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

ida和bda矩阵的意义是什么? #10

Open
ww249 opened this issue Sep 25, 2023 · 1 comment
Open

ida和bda矩阵的意义是什么? #10

ww249 opened this issue Sep 25, 2023 · 1 comment

Comments

@ww249
Copy link

ww249 commented Sep 25, 2023

..\AeDet\layers\backbones\lss_fpn.py中有这样一段代码:

def get_geometry(self, sensor2ego_mat, intrin_mat, ida_mat, bda_mat):
    """Transfer points from camera coord to ego coord.

    Args:
        rots(Tensor): Rotation matrix from camera to ego.
        trans(Tensor): Translation matrix from camera to ego.
        intrins(Tensor): Intrinsic matrix.
        post_rots_ida(Tensor): Rotation matrix for ida.
        post_trans_ida(Tensor): Translation matrix for ida
        post_rot_bda(Tensor): Rotation matrix for bda.

    Returns:
        Tensors: points ego coord.
    """
    batch_size, num_cams, _, _ = sensor2ego_mat.shape

    # undo post-transformation
    # B x N x D x H x W x 3
    points = self.frustum
    ida_mat = ida_mat.view(batch_size, num_cams, 1, 1, 1, 4, 4)
    points = ida_mat.inverse().matmul(points.unsqueeze(-1))
    # cam_to_ego
    points = torch.cat(
        (points[:, :, :, :, :, :2] * points[:, :, :, :, :, 2:3],
         points[:, :, :, :, :, 2:]), 5)

    combine = sensor2ego_mat.matmul(torch.inverse(intrin_mat))
    points = combine.view(batch_size, num_cams, 1, 1, 1, 4,
                          4).matmul(points)
    if bda_mat is not None:
        bda_mat = bda_mat.unsqueeze(1).repeat(1, num_cams, 1, 1).view(
            batch_size, num_cams, 1, 1, 1, 4, 4)
        points = (bda_mat @ points).squeeze(-1)
    else:
        points = points.squeeze(-1)
    return points[..., :3]

any apply is appreciated!!

@qq1361096516
Copy link

ida是指在图像上做的数据增强得到的数据增强矩阵,只会影响图像内参
bda是指在BEV空间下对GT进行数据增强得到的数据增强矩阵,只会影响到相机到激光雷达的外参

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