Point Search Circle Detection (PSCD) Algorithm is
one of circle shape recognition methods, which introduced in the
field of pattern recognition and digital image processing. Because
of PSCD has some weakness points, therefore this paper aims to
determine the weakness points of PSCD and find solution for
these points, furthermore adding enhancements to the algorithm
and adding ellipse shape recognition algorithm to the recognition
process of the PSCD.
The improved algorithm is applied on image contains circle and
ellipse shapes. The recognition results were finding center of each
shape and its radius for circle shape and both radiuses for ellipse
shape, MATLAB is used to conduct the improved algorithm.
Improve Point Search Algorithm Detect Circles Ellipses
1. Improvement And Enhancement Point Search
Algorithm
Sundus Khaleel Ebraheem
Dept. of Computer Sciences
College of Computer Sciences and Mathematics,
Mosul University, Mosul, Iraq
sunduskhaleel@yahoo.com
Eman Abdulaziz
Dept. of Computer Sciences
College of Computer Sciences and Mathematics
Mosul University, Mosul, Iraq
emanazz@yahoo.com
Abstract— Point Search Circle Detection (PSCD) Algorithm is
one of circle shape recognition methods, which introduced in the
field of pattern recognition and digital image processing. Because
of PSCD has some weakness points, therefore this paper aims to
determine the weakness points of PSCD and find solution for
these points, furthermore adding enhancements to the algorithm
and adding ellipse shape recognition algorithm to the recognition
process of the PSCD.
The improved algorithm is applied on image contains circle and
ellipse shapes. The recognition results were finding center of each
shape and its radius for circle shape and both radiuses for ellipse
shape, MATLAB is used to conduct the improved algorithm.
Keywords- Image processing, Pattern recognition, Computer
vision, Cicrle recognition, Elippse recognition, Cicrle detection,
Elippse detection.
I. INTRODUCTION
They say "Image speaks thousands of words"; starting from
this common sentence, it can say that the computer vision and
image processing started to drive best techniques, to get
different scenes for same image to help us to see its contents,
meaning and denotations. Although image processing is not
rival or emulate the accuracy of human eye yet, but it may able
us to convert the images to mathematics operation to get
information as much as possible from the image.
So, image processing is one of subjects that got great
attention, where expand got variety of applications. Image
processing now becomes the most important and the major
spread applications of computer because it uses in different
fields and not confined in processing personal photograph but it
extended to sciences field such as processing medical images,
producing films, remote sensing and monitoring
applications [1]. As well as to enhance the images to facilitate
its interpretation, understanding and image data processing to
store it on different storage media speedy and fewer size to
automate the realization of images [2]. The more important
application in the medical field is detection and prediction
cancer diseases.
Where it is possible now diagnosis the cancerous cells by
using computer or detects the disease type from X-ray or
others. Due to all that a wide attention gave to the digital image
processing [1]. Where image processing and enhancing is the
more important thing that computer presents to the image [3].
There are several projects or researches which employ the
digits recognition idea in the several fields, in 2000, Rodolfo
and Stefano presented a method based on vector quantization
(VQ) to process vehicle images. This method makes it possible
to perform superior picture compression for archival purposes
and to support effective location at the same time [3].
It can define any image as two dimensional function f(x, y),
where x and y are plane dimensional. The image stored
digitally in the computer as a matrix of two dimensional pixels
(while in colored image each pixel has three value to represent
the colors RGB which there value ranges between 0, 255 and it
has value equal to zero or one in black and white images).
Therefore the digital image is consisting of limited component,
each called image elements or pixels [4].
II. IMAGE ANALYSIS STAGES
Image analysis process has many stages as
follows [4][5][6]:
• Image acquisition: this stage involves picture capturing
through photo sensor (e.g. camera, laser sensor,
scanner…etc).
• Preprocessing stage: it is a set of processes that prepares
the data for analysis and to manage the errors. The
techniques used in this stage differ according to type of
information that needs to be extracted from the image and
enhancement processes related to the data type that
managed.
• Segmentation: in this stage the image is divided to many
zones or elements. This stage can be describe as processes
that its input is an image and its output is the important
elements in the image.
• Features extraction: in this stage the important
information extracted from the image.
• Classification: this stage involves pattern recognition and
classifies the patterns that extracted from the previous
stage.
International Journal of Computer Science and Information Security (IJCSIS),
Vol. 15, No. 8, August 2017
294 https://sites.google.com/site/ijcsis/
ISSN 1947-5500
2. III. RELATED WORKS
There are many methods to recognize the shapes, belong
these methods, the methods of recognize the circular shapes.
These methods may be suitable for some kinds of images, and
there is no general recognition technique that can be used for
all type of images. Recognition methods and segmentation are
suitable for application that needs automatic image analysis and
involves some of intelligent. Researchers work on this field and
they are still. In view of importance, circle detection to
determine the goals in the images. In 2010 Ebraheem proposed
a new method which was Point Search (PS) to recognize the
circular shapes [7], the researcher approved the efficiency of
this method to fast recognize the separated and interlocked
circles regardless with its number by comparing the method
with common available methods such as Hough method. In the
same year Ebraheem [8] used the PS algorithm to find the
index light point to find the object dimensions in the digital
images. In 2014 Ebraheem et. al. [9] used efficiently the PS
method to recognize the green light points to find the object
area by using digital images. In 2016 [10] PS method improved
to find the amount of the material in the images and to find
efficiently the object area and its position by using digital
images.
For the importance of using circular and elliptical shapes to
determine the locations e.g. medical checkups, determine the
eye border, recognition traffic signs and in the study of
cells…etc. therefore this paper aims to enhance and develop the
PS algorithm by detecting the weakness points of algorithm
and treating them as well as adding elliptic shape detection to
develop the algorithm.
IV. IMPROVED POINT SEARCH ALGORITHM(PSA)
To extract features from digital images it is necessary to
have ability to detect some basic shapes (like: straight lines,
circles and ellipses), to do this it should at first detect some
points located on the shape circumference.
In this paper PSA used to detect circles and its weakness
points is treated to enhance it and to able it to detect elliptic
shapes in addition to circles. So this item declares the steps of
enhanced algorithm at first weakness points of the old
algorithm declared, then the treatment of the weakness points.
Lastly the enhanced algorithm steps are declared as follows:
A. Weakness Points Of The PSA
Although the algorithm is very efficient for detection of
circle but yet it has the following some weakness points:
1) Inspection point: due to noise the first point detected and
considered as inspection point on the circle ( it assumed to
locate on the same column of the center) this point may
represents by many pixels on the same row, therefore it will
leads to an error to determine the point that is on the same
column with circle center. See Fig.1 the points with red
color are possible inspection points but the old algorithm
considered the first point as inspection point (x, y), while
due to noise there are five points each of the them may be
inspection point in the figure.
2) Supposed circle circumference points: because it depend
on circle equation to find the circumference points of
supposed circle in the old search point algorithm, the
number of points is fixed for the supposed circle which will
compare with it. So the number of points of the supposed
typical circle template is constant regardless the size of the
actual circle size in the image, therefore the points will
scatter on the circle circumference in the image if the circle
size is big, while if the circle is very small these points will
repeated on the circumference, that means increase the run
time.
3) The old search point algorithm cannot recognize ellipse.
B. Treatment Of Weakness Points Of PSA
1) Finding inspection point accurately: to solve the first
problem of more than one point on the same row due to
noise, consider the midst point of these points which are on
the same row. See Fig. 2, where (a) represents image data
matrix and (col) represents the column number in the
image, (x, y) are coordinates of the first point (inspection
point previously), ynew
represents the new correct position
for inspection point.
Function ynew
=find_line(a, col, x, y)
Z=a(x, y:col);
C=find(Z==0, 1);
ynew
=round(C/2)-1;
End
2) Supposed circle circumference points: this problem solved
by using Midpoint. The algorithm Midpoint draws the
circle starting from each (0°, 90°, 180°, 270°) and extends
until reach the nearest multiple of 45° where y = x, during
International Journal of Computer Science and Information Security (IJCSIS),
Vol. 15, No. 8, Augus 2017
295 https://sites.google.com/site/ijcsis/
ISSN 1947-5500
3. this extending y does not repeat nor skip any y value.
Therefore in the while loop y increments by 1 and x
decrements by 1, until reaching at 45° then this changes
because the tangent is rise=run, where rise>run before each
45° and rise < run after it[11]. See Fig.3.
3) Ellipse: Midpoint algorithm used to draw the ellipse to
create the supposed template for the ellipse to detect this
shape in the image. Assume an ellipse center located at the
origin and its axis parallel to x and y axis then the equation
of this ellipse will be [12]:
Where a and b are the major and minor radiuses, f is equal
to zero if a point is located on the ellipse circumference.
The slope of the ellipse circumference at any point is given
below:
To draw the ellipse it can scan only one-fourth of the
ellipse, where for each (x, y) scanned it can draw (x, y), (-x,
y), (-x, -y), and (x, -y).
Starting from the top of ellipse which is point (0, b), the
slop is initially less than one, therefore x will be increment.
For the next x, use f to determine whether to increment y or
not. Thus, continue with this procedure until reach the
location that f is greater than one. Then change the rolls of
x and y until y=0.
C. Midpoint Algorithm To Draw The Circle Template
The following steps are midpoint algorithm steps:
1- Enter the values of the circle radius (r) and coordinate
of center point (xc, yc).
2- Give initial values for x and y as coordinate for
starting point to draw the circle template which its
center (xc, yc), where (x, y)=(0, r).
3- Calculate the initial value for d1 from the equation:
d1 =1-r
4- Compare between x and y, if x less than y then
continue, else go to step 8.
5- Increment x by one.
6- If (x <0) then
d=x+2*x+1
Else decrement y by one
d=x+2*x-2*y+1
7- Find other symmetric points for the circle:
(xc+xc, y+yc), (y+xc, x+yc), (y+xc, -x+yc), (x+xc, -
y+yc), (-xc+xc, -y+yc), (-y+xc, -x+xc), (-y+xc,
x+yc), (-x+xc, y+yc),
8- Go to step 4.
9- End .
D. Midpoint Algorithm To Draw The Ellipse Template
To apply this algorithm it should give the value of center
(xc, yc) and both horizontal and vertical radius a and b, then
apply the following steps:
1- Begin
2- Give initial values (0, b) to (x, y).
3- d1=b2-(a2b) + (0.25 a2)
4- If (a2(y-0.5)>b2(x+1)) and (d1 >0) then
d1=d1+b2(2x+3)+a2(-2y+2)
Decrement y by one.
Increment x by one.
Else d2=b2(x+0.5)2+a2(y-1)2-a2b2
5- If y>0 and d2<0 then
d2=d2+b2 (2x+2) +a2 (-2y+3)
increment x value by one.
Else d2=d2+a2(-2y+3)
Decrement y by one.
6- Find other symmetric points for the circle:
(xc+xc, y+yc), (y+xc, x+yc), (y+xc, -x+yc), (x+xc, -
y+yc), (-xc+xc, -y+yc), (-y+xc, -x+xc), (-y+xc, x+yc),
(-x+xc, y+yc)
7- End .
E. Improved PSA Stages
The improved algorithm involves three main stages which
are: preprocessing, circle detection and ellipse detection, as
shown in the block diagram in Fig. 4.
Figure 4. General block diagram for improved PSA.
The detailed steps for each stage of the improved PSA are:
1- Begin
2- Read the image
3- Preprocessing and Normalization
4- The Preprocessing and Normalization steps are:
International Journal of Computer Science and Information Security (IJCSIS),
Vol. 15, No. 8, Augus 2017
296 https://sites.google.com/site/ijcsis/
ISSN 1947-5500
4. Step 1: Converting to Gray scale from RGB.
Step 2: Resizing the image to 512 x 512.
Step 3: Histogram Equalization.
Step 4: Gaussian Filtering.
Step 5: Canny Edge detection.
5- Circle detection:
Circle detection steps are:
Step 1: Begin horizontally scanning from highest
left point for the binary image which
resulted from previous stage to find the
continuous adjacent point on same row.
Step 2: Find the correct inspection point (midst
point) which lies on the circle
circumference and consider it as P1(x1, y1)
else go to step (12).
Step 3: Start from the inspection point P1(x1, y1)
begin the vertical scanning to find the
second point and consider it as P2(x2, y2)
else go to step1. See figure (5).
Figure 5. Position of P1, P2, P3 and P4.
Step 4: Find the distance (d) between points (P1 &
P2) by using the following equation:
d = ²y2)-(y1²x2)-(x1 +
Step 5: Find the radius (r).
r = d/2.
Step 6: Find the coordinates for the center C (xc, yc)
of the shape.
If P1 and P2 located on the same column, thus
y1 and y2 are equal, then:
xc=x1+r.
yc=y1.
If P1 and P2 located on the same row, thus
x1 and x2 are equal, then:
xc=x1.
yc=y1+r.
Step 7: Start scan to find P3 (xc-r, yc) and P4 (xc+r,
yc), continue if one or both of them exist.
Else remove P2 and go to step 2 to resume
vertical scanning.
Step 8: Create template for the supposed shape
depending on P1 and P2 by using
Mid Point algorithm.
Step 9: Matching the supposed template with the
shape in the image. If the matching
percentage equal or greater than 50% then
consider these points as actual points exists
in the image and store the diameter of the
shape and center coordinates in the file. But
if matching is less than 50% neglect P2 and
resume vertically scanning to find another
point to consider it as P2 instead of the
previous.
Step10: If the matching occurs, remove the detected
shape to reduce the execution time.
Step11: Go to step1 and repeat the algorithm steps on
the new image produced after removing the
detected shape to find other shape if exist.
Step12: End.
6- To detect the ellipse same algorithm steps in the (5)
will be applied (to find major radius). Adding
additional steps to find d2 which represent the second
diameter for the ellipse. Depending on d2 find second
radius (r2) (minor axis radius), where: r2=d2/2 and
find P3 and P4.
7- Store data (radius and center coordinates) in the file.
V. APPLICATION
In this section preprocessing steps declared to produce the
binary image which will be used with improved PSA and final
file is declared too. See table (1).
International Journal of Computer Science and Information Security (IJCSIS),
Vol. 15, No. 8, Augus 2017
297 https://sites.google.com/site/ijcsis/
ISSN 1947-5500
5. TABLE I. EXAMPLES EXPLAIN THE STAGES OF IMPROVED PSA.
VI. CONCLUSIONS
• Improved PSA is efficient and accurate for circle and
ellipse recognition.
• Determining the inspection point accurately (by taking the
midst point for the point located continuously on the same
row) reduced the possibility of consider other points as
inspection point for other shape and reduced the reaching
fault shapes from beginning that means reducing execution
time and finding shapes accurately.
• Using Midpoint algorithm to create supposed template
makes the number of points of template approximately
equal to shape in the image. Therefore the problem of
shape size (small or big) dominated, that means the points
for big shape is more than for small shape.
• Noise that may be existed in the image like random points
or other shapes do not effect on this algorithm.
• This algorithm can be used in the beauty salon to change
the color of eye image to choose the suitable color for the
customer.
ACKNOWLEDGMENT
Our thanks to the journal staff for their patience and
cooperation.
REFERENCES
[1] Shaaban, Rustum Muhammad, (2008), "Digital Image Processing
Basics", Kutub journal. www.kutub.info_2866 update:6/8/2011..
[2] Xueyong Li, Changhou Lu, Jianchuan Zhang, Rujing Xiao, Jie Ding,
“An image acquisition method for raised characters based on laser
vision technology”, Optics and Lasers in Engineering, Vol. 51, Issue 2,
2013, pp: 148–158.
[3] Hirz Allah, Nael and Althamen, Dima, Multimedia, King Abdul-Aziz
university, Dar Wael, Central Library 2008.
[4] Beng; Kim, Jaihie, "Extraction and fusion of partial face features for
cancelable identity verification", Pattern Recognition, Vol.45, Issue9,
2012, pp:3288-3303.
[5] Pakhira, Malay K., "Computer Graphics, Multimedia and Animation",
2nd
, 2010.
[6] Ruaa Moayad Elyass Baker, "Android Based Image Registration
System using Features Extraction" , M.Sc.Thesis , Computer Sciences,
university of Mosul, 2015.
[7] Ebraheem, S., K."A suggest Point Search Algorithm For Circle
Detection In Binary Image", AL-Rafidain Journal Of Computer Science
And Mathematics, Vol 7, No 2, 2010.
Input Eye Image
Image After Gray
Conversion'
Image After
Resize
Image After
Histogram
Equalization
Image After Canny
Edge Detection
(Input Image To
Improved PSA)
Produced File After
Applying Improved PSA
Circle:
Xc Yc radius
262 241 53
263 240 182
Ellipse
Xc Yc radius1 radius2
286 163 20 39
Circle:
Xc Yc radius
259 260 79
Ellipse
Xc Yc radius1 radius2
285 280 144 129
Circle:
Xc Yc radius
194 115 30
209 266 23
373 352 29
138 428 30
Ellipse
Xc yc radius1 radius2
0 0 0 0
International Journal of Computer Science and Information Security (IJCSIS),
Vol. 15, No. 8, Augus 2017
298 https://sites.google.com/site/ijcsis/
ISSN 1947-5500
6. [8] Sundus Khaleel Ebraheem, "Using index light points to determine
object dimensions in the digital images, "AL-Rafidain Journal of
Computer Science and Mathematics, Vol. 7, No. 3, 2010, pp.135-162.
[9] Sundus Khaleel Ebraheem, Yahya Hussain AL-Hussainy, Wissam Saad
Al-Moula, " Using Digital Images to Perform Measuring Of Material's
Amount for Buildings in Civil Engineering Field", Proceeding of the
1st International Engineering Conference On Department In Civil &
Computer Engineering Applications IEC2014, Isik University, Erbil,
KRG, Iraq. November 2014, pp 162-169.
[10] Sundus Khaleel Ebraheem, " Perform Measuring By Using Image
Processing", International Journal of Informatics and Communication
Technology (IJ-ICT) Vol.5, No.1, July 2016, ISSN: 2252-8776.
[11] Ostoji, Nedeljko and Star-evi, Du, "optimization of the raster-scan
circle-Drawing algorithm based on predicate transeformers", Yugoslav
journal of Operations Research 10, No.2, 2000, pp217-234.
[12] Kenneth H. Carpenter, " The Midpoint Ellipse Algorithm", Department
of Electrical and Computer Engineering, Kansas State University 1994.
www.ece.kstate.edu/people/faculty/carpenter/documents/midellipr, pdf.
Access date 17/7/2017.
International Journal of Computer Science and Information Security (IJCSIS),
Vol. 15, No. 8, Augus 2017
299 https://sites.google.com/site/ijcsis/
ISSN 1947-5500