Skip to content

Commit 62c969d

Browse files
committed
Merge pull request #2349 from alalek:fix_contrib_2346
2 parents 1082888 + ad8f000 commit 62c969d

File tree

5 files changed

+21
-11
lines changed

5 files changed

+21
-11
lines changed

modules/ximgproc/src/structured_edge_detection.cpp

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,24 @@
3737
//
3838
//M*/
3939

40+
#include "precomp.hpp"
41+
4042
#include <vector>
4143
#include <algorithm>
4244
#include <iterator>
4345
#include <iostream>
4446
#include <cmath>
4547

46-
#include "precomp.hpp"
47-
4848
#include "advanced_types.hpp"
4949

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+
5058
/********************* Helper functions *********************/
5159

5260
/*!
@@ -730,7 +738,7 @@ class StructuredEdgeDetectionImpl : public StructuredEdgeDetection
730738
}
731739
// lookup tables for mapping linear index to offset pairs
732740

733-
#ifdef CV_CXX11
741+
#if CV_USE_PARALLEL_PREDICT_EDGES_1
734742
parallel_for_(cv::Range(0, height), [&](const cv::Range& range)
735743
#else
736744
const cv::Range range(0, height);
@@ -779,7 +787,7 @@ class StructuredEdgeDetectionImpl : public StructuredEdgeDetection
779787
}
780788
}
781789
}
782-
#ifdef CV_CXX11
790+
#if CV_USE_PARALLEL_PREDICT_EDGES_1
783791
);
784792
#endif
785793

@@ -788,8 +796,10 @@ class StructuredEdgeDetectionImpl : public StructuredEdgeDetection
788796
dstM.setTo(0);
789797

790798
float step = 2.0f * CV_SQR(stride) / CV_SQR(ipSize) / nTreesEval;
791-
#ifdef CV_CXX11
799+
#if CV_USE_PARALLEL_PREDICT_EDGES_2
792800
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);
793803
#endif
794804
{
795805
for(int i = range.start; i < range.end; ++i)
@@ -814,7 +824,7 @@ class StructuredEdgeDetectionImpl : public StructuredEdgeDetection
814824
}
815825
}
816826
}
817-
#ifdef CV_CXX11
827+
#if CV_USE_PARALLEL_PREDICT_EDGES_2
818828
);
819829
#endif
820830

modules/ximgproc/test/test_edgeboxes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace opencv_test { namespace {
77

8-
TEST(ximpgroc_Edgeboxes, regression)
8+
TEST(ximgproc_Edgeboxes, regression)
99
{
1010
//Testing Edgeboxes implementation by asking for one proposal
1111
//on a simple test image from the PASCAL VOC 2012 dataset.

modules/ximgproc/test/test_structured_edge_detection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace opencv_test { namespace {
77

8-
TEST(ximpgroc_StructuredEdgeDetection, regression)
8+
TEST(ximgproc_StructuredEdgeDetection, regression)
99
{
1010
cv::String subfolder = "cv/ximgproc/";
1111
cv::String dir = cvtest::TS::ptr()->get_data_path() + subfolder;

modules/ximgproc/test/test_thinning.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ static int createTestImage(Mat& src)
1818
return src_pixels;
1919
}
2020

21-
TEST(ximpgroc_Thinning, simple_ZHANGSUEN)
21+
TEST(ximgproc_Thinning, simple_ZHANGSUEN)
2222
{
2323
Mat src;
2424
int src_pixels = createTestImage(src);
@@ -33,7 +33,7 @@ TEST(ximpgroc_Thinning, simple_ZHANGSUEN)
3333
#endif
3434
}
3535

36-
TEST(ximpgroc_Thinning, simple_GUOHALL)
36+
TEST(ximgproc_Thinning, simple_GUOHALL)
3737
{
3838
Mat src;
3939
int src_pixels = createTestImage(src);

modules/ximgproc/tutorials/training.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Training pipeline
103103

104104
-# The final step is converting trained model from Matlab binary format to YAML which you can use
105105
with our ocv::StructuredEdgeDetection. For this purpose run
106-
opencv_contrib/ximpgroc/tutorials/scripts/modelConvert(model, "model.yml")
106+
opencv_contrib/ximgproc/tutorials/scripts/modelConvert(model, "model.yml")
107107

108108
How to use your model
109109
---------------------

0 commit comments

Comments
 (0)