Ask Your Question
0

My USB3.0 IDS camera cannot opened with opencv2.4.12.Please help me with a solution. [closed]

asked 2017-02-01 02:36:16 -0600

Ashiq KS gravatar image

The camera is not opening while c++ program code for video read is executed.I am in the middle of a college project,please help me with a solution

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by berak
close date 2017-02-01 06:42:27.436127

Comments

not enough information. what have you tried so far ?

os / opencv version / camera model ?

code ?

berak gravatar imageberak ( 2017-02-01 02:55:20 -0600 )edit

feel pleasure to be commented.thanks for coming.just now the problem was solved.Thank U again

Ashiq KS gravatar imageAshiq KS ( 2017-02-01 03:27:13 -0600 )edit

you still could post, how you solved it, so we had an answer !

berak gravatar imageberak ( 2017-02-01 03:30:34 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-02-01 03:43:53 -0600

Ashiq KS gravatar image

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>
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;}
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-02-01 02:36:16 -0600

Seen: 457 times

Last updated: Feb 01 '17