Implementation of a Fast and Accurate Algorithm for Circular Object Detection
Implementation of a Fast and Accurate Algorithm for Circular Object Detection
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
(8)
(10)
(7) Fig. 4 Value of area ratio constant is calculated for different types of regular
polygons.
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
p
C
C
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
(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)
(c) (d)
Fig. 14 Different stages of image processing of the 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
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
6
4
(c) (d) 2
% error
-2
-4
-6
-8
-10
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.