A three-dimensional measure of surface roughness based on mathematical morphology