The iterative formulas for solving eq. (3.115) and eq. (3.116) are

p(n+1)=p¯(n)+1λ[E(x,y)R(p(n),q(n))]R(n)p(3.117)

q(n+1)=q¯(n)+1λ[E(x,y)R(p(n),q(n))]R(n)q(3.118)

Example 3.11 The flowchart for solving the image brightness constraint equation.

The flowchart for solving Eqs (3.117) and (3.118) is shown in Figure 3.33. It in principle can be used for solving eqs. (3.53) and (3.54), too.

Example 3.12 Illustration of the shape from shading.

Two illustrations of shape from shading are shown in Figure 3.34. Figure 3.34(a) is an image of a ball and Figure 3.34(b) is the corresponding surface orientation map. Figure 3.34(c) is another image of a ball and Figure 3.34(d) is the corresponding surface orientation map.

3.4Texture and Surface Orientation

Shape from texture has been studied for quite some time, Gibson (1950). In the following, the estimation of the surface orientation based on texture distortion is discussed.

Figure 3.33: The flowchart for solving the image brightness constraint equation.

Figure 3.34: Illustration of shape from shading.

3.4.1Single Imaging and Distortion

The boundary of an object is formed by a set of consecutive line segments. When the lines in a 3-D space are projected on a 2-D image plane, several distortions can be produced. The projection of a point is still a point. The projection of a line depends on the projection of the points forming the line. Suppose that the two end points of a line are denoted W1 = [X1 Y1 Z1]T and W2 = [X2 Y2 Z2]T, and the points between them are (0 < p < 1)

pW1+(1p)W2=p[X1Y1Z1]+(1p)[X2Y2Z2](3.119)

Using the homogenous coordinates, the two end points can be represented by PW1 = [kX1 kY1 kZ1t1]T, PW2 = [kX2 kY2 kZ2t2]T, where t1 = k(fZ1)/λ, t2 = k(fZ2)/λ. The points on the line are represented by (0 < p < 1)

p[pW1+(1p)W2]=p[kX1kY1kZ1t1]+(1p)[kX2kY2kZ2t2](3.120)

Their image plane coordinates are (0 ≤ p ≤ 1)

w=[x,y]T=[pX1+(1p)X2pt1+(1p)t2pY1+(1p)Y2pt1+(1p)t2]T(3.121)

In the above, the projection results are represented by using p. On the other hand, the two end points on the image planes are w1 = [λX1/(λZ1) λY1/(λZ1)]T, w2 = [λX2/(λ–Z2) λY2/(λZ2)]t, and the points on the line can be represented by (0 < q < 1)

qw1+(1q)w2=q[λX1λZ1λY1λZ1]+(1q)[λX2λZ2λY2λZ2](3.122)

Their image plane coordinates are (represented by using q, with 0 ≤ q ≤ 1)

w=[xY]T=[qλX1λZ1+(1q)λX2λZ2qλY1λZ1+(1q)λY2λZ2](3.123)

Since the projection results represented using p are the image coordinates represented using q, eq. (3.121) and eq. (3.123) should be equal, which is given by

p=qt2qt2+(1q)t1(3.124)

q=pt1pt1+(1p)t2(3.125)

The point represented using p in a 3-D space corresponds to only one point represented using q in a 2-D image plane. The projection (except the orthogonal projection) result of a line from a 3-D space to a 2-D image plane is still a line (length can be different). For an orthogonal projection, the result would be a point.

Consider now the distortion of parallel lines. A point (X, Y, Z)on a 3-D line is

[XYZ]=[X0Y0Z0]+k[abc](3.126)

where (X0, Y0, Z0) represent the start points, (a, b, c) are the direction cosines and k is a coefficient. For a set of parallel lines, they have the same (a, b, c), but different (X0, Y0, Z0). Substituting eq. (3.126) into eqs. (2.25) and (2.26) of Volume I of this book set yields

x=λ(X0+kaDx)cosγ+(Y0+kbDγ)sinγ(X0+kaDx)sinαsinγ+(Y0+kbDy)sinαcosγ(Z0+kcDz)cosα+λ(3.127)

y=λ(X0+kaDx)sinγcosα+(Y0+kbDy)cosαcosγ+(Z0+kcDz)sinα(X0+kaDx)sinαsinγ+(Y0+kbDy)sinαcosγ(Z0+kcDz)cosα+λ(3.128)

When the line extends on both sides to infinity, k = ±∞, eq. (3.127) and eq. (3.128) are simplified to

x=λαcosγ+bsinγasinαsinγ+bsinαcosγccosα(3.129)

y=λαsinγcosα+bcosαcosγ+csinαasinαsinγ+bsinαcosγccosα.(3.130)

