CameraOpenNI2: Added OpenNI2 stamps/Ids option

This commit is contained in:
matlabbe
2015-10-15 16:40:49 -04:00
parent a8b5311d88
commit 835155e6ae
4 changed files with 44 additions and 9 deletions
+10 -2
View File
@@ -390,7 +390,8 @@ CameraOpenNI2::CameraOpenNI2(
#endif
_depthFx(0.0f),
_depthFy(0.0f),
_deviceId(deviceId)
_deviceId(deviceId),
_openNI2StampsAndIDsUsed(false)
{
}
@@ -715,7 +716,14 @@ SensorData CameraOpenNI2::captureImage()
float(rgb.cols/2) - 0.5f, //cx
float(rgb.rows/2) - 0.5f, //cy
this->getLocalTransform());
data = SensorData(rgb, depth, model, this->getNextSeqID(), UTimer::now());
if(_openNI2StampsAndIDsUsed)
{
data = SensorData(rgb, depth, model, depthFrame.getFrameIndex(), double(depthFrame.getTimestamp()) / 1000000.0);
}
else
{
data = SensorData(rgb, depth, model, this->getNextSeqID(), UTimer::now());
}
}
}
}