Research on the Design of Zhuang Brocade Patterns Based on Automatic Pattern Generation
Abstract
:1. Introduction
2. Related Literature and Work
2.1. Automatic Pattern Generation Technology
2.2. Works Related to the Pattern Color Extraction Algorithm
2.3. Works Related to Pattern Extraction Algorithms
2.4. Works Related to Pattern Organization Form Extraction
3. Construction of the Feature Dataset of Zhuang Brocade Patterns and Design of the Extraction Algorithm
3.1. Feature Dataset Construction
3.2. Color Feature Extraction Algorithm Design and Results
- Step 1: input the image and the number of clusters (the number of extracted colors).
- 2.
- Step 2: resize the image.
- 3.
- Step 3: train the K-means algorithm to fit the model and predict clustering.
- 4.
- Step 4: match the cluster center (RGB value) from the dictionary to the query’s actual/closest color.
- 5.
- Step 5: calculate the color percentage and draw a pie chart.
3.3. Pattern Extraction Process and Results
3.3.1. Image Smoothing
3.3.2. Image Segmentation Processing
3.3.3. Image Binarization
3.3.4. Pattern Extraction Results
3.4. Organizational Form Extraction Process and Results
- (1)
- Process of organizational form extraction for Case One.
- (2)
- Process of organizational form extraction for Case Two.
4. Analysis of the Zhuang Brocade Pattern Generation Algorithm Based on Pattern Feature Elements
4.1. Pattern Sample Encoding
4.1.1. Color Encoding
4.1.2. Pattern Encoding
4.1.3. Organizational Form Encoding
4.2. Zhuang Brocade Pattern Design Research
4.2.1. Algorithm Design and Framework
- (1)
- Step 1: generating the element encoding mapping file.
- (2)
- Step 2: decoding.
- (3)
- Step 3: Zhuang brocade pattern reconstruction.
- (4)
- Step 4: recoloring the reconstructed pattern.
- Use the cv2.imread(img) method to read the image. At this point, the image format is BGR.
- Convert the image to grayscale using the color space conversion function cv2.cvtColor(img, cv2.COLOR_BGR2GRAY). Here, img is the result returned by step A, and cv2.COLOR_BGR2GRAY indicates the conversion from BGR format to grayscale.
- Use the grayscale image obtained from step B as the src parameter in the cv2.threshold(src, thresh, maxval, type[, dst]) function. This function performs binary thresholding on the grayscale image, returning retVal and dst for subsequent image processing. In this context, src represents the image source (i.e., the grayscale image), thresh denotes the threshold (initial value), and maxval indicates the threshold (maximum value), set to 0 and 255, respectively. The type parameter selects the method, employing a combination of cv2.THRESH_BINARY_INV and cv2.THRESH_OTSU. cv2.THRESH_OTSU utilizes the least squares method to process pixel points, seeking the optimal threshold, while cv2.THRESH_BINARY_INV sets the binarization color—pixels greater than the threshold are set to 0 (black), and those less than the threshold are set to maxval, i.e., 255 (white). The returned value retVal is the threshold value, and dst represents the resulting black-and-white image.
- The color group colorGroup obtained in step A is in list format, containing all color codes and corresponding RGB values in the color group. RGB values are assigned corresponding to the colors to the parts outside the mask, i.e., img[mask] = RGB. The mask specifies the areas to be preserved from replacement, taking values of 0 or 255, and RGB represents the color to be substituted.
4.2.2. Case Examples
- (1)
- Step 1: decoding.
- (2)
- Step 2: pattern reconstruction.
- (3)
- Step 3: pattern recoloring.
4.3. Zhuang Brocade Pattern Style Similarity Evaluation
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Huang, Y.; Pan, Y. Discovery and Extraction of Cultural Traits in Intangible Cultural Heritages Based on Kansei Engineering: Taking Zhuang Brocade Weaving Techniques as an Example. Appl. Sci. 2021, 11, 11403. [Google Scholar] [CrossRef]
- Nong, Z. Feature Extraction and Measurement Algorithm Based on Color in Image Database. J. Intell. Fuzzy Syst. 2020, 38, 3885–3891. [Google Scholar] [CrossRef]
- Tian, G.; Yuan, Q.; Hu, T.; Shi, Y. Auto-Generation System Based on Fractal Geometry for Batik Pattern Design. Appl. Sci. 2019, 9, 2383. [Google Scholar] [CrossRef]
- Jia, X.; Liu, Z. Element Extraction and Convolutional Neural Network-Based Classification for Blue Calico. Text. Res. J. 2021, 91, 261–277. [Google Scholar] [CrossRef]
- Jiang, S.; Lu, Z.; Li, M. Extraction and Application of Pearl S Buck’s Cultural Elements Based on Big Data Mining. Packag. Eng. 2021, 42, 337–346. [Google Scholar]
- Liang, W. Innovative Development of Egg Carving Cultural and Creative Products Using 3D Printing Technology Based on Internet of Things. Sci. Program. 2021, 2021, e3267155. [Google Scholar] [CrossRef]
- Moghadam, T.S.; Afjeh, M.G.; Amirshahi, S.H. Classification of Persian Carpet Patterns Based on Quantitativeaesthetic-Relatedfeatures. Color Res. Appl. 2021, 46, 195–206. [Google Scholar] [CrossRef]
- Xiang, J.; Zhang, J.; Pan, R.; Han, Y.; Zhang, J.; Gao, W. Graphic Contour Extraction for Printed Fabric Based on Texture Smoothing. J. Text. Res. 2017, 38, 162–167. [Google Scholar]
- Wang, W.; Deng, N.; Xin, B.; Wang, Y.; Lu, S. Novel Segmentation Algorithm for Jacquard Patterns Based on Multi-View Image Fusion. IET Image Process. 2020, 14, 4563–4570. [Google Scholar] [CrossRef]
- Liu, J.; Zhuang, M.; Shang, L.; Zhang, X. Pattern Segmentation of Shadow Puppetry Costumes Based on Color Clustering. Adv. Text. Technol. 2021, 29, 71–77. [Google Scholar]
- Abdi, A.; Safabakhsh, R. An Automatic Graphic Pattern Generation Algorithm and Its Application to the Multipurpose Camouflage Pattern Design. IEEE Trans. Cybern. 2023, 53, 4748–4762. [Google Scholar] [CrossRef] [PubMed]
- Xu, S.; Zhang, Y.; Yan, S. Automatic Mandala Pattern Design and Generation Based on COOM Framework. J. Comput. Lang. 2022, 72, 101138. [Google Scholar] [CrossRef]
- Wu, Y.; Kyungsun, K. Automatic Generation of Traditional Patterns and Aesthetic Quality Evaluation Technology. Inf. Technol. Manag. 2022, 25, 125–143. [Google Scholar] [CrossRef]
- Ju, F.; Wang, Q.; Tan, Z.; Li, Q. Intelligent Recognition of Colour and Contour from Ancient Chinese Embroidery Images. Fibres Text. East. Eur. 2022, 30, 79–92. [Google Scholar] [CrossRef]
- Molada-Tebar, A.; Marqués-Mateu, Á.; Lerma, J.L.; Westland, S. Dominant Color Extraction with K-Means for Camera Characterization in Cultural Heritage Documentation. Remote Sens. 2020, 12, 520. [Google Scholar] [CrossRef]
- Jing, J.; Pinghua, X.; Xiaowan, S.; Jingwen, C.; Ruibing, L. Automatic Coloration of Pattern Based on Color Parsing of Sung Porcelain. Text. Res. J. 2022, 92, 5066–5079. [Google Scholar] [CrossRef]
- He, K.; Wang, D.; Tong, M.; Zhu, Z. An Improved GrabCut on Multiscale Features. Pattern Recognit. 2020, 103, 107292. [Google Scholar] [CrossRef]
- Sudhakar, M.; Meena, M.J. An Efficient Interactive Segmentation Algorithm Using Color Correction for Underwater Images. Wirel. Netw. 2021, 27, 5435–5446. [Google Scholar] [CrossRef]
- Wang, W.; Zhuang, J.; Zhang, X.; Hsia, C.-H.; Li, C.-I.; Yang, C.-F. Household Goods Recognition Using Hierarchical Multi-Object Segmentation. Sens. Mater. 2021, 33, 1363. [Google Scholar] [CrossRef]
- Feng, Y.; Deng, S.; Yan, X.; Yang, X.; Wei, M.; Liu, L. Easy2Hard: Learning to Solve the Intractables From a Synthetic Dataset for Structure-Preserving Image Smoothing. IEEE Trans. Neural Netw. Learn. Syst. 2022, 33, 7223–7236. [Google Scholar] [CrossRef] [PubMed]
- Liu, J.; Zhuang, M.; Shi, L.; Gao, T. Intelligent Contour Extraction of Shadow Patterns Based on Texture Smoothing and GrabCut. J. Silk 2020, 57, 20–27. [Google Scholar]
- Castellanos, F.J.; Gallego, A.-J.; Calvo-Zaragoza, J. Unsupervised Neural Domain Adaptation for Document Image Binarization. Pattern Recognit. 2021, 119, 108099. [Google Scholar] [CrossRef]
- Orts, F.; Ortega, G.; Cucura, A.C.; Filatovas, E.; Garzón, E.M. Optimal Fault-Tolerant Quantum Comparators for Image Binarization. J. Supercomput. 2021, 77, 8433–8444. [Google Scholar] [CrossRef]
- Merzban, M.H.; Elbayoumi, M. Efficient Solution of Otsu Multilevel Image Thresholding: A Comparative Study. Expert Syst. Appl. 2019, 116, 299–309. [Google Scholar] [CrossRef]
- Walter, N.; Ligler, H.; Gürsoy, B. From Graphical Treatment of Combinatorics to Tiling Grammars. Nexus Netw. J. 2023, 25, 321–332. [Google Scholar] [CrossRef]
- Hou, Y.; Lv, J.; Liu, X.; Hu, T.; Zhao, Z. Innovative method of ethnic pattern based on neural style transfer network. J. Graph. 2020, 41, 606–613. [Google Scholar]
- Wang, W.; Lv, J.; Pan, W.; Zhao, H.; Tian, Q. Extraction and Reuse of Pattern Configuration for Handicrafts Personalized Customization. J. Graph. 2019, 40, 583–590. [Google Scholar]
- Zhu, L.; Hu, X.; Fu, C.-W.; Qin, J.; Heng, P.-A. Saliency-Aware Texture Smoothing. IEEE Trans. Vis. Comput. Graph. 2020, 26, 2471–2484. [Google Scholar] [CrossRef] [PubMed]
- Rother, C.; Kolmogorov, V.; Blake, A. “GrabCut”: Interactive Foreground Extraction Using Iterated Graph Cuts. ACM Trans. Graph. 2004, 23, 309–314. [Google Scholar] [CrossRef]
- Ntirogiannis, K.; Gatos, B.; Pratikakis, I. Performance Evaluation Methodology for Historical Document Image Binarization. IEEE Trans. Image Process. 2013, 22, 595–609. [Google Scholar] [CrossRef]
Pattern Number | Similar | Dissimilar | Neutral |
---|---|---|---|
1 | 83.33% | 10.00 | 6.67 |
2 | 76.67% | 13.33 | 10.00 |
3 | 93.33% | 0.00 | 6.67 |
4 | 76.67% | 13.33 | 10.00 |
5 | 63.33% | 10.00 | 26.67 |
6 | 76.67% | 10.00 | 13.33 |
7 | 76.67% | 6.67 | 16.67 |
8 | 90.00% | 3.33 | 6.67 |
9 | 46.67% | 23.33 | 30.00 |
10 | 73.33% | 10.00 | 16.67 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Ni, M.; Huang, Q.; Ni, N.; Zhao, H.; Sun, B. Research on the Design of Zhuang Brocade Patterns Based on Automatic Pattern Generation. Appl. Sci. 2024, 14, 5375. https://doi.org/10.3390/app14135375
Ni M, Huang Q, Ni N, Zhao H, Sun B. Research on the Design of Zhuang Brocade Patterns Based on Automatic Pattern Generation. Applied Sciences. 2024; 14(13):5375. https://doi.org/10.3390/app14135375
Chicago/Turabian StyleNi, Minna, Qingqing Huang, Ni Ni, Huiqin Zhao, and Bo Sun. 2024. "Research on the Design of Zhuang Brocade Patterns Based on Automatic Pattern Generation" Applied Sciences 14, no. 13: 5375. https://doi.org/10.3390/app14135375
APA StyleNi, M., Huang, Q., Ni, N., Zhao, H., & Sun, B. (2024). Research on the Design of Zhuang Brocade Patterns Based on Automatic Pattern Generation. Applied Sciences, 14(13), 5375. https://doi.org/10.3390/app14135375