Reputation: 2572
I have some lists of images. They always only contain growing objects. For example:
image01:
image 01+n:
image 01+n+n:
image 01+n+n+n:
What do i like to get? (This is the third picture, but modified)
If two (or more) objects merge i like to get the center point of the merge (red point) and also two lines from this point to the background.
I already tried today to solve this problem. I thought it is not so hard, but unfortunately it does not seem to be that easy.
I tried this:
1) For every picture make all objects black
2) Get all objects on every picture. Get the center for each object.
3) Check on every image if on one object is more than one center of a polygon of the previous image. If this is the case two objects merged.
4) If a merge was detected take the centers of the two merged object of the previous frame. Connect them with the A* algorithm on the current frame. Search now the pixel which was white on the previous frame. This is the "merge point".
5) Try now to get the two nearest white points and use them to draw the "break lines" (blue lines on the last image).
Unfortunately this seems not to be that easy and programming this is also hard. Probably an already implemented algorithm (java) exists which could do this job much easier? I implemented everything which I described (quick and dirty), but it is slow and buggy. Something doesn't work and it is hard to debug it. But I think there should be an easier solution.
Upvotes: 2
Views: 368
Reputation: 2682
So your problem is software development and algorithm development.
Because you say buggy and slow: for slow I dont care for now, it has to work; but the buggy is an issue (software development).
Part 3 is essentially correct: you take an object in the current frame and if it contains two objects in the previous frame its a merge.
Your connecting line of centers idea is not correct because the centers can be anywhere and the line will not pass through the connecting region.
Check the change that has happened in the current frame from the previous frame: that will be a hallo around both previous objects. Check the growth (part of this hallo) that is closest to both previous objects. That is take the growth of one object and check which part of the growth is close to the second object; do vice versa. This will give you the merging area.
It's a full project.
Upvotes: 2