SlideShare a Scribd company logo
1 of 14
Download to read offline
“VISION SYSTEMS”
ASSIGNMENT NO: 1
SUBMITTED BY: HINNA NAYAB
REGN. NO: 11PWMCT0143
SUBMITTED TO: DR. SHEHZAD
(9th
March, 2015)
8TH
SEMESTER
(MORNING)
INSTITUTE OF MECHATRONICS ENGINEERING
UET, PESHAWAR
MATLAB INTRODUCTION
1. Construct a 10x10 matrix such that the diagonal elements get the value of the indices
(eg. index (3,3) gets the value 3), and the element with index (10,1) gets the value 5.
A matrix was constructed by using ‘rand(n)’ function to form a randomly generated matrix. The
diagonal elements and index(10,1) were specified as directed.
2. Extract the 2,3 and 7 column from the matrix with one command.
3. What is the expected result of matrix multiplication and element-wise multiplication of
this matrix with itself ? Confirm your expectations using Matlab. What is the general
operator for element-wise operations in Matlab?
The general operator for element-wise operations in matlab is ‘.’ e.g
• Multiplication(.*)
• Addition(.+)
• Subtraction(.-)
• Division(./ or.)
4. Show the original matrix as an image.
The original matrix was shown as an image by trying out commands: ‘image(A)’, ‘imagesc(A)’,
‘imshow(A)’.
• >>Image(A)
‘ image(A)’ displays matrix A as an image. Each element of A specifies the color of a rectilinear
patch in the image.
• >>imagesc(A)
‘Imagesc’: “Scale data and display as image.” imagesc(A) is the same as image(A) except the
data is scaled to use the full colormap.
1 2 3 4 5 6 7 8 9 10
1
2
3
4
5
6
7
8
9
10
1 2 3 4 5 6 7 8 9 10
1
2
3
4
5
6
7
8
9
10
>> axis image %axis image fits the plot box directly around the data
• >>imshow(A)
(imshow(A) displays the grayscale image A)
‘COLORMAP’ FUNCTION:
M-by-3 matrix specifying a colormap. imshow uses this to set the figure's colormap property.
This parameter is used to view grayscale images in false color.
The colormap matrix for ‘A’ in matlab:
>>cmap=colormap
cmap =
2 4 6 8 10
1
2
3
4
5
6
7
8
9
10
0 0 0.5625
0 0 0.6250
0 0 0.6875
0 0 0.7500
0 0 0.8125
0 0 0.8750
0 0 0.9375
0 0 1.0000
0 0.0625 1.0000
0 0.1250 1.0000
0 0.1875 1.0000
0 0.2500 1.0000
0 0.3125 1.0000
0 0.3750 1.0000
0 0.4375 1.0000
0 0.5000 1.0000
0 0.5625 1.0000
0 0.6250 1.0000
0 0.6875 1.0000
0 0.7500 1.0000
0 0.8125 1.0000
0 0.8750 1.0000
0 0.9375 1.0000
0 1.0000 1.0000
0.0625 1.0000 0.9375
0.1250 1.0000 0.8750
0.1875 1.0000 0.8125
0.2500 1.0000 0.7500
0.3125 1.0000 0.6875
0.3750 1.0000 0.6250
0.4375 1.0000 0.5625
0.5000 1.0000 0.5000
0.5625 1.0000 0.4375
0.6250 1.0000 0.3750
0.6875 1.0000 0.3125
0.7500 1.0000 0.2500
0.8125 1.0000 0.1875
0.8750 1.0000 0.1250
0.9375 1.0000 0.0625
1.0000 1.0000 0
1.0000 0.9375 0
1.0000 0.8750 0
1.0000 0.8125 0
1.0000 0.7500 0
1.0000 0.6875 0
1.0000 0.6250 0
1.0000 0.5625 0
1.0000 0.5000 0
1.0000 0.4375 0
1.0000 0.3750 0
1.0000 0.3125 0
1.0000 0.2500 0
1.0000 0.1875 0
1.0000 0.1250 0
1.0000 0.0625 0
1.0000 0 0
0.9375 0 0
0.8750 0 0
0.8125 0 0
0.7500 0 0
0.6875 0 0
0.6250 0 0
0.5625 0 0
0.5000 0 0
Trying out some basic colormap functions:
>>colormap(cmap) %sets the current figure’s colormap to cmap.
>> colormap('default') %sets the current figure's colormap tothe root's default, whose
setting is JET.
>>colormap(bone) %bone is a grayscale colormap with a higher value for blue component.
(Adds electronic look to grayscale images.)
>>colormap(spring) %spring consistes of colors that are shades of magenta and yellow.
2 4 6 8 10
1
2
3
4
5
6
7
8
9
10
>>colormap(autumn) %autumn varies smoothly from orange to red to yellow.
>>colormap(winter) %winter consists of colors that are shades of blue and green.
1 2 3 4 5 6 7 8 9 10
1
2
3
4
5
6
7
8
9
10
1 2 3 4 5 6 7 8 9 10
1
2
3
4
5
6
7
8
9
10
1 2 3 4 5 6 7 8 9 10
1
2
3
4
5
6
7
8
9
10
>>colormap(copper) %copper varies smoothly from black to bright copper.
>>colormap(gray) %returns a linear grayscale image.
5. Describe the following coordinate systems: Matrix coordinates, Mathematical Cartesian
coordinates, and Matlab image coordinates. For each you must point out where the
coordinates (10,1) is located in a 10x10 coordinate frame. Are there any differences? Which
coordinate system do you prefer?
CARTESIAN COORDINATES:
The Cartesian coordinate system is commonly used in mathematics. The origin is the point (0,
0). In this system, the first component x increases to the right, while the second component y
increases upward. The origin (0, 0) is at the lower-left corner. It is the most common coordinate
system for manipulating mathematical entities, such as parametric surfaces.
(The index (10,1) is located in 1st quadrant, lower right corner)
1 2 3 4 5 6 7 8 9 10
1
2
3
4
5
6
7
8
9
10
1 2 3 4 5 6 7 8 9 10
1
2
3
4
5
6
7
8
9
10
MATRIX COORDINATES:
The matrix coordinate system is commonly used for matrices and displays. The origin is at the
upper left corner and usually starts with (1, 1). The matrix coordinate system, also called the
row-column coordinate system, is MATLAB's coordinate system for matrices. MATLAB uses this
system for matrix subscript notation. In this system, the first component (row) increases
downward, while the second component (column) increases to the right.
(The index (10, 1) is located at the lower-left corner)
MATLAB IMAGE (PIXEL) COORDINATES:
The pixel coordinate system is the most common coordinate system for digital image
processing in MATLAB. For pixel coordinates, the first component x increases to the right, while
the second component y increases downward. The origin is at the upper left corner. These
coordinates are typically integers. If we compare it to the row-column system, then row
corresponds to y and column corresponds to x. If we compare it to the Cartesian system, then
the y axis is reversed.
(The index(10,1) is located at the upper-right corner)
MATLAB uses the matrix coordinate system for image matrix manipulation and the pixel
coordinate system for everything else.
The preferred coordinate system is the Matrix coordinate system since it makes the
mathematical computations easy.
6. Add noise to the image Use the Matlab helpdesk to search for functions that generate
random noise. Display the original matrix with noise added.
ADDING NOISE:
Adding ‘Gaussian’ (white noise with constant mean and variance) noise:
>>A= imnoise(A,’gaussian’)
>> figure(), image(A);
>> figure(), imagesc(A);
1 2 3 4 5 6 7 8 9 10
1
2
3
4
5
6
7
8
9
10
1 2 3 4 5 6 7 8 9 10
1
2
3
4
5
6
7
8
9
10
Adding random noise to the scaled image:
>>imnoise(A)
>> figure(), imagesc(A);
Adding Speckle(Multiplicative) noise to the scaled data image:
>> A= imnoise(A,’speckle’)
1 2 3 4 5 6 7 8 9 10
1
2
3
4
5
6
7
8
9
10
>> figure() , imagesc(A);
7. Try demos for Matlab Image Toolbox….. Image Processing Toolbox.
Following were practiced regarding the above:
• Reading an image.
• Using morphological opening to estimate the background.
• View background approximation as surface.
• Subtract background image from original image.
• Image intensity adjustment.
• Thresholding
• Examine one object in image.
• Image histogram.
1 2 3 4 5 6 7 8 9 10
1
2
3
4
5
6
7
8
9
10

More Related Content

What's hot

Matlab matrices and arrays
Matlab matrices and arraysMatlab matrices and arrays
Matlab matrices and arraysAmeen San
 
Principal component analysis and lda
Principal component analysis and ldaPrincipal component analysis and lda
Principal component analysis and ldaSuresh Pokharel
 
Principal component analysis - application in finance
Principal component analysis - application in financePrincipal component analysis - application in finance
Principal component analysis - application in financeIgor Hlivka
 
"FingerPrint Recognition Using Principle Component Analysis(PCA)”
"FingerPrint Recognition Using Principle Component Analysis(PCA)”"FingerPrint Recognition Using Principle Component Analysis(PCA)”
"FingerPrint Recognition Using Principle Component Analysis(PCA)”Er. Arpit Sharma
 
Linear Algebra and Matlab tutorial
Linear Algebra and Matlab tutorialLinear Algebra and Matlab tutorial
Linear Algebra and Matlab tutorialJia-Bin Huang
 
Matlab ch1 (3)
Matlab ch1 (3)Matlab ch1 (3)
Matlab ch1 (3)mohsinggg
 
Introduction to MATLAB 1
Introduction to MATLAB 1Introduction to MATLAB 1
Introduction to MATLAB 1Mohamed Gafar
 
Variables in matlab
Variables in matlabVariables in matlab
Variables in matlabTUOS-Sam
 
