CSE 4227 · decks 08–09 · only what she asks

Edges and regions, the short way

Five topics from decks 08 and 09, each with a picture and the exact lines to write in the exam.

What to learn from these two decks

decks 08–09

Everything she has asked from decks 08 and 09 is on this page. Skip the rest of the decks (point detection, split & merge, Hough).

  1. Two approaches of segmentation (7 finals, Fall 25 quiz).
  2. 1st vs 2nd derivative on a ramp (SP24) and why Gaussian + Laplacian / LoG (Fall 25 quiz).
  3. Canny: criteria and steps, Canny with numbers, false positives / negatives, Sobel with numbers, line masks, the Canny schematic (SP22–SP25, F23).
  4. Thresholding (SP23, SP25 cases).
  5. Region growing, with two full numeric examples (SP23 case, F22).

How each section works: the orange box lists the exam questions it answers. Then: the idea in one line, the lines to write (with a grey "means" line under each), and every numeric worked in full.

Your own words are fine. She marks the idea, not the exact sentence. Make sure the bold keywords appear in your answer.

1 · Two approaches of segmentation

★ 7 finals · F23 Q1(e), F25 quiz
If the exam asks this, use this section
  • "What are the two principal approaches to image segmentation?" F25 quiz
  • "Write down the types of image segmentation based on two basic properties of intensity values." F23, F22
  • "What do you understand by image segmentation?" Answer: dividing an image into meaningful regions (objects vs background), the first step of image analysis. F21
In plain wordsTo cut an image into objects you either look for where brightness suddenly jumps (borders) or for pixels that are alike (groups).
Write this2–5 marks

Normal line = write it on the paper. Grey "means" line under it = what it means (do not write that).

Segmentation algorithms use one of two basic properties of intensity values:

There are only two ways to split a picture into objects. Say that first.

1. Discontinuity: partition the image where intensity changes sharply, i.e. at edges.

Look for places where brightness suddenly jumps (dark to bright). Those jumps are the borders of objects.

Methods: point, line and edge detection (gradient, LoG, Canny), watershed.

The tools that find those jumps: Sobel gradient, Canny and so on.

2. Similarity: partition the image into regions that are similar according to a predefined criterion.

Instead of borders, put pixels that look alike into the same group (e.g. all bright pixels = object).

Methods: thresholding, region growing, region splitting and merging.

The tools that make groups: one cut-off value (threshold), or spreading from a seed (region growing).

Memory hook: discontinuity finds borders, similarity finds groups.

2 · 1st vs 2nd derivative on a ramp

★ SP24 Q1(b)
If the exam asks this, use this section
  • "Define the first-order and second-order derivatives of a 1-D function f(x)." SP24
  • "What relation is there between 1st and 2nd derivatives for an edge that is a ramp?" SP24
  • "Why is the 2nd derivative bad with noise?" / "What is a zero crossing?" slides 16–19
In plain wordsAn edge is where brightness changes. The 1st derivative is the change between neighbours, so on a ramp it is non-zero all the way along: a thick edge. The 2nd derivative is the change of the change, so it fires only where the ramp starts and stops, with opposite signs: a thin double edge. Halfway between those two it crosses zero: that is the edge centre.
x01234567
f(x)55432100
1st = f(x+1) − f(x)0-1-1-1-1-10
2nd = f(x+1) + f(x−1) − 2f(x)-100001
Write this3 + 2 marks

Normal line = write it on the paper. Grey "means" line under it = what it means (do not write that).

∂f/∂x = f(x+1) − f(x)

1st derivative = next pixel minus this pixel: how much the brightness changes in one step.

∂²f/∂x² = f(x+1) + f(x−1) − 2f(x)

2nd derivative = how much that change itself changes: right + left − 2 × middle.

Example ramp 5 5 4 3 2 1 0 0: 1st = 0 -1 -1 -1 -1 -1 0; 2nd = -1 0 0 0 0 1.

Brightness slides down 5 to 0 one step at a time (a ramp). Work out both rows with the formulas above; this example earns marks.

(1) The 1st derivative is non-zero along the entire ramp, giving a thick edge.

It is −1 at every step of the slope, so the whole slope lights up: the edge looks wide.

(2) The 2nd derivative is non-zero only at the start and end of the ramp, with opposite signs (a double edge), and zero along the ramp.

