Skip to content

Latest commit

 

History

History

B016712MP

PTZ Camera Controller for B016712MP

Hardware Conncetion

Alt text

install dependencies

  • sudo apt update
  • sudo apt install -y libatlas-base-dev python3-opencv python3-picamera2
  • sudo apt install python3-numpy

Download the source code

git clone https://github.com/ArduCAM/PTZ-Camera-Controller.git

Enable the camera module

  • 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

Enable i2c

  1. sudo raspi-config

  2. Select Interface Options and enter

select Interface Option

  1. Select I2C and enter

select i2c

  1. Select YES and press enter to confirm

enable i2c

  1. exit and reboot your Pi to take effect

Run the FocuserExample.py

  • 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.

Alt text

Run the AutofocusTableExample.py

  • 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.

Alt text

Generate autofocus configuration

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.

Refering the link to get more information about the PTZ-Camera-Controller

Pan/Tilt/Zoom Camera