Hi, I have set of points and set of lines, as can be seen in the figure below.
I need to obtain the LARGEST inscribed circle in any of the regions which can be seen in the figure. I tried to discretize the lines (each in 100 or 1000 points) and use the code given on this page: https://stackoverflow.com/questions/42806059/fitting-largest-circle-in-free-area-in-image-with-distributed-particle/42822810. With this, I get the solution, but the circle is not the largest possible.
I would appreciate if anyone can help me with this matter.
Regards, Nenad

 채택된 답변

Image Analyst
Image Analyst 2017년 9월 22일

0 개 추천

Use poly2mask() and bwdist(). The location and peak of the distance transform will give you the circle parameters.
mask = poly2mask(x, y, rows, columns);
edtImage = bwdist(mask);
maxRadius = max(edtImage(:));
[row, column] = find(edtImage == maxRadius);

추가 답변 (0개)

질문:

2017년 9월 22일

답변:

2017년 9월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by