In this paper, a method for morphological segmentation using shape information is presented. This method is based on a morphological operator named ultimate attribute opening (UAO). Our approach considers shape information to favor the detection of specific shapes. The method is validated in the framework of two applications: façade analysis and scene-text detection. The experimental results show that our approach is more robust than the standard UAO.