Computer Vision Exam 3 Flashcards

0.0(0)
Studied by 1 person
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/62

encourage image

There's no tags or description

Looks like no tags are added yet.

63 Terms

1
New cards

Hough Transform

A generic framework for detecting a parametric model by a voting process that is commonly used to detect lines, circles, and other parametric shapes in image from imperfect edge detections.

2
New cards

Edge Pixels to Lines

While algorithms like Canny detect local edge pixels, they do not group pixels into a shape model. The Hough transform groups supporting edge pixels together, allowing it to detect shapes across gaps, noise, and partial occlusions. A detected line is only a model prediction, not an observed edge.

3
New cards

A Line Becomes a Point

In an image space, a line has the equation y = mx + b. In a parameter space, a point specifies an entire line (m, b). The parallel lines share the same m coordinate but have different b coordinates while lines with the same intercept share the same b coordinate but can have different m coordinates.

<p>In an <strong>image space</strong>, a line has the equation y = mx + b. In a <strong>parameter space</strong>, a <strong>point</strong> specifies an entire line (m, b). The parallel lines share the same <span style="font-family: inherit; line-height: normal; font-size: inherit;">m</span> coordinate but have different <span style="font-family: inherit; line-height: normal; font-size: inherit;">b</span> coordinates while lines with the same intercept share the same <span style="font-family: inherit; line-height: normal; font-size: inherit;">b</span> coordinate but can have different <span style="font-family: inherit; line-height: normal; font-size: inherit;">m</span> coordinates.</p>
4
New cards

Line Estimation from an Edge Point

Given a point (x, y) on an image edge that is used to estimate its line parameters:

  • The image gradient (Ix, Iy) is perpendicular to the edge.

  • The line parameters can be estimated as:

m = - Ix / Iy, b = y - mx

Each edge point now supplies an estimated line (m, b) that can be counted.

<p>Given a point (x, y) on an image edge that is used to estimate its line parameters:</p><ul><li><p>The image gradient (I<sub>x</sub>, I<sub>y</sub>) is perpendicular to the edge.</p></li><li><p>The line parameters can be estimated as:</p></li></ul><p><strong>m = - I<sub>x</sub> / I<sub>y</sub>, b = y - mx</strong></p><p>Each edge point now supplies an estimated line (m, b) that can be counted.</p>
5
New cards

Voting in the Hough Space

Given the parameters m and b are continuous, divide their ranges into a grid of bins.

  1. Initialize every bin to zero.

  2. Estimate (m, b) at an edge point.

  3. Add one to the bin containing that estimate.

  4. Repeat for the other edge points.

Noise, corners, and other edges spread voters across additional bins while a large count indicates strong support for a line with that bin’s parameters.

<p>Given the parameters m and b are <strong>continuous</strong>, divide their ranges into a grid of <strong>bins</strong>.</p><ol><li><p>Initialize every bin to zero.</p></li><li><p>Estimate (m, b) at an edge point.</p></li><li><p>Add one to the bin containing that estimate.</p></li><li><p>Repeat for the other edge points.</p></li></ol><p>Noise, corners, and other edges spread voters across additional bins while <strong>a large count indicates strong support for a line with that bin’s parameters</strong>.</p>
6
New cards

Image Point to Hough Line

For a fixed point (x0, y0), y0 = mx0 + b → b = -x0m + y0.

In the image space, x0 and y0 are fixed: only one point. In Hough space, m and b vary: all possible lines go through that point. The Hough-space line has slope -x0 and intercept y0.

<p>For a fixed point <span style="line-height: inherit;">(x<sub>0</sub>, y<sub>0</sub>)</span><span>, y<sub>0</sub> = mx<sub>0</sub> + b → b = -x<sub>0</sub>m + y<sub>0</sub>.</span></p><p><span>In the image space, x<sub>0</sub> and y<sub>0</sub> are fixed: only one point. In Hough space, m and b vary: all possible lines go through that point. The Hough-space line has slope -x<sub>0</sub> and intercept y<sub>0.</sub></span></p>
7
New cards

Hough Voting for Lines

  1. Create a grid of slope and intercept bins.

  2. For each edge point (x, y):

  • Try each sampled slope m.

  • Compute b = y - mx.

  • Increment the corresponding (m, b) bin.

  1. Find strong, separated peaks.

  2. Map each peak back to an image line y = mx + b


8
New cards

Representing a Line with Distance and Angle

Used to represent all line orientations without unbounded slopes and intercepts. Instead of slope and intercept (m, b), describe a line using (r, θ):

  • θ is the angle of the line’s normal, measured from the positvie x axis in the range 0 ≤ θ < 180∘.

  • r is the signed perpendicular distance from the origin. The geometric distance is |r|.

Given image gradient (Ix, Iy) or line equation y = mx + b:

  1. θ = atan2(Iy, Ix) mod π, or θ = atan2(1,−m).

  2. r = xcosθ + ysinθ for any point (x,y) on the line, or r = b/√m2+1

  • If r > 0, the closest point on the line lies along the chosen normal from the origin.

  • If r < 0, it lies in the opposite direction.


<p>Used to represent all line orientations without unbounded slopes and intercepts. Instead of slope and intercept (m, b), describe a line using (r, <span>θ):</span></p><ul><li><p><span><strong>θ</strong> is the angle of the line’s <strong>normal</strong>, measured from the positvie x axis in the range </span><span style="line-height: inherit;">0 ≤ θ &lt; 180<sup>∘</sup>.</span></p></li><li><p><span style="line-height: inherit;"><strong>r</strong> is the <strong>signed perpendicular distance </strong>from the origin. The geometric distance is <strong>|r|</strong>.</span></p></li></ul><p>Given image gradient (I<sub>x</sub>, I<sub>y</sub>) or line equation y = mx + b:</p><ol><li><p><span style="font-family: inherit; line-height: normal; font-size: inherit;">θ = atan2(I<sub>y</sub>, I<sub>x</sub>) mod π</span>, or <span style="font-family: inherit; line-height: normal; font-size: inherit;">θ = atan2(1,−m)</span>.</p></li><li><p><span style="font-family: inherit; line-height: normal; font-size: inherit;">r = xcosθ + ysinθ</span> for any point <span style="font-family: inherit; line-height: normal; font-size: inherit;">(x,y)</span> on the line, or <span style="font-family: inherit; line-height: normal; font-size: inherit;">r = b/√m<sup>2</sup>+1</span></p></li></ol><ul><li><p>If r &gt; 0, the closest point on the line lies along the chosen normal from the origin.</p></li><li><p>If r &lt; 0, it lies in the opposite direction.</p></li></ul><p></p>
9
New cards

