在计算机视觉中,卢卡斯-卡纳德方法是一种广泛使用的光流估计的差分方法,这个方法是由Bruce D. Lucas和Takeo Kanade发明的。它假设光流在像素点的邻域是一个常数,然后使用最小平方法对邻域中的所有像素点求解基本的光流方程。
通过结合几个邻近像素点的信息,卢卡斯-卡纳德方法(简称为L-K方法)通常能够消除光流方程里的多义性。而且,与逐点计算的方法相比,L-K方法对图像噪声不敏感。不过,由于这是一种局部方法,所以在图像的均匀区域内部,L-K方法无法提供光流信息。
基本原理
L-K方法假设两个相邻帧的图像内容位移很小,且位移在所研究点p的邻域内为大致为常数。所以,可以假设光流方程 在以p点为中心的窗口内对所有的像素都成立。也就是说,局部图像流(速度)向量(V_x,V_y)须满足:
:I_x(q_1) V_x + I_y (q_1) V_y = -I_t(q_1)
:I_x(q_2) V_x + I_y (q_2) V_y = -I_t(q_2)
:\vdots
:I_x(q_n) V_x + I_y (q_n) V_y = -I_t(q_n)
其中,q_1,q_2,\dots,q_n 是窗口中的像素,I_x(q_i),I_y(q_i),I_t(q_i)是图像在点q_i和当前时间对位置x,y和时间t的偏导。
这些等式可以写成矩阵的形式A v = b,此处
: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
v =
\begin{bmatrix}
V_x\\[10pt]
V_y
\end{bmatrix},
\quad \mbox{and}\quad
b =
\begin{bmatrix}
-I_t(q_1) \\[10pt]
-I_t(q_2) \\[10pt]
\vdots \\[10pt]
-I_t(q_n)
\end{bmatrix}
此方程组的等式个数多于未知数个数,所以它通常是over-determined的。L-K方法使用最小平方法获得一个近似解,即计算一个2x2的方程组:
:A^T A v=A^T b 或
: \mathrm{v}=(A^T A)^{-1}A^T b
其中,A^T是矩阵A的转置。即计算:
:\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}
对i=1 到 n求和。
矩阵A^T A通常被称作图像在点p的 结构张量。
参考文献
外部链接
- [http://www.cs.cmu.edu/~kangli/code/Image_Stabilizer.html The image stabilizer plugin for ImageJ] based on the Lucas–Kanade method
- [http://www.mathworks.com/matlabcentral/fileexchange/24677 Mathworks Lucas-Kanade] Matlab implementation of inverse and normal affine Lucas-Kanade
- [https://web.archive.org/web/20091014150930/http://www.onera.fr/dtim-en/gpu-for-image/folkigpu.php FolkiGPU :] GPU implementation of an iterative Lucas-Kanade based optical flow
- [http://www.success-ware.com/150842/Lucas-Kanade-Detection-for-the-iPhone Lucas-Kanade for the iPhone] by Success Labs. A modified and enhanced port of the OpenCV lkdemo sample application to the iPhone.
- [http://www.ces.clemson.edu/~stb/klt/ KLT] : An Implementation of the Kanade–Lucas–Tomasi Feature Tracker
- [http://www.ri.cmu.edu/people/kanade_takeo.html Takeo Kanade]
评论 (0)