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.

TDA2XX: SFM_POSE.bin format

the size of SFM_POSE.bin is 330696. How could it be [9 + 12 * N] float values (4 bytes float)?

  • Hi,

    Please check this answer from Deepak:
    e2e.ti.com/.../2343565

    [9 + 12 * N] is the total number of float values, each of them is 32-bit long (8 bytes), N is the number of frames. So we have

    330696 = (9 + 12*N)*8
    41337 = 9+12*N
    41328 = 12*N

    and there are N=3444 frames.

    Regards,
    Yordan
  • it said " All values are 32 bit float.". 4 byte instead of 8 byte.
    Is it all double value 8 byte?

    Regards,
    Xinlu
  • Hi Xinlu,

    Yes, all values are 8 byte.

    Regards,
    Yordan
  • No, It is 4 byte float. I can only read reasonanble values with 4 byte float, where the first 9 data agree with camera's inter parameter. If I read is as 8 byte double, all data messed up.

    Therefore, it must be 4 byte. It is why I raise this question, that (9+12N)*4 can not equal the total file size. Do I have a corrupted SFM_POSE.bin file. If that is the case, can you give me a good one?

    Regards,

    Xinlu

  • Hi Xinlu,

    I have pinged an expert for further help.

    Regards,
    Yordan
  • Hi,

    I suspect some corruption in this file. I believe you must have parsed this file as per the data format given by me earlier. Can you please share the parsed information in float 4 byte format ?

    I can check the validity of the data and will let you know my findings.

    Regards

    Deepak Poddar

  • the first 45 data in my SFM_POSE.bin is

    (array([ 6.66660e+02,  0.00000e+00,  6.40000e+02,  0.00000e+00,
            6.66660e+02,  3.60000e+02,  0.00000e+00,  0.00000e+00,
            1.00000e+00,  1.00000e+00,  0.00000e+00,  0.00000e+00,
            0.00000e+00,  0.00000e+00,  1.00000e+00,  0.00000e+00,
            0.00000e+00,  0.00000e+00,  0.00000e+00,  1.00000e+00,
            0.00000e+00,  1.00000e+00,  0.00000e+00,  0.00000e+00,
            0.00000e+00,  0.00000e+00,  1.00000e+00,  0.00000e+00,
            0.00000e+00,  0.00000e+00,  0.00000e+00,  1.00000e+00,
            0.00000e+00,  9.99994e-01,  3.21913e-03, -1.14692e-03,
            1.25308e-01, -3.21884e-03,  9.99995e-01,  2.50728e-04,
           -5.26145e-02,  1.14772e-03, -2.47035e-04,  9.99999e-01,
           -9.90721e-01], dtype=float32),

    the last 24 data is:

    array([ 9.96781e-01,  2.79001e-02,  7.51552e-02,  1.44736e+00,
           -3.40575e-02,  9.96056e-01,  8.19354e-02, -1.38838e+01,
           -7.25727e-02, -8.42313e-02,  9.93800e-01, -1.04500e+02,
            9.96781e-01,  2.79001e-02,  7.51552e-02,  1.44736e+00,
           -3.40575e-02,  9.96056e-01,  8.19354e-02, -1.38838e+01,
           -7.25727e-02, -8.42313e-02,  9.93800e-01, -1.04500e+02],
          dtype=float32))

    I do not know how to attach the original file in this post.

    Thanks,

    Xinlu

  • Hi Xinlu,

    to attach file when you click "Reply" button there is "Insert Code, Attach Files and more..." to the bottom right which you can use.

    Regards,
    Yordan

  • I tried it. It won't allow me to post after attach the file. Not sure why. Might because that it is a binary file. the file size if not too big.

    Xinlu

  • Hi,

    I did some check on data, and I could not find any problem. However question still remains why this size is not matching formula of (9+12*N)*4.

    first 9 elements [666.66   0.0   6.40000e+02 0.0         6.66660e+02   3.60000e+02   0.0   0.0         1.0] fits for K = [fx, 0 , cx, 0, fy, cy, 0, 0, 1].

    Next 12 elements

    [  1.0   0.0   0.0         0.0
      0.0   1.0   0.0         0.0
      0.0   0.0   1.0         0.0]

    is first P0 matrix of size 3x4.

    Last 12 element

    Pn = [        9.96781e-01   2.79001e-02   7.51552e-02   1.44736e+00
           -3.40575e-02   9.96056e-01   8.19354e-02 -1.39E+01
           -7.25727e-02 -8.42E-02   9.93800e-01 -1.05E+02]

    is also another valid pose matrix as its top-left 3x3 matrix is rotation matrix

    R = [        9.96781e-01   2.79001e-02   7.51552e-02
           -3.40575e-02   9.96056e-01   8.19354e-02
           -7.25727e-02 -8.42E-02   9.93800e-01] 

    This R is valid matrix, as det(R) is 1.0.

    Another R matrix corresponding to P2 is

    R= [  .999994   .00321913 -0.00114692
    -0.00321884   .999995   .000250728
      .00114772 -0.000247035   .999999]

    and determinant of that also is 1.0.

    You can check this for all R matrices. det(R) should be 1, for all pose matrices.

    I am checking internally why the size of this file is not matching the formula, but meanwhile you can check R matrix consistency on all 12 element pose matrices.

    Also I noticed that last pose matrix is same as second last pose matrix. Also first pose matrix is same as second one. Is this two time replication happening for all the pose matrices.

    Regards

    Deepak Poddar

  • Hi,

    One more thing to highlight is that this file "SFM_POSE.bin" is specific to the test sequence used in demo. Since you will be using different test case in your application, so you will not be able to use same file. i.e. for different test case, this data has to be generated freshly.

    Also for this file, read the data as per the suggested format, and whatever is left out at the end, treat that data as not usable data or junk data.

    Thank You