Complete the code to load an image using OpenCV.
import cv2 image = cv2.[1]('image.jpg')
The function imread loads an image from a file into memory.
Complete the code to convert an image to grayscale.
gray_image = cv2.cvtColor(image, [1])cv2.COLOR_BGR2GRAY converts a color image to grayscale.
Fix the error in the code to detect edges using Canny.
edges = cv2.Canny(image, [1], 100)
The first threshold for the Canny edge detector must be a number, not a string or None.
Fill both blanks to create a dictionary of image sizes for images with width greater than 100.
sizes = {img: (img.shape[[1]], img.shape[[2]]) for img in images if img.shape[1] > 100}In OpenCV images, shape[1] is width and shape[0] is height.
Fill all three blanks to filter images by height and create a dictionary of their shapes.
filtered = {img: img.shape for img in images if img.shape[[1]] [2] [3]This code filters images with height greater than 200 pixels and stores their shapes.
