googleinterns / IBRNet

Apache License 2.0
486 stars 52 forks source link

normalize pixels? #15

Open AIBluefisher opened 1 year ago

AIBluefisher commented 1 year ago

Hi,

I read the code in projection.py. However, I wonder why we need to normalize the pixels after reprojecting 3D points to the image plane.

    def normalize(self, pixel_locations, h, w):
        resize_factor = torch.tensor([w-1., h-1.]).to(pixel_locations.device)[None, None, :]
        normalized_pixel_locations = 2 * pixel_locations / resize_factor - 1.  # [n_views, n_points, 2]
        return normalized_pixel_locations
xavihart commented 1 year ago

i think it is used for querying feature.

feat_sampled = F.grid_sample(featmaps, normalized_pixel_locations, align_corners=True)

(ibrnet/projection.py:121)