Matlab image enhancement: histogram equalization

In digital image processing, histogram equalization is a commonly used image enhancement method. This technique can enhance the contrast and brightness of an image by transforming its histogram. In this article, we will introduce how to use Matlab to implement histogram equalization.

  1. Read in image

In Matlab, you can use the imread function to read in images. The sample code is as follows:

I = imread('image.jpg');

Among them, 'image.jpg' is the name of the image file to be processed. The read image will be saved in variable I.

  1. Calculate histogram

Before performing histogram equalization, the histogram of the image to be processed needs to be calculated. The histogram can be calculated using the imhist function. The sample code is as follows:

[counts,binLocations] = imhist(I

Guess you like

Origin blog.csdn.net/wellcoder/article/details/132989661
Recommended