This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: TDA4VM: [TDA4] VPAC LDC left issues

Part Number: TDA4VM

Up to now, we have finished demo to realize following targets through VPAC LDC:

input frontview image -- > VPAC(ldc) --> output birdview image

However, I found unreasonable process for my demo, let me describe it in detail.

Take a testcase from vision_apps for example, we offen notice main function as follows:

int main(int argc, char* argv[]) {

AppObj *obj = &gAppObj;

app_parse_cmd_line_args(obj, argc, argv);
app_init(obj);
app_create_graph(obj);
app_run_graph(obj);
app_delete_graph(obj);
app_deinit(obj);

         return 0;
}

That means app_create_graph called at first, app_run_graph secondly, and app_delete_graph

called at last. Meanwhile, you can see that a batch of pics can be dealed in app_run_graph.

I want to learn from upper experience for main function, just call app_create_graph once, and

for every coming frame data, we call app_run_graph every time.That means, every frame must

share many same paras such as app_create_graph created. However, in my demo I have different

3*3 warp matrix for construct ldc node to call tivxVpacLdcNode, so I have to realize my demo

as follows:

int main(int argc, char* argv[]) {

        AppObj *obj = &gAppObj;

        app_parse_cmd_line_args(obj, argc, argv);
        app_init(obj);

        while(1)  {
            app_create_graph(obj);
            app_run_graph(obj);
            app_delete_graph(obj);

        }
        app_deinit(obj);

        return 0;
}

Then, we have to create graph again for every new frame, which consume more time for repeat ops.

In order to optimize upper process, can you offer me a better scheme to create ldc node only once, 

and we can change 3*3 warp matrix value, and pass it to ldc node meanwhile ? 

  • Hello Mr Lei Fu,

    In the current implementation of LDC node, this matrix could be set only at the create time. We could add a control command interface to set this matrix, so that you dont have to create graph everytime. 

    What other parameters do you require to change per frame?

    Regards,

    Brijesh

  • Thank you for reply, it is good news for me.

    For my requirement, I should change 3*3 warp matrix and input image every frame for ldc node.

    As your reply, you describe the solution for my problem, I want to know how to apply it to optimize my demo.

    1. Does control command interface exist for current SDK, or it can be future new interface ?

    2. If you can offer the interface, how to use the interface, can you tell me in detail ?

    Except this problem, if my new frame is coming, input img is changed continuously.

    Whether the changed input image has an impact on my project to just create graph once ? 

  • Hello Mr Lei Fu,

    Please find answers to your questions below,

    This is not supported yet. I was trying to understand if there is any other parameter that requires change. 

    In order to change input image, you will need to read the image into vx_image. Please refer to SDE or DOF example to understand how this is done. You would need to map the buffer in user space and then copy the image into buffer. 

    Rgds,

    Brijesh

  • Hi Brijesh,

    Thanks for your reply! Let me take conformance_tests/test_conformance/test_warpperspective.c as example.

    line:416  ASSERT_VX_OBJECT(node = vxWarpPerspectiveNode(graph, input_image, matrix, arg_->interp_type, output_image), VX_TYPE_NODE);

    in this node creation, we can use pipelining method on parameter input_image and output_image during graph running. And our questions is whether pipelining method can be applied on parameter matrix, and arg_->interp_type during graph running or not? As the matrix should be changing in every frame. if answer is yes. could you please provide the method.

    Thanks a lot!

    Best Regards,

    Samuel

  • Hi Samual,

    The parameter can be made graph parameter and can be pipeline, but this would require change in the LDC node, as currently LDC node does not re-apply configuration in process function. This also requires few changes in the framework.

    For the time being, if i provide control command interface to set LDC configuration, does it work?

    You would be able to set LDC configuration on every frame by calling some IOCTL.. is it ok?

    Regards,

    Brijesh

  • Hello Samuel,

    Please find attached patch, which adds support for control command in LDC node. Using this control command interface, you could set warp matrix on every frame.. 

    0001-Added-control-command-to-set-LDC-parameters.patch

    Rgds,

    Brijesh