• Aucun résultat trouvé

Statistical Model

Dans le document 2D Object Detection and Recognition (Page 77-82)

4 1D Models: Deformable Curves

4.1 Statistical Model

Here we use a transform of the gray-level pixel data into a vector of binary local image featuresXa(x),a =1, . . . ,A, and write ˆI(x)=(Xa(x);a =1, . . . ,A). The main advantage is that such features can be chosen to be robust to monotone gray-level transformations, and changes in the contrast of the data along the curve will not affect the detection. Otherwise put, such features arephotometrically invariant. This is in contrast to the data models of chapter 3, which assumed a fixed mean intensity inside the object. Such data models would be very sensitive to global changes in the range of gray-level values. Furthermore, the discrete nature of the transformed data allows for simple estimation of model parameters.

4.1.1 Local Features

We assume the curve can either traverse a pixel x at one of A different angles aπ/A,a=1, . . . ,A, in which case we writeang(x)=a; or no curve traverses the pixel, in which case we writeang(x)=φ. For example, take A=4 and assume that locally each curve is either horizontal, vertical, or at±45. The notion of curve angle is quite loose and covers quite a wide range. The featureXais expected to be “on” at x—that is,Xa(x)=1, ifang(x)=a. We list here two possible definitions, ˆXaand X˜a, for these features, but many others exist. In the experiments below, we use the conjunction of these two conditions, namely,Xa(x)=Xˆa(x)·X˜a(x). If the curve is expected to be “ridgelike,” and say, brighter than its surroundings, define

Xˆa(x)=1, ifI(x) > I(x+µa) and I(x) >I(xµa) (4.1) whereµais the vector of lengthµpixels in the direction orthogonal toa, for some smallµ.

If the curve can be brighter or darker than its surroundings but relatively constant in intensity, we require the intensity differences within the curve to be smaller than those between the pixels on the curve and those alongside it.

X˜a(x)=1, if|I(x+νa)I(x)|<min(|I(x)I(x+µa)|,|I(x)I(xµa)|) (4.2) whereνais a vector ofνpixels in the direction ofa. In figure 4.1, we show the points obtained using the conjunction of conditions 4.1 and 4.2, on an axial MRI brain scan.

The original image can be found in the top right panel of figure 4.3 (in section 4.2 Computation: dynamic programming).

59 4.1 Statistical Model

Figure 4.1 The four local feature types detected on the axial MRI brain scan shown at the top right of figure 4.3, we useA=4, µ=3, ν=1.

4.1.2 The Likelihood

Clearly, the probability that Xα(x)=1 will tend to be larger if a curve of angleα passes throughx—that is,ang(x)= α. For anglesa that are different from αwe would expect the probability thatXa(x)=1 to be smaller. Denote these probabilities pα,a, α,a =1, . . . ,A. Finally, if no curve passes through the neighborhood ofx—

that is,x is a “background” pixel, the probability of Xa(x)= 1 is denoted pb and is the same for alla. Assume that given that the curve passes through the pixelx at angleα, the variables Xa(x),a =1, . . . ,Aare independent, and given no curve passes through the pixel, they are also independent. The conditional distribution of

Iˆ(x)at pixelxgivenang(x)=α—is then P(Iˆ(x)|ang(x)=α)=

A a=1

pα,Xaa(x)(1pα,a)1−Xa(x) (4.3) and given no curve passes through the pixel

Pb(Iˆ(x))=P(Iˆ(x)|ang(x)=φ)= A a=1

pbXa(x)(1−pb)1Xa(x) (4.4) Given an instantiationθ=1, . . . , θn)of the curve, we assume the data ˆI(x),xL to be conditionally independent. LetLi be the pixels on the segment connecting the pointsθi, θi+1and letL(θ)be the union of the setsLi. Also, letαidenote the angle of theith segment. Associated to eachxL(θ)there is a specific angleang(θ,x)—the angle of the segment to which the pixelxbelongs. The conditional distribution of ˆI, on the entire lattice, given the instantiationθis then

