SlideShare a Scribd company logo
1 of 2
Object Detection Using Image Processing Techniques
Aditya Rayan Aranha
Dept. of Industrial & Systems Engineering
University at Buffalo, The State University of New York
Buffalo, NY 14228 USA
aaranha@buffalo.edu
Emmanuel Dylan Devotta
Dept. of Industrial & Systems Engineering
University at Buffalo, The State University of New York
Buffalo, NY 14228 USA
edevotta@buffalo.edu
Abstract—This paper describes a technique for detection of
multiple objects of different colors and shapes against a
background. The code is written in Matlab using the image
processing toolbox for object detection. The proposed approach
uses techniques such as obtaining a threshold from inspecting
histograms of RGB and Grayscale images and applying adaptive,
global & local threshold to isolate objects from the background.
Noise is filtered out and a complement of the image is used.
Bounding box methodology is used to find the center and
boundary of objects. The number of circular objects are found by
detecting centers and radii of circles. Simple counting program is
used to count the number of Images. Objects of different color
are isolated by identifying RGB pixel values for particular color
and mask is applied by specifying a range of pixel values.
Index Terms—Threshold, Object Detection, Pixel, Cluster ,
Circular, RGB(key words)
I. INTRODUCTION
Figure 1
The objective of the problem is to identify all objects and trace
their edges in the image by using various image processing
techniques. Once we have identified all objects the next step
would be to count all of them. After counting objects, we
would like to identify all circular objects and their centers in
the image and count them. The last step of the problem
involves identifying and segregating green circular objects
from the rest of the image.
II. PROCEDURE
The first step of the process if to convert the image to greyscale
and manually find a threshold value to separate objects from
background. For the image shown in Figure 1 after we convert
to greyscale and inspect the histogram. We choose a threshold
value of 175 and convert to binary and take a complement of
the image as shown in Figure 2
.
Figure 2
A. Identifying Objects
Once we obtain a complement we need to isolate the noise in
the image. We use inbuilt matlab function bwconncomp to
identify clusters with 4 or more connected points. Next we plot
a graph to see the connected points in each cluster. By
inspecting the graph, we conclude that any cluster with less
than 500 points can be considered as noise as shown in Figure
3. We apply a mask to and set the id of main pixel as equal to
1. The final result of cleaned image is shown in figure 4.
Figure 3
Figure 3
B. Tracing Boundaries and Identifying Circles
We use the mesh grid system to make a coordinate
system on the picture. For each cluster of pixels in an
objects we plot the maximum, minimum and mean
values in both horizontal and vertical directions for
each objects. After obtaining the bounding box we can
easily plot the mid-point of the objects.
To distinguish circles from other objects in the image
we use the logic that the distance in both the horizontal
and vertical direction for a circle show be zero. To
account for distortion at edges we use the condition
that if abs(d1-d2)<5 then the object is circular. (Note:
This logic would also apply to a square object, but the
figure does not contain any square objects)
To count the objects in the image, we have the object
clusters and pixel id. We use a simple counter to count
for all the objects. This logic is also applied separately
to count the circular objects as well.
The final results are shown in Figure 4.
Figure 4
C. Identification of Green Circular Objects
The procedure used to find green objects in the image uses the
inbuilt function in mathlab called impixel to find the individual
RGB pixels for the green shaded objects. Once we compare the
minimum and maximum pixel value for each RGB element in
the green shaded object we can use these parameters to set a
mask within a certain range of red>96 & red<=130 &
green>160 & green<185 & blue>=53 & blue<100 so that only
green shaded objects are isolated. The results of segregating the
green objects is shown in Figure 5
Figure 5
The procedure for trying to isolate the green objects based on
threshold values for each individual RGB plot of image by
inspecting the histograms proved unsuccessful as it was not
possible to find a specific threshold value to separate green
objects from rest of the objects.
III. REFERENCES
[1] Color Based Segmentation Procedures- www.mathworks.com
[2] Matlab Code for image processing on UB Learns-Dr
Ehsan Tarkesh Esfahani

More Related Content

What's hot

Performance Analysis of Iterative Closest Point (ICP) Algorithm using Modifie...
Performance Analysis of Iterative Closest Point (ICP) Algorithm using Modifie...Performance Analysis of Iterative Closest Point (ICP) Algorithm using Modifie...
Performance Analysis of Iterative Closest Point (ICP) Algorithm using Modifie...IRJET Journal
 
search engine for images
search engine for imagessearch engine for images
search engine for imagesAnjani
 
