How to get the bounding box of ROI

Im trying to get the bounding box of a footprint image. Im using find contours to draw the bounding boxes, but instead of getting a bounding box for the entire footprint, i am getting bounding boxes for the individual components of the footprint. Using the suggestions made below, I am still not getting the desired results. Here is the code I am using: Mat ROI_Detection::getBoundingBox_Train(Mat inputImage) {
outputImage = inputImage.clone();
Mat imageContours = inputImage.clone();