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

campose maybe is not corret #5

Open
Traffic-X opened this issue Mar 13, 2025 · 2 comments
Open

campose maybe is not corret #5

Traffic-X opened this issue Mar 13, 2025 · 2 comments

Comments

@Traffic-X
Copy link

Traffic-X commented Mar 13, 2025

I use the google earth dataset for SFM and transform the cam pose to Colmap format, but I found some mistake, can you give me some advice, process is below
First, I run [dateset_generator.py] to process Google Earth, then the [CameraPoses.csv] can be generated
Second, I read the code in [dateset_generator.py] , cam pose in .csv means Camera2World transform, so I should change it to W2C following Colmap
Finally, I read the code in [inference.py] and [diff_gaussian_rasterization/init.py], I think W2C is also needed for Gaussian render too, then I found "_get_w2c_matrix(self, cam_position, cam_quaternion)" function, I use the same code for Colmap format, but it doesn't work well. For SFM, I use Triangulator directly, but the reconstruction result is wrong.

So I think the cam coord is maybe wrong and also a question for gaussian render, can you give me some advice,

Image

@Traffic-X
Copy link
Author

Image
Use colmap recalib campose without initialization and run spare reconstruciton

@hzxie
Copy link
Owner

hzxie commented Mar 13, 2025

The camera pose must be correct. You can uncomment the following code to verify the camera poses.

# # Debug: Render Instance Map with Gaussian Splatting
# # Revert the cx value for the KITTI 360 dataset. Otherwise, the image cannot be aligned perfectly.
# _cam_rig = copy.deepcopy(cam_rig)
# if dataset == "KITTI_360":
# _cam_rig["intrinsics"][2] = (
# cam_rig["sensor_size"][0] - cam_rig["intrinsics"][2]
# )
# scales = scales[vp_idx]
# import extensions.diff_gaussian_rasterization as dgr
# gr = dgr.GaussianRasterizerWrapper(
# np.array(_cam_rig["intrinsics"], dtype=np.float32).reshape((3, 3)),
# _cam_rig["sensor_size"],
# flip_lr=True,
# flip_ud=dataset == "KITTI_360",
# device=torch.device("cuda"),
# )
# with torch.no_grad():
# gs_points = utils.helpers.get_gaussian_points(
# torch.from_numpy(points[:, :3]).unsqueeze(0),
# scales.unsqueeze(0) * 0.5,
# {
# "rgb": torch.from_numpy(
# utils.helpers.get_ins_colors(points[:, 4])
# ).unsqueeze(0)
# / 255.0
# },
# ).cuda()
# img = gr(gs_points.squeeze(0), cam_pos, cam_quat)
# cv2.imwrite(
# "output/test.jpg",
# img.permute(1, 2, 0).cpu().numpy()[..., ::-1] * 255,
# )

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