Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
d3f75df0
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
d3f75df0
编写于
10月 24, 2018
作者:
T
Tomoaki Teshima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
objdetect: fix test failure of QR code on Aarch64
* use boundingRect instead of manual loop
上级
ab2c16b2
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
19 addition
and
4 deletion
+19
-4
modules/objdetect/src/qrcode.cpp
modules/objdetect/src/qrcode.cpp
+19
-4
未找到文件。
modules/objdetect/src/qrcode.cpp
浏览文件 @
d3f75df0
...
...
@@ -862,6 +862,20 @@ bool QRDecode::updatePerspective()
return
true
;
}
inline
Point
computeOffset
(
const
vector
<
Point
>&
v
)
{
// compute the width/height of convex hull
Rect
areaBox
=
boundingRect
(
v
);
// compute the good offset
// the box is consisted by 7 steps
// to pick the middle of the stripe, it needs to be 1/14 of the size
const
int
cStep
=
7
*
2
;
Point
offset
=
Point
(
areaBox
.
width
,
areaBox
.
height
);
offset
/=
cStep
;
return
offset
;
}
bool
QRDecode
::
versionDefinition
()
{
LineIterator
line_iter
(
intermediate
,
Point2f
(
0
,
0
),
Point2f
(
test_perspective_size
,
test_perspective_size
));
...
...
@@ -879,17 +893,18 @@ bool QRDecode::versionDefinition()
Mat
mask_roi
=
mask
(
Range
(
1
,
intermediate
.
rows
-
1
),
Range
(
1
,
intermediate
.
cols
-
1
));
findNonZero
(
mask_roi
,
non_zero_elem
);
convexHull
(
Mat
(
non_zero_elem
),
locations
);
Point
offset
=
computeOffset
(
locations
);
Point
temp_remote
=
locations
[
0
],
remote_point
;
const
Point
delta_diff
=
Point
(
4
,
4
)
;
const
Point
delta_diff
=
offset
;
for
(
size_t
i
=
0
;
i
<
locations
.
size
();
i
++
)
{
if
(
norm
(
black_point
-
temp_remote
)
<
norm
(
black_point
-
locations
[
i
]))
if
(
norm
(
black_point
-
temp_remote
)
<
=
norm
(
black_point
-
locations
[
i
]))
{
const
uint8_t
value
=
intermediate
.
at
<
uint8_t
>
(
temp_remote
-
delta_diff
);
if
(
value
==
0
)
{
remote_point
=
temp_remote
-
delta_diff
;
}
else
{
remote_point
=
temp_remote
;
}
temp_remote
=
locations
[
i
];
if
(
value
==
0
)
{
remote_point
=
temp_remote
-
delta_diff
;
}
else
{
remote_point
=
temp_remote
-
(
delta_diff
/
2
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录