コード例 #1
0
ファイル: video.cs プロジェクト: highwayns/opencv.net
 internal static extern void cvCalcOpticalFlowFarneback(
     Arr prev,
     Arr next,
     Arr flow,
     double pyr_scale,
     int levels,
     int winsize,
     int iterations,
     int poly_n,
     double poly_sigma,
     FarnebackFlowFlags flags);
コード例 #2
0
 /// <summary>
 /// Computes dense optical flow using Gunnar Farneback’s algorithm.
 /// </summary>
 /// <param name="prev">The first 8-bit single-channel input image.</param>
 /// <param name="next">The second input image of the same size and the same type as <paramref name="prev"/>.</param>
 /// <param name="flow">
 /// The computed flow image; will have the same size as <paramref name="prev"/> and two 32-bit floating-point channels.
 /// </param>
 /// <param name="pyrScale">
 /// Specifies the image scale (less than 1) to build the pyramids for each image. 0.5 means the classical pyramid,
 /// where each next layer is twice smaller than the previous.
 /// </param>
 /// <param name="levels">
 /// The number of pyramid layers, including the initial image. 1 means that no extra layers are created and only
 /// the original images are used.
 /// </param>
 /// <param name="winSize">
 /// The averaging window size; The larger values increase the algorithm robustness to image noise and give more
 /// chances for fast motion detection, but yield a more blurred motion field.
 /// </param>
 /// <param name="iterations">The number of iterations the algorithm does at each pyramid level.</param>
 /// <param name="polyN">
 /// Size of the pixel neighborhood used to find polynomial expansion in each pixel. The larger values mean that
 /// the image will be approximated with smoother surfaces, yielding a more robust algorithm and a more blurred
 /// motion field. Typically, <paramref name="polyN"/> is set to 5 or 7.
 /// </param>
 /// <param name="polySigma">
 /// Standard deviation of the Gaussian that is used to smooth derivatives that are used as a basis for the
 /// polynomial expansion. For a <paramref name="polyN"/> of 5 you can set <paramref name="polySigma"/> to 1.1,
 /// while for a <paramref name="polyN"/> of 7 a good value would be 1.5.
 /// </param>
 /// <param name="flags">Specifies operation flags.</param>
 public static void CalcOpticalFlowFarneback(
     Arr prev,
     Arr next,
     Arr flow,
     double pyrScale,
     int levels,
     int winSize,
     int iterations,
     int polyN,
     double polySigma,
     FarnebackFlowFlags flags)
 {
     NativeMethods.cvCalcOpticalFlowFarneback(
         prev,
         next,
         flow,
         pyrScale,
         levels,
         winSize,
         iterations,
         polyN,
         polySigma,
         flags);
 }