# va_image

## Public Attributes

va_image_type type
int32_t width
int32_t height
size_t stride
va_refcount ref_count
uint32_t time
void* data
int32_t channel_min
int32_t channel_max
va_coordinate_frame world_frame
va_coordinate_frame camera_frame
va_camera_parameters calibration_data
struct va_image* source
void(* destroy)(struct va_image*)

## Detailed Description

An image.

The image structure describes the format of the image and contains a pointer to the start of image data. Images are always stored in row-major order: the data pointer points to the upper left pixel, data + 1 to the pixel to the right of it and data + stride to the beginning of the row below the first one.

The image structure always contains calibration data and a coordinate frame that can be used to map the image to the physical world. This makes it possible to always make measurements in world units (e.g. millimeters) and to easily relate images to each other without using side channels to pass location information. For example, the exact location of a subimage within the original is always known because both images know their location with respect to the world.

## Member Data Documentation

va_camera_parametersva_image::calibration_data

Camera calibration data.

va_coordinate_frameva_image::camera_frame

Camera coordinate system position with respect to world frame. This frame is obtained by inverting world_frame. It is stored in the image to avoid inverting the world frame repeatedly. Use the va_image_set_world_frame() function to set both frames at once.

int32_t va_image::channel_max

The maximum value a color channel in the image can take. Usually, this value is 255 for va_gray8_image_type, but it may be less (e.g. 1 in binary images). If a 10-bit camera is used, channel_max is 1023 even though va_gray16_image_type would allow values up to 32767.

Note that the image may or may not actually contain this value. For example, a binary image (channel_max = 1) may contain just zeros.

int32_t va_image::channel_min

The minimum value a color channel in the image can take. With the va_gray8_image_type, this is always zero. With other gray-level types, channel_min can take a negative value.

Note that the image may or may not actually contain this value. For example, a gray-level image may have no black pixels.

void* va_image::data

Pointer to data (upper left corner).

void(* va_image::destroy)(structva_image*)

Destructor function. Depending on how the image data was originally allocated, it also needs to be deallocated differently. If destroy is non-null, it will be used instead of shm_free() when deallocating a va_image.

int32_t va_image::height

The number of rows in the image.

va_refcount va_image::ref_count

The number of references to this image structure.

struct va_image* va_image::source

Pointer to source image, if this is a subimage.

size_t va_image::stride

The number of bytes between the starts of successive rows. If the image is compressed, stride tells the size of the compressed data in bytes.

uint32_t va_image::time

Acquisition time in user-defined format. This field can be used to store a time stamp or a sequence index for inter-camera synchronization.

va_image_typeva_image::type

The type of the image.

int32_t va_image::width

The number of columns in the image.

va_coordinate_frameva_image::world_frame

World coordinate system position with respect to camera frame.