본문 바로가기

VISION

Quadratic interpolation을 쓰지 않는 이유

Linear > quadratic > cubic으로 갈 수록 function approximation을 위해 더 많은 주변 픽셀을 필요로 한다.

예를 들면 linear function은 두 개의 점만 있어도 그릴 수 있지만, quadratic function은 3개, cubic function은 4개의 점을 필요로 한다.

 

linear interpolation의 단점은 포인트 간 linear function을 그리면 포인트들에서 sharp edge가 생긴다는 것이다. 따라서 포인트 전후의 값을 interpolation하면 포인트 직전과 직후임에도 함수의 방향이 다르므로 값이 달라지고 계단이 생길 수 있다. 이를 보완하려면 포인트 전후로 연속함수여야 한다.

quadratic interpolation의 경우, 1차 도함수(slope)는 연속이므로 sharp edge가 없는 spline이 그려지긴 한다. 하지만 2차 도함수가 연속이 아니기 때문에(slope의 미분(2차미분, 변화량, 변화속도)이 다름), spline을 만들 때 (각 function을 하나로 연결할 때) 두 function의 curvature(곡률)가 달라 불연속점이 여전히 생긴다. 실제로 quadratic interpolation을 하면 억지로 이어붙인 것처럼 급격히 변화하는 곡선이 존재한다.

다시 말하면 2차함수의 2차 도함수는 상수이므로 두 함수를 연결(spline)할 degree of freedom이 더 이상 남아있지 않다. 2차함수에서 2차도함수 값까지 같으려면 모든 점이 같은 2차함수 위에 존재해야 한다. 그래야 같은 상수값이 나오니까.

 

우리가 linear interpolation에서 차수를 높이는 이유는 smoothness를 얻기 위함인데, 따라서 2차 도함수까지 연속인 함수 중 가장 연산량이 적은 cubic function을 사용하는 것이다. 그래야 spline point에서 curvature까지 smooth하게 연결되는 그래프를 얻어낼 수 있으니까. (quadratic은 linear에 비해 연산량만 늘어나면서 여전히 포인트에서의 smoothness를 보장할 수 없어 이득이 적음)

* 2차, 3차로 갈수록(higher derivative) 도함수가 연속이라면, 함수의 곡률을 줄일 수 있다(more smoothness).

Linear interpolation / Quadratic function and its derivative

 

또한 아래 그림에서 Node2와 3 사이의 점을 quadratic function으로 보간하고 싶다면 하나의 점이 더 필요하다. 그 점을 Node 1로 할 지 4로 할 지에 대한 모호함이 생기는 문제도 있다.

Quadratic interpolation

 

 

참고) 도움이 많이 된 자료들

https://math.stackexchange.com/questions/1006207/why-do-we-choose-cubic-polynomials-when-we-make-a-spline

 

Why do we choose cubic polynomials when we make a spline?

Good morning, I want to learn more about cubic splines but unfortunately my class goes pretty quickly and we really only get the high level overview of why they're important and why they work. To...

math.stackexchange.com

https://www.youtube.com/watch?v=BqZXS3n75l0 

https://www.youtube.com/watch?v=wMMjF7kXnWA 

 

 

그 외 참고자료)

 

how to spline polynomials - Google 검색

Derivation of Spline Polynomials ... Spline fitting or spline interpolation is a way to draw a smooth curve through n+1 points (x0, y0), …, (xn,yn). Thus, we seek ...

www.google.com

 

 

Cubic splines better than quadratic splines?

I have read in a number of places that cubic splines are of more practical use than quadratic splines in general (there are exceptions of course). Anyone know specifically why they are more applica...

math.stackexchange.com