Ask Your Question

Revision history [back]

Can't convert cv::Mat to CV_32F in ocv 3.1

Trying to convert an image to CV_32F like so:

cv::Mat ofApp::getDescriptors(const cv::Mat& img)
{
    cv::Mat dst;
    img.convertTo(dst, CV_32F);

Gives me the following error:

OpenCV Error: The function/feature is not implemented (Unknown/unsupported array type) in create, file ../../code/opencv/opencv-3.1.0/modules/core/src/matrix.cpp, line 2559
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: ../../code/opencv/opencv-3.1.0/modules/core/src/matrix.cpp:2559: error: (-213) Unknown/unsupported array type in function create

Can someone shed some light on how to convert an image to CV_32F? The image itself is a valid cv::Mat with the following characteristics:

flags   int 1124024336
dims    int 2
rows    int 499
cols    int 381

I can draw the image without problem but can't convert it to CV_32F