genicam / harvesters

Image Acquisition Library for GenICam-based Machine Vision System
Apache License 2.0
518 stars 89 forks source link

Is driver change necessary while switching cti files of different manufacturers (GigE Vision Camera)? #132

Closed 12Patrick closed 4 years ago

12Patrick commented 4 years ago

Hi @kazunarikudo, Thanks for your great work to provide harvesters and your support! I started a new project and run into problems.

Describe the bug If I use the cti file of Allied Vision, the device is recognized and create_image_aquirer(0) works. If I change to the cti file of Matrix Vision (without changing anything else, no driver change), the device is not recognized and the device_info_list is empty.

To Reproduce Steps to reproduce the behavior:

  1. Install the driver with Vimba Driver Installer
  2. Follow all your steps to set up Anaconda and the environment (incl. harvesters)
  3. Try the following code with the cti file of Vimba --> works
  4. Try the following code with the cti file of MV by changing the out-commented cti file --> does not work. The device_info_list is empty. This is raised: Exception has occurred: IndexError list index out of range

Expected behavior So my question is, do I have to install different drivers while switching cti files? I'm using a GigE Vision Camera. You already wrote in ticket #91: "If you use JAI then you'd use JAI's driver. If you go with MV, then you'd use their dirver." But does that only apply to USB3 Vision or also GigE Vision Cameras?

If I open the programm wxPropView(x64), I get images from the Allied Vision Camera without consciously installing new drivers. So it seems that it works in this programm with the Allied Vision driver.

My Code

from harvesters.core import Harvester

h = Harvester()

# Choose between cti-file from Allied Vision Vimba (GigE) or Matrix Vision (GigE)
h.add_cti_file('C:\Program Files\Allied Vision\Vimba_3.1\VimbaGigETL\Bin\Win64\VimbaGigETL.cti')
###h.add_cti_file('C:\Program Files\MATRIX VISION\mvIMPACT Acquire\bin\x64\mvGenTLProducer.cti')

# Output all implemented cti files
print(h.cti_files)

# Scan for new devices and add them to the device list
h.update_device_info_list()

# Output all devices
print(h.device_info_list)

# Number of devices in list
print('# of devices: {}'.format(len(h.device_info_list)))

# Prepare for image acquisition 
ia = h.create_image_acquirer(0)

Desktop (please complete the following information):

Additional context I have not added more code. Because I ran into some other problems. That is why I wanted to switch to the GenTL Producer of Matrix Vision as often recommended by you to exclude that problems are coming from the Vimba GenTL Producer.

I hope you can help me. Thank you for your patience!

kazunarikudo commented 4 years ago

@12Patrick Hi, thank you for trying out Harvester. In general, you should use the driver that its GenTL Producer manufacture shipped with because if it worked by a chance such as the driver is based on an open source software but it does not mean it’s a case where the manufacturer can support any issue based on the unauthorized driver software. Feel free to update if the issue cannot be resolved by the suggestion. /Kazunari

12Patrick commented 4 years ago

@kazunarikudo Thanks for your quick reply!

I uninstalled Vimba and also all Matrix Vision Software. Afterwards, I installed mvGenTL_Acquire x86_64 2.37.1.exe again. Is this the correct software? I downloaded it from this website https://www.matrix-vision.com/software-drivers-en.html and selected mvBlueCOUGAR (Gigabit Ethernet / Dual Gigabit Ethernet) in the drop down menu.

Still the same problem. No device in the device_info_list.

Also tried to deinstall drivers with mvGigEConfigure(x64) and install again. Still the same problem.

Anything else I could check? What could I have done wrong? If I open the program wxPropView(x64), I am able to acquire images in this program.

kazunarikudo commented 4 years ago

@12Patrick Hi, thank you for the update. Please excuse me, I had thought that you were also working with a U3V camera having read the following sentence:

does that only apply to USB3 Vision or also GigE Vision Cameras?

In general, filter drivers do not affect the device enumeration process even though U3V drivers do.

However, no matter what the principle is, I also feel strange you can't enumerate GEV devices though a GenTL Producer from MV.

Okay, I will try to guess possible reasons. Hope you keep stay tuned. /Kazunari

12Patrick commented 4 years ago

@kazunarikudo Hi, I just want to come back on this issue.

Can you confirm that the following is correct: I downloaded the GenTL producer from Matrix Vision from this website https://www.matrix-vision.com/software-drivers-en.html and selected mvBlueCOUGAR (Gigabit Ethernet / Dual Gigabit Ethernet) in the drop down menu. Then I downloaded the file mvGenTL_Acquire x86_64 2.37.1.exe (login needed to see all files).

Or is this wrong and could lead into my problems? You linked this page (http://static.matrix-vision.com/mvIMPACT_Acquire/2.29.0/) in your installation manual. But I was not sure what to download and install for Windows 10 (64 bit). Would it be mvGenTL_Acquire-x86_64-2.29.0.msi ?

kazunarikudo commented 4 years ago

@12Patrick As I described recently, you should be able to detect GEV cameras without any GEV filter driver, unlike U3V GenTLProducers require you to install its proprietary U3V driver; a GEV filter driver is used to boost the performance in general and a typical GEV application software can at least detect GEV cameras without any GEV filter driver. Anyway, I believe this issue should not involve the mvBlueCOUGER driver you tried. So you should forget about the installer. However, I do not have any idea that tells you why MV's GenTL Producer can't detect your Allied Vision camera. I'm sorry but I guess there are people who have got Allied VIsion camera working with MV's GenTL Producer. One thing I can tell you is MV's GenTL Producer should accept any GenICam compliant camera in principle.

kazunarikudo commented 4 years ago

In general, you should just install MV's GenTL Producer and the file name should look like mvGenTL_Acquire-x86_64-n.nn.n.msi.

12Patrick commented 4 years ago

@kazunarikudo Thanks for your support!

It's working now. It was a stupid issue. The \ in the path string led to problems. It was just luck that in the path string of vimba it was a big B and in the path of matrix vision a small b. And "\b" changes the string in a way I don't wanted it. (I think Byte String is the right word.)

As I run afterwards also in a kind of same problem as #92, maybe you can put the following in the FAQ. The reason why I have not posted it directly under #92 is that he wanted to have the ChunkModeActive to be true. But for me, it seems as I don't need it until now. SO the following could be helpful for others: => If you are getting the error "Invalid layout of buffer attached to chunk parser! RuntimeException..." (happens especially on Allied Vision Cameras) and you don't need the chunk mode, try the following workaround: Disabling chunk mode stops the raising of the exception. It is a workaround if you do not need Chunk data. In order to implement this workaround, you have to add this line to your code: ia.device.node_map.ChunkModeActive.value = False

It was originally posted by lmarga in the Gitter chatroom.

Thanks again for your support and patience! I hope I haven't taken up too much of your time with this problem. But even that I had a problem which was not related to harvesters maybe it could help somebody. So maybe it's better to put my problem with the backslash in the FAQ as it is not a bug of harvesters.