Search code examples
maskimage-segmentationtemplate-matching

Segmentation of the non-occluded objects


I'm curious to know what would be a good approach for getting the masks of objects in an image in which we only have many instances of one object (see the image), but just for the instances in which the whole shape is visible.

A box full of similar Levers

I've already tried Mask-RCNN and annotated the fully visible objects for a handful of images.

The annotated image

However, apparently, Mask-RCNN does not care about the fact that I'm interested in getting the masks for the items which are fully visible. It tries to find all the objects, even those which are partially visible, and gives me the all the masks.


Solution

  • After weeks of try and error, I got a proper result by doing the followings:

    • annotate both of the holes on the levers (separately)
    • annotate as many levers as it makes sense in an image (even the partially occluded ones in which their holes are still visible)
    • Filter out the results of Mask-RCNN by checking whether a lever mask also contains two hole masks or not

    This gives a roughly accurate answer. However, I'm still curious to know whether there's a better approach or not.