A computer vision approach for textile inspection