HBadertscher / Matlab_BaslerCamDriver

A universal MATLAB driver for Basler cameras
MIT License
21 stars 5 forks source link

Problem when connecting multiple cameras #17

Open KlaymenGC opened 8 years ago

KlaymenGC commented 8 years ago

Hello,

When multiple cameras are connected, it seems to read the indices of the cameras in an complete arbitrary manner, for example, if 3 cameras are connected, when I set the parameter for camera 2: baslerSetParameter(2, 'ExposureTimeAbs', 1000) then I want to check the parameter I just set: baslerGetParameter(2,'ExposureTimeAbs','double') It will randomly return the parameter of one of the three cameras.

I think that getting the cameras by its DeviceSerialNumber would work, unfortunately, I'm not quite familiar with C++, could you offer some suggestions? @HBadertscher

Thanks a lot!

HBadertscher commented 8 years ago

I wasn't aware of this bug, that's really bad. What camera interface and Pylon version do you use? Is it only if you unplug and replug the camera, or also if you leave them plugged in (and don't restart MATLAB)?

The solution I have in mind is to provide a similar interface like the videoinput class, and provide init, read, set, ... functions to this objects. How to do that is briefly discussed here and here. This would also fix several issues with speed, as the camera doesn't need to be initialized in every call.

Unfortunately, I am quite busy with other projects at the moment, and I don't think I'll be able to implement this before summer 2016 (or maybe even later...). If somebody would offer his/her help, I'd be happy to offer write-access to this repository (or maybe move it to an organization).

I'll take a look at the DeviceSerialNumber in the next few days and look if I can do a quick fix for that.

KlaymenGC commented 8 years ago

Thanks for the reply, I'm using pylon 4 for the moment. This happens when I keep them plugged in (and don't restart MATLAB).