Practical Exercise: Min-Max Contrast Stretching

The Scenario:

You have captured an image, but due to poor illumination, it suffers from low contrast. When you analyze the image histogram, you find that the pixel intensities only range from a minimum of 100 to a maximum of 151 (a very narrow, gray-washed image).

You want to stretch this contrast to fill the standard 8-bit dynamic range, which goes from 0 to 255.

The Formula:

Inew=(IMin)NewMaxNewMinMaxMin+NewMin

Step 1: Identify your variables

Step 2: Plug the limits into the scaling factor

Scaling Factor=2550151100=25551=5

Step 3: Create your simplified transformation equation

Now substitute the scaling factor back into the formula. Your specific transformation function for every pixel I in this image is:

Inew=(I100)×5

Step 4: Test it on specific pixels!

Let's see what happens to the pixels in the original image:

Conclusion: By applying this simple linear operation to every pixel, you have successfully stretched the narrow 51-level range into a full 256-level range, significantly enhancing the visual contrast!

Pasted image 20260227225212.png


Graph meaning

This slide explains a fundamental concept in digital image processing known as a Piecewise Linear Transformation, specifically used for Contrast Stretching.

It shows how you can change the brightness and contrast of an image by mapping the original pixel values (input) to new pixel values (output) using a mathematical graph.

Here is a breakdown of the concepts shown on the slide:

Pasted image 20260227230751.png

The Basics of the Graph


The Three Scenarios Explained

1. Linear Function

2. Thresholding Function

3. Min-Max Stretching