Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenCV
opencv
提交
325fe7e6
O
opencv
项目概览
OpenCV
/
opencv
上一次同步 8 个月
通知
982
Star
71100
Fork
55581
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
325fe7e6
编写于
2月 11, 2023
作者:
H
hzcyf
提交者:
yufeng
2月 11, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add support for Orbbec Femto Mega RGB-D camera
上级
606c8034
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
40 addition
and
7 deletion
+40
-7
modules/videoio/src/cap_obsensor/obsensor_stream_channel_interface.hpp
...io/src/cap_obsensor/obsensor_stream_channel_interface.hpp
+1
-0
modules/videoio/src/cap_obsensor/obsensor_stream_channel_msmf.cpp
...videoio/src/cap_obsensor/obsensor_stream_channel_msmf.cpp
+1
-1
modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.cpp
.../videoio/src/cap_obsensor/obsensor_uvc_stream_channel.cpp
+18
-0
modules/videoio/src/cap_obsensor_capture.cpp
modules/videoio/src/cap_obsensor_capture.cpp
+20
-6
未找到文件。
modules/videoio/src/cap_obsensor/obsensor_stream_channel_interface.hpp
浏览文件 @
325fe7e6
...
...
@@ -36,6 +36,7 @@ namespace obsensor {
#define OBSENSOR_CAM_VID 0x2bc5 // usb vid
#define OBSENSOR_ASTRA2_PID 0x0660 // pid of Orbbec Astra 2 Camera
#define OBSENSOR_GEMINI2_PID 0x0670 // pid of Orbbec Gemini 2 Camera
#define OBSENSOR_FEMTO_MEGA_PID 0x0669 // pid of Orbbec Femto Mega Camera
enum
StreamType
{
...
...
modules/videoio/src/cap_obsensor/obsensor_stream_channel_msmf.cpp
浏览文件 @
325fe7e6
...
...
@@ -499,7 +499,7 @@ STDMETHODIMP MSMFStreamChannel::OnEvent(DWORD /*sidx*/, IMFMediaEvent* /*event*/
STDMETHODIMP
MSMFStreamChannel
::
OnFlush
(
DWORD
)
{
if
(
streamState_
==
STREAM_STARTING
)
if
(
streamState_
!=
STREAM_STOPED
)
{
std
::
unique_lock
<
std
::
mutex
>
lock
(
streamStateMutex_
);
streamState_
=
STREAM_STOPED
;
...
...
modules/videoio/src/cap_obsensor/obsensor_uvc_stream_channel.cpp
浏览文件 @
325fe7e6
...
...
@@ -338,6 +338,24 @@ bool IUvcStreamChannel::getProperty(int propId, uint8_t* recvData, uint32_t* rec
*
recvDataSize
=
sizeof
(
CameraParam
);
memcpy
(
recvData
,
&
param
,
*
recvDataSize
);
}
else
if
(
OBSENSOR_FEMTO_MEGA_PID
==
devInfo_
.
pid
){
// return default param
CameraParam
param
;
param
.
p0
[
0
]
=
748.370
f
;
param
.
p0
[
1
]
=
748.296
f
;
param
.
p0
[
2
]
=
634.670
f
;
param
.
p0
[
3
]
=
341.196
f
;
param
.
p1
[
0
]
=
374.185
f
;
param
.
p1
[
1
]
=
374.148
f
;
param
.
p1
[
2
]
=
317.335
f
;
param
.
p1
[
3
]
=
170.598
f
;
param
.
p6
[
0
]
=
1280
;
param
.
p6
[
1
]
=
720
;
param
.
p7
[
0
]
=
640
;
param
.
p7
[
1
]
=
360
;
*
recvDataSize
=
sizeof
(
CameraParam
);
memcpy
(
recvData
,
&
param
,
*
recvDataSize
);
}
else
{
rst
&=
setXu
(
2
,
OB_EXT_CMD5
,
sizeof
(
OB_EXT_CMD5
));
rst
&=
getXu
(
2
,
&
rcvData
,
&
rcvLen
);
...
...
modules/videoio/src/cap_obsensor_capture.cpp
浏览文件 @
325fe7e6
...
...
@@ -34,8 +34,10 @@ 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_Y14
};
static
const
obsensor
::
StreamProfile
astra2depthProfile
=
{
640
,
480
,
30
,
obsensor
::
FRAME_FORMAT_Y14
};
static
const
obsensor
::
StreamProfile
gemini2DepthProfile
=
{
1280
,
800
,
30
,
obsensor
::
FRAME_FORMAT_Y14
};
static
const
obsensor
::
StreamProfile
astra2DepthProfile
=
{
640
,
480
,
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
};
streamChannelGroup_
=
obsensor
::
getStreamChannelGroup
(
index
);
if
(
!
streamChannelGroup_
.
empty
())
...
...
@@ -46,11 +48,17 @@ VideoCapture_obsensor::VideoCapture_obsensor(int index) : isOpened_(false)
switch
(
streamType
)
{
case
obsensor
::
OBSENSOR_STREAM_COLOR
:
channel
->
start
(
colorProfile
,
[
&
](
obsensor
::
Frame
*
frame
)
{
{
auto
profile
=
colorProfile
;
if
(
OBSENSOR_FEMTO_MEGA_PID
==
channel
->
getPid
()){
profile
=
megaColorProfile
;
}
channel
->
start
(
profile
,
[
&
](
obsensor
::
Frame
*
frame
)
{
std
::
unique_lock
<
std
::
mutex
>
lk
(
frameMutex_
);
colorFrame_
=
Mat
(
1
,
frame
->
dataSize
,
CV_8UC1
,
frame
->
data
).
clone
();
frameCv_
.
notify_all
();
});
}
break
;
case
obsensor
::
OBSENSOR_STREAM_DEPTH
:
{
...
...
@@ -59,11 +67,13 @@ VideoCapture_obsensor::VideoCapture_obsensor(int index) : isOpened_(false)
obsensor
::
StreamProfile
profile
=
depthProfile
;
if
(
OBSENSOR_GEMINI2_PID
==
channel
->
getPid
()){
profile
=
gemini2
d
epthProfile
;
profile
=
gemini2
D
epthProfile
;
}
else
if
(
OBSENSOR_ASTRA2_PID
==
channel
->
getPid
()){
profile
=
astra2depthProfile
;
profile
=
astra2DepthProfile
;
}
else
if
(
OBSENSOR_FEMTO_MEGA_PID
==
channel
->
getPid
()){
profile
=
megaDepthProfile
;
}
channel
->
start
(
profile
,
[
&
](
obsensor
::
Frame
*
frame
)
{
...
...
@@ -127,6 +137,10 @@ bool VideoCapture_obsensor::retrieveFrame(int outputType, OutputArray frame)
grabbedDepthFrame_
=
grabbedDepthFrame_
*
0.8
;
grabbedDepthFrame_
.
copyTo
(
frame
);
}
else
if
(
OBSENSOR_FEMTO_MEGA_PID
==
streamChannelGroup_
.
front
()
->
getPid
()){
Rect
rect
(
0
,
0
,
640
,
360
);
grabbedDepthFrame_
(
rect
).
copyTo
(
frame
);
}
else
{
grabbedDepthFrame_
.
copyTo
(
frame
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录