It only reacts where the slope begins (−1) and ends (+1): two thin lines, one negative and one positive.

(3) It crosses zero at the edge centre, where the 1st derivative is maximum. Its sign tells dark→light or light→dark.

Between the −1 and the +1 it passes through 0: that crossing point is the middle of the edge. Which sign comes first tells which way the brightness goes.

The 2nd derivative responds strongly to isolated points and is very sensitive to noise, so the image is smoothed first.

A single noisy dot gives a huge 2nd-derivative value, so we blur the image a bit before using it.

2b · Why Gaussian + Laplacian (LoG): the quiz question

★ F25 quiz (set D) Q1 · 4 + 2 marks
If the exam asks this, use this section
  • "Why is a Laplacian combined with Gaussian smoothing (LoG) before edge detection in noisy images?" F25 quiz
  • "What is LoG / Marr–Hildreth?" Answer: Gaussian smoothing + Laplacian, edges at zero crossings, g = ∇²[G ★ f]. slides 33–37

What are the two principal approaches to image segmentation? Why is a Laplacian filter typically combined with a Gaussian smoothing filter (LoG operator) before performing edge detection in noisy environments? [4 + 2 = 6]

In plain wordsThe Laplacian is a 2nd derivative, and 2nd derivatives go wild on noise: one bad pixel looks like an edge. So blur first with a Gaussian to wipe the noise away, then apply the Laplacian, and mark where the result crosses zero. Blur + Laplacian can be merged into one mask: the LoG (the "Mexican hat").
Write this4 + 2 marks

Normal line = write it on the paper. Grey "means" line under it = what it means (do not write that).

(a) Two principal approaches, based on two basic properties of intensity values:

Same answer as section 1. Write both approaches with their methods; that's the 4 marks.

1. Discontinuity: partition the image where intensity changes abruptly, e.g. at edges. Methods: point, line and edge detection (gradient, Laplacian / LoG, Canny).

Find where brightness suddenly jumps; those jumps are the borders.

2. Similarity: partition the image into regions that are similar according to a predefined criterion. Methods: thresholding, region growing, region splitting and merging.

Group pixels that look alike.

(b) Why Gaussian before Laplacian: the Laplacian ∇²f is a second derivative, which is extremely sensitive to noise: every noisy pixel gives a strong response and false zero crossings (false edges).

The Laplacian reacts hugely to any single odd pixel, so noise shows up as fake edges.

Smoothing with a Gaussian G(x,y) = e−(x²+y²)/2σ² first suppresses the noise, so the zero crossings of the Laplacian mark only real edges: g(x,y) = ∇²[G(x,y) ★ f(x,y)].

Blur first to kill the noise, then take the Laplacian. Now the zero crossings are real edges.

Both are linear, so they combine into one mask, the LoG ("Mexican hat"): ∇²[G ★ f] = [∇²G] ★ f. This is cheaper, and the zero crossings give well-localised edges. σ controls the scale: larger σ = more smoothing, only coarse edges.

You can pre-combine blur + Laplacian into a single mask and slide it once. Bigger σ = more blur = only the big edges remain.

00-100
0-1-2-10
-1-216-2-1
0-1-2-10
00-100
5×5 LoG mask (slide 34): positive centre, negative ring, sums to 0

3 · Canny edge detector

★ SP25, F23
If the exam asks this, use this section
  • "How many steps are in Canny edge detection and what are they?" F23, SP22, F21
  • "Explain the three main criteria of the Canny algorithm." F22
  • "Explain non-maximum suppression" / "What is the role of NMS in Canny?" F21, SP23, SP25
  • "What is hysteresis thresholding?" SP24
In plain wordsCanny is the careful edge detector: blur away noise, find how strong and which way each edge is, thin every edge to one pixel, then keep the sure edges plus the weak pixels that touch a sure edge.
1 · Smooth
Gaussian
2 · Gradient
Sobel: M, α
3 · Non-max suppression
thin to 1 pixel
4 · Double threshold
strong / weak
5 · Hysteresis
weak joins strong
Write this5 marks

Normal line = write it on the paper. Grey "means" line under it = what it means (do not write that).

Three criteria:

Canny promises three things. Write all three.

