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
4d633622
Commit
4d633622
authored
Sep 30, 2014
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3278 from akarsakov:ocl_houghlines_perf_test
parents
148e64d4
4880dd0c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
92 additions
and
0 deletions
+92
-0
perf_houghLines.cpp
modules/imgproc/perf/opencl/perf_houghLines.cpp
+92
-0
No files found.
modules/imgproc/perf/opencl/perf_houghLines.cpp
0 → 100644
View file @
4d633622
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
// Copyright (C) 2014, Itseez, Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
#include "../perf_precomp.hpp"
#include "opencv2/ts/ocl_perf.hpp"
#ifdef HAVE_OPENCL
namespace
cvtest
{
namespace
ocl
{
///////////// HoughLines //////////////////////
struct
Vec2fComparator
{
bool
operator
()(
const
Vec2f
&
a
,
const
Vec2f
b
)
const
{
if
(
a
[
0
]
!=
b
[
0
])
return
a
[
0
]
<
b
[
0
];
else
return
a
[
1
]
<
b
[
1
];
}
};
typedef
std
::
tr1
::
tuple
<
Size
,
double
,
double
>
ImageSize_RhoStep_ThetaStep_t
;
typedef
TestBaseWithParam
<
ImageSize_RhoStep_ThetaStep_t
>
HoughLinesFixture
;
OCL_PERF_TEST_P
(
HoughLinesFixture
,
HoughLines
,
Combine
(
OCL_TEST_SIZES
,
Values
(
0.1
,
1
),
Values
(
CV_PI
/
180.0
,
0.1
)))
{
const
Size
srcSize
=
get
<
0
>
(
GetParam
());
double
rhoStep
=
get
<
1
>
(
GetParam
());
double
thetaStep
=
get
<
2
>
(
GetParam
());
int
threshold
=
250
;
UMat
usrc
(
srcSize
,
CV_8UC1
),
lines
(
1
,
1
,
CV_32FC2
);
Mat
src
(
srcSize
,
CV_8UC1
);
src
.
setTo
(
Scalar
::
all
(
0
));
line
(
src
,
Point
(
0
,
100
),
Point
(
src
.
cols
,
100
),
Scalar
::
all
(
255
),
1
);
line
(
src
,
Point
(
0
,
200
),
Point
(
src
.
cols
,
200
),
Scalar
::
all
(
255
),
1
);
line
(
src
,
Point
(
0
,
400
),
Point
(
src
.
cols
,
400
),
Scalar
::
all
(
255
),
1
);
line
(
src
,
Point
(
100
,
0
),
Point
(
100
,
src
.
rows
),
Scalar
::
all
(
255
),
1
);
line
(
src
,
Point
(
200
,
0
),
Point
(
200
,
src
.
rows
),
Scalar
::
all
(
255
),
1
);
line
(
src
,
Point
(
400
,
0
),
Point
(
400
,
src
.
rows
),
Scalar
::
all
(
255
),
1
);
src
.
copyTo
(
usrc
);
declare
.
in
(
usrc
).
out
(
lines
);
OCL_TEST_CYCLE
()
cv
::
HoughLines
(
usrc
,
lines
,
rhoStep
,
thetaStep
,
threshold
);
Mat
result
;
lines
.
copyTo
(
result
);
std
::
sort
(
result
.
begin
<
Vec2f
>
(),
result
.
end
<
Vec2f
>
(),
Vec2fComparator
());
SANITY_CHECK
(
result
,
1e-6
);
}
///////////// HoughLinesP /////////////////////
typedef
std
::
tr1
::
tuple
<
string
,
double
,
double
>
Image_RhoStep_ThetaStep_t
;
typedef
TestBaseWithParam
<
Image_RhoStep_ThetaStep_t
>
HoughLinesPFixture
;
OCL_PERF_TEST_P
(
HoughLinesPFixture
,
HoughLinesP
,
Combine
(
Values
(
"cv/shared/pic5.png"
,
"stitching/a1.png"
),
Values
(
0.1
,
1
),
Values
(
CV_PI
/
180.0
,
0.1
)))
{
string
filename
=
get
<
0
>
(
GetParam
());
double
rhoStep
=
get
<
1
>
(
GetParam
());
double
thetaStep
=
get
<
2
>
(
GetParam
());
int
threshold
=
100
;
double
minLineLength
=
50
,
maxGap
=
5
;
Mat
image
=
imread
(
getDataPath
(
filename
),
IMREAD_GRAYSCALE
);
Canny
(
image
,
image
,
50
,
200
,
3
);
UMat
usrc
,
lines
(
1
,
1
,
CV_32SC4
);
image
.
copyTo
(
usrc
);
declare
.
in
(
usrc
).
out
(
lines
);
OCL_TEST_CYCLE
()
cv
::
HoughLinesP
(
usrc
,
lines
,
rhoStep
,
thetaStep
,
threshold
,
minLineLength
,
maxGap
);
EXPECT_NE
((
int
)
lines
.
total
(),
0
);
SANITY_CHECK_NOTHING
();
}
}
}
// namespace cvtest::ocl
#endif // HAVE_OPENCL
\ No newline at end of file
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