123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364 |
- #ifndef __OPENCV_OPTFLOW_HPP__
- #define __OPENCV_OPTFLOW_HPP__
- #include "opencv2/core.hpp"
- #include "opencv2/video.hpp"
- #include "opencv2/optflow/pcaflow.hpp"
- #include "opencv2/optflow/sparse_matching_gpc.hpp"
- namespace cv
- {
- namespace optflow
- {
-
- CV_EXPORTS_W void calcOpticalFlowSF( InputArray from, InputArray to, OutputArray flow,
- int layers, int averaging_block_size, int max_flow);
- CV_EXPORTS_W void calcOpticalFlowSF( InputArray from, InputArray to, OutputArray 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 );
- CV_EXPORTS_W void calcOpticalFlowSparseToDense ( InputArray from, InputArray to, OutputArray flow,
- int grid_step = 8, int k = 128, float sigma = 0.05f,
- bool use_post_proc = true, float fgs_lambda = 500.0f,
- float fgs_sigma = 1.5f );
- CV_EXPORTS_W Mat readOpticalFlow( const String& path );
- CV_EXPORTS_W bool writeOpticalFlow( const String& path, InputArray flow );
- class CV_EXPORTS_W VariationalRefinement : public DenseOpticalFlow
- {
- public:
-
- CV_WRAP virtual void calcUV(InputArray I0, InputArray I1, InputOutputArray flow_u, InputOutputArray flow_v) = 0;
-
- CV_WRAP virtual int getFixedPointIterations() const = 0;
-
- CV_WRAP virtual void setFixedPointIterations(int val) = 0;
-
- CV_WRAP virtual int getSorIterations() const = 0;
-
- CV_WRAP virtual void setSorIterations(int val) = 0;
-
- CV_WRAP virtual float getOmega() const = 0;
-
- CV_WRAP virtual void setOmega(float val) = 0;
-
- CV_WRAP virtual float getAlpha() const = 0;
-
- CV_WRAP virtual void setAlpha(float val) = 0;
-
- CV_WRAP virtual float getDelta() const = 0;
-
- CV_WRAP virtual void setDelta(float val) = 0;
-
- CV_WRAP virtual float getGamma() const = 0;
-
- CV_WRAP virtual void setGamma(float val) = 0;
- };
- CV_EXPORTS_W Ptr<VariationalRefinement> createVariationalFlowRefinement();
- CV_EXPORTS_W Ptr<DenseOpticalFlow> createOptFlow_DeepFlow();
- CV_EXPORTS_W Ptr<DenseOpticalFlow> createOptFlow_SimpleFlow();
- CV_EXPORTS_W Ptr<DenseOpticalFlow> createOptFlow_Farneback();
- CV_EXPORTS_W Ptr<DenseOpticalFlow> createOptFlow_SparseToDense();
- class CV_EXPORTS_W DISOpticalFlow : public DenseOpticalFlow
- {
- public:
- enum
- {
- PRESET_ULTRAFAST = 0,
- PRESET_FAST = 1,
- PRESET_MEDIUM = 2
- };
-
- CV_WRAP virtual int getFinestScale() const = 0;
-
- CV_WRAP virtual void setFinestScale(int val) = 0;
-
- CV_WRAP virtual int getPatchSize() const = 0;
-
- CV_WRAP virtual void setPatchSize(int val) = 0;
-
- CV_WRAP virtual int getPatchStride() const = 0;
-
- CV_WRAP virtual void setPatchStride(int val) = 0;
-
- CV_WRAP virtual int getGradientDescentIterations() const = 0;
-
- CV_WRAP virtual void setGradientDescentIterations(int val) = 0;
-
- CV_WRAP virtual int getVariationalRefinementIterations() const = 0;
-
- CV_WRAP virtual void setVariationalRefinementIterations(int val) = 0;
-
- CV_WRAP virtual float getVariationalRefinementAlpha() const = 0;
-
- CV_WRAP virtual void setVariationalRefinementAlpha(float val) = 0;
-
- CV_WRAP virtual float getVariationalRefinementDelta() const = 0;
-
- CV_WRAP virtual void setVariationalRefinementDelta(float val) = 0;
-
- CV_WRAP virtual float getVariationalRefinementGamma() const = 0;
-
- CV_WRAP virtual void setVariationalRefinementGamma(float val) = 0;
-
- CV_WRAP virtual bool getUseMeanNormalization() const = 0;
-
- CV_WRAP virtual void setUseMeanNormalization(bool val) = 0;
-
- CV_WRAP virtual bool getUseSpatialPropagation() const = 0;
-
- CV_WRAP virtual void setUseSpatialPropagation(bool val) = 0;
- };
- CV_EXPORTS_W Ptr<DISOpticalFlow> createOptFlow_DIS(int preset = DISOpticalFlow::PRESET_FAST);
- }
- }
- #include "opencv2/optflow/motempl.hpp"
- #endif
|