October 2018
Intermediate to advanced
472 pages
10h 57m
English
It's time to use the mask that we created to extract the object from the image. First, we will find the biggest contour using the helper function, which is the largest region of our object that we need to extract. Then apply the mask to the image and draw a circle bounding box on the extracted object:
# Extract biggest bounding boxbig_contour, red_mask = find_biggest_contour(mask_clean)# Apply maskoverlay = overlay_mask(red_mask, image)# Draw bounding boxcircled = circle_countour(overlay, big_contour)show(circled)
Following is the output:

Read now
Unlock full access