|
@@ -26,47 +26,22 @@ 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];
|
|
|
+ Image tmp(101,195);
|
|
|
+ tmp.set(0);
|
|
|
+ string infile = "/home/froehlich/Desktop/wichtiges/coind/out.txt";
|
|
|
+ ifstream in(infile.c_str());
|
|
|
|
|
|
- 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) )
|
|
|
+ while(!in.eof())
|
|
|
{
|
|
|
- if ( fgets ( buffer, buffersize, f ) <= 0 )
|
|
|
- {
|
|
|
- break;
|
|
|
- } else {
|
|
|
- fprintf (stderr, "%s", buffer );
|
|
|
- }
|
|
|
+ int x,y,v;
|
|
|
+ in >> x;
|
|
|
+ in >> y;
|
|
|
+ in >> v;
|
|
|
+ if(v == 0)
|
|
|
+ v = 1;
|
|
|
+ tmp.setPixel(x,y,v);
|
|
|
}
|
|
|
- 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);
|
|
|
+ tmp.write("/home/froehlich/Desktop/wichtiges/coind/out.pgm");
|
|
|
|
|
|
|
|
|
return 0;
|