Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
b19bb95d
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,发现更多精彩内容 >>
提交
b19bb95d
编写于
2月 02, 2019
作者:
A
Alexander Alekhin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #12855 from dkurt:js_features2d_tests
上级
554eae56
8ecc5e6f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
100 addition
and
8 deletion
+100
-8
modules/js/src/core_bindings.cpp
modules/js/src/core_bindings.cpp
+12
-0
modules/js/src/embindgen.py
modules/js/src/embindgen.py
+1
-1
modules/js/test/test_features2d.js
modules/js/test/test_features2d.js
+82
-0
modules/js/test/tests.html
modules/js/test/tests.html
+1
-6
modules/js/test/tests.js
modules/js/test/tests.js
+1
-1
platforms/js/build_js.py
platforms/js/build_js.py
+3
-0
未找到文件。
modules/js/src/core_bindings.cpp
浏览文件 @
b19bb95d
...
@@ -74,7 +74,9 @@
...
@@ -74,7 +74,9 @@
using
namespace
emscripten
;
using
namespace
emscripten
;
using
namespace
cv
;
using
namespace
cv
;
#ifdef HAVE_OPENCV_DNN
using
namespace
dnn
;
using
namespace
dnn
;
#endif
namespace
binding_utils
namespace
binding_utils
{
{
...
@@ -276,13 +278,16 @@ namespace binding_utils
...
@@ -276,13 +278,16 @@ namespace binding_utils
float
radius
;
float
radius
;
};
};
#ifdef HAVE_OPENCV_IMGPROC
Circle
minEnclosingCircle
(
const
cv
::
Mat
&
points
)
Circle
minEnclosingCircle
(
const
cv
::
Mat
&
points
)
{
{
Circle
circle
;
Circle
circle
;
cv
::
minEnclosingCircle
(
points
,
circle
.
center
,
circle
.
radius
);
cv
::
minEnclosingCircle
(
points
,
circle
.
center
,
circle
.
radius
);
return
circle
;
return
circle
;
}
}
#endif
#ifdef HAVE_OPENCV_VIDEO
emscripten
::
val
CamShiftWrapper
(
const
cv
::
Mat
&
arg1
,
Rect
&
arg2
,
TermCriteria
arg3
)
emscripten
::
val
CamShiftWrapper
(
const
cv
::
Mat
&
arg1
,
Rect
&
arg2
,
TermCriteria
arg3
)
{
{
RotatedRect
rotatedRect
=
cv
::
CamShift
(
arg1
,
arg2
,
arg3
);
RotatedRect
rotatedRect
=
cv
::
CamShift
(
arg1
,
arg2
,
arg3
);
...
@@ -300,6 +305,7 @@ namespace binding_utils
...
@@ -300,6 +305,7 @@ namespace binding_utils
result
.
call
<
void
>
(
"push"
,
arg2
);
result
.
call
<
void
>
(
"push"
,
arg2
);
return
result
;
return
result
;
}
}
#endif // HAVE_OPENCV_VIDEO
std
::
string
getExceptionMsg
(
const
cv
::
Exception
&
e
)
{
std
::
string
getExceptionMsg
(
const
cv
::
Exception
&
e
)
{
return
e
.
msg
;
return
e
.
msg
;
...
@@ -538,19 +544,25 @@ EMSCRIPTEN_BINDINGS(binding_utils)
...
@@ -538,19 +544,25 @@ EMSCRIPTEN_BINDINGS(binding_utils)
function
(
"exceptionFromPtr"
,
&
binding_utils
::
exceptionFromPtr
,
allow_raw_pointers
());
function
(
"exceptionFromPtr"
,
&
binding_utils
::
exceptionFromPtr
,
allow_raw_pointers
());
#ifdef HAVE_OPENCV_IMGPROC
function
(
"minEnclosingCircle"
,
select_overload
<
binding_utils
::
Circle
(
const
cv
::
Mat
&
)
>
(
&
binding_utils
::
minEnclosingCircle
));
function
(
"minEnclosingCircle"
,
select_overload
<
binding_utils
::
Circle
(
const
cv
::
Mat
&
)
>
(
&
binding_utils
::
minEnclosingCircle
));
#endif
function
(
"minMaxLoc"
,
select_overload
<
binding_utils
::
MinMaxLoc
(
const
cv
::
Mat
&
,
const
cv
::
Mat
&
)
>
(
&
binding_utils
::
minMaxLoc
));
function
(
"minMaxLoc"
,
select_overload
<
binding_utils
::
MinMaxLoc
(
const
cv
::
Mat
&
,
const
cv
::
Mat
&
)
>
(
&
binding_utils
::
minMaxLoc
));
function
(
"minMaxLoc"
,
select_overload
<
binding_utils
::
MinMaxLoc
(
const
cv
::
Mat
&
)
>
(
&
binding_utils
::
minMaxLoc_1
));
function
(
"minMaxLoc"
,
select_overload
<
binding_utils
::
MinMaxLoc
(
const
cv
::
Mat
&
)
>
(
&
binding_utils
::
minMaxLoc_1
));
#ifdef HAVE_OPENCV_IMGPROC
function
(
"morphologyDefaultBorderValue"
,
&
cv
::
morphologyDefaultBorderValue
);
function
(
"morphologyDefaultBorderValue"
,
&
cv
::
morphologyDefaultBorderValue
);
#endif
function
(
"CV_MAT_DEPTH"
,
&
binding_utils
::
cvMatDepth
);
function
(
"CV_MAT_DEPTH"
,
&
binding_utils
::
cvMatDepth
);
#ifdef HAVE_OPENCV_VIDEO
function
(
"CamShift"
,
select_overload
<
emscripten
::
val
(
const
cv
::
Mat
&
,
Rect
&
,
TermCriteria
)
>
(
&
binding_utils
::
CamShiftWrapper
));
function
(
"CamShift"
,
select_overload
<
emscripten
::
val
(
const
cv
::
Mat
&
,
Rect
&
,
TermCriteria
)
>
(
&
binding_utils
::
CamShiftWrapper
));
function
(
"meanShift"
,
select_overload
<
emscripten
::
val
(
const
cv
::
Mat
&
,
Rect
&
,
TermCriteria
)
>
(
&
binding_utils
::
meanShiftWrapper
));
function
(
"meanShift"
,
select_overload
<
emscripten
::
val
(
const
cv
::
Mat
&
,
Rect
&
,
TermCriteria
)
>
(
&
binding_utils
::
meanShiftWrapper
));
#endif
function
(
"getBuildInformation"
,
&
binding_utils
::
getBuildInformation
);
function
(
"getBuildInformation"
,
&
binding_utils
::
getBuildInformation
);
...
...
modules/js/src/embindgen.py
浏览文件 @
b19bb95d
...
@@ -141,7 +141,7 @@ features2d = {'Feature2D': ['detect', 'compute', 'detectAndCompute', 'descriptor
...
@@ -141,7 +141,7 @@ features2d = {'Feature2D': ['detect', 'compute', 'detectAndCompute', 'descriptor
'AKAZE'
:
[
'create'
,
'setDescriptorType'
,
'getDescriptorType'
,
'setDescriptorSize'
,
'getDescriptorSize'
,
'setDescriptorChannels'
,
'getDescriptorChannels'
,
'setThreshold'
,
'getThreshold'
,
'setNOctaves'
,
'getNOctaves'
,
'setNOctaveLayers'
,
'getNOctaveLayers'
,
'setDiffusivity'
,
'getDiffusivity'
,
'getDefaultName'
],
'AKAZE'
:
[
'create'
,
'setDescriptorType'
,
'getDescriptorType'
,
'setDescriptorSize'
,
'getDescriptorSize'
,
'setDescriptorChannels'
,
'getDescriptorChannels'
,
'setThreshold'
,
'getThreshold'
,
'setNOctaves'
,
'getNOctaves'
,
'setNOctaveLayers'
,
'getNOctaveLayers'
,
'setDiffusivity'
,
'getDiffusivity'
,
'getDefaultName'
],
'DescriptorMatcher'
:
[
'add'
,
'clear'
,
'empty'
,
'isMaskSupported'
,
'train'
,
'match'
,
'knnMatch'
,
'radiusMatch'
,
'clone'
,
'create'
],
'DescriptorMatcher'
:
[
'add'
,
'clear'
,
'empty'
,
'isMaskSupported'
,
'train'
,
'match'
,
'knnMatch'
,
'radiusMatch'
,
'clone'
,
'create'
],
'BFMatcher'
:
[
'isMaskSupported'
,
'create'
],
'BFMatcher'
:
[
'isMaskSupported'
,
'create'
],
''
:
[
'
FAST'
,
'AGAST'
,
'
drawKeypoints'
,
'drawMatches'
]}
''
:
[
'drawKeypoints'
,
'drawMatches'
]}
def
makeWhiteList
(
module_list
):
def
makeWhiteList
(
module_list
):
wl
=
{}
wl
=
{}
...
...
modules/js/test/test_features2d.js
0 → 100644
浏览文件 @
b19bb95d
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
if
(
typeof
module
!==
'
undefined
'
&&
module
.
exports
)
{
// The envrionment is Node.js
var
cv
=
require
(
'
./opencv.js
'
);
// eslint-disable-line no-var
}
function
generateTestFrame
(
width
,
height
)
{
let
w
=
width
||
200
;
let
h
=
height
||
200
;
let
img
=
new
cv
.
Mat
(
h
,
w
,
cv
.
CV_8UC1
,
new
cv
.
Scalar
(
0
,
0
,
0
,
0
));
let
s
=
new
cv
.
Scalar
(
255
,
255
,
255
,
255
);
let
s128
=
new
cv
.
Scalar
(
128
,
128
,
128
,
128
);
let
rect
=
new
cv
.
Rect
(
w
/
4
,
h
/
4
,
w
/
2
,
h
/
2
);
img
.
roi
(
rect
).
setTo
(
s
);
img
.
roi
(
new
cv
.
Rect
(
w
/
2
-
w
/
8
,
h
/
2
-
h
/
8
,
w
/
4
,
h
/
4
)).
setTo
(
s128
);
cv
.
rectangle
(
img
,
new
cv
.
Point
(
w
/
8
,
h
/
8
),
new
cv
.
Point
(
w
-
w
/
8
,
h
-
h
/
8
),
s
,
5
);
cv
.
rectangle
(
img
,
new
cv
.
Point
(
w
/
5
,
h
/
5
),
new
cv
.
Point
(
w
-
w
/
5
,
h
-
h
/
5
),
s128
,
3
);
cv
.
line
(
img
,
new
cv
.
Point
(
-
w
,
0
),
new
cv
.
Point
(
w
/
2
,
h
/
2
),
s128
,
5
);
cv
.
line
(
img
,
new
cv
.
Point
(
2
*
w
,
0
),
new
cv
.
Point
(
w
/
2
,
h
/
2
),
s
,
5
);
return
img
;
}
QUnit
.
module
(
'
Features2D
'
,
{});
QUnit
.
test
(
'
Detectors
'
,
function
(
assert
)
{
let
image
=
generateTestFrame
();
let
kp
=
new
cv
.
KeyPointVector
();
let
orb
=
new
cv
.
ORB
();
orb
.
detect
(
image
,
kp
);
assert
.
equal
(
kp
.
size
(),
67
,
'
ORB
'
);
let
mser
=
new
cv
.
MSER
();
mser
.
detect
(
image
,
kp
);
assert
.
equal
(
kp
.
size
(),
7
,
'
MSER
'
);
let
brisk
=
new
cv
.
BRISK
();
brisk
.
detect
(
image
,
kp
);
assert
.
equal
(
kp
.
size
(),
191
,
'
BRISK
'
);
let
ffd
=
new
cv
.
FastFeatureDetector
();
ffd
.
detect
(
image
,
kp
);
assert
.
equal
(
kp
.
size
(),
12
,
'
FastFeatureDetector
'
);
let
afd
=
new
cv
.
AgastFeatureDetector
();
afd
.
detect
(
image
,
kp
);
assert
.
equal
(
kp
.
size
(),
67
,
'
AgastFeatureDetector
'
);
let
gftt
=
new
cv
.
GFTTDetector
();
gftt
.
detect
(
image
,
kp
);
assert
.
equal
(
kp
.
size
(),
168
,
'
GFTTDetector
'
);
let
kaze
=
new
cv
.
KAZE
();
kaze
.
detect
(
image
,
kp
);
assert
.
equal
(
kp
.
size
(),
159
,
'
KAZE
'
);
let
akaze
=
new
cv
.
AKAZE
();
akaze
.
detect
(
image
,
kp
);
assert
.
equal
(
kp
.
size
(),
52
,
'
AKAZE
'
);
});
QUnit
.
test
(
'
BFMatcher
'
,
function
(
assert
)
{
// Generate key points.
let
image
=
generateTestFrame
();
let
kp
=
new
cv
.
KeyPointVector
();
let
descriptors
=
new
cv
.
Mat
();
let
orb
=
new
cv
.
ORB
();
orb
.
detectAndCompute
(
image
,
new
cv
.
Mat
(),
kp
,
descriptors
);
assert
.
equal
(
kp
.
size
(),
67
);
// Run a matcher.
let
dm
=
new
cv
.
DMatchVector
();
let
matcher
=
new
cv
.
BFMatcher
();
matcher
.
match
(
descriptors
,
descriptors
,
dm
);
assert
.
equal
(
dm
.
size
(),
67
);
});
modules/js/test/tests.html
浏览文件 @
b19bb95d
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
<script
type=
"application/javascript"
src=
"test_imgproc.js"
></script>
<script
type=
"application/javascript"
src=
"test_imgproc.js"
></script>
<script
type=
"application/javascript"
src=
"test_objdetect.js"
></script>
<script
type=
"application/javascript"
src=
"test_objdetect.js"
></script>
<script
type=
"application/javascript"
src=
"test_video.js"
></script>
<script
type=
"application/javascript"
src=
"test_video.js"
></script>
<script
type=
"application/javascript"
src=
"test_features2d.js"
></script>
<script
type=
'text/javascript'
>
<script
type=
'text/javascript'
>
QUnit
.
config
.
autostart
=
false
;
QUnit
.
config
.
autostart
=
false
;
...
@@ -68,11 +69,5 @@
...
@@ -68,11 +69,5 @@
};
};
};
};
</script>
</script>
<!--
TODO
<script type="application/javascript" src="test_features2d.js"></script>
-->
</body>
</body>
</html>
</html>
modules/js/test/tests.js
浏览文件 @
b19bb95d
...
@@ -45,7 +45,7 @@ testrunner.run(
...
@@ -45,7 +45,7 @@ testrunner.run(
{
{
code
:
'
opencv.js
'
,
code
:
'
opencv.js
'
,
tests
:
[
'
test_mat.js
'
,
'
test_utils.js
'
,
'
test_imgproc.js
'
,
tests
:
[
'
test_mat.js
'
,
'
test_utils.js
'
,
'
test_imgproc.js
'
,
'
test_objdetect.js
'
,
'
test_video.js
'
],
'
test_objdetect.js
'
,
'
test_video.js
'
,
'
test_features2d.js
'
],
},
},
function
(
err
,
report
)
{
function
(
err
,
report
)
{
console
.
log
(
report
.
failed
+
'
failed,
'
+
report
.
passed
+
'
passed
'
);
console
.
log
(
report
.
failed
+
'
failed,
'
+
report
.
passed
+
'
passed
'
);
...
...
platforms/js/build_js.py
浏览文件 @
b19bb95d
...
@@ -112,6 +112,7 @@ class Builder:
...
@@ -112,6 +112,7 @@ class Builder:
"-DWITH_GPHOTO2=OFF"
,
"-DWITH_GPHOTO2=OFF"
,
"-DWITH_LAPACK=OFF"
,
"-DWITH_LAPACK=OFF"
,
"-DWITH_ITT=OFF"
,
"-DWITH_ITT=OFF"
,
"-DWITH_QUIRC=OFF"
,
"-DBUILD_ZLIB=ON"
,
"-DBUILD_ZLIB=ON"
,
"-DBUILD_opencv_apps=OFF"
,
"-DBUILD_opencv_apps=OFF"
,
"-DBUILD_opencv_calib3d=ON"
,
# No bindings provided. This module is used as a dependency for other modules.
"-DBUILD_opencv_calib3d=ON"
,
# No bindings provided. This module is used as a dependency for other modules.
...
@@ -128,9 +129,11 @@ class Builder:
...
@@ -128,9 +129,11 @@ class Builder:
"-DBUILD_opencv_superres=OFF"
,
"-DBUILD_opencv_superres=OFF"
,
"-DBUILD_opencv_stitching=OFF"
,
"-DBUILD_opencv_stitching=OFF"
,
"-DBUILD_opencv_java=OFF"
,
"-DBUILD_opencv_java=OFF"
,
"-DBUILD_opencv_java_bindings_generator=OFF"
,
"-DBUILD_opencv_js=ON"
,
"-DBUILD_opencv_js=ON"
,
"-DBUILD_opencv_python2=OFF"
,
"-DBUILD_opencv_python2=OFF"
,
"-DBUILD_opencv_python3=OFF"
,
"-DBUILD_opencv_python3=OFF"
,
"-DBUILD_opencv_python_bindings_generator=OFF"
,
"-DBUILD_EXAMPLES=OFF"
,
"-DBUILD_EXAMPLES=OFF"
,
"-DBUILD_PACKAGE=OFF"
,
"-DBUILD_PACKAGE=OFF"
,
"-DBUILD_TESTS=OFF"
,
"-DBUILD_TESTS=OFF"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录