Morphological operations such as erosion and opening are applied to both direct and spatially filtered images of test fabrics to identify defects. Detecting defects morpholog ically on spatially filtered images of fabrics produces better results, particularly when the fabric is fine and contains defects of small size. The diffraction pattern of the test fabric is obtained optically 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 selected structuring element are then applied to the image after suitable pre-processing. © 2000, Sage Publications. All rights reserved.