## 1. Introduction

In this chapter a particular image processing problem existing in quality assurance for steel industry is addressed. Since the quality standards in steel industry are ever increasing, even steel industry starts to use machine vision systems to monitor their product quality. In case of steel coils a particular figure of merit in quality is the roundness (ellipticity) or lack thereof of the coil. The mathematical correct measure of the roundness is the eccentricity*a* and the minor semi axis *b*. But the fastest way for the quality inspector is just to measure *a* and *b* of the coil and calculate their ratio

Indeed some error sources reduce the accuracy, which are discussed at the end of the chapter. The chapter is organized as follows: First the image acquisition system is described. Then the algorithm is explained consecutively in Sec. 3. Further sources of different errors are investigated in Sec. 4. Finally major results are presented (Sec. 5) and a conclusion (Sec. 6) is given.

## 2. Image acquisition system

The image acquisition setup shown in Fig. 1a consists of a camera placed on a tripod, a laser trigger unit to initiate the acquisition and a laptop to store, process and view the images. A single image frame

## 3. Algorithm

The block diagram of the algorithm, shown in Fig. 3, reflects the structure of this section. The preprocessing, circular hough transform and extraction of all curve segments

### 3.1. Preprocessing

The first preprocessing step is to crop

where *G*(*x*,*y*) is the discrete Laplacian

of the raw image. The parameter *λ* determines the sharpening power of the algorithm. Setting *λ* too large leads to a very noisy image result, since the Laplacian is very sensitive to noise. Since the sharpening process is similar to a high pass filter, any influence of the inhomogeneous natural lighting is reduced.

The next important preprocessing step is the segmentation of the image into background and foreground pixels (front side highlighted in Fig. 1a). Usually this is done by comparing the actual image to a background image only (Zivkovic, 2004). Since only a single image of the coil is available this procedure can not be applied and the results of the circular hough transform are used to first find the coils center and then to segment the coils front side, which is described in the next section.

### 3.2. Circular Hough Transform (CHT)

The circular Hough transform (Illingworth & Kittler, 1987; Peng, 2007; Peng et al., 2007) is a transform mapping points in the *x*,*y*–plane belonging to circular slopes into parameter space. Thus filling a so called accumulator. A circle in *x*,*y*–space can be described by

In parameter space it is then

Rearranging Eqn 4 yields

and transfers the problem in a form similar to the well known (line) Hough transform (HT). The accumulator of the HT, where the circles centers *r*_{i} aswell as the outer:

radius *r*_{o} (marked by a red asterisk). Local maxima in the signature curve are marked with a blue asterisk and signals the presence of a circular shape detected in the front side image.

To reduce the execution time of the CHT algorithm the preprocessed image

Due to the reduced image size the center estimation is only very rough, though fast. Furthermore the two stage concept causes the error of the center estimate to propagate further to the radius estimation in the signature curve. That’s why the signature curve is not very reliable to return the proper real inner and outer radius, respectively. When no proper radii are found, the maximum coil size is chosen to segment the coil front side, since subsequent selection criteria will be applied to the curves before they are used for the fitting process.

### 3.3. Curve extraction

To extract arc curve segments at least of some of the sheet metal layers the Canny edge detector (Canny, 1986) is applied to

First the ramifications are removed by erosion (Gonzales & Woods, 2002, pp. 525–527) with the templates shown in Fig. 6 and their permutations by 0 , 90 , 180 and 270 .

After the erosion, the resultant image *c*_{j} is a

### 3.4. Curve selection

Since the extracted curve set

To select only elliptic arc segments which are part of the coil the scalar product of*c*_{j}. Figure 8 shows two curves with typical cases indicated. Concerning an ideal round coil, the scalar product _{r} and t are normalized, the range of the result of the scalar product is [0,...,1]. The subsequently applied hysteresis thresholding technique (Nixon & Aguado, 2002) returns only reasonable curve segments for the final ellipticity estimation algorithm.

### 3.5. Ellipticity estimation

To estimate the ellipticity an ellipse fit is applied to the dataset. Curve fitting is an extensive topic and even ellipse fitting is discussed in literature very detailed (Gander et al., 1994; Matei & Meer, 2000b; Leedan & Meer, 2000; Halir, 1998; Ahn et al., 2001; Nair & Saunders, 1996; Liu et al., 2006; Lei &Wong, 1999; Fitzgibbon et al., 1999; Halir, 1998).

The paper written by Gander et al. (1994), was one of the first that covered circle and ellipse fitting using least squares and iterative methods.

Figure 10 shows typical fitting results when applying the general ellipse fit algorithm to the previously extracted arc segment dataset

In the following sections first the chosen curve fitting algorithm is described on a general way. Then the general, the simple and the new concentric ellipse fit, which incorporates the fact of the common coil center, is described in more detail.

#### 3.5.1. Curve fitting

Before doing the ellipse fit, a short introduction into curve fitting will be given. Therefore the same notation as proposed by Chernov (2007) will be used.

The principal equation for algebraic curve fitting is

with*L*unknown variables. The measured data vector

*I*element long vector, assumed to represent the true data

To estimate Θ the approximate maximum likelihood (AML) method (Chernov, 2007) is used.

The square matrices _{i} and have the size

Using these matrices for the representation of the input data many popular schemes can be used to solve the minimization problem:

(TAU) Taubin’s fit (Taubin, 1991)

(HEIV) Heteroscedastic errors–in–variables (Leedan & Meer, 2000; Matei & Meer, 2000a)

(FNS) Fundamental numerical scheme (Chojnacki et al., 2001; 2005; 2004)

(RED) Reduced scheme (Kanatani, 2005)

(REN) Renormalization procedure (Kanatani, 2005; 1997; 2008)

All of the above algorithms were tested for the concentric ellipse fitting problem and only REN showed unstable behavior. The other algorithms only vary in execution time and achieved accuracy, which is also dependent on the maximum number of iterations and the set tolerances. For additional information about these schemes we refer to Chernov (2007). In the following sections the way to obtain the

#### 3.5.2. General ellipse fitting

A general ellipse can be described by the equation for the algebraic distance

To obtain the unknown parameters *A*,..., *F* of Eqn 13 the AML method is used. Therefore the equation is written in terms u(x) and Θ.

Further we obtain

(16) |

#### 3.5.3. Simple ellipse fitting

The denotation simple ellipse fitting (SEF) is used when the simplest form of an ellipse, with the center at the origin (0,0) and no rotation, is to be fitted. Equation 12 is then simplified to

Here *a* and *b* are the major and minor semi axes and *u* and *v* are the coordinates related to the semi axis of the ellipse. To obtain *u* and *v* the ellipse must be centered in the origin thus:

to calculate

#### 3.5.4. Concentric ellipses fitting

The concentric ellipse fit takes the whole dataset

For a typical coil the first assumption is justifiable since mainly the acting force of gravity determines the orientation of the semi major axis to be horizontal. Further the requirement of constant ellipticity for all elliptic curve segments doesn’t hold here exactly and will cause a small error, but the center estimation is not affected by this fact (Schleicher & Zagar, 2009b).

First Eqn 12 is rewritten using the center coordinate *a* and *b*.

Introducing

Concerning Eqn 27 the newly introduced parameters *b*, while *b*. Therefore

using all curve segments in the dataset _{s}, which is indexed as follows: The dataset contains *J* curves indexed by *j*, where curve *j* has *M*_{j} points. A point on curve *j* is denoted by*m* is the index of the point (*m* = 1,...,*M*).

When concatenating the curves to the input data vector x a point is addressed by index *i*.

(29) |

Furthermore u(x) must also be extended to

In the general sense we can write

For the gradient we obtain

Having

Out of all parameters in *x*_{c},*y*_{c}) and parameter and *b* are calculated.

