int main(int argc, char **argv) { init(); // For catching a CTRL-C signal(SIGINT,exit_handler); // Initialize int retVal = stereo.init(); if (retVal !=0 ) exit_handler(0); // Start the acquisition flow retVal = stereo.start(); if (retVal !=0 ) exit_handler(0); // Main loop while(true) { // Capture stereo images retVal = stereo.saveTwoImages(); if (retVal !=0 ) exit_handler(0); // Wait 1s between each images usleep(300000); // Handle pause/unpause and ESC int c = cvWaitKey(1); if(c == 'p') { DEBUG<<"Acquisition is now paused"<<endl; c = 0; while(c != 'p' && c != 27){ c = cvWaitKey(250); } DEBUG<<"Acquisition is now unpaused"<<endl; } if(c == 27) { DEBUG<<"Acquisition has been stopped by user"<<endl; break; } } // Stop the acquisition flow stereo.stop(); // Close cameras stereo.close(); return 0; }
int main(int argc, char **argv) { init(); // For catching a CTRL-C signal(SIGINT,exit_handler); // Initialize int retVal = stereo.init("../examples/stereo_calib_dataset_3/"); if (retVal !=0 ) exit_handler(0); // Main loop retVal = stereo.calib(); if (retVal !=0 ) exit_handler(0); // Close camera stereo.close(); return 0; }
// Create a CTRL-C handler void exit_handler(int s){ stereo.close(); exit(1); }