Quiz: contrast and intensity transforms

Short questions to test your understanding. Try each on paper first, then open the answer.


Q1. Is a threshold a point operation? Is a 3 × 3 median filter? Is CLAHE?

A point operation uses only the old value of the same pixel, with one curve for the whole image.

A threshold is: its curve is a step from 0 to 255, the steepest point operation. The median filter is not: it looks at the neighbours. CLAHE is not either: every pixel goes through a curve, but the curve depends on where the pixel is (its tiles), so the same raw value can become different outputs in different places.


Q2. Your fluorescence cells are dim and the bright nuclei are fine. Which gamma do you choose for the display, γ = 0.5 or γ = 2? What happens to the background noise?

Where is the curve v^\gamma steep?

γ = 0.5: it is steep for small values (it brightens and stretches the darks) and flat for large ones. The background is dark too, so its noise is amplified by the same slope: the background becomes grey and grainy.


Q3. An image’s histogram before and after a point operation: before, one smooth hump between 60 and 120; after, every 4th level from 0 to 252 is used and the levels in between are empty. What was the curve, and what kind of data was it applied to?

How many input levels are there, and how many output levels are used?

A linear stretch (a window) of about 60 … 123 to 0 … 255, slope 4, applied to 8-bit data: 64 input values can give only 64 output values, so the histogram becomes a comb. On 12-bit data the same stretch would fill the levels smoothly.


Q4. After histogram equalisation the histogram of an 8-bit image still has tall spikes and empty levels. Why is it not flat?

What happens to all the pixels that have the same input value?

Equalisation is a point operation: all pixels with the same input value get the same output value. A level with many pixels is moved as a whole, never split; rounding merges neighbouring levels and leaves others empty. Only the cumulative histogram of the result is close to a straight line. (A perfectly flat histogram needs an invented order among equal pixels: exact equalisation.)


Q5. What does the clip limit of CLAHE control, and what happens at β = 1 and as β grows very large?

The slope of an equalisation curve is the histogram.

It caps the histogram, and since the slope of the curve is the histogram, it caps the contrast gain: at most about β×, for the signal and the noise alike. β = 1 flattens every tile histogram completely: the curve is a straight line and nothing changes. A very large β means no clipping: plain adaptive equalisation, with exploding noise in flat tiles.


Q6. To make a figure “consistent”, you match the histogram of a treated sample to that of the control. A reviewer objects. Why?

What does matching do to a difference in brightness between the two images?

Matching makes the treated image’s distribution of grey values equal to the control’s by construction. If the treatment made the cells brighter, that difference is exactly what matching removes: the figure no longer shows the effect. Show both images with the same (linear) display settings instead, and say so in the caption.


Q7. You equalised an image to segment nuclei. May you report the mean nucleus intensity from the equalised image?

What is an equalised value?

No. An equalised value is a rank (“brighter than 73 % of this image”), not an intensity: ratios and differences are changed, and the curve depends on the image, so values cannot be compared between images. Use the masks found on the equalised image, and measure the raw values inside them.


Q8. Which of these survive any rising curve unchanged: the median pixel, the mean, the Spearman correlation, the Pearson correlation?

Which of them use only the order of the values?

The median pixel (it stays the median, \operatorname{median}T(X) = T(\operatorname{median}X)) and the Spearman correlation (it uses ranks). The mean and the Pearson correlation use the values themselves and change under any non-linear curve.


Q9. (math) Show that the slope of the equalisation curve at v is proportional to the histogram at v, and say what that implies for the output density (continuous case).

The curve is T(v) = (L - 1)F(v), and p_S = p_X / T'.

T'(v) = (L - 1)F'(v) = (L - 1)\,p_X(v): the slope is the density (the normalised histogram) times L - 1. Then p_S(s) = p_X(v)/T'(v) = 1/(L - 1), constant on [0, L - 1]: the output is uniform. For a discrete image the same holds only approximately, because equal values cannot be split.