Recall & Review
beginner
What is the main OpenCV function used to access a camera stream?
The main function is
cv2.VideoCapture(). It opens the camera stream for capturing video frames.Click to reveal answer
beginner
How do you specify the default camera device in OpenCV?
You pass
0 as the argument to cv2.VideoCapture(0) to open the default camera on your device.Click to reveal answer
beginner
What method do you use to read a frame from the camera stream in OpenCV?
Use the
read() method on the VideoCapture object. It returns two values: a boolean indicating success and the frame image.Click to reveal answer
intermediate
Why is it important to release the camera after use in OpenCV?
Releasing the camera with
cap.release() frees the hardware resource so other programs or processes can use it.Click to reveal answer
beginner
How can you display the camera stream frames in a window using OpenCV?
Use
cv2.imshow(window_name, frame) inside a loop to show each frame. Use cv2.waitKey() to refresh and detect key presses.Click to reveal answer
Which argument opens the default camera in OpenCV?
✗ Incorrect
Passing 0 to cv2.VideoCapture opens the default camera device.
What does the
read() method return?✗ Incorrect
read() returns a tuple: success flag (boolean) and the captured frame.
Why use
cap.release() after capturing video?✗ Incorrect
Releasing the camera frees it for other uses.
Which function shows the video frame in a window?
✗ Incorrect
cv2.imshow() displays an image or frame in a window.
What does
cv2.waitKey(1) do in a video loop?✗ Incorrect
waitKey(1) waits 1 ms and processes GUI events, allowing frame refresh and key detection.
Explain the steps to access and display a live camera stream using OpenCV.
Think about opening, reading, showing, and closing the camera stream.
You got /5 concepts.
Why is it important to handle the camera resource properly in drone programming?
Consider what happens if the camera is not released.
You got /4 concepts.