Generalized Connected Morphological Operators for Robust Shape Extraction by