This draft algorithm page mirrors the rich markdown feature coverage of the blog pipeline so the /algorithms/* route is exercised with the same authoring tools. It also provides explicit internal links to the intro post and the Harris detector page.
Typography Basics
Body text is rendered in Source Serif 4 at 18px with a line height of 1.75. This creates comfortable reading rhythm for technical prose. The maximum line width is constrained to approximately 68 characters, which is optimal for sustained reading.
Paragraphs have generous spacing between them. Bold text stands out clearly, while italic text provides subtle emphasis. Links like the algorithms index use a steel blue color with a subtle underline that becomes more prominent on hover.
Heading Hierarchy
Headings use Inter (sans-serif) to create clear visual contrast with the serif body text. The spacing above headings is generous to signal new sections, while the space below is tighter to keep the heading connected to its content.
Fourth-Level Heading
Fourth-level headings are used sparingly for fine-grained structure within subsections.
Lists
Unordered lists with improved spacing:
- First item with comfortable line height
- Second item demonstrating consistent bullet appearance
- Third item with a longer description that wraps to multiple lines to verify that the indentation and line height remain comfortable
Ordered lists:
- Normalize the image coordinates using an isotropic scaling transformation.
- Assemble the linear system from point correspondences.
- Compute the SVD of and extract the null space vector.
- Reshape the solution into the homography matrix .
Nested lists:
- Camera models
- Pinhole model
- Fisheye model
- Omnidirectional model
- Calibration methods
- Zhang's method
- DLT (Direct Linear Transform)
Inline Math and Display Math
The homography matrix maps points between two views when all observed points lie on a plane. Given a camera intrinsic matrix , rotation , and translation , the plane-induced homography is:
where is the plane normal and is the distance from the camera center to the plane.
The reprojection error for a point correspondence is defined as:
Equation \eqref{eq
} is the linear system solved in Direct Linear Transform, and \ref{eq} is where the homogeneous constraint first appears on the algorithm route.Code Blocks
Python example with syntax highlighting:
import numpy as np
from numpy.linalg import svd
def normalize_points(pts: np.ndarray) -> tuple[np.ndarray, np.ndarray]:
"""Normalize 2D points so that centroid is at origin and mean distance is sqrt(2)."""
centroid = pts.mean(axis=0)
shifted = pts - centroid
mean_dist = np.sqrt((shifted ** 2).sum(axis=1)).mean()
scale = np.sqrt(2) / mean_dist
T = np.array([
[scale, 0, -scale * centroid[0]],
[0, scale, -scale * centroid[1]],
[0, 0, 1],
])
return T, (T @ np.vstack([pts.T, np.ones(len(pts))]))[: 2].T
TypeScript example:
interface CalibrationResult {
reprojectionError: number;
intrinsics: Matrix3x3;
distortion: number[];
}
async function calibrate(
imagePoints: Point2D[][],
objectPoints: Point3D[][],
): Promise<CalibrationResult> {
const response = await fetch("/api/v1/cv/calibrate", {
method: "POST",
body: JSON.stringify({ imagePoints, objectPoints }),
});
return response.json();
}
Inline code like np.linalg.svd() or CalibrationResult should be clearly distinct from surrounding prose without being visually noisy.
Semantic Blocks
Definitions
A homography is a projective transformation from to represented by a non-singular matrix , defined up to scale. It maps points as where denotes equality up to a non-zero scalar.
The epipolar geometry describes the intrinsic projective relationship between two views of a scene. It is independent of scene structure and depends only on the cameras' internal parameters and relative pose.
Theorems and Proofs
If all observed 3D points lie on a plane , then the correspondence between two views is exactly described by a homography , where are the intrinsic matrices, and is the relative pose.
Let be a point on the plane, so . The projection into the first view is . The projection into the second view is .
Since , we have , and thus . Substituting:
Therefore with .
∎Lemma
The fundamental matrix is a rank-2 matrix. Specifically, and has exactly 7 degrees of freedom (a matrix up to scale, minus the rank constraint).
Notes and Warnings
The DLT algorithm requires at least 4 point correspondences to estimate a homography. For robust estimation in the presence of outliers, use RANSAC with a minimum of 4 points per sample.
Numerical conditioning is critical when solving linear systems in homography estimation. Always normalize your point coordinates before constructing the design matrix. Failure to normalize can lead to catastrophic cancellation and numerically unstable results.
Examples
Given four corners of a known square pattern at positions , , , in world coordinates, and their detected image positions , , , , we can compute the homography using DLT.
The resulting maps any world point on the pattern plane to its image projection, enabling us to rectify the image or compute additional derived quantities.
Algorithm
- Compute normalizing transforms and for each set of points.
- Apply normalization: , .
- For each correspondence, construct two rows of the design matrix .
- Compute the SVD: .
- Extract from the last column of , reshaped to .
- Denormalize: .
Quote
In dealing with the estimation of geometric relations from image measurements, the issue of normalization of coordinates is of utmost importance, and failure to normalize will lead to serious inaccuracies.
Tables
| Method | Min. Points | Robust | Use Case |
|---|---|---|---|
| DLT | 4 | No | Initial estimate |
| Normalized DLT | 4 | No | Improved accuracy |
| RANSAC + DLT | 4 | Yes | Outlier rejection |
| Gold Standard | 4 | No | Maximum likelihood |
Blockquote (Standard Markdown)
The fundamental matrix encapsulates the epipolar geometry of two views. It is a matrix of rank 2, and satisfies the constraint for every pair of corresponding points.
Mermaid Diagram
graph TD
A[Input Images] --> B[Feature Detection]
B --> C[Feature Matching]
C --> D[Homography Estimation]
D --> E{RANSAC}
E --> |Inliers| F[Refined H]
E --> |Outliers| C
F --> G[Image Warping]
Inline Colored Text
Use inline colour to mark semantic roles inside a paragraph — a variable, a warning, a confirmed value, a symbolic identifier, or a secondary annotation. Unknown directive names like :rainbow[text] are left as-is by the parser so authors get predictable fallback.
Emphasized Phrase Block
For a single stand-alone idea that deserves a reader's full attention, use the :::emph container directive. It renders as a decorated pull-quote distinct from :::quote (which is attribution-oriented) and :::note (which is informational).
Every subpixel estimator trades bias for variance. There are no exceptions — the best any method can do is shift where the error lives, not eliminate it.
This concludes the content feature demonstration for algorithm pages.