Search code examples
image-processingcontrast

Contrast stretching over a small range of intensities


What's the use of applying contrast stretching over a small range of intensities in an image (take, for example, the intensity transform below)? I have the same question for contrast shrinking.

Contrast stretching for the entire range of intensities can make the image clearer (so it's benefit is obvious in particular cases). My guess is that stretching the contrast over a small range of intensities makes the areas with those intensities more distinguishable.

enter image description here


Solution

  • Just have a look at the graph you provided (although a graph without axis labels is pretty useless by itself)

    The vertical axis of your graph is the output intensity. The horizontal axis is the input.

    If we interpret your graph like that we see that a few low input values will be spread (stretched) across a wider range of output values.

    The following input values are compressed into a smaller output inverval while teh rest of our input values stays unchanged.

    Humans have problems to distinguish between very similar intensity values. The following black rectangles both show a square on a square. In the left one its intensity 5 on 1 and on the right its 50 on 10. So by stretching the interval 1:5 by factor 10 I made the rectangle visible as I increased the contrast.

    enter image description here

    So if you have information in a small region of gray values you can stretch it to make it more visible to humans. Computers usually don't care.

    Shrinking has the opposite effect. You decrease contrast. This makes sense for an intensity range that bears no information. Why waste that interval?

    As we only have a limited amount of gray values, we of course can only stretch one section if we sacrifice another one (by shrinking it)