facebookresearch / InterHand2.6M

Official PyTorch implementation of "InterHand2.6M: A Dataset and Baseline for 3D Interacting Hand Pose Estimation from a Single RGB Image", ECCV 2020
Other
675 stars 92 forks source link

came parms used wrong #114

Open yunshangyue71 opened 2 years ago

yunshangyue71 commented 2 years ago

your original image is high resolution, you want to protect the subjects, so the published img is cropped. i think you want make the crop as the original image, but the cam parm you offered is wrong or somthing forgotted. your change your princeple ,for example from (13, 7) to (27,18), the intrisic is not change. your changed the camera ceil's position, but only changed the camera princeple

dataset.py

campos, camrot = np.array(cameras[str(capture_id)]['campos'][str(cam)], dtype=np.float32), \ np.array(cameras[str(capture_id)]['camrot'][str(cam)], dtype=np.float32) focal, princpt = np.array(cameras[str(capture_id)]['focal'][str(cam)], dtype=np.float32), \ np.array(cameras[str(capture_id)]['princpt'][str(cam)], dtype=np.float32)

        joint_world = np.array(joints[str(capture_id)][str(frame_idx)]['world_coord'], dtype=np.float32)# 世界坐标系 joint 3d
        joint_cam = world2cam(joint_world.transpose(1,0), camrot, campos.reshape(3,1)).transpose(1,0) # 相机坐标系joint 3d
        joint_img = cam2pixel(joint_cam, focal, princpt)[:,:2]                                        # 像素坐标 

def cam2pixel(cam_coord, f, c): x = cam_coord[:, 0] / (cam_coord[:, 2] + 1e-8) f[0] + c[0] y = cam_coord[:, 1] / (cam_coord[:, 2] + 1e-8) f[1] + c[1] z = cam_coord[:, 2] img_coord = np.concatenate((x[:,None], y[:,None], z[:,None]), 1) return img_coord why i think you not change intrinsic is , the scale of x and the scale y is equal 2022-04-27 20-14-13 的屏幕截图

yunshangyue71 commented 2 years ago

i use * to replace the precision number

mks0601 commented 2 years ago

I can't get what you're saying. We just resized the original high-resolution images to low-resolution ones without cropping. In other word, we did not crop the original images, but just resized it to a smaller size.