diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake index bcc0072aae..cd98f3370d 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake @@ -313,7 +313,7 @@ macro(ocv_glob_modules) # TODO: Undo this change to build all modules #file(GLOB __ocvmodules RELATIVE "${__path}" "${__path}/*") - file(GLOB __ocvmodules RELATIVE "${__path}" "${__path}/core" "${__path}/imgproc" "${__path}/matlab") + file(GLOB __ocvmodules RELATIVE "${__path}" "${__path}/core" "${__path}/imgproc" "${__path}/ml" "${__path}/highgui" "${__path}/matlab") if(__ocvmodules) list(SORT __ocvmodules) foreach(mod ${__ocvmodules}) diff --git a/modules/matlab/generator/gen_matlab.py b/modules/matlab/generator/gen_matlab.py index ad7ba3b24b..e6e764a36a 100644 --- a/modules/matlab/generator/gen_matlab.py +++ b/modules/matlab/generator/gen_matlab.py @@ -12,8 +12,8 @@ class MatlabWrapperGenerator(object): name = os.path.splitext(os.path.basename(file))[0] ns[name] = parser.parse(file) - print ns['imgproc'] # cleanify the parser output + print ns['ml'] parse_tree = ParseTree() parse_tree.build(ns) print parse_tree diff --git a/modules/matlab/generator/parse_tree.py b/modules/matlab/generator/parse_tree.py index be2d89631d..70730059b6 100644 --- a/modules/matlab/generator/parse_tree.py +++ b/modules/matlab/generator/parse_tree.py @@ -49,7 +49,7 @@ class Translator(object): def translate(self, defn): # --- class --- # classes have 'class' prefixed on their name - if 'class' in defn[0]: + if 'class' in defn[0].split(' ') or 'struct' in defn[0].split(' '): return self.translateClass(defn) # --- function --- # functions either need to have input arguments, or not uppercase names @@ -100,8 +100,9 @@ class Translator(object): return name.split(' ')[-1].split('.')[-1] def translateClassName(self, name): + name = name.split(' ')[-1] parts = name.split('.') - return parts[1] if len(parts) == 3 else '' + return parts[-2] if len(parts) > 1 and not parts[-2] == 'cv' else '' diff --git a/modules/matlab/include/bridge.hpp b/modules/matlab/include/bridge.hpp index b7d32b1d4e..597092ba74 100644 --- a/modules/matlab/include/bridge.hpp +++ b/modules/matlab/include/bridge.hpp @@ -14,6 +14,7 @@ typedef std::vector vector_Mat; typedef std::vector vector_Point; typedef std::vector vector_int; typedef std::vector vector_float; +typedef std::vector vector_uchar; void conditionalError(bool expr, const std::string& str) { @@ -178,6 +179,11 @@ public: vector_Point toVectorPoint() { return vector_Point(); } operator vector_Point() { return toVectorPoint(); } + // ------------------------ vector_uchar ------------------------------------- + Bridge& operator=(const vector_uchar& obj) { return *this; } + vector_uchar toVectorUchar() { return vector_uchar(); } + operator vector_uchar() { return toVectorUchar(); } + // -------------------------- Scalar -------------------------------------- Bridge& operator=(const cv::Scalar& obj) { return *this; } cv::Scalar toScalar() { return cv::Scalar(); }