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.
pull/3404/head
Alexander Alekhin 10 years ago
parent 4f2aeeffaa
commit 2981ee00d9
  1. 2
      modules/videoio/src/cap_openni2.cpp

@ -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) )
{

Loading…
Cancel
Save