diff --git a/modules/matlab/CMakeLists.txt b/modules/matlab/CMakeLists.txt index b18d0254388..11967a5ad6d 100644 --- a/modules/matlab/CMakeLists.txt +++ b/modules/matlab/CMakeLists.txt @@ -113,6 +113,8 @@ ocv_add_module(matlab BINDINGS opencv_calib opencv_calib3d opencv_stitching opencv_superres opencv_xfeatures2d + opencv_optflow + opencv_xphoto ) # get the commit information @@ -156,6 +158,8 @@ endforeach() # add extra headers by hand list(APPEND opencv_extra_hdrs "core=${OPENCV_MODULE_opencv_core_LOCATION}/include/opencv2/core/base.hpp") list(APPEND opencv_extra_hdrs "video=${OPENCV_MODULE_opencv_video_LOCATION}/include/opencv2/video/tracking.hpp") +list(APPEND opencv_extra_hdrs "optflow=${OPENCV_MODULE_opencv_optflow_LOCATION}/include/opencv2/optflow.hpp") + # pass the OPENCV_CXX_EXTRA_FLAGS through to the mex compiler # remove the visibility modifiers, so the mex gateway is visible diff --git a/modules/matlab/generator/parse_tree.py b/modules/matlab/generator/parse_tree.py index 0a7ef364841..41d6d24d123 100644 --- a/modules/matlab/generator/parse_tree.py +++ b/modules/matlab/generator/parse_tree.py @@ -1,4 +1,10 @@ -import collections +import sys +if sys.version_info >= (3, 10): + import collections.abc + IterableType = collections.abc.Iterable +else: + import collections + IterableType = collections.Iterable from textwrap import fill from filters import * try: @@ -371,7 +377,7 @@ def todict(obj): return obj elif isinstance(obj, dict): return dict((key, todict(val)) for key, val in obj.items()) - elif isinstance(obj, collections.Iterable): + elif isinstance(obj, IterableType): return [todict(val) for val in obj] elif hasattr(obj, '__dict__'): return todict(vars(obj)) diff --git a/modules/matlab/include/opencv2/matlab/bridge.hpp b/modules/matlab/include/opencv2/matlab/bridge.hpp index d3342c16a40..654d1092101 100644 --- a/modules/matlab/include/opencv2/matlab/bridge.hpp +++ b/modules/matlab/include/opencv2/matlab/bridge.hpp @@ -55,6 +55,21 @@ #include #include #include +#include +#include + +/* This 'using' line was added in order to fix the following Error. + * Failed to compile currentUIFramework: + * modules/matlab/src/currentUIFramework.cpp: + * In function void mexFunction(int, mxArray**, int, const mxArray**) + * error: string was not declared in this scope + * string retval; in line 41 + * + * This error happens at the last stage of opencv build, when compiling the mex bindings + * TODO: This is NOT the optimal fix, and needs to be addressed + */ +using std::string; + namespace cv { namespace bridge { @@ -85,17 +100,21 @@ typedef cv::Ptr Ptr_AlignMTB; typedef cv::Ptr Ptr_CalibrateDebevec; typedef cv::Ptr Ptr_CalibrateRobertson; typedef cv::Ptr Ptr_DenseOpticalFlow; -typedef cv::Ptr Ptr_DualTVL1OpticalFlow; +typedef cv::Ptr Ptr_DualTVL1OpticalFlow; typedef cv::Ptr Ptr_MergeDebevec; typedef cv::Ptr Ptr_MergeMertens; typedef cv::Ptr Ptr_MergeRobertson; typedef cv::Ptr Ptr_Stitcher; typedef cv::Ptr Ptr_Tonemap; typedef cv::Ptr Ptr_TonemapDrago; -typedef cv::Ptr Ptr_TonemapDurand; +typedef cv::Ptr Ptr_TonemapDurand; typedef cv::Ptr Ptr_TonemapMantiuk; typedef cv::Ptr Ptr_TonemapReinhard; typedef cv::Ptr Ptr_float; +typedef cv::Ptr Ptr_GeneralizedHoughBallard; +typedef cv::Ptr Ptr_GeneralizedHoughGuil; + + // ---------------------------------------------------------------------------- // PREDECLARATIONS @@ -527,6 +546,15 @@ class Bridge { Bridge& operator=(const Ptr_float& ) { return *this; } Ptr_float toPtrFloat() { return Ptr_float(); } operator Ptr_float() { return toPtrFloat(); } + + // --------------------------- Ptr_GeneralizedHoughBallard -------------- + Bridge& operator=(const Ptr_GeneralizedHoughBallard& obj) { return *this; } + operator Ptr_GeneralizedHoughBallard() { return Ptr_GeneralizedHoughBallard(); } + + // --------------------------- Ptr_GeneralizedHoughGuil ---------------------- + Bridge& operator=(const Ptr_GeneralizedHoughGuil& obj) { return *this; } + operator Ptr_GeneralizedHoughGuil() { return Ptr_GeneralizedHoughGuil(); } + }; // class Bridge