Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Kluwer - Handbook of Biomedical Image Analysis Vol

.1.pdf
Скачиваний:
106
Добавлен:
10.08.2013
Размер:
10.58 Mб
Скачать

Shape From Shading Models

285

p Z(i, j) − Z(i, j − 1) q Z(i, j) − Z(i − 1, j)

end do

end do

Normalize(Z(x, y), Zmax, Zmin) Output Z(x, y)

The subfunction Normalize is a standard math function used in signal and image processing.

We now demonstrate this method by using the following example.

Example 6. Reconstruct the surface of a synthetic vase using the Zheng– Chellappa method.

The experiments are based on the synthetic images that are generated using true depth maps. Figure 5.4(a) shows the same synthetic vase as in the previous section and the reconstruction results using Pentland’s algorithm. The light is from above at (x = 0, y = 0, z = 1). The input image is showed in Fig. 5.4(a). The surface, shown in Figs. 5.4(b), (c), and (d), is the reconstructed depth map from three different directions. Zheng–Chellappa algorithm produces reasonable results as expected for the vase. However, some errors can be seen around the boundary of the vase. In general, the experiment shows that Zheng–Chellappa’s algorithm can reasonably reconstruct the object on the surface. The most important advantage of Zheng–Chellappa’s algorithm is that the optimization approach is not limited to the situation where the reflectance map changes linearly with respect to the surface shape.

Example 7. Reconstruct the surface of a synthetic Mozart using Zheng– Chellappa’s method.

The experiments are also based on the synthetic images that are generated using true depth maps. Figure 5.5(a) shows the synthetic Mozart and the reconstruction results using Zheng–Chellappa’s algorithm. The light is from above at (x = 0, y = 0, z = 1). The input image is showed in Fig. 5.5 (a). The result image, shown in Figs. 5.5(b), (c), and (d), is the reconstructed depth map from three different directions. The recovered surface is well outlined as expected for the human’s head. However, the details of Mozart cannot be accurately recovered using their approach. In our opinion, this is due to the rapid changes and complexity of the input image. Although the results can be improved by prefiltering and smoothing the input image, in general, we conclude

286

Shen and Yang

Figure 5.4: Zheng–Chellappa’s linear SFS algorithm applied to the synthetic vase image. (a) is the input image with light source (x = 1, y = 0, z = 1). (b), (c), and (d) are the reconstructed surface from three different directions.

from the experiment that Zheng–Chellappa’s algorithm does encounter some difficulties when the input image is complex. This observation is also true even if we used the simplest light source direction. We expect this experiment to inform the readers that SFS problem is indeed one of the most difficult problems in computer vision. No perfect, or even satisfactory, solution has been proposed yet.

We summarize this section with a few words about the advantage and disadvantage of these two methods we introduced in this section. Pentland’s method uses FFT and IFFT to calculate the depth map. This makes the algorithm relatively nonsensitive to the initial values. However, there are a few disadvantages:

(1) When the light source direction and the viewing direction are similar, the Fourier transforms of p2 and q2 will have a doubling effect in the frequency

Shape From Shading Models

287

Figure 5.5: Zheng–Chellappa’s linear SFS algorithm applied to the synthetic Mozart image. (a) is the input image with light source (x = 0, y = 0, z = 1). (b), (c), and (d) are the reconstructed surface from three different directions.

domain, which will affect the accuracy of the linear approximation. (2) When applying FFT and IFFT to the whole image, Pentland’s algorithm needs more time than Tsai–Shah’s approach. Tsai–Shah’s algorithm uses Newton’s method to solve the quadratic equations. When the initial value is close to the exact solution, Tsai–Shah’s algorithm converges very fast. Actually, given certain good initial values, Tsai–Shah’s algorithm needs several steps to converge. However, it is well known that Newton’s method cannot always guarantee convergence. This disadvantage makes Tsai–Shah’s approach sensitive to initial estimation than Pentland’s.

The discussion in this subsection has also shown us that the linear approach is conceptually simple. The related algorithms are relatively fast and easy to

288

Shen and Yang

implement. However, the reconstruction accuracy of this kind of methods is limited. The assumption of simple linear models is not quite satisfactory for the actual objects (see Section 5.2.3.2). Therefore, more advanced methods, such as multiscale methods, are introduced to overcome the disadvantage of these linear approaches. As an example, we will introduce a wavelet-based method in the following section.

To end this section, we would like to acknowledge the website http:// www.cs.ucf.edu/˜vision/source.html; all the source codes used in this section can be found in this site.

Finally, we will iterate the importance of the direction of the light source. We recall that the brightness of an object depends on the following three factors:

(1)microstructure of the surface,

(2)distribution of the incident light,

