Question

That is my code

Image<Gray, Byte> image = new Image<Gray, byte>(Openfile.FileName);
pictureBox1.Image = image.ToBitmap();
image1 = image1.ThresholdBinary(new Gray(50), new Gray(255));

I open an image from my desktop and convert it to grayscale and then binary. I want to get either the values 1 or 0 from binary images in order to storage in matrix. How can I do that?? I am using emgucv.

Was it helpful?

Solution

You can do this:

Gray byCurrent = image1[x, y];

Or this :

Byte byCurrent = image1.Data[x, y, 0];

But you will have 0 or 255 values instead of 0 and 1.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top