Professional Documents
Culture Documents
clc;
clear all;
close all;
a=im2double(imread('cameraman.tif'));
b=a.^0.45;
figure;imshow(a);title('Original image');
figure;imshow(b);title('After power law transforming');
clc;
clear all;
close all;
a=imread('pout.tif');
b=histeq(a);
figure;subplot(1,2,1);imshow(a);title('Original image');
subplot(1,2,2);imshow(b);title('After Global Histogram Equalized');
figure;subplot(1,2,1);imhist(a);title('Histogram of Original Image');
subplot(1,2,2);imhist(b);title('Histogram of Global Histogram Equalized
Image');
IMAGE ENHANCEMENT BY LOCAL HISTOGRAM
clc;
clear all;
close all;
a=im2double(imread('coins.png'));
w=input('Enter the window size:');
k=input('Enter the value of the constant k(value should be between 0 and
1):');
M=mean2(a);
z=colfilt(a,[w w],'sliding',@std);
m=colfilt(a,[w w],'sliding',@mean);
A=k*M./z;
b=A.*(a-m)+m;
figure;subplot(1,2,1);imshow(a);title(‘Original Image’);
subplot(1,2,2);imshow(b);title(‘Local Histogram Equalized Image’);