diff --git a/modules/matlab/README.md b/modules/matlab/README.md index b36123efc0..42237eccf8 100644 --- a/modules/matlab/README.md +++ b/modules/matlab/README.md @@ -124,9 +124,8 @@ opencv/modules/matlab (this module) * `CMakeLists.txt` (main cmake configuration file) * `README.md` (this file) -* `compile.cmake` (the cmake help script for compiling generated source code) +* `compile.cmake` (the cmake script for compiling generated source code) * `generator` (the folder containing generator code) - * `jinja2` (the binding templating engine) * `filters.py` (template filters) * `gen_matlab.py` (the binding generator control script) * `parse_tree.py` (python class to refactor the hdr_parser.py output) @@ -135,7 +134,6 @@ opencv/modules/matlab (this module) * `mxarray.hpp` (C++ OOP-style interface for Matlab mxArray* class) * `bridge.hpp` (type conversions) * `map.hpp` (hash map interface for instance storage and method lookup) -* `io` (FileStorage interface for .mat files) * `test` (generator, compiler and binding test scripts) @@ -262,28 +260,41 @@ File Reference **gen_matlab.py** gen_matlab has the following call signature: - gen_matlab.py --hdrparser path/to/hdr_parser/dir + gen_matlab.py --jinja2 path/to/jinja2/engine + --hdrparser path/to/hdr_parser/dir --rstparser path/to/rst_parser/dir --moduleroot path/to/opencv/modules - --modules core imgproc highgui etc + --modules [core imgproc highgui ...] --extra namespace=/additional/header/to/parse --outdir /path/to/place/generated/src **build_info.py** build_info has the following call signature: - build_info.py --os operating_system_string - --arch bitness processor - --compiler id version + build_info.py --jinja2 path/to/jinja2/engine + --os operating_system_string + --arch [bitness processor] + --compiler [id version] --mex_arch arch_string --mex_script /path/to/mex/script - --cxx_flags -list -of -flags -to -passthrough + --cxx_flags [-list -of -flags -to -passthrough] --opencv_version version_string --commit commit_hash_if_using_git --modules core imgproc highgui etc --configuration Debug/Release --outdir path/to/place/build/info +**cvmex.py** +cvmex.py, the custom compiler generator, has the following call signature: + + cvmex.py --jinja2 path/to/jinja2/engine + --opts [-list -of -opts] + --include_dirs [-list -of -opencv_include_directories] + --lib_dir opencv_lib_directory + --libs [-lopencv_core -lopencv_imgproc ...] + --flags [-Wall -opencv_build_flags ...] + --outdir /path/to/generated/output + **parse_tree.py** To build a parse tree, first parse a set of headers, then invoke the parse tree to refactor the output: diff --git a/modules/matlab/generator/build_info.py b/modules/matlab/generator/build_info.py index 5b25a875e1..65619a2a75 100644 --- a/modules/matlab/generator/build_info.py +++ b/modules/matlab/generator/build_info.py @@ -25,7 +25,8 @@ def substitute(build, output_dir): if __name__ == "__main__": """ - Usage: python build_info.py --os os_version_string + Usage: python build_info.py --jinja2 /path/to/jinja2/engine + --os os_version_string --arch [bitness processor] --compiler [id version] --mex_arch arch_string diff --git a/modules/matlab/generator/cvmex.py b/modules/matlab/generator/cvmex.py index 7e2718c3c3..52c5f649f5 100644 --- a/modules/matlab/generator/cvmex.py +++ b/modules/matlab/generator/cvmex.py @@ -26,7 +26,8 @@ def substitute(cv, output_dir): if __name__ == "__main__": """ - Usage: python cvmex.py --opts [-list -of -opts] + Usage: python cvmex.py --jinja2 /path/to/jinja2/engine + --opts [-list -of -opts] --include_dirs [-list -of -opencv_include_directories] --lib_dir opencv_lib_directory --libs [-lopencv_core -lopencv_imgproc ...] diff --git a/modules/matlab/generator/gen_matlab.py b/modules/matlab/generator/gen_matlab.py index 7092e31396..49e575099a 100644 --- a/modules/matlab/generator/gen_matlab.py +++ b/modules/matlab/generator/gen_matlab.py @@ -130,7 +130,8 @@ class MatlabWrapperGenerator(object): if __name__ == "__main__": """ - Usage: python gen_matlab.py --hdrparser /path/to/hdr_parser/dir + Usage: python gen_matlab.py --jinja2 /path/to/jinja2/engine + --hdrparser /path/to/hdr_parser/dir --rstparser /path/to/rst_parser/dir --moduleroot /path/to/opencv/modules --modules [core imgproc objdetect etc] @@ -147,6 +148,8 @@ if __name__ == "__main__": definitions gen_matlab.py requires the following inputs: + --jinja2 the path to the Jinja2 templating engine + e.g. ${CMAKE_SOURCE_DIR}/3rdparty --hdrparser the path to the header parser directory (opencv/modules/python/src2) --rstparser the path to the rst parser directory diff --git a/modules/matlab/include/opencv2/matlab/mxarray.hpp b/modules/matlab/include/opencv2/matlab/mxarray.hpp index 3d46ed4506..ba8c64c496 100644 --- a/modules/matlab/include/opencv2/matlab/mxarray.hpp +++ b/modules/matlab/include/opencv2/matlab/mxarray.hpp @@ -379,10 +379,10 @@ public: * * e.g. * { - * MxArray A(5, 5); // allocates memory - * MxArray B(5, 5); // ditto - * plhs[0] = A; // not allowed!! - * plhs[0] = A.releaseOwnership(); // makes explicit that ownership is being released + * MxArray A = MxArray::Matrix(5, 5); // allocates memory + * MxArray B = MxArray::Matrix(5, 5); // ditto + * plhs[0] = A; // not allowed!! + * plhs[0] = A.releaseOwnership(); // makes explicit that ownership is being released * } // end of scope. B is released, A isn't * */