00001 /* 00002 This file is part of Cali Cam. 00003 00004 Cali Cam is free software: you can redistribute it and/or modify 00005 it under the terms of the GNU General Public License as published by 00006 the Free Software Foundation, either version 3 of the License, or 00007 (at your option) any later version. 00008 00009 Cali Cam is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with Cali Cam. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 //class Waldo, Waldo.h 00018 //used in Points::reduce 00019 //manages many functions of the reduction 00020 //deletes appropriate nodes/rows/columns in the associated list and matrix 00021 //keeps information on the smallest and second smallest entries in a matrix columns 00022 //has room for run time speed improvement 00023 00024 //perhaps Matrix should be used entirely in here... 00025 #pragma once 00026 #include "PointList.h" 00027 #include "Matrix.h" 00028 #include "waNode.h" 00029 namespace Recognition{ 00035 class Waldo{ 00036 waNode **wn; 00037 int size; 00038 int maxSize; 00040 Matrix *mat; 00042 PointList *pl; 00043 00044 public: 00045 Waldo(PointList *,Matrix *); 00046 ~Waldo(void); 00047 void del(int); 00048 void getMins(int, float &,float &); 00049 int gSize(){return size;}; 00050 float gSum(int index){ 00051 return mat->sum(wn[index]->mn); 00052 } 00053 float avegMin(){ 00054 double temp=0; 00055 for(int i=0;i<size;i++) 00056 temp+=wn[i]->min1; 00057 temp=temp/size; 00058 return temp; 00059 } 00060 00061 }; 00062 }