CSE 429 Computer Vision · Gonzalez & Woods Ch. 1–3

Computer Vision
Study Guide

Socratic walkthroughs, flashcards & practice quizzes for the full course
قبل ما تبدا سمي الله و صلي عالنبي

Welcome 👋

This interactive guide covers CSE 429 Computer Vision and Pattern Recognition so far: how digital images are made, pixels and their neighbours, interpolation, image operations, intensity transformations and histogram equalization. It follows Gonzalez & Woods' Digital Image Processing (3rd ed.), the lecture slides and Sheets 1–3. Where a slide has a mistake, the guide says so and gives the correct version. Navigate through the modes below:

  • 📖 Tutorial Mode: each step goes idea → worked example → why → quick check, with tap-to-trace tables and explorers for paths, zooming and equalization.
  • 🎴 Flash Cards: definitions, formulas and the worked answers you should know cold.
  • 🎯 Professor's Focus: exam-style theory answers and every sheet problem worked in full: Part 1 (image fundamentals) and Part 2 (enhancement).
  • ⚡ Practice Quiz: exam-style MCQs from the lectures and all three sheets.

💡 Short on time? Do Tutorials 4, 7 and 8: they hold every numerical problem. Press Ctrl+K to search, and open the 📋 Cheat Sheet (bottom-right) for every formula.

📖
Tutorial Mode
Explanation-first walkthroughs of every lecture with try-it checks
0 / 0
🎴
Flash Cards
Quick-recall decks of definitions, formulas & worked answers
0 / 0
🎯
Professor's Focus
Exam-style theory answers and every sheet problem worked in full
⚡
Practice Quiz
Exam-style MCQs with hints, explanations & mistake tracking
Professor's Focus

Pick a revision part

Each part is a self-contained Q & A + worked-numerical deck built from the lecture slides, problem sheets and Gonzalez & Woods.

P1
Part 1 · Image Fundamentals
Lec 1–3 — what vision is, digital images, storage and transmission, adjacency and paths, distances, interpolation, image operations.
11 Q & A 9 worked problems
P2
Part 2 · Image Enhancement
Lec 4 — intensity transformations, contrast stretching, slicing, histograms and equalization.
5 Q & A + diagrams 4 worked problems
Sheet questions only Restrict the pool to questions that came directly from the practice sheets
10
15
20
All
of 0
Practice modeShow the correct answer & explanation after each question
Shuffle questionsRandomize the order each attempt
Sheet questions only Restrict the pool to coding tasks pulled from the practice sheets
5
10
15
All
of 0
Mix question stylesInterleave fill, line builder, and scratch coding questions
Shuffle questionsRandomize the order each attempt
Shuffle cardsRandomize the order each session
📋 Cheat Sheet
Check every formula and recipe anytime!
TUTORIAL MODEChoose a topic
Which topic do you want to walk through?

🗺️ The order: everything comes from Gonzalez & Woods, Digital Image Processing (3rd ed.), Chapters 1–3, plus the Lec 1 overview. Each topic only uses ideas from the ones above it: you need pixels and neighbours (4) before interpolation (5), and point operations (6–7) before histograms (8). If you're short on time, do 4, 7 and 8 first: they hold all the worked numerical problems.

