| Embroidery is one of the excellent Chinese traditional folk arts and crafts. The design of scripts is necessary to complete an embroidery, as it need rich experience and artistic accomplishment which is difficult for common people to grasp. With the development and application of computer technology, we can generate embroidery script by the aid of computer image processing technology. This thesis is intended to achieve automated script generation, convert an ordinary picture into an embroidery thesis by using image processing techniques, based on which we can complete an embroider easily and practically.For automated generation of script in the process of sew and requirements of embroidery picture’s effect, this article resolve thread color selection, color zoning and graphics vectorization during automatically generating. Realize the process of color analysis of image, image color Clustering and image vectorization. This thesis uses hierarchical clustering, K-means clustering algorithm for clustering color processing. Vectorization processing uses straight lines and Bezier curves to fit the shape primitives. The main work is as follows:(1) Image color quantization. Generalize the rich color of the real picture to the color set in embroidery color library, quantize the picture’s color based on embroider color library, using embroidery thread color reconstruction images, to reasonable express the original colors within thread colors.(2) Clustering processing to image color. Reduce the number of colors, while treat the color excess as zoning to reduce the difficulty of embroidery and the complexity of manual processing. Process using the method of hierarchical clustering and K-means clustering based on embroidery thread color library, finally get several thread color closest to the expression of original picture.(3) Image vectorization. Export the final output described in vector images. First smoothing the image to optimize clustering results. Then fit the shape of the outline to obtain for bitmap image’s vectorization description. Finally adoption SVG format to describe vector images, output vectorization script to a file.This thesis has realized color zoning to the input image, automatically select the thread color to embroidered each region, and export the vectorization manuscript. |