Domanda

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.

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top