• Aucun résultat trouvé

The Contracting Curve Density Algorithm (CCD)

Dans le document Advances in Pattern Recognition (Page 142-147)

Another algorithm falling into the class of fitting a curve model to supposed object boundaries is the contracting curve density algorithm (CCD) suggested by Hanek and Beetz [2]. It works on RGB color images and also utilizes a paramet-ric curve model. In addition to that, a model for the probability distribution of the curve parameters is used, too. This means that the curve model is not deter-ministic, but instead consists of a “mean” parameter vector mϕ and a covariance matrixϕ describing the joint probability distributions of the parametersϕof the curve model.

The algorithm consists of two iteration steps which are performed in alternation:

1. During the first step, local image statistics, e.g., the distribution of RGB values, are calculated for each of the two sides of the curve. To this end, the pixels in the vicinity of the curve are assigned probabilistically to a specific side of the curve with the help of the current curve model. Based on that assignment, the statistics can be estimated for each side separately.

2. The curve model consisting of the mean parameter vector and its covariance matrix is refined in the second step. This can be done by calculating the proba-bility of occurrence of the actually sensed RGB values based on the assignment of each pixel to a curve side as well as the local statistics, both derived in the first step. To put it in other words: How likely are the actually acquired RGB values to occur, given the estimates of step 1? Now the curve model is updated such that it maximizes this probability. These two steps are performed iteratively until the curve model converges, i.e., the changes of mϕ andϕ are small enough (see also Fig.6.4).

Please note that, as the local image statistics are allowed to change as the curve is traversed and can additionally be updated in each iteration step, it is possible to use dynamically adjusted criteria for the assignment of pixels to a side of the curve.

This is a considerable improvement compared to using pre-defined criteria which are applied by many conventional image segmentation schemes such as homogeneity or gradient-based information.

Fig.6.4TakenfromHanekandBeetz[2]5:OutlineoftheCCDalgorithm 5WithkindpermissionfromSpringerScience+BusinessMedia:HanekandBeetz[2],Figure7,©2004Springer.

6.3.2 Optimization

The details of the optimization procedure involve extensive use of mathematics and are beyond our focus. Therefore just the outline of the proceeding at each iteration step i shall be presented here; the interested reader is referred to the original article of Hanek and Beetz [2] for details.

The first question that has to be answered is how to assign the pixels to side n ∈ {1, 2}of the curve v. The assignment can be done by calculating a quantity ap,1(mϕ,ϕ) for each pixel p in the vicinityνof v which indicates the probability of p belonging to side 1 of the curve. It depends on the location of p relative to v as well as the curve model parameters mϕ and ϕ. Here, the term “vicinity”

means that p is located close enough to v such that it has to be considered in the optimization procedure. The probability that p belongs to side 2 of the curve is given by ap,2=1−ap,1. ap,1consists of two parts: the probabilitya˜p,1for a given vector of model parameters ϕ(which corresponds to the fraction of p which is located at side 1 of the curve and is 0 or 1 in most cases) and the conditional probability p(ϕ|mϕ,ϕ) defining the probability of occurrence of this parameter set, given the statistical properties of the model:

ap,1(mϕ,ϕ)=

˜

ap,1(ϕ)·p(ϕ|mϕ,ϕ)dϕ (6.10) Second, for each pixel p in the vicinity of the curve v(s,ϕ) the statistics of its local neighborhoods have to be modeled. To this end, a Gaussian distribution is chosen for modeling the probability of occurrence of a specific RGB value, which is char-acterized by a 3D mean vector mp,n(corresponding to the mean red, green and blue intensity) and a 3×3 covariance matrixp,n modeling their joint probabilities.

The statistics Sp,n=

mp,n,p,n

for each pixel p are calculated separately for each of the two sides of the curve, i.e., the neighborhood is separated into two parts, one for each side of the curve. mp,nandp,ncan be calculated based on weighted sums of the actual RGB values of the two parts of the neighborhood. As s increases when traversing the curve, the weights are varying (only the local neighborhood of p shall be considered) and therefore the local statistics are allowed to change, which results in a suitable neighborhood representation even in challenging situations of inhomogeneous regions.

