Occluded Point Map

mesh&furniture color_mesh

Description

This repository contains two general functions where it is possible to get:

Function Input Result
A projection of mesh to equirectangular image (JPG file): projection_mesh_to_image 360 image (1024x512 px) equi_img Boundary Mesh mesh Projected Mesh to 360º image project_mesh2equi
A occluded point map from mesh and furniture (PLY file): occluded_point_map Boundary Mesh + Furniturecompl_mesh Occluded Point Map occluded_point_map Number of occluded points Statistics (CSV file) statistics.csv

Table of Contents

  1. Quick start
  2. Source Code Structure
  3. Installation

Quick start

Run next command line:

$ make quick-start

Source Code Structure

├── colorized_mesh
|   ├── colorized_mesh.py
|   ├── obb_tree.py
├── dataloader
|   ├── mesh_dataset.py
├── dataset
|   ├── [...]
|   ├── README.md
├── docs
├── mesh
│   ├── manager.py
│   ├── projection_img_mesh.py
├── misc
│   ├── panostretch.py
│   ├── point2mesh.py
|   ├── tools.py
├── result
|   ├── README.md
├── settings
│   ├── argument_parser.py
│   ├── arguments.py
|   ├── config_files
|       ├── local_config.ini
├── utils
│   ├── save_results.py
├── .gitignore
├── main.py
├── Makefile
├── README.md
└── requirements.txt

Installation

  1. Virtual Environment (Optional)
  2. Requirements

Virtual Environment (Optional)

Install pip3 if it is already not installed on your system:

$ sudo apt install python3-pip

Install Python3-venv if it is already not installed on your system:

$ sudo apt install -y python3-venv

To create a virtual environment, decide upon a directory where you want to place it, and run the venv module as a script with the directory path (Note: the second venv is the name of your virtual environment, so you can choose the one you want):

$ python3 -m venv venv

Once you’ve created a virtual environment, you may activate it and run it:

$ source venv/bin/activate

Install the requirements file:

(venv) $ pip3 install -r requirements.txt

Requirements

This code was tested with the following tools:

  • Python 3.8.10
  • Open3D 0.13.0 (which includes the installation of Numpy and more)
  • Trimesh 3.9.27
  • Pytorch3D 0.3.0 (which includes the installation of torchvision)
  • Vedo 2021.0.3
  • VTK 9.0.3
  • PyVista 0.31.3

Install all the requirements for this project:

pip3 install -r requirements.txt

Installing torch==1.9.0

pip3 install torch

Check the requirements:

pip3 freeze

Settings

The configuration files are in the /config_files folder and the name is local_config.ini.

cat /settings/config_files/local_config.ini
  • The default values are indicated by 'DEFAULT'. Example:
[DEFAULT]
img_path = /Datasets/img
mesh_path = /Datasets/mesh
index = 0

Concepts

Triangle mesh

Reference

A triangle mesh has several properties that can be tested:

  • the manifold property, where the triangle mesh has to be edge manifold and vertex manifold.
    • A triangle mesh is edge manifold, if each edge is bounding either one or two triangles.
    • Triangle mesh is vertex manifold if the star of the vertex is edge-manifold and edge-connected, e.g., two or more faces connected only by a vertex and not by an edge.
  • Another property is the self-intersection.
  • A watertight mesh can be defined as a mesh that is edge manifold, vertex manifold and not self intersecting.
  • if it is orientable, i.e. the triangles can be oriented in such a way that all normals point towards the outside.

More info

There is a function to check those properties in this project here.