Fixed OpenNI2 reading *.oni files

This commit is contained in:
matlabbe
2015-04-23 08:17:44 -04:00
parent 7837b04e34
commit e2d71c5999

View File

@@ -519,13 +519,21 @@ bool CameraOpenNI2::init(const std::string & calibrationFolder)
return false;
}
if(!_device->isImageRegistrationModeSupported(openni::IMAGE_REGISTRATION_DEPTH_TO_COLOR))
if(UFile::getExtension(_deviceId).compare("oni")!=0 &&
!_device->isImageRegistrationModeSupported(openni::IMAGE_REGISTRATION_DEPTH_TO_COLOR))
{
UERROR("CameraOpenNI2: Device doesn't support depth/color registration.");
_device->close();
openni::OpenNI::shutdown();
return false;
}
else if(_device->getPlaybackControl() && _device->getPlaybackControl()->setRepeatEnabled(false) != openni::STATUS_OK)
{
UERROR("CameraOpenNI2: Cannot set repeat mode to false.");
_device->close();
openni::OpenNI::shutdown();
return false;
}
if(_device->getSensorInfo(openni::SENSOR_DEPTH) == NULL ||
_device->getSensorInfo(openni::SENSOR_COLOR) == NULL)