Morphological operations such as erosion and opening are applied to both di
rect and spatially filtered images of test fabrics to identify defects. Det
ecting defects morphologically on spatially filtered images of fabrics prod
uces better results, particularly when the fabric is fine and contains defe
cts of small size. The diffraction pattern of the test fabric is obtained o
ptically by illuminating it with a collimated laser beam. A spatial filter
is placed at the Fourier plane to remove the periodic grating structure of
the fabric from the image. Morphological operations with a critically selec
ted structuring element are then applied to the image after suitable pre-pr
ocessing.