Opencv get image properties



Shape can obtain the shape of the image and return tuples containing the number of rows, columns and channels.

Grayscale: returns the number of rows and columns

Color: returns the number of rows, columns, and channels


import cv2
import cv2

Number of pixels

Size can get the number of pixels of the image

Grayscale: Return: number of rows x number of columns

Color: Return: rows x columns x channels


import cv2

image type

Dtype returns the data type of the image


import cv2

This work adoptsCC agreement, reprint must indicate the author and the link to this article


Recommended Today

Knowledge Graph Reasoning for Joint Semantic and Data-Driven Path Representation

original Joint semantics and data-driven path representation for knowledge graph reasoning publishing Neurocomputing Volume 483 Issue C Apr 2022 pp 249–261 declare The copyright belongs to the original author and the publisher. If there is any infringement, please contact to delete Summary Reasoning on large-scale knowledge graphs is of great significance for applications such […]