Polar Hough Voting

Dividing the hough space into angle and distance bins, use 0 ≤ θ < 180∘, and −D ≤ r ≤ D. For a W × H image, D = √(W - 1)2 + (H - 1)2. A vertical line x = c has θ = 0⁰ and r = c, while a horizontal line y = c has θ = 90⁰ and r = c.

Steps:

  1. For each edge point (x, y), try each sampled angle θ.

  2. Compute r = xcosθ + ysinθ and increment the corrsponding bin.

  3. Find strong peaks to identify supported line models.


<p>Dividing the hough space into angle and distance bins, use <span style="line-height: inherit;">0 ≤ θ &lt; 180<sup>∘</sup></span><span>, and </span><span style="line-height: inherit;">−D ≤ r ≤ D</span><span>. For a W × H image, D = √(W - 1)<sup>2</sup> + (H - 1)<sup>2</sup>. A vertical line x = c has θ = 0⁰ and r = c, while a horizontal line y = c has </span>θ = 90⁰ and r = c.</p><p>Steps:</p><ol><li><p>For each edge point (x, y), try each sampled angle θ.</p></li><li><p>Compute r = xcosθ + ysinθ and increment the corrsponding bin.</p></li><li><p>Find strong peaks to identify supported line models.</p></li></ol><p></p>
10
New cards

Circle Detection

A circle has center (a, b) and radius r: (x - a)2 + (y - b)2 = r2

If r is known, an edge point (x, y) voted for all centers (a, b) at distance r from it.

Points on the same image circle support a shared center. Binning these votes produces a peak.

<p>A circle has center (a, b) and radius r: (x - a)<sup>2</sup> + (y - b)<sup>2</sup> = r<sup>2</sup> </p><p>If r is known, an edge point (x, y) voted for all centers (a, b) at distance r from it.</p><p>Points on the same image circle support a shared center. Binning these votes produces a peak.</p>
11
New cards

Gradient-Based Radii Search

When the radius is unknown, the full parameter space three-dimensional: (a, b, r).

  • A direct approach repeats center voting for each tested radius.

  • Gradient directions reduce the search: a circle’s normal passes through its center.

For a unit gradient direction g at an edge point, [a b] = [x y] ± rg.

Steps:

  1. Find edges and their gradient directions.

  2. Vote for centers along those directions.

  3. Estimate radii supported by edges around each candidate center.


<p>When the radius is unknown, the full parameter space <strong>three-dimensional</strong>: (a, b, r).</p><ul><li><p>A direct approach repeats center voting for each tested radius.</p></li><li><p>Gradient directions reduce the search: a circle’s normal passes through its center.</p></li></ul><p>For a unit gradient direction <span style="line-height: normal;">g at an edge point, [a b] = [x y] </span><span>± rg.</span></p><p>Steps:</p><ol><li><p>Find edges and their gradient directions.</p></li><li><p>Vote for centers along those directions.</p></li><li><p>Estimate radii supported by edges around each candidate center.</p></li></ol><p></p>
12
New cards

Grayscale Image

A H × W matrix with one intensity value per pixel. For an 8-bit image, the values rnage from 0 (black) to 255 (white). Python indexes the image as gray[y, x] : row first, column second.

<p>A H × W matrix with one intensity value per pixel. For an 8-bit image, the values rnage from <strong>0 (black) </strong> to <strong>255 (white)</strong>. Python indexes the image as <code>gray[y, x]</code> : <strong>row first, column second</strong>. </p>
13
New cards

RGB Image

Three H × W matrices: red, green, and blue. Together, they form an array with shape (H, W, 3). I(y, x) = [R(y, x) G(y, x) B(y, x)]

14
New cards

Visible Light

A small part of the electromagnetic spectrum that has a wavelength in the range of approximately 400-700 nm.

<p>A small part of the electromagnetic spectrum that has a wavelength in the range of approximately <strong>400-700 nm</strong>.</p>
15
New cards

Camera Capturing Color

With three sensors, a prism separates light into three paths, one for each color channel. With one sensor, a color filter array lets each sensor location measure one color component. For a Bayer pattern, each 2 × 2 Bayer block contains two green, one red, and one blue sample. This is because human vision is most sensitive to green, where the M and L cones overlap such that green carries most of perception.

<p>With <strong>three sensors</strong>, a prism separates light into three paths, one for each color channel. With <strong>one sensor</strong>, a color filter array lets each sensor location measure one color component. For a Bayer pattern, each 2 × 2 Bayer block contains <strong>two green</strong>, <strong>one red</strong>, and <strong>one blue </strong>sample. This is because <strong>human vision is most sensitive to green,</strong> where the M and L cones overlap such that green carries most of perception.</p>
16
New cards

Demosaicing

Estimates the two missing color components at each sensor location using nearby samples.

At the center, green is measured directly: G^C = GC

Estimate red and blue by averaging nearby samples: R^C = (RL + RR)/2, B^C = (BU + BD)/2

The reconstructed pixel is I^C = [R^C GC B^C]

<p>Estimates the two missing color components at each sensor location using nearby samples.</p><p>At the center, green is measured directly: G<sup>^</sup><sub>C </sub>= G<sub>C</sub></p><p>Estimate red and blue by averaging nearby samples: R<sup>^</sup><sub>C</sub> = (R<sub>L</sub> + R<sub>R</sub>)/2, B<sup>^</sup><sub>C</sub> = (B<sub>U</sub> + B<sub>D</sub>)/2</p><p>The reconstructed pixel is I<sup>^</sup><sub>C</sub> = [R<sup>^</sup><sub>C</sub> G<sub>C</sub> B<sup>^</sup><sub>C</sub>]</p>
17
New cards

RGB

A color space that uses red, green, and blue components and is widely used for images and displays. This is an additive model: adding colored light produces brighter colors.

18
New cards

CMYK

A color space that uses cyan, magenta, yellow, and black inks in a subtractive model: inks absorb light. Commonly used for printing.

