Opencv get image properties

Time:2021-9-22

shape

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

eg:

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

eg:

import cv2

image type

Dtype returns the data type of the image

eg:

import cv2

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

Hacking

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 https://doi.org/10.1016/j.neucom.2022.02.011 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 […]