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

Supervisor

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, […]