0% found this document useful (0 votes)
2 views

Implementation of a Fast and Accurate Algorithm for Circular Object Detection

Download now.
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Implementation of a Fast and Accurate Algorithm for Circular Object Detection

Download now.
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 10

Implementation of a Fast and Accurate Algorithm for

Circular Object Detection


Md. Manirul Islam,1,* and M. A. Rashid1,**
1
Faculty of Design & Engineering Technology, University Sultan Zainal Abidin
Terengganu, Malaysia
*
[email protected], and **[email protected]

Abstract— Detection of circular object with high accuracy and processing is another issue that should be considered. Object
speed from images is a challenging computer vision problem. can contain void inside it. Circular object containing void
Most of the algorithm used in high accuracy system is time inside may cause error. Before processing of object image, the
consuming and complex. Also most of the fast algorithm is not
void is to be removed from image. Sometimes small objects
highly accurate but simple. A fast and accurate algorithm is
proposed here to detect circular object. This algorithm needs
like dusts or small particles remain in the images. These
very few addition and multiplication command. Therefore, it can noises are to be removed before processing. Noise can be
be implemented in simple processor. True color image is produced from camera also. These are actually some
captured from a digital camera and saved in a memory location. pretreatments of the images that are used to simplify image
Then true color image is transformed into gray scale and processing and improve accuracy of the system.
background information is removed. If any noise or void inside Image color transformation, grayscale encoding,
the object remains in the image then it is removed. Mainly some binaryzation, binary matrix analysis, etc. are then performed
parameters of a circle are measured such as area, perimeter, to get the result. These are very common techniques and
center, radios etc. Then from these parameters, it is calculated
procedures that are used widely in almost all areas of image
that the object is circular or not. Some of the developed system
gives poor results with variation of object color. It can detect any processing. In Fig. 1, it is shown graphically.
multi colored object with high accuracy. Speed of the system does
not depend on the color of object. The proposed system can
automatically detect the background and the object. No need to
select the object color or background color. The speed of the
system is mainly depending on the resolution of the image. Speed
of the system decreases linearly with the resolution of image. It’s
a great advancement. In some system, speed is decreased in
increasing order with resolution. In production areas of
industrial sector, it can automate a system to remove damaged (a) (b) (c)
product. This algorithm can be implemented in robot to detect
various types of object. It has an immense application in 0 1 1 1 1 1 1 1 1 1
biomedical engineering area. Such as lung nodule can be detected 0
0
0
0
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
by it. Above all the system is very reliable, fast, accurate and 0 0 0 0 1 1 1 1 1 1
0 0 0 0 0 1 1 1 1 1
efficient. 0 0 0 0 0 0 1 1 1 1
0 0 0 0 0 0 0 1 1 1
0 0 0 0 0 0 0 0 1 1

Index Terms—RGB, HSL, grayscale, binaryzation, remote


0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 0

monitoring, edge detection, binary matrix, resolution (d) (e) (f)


