Bird
0
0
Raspberry Piprogramming~10 mins

Capturing still images in Raspberry Pi - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the camera module.

Raspberry Pi
from picamera import [1]
Drag options to blanks, or click blank then click option'
ACamera
BPiCamera
Cpicamera
DCameraModule
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase 'picamera' instead of 'PiCamera'.
Using 'Camera' which is not the correct class name.
2fill in blank
medium

Complete the code to start the camera preview.

Raspberry Pi
camera = PiCamera()
camera.[1]()
Drag options to blanks, or click blank then click option'
Ashow_preview
Bcapture
Cpreview_start
Dstart_preview
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'capture' which takes a photo, not starts preview.
Using 'preview_start' which is not a valid method.
3fill in blank
hard

Fix the error in the code to capture an image.

Raspberry Pi
camera = PiCamera()
camera.capture('[1]')
Drag options to blanks, or click blank then click option'
Aimage.jpg
Bcapture.jpg
Cphoto.png
Dpicture.bmp
Attempts:
3 left
💡 Hint
Common Mistakes
Using unsupported file extensions like '.bmp' which may not be supported.
Using names that do not end with an image extension.
4fill in blank
hard

Fill both blanks to capture an image with a delay.

Raspberry Pi
import time
camera = PiCamera()
camera.start_preview()
time.[1](5)
camera.[2]('photo.jpg')
camera.stop_preview()
Drag options to blanks, or click blank then click option'
Asleep
Bpause
Ccapture
Dwait
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'pause' or 'wait' which are not valid time module functions.
Using 'start_preview' instead of 'capture' to take a photo.
5fill in blank
hard

Fill all three blanks to capture an image with resolution set.

Raspberry Pi
import time
camera = PiCamera()
camera.[1] = (1920, 1080)
camera.start_preview()
time.[2](3)
camera.[3]('high_res.jpg')
camera.stop_preview()
Drag options to blanks, or click blank then click option'
Aresolution
Bsleep
Ccapture
Dframerate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'framerate' instead of 'resolution' to set image size.
Using 'wait' instead of 'sleep' for delay.
Using 'start_preview' instead of 'capture' to take the photo.