CSE 4227 · Prof. Kalpoma · AUST

DIP on one page

What each question type wants, which method each story word points to, every formula with a worked line, and the theory points to write. Fall 2024 papers are left out.

The paper in one look

70 marks · 3 hours
In plain wordsThree questions. Q1 asks you to explain, Q2 asks you to calculate, Q3 gives a story (a hospital, a satellite, a scanner) and asks which method fits. The same 12 methods answer all three; only the way you write changes.
questionwhat it wantschoicehow you write it
Q1 theory · 25define, compare, list effectsany 5 of 6 (one per chapter)definition → formula → 2–3 points → small sketch
Q2 math · 24numbers: histogram, filter, compression, chain code / morphologyabout 3 of 4formula → table of every step → final grid / code → one-line comment
Q3 case · 21a real problem; pick and justify methodsany 3 of 4problem → method → why → steps (with equation) → result

Time: about 2.5 minutes per mark. A 7-mark case = 17 minutes. Never spend more than 20 minutes on one part.

Where marks hide: the formula line, the working table and the final labelled answer each carry marks on their own. A right answer with no table loses about half.

How everything connects

all 14 decks
In plain wordsEvery topic is one stop on the same road: take a picture, make it look better, find the object, describe its shape, store it small. Once you see the road, you know which chapter a question comes from.
1 · Capturedecks 01–03

sampling, quantization, bits, pixels, neighbours, distance

2 · Enhancedecks 04–07

point ops (negative, log, gamma, stretch, slice, bit-plane) → histogram → smooth → sharpen

3 · Find objectsdecks 08–09

edges (gradient, Laplacian, Canny) or regions (threshold, region growing)

4 · Clean shapedecks 11–12

erosion, dilation, opening, closing, boundary, hit-or-miss

5 · Describe shapedeck 10

chain code → CFD → shape number

6 · Store / colourdecks 13–14

Huffman, Golomb, LZW, RLE, RMSE · RGB, CMY, HSI

The same idea shows up twice (connect these dots)

first meetingsecond meetingthe link
thresholding s = 1 if r > k (deck 04)global / iterative threshold (deck 09), binary input for morphology (deck 11)one cut turns gray into object vs background
contrast stretching (deck 04)histogram equalization (deck 05)both spread values over 0…L−1; HE does it automatically from the CDF
mean / Gaussian smoothing (deck 06)Canny step 1, LoG (deck 08)smooth first so noise doesn't make fake edges
Laplacian ∇²f (deck 07)LoG / zero crossings (deck 08)2nd derivative: thin double edges, sensitive to noise
Sobel / Prewitt gradient (deck 07)Canny step 2 (deck 08)1st derivative: edge strength and direction
median filter (deck 06)salt-and-pepper case questions (Q3)median ignores extreme 0/255 values and keeps edges
boundary β(A) = A − (A ⊖ B) (deck 11)chain code walks that boundary (deck 10)first find the outline, then code it
erosion (deck 11)hit-or-miss = two erosions (deck 12)HMT erodes the object with B1 and the background with B2
entropy H (deck 13)Huffman Lavg (deck 13)H is the floor: Lavg ≥ H, efficiency = H / Lavg
histogram p(rk) = nk/N (deck 05)probabilities for Huffman and entropy (deck 13)same counting table, different use
intensity I in HSI (deck 14)gray-level methods (decks 04–06)enhance I only, keep H and S, colours stay true

Cue words: what the question really asks

Q3 and Q1 triggers
In plain wordsCase questions hide the method inside a story. Spot the problem word, map it to the method, then justify with one line of how the method works. Learn this table and Q3 becomes matching.

Enhancement stories

