libfreenect-goodies icon indicating copy to clipboard operation
libfreenect-goodies copied to clipboard

cv.ShowImage requires a CvArr, not a numpy array

Open bartdegoede opened this issue 14 years ago • 4 comments

I tried to run demo_freenect.py, but it crashes as ShowImage (line 17) requires a CvArr, and not a numpy array as input.

An easy solution would be to change line 17 to: cv.ShowImage('both', cv.fromarray(np.array(da[::2,::2,::-1])))

bartdegoede avatar Oct 04 '11 20:10 bartdegoede

You must have an older version of opencv, since about 2.0 I think, showimage supports a numpy array directly.

Could you clarify the version of opencv you are using?

Either way theres nothing wrong with using your workaround, for earlier opencv versions.

On Oct 4, 2011, at 4:33 PM, [email protected] wrote:

I tried to run demo_freenect.py, but it crashes as ShowImage (line 17) requires a CvArr, and not a numpy array as input.

An easy solution would be to change line 17 to:

cv.ShowImage('both', cv.fromarray(np.array(da[::2,::2,::-1])))

Reply to this email directly or view it on GitHub: https://github.com/amiller/libfreenect-goodies/issues/5

amiller avatar Oct 05 '11 00:10 amiller

I've got this same error with OpenCV 2.4. More specifically, I have installed the ubuntu packages python-opencv2.4, libopencv-core2.4 etc.

dancek avatar Jul 05 '12 10:07 dancek

The turnaround works just fine. :)

manojm321 avatar Aug 02 '12 09:08 manojm321

Just wanted to add, having this issue with the default packages on Ubuntu 13.04, which ships opencv2.4 currently as mentioned above.

jordanrinke avatar Jun 28 '13 08:06 jordanrinke