Professional Documents
Culture Documents
function g = localhisteq(f, m, n)
if nargin == 1
m = 3; n = 3;
elseif nargin == 2
n = m;
end
if (mod(m,2) == 0 || mod(n,2) == 0)
end
f = im2uint8(f);
[L T] = size(f);
x1 = 0;
x1 = x1 + 1;
y1 = 0;
y1 = y1 + 1;
h = histeq(subimage);
end
end
Problem 2: Comparing Global and Local Histogram Equalization.
(a)
>> f = imread('Fig1.tif');
>> f = imread('Fig1.tif');
>>figure1=figure
>>hloc3=localhisteq(f,3,3);
>>hloc7=localhisteq(f,7,7);
>> subplot(2,2,1);
>> imshow(f);
>>subplot(2,2,2);
>>imshow(hloc3);
>>subplot(2,2,3);
>> imshow(hloc7);
(b)
>> h = histeq(f,64);
>>subplot(2,2,4);
>>imshow(h);
>> print(figure1);
(a) By analyzing the processed images, the main difference between doing local equalization using 3x3
window or 7x7 window is that, as the size of the local window increases, the distortion increases (seen
as a blurring in the 7x7 Local Equalization figure). The reason is the intensity mappings of the histogram
with a larger area.
(b) Global equalization could not bring out the details embedded in the black squares within the image
because they had little effect on the shape of the global transformation function (the cumulative
distribution function).