h (A, B) = \max_{a \in A} \{ \min_{b \in B} \{ d(a,b)\} \} \\[2mm]
```
Meshlab provides a Hausdorff distance calculation (a filter) so we decided to use it to calculate our quality parameter. For simplicity we used the python library Pymeshlab to automatize the quality calculation.
Meshlab provides a Hausdorff distance calculation (a filter) so we decided to use it to calculate our quality parameter. For simplicity we used the python library Pymeshlab to automatize the quality calculation (see how to section for more details).
The Hausdorff filter provided by Pymeshlab basically selects a number of points a from the set A and searchs for each point a the closest point b of the set B. We can see how the result of the calculation depends strongly on the number of points used of the set A (which it will be called in the program the sampled mesh). It is a good criteria is to use as a number of sampling points the number of vertex of the sampling mesh (or higher).
Although both distances should be calculated, the most representative is the one whose sampling mesh has more density which it is normally the original mesh (in our case the original 3D model).
The Hausdorff filter from Pymeshlad provides the following values as a result:
- min: the minimum distance found between the two meshes
- max: the maximum distance found between the two meshes
- mean: the average distance found between the two meshes
- RMS: standard deviation.
- diag_mesh_0: diagonal of the mesh 0 (sampling mesh)
- diag_mesh_1: diagonal of the mesh 1 (target mesh)
- n_samples: Number of samples used for sampling the sampling mesh
In general terms the two values that are going to be more useful when defining a quality criteria are max and mean.
On one side, the smaller value of max the closest are the two meshes so the better the descomposition has been.
On the other side, the closest the mean is to zero the more points from target mesh are close to the sampling mesh so the overall error distribution is small.
It is important to take into account that, in order to be able to compare different 3D models we should normalize the values of max, min, mean (so that there are not dependant on the size). That is the reason we have diag_mesh_0 and diag_mesh_1 values. A good approach is to use diag_mesh_0 and then obtain the percentage, in this case we could set up a minimum percentage required to consider that the decomposition is well done.