Finally, a way of updating the curve model mϕ andϕ has to be found. To this end, a probability distribution for the occurrence of the RGB values at each pixel p (how likely is a specific value of Ip, given the statistics Sp,n?) is calculated based on the assignments ap,n as well as the local neighborhood statistics Sp,n. Again, a Gaussian distribution is chosen. It is given by

mp=ap,1mp,1+ap,2mp,2 (6.11) and p=ap,1p,1+ap,2p,2 (6.12)

Given this distribution, the probability p(Ip|mp,p) of the occurrence of the actual RGB value Ipof p can be calculated. The probability of occurrence of the sensed image data for the entire vicinityνis characterized by the product of p(Ip|mp,p) for all pixels located withinν:

p(Iν|mν,ν)="

p∈ν

p(Ip|mp,p) (6.13)

The updated mean vector miϕ+1can be set to the parameter vectorϕthat maximizes the following product:

miϕ+1=arg max

p(Iν|mν,ν)·p

ϕ|miϕ,iϕ

(6.14) iϕ+1is calculated based upon a Hessian matrix derived from this product, for details see [2].

6.3.3 Example

In Fig.6.5the exact contour of a mug is determined: starting from the initial contour estimation shown as a red curve, the algorithm converges to the contour shown in black. Estimating the contour is a difficult task here, as both the object and the background area are highly inhomogeneous in terms of RGB values due to texture, shading, clutter, and highlights.

Fig. 6.5 Taken from Hanek and Beetz [2]6showing the precise contour detection of a mug as a challenging example application

6With kind permission from Springer Science+Business Media: Hanek and Beetz [2], Fig. 2, © 2004 Springer.

6.3.4 Pseudocode

function optimizeCurveCCD (in Image I, in initial curve estimate v(ϕ0), convergence limits εm and ε, out refined curve estimate v(ϕi))

// iterative optimization i ← -1

do

ii + 1

// step 1: estimate local statistics for each pixel pν

calculate probability ap, 1 that p belongs to side 1 of the curve according to Equation 6.10

ap, 2 ← 1 - ap, 1 next

for each pixel pν

// calculate statistics Sp of the neighborhood of p for each pixel q at side 1 and in neighborhood of p

update mp, 1 and p, 1 according to q weighted by the distance between p and q

next

for each pixel q at side 2 and in neighborhood of p update mp,2 and p,2 according to q weighted by the distance between p and q

next

estimate mp and p acc. to Equation 6.11 and 6.12 next

// step 2: refine estimate of model params mϕi+1 and ϕi+1 for each pixel pν

calculate p(Ip |mp, p) and update p(Iν | mν, ν)

(probability that actual RGB values are observed; Equ.

6.13) next

mϕi+1 ← argmax of Equation 6.14 // update mean update ϕi+1 based on Hessian matrix

until ||mϕi+1 - mϕi||≤ εm ∧||ϕi+1 - ϕi||≤ ε

6.3.5 Rating

With the help of examples, the authors give evidence that the algorithm achieves high accuracy when detecting the object border even in very challenging situa-tions with, e.g., severe texture, clutter, partial occlusion, shading, or illumination variance while featuring large areas of convergence at the same time (see Fig.6.5 where the border of a mug is detected accurately despite being located in a highly

inhomogeneous background; the detection result is superior to other segmentation methods for that kind of situations). This is due to the fact that the algorithm uti-lizes a “blurred” model (probability distribution of the curve parameters) and does not blur the image content like other algorithms do in order to enlarge convergence area.

Besides, the dynamic update of the statistical characterization of the pixel neigh-borhoods especially pays off in challenging situations like the mug shown in the example. If the object and/or background regions are highly inhomogeneous, a dynamic adjustment of the statistics is clearly superior to a segmentation based on any kind of pre-defined thresholds.

On the other hand, this algorithm is rather time-consuming and relies on a reasonable starting point as well.

Dans le document Advances in Pattern Recognition (Page 142-147)