The digital image captured with CCD camera is processed according to the woven fabric character.The direction of the stripes is found out and the image will be rotated automatically.The fabric density can be accurately calculated by using error treatment.The warp and weft densities can be quickly worked out just by using only one fabric image,and it is less complex than the Fourier transform and wavelet transformation.The method can be applied to the online detection of fabric density in real manufacturing.