From 9382f0ed39751af8520b53b6dc8ab8a8a96c2c6e Mon Sep 17 00:00:00 2001 From: DirtyMaster Date: Mon, 31 Aug 2015 10:42:48 +0200 Subject: [PATCH] Parallelize edges detection --- modules/ximgproc/src/structured_edge_detection.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/ximgproc/src/structured_edge_detection.cpp b/modules/ximgproc/src/structured_edge_detection.cpp index f61bda665..69edf4e37 100644 --- a/modules/ximgproc/src/structured_edge_detection.cpp +++ b/modules/ximgproc/src/structured_edge_detection.cpp @@ -549,7 +549,9 @@ protected: offsetY[n] = x2*features.cols*nchannels + y2*nchannels + z; } // lookup tables for mapping linear index to offset pairs - + #ifdef _OPENMP + #pragma omp parallel for + #endif for (int i = 0; i < height; ++i) { float *regFeaturesPtr = regFeatures.ptr(i*stride/shrink); @@ -599,6 +601,9 @@ protected: dstM.setTo(0); float step = 2.0f * CV_SQR(stride) / CV_SQR(ipSize) / nTreesEval; + #ifdef _OPENMP + #pragma omp parallel for + #endif for (int i = 0; i < height; ++i) { int *pIndex = indexes.ptr(i);