Reputation: 1
What I am trying is to convert a structure object into an OpenVX array and then conversly extract and print the elements of OpenVx array to verify.
Perhaps this a dummy structure which called Bounding box which has 4 co ordiantes of type float.
typedef struct _FloatRectangle_T
{
float32_t fStartX = 0.f;
float32_t fStartY = 0.f;
float32_t fEndX = 0.f;
float32_t fEndY = 0.f;
} FloatRectangle_T;
typedef struct _BoundingBoxData_T
{
FloatRectangle_T rec;
float conf = 0.f;
} BoundingBoxData_T;
I wanted to convert the object of the below type into a vx array.
BoundingBoxData_T bboxData;
bboxData[index].rec.fStartX = 100;
bboxData[index].rec.fStartY = 200;
bboxData[index].rec.fEndX = 300;
bboxData[index].rec.fEndY = 400;
bboxData[i].conf = 1.0f;
Now I am assuming the below is a vague representation of covnerting structure object into vx array.
m_vxContext = vxCreateContext();
e_vxBB = vxRegisterUserStruct(m_vxContext, sizeof(BoundingBoxData_T));
m_vxBB = vxCreateArray(m_vxContext, e_vxBB, 10);
vxFaceBB = vxAddArrayItems(m_vxBB, 1, Bbox, sizeof(BoundingBoxData_T));
Also please guide on how to extract the elements from vx_array vxFaceBB and print it.
Upvotes: 0
Views: 22