Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In the first code part: Who is J?

In the second: matimg.data is a pointer (uchar*), so you always put in temp the value linked to the first element in the Mat. You shall use something like (I did not test it):

temp2 = (matimg.data + i2 * matimg.step)[j2  * matimg.elemSize() + k2 ];

or:

temp2 = matimg.ptr(i2)[j2 + k2];

Anyway, the code does not seems to be the same...