convertTo : Mat vs GpuMat

asked 2018-07-09 00:47:22 -0600

Phil4444 gravatar image

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);
edit retag flag offensive close merge delete