Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

convertTo : Mat vs GpuMat

Can anyone tell me why the second 'convertTo' of this code crashes with a illegal memory access? Thanks. (OpenCv 3.4.0)

    const int width = 100;
    const int height = 200;

    float incoming[width * height];

    cv::Mat outMat;
    cv::Mat inMat(Size(frame_width, frame_height), CV_32F, incoming);
    inMat.convertTo(outMat, CV_32F, 2.0);

    cuda::GpuMat outGpuMat;
    cuda::GpuMat inGpuMat(Size(frame_width, frame_height), CV_32F, incoming);
    inGpuMat.convertTo(outGpuMat, CV_32F, 2.0);