Borrar filtros
Borrar filtros

Fill the spaces between circles

7 visualizaciones (últimos 30 días)
Elena
Elena el 4 de Dic. de 2019
Respondida: Image Analyst el 5 de Dic. de 2019
Hi,
I need help to understand how to fill the spaces between lines.
I have 5 circles with this disposition:
I would like to obtain the following picture as a result, but I can't understand how:
How can I do this? I have plot the circles using the function "viscircles".
Thanks!
  1 comentario
darova
darova el 4 de Dic. de 2019
I think it's impossible
Don't know if somebody can do this

Iniciar sesión para comentar.

Respuesta aceptada

J. Alex Lee
J. Alex Lee el 4 de Dic. de 2019
just a quick look, but maybe the shaded regions are shared by exactly 2 or 3 circles, not more and not fewer...does that work? as for algorithm to fill that region, maybe takes more thought (assuming above is even correct).
  2 comentarios
Elena
Elena el 4 de Dic. de 2019
It's correct. It is exactly the criterion with which the shaded regions were chosen!
J. Alex Lee
J. Alex Lee el 5 de Dic. de 2019
Assuming you don't need to start from the image, but rather you have mathematical descriptions of the circle positions, an easy way would be to start with a canvas of pixels and test for its assignment in each of the circles (i.e., within radius of the center).
If you can find all the intersection points of the circles and figure out all the sides belonging to each "patch", you could test for each patch if a representative point within it (e.g., center of mass?) falls within the circles.
Neat problem.

Iniciar sesión para comentar.

Más respuestas (1)

Image Analyst
Image Analyst el 5 de Dic. de 2019
Hint: since it seems like you're using a digital image and using viscircles, just see which point is within one radius of exactly 2 or 3 of the circles. Just compute the distance of the current point, as you scan the image, to the centers of the 5 circles. It's trivial - just use Pythagorean theorem. If it is within exactly 2 or 3, then color that pixel gray, otherwise color it white. Should be pretty easy, right? Let me know if you can't figure it out.

Etiquetas

Productos


Versión

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by