(새 문서: 분류: 컴퓨터 비전 == 개요 == 비디오는 연속적인 이미지로 얻어진다. 시간 t에 대한 I(x,y,t)로 이미지의 한 지점을 얻을 수 있다. 만약 정지된 카메라를 가지고 있다면, 물체의 연속된 움직임을 예측할 수 있다. Optical Flow는 이러한 문제에 사용될 수 있다. 이러한 움지직임을 가지고 Denoising을 계산할 수도 있다. 이러한 이미지와 이미지의 연속된 움직임을 Optical Flow...)
 
편집 요약 없음
 
24번째 줄: 24번째 줄:
or  
or  
:<math>\nabla I\cdot\vec{V} = -I_t</math>
:<math>\nabla I\cdot\vec{V} = -I_t</math>
Optical Flow를 펼치면,
:<math>I_x(q_1) V_x + I_y (q_1) V_y = -I_t(q_1)</math>
:<math>I_x(q_2) V_x + I_y (q_2) V_y = -I_t(q_2)</math>
:<math>\vdots</math>
:<math>I_x(q_n) V_x + I_y (q_n) V_y = -I_t(q_n)</math>
이고 이를 Av = b 행렬로 나타내면,
:<math>A = \begin{bmatrix}
I_x(q_1) & I_y(q_1) \\[10pt]
I_x(q_2) & I_y(q_2) \\[10pt]
\vdots  & \vdots  \\[10pt]
I_x(q_n) & I_y(q_n)
\end{bmatrix}
\quad\quad\quad
v =
\begin{bmatrix}
V_x\\[10pt]
V_y
\end{bmatrix}
\quad\quad\quad
b =
\begin{bmatrix}
-I_t(q_1) \\[10pt]
-I_t(q_2) \\[10pt]
\vdots  \\[10pt]
-I_t(q_n)
\end{bmatrix}
</math>
이고 정사각 행렬로 만들기 위해서 A transpose를 곱해주면,
:<math>A^T A v=A^T b</math> or
:<math>        \mathrm{v}=(A^T A)^{-1}A^T b</math>
:<math>\begin{bmatrix}
V_x\\[10pt]
V_y
\end{bmatrix}
=
\begin{bmatrix}
\sum_i I_x(q_i)^2      & \sum_i I_x(q_i)I_y(q_i) \\[10pt]
\sum_i I_y(q_i)I_x(q_i) & \sum_i I_y(q_i)^2
\end{bmatrix}^{-1}
\begin{bmatrix}
-\sum_i I_x(q_i)I_t(q_i) \\[10pt]
-\sum_i I_y(q_i)I_t(q_i)
\end{bmatrix}
</math>
으로 구해진다.


아주 쉽게 말하면, Motion Vector (Vx, Vy)를 구하는데있어서, 영상을 x축으로 미분(Ix)하고, y축으로 미분(Iy)하고, 시간축으로 미분(It)해서 저 식에 대입해서 Matrix를 풀면 바로 구할 수 있다는 이야기다.
아주 쉽게 말하면, Motion Vector (Vx, Vy)를 구하는데있어서, 영상을 x축으로 미분(Ix)하고, y축으로 미분(Iy)하고, 시간축으로 미분(It)해서 저 식에 대입해서 Matrix를 풀면 바로 구할 수 있다는 이야기다.

2023년 2월 25일 (토) 10:48 기준 최신판


개요

비디오는 연속적인 이미지로 얻어진다. 시간 t에 대한 I(x,y,t)로 이미지의 한 지점을 얻을 수 있다. 만약 정지된 카메라를 가지고 있다면, 물체의 연속된 움직임을 예측할 수 있다. Optical Flow는 이러한 문제에 사용될 수 있다. 이러한 움지직임을 가지고 Denoising을 계산할 수도 있다. 이러한 이미지와 이미지의 연속된 움직임을 Optical Flow라고 한다. Optical Flow에서 또한 중요한 것은 이미지의 Lighting 환경이 변할 수 있다는 것이다. 이러한 Lighting도 계산할 수 있어야 한다.

Optical Flow를 계산하기 위해서, 픽셀 움직임의 Delta를 구함으로써 구할 수 있다. 중요한 고려사항은 Brightness이다. Brightness는 Lighting이 바뀌지 않는 다는 조건에서 유효하게 작동한다. 또한 Neighboring points들이 같은 surface에 속한다는 가정도 할 수 있다. 이 두조건에서 [math]I(x,y,t-1)=I(x+u(x,y),y+v(x,y),y)[/math]라는 Assumption이 성립하는 것이다.

수식

윗 수식에서,

[math]I(x,y,t) = I(x+\Delta x, y + \Delta y, t + \Delta t)[/math]

Assuming the movement to be small, the image constraint at [math]I(x,y,t)[/math] with Taylor series can be developed to get:

[math]I(x+\Delta x,y+\Delta y,t+\Delta t) = I(x,y,t) + \frac{\partial I}{\partial x}\Delta x+\frac{\partial I}{\partial y}\Delta y+\frac{\partial I}{\partial t}\Delta t+[/math]higher-order terms

By truncating the higher order terms, a linearization, it follows that:

[math]\frac{\partial I}{\partial x}\Delta x+\frac{\partial I}{\partial y}\Delta y+\frac{\partial I}{\partial t}\Delta t = 0[/math]

or, dividing by [math]\Delta t[/math],

[math]\frac{\partial I}{\partial x}\frac{\Delta x}{\Delta t}+\frac{\partial I}{\partial y}\frac{\Delta y}{\Delta t}+\frac{\partial I}{\partial t}\frac{\Delta t}{\Delta t} = 0[/math]

which results in

[math]\frac{\partial I}{\partial x}V_x+\frac{\partial I}{\partial y}V_y+\frac{\partial I}{\partial t} = 0[/math]

where [math]V_x,V_y[/math] are the [math]x[/math] and [math]y[/math] components of the velocity or optical flow of [math]I(x,y,t)[/math] and [math]\tfrac{\partial I}{\partial x}[/math], [math]\tfrac{\partial I}{\partial y}[/math] and [math]\tfrac{\partial I}{\partial t}[/math] are the derivatives of the image at [math](x,y,t)[/math] in the corresponding directions. [math]I_x[/math],[math] I_y[/math] and [math] I_t[/math] can be written for the derivatives in the following.

Thus:

[math]I_xV_x+I_yV_y=-I_t[/math]

or

[math]\nabla I\cdot\vec{V} = -I_t[/math]

Optical Flow를 펼치면,

[math]I_x(q_1) V_x + I_y (q_1) V_y = -I_t(q_1)[/math]
[math]I_x(q_2) V_x + I_y (q_2) V_y = -I_t(q_2)[/math]
[math]\vdots[/math]
[math]I_x(q_n) V_x + I_y (q_n) V_y = -I_t(q_n)[/math]

이고 이를 Av = b 행렬로 나타내면,

[math]A = \begin{bmatrix} I_x(q_1) & I_y(q_1) \\[10pt] I_x(q_2) & I_y(q_2) \\[10pt] \vdots & \vdots \\[10pt] I_x(q_n) & I_y(q_n) \end{bmatrix} \quad\quad\quad v = \begin{bmatrix} V_x\\[10pt] V_y \end{bmatrix} \quad\quad\quad b = \begin{bmatrix} -I_t(q_1) \\[10pt] -I_t(q_2) \\[10pt] \vdots \\[10pt] -I_t(q_n) \end{bmatrix} [/math]

이고 정사각 행렬로 만들기 위해서 A transpose를 곱해주면,

[math]A^T A v=A^T b[/math] or
[math] \mathrm{v}=(A^T A)^{-1}A^T b[/math]
[math]\begin{bmatrix} V_x\\[10pt] V_y \end{bmatrix} = \begin{bmatrix} \sum_i I_x(q_i)^2 & \sum_i I_x(q_i)I_y(q_i) \\[10pt] \sum_i I_y(q_i)I_x(q_i) & \sum_i I_y(q_i)^2 \end{bmatrix}^{-1} \begin{bmatrix} -\sum_i I_x(q_i)I_t(q_i) \\[10pt] -\sum_i I_y(q_i)I_t(q_i) \end{bmatrix} [/math]

으로 구해진다.

아주 쉽게 말하면, Motion Vector (Vx, Vy)를 구하는데있어서, 영상을 x축으로 미분(Ix)하고, y축으로 미분(Iy)하고, 시간축으로 미분(It)해서 저 식에 대입해서 Matrix를 풀면 바로 구할 수 있다는 이야기다.

하지만, 우리는 Birhgtness Consistency를 곧바로 사용할 수는 없다. 왜냐하면 Aperutre Problem과 같은 문제들이 있기 때문이다. 이를 Barber Pole illusion이라고 하기도 한다. 또한 저기서 벡터는 Matrix가 아니라서 풀수 없는 문제가 있는데, 이를 하결하기 위해서 Lucas-Kanade와 같은 방식들이 존재한다.

Deep learning based model

Deep learning을 이용하여 Optical Flow를 해결하려는 문제도 있으며 open problem이다. 이러한 방식은 다음과 같은 문제점을 해결해야 한다.

  1. Various Scales of displacement
  2. Handling occlusion and disocclusion
  3. Homogeneous regions
  4. Dependency on photometric term
  5. Generalization

FlowNet

FlowNet Simple은 이미지 두개를 포개 넣어서 Optical Flow를 예측하는 방식이다. FlowNet의 아이디어는, Correlation Layer을 넣었다는 것이다. FlowNet 2.0은 FlowNet 여러개를 합쳐놓은 것이었다. Warrping Layer을 통해서 원래이미지와 비교하는 레이어를 두어서 Large Motion과 Small Motion을 동시에 해결하였다. 후에 정교한 파라미터 분석을 통해 파라미터를 줄여서 LiteFlowNet이라는 논문이 나오게 되었다.

응용

  1. 3D Reconstruction
  2. Segmenting Objects
  3. Object Tracking
  4. Super Resolution
  5. Motion Detecting

참고

  1. Lucas-Kanade
  2. Horn-Schunk
  3. Micahel Black

출처

https://paeton.tistory.com/entry/%EC%98%B5%ED%8B%B0%EC%B9%BC-%ED%94%8C%EB%A1%9C%EC%9A%B0-Optical-Flow