К содержимому
  1. Главная
  2. Документация
  3. Камеры для Raspberry Pi
  4. Быстрый старт: камера IMX219 на 8 Мп с моторизованной фокусировкой

Быстрый старт: камера IMX219 на 8 Мп с моторизованной фокусировкой

Документация Arducam · перевод arducam-russia.ru

Камеры

АртикулРазъём (контакты, сторона)СенсорРазрешениеОсобенностиОбъективУгол обзора (Г × В)ФокусировкаЧувствительность к ИК
B018215, н/дIMX2198 МпПрямая замена штатной камерыШтатный65° × 51°МоторизованнаяИК-фильтр 650 нм
B019015, н/дIMX2198 МпПрямая замена штатной камерыШтатный65° × 51°МоторизованнаяИК-фильтр 650 нм
B039315, снизуIMX2198 МпМиниатюрнаяШтатный62,1° × 46,5°АвтофокусИК-фильтр 650 нм

Аппаратная часть

Подключение камеры с моторизованной фокусировкой к Raspberry Pi

ПО

Включение драйвера фокусировки

Выполните команду sudo nano /boot/config.txt и добавьте в раздел [all] файла конфигурации строки ниже — они настраивают камеру и драйвер мотора.

Bookworm и Pi 5

На Pi 5 с Raspberry Pi OS Bookworm нужно заменить файл dtb — выполните шаги ниже.

1. Скачайте архив

cd ~
mkdir imx219_dtb_test
cd imx219_dtb_test
wget https://www.arducam.com/wp-content/uploads/2024/11/imx219_rpi_dtoverlay.zip

2. Распакуйте архив

unzip imx219_rpi_dtoverlay.zip

3. Скомпилируйте и установите

cd imx219_rpi_dtoverlay
./build_and_install.sh

Затем выполните:

sudo nano /boot/firmware/config.txt 
#Find the line: camera_auto_detect=1, update it to:
camera_auto_detect=0
#Find the line: [all], add the following item under it:
dtoverlay=imx219,vcm
#Save and reboot.
Чтобы включить камеру на порту cam0 Pi 5, внесите такие изменения:
sudo nano /boot/firmware/config.txt 
#Find the line: camera_auto_detect=1, update it to:
camera_auto_detect=0
#Find the line: [all], add the following item under it:
dtoverlay=imx219,vcm,cam0
#Save and reboot.

Bookworm/Bullseye и Pi 4

Для Raspberry Pi OS Bookworm/Bullseye на Pi 4 выполните:

Bookworm на Pi 4
sudo nano /boot/firmware/config.txt 
#Find the line: camera_auto_detect=1, update it to:
camera_auto_detect=0
#Find the line: [all], add the following item under it:
dtoverlay=imx219,vcm
#Save and reboot.
Bullseye на Pi 4
sudo nano /boot/config.txt 
#Find the line: camera_auto_detect=1, update it to:
camera_auto_detect=0
#Find the line: [all], add the following item under it:
dtoverlay=imx219,vcm
#Save and reboot.

Bookworm/Bullseye и Pi 0–Pi 3

Для Raspberry Pi OS Bookworm/Bullseye на Pi 0–Pi 3 выполните:

Bookworm на Pi 0–Pi 3
sudo nano /boot/firmware/config.txt 
#Find the line: camera_auto_detect=1, update it to:
camera_auto_detect=0
#Find the line: [all], add the following item under it:
dtoverlay=imx219,vcm
#Save and reboot.
Bullseye на Pi 0–Pi 3
sudo nano /boot/config.txt 
#Find the line: camera_auto_detect=1, update it to:
camera_auto_detect=0
#Find the line: [all], add the following item under it:
dtoverlay=imx219,vcm
#Save and reboot.
  1. Откройте терминал.
  2. Выполните sudo raspi-config.
  3. Перейдите в Advanced Options.
  4. Включите графическое ускорение Glamor.
  5. Перезагрузите Raspberry Pi.

Если возникнут проблемы с выводом изображения на экран, выполните также следующие шаги:

  1. Откройте терминал.
  2. Выполните sudo raspi-config.
  3. Перейдите в Advanced Options.
  4. Перейдите в GL Driver.
  5. Выберите GL (Full KMS).
  6. Перезагрузите Raspberry Pi.

Затем перезагрузите Raspberry Pi, чтобы изменения вступили в силу.

sudo reboot

Установка libcamera от Arducam

Шаг 1. Скачайте bash-скрипт:

wget -O install_pivariety_pkgs.sh https://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver/releases/download/install_script/install_pivariety_pkgs.sh
chmod +x install_pivariety_pkgs.sh

Шаг 2. Установите libcamera:

./install_pivariety_pkgs.sh -p libcamera_dev

Шаг 3. Установите libcamera-apps:

./install_pivariety_pkgs.sh -p libcamera_apps

Управление фокусом на Pi 0–Pi 4

rpicam-still -t 0 --tuning-file /usr/share/libcamera/ipa/rpi/vc4/imx219_af.json

Непрерывный автофокус

rpicam-still -t 0 --autofocus-mode continuous --tuning-file /usr/share/libcamera/ipa/rpi/vc4/imx219_af.json

Однократный автофокус

rpicam-still -t 0 --autofocus-mode auto --tuning-file /usr/share/libcamera/ipa/rpi/vc4/imx219_af.json

Ручная фокусировка

rpicam-still -t 0 --autofocus-mode manual --tuning-file /usr/share/libcamera/ipa/rpi/vc4/imx219_af.json
# Use keyboard to control focus
# "f" trigger one-shot autofocus
# "a" add the lens position, "d" decrease the lens position, the minimum unit of step adjustment is 1
rpicam-still -t 0 --autofocus-mode manual -k --tuning-file /usr/share/libcamera/ipa/rpi/vc4/imx219_af.json

Положение объектива

rpicam-still -t 0 --autofocus-mode manual --lens-position 5 --tuning-file /usr/share/libcamera/ipa/rpi/vc4/imx219_af.json

Автофокус перед съёмкой

rpicam-still -t 0 --autofocus-on-capture --tuning-file /usr/share/libcamera/ipa/rpi/vc4/imx219_af.json

Диапазон фокусировки

# Normal
rpicam-still -t 0 --autofocus-range normal --tuning-file /usr/share/libcamera/ipa/rpi/vc4/imx219_af.json
# Close Focus
rpicam-still -t 0 --autofocus-range macro --tuning-file /usr/share/libcamera/ipa/rpi/vc4/imx219_af.json

Управление фокусом на Pi 5

rpicam-still -t 0 --tuning-file /usr/share/libcamera/ipa/rpi/pisp/imx219_af.json

Непрерывный автофокус

rpicam-still -t 0 --autofocus-mode continuous --tuning-file /usr/share/libcamera/ipa/rpi/pisp/imx219_af.json

Однократный автофокус

rpicam-still -t 0 --autofocus-mode auto --tuning-file /usr/share/libcamera/ipa/rpi/pisp/imx219_af.json

Ручная фокусировка

rpicam-still -t 0 --autofocus-mode manual --tuning-file /usr/share/libcamera/ipa/rpi/pisp/imx219_af.json
# Use keyboard to control focus
# "f" trigger one-shot autofocus
# "a" add the lens position, "d" decrease the lens position, the minimum unit of step adjustment is 1
rpicam-still -t 0 --autofocus-mode manual -k --tuning-file /usr/share/libcamera/ipa/rpi/pisp/imx219_af.json

Положение объектива

rpicam-still -t 0 --autofocus-mode manual --lens-position 5 --tuning-file /usr/share/libcamera/ipa/rpi/pisp/imx219_af.json

Автофокус перед съёмкой

rpicam-still -t 0 --autofocus-on-capture --tuning-file /usr/share/libcamera/ipa/rpi/pisp/imx219_af.json

Диапазон фокусировки

# Normal
rpicam-still -t 0 --autofocus-range normal --tuning-file /usr/share/libcamera/ipa/rpi/pisp/imx219_af.json
# Close Focus
rpicam-still -t 0 --autofocus-range macro --tuning-file /usr/share/libcamera/ipa/rpi/pisp/imx219_af.json

Запросить цену

Укажите количество — пришлём коммерческое предложение.