From: Nabil Ghodbane Date: Mon, 26 Jul 2021 09:21:56 +0000 (+0200) Subject: backport opencv 3.2 patch fix - aimed to build ALAMOS-9.3.0 -windows X-Git-Tag: V9_8_0~121 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e0ab4a13da3a02e4f8d9840670fb813661024da2;p=tools%2Fsat_salome.git backport opencv 3.2 patch fix - aimed to build ALAMOS-9.3.0 -windows --- diff --git a/products/patches/GEOM-9.3.0-opencv_windows.patch b/products/patches/GEOM-9.3.0-opencv_windows.patch new file mode 100644 index 0000000..de7d7ff --- /dev/null +++ b/products/patches/GEOM-9.3.0-opencv_windows.patch @@ -0,0 +1,31 @@ +diff --git a/src/ShapeRecognition/ShapeRec_FeatureDetector.cxx b/src/ShapeRecognition/ShapeRec_FeatureDetector.cxx +index a56e18f7f..a59aaee76 100644 +--- a/src/ShapeRecognition/ShapeRec_FeatureDetector.cxx ++++ b/src/ShapeRecognition/ShapeRec_FeatureDetector.cxx +@@ -26,6 +26,12 @@ + #include "ShapeRec_FeatureDetector.hxx" + #include + #include "utilities.h" ++#include ++ ++ ++#if CV_MAJOR_VERSION == 3 ++#define cvCvtPixToPlane cvSplit ++#endif + + // TODO : All the following methods but ComputeContours use the C API of OpenCV while ComputContours + // uses the C++ API of the library. +@@ -233,7 +239,12 @@ bool ShapeRec_FeatureDetector::ComputeContours( bool useROI, ShapeRec_Parameters + cvReleaseImage(&input_splane); + cvReleaseImage(&backproject); + +- detected_edges = cv::Mat(binary_backproject); ++ ++#if CV_MAJOR_VERSION == 3 ++ detected_edges = cv::cvarrToMat(binary_backproject); ++#else ++ detected_edges = cv::Mat(binary_backproject); ++#endif + } + // else if ( detection_method == RIDGE_DETECTOR ) // Method adapted for engineering drawings (e.g. watershed functionality could be used here cf.OpenCV documentation and samples) + // {