// Beispielhafter Aufruf: BUILD_x86_64/progs/testSemanticSegmentation -config /** * @file test.cpp * @brief simple test program for everything * @author Björn Fröhlich * @date 03/10/2010 */ #ifdef NICE_USELIB_OPENMP #include #endif #include #include #include "objrec/segmentation/RSMeanShift.h" #include "objrec/segmentation/RSCache.h" #include "objrec/baselib/Globals.h" using namespace std; using namespace OBJREC; int main(int argc, char **argv) { //popen test string fn = "/tmp/img.ppm"; std::string call = "ls *"; const int buffersize = 65536; char *buffer = new char [buffersize]; FILE *f = popen ( call.c_str(), "r" ); cout << call << endl; if ( f == NULL ) { fprintf (stderr, "FATAL ERROR, unable to run program\n"); return -1; } while ( ! feof(f) ) { if ( fgets ( buffer, buffersize, f ) <= 0 ) { break; } else { fprintf (stderr, "%s", buffer ); } } pclose(f); //openMP test #pragma omp parallel for for(int i = 0; i < 3; i++) { cout << i << endl; } Config * conf = new Config(); RegionSegmentationMethod *tmprsm = new RSMeanShift(conf); RSCache rsm( conf, tmprsm ); Image cimg(fn); Matrix mask; Globals::setCurrentImgFN ( fn ); rsm.segRegions (cimg, mask); return 0; }