001//
002// This file is auto-generated. Please don't modify it!
003//
004package org.opencv.video;
005
006import org.opencv.core.Algorithm;
007import org.opencv.core.Mat;
008
009// C++: class SparseOpticalFlow
010/**
011 * Base interface for sparse optical flow algorithms.
012 */
013public class SparseOpticalFlow extends Algorithm {
014
015    protected SparseOpticalFlow(long addr) { super(addr); }
016
017    // internal usage only
018    public static SparseOpticalFlow __fromPtr__(long addr) { return new SparseOpticalFlow(addr); }
019
020    //
021    // C++:  void cv::SparseOpticalFlow::calc(Mat prevImg, Mat nextImg, Mat prevPts, Mat& nextPts, Mat& status, Mat& err = cv::Mat())
022    //
023
024    /**
025     * Calculates a sparse optical flow.
026     *
027     *     @param prevImg First input image.
028     *     @param nextImg Second input image of the same size and the same type as prevImg.
029     *     @param prevPts Vector of 2D points for which the flow needs to be found.
030     *     @param nextPts Output vector of 2D points containing the calculated new positions of input features in the second image.
031     *     @param status Output status vector. Each element of the vector is set to 1 if the
032     *                   flow for the corresponding features has been found. Otherwise, it is set to 0.
033     *     @param err Optional output vector that contains error response for each point (inverse confidence).
034     */
035    public void calc(Mat prevImg, Mat nextImg, Mat prevPts, Mat nextPts, Mat status, Mat err) {
036        calc_0(nativeObj, prevImg.nativeObj, nextImg.nativeObj, prevPts.nativeObj, nextPts.nativeObj, status.nativeObj, err.nativeObj);
037    }
038
039    /**
040     * Calculates a sparse optical flow.
041     *
042     *     @param prevImg First input image.
043     *     @param nextImg Second input image of the same size and the same type as prevImg.
044     *     @param prevPts Vector of 2D points for which the flow needs to be found.
045     *     @param nextPts Output vector of 2D points containing the calculated new positions of input features in the second image.
046     *     @param status Output status vector. Each element of the vector is set to 1 if the
047     *                   flow for the corresponding features has been found. Otherwise, it is set to 0.
048     */
049    public void calc(Mat prevImg, Mat nextImg, Mat prevPts, Mat nextPts, Mat status) {
050        calc_1(nativeObj, prevImg.nativeObj, nextImg.nativeObj, prevPts.nativeObj, nextPts.nativeObj, status.nativeObj);
051    }
052
053
054    @Override
055    protected void finalize() throws Throwable {
056        delete(nativeObj);
057    }
058
059
060
061    // C++:  void cv::SparseOpticalFlow::calc(Mat prevImg, Mat nextImg, Mat prevPts, Mat& nextPts, Mat& status, Mat& err = cv::Mat())
062    private static native void calc_0(long nativeObj, long prevImg_nativeObj, long nextImg_nativeObj, long prevPts_nativeObj, long nextPts_nativeObj, long status_nativeObj, long err_nativeObj);
063    private static native void calc_1(long nativeObj, long prevImg_nativeObj, long nextImg_nativeObj, long prevPts_nativeObj, long nextPts_nativeObj, long status_nativeObj);
064
065    // native support for java finalize()
066    private static native void delete(long nativeObj);
067
068}