00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef NPCLASSIFY_H_DEFINED
00040 #define NPCLASSIFY_H_DEFINED
00041
00042 #include <vector>
00043 #include "Util/readConfig.H"
00044
00045 class NPclassify
00046 {
00047 private:
00048 std::vector<long> children;
00049 std::vector<long> parent;
00050 std::vector<long> childMapTot;
00051 std::vector<long> childMapTotLast;
00052 std::vector<long> stem;
00053 std::vector<long> root;
00054 std::vector<long> master;
00055 std::vector<long> masterIndex;
00056 std::vector<long> classSize;
00057 std::vector<long> childInterCount;
00058 std::vector<long> idealLinks;
00059
00060 std::vector<double> density;
00061 std::vector<double> distance;
00062 std::vector<double> meanInterDistance;
00063 std::vector<double> meanInterChild;
00064 std::vector<double> meanInterDensity;
00065 std::vector<double> stdInterDistance;
00066 std::vector<double> stdInterDensity;
00067 std::vector<double> stdInterChild;
00068 std::vector<double> trainMeasure;
00069
00070 std::vector<bool> revStem;
00071 std::vector<bool> childMapDone;
00072 std::vector<bool> lowDensity;
00073 std::vector<bool> selected;
00074 std::vector< std::vector<long> > child;
00075 std::vector< std::vector<long> > childMap;
00076 std::vector< std::vector<long> > childInterMap;
00077 std::vector< std::vector<long> > Class;
00078 std::vector< std::vector<double> > D;
00079 std::vector< std::vector<double> > Dis;
00080 std::vector< std::vector<double> > Space;
00081 long spaceSize,stems,roots,iteration,defaultSize;
00082 long minDist,minChild;
00083 long hardClassSize,hardLinkSize;
00084 double distanceCut, childCut;
00085 double maxDensity,trainChildWeight;
00086 double Con1,Con2,Con3;
00087 double sumSquares,sum;
00088 double meanDistance,stdDistance,meanChildren,stdChildren;
00089 double meanChildMap,stdChildMap,meanDensity,stdDensity;
00090 double DWeight1, CWeight1, IDWeight1, ICWeight1;
00091 double DWeight2, CWeight2, IDWeight2, ICWeight2;
00092 double DenWeight1, DenWeight2, preDenWeight1, preDenWeight2;
00093 double thresh1,thresh2,thresh3,thresh4,measure1,measure2;
00094 bool notDone;
00095 double polyDensObjectCut1,polyDensObjectCut2,polyDensObjectCut3;
00096 double polySpaceChildCut1,polySpaceChildCut2,polySpaceChildCut3;
00097 bool CLS;
00098
00099
00100
00101
00102
00103 void convolveSpace();
00104
00105 void convolveSpace2();
00106
00107 void linkSpace();
00108
00109 void mapSpace();
00110
00111 void analizeSpace();
00112
00113 void evolveSpace();
00114
00115 void analizeInterSpace();
00116
00117 void evolveInterSpace();
00118
00119 void computeMasters();
00120
00121 void resizeSpace();
00122 public:
00123 int doLinkMap,doDensityMap,doClassMap,usePolySet;
00124
00125
00126
00127
00128 NPclassify(readConfig &settings, readConfig &polySet,
00129 bool commandLineSettings = false);
00130 ~NPclassify();
00131
00132 void inputCommandLineSettings(double _distance, double _children,
00133 double Idistance, double Ichildren,
00134 long _hardClassSize, long _hardLinkSize,
00135 double _polyDensObjectCut1,
00136 double _polyDensObjectCut2,
00137 double _polyDensObjectCut3);
00138
00139 void addPoint(std::vector<long> point);
00140
00141
00142
00143
00144
00145
00146 void addSpace(std::vector<std::vector<double> > &space,long sSize = 0);
00147
00148 void echoSpace();
00149
00150 void resetSpace();
00151
00152 void classifySpaceNew();
00153
00154 void classifySpaceKmeans(unsigned int K);
00155
00156 void classifySpacePartial();
00157
00158 long getStemNumber();
00159
00160 double getMaxDensity();
00161
00162 bool isLowDensity(long item);
00163
00164 bool isStem(long item);
00165
00166 std::vector<double> getDensity();
00167
00168 std::vector<long> getStems();
00169
00170 long getClassSize(long _Class);
00171
00172 long getMinClassSize();
00173
00174 std::vector<long> getClass(long _Class);
00175
00176 long getClass(long _Class, long item);
00177
00178 double getFeature(long m_feature_index, long n_vector_index);
00179
00180 std::vector<long> getParents();
00181
00182 std::vector<std::vector<long> > getChildren();
00183
00184 std::vector<std::vector<long> > getBoundingBoxes();
00185
00186 void metaClassify(int objects);
00187 };
00188
00189 #endif
00190
00191
00192
00193
00194
00195
00196