Matrix Manipulation in Matlab
Matrix Manipulation in MatlabMatrix Manipulation in Matlab
Matrix Manipulation in MatlabMohamed Loey
 
Matlab HTI summer training course Lecture3
Matlab HTI summer training course Lecture3Matlab HTI summer training course Lecture3
Matlab HTI summer training course Lecture3Mohamed Awni
 
Principal Component Analysis and Clustering
Principal Component Analysis and ClusteringPrincipal Component Analysis and Clustering
Principal Component Analysis and ClusteringUsha Vijay
 
Introduction to simulink (1)
Introduction to simulink (1)Introduction to simulink (1)
Introduction to simulink (1)Memo Love
 

What's hot (20)

Matlab matrices and arrays
Matlab matrices and arraysMatlab matrices and arrays
Matlab matrices and arrays
 
Principal component analysis and lda
Principal component analysis and ldaPrincipal component analysis and lda
Principal component analysis and lda
 
Environmental Engineering Assignment Help
Environmental Engineering Assignment HelpEnvironmental Engineering Assignment Help
Environmental Engineering Assignment Help
 
gmrit-cse
gmrit-csegmrit-cse
gmrit-cse
 
Principal component analysis - application in finance
Principal component analysis - application in financePrincipal component analysis - application in finance
Principal component analysis - application in finance
 
"FingerPrint Recognition Using Principle Component Analysis(PCA)”
"FingerPrint Recognition Using Principle Component Analysis(PCA)”"FingerPrint Recognition Using Principle Component Analysis(PCA)”
"FingerPrint Recognition Using Principle Component Analysis(PCA)”
 
Fourier Transform Assignment Help
Fourier Transform Assignment HelpFourier Transform Assignment Help
Fourier Transform Assignment Help
 
PCA
PCAPCA
PCA
 
Linear Algebra and Matlab tutorial
Linear Algebra and Matlab tutorialLinear Algebra and Matlab tutorial
Linear Algebra and Matlab tutorial
 
Understandig PCA and LDA
Understandig PCA and LDAUnderstandig PCA and LDA
Understandig PCA and LDA
 
MATLAB - Arrays and Matrices
MATLAB - Arrays and MatricesMATLAB - Arrays and Matrices
MATLAB - Arrays and Matrices
 
Matlab ch1 (3)
Matlab ch1 (3)Matlab ch1 (3)
Matlab ch1 (3)
 
Introduction to MATLAB 1
Introduction to MATLAB 1Introduction to MATLAB 1
Introduction to MATLAB 1
 
