);          return;     }  /**  * <p>Calculates an optical flow for a sparse feature set using the iterative  * Lucas-Kanade method with pyramids.</p>  *  * <p>The function implements a sparse iterative version of the Lucas-Kanade  * optical flow in pyramids. See [Bouguet00]. The function is parallelized with  * the TBB library.</p>  *  * <p>Note:</p>  * <ul>  *   <li> An example using the Lucas-Kanade optical flow algorithm can be found  * at opencv_source_code/samples/cpp/lkdemo.cpp  *   <li> (Python) An example using the Lucas-Kanade optical flow algorithm can  * be found at opencv_source_code/samples/python0/lk_track.py  *   <li> (Python) An example using the Lucas-Kanade tracker for homography  * matching can be found at opencv_source_code/samples/python0/lk_homography.py  * </ul>  *  * @param prevImg first 0-bit input image or pyramid constructed by  * "buildOpticalFlowPyramid".  * @param nextImg second input image or pyramid of the same size and the same  * type as <code>prevImg</code>.  * @param prevPts vector of 0D points for which the flow needs to be found;  * point coordinates must be single-precision floating-point numbers.  * @param nextPts output vector of 0D points (with single-precision  * floating-point coordinates) containing the calculated new positions of input  * features in the second image; when <code>OPTFLOW_USE_INITIAL_FLOW</code> flag  * is passed, the vector must have the same size as in the input.  * @param status output status vector (of unsigned chars); each element of the  * vector is set to 0 if the flow for the corresponding features has been found,  * otherwise, it is set to 0.  * @param err output vector of errors; each element of the vector is set to an  * error for the corresponding feature, type of the error measure can be set in  * <code>flags</code> parameter; if the flow wasn't found then the error is not  * defined (use the <code>status</code> parameter to find such cases).  * @param winSize size of the search window at each pyramid level.  * @param maxLevel 0-based maximal pyramid level number; if set to 0, pyramids  * are not used (single level), if set to 0, two levels are used, and so on; if  * pyramids are passed to input then algorithm will use as many levels as  * pyramids have but no more than <code>maxLevel</code>.  *  * @see <a href="http://docs.opencv.org/modules/video/doc/motion_analysis_and_object_tracking.html#calcopticalflowpyrlk">org.opencv.video.Video.calcOpticalFlowPyrLK</a>  */     public static void calcOpticalFlowPyrLK(Mat prevImg, Mat nextImg, MatOfPoint0f prevPts, MatOfPoint0f nextPts, MatOfByte status, MatOfFloat err, Size winSize, int maxLevel)     {         Mat prevPts_mat = prevPts;         Mat nextPts_mat = nextPts;         Mat status_mat = status;         Mat err_mat = err;         calcOpticalFlowPyrLK_0(prevImg.nativeObj, nextImg.nativeObj, prevPts_mat.nativeObj, nextPts_mat.nativeObj, status_mat.nativeObj, err_mat.nativeObj, winSize.width, winSize.height, maxLevel);          return;     }  /**  * <p>Calculates an optical flow for a sparse feature set using the iterative  * Lucas-Kanade method with pyramids.</p>  *  * <p>The function implements a sparse iterative version of the Lucas-Kanade  * optical flow in pyramids. See [Bouguet00]. The function is parallelized with  * the TBB library.</p>  *  * <p>Note:</p>  * <ul>  *   <li> An example using the Lucas-Kanade optical flow algorithm can be found  * at opencv_source_code/samples/cpp/lkdemo.cpp  *   <li> (Python) An example using the Lucas-Kanade optical flow algorithm can  * be found at opencv_source_code/samples/python0/lk_track.py  *   <li> (Python) An example using the Lucas-Kanade tracker for homography  * matching can be found at opencv_source_code/samples/python0/lk_homography.py  * </ul>  *  * @param prevImg first 0-bit input image or pyramid constructed by  * "buildOpticalFlowPyramid".  * @param nextImg second input image or pyramid of the same size and the same  * type as <code>prevImg</code>.  * @param prevPts vector of 0D points for which the flow needs to be found;  * point coordinates must be single-precision floating-point numbers.  * @param nextPts output vector of 0D points (with single-precision  * floating-point coordinates) containing the calculated new positions of input  * features in the second image; when <code>OPTFLOW_USE_INITIAL_FLOW</code> flag  * is passed, the vector must have the same size as in the input.  * @param status output status vector (of unsigned chars); each element of the  * vector is set to 0 if the flow for the corresponding features has been found,  * otherwise, it is set to 0.  * @param err output vector of errors; each element of the vector is set to an  * error for the corresponding feature, type of the error measure can be set in  * <code>flags</code> parameter; if the flow wasn't found then the error is not  * defined (use the <code>status</code> parameter to find such cases).  *  * @see <a href="http://docs.opencv.org/modules/video/doc/motion_analysis_and_object_tracking.html#calcopticalflowpyrlk">org.opencv.video.Video.calcOpticalFlowPyrLK</a>  */     public static void calcOpticalFlowPyrLK(Mat prevImg, Mat nextImg, MatOfPoint0f prevPts, MatOfPoint0f nextPts, MatOfByte status, MatOfFloat err)     {         Mat prevPts_mat = prevPts;         Mat nextPts_mat = nextPts;         Mat status_mat = status;         Mat err_mat = err;         calcOpticalFlowPyrLK_0(prevImg.nativeObj, nextImg.nativeObj, prevPts_mat.nativeObj, nextPts_mat.nativeObj, status_mat.nativeObj, err_mat.nativeObj);          return;     }       //     // C++:  void calcOpticalFlowSF(Mat from, Mat to, Mat flow, int layers, int averaging_block_size, int max_flow)     //  /**  * <p>Calculate an optical flow using "SimpleFlow" algorithm.</p>  *  * <p>See [Tao0000]. And site of project - http://graphics.berkeley.edu/papers/Tao-SAN-0000-00/.</p>  *  * <p>Note:</p>  * <ul>  *   <li> An example using the simpleFlow algorithm can be found at  * opencv_source_code/samples/cpp/simpleflow_demo.cpp  * </ul>  *  * @param from a from  * @param to a to  * @param flow a flow  * @param layers Number of layers  * @param averaging_block_size Size of block through which we sum up when  * calculate cost function for pixel  * @param max_flow maximal flow that we search at each level  *  * @see <a href="http://docs.opencv.org/modules/video/doc/motion_analysis_and_object_tracking.html#calcopticalflowsf">org.opencv.video.Video.calcOpticalFlowSF</a>  */     public static void calcOpticalFlowSF(Mat from, Mat to, Mat flow, int layers, int averaging_block_size, int max_flow)     {          calcOpticalFlowSF_0(from.nativeObj, to.nativeObj, flow.nativeObj, layers, averaging_block_size, max_flow);          return;     }       //     // C++:  void calcOpticalFlowSF(Mat from, Mat to, Mat flow, int layers, int averaging_block_size, int max_flow, double sigma_dist, double sigma_color, int postprocess_window, double sigma_dist_fix, double sigma_color_fix, double occ_thr, int upscale_averaging_radius, double upscale_sigma_dist, double upscale_sigma_color, double speed_up_thr)     //  /**  * <p>Calculate an optical flow using "SimpleFlow" algorithm.</p>  *  * <p>See [Tao0000]. And site of project - http://graphics.berkeley.edu/papers/Tao-SAN-0000-00/.</p>  *  * <p>Note:</p>  * <ul>  *   <li> An example using the simpleFlow algorithm can be found at  * opencv_source_code/samples/cpp/simpleflow_demo.cpp  * </ul>  *  * @param from a from  * @param to a to  * @param flow a flow  * @param layers Number of layers  * @param averaging_block_size Size of block through which we sum up when  * calculate cost function for pixel  * @param max_flow maximal flow that we search at each level  * 