Salome HOME
spns #32755 : TopIIVolMesh: move back to master branch
[tools/sat_salome.git] / products / patches / GEOM-9.3.0-opencv_windows.patch
1 diff --git a/src/ShapeRecognition/ShapeRec_FeatureDetector.cxx b/src/ShapeRecognition/ShapeRec_FeatureDetector.cxx
2 index a56e18f7f..a59aaee76 100644
3 --- a/src/ShapeRecognition/ShapeRec_FeatureDetector.cxx
4 +++ b/src/ShapeRecognition/ShapeRec_FeatureDetector.cxx
5 @@ -26,6 +26,12 @@
6  #include "ShapeRec_FeatureDetector.hxx"
7  #include <stdio.h>
8  #include "utilities.h"
9 +#include <opencv2/core/version.hpp>
10 +
11 +
12 +#if CV_MAJOR_VERSION == 3
13 +#define cvCvtPixToPlane cvSplit
14 +#endif
15  
16  // TODO : All the following methods but ComputeContours use the C API of OpenCV while ComputContours
17  // uses the C++ API of the library.
18 @@ -233,7 +239,12 @@ bool ShapeRec_FeatureDetector::ComputeContours( bool useROI, ShapeRec_Parameters
19      cvReleaseImage(&input_splane);
20      cvReleaseImage(&backproject);
21    
22 -    detected_edges = cv::Mat(binary_backproject);
23 +
24 +#if CV_MAJOR_VERSION == 3
25 +    detected_edges = cv::cvarrToMat(binary_backproject);
26 +#else
27 +     detected_edges = cv::Mat(binary_backproject);
28 +#endif
29    }
30    // else if ( detection_method == RIDGE_DETECTOR )  // Method adapted for engineering drawings (e.g. watershed functionality could be used here cf.OpenCV documentation and samples)
31    // {