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

 Akzeptierte Antwort

Image Analyst
Image Analyst am 22 Sep. 2017

0 Stimmen

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);

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by