This is an interesting task, but sadly there aren't any detailed answers. Let's say I have binarized an image with an object that can be like this: (with some rumors)
Which would be the best way (and maybe the fastest) to determine the bounding box around that triangle? Something like this: