ajb974 / Kibble-Kounter1

Apache License 2.0
1 stars 0 forks source link

Camera - Expert Level Instructions #12

Closed mlivai closed 1 year ago

mlivai commented 1 year ago

(1 hr) Prepare detailed instructions showing how the part works and what is can do, at an expert level. (Include photos/screenshots).

mlivai commented 1 year ago

IMAGE 1: Screenshot (642)

[Reference: https://www.raspberrypi.com/documentation/accessories/camera.html]

mlivai commented 1 year ago

The camera can be controlled through the command line and through python code on the Raspberry Pi.

Command Line:

Python Code:

[Reference: https://projects.raspberrypi.org/en/projects/getting-started-with-picamera/3 ]

mlivai commented 1 year ago

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.

The frame rate of a camera is the number of frames recorded per second (fps).

[Reference: https://projects.raspberrypi.org/en/projects/getting-started-with-picamera/7 ]

mlivai commented 1 year ago

The camera is capable of rotating:

[Reference: https://projects.raspberrypi.org/en/projects/getting-started-with-picamera/4 ]

mlivai commented 1 year ago

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_gainsand 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 ]

mlivai commented 1 year ago

[Reference: https://picamera.readthedocs.io/en/release-1.13/faq.html ]

mlivai commented 1 year ago

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 ]

mlivai commented 1 year ago

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]

ajb974 commented 1 year ago

Looks good.