joshdoe / gst-plugins-vision

GStreamer plugins related to the field of machine vision
Other
133 stars 50 forks source link

Pylon 2 camera Indeterminance #74

Open cafsigjolmos opened 2 years ago

cafsigjolmos commented 2 years ago

Hello, i am trying to build a homemade stereo camera with two basler cameras and i found this repository that allow Genicam interfaces to be easily integrated with gstreamer (nice and hard work, you have my congrats). When using 2 cameras with pylon plugin the two cameras have a given index related to their connection time. Because of that it is impossible to identify the camera (left or right) and the ids can change making imposible to fix a configuration.

Regards

mrstecklo commented 2 years ago

Hi, @JMOlmos-cafsig. I've once created a console application for configuring Basler cameras using C API. Unfortunately I've lost the code. But as far as I remember you need to connect to each device one by one and request their serial numbers manually.

I think that the best way is to add serial-number property to the plugin so that required camera is selected upon creation.

The required code is actually already written (see gst_pylonsrc_select_device and pylonc_print_camera_info), so you can go ahead and implement this property yourself.

thiesmoeller commented 2 years ago

@JMOlmos-cafsig the serial number or user specified name of the device can be given into the DeviceInfo object during the enumeration query

cafsigjolmos commented 2 years ago

@thiesmoeller , do you mean in pylonC api?
i will implement little changes to pylonsrc for initialize device by serialnumber and upload the workaround with a merge request after some testing with basler cameras, @mrstecklo it is ok this way?

mrstecklo commented 2 years ago

I'm not a project owner which is @joshdoe. So I can't make any final decisions. I've just used to contribute to this plugin. So now I'm just sticking around pretending I know something about Pylon. While @joshdoe does not show up very often here. @JMOlmos-cafsig, you are free to make any changes in your fork and open a pull request

joshdoe commented 2 years ago

I'd be happy to review pull requests. All I ask is that you run gst-indent, and follow the GStreamer style of commit messages.

thiesmoeller commented 2 years ago

@JMOlmos-cafsig yes via pylonc API.

If you add this, adding a "open via user name" would be done exactly the same way and would allow to name your camera e.g "Left" and "Right' and makes the app code more readable....