Changed build scripts for AVT (pvapi) and Windows (Patch #1927)


Added by Erich Michler almost 13 years ago. Updated over 12 years ago.


Status:Done Start date:2012-05-14
Priority:Normal Due date:
Assignee:Andrey Kamaev % Done:

0%

Category:build/install
Target version:2.4.1
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

Two CMakelists.txt changed (main and highgui) to enable selection of pvapi with Windows.


CMakeLists.txt.patch (2.8 kB) Erich Michler, 2012-05-14 08:36 am

CMakeLists.txt.patch (1.9 kB) Erich Michler, 2012-05-14 08:36 am

OpenCVFindLibsVideo.cmake.patch - GigE Vision support (920 Bytes) Philippe FOUBERT, 2012-06-07 11:16 pm


Associated revisions

Revision e161f428
Added by Andrey Kamaev almost 13 years ago

Fixed PvAPI search on Windows #1927

Revision 7069b4b7
Added by Andrey Pavlenko over 11 years ago

Merge pull request #1927 from JBosch:issue3409

History

Updated by Andrey Kamaev almost 13 years ago

Thanks for the patch!
And could you provide short instruction for building OpenCV with PvAPI on Windows? We'll make a wiki page showing how to build OpenCV with various back-ends.

Updated by Erich Michler almost 13 years ago

It's quite easy building OpenCV with PvAPI on Windows. It's just a one step instruction ;-). All you have to do is to download and install the SDK from AVT (http://www.alliedvisiontec.com/us/products/software/avt-pvapi-sdk.html). Default installation path is C:\Program Files\Allied Vision Technologies\GigESDK. CMake will do everything else for you. If Patch #1921 is also applied trouble-free compiling of OpenCV with Visual Studio 10 (32 bit and 64 bit) should be guaranteed.

Updated by Andrey Kamaev almost 13 years ago

  • Target version set to 2.4.1
  • Assignee changed from Alexander Shishkov to Andrey Kamaev

Updated by Andrey Kamaev almost 13 years ago

Windows paths support is added to OpenCV trunk.

  • Status changed from Open to Done

Updated by Himanshu Madhu almost 13 years ago

Hi,

I tried building OpenCV2.4.1 (which includes this patch) with PvAPI using codeblocks+mingw, and it failed. Can you help me on this?

Thanks and regards
Himanshu

Updated by Philippe FOUBERT almost 13 years ago

I did it but i did not have time to post the patch i wrote yet (tested with mingw).
I plan to post it next week.

Regards,

Philippe.

Updated by Himanshu Madhu almost 13 years ago

Philippe,

Thanks, next week should work. Meanwhile, even i am trying to fix it. But i will wait for your patch.

Thanks and regards
Himanshu

Updated by Philippe FOUBERT almost 13 years ago

I planed to check it more seriously next week but if you need it soon, please check the attached patch.

The tick is the addition of the define "PVDECL=__stdcall"

Philippe.

  • File OpenCVFindLibsVideo.cmake.patch added

Updated by Himanshu Madhu almost 13 years ago

Philippe,

Thank you for the patch. I used it and the compilation succeeded. Thanks a lot.

Thanks and regards
Himanshu

Updated by Graham Pennington over 12 years ago

Hi,
I have built openCV on a windows 7 machine using Visual Studio 10. I'm trying to communicate with my AVT Prosilica GE680 cam. I've got PvApi working, as i can use the gigE SDK functions no problem. I can find and open my cam using the SDK functions, but I can't get the openCV functions to work with it.
Below is a snippet of code that is failing:

printf("Press ESC to exit\n");

cvNamedWindow( "First Example of PVAPI Integrated", CV_WINDOW_AUTOSIZE );
CvCapture* capture = cvCreateCameraCapture( CV_CAP_PVAPI );
assert( capture != NULL );

However, when i run this piece, the assertion fails. I don't think openCV is talking to the camera. Any help would be greatly appreciated!
Thanks,
~Graham

Updated by Erich Michler over 12 years ago

Hi Graham,

did you already try to debug cap_pvapi.cpp? There's a delay during initialization of the camera. Maybe in your case this delay is too short. Do AVT SDK tools detect camera immediately and without configuring anything? Or do you have to set an ip address? If you set an ip address and don't use zeroconf configuration that's maybe another source of problems.

Erich

Updated by Himanshu Madhu over 12 years ago

Philippe,

Using the patch, compilation was successful using MinGW. But when i wrote a 'C' script in Codeblocks (using Mingw compilers) to test the capture of AVT cameras & used following command:

#include <PvApi.h>

it failed and gave an error: "#error Define PVDECL to be your compiler keyword for "standard call" "

Can you help me on this?

Thanks and regards
Himanshu

Updated by Philippe FOUBERT over 12 years ago

Hi Himanshu,

You should add a "#define PVDECL __stdcall" in your project (before including the PvApi.h file).

Tell me if it works.

Philippe.

Updated by Himanshu Madhu over 12 years ago

Philippe,

I added that and the script got compiled.

Following is part of the script. I have used the the AVT GIGE SDK commands to determine number of cameras connected & also the OpenCV command for the same:

PvInitialize();
tPvCameraInfo cameraList[1];
Sleep(1000);
unsigned long cameraNum = PvCameraList(cameraList,1,NULL);
printf("Num of cameras %d'\n", cameraNum);
CvCapture* capture = 0;
capture = cvCreateCameraCapture(CV_CAP_PVAPI);
assert( capture)

The printf command displays the number of cameras connects as 1 (detects the AVT camera)
But, the assert(capture) command returns FALSE.

Why is it so?

Thanks and regards
Himanshu

Updated by Graham Pennington over 12 years ago

Erich Michler wrote:

Hi Graham,

did you already try to debug cap_pvapi.cpp? There's a delay during initialization of the camera. Maybe in your case this delay is too short. Do AVT SDK tools detect camera immediately and without configuring anything? Or do you have to set an ip address? If you set an ip address and don't use zeroconf configuration that's maybe another source of problems.

Erich

Erich,
Thank you for the help. I debugged cap_pvapi.cpp and found some issues. I am finally able to capture video with my GE680. However, it seems that i can only capture in mono8 mode. A quick look at cap_pvapi.cpp suggests that Bgr24 should be supported. I used the gigE viewer to change the camera to Bgr24, but i get an assertion failure in the convert.cpp file when doing this... Is there a fix for this?
Thanks,
~Graham

Updated by Erich Michler over 12 years ago

Sorry Graham, I only have a mono camera, never worked in colormode.

Also available in: Atom PDF