fixed incorrect output of resize(...scalex, scaley, INTER_NEAREST) when scalex and scaley are even integers (ticket #1013)

This commit is contained in:
Vadim Pisarevsky 2011-06-03 13:25:44 +00:00
parent c7bdf83de5
commit 6be2a79fb9

View File

@ -253,14 +253,14 @@ resizeNN( const Mat& src, Mat& dst, double fx, double fy )
for( x = 0; x < dsize.width; x++ )
{
int sx = saturate_cast<int>(x*ifx);
int sx = cvFloor(x*ifx);
x_ofs[x] = std::min(sx, ssize.width-1)*pix_size;
}
for( y = 0; y < dsize.height; y++ )
{
uchar* D = dst.data + dst.step*y;
int sy = std::min(saturate_cast<int>(y*ify), ssize.height-1);
int sy = std::min(cvFloor(y*ify), ssize.height-1);
const uchar* S = src.data + src.step*sy;
switch( pix_size )