VisionWorks pyramid deep copy

From my understanding, vx_pyramid is just a pointer to a pyramid struct in Visionworks. And it looks like visionworks removed the vxuCopy function from OpenVX to perform deep copy. So if I want to do a deep copy on vx_pyramid, how should I do it?

Also, if I make a shallow copy of vx_pyramid, can I still free it by calling vxReleasePyramid(&copied_pyramid)?

Hi,

Maybe you can just create a new one directly from the image context.
And vxCreatePyramid and vxReleasePyramid should be enough for you.

Thanks.

Hi AastaLLL,

Thank you for your reply!

Recreating a pyramid by calling vxGaussianPyramid() again would be too expensive for me.
Can you tell me if the pyramid can be handled correctly if I just assign an already created pyramid to another vx_pyramid object? Will vxReleasePyramid correctly destroy the original pyramid?

vx_pyramid pyr1;
pyr1 = vxCreatePyramid(
      context,
      3,
      VX_SCALE_PYRAMID_HALF,
      1920,
      1080,
      VX_DF_IMAGE_U8);
vxGaussianPyramid(context, frame, pyr1);
vx_pyramid pyr2 = pyr1;
vxReleasePyramid(&pyr2);

Sorry if my question sounds stupid, I’m just a little confused about the vx_pyramid object and how its reference count is managed in memory.

Hi,

Suppose not.
It looks like you need to release both pyr1 and pyr2 to free the image.

Thanks.