当前位置:网站首页>opencvsharp二值图像反色

opencvsharp二值图像反色

2022-06-24 06:44:00 ligang2255

            Mat d = xxx 二值图像....; 

            for (int i = 0; i< d.Height; i++)
            {
                for (int j = 0; j< d.Width; j++)
                {
                    if(d.At<byte>(i,j) ==255)//白色
                    {
                        d.Set<byte>(i, j, 0);
                    }
                    else
                    {
                        d.Set<byte>(i, j, 255);
                    }
                }
            }
原网站

版权声明
本文为[ligang2255]所创,转载请带上原文链接,感谢
https://blog.csdn.net/ligang2255/article/details/125316607