A simple multi camera library using PySpin.
-
Increase USB file system memory. In this case, I've set it to 16gb (16000 mb). Please update the number to whatever you think is appropriate for your machine. There are two ways:
-
Open the
/etc/default/grub
file in any text editor. Find and replace:GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
with this:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbcore.usbfs_memory_mb=16000"
-
Update grub with these settings:
$ sudo update-grub
-
Reboot and test a USB camera.
-
Run the following command:
sudo sh -c 'echo 16000 > /sys/module/usbcore/parameters/usbfs_memory_mb'
-
-
After doing either the permanent or temporary way, confirm that you have successfully updated the memory limit by running the following command:
cat /sys/module/usbcore/parameters/usbfs_memory_mb
The output should be 16000.
-
Configure udev rules to allow access to USB devices:
cd /tmp wget https://github.com/justinblaber/multi_pyspin/blob/master/spinnaker-1.23.0.27-amd64-Ubuntu18.04-pkg.tar.gz?raw=true -O spinnaker-1.23.0.27-amd64-Ubuntu18.04-pkg.tar.gz tar xvfz spinnaker-1.23.0.27-amd64-Ubuntu18.04-pkg.tar.gz cd spinnaker-1.23.0.27-amd64 sudo ./configure_spinnaker.sh
-
Download singularity image:
mkdir -p ~/multi_pyspin cd ~/multi_pyspin singularity pull --name multi_pyspin.simg shub://justinblaber/multi_pyspin
-
Run the singularity image:
./multi_pyspin.simg
A gui should appear like so:
-
Set the number of cameras, set/configure the yaml files, press the "setup" buttons, set gain/exposure/fps, then (optionally) start the streams. If successful, the gui should look like:
-
Saving "multi" images should result in something like:
SERIAL_19061245_DATETIME_2019-05-28-22:28:10-795899_CAM_1_FRAMEID_0_COUNTER_1.png
:SERIAL_16276941_DATETIME_2019-05-28-22:28:10-795920_CAM_2_FRAMEID_0_COUNTER_1.png
:SERIAL_16276942_DATETIME_2019-05-28-22:28:10-795941_CAM_3_FRAMEID_0_COUNTER_1.png
:It's important to note that the images should be acquired very closely in time (especially if a hardware trigger is used, in which case the times should be ~1e-3 seconds apart at most) and their frameid's should match.