The process of manually rendering traditional Chinese meticulous flower painting is complicated and highly skilled,it is not easy to quickly render diversified meticulous flower paintings.The existing automatic line drawing colorization is difficult to generate natural and reasonable gradient effect,and the accuracy of color positioning is poor,it is prone to some problems such as unreasonable color in local areas,insufficient coloring,or color overflow.To address these problems,an interactive meticulous flower coloring algorithm via attention guidance is proposed to accomplish the colorization of meticulous flowers from line drawing.The main work of this paper is as follows:(1)Aiming at the new problem of generating meticulous flower from line drawing,an attention-guided interactive mode is designed,and a new CGAN-based method for Meticulous Flowers Color Rendering(MFCR-CGAN)is proposed.Firstly,a color attention map depicting the color category and layout of flowers is designed to guide the proposed network to strengthen block color learning and considered as the means of interaction for color design.Secondly,a local color-coding sub-network is constructed and trained to encode the color attention map,the encoded information is introduced into the conditional normalization process of each layer of the generator as an affine parameter to accomplish the learning and control of colors.In view of the rare availability of "Meticulous Flower-Line Drawing Flower" datasets for training the MFCR-CGAN network,a method simulated the line drawing is proposed,which automatically extracted the edge contour of the meticulous flower by the edge detection operator XDoG.An image segmentation method based on HSV color space is used to automatically generate the color attention map of meticulous flowers.(2)Using the reference image selected by the user as interactive mode,a meticulous flower coloring method based on semantic matching of reference images(Reference Based and Semantic Matching,RBSM-CGAN)is proposed.Using color attention map as interactive mode requires users to design color scheme and it is difficult to quickly generate diversified results,which is suitable for users with a certain art foundation;while the reference based method is highly automated and suitable for general users.On the basis of U-Net,the generator of RBSM-CGAN designs two additional sub-modules.One is the semantic positioning sub-module.A pre-trained semantic segmentation network is used to generate the semantic label map of the line drawing,and guide the color of the reference image position to different semantic regions of the line drawing.The other is the color coding sub-module,which is used to extract the color information of the reference image and introduce into the coloring model.In order to reduce the dependence of the model on the spatial structure of the reference image,reference images is generated by perturbation operations such as disrupting the geometric structure of the original work in the training stage,and uses the "original perturbation map-line drawing" data pair for training to ensure that the trained network can make correct color responses to different layout reference images input by the user.(3)Realize the above two different interactive form meticulous flowers simulation algorithm in Tensorflow framework,and the coloring effect is compared and analyzed in various aspects.It mainly includes the comparison with the previous line drawing coloring methods,the comparison of the ablation experiments of the network module,and the experimental effects comparison with different losses.Experimental results show that the proposed algorithm render line drawing of flowers better into meticulous flower,the generated image are accordant with the color distribution and characteristics of real meticulous flower paintings,and has more artistic reality and appreciation. |