Commit f7792667 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #4186 from ultrafro:fix_setDepthGeneratorProperty_registration_flag_polarity

parents 6116a2fc ed574171
...@@ -567,13 +567,13 @@ bool CvCapture_OpenNI2::setDepthGeneratorProperty( int propIdx, double propValue ...@@ -567,13 +567,13 @@ bool CvCapture_OpenNI2::setDepthGeneratorProperty( int propIdx, double propValue
{ {
case CV_CAP_PROP_OPENNI_REGISTRATION: 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) // if there isn't image generator (i.e. ASUS XtionPro doesn't have it)
// then the property isn't avaliable // then the property isn't avaliable
if ( color.isValid() ) 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.getImageRegistrationMode() == mode )
{ {
if (device.isImageRegistrationModeSupported(mode)) if (device.isImageRegistrationModeSupported(mode))
......
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