I have laptop with Windows 10 and Marvell Yukon 88E8072 PCI-E Gigabit Ethernet Controller. I have Allied Vision Manta camera connected to my laptop. I installed Visual Studio 2015 and also I installed Allied Vision SDK - Vimba Viewer. I am able to capture images with Vimba Viewer interface soo I know that camera is working ok.
The problem is when I try to capture images in Visual Studio. I downloaded sample source code and with this code I am able to capture image from my webcam.This is code:
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <opencv2\video\video.hpp>
#include "opencv2/highgui/highgui.hpp"
using namespace cv;
using namespace std;
int main(int argc, char* argv[])
{
//cerr << getBuildInformation() << endl;
VideoCapture cap(0); // open the video camera no. 0 - we camera, 1- should be GigE camera?
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 = cap.read(frame); // read a new frame from video
if (!bSuccess) //if not success, break loop
{
cout << "Cannot read a frame from video stream" << endl;
break;
}
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;
break;
}
}
return 0;
}
If I change VideoCapture cap(0) to VideoCapture cap(1), so that I should get video from GigE camera, I get a message ''Canot open the video cam'', so cap.isOpen() is false (see code above).
I am assuming that this has to do something with PvAPI driver not installed/included correctly. When I run:
cerr << getBuildInformation() << endl;
in cmd I see under Video I/O there is a line that says: PvAPI NO!
My question is, how can I configure my sistem to be able to capture images from Allied Vision Camera, model Manta in Visual Studio?
SO FOR ALL ENGINEERS WHO ARE TRYING (AND ARE NEW LIKE ME IN MACHINE VISION) TO USE VIMBA VIEWER APIs (C++, C#) TO CONNECT WITH MANTA CAMERAS, THIS IS HOW IT IS DONE:
POSIBLE PROBLEMS THAT I HAD AND FIXES: