//Finding Image Details //After loading the image with the imread() function, we can then retrieve some simple properties //about it, like the number of pixels and dimensions: import cv2 img = cv2.imread('rose.jpg') print("Image Properties") print("- Number of Pixels: " + str(img.size)) print("- Shape/Dimensions: " + str(img.shape)) //output //Image Properties //- Number of Pixels: 2782440 //- Shape/Dimensions: (1180, 786, 3)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter