Computation of Minkowski measures on 2D and 3D binary images