Take photos and record videos with multiple Basler cameras at once. Change camera settings and log photo/video information.
Image Grabber allows you to capture images or video with multiple Basler USB Cameras at once. It logs all captured data
to a CSV file for later use.
Tested on Ubuntu 20.04, may not work properly on other Linux distributions. This software is necessary for the code to
compile and run properly.
Devices supported are:
In the project root folder:
make
../ImageGrabber -v -f 60 -o "/myoutput"
.SIGINT
or SIGTERM
signal (Ctrl+C
).-R
(--bwr
) - Balance white (red channel), larger than 0, double precision, (default: auto continuous),-G
(--bwg
) - Balance white (green channel), larger than 0, double precision, (default: auto continuous),-B
(--bwb
) - Balance white (blue channel), larger than 0, double precision, (default: auto continuous),-e
(--exposure
) - Set exposure time in microseconds, range may vary (for example 28 - 1e7), double precision,-f
(--framerate
) - Set framerate (fps) of recording, double precision, (default: 25).-g
(--gain
) - Set gain, range may vary (for example 0 - 23.59), double precision, (default: auto continuous).-h
(--help
) - Show help.-i
(--image
) - Save images instead of video.-o
(--output
) - Set directory for video/image and log output (default: out), directories will be created.-q
(--quality
) - Set image quality (use only together with -i
) between 0 and 100, the higher is the better,-v
(--verbose
) - Print information about the camera state.Saved images are in JPG format.
Saved video is in AVI container.
Saved log information is in CSV file with format shown below. Each captured image on a separate line.
index
- Index of the captured image.mode
- Format of recording: img
or vid
, stays same for one log file.camera
- Camera identification number, stays same for one log file.file_path
- Path to the captured image or video.timestamp_in_ms
- System timestamp of the captured image in milliseconds.iso_datetime
- Datetime of the captured image in ISO format YYYY-MM-DDThh
ss.sss
.exposure_time
- Exposure time of the captured image.gain
- Gain of the captured image.white_balance_r
- Balance white (red channel) of the captured image.white_balance_g
- Balance white (green channel) of the captured image.white_balance_b
- Balance white (blue channel) of the captured image.Cameras can be configured using the arguments when launching the app. Settings are applied to all cameras. Default
values for all available settings are auto continuous
which means that before each image is captured, values are
automatically set. Available settings are stated below.
App detects all Basler cameras connected to the device and starts recording on all of them with the same settings. Once
any camera is disconnected, recording is stopped on all of the cameras. As soon as the disconnected camera is connected
again, the recording is resumed and the newly obtained data is appended.
Each captured image is handled by the OpenCV library and it is saved using it. Videos are also saved with OpenCV.
Capturing images with multiple cameras is parallelized using Pylon library - each camera has its own thread.
Synchronization of capturing images from all cameras at the same time is done by software trigger that is serially sent
to all cameras. Software sleep until the necessary time is used when waiting for the next image. With this mechanism,
precision of +-1 ms is achieved.