title: OpenCV Cuda calcOpticalFlowBM
body: <p>I am trying to calculate and display opticalFlowBM but having serious troubles. I am using Cuda 7.5 and OpenCV 3.0.0.
  I was trying to rewrite it to 3.0.0.
  <a href="https://stackoverflow.com/questions/21794539/sizes-of-input-arguments-do-not-macth-in-cvcalcopticalflowbm-opencv-2-4-7">Sizes of input arguments do not match in cvcalcopticalflowbm opencv 2.4.7</a>
  My code (<code>imgA</code> and <code>imgB</code> are <code>Mats</code> read from <code>VideoCapture // cap.read(ImgA)</code>):</p>
  
  <pre><code>            cvtColor(imgA,imgA,COLOR_BGR2GRAY);
              cvtColor(imgB,imgB,COLOR_BGR2GRAY);
              CvSize size = imgA.size();
              CvSize velsize = CvSize(size.width,size.height);
              size.width/=BS;
              size.height/=BS;
              //result=Mat(size,IPL_DEPTH_8U);
              //result=Scalar(255,255,255);
  
              Mat velx,vely;
              velx=Mat(velsize,IPL_DEPTH_32F);
              vely=Mat(velsize,IPL_DEPTH_32F);
              GpuMat imgAA;
              imgAA.upload(imgA);
              GpuMat imgBB;
  
              cvtColor(imgAA,imgAA,COLOR_BGR2GRAY);
              cvtColor(imgBB,imgBB,COLOR_BGR2GRAY);
              imgBB.upload(imgB);
              GpuMat velxx;
              velxx.upload(velx);
              GpuMat velyy;
              velyy.upload(vely);
              GpuMat buffor;
              calcOpticalFlowBM(imgBB,imgAA,cvSize(BS,BS),cvSize(1,1),cvSize(1,1),0,velxx,velyy,buffor);
              Mat abc(imgAA);
              namedWindow("abc");
              imshow("abc",imgAA);
  </code></pre>
  
  <p>But keep getting error: </p>
  
  <blockquote>
    <p>OpenCV Error: The function/feature is not implemented (You<br>
    should explicitly call download method for cuda::GpuMat
    object) in getMat,file<br>
    /home/pentaquark/Pulpit/opencv/opencv-3.0.0-<br>
    alpha/modules/core/src/matrix.cpp, line 1193
    terminate called after throwing an instance of 
    'cv::Exception'what():<br>
    /home/pentaquark/Pulpit/opencv/opencv-3.0.0-
    alpha/modules/core/src/matrix.cpp:1193: error: (-213) You 
    should explicitly call download method for cuda::GpuMat 
    object in function getMat</p>
  </blockquote>
  
  <p>Could anyone help me?</p>