00001 /* Copyright (C) 2005 Pierre Moisan (Pierre.Moisan@USherbrooke.ca) 00002 00003 This library is free software; you can redistribute it and/or 00004 modify it under the terms of the GNU Lesser General Public 00005 License as published by the Free Software Foundation; either 00006 version 2.1 of the License, or (at your option) any later version. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Lesser General Public License for more details. 00012 00013 You should have received a copy of the GNU Lesser General Public 00014 License along with this library; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00016 */ 00017 00018 #ifndef _PFPARTICLEFILTER_H_ 00019 #define _PFPARTICLEFILTER_H_ 00020 00021 #include "VisualTracker.h" 00022 #include "PFParticle.h" 00023 #include "PFUtilityFct.h" 00024 00025 namespace RobotFlow { 00026 00027 typedef enum 00028 { 00029 e_PF_GenericFilter = 0, 00030 e_PF_Unknown 00031 } e_PF_type; 00032 00033 // 00034 // Abstract base class for particle filter 00035 // 00036 00037 class PFParticleFilter : public VisualTracker 00038 { 00039 public: 00040 PFParticleFilter() 00041 : m_filterType(e_PF_Unknown) 00042 { 00043 00044 } 00045 00046 PFParticleFilter(e_PF_type i_modelType) 00047 : m_filterType(i_modelType) 00048 { 00049 } 00050 00051 PFParticleFilter(e_PF_type i_modelType, std::string nodeName, FD::ParameterSet params) 00052 : VisualTracker(nodeName, params), 00053 m_filterType(i_modelType) 00054 { 00055 00056 } 00057 00058 virtual ~PFParticleFilter() 00059 { 00060 00061 } 00062 00063 // Default routine to print a PFParticleFilter object to an output stream 00064 void printOn(std::ostream &out) const = 0; 00065 00066 // Default routine to read a PFParticleFilter object from an input stream 00067 void readFrom(std::istream &in) = 0; 00068 00069 void calculate(int output_id, int count, FD::Buffer &out) = 0; 00070 00071 e_PF_type GetType() const 00072 { 00073 return m_filterType; 00074 } 00075 00076 void SetType(e_PF_type i_type) 00077 { 00078 m_filterType = i_type; 00079 } 00080 00081 private: 00082 e_PF_type m_filterType; 00083 }; 00084 00085 } 00086 00087 #endif