I have been testing background subtraction using gaussian state model. I am using opencv 2.1.0. I can generate binary image of foreground of the scene. Now all I want to do is Draw countour bounding rectangle to highlight the moving object. I have used cvCountourBoundingRect to obtain the rectangle covering countour. The issue I am facing is in case of multiple countour, sometime nearby rectangle overlaps. Here, can anyone suggest me to prevent overlapping of rectangle? In ideal case, two rectangle should not be overlapped. It rather should be draw a bigger rectagle which covers all two rectangles.
Any suggetion will be greatful.