diff --git a/modules/videoio/src/cap_openni2.cpp b/modules/videoio/src/cap_openni2.cpp index ca897ae42d..ff18ed4b56 100644 --- a/modules/videoio/src/cap_openni2.cpp +++ b/modules/videoio/src/cap_openni2.cpp @@ -567,13 +567,13 @@ bool CvCapture_OpenNI2::setDepthGeneratorProperty( int propIdx, double propValue { case CV_CAP_PROP_OPENNI_REGISTRATION: { - if( propValue < 1.0 ) // "on" + if( propValue != 0.0 ) // "on" { // if there isn't image generator (i.e. ASUS XtionPro doesn't have it) // then the property isn't avaliable if ( color.isValid() ) { - openni::ImageRegistrationMode mode = propValue < 1.0 ? openni::IMAGE_REGISTRATION_DEPTH_TO_COLOR : openni::IMAGE_REGISTRATION_OFF; + openni::ImageRegistrationMode mode = propValue != 0.0 ? openni::IMAGE_REGISTRATION_DEPTH_TO_COLOR : openni::IMAGE_REGISTRATION_OFF; if( !device.getImageRegistrationMode() == mode ) { if (device.isImageRegistrationModeSupported(mode))