当前位置:网站首页>Opencv 07, pixel read, change and bitmap write

Opencv 07, pixel read, change and bitmap write

2022-06-13 02:29:00 An unforgettable squirrel

Console Application , Pixel reading 、 Change and bitmap Write , I learned before .

Involving function

var pixel = src.Get<Vec3b>(y, x);
                        var newPixel = new Vec3b
                        {
                            Item0 = (byte)(255 - pixel.Item0), // B
                            Item1 = (byte)(255 - pixel.Item1), // G
                            Item2 = (byte)(255 - pixel.Item2) // R
                        };
                        dst.Set(y, x, newPixel);

using (var bitmap = dst.ToBitmap()) // => OpenCvSharp.Extensions.BitmapConverter.ToBitmap(dst)
                {
                    bitmap.Save("gray.png", ImageFormat.Png);
                }

原网站

版权声明
本文为[An unforgettable squirrel]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202280542541565.html