00001 #include "CUDA/CudaHmaxCBCL.H" 00002 #include "Image/Image.H" 00003 #include "Raster/Raster.H" 00004 #include "Util/log.H" 00005 00006 #include <fstream> 00007 #include <iostream> 00008 #include <iomanip> 00009 #include <string> 00010 #include <unistd.h> 00011 #include <cstdlib> 00012 #include <vector> 00013 #include <dirent.h> 00014 00015 int main(int argc,char* argv[]) 00016 { 00017 Image<float> img; 00018 std::string c0patchFile = std::string("c0Patches.txt"); 00019 std::string c1patchFile = std::string("c1Patches.txt"); 00020 std::string c2outFile = std::string("c2.out"); 00021 00022 if(argc != 2) 00023 { 00024 fprintf(stderr,"testprog <image_file>\n"); 00025 exit(1); 00026 } 00027 CudaHmaxCBCL hmax = CudaHmaxCBCL(c0patchFile,c1patchFile); 00028 // Load image 00029 img = Raster::ReadGrayNTSC(argv[1]); 00030 // Get C2 00031 hmax.getC2(img.getArrayPtr(),img.getWidth(),img.getHeight()); 00032 // Write out C2 00033 hmax.writeOutFeatures(c2outFile,1,true); 00034 // Clear C2 memory 00035 hmax.clearC2(); 00036 }