Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
e9f99063
Commit
e9f99063
authored
Sep 26, 2018
by
Dmitry Kurtaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JavaScript bindings for features2d module
parent
43e66e7f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
8 deletions
+27
-8
CMakeLists.txt
modules/features2d/CMakeLists.txt
+1
-1
features2d.hpp
modules/features2d/include/opencv2/features2d.hpp
+4
-0
embindgen.py
modules/js/src/embindgen.py
+21
-6
build_js.py
platforms/js/build_js.py
+1
-1
No files found.
modules/features2d/CMakeLists.txt
View file @
e9f99063
set
(
the_description
"2D Features Framework"
)
ocv_define_module
(
features2d opencv_imgproc OPTIONAL opencv_flann opencv_highgui WRAP java python
)
ocv_define_module
(
features2d opencv_imgproc OPTIONAL opencv_flann opencv_highgui WRAP java python
js
)
modules/features2d/include/opencv2/features2d.hpp
View file @
e9f99063
...
...
@@ -137,7 +137,11 @@ public:
/** @brief Abstract base class for 2D image feature detectors and descriptor extractors
*/
#ifdef __EMSCRIPTEN__
class
CV_EXPORTS_W
Feature2D
:
public
Algorithm
#else
class
CV_EXPORTS_W
Feature2D
:
public
virtual
Algorithm
#endif
{
public
:
virtual
~
Feature2D
();
...
...
modules/js/src/embindgen.py
View file @
e9f99063
...
...
@@ -126,7 +126,22 @@ video = {'': ['CamShift', 'calcOpticalFlowFarneback', 'calcOpticalFlowPyrLK', 'c
'BackgroundSubtractor'
:
[
'apply'
,
'getBackgroundImage'
]}
dnn
=
{
'dnn_Net'
:
[
'setInput'
,
'forward'
],
''
:
[
'readNetFromCaffe'
,
'readNetFromTensorflow'
,
'readNetFromTorch'
,
'readNetFromDarknet'
,
'blobFromImage'
]}
''
:
[
'readNetFromCaffe'
,
'readNetFromTensorflow'
,
'readNetFromTorch'
,
'readNetFromDarknet'
,
'readNetFromONNX'
,
'readNet'
,
'blobFromImage'
]}
features2d
=
{
'Feature2D'
:
[
'detect'
,
'compute'
,
'detectAndCompute'
,
'descriptorSize'
,
'descriptorType'
,
'defaultNorm'
,
'empty'
,
'getDefaultName'
],
'BRISK'
:
[
'create'
,
'getDefaultName'
],
'ORB'
:
[
'create'
,
'setMaxFeatures'
,
'setScaleFactor'
,
'setNLevels'
,
'setEdgeThreshold'
,
'setFirstLevel'
,
'setWTA_K'
,
'setScoreType'
,
'setPatchSize'
,
'getFastThreshold'
,
'getDefaultName'
],
'MSER'
:
[
'create'
,
'detectRegions'
,
'setDelta'
,
'getDelta'
,
'setMinArea'
,
'getMinArea'
,
'setMaxArea'
,
'getMaxArea'
,
'setPass2Only'
,
'getPass2Only'
,
'getDefaultName'
],
'FastFeatureDetector'
:
[
'create'
,
'setThreshold'
,
'getThreshold'
,
'setNonmaxSuppression'
,
'getNonmaxSuppression'
,
'setType'
,
'getType'
,
'getDefaultName'
],
'AgastFeatureDetector'
:
[
'create'
,
'setThreshold'
,
'getThreshold'
,
'setNonmaxSuppression'
,
'getNonmaxSuppression'
,
'setType'
,
'getType'
,
'getDefaultName'
],
'GFTTDetector'
:
[
'create'
,
'setMaxFeatures'
,
'getMaxFeatures'
,
'setQualityLevel'
,
'getQualityLevel'
,
'setMinDistance'
,
'getMinDistance'
,
'setBlockSize'
,
'getBlockSize'
,
'setHarrisDetector'
,
'getHarrisDetector'
,
'setK'
,
'getK'
,
'getDefaultName'
],
# 'SimpleBlobDetector': ['create'],
'KAZE'
:
[
'create'
,
'setExtended'
,
'getExtended'
,
'setUpright'
,
'getUpright'
,
'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'
],
'BFMatcher'
:
[
'isMaskSupported'
,
'create'
],
''
:
[
'FAST'
,
'AGAST'
,
'drawKeypoints'
,
'drawMatches'
]}
def
makeWhiteList
(
module_list
):
wl
=
{}
...
...
@@ -138,7 +153,7 @@ def makeWhiteList(module_list):
wl
[
k
]
=
m
[
k
]
return
wl
white_list
=
makeWhiteList
([
core
,
imgproc
,
objdetect
,
video
,
dnn
])
white_list
=
makeWhiteList
([
core
,
imgproc
,
objdetect
,
video
,
dnn
,
features2d
])
# Features to be exported
export_enums
=
False
...
...
@@ -219,7 +234,8 @@ def handle_ptr(tp):
def
handle_vector
(
tp
):
if
tp
.
startswith
(
'vector_'
):
tp
=
'std::vector<'
+
"::"
.
join
(
tp
.
split
(
'_'
)[
1
:])
+
'>'
tp
=
handle_vector
(
tp
[
tp
.
find
(
'_'
)
+
1
:])
tp
=
'std::vector<'
+
"::"
.
join
(
tp
.
split
(
'_'
))
+
'>'
return
tp
...
...
@@ -845,13 +861,12 @@ class JSWrapperGenerator(object):
[
class_info
.
cname
,
property
.
name
])))
dv
=
''
base
=
Template
(
"""base<$base
$isPoly
>"""
)
base
=
Template
(
"""base<$base>"""
)
assert
len
(
class_info
.
bases
)
<=
1
,
"multiple inheritance not supported"
if
len
(
class_info
.
bases
)
==
1
:
dv
=
","
+
base
.
substitute
(
base
=
', '
.
join
(
class_info
.
bases
),
isPoly
=
" ,true"
if
class_info
.
name
==
"Feature2D"
else
""
)
dv
=
","
+
base
.
substitute
(
base
=
', '
.
join
(
class_info
.
bases
))
self
.
bindings
.
append
(
class_template
.
substitute
(
cpp_name
=
class_info
.
cname
,
js_name
=
name
,
...
...
platforms/js/build_js.py
View file @
e9f99063
...
...
@@ -131,7 +131,7 @@ class Builder:
"-DBUILD_opencv_apps=OFF"
,
"-DBUILD_opencv_calib3d=OFF"
,
"-DBUILD_opencv_dnn=ON"
,
"-DBUILD_opencv_features2d=O
FF
"
,
"-DBUILD_opencv_features2d=O
N
"
,
"-DBUILD_opencv_flann=OFF"
,
"-DBUILD_opencv_ml=OFF"
,
"-DBUILD_opencv_photo=OFF"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment