Mathematical morphology based characterization of binary image