(1) Good detection: mark all real edges, few missed, few false.

Find every real edge, and don't invent fake ones from noise.

(2) Good localisation: detected edge as close as possible to the true edge.

The line you draw sits exactly on the real border, not shifted to the side.

(3) Single response: only one response per edge.

One edge = one thin line, not three parallel lines.

Five steps:

Then list the 5 steps in order.

1. Smoothing: fs = G ★ f, with Gaussian G(x,y) = e−(x²+y²)/2σ², to remove noise.

Blur the picture a little so tiny noise dots don't look like edges. ★ = slide the Gaussian mask over the image; σ = how strong the blur is.

2. Gradient with Sobel masks: M = √(gx² + gy²), α = tan⁻¹(gy/gx).

gx = how fast brightness changes left to right, gy = top to bottom (the two Sobel masks). M = edge strength (big M = strong edge). α = the direction in which brightness increases.

3. Non-maximum suppression: round α to 0°, 45°, 90° or 135°; keep a pixel only if its M is not smaller than both neighbours along that direction, else set it to 0.

After step 2 an edge is several pixels thick, like a hill. Walk across the hill (direction α) and keep only the top; set the slopes to 0. Now every edge is 1 pixel thin.

4. Double threshold TH : TL = 2:1 or 3:1. M ≥ TH → strong; TL ≤ M < TH → weak; M < TL → discarded.

Two cut-off values. Above the high one = sure edge. Below the low one = sure NOT an edge. In between = "maybe". The high one is 2 to 3 times the low one.

5. Hysteresis: keep a weak pixel only if it is 8-connected to a strong pixel.

A "maybe" pixel survives only if it touches a "sure" pixel (in any of the 8 directions). Real edges are long lines, so a maybe next to a sure is part of it; a lonely maybe is just noise.

Why two thresholds: one high T loses real edges (false negatives); one low T keeps noise (false positives). Hysteresis keeps the weak pixels that continue a real edge, giving thin, continuous edges.

Only a high cut-off: faint parts of real edges disappear and leave gaps. Only a low cut-off: noise becomes edges. Two cut-offs + the touch rule keep faint parts that connect to strong ones and throw away lonely noise.

Tiny worked example (slide 59, TH = 100, TL = 45)

200057
045101
5000
gN after step 3
200057
045101
000
final edges

3b · Canny with numbers

★ F23 Q3(a) 10 marks · SP25 Q2(d)(ii)
If the exam asks this, use this section
  • "Given the result of the first two Canny steps (magnitude + direction), complete the remaining 3 steps with high = 100, low = 45." F23
  • "Identify false positive / false negative edges." "What happens with high = 245, low = 10?" F23
  • "A pixel has magnitude 80 after NMS; low = 50, high = 100. How is it classified?" SP25
In plain wordsThree moves. (1) NMS: look at the two neighbours along each pixel's arrow; if the pixel is smaller than either one, it becomes 0. (2) Double threshold: ≥ high = strong, between = weak, below low = 0. (3) Hysteresis: a weak pixel stays only if it touches a strong one.
c0c1c2
r0200 ↓40 ↓57 ↙
r110 →20 ↑101 ←
r250 ↑41 ↑74 ←

Given: magnitude M and gradient arrow at each pixel (F23 Q3(a)). TH = 100, TL = 45.

Step 3 · Non-maximum suppression

For each pixel, check the two neighbours in the arrow direction (forward and backward). Neighbours outside the 3×3 are ignored.

pixelMarrowneighbours along the arrowresult
(0,0)200↓(1,0) = 10 (other side is outside)kept
(0,1)40↓(1,1) = 20 (other side is outside)kept
(0,2)57↙(1,1) = 20 (other side is outside)kept
(1,0)10→(1,1) = 20 (other side is outside)smaller → 0
(1,1)20↑(0,1) = 40, (2,1) = 41smaller → 0
(1,2)101←(1,1) = 20 (other side is outside)kept
(2,0)50↑(1,0) = 10 (other side is outside)kept
(2,1)41↑(1,1) = 20 (other side is outside)kept
(2,2)74←(2,1) = 41 (other side is outside)kept
2004057
00101
504174
gN after NMS

Step 4 · Double threshold

≥ 100 → strong. 45 to 99 → weak. Below 45 → 0 (so 40 and 41 are gone).

