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


Supervisor [note] Supervisor – H view supervisor command help Supervisorctl – H view supervisorctl command help Supervisorctl help view the action command of supervisorctl Supervisorctl help any action to view the use of this action 1. Introduction Supervisor is a process control system. Generally speaking, it can monitor your process. If the process exits abnormally, […]