How to Normalize a Histogram in MATLAB? Last Updated : 08 Dec, 2021 Comments Improve Suggest changes Like Article Like Report Histogram normalization is a technique to distribute the frequencies of the histogram over a wider range than the current range. This technique is used in image processing too. There we do histogram normalization for enhancing the contrast of poor contrasted images. Formula: New intensity= ((Intensity - minimum) /(maximum-minimum)) *255; Here ./ and .* means operation has to be performed element-wise. Steps: Read the image.Convert color image into grayscale.Display histogram.Observe maximum and minimum intensities from the histogram.Change image type from uint8 to double.Apply a formula for histogram normalization.Convert back into unit format.Display image and modified histogram.Example: Matlab % MATLAB code for % Histogram normalisation. % Read the image. k=imread("lincoln.jfif"); % Convert into grayscale k1=rgb2gray(k); % Display the image and histogram. imtool(k1,[]); imhist(k1); % Set the minimum and maximum % Values from histogram. min=45; max=180; % Convert image into double. k2=double(k1); % Apply the formula. k3=(k2-min)./(max-min); % Multiply with maximum possible value. k4=k3.*255; % Convert the final result into uint8. k5=uint8(k4); % Display the enhanced image and histogram. imtool(k5,[]); imhist(k5); Output: Figure: Original histogramFigure: Normalized histogramFigure: Images before and after normalizationCode Explanation: First, we read the image using imread( ) function.After reading the image, we convert it into the grayscale format.After converting it into grayscale, we displayed the image and its histogram.Maximum and minimum intensity is noted from the histogram.The image data type is changed from uint8 to double, to facilitate the calculation steps.Apply the formula of normalization.The image data type is changed back to uint8. Comment More infoAdvertise with us Next Article How to Normalize a Histogram in MATLAB? pintusaini Follow Improve Article Tags : Software Engineering MATLAB-graphs MATLAB image-processing Similar Reads How to plot a Histogram in MATLAB ? A Histogram is a diagrammatic representation of a group of data over user-specified ranges. Basically, the histogram contains several bins. Bins are non-overlapping intervals in which the data is spread. In MATLAB we have a function named hist() which allows us to plot a bar graph. Syntax: hist(X) 2 min read Normalize Data in MATLAB Data Normalization is a technique in statistical mathematics that converts the entire data into a specified range or scale or normalizes it using different methods such as by computing its z-score. There is no specific definition of normalization but, it has various meanings depending on the user's 2 min read How to Normalize Data in R? In this article, we will discuss how to normalize data in the R programming language. What is Normalization?Normalization is a pre-processing stage of any type of problem statement. In particular, normalization takes an important role in the field of soft computing, cloud computing, etc. for the man 3 min read How to Plot Multiple Histograms in R? In this article, we will discuss how to plot multiple histograms in the R Programming language. Method 1: Multiple Histogram in Base R To create multiple histograms in base R, we first make a single histogram and then add another layer of the histogram on top of it. But in doing so some plots may cl 6 min read How to Normalize Data in Excel? The term "normalization" is a popular buzzword among professionals in fields like Machine Learning, Data Science, and statistics. It refers to the process of scaling down values to fit within a specific range. The term is often misunderstood and is sometimes used interchangeably with "standardisatio 7 min read Like