20000
00101
000
gNH: strong (≥ 100)
0057
000
50074
gNL: weak (45–99)

Step 5 · Hysteresis

weak pixelvaluestrong 8-neighboursdecision
(0,2)57101 at (1,2)kept
(2,0)50nonedropped
(2,2)74101 at (1,2)kept
200057
00101
0074
final edge map g
(ii) and (iii): write this2 + 3 marks

Normal line = write it on the paper. Grey "means" line under it = what it means (do not write that).

(ii) 74 at (2,2) is weak but kept because it touches the strong 101. If it was really noise, it is a false positive. 50 at (2,0) is weak with no strong neighbour, so it is dropped. If it was a real edge, it is a false negative.

Name one pixel that might be a fake edge that got in, and one that might be a real edge that got thrown out.

(iii) With TH = 245 no pixel is strong, so hysteresis keeps nothing: the output is empty, every real edge is lost (false negatives). TL = 10 would let almost every pixel in as weak (false positives). The ratio 245:10 breaks the usual 2:1 to 3:1 rule.

Too high a top cut-off: nothing is "sure", so nothing survives. Too low a bottom cut-off: everything becomes a "maybe".

SP25: 50 ≤ 80 < 100, so the pixel is a weak edge. It becomes an edge only if it is 8-connected to a strong pixel; otherwise it is discarded.

80 is between the two cut-offs, so it is a "maybe".

3c · False positives and false negatives

★ SP22, SP24, F21
If the exam asks this, use this section
  • "What are false positive and false negative edge pixels? How does Canny reduce (overcome) these errors?" SP22, SP24, F21
In plain wordsA false positive is a fake edge that got drawn (usually noise). A false negative is a real edge that got missed. Canny thins away the extras and rescues the faint real parts.
Write this2 + 2 marks

Normal line = write it on the paper. Grey "means" line under it = what it means (do not write that).

False positive: a pixel marked as an edge that is not a real edge (e.g. noise). Caused by a threshold that is too low.

Fake edge drawn.

False negative: a real edge pixel that is missed. Caused by a threshold that is too high.

Real edge lost.

How Canny reduces them: Gaussian smoothing removes noise before the gradient (fewer false positives). NMS keeps only the local maxima, so thick edges become thin (fewer false positives).

Blur kills noise; NMS deletes the extra pixels around each edge.

Double threshold + hysteresis keeps a weak pixel only when it is connected to a strong edge: faint parts of real edges are kept (fewer false negatives) and isolated weak noise is dropped (fewer false positives).

The touch rule rescues faint real edges and throws away lonely noise.

3d · Sobel with numbers

★ SP22 Q6(b)(i) · SP25 Q2(d)(i) · SP25 Q1(e)
If the exam asks this, use this section
  • "Find the Sobel gradient-magnitude image and the edge direction of the central pixel." SP22
  • "Apply the Sobel operator in the horizontal direction; gradient value at the centre pixel?" SP25
  • "What is the primary goal of edge detection? Name two gradient-based operators." Answer: find the boundaries where intensity changes sharply; Sobel and Prewitt (also Roberts). SP25
In plain wordsTwo masks. Gx = right column minus left column (weights 1, 2, 1). Gy = bottom row minus top row (weights 1, 2, 1). Edge strength = |Gx| + |Gy|.
-101
-202
-101
Gx mask
-1-2-1
000
121
Gy mask
376
258
347
SP22 image

Centre pixel, in full

Label the 3×3 window z1 … z9 row by row: z1 = 3, z2 = 7, z3 = 6, z4 = 2, z5 = 5, z6 = 8, z7 = 3, z8 = 4, z9 = 7.

Gx = (z3 + 2z6 + z9) − (z1 + 2z4 + z7) = (6 + 16 + 7) − (3 + 4 + 3) = 29 − 10 = 19

Gy = (z7 + 2z8 + z9) − (z1 + 2z2 + z3) = (3 + 8 + 7) − (3 + 14 + 6) = 18 − 23 = −5

|∇f| ≈ |Gx| + |Gy| = 19 + 5 = 24  (exact √(19² + 5²) = 19.65)

