The mechanical characteristics of the railway superstructure are related to the properties of the ballast, and especially to the particle size distribution of its grains. Under the constant stress-strain of carriages, the ballast can deteriorate over time, and consequently it should properly be monitored for safety reasons. The equipment which currently monitors the railway superstructure (like the Italian diagnostic train Archimede) do not make any “quantitative” evaluation of the ballast. The aim of this paper is therefore to propose a new methodology for extracting railway ballast particle size distribution by means of the image processing technique. The procedure has been tested on a regularly operating Italian railway line and the results have been compared with those obtained from laboratory experiments, thus assessing how effective is the methodology which could potentially be implemented also in diagnostic trains in the near future.