← Back to Lesson 1

Quiz 1: Images as Arrays

Score: 0 / 4

. What are the three dimensions of a color image array, in order?

array.shape for a color image is (height, width, channels) -- rows first, then columns, then color channel.

. In NumPy indexing img[row, col], what does row correspond to?

The first array axis is the row, which moves down the image -- that's y, not x.

. cv2.imread loads a color image with channels in what order?

OpenCV uses BGR order, the opposite of RGB that Matplotlib and most other libraries expect.

. Passing a cv2.imread-loaded image straight to plt.imshow without converting typically produces what?

Matplotlib interprets the array as RGB, so a BGR array renders with red and blue reversed.