2

I have a set of bounding boxes and I want to bound these bounding boxes with a larger bounding box like in this example . enter image description here

I want to bound close boxes into a bigger bounding box like I would want to have bounding boxes for "Washing","Up","liquid",etc. I tried out clubbing all those boxes which have almost same aspect ratio . But this approach is not that flexible . Can anybody suggest a good approach which is expandable to other examples also.?

Shai
  • 111,146
  • 38
  • 238
  • 371
Deepesh
  • 99
  • 2
  • 11
  • Can you provide any code that you've done to get to this point? Also, provide the original images so we can work on a solution. There are a few suggestions that I would like to make to get you started though: (1) Do some clustering on the bounding boxes. (2) Apply basic morphology to merge nearby boxes together, then do a bounding box detection on this image. Option #2 is the simpler approach, but I can't get started until I get the original inputs you have. – rayryeng Sep 04 '14 at 03:10
  • @rayryeng: The problem with morpholigcal operation is that we have to define a structuring element of some fixed dimensions , which is very difficult to get by . I think you are suggesting morpholical operation to merge two boxes . We can't have a a structing element which generalises to all the boxes spacing .Like in above case spacing between elements of "Washing" is less while it is large in case of "Value" . That's why I refrained myself fro m applying morphological operations . I don't know about the clustering step . Can you please elaborate about it – Deepesh Sep 04 '14 at 03:18
  • 2
    OK, what I would do is for each bounding box, detect the centroids. Then a simple clustering technique I would suggest is to look horizontally by a certain amount and group any centroids that are within this distance to the same group. You could then find the minimum spanning bounding box that encapsulates all of these bounding box. This is quite rudimentary, but I can't test this until I get your original images. – rayryeng Sep 04 '14 at 03:37
  • @rayryeng: right now I am posing the problem as a graph theory problem wherein in each bounding box is a node and our aim is to find all the connected components in the graph . I formulating the graph using the centroid based approach wherein I assign an edge if centroid distance is in certain threshold , but the results are not very specific . It is encapsulating "washing","up" and "liquid" into one box . Here is the link of the image [ http://i.imgur.com/hbXJA6V.jpg ] . I used regionprops matlab command to find the bounding boxes for the connected components . – Deepesh Sep 04 '14 at 03:53
  • 2
    You may find section 3.2 in the paper [Detecting Text in Natural Scenes with Stroke Width Transform (CVPR 2010)](http://www.math.tau.ac.il/~turkel/imagepapers/text_detection.pdf) relevant to your case. You can use SWT implementation from [this answer](http://stackoverflow.com/a/19971599/1714410). – Shai Sep 04 '14 at 10:49
  • @Shai: thanks a lot . This seems like useful . – Deepesh Sep 04 '14 at 11:36

0 Answers0