Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
c54ae801
Commit
c54ae801
authored
Sep 03, 2014
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #82 from rokm/matlab-fix
matlab: fix bindings generation for xfeatures2d
parents
1bd91cd5
347fa4fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
CMakeLists.txt
modules/matlab/CMakeLists.txt
+1
-1
gen_matlab.py
modules/matlab/generator/gen_matlab.py
+12
-6
No files found.
modules/matlab/CMakeLists.txt
View file @
c54ae801
...
@@ -218,7 +218,7 @@ add_custom_command(
...
@@ -218,7 +218,7 @@ add_custom_command(
--jinja2
${
JINJA2_PATH
}
--jinja2
${
JINJA2_PATH
}
--hdrparser
${
HDR_PARSER_PATH
}
--hdrparser
${
HDR_PARSER_PATH
}
--rstparser
${
RST_PARSER_PATH
}
--rstparser
${
RST_PARSER_PATH
}
--moduleroot
${
CMAKE_SOURCE_DIR
}
/modules
--moduleroot
${
CMAKE_SOURCE_DIR
}
/modules
${
OPENCV_EXTRA_MODULES_PATH
}
--modules
${
opencv_modules
}
--modules
${
opencv_modules
}
--extra
${
opencv_extra_hdrs
}
--extra
${
opencv_extra_hdrs
}
--outdir
${
CMAKE_CURRENT_BINARY_DIR
}
--outdir
${
CMAKE_CURRENT_BINARY_DIR
}
...
...
modules/matlab/generator/gen_matlab.py
View file @
c54ae801
...
@@ -11,7 +11,7 @@ class MatlabWrapperGenerator(object):
...
@@ -11,7 +11,7 @@ class MatlabWrapperGenerator(object):
constructed. Given an instance, the gen() method performs the translation.
constructed. Given an instance, the gen() method performs the translation.
"""
"""
def
gen
(
self
,
module_root
,
modules
,
extras
,
output_dir
):
def
gen
(
self
,
module_root
s
,
modules
,
extras
,
output_dir
):
"""
"""
Generate a set of Matlab mex source files by parsing exported symbols
Generate a set of Matlab mex source files by parsing exported symbols
in a set of C++ headers. The headers can be input in one (or both) of
in a set of C++ headers. The headers can be input in one (or both) of
...
@@ -45,8 +45,14 @@ class MatlabWrapperGenerator(object):
...
@@ -45,8 +45,14 @@ class MatlabWrapperGenerator(object):
path_template
=
Template
(
'${module}/include/opencv2/${module}.hpp'
)
path_template
=
Template
(
'${module}/include/opencv2/${module}.hpp'
)
for
module
in
modules
:
for
module
in
modules
:
# construct a header path from the module root and a path template
for
module_root
in
module_roots
:
header
=
os
.
path
.
join
(
module_root
,
path_template
.
substitute
(
module
=
module
))
# construct a header path from the module root and a path template
header
=
os
.
path
.
join
(
module_root
,
path_template
.
substitute
(
module
=
module
))
if
os
.
path
.
isfile
(
header
):
break
else
:
raise
Exception
(
'no header found for module
%
s!'
%
module
)
# parse the definitions
# parse the definitions
ns
[
module
]
=
parser
.
parse
(
header
)
ns
[
module
]
=
parser
.
parse
(
header
)
# parse the documentation
# parse the documentation
...
@@ -142,7 +148,7 @@ if __name__ == "__main__":
...
@@ -142,7 +148,7 @@ if __name__ == "__main__":
Usage: python gen_matlab.py --jinja2 /path/to/jinja2/engine
Usage: python gen_matlab.py --jinja2 /path/to/jinja2/engine
--hdrparser /path/to/hdr_parser/dir
--hdrparser /path/to/hdr_parser/dir
--rstparser /path/to/rst_parser/dir
--rstparser /path/to/rst_parser/dir
--moduleroot
/path/to/opencv/modules
--moduleroot
[ /path/to/opencv/modules /path/to/opencv_contrib/modules etc ]
--modules [core imgproc objdetect etc]
--modules [core imgproc objdetect etc]
--extra namespace=/path/to/extra/header.hpp
--extra namespace=/path/to/extra/header.hpp
--outdir /path/to/output/generated/srcs
--outdir /path/to/output/generated/srcs
...
@@ -163,7 +169,7 @@ if __name__ == "__main__":
...
@@ -163,7 +169,7 @@ if __name__ == "__main__":
(opencv/modules/python/src2)
(opencv/modules/python/src2)
--rstparser the path to the rst parser directory
--rstparser the path to the rst parser directory
(opencv/modules/java/generator)
(opencv/modules/java/generator)
--moduleroot (optional) path
to the opencv directory
containing the modules
--moduleroot (optional) path
s to the opencv directories
containing the modules
--modules (optional - required if --moduleroot specified) the modules
--modules (optional - required if --moduleroot specified) the modules
to produce bindings for. The path to the include directories
to produce bindings for. The path to the include directories
as well as the namespaces are constructed from the modules
as well as the namespaces are constructed from the modules
...
@@ -182,7 +188,7 @@ if __name__ == "__main__":
...
@@ -182,7 +188,7 @@ if __name__ == "__main__":
parser
.
add_argument
(
'--jinja2'
)
parser
.
add_argument
(
'--jinja2'
)
parser
.
add_argument
(
'--hdrparser'
)
parser
.
add_argument
(
'--hdrparser'
)
parser
.
add_argument
(
'--rstparser'
)
parser
.
add_argument
(
'--rstparser'
)
parser
.
add_argument
(
'--moduleroot'
,
default
=
''
,
required
=
False
)
parser
.
add_argument
(
'--moduleroot'
,
nargs
=
'*'
,
default
=
[]
,
required
=
False
)
parser
.
add_argument
(
'--modules'
,
nargs
=
'*'
,
default
=
[],
required
=
False
)
parser
.
add_argument
(
'--modules'
,
nargs
=
'*'
,
default
=
[],
required
=
False
)
parser
.
add_argument
(
'--extra'
,
nargs
=
'*'
,
default
=
[],
required
=
False
)
parser
.
add_argument
(
'--extra'
,
nargs
=
'*'
,
default
=
[],
required
=
False
)
parser
.
add_argument
(
'--outdir'
)
parser
.
add_argument
(
'--outdir'
)
...
...
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