Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

videoio: add Orbbec Gemini 330 camera support#27230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
asmorkalov merged 10 commits intoopencv:4.xfromsirudoi:4.x
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
10 commits
Select commitHold shift + click to select a range
1b24e5d
obsensor: add Orbbec Gemini330 camera support
sirudoiApr 14, 2025
2ef9880
obsensor: pull OrbbecSDK v2 during build and update API calls
sirudoiApr 14, 2025
49a1437
obsensor: fix compiler warnings
sirudoiApr 16, 2025
9ce46bf
obsensor: replace OrbbecSDK Git clone with archive download
sirudoiApr 17, 2025
c45874c
obsensor: add firmware reminder to Note section
sirudoiApr 21, 2025
e9a444f
obsensor: revert OrbbecSDK invocation code on macOS
sirudoiApr 21, 2025
e145f1f
obsensor: fix API usage to v1 version
sirudoiApr 21, 2025
2f1eccf
obsensor: revert all API calls back to the v1 SDK.
sirudoiApr 22, 2025
9edb7d6
obsensor: move ObExtensionUnit definitions from header to source file
sirudoiApr 22, 2025
bf3f4e3
obsensor: modify the stream-start resolution configuration to remove …
sirudoiApr 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletiondoc/tutorials/app/orbbec_uvc.markdown
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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).
2 changes: 1 addition & 1 deletionmodules/videoio/include/opencv2/videoio.hpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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.
};


Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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
{
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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<void**>(&cameraControl_)));
HR_FAILED_RETURN(deviceSource_->QueryInterface(__uuidof(IAMVideoProcAmp), reinterpret_cast<void**>(&videoProcAmp_)));
HR_FAILED_LOG(deviceSource_->QueryInterface(__uuidof(IAMCameraControl), reinterpret_cast<void**>(&cameraControl_)));
HR_FAILED_LOG(deviceSource_->QueryInterface(__uuidof(IAMVideoProcAmp), reinterpret_cast<void**>(&videoProcAmp_)));

HR_FAILED_RETURN(MFCreateAttributes(&readerAttrs_, 3));
HR_FAILED_RETURN(readerAttrs_->SetUINT32(MF_SOURCE_READER_DISCONNECT_MEDIASOURCE_ON_SHUTDOWN, false));
Expand DownExpand Up@@ -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++)
{
Expand All@@ -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);
Expand DownExpand Up@@ -391,9 +397,9 @@ bool MSMFStreamChannel::setXu(uint8_t ctrl, const uint8_t* data, uint32_t len)
}
memcpy(xuSendBuf_.data(), data, len);

KSP_NODEnode;
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<const GUID &>(xuUnit_.id);
node.Property.Id = ctrl;
node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY;
node.NodeId = xuNodeId_;
Expand All@@ -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<const GUID&>(xuUnit_.id);
node.Property.Id = ctrl;
node.Property.Flags = KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_TOPOLOGY;
node.NodeId = xuNodeId_;
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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)),
Expand All@@ -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)),
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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) \
Expand All@@ -62,6 +66,7 @@ const std::map<uint32_t, FrameFormat> 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)
Expand DownExpand Up@@ -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)
Expand DownExpand Up@@ -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))
{

Expand DownExpand Up@@ -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);
Expand DownExpand Up@@ -400,6 +410,42 @@ bool IUvcStreamChannel::getProperty(int propId, uint8_t* recvData, uint32_t* rec
*recvDataSize = sizeof(CameraParam);
memcpy(recvData, &param, *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, &param, *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, &param, *recvDataSize);
}
else{
rst &= setXu(2, OB_EXT_CMD5, sizeof(OB_EXT_CMD5));
rst &= getXu(2, &rcvData, &rcvLen);
Expand DownExpand Up@@ -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)))
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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
{
Expand All@@ -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);
Expand DownExpand Up@@ -104,6 +115,7 @@ class IUvcStreamChannel : public IStreamChannel {

protected:
const UvcDeviceInfo devInfo_;
const ObExtensionUnit xuUnit_;
StreamType streamType_;
Ptr<IFrameProcessor> depthFrameProcessor_;
};
Expand Down
31 changes: 17 additions & 14 deletionsmodules/videoio/src/cap_obsensor_capture.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,16 +34,16 @@ Ptr<IVideoCapture> 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())
Expand DownExpand Up@@ -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;
Expand DownExpand Up@@ -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);
}
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp