Given the image 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…
Private research annotation
Sign in to add a private research label or note.
- User
Given the image
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 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
To perform the desired operations, we first need to find the minimum and maximum pixel values of the image.
From the given image, the minimum pixel value is 0 and the maximum pixel value is 8.
To truncate about 10% from the dark region, we need to find the intensity values at the 5th and 95th percentiles.
Sorting all the pixel values in ascending order: 0 0 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 5 5 5 5 5 5 6 6 6 6 7 7 7 7 7 8 8
Number of pixels (N) = 49x7 = 343
Finding the pixel value at the 5th percentile: 5th percentile = 0.05 * 343 = 17.15 ≈ 17
Finding the pixel value at the 95th percentile: 95th percentile = 0.95 * 343 = 325.85 ≈ 326
- User
3- Modify the histogram of the following image into a uniformly distributed histogram in the interval [0,7]
2 3 3 0 0 4 0 5 6 3 6 6 6 5 0 3 0 1 1 2 2 4 1 2 1
- Assistant
To modify the histogram of the given image into a uniformly distributed histogram in the interval [0,7], we can use histogram equalization.
First, let's calculate the cumulative histogram of the image.
Original image: 2 3 3 0 0 4 0 5 6 3 6 6 6 5 0 3 0 1 1 2 2 4 1 2 1
Histogram: 0: 5 1: 5 2: 4 3: 3 4: 2 5: 2 6: 4
Cumulative histogram: 0: 5 1: 10 2: 14 3: 17 4: 19 5: 21 6: 25
Next, we calculate the normalized histogram by dividing each value in the cumulative histogram by the total number of pixels.
Total number of pixels = 5x5 = 25
Normalized histogram: 0: 5/25 = 0.2 1: 10/25 = 0.4 2: 14/25 = 0.56 3: 17/25 = 0.68 4: 19/25 = 0.76 5: 21/25 = 0.84 6: 25/25 = 1
Now, we can map the original pixel values to new pixel values based on the normalized histogram.
New pixel values: 2 -> 0.2 * 7 = 1.4 ≈ 1 3 -> 0.4 * 7 = 2.8 ≈ 3 3 -> 0.4 * 7 = 2.8 ≈ 3 0 -> 0.2 * 7 = 1.4 ≈ 1 0 -> 0.2 * 7 = 1.4 ≈ 1 4 -> 0.56 * 7 = 3.92 ≈ 4 0 -> 0.2 * 7 = 1.4 ≈ 1 5 -> 0.84 * 7 = 5.88 ≈ 6 6 -> 1 * 7 = 7 3 -> 0.4 * 7 = 2.8 ≈ 3 6 -> 1 * 7 = 7 6 -> 1 * 7 = 7 6 -> 1 * 7 = 7 5 -> 0.84 * 7 = 5.88 ≈ 6 0 -> 0.2 * 7 = 1.4 ≈ 1 3 -> 0.4 * 7 = 2.8 ≈ 3 0 -> 0.2 * 7 = 1.4 ≈ 1 1 -> 0.56 * 7 = 3.92 ≈ 4 1 -> 0.56 * 7 = 3.92 ≈ 4 2 -> 0.4 * 7 = 2.8 ≈ 3 2 -> 0.4 * 7 = 2.8 ≈ 3 4 -> 0.56 * 7 = 3.92 ≈ 4 1 -> 0.56 * 7 = 3.92 ≈ 4 2 -> 0.4 * 7 = 2.8 ≈ 3 1 -> 0.56 * 7 = 3.92 ≈ 4