37
37
//
38
38
//M*/
39
39
40
+ #include " precomp.hpp"
41
+
40
42
#include < vector>
41
43
#include < algorithm>
42
44
#include < iterator>
43
45
#include < iostream>
44
46
#include < cmath>
45
47
46
- #include " precomp.hpp"
47
-
48
48
#include " advanced_types.hpp"
49
49
50
+ #ifdef CV_CXX11
51
+ #define CV_USE_PARALLEL_PREDICT_EDGES_1 1
52
+ #define CV_USE_PARALLEL_PREDICT_EDGES_2 0 // 1, see https://github.com/opencv/opencv_contrib/issues/2346
53
+ #else
54
+ #define CV_USE_PARALLEL_PREDICT_EDGES_1 0
55
+ #define CV_USE_PARALLEL_PREDICT_EDGES_2 0
56
+ #endif
57
+
50
58
/* ******************** Helper functions *********************/
51
59
52
60
/* !
@@ -730,7 +738,7 @@ class StructuredEdgeDetectionImpl : public StructuredEdgeDetection
730
738
}
731
739
// lookup tables for mapping linear index to offset pairs
732
740
733
- #ifdef CV_CXX11
741
+ #if CV_USE_PARALLEL_PREDICT_EDGES_1
734
742
parallel_for_ (cv::Range (0 , height), [&](const cv::Range& range)
735
743
#else
736
744
const cv::Range range (0 , height);
@@ -779,7 +787,7 @@ class StructuredEdgeDetectionImpl : public StructuredEdgeDetection
779
787
}
780
788
}
781
789
}
782
- #ifdef CV_CXX11
790
+ #if CV_USE_PARALLEL_PREDICT_EDGES_1
783
791
);
784
792
#endif
785
793
@@ -788,8 +796,10 @@ class StructuredEdgeDetectionImpl : public StructuredEdgeDetection
788
796
dstM.setTo (0 );
789
797
790
798
float step = 2 .0f * CV_SQR (stride) / CV_SQR (ipSize) / nTreesEval;
791
- #ifdef CV_CXX11
799
+ #if CV_USE_PARALLEL_PREDICT_EDGES_2
792
800
parallel_for_ (cv::Range (0 , height), [&](const cv::Range& range)
801
+ #elif CV_USE_PARALLEL_PREDICT_EDGES_1
802
+ const cv::Range range (0 , height);
793
803
#endif
794
804
{
795
805
for (int i = range.start ; i < range.end ; ++i)
@@ -814,7 +824,7 @@ class StructuredEdgeDetectionImpl : public StructuredEdgeDetection
814
824
}
815
825
}
816
826
}
817
- #ifdef CV_CXX11
827
+ #if CV_USE_PARALLEL_PREDICT_EDGES_2
818
828
);
819
829
#endif
820
830
0 commit comments