A New Algorithm of Shape Boundaries Based on Chain Coding

A new method to obtain connected component in binary images is presented. The method uses DFA automaton to obtain chain code and label the component boundary. It is theoretically proved that the algorithm improves the image encoding efficiency closer to the lowest time consumption. Keywords-image shape; boundary tracing; chain code; automaton; boundary processing


Introduction
Connected component obtaining in a binary image is one of the most fundamental operations in pattern recognition and image analysis.The purpose of labeling is to treat the individual connected components of a digitized image as separate objects.
Rosenfeld presented tracing idea in 1978 [1].The subsequent work [2,3 ] are effective, but have less efficiency then Rosenfeld .The well-known TP algorithm is proposed in [4], but some errors including losing inner contours, connectivity and traversing some of the boundary pixels more than one time can be found.
Several algorithms based on label equivalences have been proposed.Chang et al. [5] outperforms other methods using label equivalences and ordinary computers and thus is picked out to represent existing methods based on label equivalences with more than two passes.
The report of Seong-Dae Kim et al. described a twostep run-length algorithm [6].The method computes chain code from run-length coding representation.It preserves the connectivity information between runs and never loses the inner or outer contours.
A fast algorithm is proposed inn this paper.It uses DFA automaton to obtain chain code and label the component boundary specifically for binary image.The algorithm makes full utilization of the automaton in the labelling method to avoid tracing contours more than once.Our algorithm improves the current binary image encoding efficiency regarding algorithmic complexity and memory usage.

Proposed Algorithm
Freeman introduced chain code to represent digital curves [7] first.Ernesto Bribiesca used a derivative of the Freeman chain code for shape representation and defined vertex chain code (VCC) [8] in 1999.Then Bribiesca presented a new measure of tortuosity for 2D curves which based on geometric structure of Slope Chain Code (SCC) [9].It has been proved that chain code provide a compact representation and preserve all the information of the image [10,11].Bribiesca also proved that chain coding data has higher ratio of lossless compression [12].
The deterministic finite automaton (DFA) is suitable for modelling the collaboration entities in a collaboration session.A finite automaton is a five-tuple notation G 6 is the name of the automaton.is the finite set of states of the automaton. 6is the finite set of input symbols.o 6 u

G
is the transition function, which takes as parameters as state from and a symbol(from 6 ,and returns a state in for deterministic Finite Automata(DFA).
is the start state.is the finite set of final or accepting states, which is a subset of .
ITA 2017 In DFA, for each 6 u of state and input there is a unique next state giver by the transition function.
For the usage of automaton, pixels on image contour are divided into 4 states.All states can transform to related states under given condition.However, the automaton traverses on the outside boundary of the image.

The 8-Connected Automaton
The new examining sequence is proposed and pitched as in According to the transition image, the automaton is given in fig 3 .Figure3.DFA of 8-connected image tracer.
In addition, chain code can be obtained the same time.Freeman

How to Find a New Contour
To find a new contour and start the automaton needs to examine whether current situation complies with state A -upper pixel is black and lower pixel is white.Starting procedure of automaton with 8-connected image is shown in fig. 7.
To terminate the automata is simple, it only needs to analyze whether the automata have returned to the starting point.If automata traces back to the starting position again, it will terminate and begin to find a new contour -the next position with state A.

Performances Comparison
The performances of algorithms are shown in tab 3. (AK stands for Kim algorithm; AFC stands for Fuchang method; AA_e stands for algorithm using automaton) In these figures, the size of the test image (M pixels) is plotted along the horizontal axis, while the average processing time (ms) of each method is plotted along the vertical axis.

Conclusion
This paper presents a new method to obtain connected component in binary images.The time consumption in this method is, in expense of additional work memory, this method is closer to the lowest time consumption.
The algorithm makes full utilization of the automaton in the labeling method to avoid tracing contours more than once.The connectivity information is fully preserved and the inner and outer contours can be distinguished.The new algorithm only labels west side of the outer contour and east side of the inner contour and it is capable of generating all types of chain code after tracing the contours.
It is theoretically proved that our algorithm improves the current binary image encoding efficiency regarding algorithmic complexity and memory usage.In experiments on six types of images of various sizes, we compare our method with other algorithm.The results show that our algorithm outperforms that in all six types of binary image in terms of computational speed especially for complex image.

Fig. 1 .Figure1.
Figure1.The four states of 8-connected automaton.So value of points 'a' and point 'b' are input of DFA.The input can be '0x', '10' or '11' according to the following definition: 0x: a=0(a is black, b is not examined) 10: a=1, b=0(a is white , b is black) 11: a=1, b=1 (a is white , b is white) 8-direction code is Output according to tab.1.