Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

what is your labelsArray ? (if it is an int[] or similar, you cannot simpy change the type flag)

what is your labelsArray ? (if it is an int[] or similar, you cannot simpy change the type flag)

maybe you need 2 steps:

cv::Mat labelsMat(labels.size(), 1, CV_32S, labelsArray); // assuming, labelsArray is int[]
labelsMat.convertTo(labelsMat, CV_32F); // proper float Mat now.

what is your labelsArray ? (if it is an int[] or similar, you cannot simpy change the type flag)

maybe i think, you need 2 steps:

cv::Mat labelsMat(labels.size(), 1, CV_32S, labelsArray); // assuming, labelsArray is int[]
labelsMat.convertTo(labelsMat, CV_32F); // proper float Mat now.