Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
22f0ea0c
Commit
22f0ea0c
authored
Nov 13, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ximgproc: avoid data race in StructuredEdgeDetection::detectEdges()
parent
6ae9809b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
structured_edge_detection.cpp
modules/ximgproc/src/structured_edge_detection.cpp
+16
-6
No files found.
modules/ximgproc/src/structured_edge_detection.cpp
View file @
22f0ea0c
...
...
@@ -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 *********************/
/*!
...
...
@@ -730,7 +738,7 @@ protected:
}
// lookup tables for mapping linear index to offset pairs
#if
def CV_CXX1
1
#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:
}
}
}
#if
def CV_CXX1
1
#if
CV_USE_PARALLEL_PREDICT_EDGES_
1
);
#endif
...
...
@@ -788,8 +796,10 @@ protected:
dstM
.
setTo
(
0
);
float
step
=
2.0
f
*
CV_SQR
(
stride
)
/
CV_SQR
(
ipSize
)
/
nTreesEval
;
#if
def 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:
}
}
}
#if
def CV_CXX11
#if
CV_USE_PARALLEL_PREDICT_EDGES_2
);
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment