Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This is the code i used to open USB3.0 IDS camera in opencv.

include<opencv2 opencv.hpp="">

include<iostream>

using namespace cv; using namespace std; int main() { Mat CameraFrame; Mat Grey; VideoCapture cap; char keypressed; cap.open(0); if( !cap.isOpened() ) {cout << "Could not initialize capturing...\n"; return -1;} namedWindow("Camera Preview", CV_WINDOW_AUTOSIZE); for(;;) {cap >> CameraFrame; if( CameraFrame.empty() ) break; imshow("Camera Preview", CameraFrame); keypressed = (char)waitKey(10); if( keypressed == 27 ) break;} cap.release(); return 0;}

click to hide/show revision 2
No.2 Revision

updated 2017-02-01 03:57:32 -0600

berak gravatar image

This is the code i used to open USB3.0 IDS camera in opencv.

include<opencv2 opencv.hpp="">

include<iostream>

#include<opencv2/opencv.hpp>
#include<iostream>
using namespace cv;
using namespace std;
int main()
    {
    Mat CameraFrame;
    Mat Grey;
    VideoCapture cap;
    char keypressed;
    cap.open(0);
    if( !cap.isOpened() )
    {cout << "Could "***Could not initialize capturing...\n";
capturing...***\n";
   return -1;}
   namedWindow("Camera Preview", CV_WINDOW_AUTOSIZE);
   for(;;)
   {cap >> CameraFrame;
   if( CameraFrame.empty() )
   break;
   imshow("Camera Preview", CameraFrame);
   keypressed = (char)waitKey(10);
   if( keypressed == 27 )
   break;}
   cap.release();
  return 0;}

0;}