I. INTRODUCTION Fig. 1 Common image processing techniques and binary matrix analysis.
In pattern recognition and computer vision, circular object True color image of object is shown in Fig. 1 (a). This true
detection and parameters determination are essential tasks. color image is converted into grayscale image that is shown in
There are many algorithms are proposed to detect circular Fig. 1 (b). Gray scale image can be obtained from true color
object. Detection time with accuracy is another challenge. image by eliminating the hue and saturation information while
Speed of algorithm decreases with accuracy of the system. retaining the luminance. Then it is transformed into black and
Accuracy of a system mainly depends on the precision white (BW) image. Here only two color remains, black or
measurement of the parameters. For precision measurement, white that is shown in Fig. 1 (c). The portion of image inside
complex calculation can not be avoided. Also the calculation the red box in Fig. 1 (c) is zoomed in Fig. 1 (d). The pixel of
complexity can not be simplified because it develops error this image is shown in Fig. 1(e) and the matrix representation
terms. Conversely, the speed of a system mainly depends on of that portion is shown in Fig. 1 (f). This matrix is called
the calculation simplicity and numbers of computations. binary matrix. Its elements are either one or zero. Black color
Numbers of computations are immensely more in accurate pixels are represented by zero and white color pixels are
algorithm than simple and general algorithm. Therefore, High represented by one in it. From this process every image
speed and accurate algorithm is a tricky problem to detect captured from a camera can be transformed into a binary
circular object. Here, images of object are captured from a matrix. Then matrix analysis is performed to detect the object
camera. Then it is processed to detect the object is circular or is circular or not.
not. The background color and the object color may overlap Images of the object are captured from a digital camera.
with each other. Therefore, background color selection and These images are generally true color. The smallest
addressable elements or points of an image are pixel. Color of high quality binary image [8]. Accuracy of the system is
images can be described by some models. RGB, HSL and mostly depends on these pretreatments.
CMY are the most popular models. On addition and Identifying circular objects in images can be done by
subtraction process of light spectrum, color model is classified adaption of Circular Hough Transform (CHT) [1]. Eigen
into two categories, additive color model and subtractive color values of Covariance Matrix and K-means clustering
model. techniques are also used to achieve fast and accurate
The RGB color model is an additive color model in the algorithm.
logic that when three light beams are added together then their Edge detection is needed to get the shape of object. Then
light spectra are added to produce the ultimate color spectrum. geometric property parameters are calculated to detect the
A wide range of colors can be produced by adding red, green, shape of object. In [9] mathematical morphology operators are
and blue color. The name of the model comes from the initials used to get edge point set and then the geometric property
of the three additive primary colors, red, green, and blue. RGB parameters are calculated from it.
color model is also a device dependent color model. RGB Different algorithms are developed to calculate the
color model is widely used in color TV of various geometric property. The centers of curvature are calculated by
technologies (CRT, LCD, LED, plasma etc.), computer least square fitting. By fitting degree, the circles are
display, mobile phone display, multicolor LED display, video recognized and their radii and centers are calculated in [7].
camera, digital camera, image scanner and video projector etc. Circular objects in noisy and inhomogeneous contrast
On the other hand the CMY color model is a subtractive image can be detected by the separability and uniformity of
color model. The name of the model comes from the initials of the image intensity distributions as calculated by
three primary colors, cyan, magenta and yellow color. In this Bhattacharyya Coefficient [6]. Detecting of obscure and
model, white color is the absence of color and black is the textured circular objects, both of which are challenges for
combination of three colors. This model is mainly used in conventional methods.
color printing and is also used to describe the printing process Circular object detection by probability searching is also
itself. To save ink and to produce deeper dark black color, used. It can be done by determining a candidate center and
black ink is used instead of the combination of cyan, magenta radius by the intersection of gradient lines to achieve
and yellow color. Therefore this model is also known as candidate circle [4].
CMYK model. K stands for black because B is already is used Detection system can be based on shape matching. Using
for blue. circular arc segments to describe image edges is advantageous
RGB (240,100,70) RGB (100,70,240) RGB (70,240,100) for shape description, shape expression and reconstruction
RGB RGB RGB [11]. But the speed of the system is not good enough due to
complex algorithm.
R(240) R(100) R(70)
Real world object like coconut is analyzed using CHT and
G(100) G(70) G(240) the chord intersection in [2]. CHT is more accurate than chord
B(70) B(240) B(100) intersection. It will be a great achievement if the accuracy
L(138) L(98) L(173) crosses 95% with satisfactory speed.
(a) (b) (c) This method can be implemented in automated lung cancer
detection. The manual nodule detection is very time
Fig. 2 RGB and Grayscale color analysis. consuming and costly. Therefore, circular object detection
HSL color model is actually a cylindrical coordinate system can be implemented for lung nodule detection from
representation of points in RGB color model. The name of the CT scan images [10].
model comes from the initials of three properties of colors, Circular object detection is implemented in soccer robot
hue, saturation and luminance. This model is also known as now a day. Detection method is based on threshold
HSV and HSI. V and I stand for value and intensity segmentation, edge detection and the model of Hough
respectively. This model is mainly used in color pickers, Transform [5].
image editing software and less frequently in image analysis Circular object detection is also essential part in face
and computer vision. detection. It can play an important role in iris detection from
Different RGB color image is shown in Fig. 2. The portions face images [3]. Iris detection is also implemented with face
of R, G and B in a RGB image are varied from 0 to 255. The detection in immigration counter now a day.
portions of R, G and B are calculated and shown in Fig. 2. The This paper is organized as follows: Section II describes the
luminance value (L) of the RGB color image is also calculated methodology that is used in circular object detection. Section
and shown in Fig. 2. The luminance value (L) can be III explains the complete design of the system. Results are
calculated by using (1). shown in section IV. Some discussions are made there to
(1) reduce error from the result. Finally, section V concludes the
entire paper.
From (1), it is clear that value of L can be equal for
different RGB color. Gray scale image is obtained from true II. METHODOLOGY
color image by retaining the luminance value only. Therefore,
To detect the shape of an object, it is needed to measure the
it is obviously true that from different true color images of
parameters of the object. Circle has some parameters such as
objects, same grayscale images can be found.
diameter, center, perimeter, area etc. If an object met all the
In pattern recognition and computer vision, the color image
property of a circle then it can be called circle. Circle has a
is processed with the following pretreatment methods: image
unique property. If the perimeter of different shapes is equal
grayness, image smoothness, image binaryzation etc to get the
then only circle will occupy the largest area among them.
Alternatively, it can be said that, if the area of different shapes
is equal then circle will occupy the least perimeter. It will be polygon increases exponentially and the value of area will
proved here. touch a maximum limit.
Different types of shapes are shown in Fig. 3. If the TABLE I
perimeter of all the shapes is equal then circle in Fig. 3 (f) AREA OF DIFFERENT REGULAR POLYGONS AT CONSTANT PERIMETER
occupies the largest area among all the shape. If all sides of
At constant perimeter
shapes are equal then it is called regular polygon. Let, length
Sl. Number Perimeter, Length Area of
of each side of triangle, square, pentagon, hexagon are a, b, c, of sides, PN of each regular
d respectively. Then, N side, s polygon, AN
(2) 1 3 16.0000 5.3333 12.3168
Where, r is the radius of circle that is shown in Fig. 3 (f). In 2 4 16.0000 4.0000 16.0000
(2), N is the number of sides and s is the length of each sides 3 5 16.0000 3.2000 17.6177
of a regular polygon. Area of triangle can be expressed by (3). 4 6 16.0000 2.6667 18.4752
5 7 16.0000 2.2857 18.9853
(3) 6 8 16.0000 2.0000 19.3137
7 9 16.0000 1.7778 19.5376
Where, A3 is the area of triangle. The value of a from (2) 8 10 16.0000 1.6000 19.6972
can be substituted in (3). It is expressed in (4). 9 11 16.0000 1.4545 19.8149
10 12 16.0000 1.3333 19.9043
(4)
For better analysis of the area of regular polygons, a
Similarly, area of square, A4 can be derived. It is shown in
constant is defined. Ratio between area of regular polygon and
(5).
circle, when their perimeter is equal, is defined as Area Ratio
(5) Constant, Ca. It can be expressed by (8).

