fixed wrong condition with interpolation types

This commit is contained in:
Ilya Lavrenov 2012-09-17 18:30:55 +04:00
parent 5ab3fe489f
commit f58c5646b0

View File

@ -1825,9 +1825,12 @@ void cv::resize( InputArray _src, OutputArray _dst, Size dsize,
// in case of scale_x && scale_y is equal to 2 // in case of scale_x && scale_y is equal to 2
// INTER_AREA (fast) also is equal to INTER_LINEAR // INTER_AREA (fast) also is equal to INTER_LINEAR
if ( interpolation == INTER_LINEAR && if ( interpolation == INTER_LINEAR && std::abs(scale_x - 2.0) < DBL_EPSILON &&
scale_x >= 1 && scale_y >= 1 && is_area_fast) std::abs(scale_y - 2.0) < DBL_EPSILON)
{
interpolation = INTER_AREA; interpolation = INTER_AREA;
is_area_fast = true;
}
// true "area" interpolation is only implemented for the case (scale_x <= 1 && scale_y <= 1). // true "area" interpolation is only implemented for the case (scale_x <= 1 && scale_y <= 1).
// In other cases it is emulated using some variant of bilinear interpolation // In other cases it is emulated using some variant of bilinear interpolation