Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
f7f1fb2b
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f7f1fb2b
编写于
8月 09, 2012
作者:
V
Vladislav Vinogradov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added tests for VIBE_GPU and GMG_GPU
上级
da38a95d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
98 addition
and
7 deletion
+98
-7
modules/gpu/test/test_video.cpp
modules/gpu/test/test_video.cpp
+98
-7
未找到文件。
modules/gpu/test/test_video.cpp
浏览文件 @
f7f1fb2b
...
...
@@ -624,6 +624,9 @@ TEST_P(MOG2, Update)
TEST_P
(
MOG2
,
getBackgroundImage
)
{
if
(
useGray
)
return
;
cv
::
VideoCapture
cap
(
inputFile
);
ASSERT_TRUE
(
cap
.
isOpened
());
...
...
@@ -640,13 +643,6 @@ TEST_P(MOG2, getBackgroundImage)
cap
>>
frame
;
ASSERT_FALSE
(
frame
.
empty
());
// if (useGray)
// {
// cv::Mat temp;
// cv::cvtColor(frame, temp, cv::COLOR_BGR2GRAY);
// cv::swap(temp, frame);
// }
mog2
(
loadMat
(
frame
,
useRoi
),
foreground
);
mog2_gold
(
frame
,
foreground_gold
);
...
...
@@ -667,6 +663,101 @@ INSTANTIATE_TEST_CASE_P(GPU_Video, MOG2, testing::Combine(
testing
::
Values
(
UseGray
(
true
),
UseGray
(
false
)),
WHOLE_SUBMAT
));
//////////////////////////////////////////////////////
// VIBE
PARAM_TEST_CASE
(
VIBE
,
cv
::
gpu
::
DeviceInfo
,
cv
::
Size
,
MatType
,
UseRoi
)
{
};
TEST_P
(
VIBE
,
Accuracy
)
{
const
cv
::
gpu
::
DeviceInfo
devInfo
=
GET_PARAM
(
0
);
cv
::
gpu
::
setDevice
(
devInfo
.
deviceID
());
const
cv
::
Size
size
=
GET_PARAM
(
1
);
const
int
type
=
GET_PARAM
(
2
);
const
bool
useRoi
=
GET_PARAM
(
3
);
const
cv
::
Mat
fullfg
(
size
,
CV_8UC1
,
cv
::
Scalar
::
all
(
255
));
cv
::
Mat
frame
=
randomMat
(
size
,
type
,
0.0
,
100
);
cv
::
gpu
::
GpuMat
d_frame
=
loadMat
(
frame
,
useRoi
);
cv
::
gpu
::
VIBE_GPU
vibe
;
cv
::
gpu
::
GpuMat
d_fgmask
=
createMat
(
size
,
CV_8UC1
,
useRoi
);
vibe
.
initialize
(
d_frame
);
for
(
int
i
=
0
;
i
<
20
;
++
i
)
vibe
(
d_frame
,
d_fgmask
);
frame
=
randomMat
(
size
,
type
,
160
,
255
);
d_frame
=
loadMat
(
frame
,
useRoi
);
vibe
(
d_frame
,
d_fgmask
);
// now fgmask should be entirely foreground
ASSERT_MAT_NEAR
(
fullfg
,
d_fgmask
,
0
);
}
INSTANTIATE_TEST_CASE_P
(
GPU_Video
,
VIBE
,
testing
::
Combine
(
ALL_DEVICES
,
DIFFERENT_SIZES
,
testing
::
Values
(
MatType
(
CV_8UC1
),
MatType
(
CV_8UC3
),
MatType
(
CV_8UC4
)),
WHOLE_SUBMAT
));
//////////////////////////////////////////////////////
// GMG
PARAM_TEST_CASE
(
GMG
,
cv
::
gpu
::
DeviceInfo
,
cv
::
Size
,
MatDepth
,
Channels
,
UseRoi
)
{
};
TEST_P
(
GMG
,
Accuracy
)
{
const
cv
::
gpu
::
DeviceInfo
devInfo
=
GET_PARAM
(
0
);
cv
::
gpu
::
setDevice
(
devInfo
.
deviceID
());
const
cv
::
Size
size
=
GET_PARAM
(
1
);
const
int
depth
=
GET_PARAM
(
2
);
const
int
channels
=
GET_PARAM
(
3
);
const
bool
useRoi
=
GET_PARAM
(
4
);
const
int
type
=
CV_MAKE_TYPE
(
depth
,
channels
);
const
cv
::
Mat
zeros
(
size
,
CV_8UC1
,
cv
::
Scalar
::
all
(
0
));
const
cv
::
Mat
fullfg
(
size
,
CV_8UC1
,
cv
::
Scalar
::
all
(
255
));
cv
::
Mat
frame
=
randomMat
(
size
,
type
,
0
,
100
);
cv
::
gpu
::
GpuMat
d_frame
=
loadMat
(
frame
,
useRoi
);
cv
::
gpu
::
GMG_GPU
gmg
;
gmg
.
numInitializationFrames
=
5
;
gmg
.
smoothingRadius
=
0
;
gmg
.
initialize
(
d_frame
.
size
(),
0
,
255
);
cv
::
gpu
::
GpuMat
d_fgmask
=
createMat
(
size
,
CV_8UC1
,
useRoi
);
for
(
int
i
=
0
;
i
<
gmg
.
numInitializationFrames
;
++
i
)
{
gmg
(
d_frame
,
d_fgmask
);
// fgmask should be entirely background during training
ASSERT_MAT_NEAR
(
zeros
,
d_fgmask
,
0
);
}
frame
=
randomMat
(
size
,
type
,
160
,
255
);
d_frame
=
loadMat
(
frame
,
useRoi
);
gmg
(
d_frame
,
d_fgmask
);
// now fgmask should be entirely foreground
ASSERT_MAT_NEAR
(
fullfg
,
d_fgmask
,
0
);
}
INSTANTIATE_TEST_CASE_P
(
GPU_Video
,
GMG
,
testing
::
Combine
(
ALL_DEVICES
,
DIFFERENT_SIZES
,
testing
::
Values
(
MatType
(
CV_8U
),
MatType
(
CV_16U
),
MatType
(
CV_32F
)),
testing
::
Values
(
Channels
(
1
),
Channels
(
3
),
Channels
(
4
)),
WHOLE_SUBMAT
));
//////////////////////////////////////////////////////
// VideoWriter
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录