Computer Vision
Geometry Fundamentals
Planar Geometry · Projective Spaces · Applications
Comprehensive Study Notes
Table of Contents
Part 1: Planar Geometry
1. What is a Plane?
2. Plane Equation in 3D
3. Homogeneous Representation
4. Parametric Representation
5. Planar Surfaces in Images
6. Homography
7–9. Estimating Homography & DLT
10. Applications of Homography
11–14. Transformation Hierarchy
15–16. Vanishing Points & Lines
17. Plane-Induced Homography
18–20. Calibration & Rectification
21–24. Numerical Example & Summary
Part 2: Projective Spaces
1. Motivation & Introduction
2. What is Projective Space?
3–5. Homogeneous Coordinates
6. Points at Infinity
7–9. Lines, Planes & Duality
10–12. Intersections & Cross Product
13–14. Projective Transformations
15. Cross Ratio
16–18. Camera Projection & Ideal Points
19. Affine vs Projective Space
20–24. Applications & Summary
Part 3: Applications: Stitching, Correction & Rectification
1–3. Image Stitching Overview
4. Steps in Image Stitching
5. Mathematical Model
6–7. Applications & Challenges
8–10. Perspective Correction
11. Applications of Correction
12–14. Rectification Types
15–16. Stereo Rectification
17–19. Bird's-Eye View & OpenCV
20–25. Summary & Key Points
Part 1
Planar Geometry
Planar geometry studies the geometry of planes and planar surfaces in images and 3D space. It is one of
the most important topics in computer vision because many real-world objects are approximately planar.
Real-World Examples of Planar Objects
• Roads
• Walls
• Documents
• Screens
• Buildings
• Calibration checkerboards
Fundamental Applications
• Homography estimation
• Camera calibration
• Image stitching
• Augmented Reality
• Perspective correction
• Stereo vision
• 3D reconstruction
1. What is a Plane?
A plane is a flat 2D surface extending infinitely in 3D space. Common examples include table surfaces,
whiteboards, floors, and sheets of paper.
2. Plane Equation in 3D
The general equation of a plane in 3D space is:
aX + bY + cZ + d = 0
Where:
• (X, Y, Z) = any point on the plane
• (a, b, c) = the plane's normal vector n
• d = distance parameter from the origin
Plane Normal Vector
The normal vector is perpendicular to the plane surface:
n = (a, b, c)T
Geometrically, if nTX + d = 0, then the point X lies on the plane.
3. Homogeneous Representation of a Plane
In projective geometry, a plane is represented as:
π = (a, b, c, d)T
A point X = (X, Y, Z, W)T lies on the plane if πTX = 0.
4. Parametric Representation of a Plane
X = X■ + λu + µv
Where:
• X■ = a known point on the plane
• u, v = two spanning (basis) vectors lying in the plane
• λ, µ = scalar parameters
5. Planar Surfaces in Images
When a camera views a planar surface, perspective distortion occurs: parallel lines may appear to
converge, and the shape changes with viewpoint. However, the mapping between views remains
governed by a homography.
• Perspective distortion occurs on image capture
• Parallel lines may converge toward vanishing points
• Shape changes depend on camera viewpoint
• Planar mapping is always a projective (homographic) transform
6. Homography — The Core Concept
A homography is a projective transformation that maps points between two views of the same planar
scene. It is the single most important concept in planar geometry for computer vision.
Homography Equation
p' = H p
Where:
• p = point coordinates in the first image
• p' = corresponding point in the second image
• H = 3×3 homography matrix
Homography Matrix
H = | h11 h12 h13 |
| h21 h22 h23 |
| h31 h32 h33 |
Key Properties
• Homography has 8 degrees of freedom (9 elements, scale-invariant)
• Scale factor is irrelevant — only ratios matter
• Defined up to an overall multiplicative constant
7. Why Homography Exists for Planes
For planar scenes, the 3D geometry reduces to a 2D projective transformation. This dimensional reduction
is why planes are extremely useful and tractable in computer vision.
3D geometry on plane ■ 2D projective (homographic) transformation
8. Estimating Homography
To uniquely determine a homography, a minimum of 4 point correspondences is required (since H has 8
DOF and each correspondence provides 2 equations).
Minimum correspondences: 4 (p■ ↔ p■')
9. Direct Linear Transform (DLT)
DLT is the standard method for estimating the homography matrix from point correspondences. It converts
the problem into a linear system solved via Singular Value Decomposition (SVD).
• Set up a linear system Ah = 0 from correspondences
• Solve via SVD — solution is the singular vector for smallest singular value
• Normalize coordinates before applying DLT for numerical stability
10. Applications of Homography
(a) Image Stitching
Panorama generation by aligning multiple overlapping images.
(b) Perspective Correction
Rectifying tilted documents for clean fronto-parallel views.
(c) Augmented Reality
Overlaying virtual objects convincingly on planar surfaces.
(d) Camera Calibration
Checkerboard-based intrinsic parameter estimation.
(e) Planar Tracking
Tracking planar objects across video frames.
11. Affine Transformation
An affine transformation is a special (restricted) case of homography where the last row of H is [0, 0, 1]. It
preserves parallelism but not angles or lengths.
x' = Ax + t
A=|ab|
|cd|
12. Euclidean Transformation
Preserves distances and angles. Includes rotation and translation only.
x' = Rx + t
13. Similarity Transformation
Preserves shape and angles; allows uniform scaling.
x' = sRx + t
14. Hierarchy of Transformations
From most restrictive to most general:
Euclidean ⊂ Similarity ⊂ Affine ⊂ Projective
Transform Preserves Does Not Preserve DOF
Euclidean Distances, Angles — 3
Similarity Shape, Angles Scale 4
Affine Parallelism Angles, Lengths 6
Projective Collinearity, Cross-ratio Parallelism, Angles 8
15. Vanishing Points on Planes
When parallel lines on a planar surface are projected by a camera, they appear to converge at a single
point called the vanishing point. The classic example is road lanes appearing to meet at the horizon.
• Each family of parallel lines has its own vanishing point
• Vanishing points lie on the image horizon (vanishing line)
• Important for scene understanding and camera calibration
16. Vanishing Line (Horizon Line)
All vanishing points arising from parallel lines in the same plane lie on a single line called the vanishing line
or horizon line. It is used for camera pose estimation and metric rectification.
17. Plane-Induced Homography
Given two camera views of a 3D plane with known relative pose, the homography between views is
derived from the camera geometry:
H = K (R - (1/d) t nT) K-1
Where:
• R, t = relative rotation and translation between cameras
• n = unit normal vector of the plane
• d = distance from camera to the plane
• K = camera intrinsic matrix
18. Planar Calibration
Camera calibration most commonly uses planar checkerboard patterns. Because the checkerboard is
planar, homography directly relates the board's known metric coordinates to image observations, greatly
simplifying the calibration equations.
19. Rectification
Rectification removes perspective distortion from images of planar objects. Examples include document
scanning (CamScanner) and whiteboard photo correction.
20. Metric Rectification
Metric rectification recovers the true metric geometry of a planar surface — restoring correct angles and
relative distances — using geometric constraints such as known angles or the circular points.
21. Epipolar Geometry and Planes
Planes play a central role in stereo reconstruction. In the special case where all scene points lie on a
single plane, full 3D structure reduces to a homography between the two views.
22. Numerical Example
Given the homography matrix and point:
H=|201|p=|1|
|023||2|
|001||1|
Solution
Compute p' = Hp:
p' = H × p
= | 2(1) + 0 + 1 | = | 3 |
| 0 + 2(2) + 3 | | 7 |
|1||1|
Final Answer: (3, 7)
23. Advantages of Planar Geometry
• Simplifies 3D problems by reducing dimensionality
• Homography enables efficient, exact mapping between views
• Widely applicable — many real scenes are approximately planar
• Essential for camera calibration (checkerboard methods)
24. Limitations
• Assumes planarity — fails for highly non-planar scenes
• A single homography cannot recover full 3D structure
• Sensitive to incorrect feature correspondences
25. Important Formulas Summary
Plane Equation: aX + bY + cZ + d = 0
Homography: p' = Hp
Euclidean Transform: x' = Rx + t
Similarity Transform: x' = sRx + t
26. Interview & Exam Questions
Q1. What is planar geometry in computer vision?
Q2. Derive the plane equation from first principles.
Q3. Explain homography and its geometric meaning.
Q4. Why are exactly 4 point correspondences needed for homography?
Q5. Difference between affine and projective transformations.
Q6. Explain vanishing points and how they arise.
Q7. What is plane-induced homography?
Q8. List five real-world applications of homography.
Q9. Explain image rectification and its types.
Q10. Describe the full transformation hierarchy in computer vision.
27. Key Points to Remember
✔ Planes are fundamental geometric structures in computer vision.
✔ Homography relates two planar views — the core tool of planar CV.
✔ At least 4 correspondences are required to estimate a homography.
✔ Checkerboard calibration relies entirely on planar geometry.
✔ Vanishing points arise from perspective projection of parallel lines.
✔ Planar geometry is central to image stitching and augmented reality.
Part 2
Projective Spaces
Projective spaces provide the mathematical foundation for perspective projection, camera geometry,
homogeneous coordinates, vanishing points, multi-view geometry, and 3D reconstruction in computer
vision.
1. Motivation
Euclidean geometry creates problems for computer vision: parallel lines never intersect, perspective
projection is non-linear, and points at infinity cannot be represented. Projective geometry resolves all of
these elegantly by extending Euclidean space to include points at infinity.
Key Idea: In projective geometry, parallel lines intersect at infinity.
2. What is a Projective Space?
A projective space extends Euclidean space by adjoining points at infinity for every direction.
• 2D projective space: P² (the projective plane)
• 3D projective space: P³ (used for camera geometry)
3. Homogeneous Coordinates
Projective spaces use homogeneous coordinates to represent points.
Space Euclidean Point Homogeneous Form
2D (x, y) (x, y, 1) or (λx, λy, λ)
3D (X, Y, Z) (X, Y, Z, 1) or (λX, λY, λZ, λ)
4. Equivalence Relation
In projective space, homogeneous coordinates are defined only up to a non-zero scale factor:
(x, y, w) ≡ (λx, λy, λw) for any λ ≠ 0
Example: (2, 4, 2) ≡ (1, 2, 1) — both represent the same point.
5. Converting to Euclidean Coordinates
For a homogeneous point with w ≠ 0:
x■■■ = X / W
y■■■ = Y / W
Example: (4, 6, 2) ■ Euclidean (2, 3)
6. Points at Infinity
When the homogeneous coordinate w = 0, the point lies at infinity. This is the key extension that projective
geometry adds to Euclidean space.
(1, 2, 0) ■ point at infinity in direction (1, 2)
All parallel lines share the same point at infinity. In an image, vanishing points correspond exactly to these
ideal points in P².
7–9. Projective Line, Plane, and 3D Space
Space Notation Contents
Projective Line P¹ Finite points + 1 point at infinity
Projective Plane P² Finite points + line at infinity
Projective 3D Space P³ 3D points + plane at infinity
10. Lines in Projective Space
A 2D projective line is represented as a 3-vector l = (a, b, c)■.
Line equation: ax + by + cw = 0
Point-on-line: l■ p = 0
11. Duality Principle
In projective geometry, points and lines are completely dual concepts. Any theorem about points and lines
yields a new valid theorem when the words 'point' and 'line' are swapped.
• Intersection of two lines ↔ Line through two points
• Point lies on line ↔ Line passes through point
12. Intersections Using Cross Product
Intersection of lines l■, l■: p = l■ × l■
Line through points p■, p■: l = p■ × p■
13. Projective Transformations
A projective transformation (homography) maps one projective space to another via an invertible matrix H:
p' = Hp where H is an invertible 3×3 matrix
Properties Preserved by Projective Transformations
• Collinearity (points on a line remain on a line)
• Cross-ratio of four collinear points
Properties NOT Preserved
• Angles
• Lengths / distances
• Parallelism
14. Hierarchy of Geometries
Euclidean ⊂ Similarity ⊂ Affine ⊂ Projective
Projective geometry is the most general; each subset adds more structure.
15. Cross Ratio
The cross ratio is the most important invariant in projective geometry. For four collinear points A, B, C, D it
is defined as:
(A, B; C, D) = (AC / BC) / (AD / BD)
This value is unchanged by any projective transformation.
Used in: metric reconstruction and single-view metrology.
16. Projective Basis
A projective basis defines a coordinate system in projective space. Any point can be expressed as a linear
combination of basis points.
17. Camera Projection and Projective Space
Perspective camera projection maps P³ → P²:
p = PX
P = 3×4 camera matrix, X = 3D homogeneous point, p = image point
18. Ideal Points and Ideal Lines
• Ideal point: any point at infinity (w = 0)
• Ideal line: the line containing all ideal points in P²
• In images, the ideal line appears as the horizon / vanishing line
19. Affine Space vs Projective Space
Feature Affine Space Projective Space
Parallel lines Never meet Meet at infinity
Handling of infinity Not natural Natural / built-in
Coordinates Cartesian Homogeneous
Perspective projection Difficult / non-linear Elegant / linear
Typical use in CV Affine rectification Camera geometry, homography
20. Applications in Computer Vision
Camera Geometry
Foundation of perspective projection models.
Homography
Planar transformations between image views.
Epipolar Geometry
Fundamental matrix and stereo vision constraints.
3D Reconstruction
Multi-view geometry and triangulation.
Augmented Reality
Accurate pose estimation and overlay.
Image Rectification
Correcting perspective distortion in images.
21. Numerical Example
Convert the homogeneous point p = (6, 9, 3) to Euclidean coordinates.
x=6/3=2
y=9/3=3
Euclidean coordinates: (2, 3)
22. Advantages of Projective Spaces
• Unified framework for finite and infinite points
• Projection becomes pure matrix multiplication (linear algebra)
• Elegant, natural modelling of perspective imaging
• Theoretical foundation for all modern camera geometry
23. Limitations
• Less intuitive than Euclidean geometry
• Scale ambiguity — coordinates defined only up to scale
• Metric properties (distances, angles) are not preserved
24. Important Formulas Summary
Homogeneous Equivalence: (x, y, w) ≡ (λx, λy, λw)
Line Equation: ax + by + cw = 0
Camera Projection: p = PX
Homography: p' = Hp
25. Interview & Exam Questions
Q1. What is projective space and why is it used in CV?
Q2. Why do we use homogeneous coordinates?
Q3. What are points at infinity and what do they represent geometrically?
Q4. Explain projective transformations and their properties.
Q5. Difference between affine and projective space.
Q6. Explain vanishing points using projective geometry.
Q7. What is the cross ratio and why is it important?
Q8. Explain the duality principle in projective geometry.
Q9. How are lines represented in projective space?
Q10. Why is projective geometry indispensable in computer vision?
26. Key Points to Remember
✔ Projective spaces extend Euclidean spaces by adding points at infinity.
✔ Homogeneous coordinates are used throughout projective geometry.
✔ All points are defined only up to a non-zero scale factor.
✔ Parallel lines intersect at infinity in projective space.
✔ Perspective projection becomes a linear matrix operation in P³.
✔ Projective geometry is the foundation of modern camera and multi-view geometry.
Part 3
Applications: Image Stitching, Perspective Correction & Rectification
These are among the most impactful real-world applications of projective geometry and homography,
found in mobile cameras, AR systems, autonomous vehicles, satellite imaging, document scanning, and
robotics.
1. Image Stitching
Image stitching combines multiple overlapping images into a single large image called a panorama. If two
images share the same planar scene (or the camera rotates about its optical centre), the relationship
between them is exactly a homography.
p' = Hp (correspondence between overlapping images)
2. Why Image Stitching Works
For purely rotational camera motion or planar scenes, the perspective projection reduces to a projective
(homographic) mapping between image planes, making exact alignment possible.
3. Steps in Image Stitching
Step 1: Capture Overlapping Images
Images must overlap by 30–60% to provide sufficient shared content.
Step 2: Detect Features
Use robust detectors such as SIFT, SURF, ORB, or Harris corners to find salient keypoints in each image.
Step 3: Match Corresponding Features
Match descriptors between images to identify the same physical point appearing in both views.
Step 4: Estimate Homography
Use at least 4 correspondences with DLT + RANSAC. RANSAC rejects outlier (incorrectly matched)
correspondences, making estimation robust.
Step 5: Warp Images
Transform one image into the coordinate system of the other using the estimated homography
(warpPerspective in OpenCV).
Step 6: Blend Images
Smooth intensity transitions at the seam using alpha blending or multi-band (Laplacian pyramid) blending
for seamless results.
4. Mathematical Model of Stitching
| u' | | h11 h12 h13 | | u |
| v' | = | h21 h22 h23 | | v |
| w' | | h31 h32 h33 | | 1 |
Normalize: x = u'/w', y = v'/w'
5. Applications of Image Stitching
• Mobile panorama cameras (smartphones)
• Satellite and aerial imaging for large-area maps
• Medical microscope mosaics
• Virtual reality 360° scene generation
• Wide-area surveillance systems
6. Challenges in Image Stitching
Challenge Cause Mitigation
Parallax errors Camera translation Use optical-centre rotation or depth-aware stitching
Illumination changes Different exposures Exposure compensation before blending
Moving objects Scene changes between shots Ghosting reduction algorithms
Lens distortion Optical imperfections Calibrate and undistort images first
7. Perspective Correction
Perspective correction removes the projective distortion caused by photographing a planar object from an
angle, recovering a fronto-parallel (top-down or face-on) view.
• Buildings photographed from below appear to lean inward
• Tilted whiteboards appear trapezoidal
• Angled document photos have non-rectangular borders
8. Why Perspective Distortion Occurs
Perspective projection causes objects farther from the camera to appear smaller. This makes parallel lines
on a plane converge in the image, creating the apparent distortion.
9. Mathematical Basis of Perspective Correction
Perspective correction is simply a homography applied to the image:
p' = Hp
Goal: map four detected (distorted) corners to a desired rectangle.
10. Steps in Perspective Correction
Step 1: Detect Boundary / Corners
Locate the four corners of the planar object (e.g. document edges).
Step 2: Define Desired Rectangle
Specify the output coordinates — typically the corners of a standard page size.
Step 3: Estimate Homography
Compute H from the 4 corner correspondences (getPerspectiveTransform).
Step 4: Warp the Image
Apply the inverse perspective warp (warpPerspective) to produce the corrected view.
11. Applications of Perspective Correction
• Document scanning apps (CamScanner, Adobe Scan)
• OCR systems — improving text recognition accuracy
• Architectural photography correction
• Lane detection and bird's-eye road view in autonomous driving
• Sports analysis — top-view field mapping
12. Rectification — Definition and Types
Rectification transforms images into a geometrically convenient form. The goal depends on the
application.
Type Removes Restores Primary Use
Affine rectification Projective distortion Parallelism Affine measurements
Metric rectification Affine distortion Angles, distances True geometry recovery
Stereo rectification Arbitrary epipolar geometry Horizontal epipolar lines Stereo matching
13. Affine Rectification
Affine rectification removes projective distortion by mapping the vanishing line to the line at infinity,
restoring parallelism while not necessarily recovering angles or lengths.
14. Metric Rectification
Metric rectification goes further, removing affine distortion to restore true angles and relative distances — a
square appears as a square again. It uses geometric constraints such as knowledge of orthogonal
directions or the circular points of the plane.
15. Stereo Rectification
Stereo rectification is the most practically important rectification in computer vision. After rectification,
epipolar lines in both images become horizontal, meaning corresponding points lie on the same row. This
reduces stereo matching from a 2D to a 1D search — a huge computational saving.
Before rectification: epipolar lines are arbitrary
After rectification: epipolar lines are horizontal rows
Search space reduced: 2D ■ 1D
16. Epipolar Geometry in Rectification
The fundamental matrix encodes the epipolar constraint between two cameras. Stereo rectification finds
homographies H■, H■ for both images such that corresponding rows contain matching points after the
transform.
17. Bird's-Eye View Transformation
A bird's-eye (top-down) view is produced by applying a homography that maps the road/ground plane to a
horizontal fronto-parallel view. Widely used in autonomous driving, lane detection, and robotics.
18. OpenCV Functions Reference
Image Stitching
Function Purpose
detectAndCompute() Feature extraction (keypoints + descriptors)
BFMatcher() / FLANN Feature descriptor matching
findHomography() Robust homography estimation (with RANSAC)
warpPerspective() Apply homographic warp to an image
Perspective Correction
Function Purpose
getPerspectiveTransform() Compute homography from 4 point pairs
warpPerspective() Apply perspective transform to correct the image
Stereo Rectification
Function Purpose
stereoRectify() Compute rectification transforms for a stereo pair
initUndistortRectifyMap() Compute per-pixel remapping
remap() Apply the rectification maps to images
19. Numerical Example
H=|201|p=|1|
|023||2|
|001||1|
p' = Hp = | 3 | Final: (3, 7)
|7|
|1|
20. Advantages Summary
Technique Key Advantage
Image Stitching Creates wide field-of-view panoramas from consumer cameras
Perspective Correction Recovers accurate shapes; boosts OCR quality
Stereo Rectification Simplifies stereo geometry; enables real-time disparity
Metric Rectification Enables true metric measurements from single images
21. Limitations
Technique Limitation
Image Stitching Parallax errors for translating cameras; ghosting from motion
Perspective Correction Sensitive to accurate corner detection
Rectification Requires accurate calibration for metric recovery
22. Important Formulas Summary
Homography: p' = Hp
Perspective Projection: x = fX/Z, y = fY/Z
23. Interview & Exam Questions
Q1. Explain the complete image stitching pipeline step by step.
Q2. Why is homography the correct model for image stitching?
Q3. What is perspective correction and when is it needed?
Q4. Explain stereo rectification and its computational benefit.
Q5. Difference between affine and metric rectification.
Q6. What is the bird's-eye view transformation and where is it used?
Q7. Why is RANSAC essential in the stitching pipeline?
Q8. How is a panorama generated in practice?
Q9. Why do epipolar lines become horizontal after stereo rectification?
Q10. Name five applications of perspective correction.
24. Key Points to Remember
✔ Image stitching combines overlapping images into panoramas using homography.
✔ Perspective correction removes projective distortion from planar objects.
✔ Rectification transforms images into a geometrically convenient form.
✔ Stereo rectification reduces 2D correspondence search to 1D — a major speedup.
✔ Homography is the mathematical engine behind all three applications.
✔ These techniques are deployed in AR, robotics, autonomous driving, and document scanning.