matlab histogram normalization
时间: 2023-10-13 10:06:43 浏览: 130
Histogram-equalization-.zip_图像 区域_图像局部处理_图像清晰 matlab
Histogram normalization is a technique used to enhance the contrast of an image by redistributing the pixel values. In MATLAB, you can perform histogram normalization using the `histeq` function.
Here's an example of how to apply histogram normalization to an image in MATLAB:
```matlab
% Load the image
image = imread('your_image.jpg');
% Convert the image to grayscale if needed
if size(image, 3) > 1
image = rgb2gray(image);
end
% Perform histogram equalization
normalized_image = histeq(image);
% Display the original and normalized images
subplot(1,2,1), imshow(image), title('Original Image');
subplot(1,2,2), imshow(normalized_image), title('Normalized Image');
```
This code loads an image, converts it to grayscale (if it's not already), applies histogram equalization using the `histeq` function, and displays the original and normalized images side by side.
Histogram normalization can be a useful preprocessing step for improving the visibility of details in an image or improving the performance of subsequent image processing tasks.
阅读全文