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);