Sign inSign up

gianpaolocoro/open_mesh_reconstructor

By gianpaolocoro

•Updated about 2 years ago

A docker version to execute the Open Mesh Reconstructor algorithm or 3D object reconstruction.

Image
Machine learning & AI
0

1.2K

gianpaolocoro/open_mesh_reconstructor repository overview

⁠Open Mesh Reconstructor

A docker version to execute the Open Mesh Reconstructor algorithm or 3D object reconstruction.

Described in: Coro, G., Palma, M., Ellenbroek, A., Panichi, G., Nair, T., & Pagano, P. (2019). Reconstructing 3D virtual environments within a collaborative e‐infrastructure. Concurrency and Computation: Practice and Experience, 31(11), e5028.

⁠INSTRUCTIONS FOR LINUX OS WITH AN NVIDIA GRAPHIC CARD

Usage notes (LINUX + NVIDIA graphic card):

  1. Enable the NVIDIA runtime for Docker (see https://github.com/NVIDIA/nvidia-docker/issues/1730⁠ if you experience issues and to execute a test)
  2. Collect the images of an object as JPG files. The higher the resolution the better the reconstruction.
  3. Use the following test as an example: https://data.d4science.net/Hh8J⁠
  4. Zip the images into a file named input.zip file (as in the example)
  5. Open a terminal
  6. Go to the directory hosting input.zip (e.g., cd "/home/test/")
  7. Execute the following command:

docker run --runtime=nvidia --gpus all -i --rm -v ${PWD}:/home/docker/ --name omr_latest gianpaolocoro/open_mesh_reconstructor:latest /bin/sh -c "export PATH=/usr/local/cuda-10.0/bin/:$PATH&& nvidia-smi&& nvcc -V && cd /OMR/ && cp /home/docker/input.zip /OMR/ && java -cp ./omr2.jar org.gcube.dataanalysis.imageprocessing.mesh.OpenMeshReconstructorv2 /OMR/input.zip krun ULTRA false false /OMR/reco.zip && cp /OMR/reconstruction.zip /home/docker/reconstruction.zip && chmod 777 /home/docker/reconstruction.zip"

Get the reconstructed point cloud (in PLY format), the object (in .OBJ format), and the texture from reconstruction.zip in the same folder as the input.zip file. An output example can be downloaded here: https://data.d4science.net/omha⁠

⁠INSTRUCTIONS FOR LINUX OS WITHOUT AN NVIDIA GRAPHIC CARD

Usage notes (LINUX WITHOUT an NVIDIA graphic card):

  1. Collect the images of an object as JPG files. The higher the resolution the better the reconstruction.
  2. Use the following test as an example: https://data.d4science.net/Hh8J⁠
  3. Zip the images into a file named input.zip file (as in the example)
  4. Open a terminal
  5. Go to the directory hosting input.zip (e.g., cd "/home/test/")
  6. Execute the following command:

docker run --rm -v ${PWD}:/home/docker/ --name omr_latest_nocuda_linux gianpaolocoro/open_mesh_reconstructor:nocuda /bin/sh -c "cd /OMR/ && cp /home/docker/input.zip /OMR/ && java -cp ./omr3.jar org.gcube.dataanalysis.imageprocessing.mesh.OpenMeshReconstructorv3 /OMR/input.zip ULTRA false && cp /OMR/reconstruction.zip /home/docker/reconstruction.zip && chmod 777 /home/docker/reconstruction.zip"

Get the reconstructed point cloud (in PLY format), the object (in .PLY format), and the texture from reconstruction.zip in the same folder as the input.zip file. An output example can be downloaded here: https://data.d4science.net/qpt6⁠

⁠INSTRUCTIONS FOR WINDOWS WITHOUT AN NVIDIA GRAPHIC CARD

Usage notes (WINDOWS WITHOUT an NVIDIA graphic card):

  1. Collect the images of an object as JPG files. The higher the resolution the better the reconstruction.
  2. Use the following test as an example: https://data.d4science.net/Hh8J⁠
  3. Zip the images into a file named input.zip file (as in the example)
  4. Open a command prompt
  5. Go to the directory hosting input.zip (e.g., cd "/home/test/")
  6. Execute the following command:

docker run --rm -v %cd%:/home/docker/ --name omr_latest_nocuda_win gianpaolocoro/open_mesh_reconstructor:nocuda_winOS /bin/sh -c "cd /OMR/ && cp /home/docker/input.zip /OMR/ && java -cp ./omr3.jar org.gcube.dataanalysis.imageprocessing.mesh.OpenMeshReconstructorv3 /OMR/input.zip ULTRA false && cp /OMR/reconstruction.zip /home/docker/reconstruction.zip && chmod 777 /home/docker/reconstruction.zip"

Get the reconstructed point cloud (in PLY format), the object (in .PLY format), and the texture from reconstruction.zip in the same folder as the input.zip file. An output example can be downloaded here: https://data.d4science.net/qpt6⁠

⁠Parameter explanation

There are only three parameters in the example call: "ULTRA false false"

  1. The first is the ReconstructionAccuracy, which can be one among ULTRA, HIGH, or NORMAL. This is the level of reconstruction accuracy. This parameter has consequences on computational time. Typically, use ULTRA for small images or when object details are not clear. Use HIGH for large collections of medium-size images (100 photos). Use NORMAL for very large collections of high resolution images.

  2. The second is BruteForceSearch, which can be set to false or true. This forces the use of brute force search, which enhances the number of matching points between images. This should be used when the algorithm cannot reconstruct the mesh with the default algorithm (FAST CASCADE HASHING L2). Brute forcing is used by default if ULTRA accuracy is selected.

  3. The third (only available for the NVIDIA-enabled version) is PointCloudOnly, which can be set to false or true. This is an option to generate the point cloud only, without mesh reconstruction. It is useful for fast prototyping, to check the potential results of a set of parameters.

⁠Suggestions

  1. If you are using a Reflex camera, a maximum of 20-30 photos should be sufficient
  2. If you are using a low resolution camera, around 30 photos should be better
  3. For very large objects, areas, and videos, reduce the pictures to a maximum of 300 at 1080p resolution.

Tag summary

Content type

Image

Digest

sha256:c47ce87fb…

Size

11.6 GB

Last updated

about 2 years ago

docker pull gianpaolocoro/open_mesh_reconstructor