我知道这可以通过 GetPixel/SetPixel
来完成,但这需要很长时间。
我现在正在尝试适应 AForge,并且想知道是否有一个过滤器可以快速完成此操作。
最佳答案
您可以使用EuclideanColorFiltering实现这一目标:
EuclideanColorFiltering filter = new EuclideanColorFiltering();
filter.CenterColor = new AForge.Imaging.RGB(Color.White); //Pure White
filter.Radius = 0; //Increase this to allow off-whites
filter.FillColor = new AForge.Imaging.RGB(Color.Red); //Replacement Colour
filter.ApplyInPlace(image);
关于c# - 如何使用 AForge 将位图白色像素替换为红色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8772357/