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
ad4d6bed
Commit
ad4d6bed
authored
Apr 30, 2013
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored gpu::GeneralizedHough
parent
4087a45e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
27 deletions
+13
-27
gpuimgproc.hpp
modules/gpuimgproc/include/opencv2/gpuimgproc.hpp
+7
-21
perf_hough.cpp
modules/gpuimgproc/perf/perf_hough.cpp
+1
-1
hough.cpp
modules/gpuimgproc/src/hough.cpp
+0
-0
test_hough.cpp
modules/gpuimgproc/test/test_hough.cpp
+2
-2
generalized_hough.cpp
samples/gpu/generalized_hough.cpp
+3
-3
No files found.
modules/gpuimgproc/include/opencv2/gpuimgproc.hpp
View file @
ad4d6bed
...
...
@@ -344,34 +344,20 @@ inline void HoughCircles(InputArray src, OutputArray circles, int /*method*/, fl
//! finds arbitrary template in the grayscale image using Generalized Hough Transform
//! Ballard, D.H. (1981). Generalizing the Hough transform to detect arbitrary shapes. Pattern Recognition 13 (2): 111-122.
//! Guil, N., González-Linares, J.M. and Zapata, E.L. (1999). Bidimensional shape detection using an invariant approach. Pattern Recognition 32 (6): 1025-1038.
class
CV_EXPORTS
GeneralizedHough
_GPU
:
public
cv
::
Algorithm
class
CV_EXPORTS
GeneralizedHough
:
public
Algorithm
{
public
:
static
Ptr
<
GeneralizedHough_GPU
>
create
(
int
method
);
GeneralizedHough_GPU
();
virtual
~
GeneralizedHough_GPU
();
static
Ptr
<
GeneralizedHough
>
create
(
int
method
);
//! set template to search
v
oid
setTemplate
(
const
GpuMat
&
templ
,
int
cannyThreshold
=
100
,
Point
templCenter
=
Point
(
-
1
,
-
1
))
;
v
oid
setTemplate
(
const
GpuMat
&
edges
,
const
GpuMat
&
dx
,
const
GpuMat
&
dy
,
Point
templCenter
=
Point
(
-
1
,
-
1
))
;
v
irtual
void
setTemplate
(
InputArray
templ
,
int
cannyThreshold
=
100
,
Point
templCenter
=
Point
(
-
1
,
-
1
))
=
0
;
v
irtual
void
setTemplate
(
InputArray
edges
,
InputArray
dx
,
InputArray
dy
,
Point
templCenter
=
Point
(
-
1
,
-
1
))
=
0
;
//! find template on image
void
detect
(
const
GpuMat
&
image
,
GpuMat
&
positions
,
int
cannyThreshold
=
100
);
void
detect
(
const
GpuMat
&
edges
,
const
GpuMat
&
dx
,
const
GpuMat
&
dy
,
GpuMat
&
positions
);
void
download
(
const
GpuMat
&
d_positions
,
OutputArray
h_positions
,
OutputArray
h_votes
=
noArray
());
void
release
();
virtual
void
detect
(
InputArray
image
,
OutputArray
positions
,
int
cannyThreshold
=
100
)
=
0
;
virtual
void
detect
(
InputArray
edges
,
InputArray
dx
,
InputArray
dy
,
OutputArray
positions
)
=
0
;
protected
:
virtual
void
setTemplateImpl
(
const
GpuMat
&
edges
,
const
GpuMat
&
dx
,
const
GpuMat
&
dy
,
Point
templCenter
)
=
0
;
virtual
void
detectImpl
(
const
GpuMat
&
edges
,
const
GpuMat
&
dx
,
const
GpuMat
&
dy
,
GpuMat
&
positions
)
=
0
;
virtual
void
releaseImpl
()
=
0
;
private
:
GpuMat
edges_
;
Ptr
<
CannyEdgeDetector
>
canny_
;
virtual
void
downloadResults
(
InputArray
d_positions
,
OutputArray
h_positions
,
OutputArray
h_votes
=
noArray
())
=
0
;
};
////////////////////////// Corners Detection ///////////////////////////
...
...
modules/gpuimgproc/perf/perf_hough.cpp
View file @
ad4d6bed
...
...
@@ -286,7 +286,7 @@ PERF_TEST_P(Method_Sz, GeneralizedHough,
const
cv
::
gpu
::
GpuMat
d_dy
(
dy
);
cv
::
gpu
::
GpuMat
posAndVotes
;
cv
::
Ptr
<
cv
::
gpu
::
GeneralizedHough
_GPU
>
d_hough
=
cv
::
gpu
::
GeneralizedHough_GPU
::
create
(
method
);
cv
::
Ptr
<
cv
::
gpu
::
GeneralizedHough
>
d_hough
=
cv
::
gpu
::
GeneralizedHough
::
create
(
method
);
if
(
method
&
GHT_ROTATION
)
{
d_hough
->
set
(
"maxAngle"
,
90.0
);
...
...
modules/gpuimgproc/src/hough.cpp
View file @
ad4d6bed
This diff is collapsed.
Click to expand it.
modules/gpuimgproc/test/test_hough.cpp
View file @
ad4d6bed
...
...
@@ -218,7 +218,7 @@ GPU_TEST_P(GeneralizedHough, POSITION)
templ
.
copyTo
(
imageROI
);
}
cv
::
Ptr
<
cv
::
gpu
::
GeneralizedHough
_GPU
>
hough
=
cv
::
gpu
::
GeneralizedHough_GPU
::
create
(
cv
::
GeneralizedHough
::
GHT_POSITION
);
cv
::
Ptr
<
cv
::
gpu
::
GeneralizedHough
>
hough
=
cv
::
gpu
::
GeneralizedHough
::
create
(
cv
::
GeneralizedHough
::
GHT_POSITION
);
hough
->
set
(
"votesThreshold"
,
200
);
hough
->
setTemplate
(
loadMat
(
templ
,
useRoi
));
...
...
@@ -227,7 +227,7 @@ GPU_TEST_P(GeneralizedHough, POSITION)
hough
->
detect
(
loadMat
(
image
,
useRoi
),
d_pos
);
std
::
vector
<
cv
::
Vec4f
>
pos
;
hough
->
download
(
d_pos
,
pos
);
hough
->
download
Results
(
d_pos
,
pos
);
ASSERT_EQ
(
gold_count
,
pos
.
size
());
...
...
samples/gpu/generalized_hough.cpp
View file @
ad4d6bed
...
...
@@ -11,7 +11,7 @@
using
namespace
std
;
using
namespace
cv
;
using
namespace
cv
::
gpu
;
using
cv
::
gpu
::
GpuMat
;
static
Mat
loadImage
(
const
string
&
name
)
{
...
...
@@ -101,7 +101,7 @@ int main(int argc, const char* argv[])
GpuMat
d_image
(
image
);
GpuMat
d_position
;
Ptr
<
GeneralizedHough_GPU
>
d_hough
=
GeneralizedHough_GPU
::
create
(
method
);
Ptr
<
gpu
::
GeneralizedHough
>
d_hough
=
gpu
::
GeneralizedHough
::
create
(
method
);
d_hough
->
set
(
"minDist"
,
minDist
);
d_hough
->
set
(
"levels"
,
levels
);
d_hough
->
set
(
"dp"
,
dp
);
...
...
@@ -134,7 +134,7 @@ int main(int argc, const char* argv[])
tm
.
start
();
d_hough
->
detect
(
d_image
,
d_position
);
d_hough
->
download
(
d_position
,
position
);
d_hough
->
download
Results
(
d_position
,
position
);
tm
.
stop
();
}
...
...
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