[原创]在Raspberry Pi(树莓派)上调用V4L2来操纵摄像头拍照/Use V4L2 on Raspberry Pi to Controll a Webcam to Grab Images

Raspberry Pi是什么?
引用维基百科的一句话:

The Raspberry Pi is a credit card sized single-board computer developed in the UK by the Raspberry Pi Foundation with the intention of stimulating the teaching of basic computer science in schools.

简单地说,它就是一个基于ARM CPU的、信用卡那么大的迷你计算机。

我曾经写过一篇教程,展示了如何调用OpenCV,来控制摄像头拍照。在那篇文章的末尾,我提到了一个遗留问题,即把抓取图像的尺寸设置得稍高一点的时候,那个程序就很容易崩溃;在图像尺寸设置得很低的时候,有时候也会崩溃,我一直没弄明白为什么。
但是在前段时间,由于参赛原因,被迫在很短的时间内解决这个棘手的问题。真可谓是搜了无数网页,最后采取了一种折衷的方式“在很大程度上”解决了这个问题——毕竟还不完美。

阅读更多