2013 International Conference of Information and Communication Technology (ICoICT)
Arabic Character Segmenta
ation Using Projection-Based Approach
h with Profile's
Amplitude Filter
Mahmoud A. A. Mousa
Dept. of Computer and Systems Engin
Zagazig University, Zagazig, Egy
neering,
ypt
Mohammed S. Sayed and Mah
Dept. of Electronics and Communi
Zagazig University, Zaga
[email protected], mabdal
hmoud I. Abdalla
cations Engineering,
azig, Egypt
Abstract—Arabic is one of the languages th
challenges to Optical character recognition (
challenge in Arabic is that it is mostly curs
segmentation process must be carried out
character’s start and end. This step is essen
recognition. This
presents Ar
segmentation algorithm. The proposed alg
projection-based approach concepts to separ
and characters. This is done using profile's
and simple edge tool to find characters
algorithm shows promising performance w
different printed documents with different Ar
hat present special
(OCR). The main
sive. Therefore, a
to determine the
ntial for character
rabic
character
gorithm uses the
rate lines, words,
s amplitude filter
separations. Our
when applied on
rabic fonts.
paper
Keywords—Character Segmentation, Ara
abic Text OCR,
r
Projection-Based Approach, Amplitude Filter
I.
INTRODUCTION
Optical character recognition (OCR) is a
image recognition that studies automatic
done by taking an image of text writte
language to be understood by the computer
computer representation for this text. OCR
vary according to the language which will b
and the application in which this techniqu
The ultimate goal of OCR is to imitate the
read at a much faster rate by associating sy
with images of characters.
an application for
reading. This is
en in a specific
and get the final
R techniques may
be used, its nature
ue is applied [1].
human ability to
ymbolic identities
Arabic is one of the languages that
challenges to OCR. The main challenge in A
mostly cursive. Arabic is written by conn
together to produce words or parts of words
1. Arabic text is written from right to left.
has 28 basic characters, of which 16 have f
dots.
t present special
Arabic is that it is
necting characters
s as shown in Fig.
Arabic language
from one to three
Figure 1. The characters connectivity of Ar
Arabic text.
Arabic characters have many shapes an
on their position in the word. For examp
"noon" is written in the form of "ـﻧ" at the
middle, and "ﻦـ" at the end of a word but th
of this character is "ن". The shape and th
nd depend mainly
ple, the character
e start, "ـﻨـ" at the
he separated form
he size of Arabic
978-1-4673-4992-5/13/$26.00 ©2013 IEEE
122
Advertisement
characters vary with respect to their
this is a great challenge in Arabic tex
Because of the different nat
characters may overlap vertical
compounds of characters at certain
word segments such as "ـﺤﻣ , ﺣﻤـ
represented by single atomic grap
Traditional Arabic font for examp
graphemes, and another common
fewer ligatures) like Simplified Ara
graphemes [1, 17, 18].
r position in the word and
xt [1].
ture Arabic text fonts,
lly
to produce certain
n positions of the Arabic
ﺣ , ـﺠﻧ " which can be
phemes called ligatures.
ple contains around 220
less involved font (with
abic contains around 151
Some Arabic characters have si
ب" and another characters have dou
and other characters have triple do
doted characters exhibit a big
processed.
ingle dot such as "ج , ن ,
uble dots such as "ـﻳ , ـﺗ"
ـﺷ ". The
ots such as "ـﺛ ,
problem while being
This paper presents Arabic
algorithm. The proposed algorithm
approach concepts to separate line
using profile's amplitude filter and s
of the paper is organized as foll
different segmentation techniques.
proposed algorithm. Section 4 dem
performance analysis. Section 5 con
character segmentation
uses the projection-based
es, word, and characters
simple edge tool. The rest
lows: Section 2 reviews
Section 3 presents the
monstrates the results and
ncludes this paper.
II. SEGMENTATION
TECHNIQUES
In this part, methods of how to
contains Arabic text into characte
three seg
This
is done using
segmentation, word
segmenta
segmentation.
o convert the image that
er images are discussed.
line
gmentation stages:
character
ation,
and
A. Line segmentation approaches:
Projection-based approach; in w
being summed along the horizontal
this is referred as a horizontal proje
along the vertical axis for each x val
image and this is called vertical pro
18].
which pixels of image are
axis for each y value and
ection [2-5, 10,14-18 ] or
lue on the segmented line
ojection [2, 3, 12, 13, 14-
Smearing approach; in which
along the horizontal direction are
between the white space is calcula
within a predefined threshold, it is
The text lines are bounded with co
pixels [6, 10, 11].
consecutive black pixels
e smeared. The distance
ated. If the distance lies
filled with black pixels.
onnected shapes of black
Grouping approach; in which
constructed by grouping neighborin
text lines are iteratively
ng connected components
2013 International Conference of Information and Communication Technology (ICoICT)
This profile has information about the text lines that are
indicated by the regions with the black intensities as in Fig.
2. On the other hand, the blank lines appear as a drop in the
black intensities. The text lines can be extracted by
comparing the profile with a pre-defined threshold and this
Advertisement
can be achieved by performing the algorithm described in
Fig. 3.
Fig. 3 shows the line segmentation algorithm that accepts
an image written in Arabic and extracts its lines. This is done
using the horizontal axis profile on two stages. The first one
is to locate each connected group of dark regions in the
profile. The other one is to decide which dark region(s) can
be considered as a separate line.
Figure 2. Horizontal axis profile for a sample image with different
fonts and different word size.
Figure 3. Line segmentation algorithm.
based on certain perceptual criteria such as similarity,
continuity and proximity [7, 10].
Hough-based approach in which the Hough transform is
used for locating straight lines in text images [8-10].
B. Word and character segmentation approaches:
There are four main approaches that deal with connected
characters in an Arabic word [1].
a. Assuming that the input is already segmented into
characters (i.e., no character segmentation will be
needed).
b. Segmenting input words into primitives smaller
than a character then collecting each group of
primitives into character while being recognized.
c. Segmenting words into characters. This is the most
difficult approach in cursive nature languages.
d. Recognizing input words, as a whole, with no
segmentation.
C. Histogram-based Algorithms
Several algorithms use histogram-based techniques for
OCR in different languages. None of these algorithms solved
all the problems associated with OCR in Arabic language. In
Telugu script, the text document image may contain
overlapped lines and characters and no cursive nature
between characters [15,21]. Devnagari is used for writing
Hindi, Marathi, Sanskrit and Nepali languages. Characters
may be separate or connected with a horizontal line at the
upper part, known as Shirorekha and no overlapping
challenge considered [16]. Only line and connected parts
segmentation is performed on Arabic language and the main
difficult in Arabic language, which is to separate characters
and this, is not considered in [20].
III. THE PROPOSED ALGORITHM
text
This paper concerned with segmentation procedure that
accepts an Arabic
image and outputs separated
characters. It has three stages. The first one is responsible for
detecting and separating lines in the text. The segmented
lines are then passed throw the second stage which is
designed to get words from text lines. Finally, the third stage
takes those words and produces the character representation
of each word. The proposed algorithm considers the cursive
and the partially overlapping natures between characters .A
pre-stage is used for detecting and correcting the skew for
the scanned text image. The algorithm in [19] is used to
perform the skew angle correction.
A. Line segmentation:
Line segmentation is done using Image Axis Profile
method that calculates the horizontal axis profile for the
binarized text image [10]. The horizontal axis profile matrix
(cid:1835)(cid:3037) is calculated by summing pixels values P(i,j) along the X-
axis for each y value as shown in (1).
(cid:2919)(cid:2880)(cid:2924)
I(cid:2920) (cid:3404) (cid:3533)(cid:3435)255 (cid:3398) P(cid:4666)i, j(cid:4667)(cid:3439)
(cid:4666)1(cid:4667)
(cid:2919)(cid:2880)(cid:2868)
where i, j are X and Y - axis indices respectively, n = X-
resolution.
978-1-4673-4992-5/13/$26.00 ©2013 IEEE
123
2013 International Conference of Information and Communication Technology (ICoICT)
B. Word segmentation:
Fig. 4 shows an Arabic text line image and its
corresponding vertical profile. The text line is segmented,
beginning from the left side to the right, into connected parts.
These connected parts are clustered to the corresponding
word. The algorithm in explained in Fig. 5. Each word is an
input image to the character segmentation stage.
Figure 4. A test sample for the word segmentation algorithm
Figure 5. Word parts segmentation algorithm
C. Character segmentation:
Character segmentation process is the most important one
in the OCR system, because character will be then entered to
the recognition stage so it should be correctly separated with
no error to be recognized correctly. As shown in Fig. 6, the
text word/sub-word image is entered to the character
segmentation
the base-line
coordinates for each text line image as shown in Fig. 2,
which is in red color. The base-line is the space around the
maximum value in the horizontal profile [12, 15, 17].
stage which
calculates
978-1-4673-4992-5/13/$26.00 ©2013 IEEE
124
Figure 6. The character segmentation algorithm
The proposed algorithm mainly depends on the vertical
Advertisement
profile and its dc components that correspond to connections
between two characters. So, the existence of Hamza of Alif
character such as أ , إ , ﻹ , points of the characters such as ـﻧ ,
ـﺗ , ـﺛ , ـﺷ and all other characters that have points above or
under the character shape may produce errors in our
technique, so another no-points and Hamza image is to be
constructed from the previous word image . The method of
locating points and Hamza is to locate connected group of
dark pixels. The points and Hamza are small connected areas
above or under the baseline. So, they can be erased
successfully as shown in Fig. 7.
By constructing the vertical profile for the no points word
image. The separation between two characters is considered
as constant amplitude in the profile. A constant amplitude
(low variation) passing filter is designed so that only low
variations in the profile will be passed. The filter's output
pulses are a locus of the characters connections. This locus
takes the shape of separated sequential train of pulses as
shown in Fig. 7.
2013 International Conference of Information and Communication Technology (ICoICT)
the green color lines for the original image with points and
Hamza.
Figure 7. A test sample for the character segmentation algorithm
Each pulse in the locus shape will be checked to
determine whether it is a correct characters connection or
not. This is done by using the simple edge tool which finds
step edges along an array of pixel coordinates. This tool
returns the coordinates of all the edges found. If there is only
two edges and the coordinates of these edges lie within the
base-line coordinates, then this pulse is considered as a
character connector as shown in Fig. 7.
To calculate the base-line coordinates, the vertical index
corresponding to the maximum peek in the horizontal axis
profile (cid:1848)-(cid:1861)(cid:1866)(cid:1856)(cid:3040)(cid:3028)(cid:3051) is calculated for each text line generated
from the line segmentation stage as shown in (3).
(cid:1848)-(cid:1861)(cid:1866)(cid:1856)(cid:3040)(cid:3028)(cid:3051) (cid:3404) (cid:1835)(cid:1866)(cid:1856)(cid:1857)(cid:1876)(cid:1841)(cid:1858)(cid:4666)max(cid:4666)(cid:1835)(cid:4667)(cid:4667) (cid:4666)3(cid:4667)
This value is bounded by two lines which are the base line
coordinates as shown in Fig. 2.
An image cutter tool is used on the original text image to
extract sub-images which correspond to each pulse in the
filter response. Each sub-image is extracted vertically
starting from the first index to the last index of each pulse. A
horizontal axis profile is calculated for each sub-image. If the
output of the horizontal axis profile takes the shape of one
pulse with constant amplitude and the vertical index
(cid:1848)-(cid:1861)(cid:1866)(cid:1856)(cid:3040)(cid:3028)(cid:3051) lies inside this pulse, then the pulse coordinates
are considered as the base line coordinates.
Fig. 8 shows a word, its filter output, and the horizontal
axis profile for each sub-image corresponds to each pulse in
the filter output. The vertical index for the second line in Fig.
2 is (cid:1848)-(cid:1861)(cid:1866)(cid:1856)(cid:3040)(cid:3028)(cid:3051) (cid:3404) 29. Hence, the first vertical pulse in Fig. 8
is refused because it gives a horizontal profile from 36 to 41,
which is away from (cid:1848)-(cid:1861)(cid:1866)(cid:1856)(cid:3040)(cid:3028)(cid:3051). The second vertical pulse is
accepted because the vertical index (cid:1848)-(cid:1861)(cid:1866)(cid:1856)(cid:3040)(cid:3028)(cid:3051) lies inside its
horizontal profile (i.e. from 28 to 32). The third vertical
pulse is refused as it gives more than one pulse in its
horizontal axis profile.
Fig. 7 shows the original test images, the no point
images, and output of the low variation passing filter whose
input is the no-point vertical profile for the word. For the
pervious algorithm, only pulses pass are those which marked
with a green line. Character separation operation is done at
978-1-4673-4992-5/13/$26.00 ©2013 IEEE
125
Figure 8. A word with its filter output and the horizontal axis profile for
each sub-image corresponds to each pulse
The character (ر) may overlap in many fonts with the
remaining part of the word. This represents a challenge when
separating the word into connected parts. The proposed
algorithm locate these connected parts as well as points and
Hamza overcoming the problem of separating partially
overlapped characters in [15] as shown in Fig. 9.
Figure 9. Samples with different font and size
IV. RESULTS AND PERFORMANCE EVALUATION
Test operation is done on a document (264 pages, 6,286
lines, 50,931 words, 224,781 characters with no spaces,
275,136 characters with spaces). The line segmentation
algorithm achieved a very large correction ratio that reaches
99.9%. One error is found in the test when dealing with a
group of text lines bounded by a text box. All these lines and
the text box are treated as a single line and this happened
because of the continuity of the text box.
2013 International Conference of Information and Communication Technology (ICoICT)
The word segmentation algorithm achieved a correction
ratio of approximately 99.9%. One error appeared when
dealing with marks such as exclamation, question, comma,
and semicolon. When writing those marks directly after the
word with no separation space (e.g. ؟اذﺎﻣ , ﻰﺘﻣ
), the algorithm
gives an indication that those marks belong to the same
pervious word cluster number as the space between them is
in sufficient to decide that the mark is another word.
!
The character segmentation algorithm achieved also an
acceptable correction ratio that reaches 98%. This algorithm
deals with the compounded characters as a separate character
(e.g. ـﺤﻣ , ـﺠﻧ). These compounded characters will be dealt
with in the recognition stage. This makes the alphabetic
Advertisement
Arabic language equal to 28 basic characters plus 220
compounded characters.
V. CONCLUSION
This paper presents Arabic character segmentation
algorithm. The proposed algorithm uses the projection-based
approach concepts to separate lines, words, and characters.
The lines produced from the line segmentation stage are
entered to the next one which segments them to connected
parts. These connected parts may be separate characters or a
number of connected characters. Those connected characters
are entered then to the character segmentation stage that is
responsible for separating these connected characters. The
proposed algorithm achieved a promising success rate ratio
for line, word and character segmentation.
REFERENCES
[1] B. Al-Badr and S. A. Mahmoud, “Survey and Bibliography of Arabic
Optical Text Recognition,” Elsevier Signal Processing, vol. 41, pp.
49-77, 1995.
[2] K. Bouhilali, M. Kamrouni, and N. Ellouze, “Method
of
Segmentation of Arabic Text Image into Characters,” Kuwaiti
Computer Conferance, pp. 442-446, 1989.
[3] M. Attia and M. El-Mahallawy, “Histogram-Based Lines and Words
Decomposition for Arabic Omni Font-Written OCR Systems;
International Conference on
Enhancements and Evaluation,”
Computer Analysis of Images and Patterns , pp. 522-530, 2007.
[4] Z. Razak, K. Zulkiflee, M. Y. I. Idris, E. M. Tamil, M. Noorzaily, M.
Noor, R. Salleh, M. Yaakob, Z. M. Yusof, and M. Yaacob, “Off-line
Handwriting Text Line Segmentation : A Review,” International
Journal of Computer Science and Network Security, vol. 8, no. 7,
2008.
[5] G. Tímár, K. Karacs, and Cs. Rekeczky, “Analogic Preprocessing and
Segmentation Algorithms For Offline Handwriting Recognition,” in
Proc. of the 7th IEEE International Workshop on Cellular Neural
Networks and their Applications, pp.407-414, 2002.
[6] Y. Li, Y. Zheng, D. Doermann, and S. Jaeger, “A new Algorithm for
Detecting Text Line in Handwritten Documents,” International
Workshop on Frontiers in Handwriting Recognition, pp. 35-40, 2006.
[7] M. Feldbach and K. D. Tönnies, “Line Detection and Segmentation in
Historical Church Registers,” International Conference on Document
Analysis and Recognition, pp. 743-747, 2001.
[8] L. Likforman-Sulem, A. Hanimyan, and C. Faure, “A Hough Based
Algorithm for Extracting Text Lines in Handwritten Documents,”
International Conference on Document Analysis and Recognition,
vol. 2, pp. 774-777, 1995.
[9] G. Louloudis, B. Gatos, I. Pratikakis, and K. Halatsis, “A Block-
Based Hough Transform Mapping for Text Line Detection in
Handwritten Documents,” International Workshop on Frontiers in
Handwriting Recognition, 2006.
[10] L. Likforman-Sulem , A. Zahour, and Bruno Taconet, “Text Line
Segmentation of Historical Documents: a Survey,” International
Journal on Document Analysis and Recognition, vol. 9, pp. 123 - 138,
2007.
[11] Z. Shi and V. Govindaraju, “Line Separation for Complex Document
Images Using Fuzzy Runlength,” International Workshop on
Document Image Analysis for Libraries, 2004.
[12] L. Zheng, A. H. Hassin, and X. Tang , “A new Algorithm for
Machine Printed Arabic Character Segmentation,” Pattern
Recognition Letters, vol. 25, pp. 1723–1729, 2004.
[13] B. M. F. Bushofa and M. Spann , “ Segmentation and Recognition
of Arabic Characters by Structural Classification,” Elsever Image
and Vision Computing, vol. 15 ,pp.167-179, 1997.
[14] V. Kumar, P. K. Sengar, “Segmentation of Printed Text in
Devanagari Script and Gurmukhi Script,” International Journal of
Computer Applications, vol. 3, no. 8, pp. 24-29, 2010.
[15] M. S. Das, C. Reddy, A. Govardhan and G. Saikrishna,
“Segmentation of Overlapping Text Lines, Characters in Printed
International Journal of
Images,”
Telugu Text Document
Engineering Science and Technology, vol. 2, pp. 6606-6610, 2010.
[16] V. J. Dongre and V. H. Mankar, “Devnagari Document Segmentation
Using Histogram Approach,” International Journal of Computer
Science, Engineering and Information Technology, vol.1, no.3, pp.46-
53, 2011.
[17] S. Elaiwat, M. A. Abu-zanona, “A Three Stages Segmentation Model
for a Higher Accurate off-line Arabic Handwriting Recognition,”
World of Computer Science and Information Technology Journal,
vol. 2, no. 3, pp. 98-104, 2012.
[18] M. A. Abdullah, L. M. Al-Harigy, and H. H. Al-Fraidi, “Off-Line
Arabic Handwriting Character Recognition Using Word
Segmentation,” Journal of Computing, vol.4, pp.40-44, 2012.
[19] A. M. Al-Shatnawi and K. Omar, “Skew Detection and Correction
Technique for Arabic Document Images Based on Centre of Gravity,”
Journal of Computer Science, pp. 363-368, 2009.
[20] S. Brook and Z. Al Aghbari, “Classification of Personal Arabic
Handwritten Documents,” Transactions on Information Science &
Applications, vol. 5,pp. 1021-1030, 2008.
[21] N. Sridevi and P. Subashini, “Segmentation of Text Lines and
Characters in Ancient Tamil Script Documents using Computational
Intelligence Techniques,”
International Journal of Computer
Applications, vol. 52, no.14, 2012.
978-1-4673-4992-5/13/$26.00 ©2013 IEEE
126