I agree with Ali Reza. There is plenty of sw for image analysis available from optical microscope producers. Most of them are based on methods described in ASTM standards and are reliable. It all depends on the filter the operator inserts, the chosen magnitude and the grain size. They first require a preliminary test on a few images for calibration.