(3)orientation of the surface with respect to the view and light source.

It is notable that if we change the direction of the light source, the irradiance map will be changed coordinately. This will have an impact on the convergence properties for certain numerical methods (see Section 5.3 and [64]).

5.4 Wavelet-Based Methods

Wavelet theory has been enthusiastically adopted by people in the area of signal and image processing. It has been proved to be a useful tool in many applications. A wavelet-based shape from shading method was introduced in [31]. Unlike methods introduced in Section 5.3, the objective function in the constrained optimization problem is replaced by its projection to the wavelet subspaces. To understand this approach, we first recall some elements in wavelet theory.

5.4.1 Background of Wavelets Analysis

5.4.1.1 1D Wavelets

To begin with, we present here a few elements of one-dimensional orthogonal wavelet theory, in which an orthonormal basis {ψmn} of L2(R) is constructed

Shape From Shading Models

289

having the form

ψmn(t) = 2m/2ψmn(2mt n), n, m Z,

where ψ (t) is the “mother wavelet.” Usually it is not constructed directly but rather from another function called the “scaling function” φ(t) L2(R). The

scaling function φ is chosen in such a way that

 

 

 

 

 

 

 

 

 

 

 

(i)

( φ(t)φ(t n)dt = δ0,n,

 

n Z,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2

 

 

 

 

 

 

(ii)

φ(t)

 

 

2c

φ(2t

 

 

k),

c

 

 

 

 

 

,

 

 

 

 

 

 

 

 

 

 

k k

Z

 

l

 

 

 

 

 

 

 

 

 

 

 

 

k

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

=

−∞

 

 

 

 

{ }

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(5.62)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(iii) for each f L (R), > 0, there is a function

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

m

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

fm(t)

 

amnφ(2

 

t

 

n) such that

 

 

fm

f

< .

 

 

 

 

 

=

n

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

=−∞

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

These

conditions lead to a “multiresolution approximation”

 

Vm m Z

, consist-

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

{

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

}

 

ing of closed subspaces of L2(R). The space Vm is taken to be the closed linear span of {φ(2mt n)}n Z . Because of (5.62) (ii), the Vm are nested, i.e. Vm Vm+1 and because of (5.62) (iii), mVm is dense in L2(R).

There are many different types of wavelet bases created and employed for different purposes. They can be classified as time-limited wavelets, such as Haar wavelets and Daubechies wavelets, band-limited wavelets, such as Shannon and Meyer wavelets. Another standard prototype is the Haar system in which

φ(t) = χ[0,1](t), where

χ[0,1]

= 1,

x [0,1],

 

0,

x /[0,1]

is the characteristic function of [0, 1]. It is an easy exercise to show that (5.62) is satisfied. This prototype has poor frequency localization but good time localization. Most of the other examples found, e.g., in [12] and [66], attempt to get fairly good time and frequency localization simultaneously.

The various scales are related by the dilation equation of the scaling function

φ(t) = 2

cnφ(2t n),

(5.63)

n=−∞

ψ (t) = 2

dnφ(2t n),

 

n=−∞

where dn = c1−n(−1)n.

290

Shen and Yang

In addition, the Fourier transform of the mother wavelet ψ (t) vanishes in a neighborhood of the origin. We denote by Wm the closed linear span of {ψ (2mt n)}. This set of functions form an orthogonal basis of L2(R). That is,

Vm = Vm−1 Wm−1

L2(R) = m=−∞ Wm

For f L2(R), we have the projections onto the subspace Vm and Wm respectively given by

fm(t) = Pm f (t) =

am,n2m/2φ(2mt n),

(5.64)

 

n=−∞

 

 

 

f m(t) = Pm f (t) =

 

 

bm,n2m/2ψ (2mt n),

(5.65)

n=−∞

where

am,n = 2m/2 f (x)φ(2mt n)dx,

bm,n = 2m/2 f (x)ψ (2mt n)dx.

−∞

The coefficients aj,n and b j,n at resolution j = m and j = m + 1 are related by a tree algorithm. To see this, we space V1, we have two distinct orthonormal bases:

 

 

 

 

 

 

 

 

and

)√2φ(2x n)*n=−∞

 

 

 

 

 

 

 

 

 

 

{φ(x n), ψ (x k)}n,k=−∞ .

 

Hence each f V1 has an expansion

 

 

 

 

 

 

 

 

 

 

 

 

 

 

f (x) =

a1,n

 

2

φ(2x n)

 

 

n=−∞

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

=

a0,nφ(x n) + b0,nψ (x n).

 

 

n=−∞

 

 

 

 

 

 

 

By (5.63) we have

 

 

 

 

 

 

 

 

 

 

 

 

 

 

