Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Get values of a Mat object

Hi guys,

I'm pretty stuck right now. My goal is the following one: JavaFX Image -> Mat -> byte values So I already made it to convert the image to a openCV mat, but I'm confused about the getter and setter methods of the Mat object. I mean, at a specific row and column, let' say X=30 and Y=20, I would get a array back, in all cases, for one value? Like this:

double[] arr = mat.get(j, i);

Why should I even consider to do this? And what's the point behind the getter method "mat.get(int col, int row, byte[] array)? I mean, what's that byte doing there?

Anyways, I want to manipulate specific mat values and I need a byte representation of each value. How would you do this?

I appreciate any help :)

click to hide/show revision 2
retagged

updated 2017-02-24 14:06:23 -0600

berak gravatar image

Get values of a Mat object

Hi guys,

I'm pretty stuck right now. My goal is the following one: JavaFX Image -> Mat -> byte values So I already made it to convert the image to a openCV mat, but I'm confused about the getter and setter methods of the Mat object. I mean, at a specific row and column, let' say X=30 and Y=20, I would get a array back, in all cases, for one value? Like this:

double[] arr = mat.get(j, i);

Why should I even consider to do this? And what's the point behind the getter method "mat.get(int col, int row, byte[] array)? I mean, what's that byte doing there?

Anyways, I want to manipulate specific mat values and I need a byte representation of each value. How would you do this?

I appreciate any help :)