I want you to fill out the ? marks in Matlab code
Enhance contrast using histogram equalization - matlab
%Histogram Equalization
clear all; clc;close all;
imgfiles = {'GreyCrownCrane.jpg','GreyCrownCraneGrainy.jpg'};
for imgfls=1:length(?)
[original_image{?}] = imread(?{?});
end
for imgfls = 1:length(?)
original_img=?{?};%avoid index inside the loop
fsf(imgfls)=figure(imgfls);
set(fsf(imgfls), 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
subplot(2,3,1)
imshow(?) % original image
title('?');
subplot(2,3,2)
imhist(?);
title('Histogram of Original Image');
number_of_pixels=numel(?);
imghist_orig_norm=imhist(?)./?; % Normalized
cumulative_sum_orig=cumsum(?);
x_axis=linspace(0,1,256);
subplot(2,3,3)
plot(?,?); %normalized cumulative sum
title('?');
equalized_image=histeq(?,256);
subplot(2,3,4)
imshow(?) % equilized image
title('?');
subplot(2,3,5)
imhist(?)
title('?');
imghist_eqlz_norm=imhist(?)./?; % Nomalized
cumulative_sum_eqlz=cumsum(?);
subplot(2,3,6)
plot(?,?); %normalized cumulative sum
title('cummulative sum of histogram bins normalized');
end
Unlock access to this and over
10,000 step-by-step explanations
Have an account? Log In