Opencv Image Properties
OpenCV allows access to image properties. These properties are rows, columns and channels, type of image data, number of pixels.
The img.shape command is used to access the shape of the image. Returns rows, columns and channels.
import cv2
img = cv2.imread('flower.jpg')
print (img.shape)
(400, 400, 3)
The data type of the image is obtained with img.dtype
import cv2
img = cv2.imread('flower.jpg')
print (img.dtype)
Result:
uint8
Comments
Post a Comment