System architecture
System architectureSystem architecture
System architectureSanjay Raj
 
Performance Anaysis for Imaging System
Performance Anaysis for Imaging SystemPerformance Anaysis for Imaging System
Performance Anaysis for Imaging SystemVrushali Lanjewar
 
Sign Language Recognition Using Image Processing For Mute People
Sign Language Recognition Using Image Processing For Mute PeopleSign Language Recognition Using Image Processing For Mute People
Sign Language Recognition Using Image Processing For Mute Peoplepaperpublications3
 
Finding Maximum Edge Biclique in Bipartite Networks by Integer Programming
Finding Maximum Edge Biclique in Bipartite Networks by Integer ProgrammingFinding Maximum Edge Biclique in Bipartite Networks by Integer Programming
Finding Maximum Edge Biclique in Bipartite Networks by Integer ProgrammingMelih Sözdinler
 
Dip digital image 3
Dip digital image 3Dip digital image 3
Dip digital image 3Shajun Nisha
 
IRJET- IR Instrument Thermal Background Modelling and Radiometric Analysis
IRJET- IR Instrument Thermal Background Modelling and Radiometric AnalysisIRJET- IR Instrument Thermal Background Modelling and Radiometric Analysis
IRJET- IR Instrument Thermal Background Modelling and Radiometric AnalysisIRJET Journal
 
aip basic open cv example
aip basic open cv exampleaip basic open cv example
aip basic open cv exampleSaeed Ullah
 
B. SC CSIT Computer Graphics Unit1.2 By Tekendra Nath Yogi
B. SC CSIT Computer Graphics Unit1.2 By Tekendra Nath YogiB. SC CSIT Computer Graphics Unit1.2 By Tekendra Nath Yogi
B. SC CSIT Computer Graphics Unit1.2 By Tekendra Nath YogiTekendra Nath Yogi
 
Design and Implementation of Digital Image Transformation Algorithms
Design and Implementation of Digital Image Transformation AlgorithmsDesign and Implementation of Digital Image Transformation Algorithms
Design and Implementation of Digital Image Transformation Algorithmsijtsrd
 
Mathcad - cp (computational physics) with python - example example 0.1.1.xmcd
Mathcad  - cp (computational physics) with python - example example 0.1.1.xmcdMathcad  - cp (computational physics) with python - example example 0.1.1.xmcd
Mathcad - cp (computational physics) with python - example example 0.1.1.xmcdJulio Banks
 
Image Maximization Using Multi Spectral Image Fusion Technique
Image Maximization Using Multi Spectral Image Fusion TechniqueImage Maximization Using Multi Spectral Image Fusion Technique
Image Maximization Using Multi Spectral Image Fusion Techniquedbpublications
 
Multi graph encoder
Multi graph encoderMulti graph encoder
Multi graph encoderYajie Zhou
 

What's hot (19)

Performance Analysis of Iterative Closest Point (ICP) Algorithm using Modifie...
Performance Analysis of Iterative Closest Point (ICP) Algorithm using Modifie...Performance Analysis of Iterative Closest Point (ICP) Algorithm using Modifie...
Performance Analysis of Iterative Closest Point (ICP) Algorithm using Modifie...
 
search engine for images
search engine for imagessearch engine for images
search engine for images
 
System architecture
System architectureSystem architecture
System architecture
 
Matlab Working With Images
Matlab Working With ImagesMatlab Working With Images
Matlab Working With Images
 
Performance Anaysis for Imaging System
Performance Anaysis for Imaging SystemPerformance Anaysis for Imaging System
Performance Anaysis for Imaging System
 
Sign Language Recognition Using Image Processing For Mute People
Sign Language Recognition Using Image Processing For Mute PeopleSign Language Recognition Using Image Processing For Mute People
Sign Language Recognition Using Image Processing For Mute People
 
Finding Maximum Edge Biclique in Bipartite Networks by Integer Programming
Finding Maximum Edge Biclique in Bipartite Networks by Integer ProgrammingFinding Maximum Edge Biclique in Bipartite Networks by Integer Programming
Finding Maximum Edge Biclique in Bipartite Networks by Integer Programming
 
Array
ArrayArray
Array
 
Visual Search
Visual SearchVisual Search
Visual Search
 
Histogram Equalization
Histogram EqualizationHistogram Equalization
Histogram Equalization
 
Dip digital image 3
Dip digital image 3Dip digital image 3
Dip digital image 3
 
