Access a specific element inside a Mat matrix using openCV

167 views Asked by At

I'm working on the java opencv and implementing a eigen face recogniser by converting matlab code. One of the things that is really confounding me, is how to access elements inside the mat. For example I have this mat -

Mat tempImage = Imgcodecs.imread("C:\\Fraps\\ImageSet\\img.bmp");

Now say I want to access the second column of this matrix. When I try,

tempImage.get(1,2);

I get header meta data instead of the actual elements. If I try -

tempImage.col(1);

Instead of accessing the second column, I again get a whole bunch of header info again. Can anyone please tell me where I am going wrong?

0

There are 0 answers