当初はraspisillを使おうと思ってましたが、RasPi公式の資料によるとfswebcamというのがいいみたい。
www.raspberrypi.org
実際のところ
$ sudo apt install fswebcam
ユーザー名(今回はpi)をユーザーに登録
$ sudo usermod -a -G video pi
$ fswebcam image000.jpg --- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. No input was specified, using the first. Adjusting resolution from 384x288 to 640x480. --- Capturing frame... Captured frame in 0.00 seconds. --- Processing captured image... Writing JPEG image to 'image000.jpg'.
で、とってみたのがこちら。
なんかメッチャ暗いですね。
オプションを設定してみます。
オートフォーカス付きだから大分違うのでは……??
$ fswebcam -F 2 -S 12 image003.jpg --- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. No input was specified, using the first. Adjusting resolution from 384x288 to 640x480. --- Capturing 2 frames... Skipping 12 frames... Capturing 2 frames... Captured 14 frames in 0.55 seconds. (25 fps) --- Processing captured image... Writing JPEG image to 'image003.jpg'.
……輪郭はくっきりしましたが、まだまだですね。
解像度を上げることができるので、Sを増してやってみましょう。
$ fswebcam -r 1920x1080 -F 1 -S 20 image004.jpg --- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. No input was specified, using the first. --- Capturing frame... Skipping 20 frames... Capturing 1 frames... Captured 21 frames in 1.33 seconds. (15 fps) --- Processing captured image... Writing JPEG image to 'image004.jpg'.
ちょっと離れてしまいましたが、輪郭がより明細になり文字も読もうと思えば読めるレベルになりました。