ethnhe / PVN3D

Code for "PVN3D: A Deep Point-wise 3D Keypoints Hough Voting Network for 6DoF Pose Estimation", CVPR 2020
MIT License
488 stars 105 forks source link

About corner keypoints #25

Closed zx19950617 closed 4 years ago

zx19950617 commented 4 years ago

Hi, @ethnhe , thanks for your excellent work and sharing! Now, I'm confused the coordinates of corner ketpoints. Take ape for example.

In the models_info.yml, the information of ape model is shown as follows: 1: {diameter: 102.09865663, min_x: -37.93430000, min_y: -38.79960000, min_z: -45.88450000, size_x: 75.86860000, size_y: 77.59920000, size_z: 91.76900000} So, I think that one of the corners should be (min_x, min_y, min_z), that is, ( -37.93430000, -38.79960000, -45.88450000).

But the corners.txt you provide in the /lm_obj_kps/ape folder is shown as follows: 图片

Why the (min_x, min_y, min_z) is (-3.982000052928924561e-02, -4.070999845862388611e-02, -3.513399884104728699e-02) which is different from the obj model information in the models_info.yml?

Sorry for my poor English,I hope I expressed my question clearly! Any answer will be appreciated a lot!

Once again, thanks a lot! I'm looking forward to your reply.

ethnhe commented 4 years ago

The corners are obtained following PVNet. Code is as follow:

        ply = PlyData.read(ply_path)
        data = ply.elements[0].data

        x = data['x']
        min_x, max_x = np.min(x), np.max(x)
        y = data['y']
        min_y, max_y = np.min(y), np.max(y)
        z = data['z']
        min_z, max_z = np.min(z), np.max(z)
        corners_3d = np.array([
            [min_x, min_y, min_z],
            [min_x, min_y, max_z],
            [min_x, max_y, min_z],
            [min_x, max_y, max_z],
            [max_x, min_y, min_z],
            [max_x, min_y, max_z],
            [max_x, max_y, min_z],
            [max_x, max_y, max_z],
        ])
        self.corners_3d[class_type] = corners_3d
        np.savetxt(corner_pth,corners_3d)
Michael187-ctrl commented 4 years ago

I cant find that specific PVNet Code. Where can I find it?

zx19950617 commented 4 years ago

Hi, @Michael187-ctrl , PVNet code can be found at https://github.com/zju3dv/pvnet/blob/master/lib/utils/data_utils.py

Michael187-ctrl commented 4 years ago

Thanks for your answer. But I still dont get , why the values of the corners.txt are different from the min_x , min_y and min_z of the object model information. The size_x , size_y and size_z can be gained with the min and max values from the corners.txt. But how do you get the min_x , min_y and min_z , diameter value of the models_info.yml?

pyni commented 4 years ago

@Michael187-ctrl Actually, they are not contradictory. The coordinate centers for models_info.yml and corners.txt are different. You can find 0.03604900091886520386( xmin in corners.txt )+0.03982000052928924561( xmax in corners.txt )=0.07586900144815445 (the size_x in models_info.yml )