Connectivity analysis of a binary input image according to Burger, W., Burge, M.: Digitale Bildverarbeitung. Springer Verlag 2006, p.208.Output consists in a symbolic image of the connected foreground regions and a shape of the borders of the foreground regions (outer and inner borders). The shape may contain alternatively the centers or the corners of the border pixels. Optionally, the regions which have contact with the image borders can be removed together with their border shapes. In addition, an optional morphological filter (erosion-binary reconstruction) can be applied to the input image first.