Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenCV
opencv
提交
c643af0b
O
opencv
项目概览
OpenCV
/
opencv
上一次同步 大约 1 年
通知
1005
Star
71102
Fork
55580
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c643af0b
编写于
3月 29, 2023
作者:
A
Alex
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix test
上级
39e2ebbd
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
4 addition
and
26 deletion
+4
-26
modules/objdetect/test/test_charucodetection.cpp
modules/objdetect/test/test_charucodetection.cpp
+4
-26
未找到文件。
modules/objdetect/test/test_charucodetection.cpp
浏览文件 @
c643af0b
...
...
@@ -213,7 +213,7 @@ void CV_CharucoPoseEstimation::run(int) {
Mat
distCoeffs
(
5
,
1
,
CV_64FC1
,
Scalar
::
all
(
0
));
// for different perspectives
for
(
double
distance
:
{
0.2
,
0.
3
})
{
for
(
double
distance
:
{
0.2
,
0.
25
})
{
for
(
int
yaw
=
-
55
;
yaw
<=
50
;
yaw
+=
25
)
{
for
(
int
pitch
=
-
55
;
pitch
<=
50
;
pitch
+=
25
)
{
...
...
@@ -244,18 +244,6 @@ void CV_CharucoPoseEstimation::run(int) {
detector
.
setCharucoParameters
(
charucoParameters
);
detector
.
detectBoard
(
img
,
charucoCorners
,
charucoIds
,
corners
,
ids
);
}
// // create debug images
// Mat rgb_image;
// cv::cvtColor(img, rgb_image, COLOR_GRAY2RGB);
// aruco::drawDetectedCornersCharuco(rgb_image, charucoCorners, charucoIds);
// aruco::drawDetectedMarkers(rgb_image, corners, ids);
// cv::imwrite("Debug_CV_CharucoPoseEstimation"
// + (legacyPattern ? std::string("_legacy") : std::string(""))
// + "_dist" + std::to_string(distance)
// + "_yaw" + std::to_string(yaw)
// + "_pitch" + std::to_string(pitch) + ".png", rgb_image);
ASSERT_EQ
(
ids
.
size
(),
board
.
getIds
().
size
());
if
(
charucoIds
.
size
()
==
0
)
continue
;
...
...
@@ -323,7 +311,7 @@ void CV_CharucoDiamondDetection::run(int) {
int
iter
=
0
;
Mat
cameraMatrix
=
Mat
::
eye
(
3
,
3
,
CV_64FC1
);
Size
imgSize
(
750
,
75
0
);
Size
imgSize
(
500
,
50
0
);
aruco
::
DetectorParameters
params
;
params
.
minDistanceToBorder
=
0
;
float
squareLength
=
0.03
f
;
...
...
@@ -333,7 +321,7 @@ void CV_CharucoDiamondDetection::run(int) {
aruco
::
CharucoDetector
detector
(
board
);
cameraMatrix
.
at
<
double
>
(
0
,
0
)
=
cameraMatrix
.
at
<
double
>
(
1
,
1
)
=
100
0
;
cameraMatrix
.
at
<
double
>
(
0
,
0
)
=
cameraMatrix
.
at
<
double
>
(
1
,
1
)
=
65
0
;
cameraMatrix
.
at
<
double
>
(
0
,
2
)
=
imgSize
.
width
/
2
;
cameraMatrix
.
at
<
double
>
(
1
,
2
)
=
imgSize
.
height
/
2
;
...
...
@@ -344,7 +332,7 @@ void CV_CharucoDiamondDetection::run(int) {
detector
.
setCharucoParameters
(
charucoParameters
);
// for different perspectives
for
(
double
distance
:
{
0.2
,
0.
3
})
{
for
(
double
distance
:
{
0.2
,
0.
22
})
{
for
(
int
yaw
=
-
50
;
yaw
<=
50
;
yaw
+=
25
)
{
for
(
int
pitch
=
-
50
;
pitch
<=
50
;
pitch
+=
25
)
{
...
...
@@ -376,16 +364,6 @@ void CV_CharucoDiamondDetection::run(int) {
detector
.
detectDiamonds
(
img
,
diamondCorners
,
diamondIds
,
corners
,
ids
);
// // create debug images
// Mat rgb_image;
// cv::cvtColor(img, rgb_image, COLOR_GRAY2RGB);
// aruco::drawDetectedDiamonds(rgb_image, diamondCorners, diamondIds);
// aruco::drawDetectedMarkers(rgb_image, corners, ids);
// cv::imwrite(std::string("Debug_CV_CharucoDiamondDetection")
// + "_dist" + std::to_string(distance)
// + "_yaw" + std::to_string(yaw)
// + "_pitch" + std::to_string(pitch) + ".png", rgb_image);
// check detect
if
(
ids
.
size
()
!=
4
)
{
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"Not enough markers for diamond detection"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录