int binary_cb(void) { Image* tmp = gc.image; if (tmp != NULL){ IupSetfAttribute(gc.msgbar, "TITLE", "Grey scale image ..."); gc.image = imgGrey(tmp); repaint_cb(gc.canvas); /* repaint canvas */ imgDestroy(tmp); tmp = gc.image; gc.image = imgBinary(tmp); repaint_cb(gc.canvas); /* repaint canvas */ imgDestroy(tmp); IupSetfAttribute(gc.msgbar, "TITLE", "Binary image ..."); } return IUP_DEFAULT; }
Colony::Colony(Image* image, DirectionalField* directionalFied) { if (imgGetDimColorSpace( image ) != 1) { Image* aux = imgGrey( image ); imgDestroy( image ); image = aux; aux = 0; } // Normalize image //imgNormalize( image, 2 ); // Apply gaussian filter for noise reduction //imgGauss( image ); imgWriteBMP( (char*)"debugImg/inputAfterGaussian.bmp", image ); _environment = new Environment( INITIAL_PHEROMONE, MIN_PHEROMONE, EVAPORATION_RATE, image, directionalFied ); generateProbabilityImages(); }