Crates.io | histogram_equalization |
lib.rs | histogram_equalization |
version | 0.2.2 |
source | src |
created_at | 2024-06-08 19:34:58.134782 |
updated_at | 2024-11-10 11:17:28.304112 |
description | Histogram equalization |
homepage | https://github.com/awxkee/histogram_equalization |
repository | https://github.com/awxkee/histogram_equalization |
max_upload_size | |
id | 1265930 |
size | 136,482 |
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:
All color spaces as it is have different properties and of course results.
There is no implementation for gray images.
clahe_luv_rgb(
src_bytes,
stride as u32,
&mut dst_bytes,
stride as u32,
dimensions.0,
dimensions.1,
4f32,
ClaheGridSize::new(8, 8),
128,
);
image
cratelet img = ImageReader::open("assets/asset_1.jpg")
.unwrap()
.decode()
.unwrap();
let dimensions = img.dimensions();
let channels = 3;
let stride = dimensions.0 as usize * channels;
let mut dst_bytes: Vec<u8> = vec![0; stride * dimensions.1 as usize];
let src_bytes = img.as_bytes();
hist_equal_hsv_rgb(
src_bytes,
stride as u32,
&mut dst_bytes,
stride as u32,
dimensions.0,
dimensions.1,
128,
);
image::save_buffer(
"converted_eq_hsv.jpg",
&dst_bytes,
dimensions.0,
dimensions.1,
image::ExtendedColorType::Rgb8,
)
.unwrap();
Original
CLAHE
Original
Ahe
This project is licensed under either of
at your option.