Skip to content

about generate input ground map #1

@ahtso

Description

@ahtso

Hi Author,

Thanks for your great work,
there is a question about generating the input ground map.
I follow here
and try to generate ground map of KITTI.
But the output is not as my expected.

I remove the flip, scales and rotation part, so the function of get_ground becomes more simple.

    def get_ground(self, folder, flip, transform, out_intrinsic):
        c = self.calibrations[folder]
        cam_to_world = c["cam_to_world"]

        ### if transform is None:
        transform = np.eye(4)
        transform[:3, :3] = c["intrinsic"] @ np.linalg.inv(c["intrinsic_scaled"]) ### it makes transform matrix becomes unit matrix

        w, h = self.width, self.height

        cam_to_world = cam_to_world @ transform ### the extrinsic matrix would not change.
        cam_to_world[2, 3] += 1.65
        u, v = np.meshgrid(range(w), range(h), indexing="xy")
        ground = -cam_to_world[2, 3] / (cam_to_world[2, 0] * u + cam_to_world[2, 1] * v + cam_to_world[2, 2])

        ground[ground < 0] = 0
        ground = ground[None]
        ground = torch.from_numpy(ground.astype(np.float32))

        return ground, cam_to_world[2, 3], torch.tensor(cam_to_world).float()

All I got the ground map becomes all black or nothing.
Can you help to figure out?
Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions