1.前言

树莓派作为一台小型电脑,玩法多种多样。本文介绍树莓派控制摄像头的方法。

2.准备工作

1)连接摄像头与树莓派

2)修改树莓派配置,开启摄像头模块。

  1. sudo raspi-config

让树莓派变身照相机——摄像头控制_C/C  _学不可以已-CSDN博客 - 图1

如图所示,选择“Enable Camera”, 保存后将自动重启。

3. 拍摄与查看

接下来,可以进行拍摄了。

  1. raspistill -t 2000 -o image.jpg

raspistill是树莓派控制摄像头拍照的命令,-t制定捕获图片等待时间,单位毫秒 -o输出文件名

查看图片命令

  1. gpicview image.jpg

让树莓派变身照相机——摄像头控制_C/C  _学不可以已-CSDN博客 - 图2

4. 常用命令

  1. 常用命令:
  2. raspistill -t 2000 -o image.jpg
  3. raspistill -t 2000 -o image.jpg -w 640 -h 480
  4. raspistill -t 2000 -o image.jpg -q 5
  5. raspistill -t 2000 -o image.jpg -p 100,100,300,200
  6. raspistill -t 2000 -o image.jpg -n
  7. raspistill -t 2000 -o image.png e png
  8. raspistill -t 2000 -o image.jpg -x IFD0.Artist=Dreamcolor -x GPS.GPSAltitude=1235/10
  9. raspistill -t 2000 -o image.jpg -ifx emboss
  10. raspistill -t 2000 -o image.jpg -cfx 128:128
  11. raspistill -t 2000
  12. raspistill -t 600000 -tl 10000 -o image_num_%d_today.jpg
  13. raspistill -t 2000 -o -
  14. raspistill -t 2000 -o - > my_file.jpg

让树莓派变身照相机——摄像头控制_C/C  _学不可以已-CSDN博客 - 图3 让树莓派变身照相机——摄像头控制_C/C  _学不可以已-CSDN博客 - 图4

发布了10 篇原创文章 · 获赞 17 · 访问量 5万+