vislearn / dsacstar

DSAC* for Visual Camera Re-Localization (RGB or RGB-D)
BSD 3-Clause "New" or "Revised" License
235 stars 36 forks source link

Generate learned geometry #10

Closed YaroslavShchekaturov closed 2 years ago

YaroslavShchekaturov commented 2 years ago

HI!

Could you please clearify how to generate learned geometry? i've tried to run test.py saving scene_coordinates = scene_coordinates.cpu() cv2.imwrite(str(file),scene_coordinates.permute([0,2,3,1]).numpy()[0]) So I got network predictions, but it is not clear how to generate a point cloud from them. I took all these images and reshaped them to the (N, 3) , but when I visualize them I get following: image

ebrach commented 2 years ago

Hi, I usually just write the scene coordinate predictions into a txt file, with one line per 3D point in the form X Y Z R G B. XYZ is comes from the network, RGB comes from the input image. Just down-size the input image to the same dimensions as the network prediction, and read out colors at the same positions as the predicted 3D point.

These text files can be opened with tools like MeshLab or CloudCompare. You can run Poisson reconstruction on top to get a (crude) mesh.

Hope that helps, Eric

YaroslavShchekaturov commented 2 years ago

Hi Eric!

Thank you very much for you help!

Best, Yaroslav