Skip to main content
added 581 characters in body
Source Link
bill s
  • 70.1k
  • 4
  • 105
  • 200

One way to proceed is to binarize the image and find the constituent components:

img = Import["https://i.sstatic.net/EY2EG.png"]; objects = MorphologicalComponents[Binarize[img, 0.21]]; Colorize[objects] 

enter image description here

Examine the various components (that are colored differently)

ComponentMeasurements[objects, "Area"] {1 -> 133874., 2 -> 3085.75, 3 -> 3063.75, 4 -> 3226.75, 5 -> 505.5,  6 -> 503.5,  7 -> 3074.13, 8 -> 2.25, 9 -> 2.25, 10 -> 6., 11 -> 13.,  12 -> 4.5, 13 -> 13.} 

We can see that the rectangles are the three objects of nearly identical size: objects 2, 3, and 7. The bounding boxes of these rectangles are:

ComponentMeasurements[objects, "BoundingBox"][[{2, 3, 7}]] {2 -> {{160., 338.}, {279., 449.}}, 3 -> {{355., 271.}, {410., 417.}},  7 -> {{183., 194.}, {326., 259.}}} 

To locate the circles, use the eccentricity:

ComponentMeasurements[objects, "Eccentricity"] {1 -> 0.0694129, 2 -> 0.989404, 3 -> 0.989675, 4 -> 0.0816974,  5 -> 0.116954, 6 -> 0.33685,  7 -> 0.989536, 8 -> 0.866025,  9 -> 0.935414, 10 -> 0.924176, 11 -> 0., 12 -> 0., 13 -> 0.} 

The largest (greenish) circular object is object 1#1 and the inner (greyish) circle is object 4#4. The center and radius of this inner circle is:

ComponentMeasurements[objects, {"BoundingDiskCenter", "BoundingDiskRadius"}][[4]] 4 -> {{285.875, 320.543}, 53.9322} 

One way to proceed is to binarize the image and find the constituent components:

img = Import["https://i.sstatic.net/EY2EG.png"]; objects = MorphologicalComponents[Binarize[img, 0.21]]; Colorize[objects] 

enter image description here

Examine the various components (that are colored differently)

ComponentMeasurements[objects, "Area"] {1 -> 133874., 2 -> 3085.75, 3 -> 3063.75, 4 -> 3226.75, 5 -> 505.5,  6 -> 503.5, 7 -> 3074.13, 8 -> 2.25, 9 -> 2.25, 10 -> 6., 11 -> 13.,  12 -> 4.5, 13 -> 13.} 

We can see that the rectangles are the three objects of nearly identical size: objects 2, 3, and 7. The bounding boxes of these rectangles are:

ComponentMeasurements[objects, "BoundingBox"][[{2, 3, 7}]] {2 -> {{160., 338.}, {279., 449.}}, 3 -> {{355., 271.}, {410., 417.}}, 7 -> {{183., 194.}, {326., 259.}}} 

To locate the circles, use the eccentricity:

ComponentMeasurements[objects, "Eccentricity"] {1 -> 0.0694129, 2 -> 0.989404, 3 -> 0.989675, 4 -> 0.0816974,  5 -> 0.116954, 6 -> 0.33685, 7 -> 0.989536, 8 -> 0.866025,  9 -> 0.935414, 10 -> 0.924176, 11 -> 0., 12 -> 0., 13 -> 0.} 

The largest (greenish) circular object is object 1 and the inner (greyish) circle is object 4. The center and radius of this inner circle is:

ComponentMeasurements[objects, {"BoundingDiskCenter", "BoundingDiskRadius"}][[4]] 4 -> {{285.875, 320.543}, 53.9322} 

One way to proceed is to binarize the image and find the constituent components:

img = Import["https://i.sstatic.net/EY2EG.png"]; objects = MorphologicalComponents[Binarize[img, 0.21]]; Colorize[objects] 

enter image description here

Examine the various components (that are colored differently)

ComponentMeasurements[objects, "Area"] {1 -> 133874., 2 -> 3085.75, 3 -> 3063.75, 4 -> 3226.75, 5 -> 505.5, 6 -> 503.5,  7 -> 3074.13, 8 -> 2.25, 9 -> 2.25, 10 -> 6., 11 -> 13., 12 -> 4.5, 13 -> 13.} 

We can see that the rectangles are the three objects of nearly identical size: objects 2, 3, and 7. The bounding boxes of these rectangles are:

ComponentMeasurements[objects, "BoundingBox"][[{2, 3, 7}]] {2 -> {{160., 338.}, {279., 449.}}, 3 -> {{355., 271.}, {410., 417.}},  7 -> {{183., 194.}, {326., 259.}}} 

To locate the circles, use the eccentricity:

ComponentMeasurements[objects, "Eccentricity"] {1 -> 0.0694129, 2 -> 0.989404, 3 -> 0.989675, 4 -> 0.0816974, 5 -> 0.116954, 6 -> 0.33685,  7 -> 0.989536, 8 -> 0.866025, 9 -> 0.935414, 10 -> 0.924176, 11 -> 0., 12 -> 0., 13 -> 0.} 

The largest (greenish) circular object #1 and the inner (greyish) circle is object #4. The center and radius of this inner circle is:

ComponentMeasurements[objects, {"BoundingDiskCenter", "BoundingDiskRadius"}][[4]] 4 -> {{285.875, 320.543}, 53.9322} 
added 581 characters in body
Source Link
bill s
  • 70.1k
  • 4
  • 105
  • 200

One way to proceed is to binarize the image and find the constituent components:

