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: [TDA4] VPAC LDC issues

Part Number: TDA4VM

We just want to realize following targets through VPAC LDC:

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

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

Take two pictures for example:

frontview image

https://www.hindawi.com/journals/js/2016/4058093/fig22/

birdview image

https://www.hindawi.com/journals/js/2016/4058093/fig23/

Thus, I have following issues to be resloved:

1 Can you offer us demos to realize upper functions?

If you can offer demos, we can apply it quickly to slove this problem.

2 If you cann't, you should tell us how to realize?

We find that We can use openvx api tivxVpacLdcNode, which has a para for warp_matrix needed to be filled.

For perspective transformation, Warp matrix is a 3x3 matrix with 9th value always = 1. Then, we just to make 

sure 8 parameters which are referred to as {A, B, C, D, E F, G, H}. How to obtain these values?

At first, we use cv2.warpPerspective interface to realize c models for upper functions, we verify right 3*3I

perspective matrix, but how to translate this matrix to {A, B, C, D, E F, G, H}, we try and try again, but always

failed, please tell me why? 

At lase, in your documentation, {G, H} should use S16Q23, which format is unknown for us, can you explain

in detail?

  • Hi,

    >> 1 Can you offer us demos to realize upper functions?
    >> 2 If you cann't, you should tell us how to realize?

    The SDK camera demos (e.g., "vx_app_single_cam.out") run the LDC node, but it requires a supported H/W camera module.
    You will need to program the LUT and other parameters in H/W format and/or c code format there.

    The simplest thing to do is to use the TDA3 or TDA4 DCC tuning tool.
    You may input an image, a LUT, and the other parameters into the tuning tool.
    Then, you can preview the output image and make sure your LUT and parameters are correct.

    The attached slides explain the format of the LUT, LDC parameters and other details about programming LDC.

    Typically, you need to find out you desired coordinate back mapping first and then encode it in proper mesh LUT format.

    >> but how to translate this matrix to {A, B, C, D, E F, G, H}, 

    The 3x3 matrix is in integer format and has integer limitations.
    So, I typically recommend using the mesh LUT directly.

    The matrix is part of the back mapping process (back here means from output to input).
    You first calculate the floating point matrix from output image coordinates to input image image coordinates if mesh LUT is not used.
    For example, if you want to scale down your input image by 2x, then your matrix is "identity matrix * 2" rather than "identity / 2".
    Then, you shall convert the floating point numbers into their integer formats and make sure the quantization error is acceptable.

    >> At lase, in your documentation, {G, H} should use S16Q23, which format is unknown for us, can you explain

    This SnQm notation is the same for all parameters of A ~ H.
    It means signed n-bit integer with a scaling of 2^m on the floating point value, i.e., "floating point value" = "n-bit integer value" / 2^m.

    Best,

    Gang

    J7_ISP_LDC_2020_0128.pdf

  • For demos, I know Zhongming is ready to offer and make effort to know principle for us.

    Upon your reply, you recommend us to use mesh LUT to realize the function for LDC.

    However, because it needs more compute for A72 to make sure LUT mesh, which will

    consume more time, we prefer to use warp matrix for this transformation.

    Then, in your description, “The 3x3 matrix is in integer format and has integer limitations.”

    So, you want us to make sure  whether the quantization error is acceptable.

    Here, can you tell me the integer limitations in detail, and Can you offer some negative

    examples to interpret quantization error ?

    Then, we can evaluate the precision for our actual application. 

  • There is a LDC conformance test "tiovx/tiovx_dev/kernels_j7/hwa/test/test_vpac_ldc.c" which may be useful to you and Ming.

    For the limitation of the matrix, please take a look at the last page in "J7_ISP_LDC_2020_0128.pdf" above.

    For some applications, all possible views may be decided before deployment, then the LUTs and/or matrices may be prepared and verified offline without run-time load on A72.
    At run-time, the LDC H/W also provides interrupts and error flags for errors (please refer to TRM for details).