Techniques to identify this boundary please?

Hi there, could anyone suggest some techniques to generate boundary polygons like the yellow lines in this image, the input being the red pixels? As you can see there is noise outside the main shape which needs to be ignored, and missing areas within the shape which also need to be ignored. Pointers much appreciated, thank you.
apertureMap_4 boundary

what makes you think the “proper” contour for your point cloud is as you drew it? it could be more intricate…


To Draw a Polygon:

To Detect a Polygon:

Also following are some methods that might help you.