[Tech Blog] Homogeneous Coordinates in Computer Vision
Introduction to Homogeneous Coordinates
Homogeneous coordinates are an extension of conventional Cartesian coordinates used in projective geometry. They allow geometric transformations such as translation, rotation and scaling to be represented and manipulated within a unified framework. Using homogeneous coordinates simplifies the mathematical representation of these transformations and makes computation more efficient and straightforward.
What Are Homogeneous Coordinates?
In 2D space, a point (x, y) in Cartesian coordinates is represented in homogeneous coordinates as (x, y, w), where w is a non-zero scalar. For convenience, w = 1 is usually chosen, so the point (x, y) becomes (x, y, 1). This representation extends to 3D space as well: the point (x, y, z) becomes (x, y, z, w).
Why Use Homogeneous Coordinates?
- Unified representation of transformations: With homogeneous coordinates, translation, rotation and scaling can all be expressed as matrix multiplications. This unification simplifies the implementation of complex transformations.
- Projective geometry: Homogeneous coordinates can represent points at infinity, which is useful in projective transformations and computer graphics.
- Computational convenience: Operations that are not linear in Cartesian coordinates (for example, translation) become linear in homogeneous coordinates. This makes computation with matrix algebra more efficient.
Homogeneous Transformation Matrices
Translation
The homogeneous matrix for translating a point (x, y) by (tx, ty) is:
(1 0 tx)
(0 1 ty)
(0 0 1 )
Multiplying this matrix by the point (x, y, 1) in homogeneous coordinates gives the new point (x + tx, y + ty, 1).


Rotation
The rotation matrix for rotating a point (x, y) about the origin by an angle θ is:
(cos θ - sin θ 0)
(sin θ cos θ 0)
(0 0 1)
Multiplying this matrix by the point (x, y, 1) gives the point (x cos θ - y sin θ, x sin θ + y cos θ, 1).


Scaling
The matrix for scaling a point (x, y) by sx in the x direction and sy in the y direction is:
(sx 0 0)
(0 sy 0)
(0 0 1)
Multiplying this matrix by (x, y, 1) gives the scaled point (sx x, sy y, 1).


Conclusion
Homogeneous coordinates play an important role in computer vision and graphics and are a powerful tool for handling geometric transformations. Representing points and transformations in a unified matrix form simplifies the process of manipulating and transforming images and shapes. Thanks to this mathematical elegance and computational convenience, homogeneous coordinates have become an essential concept in computer vision.


