Recall & Review
beginner
What does it mean to write or save an image in computer vision?
Writing or saving an image means storing the image data from memory to a file on disk, so it can be viewed or used later.
Click to reveal answer
beginner
Name a common file format used to save images.
JPEG, PNG, BMP, and TIFF are common image file formats used to save images.
Click to reveal answer
beginner
In Python, which library is often used to write images to disk?
OpenCV (cv2) is often used in Python to write images to disk using the function cv2.imwrite().
Click to reveal answer
beginner
What is the basic syntax of cv2.imwrite() to save an image?
cv2.imwrite(filename, image) saves the image to the file named filename.
Click to reveal answer
intermediate
Why is it important to check the return value of cv2.imwrite()?
Because cv2.imwrite() returns True if the image was saved successfully and False if it failed, checking helps confirm the save worked.
Click to reveal answer
Which function in OpenCV saves an image to disk?
✗ Incorrect
cv2.imwrite() is used to write or save images to disk.
What does cv2.imwrite() return if saving the image fails?
✗ Incorrect
cv2.imwrite() returns False if it fails to save the image.
Which image format supports transparency when saving images?
✗ Incorrect
PNG supports transparency (alpha channel), unlike JPEG.
What is the minimum information needed to save an image using cv2.imwrite()?
✗ Incorrect
cv2.imwrite() requires both the filename and the image data.
If you want to save an image as 'output.png', which is the correct call?
✗ Incorrect
The first argument is the filename string, the second is the image data.
Explain how to save an image using OpenCV in Python.
Think about the function name and what inputs it needs.
You got /4 concepts.
List common image file formats and mention one key feature of each.
Consider which formats are good for photos, transparency, or quality.
You got /4 concepts.