Commit 2981ee00 authored by Alexander Alekhin's avatar Alexander Alekhin

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.
parent 4f2aeeff
......@@ -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) )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment