Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
00367289
O
Opencv
项目概览
Greenplum
/
Opencv
10 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
00367289
编写于
6月 07, 2019
作者:
A
Alexander Alekhin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #14754 from allnes:java_qr_code
上级
6d62be55
a9769b92
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
47 addition
and
1 deletion
+47
-1
modules/objdetect/misc/java/test/QRCodeDetectorTest.java
modules/objdetect/misc/java/test/QRCodeDetectorTest.java
+29
-0
modules/objdetect/misc/python/test/test_qrcode_detect.py
modules/objdetect/misc/python/test/test_qrcode_detect.py
+18
-0
modules/objdetect/src/qrcode.cpp
modules/objdetect/src/qrcode.cpp
+0
-1
未找到文件。
modules/objdetect/misc/java/test/QRCodeDetectorTest.java
0 → 100644
浏览文件 @
00367289
package
org.opencv.test.objdetect
;
import
org.opencv.core.Mat
;
import
org.opencv.objdetect.QRCodeDetector
;
import
org.opencv.imgcodecs.Imgcodecs
;
import
org.opencv.test.OpenCVTestCase
;
public
class
QRCodeDetectorTest
extends
OpenCVTestCase
{
private
final
static
String
ENV_OPENCV_TEST_DATA_PATH
=
"OPENCV_TEST_DATA_PATH"
;
private
String
testDataPath
;
@Override
protected
void
setUp
()
throws
Exception
{
super
.
setUp
();
testDataPath
=
System
.
getenv
(
ENV_OPENCV_TEST_DATA_PATH
);
if
(
testDataPath
==
null
)
throw
new
Exception
(
ENV_OPENCV_TEST_DATA_PATH
+
" has to be defined!"
);
}
public
void
testDetectAndDecode
()
{
Mat
img
=
Imgcodecs
.
imread
(
testDataPath
+
"/cv/qrcode/link_ocv.jpg"
);
QRCodeDetector
detector
=
new
QRCodeDetector
();
String
output
=
detector
.
detectAndDecode
(
img
);
assertEquals
(
output
,
"https://opencv.org/"
);
}
}
modules/objdetect/misc/python/test/test_qrcode_detect.py
0 → 100644
浏览文件 @
00367289
#!/usr/bin/env python
'''
===============================================================================
QR code detect and decode pipeline.
===============================================================================
'''
import
numpy
as
np
import
cv2
as
cv
from
tests_common
import
NewOpenCVTests
class
qrcode_detector_test
(
NewOpenCVTests
):
def
test_detect_and_decode
(
self
):
img
=
cv
.
imread
(
self
.
extraTestDataPath
+
'/cv/qrcode/link_ocv.jpg'
)
detector
=
cv
.
QRCodeDetector
()
retval
,
points
,
straight_qrcode
=
detector
.
detectAndDecode
(
img
)
self
.
assertEqual
(
retval
,
"https://opencv.org/"
);
modules/objdetect/src/qrcode.cpp
浏览文件 @
00367289
...
...
@@ -1084,7 +1084,6 @@ cv::String QRCodeDetector::decode(InputArray in, InputArray points,
inarr
=
gray
;
}
CV_Assert
(
points
.
isVector
());
vector
<
Point2f
>
src_points
;
points
.
copyTo
(
src_points
);
CV_Assert
(
src_points
.
size
()
==
4
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录