img = Import["https://i.sstatic.net/EY2EG.png"]; objects = MorphologicalComponents[Binarize[img, 0.21]]; Colorize[objects] 

enter image description here

Now findExamine the various components (that are colored differently)

ComponentMeasurements[objects, "Area"] {1 -> 133874., 2 -> 3085.75, 3 -> 3063.75, 4 -> 3226.75, 5 -> 505.5, 6 -> 503.5, 7 -> 3074.13, 8 -> 2.25, 9 -> 2.25, 10 -> 6., 11 -> 13., 12 -> 4.5, 13 -> 13.} 

We can see that the rectangles are the three objects of nearly identical size: objects 2, 3, and 7. The bounding boxes of these rectangles are:

ComponentMeasurements[objects, "BoundingBox"][[{2, 3, 7}]] {2 -> {{160., 338.}, {279., 449.}}, 3 -> {{355., 271.}, {410., 417.}}, 7 -> {{183., 194.}, {326., 259.}}} 

To locate the circles, use the eccentricity:

ComponentMeasurements[objects, "Eccentricity"] {1 -> 0.0694129, 2 -> 0.989404, 3 -> 0.989675, 4 -> 0.0816974, 5 -> 0.116954, 6 -> 0.33685, 7 -> 0.989536, 8 -> 0.866025, 9 -> 0.935414, 10 -> 0.924176, 11 -> 0., 12 -> 0., 13 -> 0.} 

The largest (greenish) circular object is object 1 and the inner (greyish) circle is object 4. The center and radius of this inner circle is:

ComponentMeasurements[objects, {"BoundingDiskCenter", "BoundingDiskRadius"}][[4]] 4 -> {{285.875, 320.543}, 53.9322} 

One way to proceed is to binarize and find the components:

img = Import["https://i.sstatic.net/EY2EG.png"]; objects = MorphologicalComponents[Binarize[img, 0.21]]; Colorize[objects] 

enter image description here

Now find the various components (that are colored differently)

ComponentMeasurements[objects, "Area"] {1 -> 133874., 2 -> 3085.75, 3 -> 3063.75, 4 -> 3226.75, 5 -> 505.5, 6 -> 503.5, 7 -> 3074.13, 8 -> 2.25, 9 -> 2.25, 10 -> 6., 11 -> 13., 12 -> 4.5, 13 -> 13.} 

We can see that the rectangles are the three objects of nearly identical size: objects 2, 3, and 7. The bounding boxes of these rectangles are:

ComponentMeasurements[objects, "BoundingBox"][[{2, 3, 7}]] {2 -> {{160., 338.}, {279., 449.}}, 3 -> {{355., 271.}, {410., 417.}}, 7 -> {{183., 194.}, {326., 259.}}} 

One way to proceed is to binarize the image and find the constituent components:

img = Import["https://i.sstatic.net/EY2EG.png"]; objects = MorphologicalComponents[Binarize[img, 0.21]]; Colorize[objects] 

enter image description here

Examine the various components (that are colored differently)

ComponentMeasurements[objects, "Area"] {1 -> 133874., 2 -> 3085.75, 3 -> 3063.75, 4 -> 3226.75, 5 -> 505.5, 6 -> 503.5, 7 -> 3074.13, 8 -> 2.25, 9 -> 2.25, 10 -> 6., 11 -> 13., 12 -> 4.5, 13 -> 13.} 

We can see that the rectangles are the three objects of nearly identical size: objects 2, 3, and 7. The bounding boxes of these rectangles are:

ComponentMeasurements[objects, "BoundingBox"][[{2, 3, 7}]] {2 -> {{160., 338.}, {279., 449.}}, 3 -> {{355., 271.}, {410., 417.}}, 7 -> {{183., 194.}, {326., 259.}}} 

To locate the circles, use the eccentricity:

ComponentMeasurements[objects, "Eccentricity"] {1 -> 0.0694129, 2 -> 0.989404, 3 -> 0.989675, 4 -> 0.0816974, 5 -> 0.116954, 6 -> 0.33685, 7 -> 0.989536, 8 -> 0.866025, 9 -> 0.935414, 10 -> 0.924176, 11 -> 0., 12 -> 0., 13 -> 0.} 

The largest (greenish) circular object is object 1 and the inner (greyish) circle is object 4. The center and radius of this inner circle is:

ComponentMeasurements[objects, {"BoundingDiskCenter", "BoundingDiskRadius"}][[4]] 4 -> {{285.875, 320.543}, 53.9322} 
Source Link
bill s
  • 70.1k
  • 4
  • 105
  • 200

One way to proceed is to binarize and find the components:

img = Import["https://i.sstatic.net/EY2EG.png"]; objects = MorphologicalComponents[Binarize[img, 0.21]]; Colorize[objects] 

enter image description here

Now find the various components (that are colored differently)

ComponentMeasurements[objects, "Area"] {1 -> 133874., 2 -> 3085.75, 3 -> 3063.75, 4 -> 3226.75, 5 -> 505.5, 6 -> 503.5, 7 -> 3074.13, 8 -> 2.25, 9 -> 2.25, 10 -> 6., 11 -> 13., 12 -> 4.5, 13 -> 13.} 

We can see that the rectangles are the three objects of nearly identical size: objects 2, 3, and 7. The bounding boxes of these rectangles are:

ComponentMeasurements[objects, "BoundingBox"][[{2, 3, 7}]] {2 -> {{160., 338.}, {279., 449.}}, 3 -> {{355., 271.}, {410., 417.}}, 7 -> {{183., 194.}, {326., 259.}}}