mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Fix pixel saturation in interpolate_quadratic (#2806)
* Fix pixel saturation in interpolate_quadratic * Use pixel_type_t alias
This commit is contained in:
parent
eccb9675ff
commit
759170d3d6
@ -310,7 +310,9 @@ namespace dlib
|
|||||||
pixel_to_vector<double>(img[r+1][c ])(i),
|
pixel_to_vector<double>(img[r+1][c ])(i),
|
||||||
pixel_to_vector<double>(img[r+1][c+1])(i));
|
pixel_to_vector<double>(img[r+1][c+1])(i));
|
||||||
typename image_view_type::pixel_type temp;
|
typename image_view_type::pixel_type temp;
|
||||||
vector_to_pixel(temp, pvout);
|
const auto min_val = pixel_traits<pixel_type_t<image_view_type>>::min();
|
||||||
|
const auto max_val = pixel_traits<pixel_type_t<image_view_type>>::max();
|
||||||
|
vector_to_pixel(temp, clamp(pvout, min_val, max_val));
|
||||||
assign_pixel(result, temp);
|
assign_pixel(result, temp);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user