fundamental role of segment code in Pan- Euclidean geometry and the ... Positive integer n indicating foreground colored basic segment with the length of n.
Approach for deicription and recognition of arbitrary curvea baied on segment code Xian Wu Liu Hongjian Du Jiangehuan Opto. Elec. Prec. Instrument in Chongqing University P.R.CHINA 630044 Chongqing,Sichuan Ernest L. Hall University of Cincinnati U.S.A.
ABSTRACT
0uantity is the integration of discretion and continuity' Starting with the definition of segment code, a basic data structure in which continuity is achieved •
through discrete series this paper surveys a simple method by which arbitrary curve is represented by an integral series. Also, the application of four—vertex theorem and even number theorem of simple closed curve in pattern recognition is explained through the the process of obtaining graphic characteristics of handwriting digits 0--9. Finally
fundamental role of segment code in Pan- Euclidean geometry and the future of its development are discussed.
Key words: Pan—Euci idean geometry basic segments digital curves pattern recognition
I.
PREFACE
The desoription creation, classification and recognition of curve(here instanced by straight line) have long been basic problems in geometry drafting image processing and pattern recognition. 2
The precise description and successful control of macro continuous movement with the method of real number equation in traditional mathematics impel people to expect the same success with the same method in the description and recognition of micro discrete However, 'simple image(digital image characteristic of resolution factor and mesh) . geometry conquers advanced computer'3 . To perfectly establish a consistent system of the fundamentals of computer graphics and image recognitions we would prefer creating a Pan new model in which continuity is achieved through finite discrete series i. e. —Euclidean model4 rather than arduously trying to improve the infinitely divisible continuous model. As reference5 has dealt with problems in straight lines, this paper intends to research into problems in curves. Also, problems of 3—dimensional model will be discussed in our to-be-published book 'Pan-Euclidean geometry'.
2. DEFINITION OP BASIC SEGMENT CODE Basic definition:
. basic segment:
4-connected pixel group(same colored) only along X or Y direction on the screen of a computer.
. positive segment code:
Positive integer n indicating foreground colored basic segment with the length of n along the present direction. Its initial state is horizontal to the right(east) right— handed.
216 / SPIE Vol. 1825 Intelligent Robots and Computer Vision XI (1992)
Downloaded From: http://proceedings.spiedigitallibrary.org/ on 10/23/2013 Terms of Use: http://spiedl.org/terms
0-8194-1 026-8/92/$4.0O
. negative segment code:
negative integer indicating background colored basic segment with the opposite rotating direction to that of positive segment. Its initial state is horizontal to the left(west), left—handed. . rotating code:
A series of 0 in which every 0 makes the longer side of a basic segment rotate 90 degrees clockwise.
. contrarotating code: Symbol $ which changes the rotating direction of a basic segment to its opposite(e.g.
left-handed to right—handed and vice versa). $ can be considered a finite number and represented by the minimum negative integer in computers. For instances to 'char' data it is represented by minus 128.
Basically positive and negative segment code reflect the length of a basic segment while rotating code and contrarotating code reflect the orientation features of a basic segment.
positive segment code +5
negative segment code -S
EJflEIIID
Above U indicates foreground—colored pixels and 0 indicates background—colored pixel. The horizontal line is the starting line(X line) in basic segment positioning and the vertical line is the ending line(Y line) in basic segment positioning.
3.THE CODING OP CURVES As codes dealing with basic segments positive and negative segment code are mutually supplementary in their rotating directions and colors. The absolute value of segment code reflects the length of basic segments which is one of the most basic geometric features of basic segments and this is the exact relationship between segment code and basic segment which is unchangeable under any circumstances. Other features of basic segment change according to the alteration of rotating & contrarotating code which are ahead of segment code. The interaction between basic segment and segment code is a serial one—one mapping process in which a basic segment is created with a segment code, or vice versa. In the process of creating a basic segment on the screens the moving frame changes its position from the starting point to the ending points and this shows the fact that segment code shifts the starting point in image—showing. H t
S
1
SO3
004
horizontally S vertically to the right
nO
downward
n1
horizontally to the left
n2
t I S
L__
n3
0003
vertically
upward
In the above figures n is the remainder of: length of rotating code/4. Static basic segment has only two directions, horizontal and vertical, dynamic processing it has four directions: east & west, and south & north,
SPIE
Vol. 1825 Intelligent Robots and Computer
Downloaded From: http://proceedings.spiedigitallibrary.org/ on 10/23/2013 Terms of Use: http://spiedl.org/terms
while in which are
Vision Xl (1992) / 217
determined by the number of rotating code ahead of segment code. Rotating code changes the direction of drawing or scanning through controllIng direction of moving frame so that any basic segment of arbitrary direction can be processed by a series of 0 with if the initial direction of a basic segment is different lengths. For example, horizontal to the rights a rotating code consisting of one 0 changes it to vertically downward. Similarly a rotating code consisting of two Os changes it to horizontal to the lefts a rotating code consisting of three Os to vertically upwards and four Os to the original direction. From this we get the conclusion that rotating code is 4—modulused, and the kind of basic segment with an even length of its rotating codes is horizontally positioned while that with an odd length of its rotating code is vertically positioned. In Pan—Euolidean geometry any line has its breadth simply because it is made up of several pixels on the screen which occupy a certain area. What we intend to do is to control the creation of lines of a pixel's width in Pan—Euclidean geometry with lines of no width in Euclidean geometry system; and this sort of controlling technique is the crux of creating segment code. The edge of a basic segment forms a rectangle of which there are four rectangular sides. First we move along X side and then Y side. and thus completely determine the length and position of a basic segment. These two rectangular and the rotating direction of these two sides are defined as positioning sides, positioning sides is the rotating direction of the segment code of a basic segment. According to right—hand screw rule, it is regulated that clockwise direction(right—handed) is positive and anti-clockwise direction(left—handed) is negative. Furthermore, we set the initial state of positive segment code as positive and that of negative segment code the The rotating direction of a segment code is determined by as negative. contrarotat ing code ahead of it.
Through altering the direction and position of X and Y side which help create a basic segments the contrarotating code modifies the rotating direction of the positioning sides of a basic segment. In quadrant I and III the rotating direction of the positioning sides of simple closed convex curves(not self—intersected) is regulated as right-handed while in quadrant II and IV left—handed.
To deal with the problem of
changes of direction of curves on local extreme point when image processing this sort In the of arrangement is quite necessary. We can see this from rectangular coding. in which code 0$ following figure the segment code of the square is 70$80$70$ 80$ Rotating code 0 appears in the rear of every basic segment code of its four sides. indicates the horizontal side alternates with the vertical sides and contrarotating code $ indicates that every side of the square occupies a quadrant. Combination of 0 and $ indicates that these two changes are cogradient i.e., changes of curvature are very sharp. In fact, $ here enhances the function of 0.
S 2
1111
112
7
0$ t
11
I
8lII11llllO$ II
•II •• 1 0$Ii I
I
I
II I1
U
110
12
$12
I 21
-
2$
2210122$
2210122$
2 1
21
oil211 $2
70$80$70$80$
1
10 1 I 2 I 2 I 1$
2210122$
11
Os
2
I
2210122$
I 21
I tIIIIIIII8 7'
II
011 1
I
1
211
21111
The four '2210122$' indicate moving(from point S) along the circumference of the circle ending on point S clockwise.
218 ISPIE Vol. 1825 Intelligent Robots and Computer Vision XI (1992) Downloaded From: http://proceedings.spiedigitallibrary.org/ on 10/23/2013 Terms of Use: http://spiedl.org/terms
To change the moving direction of a basic segment when drawing by coding a basic segment into two segment codes is the basic usage of contrarotating code. So long as the lengths of basic segments on X V's local extreme points are greater than 1 we can code a basic segment into two segment codes. If the first segment code of the two is right— handed, then after finishing coding the first code, we can add a contrarotating code so for the as to change the rotating direction of the other segment code to left—handed,
purpose of symmetry. A typical example: the segment code sequence of a circle will indicate that suffice. In the above figure the four identical segment codes 2210122$ segment codes in every quadrant are the same. 0 represents the separating point of X and basic segments while $ Y(horizontal and vertical) indicates changes of rotating
directions of basic segments on extreme points. The uniform distribution of 0 and $ indicates uniform changes of curvature of the circle, and this is the opposite to the case of a rectangle. 4.
THE SEGMENT CODE FEATURE OF SiMPLE CLOSED CURVE
The real-time display and recognition of moving objects make it necessary to process arbitrary curve with a high speed. The speed of our algorithm by which split curves are adopted to approximate and restore the original curve after division of the curve Into several sections according to its segment code is much higher than that of traditional a1gorithm and high efficient image codes can be obtained through tracking 360 degrees along the outline of an image(right-handed to outer loops and left—handed to inner loop).
URRUR uuoo—oaua
samo oaua UROO osaa
•uo oua RMO oaa amo
•oooouaau •SRSURNURU auuasu U. Ru ua aaa .R. S.
The segment code sequence of digit 090 is as the following: 4 1 $ 1 0 4 2 3 6 1 00 $ 4 -3 000 4 3
-2 -2 $ 000 -1 $ 0 -2 000 -2 -2 000 -4 -1 -1 000 -5 000 direction-related code feature represented original meaning 0: rotate 90 degrees clockwise convex point 00: rotate 180 degrees clockwise end point 000: rotate 90 degrees contra-clockwise concave point $: contrarotate the rotating direction extreme point decided by the two positioning sides
As sections of the segment code of a curve separated by Os and $s are simpler flat and the geometric feature of a curve is determined by the approximately similar, distribution of Os and the finite $s in the segment code of the curve. The number of Os in the segment code of a simple closed curve is the multiple of 4, and this is the quantified representation of the 4—point theorem of differential geometry in segment code. he number of contrarotating codes $ in the segment code of a simple closed curve is even. In the following code sequence the coding process of outer loop which starts from point S ends on point S after moving 360 degrees along the black pixels of the outline of the image.
4 1 $ 1 0 4 2 3 6 1 00 $ 4 —3 000 4 3 0 $ 3 1 2 1 0 2
1 1 $
Starting from point 1, the coding process of inner loop ends on point 1 after moving 360 degrees contra-clockwise along the white pixels of the inner circle of the image.
-2 -2 $ 000 -1 $ 0 -2 000 -2 -2 000 -4 -1 -1 000 -5 000
SPIE Vol. 1825 Intelligent Robots and Computer Vision XI (1992)1 219
Downloaded From: http://proceedings.spiedigitallibrary.org/ on 10/23/2013 Terms of Use: http://spiedl.org/terms
The geometric features of the outline of the image are reflected in the directionrelated code of the outer loop.
{$O
00$
A
convex
0$
000
AA
A
V concave
end
convex
0
A
$
convex
0+00+000+0+0= 8 The number of Os in the direction—related code of the outer loop is the multiple of 4. The geometric features of the inner loop of the image are reflected in the direction-related code of the inner loop. $O-2000 shows there exists an obtuse angle and the other four groups of sequences 000 indicate rotation of 360 degrees( left —handed). The number of Os in the inner loop is the multiple of 4. From the above two codes(outer and inner loop code) the geometric features of digit 9 can be detected as following:
One concave ,
three
convexs , one end point and one inner loop.
To effectively differentiate various features from the noises some geometric quantities such as areas of concave and convex regions are worked out to serve as the major criterion according to the basic segment codes separated by two types of directionrelated codes. On the other hand, the algebraic sums of the two direction-related codes indicate the topological features of an image.
Furthermore, we can re-code the sequence of direction-related codes according to the following rule:
$ -->
0
0 --> 1,
00 -->
2
000 --> 3.
Obviously here the value of the new code indicates the number of Os,and a unit of this
new code can be realized in two bits. The following are standard modes of digit 0 through 9:
0: 1: 2: 3:
( { ( { 4: { { 5: 6: { { 7: 8: ( 9: {
3333 10101010 10210 } 103022332 1031012332332 10332320320320 2033010023321 3333 1031010101 1020122 } 3333 3333 10310101031010 3333 102031010
It should be noted that the above sequences of codes are in accordance with the 4point theorem and the even number theorem.
As the shape of an inner loop cannot be used as indicator of different digits we can use sequence 3333 to express an inner loop. Because of its stability' sequence 3333 can be positioned ahead of a segment code sequence for the convenience of classification and sequencing.
Similar geometric shapes always result in certain similarity. For examples there are which two more 3s in the code sequence of outer loop of digit 8 than that of digit 0, indicates the two concave sections of digit 8. Another example: the code sequence of outer loop of digit 6 is on the whole an inversion of that of digit 9. To various multi-formed handwritings of the same digits the code sequences of them are always similar.
The handholder OCR CD-IV system based on the segment code has reached a recognition and a precision of 99.87%(according to statistical results from 100 thousand digits)
220 ISPIE Vol. 1825 Intelligent Robots and Computer Vision Xl (1 992)
Downloaded From: http://proceedings.spiedigitallibrary.org/ on 10/23/2013 Terms of Use: http://spiedl.org/terms
recognition speed of 27 digits per second on the AT286 computer. This system has the specialities of highly concentration of features, powerful anti—noise abiIity and less entries of dictionary. 6,?
.
CONCLUSION
The two types of scale codes(positive and negative segment code)reflect the length and direction, i.e. the micro-geometric quantities of a basic segment while the two direction—related codes reflect the topological relationships i.e. the macro- geometric quantities between segment codes. Thus, their combination forms a thorough reflection of comprehensive geometric quantities of an images and this is the reason why segment code has its wide application in computer graphics and digit image processing. With the use of segmet codes most algorithms such as curve fittings the generation of lines and e1lipses clipping and polygonal fiIling etc., can be greatly enhanced and their running speeds are increased by 2—10 times than that of Bland C++ library.
Pan-Euclidean geometry is a kind of computer geometry with segment code as its basic data structure. The concept of basic segment code is first developed from the process of We can character recognitions but it can be applied to computer graphics as well. benefit a lot unexpectedly from adopting basic segment which is expressed by relative length instead of the concept of point which is traditionally expressed by its absolute x and Y coordinates. As segment code which reflects the first order difference of any discrete curve is parallel translating invariant(its length) and rectangular rotating fi I I ing invar iant, objectives such as compact coding set operation, contour tracings
clipping, the remove of the hidden plane and gray scale image of arbitrary shape can be realized through segment oode and its higher dimensional expansion. In addition, basic segment code can be created through scanning lattice of an images analyzing the Huffman codes etc., and it can be conveniently converted into the equation form of a straight line, or a curve. As features such as the extreme value, the singular point and concave & convex of a curve can be easily ascertained from the distribution of rotating code 0, some advanced operations such as continuous amplification and reductions rotation, feature extraction and recognition can therefore be executed in a convenient way. Thus, this kind of two-way operation(from image to mode and vice versa) can be realized within the same geometric mode, which is essentially helpful to reduce the lengths of programs and yet easy to grasp. In pace with increase of space resolution factor and the number of basic segments the image precision accuracy reflected by segment code increases and the differences between Euclidean geometry and Pan-Euclidean geometry become reduced. This is just the opposite case in comparison with that of non— Euclidean geometry in which the differences between Euclidean geometry and non— Euclidean geometry increase along with the increase of space dimension, and this is exactly one of the meanings of Pan—EucI idean geometry. 6.
REFERENCES
1. Hegel, C. W. F. 'Logic's p199, ISBN 1—1OO—O1145—O Commercial Press, 1991. 2. Pavlidis,T: Structural pattern recognition" Springer—Verlag Berlin Heidelberg 1977. 3. Wallich, P: 1Useless inputs useless output's SCIENTIFIC AMERICAN V.263 N.8, 1990.12. 4. Liu Hongjian, Du Jiangchuan: 'The Basic Encoding for Pan—Euclidean Geometry—— Segment Code and It's Application',