Tuesday, 13 September 2016

Program for Histogram Equalization using Matlab


Histogram Equalization

Histogram equalization is a technique for adjusting image intensities to enhance contrast. Let f be a given image represented as a m x n matrix of integer pixel intensities ranging from 0 to L − 1. L is the number of possible intensity values, often 256.

Program: 

clc;
clear all;
close all;
a=imread('D:\sample.jpg');
c=rgb2gray(a);
b=histeq(c);


subplot(2,2,1);
imshow(c);
title('original image');

subplot(2,2,2);
imshow(b);
title('After histrogram equalization');

subplot(2,2,3);
imhist(c,255);
title('original image Histogram plot')

subplot(2,2,4);
imhist(b,255);
title('equalized Histogram plot')

Output: 




No comments:

Post a Comment