• No se han encontrado resultados

The boundary detection algorithm used in the current application was a sequential type process based on three criteria; edge direction map, gradient magnitude, and connectivity. Curvature information was also used as a shape based criterion to examined the detected boundaries based on a priori knowledge o f the object boundary. The algorithm is outlined in the following sub-sections.

1) An initial boundary point is picked from a manually selected box in a high contrast region around the edge. The point which has the maximum compass gradient value is firstly

selected from inside the box, and is placed on a boundary list.

gradient masks. For the next point, only the neighbouring points which might satisfy the connectivity criterion are examined (i.e. tracking algorithm). This

reduces the number of candidate

connected neighbours to three points for each element.

3) The point which has the

maximum compass gradient value is first selected and compared with a pre-defined threshold. Then, it is considered as a candidate for the boundary if it has a gradient value above the threshold, and has not been previously marked as a bad

> 0

Figure 4.5- Shows the connectivity criterion of edges in respect to the central pixel. The direction map shows eight principal directions of the edge at the central pixel.

point. All other neighbouring points on the track are stored in a separate list known as the backtracking list if their gradients are also above the threshold.

The threshold is measured using the mean gradient value of a high contrast region (box) on the object boundary where the tracking starts. This threshold can be updated locally as the boundary of the object tracked sequentially. T is defined as T=aT^, where T^ is the average gradient value inside the box (for a fixed threshold), or along the boundary found so far (for a local threshold), ’a’ is a tolerance factor, a<l. Empirically, a=0.4 was found to be appropriate for all the applications used in this project.

4) The direction of edge at the current point is then determined by the direction of the maximum compass gradient mask, by which the connectivity check is performed. The current

point is counted as a boundary element if it satisfies the connectivity criterion. If this criterion fails for the current point, the process is continued, examining the next promising neighbouring point, and going on to step 3. An array comprised of bad paths (which stores both the bad boundary elements and bad directions; i.e. the direction of the boundary ended to the current bad element) is generated and updated accordingly.

5) If the algorithm fails to find the next acceptable boundary point, a backtracking routine is called by which the elements in the backtracking list are examined. The first element from the top o f this list is selected and the process continues if the path is not flagged as returning to the previous wrong path or the algorithm does not fail again in the new direction. Otherwise, the previous point in the backtracking list is taken into account and the process repeated.

6) If the initial point or one of its neighbours is detected during the process, the algorithm might find a close boundary. The process is then stopped (termination process) in the current slice. Steps one to six are repeated in the next adjacent slice. If the slice thickness or interslice spacing is not big (i.e. more than 2 millimetre), the selection o f initial points can be automated using the connectivity criterion.

4.3.4- Curvature and circularity check

Slope and curvature are important contour segmentation criteria used by Freeman 1967 and Rosenfeld 1973, 1975, and reviewed extensively by Pavlidis 1977-1978. These two are the most useful geometrical properties describing the shape o f a curve and the relational information among subsets o f a single digital curve or segments o f two adjacent curves. The slope at a point can be derived from its tangent vector, whereas curvature is defined as the rate o f change o f this slope. Both, slope and curvature at a point P can be defined as the slope and curvature o f a line segment on each side of P along the curve. Using a line segment enables smoothing o f the slope/curvature and thus the noise suppression on a contour is also achieved. The length o f the line segment determines the amount o f smoothing and should not be bigger than a straight line desired to match the curve segment starting at p.

Significant features on a curve are defined as the points where the absolute curvature is high (the slope changes abruptly), or where the sign o f the curvature changes. These are defined as corners (angles) and inflections, respectively. The inflections give useful information about convexity and concavity o f a curve, and are also important features o f a contour image.

Two methods were implemented for calculation o f the curvature. For a one-dimensional ciu^e y=f(x), curvature k is expressed as a function o f arc length and in terms o f the derivatives

Àrea À

%

y Àrea B A 'II' Àrsa C

Figure 4.6- Schematic of a cylinder image showing partially occupied pixels at different parts of the boundary, where the slopes arc different (see arrows) in respect to the basis coordinate axes.

K(X) = f ( x ) / ( l + ( f ( x ) ) y ^ = ( d ^ / d x ^ ) / ( l + ( d y / d x ) y ^ .

where f (x) and f (x) are the first and second derivative of the function f(x). The curvature can be defined on a digital curve (Pi=(X|,yJ, i=l,...,n) by replacing the above derivatives by differences. In this respect, a smoothed slope is considered to be (yi+k-yi)/(X|+k-^i) for some integer k>l.

The curvature can also be defined as the cosine of the angle between two k-vectors and bjk, where

Sik = (Xi-Xi+k>yryi+k) bi^ = (xrXi.k,yryi.k),

and the choice of k acts as a smoothing factor. The cosine of the angle between each two curve segments can then be expressed as

^ i k - 0 i k ' ^ i k ) / | ^ i k I I t ^ i k l »

Cue = (Ax^)(Ax')+(Ay'")(Ay’) / i{A s^ f+ (A y ^ f)/((Axf+iAy'Ÿ )), where Ax^=Xi-Xj^^, Ax'=Xi-\.k, Ay+=yryi+k, and Ay'=yi-yi.k.

Having found the curvature at every point (i=l,...,n) of a detected boundary image, their values are compared with a pre-set threshold value to check the desirability of the angles and curvatures of the boundary points (see fig 4.13). Since this curvature threshold value corresponds to a well-defined regular, and approximately a circular, shape of the head contour, this process is referred to the circularity check.

4.3.5- Experimental results

In order to see the effect of the choice of threshold value on the size of an object determined by an edge detection process, a cylindrical phantom having a known physical size was used in this experiment. This phantom was also used to calibrate and verify the parameters

le 4.1- Phantom study using threshold and gradient methods to detect edges of a 2-D phantom image (cross section of a cylinder with

Documento similar