What is the best options to detect if the Kinect sensor is connected? (Feature #1237)
Description
Hi,
from the view of application development it would be very nice, if one could detect if the kinect is connect well.
Now if one tries to connect Kinect and no kinect is connected, it results in an CV_ERROR
+
if( status != XN_STATUS_OK )
CV_Error(CV_StsError, ("Failed to enumerate production trees: " + std::string(xnGetStatusString(status))).c_str() );
+
I know that i could do it over OpenNI, but it would be nice if OpenCV says (over a return value) that someting went wrong.
The other possibility would be to open an TRY/CATCH-Block.
What would you suggest to be the best of the three options for secure future application developments:
1) change OpenCV code + return value
2) OpenNI
3) try/catch block
Thank you for support,
Hagen
Associated revisions
fixed CvCapture_OpenNI constructor (removed all exceptions) (#1237)
Merge pull request #1237 from SpecLad:xls-separate-wh
History
Updated by Maria Dimashova over 13 years ago
Thanks for the report.
We removed all exceptions from CvCapture_OpenNI constructor (r6374). If some problem has been occurred while the OpenNI context initializing and generators configuring (i.e. in the constructor) then the corresponding status message is output to the std::cerr and constructor is returned. Then VideoCapture::isOpened() method will return false in such cases.
- Status changed from Open to Done
- (deleted custom field) set to fixed
Updated by Andrey Kamaev over 12 years ago
- Category changed from highgui-images to highgui-camera