TarzaNN
TarzaNN neural network simulator
C:/Users/albertlr/projects/TarzaNN/TarzaNN/SOMGeomDataset.h
Go to the documentation of this file.
00001 /****************************************************************************
00002  **
00003  ** Copyright C 2002-2012 Laboratory for Active and Attentive Vision (LAAV), Department of Computer Science and Engineering, York University, Toronto, ON, Canada.
00004  ** All rights reserved.
00005  **
00006  ** This file is part of the TarzaNN Neural Network Simulator.
00007  **
00008  ** This file may be distributed and/or modified under the terms of the
00009  ** GNU General Public License version 2 as published by the Free Software
00010  ** Foundation and appearing in the file LICENSE.GPL included in the
00011  ** packaging of this file.
00012  **
00013  ** See http://www.tarzann.org/gpl/ for GPL licensing information.
00014  **
00015  ** Contact info@tarzann.org if any conditions of this licensing are
00016  ** not clear to you.
00017  **
00018  ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00019  ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00020  **
00021  ****************************************************************************/
00022 
00023 #ifndef SOMGeomDataset_H_INCLUDED
00024 #define SOMGeomDataset_H_INCLUDED
00025 
00026 #include <vector>
00027 using namespace std;
00028 #include "Dataset.h"
00029 #include <QDir>
00030 
00031 #define FULL_IMAGE_SIZE_X 166
00032 #define FULL_IMAGE_SIZE_Y 166
00033 
00034 #define COIL_IMAGE_SIZE_X 128
00035 #define COIL_IMAGE_SIZE_Y 128
00036 
00037 #define MAX_OBJECTS 100
00038 #define MAX_ANGLES 71
00039 #define ANGLE_INCREMENT 5
00040 
00041 class CurrentImage;
00042 
00043 //Dataset for SOM learning.
00044 class SOM_GeomDataset : public Dataset {
00045         
00046 private:
00047         long imageBaseOffset;
00048         long imageSize;
00049         FILE* imageFile;
00050         char* currentfileName;
00051         QFileInfoList fileList;
00052         Matrix* result;
00053 
00054     float RandomFloat(float min, float max);
00055 
00056     QMutex dataPrep;
00058     CurrentImage* currentImage;
00059     void goToNextStep();
00060 
00061 public:
00063         SOM_GeomDataset(char* basefilename);
00064         ~SOM_GeomDataset();
00066         OutputImage* getImage(int index, OutputImage** list, int LorR=0);
00068         Matrix* getDesiredOutcome(int index);
00070         int getRandomIndex();
00071 };
00072 #endif/*SOMGeomDataset_H_INCLUDED*/
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines