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

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.

enter image description here


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

enter image description here

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]];

enter image description here

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

Mathematica graphics

|improve this answer|||||
  • 1
    $\begingroup$ thanks to @belisarius for the log histogram... that looks more like the plot the OP was expecting! $\endgroup$ – bill s Aug 22 '15 at 12:56
  • 1
    $\begingroup$ I thought exactly the same :) $\endgroup$ – Dr. belisarius Aug 22 '15 at 14:18
  • $\begingroup$ 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. $\endgroup$ – Enrique Pérez Herrero Aug 22 '15 at 21:05
  • $\begingroup$ Nice job bill s! $\endgroup$ – Enrique Pérez Herrero Aug 22 '15 at 21:09
  • 1
    $\begingroup$ In fact, the largest segment is the coin, which has area 47949 pixels (it's the first element of areas). $\endgroup$ – bill s Aug 22 '15 at 22:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.