# Will binarization / thresholding of image yield better results when performed in a linear color space?

All thresholding algorithms I have read about make no mention about color space, except sometimes using pixel values between 0 and 255 as an example.

But since the intensity output by a monitor of a greyscale is $greyscale^{gamma}$, the perceived difference between 1 and 2 is less than the difference between 254 and 255. Provided this fact, should it not improve accuracy to perform binarization on intensities rather than greyscale values?

Disclaimer: What I am about to say is a general rule of the thumb, there are exceptions.

In short: Linear space is more useful for computer vision while non-linear space is more useful for showing the final image to humans, without outputing a quantitative analysis.

This highly depends on your problem.

Linear space is more related to physical measurements. Thus, thresholding in it is more natural when you are dealing with measurements such as: counting instances, location of objects, etc. Noise behaves in a predictable way - variance of the signal is linearly dependent on the mean value of the signal. There are many other properties that make your algorithms more straightforward and easier to implement. Among other things, when you are selecting a threshold, you can use the linearity of the signal.

On the other hand, the non-linear space is more related to human perception of light intensity. Thus, it is more suited for image processing problems in which there is no measurement, but rather showing a good image to the observer, or measuring something in a way that humans do.

Examples:

Linear space - Counting cells in microscopic images, finding defects in a wafer, tracking cars on a road. (Some image processing operations must be done in linear space due to the physics of the process involved, but the final image is almost always in non-linear domain)

Non-Linear space - Performing image processing pixel crunching operations to show a nice image on your tablet, attempting to find defects on a carpet texture, performing image segmentation of medical images in order to assist a human interpreting a scene.

• I'm not sure I follow... For instance when an algorithm is segmenting a medical image in non-linear color, won't it be making decisions with a different importance assigned to an intensity than a human? – Viktor Dec 15 '12 at 18:26
• @Viktor, if the final result is an image and not quantitative analysis, then it should be in non-linear space. – Andrey Rubshtein Dec 17 '12 at 20:05