- sudo apt update
- sudo apt install -y libatlas-base-dev python3-opencv python3-picamera2
- sudo apt install python3-numpy
git clone https://github.com/ArduCAM/PTZ-Camera-Controller.git
-
Edit the configuration file: sudo nano /boot/config.txt
-
Find the line: camera_auto_detect=1, update it to: camera_auto_detect=0
-
Add the entry under the line [all] at the bottom: dtoverlay=imx477
-
Save and exit
-
sudo raspi-config
-
Select Interface Options and enter
- Select I2C and enter
- Select YES and press enter to confirm
- exit and reboot your Pi to take effect
- cd PTZ-Camera-Controller/B016712MP
- python3 FocuserExample.py
Please note that after opening the program, press the
T
key first and wait for about 8 seconds. The mode will switch from 'Fix' to 'Adjust'. At this point, you can use the keyboard to control Zoom, Focus, IR-CUT, etc.
- cd PTZ-Camera-Controller/B016712MP
- python3 AutofocusTableExample.py
If you're running the program for the first time, place the camera in the desired position and wait five minutes for the camera to generate a focus chart.
The program will automatically read the autofocus file when it starts. If the file is not available, it will prompt the user to generate the autofocus configuration using the dedicated program.
When entering the program to generate the auto-zoom focus configuration, please ensure that the camera is fixed on the desired area for photography.
If the resulting configuration does not yield satisfactory results, press F to regenerate the configuration.
Note:
Compared to FocuserExample.py, the AutofocusTableExample.py provides smoother autofocus. By simply pressing the
↑
and↓
arrow keys, you can automatically adjust the focus and zoom.If your keyboard keys are not functioning, please make sure that you are not in the "Fix" mode. If so, Press
T
to switch to Adjust mode.If you are not satisfied with the autofocus performance, you can press the
R
key to reset the autofocus table and then press the 'F' key to regenerate the autofocus table.