In practice, the binary image sometimes contains small pixel clusters (blobs) from image noise. Morphological opening (dilation of the erosion) operation is performed to remove image noise in the background (Fig. 2(c)). Morphological closing (erosion of the dilation) operation is performed to fill the holes inside the oyster boundary. After small blobs have been removed and small holes have been filled (Fig. 2(d)), the oyster contour (Fig. 2(e)) is extracted using a fast and efficient eight-neighborhood contour trace algorithm (Lee et al., 2003). The x and y coordinates of the contour are then processed for shape analysis.