diff --git a/doc/tutorials/app/orbbec_uvc.markdown b/doc/tutorials/app/orbbec_uvc.markdown index 1b043f2579..214ef6afc7 100644 --- a/doc/tutorials/app/orbbec_uvc.markdown +++ b/doc/tutorials/app/orbbec_uvc.markdown @@ -123,4 +123,5 @@ This tutorial code's is shown lines below. You can also download it from ![BGR And DEPTH And DepthToColor frame](images/orbbec_uvc_cpp.jpg) ### Note -Mac users need sudo privileges to execute the code. + - Mac users need sudo privileges to execute the code. + - **Firmware**: If you’re using an Orbbec UVC 3D camera, please ensure your camera’s firmware is updated to the latest version to avoid potential compatibility issues. For more details, see [Orbbec’s Release Notes](https://github.com/orbbec/OrbbecSDK_v2/releases). diff --git a/modules/videoio/include/opencv2/videoio.hpp b/modules/videoio/include/opencv2/videoio.hpp index c323e57eb7..6b5c1b6cc4 100644 --- a/modules/videoio/include/opencv2/videoio.hpp +++ b/modules/videoio/include/opencv2/videoio.hpp @@ -128,7 +128,7 @@ enum VideoCaptureAPIs { CAP_INTEL_MFX = 2300, //!< Intel MediaSDK CAP_XINE = 2400, //!< XINE engine (Linux) CAP_UEYE = 2500, //!< uEye Camera API - CAP_OBSENSOR = 2600, //!< For Orbbec 3D-Sensor device/module (Astra+, Femto, Astra2, Gemini2, Gemini2L, Gemini2XL, Femto Mega) attention: Astra2 cameras currently only support Windows and Linux kernel versions no higher than 4.15, and higher versions of Linux kernel may have exceptions. + CAP_OBSENSOR = 2600, //!< For Orbbec 3D-Sensor device/module (Astra+, Femto, Astra2, Gemini2, Gemini2L, Gemini2XL, Gemini330, Femto Mega) attention: Astra2 cameras currently only support Windows and Linux kernel versions no higher than 4.15, and higher versions of Linux kernel may have exceptions. }; diff --git a/modules/videoio/src/cap_obsensor/obsensor_stream_channel_interface.hpp b/modules/videoio/src/cap_obsensor/obsensor_stream_channel_interface.hpp index 7337452359..878de60f21 100644 --- a/modules/videoio/src/cap_obsensor/obsensor_stream_channel_interface.hpp +++ b/modules/videoio/src/cap_obsensor/obsensor_stream_channel_interface.hpp @@ -39,6 +39,21 @@ namespace obsensor { #define OBSENSOR_FEMTO_MEGA_PID 0x0669 // pid of Orbbec Femto Mega Camera #define OBSENSOR_GEMINI2L_PID 0x0673 // pid of Orbbec Gemini 2 L Camera #define OBSENSOR_GEMINI2XL_PID 0x0671 // pid of Orbbec Gemini 2 XL Camera +#define OBSENSOR_GEMINI335_PID 0x0800 // pid of Orbbec Gemini 335 Camera +#define OBSENSOR_GEMINI330_PID 0x0801 // pid of Orbbec Gemini 330 Camera +#define OBSENSOR_GEMINI336_PID 0x0803 // pid of Orbbec Gemini 336 Camera +#define OBSENSOR_GEMINI335L_PID 0x0804 // pid of Orbbec Gemini 335L Camera +#define OBSENSOR_GEMINI330L_PID 0x0805 // pid of Orbbec Gemini 330L Camera +#define OBSENSOR_GEMINI336L_PID 0x0807 // pid of Orbbec Gemini 336L Camera + +#define IS_OBSENSOR_GEMINI330_SHORT_PID(pid) \ + ((pid) == OBSENSOR_GEMINI335_PID || (pid) == OBSENSOR_GEMINI330_PID || (pid) == OBSENSOR_GEMINI336_PID) + +#define IS_OBSENSOR_GEMINI330_LONG_PID(pid) \ + ((pid) == OBSENSOR_GEMINI335L_PID || (pid) == OBSENSOR_GEMINI330L_PID || (pid) == OBSENSOR_GEMINI336L_PID) + +#define IS_OBSENSOR_GEMINI330_PID(pid) \ + (IS_OBSENSOR_GEMINI330_SHORT_PID(pid) || IS_OBSENSOR_GEMINI330_LONG_PID(pid)) enum StreamType { diff --git a/modules/videoio/src/cap_obsensor/obsensor_stream_channel_msmf.cpp b/modules/videoio/src/cap_obsensor/obsensor_stream_channel_msmf.cpp index 5de686430f..18c6f4782d 100644 --- a/modules/videoio/src/cap_obsensor/obsensor_stream_channel_msmf.cpp +++ b/modules/videoio/src/cap_obsensor/obsensor_stream_channel_msmf.cpp @@ -228,8 +228,8 @@ MSMFStreamChannel::MSMFStreamChannel(const UvcDeviceInfo& devInfo) : }) delete[] buffer; HR_FAILED_RETURN(MFCreateDeviceSource(deviceAttrs_.Get(), &deviceSource_)); - HR_FAILED_RETURN(deviceSource_->QueryInterface(__uuidof(IAMCameraControl), reinterpret_cast(&cameraControl_))); - HR_FAILED_RETURN(deviceSource_->QueryInterface(__uuidof(IAMVideoProcAmp), reinterpret_cast(&videoProcAmp_))); + HR_FAILED_LOG(deviceSource_->QueryInterface(__uuidof(IAMCameraControl), reinterpret_cast(&cameraControl_))); + HR_FAILED_LOG(deviceSource_->QueryInterface(__uuidof(IAMVideoProcAmp), reinterpret_cast(&videoProcAmp_))); HR_FAILED_RETURN(MFCreateAttributes(&readerAttrs_, 3)); HR_FAILED_RETURN(readerAttrs_->SetUINT32(MF_SOURCE_READER_DISCONNECT_MEDIASOURCE_ON_SHUTDOWN, false)); @@ -314,7 +314,7 @@ void MSMFStreamChannel::start(const StreamProfile& profile, FrameCallback frameC currentProfile_ = profile; currentStreamIndex_ = -1; - for (uint8_t index = 0; index <= 5; index++) + for (uint8_t index = 0; index < 5; index++) { for (uint32_t k = 0;; k++) { @@ -341,6 +341,12 @@ void MSMFStreamChannel::start(const StreamProfile& profile, FrameCallback frameC fps == profile.fps && frameFourccToFormat(device_fourcc) == profile.format) { + for (uint8_t i = 0; i < 5; ++i) { + if (index == i) + continue; + + streamReader_->SetStreamSelection(i, FALSE); + } HR_FAILED_RETURN(streamReader_->SetCurrentMediaType(index, nullptr, mediaType.Get())); HR_FAILED_RETURN(streamReader_->SetStreamSelection(index, true)); streamReader_->ReadSample(index, 0, nullptr, nullptr, nullptr, nullptr); @@ -391,9 +397,9 @@ bool MSMFStreamChannel::setXu(uint8_t ctrl, const uint8_t* data, uint32_t len) } memcpy(xuSendBuf_.data(), data, len); - KSP_NODE node; + KSP_NODE node; memset(&node, 0, sizeof(KSP_NODE)); - node.Property.Set = { 0xA55751A1, 0xF3C5, 0x4A5E, {0x8D, 0x5A, 0x68, 0x54, 0xB8, 0xFA, 0x27, 0x16} }; + node.Property.Set = reinterpret_cast(xuUnit_.id); node.Property.Id = ctrl; node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY; node.NodeId = xuNodeId_; @@ -412,7 +418,7 @@ bool MSMFStreamChannel::getXu(uint8_t ctrl, uint8_t** data, uint32_t* len) } KSP_NODE node; memset(&node, 0, sizeof(KSP_NODE)); - node.Property.Set = { 0xA55751A1, 0xF3C5, 0x4A5E, {0x8D, 0x5A, 0x68, 0x54, 0xB8, 0xFA, 0x27, 0x16} }; + node.Property.Set = reinterpret_cast(xuUnit_.id); node.Property.Id = ctrl; node.Property.Flags = KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_TOPOLOGY; node.NodeId = xuNodeId_; diff --git a/modules/videoio/src/cap_obsensor/obsensor_stream_channel_v4l2.cpp b/modules/videoio/src/cap_obsensor/obsensor_stream_channel_v4l2.cpp index 96e78e160b..0764ac3ace 100644 --- a/modules/videoio/src/cap_obsensor/obsensor_stream_channel_v4l2.cpp +++ b/modules/videoio/src/cap_obsensor/obsensor_stream_channel_v4l2.cpp @@ -314,7 +314,7 @@ bool V4L2StreamChannel::setXu(uint8_t ctrl, const uint8_t* data, uint32_t len) } memcpy(xuSendBuf_.data(), data, len); struct uvc_xu_control_query xu_ctrl_query = { - .unit = XU_UNIT_ID, + .unit = xuUnit_.unit, .selector = ctrl, .query = UVC_SET_CUR, .size = (__u16)(ctrl == 1 ? 512 : (ctrl == 2 ? 64 : 1024)), @@ -333,7 +333,7 @@ bool V4L2StreamChannel::getXu(uint8_t ctrl, uint8_t** data, uint32_t* len) xuRecvBuf_.resize(XU_MAX_DATA_LENGTH); } struct uvc_xu_control_query xu_ctrl_query = { - .unit = XU_UNIT_ID, + .unit = xuUnit_.unit, .selector = ctrl, .query = UVC_GET_CUR, .size = (__u16)(ctrl == 1 ? 512 : (ctrl == 2 ? 64 : 1024)), diff --git a/modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.cpp b/modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.cpp index 76a963748b..e10948efd6 100644 --- a/modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.cpp +++ b/modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.cpp @@ -35,19 +35,23 @@ namespace cv { namespace obsensor { +const ObExtensionUnit OBSENSOR_COMMON_XU_UNIT = { XU_UNIT_ID_COMMON, { 0xA55751A1, 0xF3C5, 0x4A5E, { 0x8D, 0x5A, 0x68, 0x54, 0xB8, 0xFA, 0x27, 0x16 } } }; +const ObExtensionUnit OBSENSOR_G330_XU_UNIT = { XU_UNIT_ID_G330, { 0xC9606CCB, 0x594C, 0x4D25, { 0xaf, 0x47, 0xcc, 0xc4, 0x96, 0x43, 0x59, 0x95 } } }; + const uint8_t OB_EXT_CMD0[16] = { 0x47, 0x4d, 0x04, 0x00, 0x02, 0x00, 0x52, 0x00, 0x5B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 }; const uint8_t OB_EXT_CMD1[16] = { 0x47, 0x4d, 0x04, 0x00, 0x02, 0x00, 0x54, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; const uint8_t OB_EXT_CMD2[16] = { 0x47, 0x4d, 0x04, 0x00, 0x02, 0x00, 0x56, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 }; const uint8_t OB_EXT_CMD3[16] = { 0x47, 0x4d, 0x04, 0x00, 0x02, 0x00, 0x58, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 }; const uint8_t OB_EXT_CMD4[16] = { 0x47, 0x4d, 0x02, 0x00, 0x03, 0x00, 0x60, 0x00, 0xed, 0x03, 0x00, 0x00 }; const uint8_t OB_EXT_CMD5[16] = { 0x47, 0x4d, 0x02, 0x00, 0x03, 0x00, 0x62, 0x00, 0xe9, 0x03, 0x00, 0x00 }; -const uint8_t OB_EXT_CMD6[16] = { 0x47, 0x4d, 0x04, 0x00, 0x02, 0x00, 0x7c, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00}; +const uint8_t OB_EXT_CMD6[16] = { 0x47, 0x4d, 0x04, 0x00, 0x02, 0x00, 0x7c, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 }; const uint8_t OB_EXT_CMD7[16] = { 0x47, 0x4d, 0x04, 0x00, 0x02, 0x00, 0xfe, 0x12, 0x55, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 }; const uint8_t OB_EXT_CMD8[16] = { 0x47, 0x4d, 0x04, 0x00, 0x02, 0x00, 0xfe, 0x13, 0x3f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 }; const uint8_t OB_EXT_CMD9[16] = { 0x47, 0x4d, 0x04, 0x00, 0x02, 0x00, 0xfa, 0x13, 0x4b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 }; const uint8_t OB_EXT_CMD11[16] = { 0x47, 0x4d, 0x04, 0x00, 0x02, 0x00, 0xfe, 0x13, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; const uint8_t OB_EXT_CMD12[16] = { 0x47, 0x4d, 0x04, 0x00, 0x02, 0x00, 0xfe, 0x13, 0x3f, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 }; const uint8_t OB_EXT_CMD13[16] = { 0x47, 0x4d, 0x04, 0x00, 0x02, 0x00, 0xfa, 0x13, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +const uint8_t OB_EXT_CMD14[16] = { 0x47, 0x4d, 0x04, 0x00, 0x02, 0x00, 0xfa, 0x14, 0xd3, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 }; #if defined(HAVE_OBSENSOR_V4L2) #define fourCc2Int(a, b, c, d) \ @@ -62,6 +66,7 @@ const std::map fourccToOBFormat = { {fourCc2Int('M', 'J', 'P', 'G'), FRAME_FORMAT_MJPG}, {fourCc2Int('Y', '1', '6', ' '), FRAME_FORMAT_Y16}, {fourCc2Int('Y', '1', '4', ' '), FRAME_FORMAT_Y14}, + {fourCc2Int('Z', '1', '6', ' '), FRAME_FORMAT_Y16} }; StreamType parseUvcDeviceNameToStreamType(const std::string& devName) @@ -204,7 +209,6 @@ DepthFrameUnpacker::~DepthFrameUnpacker() { delete[] outputDataBuf_; } - #define ON_BITS(count) ((1 << count) - 1) #define CREATE_MASK(count, offset) (ON_BITS(count) << offset) #define TAKE_BITS(source, count, offset) ((source & CREATE_MASK(count, offset)) >> offset) @@ -245,6 +249,7 @@ void DepthFrameUnpacker::process(Frame *frame){ IUvcStreamChannel::IUvcStreamChannel(const UvcDeviceInfo& devInfo) : devInfo_(devInfo), + xuUnit_(IS_OBSENSOR_GEMINI330_PID(devInfo.pid) ? OBSENSOR_G330_XU_UNIT : OBSENSOR_COMMON_XU_UNIT), streamType_(parseUvcDeviceNameToStreamType(devInfo_.name)) { @@ -286,6 +291,11 @@ bool IUvcStreamChannel::setProperty(int propId, const uint8_t* /*data*/, uint32_ rst &= getXu(2, &rcvData, &rcvLen); rst &= setXu(2, OB_EXT_CMD6, sizeof(OB_EXT_CMD6)); rst &= getXu(2, &rcvData, &rcvLen); + }else if(IS_OBSENSOR_GEMINI330_PID(devInfo_.pid)) { + rst &= setXu(2, OB_EXT_CMD6, sizeof(OB_EXT_CMD6)); + rst &= getXu(2, &rcvData, &rcvLen); + rst &= setXu(2, OB_EXT_CMD14, sizeof(OB_EXT_CMD14)); + rst &= getXu(2, &rcvData, &rcvLen); }else{ rst &= setXu(2, OB_EXT_CMD0, sizeof(OB_EXT_CMD0)); rst &= getXu(2, &rcvData, &rcvLen); @@ -400,6 +410,42 @@ bool IUvcStreamChannel::getProperty(int propId, uint8_t* recvData, uint32_t* rec *recvDataSize = sizeof(CameraParam); memcpy(recvData, ¶m, *recvDataSize); } + else if(IS_OBSENSOR_GEMINI330_SHORT_PID(devInfo_.pid)){ + // return default param + CameraParam param; + param.p0[0] = 460.656f; + param.p0[1] = 460.782f; + param.p0[2] = 320.985f; + param.p0[3] = 233.921f; + param.p1[0] = 460.656f; + param.p1[1] = 460.782f; + param.p1[2] = 320.985f; + param.p1[3] = 233.921f; + param.p6[0] = 640; + param.p6[1] = 480; + param.p7[0] = 640; + param.p7[1] = 480; + *recvDataSize = sizeof(CameraParam); + memcpy(recvData, ¶m, *recvDataSize); + } + else if(IS_OBSENSOR_GEMINI330_LONG_PID(devInfo_.pid)){ + // return default param + CameraParam param; + param.p0[0] = 366.751f; + param.p0[1] = 365.782f; + param.p0[2] = 319.893f; + param.p0[3] = 243.415f; + param.p1[0] = 366.751f; + param.p1[1] = 365.782f; + param.p1[2] = 319.893f; + param.p1[3] = 243.415f; + param.p6[0] = 640; + param.p6[1] = 480; + param.p7[0] = 640; + param.p7[1] = 480; + *recvDataSize = sizeof(CameraParam); + memcpy(recvData, ¶m, *recvDataSize); + } else{ rst &= setXu(2, OB_EXT_CMD5, sizeof(OB_EXT_CMD5)); rst &= getXu(2, &rcvData, &rcvLen); @@ -453,7 +499,15 @@ bool IUvcStreamChannel::initDepthFrameProcessor() setXu(2, OB_EXT_CMD13, sizeof(OB_EXT_CMD13)); getXu(2, &rcvData, &rcvLen); + return true; + } + else if(IS_OBSENSOR_GEMINI330_PID(devInfo_.pid)) + { + uint8_t* rcvData; + uint32_t rcvLen; + setXu(2, OB_EXT_CMD7, sizeof(OB_EXT_CMD7)); + getXu(2, &rcvData, &rcvLen); return true; } else if(streamType_ == OBSENSOR_STREAM_DEPTH && setXu(2, OB_EXT_CMD4, sizeof(OB_EXT_CMD4))) diff --git a/modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.hpp b/modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.hpp index caff38efea..d967f928d8 100644 --- a/modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.hpp +++ b/modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.hpp @@ -27,7 +27,8 @@ namespace cv { namespace obsensor { #define XU_MAX_DATA_LENGTH 1024 -#define XU_UNIT_ID 4 +#define XU_UNIT_ID_COMMON 4 +#define XU_UNIT_ID_G330 3 struct UvcDeviceInfo { @@ -46,6 +47,16 @@ enum StreamState STREAM_STARTED = 2, STREAM_STOPPING = 3, }; +struct Guid { + uint32_t data1; + uint16_t data2, data3; + uint8_t data4[8]; +}; + +struct ObExtensionUnit { + uint8_t unit; + Guid id; +}; StreamType parseUvcDeviceNameToStreamType(const std::string& devName); FrameFormat frameFourccToFormat(uint32_t fourcc); @@ -104,6 +115,7 @@ protected: protected: const UvcDeviceInfo devInfo_; + const ObExtensionUnit xuUnit_; StreamType streamType_; Ptr depthFrameProcessor_; }; diff --git a/modules/videoio/src/cap_obsensor_capture.cpp b/modules/videoio/src/cap_obsensor_capture.cpp index 4c64faee11..10e457f7fd 100644 --- a/modules/videoio/src/cap_obsensor_capture.cpp +++ b/modules/videoio/src/cap_obsensor_capture.cpp @@ -34,16 +34,16 @@ Ptr create_obsensor_capture(int index) VideoCapture_obsensor::VideoCapture_obsensor(int index) : isOpened_(false) { static const obsensor::StreamProfile colorProfile = { 640, 480, 30, obsensor::FRAME_FORMAT_MJPG }; - static const obsensor::StreamProfile depthProfile = {640, 480, 30, obsensor::FRAME_FORMAT_Y16}; - static const obsensor::StreamProfile gemini2DepthProfile = {1280, 800, 30, obsensor::FRAME_FORMAT_Y16}; - static const obsensor::StreamProfile astra2ColorProfile = {800, 600, 30, obsensor::FRAME_FORMAT_MJPG}; - static const obsensor::StreamProfile astra2DepthProfile = {800, 600, 30, obsensor::FRAME_FORMAT_Y14}; - static const obsensor::StreamProfile megaColorProfile = {1280, 720, 30, obsensor::FRAME_FORMAT_MJPG}; - static const obsensor::StreamProfile megaDepthProfile = {640, 576, 30, obsensor::FRAME_FORMAT_Y16}; - static const obsensor::StreamProfile gemini2lColorProfile = { 1280, 720, 30, obsensor::FRAME_FORMAT_MJPG}; - static const obsensor::StreamProfile gemini2lDepthProfile = {1280, 800, 30, obsensor::FRAME_FORMAT_Y16}; - static const obsensor::StreamProfile gemini2XlColorProfile = { 1280, 800, 10, obsensor::FRAME_FORMAT_MJPG}; - static const obsensor::StreamProfile gemini2XlDepthProfile = {1280, 800, 10, obsensor::FRAME_FORMAT_Y16}; + static const obsensor::StreamProfile depthProfile = { 640, 480, 30, obsensor::FRAME_FORMAT_Y16 }; + static const obsensor::StreamProfile gemini2DepthProfile = { 1280, 800, 30, obsensor::FRAME_FORMAT_Y16 }; + static const obsensor::StreamProfile astra2ColorProfile = { 800, 600, 30, obsensor::FRAME_FORMAT_MJPG }; + static const obsensor::StreamProfile astra2DepthProfile = { 800, 600, 30, obsensor::FRAME_FORMAT_Y14 }; + static const obsensor::StreamProfile megaColorProfile = { 1280, 720, 30, obsensor::FRAME_FORMAT_MJPG }; + static const obsensor::StreamProfile megaDepthProfile = { 640, 576, 30, obsensor::FRAME_FORMAT_Y16 }; + static const obsensor::StreamProfile gemini2lColorProfile = { 1280, 720, 30, obsensor::FRAME_FORMAT_MJPG }; + static const obsensor::StreamProfile gemini2lDepthProfile = { 1280, 800, 30, obsensor::FRAME_FORMAT_Y16 }; + static const obsensor::StreamProfile gemini2XlColorProfile = { 1280, 800, 10, obsensor::FRAME_FORMAT_MJPG }; + static const obsensor::StreamProfile gemini2XlDepthProfile = { 1280, 800, 10, obsensor::FRAME_FORMAT_Y16 }; streamChannelGroup_ = obsensor::getStreamChannelGroup(index); if (!streamChannelGroup_.empty()) @@ -80,11 +80,9 @@ VideoCapture_obsensor::VideoCapture_obsensor(int index) : isOpened_(false) obsensor::StreamProfile profile = depthProfile; if(OBSENSOR_GEMINI2_PID == channel->getPid()){ profile = gemini2DepthProfile; - } - else if(OBSENSOR_ASTRA2_PID == channel->getPid()){ + }else if(OBSENSOR_ASTRA2_PID == channel->getPid()){ profile = astra2DepthProfile; - } - else if(OBSENSOR_FEMTO_MEGA_PID == channel->getPid()){ + }else if(OBSENSOR_FEMTO_MEGA_PID == channel->getPid()){ profile = megaDepthProfile; }else if(OBSENSOR_GEMINI2L_PID == channel->getPid()){ profile = gemini2lDepthProfile; @@ -164,6 +162,11 @@ bool VideoCapture_obsensor::retrieveFrame(int outputType, OutputArray frame) grabbedDepthFrame_(rect).copyTo(frame); }else if(OBSENSOR_GEMINI2XL_PID == streamChannelGroup_.front()->getPid()){ grabbedDepthFrame_.copyTo(frame); + }else if(IS_OBSENSOR_GEMINI330_PID(streamChannelGroup_.front()->getPid())){ + const double DepthValueScaleG300 = 1.0; + grabbedDepthFrame_ = grabbedDepthFrame_*DepthValueScaleG300; + Rect rect(0, 0, 640, 480); + grabbedDepthFrame_(rect).copyTo(frame); }else{ grabbedDepthFrame_.copyTo(frame); }