Segmentation of 2D and 3D textures from estimates of the local orientation