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
229e8b1b
Commit
229e8b1b
authored
May 31, 2018
by
take1014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct handling when IPP is enabled
parent
58d28061
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
histogram.cpp
modules/imgproc/src/histogram.cpp
+4
-0
test_histograms.cpp
modules/imgproc/test/test_histograms.cpp
+30
-0
No files found.
modules/imgproc/src/histogram.cpp
View file @
229e8b1b
...
...
@@ -821,6 +821,10 @@ static bool ipp_calchist(const Mat &image, Mat &hist, int histSize, const float*
return
false
;
#endif
// IPP_DISABLE_HISTOGRAM - https://github.com/opencv/opencv/issues/11544
if
(
uniform
&&
(
ranges
[
0
][
1
]
-
ranges
[
0
][
0
])
!=
histSize
)
return
false
;
Mat
ihist
=
hist
;
if
(
accumulate
)
ihist
.
create
(
1
,
&
histSize
,
CV_32S
);
...
...
modules/imgproc/test/test_histograms.cpp
View file @
229e8b1b
...
...
@@ -1918,5 +1918,35 @@ TEST(Imgproc_Hist_CalcBackProject, accuracy) { CV_CalcBackProjectTest test; test
TEST
(
Imgproc_Hist_CalcBackProjectPatch
,
accuracy
)
{
CV_CalcBackProjectPatchTest
test
;
test
.
safe_run
();
}
TEST
(
Imgproc_Hist_BayesianProb
,
accuracy
)
{
CV_BayesianProbTest
test
;
test
.
safe_run
();
}
TEST
(
Imgproc_Hist_Calc
,
calcHist_regression_11544
)
{
cv
::
Mat1w
m
=
cv
::
Mat1w
::
zeros
(
10
,
10
);
int
n_images
=
1
;
int
channels
[]
=
{
0
};
cv
::
Mat
mask
;
cv
::
MatND
hist1
,
hist2
;
cv
::
MatND
hist1_opt
,
hist2_opt
;
int
dims
=
1
;
int
hist_size
[]
=
{
1000
};
float
range1
[]
=
{
0
,
900
};
float
range2
[]
=
{
0
,
1000
};
const
float
*
ranges1
[]
=
{
range1
};
const
float
*
ranges2
[]
=
{
range2
};
setUseOptimized
(
false
);
cv
::
calcHist
(
&
m
,
n_images
,
channels
,
mask
,
hist1
,
dims
,
hist_size
,
ranges1
);
cv
::
calcHist
(
&
m
,
n_images
,
channels
,
mask
,
hist2
,
dims
,
hist_size
,
ranges2
);
setUseOptimized
(
true
);
cv
::
calcHist
(
&
m
,
n_images
,
channels
,
mask
,
hist1_opt
,
dims
,
hist_size
,
ranges1
);
cv
::
calcHist
(
&
m
,
n_images
,
channels
,
mask
,
hist2_opt
,
dims
,
hist_size
,
ranges2
);
for
(
int
i
=
0
;
i
<
1000
;
i
++
)
{
EXPECT_EQ
(
hist1
.
at
<
float
>
(
i
,
0
),
hist1_opt
.
at
<
float
>
(
i
,
0
))
<<
i
;
EXPECT_EQ
(
hist2
.
at
<
float
>
(
i
,
0
),
hist2_opt
.
at
<
float
>
(
i
,
0
))
<<
i
;
}
}
}}
// namespace
/* 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