Ask Your Question
0

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

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

Compvis gravatar image

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

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 -0500

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
Login/Signup to Answer

Question Tools

Stats

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

Seen: 1,474 times

Last updated: Oct 07 '13