libfreenect-goodies
libfreenect-goodies copied to clipboard
cv.ShowImage requires a CvArr, not a numpy array
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])))
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
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.
The turnaround works just fine. :)
Just wanted to add, having this issue with the default packages on Ubuntu 13.04, which ships opencv2.4 currently as mentioned above.