(8)

Where, AN is the area of regular polygon with N sides and


AC is the area of circle. AC is expressed in (9).
(9)
(a) (b) (c) Substituting the value of AN from (7) and AC from (9) into
(8), Ca can be calculated. It is expressed in (10).

(10)

For different values of N, Ca is plotted against N and is


shown in Fig. 3. Value of Ca is increased exponentially with N
(d) (e) (f) and the maximum value of Ca will be 1, it can be guessed.
1
Fig. 3 Different types of regular polygons and circle.
X: 15 X: 30
To calculate the area of different regular polygons, a 0.8 Y: 0.9853 Y: 0.9963
X: 5
Number of side, N

general equation can be derived. If the length of each side is s Y: 0.8648


and the number of sides is N then area of the regular polygon 0.6
can be expressed by (6). X: 3
Y: 0.6046
0.4
(6)
0.2 X: 2
Y: 9.618e-017
Where, AN is the area of regular polygon whose number of
side is N. The value of s from (2) can be substituted in (6). It 0
0 10 20 30 40
is expressed in (7).
Area ratio constant, Ca

(7) Fig. 4 Value of area ratio constant is calculated for different types of regular
polygons.

The highest value of Ca can be calculated by putting the


From (4) and (5), it is clear that area of square is greater
limiting value of N to infinity in (10). It is shown in (11).
than area of triangle, when their perimeter is same. Perimeter
is kept constant at 16 and areas of regular polygons are
calculated by using (2) and (6). It is shown in Table I. (11)
From Table I, it is clear that with increase of the number of
sides of regular polygon at constant perimeter, area of regular
Therefore, it can be concluded that, if a regular polygon has
infinite number of sides then the area of polygon and the area (17)
of circle will be equal when perimeter of both is same. On the
other hand, it can be said that, a circle is a regular polygon For different values of N, Cp is plotted against N and is
with infinite number of sides. It can be proved by putting the shown in Fig. 5. Value of Cp is decreased exponentially with N
limiting value of N to infinity in (7). and the minimum value of Cp will be 1, it can be assumed.
1.4
(12) X: 3
Y: 1.286
1.3

