If I acquire, segment and at the end process via pcl::ConvexHull a relatively flat face of an object without setting it as 2D or 3D the convexhull sometimes classifies it as 2D, sometimes as 3D (and that is quite normal because it is flat with some noise and some small part of a second side which is not completely filtered out)
but the results I get with getArea() and getVolume() are totally inconsistent and not justified by the slight difference there is between the subsequent acquisitions I obtain from my Intel realsense.
Without moving the object I am getting these results (I quote just two examples): (the object is a box which has a main visible side of 9cm x 20cm -> 0.018 m2 )
(1)
------ output inherent in qhull used by PCL:
Convex hull of 80663 points in 2-d:
Number of vertices: 22 Number of facets: 22
Statistics for: | qhull FA
Number of points processed: 22 Number of hyperplanes created: 42 Number of distance tests for qhull: 532571 CPU seconds to compute hull (after input): 0.006
Total facet area: 0.57170199
Total volume: 0.017460552
----- output from my PCL based application:
Convex cluster hull 0 area (getArea()): 0.0174606
Convex cluster hull 0 vol. (getVolume()): 0
Convex unflatness (1/flatness) : 0
(2)
------ output inherent in qhull used by PCL:
Convex hull of 80571 points in 3-d:
Number of vertices: 86 Number of facets: 151 Number of non-simplicial facets: 11
Statistics for: | qhull FA
Number of points processed: 109 Number of hyperplanes created: 487 Number of distance tests for qhull: 854976 Number of distance tests for merging: 2495 Number of distance tests for checking: 1850 Number of merged facets: 26 CPU seconds to compute hull (after input): 0.008
Approximate facet area: 0.042347971
Approximate volume: 0.00026576258
----- output from my PCL based application:
Convex cluster hull 0 area (getArea()): 0.042348
Convex cluster hull 0 vol.(getVolume()): 0.000265763
Convex unflatness (1/flatness) : 0.200883
(as you can see the clouds are just slightly different) enter image description here
The facet area and facet volume I get in the two cases are totally inconsistent and PCL tries to compensate with it in the first case by loading the volume as if it was an area and by setting the volume to zero (which from my point of view makes the general result even worse).
I don't know what I am missing here but I would expect more similar values of at least the area value, as the surface is basically the same with minimum differences between the two acquisitions. I understand that if the surface of the cloud is classified as 2D or 3D different algorithms are triggered but the value of the convex hull of a flat surface should not be so different. Say it multiplied roughly by 2 considering a 3D convex hull would have 2++ main sides.
I will try to plot now also the polygons of the convex hull to better understand what is going on
thanks