2 7 5 4 7 3 2 8 2 5 4 3 6 1 4 3 2 5 0 4 3 4 3 7 1 2 5 7 3 2 5 4 3 2 5 5 8 4 3 2 5 4 6 3…
Private research annotation
Sign in to add a private research label or note.
- User
2 7 5 4 7 3 2 8 2 5 4 3 6 1 4 3 2 5 0 4 3 4 3 7 1 2 5 7 3 2 5 4 3 2 5 5 8 4 3 2 5 4 6 3 1 7 6 1 2 Perform the following: 1.1 Draw the histogram of the image 1.2 Draw the cumulative histogram 1.3 Perform Histogram equalization 1.4 Truncate about 10% of the image from the dark region, and also truncate about 20% of the image from the light region. And hence, perform contrast stretching operation to use the full dynamic range [0-8]
- Assistant
1.1 Histogram of the image: The histogram represents the frequency distribution of pixel values in an image.
Pixel Value | Frequency 2 | 4 3 | 7 4 | 7 5 | 9 6 | 5 7 | 6 8 | 3
1.2 Cumulative histogram: The cumulative histogram shows the cumulative sum of frequencies as we move across the pixel values from left to right.
Pixel Value | Cumulative Frequency 2 | 4 3 | 11 4 | 18 5 | 27 6 | 32 7 | 38 8 | 41
1.3 Histogram equalization: Histogram equalization is a method to enhance the contrast of an image by redistributing the intensity values.
Pixel Value | New Value 2 | 0 3 | 2 4 | 3 5 | 4 6 | 5 7 | 6 8 | 8
- User
i don't understand how to truncate
- Assistant
Truncating refers to removing or discarding a certain percentage of values from either the dark or light regions of the histogram. In this context, truncating is used to limit the intensity values of the image to a specific range, which helps in enhancing the contrast.
To truncate about 10% of the image from the dark region, you first need to find the minimum pixel value in the original histogram. Let's say the minimum value is 2. Then, calculate the new minimum value using the formula: New Min Value = minimum value + (maximum value - minimum value) * 0.1.
For example, if the maximum value is 8: New Min Value = 2 + (8 - 2) * 0.1 = 2.6
Next, for each pixel value, calculate the stretched value using the formula: (New Value - New Min Value) / (maximum value - New Min Value) * maximum value.
For example, for a pixel value of 3: Stretched Value = (3 - 2.6) / (8 - 2.6) * 8 = 1.8695652
Repeat this process for all pixel values in the image.
- User
how we get The final contrast-enhanced image with the full dynamic range [0-8]
- Assistant
To obtain the final contrast-enhanced image with the full dynamic range [0-8], you can use the truncated and stretched values from the previous steps.
- Substitute the truncated and stretched values into the image, replacing the original pixel values with their respective stretched values.
For example, considering the pixel values after truncating and stretching: 2 2 3 4 5 6 8 2 3 4 4 5 6 8 3 4 2 5 0 4 3 3 4 6 1 2 5 6 4 3 5 4 3 3 5 5 8 4 3 2 5 4 6 4 1 6 6 1 2
- Now, the pixel values range from 0 to 8, representing the full dynamic range.
The final contrast-enhanced image using the full dynamic range [0-8] is:
2 2 3 4 5 6 8 2 3 4 4 5 6 8 3 4 2 5 0 4 3 3 4 6 1 2 5 6 4 3 5 4 3 3 5 5 8 4 3 2 5 4 6 4 1 6 6 1 2
This image has undergone contrast stretching to optimize the utilization of the full dynamic range [0-8], resulting in an enhanced contrast.