• 04/03/2020
  • Public Content
Contents

Map/Unmap for OpenVX* Images

Your code does not need to re-create an OpenVX* image each time new data (for example, from a camera) arrives. Setting the new image as a graph input might potentially invalidate the graph, so that implicit verification will be triggered.
Also most APIs (that you might want to do interoperability with) provide no guarantees that the pointer returned upon resource mapping will be the same each time. In many cases, it is easier to create a regular OpenVX image instead, and do a data copy each time the image data needs to be updated. Images, just like other OpenVX resources (for example, arrays or matrices), can be manipulated via Map/Unmap:
//create an image in a regular way vx_image image = vxCreateImage(context, 640, 480,VX_DF_IMAGE_RGB); vx_imagepatch_addressing_t addr; vx_map_id map_id; void* ptr = 0; //request a pointer in the system memory system vx_status status = vxMapImagePatch(image, &rect, 0,&map_id, &addr, &ptr, usage, VX_MEMORY_TYPE_HOST, 0); //manipulate image data (referenced by the ptr), e.g. update the values ... //commit back the changes and pass the ownership back to the OpenVX status = vxUnmapImagePatch(image, map_id);

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.