Complete the code to crop the image using slicing.
cropped_img = img[[1]:100, 50:150]
The code slices the image from row 20 to 100 and columns 50 to 150, cropping the desired area.
Complete the code to crop the image to a square of size 50x50 pixels starting at (30, 40).
cropped_img = img[[1]:[1]+50, 40:90]
The crop starts at row 30 and goes 50 pixels down, so the slice is from 30 to 80.
Fix the error in the code to correctly crop the image region from (10, 20) to (60, 70).
cropped_img = img[10:[1], 20:70]
The row slice should end at 60 to crop from row 10 to 60.
Fill both blanks to crop a 40x40 pixel square starting at (15, 25).
cropped_img = img[[1]:[2], 25:65]
The crop starts at row 15 and ends at 55 (15 + 40) to get a 40 pixel height.
Fill all three blanks to crop the image from (10, 20) to (60, 70) and convert to grayscale.
cropped_img = img[[1]:[2], [3]:70] gray_img = cv2.cvtColor(cropped_img, cv2.COLOR_BGR2GRAY)
The crop rows go from 10 to 60, columns from 20 to 70, then convert to grayscale.