19
New cards

HSV: Hue, Saturation, and Value

Hue describes the color, saturation its departure from gray, and value the largest RGB component. Useful for selecting and tracking objects by color. Hue separates colors; saturation and value help exclude nearly gray or very dark pixels. Hue is unreliable when saturation or value is very small.

<p><strong>Hue</strong> describes the color, <strong>saturation</strong> its departure from gray, and <strong>value</strong> the largest RGB component. Useful for selecting and tracking objects by color. Hue <span>separates colors; saturation and value help exclude nearly gray or very dark pixels. Hue is unreliable when saturation or value is very small.</span></p>
20
New cards

YCbCr: Luma and Chroma

Y represents luma; Cb and Cr represent blue- and red-difference chroma. Used in image/video compression: chroma can be stored at lower resolution than luma.

<p><strong>Y</strong> represents luma; <strong>Cb</strong> and <strong>Cr</strong> represent blue- and red-difference chroma. Used in image/video compression: chroma can be stored at lower resolution than luma.</p>
21
New cards

CIELAB: Lightness and Color Differences

L∗ describes lightness; a∗ runs from green to red, and b∗ from blue to yellow. Approximately perceptually uniform: distances are useful for comparing colors and grouping similar colors.

<p><span style="font-family: inherit; line-height: normal; font-size: inherit;"><strong>L<sup>∗</sup></strong></span> describes lightness; <span style="font-family: inherit; line-height: normal; font-size: inherit;"><strong>a<sup>∗</sup></strong></span> runs from green to red, and <span style="font-family: inherit; line-height: normal; font-size: inherit;"><strong>b<sup>∗</sup></strong></span><sup> </sup>from blue to yellow. Approximately perceptually uniform: distances are useful for comparing colors and grouping similar colors.</p>
22
New cards

Optical Flow

Describes the apparent motion of image points between video frames. A point at (x, y) moves to (x + u, y + v), giving a displacement vector (u, v). Motion can result from movement of the object, the camera, or both.

<p>Describes the apparent motion of image points between video frames. A point at (x, y) moves to (x + u, y + v), giving a displacement vector (u, v). Motion can result from movement of the <strong>object</strong>, the <strong>camera</strong>, or <strong>both</strong>. </p>
23
New cards

Sparse and Dense Optical Flow

Sparse optical flow: Estimated displacement at selected image points.

Dense optical flow: Estimated displacement at every pixel.

Sparse estimates are often used for tracking selected features while dense estimates describe motion across the image, including regions with different motions.

<p><strong>Sparse optical flow</strong>: Estimated displacement at <strong>selected image points</strong>.</p><p><strong>Dense optical flow</strong>: Estimated displacement at <strong>every pixel</strong>.</p><p>Sparse estimates are often used for tracking selected features while dense estimates describe motion across the image, including regions with different motions.</p>
24
New cards

Brightness Constancy

Given that brightness stays the same as a point moves between frames, a scene point would keep its intensity as it moves: I(x, y, t) = I(x + u, y + v, t + 1)

<p>Given that brightness stays the same as a point moves between frames, a scene point would keep its intensity as it moves: <span style="line-height: normal;">I(x, y, t) = I(x + u,&nbsp;y + v,&nbsp;t + 1)</span></p>
25
New cards

Optical Flow Equation

Ixu + Iyv + It = 0

  • Ix, Iy: spatial image gradients.

  • It ≈ I(x, y, t + 1) − I(x, y, t): change of intensity at a fixed pixel.

The approximate is bad when u or v is large compared with how smoothly the image varies.

26
New cards

Recovering (u, v) From The Optical Flow Equation

Given Ix, Iy, It, (u, v) cannot be recovered from the optical flow equationIxu+Iyv+It=0I_{x}u+I_{y}v+I_{t}=0 since there’s one equation per pixel and two unknowns.

If (u, v) satisfies ∇I⋅(u,v)+It=0\nabla I\cdot\left(u,v\right)+I_{t}=0, so does (u+u′,v+v′)\left(u+u^{\prime},v+v^{\prime}\right) for any (u′,v′)\left(u^{\prime},v^{\prime}\right) with ∇I⋅(u′,v′)=0\nabla I\cdot(u^{\prime},v^{\prime})=0.

Only the flow component along the gradient can be recovered:

un=−It∣∇I∣u_{n}=-\frac{I_{t}}{\left|\nabla I\right|}

<p>Given I<sub>x</sub>, I<sub>y</sub>, I<sub>t</sub>, (u, v) <strong>cannot </strong>be recovered from the optical flow equation$$I_{x}u+I_{y}v+I_{t}=0$$ since there’s one equation per pixel and two unknowns.</p><p>If (u, v) satisfies $$\nabla I\cdot\left(u,v\right)+I_{t}=0$$, so does $$\left(u+u^{\prime},v+v^{\prime}\right)$$  for any $$\left(u^{\prime},v^{\prime}\right)$$ with $$\nabla I\cdot(u^{\prime},v^{\prime})=0$$.</p><p>Only the flow component along the gradient can be recovered: </p><p>$$u_{n}=-\frac{I_{t}}{\left|\nabla I\right|}$$ </p>
27
New cards

Lucas-Kande

Resolves underdetermination by assuming spatial coherence: pixels in a small local window (e.g., 5 × 5) move together with the same displacement vector (u, v).

A 5 × 5 window gives 25 equations:

Solving for (u, v), Least squares:

ATAd=ATb⇒d=(ATA)−1ATbA^{T}Ad=A^{T}b\Rightarrow d=(A^{T}A)^{-1}A^{T}b

Summing over the pixels in the window:

Least squares finds the (u, v) that best satisfies all lines.

Conditions for (u, v) to be solved:

  • ATAA^{T}A must be invertible: in a uniform region it is singular

  • ATAA^{T}A must not be too small: otherwise noise dominates

  • ATAA^{T}A must be well-conditioned: a large λ1/λ2 indicates and edge

  • ATAA^{T}A is the second moment matrix M from Harris corners: good corners give reliable flow

Implementation:

  1. ComputeIx,IyI_{x,}I_{y} from a smoothed frame and ItI_{t} from the frame difference

  2. Sum products over the window to form ATAA^{T}A and ATbA^{T}b

  3. Skip the window if the smaller eigenvalue of ATAA^{T}A is too small

  4. Solve the 2 × 2 system for (u, v)

