Ask Your Question

phdstudent2012's profile - activity

2014-02-07 14:58:52 -0600 commented question Web cam and prosilica camera did not work.

I get the solution

2014-02-07 12:41:28 -0600 commented answer How do I get Allied Vision Camera (GC2450C) working with OpenCV 2.4?

@kaushal can you share how did you do to get camera working. thanks

2014-02-07 10:37:36 -0600 received badge  Editor (source)
2014-02-07 10:36:56 -0600 asked a question Web cam and prosilica camera did not work.

Hello, I installed vimbaviewer on windows 7. Then, I installed opencv 2.4.8. I build it using cmake with With_PVAPI and WITH_QT. I am using QT 5.2.0 with mingw32. At this stade the webcam is running correctly but the prosilica camera did not work.

After that I found the link link. So I nstalled the SDK AVT for windows and I rebuild it with With_PVAPI and WITH_QT. At this phase, the webcam did not work and also the prosilica camera always did not work. SEE my code to get video:

#include "opencv2/highgui/highgui.hpp"
#include <iostream>
using namespace cv;
using namespace std;
int main()
    VideoCapture cap(0); // open the video camera no. 0
    //VideoCapture cap(CV_CAP_PVAPI); // open the video camera prosilica

    if (!cap.isOpened())  // if not success, exit program
cout << "Cannot open the video cam" << endl;
        return -1;

   double dWidth = cap.get(CV_CAP_PROP_FRAME_WIDTH); //get the width of frames of the video
   double dHeight = cap.get(CV_CAP_PROP_FRAME_HEIGHT); //get the height of frames of the video

    cout << "Frame size : " << dWidth << " x " << dHeight << endl;

    namedWindow("MyVideo",CV_WINDOW_AUTOSIZE); //create a window called "MyVideo"

    while (1)
        Mat frame;

        bool bSuccess =; // read a new frame from video

if (!bSuccess) //if not success, break loop
cout << "Cannot read a frame from video stream" << endl;

        imshow("MyVideo", frame); //show the frame in "MyVideo" window

        if (waitKey(30) == 27) //wait for 'esc' key press for 30ms. If 'esc' key is pressed, break loop
cout << "esc key is pressed by user" << endl;
    return 0;


When I execute this code, It seems that exit directly without any error, I did not execute the code. In fact , I get this window:

image description

Thanks for help me