diff --git a/modules/matlab/CMakeLists.txt b/modules/matlab/CMakeLists.txt index 3a5c6d12f..a4c1c3b16 100644 --- a/modules/matlab/CMakeLists.txt +++ b/modules/matlab/CMakeLists.txt @@ -104,7 +104,11 @@ set(RST_PARSER_PATH ${CMAKE_SOURCE_DIR}/modules/java/generator) # set mex compiler options prepend("-I" MEX_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include) -prepend("-L" MEX_LIB_DIR ${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR} ) +if (MSVC) + prepend("-L" MEX_LIB_DIR ${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}) +else() + prepend("-L" MEX_LIB_DIR ${LIBRARY_OUTPUT_PATH}) +endif() set(MEX_OPTS "-largeArrayDims") if (BUILD_TESTS) diff --git a/modules/matlab/generator/templates/functional.cpp b/modules/matlab/generator/templates/functional.cpp index 9f3a99538..b019a1300 100644 --- a/modules/matlab/generator/templates/functional.cpp +++ b/modules/matlab/generator/templates/functional.cpp @@ -110,7 +110,7 @@ addVariant("{{ fun.name }}", {{ fun.req|inputs|length }}, {{ fun.opt|inputs|leng {{arg.tp}} {{arg.name}} = inputs[{{ loop.index0 }}].to{{arg.tp|toUpperCamelCase}}(); {% endfor %} {% for opt in fun.opt|inputs %} - {{opt.tp}} {{opt.name}} = inputs[{{loop.index0 + fun.req|inputs|length}}].empty() ? {% if opt.ref == '*' -%} {{opt.tp}}() {%- else -%} {{opt.default}} {%- endif %} : inputs[{{loop.index0 + fun.req|inputs|length}}].to{{opt.tp|toUpperCamelCase}}(); + {{opt.tp}} {{opt.name}} = inputs[{{loop.index0 + fun.req|inputs|length}}].empty() ? ({{opt.tp}}) {% if opt.ref == '*' -%} {{opt.tp}}() {%- else -%} {{opt.default}} {%- endif %} : inputs[{{loop.index0 + fun.req|inputs|length}}].to{{opt.tp|toUpperCamelCase}}(); {% endfor %} {# ----------- Outputs ------------ #} {% for arg in fun.req|only|outputs %} diff --git a/modules/matlab/include/opencv2/matlab/bridge.hpp b/modules/matlab/include/opencv2/matlab/bridge.hpp index ca8ebd6a4..e38053c2c 100644 --- a/modules/matlab/include/opencv2/matlab/bridge.hpp +++ b/modules/matlab/include/opencv2/matlab/bridge.hpp @@ -49,6 +49,7 @@ #include #include #include +#include namespace cv { namespace bridge { @@ -71,6 +72,18 @@ typedef cv::Ptr Ptr_StereoBM; typedef cv::Ptr Ptr_StereoSGBM; typedef cv::Ptr Ptr_FeatureDetector; typedef cv::Ptr Ptr_CLAHE; +typedef cv::Ptr Ptr_LineSegmentDetector; +typedef cv::Ptr Ptr_AlignMTB; +typedef cv::Ptr Ptr_CalibrateDebevec; +typedef cv::Ptr Ptr_CalibrateRobertson; +typedef cv::Ptr Ptr_MergeDebevec; +typedef cv::Ptr Ptr_MergeMertens; +typedef cv::Ptr Ptr_MergeRobertson; +typedef cv::Ptr Ptr_Tonemap; +typedef cv::Ptr Ptr_TonemapDrago; +typedef cv::Ptr Ptr_TonemapDurand; +typedef cv::Ptr Ptr_TonemapMantiuk; +typedef cv::Ptr Ptr_TonemapReinhard; // ---------------------------------------------------------------------------- @@ -419,6 +432,66 @@ public: Bridge& operator=(const Ptr_CLAHE& ) { return *this; } Ptr_CLAHE toPtrCLAHE() { return Ptr_CLAHE(); } operator Ptr_CLAHE() { return toPtrCLAHE(); } + + // --------------------------- Ptr_LineSegmentDetector ------------------ + Bridge& operator=(const Ptr_LineSegmentDetector& ) { return *this; } + Ptr_LineSegmentDetector toPtrLineSegmentDetector() { return Ptr_LineSegmentDetector(); } + operator Ptr_LineSegmentDetector() { return toPtrLineSegmentDetector(); } + + // --------------------------- Ptr_AlignMTB ----------------------------- + Bridge& operator=(const Ptr_AlignMTB& ) { return *this; } + Ptr_AlignMTB toPtrAlignMTB() { return Ptr_AlignMTB(); } + operator Ptr_AlignMTB() { return toPtrAlignMTB(); } + + // --------------------------- Ptr_CalibrateDebevec ------------------- + Bridge& operator=(const Ptr_CalibrateDebevec& ) { return *this; } + Ptr_CalibrateDebevec toPtrCalibrateDebevec() { return Ptr_CalibrateDebevec(); } + operator Ptr_CalibrateDebevec() { return toPtrCalibrateDebevec(); } + + // --------------------------- Ptr_CalibrateRobertson ------------------- + Bridge& operator=(const Ptr_CalibrateRobertson& ) { return *this; } + Ptr_CalibrateRobertson toPtrCalibrateRobertson() { return Ptr_CalibrateRobertson(); } + operator Ptr_CalibrateRobertson() { return toPtrCalibrateRobertson(); } + + // --------------------------- Ptr_MergeDebevec ----------------------- + Bridge& operator=(const Ptr_MergeDebevec& ) { return *this; } + Ptr_MergeDebevec toPtrMergeDebevec() { return Ptr_MergeDebevec(); } + operator Ptr_MergeDebevec() { return toPtrMergeDebevec(); } + + // --------------------------- Ptr_MergeMertens ----------------------- + Bridge& operator=(const Ptr_MergeMertens& ) { return *this; } + Ptr_MergeMertens toPtrMergeMertens() { return Ptr_MergeMertens(); } + operator Ptr_MergeMertens() { return toPtrMergeMertens(); } + + // --------------------------- Ptr_MergeRobertson ----------------------- + Bridge& operator=(const Ptr_MergeRobertson& ) { return *this; } + Ptr_MergeRobertson toPtrMergeRobertson() { return Ptr_MergeRobertson(); } + operator Ptr_MergeRobertson() { return toPtrMergeRobertson(); } + + // --------------------------- Ptr_Tonemap ------------------------------ + Bridge& operator=(const Ptr_Tonemap& ) { return *this; } + Ptr_Tonemap toPtrTonemap() { return Ptr_Tonemap(); } + operator Ptr_Tonemap() { return toPtrTonemap(); } + + // --------------------------- Ptr_TonemapDrago ------------------------- + Bridge& operator=(const Ptr_TonemapDrago& ) { return *this; } + Ptr_TonemapDrago toPtrTonemapDrago() { return Ptr_TonemapDrago(); } + operator Ptr_TonemapDrago() { return toPtrTonemapDrago(); } + + // --------------------------- Ptr_TonemapDurand ------------------------ + Bridge& operator=(const Ptr_TonemapDurand& ) { return *this; } + Ptr_TonemapDurand toPtrTonemapDurand() { return Ptr_TonemapDurand(); } + operator Ptr_TonemapDurand() { return toPtrTonemapDurand(); } + + // --------------------------- Ptr_TonemapMantiuk ----------------------- + Bridge& operator=(const Ptr_TonemapMantiuk& ) { return *this; } + Ptr_TonemapMantiuk toPtrTonemapMantiuk() { return Ptr_TonemapMantiuk(); } + operator Ptr_TonemapMantiuk() { return toPtrTonemapMantiuk(); } + + // --------------------------- Ptr_TonemapReinhard ---------------------- + Bridge& operator=(const Ptr_TonemapReinhard& ) { return *this; } + Ptr_TonemapReinhard toPtrTonemapReinhard() { return Ptr_TonemapReinhard(); } + operator Ptr_TonemapReinhard() { return toPtrTonemapReinhard(); } }; // class Bridge