Ask Your Question
0

GpuMat submatrix out of GpuMat object?

asked Jul 1 '12

Anton 7 gravatar image

Since accessing pixels in GpuMat object is not possible, is it possible to create GpuMat sub matrix out of main GpuMat matrix with defined range or ROI and how? Transferring GpuMat to Mat and then again to GpuMat is not an option, since memory transfers will actually slow down my program. Thanks in advance.

Preview: (hide)

1 answer

Sort by » oldest newest most voted
2

answered Jul 2 '12

Andrey Pavlenko gravatar image

updated Jul 2 '12

You can create a sub-mat of a GpuMat with a call to

cv::gpu::GpuMat::GpuMat(const GpuMat& m, Rect roi)

but to access its pixels you'll still have to download it to a Mat.

Preview: (hide)

Question Tools

Stats

Asked: Jul 1 '12

Seen: 1,897 times

Last updated: Jul 02 '12