Number of side, N
From Fig. 4 and (11) it is clear that with a certain
perimeter among all the regular polygons and circle, circle has
1.2
the largest area. X: 4
Y: 1.128
Alternatively, it can be proved that, if the area of different
regular polygons and circle is same then circle has the least 1.1 X: 6
perimeter. This condition can be expressed by (13). Y: 1.05
X: 14 X: 33 X: 50
Y: 1.009 Y: 1.002 Y: 1.001
1
(13) 0 10 20 30 40 50
Perimeter ratio constant, Cp

Perimeter of a regular polygon, PN with N side can be Fig. 5 Value of perimeter ratio constant is calculated for different types of
regular polygons.
expressed by (14).
(14) The lowest value of Cp can be calculated by putting the
The value of s from (13) can be substituted in (14). It is limiting value of N to infinity in (17). It is shown in (18).
expressed in (15).
(18)
(15)
Therefore, it can be concluded that, if a regular polygon has
Area is kept constant at 16 and perimeter of regular infinite number of sides then the perimeter of regular polygon
polygon is calculated by using (13) and (14). It is shown in and the perimeter of circle will be equal when area of both is
Table II. same. It can also be proved by putting the limiting value of N
to infinity in (15). It is expressed in (19).
TABLE II
PERIMETER OF DIFFERENT REGULAR POLYGONS AT CONSTANT AREA
(19)
At constant area
Sl. Number Area, AN Length of Perimeter, Therefore, from (12) and (19) it is clear that, regular
of sides, N each side, s PN polygon with infinite number of sides is circle. From Fig. 5
1 3 16.0000 6.0787 18.2361 and (18), it is clear that with a certain area among all the
2 4 16.0000 4.0000 16.0000 regular polygons and circle, circle has the least perimeter.
3 5 16.0000 3.0495 15.2477 Ca and Cp is plotted against number of sides N and is shown
4 6 16.0000 2.4816 14.8897
in Fig. 6.
5 7 16.0000 2.0983 14.6883
1.4
6 8 16.0000 1.8204 14.5629 Ca
7 9 16.0000 1.6088 14.4792 1.3
Cp
8 10 16.0000 1.4420 14.4204
9 11 16.0000 1.3070 14.3775 1.2
10 12 16.0000 1.1954 14.3452
1.1

From Table II, it is clear that with increase of the number of 1


a

p
C
C

sides of regular polygon, perimeter is decreased. It is


0.9
decreased in decreasing order. Therefore, it can be guessed
that it will reach a least value. 0.8
For better analysis of the perimeter of regular polygons, a
constant is defined. Ratio between perimeter of regular 0.7
polygon and circle, when their area is equal, is defined as
Perimeter Ratio Constant, Cp. It is expressed in (16). 0 10 20 30 40
Number of side, s

(16) Fig. 6 Ca and Cp is calculated for different types of regular polygons.

Where, PN is the perimeter of regular polygon with N side From (10) and (17), relation between Area Ratio Constant
and PC is the perimeter of circle. Substituting the value of PN and Perimeter Ratio Constant can be derived. It is shown in
and PC in (16), Cp can be calculated. It is expressed in (17). (20).
From Table III, it can be shown that with increase of the
(20) number of side, value of Cc increases in decreasing order.
From previous analysis it is known that a circle is a regular
A regular hexagon is shown in Fig. 7 (a) and some irregular polygon with infinite sides. Therefore, in real world value of
hexagons are shown in Fig. 7 (b)-(f). Cc is one for circle only. For different regular polygons with N
sides, Cc is calculated and plotted in Fig. 8.
1
X: 18 X: 32 X: 40
0.95 X: 11 Y: 0.9898 Y: 0.9968 Y: 0.9979
Y: 0.9727
X: 5
0.9 Y: 0.8648

Number of side, N
(a) (b) (c) 0.85
X: 4
Y: 0.7854
0.8

0.75

0.7

0.65 X: 3
Y: 0.6046

(d) (e) (f) 0 5 10 15 20 25 30 35 40


