Ask Your Question
0

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

Hi,

If you try to use this code:

Mat m = imRead("D:\\pic.jpg",1);
GpuMat gm;
gm.upload(m);
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
3

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

Stats

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

Seen: 3,003 times

Last updated: Oct 07 '13