Loading modules/ximgproc/src/structured_edge_detection.cpp +16 −6 Original line number Diff line number Diff line Loading @@ -37,16 +37,24 @@ // //M*/ #include "precomp.hpp" #include <vector> #include <algorithm> #include <iterator> #include <iostream> #include <cmath> #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 *********************/ /*! Loading Loading @@ -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); Loading Loading @@ -779,7 +787,7 @@ protected: } } } #ifdef CV_CXX11 #if CV_USE_PARALLEL_PREDICT_EDGES_1 ); #endif Loading @@ -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) Loading @@ -814,7 +824,7 @@ protected: } } } #ifdef CV_CXX11 #if CV_USE_PARALLEL_PREDICT_EDGES_2 ); #endif Loading modules/ximgproc/test/test_edgeboxes.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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. Loading modules/ximgproc/test/test_structured_edge_detection.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading modules/ximgproc/test/test_thinning.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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); Loading modules/ximgproc/tutorials/training.markdown +1 −1 Original line number Diff line number Diff line Loading @@ -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 --------------------- Loading Loading
modules/ximgproc/src/structured_edge_detection.cpp +16 −6 Original line number Diff line number Diff line Loading @@ -37,16 +37,24 @@ // //M*/ #include "precomp.hpp" #include <vector> #include <algorithm> #include <iterator> #include <iostream> #include <cmath> #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 *********************/ /*! Loading Loading @@ -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); Loading Loading @@ -779,7 +787,7 @@ protected: } } } #ifdef CV_CXX11 #if CV_USE_PARALLEL_PREDICT_EDGES_1 ); #endif Loading @@ -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) Loading @@ -814,7 +824,7 @@ protected: } } } #ifdef CV_CXX11 #if CV_USE_PARALLEL_PREDICT_EDGES_2 ); #endif Loading
modules/ximgproc/test/test_edgeboxes.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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. Loading
modules/ximgproc/test/test_structured_edge_detection.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading
modules/ximgproc/test/test_thinning.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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); Loading
modules/ximgproc/tutorials/training.markdown +1 −1 Original line number Diff line number Diff line Loading @@ -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 --------------------- Loading