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

Custom images with colmap get poor results. #273

Open
CuiYan27 opened this issue Dec 28, 2023 · 8 comments
Open

Custom images with colmap get poor results. #273

CuiYan27 opened this issue Dec 28, 2023 · 8 comments

Comments

@CuiYan27
Copy link

Describe the bug

I used DTU images(1600,1200) to build sdfstudio(meta_data.json) from colmap, tested neus-facto, and got a poor results.

Here is my process:

1. I ran the colmap(hloc) and got transfroms.json. The command is:
ns-process-data images
--data ./data/dtu/scan114/image
--sfm_tool hloc
--output-dir ./data/dtu/scan114/nerfstudio

2. I ran the process_nerfstudio_to_sdfstudio.py scripts to get meta_data.json. The command is:
python scripts/datasets/process_nerfstudio_to_sdfstudio.py
--data ./data/dtu/scan114/nerfstudio
--output-dir ./data/dtu/scan114/sdfstudio
--data-type colmap
--scene-type object

3. Then I used neus-facto to start training the model. The command is:
ns-train neus-facto
--experiment-name dtu
--trainer.max-num-iterations 20001
--trainer.save-only-latest-checkpoint False
--trainer.steps_per_save 1000
--pipeline.model.sdf-field.inside-outside False
--vis tensorboard sdfstudio-data
--data ./data/dtu/scan114/sdfstudio

ns-train neus-facto
--experiment-name dtu
--trainer.max-num-iterations 20001
--trainer.save-only-latest-checkpoint False
--trainer.steps_per_save 1000
--pipeline.model.sdf-field.inside-outside False
--vis tensorboard nerfstudio-data
--data ./data/dtu/scan114/nerfstudio

4. Finally, extract mesh with:
ns-extract-mesh
--load-config outputs/dtu/neus-facto/2023-12-28_170416/config.yml
--output-path outputs/dtu/neus-facto/2023-12-28_170416/dtu.ply

ns-extract-mesh
--load-config outputs/dtu/neus-facto/2023-12-28_164550/config.yml
--output-path outputs/dtu/neus-facto/2023-12-28_164550/dtu.ply

But i get wrong mesh. Here is my results:
nerfstudio-data:
1
4

sdfstudio-data:
3
2

Which step went wrong?

@peta-peta
Copy link

Could you please send a picture of the camera poses from the viewer? I figured out that the camera poses are not correctly transformed in step 2 (as per your description).

@CuiYan27
Copy link
Author

CuiYan27 commented Jan 3, 2024

Thank you for your reply! And I want to correct the size of my image, my input size is (384, 384).

I got the camera pose from colmap, and here is my camera pose.
2024-01-03_10-32
2024-01-03_10-31
colmap:
intrinsics:
2024-01-03_10-41
extrinsics:
2024-01-03_11-07

nerfstudio data:
2024-01-03_11-08

sdfstudio data:
2024-01-03_11-09
2024-01-03_11-10
2024-01-03_11-10_1

@peta-peta
Copy link

Thanks! The pose looks good to me. Could you show me the pose in the nerfstudio viewer (after you have executed process_nerfstudio_to_sdfstudio.py), too?

@CuiYan27
Copy link
Author

CuiYan27 commented Jan 5, 2024

Here is the capture of the sdtstudio-data in viewer:
1
2
3

@CuiYan27
Copy link
Author

CuiYan27 commented Jan 5, 2024

@niujinshuchong
Copy link
Member

Hi, I think it might due to the camera normalization. After using colmap, the pose is normalized to [-1, 1] cube but the real object might not be centered in the origin anymore. And in this case, the near and far might not be set correctly to cover the object. I think you can compare you colmap poses with the provided poses.

@hanjoonwon
Copy link

Hi, I think it might due to the camera normalization. After using colmap, the pose is normalized to [-1, 1] cube but the real object might not be centered in the origin anymore. And in this case, the near and far might not be set correctly to cover the object. I think you can compare you colmap poses with the provided poses.

Could you give me an example of how to fix it?

@CuiYan27
Copy link
Author

Hi, I think it might due to the camera normalization. After using colmap, the pose is normalized to [-1, 1] cube but the real object might not be centered in the origin anymore. And in this case, the near and far might not be set correctly to cover the object. I think you can compare you colmap poses with the provided poses.

Could you give me an example of how to fix it?

I think you can use the idr preprocessing method. It can normalized pose to [-1, 1] cube.

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

4 participants