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