Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 600

I was able to open ids camera the code in visual studio 2012 with opencv 2.4.13,but now it can't open in visual studio 2015 opencv 3.2.0,c++.pls help me with a solution

$
0
0
#include #include using namespace cv; using namespace std; int main() { Mat CameraFrame; Mat Grey; VideoCapture cap; char keypressed; //Opens the first imaging device. cap.open(0); //Check whether user selected camera is opened successfully. if( !cap.isOpened() ) { cout << "***Could not initialize capturing...***\n"; return -1; } //Create a windows to display camera preview. namedWindow("Camera Preview", CV_WINDOW_AUTOSIZE); //Loop infinitely to fetch frame from camera and display it. for(;;) { //Fetch frame from camera. cap >> CameraFrame; //Check whether received frame has valid pointer. if( CameraFrame.empty() ) break; //Display the received frame imshow("Camera Preview", CameraFrame); //Wait for Escape keyevent to exit from loop keypressed = (char)waitKey(10); if( keypressed == 27 ) break; } //Release the camera interface. cap.release();

Viewing all articles
Browse latest Browse all 600