0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Raspberry Pi 5でRaspberry Pi AI Cameraを使ってみる

0
Posted at

構成

ハードウェア

  • Raspberry Pi 5
  • Raspberry AI Camera(IMX500)

OS

  • Raspberry Pi OS(Debian 13(Trixie)ベース)
    • デスクトップ環境の描画方式(Wayland)により従来のVNC設定と違う

1. Raspberry Pi OS (Trixie) の初期設定

OSの書き込みと、ディスプレイレス運用に向けた準備をします。

OSの選択

Raspberry Pi Imagerを使用し、Raspberry Pi OS (64-bit) を選択

OSの詳細設定

  • ホスト名
  • ユーザー名/パスワード
  • Wi-Fi設定
  • SSHを有効化

2. VNC(リモートデスクトップ)の構築

VNCを有効化

ターミナルで sudo raspi-config を開き、Interface Options > VNC > Yes を選択します。

sudo raspi-config
再起動
sudo reboot

クライアントPC(Mac/Windows)側の操作

  1. RealVNC Viewer をダウンロードしてインストールします
  2. ラズパイのIPアドレス(または、ホスト名)を入力して接続します

3. Raspberry Pi AI Camera のセットアップ

AI Camera (IMX500) は、カメラ側でAI推論を行うため、専用のファームウェアとライブラリが必要です。

ソフトウェアのインストール

ターミナルで以下のコマンドを実行し、IMX500用のパッケージを導入します。

システムの更新
sudo apt update && sudo apt full-upgrade -y
AI Camera用ファームウェアとツールのインストール
sudo apt install imx500-all -y
再起動して設定を反映
sudo reboot

動作確認

カメラが正しく認識されているか確認します。

Available cameras
-----------------
0 : imx500 [4056x3040 10-bit RGGB] (/base/axi/pcie@1000120000/rp1/i2c@88000/imx500@1a)
    Modes: 'SRGGB10_CSI2P' : 2028x1520 [30.02 fps - (0, 0)/4056x3040 crop]
                             4056x3040 [10.00 fps - (0, 0)/4056x3040 crop]

imx500 の名前が表示されれば成功です。


4. 画像認識の実行

AI Cameraには標準で「物体検出」や「ポーズ推定」のモデルが付属しており、すぐにテスト可能です。VNC越しにプレビュー画面を確認してみましょう。

物体検出 (MobileNet-SSD) の実行

rpicam-hello -t 0 --post-process-file /usr/share/rpi-camera-assets/imx500_mobilenet_ssd.json --viewfinder-width 1280 --viewfinder-height 720
  • -t 0: プレビューを終了せず継続
  • --post-process-file: AI推論(バウンディングボックスの描画など)を指定

僕の環境では、--vflipをオプションで指定しないと、上下逆になっていました。

  • --vflip: 垂直方向に反転させる
  • --hflip: 水平方向に反転させる

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?