# 參考: https://www.raspberrypi.com/documentation/accessories/camera.html ### ex2-1 ### # 檢查相機狀態指令 $ vcgencmd get_camera ### ex2-2 ### # 先在家目錄裡,建立一個 Lab 目錄 $ cd ~ $ mkdir Lab # 進入 Lab 目錄,再建立一個 ch02 目錄,並進入 ch02 目錄 $ cd Lab $ mkdir ch02 $ cd ch02 # 參考: https://www.raspberrypi.com/documentation/accessories/camera.html#raspistill # 只預覽 2 秒 (-t),不存檔 $ raspistill -t 2000 # 5 秒後拍照 (預設),檔案 test.jpg (-o) $ raspistill -o test.jpg # 3 秒後拍照,並編碼成 png 格式 (-e),長 640 x 寬 480 $ raspistill -t 3000 -o test.png -e png -w 640 -h 480 ### ex2-3 ### # 參考: https://www.raspberrypi.com/documentation/accessories/camera.html#raspivid # 錄 5 秒 (-t) 1080p30 影片 (預設 w/h = 1920/1080) $ raspivid -t 5000 -o video1920x1080.h264 # 錄 5 秒的 1080p30 影片, 長 640 x 寬 480 $ raspivid -t 5000 -w 640 -h 480 -o video_640x480.h264 ### ex2-4 ### # WinSCP 下載 https://winscp.net/eng/download.php ### ex2-5 ### # Xming 下載 https://sourceforge.net/projects/xming/ ### ex2-6 ### # 看 ex2-3 照片 $ gpicview test.jpg & $ gpicview test.png & ### ex2-7 ### # 修改 X11Forwarding no --> yes $ sudo nano /etc/ssh/sshd_config ### ex2-8 ### # 參考: https://www.raspberrypi.com/documentation/accessories/camera.html # 一般拍照 $ raspistill -t 2000 -o normal.jpg $ gpicview normal.jpg & # 旋轉拍照 $ raspistill -t 2000 --rotation 180 -o rotation.jpg # 旋轉 180 度拍照 $ gpicview rotation.jpg & #負片效果 $ raspistill -t 2000 -ifx emboss -o neg.jpg # 負片效果 (浮雕) $ gpicview neg.jpg &