Intelligent Approaches for Vectorizing Image Outlines

Two computing approaches, based on linear and conic splines, are proposed here in reviewed and extended for vectorizing image outlines. Both of the approaches have various phases including extracting outlines of images, detecting corner points from the detected outlines, and curve fitting. Interpolation splines are the bases of the two approached. Linear spline approach is straight forward as it does not have a degree of freedom.in terms of some shape controller in its description. However, the idea of the soft computing approach, namely simulated annealing, has been utilized for conic splines. This idea has been incorporated to optimize the shape parameters in the description of the generalized conic spline. Both of the linear and conic approaches ultimately produce optimal results for the approximate vectorization of the digital contours obtained from the generic shapes.

The proposed work is a motivation of work on cubic splines [28].A conic approach was studied in its intial form in [29].It was then extended together with a linear spline in [30].This paper reviews and further extends the work of [30].It provides more detailed description and comparative study of linear and conic models.This work is a representation of two approaches using linear and conic interpolations.The linear interpolant approach is straight forward.However, the conic approach is inspired by an optimization algorithm based on simulated annealing (SA) by Kirkpatrick et.al [24].It motivates the author to an optimization technique proposed for the outline capture of planar images.In this paper, the data point set represents any generic shape whose outline is required to be captured.We present an iterative process to achieve our objective.The algorithm comprises of various phases to achieve the target.First of all, it finds the contour [25][26][27] of the gray scaled bitmap images.Secondly, it uses the idea of corner points [1][2][3][4][5][6][7] to detect corners.That is, it detects the corner points on the digital contour of the generic shape under consideration.These phases are considered as preprocessing steps.Linear and conic interpolants are then used to vectorize the outline.The idea of simulated annealing (SA) is used to fit a conic spline which passes through the corner points.It globally optimizes the shape parameters in the description of the conic splines to provide a good approximation to the digital curves.In case of poor approximation, the insertions of intermediate points are made as long as the desired approximation or fit is achieved.
The organization of the paper is as follows, Section 2 discusses about preprocessing steps which include finding the boundary of planar objects and detection of corner points.Section 3 is about the interpolant forms of linear and conic spline curves.Section 4 is dedicated for simulated annealing.Overall methodology of curve fitting is explained in Section 5, it includes the idea of knot insertion as well as the algorithm design for the proposed vectorization schemes.Demonstration of the proposed schemes as well as comparative study is presented in Section 6.Finally, the paper is concluded in Section 7.
The proposed schemes start with finding the boundary of the generic shape and then using the output to find the corner points [1][2][3][4][5][6][7].The image of the generic shapes can be acquired either by scanning or by some other mean.The aim of boundary detection is to produce an object's shape in graphical or non-scalar representation.Chain codes [26], in this paper, have been used for this purpose.Demonstration of the method can be seen in Figure 1(b) which is the contour of the bitmap image shown in Figure 1(a).Corners, in digital images, give important clues for the shape representation and analysis.These are the points that partition the boundary into various segments.The strategy of getting these points is based on the method proposed in [1].The demonstration of the algorithm is made on Figure 1

Curve Fitting and Spline
The motive of finding the corner points, in Section 2, was to divide the contours into pieces.Each piece contains the data points in between two subsequent corners inclusive.This means that if there are m corner points cp 1 , cp 2 , …, cp m then there will be m pieces pi 1 , pi 2 , …, pi m .We treat each piece separately and fit the spline to it.In general, the i th piece contains all the data points between cp i and cp i+1 inclusive.After breaking the contour of the image into different pieces, we fit the spline curve to each piece.To construct the parametric spline interpolant on the interval ] , [ 0 n t t , we have , as interpolation data, at knots t i , n i ,......, 1 , 0 = .

Linear Spline
The curve fitted by a linear spline is a candidate of best fit, but it may not be a desired fit.This leads to the need of introducing some extra treatment in the methodology.This section deals with a form of linear spline.It introduces parameters t's in the description of linear spline defined as follows: .
P i and P i+1 are corner points of the i th piece.

Quadratic Spline
The curve fitted by a conic spline is a candidate of best fit, but it may not be a desired fit.This leads to the need of introducing some shape parameters in the description of the conic spline.This section deals with a form of conic spline.It introduces shape parameters u's in the description of conic spline defined as follows: where ( ) D i and D i+1 are the corresponding tangents at corner pointsP i and P i+1 of thei th piece.The tangent vectors are calculated, as in [29], using arithmetic mean.Obviously, the parameters u i 's, when equal to 1, provide the special case of quadratic spline.Otherwise, these parameters can be used to loose or tighten the curve.This paper proposes an evolutionary technique, namely simulated annealing (SA), to optimize these parameters so that the curve fitted is optimal.

Simulated Annealing (SA)
Simulated annealing (SA) [24] is a global optimization method based on the Monte Carlo method.It works on the analogy of the energy in an n-body system where the material is cooled to lower temperatures gradually to result in a perfect crystal structure.The perfect crystal structure is attained by having minimum energy in the material.This analogy translates to the optimization done in simulated annealing in finding a solution that has the lowest objective function value.The solution space is all the possible solutions.The current solution is the present state of the material.The algorithm iteratively tries to change the state of the material and check whether it has improved.The material's state is changed slightly to find a neighboring state i.e. a close solution value in the solution space.It is possible that all neighboring states of current states are worse solutions.The algorithm allows going to a worse state with a certain probability.This probability decreases as the algorithm iterations proceed.Finally, it only allows a change in state if it is strictly better than the current solution.Details of SA theory can be found in [24].A detailed description of the mapping of the SA technique on the proposed problem is given in the next section.

Proposed Approach for Vectorization
Theproposed approach to the curve problem is described here in detail.It includes the phases of problem matching with SA using conic splines, description of parameters used for SA, curve fitting, and the overall designs of algorithms.

Problem Mapping
Thissection describes about the SA formulation of the current problem in detail.Our interest is to optimize the values of conic curve parameters u such that the defined curve fits as close to the original contour segments as possible.We use SA for the optimization of these parameters for the fitted curves.Hence the dimensionality of the solution space is 1 for conic curves.Each state in the SA solution space represents a value of u for conics.
We start with an initial state that is a given value of u for conics.A starting temperature is also chosen arbitrarily.This temperature is an inherent internal parameter of SA and has no significance or mapping on our problem.The algorithm maintains a record of the best state ever reached throughout the algorithm run.This is the value of u for conics that has given the best curve fitting so far.This best solution gets updated whenever the algorithm finds a better solution.The algorithm iteratively looks for neighboring states that may or may not be better than the current one.These neighboring states are values of u for conics that are slightly different from the values of u for conics.The cooling rate in SA is the factor affecting the likelihood of selecting neighboring values of u for conics that give a curve fitting worse than the values of u for conics.
Note that we apply SA independently for each segment of a contour that we have identified using corner points.SA is applied sequentially on each of the segments, generating an optimized fitted curve for each segment.The algorithm is run until the maximum allowed time is reached, or an optimal curve fitting is attained.

Initialization
Once we have the bitmap image of a generic shape, the boundary of the image can be extracted using the method described in Section 2. After the boundary points of the image are found, the next step is to detect corner points as explained in Section 2. This corner detection technique assigns a measure of 'corner strength' to each of the points on the boundary of the image.This step helps to divide the boundary of the image into n segments.
Each of these segments is then approximated by interpolating spline described in Sections 3.2.The initial solution of spline parameters u values for conics are randomly selected within the range [-1, 1].

Curve Fitting
After an initial approximation for the segment is obtained, better approximations are obtained through SA to reach the optimal solution.We experiment with our system by approximating each segment of the boundary using the conic splines of Section 3.2.
The conic spline method is a variation of the quadratic spline.It provides greater control on the shape of the curve and also efficient to compute.The tangents, in the description of the spline, are computed using the arithmetic mean method described in Eqn.(3).Each boundary segment is approximated by the spline.The shape parameter u, in the conic spline, provides greater flexibility over the shape of the curve.These parameters are adjusted using SA to get the optimal fit.
Since, the objective of the paper is to come up with optimal techniques which can provide decent curve fit to the digital data.Therefore, the interest would be to compute the curve in such a way that the sum square error of the computed curve with the actual curve (digitized contour) is minimized.Mathematically, the sum squared distance is given by: where P i,j = (x i,j , y i,j ), j = 1,2,…,m i , (12) are the data points of the ith segment on the digitized contour.The parameterization over t's is in accordance with the chord length parameterization.Thus the curve fitted in this way will be a candidate of best fit.
Once an initial fit for a particular segment is obtained, the parameters of the fitted curve u's for conics are adjusted to get better fit.Here, we try to minimize the sum squared error of Eqn.(11).Using SA, we try to obtain the optimal values of the curve parameters.We choose this technique because it is powerful, yet simple to implement and as shown in Section 6, performs well for our purpose.
For some segments, the best fit obtained through iterative improvement may not be satisfactory.In that case, we subdivide the segment into smaller segments at points where the distance between the boundary and parametric curve exceeds some predefined threshold.Such points are termed as intermediate points.A new parametric curve is fitted for each new segment.
We can summarize all the phases from digitization to optimization discussed in the previous sections.The algorithms of the proposed schemes are contained on various steps.The reader is referred to [29] for the details of the Algorithms.The above mentioned schemes and the algorithms have been implemented and tested for various images.Reasonably quite elegant results have been observed as can be seen in the following Section of demonstrations.

Demonstrations
The proposed curve scheme has been implemented successfully in this section.We evaluate the performance of the system by fitting parametric curves to different binary images.
Figure 2 shows the implementation results of the two schemes for the image "Lillah" in Figure 1(a).Figures 2(a   Figures 5 and 6 show the implementation results of a "Fork" image.Figures 5(a), 5(b), 5(c) are respectively the original image of the Fork, its outline, outline together with the corner points detected.Figure 6 shows the implementation results of the two schemes for the "Fork" image in Figure 5(a).Figures 6(a) and 6(b) are the results for the linear scheme, respectively, without and with insertion of intermediate points.Similarly, Figures 6(c) and 6(d) are the results for the conic scheme, respectively, without and with insertion of intermediate points.One can see that the approximation is not satisfactory when it is achieved over the corner points only.This is specifically due to those segments which are bigger in size and highly curvy in nature.Thus, some more treatment is required for such outlines.This is the reason that the idea to insert some intermediate points is demonstrated in the schemes.It provides excellent results.The idea of how to insert intermediate points is not explained here due to limitation of space.It will be explained in a subsequent paper.Tables I, II and III summarize the experimental results for different bitmap images.These results highlight various information including contour details of images, corner points, intermediate points, total time taken for linear interpolation, and total time taken for conic interpolation.

Conclusion and Future Work
Two optimization techniques are proposed for the outline capture of planar images.First technique uses simply a linear interpolant and a straight forward method based on distribution of corner and intermediate points.Second technique uses the simulated annealing to optimize a conic spline to the digital outline of planar images.By starting a search from certain good points (initially detected corner points), an improved convergence result is obtained.The overall technique has various phases including extracting outlines of images, detecting corner points from the detected outline, curve fitting, and addition of extra knot points if needed.The idea of simulated annealing has been used to optimize the shape parameters in the description of a conic spline introduced.The two methods ultimately produce optimal results for the approximate vectorization of the digital contours obtained from the generic shapes.The schemes provide an optimal fit with an efficient computation cost as far as curve fitting is concerned.The proposed schemes are fully automatic and require no human intervention.The author is also thinking to apply the proposed methodology for another model curve.It might improve the approximation process.This work is in progress to be published as a subsequent work.
(b).The corner points of the image are shown in Figure 1(c).

Figure 2 .
Figure 2. Results of linear scheme: (a) Fitted Outline of the image, (b) Fitted Outline of the image with intermediate points.Results of conic scheme: (c) Fitted Outline of the image, (d) Fitted Outline of the image with intermediate points.

Figure 3 .
Figure 3. Pre-processing Steps: (a) Original Image, (b) Outline of the image, (c) Corner points achieved, (d) Fitted Outline of the image.
) and 2(b) are the results for the linear scheme, respectively, without and with insertion of intermediate points.Similarly, Figures2(c) and 2(d) are the results for the conic scheme, respectively, without and with insertion of intermediate points.

Figure 4 .Figure 5 .Figure 6 .Figures 3
Figure 4. Results of curve fitting.Linear curve fitting: (a) Fitted Outline of the image, (b) Fitted Outline of the image with intermediate points.Conic curve fitting: (c) Fitted Outline of the image, (d) Fitted Outline of the image with intermediate points.
Figures 3 and 4 show the implementation results of a "Plane" image.Figures 3(a), 3(b), 3(c) are respectively the original image of the Plane, its outline, outline together with the corner points detected.Figure 4 shows the implementation results of the two algorithms for the This work was supported by Kuwait University, Research Grant No. [WI 05/10].