Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

something like:

Mat m = ...
byte pixels[] = new byte[m.total() * m.elemSize()];
m.get(0,0, pixels);
// do your operation
m.put(0,0, pixels);

something like:

Mat m = ...
byte pixels[] = new byte[m.total() * m.elemSize()];
m.get(0,0, pixels);
pixels); // copy to array
// do your operation
m.put(0,0, pixels);
pixels); // copy to mat

something like:

Mat m = ...
byte pixels[] = new byte[m.total() * m.elemSize()];
m.channels()];
m.get(0,0, pixels); // copy to array
// do your operation
m.put(0,0, pixels); // copy to mat