basler / pypylon

The official python wrapper for the pylon Camera Software Suite
http://www.baslerweb.com
BSD 3-Clause "New" or "Revised" License
556 stars 207 forks source link

Interfacing camera link cameras #506

Open hrouault opened 2 years ago

hrouault commented 2 years ago

Hi,

I am trying to control two cameras that are connected to a frame grabber. I can access the cameras in pylonviewer through a com port. However, we I try to list the cameras with pypylon, I obtain an empty list. Are camera link cameras supported by pypylon?

Thanks,

SMA2016a commented 2 years ago

Simply run the following code to see which transport layers are support:

tlFactory = pylon.TlFactory.GetInstance() tl_infos = pylon.TlFactory.GetInstance().EnumerateTls()

for d in tl_infos: print(d.GetTLType())

In general, pylon supports configuring the camera link camera, but not streaming. You need to use the SDK of the frame grabber manufacture for streaming.

hrouault commented 2 years ago

For the list of transport layers, I obtain:

U3V
GEV
CXP

but the output of pylon.TlFactory.GetInstance().EnumerateDevices() is an empty tuple although the camera is well detected in pylon viewer.

Should I indicate the transport layer in EnumerateDevices in some way?

thiesmoeller commented 2 years ago

@hrouault , by default pypylon doesn't contain the camera link transport layer, as this would delay the device enumeration time for everyone quite heavily ( we have to probe at 9600 Baud on every serial port of the system )

You have two options:

-> what is your operating system?

hrouault commented 2 years ago

I would be ok with recompiling pypylon but the setup.py script is large and I really don't see what to modify.

The second solution might not fit my needs since I develop an application in a virtual environment where pypylon is installed. I would then need to copy the driver in different places and this is not robust nor convenient.

Is the CL driver long to compile? Would it be possible to compile it by default while setting up a flag for serial port probing?

thiesmoeller commented 2 years ago

Okay. What is your platform/operating system to support you better?

hrouault commented 2 years ago

sorry, I forgot to reply to that... The cameras are on a windows platform.

Thanks!

thiesmoeller commented 2 years ago
>>> for tl in tlf.EnumerateTls():
...     print(tl.GetTLType()) 
... 
U3V
GEV
CL
CXP

please checkout and compile from this branch ( https://github.com/thiesmoeller/pypylon/tree/feature/support_cl ) which includes the packaging for the cameralink libraries for windows

As I have no CL camera available at the moment you would have to test my branch on your side ;-)

hrouault commented 2 years ago

When I try to install, I get this error:

OSError: PYLON_DEV_DIR is not set

Searching the .appveyor.yml file, I understand I should set it up to the develpment folder in my pylon installation but my pylon installation does not contain a development folder.

How should I initialize this variable?

thiesmoeller commented 2 years ago

Modify your windows installation of pylon to include all development files.

Per readme.md get windows installation of swig.

Have visual studio / compilers installed If you don't have a msdn account you can get the basic version for free from Microsoft

hrouault commented 2 years ago

This is working. The cameras are now appearing.

Thank you very much!

I guess I can apply this patch to the newer version of pypylon?

thiesmoeller commented 2 years ago

Hi @hrouault, good news.

Until we break the setup.py sometime in future ... this should apply on new versions too.

I'm thinking about putting the CL support into a sub-package. So you can do pip install pypylon

and only if you want the CL support you have to pip install pypylon_cl

WOFGA commented 1 year ago

hi,is this change already merge into the original pypylon build?