a1,n =

 

 

 

 

 

 

cn−2ka0,k +

 

 

(−1)n−1c1−n+2kb0,k,

(5.66)

 

k=−∞

 

 

 

k=−∞

 

Shape From Shading Models

291

which is the reconstruction part. The decomposition is even easier: We need merely use the formulas for an0 and bn0 to find

a0,n

b0,n

 

 

 

 

= −∞ f (x)φ(x n)dx = −∞ f (x)

 

ck

 

φ(2x − 2n k)dx (5.67)

k

2

 

 

 

 

 

 

= cka1,2n+k = a1,kck−2n,

 

 

 

 

k

k

 

 

 

 

 

 

 

 

 

 

= a1,k(−1)k−1c1−k+2n.

 

 

 

 

k

This works at each scale to give us the tree algorithm for decomposition (5.67),

 

bm−1,n

b0,n

 

 

 

· · · −→ am,n −→ am−1,n −→ · · · −→ a1,n −→ a0,n −→ · · ·

and for reconstruction (5.66),

 

b0,n

b1,n

bm−1,n

 

 

 

· · · −→ a0,n −→ a1,n −→ · · · −→ am−1,n −→ am,n −→ · · · .

Thus we need calculate the coefficients from the function f (t) only once at the finest scale of interest. Then we work down to successively coarser scales by using this decomposition algorithm, with the error at each successive scale corresponding to the wavelet coefficients. These algorithms are called Mallat algorithms (see [39]).

5.4.1.2 2D Separable Wavelets

In order to represent an image using wavelet bases, we need to construct a basis for L2(R2). There are two different methods to do so. One way is based on the multiresolution analysis in 2D space to construct 2D wavelet basis directly, while another way is based on the tensor product of the 1D wavelets. The former usually leads to a nonseparable basis, while the latter derives a separable basis. Here we merely consider the separable basis, which is based on the separable multiresolution analysis of L2(R2).

292

Shen and Yang

Let {Vm} be a multiresolution of L2(R); a separable two-dimensional multiresolution is composed of the tensor product spaces

 

 

Vm2 = Vm Vm.

 

 

The space V 2

is the set of the finite energy functions that are linear expan-

 

m

 

 

 

sions of the set of the separable bases φm,k,l (x, y)

, while the correspondent

 

 

 

k,l=0

 

wavelet subspace Wm2 is given by the+close linear,span of

 

 

 

 

where

+φm,k(x)ψm,l (y), ψm,l (x)φm,k(y), ψm,k(x)ψm,l (y),k,l=0

 

 

m

k),

(5.68)

 

 

φm,k(x) : = 2 2 φ(2mx

 

 

m

k),

 

 

