Ask Your Question

Bug with GpuMat::GpuMat(const GpuMat& m, Rect roi)

asked 2013-10-07 10:52:23 -0600

Compvis gravatar image

updated 2013-10-07 10:55:52 -0600


If you try to use this code:

Mat m = imRead("D:\\pic.jpg",1);
GpuMat gm;
GpuMat roi(gm, Rect(0,0,gm.rows-1, gm.cols-1);

An error will raises !

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2013-10-07 11:58:21 -0600

Vladislav Vinogradov gravatar image

cv::Rect has next constructor:

Rect(int x, int y, int width, int height);

Correct code (swap last two parameters):

GpuMat roi(gm, Rect(0, 0, gm.cols-1, gm.rows-1);
edit flag offensive delete link more

Question Tools


Asked: 2013-10-07 10:52:23 -0600

Seen: 2,714 times

Last updated: Oct 07 '13