Circle Constant, Cc
Fig. 7 Different types of irregular polygons of six sides. Fig. 8 Circle constant is calculated for different types of regular polygons.
From analysis it is also obtained that if the area of them is Therefore, to detect a circular object, the perimeter and area
equal then regular hexagon has the least perimeter. is measured first. Then circular constant, Cc is measured.
Alternatively, if the perimeter of them is equal then regular Finally the result can be drawn from the value of Cc.
hexagon has the largest area. This is true for all regular
polygons similarly. In short, it can be said that, if the III. DESIGN OF THE SYSTEM
perimeter of regular polygon and irregular polygons with N Complete system can be easily presented by block diagram.
side is equal then regular polygon has the largest area. It is shown in Fig. 9. At first, image of the object is captured
Conversely, if the area of regular polygon and irregular from a digital camera. The result is mainly dependent on the
polygons with N side is equal then regular polygon has the quality of image. Therefore, good quality digital camera is
least perimeter. necessary to capture the image of object. In this stage, some
Therefore, finally it can be concluded that among all the common image processing technique is applied to get better
shapes in real world with same perimeter, circular shape has result. Such as, edge smoothing, color filtering, etc. Then the
the largest area. Alternatively, among all the shapes in real RGB image of the object is transformed into grayscale. It is
world with equal area, circular shape has the least perimeter. done by using (1). Then background information is removed
This property of circular shape is used here to detect the from the grayscale image and replaced by pure white color.
circular object.
To find out the circular shape, a constant is defined as
circular constant, Cc. It is expressed in (21). Image Capturing: RGB to Noise Noise
RGB image Grayscale level removal
(21)
Background color Background Grayscale
Where, A is the area and P is the perimeter of any object. Cc value Elimination to BW
can be calculated for any object from (21). It is apparent that,
Void
for a circle, Cc =1. Other than circle for any shape, the value of
Void Threshold Removal
Cc is less than 1. For different regular polygons, Cc is Alarm Showing
system Result level value
calculated and shown in Table III.
TABLE III
CIRCLE CONSTANT OF DIFFERENT REGULAR POLYGONS Perimeter
Circle calculation
Circle Constant Calculation Setting
Constant,
Sl Number of sides, N Circle Constant, Cc value on
Cc
1 3 0.6046 the image Area
calculation
2 4 0.7854 calculation
3 5 0.8648 Storing images in memory
4 6 0.9069
5 7 0.9319 Fig. 9 Simplified block diagram of the circular shape detection system.
6 8 0.9481
7 9 0.9591 Background color is automatically detected from the RGB
8 10 0.9669 image. A special algorithm is introduced here to detect
9 11 0.9727 background color. Then, it becomes a grayscale image of only
10 12 0.9770 object. In the RGB image, some void inside the object can be
produced or some dust outside object (noise) can be remained.
This grayscale image is transformed into black and white elements. One is center element and other 4 are neighbor
(BW) image. It can be easily done by transforming the pure element. In Fig. 11 (a), green color zero is the center element.
white color (value 255) into white (value 1) and gray or black If one center element is 0 and one neighbor element is 1 then
color (value 0 to 254) into black (value 0). Here, threshold 0 is marked with cyan color. If one center element is 0 and
value is 254. A noise level in size (such as 30X30 pixel) is two neighbor elements are 1 then 0 is marked with magenta
settled to remove noise from the image. If the size of noise is color. If one center element is 0 and three neighbor elements
less than noise level then it is removed from the grayscale are 1 then 0 is marked with yellow color. There is no
image. Void level is also settled to remove void from the condition like this, 4 neighbor elements are one and center
object. Void can also be produced inside object by element is zero. If one center element is 0 and four neighbor
background elimination process or grayscale conversion elements are 0 then centered 0 is marked with white color. It
process. Then if the void size is less than void level then that is shown in Fig. 11 (b).
void is removed. Thus the BW image of the object is 1 1 1 1 1 1 1 1 1 1 1 1 1 1
achieved. Here is no noise or void in the image. From this BW
1 0 0 1 0 1 1 1 0 0 1 0 1 1
image, the area and perimeter is calculated by using a fast
algorithm. It will be discussed later. Then circular constant, Cc 1 0 0 0 0 0 1 1 0 0 0 0 0 1
is calculated from area and perimeter. Value of Cc is settled on 1 1 1 0 0 0 1 1 1 1 0 0 0 1
the RGB image and result is shown in the monitor. The image 1 0 1 0 0 0 1 1 0 1 0 0 0 1
is stored in a memory location for further use. This is a
1 0 0 0 0 1 1 1 0 0 0 0 1 1
continuous process. If the value of Cc is near to one then the
shape of object is circular. Otherwise the shape of object is not 1 1 1 1 1 1 1 1 1 1 1 1 1 1
circular. Then the alarm system gives an alarm and stops the (a) (b)
process. All of these are shown in Fig. 9.
From the noise and void less BW image, area and perimeter Fig. 11 Area and perimeter calculation from binary matrix.
is calculated by a fast algorithm. It is explained here. In Fig. Now, the weight of white, cyan, magenta and yellow zero is
10 (a), the noise and void less BW image of a simple object is settled to 0, 1, 2 and 3 respectively. Now total weight is
shown. Perimeter is the length of red line bounded over the counted. From Fig. 11 (b), total weight is 28. Therefore,
object. It is shown in Fig. 10 (b). And area of the object is perimeter of the object will be 28p unit. Thus, perimeter is
covered by red line. calculated from binary matrix. Then finally circular constant,
Cc is calculated from area and perimeter. For this test object,
value of Cc is 0.3045. Therefore, from the value of Cc it is
apparent that this object is not circular.
Complete flow diagram of the system is shown in Fig. 12.
This is a continuous system. First RGB image of the object is
captured from a digital camera. Then this RGB image is
transformed into grayscale.

