Check Overlap Between Circles

조회 수: 5 (최근 30일)
Daniel Liberman
Daniel Liberman 2020년 2월 16일
댓글: Walter Roberson 2020년 2월 17일
Hi,
I have the diameters and distances of n circles from one another. Each pair of circles which sum of diameters is grater than half the distance between them (0.5*dij<di+dj) should be overlaped by a circle tangent to both of them(Dij=dij+0.5*(di+dj)). If multiple circles are overlaped by this manner, they should all be overlaped by a circle tangent to the two most distant original circles (even if those two are not directly overlaped by the manner above).
How can I find the overlap for multiple circles? Is there an efficient to do this?
Thank you
  댓글 수: 3
Daniel Liberman
Daniel Liberman 2020년 2월 17일
How can I use sets to find the total overlap for multiple circles in the manner above?
and lets say that insted of distances between the circles I have the exact x and y coordinates for each circle
Walter Roberson
Walter Roberson 2020년 2월 17일
Create a cell array of sets (a set in matlab is represented by a numeric vector). Start it out as num2cell(1:number_of_circles) -- so each circle is in its own set.
When you determine that two circles are overlapping in the appropriate way, then for each of the two circle indices, find the index in the cell array of the set that the circle index belongs to. If the two are the same, then they are already both entered in the same set and you do not need to do anything. Otherwise, merge the contents of the higher numbered one into the lower numbered one, removing the higher numbered one.
Afterwards, prune out the sets that only have a single entry -- they do not have any overlap.
Now each set is a list of circle indices that mutually overlap. You can use the coordinates to find the two most distant circles in the set, and you can create the appropriate tangent circle.
and lets say that insted of distances between the circles I have the exact x and y coordinates for each circle
Coordinates of pixels? Or coordinates of the center? I think I noticed in another Question that you are working with identifying circles in an image, so you might be talking about pixel coordinates ??

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by