Ask Your Question

Revision history [back]

OpenCv with Cuda on Carma board

I have completed compiling opencv for Carma board with Cuda enable.

However when I tried to run a simple code, i always got segmentation errors. But if i just commented out gpu functions, the program run well.

Do you have any ideas about this issue?? Thanks Below is my sample code:

int main (int argc, char* argv[])

{ try { gpu::getCudaEnabledDeviceCount(); Mat src_host = imread("sample.bmp", IMREAD_GRAYSCALE); gpu::GpuMat src,dst;

    src.upload(src_host);

    //gpu::transpose(src,dst);
    //gpu::Canny(src,dst,100,100,3,false);
    //gpu::cvtColor(src, dst, CV_YUV2RGB);

    gpu::blur(src,dst,Size(3,3));
    //gpu::cvtColor(src,dst,CV_BGR2GRAY);

    Mat result_host(src);
    imwrite("output.bmp",result_host);
    waitKey();
}
catch(const cv::Exception& ex)
{
    cout <<"Exception happened\n";
    system("pause");
}

return 0;

}