Variables in matlab
Variables in matlabVariables in matlab
Variables in matlab
 
working with matrices in r
working with matrices in rworking with matrices in r
working with matrices in r
 
Matrix Manipulation in Matlab
Matrix Manipulation in MatlabMatrix Manipulation in Matlab
Matrix Manipulation in Matlab
 
Matlab HTI summer training course Lecture3
Matlab HTI summer training course Lecture3Matlab HTI summer training course Lecture3
Matlab HTI summer training course Lecture3
 
Principal Component Analysis and Clustering
Principal Component Analysis and ClusteringPrincipal Component Analysis and Clustering
Principal Component Analysis and Clustering
 
Introduction to simulink (1)
Introduction to simulink (1)Introduction to simulink (1)
Introduction to simulink (1)
 
Independent Component Analysis
Independent Component AnalysisIndependent Component Analysis
Independent Component Analysis
 

Similar to Vision systems_Image processing tool box in MATLAB

Importance of matlab
Importance of matlabImportance of matlab
Importance of matlabkrajeshk1980
 
Basic MATLAB-Presentation.pptx
Basic MATLAB-Presentation.pptxBasic MATLAB-Presentation.pptx
Basic MATLAB-Presentation.pptxPremanandS3
 
CIV1900 Matlab - Plotting & Coursework
CIV1900 Matlab - Plotting & CourseworkCIV1900 Matlab - Plotting & Coursework
CIV1900 Matlab - Plotting & CourseworkTUOS-Sam
 
Introduction to matlab lecture 2 of 4
Introduction to matlab lecture 2 of 4Introduction to matlab lecture 2 of 4
Introduction to matlab lecture 2 of 4Randa Elanwar
 
Notes on MATLAB - Basic Cheatsheet
Notes on MATLAB    -    Basic CheatsheetNotes on MATLAB    -    Basic Cheatsheet
Notes on MATLAB - Basic CheatsheetAhmed Nassar
 
Me 443 4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...
Me 443   4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...Me 443   4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...
Me 443 4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...Erdi Karaçal
 
Matlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processingMatlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processingDr. Manjunatha. P
 
A complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projectsA complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projectsMukesh Kumar
 
Introduction to Matlab
Introduction to MatlabIntroduction to Matlab
Introduction to MatlabAmr Rashed
 
Introduction to Matlab - Basic Functions
Introduction to Matlab - Basic FunctionsIntroduction to Matlab - Basic Functions
Introduction to Matlab - Basic Functionsjoellivz
 
Bt9301, computer graphics
Bt9301, computer graphicsBt9301, computer graphics
Bt9301, computer graphicssmumbahelp
 

Similar to Vision systems_Image processing tool box in MATLAB (20)

MATLAB
MATLABMATLAB
MATLAB
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
 
Importance of matlab
Importance of matlabImportance of matlab
Importance of matlab
 
Basic MATLAB-Presentation.pptx
Basic MATLAB-Presentation.pptxBasic MATLAB-Presentation.pptx
Basic MATLAB-Presentation.pptx
 
Isam2_v1_2
Isam2_v1_2Isam2_v1_2
Isam2_v1_2
 
Matlab1
Matlab1Matlab1
Matlab1
 
CIV1900 Matlab - Plotting & Coursework
CIV1900 Matlab - Plotting & CourseworkCIV1900 Matlab - Plotting & Coursework
CIV1900 Matlab - Plotting & Coursework
 
Introduction to matlab lecture 2 of 4
Introduction to matlab lecture 2 of 4Introduction to matlab lecture 2 of 4
Introduction to matlab lecture 2 of 4
 
Matlab-1.pptx
Matlab-1.pptxMatlab-1.pptx
Matlab-1.pptx
 
Notes on MATLAB - Basic Cheatsheet
Notes on MATLAB    -    Basic CheatsheetNotes on MATLAB    -    Basic Cheatsheet
Notes on MATLAB - Basic Cheatsheet
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
 
Backtracking
BacktrackingBacktracking
Backtracking
 
Me 443 4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...
Me 443   4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...Me 443   4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...
Me 443 4 plotting curves Erdi Karaçal Mechanical Engineer University of Gaz...
 
Matlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processingMatlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processing
 
A complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projectsA complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projects
 
Application of matrices in real life
Application of matrices in real lifeApplication of matrices in real life
Application of matrices in real life
 
Report_NLNN
Report_NLNNReport_NLNN
Report_NLNN
 
Introduction to Matlab
Introduction to MatlabIntroduction to Matlab
Introduction to Matlab
 
Introduction to Matlab - Basic Functions
Introduction to Matlab - Basic FunctionsIntroduction to Matlab - Basic Functions
Introduction to Matlab - Basic Functions
 
Bt9301, computer graphics
Bt9301, computer graphicsBt9301, computer graphics
Bt9301, computer graphics
 

Recently uploaded

Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...Call Girls in Nagpur High Profile
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 

Recently uploaded (20)

Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 

Vision systems_Image processing tool box in MATLAB

  • 1. “VISION SYSTEMS” ASSIGNMENT NO: 1 SUBMITTED BY: HINNA NAYAB REGN. NO: 11PWMCT0143 SUBMITTED TO: DR. SHEHZAD (9th March, 2015) 8TH SEMESTER (MORNING) INSTITUTE OF MECHATRONICS ENGINEERING UET, PESHAWAR
  • 2. MATLAB INTRODUCTION 1. Construct a 10x10 matrix such that the diagonal elements get the value of the indices (eg. index (3,3) gets the value 3), and the element with index (10,1) gets the value 5. A matrix was constructed by using ‘rand(n)’ function to form a randomly generated matrix. The diagonal elements and index(10,1) were specified as directed.
  • 3. 2. Extract the 2,3 and 7 column from the matrix with one command. 3. What is the expected result of matrix multiplication and element-wise multiplication of this matrix with itself ? Confirm your expectations using Matlab. What is the general operator for element-wise operations in Matlab? The general operator for element-wise operations in matlab is ‘.’ e.g • Multiplication(.*) • Addition(.+) • Subtraction(.-) • Division(./ or.)
  • 4. 4. Show the original matrix as an image. The original matrix was shown as an image by trying out commands: ‘image(A)’, ‘imagesc(A)’, ‘imshow(A)’. • >>Image(A) ‘ image(A)’ displays matrix A as an image. Each element of A specifies the color of a rectilinear patch in the image. • >>imagesc(A) ‘Imagesc’: “Scale data and display as image.” imagesc(A) is the same as image(A) except the data is scaled to use the full colormap. 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10
  • 5. >> axis image %axis image fits the plot box directly around the data • >>imshow(A) (imshow(A) displays the grayscale image A) ‘COLORMAP’ FUNCTION: M-by-3 matrix specifying a colormap. imshow uses this to set the figure's colormap property. This parameter is used to view grayscale images in false color. The colormap matrix for ‘A’ in matlab: >>cmap=colormap cmap = 2 4 6 8 10 1 2 3 4 5 6 7 8 9 10
  • 6. 0 0 0.5625 0 0 0.6250 0 0 0.6875 0 0 0.7500 0 0 0.8125 0 0 0.8750 0 0 0.9375 0 0 1.0000 0 0.0625 1.0000 0 0.1250 1.0000 0 0.1875 1.0000 0 0.2500 1.0000 0 0.3125 1.0000 0 0.3750 1.0000 0 0.4375 1.0000 0 0.5000 1.0000 0 0.5625 1.0000 0 0.6250 1.0000 0 0.6875 1.0000 0 0.7500 1.0000 0 0.8125 1.0000 0 0.8750 1.0000 0 0.9375 1.0000 0 1.0000 1.0000 0.0625 1.0000 0.9375 0.1250 1.0000 0.8750 0.1875 1.0000 0.8125 0.2500 1.0000 0.7500 0.3125 1.0000 0.6875 0.3750 1.0000 0.6250 0.4375 1.0000 0.5625
  • 7. 0.5000 1.0000 0.5000 0.5625 1.0000 0.4375 0.6250 1.0000 0.3750 0.6875 1.0000 0.3125 0.7500 1.0000 0.2500 0.8125 1.0000 0.1875 0.8750 1.0000 0.1250 0.9375 1.0000 0.0625 1.0000 1.0000 0 1.0000 0.9375 0 1.0000 0.8750 0 1.0000 0.8125 0 1.0000 0.7500 0 1.0000 0.6875 0 1.0000 0.6250 0 1.0000 0.5625 0 1.0000 0.5000 0 1.0000 0.4375 0 1.0000 0.3750 0 1.0000 0.3125 0 1.0000 0.2500 0 1.0000 0.1875 0 1.0000 0.1250 0 1.0000 0.0625 0 1.0000 0 0 0.9375 0 0 0.8750 0 0 0.8125 0 0 0.7500 0 0 0.6875 0 0 0.6250 0 0
  • 8. 0.5625 0 0 0.5000 0 0 Trying out some basic colormap functions: >>colormap(cmap) %sets the current figure’s colormap to cmap. >> colormap('default') %sets the current figure's colormap tothe root's default, whose setting is JET. >>colormap(bone) %bone is a grayscale colormap with a higher value for blue component. (Adds electronic look to grayscale images.) >>colormap(spring) %spring consistes of colors that are shades of magenta and yellow. 2 4 6 8 10 1 2 3 4 5 6 7 8 9 10
  • 9. >>colormap(autumn) %autumn varies smoothly from orange to red to yellow. >>colormap(winter) %winter consists of colors that are shades of blue and green. 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10
  • 10. >>colormap(copper) %copper varies smoothly from black to bright copper. >>colormap(gray) %returns a linear grayscale image. 5. Describe the following coordinate systems: Matrix coordinates, Mathematical Cartesian coordinates, and Matlab image coordinates. For each you must point out where the coordinates (10,1) is located in a 10x10 coordinate frame. Are there any differences? Which coordinate system do you prefer? CARTESIAN COORDINATES: The Cartesian coordinate system is commonly used in mathematics. The origin is the point (0, 0). In this system, the first component x increases to the right, while the second component y increases upward. The origin (0, 0) is at the lower-left corner. It is the most common coordinate system for manipulating mathematical entities, such as parametric surfaces. (The index (10,1) is located in 1st quadrant, lower right corner) 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10
  • 11. MATRIX COORDINATES: The matrix coordinate system is commonly used for matrices and displays. The origin is at the upper left corner and usually starts with (1, 1). The matrix coordinate system, also called the row-column coordinate system, is MATLAB's coordinate system for matrices. MATLAB uses this system for matrix subscript notation. In this system, the first component (row) increases downward, while the second component (column) increases to the right. (The index (10, 1) is located at the lower-left corner) MATLAB IMAGE (PIXEL) COORDINATES: The pixel coordinate system is the most common coordinate system for digital image processing in MATLAB. For pixel coordinates, the first component x increases to the right, while the second component y increases downward. The origin is at the upper left corner. These coordinates are typically integers. If we compare it to the row-column system, then row corresponds to y and column corresponds to x. If we compare it to the Cartesian system, then the y axis is reversed. (The index(10,1) is located at the upper-right corner) MATLAB uses the matrix coordinate system for image matrix manipulation and the pixel coordinate system for everything else. The preferred coordinate system is the Matrix coordinate system since it makes the mathematical computations easy. 6. Add noise to the image Use the Matlab helpdesk to search for functions that generate random noise. Display the original matrix with noise added. ADDING NOISE: Adding ‘Gaussian’ (white noise with constant mean and variance) noise:
  • 12. >>A= imnoise(A,’gaussian’) >> figure(), image(A); >> figure(), imagesc(A); 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10
  • 13. Adding random noise to the scaled image: >>imnoise(A) >> figure(), imagesc(A); Adding Speckle(Multiplicative) noise to the scaled data image: >> A= imnoise(A,’speckle’) 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10
  • 14. >> figure() , imagesc(A); 7. Try demos for Matlab Image Toolbox….. Image Processing Toolbox. Following were practiced regarding the above: • Reading an image. • Using morphological opening to estimate the background. • View background approximation as surface. • Subtract background image from original image. • Image intensity adjustment. • Thresholding • Examine one object in image. • Image histogram. 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10