Closed mlivai closed 1 year ago
IMAGE 1:
[Reference: https://www.raspberrypi.com/documentation/accessories/camera.html]
The camera can be controlled through the command line and through python code on the Raspberry Pi.
Command Line:
raspistill -o Desktop/image.jpg
raspistill -o Desktop/image-small.jpg -w 640 -h 480
-raspivid command line tool to record a video
raspivid -o Desktop/video.h264
Python Code:
from picamera import PiCamera
camera = PiCamera()
(Look at Additional Comments Under This Issue For Further Info)[Reference: https://projects.raspberrypi.org/en/projects/getting-started-with-picamera/3 ]
The resolution of the sensor is the number of pixels across the height and the number of pixels across width of the view of the camera.
camera.resolution = (2592, 1944)
The frame rate of a camera is the number of frames recorded per second (fps).
camera.framerate = 15
[Reference: https://projects.raspberrypi.org/en/projects/getting-started-with-picamera/7 ]
The camera is capable of rotating:
camera.rotation = 180
[Reference: https://projects.raspberrypi.org/en/projects/getting-started-with-picamera/4 ]
The images can be captured to a:
Capture to a file (start a preview and capture image to a file):
camera.start_preview()
camera.capture('foo.jpg') #one image
Capture to continuous images with loop:
for filename in camera.capture_continuous('img{counter:03d}.jpg'):
sleep(300) # time to wait between each capture in seconds
Resize a file to a size different than that of the resolution:
camera.capture('filename.jpg', resize=(320, 240))
Capture Consistent Images (Make sure each image is consistent):
Sensitivity: camera.iso = #100/200 for brighter conditions and 400/800 for darker conditions
Exposure time (Amount of time it takes for camera to capture image):
camera.shutter_speed = camera.exposure_speed
Exposure gains: Allow time for analog_gains
and digital_gains
to get to a value and then set camera.exposure_mode = #(off, auto, night, nightpreview, backlight, etc)
[https://projects.raspberrypi.org/en/projects/getting-started-with-picamera/7]
White Balance (Color Balance): camera.awb_mode = #(off, auto, sunlight, cloudy, shade, etc.)
[https://projects.raspberrypi.org/en/projects/getting-started-with-picamera/7], capture camera.awb_gains
into a variable and then set it equal to that variable after awb_mode
is set
Capture a sequence of images with loop:camera.capture_sequence(['image%02d.jpg' % i for i in range(10)])
Capture Image in Low Light: Set slow framerate Set shutter speed to max (6s) Set sensitivity (iso) according to lowlight (800) Set exposure mode to 'off' Capture image
Additional Functions with Images Include:
[Reference: https://picamera.readthedocs.io/en/release-1.13/recipes1.html#capturing-resized-images ]
camera.close()
)or destroyed. This is because when the picamera object is created, the camera itself is already running and this method would allow you to conserve battery life. However, this method of conserving battery life does not allow for the capturing continuous pictures (for example with camera.capture_continuous()
)[Reference: https://picamera.readthedocs.io/en/release-1.13/faq.html ]
The videos can be captured to a:
File:
camera.start_recording('filename.h264')
camera.wait_recording(60) #records for a specified number of seconds
camera.stop_recording()
Multiple Files:
camera.start_recording('1.h264')
camera.wait_recording(5)
for i in range(2, 11):
camera.split_recording('%d.h264' % i)
camera.wait_recording(5)
camera.stop_recording()
Additional Functions With Videos Include:
[Reference: https://picamera.readthedocs.io/en/release-1.13/recipes1.html#recording-video-to-a-file ]
The LED can also be controlled by setting it to FALSE to turn it off and TRUE to keep it on.
The following is an example of this:
camera.led = False
[Reference: https://picamera.readthedocs.io/en/release-1.13/recipes1.html#controlling-the-led]
Looks good.
(1 hr) Prepare detailed instructions showing how the part works and what is can do, at an expert level. (Include photos/screenshots).