read_image

Function Usage

Decodes and reads images.

For details about the input and output formats and alignment modes, see decode(inputPath, decodeFormat).

This API will be officially deleted in December, 2025. Use decode of the ImageProcessor class.

Prototype

1
read_image(inputPath: str, deviceId: int, decodeFormat: image_format)

Input Parameters

Parameter

Type

Description

inputPath

str

Image path

deviceId

int

Device ID

decodeFormat

image_format enumeration

Decoding format of an input image

Response Parameters

Image object

Exception Throwing Interface

If the ImageProcessor fails to be created or an image fails to be decoded, a runtime exception is thrown.