[CV] 1. Image Processing

실버버드·2025년 10월 13일

Computer Vision

목록 보기
1/14

Week 1-2. Image Processing 1

1. Image formation

  • Pinhole camera
  • Digital transformation: Sampling, Quantizing
    function f: R2^2 -> 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

  • Linear operations

  • Gamma correction

  • 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)×(L1)) where c(lin)=l=0linh^(l)\displaystyle l_{out} = T(l_{in}) = round(c(l_{in}) \times (L-1))\ where\ c(l_{in}) = \sum^{l_{in}}_{l=0}\hat{h}(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)

  • operations

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 τ\tau
h(t)=f(τ)g(tτ)dτ, h=fg\displaystyle h(t) = \int^{\infin}_{-\infin}f(\tau)g(t - \tau)d\tau,\ h = f * g
convolution of f and g:
reflect one of the function g -> g(t - τ\tau)
slide t from to-\infin to \infin
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(δ\delta) 곱한 적분은 f(0)
    g(x)는 f(τ),δ(xτ)f(\tau), \delta(x-\tau) 곱한거 적분이자 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=mmj=nnf(xi,yj)h(i,j)\displaystyle g(x,y) = \sum^m_{i=-m}\sum^n_{j=-n}f(x-i, y-j)h(i,j)
  • Border problem
    Pad with constant values, reflection

2. Cross-Correlation
locate the template 본뜬 판 두기
(f - t)2^2 합 E 최소화
t*f 합 R 최대화

  • Normalized Correlation

+Convolution, Cross-Correlation 구분 안해도 됨

  • Convolution is a Generic Function
    Separable linear filter: K=vhTK = vh^T
    O(k2^2) -> O(2k) 1차원 수평, 1차원 수직 convolution

3. Gaussian Smoothing
Gaussian kernel
h(i,j)=12πσ2e12(i2+j2σ2)\displaystyle h(i,j) = \frac{1}{2\pi\sigma^2}e^{-\frac{1}{2}(\frac{i^2 + j^2}{\sigma^2})}
g(i,j)=12πσ2m=1n=1e12(m2+n2σ2)f(im,jn)\displaystyle g(i,j) = \frac{1}{2\pi\sigma^2}\sum_{m=1}\sum_{n=1}e^{-\frac{1}{2}(\frac{m^2 + n^2}{\sigma^2})}f(i-m,j-n)
=12πσ2m=1e1m22σ2n=1e1n22σ2f(im,jn)\displaystyle =\frac{1}{2\pi\sigma^2}\sum_{m=1}e^{-\frac{1m^2 }{2\sigma^2}}\sum_{n=1}e^{-\frac{1n^2 }{2\sigma^2}}f(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^2 values around the pixel
Select middle value(median)
Non-linear(no convolution)

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

0개의 댓글