Experiment 3: Spatial Domain Image Enhancement: MATLAB Code
Experiment 3: Spatial Domain Image Enhancement: MATLAB Code
enhancement
law transformation)
MATLAB code
I = imread('coloredChips.png');
Image')
complemented_image = 255 - I;
subplot(2,2,2)
imshow(complemented_image);
subplot(2,2,3)
imshow(uint8(log_transformed_image));
subplot(2,2,4)
imshow(uint8(power_law_image)); title('Power
MATLAB code:
I = imread('cameraman.tif');
subplot(3,2,1) imshow(I)
title('Original Image')
subplot(3,2,2) bar(binLocations,
counts); title('Histogram of
Image');
xlabel('Intensity');
ylabel('Frequency'); I =
imread('pout.tif');
subplot(3,2,3) imshow(I)
title('Original
Image')
subplot(3,2,4)
bar(binLocations, counts);
title('Histogram of
Image'); xlabel('Intensity');
ylabel('Frequency');
I = imread('coins.png');
[counts, binLocations] =
imhist(I);
subplot(3,2,5)
imshow(I) title('Original
Image')
subplot(3,2,6) bar(binLocations,
counts); title('Histogram of
Image');
xlabel('Intensity');
ylabel('Frequency');
3.3 WAP to clip image through thresholding two gray levels from both ends
MATLAB code
I = imread('coloredChips.png'); A =
imshow(thresholded_image)
; title('Thresholded Image');
3.4 WAP to clip image i.e to highlight intensity range between A & B and
MATLAB code
I = imread('coloredChips.png'); A = 100; B = 200;
MATLAB code
I=
imread('coloredChips.png'); A
= 100;
B = 200;
subplot(1,2,1)
imshow(I) title('Original
Image') subplot(1,2,2)
imshow(J);
title('Clipped Image');
3.6 WAP for enhancement of an image using histogram equalization (pout.tif). Hint:
use 'histeq()'.
MATLAB code
I = imread('coloredChips.png'); J =
title('Original
title('Histogram of
Image');
NAME: VALLURIUDAYABHASKARA
ID- B221064