Ask Your Question
1

calcHist with GpuMat submatrix

asked 2012-09-05 17:28:14 -0600

Michael Barnes gravatar image

I get an unspecified launch error in hist.cu, line 187, from the following call.

calcHist(storage.input(xr,yr), storage.hist);

Where storage.input and storage.hist are both GpuMat objects and xr,yr are Range objects.

This crash only occurs if yr.start > 0. I have tried using a Rect, or using GpuMat(storage.input,xr,yr), as well as creating another object set to equal storage.input(xr,yr). In all cases I get the unspecified launch error if the second dimension starts with a value above 0. The first axis can have any values, as can yr.end. The matrix I am testing is 2 dimensional.

I have checked that downloading storage.input(xr,yr) gives an identical result to the original Mat object with the same Ranges.

I think I should have covered everything, but it's been a while since I've used OpenCV for much and this is my first major use of the GPU code. Is this a bug? Is it me?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2012-09-06 03:16:23 -0600

Vladislav Vinogradov gravatar image

gpu::calcHist function can't work with arbitrary submatrix, because it works only with aligned pointers. You can use any row range, but column range must be aligned (yr.start % 4 == 0).

edit flag offensive delete link more

Comments

Thankyou very much. I had missed that detail, but I can work around that limitation quite easily now I know what it is. I just need four copies of the matrix.

Michael Barnes gravatar imageMichael Barnes ( 2012-09-06 04:07:57 -0600 )edit

Question Tools

Stats

Asked: 2012-09-05 17:28:14 -0600

Seen: 906 times

Last updated: Sep 06 '12