prs-eth / OverlapPredator

[CVPR 2021, Oral] PREDATOR: Registration of 3D Point Clouds with Low Overlap.
https://shengyuh.github.io/predator/index.html
MIT License
499 stars 70 forks source link

How to creat gt.info and gt.log files #73

Open lcxiha opened 1 year ago

lcxiha commented 1 year ago

Hello, May I ask for how the files of gt.info, gt.log, and gt_overlap.log in OverlapPredator-main\configs\benchmarks\3DMatch\7-scenes-redkitchen generated? What information is required to generate these three files? I have been troubled by this place for a long time. Could you please help me answer it? I would greatly appreciate it!

JosefT-TuDortmund commented 1 year ago

I would also be interested in the details. Especially for the gt.info file.

lcxiha commented 1 year ago

Hello, do you know how the gt.log file is generated? Looking forward to your reply! @JosefT-TuDortmund

JosefT-TuDortmund commented 1 year ago

Yes, I managed to generate them. I did it the following way:

  1. First as a prerequisite you need to have all the transformations that align your point clouds in the world coordinate system. For the 3DMatch dataset they are stored in the cloudbin{id}.info.txt files.
  2. The gt.log file essentially holds the pairwise relative transformations to align two point clouds. this can look like this: 0 1 60 9.96926560e-01 6.68735757e-02 -4.06664421e-02 -1.15576939e-01 -6.61289946e-02 9.97617877e-01 1.94008687e-02 -3.87705398e-02 4.18675510e-02 -1.66517807e-02 9.98977765e-01 1.14874890e-01 0.00000000e+00 0.00000000e+00 0.00000000e+00 1.00000000e+00 The Transformation aligns the first point cloud (here idx 0) with the second (here indx 1). The 60 is the total number of point clouds in the sequence. Lets say you have the transformations for point cloud 0 and point cloud 1 given as T0 and T1. Then you can calculate the relative transformation as: Trel = np.linalg.inv(T0) @ T1 # in python

    For gt_info.log however, I am also clueless. Hope that this helps you :)

lcxiha commented 1 year ago

1.That is to say, if I have the rotation matrix and translation matrix of two frame point clouds in the world coordinate system, can I get the gt.log file? But I have another question: shouldn't the. log file be a log output file? 2.But I found out that the transformation matrix in the cloudbin{id}.info.txt files cannot correspond one-to-one with the transformation matrix in the gt.log file,and I am not quite sure about what does the first line in the cloudbin{id}.info.txt file mean.

JosefT-TuDortmund commented 1 year ago

Yes, the gt.log file corresponds to the relative transformations between the point clouds when they are aligned in the world coordinate system. Idk, how the original generation process of the .log files was. Perhaps the authors of the paper/code can bring some light into this discussion?

For me, the calculation of the relative transformations given the absolute poses within the cloudbin{id}.info.txt files worked fine as I described before. For the first line, the first two numbers are indices for the point clouds. The third number is the total number of point clouds for the scene.

lcxiha commented 1 year ago

Thank you. So I can understand that the generation of the gt.log file is not related to the cloudbin{id}.info.txt file, right?

About the gt.info file, some materials say that it is the Covariance matrix of the transformation matrix, but I don't understand it. @JosefT-TuDortmund

lcxiha commented 1 year ago

And I also found a problem: when I visualized the 3DMatch.pkl file, I found that the corresponding rotation matrix and the rotation matrix of the same pair of point cloud keyframes in the gt.log file were not the same, shouldn't they be the same? @JosefT-TuDortmund

wzm2256 commented 5 months ago

For anyone who wish to know the meaning of gt.log file, please see http://redwood-data.org/indoor/fileformat.html

For anyone who wish to know how to compute the relative pose, I provide a concrete example based on @JosefT-TuDortmund 's answer.

        src_trans = np.loadtxt(src_trans_path, skiprows=1, usecols=None) # load a  *.info.txt file 
        tgt_trans = np.loadtxt(tgt_trans_path, skiprows=1, usecols=None) # load a  *.info.txt file 

        trans_full = np.matmul(np.linalg.inv(tgt_trans), src_trans) 

        assert np.abs(trans_full[:3, :3] - rot).sum() < 1e-2 # rot is the true rotation provided in gt.log or configs/indoor/3DMatch.pkl 

@lcxiha So I can understand that the generation of the gt.log file is not related to the cloud_bin_{id}.info.txt file, right? The statement is not correct.