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.

TDA4VE-Q1: Mesh image row alignment

Part Number: TDA4VE-Q1

Tool/software:

Hi,

According to the Mesh Lens Distortion Correction (Mesh LDC) documentation, the mesh LUT must have a row alignment of 16-bytes. I understand that the length of each row of the Mesh must be padded with '0' to reach a 16-byte aligned length. 

1. Question: Is it also the case for the height of the Mesh LUT?

----------------

2. Also, I just would like to validate this method:

  1. meshWidth = ceil( (W / 2^m) + 1); // example: 441
  2. align16Bytes(meshWidth)             // meshWidth = 448
  3. fill up with data from 0 to ceil( (W / 2^m) + 1) for every row
  4. fill up with padding ('0') from ceil( (W / 2^m) + 1) to meshWidth (now 448)

Thank you!

  • Hi PL,

    Is it also the case for the height of the Mesh LUT?

    Padding is not required for the number of rows, but mesh size has to be large enough for boundary pixels.

    meshWidth = ceil( (W / 2^m) + 1);

    This is good for valid mesh entries (padding not included).

    441 is the # of entries, not in bytes.

    align16Bytes(meshWidth)

    This is needed for # of bytes (not # of entries)

    fill up with data from 0 to ceil( (W / 2^m) + 1) for every row

    This is fine.

    fill up with padding ('0') from ceil( (W / 2^m) + 1) to meshWidth (now 448)

    Fine too as long as we are consistent in bytes of entries (4 bytes for each entries).

  • I use vxMapImagePatch to map a handle of the vx_image Mesh (input ldc node) to a cv::mat type CV_32FC1 (that we use to fill up the data). The 

    meshAddressing.stride_y is 16-bytes aligned (E.g. 1024), so I assume this guaranties the mesh is 16-bytes aligned?
  • Hi PL,

    meshAddressing.stride_y is 16-bytes aligned

    This is fine.

    I use vxMapImagePatch to map a handle of the vx_image Mesh (input ldc node) to a cv::mat type CV_32FC1

    I am not sure what CV_32FC1 type is and if there is any issue.

    Creating a vx_image as below with the mesh size (# of mesh entries) should be fine.

    mesh_image = vxCreateImage(context, wm, hm, VX_DF_IMAGE_U32);

    Then, you may copy the mesh content into mesh_image.
    By default, the image row pitch should be 16 types aligned by default.