Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_38597003
opencv_contrib
提交
be6718e5
O
opencv_contrib
项目概览
qq_38597003
/
opencv_contrib
与 Fork 源项目一致
Fork自
OpenCV / opencv_contrib
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
opencv_contrib
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
be6718e5
编写于
1月 21, 2021
作者:
D
dddzg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove useless cv::
上级
9750e149
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
5 addition
and
6 deletion
+5
-6
modules/wechat_qrcode/src/wechat_qrcode.cpp
modules/wechat_qrcode/src/wechat_qrcode.cpp
+5
-6
未找到文件。
modules/wechat_qrcode/src/wechat_qrcode.cpp
浏览文件 @
be6718e5
...
...
@@ -13,7 +13,6 @@
#include "opencv2/core/utils/filesystem.hpp"
#include "scale/super_scale.hpp"
#include "zxing/result.hpp"
using
cv
::
InputArray
;
namespace
cv
{
namespace
wechat_qrcode
{
class
WeChatQRCode
::
Impl
{
...
...
@@ -91,7 +90,7 @@ vector<string> WeChatQRCode::detectAndDecode(InputArray img, OutputArrayOfArrays
int
incn
=
img
.
channels
();
CV_Check
(
incn
,
incn
==
1
||
incn
==
3
||
incn
==
4
,
""
);
if
(
incn
==
3
||
incn
==
4
)
{
cv
::
cvtColor
(
img
,
input_img
,
cv
::
COLOR_BGR2GRAY
);
cv
tColor
(
img
,
input_img
,
COLOR_BGR2GRAY
);
}
else
{
input_img
=
img
.
getMat
();
}
...
...
@@ -122,7 +121,7 @@ vector<string> WeChatQRCode::Impl::decode(const Mat& img, vector<Mat>& candidate
}
vector
<
string
>
decode_results
;
for
(
auto
&
point
:
candidate_points
)
{
cv
::
Mat
cropped_img
;
Mat
cropped_img
;
if
(
use_nn_detector_
)
{
Align
aligner
;
cropped_img
=
cropObj
(
img
,
point
,
aligner
);
...
...
@@ -132,7 +131,7 @@ vector<string> WeChatQRCode::Impl::decode(const Mat& img, vector<Mat>& candidate
// scale_list contains different scale ratios
auto
scale_list
=
getScaleList
(
cropped_img
.
cols
,
cropped_img
.
rows
);
for
(
auto
cur_scale
:
scale_list
)
{
cv
::
Mat
scaled_img
=
Mat
scaled_img
=
super_resolution_model_
->
processImageScale
(
cropped_img
,
cur_scale
,
use_nn_sr_
);
string
result
;
DecoderMgr
decodemgr
;
...
...
@@ -173,7 +172,7 @@ vector<Mat> WeChatQRCode::Impl::detect(const Mat& img) {
return
points
;
}
int
WeChatQRCode
::
Impl
::
applyDetector
(
const
cv
::
Mat
&
img
,
vector
<
Mat
>&
points
)
{
int
WeChatQRCode
::
Impl
::
applyDetector
(
const
Mat
&
img
,
vector
<
Mat
>&
points
)
{
int
img_w
=
img
.
cols
;
int
img_h
=
img
.
rows
;
...
...
@@ -188,7 +187,7 @@ int WeChatQRCode::Impl::applyDetector(const cv::Mat& img, vector<Mat>& points) {
return
0
;
}
cv
::
Mat
WeChatQRCode
::
Impl
::
cropObj
(
const
cv
::
Mat
&
img
,
const
Mat
&
point
,
Align
&
aligner
)
{
Mat
WeChatQRCode
::
Impl
::
cropObj
(
const
Mat
&
img
,
const
Mat
&
point
,
Align
&
aligner
)
{
// make some padding to boost the qrcode details recall.
float
padding_w
=
0.1
f
,
padding_h
=
0.1
f
;
auto
min_padding
=
15
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录