Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * sift.h - Feature-based classifier using OpenCV structures 00004 * 00005 * Created: Mon Mar 15 15:47:11 2008 00006 * Copyright 2008 Stefan Schiffer [stefanschiffer.de] 00007 * 00008 ****************************************************************************/ 00009 00010 /* This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. A runtime exception applies to 00014 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Library General Public License for more details. 00020 * 00021 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00022 */ 00023 00024 #ifndef __FIREVISION_CLASSIFIERS_SIFT_H_ 00025 #define __FIREVISION_CLASSIFIERS_SIFT_H_ 00026 00027 #ifndef HAVE_SIFT 00028 # error SIFT not available, you may not use the SiftClassifier 00029 #endif 00030 00031 #include <fvclassifiers/classifier.h> 00032 00033 //#ifdef FEAT_TIMETRACKER 00034 namespace fawkes { 00035 class TimeTracker; 00036 } 00037 //#endif 00038 00039 struct CvMemStorage; 00040 typedef struct _IplImage IplImage; 00041 00042 struct feature; 00043 00044 namespace firevision { 00045 #if 0 /* just to make Emacs auto-indent happy */ 00046 } 00047 #endif 00048 class SiftClassifier : public Classifier 00049 { 00050 public: 00051 SiftClassifier(const char * features_file, 00052 unsigned int pixel_width, unsigned int pixel_height, 00053 int kdtree_bbf_max_nn_chks = 200, float nn_sq_dist_ratio_thr = 0.49, int flags = 0); 00054 00055 virtual ~SiftClassifier(); 00056 00057 virtual std::list< ROI > * classify(); 00058 00059 private: 00060 00061 const char ** __features_files; 00062 00063 IplImage *__obj_img; 00064 feature *__obj_features; 00065 int __obj_num_features; 00066 00067 CvMemStorage *__storage; 00068 IplImage *__image; 00069 00070 feature* __img_features; 00071 00072 float __nn_sq_dist_ratio_thr; 00073 int __kdtree_bbf_max_nn_chks; 00074 int __flags; 00075 00076 //#ifdef FEAT_TIMETRACKER 00077 fawkes::TimeTracker *__tt; 00078 unsigned int __loop_count; 00079 unsigned int __ttc_objconv; 00080 unsigned int __ttc_objfeat; 00081 unsigned int __ttc_imgconv; 00082 unsigned int __ttc_imgfeat; 00083 unsigned int __ttc_matchin; 00084 unsigned int __ttc_roimerg; 00085 //#endif 00086 00087 }; 00088 00089 } // end namespace firevision 00090 00091 #endif