Background
Concrete is mixture of aggregates and cement. Aggregates are composed of different sizes and colors. Core samples are taken by drilling in order to test the strength of concrete . They are usually in cylindrical form. See the image below. I want to detect the circle of the cylinder and aggregates as well as calculate the areas.
Question
I have many images similar to this one.
May Questions are :
- How can I remove the background and detect the circle?
- How can I find the shape of aggregates calculate the areas?
PS: I'm well aware of related Questions on this site but most of them end up with failure.
Edit 1 Thank you shrx for the first part of the Q
Code
img= Import["https://i.sstatic.net/tNcYK.jpg"] circles = SelectComponents[MorphologicalComponents[ LaplacianGaussianFilter[ ColorNegate@DeleteSmallComponents@Closing[EdgeDetect[i, 3], 11], 2], 0.0056`], "Count", # > 600 &]; cm = ComponentMeasurements[circles, "MeanCentroidDistance"] ct = 1 /. ComponentMeasurements[FillingTransform@i1, "Centroid"]; Show[i, Graphics[{Thick, Red, Circle[ct, cm[[1, 2]]]}]] 






After this, it's the same procedure as in the related examples you've found.