Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 4, No. 1, 2022 159 Research on Digital Preprocessing of Minority Costume Images Qinchuan Lei1, a, *, Nan Chen1, b and Shanren Ding1, c 1Guangdong University of Science and Technology, Dongguan 523000, China a leiqinchuan1@qq.com, b 592411026@qq.com, c 2471884810@qq.com *Corresponding author Abstract: The development of minority traditional culture plays a very important role in the historical process of the development of our Chinese national culture. However, with the passage of time and the acceleration of the process of social modernization, our traditional minority culture is gradually disappearing. This makes more and more scholars begin to attach importance to the protection of traditional minority culture. As an important part of Minority minority culture, the focus of this paper is to protect and inherit the Minority minority costumes images through the use of digital image processing technology.By analyzing the current research status of the digitalization of minority costumes and the related technologies of the digitalization processing of minority costume images, this paper proposes that the digitalization pre-processing of minority costume images should be carried out before the construction of the minority costume resource database, which improves the construction process of the minority costume resource database. Through the research on the related technologies of the digital processing of minority costumes images, combined with the minority costumes resource database constructed in this paper to achieve the classification and recognition of minority costumes and target detection tasks. This paper mainly studies the image segmentation, scaling, edge detection and other technologies, and improves the relevant image processing technologies, completes the preprocessing of minority costumes images, and constructs a minority costumes resource library that can be used for the classification and recognition of minority costumes. Keywords: Image Scaling, Image digitization, Image edge detection. 1. Introduction At present, the research on the digitalization of Minority costumes mainly includes the digitalization protection of Minority costumes, the construction of the digital image library of Minority costumes and the construction of the Minority costume element library. In terms of digital protection, Huang Yonglin[1] and Professor Tan Guoxin, on the basis of analyzing the huge advantages of digital protection of intangible cultural heritage, advocated the establishment of a digital protection and inheritance technology system for intangible cultural heritage, including digital technology, resource warehousing technology, resource management technology, scenario construction technology, visualization technology, communication and service technology. In image processing, the current image processing technology is mainly divided into traditional image processing and image processing based on depth learning. In traditional image processing, the extraction of image features includes global features and local features, including color, shape and texture. In recent years, local feature extraction has also been widely used. Common local feature extraction methods include Harris[2] feature extraction, SIFT[3] feature extraction, HOG feature[4] extraction, etc. In the aspect of apparel image feature processing, Chen Jinguang[5] confirmed the SIFT feature and SURF feature in the apparel image through the best node first (BBF) algorithm. At the same time, LBP (local binary mode) feature and LDP (local direction mode) feature are used in image texture feature extraction. 2. Image Preprocessing Algorithm 2.1. Image Segmentation Algorithm Image segmentation is mainly to segment the required image information from the source image. At present, the mainstream image segmentation algorithms include edge detection segmentation algorithm and region segmentation algorithm. The edge detection and segmentation algorithm mainly uses the characteristics of discontinuous gray levels of pixels in different regions of the image to detect the edges between different regions of the image, so as to achieve image segmentation. The position of the edge pixel points corresponds to the extreme value point of the first derivative and the zero crossing point (zero crossing point) of the second derivative, which can be calculated with the differential operator during edge detection. The commonly used first order differential operators are Roberts operator, Sobel operator, Prewitt operator, Kirsch operator, and the second order differential operators are Laplace operator and LOG operator. Region segmentation algorithm is mainly to gather pixels with similar characteristics to form a region. Judge whether the pixels around the initial seed point are merged into the growing area of the seed point according to the feature similarity criteria, and repeat the above process as new seed points, until no new pixels are merged into the area, and the growing area forms the segmented image area. Although the region growing segmentation algorithm is simple and easy to understand, it requires manual interaction to determine the seed growth point, which easily leads to over segmentation or under segmentation of the image. At the same time, the algorithm is sensitive to noise. The basic idea of the region 160 splitting and merging algorithm is to split the regions that do not meet the criteria of region feature consistency into sub regions, until all regions do not meet the splitting conditions, the splitting ends, and the adjacent sub regions that meet the criteria of feature consistency are merged to achieve image segmentation. Compared with a single split and merge algorithm, the region split and merge algorithm has a better image segmentation effect. At the same time, this algorithm also has some shortcomings, such as a large amount of computation, which may destroy the boundary of the region when splitting. 2.2. Image Scaling Algorithm At present, there are two main methods of image scaling: nearest neighbor interpolation and bilinear interpolation. Nearest neighborhood interpolation is to multiply the pixels of the target image by the scaling ratio before and after image scaling. After multiplication, the nearest pixel is rounded to find the pixel. The bilinear interpolation method is different from the nearest neighborhood interpolation method. The bilinear interpolation method calculates the value of the point (gray value or RGB value) by finding the four pixels closest to the corresponding coordinate. Through the corresponding algorithm formula, calculate the distance weight of the nearest four pixels, and finally obtain the specific image pixel value. In this paper, we will use bilinear interpolation to complete the image scaling preprocessing of relevant Minority costumes and carry out experimental verification. 3. Digital Preprocessing of Minority Costume Images The algorithm of correlation image preprocessing is introduced. We will preprocess the image resources of Minority minority costumes through experiments and improve the relevant preprocessing algorithms. Due to the different sizes and quality of the images of Minority minority costumes collected in practical applications, the experiment will process the images of Minority minority costumes accordingly. For the images of Minority costumes used in this paper, we have cut, zoom, edge detection and other operations. 3.1. Image Preprocessing of Minority Costumes The image preprocessing of Minority costumes mainly deals with the Minority costume images in the establishment of Minority costume resource database. For many of the images we collected, there are problems such as different pixels and different contents. And we need to do the pattern detection and image classification recognition in Minority minority costumes images, so we must preprocess Minority minority costumes images in advance. Our specific processing flow in the image preprocessing of Minority costumes is shown in Figure 1. Figure 1. Flow Chart of Image Preprocessing of Minority Costume As can be seen from the figure, first, we read the image and segment the acquired minority costume image to find the area we need to use. Since the pixels of the minority costume images we collected are 2832 × 4256 pixels. In the subsequent feature extraction and convolution operations, the size of the pixel will directly affect our calculation. Therefore, we will carry out pixel compression operations on the segmented minority costumes images to reduce the subsequent calculation without affecting the image effect. However, because the color image is not conducive to subsequent calculation in the process of image edge detection, HOG feature extraction, etc., we will also carry out grayscale processing, edge detection and other operations on the image. After completing the above three steps, our minority costume image size, pixel and other features tend to be stable for subsequent correlation operations. 3.2. Image Scaling of Minority Costumes In this paper, the first step of the image preprocessing of minority costumes is to zoom the minority costumes image. Since the pixels of the original image are relatively high, we need to scale the collected image. In the zooming of national costume images, we mainly write the code based on OpenCV library, and read the images for zooming. Among the nearest neighbor interpolation and bilinear interpolation mentioned in related technologies, the latter is generally used widely, and the scaling effect is good. In our experiment, this method is used to scale the minority costumes image. From the experimental results, we can see that the image scaling effect is good. The main algorithm flow is as follows: Step1: Read the image to get the width and height of the image imgInfo=img.shape; 161 Step2:Scale the width and height of the image, reduce the scale by half, and rounding; dstHeight=int (height/2) (1) dstWidth=int (width/2) (2) Step3:Determine the RGB value of the new pixel by calculating the distance weight and bring the value into each pixel for i in range(0,dstHeight): for j in range(0,dstWidth): iNew = int(i*(height*1.0/dstHeight)) jNew = int(j*(width*1.0/dstWidth)) dstImage[i,j] = img[iNew,jNew] Figure 2. Scale Minority Costume Image It can be seen from the experimental results in Figure 2 that the pixel size of the scaled image is half smaller than that of the original image, but the display effect of the image is not affected by the scaling process. The costumes image pixel is reduced through image zooming, which provides more convenient calculation for the training and testing of the minority costumes dataset. 3.3. Edge detection of Minority Costume Image In the previous part of the relevant technology, we briefly introduced the edge detection segmentation method. Here we use the edge detection algorithm to process the national costume image. In the first step of image edge detection, the sobel operator shown in Figure 3 can be used to perform the convolution operation on the minority costumes image. Figure 3. Sobel Operator Template Use the image pixels in the vertical direction of the convolution check in Figure 3A to perform the image convolution operation.Use the convolution check in Figure 3B to perform the convolution operation on the image pixels in the horizontal direction.After the convolution operation, we perform the square root extraction. The specific formula is: 22 baf  (3) The value of a is the result of the vertical image convolution, and the value of b is the result of the horizontal image convolution.The calculated f value is defined as the floating value, and the size of the floating value is judged to complete the operation of edge detection on the image.The main process of edge detection algorithm is as follows: Step1: Read the image and complete the grayscale processing of minority costume image; Step2: Use convolution kernel A and convolution kernel B to perform image convolution in vertical and horizontal directions respectively; Step3: Calculate the threshold value through square root operation and judge the size of the threshold value to complete image edge detection. Figure 4 and Figure 5 show the edge detection results of minority minority costumes images. It can be seen from Figure 5 that the patterns in minority minority costumes images can be clearly detected. In addition to the decorative pattern, the surrounding redundant factors in the image can also be further filtered. Figure 4. Edge Detection Source Image 162 Figure 5. Edge Detection Experiment Results At the same time, we completed the experiment of contrast edge detection effect. Use the Candy algorithm of OpenCV to detect the edge of the same minority minority costumes image. From the comparison test Figure 6, the effect of image edge detection through image convolution calculation is better, and the details of image edge patterns are also more perfect. Figure 6. Edge Detection Results of Conventional Candy Algorithm 4. Conclusions This paper studies the digital processing technology of minority costume image. This paper presents a digital processing scheme of minority costume image based on digital image processing technology. The algorithm of scaling and edge detection used in image preprocessing is verified by experiments, and the algorithm is optimized in the edge detection of minority costumes image, which improves the accuracy of image processing. It realizes the edge detection of the patterns in the minority costumes images, and also makes preparations for the subsequent minority costumes image processing based on the target detection area. Acknowledgment This work was financially supported by Guangdong University of Science and Technology's 2021 scientific research projects “Research on Pattern Detection of Minority Costumes Based on Faster RCNN -- Taking Dongguan Hakka Ethnic Costumes Culture as an Example” Project No: GKY- 2021KYQNK-4; References [1] Huang Yonglin, Tan Guoxin. Research on Digital Protection and Development of China's Intangible Cultural Heritage [J]. Journal of Central China Normal University (Humanities and Social Sciences Edition), 2012,51 (2): 49-55. [2] Harris C,Stephens M.A Combined Comer and Edge Detector[C]. In Proceedings of Alvey Conference, 1988:147- 151. [3] Lowe D G.Distinctive image features from scale-invariant Keypoints[J].International journal of computer vision, 2004, 60(2):91-110. [4] Dalal N,Triggs B.Histograms of oriented gradients for human detection.Computer Vision and Pattern Recognition, 2005. CVPR2005.IEEE Computer Society Conference on. IEEE, 2005,1:886-893. [5] Chen Jinguang, Cao Chunmei, Ren Bingqing, et al. Research on the application of feature extraction and matching algorithm in national costume patterns [J] Silk, 2015, 52 (5): 36-41.