1 | initial version |
Use the OpenCV function findContours
Use the OpenCV function drawContours
Try it with mask as well but I hope so you can find your answer from below links as they relates to your work and they are very clear and understandable