Computing Optimized NURBS Curves using Simulated ... - Springer Link

1 downloads 0 Views 615KB Size Report
College of Computer Sciences and Engineering. King Fahd University of Petroleum and Minerals. KFUPM#1510, Dhahran 31261, Saudi Arabia. {sarfraz, sadiq ...
Computing Optimized NURBS Curves using Simulated Evolution on Control Parameters

Muhammad Sarfraz, Sadiq M. Sait, Mohmmed Balah, and M. Humayun Baig College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals KFUPM#1510, Dhahran 31261, Saudi Arabia {sarfraz, sadiq, mbalah, humayun}@cccse.kfupm.edu.sa

Abstract. In curve fitting problems, the selection of appropriate parameters in order to get an optimized curve for a shape design, is well-known. For large data, this problem needs to be dealt with optimization algorithms avoiding possible local optima and at the same time getting to the desired solution in an iterative fashion. Many evolutionary optimization techniques like genetic algorithm, simulated annealing have already been successfully applied to the problem. This paper presents an application of another evolutionary heuristic technique known as "Simulated Evolution" (SimE) to the curve fitting problem using NURBS. The shape parameters, in the description of NURBS, have been targeted to be optimized in a best possible way. The paper describes the mapping scheme of the problem to SimE followed by the proposed algorithm's outline with the results obtained.

Keywords: curve fitting, NURBS, approximation, simulated evolution, algorithm

1 Introduction In planar shape design problems, the main objective is to achieve an optimized curve with the least possible computation cost. For complicated shapes with large measurement data, the problem becomes dependent upon the selection of appropriate parameters in the description of the curve model. Algorithms based on heuristic techniques like genetic algorithms, simulated annealing, simulated evolution (SimE) etc., can provide us with an approach in finding optimal parameters with reasonable cost. Since the data in such a problem cannot be approximated with a single polynomial, the application of splines, Bezier curves etc., are well known. Non-uniform Rational B-splines (NURBS) [4], providing more local control on the shape of the curve, gives a better approximation of the underlying data in shape design problems. In [9], knots corresponding to the control points have been optimized using a genetic algorithm. An approach based on Tabu search has been applied in [14]. An algorithm proposed in [12] discusses optimization of knots and weights using Simulated Annealing. In [10] proposed a novel approach for opti-mization of NURBS control points using simulated evolution. The main

36

M. Sarfraz et al.

contribution of this work is to propose a curve fitting algorithm based on SimE using NURBS. Here, the shape parameters in the description of the NURBS have been selected to be computed such that the computed curve provides a best fit to the original data raised from the planar images after the scanning process. The paper has been designed into various sections. The following section deals with the image contour extraction. Detection of significant points have been reported in Section 3. Section 4 gives a brief description of NURBS whereas the SimE algorithm has been discussed in Section 5. The proposed approached, with details of the evolutionary optimization curve technique SimE, has been explored and designed in Section 6. Demonstration of the executed results is given in Section 7 and Section 8 concludes the paper.

2 Image Contour Extraction A digitized image is obtained from an electronic device or by scanning an image. The quality of digitized scanned image depends of various factors such as the image on paper, scanner type and the attributes set during scanning. The contour of the digitized image is extracted using the boundary detection algorithms. There are numerous algorithms for detecting boundary. We used the algorithm proposed by [8]. The input to this algorithm is a bitmap file. The algorithm returns a number of boundary points and their values.

3 Detection of Significant Points Detection of significant points is the next step after finding out contour of the image. The significant points are those points, which partition the outline into various segments. Each segment is considered to be an element in our proposed approach. A number of approaches have been proposed by researchers [2]. In this paper, the detection of corner points has been implemented using the technique presented by Chetverikov and Szabo [2]. In [2] corner point is defined as a point where triangle of specified angle can be inscribed within specified distance from its neighbor points. It is a two pass algorithm. In the first pass the algorithm scans the sequence and selects candidate comer points. The second pass is postprocessing to remove superfluous candidates.

4 NURBS A unified mathematical formulation of NURBS provides free form curves and surfaces. NURBS contains a large number of control variable, because of those vari-

ables it is flexible and powerful. NURBS is a rational combination of a set piecewise rational polynomial of basis functions of the form

Computing Optimized NURBS Curves

37

I P;W;B;,k(u) S(u) =

(1)

i=l n

LwiBi,k(U) i=l

where Pi are the control points and Wi represent the associated weights. parametric variable and Bi,k(U)

