6.3.1   Remove Bin Based on a Meshed CAD Model

The bin removal based on a meshed CAD model can be realized based on the following steps:
  1. Create a surface model with the meshed CAD model that models the bin (see figure 6.3 b)).
     
    create_surface_model (Model, 0.03, 'model_invert_normals', 'true', SurfaceModelID)
          
  2. Localize the bin.
     
    find_surface_model (SurfaceModelID, Scene, 0.05, 0.2, 0, 'true',[], [], Pose, \
                        Score, SurfaceMatchingResultID)
          
  3. Move the meshed CAD model into the scene.
     
    rigid_trans_object_model_3d (Model, Pose, ObjectModel3DRigidTrans)
          
  4. Reduce the scene to the bin's interior. Therefore, subtract the Z-mappings of the scene and the found CAD model, remove the background by applying a threshold and reduce the scene by view, considering the resulting region.
     
    object_model_3d_to_xyz (XModel, YModel, ZModel, ObjectModel3DRigidTrans, \
                            'cartesian_faces', [CameraParam],[0,0,0,0,0,0,0])
    object_model_3d_to_xyz (XScene, YScene, ZScene, Scene, 'from_xyz_map', [],[])
    sub_image (ZModel, ZScene, ImageSub, 1, 0)
    threshold (ImageSub, Regions, 0.001,1)
    reduce_object_model_3d_by_view (Regions, Scene, [], [], SceneReduced)
          

a) Scene b) CAD model c) Located bin

Figure 6.3: The bin can be found in the scene and removed from it using a CAD model of the bin.