add everything so cindy can get it
[challenge-bot] / bbb / opencv-hello-world / opencv-hello-world.cpp
diff --git a/bbb/opencv-hello-world/opencv-hello-world.cpp b/bbb/opencv-hello-world/opencv-hello-world.cpp
new file mode 100644 (file)
index 0000000..02fea3e
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+  Copyright (C) 2015 Daniel Watson
+  See the end of the file for license conditions.
+*/
+/* challenge-bot
+   GNU AGPLv3 (or later at your option)
+   project available here:
+   https://challenge-bot.com/
+*/
+#include <opencv2/opencv.hpp>
+
+using namespace cv;
+using namespace std;
+
+int main(int argc, char** argv) {
+  VideoCapture camera;
+  camera.open(0);
+  Mat edges;
+  Mat frame;
+  if(!camera.isOpened()) {
+    cout << "not opened :( that's bad" << endl;
+    exit(-1); }
+  camera >> frame;
+  Mat grey_image;
+  cvtColor(frame, grey_image, CV_BGR2GRAY);
+
+  imwrite("image.png", frame);
+  imwrite("image-grey.png", grey_image);
+  return 0; }
+
+/*
+  This file is part of challenge-bot.
+
+  Challenge-bot is free software: you can redistribute it and/or modify
+  it under the terms of the GNU Affero General Public License as published by
+  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,
+  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.
+
+  You should have received a copy of the GNU Affero General Public License
+  along with challenge-bot.  If not, see <http://www.gnu.org/licenses/>.
+*/