Re: Obtaining 2d shape from perspective image
- From: Kaba <none@xxxxxxxx>
- Date: Sat, 3 Jun 2006 02:44:52 +0300
Hi all,
I am new to 3D geometry and have the following doubt. Is there any
perspective transformation math involved while obtaining the 3D
information from a 2D perspective projection image? I know that to
calculate the 2D projected image, we have to calculate each projected
point using the transformation matrix.
To get back the original 3D shape, do I need to convert the 2D
coordinates into world coordinates first? Or is the process totally
dependent on the reconstruction algorithm? How would you approach the
problem of obtaining the depth information of the image given a
perspective projection image of a surface?
The possibility of reconstructing a 3D shape out of a 2D projection
image depends on the amount of information available.
Lets consider the geometric pipeline running as:
local space -> world space -> view space -> projection space -> screen
space
If we make the trick of using homogeneous coordinates the
transformations between local, world, view and projection spaces are
(usually chosen) linear and thus described by matrices. If these
matrices are also non-singular, the transforms are invertible and you
can trivially change from one space to another, forward or backward.
The transform from the projection space to the screen space involves a
"downcast" from homogeneous coordinates to normal coordinates. This
transform is the "divide by w": given the projective coordinates
(x,y,z,w) the transformed point is (x/w, y/w, z/w, 1) which we take
equivalent to (x/w, y/w, z/w) on the screen space.
To invert this operation, that is, to get from screen coordinates to
homogeneous screen coordinates, you clearly need to multiply every
transformed point by the w it had before the division: (x, y, z) -> (x *
w, y * w, z * w, w) If you don't have the w's, the operation is
irreversible.
The "division by w" transform has a singularity when w = 0 (a division
by zero). Thus, actually you are unable to map points with w = 0 to the
screen space. A computer graphicist deals with this problem by clipping
away everything but what's inside the view volume (most conveniently
done in homogeneous coordinates just before the divide). Of course, for
this to work it must hold that all points in the view volume have w !=
0. This is easy: just avoid the approximity of the center of projection.
So, in general you can't take all the points with you from homogeneous
screen coordinates to the screen coordinates.
Here is a quick summary:
Given the necessary input of:
- screen coordinates (x, y, z) of each point
- the projective w component of each point
- inverse of the projection transform
you are able to reconstruct the 3D points in the view space. However,
during the "division by w" transform you have already lost access to
those points with w = 0, so the reconstructed 3D points are in general
only a subset of the original 3D points. Given the additional
information of inverses of view and world transformations you can get
further backwards in the process.
Now let us be realistic. In real life you do not carry around an extra
bag of w's on your pocket. An neither do you carry around the full
geometric description of the scene in the screen space. Rather, what you
probably have is a nice 2D image with each pixel assigned a depth, and
probably, a color. In this stage it is too late to start inverting the
process. The problem is impossible to solve because it does not have
enough information to make the right deductions in 3D space.
But you must have seen 3D scenes being constructed from 2D depth images
before. The keyword here is the plural "images": given an input set of
images taken from known positions and orientations, the information that
was lost during clipping and division by w can be deduced together
again, although always just approximately, .
Construction of a 3D scene from 2D depth projections is hard and goes by
the name "image based rendering" (IBR). Google should find you a lot of
material. IBR is hardly ever discussed in this newsgroup, which might
reflect the complexity of this problem.
--
Kalle Rutanen
http://kaba.hilvi.org
.
- Follow-Ups:
- Re: Obtaining 2d shape from perspective image
- From: Bala L
- Re: Obtaining 2d shape from perspective image
- References:
- Obtaining 2d shape from perspective image
- From: Bala L
- Obtaining 2d shape from perspective image
- Prev by Date: Re: Quadratic Bezier intersection (a special case)
- Next by Date: Re: method of separating angles?
- Previous by thread: Obtaining 2d shape from perspective image
- Next by thread: Re: Obtaining 2d shape from perspective image
- Index(es):
Relevant Pages
|