CINNICinteract.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "CINNIC/CINNIC.H"
00016 #include "CINNIC/cascadeHold.H"
00017 #include "Util/log.H"
00018 #include "Util/readConfig.H"
00019 #include <iostream>
00020 #include <sstream>
00021 #include <stdlib.h>
00022 #include <sys/types.h>
00023 #include <time.h>
00024 #include <cstdio>
00025
00026
00027
00028
00029
00030 ContourNeuronCreate<float> CINNICreate;
00031
00032 CINNIC skeptic;
00033
00034 std::istream* argInput;
00035
00036 const char* configFile;
00037
00038 readConfig configIn(25);
00039
00040
00041
00042
00043
00044
00045
00046
00047 int main(int argc, char* argv[])
00048 {
00049 time_t t1,t2;
00050 (void) time(&t1);
00051
00052 if(argc > 3)
00053 {
00054 configFile = argv[3];
00055 }
00056 else
00057 {
00058 configFile = "contour.conf";
00059 }
00060 skeptic.filename = "noName";
00061 LINFO("LOADING CONFIG FILE");
00062 configIn.openFile(configFile);
00063 for(int i = 0; configIn.readFileTrue(i); i++)
00064 {
00065 std::cout << configIn.readFileValueName(i) << ":" << configIn.readFileValueF(i) << "\n";
00066 }
00067 LINFO("Starting CINNIC interaction\n");
00068 CINNICreate.CreateNeuron(configIn);
00069 LINFO("CINNIC template Neuron copied, ready for use");
00070
00071 if(argc > 2)
00072 {
00073 skeptic.savefilename = argv[2];
00074 }
00075 else
00076 {
00077 skeptic.savefilename = "noname";
00078 }
00079
00080 LINFO("argc %d", argc);
00081 argInput = new std::istringstream(argv[1]);
00082 skeptic.Ninput = Image<byte>(100,100, NO_INIT);
00083 skeptic.Ninput = Raster::ReadGray(argv[1], RASFMT_PNM);
00084 skeptic.filename = argv[1];
00085 LINFO("Image Loaded");
00086 Image<float> temp;
00087 temp = skeptic.Ninput;
00088 LINFO("RUNNING TEST");
00089 skeptic.convolveTest(CINNICreate,configIn,temp);
00090 LINFO("done!");
00091 (void) time(&t2);
00092 long int tl = (long int) t2-t1;
00093 printf("\n*************************************\n");
00094 printf("Time to execute, %ld seconds\n",tl);
00095 printf("*************************************\n\n");
00096 return 1;
00097 }
00098
00099
00100
00101
00102
00103