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.

A question about the vxuEstimateTransform function in the video stabilization sample

RSun9
新規コントリビューター I
1,363件の閲覧回数

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 件の賞賛
1 解決策
Sergey_L_Intel2
従業員
1,363件の閲覧回数

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.

元の投稿で解決策を見る

2 返答(返信)
Sergey_L_Intel2
従業員
1,364件の閲覧回数

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.

RSun9
新規コントリビューター I
1,363件の閲覧回数

Hi Sergey,

Thanks for the explanation. That makes sense now.

-Robby

返信