zju3dv / NeuralRecon

Code for "NeuralRecon: Real-Time Coherent 3D Reconstruction from Monocular Video", CVPR 2021 oral
https://zju3dv.github.io/neuralrecon/
Apache License 2.0
2.03k stars 294 forks source link

a question about transforms code #120

Open MarklearnML opened 1 year ago

MarklearnML commented 1 year ago

Thank to the nice work!But I have some questions about the transforms I just wondering why origin[2] is the const equal to -0.2 , so any vol_origin_parital's z is the const? Isn't the origin of each fragment different? Why is the point of the z-axis constant?

-------adjust volume bounds-------

    num_layers = 3
    center = (torch.tensor(((bnds[0, 1] + bnds[0, 0]) / 2, (bnds[1, 1] + bnds[1, 0]) / 2, -0.2)) - data[       
        'vol_origin']) / self.voxel_size
    center[:2] = torch.round(center[:2] / 2 ** num_layers) * 2 ** num_layers
    center[2] = torch.floor(center[2] / 2 ** num_layers) * 2 ** num_layers
    origin = torch.zeros_like(center)
    origin[:2] = center[:2] - torch.tensor(self.voxel_dim[:2]) // 2
    origin[2] = center[2]
    vol_origin_partial = origin * self.voxel_size + data['vol_origin']