Gradient angle α = tan⁻¹(Gy/Gx) = tan⁻¹(−5/19) = -14.74°. The edge runs at right angles to the gradient: edge direction = α − 90° = -104.74°.

Corner pixel (0,0), to show zero padding

Window around (0,0), outside = 0: z1, z2, z3, z4, z7 = 0; z5 = 3, z6 = 7, z8 = 2, z9 = 5.

Gx = (0 + 2×7 + 5) − (0 + 0 + 0) = 19; Gy = (0 + 2×2 + 5) − (0 + 0 + 0) = 9; |∇f| = 19 + 9 = 28.

The whole magnitude image (same formulas at every pixel)

1912-19
2119-21
1314-13
Gx
92021
-3-5-1
-9-20-21
Gy
283240
242422
223434
|Gx| + |Gy|

SP25: the bright dot

Patch [10 10 10; 10 50 10; 10 10 10]: Gx = (10 + 20 + 10) − (10 + 20 + 10) = 0 (Gy = 0 too). The left and right columns are equal and Sobel's centre weight is 0, so the dot is not seen. A Laplacian would give 4×50 − 4×10 = 160.

3e · Four line-detection masks

★ SP23 Q3(e)(iii) · 2 marks
If the exam asks this, use this section
  • "Draw four line detection masks: horizontal, +45°, vertical, −45°." SP23
In plain wordsDraw a line of 2s in the direction you want to detect and fill every other cell with −1. Each mask then sums to 0, so a flat area gives 0.
-1-1-1
222
-1-1-1
horizontal
-1-12
-12-1
2-1-1
+45°
-12-1
-12-1
-12-1
vertical
2-1-1
-12-1
-1-12
−45°
Write this2 marks

Normal line = write it on the paper. Grey "means" line under it = what it means (do not write that).

Draw the four masks above and label each.

The 2s show the line's direction.

The coefficients sum to 0, so a constant area gives 0; a line in the mask's direction gives the largest response.

Flat area: no answer. Line along the 2s: big answer.

3f · Canny schematic and hysteresis algorithm

★ SP23 Q3(e)(i)(ii)
If the exam asks this, use this section
  • "Apply Canny to extract edges from f(x,y) of size m × n; draw a schematic of the whole process up to g(x,y)." SP23
  • "Explain non-maxima suppression gN(x,y) OR hysteresis thresholding gNH, gNL." SP23
f(x,y)
input
Gaussian
fs = G ★ f
Sobel
gx, gy → M, α
NMS
gN
TH, TL
gNH, gNL
Connectivity
→ g(x,y)
Write this3 + 3 marks

Normal line = write it on the paper. Grey "means" line under it = what it means (do not write that).

(i) Draw the boxes above in a row with arrows, and write each box's formula under it.

The schematic is the 5 steps as boxes; the formulas earn the marks.

(ii) Hysteresis: gNH(x,y) = gN(x,y) ≥ TH; gNL(x,y) = gN(x,y) ≥ TL; then gNL = gNL − gNH.

Make a "strong" image and a "weak" image. Remove the strong pixels from the weak image so each pixel is in only one.

(a) Locate the next unvisited edge pixel p in gNH. (b) Mark as valid all weak pixels in gNL connected to p (8-connectivity). (c) Repeat until all pixels of gNH are visited. (d) Set to 0 all unmarked pixels of gNL.

Start at each strong pixel and follow touching weak pixels; every weak pixel you can reach stays, the rest are deleted.

Output = gNH + the marked pixels of gNL.

Final edges = strong ones + rescued weak ones.

Or NMS: round α to 0°, 45°, 90° or 135°; if M(x,y) is less than at least one of its two neighbours along that direction, gN(x,y) = 0, otherwise gN(x,y) = M(x,y).

Keep only the top of each edge "hill".

4 · Thresholding

★ SP23, SP25 cases
If the exam asks this, use this section
  • "Which method partitions pixels depending on their intensity values?" SP23
  • "Segment the text from the paper" in a document with uneven illumination SP25
  • "Global vs local vs adaptive threshold" / "How is T found automatically?" slides 35–53
In plain wordsPick one number T. Brighter than T is object, the rest is background. On a histogram with two humps (background and object), T goes in the valley between them.
4.591031729374351619310611812613314115gray levelcount
Two peaks: dark background (left) and bright object (right). T goes in the empty valley at level 7–8.
Write this2–5 marks

Normal line = write it on the paper. Grey "means" line under it = what it means (do not write that).

g(x,y) = 1 if f(x,y) > T (object point); 0 if f(x,y) ≤ T (background point).

Every pixel brighter than T becomes white (object); everything else becomes black (background).

Global: one T for the whole image, T = T[f(x,y)].

One cut-off number for the entire picture.

Local / regional: T = T[p(x,y), f(x,y)], p = a neighbourhood property such as its mean.

Each small area picks its own cut-off from its own pixels (e.g. its average brightness).

Adaptive (dynamic): T = T[x, y, p(x,y), f(x,y)].

The cut-off also changes with the position in the picture, so it can follow a shadow.

Iterative global threshold: (1) initial T = mean intensity;

Start with a guess: the average brightness.

(2) split: G₁ = pixels > T, G₂ = pixels ≤ T; (3) means μ₁, μ₂;

Split the pixels into a bright group and a dark group, and average each group.

(4) new T = ½(μ₁ + μ₂); (5) repeat until the change in T < ΔT.

The new cut-off is halfway between the two averages. Repeat until it stops moving.

Mini example (values 10, 20, 30, 200, 210, 220): T₀ = 690 / 6 = 115. G₁ = {200, 210, 220}, μ₁ = 210; G₂ = {10, 20, 30}, μ₂ = 20. T₁ = ½(210 + 20) = 115, no change → stop, T = 115.

TrapUneven illumination or a shadow: one global T fails (the shadowed part of the object drops below T). Write: use a local / adaptive threshold, so every region gets its own T.

5 · Region growing

★ SP23 tumor case · slides 9–17
If the exam asks this, use this section
  • "What segmentation method groups similar pixels?" SP23
  • "What is region growing in image segmentation?" SP25
  • "Apply region growing with the seed at the centre, |diff| ≤ T (4- or 8-direction)" slide 14, F22
In plain wordsDrop a seed inside the object. A neighbour joins if its value is close enough to the pixel it grows from. New members invite their own neighbours, like a stain spreading, until nobody else qualifies.

Slide 14: seed = 60 at the centre, rule |difference| ≤ 5. Highlighted = the grown region.

10101010101010
10101069701010
59106064595660
10591060701062
10605965671065
10101010101010
10101010101010
4-connectivity: 13 pixels
10101010101010
10101069701010
59106064595660
10591060701062
10605965671065
10101010101010
10101010101010
8-connectivity: 17 pixels

8-connectivity also steps diagonally, so the 59, 60, 59, 59 on the left join. The 10s never join: |10 − 60| = 50 > 5.

Slide 14 worked in full: every pixel that joins

(a) 4-connectivity (up, down, left, right). Each new pixel is compared with the pixel it grows from:

grows fromneighbourtest
(3,3) = 60(2,3) = 64|64 − 60| = 4 ≤ 5 ✓
(3,3) = 60(4,3) = 65|65 − 60| = 5 ≤ 5 ✓
(2,3) = 64(1,3) = 69|69 − 64| = 5 ≤ 5 ✓
(2,3) = 64(2,2) = 60|60 − 64| = 4 ≤ 5 ✓
(2,3) = 64(2,4) = 59|59 − 64| = 5 ≤ 5 ✓
(4,3) = 65(4,4) = 67|67 − 65| = 2 ≤ 5 ✓
(1,3) = 69(1,4) = 70|70 − 69| = 1 ≤ 5 ✓
(2,4) = 59(2,5) = 56|56 − 59| = 3 ≤ 5 ✓
(4,4) = 67(3,4) = 70|70 − 67| = 3 ≤ 5 ✓
(2,5) = 56(2,6) = 60|60 − 56| = 4 ≤ 5 ✓
(2,6) = 60(3,6) = 62|62 − 60| = 2 ≤ 5 ✓
(3,6) = 62(4,6) = 65|65 − 62| = 3 ≤ 5 ✓

Region = seed + these 12 = 13 pixels. Every other neighbour is a 10: |10 − 60| = 50 > 5, so it can't join.

(b) 8-connectivity also checks diagonals. Everything above joins again, plus these:

