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.
init(self: visionappster.Image) -> None
Creates an empty, invalid image.
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.
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.
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.
uninitialized(image: visionappster.Image) -> visionappster.Image
uninitialized(type: va_image_type, image: visionappster.Image) -> visionappster.Image
uninitialized(type: va_image_type, width: int, height: int) -> visionappster.Image
-
static
zeros
(*args, **kwargs)π Overloaded function.
zeros(image: visionappster.Image) -> visionappster.Image
zeros(type: va_image_type, image: visionappster.Image) -> visionappster.Image
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.
-
class