title: ASSERTION FAILED ERROR
body: <p>I am trying to find the optical flow between two sequence of images,when I run the program it shows up assertion failed at calcOpticalFlowFarneback() function.Can anyone help me with this issue.</p>
  
  <pre><code>#include "stdafx.h"
  #include&lt;opencv\cv.h&gt;
  #include&lt;opencv2\highgui\highgui.hpp&gt;
  #include&lt;opencv2\calib3d\calib3d.hpp&gt;
  #include&lt;opencv2\core\core.hpp&gt;
  
  using namespace cv;
  using namespace std;
  void drawOptFlowMap (const Mat&amp; flow, Mat&amp; cflowmap, int step, double scale, const    
  Scalar&amp; color) 
  {
    for(int y = 0; y &lt; cflowmap.rows; y += step)
      for(int x = 0; x &lt; cflowmap.cols; x += step)
      {
          const Point2f&amp; fxy = flow.at&lt;Point2f&gt;(y, x);
          line(cflowmap, Point(x,y), Point(cvRound(x+fxy.x), cvRound(y+fxy.y)),
               color);
          circle(cflowmap, Point(cvRound(x+fxy.x), cvRound(y+fxy.y)), 1, color, -1);
      }
  } 
  int main()
  {
    Mat flow,cflow;
    Mat Previous_Gray=imread("image2.png");
  
    Mat Current_Gray=imread("image3.png");
    cvtColor(Current_Gray,Current_Gray,CV_BGR2GRAY);
    cvNamedWindow("optical Flow", CV_WINDOW_NORMAL);
    calcOpticalFlowFarneback(Previous_Gray,Current_Gray,flow,0.5, 3, 15, 3, 5, 1.2, 0);
    cvtColor(Previous_Gray, cflow, CV_GRAY2BGR);
    drawOptFlowMap(flow, cflow, 32, 50, CV_RGB(0, 255, 0));
    imshow("optical Flow", cflow);
  
  
    return 0;
  }   
  </code></pre>