class cv::cuda::SparsePyrLKOpticalFlow

Overview

Class used for calculating a sparse optical flow. Moreā€¦

#include <cudaoptflow.hpp>

class SparsePyrLKOpticalFlow: public cv::cuda::SparseOpticalFlow
{
public:
    // methods

    virtual
    int
    getMaxLevel() const = 0;

    virtual
    int
    getNumIters() const = 0;

    virtual
    bool
    getUseInitialFlow() const = 0;

    virtual
    Size
    getWinSize() const = 0;

    virtual
    void
    setMaxLevel(int maxLevel) = 0;

    virtual
    void
    setNumIters(int iters) = 0;

    virtual
    void
    setUseInitialFlow(bool useInitialFlow) = 0;

    virtual
    void
    setWinSize(Size winSize) = 0;

    static
    Ptr<SparsePyrLKOpticalFlow>
    create(
        Size winSize = Size(21, 21),
        int maxLevel = 3,
        int iters = 30,
        bool useInitialFlow = false
        );
};

Inherited Members

public:
    // methods

    virtual
    void
    clear();

    virtual
    bool
    empty() const;

    virtual
    String
    getDefaultName() const;

    virtual
    void
    read(const FileNode& fn);

    virtual
    void
    save(const String& filename) const;

    virtual
    void
    write(FileStorage& fs) const;

    template <typename _Tp>
    static
    Ptr<_Tp>
    load(
        const String& filename,
        const String& objname = String()
        );

    template <typename _Tp>
    static
    Ptr<_Tp>
    loadFromString(
        const String& strModel,
        const String& objname = String()
        );

    template <typename _Tp>
    static
    Ptr<_Tp>
    read(const FileNode& fn);

    virtual
    void
    calc(
        InputArray prevImg,
        InputArray nextImg,
        InputArray prevPts,
        InputOutputArray nextPts,
        OutputArray status,
        OutputArray err = cv::noArray(),
        Stream& stream = Stream::Null()
        ) = 0;

protected:
    // methods

    void
    writeFormat(FileStorage& fs) const;

Detailed Documentation

Class used for calculating a sparse optical flow.

The class can calculate an optical flow for a sparse feature set using the iterative Lucas-Kanade method with pyramids.

  • An example of the Lucas Kanade optical flow algorithm can be found at opencv_source_code/samples/gpu/pyrlk_optical_flow.cpp

See also:

calcOpticalFlowPyrLK