当前位置: 首页>>编程示例 >>用法及示例精选 >>正文


Python skimage.registration.optical_flow_ilk用法及代码示例

用法:

skimage.registration.optical_flow_ilk(reference_image, moving_image, *, radius=7, num_warp=10, gaussian=False, prefilter=False, dtype=<class 'numpy.float32'>)

粗到细的光流估计器。

迭代Lucas-Kanade (iLK) 求解器应用于图像金字塔的每个级别。 iLK [1] 是 TVL1 算法的快速且稳健的替代方案,尽管在渲染平面和对象边界方面不太准确(请参阅[2])。

参数

reference_imagendarray,形状(M,N[,P[,…]])

序列的第一幅灰度图像。

moving_imagendarray,形状(M,N[,P[,…]])

序列的第二个灰度图像。

radiusint 可选

每个像素周围考虑的窗口半径。

num_warpint 可选

moving_image 扭曲的次数。

gaussian布尔型,可选

如果为 True,则使用高斯核进行局部积分。否则,使用统一内核。

prefilter布尔型,可选

是否在每个图像扭曲之前对估计的光流进行预过滤。当为 True 时,将应用沿每个轴的窗口大小为 3 的中值滤波器。这有助于消除潜在的异常值。

dtypedtype,可选

输出数据类型:必须是浮点数。与双精度相比,单精度提供了良好的结果并节省了内存使用和计算时间。

返回

flowndarray, 形状 ((reference_image.ndim, M, N[, P[, ...]])

每个轴的估计光流分量。

注意

  • 实现的算法在表2[1].
  • 不支持彩色图像。

参考

1(1,2)

Le Besnerais, G., & Champagnat, F. (2005, September). Dense optical flow by iterative local window registration. In IEEE International Conference on Image Processing 2005 (Vol. 1, pp. I-137). IEEE. DOI:10.1109/ICIP.2005.1529706

2

Plyer, A., Le Besnerais, G., & Champagnat, F. (2016). Massively parallel Lucas Kanade optical flow for real-time video processing applications. Journal of Real-Time Image Processing, 11(4), 713-730. DOI:10.1007/s11554-014-0423-0

例子

>>> from skimage.color import rgb2gray
>>> from skimage.data import stereo_motorcycle
>>> from skimage.registration import optical_flow_ilk
>>> reference_image, moving_image, disp = stereo_motorcycle()
>>> # --- Convert the images to gray level: color is not supported.
>>> reference_image = rgb2gray(reference_image)
>>> moving_image = rgb2gray(moving_image)
>>> flow = optical_flow_ilk(moving_image, reference_image)

相关用法


注:本文由纯净天空筛选整理自scikit-image.org大神的英文原创作品 skimage.registration.optical_flow_ilk。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。