Fails at:

  • Large motion: the Taylor approximation breaks down

  • Occlusions: points appear or disappear

  • Lighting changes, noise: brightness constancy is violated

  • Textureless regions: ATAA^{T}A is nearly singular

  • Edges (apeture problem): ATAA^{T}A is ill-conditioned


28
New cards

Coarse-to-Fine Lucas-Kanade

Given that each Guassian pyramid level halves the image size, it will also half the displacement.

Algorithm:

  1. Build Gaussian pyramids of both frames

  2. Estimate flow at the coarsest level

  3. Upsample the flow to the next level and double its values

  4. Warp frame 2 toward frame 1 using the current flow

  5. Estimate the remaining flow with Lucas-Kanade and add it

  6. Repeat until the finest level

Warping uses the current flow estimate (u0, v0) to resample frame 2, pulling each pixel back by the motion already found:

I2warped(x,y)=I2(x+u0,y+v0)I_2^{warped}\left(x,y\right)=I_2\left(x+u_0,y+v_0\right)

29
New cards

Farnebäck & DIS

Farnebäck: Fits 2D quadratic polynomials to local pixel neighborhoods to estimate dense flow fields.

DIS: Short for Dense Inverse Search. Runs a fast Lucas–Kanade-style search on a grid of patches, then combines and refines their motion estimates into a dense field.


30
New cards

Bare Sensor vs. Pinhole

Bare Sensor: Every scene point reaches every pixel, so every pixel records nearly the same average color.

Pinhole: The barrier blocks all but one ray from each point, so each pixel sees one scene point: displays an inverted image.

<p><strong>Bare Sensor</strong>: Every scene point reaches every pixel, so every pixel records nearly the same average color.</p><p><strong>Pinhole</strong>: The barrier <strong>blocks all but one ray from each point</strong>, so each pixel sees one scene point: displays an <strong>inverted </strong>image.</p>
31
New cards

Pinhole Camera Terms

The pinhole is the camera center (center of projection): every ray that forms the image passes throught it.

The sensor lies in the image place, a distanceff(the focal length) behind the pinhole.

<p>The <strong>pinhole </strong>is the <strong>camera center </strong>(center of projection): every ray that forms the image passes throught it.</p><p>The sensor lies in the <strong>image place</strong>, a distance$$f$$(the <strong>focal length</strong>) behind the pinhole.</p>
32
New cards

Focal Length

The image size is

fHfH /ZZ: doublingffdoubles the image and narrows the field of view. With the same pinhole, the light reaching each pixel is proportional to 1/f2f^2: doublingffgives ¼ of the light.

<p>The image size is </p><p>$$fH$$ /$$Z$$: doubling$$f$$doubles the image and narrows the field of view. With the same pinhole, the light reaching each pixel is proportional to 1/$$f^2$$: doubling$$f$$gives ¼ of the light.</p>
33
New cards

Pinhole Size

Light collected grows with the pinhole’s area (∝d2d^2), but each scene point spreads over a spot of size ∝dd. A very small pinhole makes the image sharp but dark; below a certain size, diffraction blurs the image again, so the pinhole cannot be made arbitrarily small.

<p>Light collected grows with the pinhole’s area <span>(</span><span style="line-height: inherit;">∝</span>$$d^2$$<span>), but each scene point spreads over a spot of size </span><span style="line-height: inherit;">∝</span>$$d$$. A very small pinhole makes the image sharp but dark; below a certain size, <strong>diffraction</strong> blurs the image again, so the pinhole cannot be made arbitrarily small.</p>
34
New cards

Lens Camera

A lens collects a bundle of rays from each scene point and focuses them back to one image point: far more light than a pinhole, without the blur. The central ray (thick) passes through the lens center undeflected, just as through a pinhole. When the lens is in focus, the pinhole model gives where each point lands.

In a lens camera, the focal lengthff is the distance at which parallel rays intersect (the focal point F). The image of an object at distanceDDforms at the focus distanceD′D^{\prime}:1D+1D′=1f\frac{1}{D}+\frac{1}{D^{\prime}}=\frac{1}{f}.

The pinhole model is describing a lens camera if:

  • Only central rays are used

  • The lens is in focus

  • The pinhole’s focal length equals the lens’s focus distanceD′D^{\prime}; for a distant object,D′=fD^{\prime}=f.

For this exam, the focal lengthffmeans the aperture-sensor distance, as in the pinhole camera.


35
New cards

Virtual Image Plane

To avoid mathematically dealing with upside-down (inverted) images, a virtual image plane is placed at focal lengthff in front of the camera center. The camera center gives the same image and the same size as the Pinhole Camera, but upright.

<p>To avoid mathematically dealing with upside-down (inverted) images, a <strong>virtual image plane</strong> is placed at focal length$$f$$ <strong>in front of</strong> the camera center. The camera center gives the same image and the same size as the Pinhole Camera, but <strong>upright</strong>.</p>
36
New cards

Camera Coordinate Frame

The origin is at the camera center. Convention: xx right, yy down, zz forward.

Th z-axis is the principal (optical) axis, which meets the image plane (z=fz=f) at the principal point.

A 3D point cX=(X,Y,Z)^{c}\mathbf{X}=\left(X,Y,Z\right) in camera coordinates projects to the point x=(x,y)\mathbf{x}=\left(x,y\right) where the ray to the camera center crosses the image plane.

<p>The origin is at the <strong>camera center</strong>. Convention: $$x$$ right, $$y$$ down, $$z$$ forward.</p><p>Th z-axis is the <strong>principal (optical) axis</strong>, which meets the image plane ($$z=f$$) at the <strong>principal point</strong>.</p><p>A 3D point $$^{c}\mathbf{X}=\left(X,Y,Z\right)$$ in camera coordinates projects to the point $$\mathbf{x}=\left(x,y\right)$$ where the ray to the camera center crosses the image plane.</p>
37
New cards

Perspective Projection

Using similar triangles, a 3D point(X,Y,Z)\left(X,Y,Z\right)in camera coordinates projects to image plane coordinates(x,y)\left(x,y\right) via:

x=fXZ,y=fYZx = f \frac{X}{Z}, \quad y = f \frac{Y}{Z}

The division byZZmakes the projection nonlinear in(X,Y,Z)\left(X,Y,Z\right) . Homogeneous coordinates make it a matrix product.

Consequences:

  • Size∝1/Z∝1/Z: doubling the distance halves the image of the cube.

  • Depth is lost: every point on a ray through the camera center projects to the same image point.

  • Vanishing points: parallel 3D lines (the rails) meet at one image point, on the horizon


38
New cards

Homogeneous Coordinates

Adds an extra scale coordinate to vectors: A 2D point(x,y)\left(x,y\right)becomes a 3D vector [x,y,1]T\left\lbrack x,y,1\right\rbrack^{T}, a 3D point(X,Y,Z)\left(X,Y,Z\right) becomes a 4D vector[X,Y,Z,1]T\left\lbrack X,Y,Z,1\right\rbrack^{T}

Converting To and From Homogeneous:

Scaling a homogeneous vector does not change the point it represents. w=0w=0 has no Cartesian equivalent: it is a point at infinity, such as the vanishing point where parallel lines meet.

<p>Adds an extra scale coordinate to vectors: A 2D point$$\left(x,y\right)$$becomes a 3D vector $$\left\lbrack x,y,1\right\rbrack^{T}$$, a 3D point$$\left(X,Y,Z\right)$$ becomes a 4D vector$$\left\lbrack X,Y,Z,1\right\rbrack^{T}$$ </p><p>Converting To and From Homogeneous:</p><img src="https://assets.knowt.com/user-attachments/e04b7912-be79-40a8-b710-5ab465e97eec.png" data-width="100%" data-align="center" alt="" style="display: block; width: 100%; margin-left: auto; margin-right: auto;"><p><strong>Scaling a homogeneous vector does not change the point it represents</strong>. $$w=0$$ has no Cartesian equivalent: it is a <strong>point at infinity</strong>, such as the vanishing point where parallel lines meet.</p>
39
New cards

Homogeneous Coordinates Scale Invariance

All multiples of a homogeneous vector are the same point:

k[xyw]∼[xyw],k≠0k\begin{bmatrix}x\\ y\\ w\end{bmatrix}\thicksim\begin{bmatrix}x\\ y\\ w\end{bmatrix},k\ne0

So a 2D point is a ray through the origin, with its Cartesian coordinates being where the ray crosses the plane w=1w=1 .

In a pinhole camera, every 3D point on a ray through the camera center lands on the same image point (scale ambiguity).


40
New cards

