Added timestamps support for Orbbec SDK backend in VideoIO.

This commit is contained in:
Alexander Smorkalov 2025-07-31 12:46:58 +03:00
parent 7ab4e1bf56
commit 8496706216
2 changed files with 26 additions and 0 deletions

View File

@ -714,6 +714,8 @@ enum VideoCaptureOBSensorProperties{
CAP_PROP_OBSENSOR_INTRINSIC_FY=26002,
CAP_PROP_OBSENSOR_INTRINSIC_CX=26003,
CAP_PROP_OBSENSOR_INTRINSIC_CY=26004,
CAP_PROP_OBSENSOR_RGB_POS_MSEC=26005,
CAP_PROP_OBSENSOR_DEPTH_POS_MSEC=26006,
};
//! @} OBSENSOR

View File

@ -83,7 +83,31 @@ double VideoCapture_obsensor::getProperty(int propIdx) const
case CAP_PROP_OBSENSOR_INTRINSIC_CY:
rst = camParam.p1[3];
break;
case CAP_PROP_POS_MSEC:
case CAP_PROP_OBSENSOR_RGB_POS_MSEC:
if (grabbedColorFrame)
{
rst = grabbedColorFrame->globalTimeStampUs();
if (rst == 0.0)
{
CV_LOG_ONCE_WARNING(NULL, "Camera reports zero global timestamp. System timestamp is used instead.");
rst = grabbedColorFrame->systemTimeStamp();
}
}
break;
case CAP_PROP_OBSENSOR_DEPTH_POS_MSEC:
if (grabbedDepthFrame)
{
rst = grabbedDepthFrame->systemTimeStamp();
if (rst == 0.0)
{
CV_LOG_ONCE_WARNING(NULL, "Camera reports zero global timestamp. System timestamp is used instead.");
rst = grabbedDepthFrame->systemTimeStamp();
}
}
break;
}
return rst;
}