Reputation: 578
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
Upvotes: 0
Views: 819
Reputation: 61
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.
Upvotes: 2