It is seen that the projection of parallel lines depends only on (a, b, c), but not on (X0, Y0, Z0). The parallel lines having the same (a, b, c) will cross a point after infinitive extension. This point is called the vanishing point and will be discussed below.

3.4.2Recover Orientation from Texture Gradient

The surface orientation can be determined with the help of surface texture, and particularly with the help of the appearance change of textures. The principle of the structural techniques (Section 12.3) is adopted here. The texture image is often decomposed into primitives, called texels (for texture elements).

When using the surface texture to determine the orientation of a surface, it must consider the imaging process. In this process, the original texture structure can be changed on the projection to the image. This change depends on the orientation of the surface, and carries the 3-D information of the surface orientation. The change of textures can be described by the texture gradients and classified into three groups. The methods for recovering orientation from textures can also be classified into three groups, as shown in Figure 3.35.

3.4.2.1Texel Change in Size

In perspective projection, texels that have different distances from viewers will change their apparent size after projection to the image, as shown in Figure 3.35(a). The direction of the maximum rate of the change of the projected texel size is the direction of the texture gradient. Suppose the image plane is in superposition with the paper and the view direction is pointed toward the inside. The direction of the texture gradient depends on the angle of the texel around the camera line of sight, and the magnitude of the texture gradient indicates how much the plane is tilted with respect to the camera.

Example 3.13 Depth provided by texel change in size.

Figure 3.36 presents two pictures showing the depth provided by the texel change in size. There are many pedals (texels) in Figure 3.36(a), which produce the depth impression of a scene with the gradual change of size from the front to the back. There are many columns and windows (texels) on the building in Figure 3.36(b), whose size change produces the depth impression and helps viewers to know the farthest part of the building.

Figure 3.35: Texture change and surface orientation.

Figure 3.36: Depth provided by the texel change in size.

3.4.2.2Texel Change in Shape

The shape of a texel after projection may change. If the original shape of the texels is known, the surface orientation can be induced by the texel change in shape. The orientation of surface is determined by two angles. For example, texture formed by circles will become ellipses if it is put on a tilted plane, as shown in Figure 3.35(b). Here, the direction of the principal axis specifies the angle around the camera axis, while the ratio (aspect ratio) of the major principal axis and the minor principal axis specifies the tilted angle with respect to the camera line of sight.

Suppose that the plane equation of circular texels is

ax+by+cz+d=0(3.131)

The circle can be viewed as the cross-line between the plane and a sphere that has the equation

x2+y2+z2=r2(3.132)

Combining eq. (3.131) and eq. (3.132) yields

a2+c2c2x2+b2+c2c2y2+2adx+2bdy+2abdxc2=r2a2c2(3.133)

This is an ellipse equation and can be further written as

[(a2+c2)x+ada2+c2]+[(a2+c2)y+bdb2+c2]2+2abxy=c2r2[a2d2+b2d2a2+c2]2(3.134)

Figure 3.37: A circular texel plane.

From eq. (3.134), the center point’s coordinates, major and minor principal axes can be determined. Based on these parameters, the rotation angle and tilted angle can be calculated.

Another method used to judge the deformation of circular texels is to compute the major and minor principal axes of the ellipses. Look at Figure 3.37. The angle between the texture plane and the y-axis is α. In the image obtained, not only the circular texels become ellipses but also the density in the upside is higher than the downside (forming density gradient).

If the original diameter of the circle is D, for the circle in the center, the major and minor principal axes are

Dmajor(0,0)=λDZ(3.135)

Dminor(0,0)=λDZcosα(3.136)

where λ is the focus of the camera and Z is the distance from object to lens.

Consider texels not on the axis of the camera, such as the bright ellipses in Figure 3.37. If the Y-coordinate of the texel is y, the angle between the line from the origin to the texel and the Z-axis is θ, then, Jain (1995)

Dmajor(0,y)=λDZ(1tanθtanα)(3.137)

Dminor(0,y)=λDZcosα(1tanθtanα)2(3.138)

The aspect ratio is cos α(1 − tan θ tan α), which will decrease with the increase of θ.

3.4.2.3Texel Change in Spatial Relation

If the texture is composed of a regular grid of texels, then the surface orientation information can be recovered by computing the vanishing point. For a projection map, the vanishing point is produced by the projection of the texels at infinity to the image plane. In other words, the vanishing point is the pool of parallel lines at infinity.

Figure 3.38: The regular grid of texels and the vanishing point.

Example 3.14 The regular grid of texels and the vanishing point

Figure 3.38(a) shows a projective map of a cube with parallel grids on the surface; Figure 3.38(b) illustrates the vanishing points of three surfaces.

By using two vanishing points obtained from the same regular grid of texels, the direction of the surface can be determined. The straight line that lies on the two vanishing points is called the vanishing line. The direction of the vanishing line indicates the angle that a texel is around the axis of the camera, while the cross-point of the vanishing line with x = 0 indicates the tilted angle of the texel with respect to the camera line of sight, as shown in Figure 3.35(c).

