#include #include #include #include "MainWindow.h" #include "Settings.h" #ifdef WIN32 #include BOOL WINAPI my_handler(DWORD signal) { if (signal == CTRL_C_EVENT) { printf("\nCtrl-C caught! Quitting application...\n"); QApplication::quit(); } return TRUE; } #else #include void my_handler(int s) { printf("\nCtrl-C caught! Quitting application...\n"); QApplication::quit(); } #endif void showUsage() { printf("\nUsage:\n" #ifdef WIN32 " Find-Object.exe [options]\n" #else " find_object [options]\n" #endif "Options:\n" " -console Don't use the GUI (by default the camera will be\n" " started automatically). Option -objs must also be\n" " used with valid objects.\n" " -objs \"path\" Directory of the objects to detect.\n" " -config \"path\" Path to configuration file (default: %s).\n" " -help or --help Show usage.\n", Settings::iniDefaultPath().toStdString().c_str()); exit(-1); } int main(int argc, char* argv[]) { QApplication app(argc, argv); // parse options bool guiMode = true; QString objectsPath = ""; QString configPath = Settings::iniDefaultPath(); for(int i=1; i