Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6403 Discussions

A question about the vxuEstimateTransform function in the video stabilization sample

RSun9
New Contributor I
935 Views

Hi there,

I have a (possibly naive) question about the function vxuEstimateTransform() in the CV SDK's video stabilization sample.

Per the OpenVX 1.1 Specification: "OpenVX also defines the vxu utility library, which exposes each OpenVX predefined function as a directly callable C function, without the need for first creating a graph. Applications built using the vxu library do not benefit from the optimizations enabled by graphs; however, the vxu library can be useful as the simplest way to use OpenVX and as first step in porting existing vision applications."

As I understand it, the statement above means that the function vxuEstimateTransform() should be in plain C, and should not rely on an OpenVX graph.

However, when I inspected the source code in the sample, I found the implementation of vxuEstimateTransform() clearly based on a graph. This seems to contradict the spec. Why is it so?  Am I missing something?

Thanks,

Robby

0 Kudos
1 Solution
Sergey_L_Intel2
Employee
935 Views

Hi Robby,

First of all, please note this function is not part of the spec. It is a user-defined function that is defined in a way that standard function from the spec are defined.

Vxu function doesn't take vx_graph argument and can be called like any other function to do some computation. It can be implemented anyhow. That statement from the spec means you don't need to create a vx_graph instance to run the function, you just call it instead. The computation is not postponed to vxProcessGraph, it just happens during vxu function call. The sample mimics standard nodes by defining two functions: vx and vxu for EstimateTransform kernel, like defined for all standard nodes. The first function (vx) is used to construct graphs, the second one (vxu) is for direct call. It is common practice to implemented such user-defined vxu function as creating a temporary graph, using vx function to create a single node in that graph, running this graph and destroy it -- all is encapsulated  in vxu function call.

View solution in original post

0 Kudos
2 Replies
Sergey_L_Intel2
Employee
936 Views

Hi Robby,

First of all, please note this function is not part of the spec. It is a user-defined function that is defined in a way that standard function from the spec are defined.

Vxu function doesn't take vx_graph argument and can be called like any other function to do some computation. It can be implemented anyhow. That statement from the spec means you don't need to create a vx_graph instance to run the function, you just call it instead. The computation is not postponed to vxProcessGraph, it just happens during vxu function call. The sample mimics standard nodes by defining two functions: vx and vxu for EstimateTransform kernel, like defined for all standard nodes. The first function (vx) is used to construct graphs, the second one (vxu) is for direct call. It is common practice to implemented such user-defined vxu function as creating a temporary graph, using vx function to create a single node in that graph, running this graph and destroy it -- all is encapsulated  in vxu function call.

0 Kudos
RSun9
New Contributor I
935 Views

Hi Sergey,

Thanks for the explanation. That makes sense now.

-Robby

0 Kudos
Reply