Suppose there is black background with a gray object.
What is the best way to determine a minimal upright rectangle which contains it? For simplicity, let's think that there is no noise or other objects around, but the object itself may be fractured. The simplest approach of findContours(), boundingRect() is not workable.