U

is the

is B-spline basis function [6]. Assuming basis

function of order k (degree k -1 ), a NURBS curve has n + k knots and the number

of control points equals to weights. The knot set

{ui }

is a non-decreasing se-

ic dornain vv s- U- U + . - u n+k . Th e parametnc omam is quence: ul « - u2 -< IS Uk ...- u n +k - I < k I NURBS include weights as extra degrees of freedom, which are used for geometric design [5-7].

5 Outline of Simulated Evolution (SimE) SimE is a powerful general iterative heuristic for solving combinatorial optimization problems [11, 13]. The algorithm consists of three basic steps: Evaluation, Selection and Allocation. These three steps are executed sequentially for a prefixed number of iterations or until a desired improvement in goodness is observed. The SimE algorithm starts with an initial assignment, and then seeks to reach better assignments from one generation to the next. SimE assumes that there exists a population P of a set M of n elements. A cost function is used to associate with each assignment of element m a cost Cm. The cost C; is used to compute the goodness gm of element m for each m E M. The selection step partitions the elements into two disjoint sets P, and P, based on their goodness. The elements with bad goodness are selected in the set P, and the rest of elements in the set Pro The non-deterministic selection operator takes as input the goodness of each element and a parameter B, a selection Bias. Hence the element with high goodness still has a non-zero probability of being assigned to the selected set P s • The value of the bias is application dependent. In our case the value of B has been taken as -0.5. The Allocation step takes P, and P, and generates a new solution P' which contains all the members of the previous population P. The members of P, are then worked upon so that their goodness could be enhanced in the subsequent iterations. The choice of a suitable allocation function is problem dependent [13].

6 Proposed Approach The proposed approach to the problem is described here in detail.

38

M. Sarfraz et al.

6.1 Problem Mapping This section describes about the SE formulation of the current problem in detail. In curve fitting problems, the solution space consists of the number of data points on the image boundary. The contour of the digitized image is extracted using the boundary detection algorithms. There are numerous algorithms for detecting boundary. We used the algorithm proposed by Quddus [8]. The input to this algorithm is a bitmap file and output is, number of boundary points and their values.

6.1.1 Initialization Initialization is the first step in SEe It consists of selecting a starting solution for the problem under consideration. This solution can be generated randomly or the output of any constructive heuristic. In our case from the boundary points, initial solution is created using comer detection algorithm. Comer detection algorithm divides the given image in to segments. The corner points are the only end points of the segment (S). For example if there is n number of comer points we have n-l segments. For each segment we need to calculate the parameters t, control points, knot vector and the weight of NURBS. The initial solution of weight vector is randomly selected from the range [0, 1]. The number of elements in the weight vector corresponds to the number of control points. The values of the parameters t for each segment are calculated using centripetal method. The number of control points of the segment are always equals to the order of the NURBS curve. In our proposed approach we have included the two comer points of the segment as the control points and the remaining control points are determined using least square method. Weight corresponding to each control point of a segment is taken randomly between 0 and 1. After calculating required parameters for each segment, curve is fitted using NURBS. This fitted curve for each segment is considered as the initial solution for SEe The other important parameters which are initialized in this step are a stopping condition and selection bias (B).we have taken selection bias (B) in the range of [-.1,1] and fixed number of iterations.

6.1.2 Evaluation In this step, each individual segment of the curve is evaluated on the basis of goodness. The goodness S, of each segment S, is determined by >1 gi -_ _8 _ , 8 _ Qi+ 8

(2)

This criterian is different than that discussed in [10]. In this research, we have taken 8 = (l, + k) where l, is the length of the knot vector for each segment, k is the order of the curve and Qi is sum square error between the target and the fitted curve. Qi can be defined as

Computing Optimized NURBS Curves

39

N

Qj=L{(S(Uj)_~)2}.

(3)

I

Here S(uj ) is the approximated curve and {~} is the target curve data. N is the total number of data points in each segment. The goodness gj represents a measure of how near each segment is to its optimum curve fit. As is obvious from Eqn. (2), the goodness of an element is between 0 and 1. The value of goodness gj nearer to 1 means that segment i is nearer to its optimum curve fitting. 6.1.3 Selection The goodness gj is used to probabilistically select segments (Sj) in the selection step. On the basis of the goodness gj' the selection function partitions the segments in to two sets P, and P, probabilistically. Selection function is defined as follows: If (Random [0, 1]

Suggest Documents