P(Iˆ|θ)= nocurve is present, and does not depend onθ, and substituting 4.4 and 4.3, we obtain a likelihood ratio of the form total number of pixels along this segment. The log-likelihood is thus up to a constant given by a sum of functions of the counts along the segments of the curve.

logP(Iˆ|θ)

61 4.1 Statistical Model

We are again making strong conditional independence assumptions that are clearly a gross simplification. However, the data model is simple and transparent and does depend on the angle of the curve in a direct way. Furthermore, as in the previous chapters, the model is created with the computational task in mind. The log-likelihood is simply a linear function of the counts. In this equation, the dependence on the data Iˆis throughNi a. It is also useful to note for later computational considerations that the log-likelihood can be written in the form

n−1

i=1

ψ(Iˆ, θi, θi+1) (4.8)

where the functionsψdepend only on the two consecutive pointsθi, θi+1and on the data ˆIalong the segment connecting them.

Under this data model, the maximum likelihood estimates of the parameters are obtained from training sample proportions. Take training subimage samples from each of the categories:α=1, . . . ,A. For eachα, obtain the proportion for which Xa(x)=1,a =1, . . . ,Ato produce an estimate ˆpα,a. An estimate ofpbis obtained from subimages with no curve, estimating one pooled probability for P(Xa(x) = 1|ang(x)=φ), for allas.

The model can be simplified by settingpα,a=pcifα=a, meaning thatP(Xa(x)= 1|ang(x)=a)=pcfor anya =1, . . . ,Aand pα,a = pb ifa =α, meaning that the probability ofXa(x)=1 ifang(x)=ais the same as the background probability.

The likelihood ratio then has the simpler form P(Iˆ|θ) In this case, parameter estimation also simplifies. Estimate one parameterpc=pa,a

for alla =1, . . . ,A, pooling together all subimage samples containing a curve of any angle. For eachaletna be the number of training subimages labeled with angle a, and letna,1be the number of these for whichXa(x)=1. Then estimate pcas

The parameter pbis estimated from training subimages identified as not having any curve.

Training samples are either obtained by hand with the user pointing out pixels with curves of theAdifferent angles and pixels with no curve. Alternatively, one can start

with initial parameter settings, detect the curve, and use pixels on and off the detected curve to update the parameters.

4.1.3 The Prior and the Posterior

The curve is parameterized directly through the locations of thenpointsθ1, . . . , θn. It is important to include a prior penalizing irregular nonsmooth curves. This can have a variety of forms. For example, a penalty on high curvature can be written as P(θ1, . . . , θn)∝exp triple of consecutive points and is entirely scale invariant. Such penalties are useful when there are no particular prior assumptions on the shape of the curve. If the model or template has a particular shape and we do not expect significant variations in scale or rotation, the functionsφi can be simplified to depend only on consecutive pairs.

In the examples below, we compare angles and lengths between a pair of consecutive points in the instantiation and the corresponding pair in the model sequence:

φii, θi+1)=A|ang(θi+1θi,zi+1zi)| +B|log(|θi+1θi|/|zi+1zi|)| This is a simple prior that independently penalizes deviations in angle and length of individual segments of the deformed curve from their counterparts on the template curve. The higher-probability instantiations will tend to have a shape similar to the model curve(z1, . . . ,zn).

Putting the data model from equation 4.8 together with the prior of equation 4.11, we write a negative log-posterior of the form

J(θ)= −logP(θ1, . . . , θn |Iˆ)=

n1

i=1

ii, θi+1)+C (4.12)

63 4.2 Computation: Dynamic Programming

where

ii, θi+1)=φii, θi+1)ψi(Iˆ, θi, θi+1), i =1, . . . ,n−1 withψidefined in equation 4.8 andφidefined in 4.10.

Dans le document 2D Object Detection and Recognition (Page 77-82)