To identify possible infestation sites among small spots segmented
from the binary image, a morphological filtering
approach is employed, which can eliminate or maintain the
spots on the image according to their area size by the procedure
of erosion and dilation. The erosion procedure shrinks
the spots, so that a spot will be eliminated if it is smaller
than a certain size. The dilation procedure is then performed to expand the spots remaining after the erosion process to
their original size. As in many image processing libraries, the
morphological filtering function is a library function of the
NI-IMAQ image processing library. The morphological filtering
function performs operations on spots in binary images,
and the filtering retains particles resistant to a specified iteration
of erosion by a 3×3 structuring element.We utilized this
morphological filtering function to screen noise or undesirable
spots using the iteration number as an operational parameter.
A typical result of small spot removal is shown in Fig. 9e. The
remaining spots are isolated and overlaid onto the original
X-ray image, as shown in Fig. 9f. The optimum number of iteration
is dependent on different kinds of fruits and extent of
infestation. Below we discuss the effect of iteration number
on the identification of suspected infestation sites.