20.5   Eliminating Small Objects

The following morphological operation eliminates small image objects and smoothes the boundaries of the remaining objects:

  ...
  segmentation(Image,&Seg);
  gen_circle(&Mask,100.0,100.0,3.5);
  opening(Seg,Mask,&Res);