A summary of the three methods for determining the surface orientation is given in Table 3.1.

3.4.3Determination of Vanishing Points

If a texture is composed of line segments, the vanishing points can be determined with the help of Figure 3.39. In Figure 3.39(a), a line is represented by

λ=xcosθ+ysinθ(3.139)

Table 3.1: A summary of the three methods used to determine surface orientation

MethodRotation Angle Around Viewing LineTilt Angle with Respect to Viewing Line
Using texel change in sizeTexture gradient directionTexture gradient value
Using texel change in shapeThe direction of major principal axis of texelRation of texel major and minor principal axes
Using texel change in spatial relationThe direction of line connecting two vanishing pointsThe crosspoint of line connecting two vanishing points and x = 0

Figure 3.39: Determination of vanishing points.

Denote “” as a transform from one set to another set. The transform {x, y} {λ, θ} maps a line in an image space XY to a point in a parametric space ΛΘ. The set of lines in the XY space that has the same vanishing point (xv, yv) will be projected onto a circle in the ΛΘ space. Taking λ=x2+y2 and θ = arctan {y/x} into the following equation yields

λ=xycosθ+yysinθ(3.140)

Writing the result in the Cartesian system yields

(xxv2)2+(yyv2)2=(Xv2)2+(Yv2)2(3.141)

Equation (3.141) represents a circle with a radius λ=(xv/2)2+(yv/2)2 and the center (xv/2, yv/2), as shown in Figure 3.39(b). This circle is the trace of the projection of all lines, which have (xv, yv) as the vanishing points, into the space ΛΘ.

The above method for determining the vanishing point has two drawbacks: One is that detecting a circle is more complicated than detecting a line, requiring more computation; the other is when xv → ∞ or yv → ∞, it will have λ → ∞. To overcome these problems, an alternative transform {x, y} {k/λ, θ} can be used, where k is a constant. In this case, eq. (3.140) becomes

k/λ=xvcosθ+yvsinθ(3.142)

Mapping eq. (3.142) into the Cartesian system (s = λ cos θ, t = λ sin θ) yields

k=xvs+yvt(3.143)

This is a line equation. The vanishing point at infinity is projected to the origin, and all lines that have the same vanishing point (xv, yv) correspond to a line in the ST space, as shown in Figure 3.39(c). The slope of this line is −yv/xv, so this line is perpendicular to the vector from the origin to the vanishing point (xv, yv), and has a distance from the origin k/xv2+yv2. Another Hough transform can be used to detect this line. Take the ST space as the original space and denote the line in the new Hough space RW. The line in the ST space corresponds to a point in the RW space, as shown in Figure 3.39(d), with the location coordinates

r=kxv2+yv2(3.144)

w=arctan{yvxv}(3.145)

From eq. (3.144) and eq. (3.145), the coordinates of vanishing points can be calculated by

xv=k2r21+tan2w(3.146)

yv=k2tanwr21+tan2w(3.147)

3.5Depth from Focal Length

The depth of field of a thin lens depends on its focal length λ. The thin lens equation can be derived from Figure 3.40. A ray from object point P parallel to the optical axis passes through the lens and reaches the image plane. From the geometry of Figure 3.40, the thin lens equation can be derived as

1λ=1d0+1d1(3.148)

where do and di are the distances from the object and from the image to the lens, respectively.

When the projection of an object is in perfect focus on the image plane, a clear image will be captured. If moving P along the optical axis, it will be out of focus. The captured image becomes a blur disk as it also moves along the optical axis. The diameter of the blur disk depends on both the resolution and the depth of field of the camera.

Figure 3.40: Depth of field of the thin lens.

Suppose that the aperture of a lens is A and the diameter of the blur disk is D. Consider the relation between D and the depth of field. Assume that D = 1 (unit is pixel) can be tolerated, what are the nearest do(do1) and farthest do(do2)? Note that at the nearest do, the distance between image and lens is di1, while at the farthest do, the distance between image and lens is di2.

According to Figure 3.40, at the nearest do,

d11=A+DAd1(3.149)

From eq. (3.148), the nearest object distance is

do1=λd11d11λ(3.150)

Substituting eq. (3.149) into eq. (3.150) yields

do1=λA+DAd1A+DAd1λ=d0λ(A+D)Aλ+Dd0(3.151)

Similarly, the farthest object distance is

do2=λADAd1ADAd1λ=d0λ(AD)AλDd0(3.152)

The depth of field should be defined as the difference between the farthest and nearest planes for the given imaging parameters and limiting D. In this case,

Δd0=do2do1=2ADdoλ(doλ)(Ddo)2(Aλ)2(3.153)

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.39.252