INNER CODE UNIT · Python

show

yashbhalgat/HashNeRF-pytorch · camera_pose_visualizer.py:52

    def show(self):
        plt.title('Extrinsic Parameters')
        plt.show()

if __name__ == '__main__':
    poses = []
    with open(os.path.join('data/nerf_synthetic/chair/', 'transforms_train.json'), 'r') as fp:
        meta = json.load(fp)
        for frame in meta['frames']:
            poses.append(np.array(frame['transform_matrix']))
    t_arr = np.array([pose[:3,-1] for pose in poses])
    maxes = t_arr.max(axis=0)
    mins = t_arr.min(axis=0)
    
    # argument : the minimum/maximum value of x, y, z
    visualizer = CameraPoseVisualizer([mins[0]-1, maxes[0]+1], [mins[1]-1, maxes[1]+1], [mins[2]-1, maxes[2]+1])

    # argument : extrinsic matrix, color, scaled focal length(z-axis length of frame body of camera

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…