IRJET- IR Instrument Thermal Background Modelling and Radiometric Analysis
IRJET- IR Instrument Thermal Background Modelling and Radiometric AnalysisIRJET- IR Instrument Thermal Background Modelling and Radiometric Analysis
IRJET- IR Instrument Thermal Background Modelling and Radiometric Analysis
 
aip basic open cv example
aip basic open cv exampleaip basic open cv example
aip basic open cv example
 
B. SC CSIT Computer Graphics Unit1.2 By Tekendra Nath Yogi
B. SC CSIT Computer Graphics Unit1.2 By Tekendra Nath YogiB. SC CSIT Computer Graphics Unit1.2 By Tekendra Nath Yogi
B. SC CSIT Computer Graphics Unit1.2 By Tekendra Nath Yogi
 
Design and Implementation of Digital Image Transformation Algorithms
Design and Implementation of Digital Image Transformation AlgorithmsDesign and Implementation of Digital Image Transformation Algorithms
Design and Implementation of Digital Image Transformation Algorithms
 
Mathcad - cp (computational physics) with python - example example 0.1.1.xmcd
Mathcad  - cp (computational physics) with python - example example 0.1.1.xmcdMathcad  - cp (computational physics) with python - example example 0.1.1.xmcd
Mathcad - cp (computational physics) with python - example example 0.1.1.xmcd
 
Image Maximization Using Multi Spectral Image Fusion Technique
Image Maximization Using Multi Spectral Image Fusion TechniqueImage Maximization Using Multi Spectral Image Fusion Technique
Image Maximization Using Multi Spectral Image Fusion Technique
 
Multi graph encoder
Multi graph encoderMulti graph encoder
Multi graph encoder
 
Image formation
Image formationImage formation
Image formation
 

Similar to Project 2

Comparative between global threshold and adaptative threshold concepts in ima...
Comparative between global threshold and adaptative threshold concepts in ima...Comparative between global threshold and adaptative threshold concepts in ima...
Comparative between global threshold and adaptative threshold concepts in ima...AssiaHAMZA
 
A secure method for hiding secret data on cubism image using hybrid feature d...
A secure method for hiding secret data on cubism image using hybrid feature d...A secure method for hiding secret data on cubism image using hybrid feature d...
A secure method for hiding secret data on cubism image using hybrid feature d...eSAT Publishing House
 
A study and comparison of different image segmentation algorithms
A study and comparison of different image segmentation algorithmsA study and comparison of different image segmentation algorithms
A study and comparison of different image segmentation algorithmsManje Gowda
 
IRJET- A Review on Plant Disease Detection using Image Processing
IRJET- A Review on Plant Disease Detection using Image ProcessingIRJET- A Review on Plant Disease Detection using Image Processing
IRJET- A Review on Plant Disease Detection using Image ProcessingIRJET Journal
 
3D Reconstruction from Multiple uncalibrated 2D Images of an Object
3D Reconstruction from Multiple uncalibrated 2D Images of an Object3D Reconstruction from Multiple uncalibrated 2D Images of an Object
3D Reconstruction from Multiple uncalibrated 2D Images of an ObjectAnkur Tyagi
 
AUTOMATIC DOMINANT REGION SEGMENTATION FOR NATURAL IMAGES
AUTOMATIC DOMINANT REGION SEGMENTATION FOR NATURAL IMAGES AUTOMATIC DOMINANT REGION SEGMENTATION FOR NATURAL IMAGES
AUTOMATIC DOMINANT REGION SEGMENTATION FOR NATURAL IMAGES cscpconf
 
Automatic dominant region segmentation for natural images
Automatic dominant region segmentation for natural imagesAutomatic dominant region segmentation for natural images
Automatic dominant region segmentation for natural imagescsandit
 
ImageProcessingWithMatlab(HasithaEdiriweera)
ImageProcessingWithMatlab(HasithaEdiriweera)ImageProcessingWithMatlab(HasithaEdiriweera)
ImageProcessingWithMatlab(HasithaEdiriweera)Hasitha Ediriweera
 
IRJET- Image Feature Extraction using Hough Transformation Principle
IRJET- Image Feature Extraction using Hough Transformation PrincipleIRJET- Image Feature Extraction using Hough Transformation Principle
IRJET- Image Feature Extraction using Hough Transformation PrincipleIRJET Journal
 
Multimedia content based retrieval in digital libraries
Multimedia content based retrieval in digital librariesMultimedia content based retrieval in digital libraries
Multimedia content based retrieval in digital librariesMazin Alwaaly
 
