# Image analysis: Gravel Sieve

In this link: http://broadwaysand.com/?page_id=165, you can find different gravel pictures.

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.

## 1 Answer

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! – bill s Aug 22 '15 at 12:56
• I thought exactly the same :) – Dr. belisarius Aug 22 '15 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. – Enrique Pérez Herrero Aug 22 '15 at 21:05
• Nice job bill s! – Enrique Pérez Herrero Aug 22 '15 at 21:09
• In fact, the largest segment is the coin, which has area 47949 pixels (it's the first element of areas). – bill s Aug 22 '15 at 22:36