Hello, I use the sample code for Videocapture with OpenCV 3.1 and in C++ I only get back images (same code in Python on the same Windows 10 machine works but uses cv2.pyd). I only have the OpenCV 3.1 opencv_world331 opencv_world331d dlls in the path. What am I doing wrong?
VideoCapture cap(0); // open the default camera if (!cap.isOpened()) // check if we succeeded return -1; Mat edges; namedWindow("edges", 1); for (;;) { Mat frame; cap >> frame; // get a new frame from camera cvtColor(frame, edges, COLOR_BGR2GRAY); GaussianBlur(edges, edges, Size(7, 7), 1.5, 1.5); Canny(edges, edges, 0, 30, 3); imshow("edges", edges); if (waitKey(0) >= 0) break; } // the camera will be deinitialized automatically in VideoCapture destructor return 0;