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
c8d1fccd
Commit
c8d1fccd
authored
Aug 01, 2013
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compare cv::gpu::calcHist with cv::calcHist
parent
9b5d1596
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
20 deletions
+21
-20
perf_imgproc.cpp
modules/gpu/perf/perf_imgproc.cpp
+11
-1
test_imgproc.cpp
modules/gpu/test/test_imgproc.cpp
+10
-19
No files found.
modules/gpu/perf/perf_imgproc.cpp
View file @
c8d1fccd
...
@@ -562,7 +562,17 @@ PERF_TEST_P(Sz, ImgProc_CalcHist,
...
@@ -562,7 +562,17 @@ PERF_TEST_P(Sz, ImgProc_CalcHist,
}
}
else
else
{
{
FAIL_NO_CPU
();
cv
::
Mat
dst
;
const
int
hbins
=
256
;
const
float
hranges
[]
=
{
0.0
f
,
256.0
f
};
const
int
histSize
[]
=
{
hbins
};
const
float
*
ranges
[]
=
{
hranges
};
const
int
channels
[]
=
{
0
};
TEST_CYCLE
()
cv
::
calcHist
(
&
src
,
1
,
channels
,
cv
::
Mat
(),
dst
,
1
,
histSize
,
ranges
);
CPU_SANITY_CHECK
(
dst
);
}
}
}
}
...
...
modules/gpu/test/test_imgproc.cpp
View file @
c8d1fccd
...
@@ -133,24 +133,6 @@ INSTANTIATE_TEST_CASE_P(GPU_ImgProc, HistEven, ALL_DEVICES);
...
@@ -133,24 +133,6 @@ INSTANTIATE_TEST_CASE_P(GPU_ImgProc, HistEven, ALL_DEVICES);
///////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////
// CalcHist
// CalcHist
namespace
{
void
calcHistGold
(
const
cv
::
Mat
&
src
,
cv
::
Mat
&
hist
)
{
hist
.
create
(
1
,
256
,
CV_32SC1
);
hist
.
setTo
(
cv
::
Scalar
::
all
(
0
));
int
*
hist_row
=
hist
.
ptr
<
int
>
();
for
(
int
y
=
0
;
y
<
src
.
rows
;
++
y
)
{
const
uchar
*
src_row
=
src
.
ptr
(
y
);
for
(
int
x
=
0
;
x
<
src
.
cols
;
++
x
)
++
hist_row
[
src_row
[
x
]];
}
}
}
PARAM_TEST_CASE
(
CalcHist
,
cv
::
gpu
::
DeviceInfo
,
cv
::
Size
)
PARAM_TEST_CASE
(
CalcHist
,
cv
::
gpu
::
DeviceInfo
,
cv
::
Size
)
{
{
cv
::
gpu
::
DeviceInfo
devInfo
;
cv
::
gpu
::
DeviceInfo
devInfo
;
...
@@ -174,7 +156,16 @@ GPU_TEST_P(CalcHist, Accuracy)
...
@@ -174,7 +156,16 @@ GPU_TEST_P(CalcHist, Accuracy)
cv
::
gpu
::
calcHist
(
loadMat
(
src
),
hist
);
cv
::
gpu
::
calcHist
(
loadMat
(
src
),
hist
);
cv
::
Mat
hist_gold
;
cv
::
Mat
hist_gold
;
calcHistGold
(
src
,
hist_gold
);
const
int
hbins
=
256
;
const
float
hranges
[]
=
{
0.0
f
,
256.0
f
};
const
int
histSize
[]
=
{
hbins
};
const
float
*
ranges
[]
=
{
hranges
};
const
int
channels
[]
=
{
0
};
cv
::
calcHist
(
&
src
,
1
,
channels
,
cv
::
Mat
(),
hist_gold
,
1
,
histSize
,
ranges
);
hist_gold
=
hist_gold
.
reshape
(
1
,
1
);
hist_gold
.
convertTo
(
hist_gold
,
CV_32S
);
EXPECT_MAT_NEAR
(
hist_gold
,
hist
,
0.0
);
EXPECT_MAT_NEAR
(
hist_gold
,
hist
,
0.0
);
}
}
...
...
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