opencv中cvCalcOpticalFlowFarneback函数所包含参数及其意义
3个回答
展开全部
cvCalcOpticalFlowFarneback的原型为:void calcOpticalFlowFarneback(InputArray prevImg, InputArray nextImg, InputOutputArray flow, double pyrScale, int levels, int winsize, int iterations, int polyN, double polySigma, int flags)
各个参数的意义:
prevImg – First 8-bit single-channel input image.
nextImg – Second input image of the same size and the same type as prevImg .
flow – Computed flow image that has the same size as prevImg and type CV_32FC2 .
pyrScale – Parameter specifying the image scale (<1) to build pyramids for each image. pyrScale=0.5means 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.
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. For polyN=5 , you can set polySigma=1.1 . For polyN=7 , a good value would bepolySigma=1.5 .
flags –
Operation flags that can be a combination of the following:
OPTFLOW_USE_INITIAL_FLOW Use the input flow as an initial flow approximation.
OPTFLOW_FARNEBACK_GAUSSIAN Use the Gaussian filter instead of a box filter of the same size for optical flow estimation. Usually, this option gives z more accurate flow than with a box filter, at the cost of lower speed. Normally, winsize for a Gaussian window should be set to a larger value to achieve the same level of robustness.
各个参数的意义:
prevImg – First 8-bit single-channel input image.
nextImg – Second input image of the same size and the same type as prevImg .
flow – Computed flow image that has the same size as prevImg and type CV_32FC2 .
pyrScale – Parameter specifying the image scale (<1) to build pyramids for each image. pyrScale=0.5means 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.
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. For polyN=5 , you can set polySigma=1.1 . For polyN=7 , a good value would bepolySigma=1.5 .
flags –
Operation flags that can be a combination of the following:
OPTFLOW_USE_INITIAL_FLOW Use the input flow as an initial flow approximation.
OPTFLOW_FARNEBACK_GAUSSIAN Use the Gaussian filter instead of a box filter of the same size for optical flow estimation. Usually, this option gives z more accurate flow than with a box filter, at the cost of lower speed. Normally, winsize for a Gaussian window should be set to a larger value to achieve the same level of robustness.
展开全部
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询