Morphological detection of edges and corners