Content Based Image Retrieval Approach Based on Top-Hat Transform And Modifie...
Content Based Image Retrieval Approach Based on Top-Hat Transform And Modifie...Content Based Image Retrieval Approach Based on Top-Hat Transform And Modifie...
Content Based Image Retrieval Approach Based on Top-Hat Transform And Modifie...cscpconf
 
A Novel Method for Image Watermarking Using Luminance Based Block Selection a...
A Novel Method for Image Watermarking Using Luminance Based Block Selection a...A Novel Method for Image Watermarking Using Luminance Based Block Selection a...
A Novel Method for Image Watermarking Using Luminance Based Block Selection a...IJERA Editor
 
Implementation of high performance feature extraction method using oriented f...
Implementation of high performance feature extraction method using oriented f...Implementation of high performance feature extraction method using oriented f...
Implementation of high performance feature extraction method using oriented f...eSAT Journals
 
aip shape detection and tracking using contours
aip shape detection and tracking using contoursaip shape detection and tracking using contours
aip shape detection and tracking using contoursSaeed Ullah
 
APPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLING
APPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLINGAPPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLING
APPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLINGsipij
 

Similar to Project 2 (20)

Project_2
Project_2Project_2
Project_2
 
Comparative between global threshold and adaptative threshold concepts in ima...
Comparative between global threshold and adaptative threshold concepts in ima...Comparative between global threshold and adaptative threshold concepts in ima...
Comparative between global threshold and adaptative threshold concepts in ima...
 
A secure method for hiding secret data on cubism image using hybrid feature d...
A secure method for hiding secret data on cubism image using hybrid feature d...A secure method for hiding secret data on cubism image using hybrid feature d...
A secure method for hiding secret data on cubism image using hybrid feature d...
 
A study and comparison of different image segmentation algorithms
A study and comparison of different image segmentation algorithmsA study and comparison of different image segmentation algorithms
A study and comparison of different image segmentation algorithms
 
Barcode reader
Barcode readerBarcode reader
Barcode reader
 
Cj36511514
Cj36511514Cj36511514
Cj36511514
 
IRJET- A Review on Plant Disease Detection using Image Processing
IRJET- A Review on Plant Disease Detection using Image ProcessingIRJET- A Review on Plant Disease Detection using Image Processing
IRJET- A Review on Plant Disease Detection using Image Processing
 
3D Reconstruction from Multiple uncalibrated 2D Images of an Object
3D Reconstruction from Multiple uncalibrated 2D Images of an Object3D Reconstruction from Multiple uncalibrated 2D Images of an Object
3D Reconstruction from Multiple uncalibrated 2D Images of an Object
 
AUTOMATIC DOMINANT REGION SEGMENTATION FOR NATURAL IMAGES
AUTOMATIC DOMINANT REGION SEGMENTATION FOR NATURAL IMAGES AUTOMATIC DOMINANT REGION SEGMENTATION FOR NATURAL IMAGES
AUTOMATIC DOMINANT REGION SEGMENTATION FOR NATURAL IMAGES
 
Automatic dominant region segmentation for natural images
Automatic dominant region segmentation for natural imagesAutomatic dominant region segmentation for natural images
Automatic dominant region segmentation for natural images
 
ImageProcessingWithMatlab(HasithaEdiriweera)
ImageProcessingWithMatlab(HasithaEdiriweera)ImageProcessingWithMatlab(HasithaEdiriweera)
ImageProcessingWithMatlab(HasithaEdiriweera)
 
IRJET- Image Feature Extraction using Hough Transformation Principle
IRJET- Image Feature Extraction using Hough Transformation PrincipleIRJET- Image Feature Extraction using Hough Transformation Principle
IRJET- Image Feature Extraction using Hough Transformation Principle
 
Ijcatr04041020
Ijcatr04041020Ijcatr04041020
Ijcatr04041020
 
Multimedia content based retrieval in digital libraries
Multimedia content based retrieval in digital librariesMultimedia content based retrieval in digital libraries
Multimedia content based retrieval in digital libraries
 
Content Based Image Retrieval Approach Based on Top-Hat Transform And Modifie...
Content Based Image Retrieval Approach Based on Top-Hat Transform And Modifie...Content Based Image Retrieval Approach Based on Top-Hat Transform And Modifie...
Content Based Image Retrieval Approach Based on Top-Hat Transform And Modifie...
 
