Closed Jakvic closed 5 years ago
The cause of this issue is Bitmap PixelFormat value that is not intended for you.
Format24bppRgb
Format32bppArgb
So, the Type() of dst.ToMat()
is not 8UC3 but 8UC4, and the result of InRange is unintended.
Hi,Sorry to reply you so late,i find the solution
dst = new Bitmap(300,300,System.Drawing.Imaging.PixelFormat.Format24bppRgb);
Just change this row,it's ok; Thanks a lot ,love you so much;
Summary of your issue
Inrange method is useless for the image that use DrawImage method
Environment
win10+vs2017+opencvsharp4.0.0
Example code: