CSS 433: Computer Vision — Chapter 1: Image Acquisition
Lecturer Reference: Dr. Toshiaki Kondo, SIIT, Thammasat University
Exam Preparation Guide for 4th-Year Computer Engineering
1. Camera Architecture & Comparison
Digital cameras are categorized into three main architectures based on their internal optical paths, sensor integration, and viewfinder mechanisms:
A: Compact Digital Camera B: Digital Single-Lens Reflex (DSLR)
+-----------+ +-------Pentaprism (7)------+
| Lens | | \ OVF (4) |
| [1] ====> |======> Sensor [2] | \ / |
+-----------+ | | Lens [5] Mirror |
v | [1] =====> / |
LCD Screen [3] | /==> Sensor |
+--------------------[2]----+
Architectural Comparison
| Feature | Compact Camera | DSLR Camera | Mirrorless Camera |
|---|---|---|---|
| Optical Path | Direct to sensor. No internal mirror or prism. | Lens Reflex Mirror (45°) Pentaprism OVF. Mirror flips up during exposure. | Direct to sensor. No reflex mirror, no pentaprism. |
| Viewfinder | Back LCD monitor (Live View only). | Optical Viewfinder (OVF) via pentaprism. | Electronic Viewfinder (EVF) or back LCD monitor. |
| Latency / Time Lag | High latency (Sensor readout image processor LCD refresh). Poor for fast action. | Zero latency (Photons travel at speed of light directly through glass/mirrors to eye). | Low-to-medium latency (High-speed sensor readout feeds miniature EVF micro-display). |
| Lens Mount | Fixed, non-interchangeable integrated zoom lens. | Interchangeable lenses with diverse focal lengths (). | Interchangeable lenses (shorter flange focal distance). |
| Sensor Size | Small (e.g., , ). | Large (APS-C , Full Frame ). | Large (Micro 4/3 , APS-C, Full Frame). |
| Power Consumption | High (sensor and screen must be powered continuously). | Low during framing (passive optical path; zero sensor power until shutter release). | Moderate/High (EVF/LCD and sensor are continuously active). |
Engineering Takeaways: EVF vs. OVF vs. LCD
- DSLR OVF: Superior for high-speed sports/action tracking because of true real-time response (zero display lag) and zero power drain while framing.
- Mirrorless EVF: Shows exposure preview, real-time histograms, and focus peaking directly inside the eyepiece. In bright sunlight, an EVF avoids screen glare that makes external LCDs unreadable. Holding the camera against your face also provides a third point of physical stabilization compared to holding an LCD at arm’s length.
2. Image Sensors: CCD vs. CMOS
Both sensor types use the photoelectric effect: silicon photodiodes (PD) convert incident photons into bound electron-hole pairs (charge). Their difference lies in how that charge is transported, converted to voltage, and amplified.
CCD Architecture (Sequential Charge Transfer):
[PD] [PD] [PD] ==> Charges shifted down
| | | Vertical Shift Registers (V-SR)
v v v
[============== Horizontal Shift Register (H-SR) ===============]
|
Single Output Amplifier + ADC
CMOS Architecture (Active Pixel Sensor - Parallel Readout):
[PD + Amp] --- [PD + Amp] --- [PD + Amp] ==> Row Select Line
| | |
Column Line Column Line Column Line
v v v
[Col ADC] [Col ADC] [Col ADC] ==> Parallel Conversion
Deep Architectural Comparison
| Characteristic | CCD (Charge-Coupled Device) | CMOS (Complementary Metal-Oxide Semiconductor) |
|---|---|---|
| Charge-to-Voltage Conversion | Outside the active pixel array at a single common output amplifier. | Inside every individual pixel (each pixel contains its own photodiode, reset gate, and amplifier). |
| Readout Mode | Bucket-brigade charge shifting across vertical and horizontal registers. | Direct row/column addressing (X-Y coordinate addressable). Read out row-by-row. |
| Readout Speed | Slower (all charges must pass through the single output node). | Extremely fast (massively parallel column-level ADCs). |
| Image Uniformity | Very High (All charges are amplified by the exact same physical circuit). | Lower (Microscopic fabrication mismatches between pixel amplifiers create Fixed-Pattern Noise). |
| Power Dissipation | High (Capacitive clocking lines drive shift registers across the entire chip continuously). | Low (Only the circuits on the actively addressed row consume switching power). |
| Shutter Type | Naturally supports Global Shutter. | Typically uses Rolling Shutter (unless specialized electronic global shutter circuitry is added). |
Characteristic Sensor Artifacts (Exam High-Yield)
1. CCD Artifacts: Charge Smearing and Blooming
- Blooming: When high-intensity light (e.g., direct sun, headlights) hits a photodiode, the generated electron count exceeds the well capacity (saturation charge limit). Excess electrons spill over into adjacent horizontal and vertical photodiode wells, causing a large white circular halo.
- Charge Smearing: Occurs during the vertical charge transfer in a CCD. If intense light continues to strike the sensor while charges are being shifted down the vertical shift registers (V-SR), unwanted electrons leak into the packets moving underneath. This creates a distinct, continuous bright vertical line passing through the highlight across the entire image.
Blooming: Charge Smearing (CCD):
. . . . | |
. . ( O ) . . <-- Well overflow | O | <-- Light leaks into V-SR
. . . . into neighbors | | during vertical transfer
| |
2. CMOS Artifact: The Rolling Shutter Effect
Because CMOS sensors read out data line-by-line, Row is exposed at time , while Row is exposed at time .
- If an object moves at high angular or linear velocity across the frame during this interval , the top of the object is recorded at an earlier position than the bottom.
- Visual Distortions:
- Rotating objects (propellers, fan blades): Blades curve into spiral shapes.
- Translating objects (fast train, golf club): Vertical structures shear horizontally (skew).
- Horizontal camera panning (wobble/jello effect): Vertical telephone poles lean to the side.
Sensor Size vs. Pixel Count
Market specifications emphasize pixel resolution (e.g., 48 MP), but computer vision performance depends fundamentally on physical sensor area ().
Sensor Dimensions:
+-------------------------------------------------------+
| Full Frame (36 x 24 mm) |
| +------------------------------------+ |
| | APS-C (~23.6 x 15.6 mm) | |
| | +--------------------------+ | |
| | | Micro 4/3 (17.3 x 13 mm) | | |
| | | +----------------+ | | |
| | | | 1" (12.8x9.6mm)| | | |
| | | | +---------+ | | | |
| | | | | 1/2.3" | | | | |
+---+---+---+---+---------+--+-----+-----+--------------+
- Why Larger Sensors Outperform Smaller Sensors with Equal Pixel Counts:
- Low-Light Sensitivity & SNR: Larger pixels collect a larger absolute number of photons per exposure: More photons collected per pixel improves the Signal-to-Noise Ratio (less visible grain).
- Dynamic Range: Larger photodiodes have higher full-well capacity, allowing them to capture bright highlights without clipping while still resolving shadow details above the noise floor.
- Depth of Field Control: Larger sensors require longer focal lengths to maintain the same field of view, producing shallower depth of field (desirable for object isolation/segmentation).
3. Thin Lens Optics (Rigorous Derivations & Examples)
The Three Fundamental Paraxial Rays
Ray 1: Parallel to axis ----> Through focus F on far side
Ray 2: Through center -------------------------> Undeviated
Ray 3: Through focus F on near side ---> Emerges parallel
Lens Plane
|
Object \ | /
(h_o) \ | /
|---> \ | /
---|------------- \ ---|--- / ------------------------- Axis
|<----- p ----->| | |<----- q ----->|
| v Real Image (h_i)
- Paraxial Ray (Ray 1): Travels parallel to the optical axis, refracts through the lens, and passes through the real focal point on the opposite side.
- Center Ray (Ray 2): Passes directly through the optical center of the lens. Because the glass faces at the center are parallel and lens thickness , the ray passes through without displacement or deviation.
- Focal Ray (Ray 3): Passes through the near focal point , strikes the lens, and emerges parallel to the optical axis on the opposite side.
Exercise 1: Geometric Derivation of the Thin Lens Equation (Slides 30–31)
1. Derive the Thin Lens Equation using Similar Triangles
Consider an object of height placed at distance in front of a converging lens of focal length . A real, inverted image of height forms at distance behind the lens.
A
|\
| \ Center Ray
h_o | \
| \
----B----+------------------+---------- Optical Axis
| \ |
| \ | h_i
| \ |
\ v
+------------C
Step 1: Triangle pair from the optical center ray
The triangle formed by the object and center is similar to the triangle formed by the image and center :
Step 2: Triangle pair from the paraxial ray refracted through focus
The paraxial ray leaves the top of the object parallel to the axis, hits the lens at height , and passes through the far focal point to reach the image plane at distance . The distance from to the image plane is .
By similar triangles across focal point :
Step 3: Equate the two geometric expressions
Divide the entire equation by (assuming ):
Rearranging gives the Gaussian Thin Lens Equation:
2. Find the condition for Magnification Rate ()
Magnification rate is defined as: For : Substitute into the thin lens equation: And since : Condition: The object must be placed at exactly twice the focal length () in front of the lens. The real image forms at behind the lens, inverted and at a scale ratio.
Exercise 2: Convex Thin Lens — Magnifying Glass (Slide 33)
Problem:
A converging lens has focal length . An object is placed inside the focal point at distance .
- Where is the image formed?
- What is the magnification rate ?
Solution:
Using the thin lens formula:
Find a common denominator ():
Interpretation: The negative sign indicates a virtual, upright image located in front of the lens (on the same side as the object).
Magnification rate: The virtual image is upright and magnified by a factor of .
Vision Correction Physics: Hyperopia vs. Myopia (Slides 32, 34)
Hyperopia (Farsightedness): Myopia (Nearsightedness):
Light focuses BEHIND the retina. Light focuses IN FRONT of the retina.
Lens Retina Lens Retina
() | () |
------()-----\-------| ------()------\------|
() \ | () \ |
\----->(Focus) * (Focus)
Correction: CONVEX (+ / Converging) Correction: CONCAVE (- / Diverging)
Adds converging power to pull focus Adds divergence to push focus back
forward onto the retina. onto the retina.
Exercise 3: Concave Thin Lens (Slide 35)
Problem:
A diverging lens has focal length . An object is placed at distance .
- Where is the image formed?
- What is the magnification rate ?
Solution:
For a diverging (concave) lens, is negative ():
Common denominator ():
Magnification rate:
Interpretation: Diverging lenses always produce a virtual, upright, diminished image () located between the lens and the object.
Exercise 4: Two-Lens System (Slides 36–37)
Problem:
A compound optical system consists of two lenses separated by a distance :
- Lens 1 (): Converging lens, focal length .
- Lens 2 (): Diverging lens, focal length .
- An object is placed at in front of .
- Where does the final image form relative to Lens 2 ()?
- What is the total system magnification ?
Ray Trace Layout:
Object Lens 1 Lens 2
| (f1=20) (f2=-35)
----+----------------|-----------------------)-------------------- Axis
|<--- 30mm ----->| |
|<------- 40mm -------->|
|<------------- q1 = 60mm ------------->| (Image 1)
|<-- p2=-20mm ->|
|<---- q2 = 46.67mm ---->| (Final)
Step-by-Step Solution:
Stage 1: Image formation through Lens 1 () Magnification of : The intermediate image forms behind , inverted and scaled .
Stage 2: Image formation through Lens 2 ()
The two lenses are separated by .
Because the rays from converge toward a point behind , they intercept before reaching that focus.
is located behind by:
Therefore, acts as a Virtual Object for :
Applying the thin lens formula to with : Find a common denominator ():
Because , the final image is real and forms behind Lens 2.
Stage 3: Total magnification Magnification through :
Total system magnification:
The final image is real, inverted (relative to the original object), and magnified .
4. Field of View & Perspective Geometry
Angle of View (alpha)
/|
/ |
d (Aperture) / |
+---+ / |
| | / |
=====+ +======* | Focal Plane
| | f \ |
+---+ \ |
\ |
\|
Angle of View (Field of View - FOV) (Slide 38)
Let be the effective dimension (or aperture limit) and be the lens focal length. The angle subtended at the focus is:
- Focal Length Trade-Off:
- Short (Wide-Angle, e.g., ): Yields large . Captures wide scenes, but introduces perspective exaggeration.
- Long (Telephoto, e.g., ): Yields small . Magnifies distant objects, but narrows the visible scene.
Perspective vs. Distance & The Compression Effect (Slides 39–41)
- Perspective is determined solely by the camera-to-subject distance, not by focal length alone.
- Compression Effect: When shooting a subject from far away with a long telephoto lens ():
- The subject appears close, but background elements (such as distant mountains) appear disproportionately large and compressed against the subject.
- With a wide-angle lens (), moving close to keep the foreground object the same size causes background elements to appear distant and small.
5. The Exposure Triangle: Shutter Speed, Aperture, and ISO
Exposure determines the total energy density incident on the sensor:
EXPOSURE
+-------------+-------------+
| |
Shutter Speed (t) Aperture (f-number N)
[Motion Blur] [Depth of Field]
\ /
\ /
+---- ISO Sensitivity ---+
[Sensor Noise]
1. Shutter Speed () (Slides 44–45)
- Controls the duration over which the sensor integrates light.
- Fast Shutter (): Freezes high-speed movement (e.g., sports, flying debris). Requires strong illumination or a wide aperture.
- Slow Shutter (): Smooths continuous movement (e.g., flowing water, light trails). Introduces motion blur for moving targets.
2. Aperture & F-Number () (Slides 46, 53–55)
The F-number (or F-stop) is the ratio of focal length to effective aperture entrance pupil diameter :
Notation Note (Slide 55): The notation "" means the aperture diameter is . The slash represents a ratio of to , not mathematical division.
Standard Geometric F-Stop Progression:
Each consecutive step scales up by a factor of :
Exercise 6: F-Numbers and Aperture Area (Slide 56)
Question: Show the relationship between the geometric sequence and the aperture area.
Derivation:
The light entering the camera is proportional to the circular aperture area : Since :
When transitioning to the next full stop ():
Conclusion: Each time the F-number increases by a factor of , the aperture opening diameter scales down by , and the physical light-collecting area is reduced by half ().
3. ISO Sensitivity (Gain) (Slides 48–50)
- The sensor photodiode has a fixed physical quantum efficiency. ISO is analog/digital amplification applied to the readout signal.
- Positive Effect: Doubling ISO () allows doubling the shutter speed () under the same lighting, helping freeze action without underexposing.
- Negative Effect: The amplifier gain boosts both the signal and the underlying noise floor (). High ISO values (e.g., ISO 3200+) introduce strong visible noise, lowering image quality.
6. Depth of Field (DOF) & The Circle of Confusion
Geometric Focus & Depth of Field (Slides 51–53)
From the thin lens equation, only objects located at an exact physical distance focus to an infinitesimal point on a sensor placed at distance : Points in front of or behind form a cone of light that projects onto the sensor as a circular blur:
Lens Sensor Plane
Object Near | |
-----(o)------------------|----\ |
| \ |
Object Focused | \-----\ |
------(O)-----------------|-------------*-------------|-- (Sharp point focus)
| / |
Object Far | /----/ |
-------(o)----------------|-----/ \ |
| \ |
| \========|== Blur Circle
|<-> Circle of Confusion (CoC)
- Circle of Confusion (CoC): The largest blur circle diameter that remains indistinguishable from a sharp point to a human observer (or relative to the sensor pixel size).
- Depth of Field (DOF): The acceptable zone of sharpness in object space over which the resulting blur circle is smaller than the CoC limit.
Exercise 7: DOF and F-Numbers Case Study (Slides 57–58)
The slide presents three images of a slanted microchip taken with varying exposure settings:
- at
- at
- at
Microchip Image at f/5, 0.2s: Microchip Image at f/32, 8.0s:
+------------------------+ +------------------------+
| Blur | | Pin-sharp |
| Sharp text [ 17301Q1 ] | | Pin-sharp [ 17301Q1 ] |
| Blur | | Pin-sharp |
+------------------------+ +------------------------+
(Narrow/Shallow DOF) (Deep/Wide DOF)
1. Explain the relationship between F-numbers and the resulting DOFs:
- At (Small F-number Large Aperture): The light rays converge at a steep angle. The blur cone expands rapidly away from the plane of focus, making the Depth of Field narrow/shallow. Only the center text row on the slanted chip is sharp; the top and bottom rows are heavily blurred.
- At (Large F-number Small Aperture): The aperture narrows the cone of light to a narrow beam. The blur circle grows very slowly with distance, producing a deep/wide DOF. The entire slanted microchip stays in sharp focus.
2. Explain why the shutter speed is varied from :
To maintain constant exposure as the aperture diameter is narrowed, the exposure time must increase proportionally to balance the loss of light:
-
Step 1 (): The aperture transmits approximately as much light. To keep exposure constant, shutter speed must increase by :
-
Step 2 (): The aperture transmits approximately as much light. Shutter speed must increase by :
Conclusion: The shutter speed is varied across to maintain uniform overall image exposure across all shots.
Exercise 8: Practical Engineering & Photography Scenarios (Slides 61–62)
Question 4: Oblique Portrait Shot
\
Far Eye \ Near Eye (FOCUS TARGET!)
(o) \ (O)
\ /
\/
Camera
1. When taking a photo in the dark, should the F-number be small or large?
- Answer: Small (e.g., or ).
- Reason: A small F-number corresponds to a large physical aperture opening (), allowing the maximum number of photons to reach the sensor in low light.
2. When you want to gain a wide depth of field (DOF), should the F-number be small or large?
- Answer: Large (e.g., , , or ).
- Reason: A large F-number constricts the light cone, keeping the blur circle within the Circle of Confusion across a wider range of object distances.
3. When you want to take a portrait shot with a smooth, blurred background (bokeh), should the F-number be small or large?
- Answer: Small (e.g., or ).
- Reason: A small F-number creates a shallow depth of field. Only the subject’s face remains sharp, while foreground and background elements quickly blur into an out-of-focus background.
4. When you take an oblique (angled) portrait shot, which eye should be the main target to focus on?
- Answer: The near eye (the eye physically closest to the camera lens).
- Reason: With shallow portrait depth of field, only one eye can be sharply in focus. In human portrait evaluation, a sharp near eye looks natural and intentional, whereas an out-of-focus near eye paired with a sharp far eye creates an unsettling blur in the foreground.
7. Quick Exam Review Summary
CORE EQUATIONS CHEAT SHEET
Thin Lens Equation: 1/p + 1/q = 1/f (f > 0: Convex, f < 0: Concave)
Magnification Rate: r = |q| / p
F-Number: N = f / d
Aperture Area Scaling: Area ~ 1 / N^2
Angle of View: alpha = 2 * arctan( d / (2f) )
Exposure Balance: Exposure ~ (t * ISO) / N^2
- CCD: Global shutter, single output amplifier, high image uniformity, high power dissipation. Vulnerable to smearing (vertical lines) and blooming (saturation bleed).
- CMOS: Rolling shutter, in-pixel amplifiers, parallel ADC, low power consumption, higher fixed-pattern noise. Vulnerable to rolling shutter distortion on fast-moving targets.
- Convex Lens ():
- real, inverted, diminished image ().
- real, inverted image with scale ().
- real, inverted, magnified image ().
- virtual, upright, magnified image on the object side ().
- Concave Lens ():
- Always yields a virtual, upright, diminished image (, ).
- DOF Trade-Off:
- Small F-number large aperture shallow DOF, higher light intake.
- Large F-number small aperture deep DOF, lower light intake (requires longer shutter speed or higher ISO).
Here is a complete breakdown of how increasing (larger) or decreasing (lower) the value of each parameter affects the final image.
1. Shutter Speed (Exposure Time)
Note on terminology: In photography, “larger value” usually refers to a longer exposure time (e.g., 2 seconds vs. 1/1000s).
Larger Value / Longer Duration (e.g., 1/2s, 2s, 10s)
- Exposure: Brighter image. The shutter stays open longer, allowing more light to hit the sensor.
- Motion Blur: Moving subjects become blurred or streaked (intentional effects include silky waterfalls, car light trails, and star trails).
- Camera Shake: Handheld shooting becomes prone to blur caused by hand tremors (often requires a tripod or image stabilization at speeds slower than ~1/60s).
Lower Value / Shorter Duration (e.g., 1/500s, 1/2000s, 1/8000s)
- Exposure: Darker image. The shutter opens and closes very quickly, limiting the light entering the camera.
- Motion Freeze: Fast-moving action is frozen crisply (e.g., water droplets, sports players, flying birds).
- Sharpness: Camera shake is eliminated, making handheld shooting sharp.
2. f-number (Aperture)
Note on terminology: The f-number is an inverse ratio (). Therefore, a larger f-number means a smaller physical opening (aperture area), and a lower f-number means a larger physical opening.
Larger f-number (e.g., f/11, f/16, f/22) Small Aperture Opening
- Exposure: Darker image. The small physical opening lets in less light.
- Depth of Field (DoF): Deep / Large DoF. Most of the frame from foreground to background remains sharp and in focus (ideal for landscapes, group photos, and architecture).
- Diffraction: At very high f-numbers (f/16, f/22), light waves bend around the blade edges, causing overall optical softness (loss of micro-contrast).
- Sunstars: Point light sources (like streetlights or the sun) turn into distinct starburst/sunstar spikes.
Lower f-number (e.g., f/1.4, f/1.8, f/2.8) Large Aperture Opening
- Exposure: Brighter image. The wide opening lets in maximum light, ideal for low-light situations.
- Depth of Field (DoF): Shallow / Narrow DoF. Only a thin slice of the scene is in focus; the background and foreground become heavily blurred with smooth bokeh (ideal for portraits, macro, and subject isolation).
- Optical Flaws: Lenses used wide open may exhibit minor corner vignetting (dark corners) and slight chromatic aberration (color fringing).
3. ISO Sensitivity
ISO measures the gain or amplification applied to the signal gathered by the sensor.
Larger / Higher ISO (e.g., ISO 1600, 3200, 6400+)
- Exposure: Brighter image. The signal amplification makes the image brighter without needing a slower shutter or wider aperture.
- Noise / Grain: Significant digital noise appears (speckling, color artifacts, luminance grain), degrading fine details and texture.
- Dynamic Range: Reduced. The camera loses the ability to capture extreme contrasts (highlights blow out faster, shadows crush into noise).
- Color Fidelity: Colors can look slightly muted, washed out, or show color cast shifts.
Lower ISO (e.g., ISO 50, 100, 200)
- Exposure: Darker image. Less signal amplification; requires sufficient ambient light, a larger aperture, or a slower shutter.
- Noise / Grain: Cleanest image. Minimal to zero visible noise; textures and fine details are sharp.
- Dynamic Range: Maximum. The sensor captures the widest range of tones from deep shadows to bright highlights.
- Color Accuracy: Delivers the most vibrant, rich, and true-to-life colors.
4. Depth of Field (DoF)
Depth of Field is the visual outcome produced by your aperture, focal length, and distance to subject.
Larger / Deeper DoF
- Sharp Focus Range: A wide physical zone in front of and behind the focal point is acceptably sharp.
- Background Appearance: Background elements remain clear and readable.
- Separation: Low subject separation; the subject blends visually into the surroundings (useful for storytelling, context, and landscapes).
Lower / Shallower DoF
- Sharp Focus Range: A narrow, thin plane is in focus; anything slightly in front of or behind the focal point blurs rapidly.
- Background Appearance: Background details melt away into soft, out-of-focus blur (bokeh).
- Separation: Extreme subject isolation; the viewer’s eye is instantly forced onto the sharp subject (essential for portraits, wildlife, and product photography).
Quick Reference Summary Table
| Parameter | Value Raised (Larger / Higher) | Value Lowered (Smaller / Lower) |
|---|---|---|
| Shutter Speed (time) | • Brighter image • Motion blur / smooth water • Risk of handheld camera shake | • Darker image • Freezes motion • Sharp handheld shots |
| f-number | • Smaller physical aperture • Darker image • Deeper DoF (everything sharp) • Risk of lens diffraction | • Larger physical aperture • Brighter image • Shallow DoF (blurry background / bokeh) |
| ISO Sensitivity | • Brighter image • Visible noise / grain • Lower dynamic range and detail | • Darker image • Cleanest quality, zero noise • Maximum dynamic range & color depth |
| Depth of Field (DoF) | • Sharp from foreground to background • Everything is clear and in context | • Blurry background & foreground • Strong subject isolation (bokeh) |