A Novel Method for Image Watermarking Using Luminance Based Block Selection a...
A Novel Method for Image Watermarking Using Luminance Based Block Selection a...A Novel Method for Image Watermarking Using Luminance Based Block Selection a...
A Novel Method for Image Watermarking Using Luminance Based Block Selection a...
 
Report
ReportReport
Report
 
Implementation of high performance feature extraction method using oriented f...
Implementation of high performance feature extraction method using oriented f...Implementation of high performance feature extraction method using oriented f...
Implementation of high performance feature extraction method using oriented f...
 
aip shape detection and tracking using contours
aip shape detection and tracking using contoursaip shape detection and tracking using contours
aip shape detection and tracking using contours
 
APPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLING
APPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLINGAPPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLING
APPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLING
 

Project 2

  • 1. Object Detection Using Image Processing Techniques Aditya Rayan Aranha Dept. of Industrial & Systems Engineering University at Buffalo, The State University of New York Buffalo, NY 14228 USA aaranha@buffalo.edu Emmanuel Dylan Devotta Dept. of Industrial & Systems Engineering University at Buffalo, The State University of New York Buffalo, NY 14228 USA edevotta@buffalo.edu Abstract—This paper describes a technique for detection of multiple objects of different colors and shapes against a background. The code is written in Matlab using the image processing toolbox for object detection. The proposed approach uses techniques such as obtaining a threshold from inspecting histograms of RGB and Grayscale images and applying adaptive, global & local threshold to isolate objects from the background. Noise is filtered out and a complement of the image is used. Bounding box methodology is used to find the center and boundary of objects. The number of circular objects are found by detecting centers and radii of circles. Simple counting program is used to count the number of Images. Objects of different color are isolated by identifying RGB pixel values for particular color and mask is applied by specifying a range of pixel values. Index Terms—Threshold, Object Detection, Pixel, Cluster , Circular, RGB(key words) I. INTRODUCTION Figure 1 The objective of the problem is to identify all objects and trace their edges in the image by using various image processing techniques. Once we have identified all objects the next step would be to count all of them. After counting objects, we would like to identify all circular objects and their centers in the image and count them. The last step of the problem involves identifying and segregating green circular objects from the rest of the image. II. PROCEDURE The first step of the process if to convert the image to greyscale and manually find a threshold value to separate objects from background. For the image shown in Figure 1 after we convert to greyscale and inspect the histogram. We choose a threshold value of 175 and convert to binary and take a complement of the image as shown in Figure 2 . Figure 2 A. Identifying Objects Once we obtain a complement we need to isolate the noise in the image. We use inbuilt matlab function bwconncomp to identify clusters with 4 or more connected points. Next we plot a graph to see the connected points in each cluster. By inspecting the graph, we conclude that any cluster with less than 500 points can be considered as noise as shown in Figure 3. We apply a mask to and set the id of main pixel as equal to 1. The final result of cleaned image is shown in figure 4. Figure 3
  • 2. Figure 3 B. Tracing Boundaries and Identifying Circles We use the mesh grid system to make a coordinate system on the picture. For each cluster of pixels in an objects we plot the maximum, minimum and mean values in both horizontal and vertical directions for each objects. After obtaining the bounding box we can easily plot the mid-point of the objects. To distinguish circles from other objects in the image we use the logic that the distance in both the horizontal and vertical direction for a circle show be zero. To account for distortion at edges we use the condition that if abs(d1-d2)<5 then the object is circular. (Note: This logic would also apply to a square object, but the figure does not contain any square objects) To count the objects in the image, we have the object clusters and pixel id. We use a simple counter to count for all the objects. This logic is also applied separately to count the circular objects as well. The final results are shown in Figure 4. Figure 4 C. Identification of Green Circular Objects The procedure used to find green objects in the image uses the inbuilt function in mathlab called impixel to find the individual RGB pixels for the green shaded objects. Once we compare the minimum and maximum pixel value for each RGB element in the green shaded object we can use these parameters to set a mask within a certain range of red>96 & red<=130 & green>160 & green<185 & blue>=53 & blue<100 so that only green shaded objects are isolated. The results of segregating the green objects is shown in Figure 5 Figure 5 The procedure for trying to isolate the green objects based on threshold values for each individual RGB plot of image by inspecting the histograms proved unsuccessful as it was not possible to find a specific threshold value to separate green objects from rest of the objects. III. REFERENCES [1] Color Based Segmentation Procedures- www.mathworks.com [2] Matlab Code for image processing on UB Learns-Dr Ehsan Tarkesh Esfahani