Sense-GVT / Fast-BEV

Fast-BEV: A Fast and Strong Bird’s-Eye View Perception Baseline
Other
555 stars 84 forks source link

Camera intrinsics overwritten #82

Open Byte247 opened 2 months ago

Byte247 commented 2 months ago

Hi, I am trying to understand the Fast BEV projection code. I noticed that in the NuScenesMultiView_Map_Dataset2 , or more precisely in the NuScenesMultiViewDataset the camera intrinsics are overritten with the identity matrix. Why is that done? In the following pipelines this is not set back to the original values.

new_info = dict(
            sample_idx=data_info['sample_idx'],
            img_prefix=[None] * n_cameras,
            img_info=[dict(filename=x) for x in data_info['img_filename']],
            lidar2img=dict(
                extrinsic=[tofloat(x) for x in data_info['lidar2img']],
                intrinsic=np.eye(4, dtype=np.float32),
                lidar2img_aug=data_info['lidar2img_aug'],
                lidar2img_extra=data_info['lidar2img_extra']
            )
        )
arnoldfychen commented 1 month ago

My understanding:

Because data_info['lidar2img']  is  lidar2img_rt, which is actually intrinsic@lidar2cam_rt.T in NuScenesDataset's get_data_info():
            viewpad = np.eye(4)
            viewpad[:intrinsic.shape[0], :intrinsic.shape[1]] = intrinsic
            lidar2img_rt = (viewpad @ lidar2cam_rt.T)

I guess the code owner wanted to re-establish the intrinsic item in lidar2img (used later in FastBEV's _compute_projection() for scaling) in NuScenesMultiViewDataset's get_data_info(), so, assigned it with an identity matrix, as you know, the value of a matrix doesn't change when the matrix multiply with an identity matrix, i.e., I@A = A