Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The constructor shall do it: std::vector< float > array(mat.data);. But if your mat is not float, but uchar 3 channels, then you should transform it: mat.convertTo(mat, CV_32F);

The constructor shall do it: std::vector< float > array(mat.data);. But if your mat is not float, but uchar 3 channels, then you should transform it: it before: mat.convertTo(mat, CV_32F);