First the parameter vector

Since the other parameters and *b*

are biased due to the (invalid) assumption of equal ellipticity of all segments the simple ellipse fit (Sec.3.5.3) is done for each curve separately, using the previously estimated center coordinate

The result of the concentric ellipse fit followed by the simple ellipse fit, where the ellipticity

## 4. Error analysis

In the following sections the main error sources which influence the accuracy of the estimated ellipticity will be discussed.

### 4.1. Aliasing

When sampling in spatial coordinates the aliasing effect (Jähne, 2002; Burger & Burge, 2006) is similar to consider as the case in the time domain. To be able to reconstruct a sampled signal the sampling frequency

For a coil with a diameter of 2 m a minimum camera chip size of

in horizontal and vertical direction, respectively, is needed. This corresponds to a 32 Mpixel camera chip. Even if we neglect

Luckily the small axial displacement of the sheet metal layers with respect to each other causes some shadings which can be captured very good avoiding aliasing. Also the roughly–textured cut surface of most thick sheet metal layers improves the possibility to recognize a single layer. In the worst case when a coil has thin layers, these layers appear blurred in the image.

Further the goal is still to estimate the ellipticity and not to capture each layer. Assuming that the arc segment is recognized only by its shadow which extends from one layer to the next (one pixel = 2.5 mm in this setup), the relative error for the ellipticity is bounded by

with the major semi axis

### 4.2. Camera orientation

One possible error source is the miss–orientation of the camera. As described previously the camera chip plane should be oriented strictly parallel to the coils front side. Even when the setup is build up very carefully using a spirit level and using edges of the coils carrier for the adjustment, an error free orientation can not be obtained. For a circular coil, with radius *r* and a misalignment angle

The angle

### 4.3. Ellipticity–radius dependency

The assumption of equal ellipticity for all arc segments made in Sec. 3.5.4 leads to a erroneous . Knowing the dimensions of the coil a simulation of the ellipticity progression can be done using the following model.

Assume an ideal circular coil with the inner radius*s* and initial oil gap

The assumed maximum number of turns on the coil is

When applying a virtual vertically acting force (e.g. gravity) on this coil, it is compressed somewhat flat, the layers get elliptic and the oil gap

Or, since the oil gap is very small in ratio to the metal sheet thickness, to be a constant setting

where

Since the mass of the circular coil *m*_{c} is equal to the mass of the deformed coil

The areas are calculated by

Resolving

Figure 12 shows two simulations of the ellipticity dependency over the turn number for various coil parameter. The layer dependent oil gap

### 4.4. Estimation errors

A comprehensive analysis of the estimation errors was done by Schleicher & Zagar (2009b), whose results are summarized in this section shortly. Using synthetic curve datasets, similar to *d* the true

center

With increasing number of datasets

Furthermore the SEF algorithm was examined, concerning an erroneous center coordinate as input and arc segments with various center angles and lengths. The result was, that for a center displacement of (1,1) (which is very large in relation to

## 5. Results

Figure 13 shows the results of the algorithm described in Sec. 3. The estimated parameters of the extracted curve segments are used to overlay the ellipses onto the image of the coils front side. Furthermore the estimated ellipticities

## 6. Conclusion

This chapter introduced the problem of ellipticity estimation on hand of a practical problem. To obtain a good ellipticity estimation proper datasets must be obtained. These datasets are generally not very easy to obtain, for which reason also the preprocessing to extract the datasets was discussed in detail. Since only arc segments could be used for the ellipticity estimation, normal ellipticy fits fail. Hence the estimation was split into two parts, first to estimate the center of the coil with the concentric ellipticity estimator and then to estimate the ellipticity of the arc segments. Using the general approach for the ellipse fit, enables also to use different solver implementations for fitting problems. When discussing the errors, it was accented that a lot of error sources affect the final result. The correct understanding of the partial errors helps to optimize the corresponding section of the algorithm.