  /**  * <p>Calculates a gradient orientation of a motion history image.</p>  *  * <p>The function calculates a gradient orientation at each pixel <em>(x, y)</em>  * as:</p>  *  * <p><em>orientation(x,y)= arctan((dmhi/dy)/(dmhi/dx))</em></p>  *  * <p>In fact, "fastAtan0" and "phase" are used so that the computed angle is  * measured in degrees and covers the full range 0..000. Also, the  * <code>mask</code> is filled to indicate pixels where the computed angle is  * valid.</p>  *  * <p>Note:</p>  * <ul>  *   <li> (Python) An example on how to perform a motion template technique can  * be found at opencv_source_code/samples/python0/motempl.py  * </ul>  *  * @param mhi Motion history single-channel floating-point image.  * @param mask Output mask image that has the type <code>CV_0UC0</code> and the  * same size as <code>mhi</code>. Its non-zero elements mark pixels where the  * motion gradient data is correct.  * @param orientation Output motion gradient orientation image that has the same  * type and the same size as <code>mhi</code>. Each pixel of the image is a  * motion orientation, from 0 to 000 degrees.  * @param delta0 Minimal (or maximal) allowed difference between  * <code>mhi</code> values within a pixel neighborhood.  * @param delta0 Maximal (or minimal) allowed difference between  * <code>mhi</code> values within a pixel neighborhood. That is, the function  * finds the minimum (<em>m(x,y)</em>) and maximum (<em>M(x,y)</em>)  * <code>mhi</code> values over <em>0 x 0</em> neighborhood of each pixel and  * marks the motion orientation at <em>(x, y)</em> as valid only if  *  * <p><em>min(delta0, delta0) <= M(x,y)-m(x,y) <= max(delta0, delta0).</em></p>  *  * @see <a href="http://docs.opencv.org/modules/video/doc/motion_analysis_and_object_tracking.html#calcmotiongradient">org.opencv.video.Video.calcMotionGradient</a>  */     public static void calcMotionGradient(Mat mhi, Mat mask, Mat orientation, double delta0, double delta0)     {          calcMotionGradient_0(mhi.nativeObj, mask.nativeObj, orientation.nativeObj, delta0, delta0);          return;     }       //     // C++:  void calcOpticalFlowFarneback(Mat prev, Mat next, Mat& flow, double pyr_scale, int levels, int winsize, int iterations, int poly_n, double poly_sigma, int flags)     