What is the best options to detect if the Kinect sensor is connected? (Feature #1237)


Added by Hagen Borstell over 13 years ago. Updated over 12 years ago.


Status:Done Start date:
Priority:Normal Due date:
Assignee:Maria Dimashova % Done:

0%

Category:highgui-camera
Target version:-
Difficulty: Pull request:

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

Revision 1f07209f
Added by Maria Dimashova over 13 years ago

fixed CvCapture_OpenNI constructor (removed all exceptions) (#1237)

Revision 92c823f8
Added by Roman Donchenko over 11 years ago

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

Also available in: Atom PDF