ImageπŸ”—

class visionappster.ImageπŸ”—

A wrapper for the va_image C type.

Images are special in that they contain information about their exact position in the β€œworld”. Unlike other buffer-like data types they can also contain encoded or compressed data that is unsuitable for processing as such.

Furthermore, images are traditionally indexed using pixel coordinates (x, y) in column-major order instead of the other way around like matrices and other multi-dimensional buffers. This class provides methods for both, and you should be careful with argument order.

class SensorTypeπŸ”—

Camera sensor types. The values match the va_camera_sensor_type C enum.

Members:

AREASCAN

LINESCAN

__init__(self: visionappster.Image.SensorType, value: int)NoneπŸ”—
property nameπŸ”—
class TypeπŸ”—

Image types. The values match the va_image_type C enum.

Members:

INVALID

GRAY8

GRAY16

GRAY32

RGB32

ARGB32

ARGB32PREMUL

XRGB32

BGR24

RGB24

RGGB8

BGGR8

GBRG8

GRBG8

YUV444

UYV444

YVU444

UYVY422

YUYV422

VYUY422

YVYU422

UYVYYY411

UYYVYY411

YUV420P

YVU420P

YUV420SP

YVU420SP

RGBX32

XBGR32

COMPRESSED

__init__(self: visionappster.Image.Type, value: int)NoneπŸ”—
property nameπŸ”—
__init__(*args, **kwargs)πŸ”—

Overloaded function.

  1. init(self: visionappster.Image) -> None

Creates an empty, invalid image.

  1. init(self: visionappster.Image, type: va_image_type, width: int, height: int) -> None

Creates an uninitialized image of the given type. The size of the image buffer will be width-by-height pixels.

  1. init(self: visionappster.Image, type: va_image_type, buffer: buffer) -> None

Creates an image of the given type and initial data copied from buffer. buffer must be either two- or three-dimensional and its data type must be compatible with type.

  1. init(self: visionappster.Image, type: va_image_type, shape: List[int]) -> None

Creates an all-zeros image with the given type and shape. Note that shape is expressed row-major order; [480, 640] is a VGA resolution image.

align_with(self: visionappster.Image, image: visionappster.Image)boolπŸ”—
compressed(self: visionappster.Image, format: str)visionappster.ImageπŸ”—

Compresses the image buffer using the given format. Supported formats depend on environment but "PNG”" and "JPEG" are always supported.

decoded(self: visionappster.Image)visionappster.ImageπŸ”—
is_empty(self: visionappster.Image)boolπŸ”—
pixel(self: visionappster.Image, x: int, y: int)objectπŸ”—

Returns the value of the pixel at (x, y). The value of a pixel is either an int or a Color object.

scaled(self: visionappster.Image, width: int, height: int)visionappster.ImageπŸ”—
set_pixel(self: visionappster.Image, x: int, y: int, value: object)NoneπŸ”—

Sets the pixel at (x, y) to value.

subimage(self: visionappster.Image, x: int, y: int, width: int, height: int)visionappster.ImageπŸ”—
to_gray(self: visionappster.Image)visionappster.ImageπŸ”—
to_premultiplied_rgba(self: visionappster.Image)visionappster.ImageπŸ”—
to_rgb(self: visionappster.Image)visionappster.ImageπŸ”—
to_rgba(self: visionappster.Image)visionappster.ImageπŸ”—
static uninitialized(*args, **kwargs)πŸ”—

Overloaded function.

  1. uninitialized(image: visionappster.Image) -> visionappster.Image

  2. uninitialized(type: va_image_type, image: visionappster.Image) -> visionappster.Image

  3. uninitialized(type: va_image_type, width: int, height: int) -> visionappster.Image

static zeros(*args, **kwargs)πŸ”—

Overloaded function.

  1. zeros(image: visionappster.Image) -> visionappster.Image

  2. zeros(type: va_image_type, image: visionappster.Image) -> visionappster.Image

  3. zeros(type: va_image_type, width: int, height: int) -> visionappster.Image

property byte_countπŸ”—

The total number of bytes in image data.

property compression_formatπŸ”—

The compression format as a text string, for example β€œPNG”.

property heightπŸ”—

The height of the image, in pixels.

property shapeπŸ”—

The shape of the image buffer as a list: [height, width].

property strideπŸ”—

The number of bytes between successive rows.

property typeπŸ”—

The type ID of the image.

property type_nameπŸ”—

Human-readable type name.

property widthπŸ”—

The width of the image, in pixels.