(a) (b)
1 1 1 1 1 1 1
1 0 0 1 0 1 1
1 0 0 0 0 0 1
1 1 1 0 0 0 1
1 0 1 0 0 0 1
1 0 0 0 0 1 1
1 1 1 1 1 1 1
(c) (d)

Fig. 10 BW image of a simple object and its binary matrix analysis.

In Fig. 10 (c), the BW image is divided into small pixels


and a binary matrix can be found from it. It is shown in Fig.
10 (d).
From the binary matrix, the area and the perimeter can be
calculated. Let the length of each side of pixel is p unit. Then
area of each pixel is p2 unit. If the number of zero in binary
matrix is n then area of the object will be np2 unit. From Fig.
10 (d), it is clear that number of zero is 19. Therefore, the area
of object is 19p2 unit. Thus, area is calculated from the binary
matrix. To calculate the perimeter, plus frame is moved from
first element to last element of binary matrix. Plus frame is
shown in Fig. 11 (a) by green line. Plus frame covers 5
Start start:
img_capture();
rgb_to_gray();
Image capturing from Camera
bg_remove(value);
gray_to_bw(value);
RGB to Grayscale while (noise)
remove(noise);
Background Elimination end while
while (void)
Grayscale to BW remove(void);
end while
calc_cc();
No if store();
if noise show();
void No exist if (cc<0.95)
exist Yes? alarm();
Yes
? Remove noise exit();
Remove void end if
goto start;
Calculation of Cc
Fig. 13 Algorithm of the circular object detection system.

Different stages of image processing are graphically


No if represented in Fig. 14 and Fig. 15. RGB image of the object
circle captured from the digital camera is shown in Fig. 14 (a). The
Alarm ? object is a blue color plastic plate. Some dust is shown in the
Yes up-right corner of the image. It becomes noise in the BW
Store result image. It should be removed from BW image before Cc
calculation. The RGB image is transformed into grayscale that
Show result is shown in Fig. 14 (b). The background information is
removed from it. It is shown in Fig. 14 (c). Background color
is detected from the RGB image. The color of the corner
Fig. 12 Flow diagram of the whole system. portion of RGB image is the background color. The average
value of the color at 4 corners is taken. Then the grayscale
From grayscale image, the background information is value is calculated by using (1). This grayscale value is
eliminated. Then, grayscale image is transformed into BW replaced by white color from the grayscale image. By this
image. If any noise exists in the BW image, noise is removed processing, sometimes void is created inside object. This
first. Then if any void exists inside the object, void is grayscale image is transformed into BW image. It is shown in
removed. Then it becomes a BW image of object only. No Fig. 14 (d). BW image contains noise and void inside the
noise, void or background information is present there. From object. Void can be created form the dazzling effect of camera
this BW image, circular constant, Cc is calculated. If the object lighting also.
is circular, then the result is stored in a memory location and
is shown in a monitor. Otherwise, an alarm system gives an
alarm and stops the process.
The algorithm of the circular shape detection system is
shown in Fig. 13. Here, if the circular constant, Cc of an object
is equal or above 0.95, then it is treated as circular. In
practical all the image is constituted by pixels, which are
square. Therefore, value of circular constant, Cc always be less
than 1. And for lighting, shadow, etc effect exact result is not
found. As a result, threshold value of Cc is taken as 0.95.
If the value of Cc always is less than 0.95 then it gives an
alarm and exit from the process. It is shown in algorithm.
Otherwise the process is started again.
Multi color object gives accurate result. The speed of the
system is independent of color. In the time of capturing image,
shadow effect should be removed. Therefore, uniform
arrangement of lighting is necessary. Otherwise shadow will
be considered as the part of object. And it gives error in result.

IV. RESULT AND DISCUSSION


