Once you have a binary image, you
can identify and
then analyze each connected set of
pixels.
The connected
components operation takes in a binary image
and produces a labeled image in which each pixel has the
integer label of either the
background (0) or a component.