grows fromneighbourtest
(3,3) = 60(4,2) = 59|59 − 60| = 1 ≤ 5 ✓
(2,2) = 60(3,1) = 59|59 − 60| = 1 ≤ 5 ✓
(4,2) = 59(4,1) = 60|60 − 59| = 1 ≤ 5 ✓
(3,1) = 59(2,0) = 59|59 − 59| = 0 ≤ 5 ✓

Region = 17 pixels.

Another numeric (F22 B5(a)): seed at the centre, 8-direction, |diff| ≤ 4

15151515151515
15151568691515
64646367706815
15157065617166
15156973581515
15151515151515
15151515151515
input; seed (3,3) = 65
grows fromneighbourtest
(3,3) = 65(2,3) = 67|67 − 65| = 2 ≤ 4 ✓
(3,3) = 65(3,4) = 61|61 − 65| = 4 ≤ 4 ✓
(3,3) = 65(2,2) = 63|63 − 65| = 2 ≤ 4 ✓
(3,3) = 65(4,2) = 69|69 − 65| = 4 ≤ 4 ✓
(2,3) = 67(1,3) = 68|68 − 67| = 1 ≤ 4 ✓
(2,3) = 67(2,4) = 70|70 − 67| = 3 ≤ 4 ✓
(2,3) = 67(1,4) = 69|69 − 67| = 2 ≤ 4 ✓
(2,3) = 67(3,2) = 70|70 − 67| = 3 ≤ 4 ✓
(3,4) = 61(4,4) = 58|58 − 61| = 3 ≤ 4 ✓
(2,2) = 63(2,1) = 64|64 − 63| = 1 ≤ 4 ✓
(4,2) = 69(4,3) = 73|73 − 69| = 4 ≤ 4 ✓
(2,4) = 70(2,5) = 68|68 − 70| = 2 ≤ 4 ✓
(2,4) = 70(3,5) = 71|71 − 70| = 1 ≤ 4 ✓
(2,1) = 64(2,0) = 64|64 − 64| = 0 ≤ 4 ✓
(2,5) = 68(3,6) = 66|66 − 68| = 2 ≤ 4 ✓
15151515151515
15151568691515
64646367706815
15157065617166
15156973581515
15151515151515
15151515151515
final region: 16 pixels

All 16 non-15 pixels join, each through a chain of steps of 4 or less (e.g. 65 → 61 → 58). The 15s never join: the closest gap is |58 − 15| = 43 > 4.

Write this2–5 marks

Normal line = write it on the paper. Grey "means" line under it = what it means (do not write that).

Region growing groups pixels into larger regions, starting from seed points and appending neighbouring pixels with similar properties (gray level, texture, colour).

Start from one pixel you know is inside the object, and keep adding neighbours that look like it.

(1) Choose the seed(s).

Pick the starting pixel (the question usually gives it).

(2) A 4- or 8-neighbour joins if it satisfies the predicate, e.g. |f(neighbour) − f(pixel it grows from)| ≤ T.

Check the neighbours (4 = up/down/left/right, 8 = also the diagonals). A neighbour joins if its value is within T of the pixel next to it.

(3) Repeat with the new members.

Every new member checks its own neighbours, so the region spreads like a stain.

(4) Stop when no more pixels satisfy the predicate.

When no neighbour is close enough any more, you are done.

Works better than edge-based methods on noisy images. Problems: good seeds are hard to choose, hard to automate, needs a good similarity rule.

One plus point and three problems: easy marks.

With numbers: table "grows from | neighbour | test", e.g. (3,3)=60 → (2,3)=64: |64 − 60| = 4 ≤ 5 ✓; then the final grid and the pixel count.

Show every joining pixel as one row of the table, then draw the final region. 8-connectivity always gives an equal or bigger region than 4.

Q3 one-liners: cheap, sure marks

case questions
the story sayswrite
"partition pixels depending on intensity"thresholding, g = 1 if f > T
"group similar pixels", "tumor region from a point"region growing from a seed, |diff| ≤ T
"uneven illumination", "shadow", "faded document"adaptive / local threshold
"noisy image, need clean thin edges"Canny (smooth first, then hysteresis)
"find boundaries of an organ / crack"Sobel gradient or Canny
"straight lines: road, lane, fracture"Hough: votes for lines in (ρ, θ), ρ = x cos θ + y sin θ