The presence of duplicate points, i.e., points with identical coordinates, often depends on the sensor's handling of data during the 3D acquisition process. In some cases, parts of the sensor do not register any information, e.g., caused by shading or the reflective features of a surface, which leads to invalid data points. Some 3D sensors remove invalid points, some code them as NaN, and others code them with value 0. If those values are assigned with 0, all the invalid data points will be reconstructed as the (0, 0, 0) coordinate point. In order to check if duplicate points are available, you can use the 'Automatic Value Check' of the procedure debug_find_surface_model or the gray-value histogram of the Z-mapping (see figure 4.3). If duplicate points are present, the matching process will slow down and the 3D-edge extraction will fail.
Figure 4.3: Check for duplicate points with the gray-value histogram of the Z-mapping represented by the peek at value 0.
Duplicate points can be removed by an appropriate threshold on the Z-mapping or by applying the operator select_points_object_model_3d. In the example of figure 4.3 the following two approaches will solve the problem.
Mapping based method:
object_model_3d_to_xyz (XMapping, YMapping, ZMapping, Scene, 'from_xyz_map', [], []) threshold (ZMapping, Region, 0.000001, 1) reduce_object_model_3d_by_view (Region, Scene, CamParam, Pose, SceneReduced)
3D-based approach:
select_points_object_model_3d (Scene, 'num_neighbors_fast 0.000001', 0, 1, SceneReduced)