// DLMSimilarity.h // ==== control variables ========================================== ; #define PREFERRED 1 #define NEXT 2 #define RANDOM 3 const int gallerySizeMax0 = 5+1; // maximal possible size of the gallery + 1 ; extern int maxGallerySize; // actual maximal simulated gallery size ; // in order to avoid multiple mem allocation ; const int gallerySizeMax = 5+1; /* For objects and models there are stored graphs with the precomputed Gabor-wavelet transform coefficients. For the models they are taken from a grid of 10 x 10 nodes centered on the faces. For the objects the grids cover the whole image plane with 16 x 17 nodes. From these stored graphs a subgraph can be selected. From the 16 x 17 graph for example a 12 x 12 subgraph will automatically be selected if the size of layer 1 is 12 x 12. In addition one can choose the location of the subgraph by the offsets Si1offset, ... , and Sj2offset. They are given as integer numbers behind the model names in the gallery files. */ class DLMSimilarity : public NslModule { public: NslDoutFloat4 S21[gallerySizeMax]; // similarity matrix from layer 1 to layers 2 ; private: NslFloat4 showS21; // for display purposes only ; // int gallerySizeMax; int frame; // width of the frame around layer 1 int i1max; // size of the image layer 1, including frame; int j1max; int i2max; // size of the model layers 2 ; int j2max; int i1Rmax; // size of the projection patches .. ; int j1Rmax; // ... from model layer 2 to image layer 1 ; int Si2offset, Sj2offset, Si1offset, Sj1offset, Oi1offset, Oj1offset; int selectedObject; nsl_string objectsFileName; nsl_string modelsFileName; nsl_string objectName; // name of the image graph file ; int kLevels, kDirections; int kLevelsTmp, kDirectionsTmp; float kMaximum, kFactor, sigma; float kMaximumTmp, kFactorTmp, sigmaTmp; int tablesCreated; float *kxArr; float *kyArr; float *confidenceBak; float *deltaPhaseBak; NslFloat0 ObjectSelectionMode; NslFloat0 preferredObject; NslFloat0 alpha_S; // minimal synaptic weight ; char* modelName[gallerySizeMax0]; // names of model graph files ; public: DLMSimilarity(nsl_string,NslModule*); ~DLMSimilarity() {} void initModule(); void memAlloc(int,int,int,int,int,int,int,int); void initSysTemp(NslFloat0&,NslFloat0&); void initRunTemp(NslFloat0&); void createTables(); float similarity(float*, float*); };