Removal of background pixels is necessary before the adaptive
thresholding algorithm is applied to the X-ray images of
fruits. This is because the random noise in the background region is suitable for global thresholding instead of adaptive
thresholding, since the pixel values in the background regions
are not affected by the thickness or density of the fruit. These
pixel values mainly represent the blank background and nal noise during image acquisition. Undesirable results will
occur if the adaptive thresholding is applied to the noise pixels.
By examining the histogram of a typical X-ray image (see
Fig. 6), we can see that there is a distinct mode in the lower
grey level region. The pixels around the mode are the background
and noise pixels while the rest pixels with higher grey
levels represent the fruit. The noise removal process is done
by resetting the grey level value of all pixels which have lower
grey level values than the threshold value T to zero as indicated
in Fig. 6. The T value is determined by searching the
valley next to the distinct mode of the smoothed histogram
using the slope information. Typical values of T ranged from
40 to 50 depending on the noise levels of a blank X-ray image
(or the background noise