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
faa6074f
Commit
faa6074f
authored
Jan 29, 2014
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added performance test
parent
384a2862
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
1 deletion
+41
-1
perf_imgproc.cpp
modules/imgproc/perf/opencl/perf_imgproc.cpp
+40
-0
histogram.cpp
modules/imgproc/src/histogram.cpp
+1
-1
No files found.
modules/imgproc/perf/opencl/perf_imgproc.cpp
View file @
faa6074f
...
...
@@ -61,6 +61,8 @@ OCL_PERF_TEST_P(EqualizeHistFixture, EqualizeHist, OCL_TEST_SIZES)
const
Size
srcSize
=
GetParam
();
const
double
eps
=
1
;
checkDeviceMaxMemoryAllocSize
(
srcSize
,
CV_8UC1
);
UMat
src
(
srcSize
,
CV_8UC1
),
dst
(
srcSize
,
CV_8UC1
);
declare
.
in
(
src
,
WARMUP_RNG
).
out
(
dst
);
...
...
@@ -69,6 +71,30 @@ OCL_PERF_TEST_P(EqualizeHistFixture, EqualizeHist, OCL_TEST_SIZES)
SANITY_CHECK
(
dst
,
eps
);
}
///////////// calcHist ////////////////////////
typedef
TestBaseWithParam
<
Size
>
CalcHistFixture
;
OCL_PERF_TEST_P
(
CalcHistFixture
,
CalcHist
,
OCL_TEST_SIZES
)
{
const
Size
srcSize
=
GetParam
();
const
std
::
vector
<
int
>
channels
(
1
,
0
);
std
::
vector
<
float
>
ranges
(
2
);
std
::
vector
<
int
>
histSize
(
1
,
256
);
ranges
[
0
]
=
0
;
ranges
[
1
]
=
256
;
checkDeviceMaxMemoryAllocSize
(
srcSize
,
CV_8UC1
);
UMat
src
(
srcSize
,
CV_8UC1
),
hist
(
256
,
1
,
CV_32FC1
);
declare
.
in
(
src
,
WARMUP_RNG
).
out
(
hist
);
OCL_TEST_CYCLE
()
cv
::
calcHist
(
std
::
vector
<
UMat
>
(
1
,
src
),
channels
,
noArray
(),
hist
,
histSize
,
ranges
,
false
);
SANITY_CHECK
(
hist
);
}
/////////// CopyMakeBorder //////////////////////
CV_ENUM
(
Border
,
BORDER_CONSTANT
,
BORDER_REPLICATE
,
BORDER_REFLECT
,
BORDER_WRAP
,
BORDER_REFLECT_101
)
...
...
@@ -83,6 +109,8 @@ OCL_PERF_TEST_P(CopyMakeBorderFixture, CopyMakeBorder,
const
Size
srcSize
=
get
<
0
>
(
params
);
const
int
type
=
get
<
1
>
(
params
),
borderType
=
get
<
2
>
(
params
);
checkDeviceMaxMemoryAllocSize
(
srcSize
,
type
);
UMat
src
(
srcSize
,
type
),
dst
;
const
Size
dstSize
=
srcSize
+
Size
(
12
,
12
);
dst
.
create
(
dstSize
,
type
);
...
...
@@ -105,6 +133,8 @@ OCL_PERF_TEST_P(CornerMinEigenValFixture, CornerMinEigenVal,
const
int
type
=
get
<
1
>
(
params
),
borderType
=
BORDER_REFLECT
;
const
int
blockSize
=
7
,
apertureSize
=
1
+
2
*
3
;
checkDeviceMaxMemoryAllocSize
(
srcSize
,
type
);
UMat
src
(
srcSize
,
type
),
dst
(
srcSize
,
CV_32FC1
);
declare
.
in
(
src
,
WARMUP_RNG
).
out
(
dst
);
...
...
@@ -124,6 +154,8 @@ OCL_PERF_TEST_P(CornerHarrisFixture, CornerHarris,
const
Size
srcSize
=
get
<
0
>
(
params
);
const
int
type
=
get
<
1
>
(
params
),
borderType
=
BORDER_REFLECT
;
checkDeviceMaxMemoryAllocSize
(
srcSize
,
type
);
UMat
src
(
srcSize
,
type
),
dst
(
srcSize
,
CV_32FC1
);
declare
.
in
(
src
,
WARMUP_RNG
).
out
(
dst
);
...
...
@@ -143,6 +175,8 @@ OCL_PERF_TEST_P(PreCornerDetectFixture, PreCornerDetect,
const
Size
srcSize
=
get
<
0
>
(
params
);
const
int
type
=
get
<
1
>
(
params
),
borderType
=
BORDER_REFLECT
;
checkDeviceMaxMemoryAllocSize
(
srcSize
,
type
);
UMat
src
(
srcSize
,
type
),
dst
(
srcSize
,
CV_32FC1
);
declare
.
in
(
src
,
WARMUP_RNG
).
out
(
dst
);
...
...
@@ -162,6 +196,8 @@ OCL_PERF_TEST_P(IntegralFixture, Integral1, ::testing::Combine(OCL_TEST_SIZES, O
const
Size
srcSize
=
get
<
0
>
(
params
);
const
int
ddepth
=
get
<
1
>
(
params
);
checkDeviceMaxMemoryAllocSize
(
srcSize
,
ddepth
);
UMat
src
(
srcSize
,
CV_8UC1
),
dst
(
srcSize
+
Size
(
1
,
1
),
ddepth
);
declare
.
in
(
src
,
WARMUP_RNG
).
out
(
dst
);
...
...
@@ -186,6 +222,8 @@ OCL_PERF_TEST_P(ThreshFixture, Threshold,
const
int
threshType
=
get
<
2
>
(
params
);
const
double
maxValue
=
220.0
,
threshold
=
50
;
checkDeviceMaxMemoryAllocSize
(
srcSize
,
srcType
);
UMat
src
(
srcSize
,
srcType
),
dst
(
srcSize
,
srcType
);
declare
.
in
(
src
,
WARMUP_RNG
).
out
(
dst
);
...
...
@@ -202,6 +240,8 @@ OCL_PERF_TEST_P(CLAHEFixture, CLAHE, OCL_TEST_SIZES)
{
const
Size
srcSize
=
GetParam
();
checkDeviceMaxMemoryAllocSize
(
srcSize
,
CV_8UC1
);
UMat
src
(
srcSize
,
CV_8UC1
),
dst
(
srcSize
,
CV_8UC1
);
const
double
clipLimit
=
40.0
;
declare
.
in
(
src
,
WARMUP_RNG
).
out
(
dst
);
...
...
modules/imgproc/src/histogram.cpp
View file @
faa6074f
...
...
@@ -1414,7 +1414,7 @@ static bool ocl_calcHist1(InputArrayOfArrays _src, OutputArray _hist, int ddepth
if
(
k1
.
empty
())
return
false
;
_hist
.
create
(
1
,
BINS
,
ddepth
);
_hist
.
create
(
BINS
,
1
,
ddepth
);
UMat
src
=
_src
.
getUMat
(),
ghist
(
1
,
BINS
*
compunits
,
CV_32SC1
),
hist
=
ddepth
==
CV_32S
?
_hist
.
getUMat
()
:
UMat
(
BINS
,
1
,
CV_32SC1
);
...
...
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