Contour fractal analysis of grains