Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

please NEVER abuse Mat::at for anything on the whole image.

if you wanted a 3 channel, single column Mat it would be a simple:

Mat res = img.reshape(3, img.total());

for 1 channel, and 3 colums it would be:

Mat res = img.reshape(1, img.total());

(imho, you're entirely overcomplicating this...)