gfx-image-formation-classical-vision-and-geometry
Use when recovering information from images: image formation and camera calibration including lens models, intrinsics, extrinsics and distortion; classical computer vision — filtering, edges, features, descriptors, matching and segmentation; and multiple view geometry with epipolar geometry, the fundamental and essential matrices, triangulation, structure from motion and bundle adjustment.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 5
- Forks
- 3
01 前言 Front Matter
- name
- gfx-image-formation-classical-vision-and-geometry
- description
- Use when recovering information from images: image formation and camera calibration including lens models, intrinsics, extrinsics and distortion; classical computer vision — filtering, edges, features, descriptors, matching and segmentation; and multiple view geometry with epipolar geometry, the fundamental and essential matrices, triangulation, structure from motion and bundle adjustment.
03 SKILL.md 正文
Graphics and Vision: Image Formation, Classical Computer Vision, and Multiple View Geometry
Part 3 of 5 of the Graphics and Vision reference (plugin
graphics-and-vision), covering §8–§10. Sibling skills:gfx-transforms-rasterization-and-rendering(§0–§4),gfx-gpu-real-time-techniques-and-colour(§5–§7),gfx-deep-learning-neural-rendering-and-performance(§11–§13),gfx-reference(§14–§19). Section numbers are shared across the set; a reference written as §N →skillpoints into that sibling skill.Currency: The mathematics is permanent — projective geometry, the rendering equation, epipolar geometry. Neural rendering and vision foundation models moved. See §16 →
gfx-referencefor those.
Why one document. ⚠️ They are inverse problems over the same geometry. Graphics goes scene → image; vision goes image → scene. They share the camera model, projective geometry, and increasingly the representations — §12 →
gfx-deep-learning-neural-rendering-and-performanceis where they now meet directly.⚠️ GOTCHA boxes mark where the math is subtle or the standard implementation is silently wrong.
The three ideas that unify the whole document:
- ⚠️ Homogeneous coordinates make projection linear. Adding a fourth component turns perspective — a nonlinear operation — into a matrix multiply, which is why the entire pipeline is matrices (§1 →
gfx-transforms-rasterization-and-rendering).- ⚠️ Rendering is an integral, and everything real-time is a sampling strategy for it. The rendering equation is the ground truth; rasterization, path tracing, and every approximation in §6 →
gfx-gpu-real-time-techniques-and-colourare ways of estimating it under a time budget (§4 →gfx-transforms-rasterization-and-rendering).- ⚠️ Vision is underdetermined and that is not a solvable bug. A single image is a projection; depth is destroyed. Every vision method is adding a constraint — multiple views, motion, a learned prior — to recover what the projection threw away (§8, §10).
§8. Image Formation and Calibration
The pinhole model — the shared foundation of §1 → gfx-transforms-rasterization-and-rendering and everything in vision:
[fx s cx]
K = [0 fy cy] x = K [R | t] X
[0 0 1]
K is intrinsics (focal lengths in pixels, principal point, skew — ⚠️ skew is
essentially always 0 in real cameras); [R|t] is extrinsics (pose).
⚠️ Distortion is not in that model and must be handled separately: radial
(k1, k2, k3 — barrel/pincushion) and tangential (p1, p2). Fisheye and wide-angle
need a different model entirely (equidistant, Kannala-Brandt) — ⚠️ applying the
polynomial radial model to a fisheye lens fails badly.
Calibration: Zhang's method — a planar checkerboard at multiple orientations,
solve for K and distortion, refine by bundle adjustment.
⚠️ The practical failures: too few orientations (⚠️ you need real tilt, not just
translation, or focal length and distance are unseparable), the board not covering the
image corners (⚠️ where distortion is largest, so it goes unconstrained), a non-flat
printed target, and rolling shutter on a moving camera.
Sensor realities: Bayer pattern and demosaicing, rolling vs global shutter (⚠️ rolling shutter skews moving objects and breaks the rigid-projection assumption underlying SfM), exposure and noise (photon/shot noise is Poisson — ⚠️ noise scales with the square root of signal, which is why dark regions are noisier), and the ISP pipeline, which has usually already applied sharpening, denoising and tone curves before you see the image.
§9. Classical Computer Vision
⚠️ Still the right answer for many problems, and cheaper and more debuggable than a network.
Filtering: convolution, Gaussian blur (⚠️ separable — O(n) per pixel instead of
O(n²)), median (edge-preserving, good for salt-and-pepper), bilateral (edge-preserving
smoothing), morphological (erode, dilate, open, close).
Edges: Sobel/Scharr gradients, Canny (⚠️ gradient → non-maximum suppression → hysteresis thresholding — the double threshold is what makes it robust), Laplacian of Gaussian.
Features: Harris corners (⚠️ the structure tensor's eigenvalues distinguish flat, edge and corner), SIFT (⚠️ scale and rotation invariant; the benchmark for two decades and now patent-free), SURF, ORB (⚠️ fast, binary descriptor, free — the default for real-time SLAM), AKAZE, and learned features (SuperPoint, DISK) with learned matching (SuperGlue, LightGlue) — ⚠️ which substantially outperform nearest-neighbour matching on hard pairs.
Matching and robustness: ratio test (Lowe), and RANSAC — ⚠️ the workhorse: randomly sample a minimal set, fit, count inliers, repeat. Everything in §10 depends on it, because feature matches always contain outliers. MAGSAC++ is the modern variant.
Other classical: Hough transform, template matching, optical flow (Lucas-Kanade sparse, Farnebäck dense, ⚠️ RAFT and successors for learned flow), background subtraction, watershed and graph-cut segmentation.
§10. Multiple View Geometry
⚠️ This is the mathematical core of 3D vision and it has not changed.
Epipolar geometry: given two views, a point in one image constrains its match to a line in the other.
x'ᵀ F x = 0 fundamental matrix, uncalibrated (7 DOF)
x'ᵀ E x = 0 essential matrix, calibrated: E = Kᵀ F K'
⚠️ E decomposes into R and t — with t only up to scale, and four candidate
solutions. Cheirality (the requirement that points be in front of both cameras) picks
the right one. ⚠️ Monocular reconstruction has an inherent scale ambiguity that no
amount of processing removes — you need a known baseline, an object of known size, or
another sensor.
Estimation: 8-point and normalized 8-point for F, 5-point (Nistér) for E,
PnP for pose from known 3D-2D correspondences, homography (H) for planes or pure
rotation.
⚠️ Hartley normalization is not optional — the unnormalized 8-point algorithm is
numerically terrible, and this is one of the best-known "the textbook version fails"
results in the field.
Triangulation → 3D points. Bundle adjustment — ⚠️ the global nonlinear least-squares refinement of all poses and points simultaneously, minimizing reprojection error. Sparse Levenberg-Marquardt exploiting the Schur complement structure; Ceres and g2o are the standard solvers.
Pipelines: SfM (offline, incremental or global — COLMAP is the reference), MVS for dense reconstruction, visual SLAM (⚠️ ORB-SLAM3 as the classical benchmark; feature-based vs direct methods like DSO/LSD-SLAM), VIO (⚠️ fusing an IMU resolves scale and handles fast motion — which is why every practical AR system is visual-inertial).
Stereo: rectify → disparity → depth (Z = f·B/d). ⚠️ Depth error grows with the
square of distance, so a stereo rig has a usable range set by its baseline. SGM
(semi-global matching) is the classical standard.
04 同仓库更多 Skills
white-paper-writing
Use when writing white papers, technical reports, policy documents, thought leadership pieces, or any long-form authoritative document. Triggers on requests to write, structure, outline, or review white papers, technical reports, position papers, policy briefs, or evidence-driven arguments. Also use for B2B content marketing strategy, technical documentation requiring authority, academic-style reports, or any document that must educate while persuading. Use when someone asks "how should I structure this" for a long-form document.
prose-technical-mechanics
Use when editing or writing prose at a technical/mechanical level: choosing between Anglo-Saxon and Latinate diction, placing information in topic vs stress positions, writing periodic vs cumulative sentences, handling sentence rhythm, punctuation as logic, transitions, paragraph structure, or phonesthetics. Use when someone wants to understand WHY prose works or doesn't, not just surface-level style advice. Triggers on word choice, sentence structure, emphasis, rhythm, diction, or any deep writing mechanics question.
prose-mechanics
Use when writing, editing, or analyzing prose style; when trying to avoid generic AI-sounding writing; when applying specific prose styles such as journalistic, academic, narrative, KJV biblical, Hemingway plain, Latinate/Jamesian, Orwellian, Augustan, Victorian, Early Modern (Bacon, Browne, Milton), or free indirect discourse; or when coaching someone on writing voice and mechanics. Triggers on any request to improve, analyze, or write in a specific prose style, to fix "AI-sounding" writing, to make prose more vivid or concrete, to vary sentence rhythm, or to understand how a particular writer achieves their effects.
narrative-structure
Use when structuring stories, pitches, presentations, white papers, or any persuasive narrative; analyzing the hero's journey in fiction or non-fiction; applying StoryBrand for business communication; designing narrative arcs for thought leadership; or understanding Vogler, Snyder, Propp, or Campbell frameworks. Triggers on any narrative structure, storytelling, pitch structure, StoryBrand, hero's journey, three-act structure, Freytag, Save the Cat, narrative arc, or "how should I structure this story/pitch/presentation" request.
legal-brief-writing
Use when writing legal briefs, motions, or any court filing; when analyzing judicial cognition and persuasion; when applying elite brief-writing techniques from Roberts, Clement, Kagan, Garner; or when structuring legal arguments for maximum persuasion. Also use for autistic/neurodivergent advocates who need to understand how their natural communication style maps to elite legal advocacy. Triggers on any legal writing, brief drafting, motion preparation, or legal argument structuring request.
journal-publishability-criteria
Use whenever a research paper, article or preprint is being written, revised, reviewed or published, and specifically before every publication of docs/paper.md. Covers what legitimate journals actually gate on, in order of gating — the editor's desk screen (scope, novelty, package problems), what reviewers judge (methodological soundness, claims the evidence can carry, statistical and qualitative reporting), EQUATOR reporting guidelines, the ICMJE authorship criteria, COPE's view of text recycling, the near-universal generative-AI policy (no AI author, disclosure, author responsibility), TOP 2025 transparency standards, how to verify a journal is legitimate, submitting without an institution, and a pre-submission checklist. Triggers on requests to evaluate, review, prepare or submit a paper, to judge publishability, to write a declarations or data-availability section, to disclose AI use, or to check a journal.