ψm,k(x) : = 2 2 ψ (2mx

φm,k,l (x, y) : = φm,k(x)φm,l (y).

Like in 1D case, we have

V 2 = V 2W 2 = (Vm Vm) W 2 ,

m m 1 m 1 m 1

Wm2 = (Vm Wm) (Wm Vm) (Wm Wm),

and

L2(R2) = m=−∞ Wm2 .

Wells et al. [67] proved the following theorem.

Theorem 8 (Wells and Zhou). Assume the function f C2( ), where is

a bounded open set in R2. Let

 

 

 

 

 

 

 

 

 

 

 

 

 

f (x, y) :

1

 

 

f (

k + c

,

 

l + c

)φ

 

(x)φ

 

(y),

x, y

 

,

(5.69)

 

 

 

 

 

 

 

 

m

= 2m

k,l

 

2 j

 

 

2 j

 

m,k

 

m,l

 

 

 

 

+

 

 

 

 

 

 

1 2

,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

where = k Z :

supp(φm,k) ∩ =

 

is the index set and

 

 

 

 

 

 

 

N 1

 

c =

2

k=0

kck.

Then

 

|| f fm||L2 ( ) C(1/2m)2,

where C is dependent on the diameter of , the first and second moduli of the firstand second-order derivatives of f on .

Formula (5.69) is the one which was used in the wavelet-based SFS method. Now we are ready to introduce this method.

Shape From Shading Models

293

5.4.2 The Wavelet-Based SFS

A wavelet-based method was developed in [31]. Instead of using the constraints in Zheng–Chellappa’s method (see Section 5.3.2.1), the authors introduced a new constraint (5.20). It is said that “the new constraint not only enforces integrability but also introduces a smoothness constraint in an implicit manner.” Now the energy function is defined as

W =

[(E(x, y) − R( p, q))2 + ( px2 + p2y + qx2 + qy2)

(5.70)

 

+ (zx p)2 + (zy q)2 + (zxx p)2 + (zyy q)2 ]dx dy.

 

The objective function is first replaced by its approximation in scaling space V0 of Daubechies wavelets. Then the variational problem is solved by an iterative algorithm. We now describe this method.

We assume that the given image size is M × M. The surface Z(x, y), its partial derivatives Zx = p(x, y), and Zy = q(x, y) have projection to V0, the scaling space at level 0:

 

 

 

 

 

 

 

 

M−1 M−1

 

 

 

 

 

 

 

 

 

 

 

 

 

Z(x, y) =

Zk,l φ0,k,l (x, y),

 

 

 

 

 

 

 

 

 

 

k=0 l=0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

M−1 M−1

 

 

 

 

 

 

 

 

 

 

 

 

 

p(x, y) =

pk,l φ0,k,l (x, y),

 

(5.71)

 

 

 

 

 

 

 

 

k=0 l=0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

M−1 M−1

 

 

 

 

 

 

 

 

 

 

 

 

 

q(x, y) =

pk,l φ0,k,l (x, y).

 

 

 

 

 

 

 

 

 

 

k=0 l=0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Denoting

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

φ0(x,k),l (x, y) =

 

 

φ0(xx,k,)l (x, y) =

 

2

 

 

 

 

 

 

φ0,k,l (x, y),

 

 

 

φ0,k,l (x, y),

 

 

 

∂ x

∂ x2

 

 

φ0(,yk),l (x, y) =

 

 

φ0(,yyk,)l (x, y) =

 

2

 

 

 

 

φ0,k,l (x, y),

 

φ0,k,l (x, y),

 

 

∂ y

∂ y2

 

substitute (5.71) in each term of (5.70) to get

 

 

 

 

 

 

 

 

 

 

 

M 1

 

 

M 1

 

 

 

 

2

 

W =

 

 

 

 

 

 

 

 

 

 

 

(5.72)

E(x, y) − R(k,l0

pk,l φ0,k,l (x, y), k,l0 qk,l φ0,k,l (x, y)) dx dy

 

 

 

 

=

 

 

 

=

 

 

 

 

 

 

 

 

 

 

 

2

 

 

 

 

 

 

2

 

 

M−1

 

 

 

 

M−1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

+ k,l

=

0 pk,l φ0(x,k),l (x, y)

+ k,l

=

0 pk,l φ0(,yk),l (x, y)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

294

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Shen and Yang

 

M−1

 

 

 

 

2

 

 

M−1

 

 

 

 

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

+ k,l

=

0 qk,l φ0(x,k),l (x, y)

 

+ k,l

=

0 qk,l φ0(x,k),l (x, y) dx dy

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

M−1

 

 

 

 

 

 

M−1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2

 

 

 

+

 

k,l

=

0 Zk,l φ0(x,k),l (x, y) k,l

=

0 pk,l φ0,k,l (x, y)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

M−1

 

 

 

 

 

M−1

 

 

 

 

 

 

 

 

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

+ k,l

=

0 Zk,l φ0(,yk),l (x, y) k,l

=

0 qk,l φ0(x,k),l (x, y)

dx dy

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

M−1

 

 

 

 

 

M−1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2

 

 

 

 

k,l

=

0 Zk,l φ0(xx,k,)l (x, y) k,l

=

0 pk,l φ0(x,k),l (x, y)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

M−1

 

 

 

 

 

M−1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

+ k,l

=

0 Zk,l φ0(,yyk,)l (x, y) k,l

=

0 qk,l φ0(,yk),l (x, y)

dx dy.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

There are total of 3M2 unknown variables (they are the function samples of

Z, p, and q):

+ , + , + ,

pk,l , qk,l , and Zk,l ,

where the indices run on M × M grid (see (5.69)).

It is remarkable that the interpolating property (5.69) simplified the computation significantly. The integrals we need to compute in energy function are only involved with the integrals which are the inner product of the scaling function φ(x, y) := φ0,0,0(x, y), its shifting φk,l (x, y) := φ0,k,l (x, y), and their partial derivatives of first and second orders. Note that we have dropped the scale (or the resolution) index 0 for simplicity, since the discussion here does not relate to other scales. Now we assume that the scaling function φ is the Daubechies scaling function with 2N + 1 filter coefficients ci (see (5.63)). These definite integrals are called connection coefficients [5]:

x(4)(k, l) = φ(xx)(x, y)φk(xx,l )(x, y)dx dy = (4)(k)D(l),

(4)y (k, l) = φ(yy)(x, y)φk(,yyl )(x, y)dx dy = D(k) (4)(k),

xy(4)(k, l) = φ(xy)(x, y)φk(xy,l )(x, y)dx dy = (2)(k) (2)(l),