# Image analysis: Gravel Sieve

A quarter dollar coin gives the scale, because its diameter is 0.955 inches (24.26 mm)

I want to get the Particle Size Distribution and plot the cummulative granulometry curve, this is the percentage of the material less than a given size.

I'm not very experienced on image analysis and I don't know where to start: How to calculate the picture size identifying the coin, and afterwards find the particle sizes.

It will only be good for a rough estimate, but you can segment the image using WatershedComponents and then visualize the results

img = ColorConvert[Import["http://i.stack.imgur.com/t3u7G.jpg"], "Grayscale"];
seg = WatershedComponents[img, Method -> {"MinimumSaliency", 0.5}];
seg // Colorize


Now you can use ComponentMeasurements to get the area of each colored region and then plot the results. Below I've plotted a histogram showing the number of detected particles (vertical axis) of each size (on the horizontal axis).

areaComp = ComponentMeasurements[seg, "Area"];
areas = areaComp[[All, 2]];
Histogram[areas]


Histogram[areas, "Log", "CDF"]


• thanks to @belisarius for the log histogram... that looks more like the plot the OP was expecting! Aug 22, 2015 at 12:56
• I thought exactly the same :) Aug 22, 2015 at 14:18
• Area[D_] := (Pi/4)*D^2 so Area[24.26 mm] = 462.244 mm^2, as the coin looks larger than any other pebble the histogram should reach the 100% before 462 mm. Aug 22, 2015 at 21:05
• Nice job bill s! Aug 22, 2015 at 21:09
• In fact, the largest segment is the coin, which has area 47949 pixels (it's the first element of areas). Aug 22, 2015 at 22:36