👁️
1 · What Computer Vision Is (Lec 1, Lec 2)
Vision vs processing vs graphics · low/mid/high levels · why vision is ill-posed · the 9 challenges · applications
›
📷
2 · How a Digital Image Is Made (Gonzalez Ch 1–2.4)
EM imaging (PET corrected) · acquisition · sampling & quantization · resolution · file size, baud rate, HDTV (Sheet 3) · simultaneous contrast · key stages
›
🐍
3 · Images as Arrays in Python (Lec 2–3 code)
Shapes and dtypes · uint8 wrap-around · slicing the rabbit · imshow colour maps · threshold, NOT and masks
›
🔲
4 · Pixel Relationships (Gonzalez §2.5)
N4, ND, N8 · 4/8/m-adjacency · paths and lengths · regions · D4, D8, Euclidean · all of Sheet 2 · path explorer
›
🔍
5 · Interpolation & Resizing (Gonzalez §2.4.4)
Nearest neighbour · shrinking by deletion · bilinear worked step by step · bicubic · zoom explorer
›
➕
6 · Operations on Images (Gonzalez §2.6)
Array vs matrix products · linear vs non-linear (max) · arithmetic, clipping vs scaling · ROI masks · set & logical ops · point/local/global
›
🌗
7 · Intensity Transformations (Gonzalez §3.1–3.2)
g = T[f] · negatives · log (and the uint8 bug) · gamma · contrast stretching 3 × 3 · intensity slicing · bit planes
›
📊
8 · Histograms & Equalization (Gonzalez §3.3)
Reading histograms · why the cumulative sum works · the slide's 4 × 8 example corrected · Example 3.5 · stepper · matching · local statistics
›
LINKSMore Practice
Want to go deeper?
  • 📕 Gonzalez & Woods: Digital Image Processing, 3rd ed., Ch 1–3. Official support site and errata: imageprocessingplace.com.
  • 📗 Szeliski: Computer Vision: Algorithms and Applications (2nd ed.), free from the author at szeliski.org/Book, useful for the later lectures.
  • 🐍 scikit-image: data types guide (img_as_float and friends).
  • 📋 Cheat Sheet: the floating button (bottom-right) has every formula, the m-adjacency rule, the distance shapes and the equalization recipe.
1 / 1
1 / 1
0 ✓
0 ✗
Q1
…
Your Result
0/0
0%
0
Correct
0
Wrong
0
Skipped
Review
Paste the copied review into ChatGPT, Claude, or any LLM for a deeper walkthrough of the questions you missed.
1 / 1
FLASH CARDS
Click the card to flip · use the buttons below to track recall
PROFESSOR'S FOCUSFull Revision Guide (Parts 1 & 2)
Exam-style theory and worked problems — Lectures 1–4, Sheets 1–3

Items drawn from the CSE 429 slides, Sheets 1–3 and Gonzalez & Woods (3rd ed.). Theory first, then solved numericals. Click any item to expand.

Show:

📘 Theoretical Q & A

🧮 Solved Numerical Problems

CODING MODEPick a topic
Which topic do you want to practice writing code for?
1 / 1
FILL
…
25:00
Start focus timer
🍅 Focus Timer
Pomodoro / break / stopwatch — keeps counting across pages and refreshes.

🍅 Focus Timer

25:00
Focus Session
Sound chime Play a gentle tone when the timer ends

📋 Exam Reference Sheet

Digital Images

  • Digital image: f(x, y) with x, y and f discrete. Origin top-left, x = row, y = column.
  • Sampling digitizes coordinates; quantization digitizes amplitude.
  • Levels: L = 2k (1→2, 4→16, 7→128, 8→256, 9→512, 16→65,536).
  • Size: rows × cols × channels × k bits; ÷ 8 = bytes; ÷ 220 = MB.
  • Transmission: packet = start + data + stop bits; time = total bits ÷ baud.
  • Dynamic range = max measurable / min detectable; contrast = highest − lowest.
  • PET: positron + electron → two gamma rays (detected). CT: X-rays.

Python

  • Shape (height, width, channels); uint8 0–255 wraps mod 256; float 0–1.
  • img_as_float float64 · img_as_ubyte uint8 · img_as_uint uint16 · img_as_int int16.
  • 2-D arrays: plt.imshow(img, 'gray'); histogram: plt.hist(img.ravel(), 256).

Neighbours & Adjacency (values in V)

  • N4: (x±1, y), (x, y±1). ND: (x±1, y±1). N8 = N4 ∪ ND.
  • 4-adj: q ∈ N4(p). 8-adj: q ∈ N8(p).
  • m-adj: q ∈ N4(p), or q ∈ ND(p) and N4(p) ∩ N4(q) has no V pixels (check the two corners).
  • Path length = steps = pixels − 1. m and 8 give the same regions.

Distances

  • De = √((x−s)² + (y−t)²) (disc)
  • D4 = |x−s| + |y−t| (diamond; D4 ≤ 2 = 13 pixels)
  • D8 = max(|x−s|, |y−t|) (square; D8 ≤ 2 = 25 pixels)
  • D8 ≤ De ≤ D4.

