How can I separate objects in a Binary Image?
显示 更早的评论
I am having trouble separating objects in this binary image. I am coding an algorithm to match deflections in a hexagonal grid. I am having diffculties separating all objects in the image through watershedding. Here is an example image. Most of the objects (pillars) are fine, but some critical ones come into such close contact with each other that they do not separate well at all and form these ellipitical objects (there are three in this image). I have tried isolating these objects using regionprops() but I have been having troube bisecting them.
Any ideas on how to separate these objects? I am hoping to automate this as it is a single frame in a movie. Any help is appreciated!

2 个评论
Walter Roberson
2021-7-31
Are there ever times when more than two of the objects can appear to touch?
Is it correct that the only possible touch geometries are at multiples of 60 degrees? Or can the "deflections" alter that?
Are the blobs a fixed size?
Elijah Holland
2021-8-2
回答(1 个)
Matt J
2021-7-31
0 个投票
What if you use regionprops to find the minor axis of the ellipse-shaped blobs and split them along that axis?
6 个评论
Elijah Holland
2021-8-2
Matt J
2021-8-2
Don't know why 90 degrees is more difficult than any other case.
Elijah Holland
2021-8-2
I don't see why you would be computing tan(90). The distance from a point (x,y) to a line is given by
distance = abs( sin(theta)*(x-x0)+cos(theta)*(y-y0) )
If you are obtaining tan(theta) because you are dividing the above equation by cos(theta) for some reason, don't do so.
Elijah Holland
2021-8-2
Matt J
2021-8-2
To find the distance from a point (x,y) to a line, this is the equation that you need.
distance = abs( sin(theta)*(x-x0)+cos(theta)*(y-y0) )
It works for any theta.
类别
在 帮助中心 和 File Exchange 中查找有关 Image Arithmetic 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!