you readit meansyou write / use
too dark, underexposed X-ray / MRI, details hidden in shadowsdark values squashed togetherlog or gamma γ < 1; or histogram equalization
washed out, too bright, aerial photo, fadedbright values squashed togethergamma γ > 1 (3.0–4.0 on the slides)
low contrast, dull, narrow histogramvalues use only part of 0…L−1contrast stretching or histogram equalization
highlight a range: tumor, bone [120, 200], water in satelliteone band of gray levels mattersgray-level slicing: give both approaches (background 0, or keep r)
huge dynamic range, Fourier spectrumvalues 0 to 10⁶ won't fit 0–255log transform
negative film, white lesions in dark mammogramdark ↔ light swap helps viewingnegative s = L−1−r
hidden watermark, which bits matter, compress by bitsimage = stack of bit planesbit-plane slicing: top planes carry the shape
want the look of another imagetarget histogram givenhistogram matching (specification)

Noise and sharpness stories

you readit meansyou write / use
salt-and-pepper, impulse noise, black and white dotsisolated extreme 0 / 255 pixelsmedian filter 3×3 (keeps edges)
Gaussian noise, grainy, random noiseevery pixel slightly offmean / weighted average / Gaussian filter (blurs a bit)
only pepper (black dots) / only salt (white dots)one-sided impulsesmax filter removes pepper, min filter removes salt
blurred, fine detail, sharpen, faded ink edgesedges too softLaplacian g = f − ∇²f, or unsharp masking / high-boost
find edges / outline of an organ, crack, road edgebig change in intensitySobel / Prewitt gradient, best: Canny
noisy image but need thin, clean, connected edgesedge detector that resists noiseCanny (smooth, gradient, NMS, double threshold, hysteresis)
straight lines: roads, lanes, fracture linespixels lying on a lineline masks (−1 −1 −1 / 2 2 2) or Hough transform (one line: votes in (ρ, θ))

Segmentation stories

you readit meansyou write / use
separate object from background, text from papertwo intensity groupsthresholding; iterative T = ½(μ₁ + μ₂)
uneven illumination, shadow on the documentone T can't fit everywherelocal / adaptive threshold (T from each neighbourhood)
group similar pixels from a seed point, tumor regiongrow from a known pixelregion growing: |neighbour − pixel it grows from| ≤ T
"partition pixels depending on intensity"the words for thresholdingthresholding (SP23 Q1(b)ii)
"groups similar pixels"the words for region-basedregion growing or split & merge (SP23 Q1(b)iv)

Shape stories (binary images)

you readit meansyou write / use
broken characters, gaps in roads, cracks to joinsmall breaks in the objectdilation (or closing to keep thickness)
small bright spots, specks, small particles to removeobjects smaller than the SEopening (erode, then dilate)
small holes inside objects, reflections to fillbackground specks inside the objectclosing (dilate, then erode)
touching coins, count objectsthin necks join the objectserosion to split, then count connected components
outline / boundary of roads, organ edge (binary)the object's border pixelsboundary β(A) = A − (A ⊖ B)
find corners, end points, a fixed patternmatch object AND backgroundhit-or-miss A ⊛ B = (A ⊖ B₁) ∩ (Aᶜ ⊖ B₂)
recognise a shape whatever its rotation / startdescribe the boundary by numberschain code → CFD → NCFD (shape number)

Storage and colour stories

you readit meansyou write / use
medical, legal, must not lose any detaillossless onlyHuffman, LZW, RLE, Golomb, arithmetic
many repeating patterns / colours, bitmap, fixed-length codesthe same sequences come backLZW (dictionary, 9-bit codes)
long runs of the same value, fax, binary documentsconsecutive equal pixelsRLE (value, run length)
some gray levels far more common than othersunequal probabilitiesHuffman (short codes for frequent values)
small integers / prediction errors, geometric spreadsmall values commonGolomb Gm(n)
whole message as one numbernon-block codearithmetic coding
how good is the decompressed image?fidelity criterionRMSE (objective) or rating scale (subjective)
printing, ink, printersubtractive colourCMY / CMYK
monitor, camera, displayadditive colourRGB
segment by colour, lighting changes, describe colour like humansseparate colour from brightnessHSI (use Hue)
TrapWhen a case lists four methods (SP25 Q3(d): chain code, histogram, Hough, power-law), give each one line of what it does, one line of how it helps here, and one limitation. That is the 3-part pattern she marks.

Q3 case answers: the template and six solved stories

SP23 · F23 · SP24 · SP25 · F21 · F25 quiz
Problem (cue word) → Method → Why it works → Steps / equation → Result + one limitation

Write each case as 4–6 short lines in that order. Name the method in bold in the first line; the examiner looks for it.

SP23 Q1(b) · brain tumor pipeline2 + 2 + 3 + 2

(i) Remove noise: median filter (scan noise is impulse-like; median keeps tumor edges) or Gaussian/mean for random noise.

(ii) Partition by intensity: thresholding, g = 1 if f > T else 0; T found iteratively.

(iii) Highlight a range of values: gray-level slicing, [A, B] → L−1, others 0 (or unchanged).

(iv) Group similar pixels: region growing from a seed inside the tumor, add 8-neighbours with |difference| ≤ T.

SP25 Q3(a) · faded, unevenly lit document for OCR4 + 3 + 3

(i) Enhance: contrast stretching or histogram equalization (faded ink = low contrast) and median filter (background specks).

(ii) Laplacian over Sobel: text is thin strokes and fine detail; the 2nd derivative gives thin, sharp response and g = f − ∇²f sharpens in one mask. Sobel gives thick edges and needs two masks.

(iii) Segment: local (adaptive) thresholding, because illumination is uneven; then horizontal projection to split text lines.

SP25 Q3(c) · satellite roads with spots and gaps3 + 3 + 3

(i) Opening A ∘ B = (A ⊖ B) ⊕ B: erosion deletes spots smaller than B, dilation restores the roads' size.

(ii) Closing A • B = (A ⊕ B) ⊖ B: dilation bridges small gaps, erosion returns the road width. Use a line-shaped SE along the road.

(iii) Boundary β(A) = A − (A ⊖ B): subtract the eroded road from the road; one-pixel outline remains.

F23 Q3(b) · touching coins, small particles5 + 5

(i) Erosion with a disk SE larger than the necks: touching coins split into separate blobs; count with connected-component labeling. (Follow with dilation if size matters = opening.)

(ii) Opening with an SE just larger than the small particles: they cannot contain the SE, so erosion removes them; dilation restores the large particles to their size.

SP24 Q3(a) · salt-and-pepper only on the object4 + 4

(i) Median filter 3×3 on the object region (mask from thresholding), background untouched: impulses sort to the ends, the median ignores them, edges stay sharp.

(ii) Morphology: opening removes white (salt) specks, closing fills black (pepper) dots inside the object.

SP25 Q3(d) · bone fracture, four methods7

Power-law: γ < 1 brightens a dark X-ray so thin cracks show; limitation: also brightens noise.

Histogram analysis / equalization: spreads bone gray levels for contrast; limitation: may over-enhance soft tissue.

Hough transform: finds straight fracture lines by voting in (ρ, θ); limitation: curved cracks are missed.

Chain code: codes the bone outline; a break shows as an irregular CFD (sudden turns); limitation: noise-sensitive, needs a clean boundary.

Formulas 1 · capture and pixels

decks 01–03
whatformulaone worked line
gray levelsL = 2k, range 0 … L−1k = 12 → L = 4096, range 0–4095
image sizeb = M × N × k bits (÷ 8 = bytes)1024 × 768 × 12 = 9,437,184 bits = 1,179,648 bytes
nearest-neighbour zoomposition = ⌈i × old / new⌉, i = 1…new3×3 → 5×5: ⌈0.6 i⌉ = 1 2 2 3 3 (copy those rows / columns)
city-block D4|x − s| + |y − t|p(1,2), q(4,6): 3 + 4 = 7
chessboard D8max(|x − s|, |y − t|)max(3, 4) = 4
Euclidean De√[(x − s)² + (y − t)²]√(9 + 16) = 5

Formulas 2 · point transformations

