00001 /*!@file VFAT/getImageStats.C simplified version of vision.C with feature analysis 00002 */ 00003 00004 // //////////////////////////////////////////////////////////////////// // 00005 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2001 by the // 00006 // University of Southern California (USC) and the iLab at USC. // 00007 // See http://iLab.usc.edu for information about this project. // 00008 // //////////////////////////////////////////////////////////////////// // 00009 // Major portions of the iLab Neuromorphic Vision Toolkit are protected // 00010 // under the U.S. patent ``Computation of Intrinsic Perceptual Saliency // 00011 // in Visual Environments, and Applications'' by Christof Koch and // 00012 // Laurent Itti, California Institute of Technology, 2001 (patent // 00013 // pending; application number 09/912,225 filed July 23, 2001; see // 00014 // http://pair.uspto.gov/cgi-bin/final/home.pl for current status). // 00015 // //////////////////////////////////////////////////////////////////// // 00016 // This file is part of the iLab Neuromorphic Vision C++ Toolkit. // 00017 // // 00018 // The iLab Neuromorphic Vision C++ Toolkit is free software; you can // 00019 // redistribute it and/or modify it under the terms of the GNU General // 00020 // Public License as published by the Free Software Foundation; either // 00021 // version 2 of the License, or (at your option) any later version. // 00022 // // 00023 // The iLab Neuromorphic Vision C++ Toolkit is distributed in the hope // 00024 // that it will be useful, but WITHOUT ANY WARRANTY; without even the // 00025 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // 00026 // PURPOSE. See the GNU General Public License for more details. // 00027 // // 00028 // You should have received a copy of the GNU General Public License // 00029 // along with the iLab Neuromorphic Vision C++ Toolkit; if not, write // 00030 // to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, // 00031 // Boston, MA 02111-1307 USA. // 00032 // //////////////////////////////////////////////////////////////////// // 00033 // 00034 // Primary maintainer for this file: T. Nathan Mundhenk <mundhenk@usc.edu> 00035 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/VFAT/getImageStats.C $ 00036 // $Id: getImageStats.C 6383 2006-03-24 00:39:47Z rjpeters $ 00037 // 00038 // ############################################################ 00039 // ############################################################ 00040 // ##### --- VFAT --- 00041 // ##### Vision Feature Analysis Tool: 00042 // ##### T. Nathan Mundhenk nathan@mundhenk.com 00043 // ##### Laurent Itti itti@pollux.usc.edu 00044 // ##### 00045 // ############################################################ 00046 // ############################################################ 00047 00048 #include "Component/ModelManager.H" 00049 #include "Media/FrameSeries.H" 00050 #include "Neuro/StdBrain.H" 00051 #include "VFAT/featureClusterVision.H" 00052 00053 int main(const int argc, const char **argv) 00054 { 00055 MYLOGVERB = LOG_INFO; // suppress debug messages 00056 00057 // Instantiate a ModelManager: 00058 ModelManager manager("Super Model"); 00059 00060 nub::soft_ref<InputFrameSeries> ifs(new InputFrameSeries(manager)); 00061 manager.addSubComponent(ifs); 00062 00063 nub::soft_ref<StdBrain> brain(new StdBrain(manager)); 00064 manager.addSubComponent(brain); 00065 00066 // feature analysis part of model 00067 const std::string name = "featureCluster"; 00068 const std::string tag = "fCV"; 00069 00070 00071 if (manager.parseCommandLine(argc, argv, 00072 "<image> <maskFile> <outFile> <label>", 00073 4, 4) == false) 00074 return 1; 00075 std::string maskFile = argv[2]; 00076 std::string imageFile = argv[1]; 00077 std::string outFile = argv[3]; 00078 std::string label = argv[4]; 00079 00080 LINFO("RUNNING with %s %s %s %s",maskFile.c_str(), 00081 imageFile.c_str(), outFile.c_str(),label.c_str()); 00082 00083 nub::soft_ref<featureClusterVision<float> > 00084 fCV(new featureClusterVision<float>(manager,name,tag,brain,ifs, 00085 manager.getExtraArg(0))); 00086 manager.addSubComponent(fCV); 00087 00088 /* Q: What happened to my getExtraArg() for my input/output? 00089 00090 A: See docs at the head of src/Media/FrameSeries.H 00091 */ 00092 00093 // let's get all our ModelComponent instances started: 00094 manager.start(); 00095 00096 LINFO("RUNNING SIMPLE FEATURES"); 00097 fCV->fCVgetImageBaseStats(maskFile,imageFile,outFile,label); 00098 LINFO("RUNNING COMPLEX FEATURES"); 00099 fCV->fCVgetImageComplexStats(maskFile,imageFile,outFile,label); 00100 00101 }