Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Commits
24098128
Commit
24098128
authored
Feb 18, 2014
by
Roman Donchenko
Committed by
OpenCV Buildbot
Feb 18, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2347 from Chechli:master
parents
139a2620
768da4d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
hough_circles.cpp
modules/cudaimgproc/src/hough_circles.cpp
+18
-1
precomp.hpp
modules/cudaimgproc/src/precomp.hpp
+1
-0
No files found.
modules/cudaimgproc/src/hough_circles.cpp
View file @
24098128
...
...
@@ -133,6 +133,7 @@ namespace
GpuMat
dx_
,
dy_
;
GpuMat
edges_
;
GpuMat
accum_
;
Mat
tt
;
//CPU copy of accum_
GpuMat
list_
;
GpuMat
result_
;
Ptr
<
cuda
::
Filter
>
filterDx_
;
...
...
@@ -140,6 +141,8 @@ namespace
Ptr
<
cuda
::
CannyEdgeDetector
>
canny_
;
};
bool
centersCompare
(
Vec3f
a
,
Vec3f
b
)
{
return
(
a
[
2
]
>
b
[
2
]);}
HoughCirclesDetectorImpl
::
HoughCirclesDetectorImpl
(
float
dp
,
float
minDist
,
int
cannyThreshold
,
int
votesThreshold
,
int
minRadius
,
int
maxRadius
,
int
maxCircles
)
:
dp_
(
dp
),
minDist_
(
minDist
),
cannyThreshold_
(
cannyThreshold
),
votesThreshold_
(
votesThreshold
),
...
...
@@ -193,6 +196,8 @@ namespace
circlesAccumCenters_gpu
(
srcPoints
,
pointsCount
,
dx_
,
dy_
,
accum_
,
minRadius_
,
maxRadius_
,
idp
);
accum_
.
download
(
tt
);
int
centersCount
=
buildCentersList_gpu
(
accum_
,
centers
,
votesThreshold_
);
if
(
centersCount
==
0
)
{
...
...
@@ -219,9 +224,21 @@ namespace
const
float
minDist2
=
minDist_
*
minDist_
;
vector
<
Vec3f
>
sortBuf
;
for
(
int
i
=
0
;
i
<
centersCount
;
i
++
){
Vec3f
temp
;
temp
[
0
]
=
oldBuf
[
i
].
x
;
temp
[
1
]
=
oldBuf
[
i
].
y
;
temp
[
2
]
=
tt
.
at
<
int
>
(
temp
[
1
]
+
1
,
temp
[
0
]
+
1
);
sortBuf
.
push_back
(
temp
);
}
std
::
sort
(
sortBuf
.
begin
(),
sortBuf
.
end
(),
centersCompare
);
for
(
int
i
=
0
;
i
<
centersCount
;
++
i
)
{
ushort2
p
=
oldBuf
[
i
];
ushort2
p
;
p
.
x
=
sortBuf
[
i
][
0
];
p
.
y
=
sortBuf
[
i
][
1
];
bool
good
=
true
;
...
...
modules/cudaimgproc/src/precomp.hpp
View file @
24098128
...
...
@@ -60,5 +60,6 @@
#endif
#include <limits>
#include <algorithm>
#endif
/* __OPENCV_PRECOMP_H__ */
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