Ask Your Question
0

Gpu sample program error

asked 2012-11-22 14:37:44 -0600

Hi! I installed openCV in my computer and I am trying to work on computer vision with openCV using CUDA. I have downloaded openCV 2.4.3 which is compatible with NVidia SDK 4.2 and I am doing the programming in microsoft visual studion 2008. I have tried one sample program of displaying an image which runs well and I can see the image. However when I am trying to run the sample program given in this website I am getting an error like

error C2440: 'initializing' : cannot convert from 'cv::gpu::GpuMat' to 'cv::Mat'

what is this error about and how can I get rid of it? Thanks for all your cooperation.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2012-11-22 23:58:38 -0600

Vladislav Vinogradov gravatar image

There is no implicit conversion from GpuMat to Mat. Use upload/download methods, or explicit constructors:

cv::Mat host_mat = imread("pic.png");
cv::gpu::GpuMat gpu_mat(host_mat);
cv::gpu::GpuMat gpu_edges;
cv::gpu::Canny(gpu_mat, gpu_edges, 50, 100);
cv::Mat host_edges;
gpu_edges.download(host_edges);
edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-11-22 14:37:44 -0600

Seen: 1,593 times

Last updated: Nov 22 '12