Project - Mask R-CNN with OpenCV for Object Detection

7 / 8

Understanding Mask Processing

We have obtained 100 detections along with their corresponding bounding boxes and mask polygons.

But here is a caveat - we need to filter these detections.

The network might sometimes tend to detect irrelevant objects from the image.

Even here, we could not see 100 objects in our input picture.

Thus, we would only consider the most confident detections (the detections whose confidence score > 0.9 (let us call these as valid detections)).

We would do this filtering using the below steps.

  • If the box confidence score exceeds the threshold, we also process the mask polygons to create the binary format of the mask as follows:

    • Identify all pixels that the mask_polygon covers
    • Resize this mask polygon to the shape of the original mask
    • Now, if the pixel confidence exceeds the threshold create a mask
    • ROI is Region of Interest in the actual picture. Let's color all of the pixels in the ROI
    • The color of ROI is made into a blend of its actual colors and color allocated to classID. Finally, everything is printed.

We execute the code for this process in the next slide.

enter image description here

No hints are availble for this assesment

Answer is not availble for this assesment

Loading comments...