Professional Documents
Culture Documents
Matlab Image Processing
Matlab Image Processing
using MATLAB
Presented by
Amarjeetsingh Thakur
Asst. Professor
Dept. of Electronics & Communication
Engg.
S.G.B.I.T. Belgaum
Outline
What
is MATLAB?
Image Processing tool box
Image formats
How to read an image?
Image conversion
Arithmetic operations on images
Conversion of an image into different formats
Image rotation
Image blurring and deblurring
Fill in ROI in grayscale image
References
What is MATLAB?
MATLAB = MATrix LABoratory
MATLAB is a high-level language and
interactive environment that enables us to
perform computationally intensive tasks
faster than with traditional programming
languages such as C, C++ and Fortran.
MATLAB is an interactive, interpreted
language that is designed for fast
numerical matrix calculations.
Key Industries
Aerospace
and defense
Automotive
Biotech and pharmaceutical
Communications
Computers
Education
Electronics and semiconductors
Energy production
Industrial automation and machinery
Medical devices
Command Window
> To execute
commands in the
MATLAB
environment
Command History
> Displays record of
the commands used
MATLAB Help
MATLAB Help is an
extremely powerful
assistance to learning
MATLAB
Help not only contains
the theoretical
background, but also
shows demos for
implementation
MATLAB Help can be
opened by using the
HELP pull-down menu
Images in MATLAB
MATLAB can
import/export several
image formats:
BMP (Microsoft
Windows Bitmap)
GIF (Graphics
Interchange Files)
HDF (Hierarchical Data
Format)
JPEG (Joint
Photographic Experts
Group)
PCX (Paintbrush)
PNG (Portable Network
Graphics)
TIFF (Tagged Image
Images in MATLAB
Binary images : {0,1}
Intensity images : [0,1] or uint8, double etc.
RGB images : m n 3
Multidimensional images: m n p (p is the number of
layers)
Binary Images
They
Intensity Images
They
Indexed Images
These
row = 256;
col = 256;
img = zeros(row, col);
img(100:105, :) = 0.5;
img(:, 100:105) = 1;
figure;
imshow(img);
o
Column 1 to
256
[256,
256]
Image Conversion
Contd..
2. imsubtract
Syntax : Z = imsubtract(X,Y)
Description: Z = imsubtract(X,Y) subtracts
each element in array Y from the
corresponding element in array X and
returns the difference in the corresponding
element of the output array Z
Contd..
3. immultiply
Syntax : Z = immultiply(X,Y)
Description: Z = immultiply(X,Y)
multiplies each element in array X by the
corresponding element in array Y and
returns the product in the corresponding
element of the output array Z.
Contd..
4. imdivide
Syntax : Z = imdivide(X,Y)
Description: Z = imdivide(X,Y) divides
each element in the array X by
the corresponding element in
array Y and returns the result in
the corresponding element of the
output array Z.
and Settings\student\My
Documents\pictures\steve.jpg');%read an image
size(i) %295 171
3
j=imread('C:\Documents and Settings\student\My
Documents\pictures\sun.jpg');
size(j) %219 230
3
k=i(1:150,1:150);
l=j(1:150,1:150);
m=imadd(k,l);
figure,imshow(m)
title('addition of two images')
% Rotate
image
anticlockwise
by
an angle 45
K=imrotate(I,-45); % Rotate
image
clockwise
by
an angle 45
imshow(J)
Imshow(K)
Deblurring operation on an
blurred image using wiener filter
I=imread(Sachin.jpg');
figure
imshow(I)
conv');
figure, imshow(Blurred)
Blurred image
F);
figure, imshow(wnr1);
title('Restored image');
Recovered image
I = imread('eight.tif');
J = roifill(I);
figure, imshow(J)
ROI fill
I=imread('C:\Documents
and
Settings\All
Users.WINDOWS\Documents\My
Pictures\Sample
Pictures\avataar.jpg');
figure
imshow(I)
J=rgb2gray(I);
figure
imshow(J)
Applications of image
processing
BIOLOGICAL:
samples.
DEFENSE/INTELLIGENCE: enhancement and
interpretation of images to find and track targets.
DOCUMENT PROCESSING: scanning, archiving,
transmission.
FACTORY AUTOMATION: visual inspection of
products.
MATERIALS TESTING: detection and quantification
of cracks, impurities, etc.
MEDICAL: disease detection and monitoring,
therapy/surgery planning
ANY QUERRIES????????
References
www.mathworks.com
THANK YOU