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

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?
  1. Yes you can get more than two of the objects to touch.
  2. No, the deflections can alter where the objects touch.
  3. Yes, they are of similar sizes in area.

댓글을 달려면 로그인하십시오.

답변 (1개)

Matt J
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

I have done that however I have had difficulties splitting objects that have an orientation of 90 degrees. Would an if statement be best to sort out this case?
Matt J
Matt J 2021년 8월 2일
Don't know why 90 degrees is more difficult than any other case.
For this method I am having trouble splitting the ellipses with an angle of 90 degrees since taking the tangent of 90 degrees gives you infinity.
I can isolate the ellipses it is just splitting them that gives me trouble.
Matt J
Matt J 2021년 8월 2일
편집: Matt J 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.
Isn't the equation of a line the reverse?
sin(theta)*(x-xo)+cos(theta)*(yo-y)=0
y=tan(theta)*(x-xo)+yo
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.

댓글을 달려면 로그인하십시오.

제품

릴리스

R2019b

질문:

2021년 7월 30일

댓글:

2021년 8월 2일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by