correct copyright info
[challenge-bot] / bbb / opencv-hello-world / opencv-hello-world.cpp
index 02fea3ea1c374657dd72e46cc28190b009c4076e..7e1f8e5ec29634aaf66c8c1d6beb61c529e27130 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2015 Daniel Watson
+  Copyright (C) 2016 Daniel Watson
   See the end of the file for license conditions.
 */
 /* challenge-bot
@@ -13,13 +13,15 @@ using namespace cv;
 using namespace std;
 
 int main(int argc, char** argv) {
-  VideoCapture camera;
-  camera.open(0);
-  Mat edges;
-  Mat frame;
+  if (argc < 2) {
+    cout << "supply a video device index." << endl;
+    cout << "probably 0 for beaglebone, 1 for laptop" << endl;
+    exit(0); }
+  VideoCapture camera(atoi(argv[1]));
   if(!camera.isOpened()) {
     cout << "not opened :( that's bad" << endl;
     exit(-1); }
+  Mat frame;
   camera >> frame;
   Mat grey_image;
   cvtColor(frame, grey_image, CV_BGR2GRAY);
@@ -36,7 +38,7 @@ int main(int argc, char** argv) {
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.
 
-  GNU Affero Emacs is distributed in the hope that it will be useful,
+  Challenge-bot is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU Affero General Public License for more details.