Quiz: when one threshold is not enough

Short questions to test your understanding. Try each on paper first, then open the answer. Objects are dark on a bright background unless stated: object where I(x) < T(x).


Q1. The background is 60 on the left of an image and 180 on the right; objects are 40 on the left and 120 on the right. Can one global threshold work?

The threshold must be above every object and below every background pixel.

No: it would have to be above 120 (right objects) and below 60 (left background). Dividing by the background helps: the objects become 40/60 = 0.67 and 120/180 = 0.67, the background 1, and a threshold of about 0.8 works everywhere.


Q2. Why does a local threshold with a window smaller than the objects produce hollow objects?

What is the local mean at the centre of a large object?

At the centre the whole window lies inside the object, so the local mean is the object’s own grey level and the centre is not darker than its surroundings. Only pixels near the edge, whose window also contains background, are found.


Q3. Niblack’s threshold with k = -0.2 in a region of pure background noise labels about 42 % of the pixels object, whatever the noise level. Why?

In that region, what are m and s?

There m is the background level and s is the noise standard deviation, so T sits 0.2 noise standard deviations below the background. A fixed fraction of the noise, \Phi(-0.2) = 0.42, falls below it; scaling the noise scales s and T with it.


Q4. How does Sauvola avoid Niblack’s problem?

T = m(1 + k(s/R - 1)) with R = 128.

In flat regions s \ll R, so T \approx m(1 - k): with k = 0.3, 30 % below the background level, far below the noise. Only near objects, where s is large, does T rise towards m.


Q5. Why does the cost of a box-filter local mean not grow with the window size?

Moving the window by one pixel.

With a running sum, moving the window one pixel adds the pixel that enters and subtracts the one that leaves: two operations per pixel and pass, for any window size. (The integral image does the same for any rectangle.)


Q6. In hysteresis, what happens to a faint object that is entirely between t_\text{low} and t_\text{high}?

Where do the seeds come from?

It has no seed (no pixel above t_\text{high}) and is not connected to one, so it is rejected entirely. Hysteresis keeps faint parts of objects that also have a bright part, not faint objects on their own.


Q7. A thin diagonal line, one pixel wide, is above t_\text{low}, and one end is above t_\text{high}. Is it kept with 4-connectivity? With 8?

How do consecutive pixels of a diagonal line touch?

With 4-connectivity only the seed pixels survive: consecutive pixels of a diagonal line touch only at corners, so they are not connected. With 8-connectivity the whole line is one component and is kept.


Q8. (math) The illumination multiplies the image, I = L\,R + n. After dividing by L, where is the noise largest?

I/L = R + n/L.

The noise term is n/L, with standard deviation \sigma_n/L: largest where the light is weakest (dark side, vignetted corners). Dividing equalises the contrast, not the noise.