deck 04
methodformulaworked lineuse
negatives = (L−1) − r8-bit, r = 100 → 155white detail in dark areas
logs = c · log(1 + r), c = (L−1)/log(L)c = 255/log 256 = 105.89; r = 50 → 105.89 × log 51 = 181expand dark, compress bright
gammas = (L−1) · (r / (L−1))γ3-bit, r = 3: γ = 0.5 → 7 × 0.6547 = 5; γ = 2 → 7 × 0.1837 = 1γ < 1 brighter, γ > 1 darker
min–max stretchs = (r − rmin)(L−1) / (rmax − rmin)[50, 150] → [0, 255]: r = 100 → 50 × 255/100 = 127.5 → 128fill the whole range
thresholds = L−1 if r > k, else 0k = 127: 90 → 0, 200 → 255binary object vs background
bit plane nbitn = ⌊r / 2n−1⌋ mod 2 (weight 2n−1)13 = 1101: planes 4,3,2,1 = 1,1,0,1top planes = shape, bottom = noise

Piecewise contrast stretching with (r₁, s₁), (r₂, s₂)

s =
(s₁ / r₁) · r
0 ≤ r < r₁
s₁ + (s₂ − s₁)(r − r₁) / (r₂ − r₁)
r₁ ≤ r ≤ r₂
s₂ + (L−1 − s₂)(r − r₂) / (L−1 − r₂)
r > r₂

Three special settings: r₁ = s₁ and r₂ = s₂ → identity (no change). r₁ = r₂, s₁ = 0, s₂ = L−1 → thresholding. r₁ ≤ r₂ and s₁ < s₂ in between → contrast stretching. Draw all three graphs.

Gray-level slicing, range [A, B] (F25 quiz: bone [120, 200])

approach 1 =
L−1
A ≤ r ≤ B
0
otherwise
approach 2 =
L−1
A ≤ r ≤ B
r
otherwise

r = 100 → 0 / 100 · r = 150 → 255 / 255 · r = 220 → 0 / 220. Approach 1 = binary, background gone; approach 2 = background kept.

TrapFind L first. A 3-bit image means L − 1 = 7, so gamma and log use 7, not 255. Round .5 up.

Formulas 3 · histogram equalization

deck 05 · in almost every final
p(rk) = nk / N  →  CDF = Σ p  →  sk = round( (L−1) × CDFk )

Worked (3-bit, N = 64, nk = [8, 10, 10, 2, 12, 16, 4, 2]). Do every row like the first two:

r = 0: p = 8/64 = 0.125, CDF = 0.125, 7 × 0.125 = 0.875 → 1.   r = 1: p = 10/64 = 0.15625, CDF = 0.28125, 7 × 0.28125 = 1.969 → 2.

rnkpCDF7 × CDFs
080.12500.12500.8751
1100.15620.28121.9692
2100.15620.43753.0623
320.03120.46883.2813
4120.18750.65624.5945
5160.25000.90626.3446
640.06250.96886.7817
720.03121.00007.0007

New histogram: add the counts that land on the same s: s = 3 gets 10 + 2 = 12; s = 7 gets 4 + 2 = 6. Total stays 64.

816081102123412516667gray levelnk
Equalized histogram: spread out, not perfectly flat, because levels are discrete. Write that sentence.

Matching (if asked): equalize the input → H, equalize the target → S, map each r to the z whose S is closest to its H (ties → higher S).

TrapDraw three things: the original histogram, the equalized histogram and the transformation (staircase). Each is a separate mark.

Formulas 4 · smoothing and sharpening

decks 06–07

One window, every filter. Centre pixel = 200 (a noise spike):

102030
4020060
708090
window f
121
242
121
weights / 16
filterruleresult at the centre
mean (box)Σ / 9600 / 9 = 66.67 → 67
weighted averageΣ w·f / 161400 / 16 = 87.5
mediansort 9, take the 5th10 20 30 40 60 70 80 90 200 → 60 (spike gone)
min / maxsmallest / largest10 / 200

Laplacian sharpening (2nd derivative)

∇²f = f(x+1,y) + f(x−1,y) + f(x,y+1) + f(x,y−1) − 4f(x,y)
101010
105010
101010
f
010
1-41
010
mask (centre −4)

∇²f = 10 + 10 + 10 + 10 − 4×50 = -160. Centre negative, so g = f − ∇²f = 50 + 160 = 210: the bright dot gets brighter, detail stands out. One-pass mask: [0 −1 0; −1 5 −1; 0 −1 0].