Parametric Transformation

  • A transformation TT maps every pointp=(x,y)\mathbf{p}=\left(x,y\right)to a new point p’=T(p)\mathbf{p}\text{'}=T\left(\mathbf{p}\right).

  • Parametric: TT is described by a few numbers (its parameters).

  • Global: the sameTTapplies to every point of the image.

  • If TTis linear, it is a matrix:p′=Mp\mathbf{p}^{\prime}=\mathbf{Mp}


<ul><li><p>A <strong>transformation </strong>$$T$$ maps every point$$\mathbf{p}=\left(x,y\right)$$to a new point $$\mathbf{p}\text{'}=T\left(\mathbf{p}\right)$$. </p></li></ul><ul><li><p><strong>Parametric</strong>: $$T$$ is described by a few numbers (its parameters).</p></li><li><p><strong>Global</strong>: the same$$T$$applies to every point of the image.</p></li><li><p>If $$T$$is <strong>linear</strong>, it is a <strong>matrix</strong>:$$\mathbf{p}^{\prime}=\mathbf{Mp}$$ </p></li></ul><img src="https://assets.knowt.com/user-attachments/10dd52f2-8e9b-41c7-914d-c362e43f12b7.png" data-width="75%" data-align="center" alt="" style="display: block; width: 75%; margin-left: auto; margin-right: auto;"><p></p>
41
New cards

2D Transformation Matrices

  • Scale, shear, and rotation are linear: they keep the origin fixed. Translation is not, so it has no 2×2 matrix.

  • In homogeneous coordinates, every one of them is a 3 × 3 matrix.


<ul><li><p>Scale, shear, and rotation are <strong>linear</strong>: they keep the origin fixed. Translation is not, so it has no <span style="font-family: inherit; line-height: normal; font-size: inherit;">2×2</span> matrix.</p></li><li><p>In homogeneous coordinates, <strong>every </strong>one of them is a 3 × 3 matrix.</p></li></ul><p></p>
42
New cards

Composing Transformations

A chain of transformation is one matrix, with the rightmost applied first. Order matters:TR≠RT\mathbf{TR}\ne\mathbf{RT}


43
New cards

The 2D Transformation Hierarchy

  1. Rigid (Euclidean): Combines 3D rotationR\mathbf{R}and translationt\mathbf{t} (X′=RX+t\mathbf{X}' = \mathbf{R}\mathbf{X} + \mathbf{t}). Preserves distances, lengths, and angles.

  2. Similarity: Rigid transformation plus uniform scaling (ss). Preserves angles and shape ratios.

  3. Affine: Preserves straight lines, parallelism, and midpoints/ratios along lines.

  4. Projective (Homography): Represented by a 3 × 3 matrix H\mathbf{H} for 2D planes. Preserves straight lines, but does NOT preserve parallelism or midpoints.

    • Homography Condition: A single 3 × 3 matrix H\mathbf{H} relates images across views only if the scene is strictly planar (2D) or if the camera undergoes pure rotation


<ol><li><p><strong>Rigid (Euclidean)</strong>: Combines 3D rotation$$\mathbf{R}$$and translation$$\mathbf{t}$$ ($$\mathbf{X}' = \mathbf{R}\mathbf{X} + \mathbf{t}$$). Preserves distances, lengths, and angles.</p></li><li><p><strong>Similarity</strong>: Rigid transformation plus uniform scaling ($$s$$). Preserves angles and shape ratios.</p></li><li><p><strong>Affine</strong>: Preserves straight lines, parallelism, and midpoints/ratios along lines.</p></li><li><p><strong>Projective (Homography)</strong>: Represented by a 3 × 3 matrix $$\mathbf{H}$$ for 2D planes. Preserves straight lines, but <strong>does NOT preserve parallelism or midpoints</strong>.</p><ul><li><p><strong>Homography Condition</strong>: A single 3 × 3 matrix $$\mathbf{H}$$ relates images across views <strong>only</strong> if the scene is strictly <strong>planar (2D)</strong> or if the camera undergoes <strong>pure rotation</strong></p></li></ul></li></ol><p></p>
44
New cards

Affine Transformations

Any combination of linear transformations and translation:

[x′y′1]=[abcdef001][xy1]\begin{bmatrix}x^{\prime}\\ y^{\prime}\\ 1\end{bmatrix}=\begin{bmatrix}a & b & c\\ d & e & f\\ 0 & 0 & 1\end{bmatrix}\begin{bmatrix}x\\ y\\ 1\end{bmatrix}

Has 6 DOF; the last row is always[001]\begin{bmatrix}0 & 0 & 1\end{bmatrix}.

Properties:

  • Lines map to lines

  • Parallel lines stay parallel

  • Ratios along a line are kept (a midpoint stays a midpoint)

  • Closed under composition


<p>Any combination of linear transformations and translation:</p><p>$$\begin{bmatrix}x^{\prime}\\ y^{\prime}\\ 1\end{bmatrix}=\begin{bmatrix}a &amp; b &amp; c\\ d &amp; e &amp; f\\ 0 &amp; 0 &amp; 1\end{bmatrix}\begin{bmatrix}x\\ y\\ 1\end{bmatrix}$$ </p><p>Has 6 DOF; the last row is always$$\begin{bmatrix}0 &amp; 0 &amp; 1\end{bmatrix}$$.</p><p>Properties:</p><ul><li><p>Lines map to lines</p></li><li><p><strong>Parallel lines stay parallel</strong></p></li><li><p><strong>Ratios</strong> along a line are kept (a midpoint stays a midpoint)</p></li><li><p>Closed under composition</p></li></ul><p></p>
45
New cards

Projective Transformations

A general 3 × 3 matrix in homogeneous coordinates:

[x′y′w′]=[h11h12h13h21h22h23h31h32h33][xy1]\begin{bmatrix}x^{\prime}\\ y^{\prime}\\ w^{\prime}\end{bmatrix}=\begin{bmatrix}h_{11} & h_{12} & h_{13}\\ h_{21} & h_{22} & h_{23}\\ h_{31} & h_{32} & h_{33}\end{bmatrix}\begin{bmatrix}x\\ y\\ 1\end{bmatrix}

Divide by w′w^{\prime} to get the point: a projective warp.

Has 8 DOF: H\mathbf{H} is defined only up to scale.

Properties

  • Lines map to lines

  • Parallel lines do not stay parallel

  • Ratios are not kept

  • Closed under composition


<p>A general 3 × 3 matrix in homogeneous coordinates:</p><p>$$\begin{bmatrix}x^{\prime}\\ y^{\prime}\\ w^{\prime}\end{bmatrix}=\begin{bmatrix}h_{11} &amp; h_{12} &amp; h_{13}\\ h_{21} &amp; h_{22} &amp; h_{23}\\ h_{31} &amp; h_{32} &amp; h_{33}\end{bmatrix}\begin{bmatrix}x\\ y\\ 1\end{bmatrix}$$ </p><p>Divide by $$w^{\prime}$$ to get the point: a <strong>projective warp</strong>. </p><p>Has 8 DOF: $$\mathbf{H}$$ is defined only up to scale.</p><p>Properties</p><ul><li><p>Lines map to lines</p></li><li><p>Parallel lines <strong>do not stay parallel</strong></p></li><li><p>Ratios are <strong>not </strong>kept</p></li><li><p>Closed under composition</p></li></ul><p></p>
46
New cards

Rigid Transforation

A 3D rigid transformation[R∣t] [\mathbf{R}\mid\mathbf{t}]\, can move a point within one frame, or change frames (i.e., give the coordinates of one fixed point in another frame).

Transformation Formula:

  • Columns of bRa: the axes of a in frame b.

  • bta: the origin of a in frame b.

Inverse Formula:

Composition Rule: Multiple frame changes chain together by matrix multiplication: cTa = cTb bTa

<p>A 3D rigid transformation$$[\mathbf{R}\mid\mathbf{t}]\,$$ can <strong>move a point </strong>within one frame, or <strong>change frames </strong>(i.e., give the coordinates of one fixed point in another frame).</p><p><strong>Transformation Formula</strong>:</p><img src="https://assets.knowt.com/user-attachments/7b0966dc-17d8-41e4-aee8-61d10a9d04c3.png" data-width="100%" data-align="center" alt="" style="display: block; width: 100%; margin-left: auto; margin-right: auto;"><ul><li><p>Columns of <sup>b</sup>R<sub>a</sub>: the axes of a in frame b.</p></li><li><p><sup>b</sup>t<sub>a</sub>: the origin of a in frame b.</p></li></ul><p><strong>Inverse Formula</strong>:</p><img src="https://assets.knowt.com/user-attachments/2619e50d-31e1-411a-8b12-549b21874888.png" data-width="100%" data-align="center" alt="" style="display: block; width: 100%; margin-left: auto; margin-right: auto;"><p><strong>Composition Rule</strong>: <span>Multiple frame changes chain together by matrix multiplication: </span><span style="line-height: normal;"><sup>c</sup>T<sub>a </sub>= <sup>c</sup>T<sub>b </sub><sup>b</sup>T<sub>a</sub></span></p>
47
New cards

Full Camera Model

Mapping a 3D world point wX=[Xw,Yw,Zw,1]T^{w}\mathbf{X} = [X_w, Y_w, Z_w, 1]^T to a pixel x=[u,v,1]T\mathbf{x} = [u, v, 1]^Trequires three sequential matrix operations:

  1. Extrinsics: world frame → camera frame

  2. Perspective Projection: camera frame → image plane

  3. Intrinsics: image plane → pixels

Each step is a matrix in homogeneous coordinates, making the whole camera model one matrix.

<p>Mapping a 3D world point $$^{w}\mathbf{X} = [X_w, Y_w, Z_w, 1]^T$$ to a pixel $$\mathbf{x} = [u, v, 1]^T$$requires three sequential matrix operations:</p><ol><li><p>Extrinsics: world frame → camera frame</p></li><li><p>Perspective Projection: camera frame → image plane</p></li><li><p>Intrinsics: image plane → pixels</p></li></ol><p>Each step is a matrix in homogeneous coordinates, making <strong>the whole camera model one matrix</strong>.</p>
48
New cards

Extrinsics

Transforms 3D points from world coordinates to camera coordinates. Points are given in a world frame w; projection needs them in the camera frame c:

cX=R wX+t^{c}\mathbf{X} = \mathbf{R} \, ^{w}\mathbf{X} + \mathbf{t} cT=[Rt01]^{c}\mathbf{T}_{}=\begin{bmatrix}^{}\mathbf{R} & \mathbf{t}\\ 0 & 1\end{bmatrix}

The Extrinsic Matrix is the top three rows of cT^{c}\mathbf{T}:[R∣t] [\mathbf{R}\mid\mathbf{t}]\,(3 × 4).

The camera center wC^{w}\mathbf{C} maps tocX=0^{c}\mathbf{X}=0, sot=−RwC\mathbf{t}=-\mathbf{R^{w}C}.

Has 6 DOF (3 rotation angles for orientation R\mathbf{R}, 3 translation parameters t\mathbf{t} for position).

<p>Transforms 3D points from world coordinates to camera coordinates. Points are given in a <strong>world </strong>frame w; projection needs them in the <strong>camera </strong>frame c:</p><p>$$^{c}\mathbf{X} = \mathbf{R} \, ^{w}\mathbf{X} + \mathbf{t}$$ $$^{c}\mathbf{T}_{}=\begin{bmatrix}^{}\mathbf{R} &amp; \mathbf{t}\\ 0 &amp; 1\end{bmatrix}$$</p><p>The <strong>Extrinsic Matrix </strong>is the top three rows of $$^{c}\mathbf{T}$$:$$[\mathbf{R}\mid\mathbf{t}]\,$$(3 × 4).</p><p>The <strong>camera center</strong> $$^{w}\mathbf{C}$$ maps to$$^{c}\mathbf{X}=0$$, so$$\mathbf{t}=-\mathbf{R^{w}C}$$.</p><p>Has <strong>6 DOF</strong> (3 rotation angles for orientation $$\mathbf{R}$$, 3 translation parameters $$\mathbf{t}$$ for position).</p>
49
New cards

Perspective Projection & Intrinsics

Combining the matrix product of Perspective Projection and the matrix produce of Intrinsics gives the Intrinsic Matrix K, a 3 × 3 upper-triangular matrix containing internal camera parameters:

K=[1px0cx01pycy001][f000f0001]=[fxscx0fycy001]\mathbf{K}=\begin{bmatrix}\frac{1}{p_{x}} & 0 & c_{x}\\ 0 & \frac{1}{p_{y}} & c_{y}\\ 0 & 0 & 1\end{bmatrix}\begin{bmatrix}f & 0 & 0\\ 0 & f & 0\\ 0 & 0 & 1\end{bmatrix}=\begin{bmatrix}f_{x} & s & c_{x}\\ 0 & f_{y} & c_{y}\\ 0 & 0 & 1\end{bmatrix} ;

K = to pixels (with pixel sizes px×pyp_{x}\times p_{y}) × focal length

Parameters (5 DOF):

  • fx,fyf_{x},f_{y} : focal length in pixels, i.e., zoom;fx=fpx,fy=fpyf_{x}=\frac{f}{p_{x}},f_{y}=\frac{f}{p_{y}}; fx≠fyf_{x}\ne f_{y} if pixels are not square.

  • cx,cyc_{x},c_{y}: principal point in pixels, usually near the image center.

  • ss: skew; s=0s=0 for almost all modern camera.

Projection:

Intrinsics:


50
New cards

Combined Camera Matrix

Chaining the three steps for the full camera model, with x=(u,v,1)\mathbf{x}=\left(u,v,1\right)in pixels andλ=Zc\lambda=Z_{c}:

With the Camera Matrix P\mathbf{P} having 11 DOF (has 12 entries, but scaling doesn’t change(u,v)\left(u,v\right))

Cube Example:


51
New cards

Geometric Camera Calibration

To calibrate is to estimate the parameters of a camera model for measurements. Geometric calibration estimates the internal geometric parameters of a camera and its 3D pose relative to a target.

Parameters:

  • Intrinsic Matrix (K): 5 Degrees of Freedom (DOF) defining internal optics and sensor geometry

  • Lens Distortion Coefficients (d): Non-linear warping parameters introduced by the lens

  • Target Poses (Rj, tj): Position and orientation of the target relative to the camera for each image view j


52
New cards

Calibration Types

  • Radiometric: pixel value vs. scene brightness

  • Color: sensor response vs. true color

  • Noise: sensor noise level and pattern

  • Lens aberration: blur, vignetting, chromatic effects

  • Geometric: where each pixel looks in 3D


53
New cards

Problems Based on Camera Model

Which quantities are known and which are unknown defines the problem:


54
New cards

Linear Calibration via Direct Linear Transform (DLT)

Uses a known 3D target Xi\mathbf{X}_{i} (e.g., two orthogonal planes with known dot positions) and their pixel positions (ui,vi)\left(u_{i},v_{i}\right)to solve for the 3×43\times4camera matrix P\mathbf{P} linearly.

From the camera modelλ[uivi1]=[p1Tp2Tp3T]Xi\lambda\begin{bmatrix}u_{i}\\ v_{i}\\ 1\end{bmatrix}=\begin{bmatrix}\mathbf{p}_1^{T}\\ \mathbf{p}_2^{T}\\ \mathbf{p}_3^{T}\end{bmatrix}\mathbf{X}_{i}, we have:

λui=p1TXi,λvi=p2TXi,λ=p3TXi\lambda u_{i}=\mathbf{p}_1^{T}\mathbf{X}_{i},\lambda v_{i}=\mathbf{p}_2^{T}\mathbf{X}_{i},\lambda=\mathbf{p}_3^{T}\mathbf{X}_{i}

Substituting λ=p3TXi\lambda=\mathbf{p}_3^{T}\mathbf{X}_{i} in the first two equations gives two equations per point, both linear in the 12 entries of P\mathbf{P} :

p1TXi−uip3TXi=0\mathbf{p}_1^T \mathbf{X}_i - u_i \mathbf{p}_3^T \mathbf{X}_i = 0, p2TXi−vip3TXi=0\mathbf{p}_2^T \mathbf{X}_i - v_i \mathbf{p}_3^T \mathbf{X}_i = 0

Stack these two rows of every point intoA\mathbf{A}and solve

Ap=0\mathbf{Ap}=0 with the SVD:

P\mathbf{P} has 11 DOF which requires at least 6 non-coplanar 3D points (with each point providing 2 equations). P\mathbf{P} can be positive or negative; keep the sign that puts the points in front of the camera.

55
New cards

RQ Decomposition of Linear Calibration

Given the left 3 × 3 block of P\mathbf{P} is M=KR\bm{M=KR}, RQ decomposition splits M\mathbf{M} into these two factors (“R” = upper triangular K\mathbf{K}, “Q” = rotation R\mathbf{R}).

With p4\mathbf{p}_4 the last column of P\mathbf{P}: t=K−1p4\bm{t=K^{-1}p_4} , C=−M−1p4\mathbf{C}=-\mathbf{M}^{-1}\mathbf{p}_4

56
New cards

Limits of Linear Calibration

  • No lens distortion. A wide-angle lens bends straight lines, which no P\mathbf{P} can model.

  • Wrong Error Metric: Minimizes algebraic error ∥Ap∥\|\mathbf{A}\mathbf{p}\|, rather than geometric distance in pixels.

  • Unconstrained: Hard to enforce physical constraints (such as zero skew s=0s = 0).

  • Degeneracy on Flat Targets: Fails if all points lie on a single 2D plane (Z=0Z=0), causing column degeneracy in A\mathbf{A} (columns of A\mathbf{A} that multiply Z\mathbf{Z} are zero.

  • Linear calibration is only used as an initial guess for non-linear optimization.


57
New cards

Nonlinear Calibration

Compares observed image points xi=(ui,vi)\mathbf{x}_{i}=\left(u_{i},v_{i}\right) with the points predicted by the camera model.
The reprojection error is their distance in pixels, summed over all points:

E=∑j∑i∥xij−π(K,d,Rj,tj,Xi)∥2E = \sum_j \sum_i \|\mathbf{x}_{ij} - \pi(\mathbf{K}, \mathbf{d}, \mathbf{R}_j, \mathbf{t}_j, \mathbf{X}_i)\|^2

  • d\mathbf{d}: lens distortion coefficients

  • Rj,tj\mathbf{R}_j,\mathbf{t}_j: one extrinsic pose of per view jj

  • π(⋅\cdot): the camera model

With EE being nonlinear in parameters.

58
New cards

Lens Distortion Model

Distortion acts on the image coordinates (x,y)(x,y), before K\mathbf{K}:

cX→(x,y)=(cXcZ,cYcZ)→(xd,yd)→(u,v)^{c}X\rightarrow\left(x,y\right)=\left(\frac{^{c}X}{^{c}Z^{}},\frac{^{c}Y}{^{c}Z}\right)\to\left(x_{d},y_{d}\right)\to\left(u,v\right)

  • (x,y)(x,y): where an ideal pinhole camera sees the point.

  • (xd,yd)(x_d,y_d): where the lens actually puts it.

With r2=x2+y2r²=x²+y² (squared distance from the principal point):


<p>Distortion acts on the image coordinates $$(x,y)$$, before $$\mathbf{K}$$:</p><p>$$^{c}X\rightarrow\left(x,y\right)=\left(\frac{^{c}X}{^{c}Z^{}},\frac{^{c}Y}{^{c}Z}\right)\to\left(x_{d},y_{d}\right)\to\left(u,v\right)$$ </p><ul><li><p>$$(x,y)$$: where an ideal <strong>pinhole </strong>camera sees the point.</p></li><li><p>$$(x_d,y_d)$$: where the <strong>lens </strong>actually puts it.</p></li></ul><p>With $$r²=x²+y²$$ (squared distance from the principal point):</p><img src="https://assets.knowt.com/user-attachments/2f3fafaf-bfc6-4d9a-ba93-9547d09a0713.png" data-width="100%" data-align="center" alt="" style="display: block; width: 100%; margin-left: auto; margin-right: auto;"><p></p>
59
New cards

Radial Distortion

The radial terms scale (x,y)(x,y) along its ray from the principal point: [xdyd]=s(r)[xy]\begin{bmatrix}x_{d}\\ y_{d}\end{bmatrix}=s\left(r\right)\begin{bmatrix}x\\ y\end{bmatrix}, s(r)=1+k1r2+k2r4+k3r6s(r) = 1 + k_1 r^2 + k_2 r^4 + k_3 r^6.

Only the distance from the center changes, from rr to rd=xd2+yd2=rs(r)r_{d}=\sqrt{x_{d}^2+y_{d}^2}=rs\left(r\right)

Barrel Distortion (k1<0,s<1k_1 < 0, s < 1): points move toward the center

Pincuchion Distortion (k1>0,s>1k_1 > 0, s > 1): points move away from the center

Straight line not through the center become curved, with the intensity of the curve growing with rr.


60
New cards

Tangential Distortion

The tangential terms shift points sideways, not along their ray from the center:

Caused by lens elements being slightly tilted or off-center relative to the sensor.

Modern camera have insignificant distortion.


61
New cards

Wide Lenses

A pinhole maps a ray at angle θ\theta from the optical axis to radius r=ftan⁡θr=f\tan{\theta}, which grows to infinity at 90°.

Fisheye lenses use a mapping close to r=fθr=f\theta, so they can see at 180° or more.

Omnidirectional camera allow field of view ≥ 180°, or a curved mirror in front of the lens.

Rule of thumb: radial-tangential up to a field of view (FOV) of about 100°-120°, i.e., θ\theta up to 50°-60° at the image edge, beyond that use fisheye or omnidirectional.

62
New cards

Common Calibration Targets

knowt flashcard image
63
New cards

Rules of Collecting Useful Calibration Images

  • Lock Camera Settings: Focus, zoom, and resolution must be fixed; altering any parameter changes K\mathbf{K}.

  • Use a Rigid, Flat Board: Paper targets must be mounted on a flat, stiff surface to prevent warping

  • Dataset Variety: Capture 20–30 sharp images. Tilt the board up to ∼45∘\sim 45^\circ in different directions and cover the outer edges and corners of the image where distortion is highest.

  • Vary the distance, but keep the board large enough for accurate corners.