A segmentation operation is applied to an input image to identify
foreground objects of interest, and then a shadow removal operation is
applied to remove any detected shadows from the foreground segmentation.
The shadow removal algorithms can leave holes and bisections in the
segmentation map, however, which will then subsequently impact on an
object detection step performed using connected component analysis. To
get around this problem, a conditional morphological dilation operation
is applied to the segmentation map to `grow` the segmented blobs to fill
in any holes and bisections, without re-growing shadow pixels in the
segmentation. The result is an object detection method and system which
is robust to illumination changes causing shadows and/or highlights.