Merge pull request #3081 from akarsakov:small_fixes

This commit is contained in:
Vadim Pisarevsky
2014-08-13 10:50:33 +00:00
6 changed files with 15 additions and 9 deletions
@@ -39,6 +39,9 @@
#define OUT_OF_RANGE -1
// for identical rounding after dividing on different platforms
#define ROUNDING_EPS 0.000001f
#if histdims == 1
__kernel void calcLUT(__global const uchar * histptr, int hist_step, int hist_offset, int hist_bins,
@@ -53,7 +56,7 @@ __kernel void calcLUT(__global const uchar * histptr, int hist_step, int hist_of
{
float lb = ranges[0], ub = ranges[1], gap = (ub - lb) / hist_bins;
value -= lb;
int bin = convert_int_sat_rtn(value / gap);
int bin = convert_int_sat_rtn(value / gap + ROUNDING_EPS);
if (bin >= hist_bins)
lut[x] = OUT_OF_RANGE;
@@ -101,7 +104,7 @@ __kernel void calcLUT(int hist_bins, __global int * lut, int lut_offset,
{
float lb = ranges[0], ub = ranges[1], gap = (ub - lb) / hist_bins;
value -= lb;
int bin = convert_int_sat_rtn(value / gap);
int bin = convert_int_sat_rtn(value / gap + ROUNDING_EPS);
lut[x] = bin >= hist_bins ? OUT_OF_RANGE : bin;
}
+2 -1
View File
@@ -939,7 +939,8 @@ void cv::boxFilter( InputArray _src, OutputArray _dst, int ddepth,
if (normalize && !src.isSubmatrix() && ddepth == sdepth &&
(/*ippBorderType == BORDER_REPLICATE ||*/ /* returns ippStsStepErr: Step value is not valid */
ippBorderType == BORDER_CONSTANT) && ocvAnchor == ippAnchor )
ippBorderType == BORDER_CONSTANT) && ocvAnchor == ippAnchor &&
dst.cols != ksize.width && dst.rows != ksize.height) // returns ippStsMaskSizeErr: mask has an illegal value
{
Ipp32s bufSize = 0;
IppiSize roiSize = { dst.cols, dst.rows }, maskSize = { ksize.width, ksize.height };