2.The representatives of object surface
Considering the complexity of the processed
buildings, we adopt two kinds of data
structure to represent the surfaces of the
building. Being a single valued function, it’s
difficult for 2D TIN to express the breaking
and hiding relation of multiple surfaces. So,
we adopt multiple TINs to express
disconnected surfaces. As for some more
complex surfaces, such as cylinder, sphere
etc, we use a series of triangles to express
them. As shown in Fig.2, the surface in Z
direction can not be a part of a TIN.
Fig.2 Hiding and visibility
In order to express surfaces exactly, the
constraints of edge between surfaces must
be taken into account. The constrained TIN
generator we use is a shared program by
Jonathan Richard Shewchuk.
3.The building of depth map image
Depth map in ortho direction is relatively
simple. It’s a rasterization processing for
every triangle. The depth of raster point can
be interpolated linearly. But the depth maps
of original photos are very different. As we
know, projective transformation is nonlinear,
the depth of raster point can not be
interpolated linearly.
On original photos, the depth of raster point
has to be computed according to the object
space coordinates. As shown in fig.3.the
ray Sp can be expressed as EQ.1.the plane
P
1P
2P
3 can be expressed as EQ.2. The
intersection point P(X,Y,Z) of ray Sp and
triangle P
1P
2P
3 can be solved from equations
EQ.1 and EQ.2.
Fig.3 Intersection of ray and triangle
where,
(X, Y, Z) = intersection of ray Sp and triangle P1P2P3
(Xi, Yi, Zi) =
vertices of triangle P1P2P3
(Xs, Ys, Zs,) = projective center S
l = photoscale
(x, y) = photo point
f = principal distance
depth = (Z max - Zp) * depthScale (4)
where:
depthScale = depth scale from actual depth to the range of WORD
Zmin = the minimum Z coordinate of objects
Zmax = the maximum Z coordinate of objects
Zp = the coordinate of object point P
depth = the depth of Point P in WORD range
The resolution of depth maps can not be
lower than the resolution of processed
images. And the range of depth maps can be
determined according to the range of
surfaces data. Considering the conflicts
between the precision and the memory
needs, we choose a WORD (unsigned short
integer, whose size is two bytes) to express
the depth. The range of WORD is between 0
and 65535. The depth value of every point
can be map into the range with EQ4. The
depth scale can be computed with EQ.3.
4.Visibility judgement and orthoimage
generating
When generating orthoimage, triangles are
scanned one by one, depth of every raster
point are computed according to EQ.4. If the
depth is not larger than the depth registered
on ortho depth map, then the point is visible.
The pixel value of the point has to be
resampled on the photo on which the point
is both visible and nearest to the projective
center.
Different from general hiding processing,
the point projected from ortho image seldom
happened to be on the pixel center of
original images. Therefore, not only pixel
values but also depth values need to be
interpolated. Pixel value can be interpolated
with bilinear interpolation or bicubic
convolution. But depth values can not be
interpolated simply according to the
neighboring depth values, for the non-linearity
of projective transformation.
Fortunately, we can turn to the visibility of
the neighboring pixel. That is to project
neighboring pixel onto the currently
processed triangle, if the depth of projective
point is not larger than the depth value of
depth map, then the neighboring pixel is
visible. If every neighboring pixel is visible,
the interpolated point is also visible on the
image. Otherwise, if the point is near the
edge, then if more than two neighboring
pixels are visible, then we say the point is
also visible.