How to get cv2 image shape with NumPy in Python

Getting the shape of a cv2 image returns a tuple containing the height, width, and channels of the image. A cv2 image is represented as a NumPy array of pixels.

Solution for How to get cv2 image shape with NumPy in Python : You can use numpy.ndarray.shape get cv2 image shape with NumPy Access the attribute pixel_array.shape, with pixel_array as the array of the image, to return the shape of the array as a tuple.


how-to-get-cv2-image-shape-with-numpy-in-python