S
S
shweps1232015-03-12 11:02:10
Mathematics
shweps123, 2015-03-12 11:02:10

Why do we need homogeneous coordinates?

Hello. Explain, please, what is the essence of homogeneous coordinates? Why do we need a fourth component in transformation matrices if we can get by with a 3x3 matrix? Can I have an example from computer graphics when the 4th component is really needed?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Mrrl, 2015-03-12
@Mrl

By and large, homogeneous coordinates are needed for the sole purpose - so that when obtaining the screen coordinates of a point, it is not necessary to distinguish between orthogonal and perspective projections. In other situations, their full support would only be a waste of resources. In terms of linear algebra, it is inconvenient to use such matrices, so a column (0,0,0,1) is added to them, and the fourth coordinate 1 is added to the coordinates of the point. De facto, in this case, we get a projective space represented by homogeneous coordinates. But for any operations on matrices and points, we will always have the last column (0,0,0,1), and the last point coordinate - 1.
I must say right away that you can’t get by with a 3 * 3 matrix. Such matrices describe only the rotation, and there are still shifts in the movements of the object and the camera in 3D. Therefore, a matrix of at least 3*4 is needed (in the convention of computer graphics, when a vector is a row and not a column).
If you know this, you can save a lot: 12 numbers instead of 16 are enough to store a matrix, 36 multiplications instead of 64 to multiply two matrices, and 9 multiplications instead of 16 to multiply a matrix by a point. I hope that they do this in real projects.
But there is one place where the last column is not equal to (0,0,0,1), and the fourth coordinate of the point may differ from 1 - this is a perspective matrix for displaying (the link has already been given to you). To display a point (x, y, z), the result of its application can be, conditionally, (x, y, z, 1) - then an orthogonal projection takes place, and the point (x, y) will be displayed, or maybe - (x, y ,-1,z) - then the coordinates of the point will be (x/z,y/z), and the projection will be perspective. One bit would be enough - how to interpret the point, whether to divide by z. But the developers of computer graphics decided that a 4 * 4 matrix and homogeneous coordinates are more efficient. They see better.

P
Peppa, 2015-03-12
@Peppa

Homogeneous coordinates are needed to study projective transformations. Actually, I don't know exactly where exactly 3D projective space is used in computer graphics, but the projective plane does appear frequently.
For example, suppose there is a flat polygon cut out of paper on a table. Then, if you take a photo, you will map the plane of the table to the plane of the photo, and your polygon will be mapped to some other polygon. Such a transformation cannot be described by a 2x2 matrix, even though you have made the transformation of the "plane" onto yourself. Therefore, in order to adequately study such transformations, homogeneous coordinates are needed.
This is important in the recognition problem. For example, you have a photograph of some object in the database. Then you want to find this object in another photo. Because when photographing you make projective transformations, then you need to look for some characteristics that do not change during such transformations, i.e. invariants. Then you can write a program that would consider these invariants, and thus compare the objects in the images with each other.

M
Mercury13, 2015-03-12
@Mercury13

All common transformations (shifts, rotations, projections) can be implemented with a 4x4 matrix.

M
Mikhail Potanin, 2015-03-13
@potan

It is more accurate and more convenient to work with remote points. In fact, they can set the direction to an infinitely distant point and it will not differ from ordinary points.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question