2. Image Processing - Report #1
Due date: April. 2, 2018
In our class, we have learned about a histogram equalization
technique to enhance the images's quality. Histograms are the basics
for numerous spatial domain techniques. Simple examples can help
you to understand how to equalize the histogram in an image.
Suppose that Fig. 1 is a 4-bit input image(L=16) of size 6×6 pixels.
And also we assume that 0 is black and 15 is white.
Now calculate the histogram equalized image. You need to calculate
histogram, PDF(probability density function), CDF(cumulative density
function), and the table for converting to . When you calculate s
values, , you round them to the nearest integer. Finally, explain the
result comparing to the input image in point of their contrasts. You
have to submit the report in class.
1. The Histogram of the input image.
0 1 2 3 4 5 6 7
frequency 13 12 6 3 2 0 0 0
8 9 10 11 12 13 14 15
frequency 0 0 0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
1 1 1 1 1 1
2 2 2 2 2 2
1 1 1 1 1 1
3 3 3 4 4 0
Fig.1 Input image
4. 가장 근접한 정수로 반올림
6. Explain the result comparing to the input image in point of their
contrasts.
을 통해 입력 의 저대비 및 낮은 평균Histogram Equalization Matrix Gray
의 값의 영상을 비교적 고른 분포의 을 가진 로 바꿀Level Histogram Matrix
수 있었다.
하지만 변환을 수행한 표만 가지고 비교함은 가식성이 떨어지기 때문에 위,
의 풀이과정을 알고리즘화 하여 코드로 변환한 후 주어진 를 가지고, Matrix
5.4 5.4 5.4 5.4 5.4 5.4
10.4 10.4 10.4 10.4 10.4 10.4
12.9 12.9 12.9 12.9 12.9 12.9
10.4 10.4 10.4 10.4 10.4 10.4
14.1 14.1 14.1 15 15 5.4
Fig.2 Output image
5 5 5 5 5 5
5 5 5 5 5 5
10 10 10 10 10 10
13 13 13 13 13 13
10 10 10 10 10 10
14 14 14 15 15 5
Fig.3 Output image with rounded
0 1 2 3 4 5 6 7
frequency 0 0 0 0 0 13 0 0
8 9 10 11 12 13 14 15
frequency 0 0 12 0 0 6 3 2
Fig.4 Histogram of the Output image
5. 연산을 진행하였다Histogram Equalization .
전 후 의 의 빈도수를 비교했을 때 기존의 대비, Matrix Gray Level Matrix
균일해졌다고 볼 수 있다.
하지만 주어진 의 이 으로 작기 때문에Matrix shape (6, 6) Histogram
을 통해 개선된 여부를 쉽게 파악하기가 쉽지 않다Equalization (Enhanced) .
따라서 조금 더 적절한 예시로 파일을 활용하여 같은 알고리즘을, lena.png
이용해 을 적용한다Histogram Equalization .
결과는 다음과 같다.
6. 기존 그리고 영역에 비어있는 의 빈도수를0~50, 225~250 Gray Level
을 통해 전체 영역에 빈도수가 고르게 분포Equalization 0~255 Gray Level
된 것 고대비 영상으로 변한 것 을 확인할 수 있었다( ) .
또한 을 통해 도출된 값들을 합하여 의, Histogram Equalization Matrix Size
로 나눈값이
의 절반값과 비슷해 진다는 것을 알 수 있었다Max Gray Level(2^Bit 1) .–
입력 행렬에서1) 6*6 ,
(5*13 + 10*12 + 13*6 + 14*3 +15*2) / (6*6) = 9.3
16/2 = 8
에서2) lena.png ,
33743418/ (512*512) = 128.7209
256 / 2 = 128
좀 더 큰 배열을 입력으로 주었을 때 그 근사정도가 커졌다고 볼 수 있다.
7. 따라서 다음과 같은 식을 도출할 수 있었으며 에 대한 근사정도가 커질, , L/2
수록 의 빈도수가 고르게 분배되었 다는 것을 알 수 있었다Gray Level .
__≈