Switch to full style
General MATLAB code examples.
Post a reply

image equalization and cumulative histogram

Fri Mar 25, 2011 4:08 pm

Following code does equalization on input image and draw the cumulative histogram before and after .
Code:

   I 
= imread('cameraman.tif'); 
   
%% Show current image.
   imshow(I);
   %% draw the cumulative  histogram of  orginal image.
   figure; 
   histogram 
= imhist(I);%image histogram.
   ch = cumsum(histogram);%cumulative  histogram.
   bar(ch,'BarWidth',1)%draw bar.
   %% image equalization and cumulative histogram 
   figure
; 
   J 
= histeq(I);
   imshow(J);
   figure; 
   histogramEq 
= imhist(J);%image histogram.
   ch = cumsum(histogramEq);%cumulative  histogram.
   bar(ch,'BarWidth',1)%draw bar.
 



Attachments
1.GIF
Before equalization
1.GIF (18.73 KiB) Viewed 11789 times
2.GIF
After equalization
2.GIF (21.7 KiB) Viewed 11789 times

Post a reply
  Related Posts  to : image equalization and cumulative histogram
 drawing the histogram of image     -  
 Image Colors Frequencies Histogram in Java     -  
 Histogram Generator     -  
 Image-Viewer-Image Processing-Filters-Noise-enhancements     -  
 Move image in front of a background image     -  
 different between cfa image and gray level image     -  
 PNG image to the image you generated     -  
 put image in asp.net     -  
 Put image in JPanel     -  
 Image I/O library     -  

Topic Tags

Matlab Image