Genetic algorithm-based detection of the layout of color yarns