A great care should be taken to set the background. From
(1), it is obviously true that different colors can have the same
grayscale value. Therefore, the object color can be overlapped
(a) (b) with the background color when transforming into grayscale.
In Fig. 16 (a), the color of object and the color of background
have the same value in grayscale. It is transformed into
grayscale and shown in Fig. 16 (b). Object and background is
totally overlapped with each other. Result will give error in
this circumstance. This can be tested by printing this page in
grayscale. Then Fig. 16 (a) will be as same as Fig. 16 (b) and
object can not be guessed from Fig 16 (a).

(c) (d)
Fig. 14 Different stages of image processing of the object.

Then noise is removed from the BW image. It is shown in


Fig. 15 (a). The void is then removed. It is shown in Fig. 15
(b). Now the image becomes fully BW image of the object
only. From this image binary matrix is achieved. From binary
(a) (b)
matrix, Cc is calculated. In Fig. 15 (c), small red circle at the
center represents the centroid of the object. Result is shown in Fig. 16 Background color can be overlapped with the color of objects in
Fig. 15 (d). grayscale image.

Therefore, a great care should be taken to set the


background. It is suggested to use black or white colored
plane as background. Grayscale value of black and white color
is 0 and 255 respectively. Other than black and white color,
grayscale value of any true color is between 1 and 254.
Therefore, it is not overlapped with background.
In Fig. 17 (a), black color is used as background. It is
transformed into grayscale and shown in Fig. 17 (b). Here
background color is not overlapped with object.

(a) (b)

(a) (b)
Fig. 17 Black background color never overlapped with colorful object.
(c) (d)
If color of object is white or light color then black color can
Fig. 15 Circle constant calculation from the image of object. be used as background. It will give better result. Otherwise, if
Accuracy of the system is mainly dependent on the color of object is black or dark color then white color can be
resolution of the image captured from the camera. With used as background. In maximum case, white color is used as
increase of resolution, speed of the system is decreased. background. In Fig. 18 (a), white color is used as background.
Because matrix size is increased with resolution of image and This image is transformed into grayscale and shown in Fig. 18
big size matrix takes long time for processing. Moreover, the (b). In this case, object is not overlapped with background in
increase of time for processing is almost linear with resolution grayscale image also. If object color is black and white like
of image. It is a great advantage. football then true color or gray color background will give
better result. Those grayscale values of true colors are shown. Cc of them is above 0.96. A small blue circle at the
between 100 and 150 will give better performance in this center represents the centroid of the object. Practically value
criterion. Multi color background should not be used. Also of Cc can not reach to 1. In Fig. 19 (d), an image of brick is
during image capturing, lighting should be uniform to ensure shown. It is also like an irregular hexagon. In Fig. 19 (e), a
same color of background everywhere. Coca Cola bottle cap is shown. It is circular but has some
spike at the surround. Its Cc is less than 0.90. From these
results, it can be concluded that the system gives the value of
Cc above 0.96 for circular shape. And for other object it is less
than 0.96. The value of threshold Cc is settled at 0.95.
The system is more accurate and reliable. Moreover, it
gives slight errors in practical. The value of some object is
measured in practical and is measured by the proposed
system. Both values are plotted in Fig. 20. The deviation
between them is very little. For better analysis, percentage

Cc calculation by proposed system


error is calculated.
(a) (b) 1.00

Fig. 18 White background color never overlapped with colorful object. 0.80
In Fig. 19, some images of real world objects are taken and
0.60
the result is shown there. An image of paper box is shown in
Fig. 19 (a). The perimeter is marked by blue line. It looks like 0.40 Series1
an irregular hexagon. Value of Cc is 0.841135. For regular
hexagon its value is 0.9069. It is shown in Table III. 0.20

0.00
0.00 0.20 0.40 0.60 0.80 1.00

Actual Cc in real measurement

Fig. 20 Deviation between actual Cc and measured Cc from the proposed


system.

Percentage error is plotted in Fig. 21. It shows the


maximum percentage error is about 4%. Errors can be
produced for some reasons. One of them is the shadow effect.
If the lighting is not uniform and shadow is produced. Then in
(a) (b) BW image, shadow is added with object. Then area and
perimeter of the object is changed. Therefore, it can not give
accurate result. Also sometimes light is reflected from the
object. Then that portion becomes white. It may be overlapped
with white background. For this dazzling effect, errors can be
occurred. In the time of image capturing, these effects should
be removed by using uniform lighting system.
10

6
4

(c) (d) 2
% error

-2
-4

-6
-8
-10

Fig. 21 Percentage error calculation for different objects.

Sometimes something is written in the object in white color


