We used RaspPi 4b 16GB RAM with Raspbian 32 bits.
├── LED.py # turns on IR ring if connected to GPIO
├── record.py # record thread
├── watch.py # processing image thread
|
├── run.sh # bash to run capture
├── test.sh # bash to test the camera stream
├── connect.sh # start the ptp server
|
├── requirements.txt # python requirements
|
└── raspividyuv # modified command to call camera wrapper
-
When installing the Raspbian OS, change the hostname to
camX
, forX
the camera ID number -
Access the Pi remotely (e.g. for camera 0)
- Install requirements
sudo apt-get install ptpd
sudo apt-get install -y libatlas-base-dev libhdf5-dev libhdf5-serial-dev libjasper-dev
pip3 install -r requirements.txt
- Deactivate NTP server
systemctl disable systemd-timesyncd.service
- Start the
ptpd
server
source connect.sh
- Connect a jumper to the GPIO 4 if you want the RPi to trigger the LED
- Test if the camera stream can be opened
source test.sh
- Check the image using VNC server
- Activate VNC in
sudo raspi-config
> Interface- Install VNC viewer in your Desktop and add a new connection with your Rasp IP
- Uncomment
hdmi-hot-plug
inboot/config.txt
if using a Rasp 4- Activate direct capture under VNC server > Options
- If you receive a warning to unsupported privilege, run
sudo vncpasswd -service
- Adjust the blob detectors parameters in
watch.py
to the size of your blob
- Change properties of
params
inwatch.py
- Comment the lines 45 to 54 in
record.py
and uncomment line 55- Uncomment the lines 61 to 67 in
watch.py
- Run
source run.sh
to view the captured blob and centroids- Repeat steps 1 to 3 until all blobs are detected
- Run a capture routine in the server (
mocaprasp cec
,mocaprasp gpe
ormocaprasp scr
) source run.sh
- Press Ctrl+C when capture is finished to avoid waiting for the timeout
You can change the timeout waiting in line 85 of
watch.py
(default: 300 seconds)