xxorde / librekinect

Depth data from a kinect sensor! Small and fast kernel driver. Also for embedded devices like the raspberry pi!
407 stars 68 forks source link

Ubuntu 14.10 can't get depth image by using OpenCV2.4 #10

Closed lucyking closed 9 years ago

lucyking commented 9 years ago

Hi Alexander, Thank you for sparing a time to read my issue in the midst of pressing affairs.

I try use PC + OpenCV2.4 to make a demo that getting the Kinect depth image.But when running the built binary, the terminal have no output, then I try a normal webcam,everything goes well.It seems a little strange.

According to OpenCV's user guide, it says only install the PrimeSensor driver that OpenCV can grap data from Kinect. (you may search "Without PrimeSensor module OpenCV" in OpenCV User Guide to see details ). But I think that when already install the librekinect driver, the PrimeSensor driver is no needed any more.

I use this simple code in OpenCV demo : /***/ VideoCapture capture( CV_CAP_OPENNI ); for(;;) { Mat depthMap; capture >> depthMap; // I think there may be someting wrong in this phase(eg:data I/O rate)

if( waitKey( 30 ) >= 0 )
    break;

} /***/ and here's my PC && Raspberry Pi sys info:: root@bt:~# uname -a Linux bt 3.13.0-32-generic #57-Ubuntu ... i686 GNU/Linux

pi@raspberrypi ~ $ uname -a Linux raspberrypi 3.12.28 #1 PREEMPT ... armv6l GNU/Linux

if you have some advice on getting depth data from Kinect by OpenCV, please let me know :-) Many thanks. Warmest regards , Joe.

lucyking commented 9 years ago

I've get the point. the raw frame format is YUV10B , so I have to trans that first.