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 _MEANSHIFTTRACKER_H_ 00019 #define _MEANSHIFTTRACKER_H_ 00020 00021 #include "VisualTracker.h" 00022 00023 namespace RobotFlow { 00024 00025 class MeanShiftTracker : public VisualTracker 00026 { 00027 public: 00028 MeanShiftTracker(); 00029 00030 MeanShiftTracker(int i_maxNumMSIter, double i_minMSDistEpsilon); 00031 00032 MeanShiftTracker(std::string nodeName, FD::ParameterSet params); 00033 00034 virtual ~MeanShiftTracker(); 00035 00036 // Default routine to print a MeanShiftTracker object to an output stream 00037 void printOn(std::ostream &out) const 00038 { 00039 throw new FD::GeneralException("Exception in MeanShiftTracker::printOn: method not yet implemented.",__FILE__,__LINE__); 00040 } 00041 00042 // Default routine to read a MeanShiftTracker object from an input stream 00043 void readFrom(std::istream &in) 00044 { 00045 throw new FD::GeneralException("Exception in MeanShiftTracker::printOn: method not yet implemented.",__FILE__,__LINE__); 00046 } 00047 00048 virtual void request(int output_id, const FD::ParameterSet &req); 00049 00050 void calculate(int output_id, int count, FD::Buffer &out); 00051 00052 private: 00053 // Input IDs (for BufferedNode) 00054 int m_imageInID; 00055 int m_targetInID; 00056 int m_msLocVecInID; 00057 int m_ppCompletedInID; 00058 00059 // Output IDs (for BufferedNode) 00060 int m_finishedOutID; 00061 int m_imageOutID; 00062 int m_curTargetOutID; 00063 int m_targetOutID; 00064 00065 int m_width; 00066 int m_height; 00067 int m_numChannels; 00068 int m_numPixels; 00069 int m_numBytesInFrame; 00070 00071 int m_numIter; 00072 int m_maxNumMSIter; 00073 double m_minMSDistEpsilon; 00074 00075 bool m_finished; 00076 bool m_initMS; 00077 00078 VisualTarget<double> *m_curTarget; 00079 00080 // Temporary image copy 00081 IplImage *m_curImage; 00082 }; 00083 00084 } 00085 00086 #endif