Image Processing
Image Processing
Output:
fig. (a)
fig.(b)
fig.(c)
fig.(a) Original image fig.(b) Gray scale image fig.(c) Negative of original image
3. To Perform histogram equalization of an image %To perform histogram equalization clear all; close all; X = imread('child.jpg'); Y=rgb2gray(X); figure(1); imshow(X), figure(2), imhist(Y); Z=histeq(Y), figure(3), imshow(Z), figure(4), imhist(Z); Results:
Original image
Histogram of image
4. To read, display & rotate an image %Image to read,display & rotate image. x=imread('images.jpg') figure(1),imshow(x) y=rgb2gray(x) figure(2),imshow(y) m=imresize(y,0.2) figure(3),imshow(m) n=imrotate(y,120) figure(4),imshow(n) z=imnoise(y,'salt & pepper'); figure(5),imshow(z)
Results:
Fig(a) Original
Fig(b)Gray scale
Fig(c)Resized image
Fig(d)Rotated image
Original image
Contrasted image
6.Stimulas background
%program to change background of square clc clear all; close all; x1(256,255)=0; x1(86:165,86:165)=0.7 I=mat2gray(x1) subplot(1,3,1); imshow(x1); x2(1:256,1:256)=0.3; x2(86:165,86:165)=0.7 I=mat2gray(x2) subplot(1,3,2); imshow(x2) x3(1:256,1:256)=0.9; x3(86:165,86:165)=0.7 I=mat2gray(x3) subplot(1,3,3); imshow(x3)
Result:
Fig(b) Lpf
Fig(c)resultant image
Result:
Fig(a)Original
Fig(b)HPF
Fig(c)resultant image
Original image
Fig(a)
fig(b)
fig(c)
Fig(a):-x ray image with salt & pepper noise Fig(b):-noise being removed with 3*3 mask filter Fig(c):-noise removed with 3*3 median filter
Fig(a)
fig(b)
fig(c)