Interpolation

  • Nearest: output (i, j) ← input (⌊i·R/R′⌋, ⌊j·C/C′⌋). Shrink = delete rows/cols.
  • Bilinear: v = ax + by + cxy + d from 4 neighbours = lerp along edges, then between them.
  • Bicubic: Σ aijxiyj, i, j = 0..3: 16 neighbours.

Operations

  • Image × image = array (element-wise) product.
  • Linear: H[a f₁ + b f₂] = a H[f₁] + b H[f₂]. Σ linear, max not.
  • Sum 0–510, difference −255–255: clip, or scale 255·(f − min)/max(f − min).
  • ROI: multiply by a 1/0 mask. A − B = A ∩ Bᶜ; A ∪ B = A, B or both.
  • Point / local / global: one pixel / neighbourhood / whole image.

s = T(r), r in 0 … L − 1

  • Negative: s = L − 1 − r
  • Log: s = c·log(1 + r), c = 255/ln(1 + rmax) ≈ 45.99. Use float, not uint8.
  • Gamma: s = c·rγ on 0–1. γ < 1 brighter, γ > 1 darker.
  • Stretch: (I − Min)(NewMax − NewMin)/(Max − Min) + NewMin, round to nearest.
  • Piecewise: r₁ = s₁, r₂ = s₂ identity; r₁ = r₂, s₁ = 0, s₂ = L − 1 threshold.
  • Slicing: [A, B] → 255; rest → 0 (binary) or unchanged. Say whether the ends count.
  • Bit plane k: ⌊r / 2k−1⌋ mod 2; plane 8 = MSB.

Histogram

  • h(rk) = nk, p(rk) = nk/MN.
  • Dark → left, bright → right, low contrast → narrow middle.

Equalization recipe

  • nk → pk → running total Σp → × (L − 1) → round = sk → replace each rk by sk.
  • Lec 4 4 × 8: s = 1, 3, 4, 5, 7 (slide's "7(0.357) = 2" is wrong).
  • Ex 3.5: 0→1, 1→3, 2→5, 3→6, 4→6, 5→7, 6→7, 7→7.
  • Matching: s = T(r), G(z) = (L − 1)Σpz, z = closest G to s.
  • Stats: m = Σ r p(r), σ² = Σ (r − m)² p(r).

Final answers (worked in Professor's Focus)

  • Camera 2680 × 1520, RGB, 256: 97,766,400 bits = 11.655 MB
  • Sheet 3 Q1 (512 levels): 109,987,200 bits ≈ 13.11 MB
  • Sheet 3 Q2 (1920 × 1080 grey, 128): 14,515,200 bits ≈ 1.73 MB
  • Sheet 3 Q3 (56K / 3000K baud): 3.12 min / 3.50 s
  • Sheet 3 Q4 (70K / 4000K baud): 4.49 min / 2.36 s (4.72 s if one pixel per packet)
  • Sheet 3 Q5 / Q6 (HDTV): 1.1664e+13 / 3.456e+12 bits
  • Sheet 2 Q1: not 4-adjacent; 8- and m-adjacent
  • Sheet 2 Q2 (a) V = {0, 1}: 4: none · 8: 4 · m: 5
  • Sheet 2 Q2 (b) V = {1, 2}: 4: 6 · 8: 4 · m: 6
  • Sheet 2 Q3: 4: none · 8: 4 · m: 6
  • Sheet 2 Q4 regions: 4-adj: 16 · 8/m-adj: 3
  • Lec 3 distances (4, 2)–(1, 4): D4 = 5, D8 = 3, De = √13 ≈ 3.61
  • Bilinear 2 × 2 → 3 × 3 centre: 145
  • Stretch [60, 150] → [0, 255]: 113 170 184 / 125 142 255 / 0 198 227
  • Lec 4 equalization (corrected): s = 1, 3, 4, 5, 7; rows 1 3 3 4 4 5 7 7
  • Gonzalez Example 3.5: s = 1, 3, 5, 6, 6, 7, 7, 7