当前位置:网站首页>Opencvsharp binary image anti color

Opencvsharp binary image anti color

2022-06-24 07:47:00 ligang2255

            Mat d = xxx  Binary image ....; 

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

版权声明
本文为[ligang2255]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206240301087657.html