It's a good idea to have a look and check the image is the quality you want, even if you end up with something like this. To get out of the preview, you need to press ctrl and d. If you run this code now, while you're hooked up to a monitor, you should see a preview of your camera and it will freeze every time it takes a photo. # The image is then saved with the name img-timestamp.jpg. # The timestamp has to be in the loop so it takes a current time for each photo. # A loop that takes pictures and names them with the time and date. # Gets the camera on and allows it time to detect light levels # A resolution of 1920 x 1080 is approx 1.1MB per photo. # Change the resolution if you want better/lower quality. # Makes a shorter name for the Pi camera, and sets the resolution. You can use the code timestamp to time stamp the image name, but it puts colons in it, which makes the filenames tricky, and it's why we need to create our own timestamp. You don't need to reboot after this step. This will install the libraries for the camera that we're going to use. Once your Pi has rebooted, open a Terminal again and type: sudo apt-get install python3-picamera This needs doing! Get the libraries for the camera Once you finish with the menu you should get prompted to reboot. You'll need to press 5, then choose option 1 to enable the camera, and then choose yes. In the Terminal, type sudo raspi-config and press Enter. If you're using a camera and a Pi, make sure the camera is connected. This tutorial assumes you have already set up your OctoCam as per the instructions. Use it to make a timelapse of a plant growing with the delay set to a day, or the progress on your building work with hourly photos, or a soldering project with a photo every 5 seconds. More complicated camera operations are covered in Sandy's tutorial about MotionOS, but this is a quick and simple bit of code. This tutorial will guide you through taking photos using a Pi Zero and camera, to make your OctoCam into a simple timelapse-capturing device.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |