|
|
VisionWorks Toolkit ReferenceApril 8, 2016 | 1.4 Release |
This tutorial demonstrates VisionWorks image data object usage.
One of the main data object in VisionWorks is vx_image. It is used to hold images, masks, and motion fields.
An image object is described by its size and format, which are also referred to as image metadata.
An image object has an attribute mechanism, which allows it to query information about the image. Some attributes can be overwritten by the application.
An image object is opaque and does not provide direct access to its own data. Application can map a rectangular sub-region of the image object for access. It is performed via the vxAccessImagePatch method, which accepts the intended usage of mapped memory (read only, write only, read and write) as an additional parameter. The method returns a mapped pointer and vx_imagepatch_addressing_t structure, which describes the layout of the mapped memory.
The vx_imagepatch_addressing_t structure holds full information about mapped patch memory layout : dimensions, steps in pixels, strides in bytes, and scales for sub-samples planes. Application must use this information to iterate pixel data.
After the application finishes manipulation with the mapped patch, it must unmap the image object using vxCommitImagePatch.
After all operations on the image object are finished and the object is not needed by the application, the image must be released. The vxReleaseImage method decrements the reference counter of the image object, and when the counter is equal to zero, the object is destroyed.
Other data objects in VisionWorks use the similar attributes mechanism, access/commit methods, and have the same release behavior.