The gray line profile method is widely used for detecting the boundaries between yarns in woven fabric surface images. One lack of the approach is the absence of generally accepted filtering method to eliminate minimum values which do not correspond to the yam boundaries. Aim of this research is to propose a method which automatically determines the filter size for sliding filters so as to detect the true local minimum points those correspond to the boundary positions of weft and warp yarns. The method is tested with real fabric images. Experimental findings demonstrate the effectiveness of the method.