c# - 如何使用 AForge 将位图白色像素替换为红色?

标签 c# .net image-processing

我知道这可以通过 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/

相关文章:

java - 在文件夹中保存图像时出现问题

python - 在 Numpy 中查找 Top10(n) RGB 颜色

c# - 每 30 秒重复一次 ping

ios - 将一些哈希码从 .net 语法转换为 objective-c

.net - 在没有 Web 服务器的情况下使用 SSL 通过 TCP/IP 套接字进行客户端/服务器通信

c# - Microsoft OLEDB 错误外部表不是预期的格式

matlab - 定向 Canny 边缘检测

c# - 愚弄 System.Diagnostics.Process WaitForExit()

c# - 等待列表中的所有任务,然后根据任务结果更新列表

c# - 如何在 C# 中调用 mySQL 存储函数?