Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: RZ_A2M_Mbed_samples
optical_flow.hpp
00001 /*M/////////////////////////////////////////////////////////////////////////////////////// 00002 // 00003 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 00004 // 00005 // By downloading, copying, installing or using the software you agree to this license. 00006 // If you do not agree to this license, do not download, install, 00007 // copy or use the software. 00008 // 00009 // 00010 // License Agreement 00011 // For Open Source Computer Vision Library 00012 // 00013 // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 00014 // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 00015 // Third party copyrights are property of their respective owners. 00016 // 00017 // Redistribution and use in source and binary forms, with or without modification, 00018 // are permitted provided that the following conditions are met: 00019 // 00020 // * Redistribution's of source code must retain the above copyright notice, 00021 // this list of conditions and the following disclaimer. 00022 // 00023 // * Redistribution's in binary form must reproduce the above copyright notice, 00024 // this list of conditions and the following disclaimer in the documentation 00025 // and/or other materials provided with the distribution. 00026 // 00027 // * The name of the copyright holders may not be used to endorse or promote products 00028 // derived from this software without specific prior written permission. 00029 // 00030 // This software is provided by the copyright holders and contributors "as is" and 00031 // any express or implied warranties, including, but not limited to, the implied 00032 // warranties of merchantability and fitness for a particular purpose are disclaimed. 00033 // In no event shall the Intel Corporation or contributors be liable for any direct, 00034 // indirect, incidental, special, exemplary, or consequential damages 00035 // (including, but not limited to, procurement of substitute goods or services; 00036 // loss of use, data, or profits; or business interruption) however caused 00037 // and on any theory of liability, whether in contract, strict liability, 00038 // or tort (including negligence or otherwise) arising in any way out of 00039 // the use of this software, even if advised of the possibility of such damage. 00040 // 00041 //M*/ 00042 00043 #ifndef OPENCV_SUPERRES_OPTICAL_FLOW_HPP 00044 #define OPENCV_SUPERRES_OPTICAL_FLOW_HPP 00045 00046 #include "opencv2/core.hpp" 00047 00048 namespace cv 00049 { 00050 namespace superres 00051 { 00052 00053 //! @addtogroup superres 00054 //! @{ 00055 00056 class CV_EXPORTS DenseOpticalFlowExt : public cv::Algorithm 00057 { 00058 public: 00059 virtual void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2 = noArray()) = 0; 00060 virtual void collectGarbage() = 0; 00061 }; 00062 00063 00064 class CV_EXPORTS FarnebackOpticalFlow : public virtual DenseOpticalFlowExt 00065 { 00066 public: 00067 /** @see setPyrScale */ 00068 virtual double getPyrScale() const = 0; 00069 /** @copybrief getPyrScale @see getPyrScale */ 00070 virtual void setPyrScale(double val) = 0; 00071 /** @see setLevelsNumber */ 00072 virtual int getLevelsNumber() const = 0; 00073 /** @copybrief getLevelsNumber @see getLevelsNumber */ 00074 virtual void setLevelsNumber(int val) = 0; 00075 /** @see setWindowSize */ 00076 virtual int getWindowSize() const = 0; 00077 /** @copybrief getWindowSize @see getWindowSize */ 00078 virtual void setWindowSize(int val) = 0; 00079 /** @see setIterations */ 00080 virtual int getIterations() const = 0; 00081 /** @copybrief getIterations @see getIterations */ 00082 virtual void setIterations(int val) = 0; 00083 /** @see setPolyN */ 00084 virtual int getPolyN() const = 0; 00085 /** @copybrief getPolyN @see getPolyN */ 00086 virtual void setPolyN(int val) = 0; 00087 /** @see setPolySigma */ 00088 virtual double getPolySigma() const = 0; 00089 /** @copybrief getPolySigma @see getPolySigma */ 00090 virtual void setPolySigma(double val) = 0; 00091 /** @see setFlags */ 00092 virtual int getFlags() const = 0; 00093 /** @copybrief getFlags @see getFlags */ 00094 virtual void setFlags(int val) = 0; 00095 }; 00096 CV_EXPORTS Ptr<FarnebackOpticalFlow> createOptFlow_Farneback(); 00097 CV_EXPORTS Ptr<FarnebackOpticalFlow> createOptFlow_Farneback_CUDA(); 00098 00099 00100 // CV_EXPORTS Ptr<DenseOpticalFlowExt> createOptFlow_Simple(); 00101 00102 00103 class CV_EXPORTS DualTVL1OpticalFlow : public virtual DenseOpticalFlowExt 00104 { 00105 public: 00106 /** @see setTau */ 00107 virtual double getTau() const = 0; 00108 /** @copybrief getTau @see getTau */ 00109 virtual void setTau(double val) = 0; 00110 /** @see setLambda */ 00111 virtual double getLambda() const = 0; 00112 /** @copybrief getLambda @see getLambda */ 00113 virtual void setLambda(double val) = 0; 00114 /** @see setTheta */ 00115 virtual double getTheta() const = 0; 00116 /** @copybrief getTheta @see getTheta */ 00117 virtual void setTheta(double val) = 0; 00118 /** @see setScalesNumber */ 00119 virtual int getScalesNumber() const = 0; 00120 /** @copybrief getScalesNumber @see getScalesNumber */ 00121 virtual void setScalesNumber(int val) = 0; 00122 /** @see setWarpingsNumber */ 00123 virtual int getWarpingsNumber() const = 0; 00124 /** @copybrief getWarpingsNumber @see getWarpingsNumber */ 00125 virtual void setWarpingsNumber(int val) = 0; 00126 /** @see setEpsilon */ 00127 virtual double getEpsilon() const = 0; 00128 /** @copybrief getEpsilon @see getEpsilon */ 00129 virtual void setEpsilon(double val) = 0; 00130 /** @see setIterations */ 00131 virtual int getIterations() const = 0; 00132 /** @copybrief getIterations @see getIterations */ 00133 virtual void setIterations(int val) = 0; 00134 /** @see setUseInitialFlow */ 00135 virtual bool getUseInitialFlow() const = 0; 00136 /** @copybrief getUseInitialFlow @see getUseInitialFlow */ 00137 virtual void setUseInitialFlow(bool val) = 0; 00138 }; 00139 CV_EXPORTS Ptr<DualTVL1OpticalFlow> createOptFlow_DualTVL1(); 00140 CV_EXPORTS Ptr<DualTVL1OpticalFlow> createOptFlow_DualTVL1_CUDA(); 00141 00142 00143 class CV_EXPORTS BroxOpticalFlow : public virtual DenseOpticalFlowExt 00144 { 00145 public: 00146 //! @brief Flow smoothness 00147 /** @see setAlpha */ 00148 virtual double getAlpha() const = 0; 00149 /** @copybrief getAlpha @see getAlpha */ 00150 virtual void setAlpha(double val) = 0; 00151 //! @brief Gradient constancy importance 00152 /** @see setGamma */ 00153 virtual double getGamma() const = 0; 00154 /** @copybrief getGamma @see getGamma */ 00155 virtual void setGamma(double val) = 0; 00156 //! @brief Pyramid scale factor 00157 /** @see setScaleFactor */ 00158 virtual double getScaleFactor() const = 0; 00159 /** @copybrief getScaleFactor @see getScaleFactor */ 00160 virtual void setScaleFactor(double val) = 0; 00161 //! @brief Number of lagged non-linearity iterations (inner loop) 00162 /** @see setInnerIterations */ 00163 virtual int getInnerIterations() const = 0; 00164 /** @copybrief getInnerIterations @see getInnerIterations */ 00165 virtual void setInnerIterations(int val) = 0; 00166 //! @brief Number of warping iterations (number of pyramid levels) 00167 /** @see setOuterIterations */ 00168 virtual int getOuterIterations() const = 0; 00169 /** @copybrief getOuterIterations @see getOuterIterations */ 00170 virtual void setOuterIterations(int val) = 0; 00171 //! @brief Number of linear system solver iterations 00172 /** @see setSolverIterations */ 00173 virtual int getSolverIterations() const = 0; 00174 /** @copybrief getSolverIterations @see getSolverIterations */ 00175 virtual void setSolverIterations(int val) = 0; 00176 }; 00177 CV_EXPORTS Ptr<BroxOpticalFlow> createOptFlow_Brox_CUDA(); 00178 00179 00180 class PyrLKOpticalFlow : public virtual DenseOpticalFlowExt 00181 { 00182 public: 00183 /** @see setWindowSize */ 00184 virtual int getWindowSize() const = 0; 00185 /** @copybrief getWindowSize @see getWindowSize */ 00186 virtual void setWindowSize(int val) = 0; 00187 /** @see setMaxLevel */ 00188 virtual int getMaxLevel() const = 0; 00189 /** @copybrief getMaxLevel @see getMaxLevel */ 00190 virtual void setMaxLevel(int val) = 0; 00191 /** @see setIterations */ 00192 virtual int getIterations() const = 0; 00193 /** @copybrief getIterations @see getIterations */ 00194 virtual void setIterations(int val) = 0; 00195 }; 00196 CV_EXPORTS Ptr<PyrLKOpticalFlow> createOptFlow_PyrLK_CUDA(); 00197 00198 //! @} 00199 00200 } 00201 } 00202 00203 #endif // OPENCV_SUPERRES_OPTICAL_FLOW_HPP
Generated on Tue Jul 12 2022 18:20:19 by
1.7.2