diff --git a/modules/ximgproc/src/structured_edge_detection.cpp b/modules/ximgproc/src/structured_edge_detection.cpp index 795dd8d67..9c3044fbf 100644 --- a/modules/ximgproc/src/structured_edge_detection.cpp +++ b/modules/ximgproc/src/structured_edge_detection.cpp @@ -37,16 +37,24 @@ // //M*/ +#include "precomp.hpp" + #include #include #include #include #include -#include "precomp.hpp" - #include "advanced_types.hpp" +#ifdef CV_CXX11 +#define CV_USE_PARALLEL_PREDICT_EDGES_1 1 +#define CV_USE_PARALLEL_PREDICT_EDGES_2 0 //1, see https://github.com/opencv/opencv_contrib/issues/2346 +#else +#define CV_USE_PARALLEL_PREDICT_EDGES_1 0 +#define CV_USE_PARALLEL_PREDICT_EDGES_2 0 +#endif + /********************* Helper functions *********************/ /*! @@ -730,7 +738,7 @@ protected: } // lookup tables for mapping linear index to offset pairs - #ifdef CV_CXX11 + #if CV_USE_PARALLEL_PREDICT_EDGES_1 parallel_for_(cv::Range(0, height), [&](const cv::Range& range) #else const cv::Range range(0, height); @@ -779,7 +787,7 @@ protected: } } } - #ifdef CV_CXX11 + #if CV_USE_PARALLEL_PREDICT_EDGES_1 ); #endif @@ -788,8 +796,10 @@ protected: dstM.setTo(0); float step = 2.0f * CV_SQR(stride) / CV_SQR(ipSize) / nTreesEval; - #ifdef CV_CXX11 + #if CV_USE_PARALLEL_PREDICT_EDGES_2 parallel_for_(cv::Range(0, height), [&](const cv::Range& range) + #elif CV_USE_PARALLEL_PREDICT_EDGES_1 + const cv::Range range(0, height); #endif { for(int i = range.start; i < range.end; ++i) @@ -814,7 +824,7 @@ protected: } } } - #ifdef CV_CXX11 + #if CV_USE_PARALLEL_PREDICT_EDGES_2 ); #endif diff --git a/modules/ximgproc/test/test_edgeboxes.cpp b/modules/ximgproc/test/test_edgeboxes.cpp index 070be308a..03e95637b 100644 --- a/modules/ximgproc/test/test_edgeboxes.cpp +++ b/modules/ximgproc/test/test_edgeboxes.cpp @@ -5,7 +5,7 @@ namespace opencv_test { namespace { -TEST(ximpgroc_Edgeboxes, regression) +TEST(ximgproc_Edgeboxes, regression) { //Testing Edgeboxes implementation by asking for one proposal //on a simple test image from the PASCAL VOC 2012 dataset. diff --git a/modules/ximgproc/test/test_structured_edge_detection.cpp b/modules/ximgproc/test/test_structured_edge_detection.cpp index b10e14d0d..3ff44a663 100644 --- a/modules/ximgproc/test/test_structured_edge_detection.cpp +++ b/modules/ximgproc/test/test_structured_edge_detection.cpp @@ -5,7 +5,7 @@ namespace opencv_test { namespace { -TEST(ximpgroc_StructuredEdgeDetection, regression) +TEST(ximgproc_StructuredEdgeDetection, regression) { cv::String subfolder = "cv/ximgproc/"; cv::String dir = cvtest::TS::ptr()->get_data_path() + subfolder; diff --git a/modules/ximgproc/test/test_thinning.cpp b/modules/ximgproc/test/test_thinning.cpp index 6e61a3e25..733fe85d4 100644 --- a/modules/ximgproc/test/test_thinning.cpp +++ b/modules/ximgproc/test/test_thinning.cpp @@ -18,7 +18,7 @@ static int createTestImage(Mat& src) return src_pixels; } -TEST(ximpgroc_Thinning, simple_ZHANGSUEN) +TEST(ximgproc_Thinning, simple_ZHANGSUEN) { Mat src; int src_pixels = createTestImage(src); @@ -33,7 +33,7 @@ TEST(ximpgroc_Thinning, simple_ZHANGSUEN) #endif } -TEST(ximpgroc_Thinning, simple_GUOHALL) +TEST(ximgproc_Thinning, simple_GUOHALL) { Mat src; int src_pixels = createTestImage(src); diff --git a/modules/ximgproc/tutorials/training.markdown b/modules/ximgproc/tutorials/training.markdown index 826e08e02..382aafbcb 100644 --- a/modules/ximgproc/tutorials/training.markdown +++ b/modules/ximgproc/tutorials/training.markdown @@ -103,7 +103,7 @@ Training pipeline -# The final step is converting trained model from Matlab binary format to YAML which you can use with our ocv::StructuredEdgeDetection. For this purpose run - opencv_contrib/ximpgroc/tutorials/scripts/modelConvert(model, "model.yml") + opencv_contrib/ximgproc/tutorials/scripts/modelConvert(model, "model.yml") How to use your model ---------------------