Sobel gradient (1st derivative)

101010
101010
909090
f
-101
-202
-101
Gx
-1-2-1
000
121
Gy

Gx = (10 + 20 + 90) − (10 + 20 + 90) = 0. Gy = (90 + 180 + 90) − (10 + 20 + 10) = 320. |∇f| ≈ |Gx| + |Gy| = 320: a strong horizontal edge. Direction α = tan⁻¹(Gy / Gx).

Unsharp masking: mask = f − blurred f; g = f + k · mask. k = 1 unsharp, k > 1 high-boost.

1st derivative (gradient)2nd derivative (Laplacian)
thick edges, non-zero along rampsthin double edges, zero on ramps, zero crossing at the edge
less noise-sensitivevery noise-sensitive, strong on isolated points
gives directionno direction, one mask

Formulas 5 · edges and segmentation

decks 08–09

Canny: 3 criteria, 5 steps

Criteria: low error rate (find real edges only), good localisation (on the true edge), single response (one pixel per edge).

  1. Smooth with a Gaussian.
  2. Gradient magnitude and angle (Sobel).
  3. Non-maximum suppression: keep a pixel only if it beats its two neighbours along the gradient direction (thin edges).
  4. Double threshold TH and TL (ratio 2:1 or 3:1): strong ≥ TH, weak between.
  5. Hysteresis: keep a weak pixel only if it is 8-adjacent to a strong one.

Thresholding

g(x,y) = 1 if f(x,y) > T, else 0    Tnew = ½(μ₁ + μ₂)

Iterative T, values 10 20 30 200 210 220: start T₀ = mean = 115. Group above: mean 210; group at or below: mean 20. T₁ = ½(210 + 20) = 115 = T₀, so stop.

Region growing: start at a seed, add a 4- or 8-neighbour when |neighbour − the pixel it grows from| ≤ T, repeat until nothing joins. Split & merge: split a block into 4 while (max − min) > T, merge neighbours that are similar.

Line masks (sum 0, the 2s lie along the line): horizontal [−1 −1 −1; 2 2 2; −1 −1 −1], vertical [−1 2 −1; −1 2 −1; −1 2 −1], ±45° with the 2s on a diagonal.

Formulas 6 · chain code (the teacher's tricks)

deck 10

Compass: 0 = right, counting anticlockwise: 1 ↗, 2 ↑, 3 ↖, 4 ←, 5 ↙, 6 ↓, 7 ↘ (4-direction: 0 →, 1 ↑, 2 ←, 3 ↓).

  1. CC: walk the boundary in the direction asked; write the arrow number of each move until you are back at the start.
  2. CFD trick: from each digit to the next, count anticlockwise steps on the compass. Same arrow = 0. The last digit goes to the first.
  3. NCFD trick: underline the 0s. Start at the longest run of 0s (the end joins the start), read to the end, wrap round. Two runs tie? Compare the digits right after them. No 0? Use the smallest digit.

Worked (slide 12 / SP24): CC = 0 0 7 7 5 6 5 5 4 3 2 2 2 1 2

CFD: 0→0 = 0 steps, 0→7 = 7 steps, 7→7 = 0, 7→5 = 6, … last 2→0 = 6. CFD = 070617077700716

0s at places 1, 3, 7, 11, 12. Longest run = places 11–12 (two 0s). Start there: 0 0 7 1 6 | 0 7 0 6 1 7 0 7 7 7 → NCFD = 007160706170777

whatinvariant to
CCtranslation
smallest shift of CC+ start point
CFD+ rotation (45° steps)
NCFD = shape numberstart point + rotation

Formulas 7 · morphology and hit-or-miss

decks 11–12
operationequationplain ruleeffect
erosionA ⊖ B = {z | (B)z ⊆ A}SE must fit (all 1s on object)shrink, delete specks, split joins
dilationA ⊕ B = {z | (B̂)z ∩ A ≠ ∅}SE must hit (any 1 on object)grow, fill holes, join gaps
openingA ∘ B = (A ⊖ B) ⊕ Berode, then dilateremove small objects and thin bridges, size kept
closingA • B = (A ⊕ B) ⊖ Bdilate, then erodefill small holes and gaps, size kept
boundaryβ(A) = A − (A ⊖ B)object minus its eroded self1-pixel inner outline
hit-or-missA ⊛ B = (A ⊖ B₁) ∩ (Aᶜ ⊖ B₂)1s match object AND 0s match background; × ignoredcorners, end points, patterns
thinning / thickeningA − (A ⊛ B) / A ∪ (A ⊛ B)subtract / add the matchesskeleton / grow outline

1-D worked, row 1 0 0 0 1 1 1 0 1 1, SE [1 1 1] (ends ignored):

Erosion takes the minimum under the SE: windows 100, 000, 001, 011, 111, 110, 101, 011 → 0 0 0 0 1 0 0 0.

Dilation takes the maximum: → 1 0 1 1 1 1 1 1 (only the 000 window stays 0).

Memory hook: Erosion Eats, Dilation Deposits. Opening = E then D (opens gaps between things, removes specks). Closing = D then E (closes holes).

TrapShow the middle image (A ⊖ B or A ⊕ B) in every opening / closing answer. For hit-or-miss draw each SE with 1 / 0 / ×, one output grid per SE, then the OR.

Formulas 8 · compression

deck 13 · biggest marks block
whatformulaworked line
compression ratioCR = n₁ / n₂ (original / compressed)512×512×8 = 2,097,152 bits; 64 KB = 524,288 bits → CR = 4
relative redundancyRD = 1 − 1/CR1 − 1/4 = 0.75 → 75% redundant
average lengthLavg = Σ l(rk) p(rk)Huffman below: 1.9 bits/symbol
entropyH = −Σ p log₂ p0.4·1.322 + 0.3·1.737 + 0.2·2.322 + 0.1·3.322 = 1.8464
efficiencyη = H / Lavg1.8464 / 1.9 = 97.2%
RMSEerms = √[ (1/MN) Σ (f̂ − f)² ]every pixel +2: √(36/9) = 2
SNR (ms)Σ f̂² / Σ (f̂ − f)²248 / 36 = 6.889

Huffman (SP25: A 0.4, B 0.3, C 0.2, D 0.1)

Reduce: sort, merge the two smallest: C + D = 0.3 → list 0.4, 0.3, 0.3 (the sum goes below the equal value) → merge 0.3 + 0.3 = 0.6 → list 0.6, 0.4.

Code back: upper branch 0, lower 1: 0.6 = 0, 0.4 = 1 → A = 1; B = 00, (CD) = 01 → C = 010, D = 011.

Lavg = 0.4·1 + 0.3·2 + 0.2·3 + 0.1·3 = 1.9 ≥ H = 1.8464. Fixed 2-bit code → CR = 2 / 1.9 = 1.053.

Golomb Gm(n)

q = ⌊n/m⌋ → q ones + 0  |  r = n mod m, k = ⌈log₂m⌉, c = 2k − m: r < c → r in k−1 bits, else r + c in k bits

G₄(9): q = 2 → 110; r = 1, k = 2, c = 0 → r ≥ c → 1 + 0 = 1 in 2 bits = 01 → 11001.

G₅(12): q = 2 → 110; r = 2, k = 3, c = 3 → r < c → 2 in 2 bits = 10 → 11010.

Arithmetic (slide 53: a1 0.2, a2 0.2, a3 0.4, a4 0.2; message a1 a2 a3 a3 a4)

new low = low + range × (slice start)    new high = low + range × (slice end)
symbolrange beforelowhigh
a1100.2
a20.20.040.08
a30.040.0560.072
a30.0160.06240.0688
a40.00640.067520.0688

Any number in [0.06752, 0.0688) codes the message: the slide picks 0.068.

LZW (slide 77: 4×4 image, every row 39 39 126 126)

Dictionary starts with 0–255. Read a pixel: if (current + pixel) is in the dictionary, keep extending; if not, output the code of current, add (current + pixel) at the next location (256, 257, …), restart from the pixel.

recognizedpixeloutputlocationentry
39
39393925639-39
391263925739-126
126126126258126-126
12639126259126-39
3939
39-3912625626039-39-126
126126

Full output: 39 39 126 126 256 258 260 259 257 126 → 10 codes × 9 bits = 90 bits vs 128 → CR = 1.42.

RLE: write (value, run length). Row 10 10 10 10 12 12 → (10, 4)(12, 2). Short runs make the file bigger (CR < 1): say so.

Which redundancy each method removes

redundancywhat it isremoved by
codingcodes longer than neededHuffman, Golomb, arithmetic
spatial / inter-pixelneighbours repeat or predict each otherLZW, RLE, predictive coding
irrelevant (psychovisual)detail the eye ignoresquantization (lossy)
temporalframes in a video repeatframe differencing

Formulas 9 · colour

deck 14
whatformula / fact
RGB → CMYC = 1 − R, M = 1 − G, Y = 1 − B (normalise to 0–1 first)
θcos⁻¹ { ½[(R − G) + (R − B)] / √[(R − G)² + (R − B)(G − B)] }
Hθ if B ≤ G, else 360° − θ (red 0°, green 120°, blue 240°)
S1 − 3·min(R, G, B) / (R + G + B)
I(R + G + B) / 3
24-bit colours2²⁴ = 16,777,216

Worked (R, G, B) = (0.8, 0.4, 0.2): numerator ½(0.4 + 0.6) = 0.5; denominator √(0.16 + 0.6 × 0.2) = √0.28 = 0.5292; θ = cos⁻¹(0.9449) = 19.1°. B ≤ G, so H = 19.1°. S = 1 − 3 × 0.2 / 1.4 = 0.5714. I = 1.4 / 3 = 0.4667.

Q1 theory: question → what to write

5 marks each · any 5 of 6
In plain wordsEach Q1 answer is a definition, a formula or sketch, and three short points. Below are the questions she repeats, with the points to write.
if askedwrite
sampling vs quantization; why more levels look finercoordinates vs amplitude; few pixels → blocky, few levels → false contours; bits = M·N·k
4-, 8-, m-connectivity; distance propertiesthe three adjacency rules; m removes double paths; D ≥ 0, symmetric, triangle inequality
image enhancement; spatial vs frequency domainmake an image more useful for a task; spatial works on pixels directly (point, neighbourhood), frequency on the Fourier transform
piecewise linear: identity, threshold, stretchthe 3-piece formula with (r₁,s₁),(r₂,s₂) and the 3 settings, each with a graph
histogram; 4 types; can you rebuild the image?h(rk) = nk; dark / bright / low / high contrast sketches; no, it holds no positions
why is the equalized histogram not flat?discrete levels: several r map to one s, some s stay empty
smoothing vs sharpeningaveraging (integration) blurs, removes noise; derivatives (differentiation) bring out edges
1st vs 2nd derivativethick vs thin double edge; ramp non-zero vs zero; 2nd strong on points, noise-sensitive
edge detection steps; Cannysmooth → gradient → threshold; Canny's 3 criteria and 5 steps
segmentation approachesdiscontinuity (points, lines, edges) and similarity (threshold, region growing, split & merge)
structuring element; erosion vs dilationsmall shape with an origin; fit vs hit; shrink vs grow; one application each
opening vs closingequations, order of operations, specks vs holes, idempotent
chain code; why CFD and NCFDboundary as direction numbers; CFD removes rotation, smallest shift removes start point
data vs information; three redundanciesdata = what is stored, information = what it tells; coding, spatial, irrelevant (+ temporal)
lossless vs lossyexact rebuild (Huffman, LZW, RLE) vs some loss for higher CR (quantization); judge lossy with RMSE
why is Huffman optimal / entropyshortest codes for most likely symbols, prefix-free; H is the lower bound on Lavg
additive vs subtractive; which model for printing, display, segmentationlight vs pigment; CMYK, RGB, HSI
RGB cube; how gray is formedaxes R, G, B 0–1; black origin, white (1,1,1); gray on the diagonal

Last-hour traps

read this on the bus