Histogram equalization in Rust
There is some implementation of CLAHE (contrast-limited adaptive histogram equalization), AHE (adaptive histogram equalization), and histogram equalization performed in different color spaces.
All methods may perform histogram equalization in:
- YUV (YCgCo subtype) always with 256 hist bins for performance purposes.
- HSV
- HSL
- CIE L*a*b
- CIE L*u*v
- Oklab
- Jzazbz
- Oklch
All color spaces as it is have different properties and of course results.
There is no implementation for gray images.
Example
clahe_luv_rgb;
How to use with image
crate
let img = open
.unwrap
.decode
.unwrap;
let dimensions = img.dimensions;
let channels = 3;
let stride = dimensions.0 as usize * channels;
let mut dst_bytes: = vec!;
let src_bytes = img.as_bytes;
hist_equal_hsv_rgb;
save_buffer
.unwrap;