This project develops an Underwater Imaging System using a Basler camera, a laser module, the Pylon API, and the WiringPi library. It's designed for precise synchronization between image captures and laser signals, beneficial in Particle Image Velocimetry (PIV) systems and similar applications.
Last Edited: Dec-07-2023
- Features
- Requirements
- Installation
- Quick Start
- Configuration
- Troubleshooting
- Hardware Configuration
- Contributing
- References
- Basler camera control via Pylon API.
- Laser pulse synchronization using WiringPi.
- Camera settings configurable through
config.ini
. - Image saving in TIFF format with operation logging.
Concept by @mu-bwang 👩🏻🔬 | Built with ❤️ by @Schutzen
- Basler camera (Pylon API compatible).
- Raspberry Pi (for GPIO control and laser sync).
- Pylon SDK.
- WiringPi library (Raspberry Pi users).
- C++11 or later development environment.
-
Pylon SDK: Install from Basler website.
-
WiringPi (Raspberry Pi): Run
sudo apt-get install wiringpi
. -
Clone Repository:
git clone [repository URL]
. -
Build: Navigate to directory and compile:
g++ -o camera_control main.cpp -lpylon -lwiringPi -lpthread
- Software: Validate Pylon SDK and WiringPi installation, GPIO configuration, C++11 compatibility.
- Hardware: Ensure connections, power supply (18V - 24V), and camera settings are correct.
- Pylon: For camera operations (
<pylon/PylonIncludes.h>
,<pylon/ParameterIncludes.h>
,<pylon/BaslerUniversalInstantCamera.h>
). - WiringPi: GPIO control (
<wiringPi.h>
). - Standard C++ Libraries: General functionalities.
Use bash commands or manually (sudo screen /dev/nACM0
).
cd cam_cpp/src
make
cd ../bin
./piv
For data folder cleanup and general maintenance.
Edit the config.ini
file with specific parameters like exposure time, frequency, dimensions, etc., adhering to the provided format and rules.
Here are the problems happend normally.
-
The laser's light is low
Check the power first
-
Error: Timeout Exception
terminate called after throwing an instance of 'GenICam_3_1_Basler_pylon::TimeoutException' Aborted
This reason might caused by the camera buffer, this might happen in the first time running codes -
error while loading shared libraries: libVimbaCPP.so: cannot open shared object file: No such file or directory
export LD_LIBRARY_PATH=/opt/Vimba_5_0/VimbaCPP/DynamicLib/arm_32bit:$LD_LIBRARY_PATH$
-
error while loading shared libraries: libPvAPI.so: cannot open shared object file: No such file or directory
export LD_LIBRARY_PATH="/home/pi/Desktop/AVT GigE SDK/bin-pc/arm/SF/:$LD_LIBRARY_PATH"
Details GPIO pin assignments for Raspberry Pi 4, including connections for the camera, laser, and RTC module.
GPIO Pin Assignments
Utilizing the WiringPi library, specific pins are designated for various components in this setup:
- Laser and Camera Connection:
GPIO 17 (Pin 11) - Camera unit GPIO 27 (Pin 13) - Laser unit
- Real-Time Clock (RTC) Module Connection:
GPIO 2 SDA (Pin3) - RTC GPIO 3 SCL (Pin5) - RTC
Explains data flow and purpose of different directories (data
, assets
, build
, bin
, download
, tests
, sample
, src
).
Guidelines for contributing, including forking, branching, making changes, and submitting pull requests.
Links to user guides for Makefile, Pylon SDK, Bash, and Linux commands.