0

Is it possible to find out whether two blobs overlap each other?

Im using two thresholds to sperate the image. Depending on some properties (compactness) and if they touch I want to merge some of those blobs again.

Thanks

Phil
  • 578
  • 2
  • 5
  • 15
  • Can you add more details ? If possible, an example image is recommended. – Abid Rahman K Nov 06 '12 at 19:08
  • I'm doing the same thg but with no luck using cvBlobsLibs. http://stackoverflow.com/questions/13218448/cvblobslib-joinblob-and-addblob – Mzk Nov 07 '12 at 01:22

1 Answers1

2

I had a similar problem. I did some image processing and ended up with several contours. I created bounding boxes and ended up with a bunch of them and some are overlapping. The overlapping ones had to be merged in order to get good ROIs. Here are the two solutions I came up with:

1st: Sweep line algorithm. You can read about this on wikipedia, it is not too hard to implement but I feel like it is kind of slow depending on how many regions you have.

2nd: This is what I am using. I take all my rectangles and build a mask out of them by filling them. that way everything that is overlaping is going to be mergerd automatically. After that you can create a convex hull or something to get new blobs. In my case, if these new blobs overlap again, it doesn't matter, so this looks like a fairly fast solution. Maybe it'll help.

pandaa
  • 61
  • 1
  • 3