Issues converting colorspace using gpu::CvtColor

asked 2014-12-29 12:53:42 -0600

antz24 gravatar image

updated 2014-12-29 14:25:41 -0600

berak gravatar image

I have recently tried offloading my image processing code to the GPU but i am not getting the same image transformation output as the CPU code. The issue seems to be occurring when I try converting to a different color space. The code works great in the CPU code but when i try using the GPU module the image becomes fuzzy and distorted and 1/2 of the image is white Has anyone had issues with this call? I am running visual studio 2010 with opencv 2.4.9 and CUDA 6.5. Below is the code:

Mat m_MatSrc;             // From file
Mat m_MatDst;            // After copy or resize
cv::gpu::GpuMat dst, src;

capture.read(m_MatSrc);

src.upload(m_MatSrc);  

//resize(m_MatSrc, m_MatDst, cv::Size(dst_width, dst_height), 0, 0, 1);
gpu::resize(src, dst, cv::Size(dst_width, dst_height), 0, 0, 1);

//cv::cvtColor(m_MatDst, m_MatDst, CV_RGB2RGBA, 4);  
gpu::cvtColor(dst, dst, CV_RGB2RGBA, 4);

dst.download(m_MatDst);

cv::imshow("Image2",m_MatDst);   //Diagnostic View port
cvWaitKey(1);
edit retag flag offensive close merge delete