Ask Your Question
0

Problem with setting up Allied Vision Manta, OpenCv and VS2015

asked 2017-02-06 08:17:44 -0600

jok23 gravatar image

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?

edit retag flag offensive close merge delete

Comments

how do you download opencv?

LBerger gravatar imageLBerger ( 2017-02-06 11:57:56 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-02-06 12:05:32 -0600

LBerger gravatar image

I think you have download from this site.

If you want to use PvAPI Library you have to clone opencv from github and read this post to build opencv using CMake

edit flag offensive delete link more

Comments

Yes your right, I have downloaded and configured OpenCv using this tutorial: https://www.youtube.com/watch?v=7SM5OD2pZKY&t=3s (https://www.youtube.com/watch?v=7SM5O...)

Ok, building opencv using CMake make sense...But is there any other way of configureing my settup? I have read something about Vimba Viewer Class Builder and APIs for c++ and c# but I don't know how to implement this in Visual Studio?

jok23 gravatar imagejok23 ( 2017-02-06 14:20:04 -0600 )edit

building opencv will take less than 1 hour (without CUDA 15 minutes)

LBerger gravatar imageLBerger ( 2017-02-06 14:40:33 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-02-06 08:17:44 -0600

Seen: 544 times

Last updated: Feb 06 '17