SlideShare a Scribd company logo
Mini Project Report Page 1
DIGITAL IMAGE
PROCESSING USING
MATLAB
Mini Project Report
Session: August to November, 2010
By:-
Ankur Nanda (08EE13)
MENTOR
H. Girisha Navada
Department of Electrical and Electronics Engineering
National Institute of Technology Karnataka, Surathkal
Mini Project Report Page 2
ACKNOWLEDGEMENT
I would like to thank Mr. H. Girisha Navada for giving me this
opportunity to learn more and for the complete freedom in the
way of working.
Mini Project Report Page 3
INDEX
Acknowledgement………………………………………………………………....2
Index………………………………………………………………………………………3
1. Introduction……………………………………………………………………………4
2. Image processing tool box………………………………………………………5
a. Image formats supported by MATLAB……………………………5
b. Working formats in MATLAB………………………………………….5
c. Working in MATLAB……………………………………………………….6
d. Image format conversion…………………………………………….…7
e. Cropping images in MATLAB……………………………………….….7
3. Applications of Image Processing…………………………………………...8
a. Text Recognition……………………………………………………….……8
b. Colour Tracking…………………………………………………………......9
c. Engineer Problem Statement………………………………………..10
d. Virtual Slate…………………………………………………………………..11
e. Face Detection………………………………………………………………12
f. Distance Estimation………………………………………………………12
4. References……………………………………………………………………………..13
Mini Project Report Page 4
1. Introduction
Image processing is a set of computational techniques for analysing , enhancing, compressing,
and reconstructing images. Its main components are importing, in which an image is captured
through scanning or digital photography; analysis and manipulation of the image, accomplished
using various specialized software applications; and output (e.g., to a printer or monitor). Image
processing has extensive applications in many areas, including astronomy, medicine,
industrial robotics, and remote sensing by satellites.
An image is usually interpreted as a two-dimensional array of brightness values, and is most
familiarly represented by such patterns as those of a photographic print, slide, television screen,
or movie screen. An image can be processed optically or digitally with a computer.
To digitally process an image, it is first necessary to reduce the image to a series of numbers that
can be manipulated by the computer. Each number representing the brightness value of the
image at a particular location is called a picture element, or pixel. A typical digitized image may
have 512 × 512 or roughly 250,000 pixels, although much larger images are becoming common.
Once the image has been digitized, there are three basic operations that can be performed on it
in the computer. For a point operation, a pixel value in the output image depends on a single
pixel value in the input image. For local operations, several neighbouring pixels in the input
image determine the value of an output image pixel. In a global operation, all of the input image
pixels contribute to an output image pixel value. These operations, taken singly or in
combination, are the means by which the image is enhanced, restored, or compressed.
An image is enhanced when it is modified so that the information it contains is more clearly
evident, but enhancement can also include making the image more visually appealing. An
example is noise smoothing. To smooth a noisy image, median filtering can be applied with a 3 ×
3 pixel window. This means that the value of every pixel in the noisy image is recorded, along
with the values of its nearest eight neighbours. These nine numbers are then ordered according
to size, and the median is selected as the value for the pixel in the new image. As the 3 × 3
window is moved one pixel at a time across the noisy image, the filtered image is formed.
Compression is a way of representing an image by fewer numbers, at the same time minimizing
the degradation of the information contained in the image. Compression is important because of
the large quantities of digital imagery that are sent electronically and stored. Digital high-
definition television relies heavily on image compression to enable transmission and display of
large-format colour images. Once the image is compressed for storage or transmission, it must
be uncompressed for use, by the inverse of the compression operations. There is a trade-off
between the amount of compression and the quality of the uncompressed image. High
compression rates are acceptable with television images, for example.However,where high
image quality must be preserved (as in diagnostic medical images).only compression rates as low
as three to four may be acceptable.
Mini Project Report Page 5
2. Image processing tool box
MATLAB is used as a tool for colour image processing.
2. a Image formats supported by MATLAB
The following image formats are supported by MATLAB:
 BMP
 HDF
 JPEG
 PCX
 TIFF
 XWB
