6.3.2   Remove Bin Based on Thresholding

In case that no meshed CAD model of the bin is available, the following approach can be used in order to reduce the scene to the objects inside the bin:
  1. Remove the background plane e.g. with a method described in section “Remove Background Plane”.
  2. Estimate the extents of the bin. Now that the scene is reduced to the bin containing the objects to be localized, the bin is estimated approximately with respect to the scene coordinate system (see figure 6.4 b) ).
     
    smallest_bounding_box_object_model_3d (Scene, 'oriented', BoundingBoxPose, \
                                           Length1, Length2, Length3)
    gen_box_object_model_3d (BoundingBoxPose, Length1, Length2, Length3, BoundingBox)
          
  3. Transform the bin into the center of the estimated smallest bounding box.
     
    pose_invert (BoundingBoxPose, PoseInverted)
    rigid_trans_object_model_3d (Scene, PoseInverted, SceneRigidTrans)
          
  4. Apply a 2D threshold on the X and Y mappings (see figure 6.4 c) and d) ).
     
    object_model_3d_to_xyz (X, Y, Z, SceneRigidTrans, 'from_xyz_map', [], [])
    threshold (X, RegionX, -Length1 / 2 * 0.85, Length1 / 2 * 0.85)
    threshold (Y, RegionY, -Length2 / 2 * 0.85, Length2 / 2 * 0.85)
          
    Alternatively, you can apply a threshold on X- and Y-coordinates using select_points_object_model_3d. In this case the next step can be skipped.
  5. Compute the region of interest by intersecting the X- and Y-mappings and the domain of the scene without background (see the results in figure 6.4 e) and f) ).
     
    intersection (RegionX, RegionY, RegionIntersection)
    intersection (RegionIntersection, SceneDomain, ROI)
    reduce_object_model_3d_by_view (ROI, Scene, 'xyz_mapping', [], SceneReduced)
          

a) Scene b) Bounding box c) Thresholded X-image
d) Thresholded Y-image e) Intersected regions f) Reduced scene

Figure 6.4: After removing the background plane the domain is reduced based on the 2D-mappings of the scene.