One of the key characteristics of X-ray images of fruits is that
the grey level of a pixel depends on the density and thickness
of the sample. For fruits with variable thickness due to
their nearly spherical or oval shape, the grey levels encompass
a wide range that includes the grey levels of infestation site
internal of the fruit. For example, Fig. 4 shows the results using
the traditional standard thresholding algorithm (Gonzales and
Woods, 2002). It is obvious that the infestation site could not be
extracted; no matter how the threshold value was set. Therefore,
it is difficult to segment the infestation site with global
(single) threshold values and it is not useful for the follow-up
image processing. An adaptive thresholding algorithm based
on the local grey-level distribution is thus necessary to resolve
this problem. The flow chart of the overall image segmentation
procedure developed in this research is depicted in Fig. 5.
The procedure starts with a pre-processing step to remove random
noise in the background of the X-ray image. The adaptive
thresholding is then applied to the X-ray image by first creating
a threshold value map with its threshold values being a function
of pixel coordinates. A binary image is obtained by using
this threshold valuemapto determine the pixel value to be 0 or
255. Possible locations of infestation are then located by a holefilling
processing followed by an image subtraction. Finally,
morphological filtering is applied to screen small spots. Infestation
sites, usually larger in area, are then selected based
on the number of iterations of morphological filtering, while
small irrelevant spots are removed.