开发者

How to convert GpuMat to CvMat in OpenCV?

开发者_开发百科

I know how to do the opposite i.e. get GpuMat from CvMat using upload, but I need a CvMat from GpuMat, is there any method that can be used for this?


explicit conversion: Mat -> GPUMat

Mat myMat;
GpuMat myGpuMat;
myGpuMat.upload(myMat); //Via a member function
//Or
GpuMat myGpuMat(myMat) //Via a constructor
//Use myGpuMat here...

implicit conversion: GpuMat -> Mat

GpuMat myGpuMat;
Mat myMat = myGpyMat;
//Use myMat here...

Hope it helped, Julien,


In win 7 , 64 bit, openCV 2.4

GpuMat --> Mat:

cv::gpu::GpuMat dst;
cv::Mat tran(dst);

As you can see dst is GpuMat, and tran is Mat.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