as same as Fig. 19 (e). This type of white content is
(e) (f) overlapped with white background. It causes a great void
inside object. It can cause an error. Therefore edge of the
Fig. 19 Circle constant is calculated for different real world objects. object is to detect. Then 100% void can be removed. If this
In Fig. 19 (b), a gold coin is shown. It is a circular object. phenomenon occurs in the edge then white content is mixed
Its Cc is 0.975595. Some error occurs from image processing. with background. It destroys the shape of the object.
In Fig. 19 (c), a disc is shown. And in Fig. 19(f), a ball is Therefore, a great attention is taken on edge detection of the
object.
V. CONCLUSIONS
Detection of circular object is very important in industrial
area and robotics. The proposed system can automatically
detect the background and the object from the image. The
accuracy is appreciable. Speed of the system is also good
enough. Analysis on some real world object is done and result
is satisfactory. It can also detect multicolor object and speed
of the system is not dependent on color of object. The
algorithm of the system is based on simple calculation. It
needs some addition and multiplication command. Simple
processor can be used to implement this system. Some real
world object is taken to measure the accuracy of the system.
Accuracy of the system is achieved above 96% from
experiment. This system can be implemented in biomedical
engineering area to detect cancer or damaged tissue. It is a
remote measurement system. Therefore, it has a great
application in astronomy and spacecraft. Implementation of
the system in robotics will be a great achievement. Finally it
can be concluded that the proposed system is more reliable,
speedy, efficient and accurate.

REFERENCES
[1] M.H.D.H. Tooei, J.R. Mianroodi, N. Norouzi and A. Khajooeizadeh,
“An innovative implementation of Circular Hough Transform using
eigenvalues of Covariance Matrix for detecting circles”, Proceedings
of the IEEE International Conference of the ELMAR, pp. 397 - 400,
September, 2011.
[2] M. Rizon, H. Yazid and Puteh Saad, “A comparison of circular object
detection using Hough transform and chord intersection”, Proceedings
of the Geometric Modeling and Imaging, (GMAI '07), pp. 115 - 120,
July, 2007.
[3] Lili Pan, Wen-Sheng Chu, J.M. Saragih, F. de la Torre and Mei Xie,
“Fast and Robust Circular Object Detection With Probabilistic
Pairwise Voting”, Proceedings of the Signal Processing Letters, IEEE,
vol. 18, issue. 11, pp. 639 - 642, November, 2011.
[4] Shi Yu, Wang Ran, Wang Guoyou and Li Xiuhua, “Accurate and
Robust Circular Object Detection Using Conditional Probability
Searching”, Proceedings of the IEEE International Conference on
Computer and Information Technology (CIT), pp. 1004 - 1010,
October, 2012.
[5] Shuai Zhang, Ze Zhang and Hai-tao Wang, “Research of Robot Color
Logo Orientation Based on Hough Transform”, Proceedings of the
International Conference on Intelligent Human-Machine Systems and
Cybernetics (IHMSC), pp. 56 - 60, August, 2010.
[6] H. Niigaki, J. Shimamura and M. Morimoto, “Circular object detection
based on separability and uniformity of feature distributions using
Bhattacharyya Coefficient”, Proceedings of the International
Conference on Pattern Recognition (ICPR), pp. 2009 - 2012,
November, 2012.
[7] Zhang Tao, Guo Junjie and Shi Enxiu, “An Algorithm for Fast Circular
Object Detection Based on Discrete Evolute Distribution”,
Proceedings of the International Symposium on Information Science
and Engineering (ISISE '08), pp. 321 - 324, December, 2008.
[8] Ping Wang, Zhiwei Li, Ruihua Xia and Wei Luo, “A method of quasi-
circular objects detection”, Proceedings of the International Congress
on Image and Signal Processing (CISP), pp. 1476 - 1479, October,
2011.
[9] Aijun Chen and Nan Liu, “Circular object detection with mathematical
morphology and geometric properties”, Proceedings of the
International Conference on Computer, Mechatronics, Control and
Electronic Engineering (CMCE), vol. 2, pp. 318 - 321, August, 2010.
[10] A. Tariq, M.U. Akram and M.Y. Javed, “Lung nodule detection in CT
images using neuro fuzzy classifier”, Proceedings of the IEEE Fourth
International Workshop on Computational Intelligence in Medical
Imaging (CIMI), pp. 49 - 53, April, 2013.
[11] Wonil Chang and Soo-Young Lee, “Description of shape patterns
using circular arcs for object detection”, Proceedings of the Computer
Vision, IET, vol. 7, issue. 2, pp. 90 - 104, April, 2013.

You might also like