Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you can use reshape for this:

img.convertTo(img, CvType.CV_32F);
Mat samples = img.reshape(1, img.total()); // 1 channel, each pixel is a row of 3 elements now