Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera intrinsics overwritten #82

Open
Byte247 opened this issue Apr 23, 2024 · 1 comment
Open

Camera intrinsics overwritten #82

Byte247 opened this issue Apr 23, 2024 · 1 comment

Comments

@Byte247
Copy link

Byte247 commented Apr 23, 2024

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
Copy link

arnoldfychen commented May 17, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants