void *display_in_thread(void *ptr) { show_image_cv(buff[(buff_index + 1)%3], "Demo", ipl); int c = cvWaitKey(1); if (c != -1) c = c%256; if (c == 10){ if(demo_delay == 0) demo_delay = 60; else if(demo_delay == 5) demo_delay = 0; else if(demo_delay == 60) demo_delay = 5; else demo_delay = 0; } else if (c == 27) { demo_done = 1; return 0; } else if (c == 82) { demo_thresh += .02; } else if (c == 84) { demo_thresh -= .02; if(demo_thresh <= .02) demo_thresh = .02; } else if (c == 83) { demo_hier += .02; } else if (c == 81) { demo_hier -= .02; if(demo_hier <= .0) demo_hier = .0; } return 0; }
void show_image(image p, char *name) { #ifdef OPENCV show_image_cv(p, name); #else fprintf(stderr, "Not compiled with OpenCV, saving to %s.png instead\n", name); save_image(p, name); #endif }