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?

More than 5 years have passed since last update.

Coral Dev Board で Camera を使ってみる

Posted at

やること

Coral Dev Board に公式カメラをつけて、顔認識させる。

用意

  • Coral Dev Board (設定済み)
  • カメラモジュール (ケーブル突き)

camera

  • 同梱の説明書について
    カメラの仕様が知りたいわけでなく、どうやってDevBoardと繋げるかを知りたいのでありますが、For more information, see g.co/coralと書いてあるのみの紙切れでありました。

URLから想像できるように、これはトップページに行くわけでして、直接カメラの接続方法を知りたいわけです。

上記のURLで無事行けました。ちなみにトップページから意地でも行きたい方は、ProductからSensorsを選び、CameraのView Productを選ぶ。そして、Get Started Guideで無事たどりつけます。

カメラの接続

見た感じ表には接続部分は見あたらないなと思ったら、背面に接続するようになっていました。

  • 黒いラッチを上げます。そうするとCamera Connectorという文字が見えるようになります。
  • ケーブルを白いコネクタに差し込みます。あまり奥まで入りません。その後ラッチを閉じて接続完了です。
  • ケーブルの向きは青い部分が見えるようにです。
  • もしカメラにケーブルが接続していなければ、同じように接続します。私の場合は始めから接続されていました。

IMG_9258_2

デバイスの確認

$ v4l2-ctl --list-formats-ext --device /dev/video1
Failed to open /dev/video1: No such file or directory

公式の通りやってみたのですが、そんなデバイスは無いと怒られました。

$ v4l2-ctl --list-devices
i.MX6S_CSI (platform:30a90000.csi1_bridge):
	/dev/video0

このように確認すべきだった模様です。video1はないけど、video0はあるのねと。

$ v4l2-ctl --list-formats-ext --device /dev/video0
ioctl: VIDIOC_ENUM_FMT
	Index       : 0
	Type        : Video Capture
	Pixel Format: 'YUYV'
	Name        : YUYV 4:2:2
		Size: Discrete 640x480
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 720x480
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1920x1080
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 2592x1944
			Interval: Discrete 0.067s (15.000 fps)
		Size: Discrete 0x0

ちゃんとデバイスデバイスの確認ができた模様です。

デモの実行

ファイルのダウンロード

まずはファイルを置くディレクトリの指定します

$ export DEMO_FILES="$HOME/demo_files"

続いてそこにダウンロードします

$ wget -P ${DEMO_FILES}/ https://github.com/google-coral/edgetpu/raw/master/test_data/mobilenet_v2_1.0_224_quant_edgetpu.tflite
$ wget -P ${DEMO_FILES}/ https://github.com/google-coral/edgetpu/raw/master/test_data/imagenet_labels.txt
$ wget -P ${DEMO_FILES}/ https://github.com/google-coral/edgetpu/raw/master/test_data/mobilenet_ssd_v2_face_quant_postprocess_edgetpu.tflite

顔認識のデモ、ストリーミングサーバ版

まずは一つデモを実行してみます。顔認識のデモ、ストリーミングサーバ版です。

$ edgetpu_detect_server \
--model ${DEMO_FILES}/mobilenet_ssd_v2_face_quant_postprocess_edgetpu.tflite

(edgetpu_detect_server:3632): Gtk-WARNING **: Locale not supported by C library.
	Using the fallback 'C' locale.
INFO:edgetpuvision.streaming.server:Listening on ports tcp: 4665, web: 4664, annexb: 4666
...
...

ウェブブラウザでボードの IP:4664 にアクセスしてください。例えばボードが 192.168.0.100 だったら、 http://192.168.0.100:4664 となります。

Snip20200122_4

Objectsが1。顔が認識されました。

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?