[Computer Graphics] Magnification (Nearest neighbor sampling, Bilinear interpolation, Bicubic interpolation)

2023. 10. 10. 18:35Run/Computer Graphics

Nearest neighbor sampling (Nearest point sampling)

Algorithm: Assign the unknown pixel to the nearest known pixel

 

Bilinear interpolation

Algorithm:

1) Find the value along rows (ex. (0.3, 0.4) → A(0, 0.4), B(1, 0.4))

2) After getting values at A and B, apply linear interpolation for point (0.3, 0.4) between A and B.

 

- Linear interpolation의 2차원 버전이라고 생각하면 된다.

- Nearest neighbor sampling 보다 부드러운 결과를 내지만 edge를 표현하는 데 이상적이지 않음

 

위 사진에서 픽셀값들이 내가 생각하는 값들과 다르게 쓰여있는데 왜인지는 모르겠다..

 

Bicubic interpolation

Algorithm: The assigned value is weighted sum of 4x4 nearest pixels

 

10 10 10 20 20 20

10 10 10 20 20 20

10 10 10 20 20 20

30 30 30 40 40 40

30 30 30 40 40 40

30 30 30 40 40 40

 

 

Bilinear interpolation 과의 차이점

1) Bilinear은 4개의 nearest neighbor을 사용, Bicubic은 16개의 nearest neighbor을 사용

2) Weight distribution이 다르게 수행됨

 

 

참고 자료

https://theailearner.com/2018/12/29/image-processing-nearest-neighbour-interpolation/

https://theailearner.com/2018/12/29/image-processing-bilinear-interpolation/

https://theailearner.com/2018/12/29/image-processing-bicubic-interpolation/