OpenNI2: prevent failure of setVideoMode() call with invalid parameters

Not all parameters are specified for openni::VideoMode, so
"selected" mode can be unsupported for device.
Replace default VideoMode constructor to result of getVideoMode() call.
This commit is contained in:
Alexander Alekhin 2014-11-08 02:21:59 +03:00
parent 4f2aeeffaa
commit 2981ee00d9

View File

@ -646,7 +646,7 @@ bool CvCapture_OpenNI2::setImageGeneratorProperty(int propIdx, double propValue)
{
case CV_CAP_PROP_OPENNI_OUTPUT_MODE :
{
openni::VideoMode mode;
openni::VideoMode mode = color.getVideoMode();
switch( cvRound(propValue) )
{