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
22b0ea1c
Commit
22b0ea1c
authored
Oct 15, 2012
by
marina.kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sort for Hough sanity checks
parent
554a7cb3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
5 deletions
+35
-5
perf_imgproc.cpp
modules/gpu/perf/perf_imgproc.cpp
+35
-5
No files found.
modules/gpu/perf/perf_imgproc.cpp
View file @
22b0ea1c
...
...
@@ -1706,10 +1706,30 @@ PERF_TEST_P(Sz_Depth_Cn, ImgProc_ImagePyramidGetLayer, Combine(GPU_TYPICAL_MAT_S
}
}
namespace
{
struct
Vec3fComparator
{
bool
operator
()(
const
cv
::
Vec3f
&
a
,
const
cv
::
Vec3f
b
)
const
{
if
(
a
[
0
]
!=
b
[
0
])
return
a
[
0
]
<
b
[
0
];
else
if
(
a
[
1
]
!=
b
[
1
])
return
a
[
1
]
<
b
[
1
];
else
return
a
[
2
]
<
b
[
2
];
}
};
struct
Vec2fComparator
{
bool
operator
()(
const
cv
::
Vec2f
&
a
,
const
cv
::
Vec2f
b
)
const
{
if
(
a
[
0
]
!=
b
[
0
])
return
a
[
0
]
<
b
[
0
];
else
return
a
[
1
]
<
b
[
1
];
}
};
}
//////////////////////////////////////////////////////////////////////
// HoughLines
PERF_TEST_P
(
Sz
,
DISABLED_
ImgProc_HoughLines
,
GPU_TYPICAL_MAT_SIZES
)
PERF_TEST_P
(
Sz
,
ImgProc_HoughLines
,
GPU_TYPICAL_MAT_SIZES
)
{
declare
.
time
(
30.0
);
...
...
@@ -1744,7 +1764,11 @@ PERF_TEST_P(Sz, DISABLED_ImgProc_HoughLines, GPU_TYPICAL_MAT_SIZES)
cv
::
gpu
::
HoughLines
(
d_src
,
d_lines
,
d_buf
,
rho
,
theta
,
threshold
);
}
GPU_SANITY_CHECK
(
d_lines
);
cv
::
Mat
h_lines
(
d_lines
);
cv
::
Vec2f
*
begin
=
(
cv
::
Vec2f
*
)(
h_lines
.
ptr
<
char
>
(
0
));
cv
::
Vec2f
*
end
=
(
cv
::
Vec2f
*
)(
h_lines
.
ptr
<
char
>
(
0
)
+
(
h_lines
.
cols
)
*
2
*
sizeof
(
float
));
std
::
sort
(
begin
,
end
,
Vec2fComparator
());
SANITY_CHECK
(
h_lines
);
}
else
{
...
...
@@ -1756,7 +1780,8 @@ PERF_TEST_P(Sz, DISABLED_ImgProc_HoughLines, GPU_TYPICAL_MAT_SIZES)
cv
::
HoughLines
(
src
,
lines
,
rho
,
theta
,
threshold
);
}
CPU_SANITY_CHECK
(
lines
);
std
::
sort
(
lines
.
begin
(),
lines
.
end
(),
Vec2fComparator
());
SANITY_CHECK
(
lines
);
}
}
...
...
@@ -1804,7 +1829,11 @@ PERF_TEST_P(Sz_Dp_MinDist, ImgProc_HoughCircles, Combine(GPU_TYPICAL_MAT_SIZES,
cv
::
gpu
::
HoughCircles
(
d_src
,
d_circles
,
d_buf
,
CV_HOUGH_GRADIENT
,
dp
,
minDist
,
cannyThreshold
,
votesThreshold
,
minRadius
,
maxRadius
);
}
GPU_SANITY_CHECK
(
d_circles
);
cv
::
Mat
h_circles
(
d_circles
);
cv
::
Vec3f
*
begin
=
(
cv
::
Vec3f
*
)(
h_circles
.
ptr
<
char
>
(
0
));
cv
::
Vec3f
*
end
=
(
cv
::
Vec3f
*
)(
h_circles
.
ptr
<
char
>
(
0
)
+
(
h_circles
.
cols
)
*
3
*
sizeof
(
float
));
std
::
sort
(
begin
,
end
,
Vec3fComparator
());
SANITY_CHECK
(
h_circles
);
}
else
{
...
...
@@ -1817,7 +1846,8 @@ PERF_TEST_P(Sz_Dp_MinDist, ImgProc_HoughCircles, Combine(GPU_TYPICAL_MAT_SIZES,
cv
::
HoughCircles
(
src
,
circles
,
CV_HOUGH_GRADIENT
,
dp
,
minDist
,
cannyThreshold
,
votesThreshold
,
minRadius
,
maxRadius
);
}
CPU_SANITY_CHECK
(
circles
);
std
::
sort
(
circles
.
begin
(),
circles
.
end
(),
Vec3fComparator
());
SANITY_CHECK
(
circles
);
}
}
...
...
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