nerfstudio-project / nerfacc

A General NeRF Acceleration Toolbox in PyTorch.
https://www.nerfacc.com/
Other
1.38k stars 112 forks source link

Calculate bounding box? #133

Closed AIBluefisher closed 1 year ago

AIBluefisher commented 1 year ago

Hi, @liruilong940607

I noticed nerfacc has a piece of code for calculating a rough bounding box:

    if args.auto_aabb:
        camera_locs = torch.cat(
            [train_dataset.camtoworlds, test_dataset.camtoworlds]
        )[:, :3, -1]
        args.aabb = torch.cat(
            [camera_locs.min(dim=0).values, camera_locs.max(dim=0).values]
        ).tolist()
        print("Using auto aabb", args.aabb)

The bounding box calculated this way can potentially be too small for the desired area since some cameras observe outside. I wonder whether it is possible to calculate a bounding box from sparse point clouds (reconstructed by COLMAP), or is it necessary?

liruilong940607 commented 1 year ago

If you have access to the point clouds surely it would be good to compute the bbox from that

AIBluefisher commented 1 year ago

I'm implementing this and plan to add it as a feature to nerfacc.