问题
i wonder if it is possible with Emgu Cv to chnage image from BGR to binary image as i try to change the BGR to gray
Image<Bgr, byte> image_pass = new Image<Bgr, byte>(bt1);
回答1:
Yes, it is possible. Maybe give this a try:
Image<Gray, Byte> image;
image = image_pass.convert<Gray,Byte>().ThresholdBinaryInv(new Gray(x), new Gray(255));
imageBox.Image(image);
CvInvoke.cvShowImage("binary", image); //To show in a new Window
Where x
is your threshold value, and 255
the maximum value.
This would convert the pixel value to 0 if the srcImage(x,y)> threshold or to 255, otherwise.
You can, obviously, change the threshold and your max values
来源:https://stackoverflow.com/questions/26874326/change-image-from-bgr-to-binary-image-0-1