Week 1-2. Image Processing 1
- Pinhole camera
- Digital transformation: Sampling, Quantizing
function f: R2 -> R
- RGB color model
- HSV color model: Hue, Saturation, Value/brightness V
2. Image Processing
f -> g = T(f)
Point Operation
depends on only the corresponding input pixel value


- Scene dissolve
(e.g., k=2)

-
Histogram
how often each (grayscale) value in the range [0, L-1] appears in the image
understand contrast, brightness, intensity distribution
-
Histogram equalization
flattens the histogram
Enhances image quality by expanding the dynamic range of intensities
intensity: 강도
use cumulative histogram as the mapping function
lout=T(lin)=round(c(lin)×(L−1)) where c(lin)=l=0∑linh^(l)
수식 외우기
ex) 원래 gray level의 빈도수(히스토그램 값)의 누적합(앞 픽셀 값 다 더함) 구함, 누적합 최종 결과 360, gray level 총 갯수 15개
누적합 x 15/360, 정규화하고 반올림
원래 빈도수와 비교하면 균등하게 분포됨


- Binarization (Thresholding)

- Otsu's algorithm
binarization is better when higher homogeneity <- lower variance

- Otsu's algorithm (efficient version)


Week 2-1. Image Processing 2
Neighborhood Operations
1. Convolution
Integral of the product of the two functions after one is reversed and shifted
dummy variable τ
h(t)=∫−∞∞f(τ)g(t−τ)dτ, h=f∗g
convolution of f and g:
reflect one of the function g -> g(t - τ)
slide t from −∞to∞
two function intersect, find the integral of their product

- Properties of Convolution
f(x) -> g(x) 이면 f(x-a) -> g(x-a)임

- Convolution: Impulse Response
f, delta(δ) 곱한 적분은 f(0)
g(x)는 f(τ),δ(x−τ) 곱한거 적분이자 f(x)

- Discrete Convolution
Images are discrete and finite 불연속
kernel/filter/mask 수평, 수직 방향으로 flip
kernel value 각각 곱하기
f(x,y) -> h(x,y) -> g(x,y)
g(x,y)=i=−m∑mj=−n∑nf(x−i,y−j)h(i,j)
- Border problem
Pad with constant values, reflection
2. Cross-Correlation
locate the template 본뜬 판 두기
(f - t)2 합 E 최소화
t*f 합 R 최대화


+Convolution, Cross-Correlation 구분 안해도 됨
- Convolution is a Generic Function
Separable linear filter: K=vhT
O(k2) -> O(2k) 1차원 수평, 1차원 수직 convolution

3. Gaussian Smoothing
Gaussian kernel
h(i,j)=2πσ21e−21(σ2i2+j2)
g(i,j)=2πσ21m=1∑n=1∑e−21(σ2m2+n2)f(i−m,j−n)
=2πσ21m=1∑e−2σ21m2n=1∑e−2σ21n2f(i−m,j−n)
-> Use two 1D Gaussian filters, horizontally and then vertically
Repeated averaging, Gaussian smoothing 비슷함
4. Median Filter
Smoothing is averaging: Blurs edges, sensitive to oufliers
-> Median filtering: 해결책
Sort k2 values around the pixel
Select middle value(median)
Non-linear(no convolution)

Salt and pepper noise- median filter
Gaussian noise- Gaussian filter