Try this -
%%// Read in the image file
img = im2bw(imread(FILE));
%%// Get bounding box stats
stats = regionprops(bwlabel(img),'Area','Centroid','Perimeter','BoundingBox');
Boxes=cat(1,stats.BoundingBox);
%%// Placeholder to store the final result
maskm = false(size(img,1),size(img,2));
for k1 = 1:size(Boxes,1)
%%// Initialize a mask representing each bounding box
mask1 = false(size(img,1),size(img,2));
%%// Get the coordinates of the boxes
starty = round(Boxes(k1,1));
stopy = starty+round(Boxes(k1,3))-1;
startx = round(Boxes(k1,2));
stopx = startx+round(Boxes(k1,4))-1;
%%// Finaly create the mask
mask1(startx:stopx,starty:stopy) = true;
maskm = maskm + imdilate(edge(mask1,'sobel'),strel('disk',2));
end
%%// Get the boxes around the original blobs
maskm = maskm + img;
figure,imshow(maskm);
Output
Look into text on how to label the boxes.