How to extract image data from vx_image?

Hi everyone,

I am new to OpenVX. I am finding difficulty in extracting image data from vx_image.

My code:
I am using IYUV 4:2:0 as my input image.
[…]
vx_image gray_scale_image=vxCreateImage(context, width, height, VX_DF_IMAGE_U8);
vxuChannelExtract(context, image, VX_CHANNEL_Y, gray_scale_image);
[…]
vxuSobel3x3(context,gray_scale_image,dx,dy)
[…]

My requirement:
I need to extract image data (Y component data) from “gray_scale_image” and pass it to my own user defined function for further processing.

Questions:

  1. How can I do this?
  2. Are there any OpenVx API’s which allows me to extract the image data?

Thanks in advance.
Kiran

I found it, I used vxAccessImagePatch();.

Is there any other better way to do this in terms of efficiency?

Thanks,
Kiran

[QUOTE=kirank3240;40391]I found it, I used vxAccessImagePatch();.

Is there any other better way to do this in terms of efficiency?

Thanks,
Kiran[/QUOTE]

vxAccessImagePatch is there to guarantee consistent access behavior across a broad range of platforms. The example in the API docs for this function show the various “faster” ways to do it, but all require using Access/Commit idioms. The idea is that a buffer may have been moved to remote device, so this call will bring it back to the CPU to be accessed.

https://www.khronos.org/registry/vx/specs/1.0.1/html/df/d09/group__group__image.html#ga843e7fee2a3df50672bcef8e1ed4af84