Multi camera selection by serial number

Hello, ild like to select multiple cameras by their serial number. Ild like to do it like this but it seems to be completly random:

self.cameras = sl.Camera.get_device_list()
self.zed_1 = sl.Camera(serial_number=self.cameras[0].serial_number)
self.zed_2 = sl.Camera(serial_number=self.cameras[1].serial_number)

Can someone tell me whats wrong?

Hi @Phyrokar,

It appears that you are not opening the camera properly with the parameters you are expecting.
Initializing the camera is done in the method, which takes sl.InitParameters as input.

You can set the serial number as such:

self.cameras = sl.Camera.get_device_list()

init_param_1 = sl.InitParameters()
self.zed_1 = sl.Camera()

init_param_2 = sl.InitParameters()
self.zed_2 = sl.Camera()
1 Like