Most of the images are in JPEG-images which is the name for one of the most widely
used compression standards for images.
2. b Working formats in MATLAB
Intensity image (gray scale image)
This is the equivalent to a "gray scale image”. It represents an image as a matrix
where every element has a value corresponding to how bright/dark the pixel at the
corresponding position should be coloured. In class uint8 which assigns an integer
between 0 and 255 to represent the brightness of a pixel. The value 0 corresponds to
black and 255 to white.
Binary image
This image format also stores an image as a matrix but can only colour a pixel black or
white (and nothing in between). It assigns a 0 for black and a 1 for white.
Indexed image
This is a practical way of representing colour images. An indexed image stores an image as two matrices.
The first matrix has the same size as the image and one number for each pixel. The second matrix is
called the colour mapand its size may be different from the image. The numbers in the first matrix is an
instruction of what number to use in the colour map matrix.
Mini Project Report Page 6
RGB image
This is another format for colour images. It represents an image with three matrices of sizes matching the
image format. Each matrix corresponds to one of the colours red, green or blue and gives an instruction
of how much of each of these colours a certain pixel should use.
2. c Working in MATLAB
Importing an image in MATLAB:
To save an image as a matrix in MATLAB we need to put the file in the working
directory and type in MATLAB
f = imread(‘123.jpg’);
where 123 is the name of the JPEG image file. The image is saved as a matrix f in
MATLAB. f is a 3 dimensional matrix.
Displaying images as figures:
imshow(f)
Displays the matrix f as an image in the figure window.
imtool(f)
Displays the image and gives more options of viewing the image.
Saving matrix as an image file
imwrite(f,’123.jpg’)
This will save the information stored in the matrix f in the image file 123.jpg.
Mini Project Report Page 7
2. d Image format conversion
RGB Image to Intensity Image (rgb2gray)
RGB Image to Indexed Image (rgb2ind)
RGB Image to Binary Image (im2bw)
Indexed Image to RGB Image (ind2rgb)
Indexed Image to Intensity Image (ind2gray)
Indexed Image to Binary Image (im2bw)
Intensity Image to Indexed Image (gray2ind)
Intensity Image to Binary Image (im2bw)
Intensity Image to RGB Image (gray2ind, ind2rgb)
The Image Processing Toolbox provides a comprehensive set of reference-standard
algorithms and graphical tools for image processing, analysis, visualization, and
algorithm development. We can restore noisy or degraded images, enhance images for
improved intelligibility, extract features, analyze shapes and textures, and register two
images.
2. e Cropping images in MATLAB
To crop the image we need treat it like a general matrix and remove the sides of the
matrix and hence the image will get cropped.
f=imread(‘123.jpg’);
f=f(x1:x2,y1:y2);
imwrite(f,’123.jpg’)
Mini Project Report Page 8
3. Applications of Image Processing
3. a Text recognition
It refers to extracting image out of an image containing text in it and importing them as text into the
computer.
New MATLAB functions used:
 GRAYTHRESH: Calculates the ideal threshold level to be used to be used to convert an image to a
black-white image.
 BWAREAOPEN: MATLAB’s very useful inbuilt function that acts as a filter to remove objects below
a specific size in terms of pixels that can be decided by the user.
 BWLABEL: This function helps in extraction of unconnected objects out of a bw image by assigning
a different number to all clusters.
 FIND: It’s used to search for a specific pixel with the specified value.
 CORR2: Finds the similarity between two images.
Procedure:
 Importing of the image
 Conversion to a black n white image
 Cropping of the unnecessary area out of the image using find function.
 Extraction of different lines using summation of each row and waiting till the sum going to zero
and hence giving us the end of the line row.
 Extraction of different alphabets out of the line by using the bwlabel function.
 Comparison of each alphabet with a template already saved in the library using the corr2
function.
 Giving the output in text format based on which alphabet it matches in the library.
 Providing spaces in between words based on the number of pixels between two alphabets.
Mini Project Report Page 9
3. b Colour Tracking
Colour tracking a specific coloured object has to be recognized in a background containing many different
types of colours and objects.
 Capture the video frames using the videoinput function.
 Set a loop that stop after 100 frames of acquisition.
 Get the snapshot of every frame.
 Now to track red objects in real time we have to subtract the red component from the grayscale
image to extract the red components in the image.
 Convert the resulting grayscale image into a binary image.
 Remove all those pixels less than 300pixels,filteing.
 Label all the connected components in the image.
 Display the image.
 Set a loop to bound the red objects in a rectangular box.
New MATLAB functions used:
 VIDEOINPUT : Create video input object.
OBJ = VIDEOINPUT(ADAPTORNAME) constructs the video input object, OBJ.
A video input object represents the connection between MATLAB and a particular image
acquisition device.
 GETSNAPSHOT Immediately returns a single image snapshot from a video input object.
 REGIONPROPS: Used to find a specific property of a combined area of a matrix. Here we use it to
find the bounding region of the object.
 BWLABEL: This function helps in extraction of unconnected objects out of a bw image by assigning
a different number to all clusters.
 RECTANGLE adds a rectangle to the specific location of a specified size.
Mini Project Report Page 10
3. c ENGINEER PROBLEM STATEMENT
In an arena consisting of 25 blocks of 30x30 cm each we need to detect the red and black lines and the
red lines are required to be avoided while collecting the green objects whose positions are specified in
another image file. The blocks and the sides are separated by cropping them and each one is scanned for
colour red and green and a specific value is assigned for red and green to define difference in them.
The path that is not to be covered (red and edges) are given the value 0, starting point (blue) is given the
value 3, point necessary to be covered (green) are assigned 2 and the points allowed to move over are
assigned 1.
Mini Project Report Page 11
3. d Virtual Slate
Using colour tracking and a laser light source, we can make an arrangement that takes video input from
outside through the webcam and processes it in MATLAB. The output is a plot of the coordinates of the
point where a are colour is detected.
Hence if we use a laser light and aim it over a blank surface we can simulate a slate which senses the
motion of the laser and forms the shape based on the movement of the laser.
New MATLAB functions used:
 VIDEOINPUT : Create video input object.
OBJ = VIDEOINPUT(ADAPTORNAME) constructs the video input object, OBJ.
A video input object represents the connection between MATLAB and a particular image
acquisition device.
 GETSNAPSHOT: Immediately returns a single image snapshot from a video input object.
 HOLD: Used to store the present figure and add the new figure over it.
 BWLABEL: This function helps in extraction of unconnected objects out of a bw image by assigning
a different number to all clusters.
 SAVEAS: Saves Figure or Simulink block diagram in desired output format.
Mini Project Report Page 12
3. e. Face Detection
Face detection is a very basic and important part of face recognition.For face recognition we need to first
process the input image and remove the unnecessary data and remove the noise.This can be done by
comparing the colour values in the picture to specific predefined values representing the skin colour.
After this we need to crop the image in the size of the average size of a human head. After this it has to
be processed further to match it with the database.
3. f. Distance Estimation
To find out the distance of anything in front we can use a system comprising of a webcam and a laser
fixed parallel to the principal axis of the camera lens. As we take the video input from the camera and
detect the laser point, we can calculate the distance of the object from the camera source after proper
calibration.
As we move the object away from the camera the position of the red spot in the image moves away from
the centre and as we approach the object the spot moves closer to the centre.
Mini Project Report Page 13
5. References:
1. Gonzalez Woods & Eddins, “Digital Image Processing Using Matlab”.
2. Mathworks, http://www.mathworks.com

More Related Content

What's hot (20)

PPTX
Introduction in Image Processing Matlab Toolbox
Shahriar Yazdipour
 
PDF
Introduction of image processing
Avani Shah
 
PDF
Image processing with matlab
minhtaispkt
 
PDF
Matlab Based Image Compression Using Various Algorithm
ijtsrd
 
DOCX
Thesis on Image compression by Manish Myst
Manish Myst
 
PPTX
Image processing and compression techniques
Ashwin Venkataraman
 
PDF
Image compression using discrete wavelet transform
Harshal Ladhe
 
DOCX
Medical Image Compression
Paramjeet Singh Jamwal
 
PPSX
Digital image processing
juangp3
 
PDF
IMAGE COMPRESSION AND DECOMPRESSION SYSTEM
Vishesh Banga
 
PPTX
Project presentation image compression by manish myst, ssgbcoet
Manish Myst
 
PPTX
BASICS OF DIGITAL IMAGE PROCESSING,MARIA PETROU
anjunarayanan
 
PPT
Digital Image Processing
Azharo7
 
PPTX
Chapter 8 image compression
asodariyabhavesh
 
PPTX
Ec section
Antriksh Saxena
 
PPSX
Image processing on matlab presentation
Naatchammai Ramanathan
 
PDF
digital image processing, image processing
Kalyan Acharjya
 
PPTX
Introduction to Image Processing with MATLAB
Sriram Emarose
 
PDF
Basics of image processing using MATLAB
Mohsin Siddique
 
POTX
Presentation of Lossy compression
Omar Ghazi
 
Introduction in Image Processing Matlab Toolbox
Shahriar Yazdipour
 
Introduction of image processing
Avani Shah
 
Image processing with matlab
minhtaispkt
 
Matlab Based Image Compression Using Various Algorithm
ijtsrd
 
Thesis on Image compression by Manish Myst
Manish Myst
 
Image processing and compression techniques
Ashwin Venkataraman
 
Image compression using discrete wavelet transform
Harshal Ladhe
 
Medical Image Compression
Paramjeet Singh Jamwal
 
Digital image processing
juangp3
 
IMAGE COMPRESSION AND DECOMPRESSION SYSTEM
Vishesh Banga
 
Project presentation image compression by manish myst, ssgbcoet
Manish Myst
 
BASICS OF DIGITAL IMAGE PROCESSING,MARIA PETROU
anjunarayanan
 
Digital Image Processing
Azharo7
 
Chapter 8 image compression
asodariyabhavesh
 
Ec section
Antriksh Saxena
 
Image processing on matlab presentation
Naatchammai Ramanathan
 
digital image processing, image processing
Kalyan Acharjya
 
Introduction to Image Processing with MATLAB
Sriram Emarose
 
Basics of image processing using MATLAB
Mohsin Siddique
 
Presentation of Lossy compression
Omar Ghazi
 

Viewers also liked (20)

DOC
Huffman coding01
Nv Thejaswini
 
DOC
Image processing report
Siddhesh Chavan
 
PDF
Final Year Project Titles 2013 2014
sybiantech
 
PDF
Manual de uso prospectiva.docx
martinpr90
 
PPTX
Unidad 2 act-1-mllg
Lulu (SHCP) Lopez
 
PDF
FLAYER THE GREEN COLLECTION PDF
John Frater
 
PPTX
Tarea 3 mapa conceptual
Jane Ramos
 
PPT
VMobile FAST TRACK Package
marievmobile
 
PDF
Koller Mobel, Skulpturen, Porzellan & Silber 2017 Furniture, Sculptures, Porc...
Koller Auctions
 
PPTX
Musica info
amybonabellijensen123
 
PDF
011 - Altre nozioni e principi fondamentali dell'Ordine Gesù Redentore per l'...
OrdineGesu
 
PDF
Jake Croman | Fundraising Tips for Student Organizations
Jake Croman
 
PDF
OpenStack and OVS: From Love-Hate to Match Made in Heaven
OPNFV
 
PDF
003 - Il Cristianesimo, l'Ordine Gesù Redentore (ogr) e le altre Religioni
OrdineGesu
 
PPT
SITEC Ec Class - e-Tail Process by Coach Adrian Oh
sitecmy
 
PPTX
500 Demo Day Batch 19: Unicorn
500 Startups
 
PDF
500 Demo Day Batch 19: Fuel
500 Startups
 
PDF
Final Project Report on Image processing based intelligent traffic control sy...
Louise Antonio
 
PPT
Digital Image Processing
Sahil Biswas
 
Huffman coding01
Nv Thejaswini
 
Image processing report
Siddhesh Chavan
 
Final Year Project Titles 2013 2014
sybiantech
 
Manual de uso prospectiva.docx
martinpr90
 
Unidad 2 act-1-mllg
Lulu (SHCP) Lopez
 
FLAYER THE GREEN COLLECTION PDF
John Frater
 
Tarea 3 mapa conceptual
Jane Ramos
 
VMobile FAST TRACK Package
marievmobile
 
Koller Mobel, Skulpturen, Porzellan & Silber 2017 Furniture, Sculptures, Porc...
Koller Auctions
 
011 - Altre nozioni e principi fondamentali dell'Ordine Gesù Redentore per l'...
OrdineGesu
 
Jake Croman | Fundraising Tips for Student Organizations
Jake Croman
 
OpenStack and OVS: From Love-Hate to Match Made in Heaven
OPNFV
 
003 - Il Cristianesimo, l'Ordine Gesù Redentore (ogr) e le altre Religioni
OrdineGesu
 
SITEC Ec Class - e-Tail Process by Coach Adrian Oh
sitecmy
 
500 Demo Day Batch 19: Unicorn
500 Startups
 
500 Demo Day Batch 19: Fuel
500 Startups
 
Final Project Report on Image processing based intelligent traffic control sy...
Louise Antonio
 
Digital Image Processing
Sahil Biswas
 
Ad

Similar to Digital Image Processing (20)

PPTX
OpenCV In Mobile Technology | Computer Vision on Mobile
dineshlakhzz
 
PPTX
Image compression 14_04_2020 (1)
Joel P
 
PPTX
DIP LEC 1.pptxlllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll...
AnumAshraf18
 
PPTX
AI Unit-5 Image Processing for all ML problems
ssuserd24233
 
PDF
Image processing using matlab
dedik dafiyanto
 
PPT
Unit ii
swapnasalil
 
PDF
Matlab dip
Jeevan Reddy
 
DOCX
Laureate Online Education Internet and Multimedia Technolog.docx
DIPESH30
 
PDF
E1102012537
IOSR Journals
 
PDF
Final Report for project
Rajarshi Roy
 
PPT
Chapter 3 data representations
ABDUmomo
 
PDF
A Biometric Approach to Encrypt a File with the Help of Session Key
Sougata Das
 
PDF
IRJET- 3D Vision System using Calibrated Stereo Camera
IRJET Journal
 
PPTX
الوسائط المتعددة Multimedia تاج
maaz hamed
 
PDF
Lossless Huffman coding image compression implementation in spatial domain by...
IRJET Journal
 
PPT
IJ-M&M08.ppt
SenukeTest
 
PDF
Matlab practical ---2.pdf
Central university of Haryana
 
PPT
Image graphics-introduction
Gerhard Lock
 
PDF
Gv2512441247
IJERA Editor
 
PDF
Gv2512441247
IJERA Editor
 
OpenCV In Mobile Technology | Computer Vision on Mobile
dineshlakhzz
 
Image compression 14_04_2020 (1)
Joel P
 
DIP LEC 1.pptxlllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll...
AnumAshraf18
 
AI Unit-5 Image Processing for all ML problems
ssuserd24233
 
Image processing using matlab
dedik dafiyanto
 
Unit ii
swapnasalil
 
Matlab dip
Jeevan Reddy
 
Laureate Online Education Internet and Multimedia Technolog.docx
DIPESH30
 
E1102012537
IOSR Journals
 
Final Report for project
Rajarshi Roy
 
Chapter 3 data representations
ABDUmomo
 
A Biometric Approach to Encrypt a File with the Help of Session Key
Sougata Das
 
IRJET- 3D Vision System using Calibrated Stereo Camera
IRJET Journal
 
الوسائط المتعددة Multimedia تاج
maaz hamed
 
Lossless Huffman coding image compression implementation in spatial domain by...
IRJET Journal
 
IJ-M&M08.ppt
SenukeTest
 
Matlab practical ---2.pdf
Central university of Haryana
 
Image graphics-introduction
Gerhard Lock
 
Gv2512441247
IJERA Editor
 
Gv2512441247
IJERA Editor
 
Ad

Recently uploaded (20)

PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
NASA A Researcher’s Guide to International Space Station : Fundamental Physics
Dr. PANKAJ DHUSSA
 
PDF
Linux schedulers for fun and profit with SchedKit
Alessio Biancalana
 
PDF
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
PDF
NASA A Researcher’s Guide to International Space Station : Earth Observations
Dr. PANKAJ DHUSSA
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
Survival Models: Proper Scoring Rule and Stochastic Optimization with Competi...
Paris Women in Machine Learning and Data Science
 
