autonomousvision / occupancy_networks

This repository contains the code for the paper "Occupancy Networks - Learning 3D Reconstruction in Function Space"
https://avg.is.tuebingen.mpg.de/publications/occupancy-networks
MIT License
1.49k stars 291 forks source link

Project point clouds to image plane #52

Open LyuJ1998 opened 4 years ago

LyuJ1998 commented 4 years ago

Hello, Thanks for sharing the great code! I am trying to project point clouds to image plane use the function visualise_projection() and the data "world_mat", "camera_mat" provide by the image dataloader. But it seems that the projection is wrong. I wonder is there something more I should do to project pc to image plane in a right way?

vtoborek commented 4 years ago

Hey @LyuJ1998, changing the following code in def visualise_projection()

plt.plot(
        (pimg2[:, 0] + 1) * image.shape[1]/2,
        (pimg2[:, 1] + 1) * image.shape[2]/2, 'x')

to

plt.plot(
        pimg2[:, 0],
        pimg2[:, 1], 'x')

should do the trick.