diff options
-rw-r--r-- | capture.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -195,12 +195,16 @@ int main(int argc, char *argv[]) { struct ct ct; + int index = CV_CAP_ANY; memset(&ct, 0, sizeof ct); gtk_init(&argc, &argv); - ct.capture = cvCreateCameraCapture(CV_CAP_ANY); + if (argc > 1) + index = atoi(argv[argc-1]); + + ct.capture = cvCreateCameraCapture(index); if (!ct.capture) { fprintf(stderr, "ERROR: capture is NULL \n"); exit(EXIT_FAILURE); |