PDF
Modern Decentralized Application Architectures.pdf
Kalema Edgar
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
Evolution: How True AI is Redefining Safety in Industry 4.0
vikaassingh4433
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
PPTX
Manual Testing for Accessibility Enhancement
Julia Undeutsch
 
PDF
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
NASA A Researcher’s Guide to International Space Station : Fundamental Physics
Dr. PANKAJ DHUSSA
 
Linux schedulers for fun and profit with SchedKit
Alessio Biancalana
 
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
NASA A Researcher’s Guide to International Space Station : Earth Observations
Dr. PANKAJ DHUSSA
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Survival Models: Proper Scoring Rule and Stochastic Optimization with Competi...
Paris Women in Machine Learning and Data Science
 
Modern Decentralized Application Architectures.pdf
Kalema Edgar
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Evolution: How True AI is Redefining Safety in Industry 4.0
vikaassingh4433
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
Manual Testing for Accessibility Enhancement
Julia Undeutsch
 
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
Digital Circuits, important subject in CS
contactparinay1
 

Digital Image Processing

  • 1. Mini Project Report Page 1 DIGITAL IMAGE PROCESSING USING MATLAB Mini Project Report Session: August to November, 2010 By:- Ankur Nanda (08EE13) MENTOR H. Girisha Navada Department of Electrical and Electronics Engineering National Institute of Technology Karnataka, Surathkal
  • 2. Mini Project Report Page 2 ACKNOWLEDGEMENT I would like to thank Mr. H. Girisha Navada for giving me this opportunity to learn more and for the complete freedom in the way of working.
  • 3. Mini Project Report Page 3 INDEX Acknowledgement………………………………………………………………....2 Index………………………………………………………………………………………3 1. Introduction……………………………………………………………………………4 2. Image processing tool box………………………………………………………5 a. Image formats supported by MATLAB……………………………5 b. Working formats in MATLAB………………………………………….5 c. Working in MATLAB……………………………………………………….6 d. Image format conversion…………………………………………….…7 e. Cropping images in MATLAB……………………………………….….7 3. Applications of Image Processing…………………………………………...8 a. Text Recognition……………………………………………………….……8 b. Colour Tracking…………………………………………………………......9 c. Engineer Problem Statement………………………………………..10 d. Virtual Slate…………………………………………………………………..11 e. Face Detection………………………………………………………………12 f. Distance Estimation………………………………………………………12 4. References……………………………………………………………………………..13
  • 4. Mini Project Report Page 4 1. Introduction Image processing is a set of computational techniques for analysing , enhancing, compressing, and reconstructing images. Its main components are importing, in which an image is captured through scanning or digital photography; analysis and manipulation of the image, accomplished using various specialized software applications; and output (e.g., to a printer or monitor). Image processing has extensive applications in many areas, including astronomy, medicine, industrial robotics, and remote sensing by satellites. An image is usually interpreted as a two-dimensional array of brightness values, and is most familiarly represented by such patterns as those of a photographic print, slide, television screen, or movie screen. An image can be processed optically or digitally with a computer. To digitally process an image, it is first necessary to reduce the image to a series of numbers that can be manipulated by the computer. Each number representing the brightness value of the image at a particular location is called a picture element, or pixel. A typical digitized image may have 512 × 512 or roughly 250,000 pixels, although much larger images are becoming common. Once the image has been digitized, there are three basic operations that can be performed on it in the computer. For a point operation, a pixel value in the output image depends on a single pixel value in the input image. For local operations, several neighbouring pixels in the input image determine the value of an output image pixel. In a global operation, all of the input image pixels contribute to an output image pixel value. These operations, taken singly or in combination, are the means by which the image is enhanced, restored, or compressed. An image is enhanced when it is modified so that the information it contains is more clearly evident, but enhancement can also include making the image more visually appealing. An example is noise smoothing. To smooth a noisy image, median filtering can be applied with a 3 × 3 pixel window. This means that the value of every pixel in the noisy image is recorded, along with the values of its nearest eight neighbours. These nine numbers are then ordered according to size, and the median is selected as the value for the pixel in the new image. As the 3 × 3 window is moved one pixel at a time across the noisy image, the filtered image is formed. Compression is a way of representing an image by fewer numbers, at the same time minimizing the degradation of the information contained in the image. Compression is important because of the large quantities of digital imagery that are sent electronically and stored. Digital high- definition television relies heavily on image compression to enable transmission and display of large-format colour images. Once the image is compressed for storage or transmission, it must be uncompressed for use, by the inverse of the compression operations. There is a trade-off between the amount of compression and the quality of the uncompressed image. High compression rates are acceptable with television images, for example.However,where high image quality must be preserved (as in diagnostic medical images).only compression rates as low as three to four may be acceptable.
  • 5. Mini Project Report Page 5 2. Image processing tool box MATLAB is used as a tool for colour image processing. 2. a Image formats supported by MATLAB The following image formats are supported by MATLAB:  BMP  HDF  JPEG  PCX  TIFF  XWB Most of the images are in JPEG-images which is the name for one of the most widely used compression standards for images. 2. b Working formats in MATLAB Intensity image (gray scale image) This is the equivalent to a "gray scale image”. It represents an image as a matrix where every element has a value corresponding to how bright/dark the pixel at the corresponding position should be coloured. In class uint8 which assigns an integer between 0 and 255 to represent the brightness of a pixel. The value 0 corresponds to black and 255 to white. Binary image This image format also stores an image as a matrix but can only colour a pixel black or white (and nothing in between). It assigns a 0 for black and a 1 for white. Indexed image This is a practical way of representing colour images. An indexed image stores an image as two matrices. The first matrix has the same size as the image and one number for each pixel. The second matrix is called the colour mapand its size may be different from the image. The numbers in the first matrix is an instruction of what number to use in the colour map matrix.
  • 6. Mini Project Report Page 6 RGB image This is another format for colour images. It represents an image with three matrices of sizes matching the image format. Each matrix corresponds to one of the colours red, green or blue and gives an instruction of how much of each of these colours a certain pixel should use. 2. c Working in MATLAB Importing an image in MATLAB: To save an image as a matrix in MATLAB we need to put the file in the working directory and type in MATLAB f = imread(‘123.jpg’); where 123 is the name of the JPEG image file. The image is saved as a matrix f in MATLAB. f is a 3 dimensional matrix. Displaying images as figures: imshow(f) Displays the matrix f as an image in the figure window. imtool(f) Displays the image and gives more options of viewing the image. Saving matrix as an image file imwrite(f,’123.jpg’) This will save the information stored in the matrix f in the image file 123.jpg.
  • 7. Mini Project Report Page 7 2. d Image format conversion RGB Image to Intensity Image (rgb2gray) RGB Image to Indexed Image (rgb2ind) RGB Image to Binary Image (im2bw) Indexed Image to RGB Image (ind2rgb) Indexed Image to Intensity Image (ind2gray) Indexed Image to Binary Image (im2bw) Intensity Image to Indexed Image (gray2ind) Intensity Image to Binary Image (im2bw) Intensity Image to RGB Image (gray2ind, ind2rgb) The Image Processing Toolbox provides a comprehensive set of reference-standard algorithms and graphical tools for image processing, analysis, visualization, and algorithm development. We can restore noisy or degraded images, enhance images for improved intelligibility, extract features, analyze shapes and textures, and register two images. 2. e Cropping images in MATLAB To crop the image we need treat it like a general matrix and remove the sides of the matrix and hence the image will get cropped. f=imread(‘123.jpg’); f=f(x1:x2,y1:y2); imwrite(f,’123.jpg’)
  • 8. Mini Project Report Page 8 3. Applications of Image Processing 3. a Text recognition It refers to extracting image out of an image containing text in it and importing them as text into the computer. New MATLAB functions used:  GRAYTHRESH: Calculates the ideal threshold level to be used to be used to convert an image to a black-white image.  BWAREAOPEN: MATLAB’s very useful inbuilt function that acts as a filter to remove objects below a specific size in terms of pixels that can be decided by the user.  BWLABEL: This function helps in extraction of unconnected objects out of a bw image by assigning a different number to all clusters.  FIND: It’s used to search for a specific pixel with the specified value.  CORR2: Finds the similarity between two images. Procedure:  Importing of the image  Conversion to a black n white image  Cropping of the unnecessary area out of the image using find function.  Extraction of different lines using summation of each row and waiting till the sum going to zero and hence giving us the end of the line row.  Extraction of different alphabets out of the line by using the bwlabel function.  Comparison of each alphabet with a template already saved in the library using the corr2 function.  Giving the output in text format based on which alphabet it matches in the library.  Providing spaces in between words based on the number of pixels between two alphabets.
  • 9. Mini Project Report Page 9 3. b Colour Tracking Colour tracking a specific coloured object has to be recognized in a background containing many different types of colours and objects.  Capture the video frames using the videoinput function.  Set a loop that stop after 100 frames of acquisition.  Get the snapshot of every frame.  Now to track red objects in real time we have to subtract the red component from the grayscale image to extract the red components in the image.  Convert the resulting grayscale image into a binary image.  Remove all those pixels less than 300pixels,filteing.  Label all the connected components in the image.  Display the image.  Set a loop to bound the red objects in a rectangular box. New MATLAB functions used:  VIDEOINPUT : Create video input object. OBJ = VIDEOINPUT(ADAPTORNAME) constructs the video input object, OBJ. A video input object represents the connection between MATLAB and a particular image acquisition device.  GETSNAPSHOT Immediately returns a single image snapshot from a video input object.  REGIONPROPS: Used to find a specific property of a combined area of a matrix. Here we use it to find the bounding region of the object.  BWLABEL: This function helps in extraction of unconnected objects out of a bw image by assigning a different number to all clusters.  RECTANGLE adds a rectangle to the specific location of a specified size.
  • 10. Mini Project Report Page 10 3. c ENGINEER PROBLEM STATEMENT In an arena consisting of 25 blocks of 30x30 cm each we need to detect the red and black lines and the red lines are required to be avoided while collecting the green objects whose positions are specified in another image file. The blocks and the sides are separated by cropping them and each one is scanned for colour red and green and a specific value is assigned for red and green to define difference in them. The path that is not to be covered (red and edges) are given the value 0, starting point (blue) is given the value 3, point necessary to be covered (green) are assigned 2 and the points allowed to move over are assigned 1.
  • 11. Mini Project Report Page 11 3. d Virtual Slate Using colour tracking and a laser light source, we can make an arrangement that takes video input from outside through the webcam and processes it in MATLAB. The output is a plot of the coordinates of the point where a are colour is detected. Hence if we use a laser light and aim it over a blank surface we can simulate a slate which senses the motion of the laser and forms the shape based on the movement of the laser. New MATLAB functions used:  VIDEOINPUT : Create video input object. OBJ = VIDEOINPUT(ADAPTORNAME) constructs the video input object, OBJ. A video input object represents the connection between MATLAB and a particular image acquisition device.  GETSNAPSHOT: Immediately returns a single image snapshot from a video input object.  HOLD: Used to store the present figure and add the new figure over it.  BWLABEL: This function helps in extraction of unconnected objects out of a bw image by assigning a different number to all clusters.  SAVEAS: Saves Figure or Simulink block diagram in desired output format.
  • 12. Mini Project Report Page 12 3. e. Face Detection Face detection is a very basic and important part of face recognition.For face recognition we need to first process the input image and remove the unnecessary data and remove the noise.This can be done by comparing the colour values in the picture to specific predefined values representing the skin colour. After this we need to crop the image in the size of the average size of a human head. After this it has to be processed further to match it with the database. 3. f. Distance Estimation To find out the distance of anything in front we can use a system comprising of a webcam and a laser fixed parallel to the principal axis of the camera lens. As we take the video input from the camera and detect the laser point, we can calculate the distance of the object from the camera source after proper calibration. As we move the object away from the camera the position of the red spot in the image moves away from the centre and as we approach the object the spot moves closer to the centre.
  • 13. Mini Project Report Page 13 5. References: 1. Gonzalez Woods & Eddins, “Digital Image Processing Using Matlab”. 2. Mathworks, http://www.mathworks.com