Install a camera
Make sure the Raspberry PI is running a newer version and that the camera is enabled. Enter the command: sudo puni-config and check the enable camera function in number 5. As shown below:
Physically mount the camera to the Raspberry PI, it feels easy to look, if not check out this video tutorial: video shows you how to install the camera
Capture a picture: raspistill
The raspistill command is an image capture tool provided by the Raspberry PI. Enter the following command to get an image and save it to image.jpg
raspistill -o image.jpg -rot 180
Parameter o means output to file; Parameter rot is to rotate the picture 180 degrees, because I asked the camera to line up, so it needs to be rotated. After the command is entered, it will be found that the led on the camera will light up, and it will be extinguished for about 7 seconds. At the same time, the command is completed. View the pictures and find that the imaging is very clear, much better than the usb camera, which is one of the reasons why it is more expensive.
Why does it take seven seconds to take a picture?
Add the -v parameter and view the debugging information: raspistill -o image.jpg -rot 80 -v
You can see a line of information: Time Delay: 5000. Then check the command document and find that the default -t parameter is 5000, that is, wait 5 seconds before taking the photo.
Then increase the speed to set the -t parameter is not fast, it is true, but in the test found that there is no difference in the length of the waiting time when the light is full, and when the light is poor, the short waiting time screen is yellow.
raspistill common parameters
-v: displays debugging information.
-w: indicates the image width
-h: image height
-rot: image rotation Angle. Only 0, 90, 180, and 270 degrees are supported
-o: image output address, such as image.jpg. If the file name is -, the output is sent to the standard output device
-t: Wait time before obtaining an image. The default value is 5000, that is, 5 seconds
-tl: how often the image is captured.
For example:
raspistill -o image%d.jpg -rot 180 -w 1024 -h 768 -t 20000 -tl 5000 -v
What this command means is, take an image 1024px wide, 768px high, rotated 180 degrees, and grab it for a total of 20 seconds, and grab it every 5 seconds. The saved file is called image1.jpg,image2.jpg, and so on.