Made resize_image() and functions that use it like the pyramid objects produce

better results when run on float and double images.  There was needless
rounding to integers happening in the bilinear interpolation.  Now if you work
with a float image the entire process will run without integer rounding.
This commit is contained in:
Davis King 2017-08-25 18:21:35 -04:00
parent 5a0824c0f3
commit 2883650b0a
1 changed files with 2 additions and 2 deletions

View File

@ -828,8 +828,8 @@ namespace dlib
simd4f bl(in_img[bottom][fleft[0]], in_img[bottom][fleft[1]], in_img[bottom][fleft[2]], in_img[bottom][fleft[3]]);
simd4f br(in_img[bottom][fright[0]], in_img[bottom][fright[1]], in_img[bottom][fright[2]], in_img[bottom][fright[3]]);
simd4i out = simd4i(tlf*tl + trf*tr + blf*bl + brf*br);
int32 fout[4];
simd4f out = simd4f(tlf*tl + trf*tr + blf*bl + brf*br);
float fout[4];
out.store(fout);
out_img[r][c] = static_cast<T>(fout[0]);