Biomedical Engineering Reference
In-Depth Information
We observe that the linear method ignores the quadratic terms in Eq. (5.41). If we
have a 3D object which has rapid changes in depth, both
p
and
q
will dominate
R
(
p
,
q
), Pentland's algorithm may not provide promising results. Fortunately,
some objects do change smoothly so that linear approximation is satisfactory
to certain extent.
The algorithm can be described by the following procedure:
Step 1
. Input the original parameters of the reflectance map,
Step 2
. Calculate the Fourier transform of the depth map
Z
(
w
1
,w
2
) using
Eq. (5.39),
Step 3.
Calculate the inverse Fourier transform of the depth map
Z
(
x
,
y
)
using Eq. (5.40).
The way to realize Pentland's algorithm can be described by the following
pseudocode.
Algorithm 1.
Pentland's algorithm
Input Z
min
(mindepthvalue),
Z
max
(maxdepthvalue), (
x
,
y
,
z
)(direction of the
light so
urce),
I
(
x
,
y
)
(input image)
D
←
x
2
,
sx
←
x
/
D
,
sy
←
y
/
D
,
sz
←
z
/
D
.
sin
γ
←
sin(arccos (
lz
))
,
sin
τ
←
sin(arctan (
sy
/
sx
))
,
cos
τ
←
cos(arctan (
sy
/
sx
))
.
for
i
=
1to
width
(
I
)do
for
j
=
1to
height
(
I
)do
F
I
(
w
1
,w
2
)
←
FFT
(
I
(
i
,
j
))
+
y
2
+
z
2
B
←
2
π
(
2
2
2
) sin
(
w
1
cos
τ
+
w
2
sin
τ
)
w
1
+
w
γ
Z
(
x
,
y
)
←
IFFT
(
FI
(
w
1
,w
2
)
/
B
)
end do
end do
Normalize
(
Z
(
x
,
y
)
,
Z
max
,
Z
min
)
Out put Z
(
x
,
y
)
The subfunctions
FFT
,
IFFT
,
and Normalize
are all standard math
functions used in signal and image processing.
We now demonstrate this method by using the following example.
Example 4.
Reconstruct the surface of a synthetic vase using Pentland's
method. The experiments are based on the synthetic images that are generated
using true depth maps. Figure 5.2(a) shows the synthetic vase and the recon-
struction results using Pentland's algorithm. The light is fromabove at (x
=
1
,