calcOpticalFlowFarneback函数解释



calcOpticalFlowFarneback

Computes a dense optical flow using the Gunnar Farneback’s algorithm.

double   pyrScale, int   levels, int   winsize, int   iterations, int   polyN, double   polySigma, int   flags )
Python:   cv2. calcOpticalFlowFarneback (prevImg, nextImg, pyr_scale, levels, winsize, iterations, poly_n, poly_sigma, flags [, flow ] )  → flow
Parameters:
  • prevImg – First 8-bit single-channel input image.   输入单通道图片
  • nextImg – Second input image of the same size and the same type asprevImg . 下一帧图片。
  • flow – Computed flow image that has the same size as prevImg and typeCV_32FC2 .输出的双通道flow
  • pyrScale – Parameter specifying the image scale (<1) to build pyramids for each image. pyrScale=0.5 means a classical pyramid, where each next layer is twice smaller than the previous one.金字塔上上下两层之间的尺度关系。
  • levels – Number of pyramid layers including the initial image.levels=1 means that no extra layers are created and only the original images are used. 金字塔层数
  • winsize – Averaging window size. Larger values increase the algorithm robustness to image noise and give more chances for fast motion detection, but yield more blurred motion field.均值窗口大小,越大越能denoise并且能够检测快速移动目标,但是会引起模糊运动区域。
  • iterations – Number of iterations the algorithm does at each pyramid level.迭代次数。
  • polyN – Size of the pixel neighborhood used to find polynomial expansion in each pixel. Larger values mean that the image will be approximated with smoother surfaces, yielding more robust algorithm and more blurred motion field. Typically, polyN =5 or 7.
  • polySigma – Standard deviation of the Gaussian that is used to smooth derivatives used as a basis for the polynomial expansion. ForpolyN=5 , you can set polySigma=1.1 . For polyN=7 , a good value would be polySigma=1.5 .
  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
OpenCV中的光流算法源码calcopticalflowfarneback实现了Farneback稠密光流算法。这个算法用于计算连续帧之间的运动向量,并且可以应用于目标跟踪、姿态估计等计算机视觉任务。 calcopticalflowfarneback函数的输入参数包括两幅输入图像、金字塔层数、块尺寸、参数k、快速金字塔标识符和光流估计方法标识符。其中,金字塔层数表示图像金字塔的层数,用于处理图像的尺度变化;块尺寸表示图像中计算光流的像素块的大小;参数k为计算光流所需的参数,代表Gaussian滤波核的标准差;快速金字塔标识符选择是否使用快速金字塔参数估计;光流估计方法标识符选择使用Farneback光流估计的具体方法。 calcopticalflowfarneback函数的输出为每个像素点在x和y方向上的光流向量。这些光流向量可用于表示图像中每个像素的运动情况,通过计算当前像素与下一帧图像中对应位置的像素之间的运动差异,从而获取图像中目标的运动信息。 通过调用calcopticalflowfarneback函数,可以对输入的连续帧序列进行光流计算,并获取到每个像素的运动向量。这些运动向量可以用于后续的目标跟踪、姿态估计等计算机视觉任务,帮助我们更好地理解图像中的运动变化和目标的位置信息。 总之,calcopticalflowfarneback函数OpenCV中实现Farneback稠密光流算法的源码,通过调用该函数可以计算连续帧之间的光流向量,从而实现图像的运动分析和相关任务的处理。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值