Skip to main content
edited body
Source Link
LCarvalho
  • 9.3k
  • 5
  • 40
  • 97

How can I create lines using the center of the circles as a reference?

I created a code, but it generates multiple lines around the circle.

coord=PixelValuePositions[imagem,Red];
coord=Sort@coord;
Graphics[{Line[{{coord[[#,1]],coord[[#,2]]}&/@Range[First[Dimensions[coord]]],{coord[[#,1]],coord[[#,2]]}&/@Range[2,First[Dimensions[coord]]]}]}]

The image used is at the link below:

ImageImage

enter image description here

How can I create lines using the center of the circles as a reference?

I created a code, but it generates multiple lines around the circle.

coord=PixelValuePositions[imagem,Red];
coord=Sort@coord;
Graphics[{Line[{{coord[[#,1]],coord[[#,2]]}&/@Range[First[Dimensions[coord]]],{coord[[#,1]],coord[[#,2]]}&/@Range[2,First[Dimensions[coord]]]}]}]

The image used is at the link below:

Image

enter image description here

How can I create lines using the center of the circles as a reference?

I created a code, but it generates multiple lines around the circle.

coord=PixelValuePositions[imagem,Red];
coord=Sort@coord;
Graphics[{Line[{{coord[[#,1]],coord[[#,2]]}&/@Range[First[Dimensions[coord]]],{coord[[#,1]],coord[[#,2]]}&/@Range[2,First[Dimensions[coord]]]}]}]

The image used is at the link below:

Image

enter image description here

edited tags
Link
deleted 8 characters in body; edited title
Source Link
LCarvalho
  • 9.3k
  • 5
  • 40
  • 97

How docan I get thecreate lines created using the center of the circles as a reference?

How docan I get thecreate lines created using the center of the circles as a reference?

I created a code, but it generates multiple lines around the circle.

coord=PixelValuePositions[imagem,Red];
coord=Sort@coord;
Graphics[{Line[{{coord[[#,1]],coord[[#,2]]}&/@Range[First[Dimensions[coord]]],{coord[[#,1]],coord[[#,2]]}&/@Range[2,First[Dimensions[coord]]]}]}]

The image used is at the link below:

Image

enter image description here

How do I get the lines created using the center of the circles as a reference?

How do I get the lines created using the center of the circles as a reference?

I created a code, but it generates multiple lines around the circle.

coord=PixelValuePositions[imagem,Red];
coord=Sort@coord;
Graphics[{Line[{{coord[[#,1]],coord[[#,2]]}&/@Range[First[Dimensions[coord]]],{coord[[#,1]],coord[[#,2]]}&/@Range[2,First[Dimensions[coord]]]}]}]

The image used is at the link below:

Image

enter image description here

How can I create lines using the center of the circles as a reference?

How can I create lines using the center of the circles as a reference?

I created a code, but it generates multiple lines around the circle.

coord=PixelValuePositions[imagem,Red];
coord=Sort@coord;
Graphics[{Line[{{coord[[#,1]],coord[[#,2]]}&/@Range[First[Dimensions[coord]]],{coord[[#,1]],coord[[#,2]]}&/@Range[2,First[Dimensions[coord]]]}]}]

The image used is at the link below:

Image

enter image description here

Source Link
LCarvalho
  • 9.3k
  • 5
  • 40
  • 97
Loading