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…

8b38bac9933740e9d2b565e53df015284e32b993-edit

To Draw a Polygon:
https://docs.opencv.org/master/dc/da5/tutorial_py_drawing_functions.html

To Detect a Polygon:

Also following are some methods that might help you.