Digital Image Processing
Using MATLAB
By
M.Veerraju, J.Nageswara Rao,
MCA 2nd YEAR,
GIET Rajahmundry
Digital Image Processing
Using
MATLAB
Digital Image
Digital image is composed of finite number of elements
Elements – Picture Elements, Image Elements, Pels or Pixels
Pixel is used to denote the elements of a digital image
A digital image is a mapping from the real three-
dimensional world to a set of two-dimensional discrete
points. Each of these spatially distinct points, holds a
number that denotes grey level or colour for it, and can be
conveniently fed to a digital computer for processing.
Digital Image Processing (DIP)
?
Digital Image Processing deals with images which
are two-dimensional entities (such as scanned
office documents, x-ray films, satellite pictures, etc)
captured electronically through a scanner or
camera system that digitises the spatially
continuous coordinates to a sequence of 0’s and
1’s.
Types Of Computerized Process
Low Level Process Mid Level Process High Level Process
Action : Primitive Action :Segmentation Action : Making
Operations Sensation
Input: Image Input: Image Input: Attributes
Output: Image Output: Attributes Output: Scene
Understanding
Examples: Noise Examples: Object
removal, image recognition, Examples: recognition,
sharpening classification & analysis & associates
processing with vision
Types of Images
4
1. Intensity Image – it’s a data matrix whose values are
represented by intensities.
2. Binary Image – stored as logical array with 0’s or 1’s
3. Indexed Image – has two components Data matrix x &
Color map matrix map(Mx3 array having the value
range[0,1])
4. RGB Image – it is an MxNx3 array of color pixels
corresponding to Red, Green & Blue.
Introduction to MAT LAB
MATLAB stands for matrix laboratory.
MATLAB is a high-performance language for technical
computing.
It integrates computation, visualization, and programming
in an easy-to-use environment.
MAT LAB … Contd.,
Typical uses include
Algorithm development
Data acquisition
Modeling, simulation, and prototyping
Data analysis, exploration, and visualization
Scientific and engineering graphics
Math and computation
Application development, including graphical user interface
building
Parts of MATLAB
5
Development environment :- set of tools and facilities that helps
to use of MATLAB functions and files.
The MATLAB mathematical function library :-vast collection of
computational algorithms ranging from elementary functions to
more sophisticated functions
The MATLAB language :–consists of control flow statements,
functions, data structures, input/output, etc.,
Graphics :-for two-dimensional and three-dimensional data
visualization, image processing, animation, and presentation
graphics
The MATLAB application program interface (API) :-library that
allows you to write C and Fortran programs that interact with
MATLAB.
Working Environment of MATLAB
Commands in MATLAB
imread( ‘filename’ )
or
f = imread( ‘D:/my images/’eagle.jpg’ );
clc or clear
size( f )
1024 1024
whos f
Name Size Bytes Class
f 1024x1024 1048576 uint8 array
Grand total is 1048576 elements using 1048576 bytes
Writing images
imwrite(f,’filename’)
or
imwrite(f,’eagle’,’jpg’)
or
imwrite(f,’eagle.jpg’)
To show the information of image
imfinfo eagle.jpg
Filename: 'eagle.jpg'
FileModDate: '29-Aug-2007 10:01:40'
FileSize: 334
Format: ‘ jpg'
FormatVersion: ''
Width: 1
Height: 1
BitDepth: 8
ColorType: 'grayscale'
FormatSignature: ''
NumberOfSamples: 1
CodingMethod: 'Huffman'
CodingProcess: 'Sequential'
Comment: {}
CodingMethod: 'Huffman'
CodingProcess: 'Sequential'
Comment: {}
To Display A Image
imshow(‘eagle.jpg’);
Or
imshow(f);
To display two images
imshow( f ), figure, imshow( g )
Two Images in single Window
[X1,map1] = imread('eagle.jpg'); subplot(1,2,1) , imshow(X1,map1)
[X2,map2] = imread('testfire.jpg'); subplot(1,2,2) , imshow(X2,map2)
More Images in single Window
[X1,map1] = imread('eagle.jpg');
[X2,map2] = imread('testfire.jpg');
[X3,map3] = imread('eagle.jpg');
Row Wise Image Representation Column Wise Image Representation
subplot(1,3,1) , imshow(X1,map1) subplot(3,1,1) , imshow(X1,map1)
subplot(1,3,2) , imshow(X2,map2) subplot(3,1,2) , imshow(X2,map2)
subplot(1,3,3) , imshow(X3,map3); subplot(3,1,3) , imshow(X3,map3)
RGB to Grayscale Image Conversion
r=imread(‘peppers.jpg '); k = rgb2gray( r );
imshow(r);
imshow(k);
Grayscale to Binary Image Conversion
Z= im2bw( k );
imshow(z);
Here image will not be displayed
To Display Binary Images
BW = imread('circles.png');
imshow(BW) imshow(~BW) imshow(BW,[1 0 0; 0 0 1])
Conclusion
Digital Image Processing using MATLAB is
very ‘interactive’ ,allows formulating
solutions to many technical problems ,those
involving Matrix Representations in fraction
of time .
Queries ………?
THANKS
To
Medha 2k7