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

about generate input ground map #1

Open
ahtso opened this issue Oct 18, 2024 · 0 comments
Open

about generate input ground map #1

ahtso opened this issue Oct 18, 2024 · 0 comments

Comments

@ahtso
Copy link

ahtso commented Oct 18, 2024

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!

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

1 participant