SlideShare a Scribd company logo
1 of 63
Follow me @ : http://sriramemarose.blogspot.in/
&
linkedin/sriramemarose
Every technology comes from Nature:
 Eye - Sensor to acquire photons
 Brain - Processor to process photoelectric signals from eye
Step 1. Light(white light) falling on
objects
Step 2. Eye lens focuses the light on
retina
Step 3. Image formation on retina, and
Step 4. Developing electric potential on
retina (Photoelectric effect)
Step 5. Optical nerves transmitting
developed potentials to brain
(Processor)
Optic nerves – Transmission medium
Hey, I got
potentials of X
values
(Temporal lobe)
Yes, I know what
does it mean
(Frontal lobe)
To frontal lobe,
From Temporal
lobe
 Different species absorbs different spectral wavelength
 Which implies different sensors(eye) have different reception abilities
 Color of the images depends on the type photo receptors
 Primary color images – RGB
 Photoreceptor – Cones
 Gray scale images (commonly known as black and white )
 Photoreceptor - Rods
 Man made technology that mimics operation of an eye
 Array of photoreceptors and film (to act as retina - cones and rods)
 Lens to focus light from surrounding/objects on the photoreceptors (mimics Iris
and eye lens)
)1,1()1,1()0,1(
)1,1()1,1()0,1(
)1,0()1,0()0,0(
),(
NMfMfMf
Nfff
Nfff
yxf
Gray line – Continuous analog
signals from sensors
Dotted lines – Sampling time
Red line – Quantized signal
Digital representation
of image obtained
from the quantized
signal
Different types of images often used,
 Color – RGB -> remember cones in eyes?
 R –> 0-255
 G –> 0-255
 B –> 0-255
 Grayscale -> remember rods in eyes?
 0 – Pure black/white
 1-254 – Shades of black and white(gray)
 255 – Pure black/white
 Boolean
 0- Pure black/white
 1- Pure white/black
Single pixel with respective
RGB values
RGB Image
Combination of RGB values
of each pixel contributing to
form an image
Pure black->0
Shades of black&white -> 1-254
White-> 255
Things to keep in mind,
 Image -> 2 dimensional matrix of size(mxn)
 Image processing -> Manipulating the values of each element of the matrix
)1,1()1,1()0,1(
)1,1()1,1()0,1(
)1,0()1,0()0,0(
),(
NMfMfMf
Nfff
Nfff
yxf
 From the above representation,
 f is an image
 f(0,0) -> single pixel of an image (similarly for all values of f(x,y)
 f(0,0) = 0-255 for grayscale
0/1 for binary
0-255 for each of R,G and B
From the image given below, how specific color(say blue) can be extracted?
Algorithm:
 Load an RGB image
 Get the size(mxn) of the image
 Create a new matrix of zeros of size mxn
 Read the values of R,G,B in each pixel while traversing through every
pixels of the image
 Restore pixels with required color to 1 and rest to 0 to the newly created
matrix
 Display the newly created matrix and the resultant image would be
the filtered image of specific color
Input image:
Output image(Extracted blue objects):
Snippet:
c=imread('F:matlab sample images1.png');
[m,n,t]=size(c);
tmp=zeros(m,n);
for i=1:m
for j=1:n
if(c(i,j,1)==0 && c(i,j,2)==0 && c(i,j,3)==255)
tmp(i,j)=1;
end
end
end
imshow(tmp);
From the image, count number of red objects,
Algorithm:
 Load the image
 Get the size of the image
 Find appropriate threshold level for red color
 Traverse through every pixel,
 Replace pixels with red threshold to 1 and remaining pixels to 0
 Find the objects with enclosed boundaries in the new image
 Count the boundaries to know number of objects
Input image:
Output image(Extracted red objects):
Snippet:
c=imread('F:matlab sample
images1.png');
[m,n,t]=size(c);
tmp=zeros(m,n);
for i=1:m
for j=1:n
if(c(i,j,1)==255 && c(i,j,2)==0 &&
c(i,j,3)==0)
tmp(i,j)=1;
end
end
end
imshow(tmp);
ss=bwboundaries(tmp);
num=length(ss);
Output: num = 3
 Thresholding is used to segment an image by setting all pixels whose intensity
values are above a threshold to a foreground value and all the remaining pixels to
a background value.
 The pixels are partitioned depending on their intensity value
 Global Thresholding,
g(x,y) = 0, if f(x,y)<=T
g(x,y) = 1, if f(x,y)>T
g(x,y) = a, if f(x,y)>T2
g(x,y) = b, if T1<f(x,y)<=T2
g(x,y) = c, if f(x,y)<=T1
 Multiple thresholding,
From the given image, Find the total number of objects present?
Algorithm:
 Load the image
 Convert the image into grayscale(incase of an RGB image)
 Fix a certain threshold level to be applied to the image
 Convert the image into binary by applying the threshold level
 Count the boundaries to count the number of objects
At 0.25 threshold At 0.5 threshold
At 0.6 thresholdAt 0.75 threshold
Snippet:
img=imread('F:matlab sample imagescolor.png');
img1=rgb2gray(img);
Thresholdvalue=0.75;
img2=im2bw(img1,Thresholdvalue);
figure,imshow(img2);
% to detect num of objects
B=bwboundaries(img2);
num=length(B);
Snippet:
img=imread('F:matlab sample imagescolor.png');
img1=rgb2gray(img);
Thresholdvalue=0.75;
img2=im2bw(img1,Thresholdvalue);
figure,imshow(img2);
% to detect num of objects
B=bwboundaries(img2);
num=length(B);
% to draw bow over objects
figure,imshow(img2);
hold on;
for k=1:length(B),
boundary = B{k};
plot(boundary(:,2), boundary(:,1), 'r','LineWidth',2);
end
 Given an image of English alphabets, segment each and every alphabets
 Perform basic morphological operations on the letters
 Detect edges
 Filter the noises if any
 Replace the pixel with maximum value found in the defined pixel set (dilate)
 Fill the holes in the images
 Label every blob in the image
 Draw the bounding box over each detected blob
Snippet:
a=imread('F:matlab sample imagesMYWORDS.png');
im=rgb2gray(a);
c=edge(im);
se = strel('square',8);
I= imdilate(c, se);
img=imfill(I,'holes');
figure,imshow(img);
[Ilabel num] = bwlabel(img);
disp(num);
Iprops = regionprops(Ilabel);
Ibox = [Iprops.BoundingBox];
Ibox = reshape(Ibox,[4 num]);
imshow(I)
hold on;
for cnt = 1:num
rectangle('position',Ibox(:,cnt),'edgecolor','r');
end
1. Write a program that solves the given equations calibration and
measurement
Hint: for manual calculation, to get values of x1,x2,y1 and y2 use imtool in
matlab
Algorithm:
 Load two images to be matched
 Detect edges of both images
 Traverse through each pixel and count number of black and white
points in one image (total value)
 Compare value of each pixels of both the images (matched value)
 Find the match percentage,
 Match percentage= ((matched value)/total value)*100)
 if match percentage exceeds certain threshold(say 90%), display, ‘image
matches’
Input Image:
Output Image after edge detection:
Note: This method works for identical
images and can be used for finger
print and IRIS matching
From the given image, find the nuts and washers based on its features
Algorithm:
 Analyze the image
 Look for detectable features of nuts/washers
 Preprocess the image to enhance the detectable feature
 Hint - Use morphological operations
 Create a detector to detect the feature
 Mark the detected results
Mathematical operation on two functions f and g, producing a third function that is a
modified version of one of the original functions
Example:
• Feature detection
Creating a convolution kernel for detecting edges:
• Analyze the logic to detect edges
• Choose a kernel with appropriate values to detect the lines
• Create a sliding window for the convolution kernel
• Slide the window through every pixel of the image
Input image Output image
After convolution
Algorithm:
• Load an image
• Create a kernel to detect horizontal edges
• Eg:
• Find the transpose of the kernel to obtain the vertical edges
• Apply the kernels to the image to filter the horizontal and vertical
components
Resultant image after applying horizontal filter kernel
Resultant image after applying vertical filter kernel
Snippet:
Using convolution:
rgb = imread('F:matlab sample images2.png');
I = rgb2gray(rgb);
imshow(I)
hy = fspecial('sobel');
hx = hy';
hrFilt=conv2(I,hy);
vrFilt=conv2(I,hx);
Using Fiters:
rgb = imread('F:matlab sample images2.png');
I = rgb2gray(rgb);
hy = fspecial('sobel');
hx = hy';
Iy = imfilter(double(I), hy, 'replicate');
Ix = imfilter(double(I), hx, 'replicate');
Often includes,
 Image color conversion
 Histogram equalization
 Edge detection
 Morphological operations
 Erode
 Dilate
 Open
 Close
To detect the required feature in an image,
• First subtract the unwanted features
• Enhance the required feature
• Create a detector to detect the feature
Gray scale
Histogram equalization
Edge detection:
Morphological close:
Image dilation:
Detect the feature in the preprocessed image
• Fusion: putting information together coming from different sources/data
• Registration: computing the geometrical transformation between two data
Applications:
• Medical Imaging
• Remote sensing
• Augmented Reality etc
Courtesy: G. Malandain, PhD, Senior Scientist, INRA
Courtesy: G. Malandain, PhD, Senior Scientist, INRA
PET scan of Brain MRI scan of Brain
+ =
Output of multimodal
registration( Different scanners)

More Related Content

What's hot

Simultaneous Smoothing and Sharpening of Color Images
Simultaneous Smoothing and Sharpening of Color ImagesSimultaneous Smoothing and Sharpening of Color Images
Simultaneous Smoothing and Sharpening of Color ImagesCristina Pérez Benito
 
Image proccessing and its application
Image proccessing and its applicationImage proccessing and its application
Image proccessing and its applicationAshwini Awatare
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentationasodariyabhavesh
 
Basics of image processing using MATLAB
Basics of image processing using MATLABBasics of image processing using MATLAB
Basics of image processing using MATLABMohsin Siddique
 
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...Hemantha Kulathilake
 
Image Acquisition and Representation
Image Acquisition and RepresentationImage Acquisition and Representation
Image Acquisition and RepresentationAmnaakhaan
 
Chapter 5 Image Processing: Fourier Transformation
Chapter 5 Image Processing: Fourier TransformationChapter 5 Image Processing: Fourier Transformation
Chapter 5 Image Processing: Fourier TransformationVarun Ojha
 
Digital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationDigital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationMostafa G. M. Mostafa
 
Digital Image Processing: An Introduction
Digital Image Processing: An IntroductionDigital Image Processing: An Introduction
Digital Image Processing: An IntroductionMostafa G. M. Mostafa
 
application of digital image processing and methods
application of digital image processing and methodsapplication of digital image processing and methods
application of digital image processing and methodsSIRILsam
 
Hough Transform By Md.Nazmul Islam
Hough Transform By Md.Nazmul IslamHough Transform By Md.Nazmul Islam
Hough Transform By Md.Nazmul IslamNazmul Islam
 
Image restoration and degradation model
Image restoration and degradation modelImage restoration and degradation model
Image restoration and degradation modelAnupriyaDurai
 
ImageProcessing10-Segmentation(Thresholding) (1).ppt
ImageProcessing10-Segmentation(Thresholding) (1).pptImageProcessing10-Segmentation(Thresholding) (1).ppt
ImageProcessing10-Segmentation(Thresholding) (1).pptVikramBarapatre2
 
Image Processing Basics
Image Processing BasicsImage Processing Basics
Image Processing BasicsA B Shinde
 

What's hot (20)

Simultaneous Smoothing and Sharpening of Color Images
Simultaneous Smoothing and Sharpening of Color ImagesSimultaneous Smoothing and Sharpening of Color Images
Simultaneous Smoothing and Sharpening of Color Images
 
Image proccessing and its application
Image proccessing and its applicationImage proccessing and its application
Image proccessing and its application
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentation
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Basics of image processing using MATLAB
Basics of image processing using MATLABBasics of image processing using MATLAB
Basics of image processing using MATLAB
 
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
 
Image Acquisition and Representation
Image Acquisition and RepresentationImage Acquisition and Representation
Image Acquisition and Representation
 
Image processing
Image processingImage processing
Image processing
 
Chapter 5 Image Processing: Fourier Transformation
Chapter 5 Image Processing: Fourier TransformationChapter 5 Image Processing: Fourier Transformation
Chapter 5 Image Processing: Fourier Transformation
 
Image processing ppt
Image processing pptImage processing ppt
Image processing ppt
 
Digital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationDigital Image Processing: Image Segmentation
Digital Image Processing: Image Segmentation
 
Digital Image Processing: An Introduction
Digital Image Processing: An IntroductionDigital Image Processing: An Introduction
Digital Image Processing: An Introduction
 
image compression ppt
image compression pptimage compression ppt
image compression ppt
 
application of digital image processing and methods
application of digital image processing and methodsapplication of digital image processing and methods
application of digital image processing and methods
 
Hough Transform By Md.Nazmul Islam
Hough Transform By Md.Nazmul IslamHough Transform By Md.Nazmul Islam
Hough Transform By Md.Nazmul Islam
 
Computer Vision
Computer VisionComputer Vision
Computer Vision
 
Image restoration and degradation model
Image restoration and degradation modelImage restoration and degradation model
Image restoration and degradation model
 
ImageProcessing10-Segmentation(Thresholding) (1).ppt
ImageProcessing10-Segmentation(Thresholding) (1).pptImageProcessing10-Segmentation(Thresholding) (1).ppt
ImageProcessing10-Segmentation(Thresholding) (1).ppt
 
Image Processing Basics
Image Processing BasicsImage Processing Basics
Image Processing Basics
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
 

Viewers also liked

Image proceesing with matlab
Image proceesing with matlabImage proceesing with matlab
Image proceesing with matlabAshutosh Shahi
 
Basics of Image Processing using MATLAB
Basics of Image Processing using MATLABBasics of Image Processing using MATLAB
Basics of Image Processing using MATLABvkn13
 
Introduction to Digital Image Processing Using MATLAB
Introduction to Digital Image Processing Using MATLABIntroduction to Digital Image Processing Using MATLAB
Introduction to Digital Image Processing Using MATLABRay Phan
 
Matlab Working With Images
Matlab Working With ImagesMatlab Working With Images
Matlab Working With Imagesmatlab Content
 
Image feature extraction
Image feature extractionImage feature extraction
Image feature extractionRushin Shah
 
Matlab Feature Extraction Using Segmentation And Edge Detection
Matlab Feature Extraction Using Segmentation And Edge DetectionMatlab Feature Extraction Using Segmentation And Edge Detection
Matlab Feature Extraction Using Segmentation And Edge DetectionDataminingTools Inc
 
Introduction in Image Processing Matlab Toolbox
Introduction in Image Processing Matlab ToolboxIntroduction in Image Processing Matlab Toolbox
Introduction in Image Processing Matlab ToolboxShahriar Yazdipour
 
Matlab and Image Processing Workshop-SKERG
Matlab and Image Processing Workshop-SKERG Matlab and Image Processing Workshop-SKERG
Matlab and Image Processing Workshop-SKERG Sulaf Almagooshi
 
Image Processing using Matlab ( using a built in Matlab function(Histogram eq...
Image Processing using Matlab ( using a built in Matlab function(Histogram eq...Image Processing using Matlab ( using a built in Matlab function(Histogram eq...
Image Processing using Matlab ( using a built in Matlab function(Histogram eq...Majd Khaleel
 
K10990 GUDDU ALI RAC ME 6TH SEM
K10990 GUDDU ALI RAC ME 6TH SEMK10990 GUDDU ALI RAC ME 6TH SEM
K10990 GUDDU ALI RAC ME 6TH SEMGuddu Ali
 
SIMULATION OF THERMODYNAMIC ANALYSIS OF CASCADE REFRIGERATION SYSTEM WITH ALT...
SIMULATION OF THERMODYNAMIC ANALYSIS OF CASCADE REFRIGERATION SYSTEM WITH ALT...SIMULATION OF THERMODYNAMIC ANALYSIS OF CASCADE REFRIGERATION SYSTEM WITH ALT...
SIMULATION OF THERMODYNAMIC ANALYSIS OF CASCADE REFRIGERATION SYSTEM WITH ALT...IAEME Publication
 
K10854 Experimental evaluation of cascade refrigeration plant
K10854 Experimental evaluation of cascade refrigeration plantK10854 Experimental evaluation of cascade refrigeration plant
K10854 Experimental evaluation of cascade refrigeration plantShraddhey Bhandari
 
Machine Vision applications development in MatLab
Machine Vision applications development in MatLabMachine Vision applications development in MatLab
Machine Vision applications development in MatLabSriram Emarose
 
Presentation of Refrigeration Simulation
Presentation of Refrigeration SimulationPresentation of Refrigeration Simulation
Presentation of Refrigeration SimulationShafiul Munir
 
SVM-based CBIR of breast masses on mammograms
SVM-based CBIR of breast masses on mammogramsSVM-based CBIR of breast masses on mammograms
SVM-based CBIR of breast masses on mammogramsLazaros Tsochatzidis
 
Morfología de las imágenes Matlab
Morfología de las imágenes MatlabMorfología de las imágenes Matlab
Morfología de las imágenes Matlabjhonbri25
 

Viewers also liked (20)

Image proceesing with matlab
Image proceesing with matlabImage proceesing with matlab
Image proceesing with matlab
 
Basics of Image Processing using MATLAB
Basics of Image Processing using MATLABBasics of Image Processing using MATLAB
Basics of Image Processing using MATLAB
 
Getting started with image processing using Matlab
Getting started with image processing using MatlabGetting started with image processing using Matlab
Getting started with image processing using Matlab
 
Introduction to Digital Image Processing Using MATLAB
Introduction to Digital Image Processing Using MATLABIntroduction to Digital Image Processing Using MATLAB
Introduction to Digital Image Processing Using MATLAB
 
Image Processing Using MATLAB
Image Processing Using MATLABImage Processing Using MATLAB
Image Processing Using MATLAB
 
Matlab Working With Images
Matlab Working With ImagesMatlab Working With Images
Matlab Working With Images
 
Image feature extraction
Image feature extractionImage feature extraction
Image feature extraction
 
Matlab Feature Extraction Using Segmentation And Edge Detection
Matlab Feature Extraction Using Segmentation And Edge DetectionMatlab Feature Extraction Using Segmentation And Edge Detection
Matlab Feature Extraction Using Segmentation And Edge Detection
 
Introduction in Image Processing Matlab Toolbox
Introduction in Image Processing Matlab ToolboxIntroduction in Image Processing Matlab Toolbox
Introduction in Image Processing Matlab Toolbox
 
Matlab and Image Processing Workshop-SKERG
Matlab and Image Processing Workshop-SKERG Matlab and Image Processing Workshop-SKERG
Matlab and Image Processing Workshop-SKERG
 
Medical Informatics
Medical InformaticsMedical Informatics
Medical Informatics
 
Image Processing using Matlab ( using a built in Matlab function(Histogram eq...
Image Processing using Matlab ( using a built in Matlab function(Histogram eq...Image Processing using Matlab ( using a built in Matlab function(Histogram eq...
Image Processing using Matlab ( using a built in Matlab function(Histogram eq...
 
K10990 GUDDU ALI RAC ME 6TH SEM
K10990 GUDDU ALI RAC ME 6TH SEMK10990 GUDDU ALI RAC ME 6TH SEM
K10990 GUDDU ALI RAC ME 6TH SEM
 
Matlab GUI
Matlab GUIMatlab GUI
Matlab GUI
 
SIMULATION OF THERMODYNAMIC ANALYSIS OF CASCADE REFRIGERATION SYSTEM WITH ALT...
SIMULATION OF THERMODYNAMIC ANALYSIS OF CASCADE REFRIGERATION SYSTEM WITH ALT...SIMULATION OF THERMODYNAMIC ANALYSIS OF CASCADE REFRIGERATION SYSTEM WITH ALT...
SIMULATION OF THERMODYNAMIC ANALYSIS OF CASCADE REFRIGERATION SYSTEM WITH ALT...
 
K10854 Experimental evaluation of cascade refrigeration plant
K10854 Experimental evaluation of cascade refrigeration plantK10854 Experimental evaluation of cascade refrigeration plant
K10854 Experimental evaluation of cascade refrigeration plant
 
Machine Vision applications development in MatLab
Machine Vision applications development in MatLabMachine Vision applications development in MatLab
Machine Vision applications development in MatLab
 
Presentation of Refrigeration Simulation
Presentation of Refrigeration SimulationPresentation of Refrigeration Simulation
Presentation of Refrigeration Simulation
 
SVM-based CBIR of breast masses on mammograms
SVM-based CBIR of breast masses on mammogramsSVM-based CBIR of breast masses on mammograms
SVM-based CBIR of breast masses on mammograms
 
Morfología de las imágenes Matlab
Morfología de las imágenes MatlabMorfología de las imágenes Matlab
Morfología de las imágenes Matlab
 

Similar to Introduction to Image Processing with MATLAB

ImageProcessingWithMatlab(HasithaEdiriweera)
ImageProcessingWithMatlab(HasithaEdiriweera)ImageProcessingWithMatlab(HasithaEdiriweera)
ImageProcessingWithMatlab(HasithaEdiriweera)Hasitha Ediriweera
 
Writeup advanced lane_lines_project
Writeup advanced lane_lines_projectWriteup advanced lane_lines_project
Writeup advanced lane_lines_projectManish Jauhari
 
Image processing with matlab
Image processing with matlabImage processing with matlab
Image processing with matlabAman Gupta
 
Lec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfLec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfnagwaAboElenein
 
Matlab intro
Matlab introMatlab intro
Matlab introfvijayami
 
1 of 6 LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
1 of 6  LAB 5 IMAGE FILTERING ECE180 Introduction to.docx1 of 6  LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
1 of 6 LAB 5 IMAGE FILTERING ECE180 Introduction to.docxmercysuttle
 
Working with images in matlab graphics
Working with images in matlab graphicsWorking with images in matlab graphics
Working with images in matlab graphicsmustafa_92
 
Ip fundamentals(3)-edit7
Ip fundamentals(3)-edit7Ip fundamentals(3)-edit7
Ip fundamentals(3)-edit7Emily Kapoor
 
IP_Fundamentals.ppt
IP_Fundamentals.pptIP_Fundamentals.ppt
IP_Fundamentals.pptKARTHICKT41
 
Using the code below- I need help with creating code for the following.pdf
Using the code below- I need help with creating code for the following.pdfUsing the code below- I need help with creating code for the following.pdf
Using the code below- I need help with creating code for the following.pdfacteleshoppe
 
ECCV2010: feature learning for image classification, part 2
ECCV2010: feature learning for image classification, part 2ECCV2010: feature learning for image classification, part 2
ECCV2010: feature learning for image classification, part 2zukun
 
Coin recognition using matlab
Coin recognition using matlabCoin recognition using matlab
Coin recognition using matlabslmnsvn
 
Image_Processing_LECTURE_c#_programming.ppt
Image_Processing_LECTURE_c#_programming.pptImage_Processing_LECTURE_c#_programming.ppt
Image_Processing_LECTURE_c#_programming.pptLOUISSEVERINOROMANO
 
Image Texture Analysis
Image Texture AnalysisImage Texture Analysis
Image Texture Analysislalitxp
 

Similar to Introduction to Image Processing with MATLAB (20)

ImageProcessingWithMatlab(HasithaEdiriweera)
ImageProcessingWithMatlab(HasithaEdiriweera)ImageProcessingWithMatlab(HasithaEdiriweera)
ImageProcessingWithMatlab(HasithaEdiriweera)
 
Report
ReportReport
Report
 
Writeup advanced lane_lines_project
Writeup advanced lane_lines_projectWriteup advanced lane_lines_project
Writeup advanced lane_lines_project
 
Image processing with matlab
Image processing with matlabImage processing with matlab
Image processing with matlab
 
Lec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfLec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdf
 
Matlab intro
Matlab introMatlab intro
Matlab intro
 
1 of 6 LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
1 of 6  LAB 5 IMAGE FILTERING ECE180 Introduction to.docx1 of 6  LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
1 of 6 LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
 
Working with images in matlab graphics
Working with images in matlab graphicsWorking with images in matlab graphics
Working with images in matlab graphics
 
Ip fundamentals(3)-edit7
Ip fundamentals(3)-edit7Ip fundamentals(3)-edit7
Ip fundamentals(3)-edit7
 
IP_Fundamentals.ppt
IP_Fundamentals.pptIP_Fundamentals.ppt
IP_Fundamentals.ppt
 
IP_Fundamentals.ppt
IP_Fundamentals.pptIP_Fundamentals.ppt
IP_Fundamentals.ppt
 
Using the code below- I need help with creating code for the following.pdf
Using the code below- I need help with creating code for the following.pdfUsing the code below- I need help with creating code for the following.pdf
Using the code below- I need help with creating code for the following.pdf
 
Image processing
Image processingImage processing
Image processing
 
Ec section
Ec section Ec section
Ec section
 
Image processing
Image processingImage processing
Image processing
 
Dip 2
Dip 2Dip 2
Dip 2
 
ECCV2010: feature learning for image classification, part 2
ECCV2010: feature learning for image classification, part 2ECCV2010: feature learning for image classification, part 2
ECCV2010: feature learning for image classification, part 2
 
Coin recognition using matlab
Coin recognition using matlabCoin recognition using matlab
Coin recognition using matlab
 
Image_Processing_LECTURE_c#_programming.ppt
Image_Processing_LECTURE_c#_programming.pptImage_Processing_LECTURE_c#_programming.ppt
Image_Processing_LECTURE_c#_programming.ppt
 
Image Texture Analysis
Image Texture AnalysisImage Texture Analysis
Image Texture Analysis
 

Recently uploaded

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 

Recently uploaded (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 

Introduction to Image Processing with MATLAB

  • 1. Follow me @ : http://sriramemarose.blogspot.in/ & linkedin/sriramemarose
  • 2. Every technology comes from Nature:  Eye - Sensor to acquire photons  Brain - Processor to process photoelectric signals from eye
  • 3. Step 1. Light(white light) falling on objects Step 2. Eye lens focuses the light on retina Step 3. Image formation on retina, and Step 4. Developing electric potential on retina (Photoelectric effect) Step 5. Optical nerves transmitting developed potentials to brain (Processor)
  • 4. Optic nerves – Transmission medium Hey, I got potentials of X values (Temporal lobe) Yes, I know what does it mean (Frontal lobe) To frontal lobe, From Temporal lobe
  • 5.
  • 6.  Different species absorbs different spectral wavelength  Which implies different sensors(eye) have different reception abilities
  • 7.  Color of the images depends on the type photo receptors  Primary color images – RGB  Photoreceptor – Cones  Gray scale images (commonly known as black and white )  Photoreceptor - Rods
  • 8.
  • 9.  Man made technology that mimics operation of an eye  Array of photoreceptors and film (to act as retina - cones and rods)  Lens to focus light from surrounding/objects on the photoreceptors (mimics Iris and eye lens)
  • 10.
  • 11.
  • 12. )1,1()1,1()0,1( )1,1()1,1()0,1( )1,0()1,0()0,0( ),( NMfMfMf Nfff Nfff yxf Gray line – Continuous analog signals from sensors Dotted lines – Sampling time Red line – Quantized signal Digital representation of image obtained from the quantized signal
  • 13. Different types of images often used,  Color – RGB -> remember cones in eyes?  R –> 0-255  G –> 0-255  B –> 0-255  Grayscale -> remember rods in eyes?  0 – Pure black/white  1-254 – Shades of black and white(gray)  255 – Pure black/white  Boolean  0- Pure black/white  1- Pure white/black
  • 14. Single pixel with respective RGB values RGB Image
  • 15. Combination of RGB values of each pixel contributing to form an image
  • 16. Pure black->0 Shades of black&white -> 1-254 White-> 255
  • 17.
  • 18.
  • 19.
  • 20. Things to keep in mind,  Image -> 2 dimensional matrix of size(mxn)  Image processing -> Manipulating the values of each element of the matrix )1,1()1,1()0,1( )1,1()1,1()0,1( )1,0()1,0()0,0( ),( NMfMfMf Nfff Nfff yxf  From the above representation,  f is an image  f(0,0) -> single pixel of an image (similarly for all values of f(x,y)  f(0,0) = 0-255 for grayscale 0/1 for binary 0-255 for each of R,G and B
  • 21. From the image given below, how specific color(say blue) can be extracted?
  • 22. Algorithm:  Load an RGB image  Get the size(mxn) of the image  Create a new matrix of zeros of size mxn  Read the values of R,G,B in each pixel while traversing through every pixels of the image  Restore pixels with required color to 1 and rest to 0 to the newly created matrix  Display the newly created matrix and the resultant image would be the filtered image of specific color
  • 23. Input image: Output image(Extracted blue objects): Snippet: c=imread('F:matlab sample images1.png'); [m,n,t]=size(c); tmp=zeros(m,n); for i=1:m for j=1:n if(c(i,j,1)==0 && c(i,j,2)==0 && c(i,j,3)==255) tmp(i,j)=1; end end end imshow(tmp);
  • 24. From the image, count number of red objects,
  • 25. Algorithm:  Load the image  Get the size of the image  Find appropriate threshold level for red color  Traverse through every pixel,  Replace pixels with red threshold to 1 and remaining pixels to 0  Find the objects with enclosed boundaries in the new image  Count the boundaries to know number of objects
  • 26. Input image: Output image(Extracted red objects): Snippet: c=imread('F:matlab sample images1.png'); [m,n,t]=size(c); tmp=zeros(m,n); for i=1:m for j=1:n if(c(i,j,1)==255 && c(i,j,2)==0 && c(i,j,3)==0) tmp(i,j)=1; end end end imshow(tmp); ss=bwboundaries(tmp); num=length(ss); Output: num = 3
  • 27.  Thresholding is used to segment an image by setting all pixels whose intensity values are above a threshold to a foreground value and all the remaining pixels to a background value.  The pixels are partitioned depending on their intensity value  Global Thresholding, g(x,y) = 0, if f(x,y)<=T g(x,y) = 1, if f(x,y)>T g(x,y) = a, if f(x,y)>T2 g(x,y) = b, if T1<f(x,y)<=T2 g(x,y) = c, if f(x,y)<=T1  Multiple thresholding,
  • 28. From the given image, Find the total number of objects present?
  • 29. Algorithm:  Load the image  Convert the image into grayscale(incase of an RGB image)  Fix a certain threshold level to be applied to the image  Convert the image into binary by applying the threshold level  Count the boundaries to count the number of objects
  • 30. At 0.25 threshold At 0.5 threshold At 0.6 thresholdAt 0.75 threshold
  • 32.
  • 33. Snippet: img=imread('F:matlab sample imagescolor.png'); img1=rgb2gray(img); Thresholdvalue=0.75; img2=im2bw(img1,Thresholdvalue); figure,imshow(img2); % to detect num of objects B=bwboundaries(img2); num=length(B); % to draw bow over objects figure,imshow(img2); hold on; for k=1:length(B), boundary = B{k}; plot(boundary(:,2), boundary(:,1), 'r','LineWidth',2); end
  • 34.  Given an image of English alphabets, segment each and every alphabets  Perform basic morphological operations on the letters  Detect edges  Filter the noises if any  Replace the pixel with maximum value found in the defined pixel set (dilate)  Fill the holes in the images  Label every blob in the image  Draw the bounding box over each detected blob
  • 35.
  • 36. Snippet: a=imread('F:matlab sample imagesMYWORDS.png'); im=rgb2gray(a); c=edge(im); se = strel('square',8); I= imdilate(c, se); img=imfill(I,'holes'); figure,imshow(img); [Ilabel num] = bwlabel(img); disp(num); Iprops = regionprops(Ilabel); Ibox = [Iprops.BoundingBox]; Ibox = reshape(Ibox,[4 num]); imshow(I) hold on; for cnt = 1:num rectangle('position',Ibox(:,cnt),'edgecolor','r'); end
  • 37.
  • 38.
  • 39.
  • 40. 1. Write a program that solves the given equations calibration and measurement Hint: for manual calculation, to get values of x1,x2,y1 and y2 use imtool in matlab
  • 41. Algorithm:  Load two images to be matched  Detect edges of both images  Traverse through each pixel and count number of black and white points in one image (total value)  Compare value of each pixels of both the images (matched value)  Find the match percentage,  Match percentage= ((matched value)/total value)*100)  if match percentage exceeds certain threshold(say 90%), display, ‘image matches’
  • 42. Input Image: Output Image after edge detection: Note: This method works for identical images and can be used for finger print and IRIS matching
  • 43. From the given image, find the nuts and washers based on its features
  • 44. Algorithm:  Analyze the image  Look for detectable features of nuts/washers  Preprocess the image to enhance the detectable feature  Hint - Use morphological operations  Create a detector to detect the feature  Mark the detected results
  • 45.
  • 46. Mathematical operation on two functions f and g, producing a third function that is a modified version of one of the original functions Example: • Feature detection Creating a convolution kernel for detecting edges: • Analyze the logic to detect edges • Choose a kernel with appropriate values to detect the lines • Create a sliding window for the convolution kernel • Slide the window through every pixel of the image
  • 47. Input image Output image After convolution
  • 48.
  • 49. Algorithm: • Load an image • Create a kernel to detect horizontal edges • Eg: • Find the transpose of the kernel to obtain the vertical edges • Apply the kernels to the image to filter the horizontal and vertical components
  • 50. Resultant image after applying horizontal filter kernel
  • 51. Resultant image after applying vertical filter kernel
  • 52. Snippet: Using convolution: rgb = imread('F:matlab sample images2.png'); I = rgb2gray(rgb); imshow(I) hy = fspecial('sobel'); hx = hy'; hrFilt=conv2(I,hy); vrFilt=conv2(I,hx); Using Fiters: rgb = imread('F:matlab sample images2.png'); I = rgb2gray(rgb); hy = fspecial('sobel'); hx = hy'; Iy = imfilter(double(I), hy, 'replicate'); Ix = imfilter(double(I), hx, 'replicate');
  • 53. Often includes,  Image color conversion  Histogram equalization  Edge detection  Morphological operations  Erode  Dilate  Open  Close
  • 54. To detect the required feature in an image, • First subtract the unwanted features • Enhance the required feature • Create a detector to detect the feature
  • 59. Detect the feature in the preprocessed image
  • 60. • Fusion: putting information together coming from different sources/data • Registration: computing the geometrical transformation between two data Applications: • Medical Imaging • Remote sensing • Augmented Reality etc
  • 61. Courtesy: G. Malandain, PhD, Senior Scientist, INRA
  • 62. Courtesy: G. Malandain, PhD, Senior Scientist, INRA
  • 63. PET scan of Brain MRI scan of Brain + = Output of multimodal registration( Different scanners)