Tuesday, November 4, 2014

Image Processing: Matlab code - Local Histogram equalization 3x3 window

Letus begin by considering following 64x64 image.

Letus apply local window processing by taking 3x3 window and move certral pixel of local window x(2,2) to output image J. Store above image to your harddisk folder and provide name in path variable below (line#2).


clear all
path = 'E:\xxx\woman_1.gif'
I = imread(path)
[row, col]=size(I);
eI = histeq(I);
h = imhist(I);
for i=2:row-1
for j=2:col-1
a = i
b = j
win = I(i-1:i+1, j-1:j+1);
ewin = histeq(win)
J(i,j) = ewin(2,2)
end
end
imshow(I); 
imhist(I);
imshow(J);
imshow(J);

Result of the local window processing is as follows:





And
to



Note: it may take certain time :)

No comments:

Post a Comment