Clothing data processing method and device, equipment, storage medium and program product
By spatially registering and extracting features from two-dimensional images and three-dimensional geometric models of Gan Opera costumes, the problem of contour separation and feature preservation in the digital archiving of highly reflective metallic thread embroidered costumes was solved, and the accurate inference and digital binding of the costume material state were achieved.
Patent Information
- Application Number
- CN202511637494.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-10
- Publication Date
- 2026-02-13
AI Technical Summary
Existing technologies struggle to accurately identify and preserve the outlines of garments with special optical properties, such as highly reflective metallic thread embroidery, resulting in compromised integrity and accuracy of digital images.
By acquiring two-dimensional image data and three-dimensional geometric model data of Gan Opera costumes, spatial registration is performed to determine the main outline of the costumes, and optical reflection areas are identified. Optical and morphological features are extracted, and material state inference and correlation are performed in combination with the three-dimensional geometric model.
It enables accurate inference and digital binding of clothing material conditions, improves the accuracy and integrity of digital images, and ensures the preservation of highlight information.
Smart Images

Figure CN121527237A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, specifically to a method, apparatus, equipment, storage medium, and program product for processing clothing data. Background Technology
[0002] In the digital preservation of cultural heritage, high-precision image acquisition and processing is the core link. The key challenge in the digital archiving of traditional opera costumes is that it is necessary to accurately separate the main body of the costume from complex images while preserving the true visual characteristics of the material.
[0003] Taking the digital archiving of Gan Opera costumes as an example, one of the key processes is to achieve "subject separation" using image processing programs. This involves automatically separating the costumes from a solid-color background based on differences in color and brightness, generating interference-free digital materials. However, conventional methods face significant difficulties when processing precious collections such as "python robes" and "embroidered robes" from the late Qing Dynasty and early Republic of China period. These costumes extensively use real gold and silver threads for embroidery, and the metallic materials produce strong high-intensity reflections under professional high-intensity lighting. The original separation logic relies on preset brightness or color thresholds to distinguish the foreground from the background, but the highlight areas of the metallic embroidery threads are extremely bright, even approaching or exceeding the background values.
[0004] Existing automated image processing methods are poorly adapted to materials with special optical properties, such as those containing highly reflective metallic thread embroidery. Algorithms easily misidentify highlight areas as background or broken holes, resulting in numerous gaps and burrs in the identified garment outlines, severely compromising the integrity and accuracy of the image. While using 3D image modeling for digital archiving of garments can provide more space and detail for accurate representation, it often struggles to accurately simulate the true optical behavior of special materials like highly reflective metallic thread embroidery, resulting in a lack of realism. Summary of the Invention
[0005] This invention provides a method, apparatus, device, storage medium, and program product for processing clothing data, in order to solve the problem of low accuracy of digital images of clothing caused by the special optical properties of the materials in the prior art.
[0006] In a first aspect, the present invention provides a method for processing clothing data, the method comprising: Acquire the two-dimensional image data and three-dimensional geometric model data of the garment to be processed; Spatial registration is performed between two-dimensional image data and three-dimensional geometric model data to determine the main outline of the clothing in the two-dimensional image data; Determine the optical reflection area within the main outline of the garment; Extract target features from the optical reflection region. These target features include both optical and morphological characteristics. Based on the target characteristics, determine the material state of the optical reflection region; The target features, material state, and 3D geometric model data are correlated.
[0007] In one alternative implementation, extracting target features of the optical reflection region includes: The 3D geometric model data is divided into semantic regions to obtain multiple semantic regions; Based on the spatial location of the optical reflection region in the three-dimensional geometric model data, the optical reflection region is mapped to the corresponding semantic region to form a feature cluster; Optical feature extraction and morphological feature extraction are performed on each optical reflection region in the feature cluster; The optical features and morphological features extracted from the feature clusters are aggregated to obtain the target optical features and target morphological features corresponding to the optical reflection region.
[0008] In one optional implementation, optical feature extraction and morphological feature extraction are performed on each optical reflection region in the feature cluster, including: Determine whether the number of pixels in the optical reflection area is less than a preset threshold; When the number of pixels in the optical reflection region is less than a preset threshold, the brightness attenuation trend of the optical reflection region is calculated based on the local pixel brightness distribution of the feature cluster to which the optical reflection region belongs, and used as an optical feature; the morphological features of the optical reflection region are determined based on the preset morphological classification rules. If the number of pixels in the optical reflection area is greater than or equal to a preset threshold, calculate the peak brightness and / or brightness decay trend of the optical reflection area and use them as optical features; calculate the area and perimeter of the optical reflection area and / or the roundness index and aspect ratio and use them as morphological features.
[0009] In one alternative implementation, the material state of the optical reflection region is determined based on target features, including: Normalize the target optical features and target morphological features in the feature cluster to obtain normalized features; Based on the ability of normalized features to distinguish different material states, a preset weight is assigned to each normalized feature. Based on normalized features and preset weights, the matching score between feature clusters and preset multiple material states is calculated. Determine whether the highest matching score exceeds a preset reliability threshold; If the highest matching score exceeds the preset reliability threshold, the material state corresponding to the highest matching score will be taken as the material state of the feature cluster. If the highest matching score does not exceed the preset reliability threshold, obtain the feature clusters adjacent to the feature clusters. The material state of a feature cluster is determined by using the material state of adjacent feature clusters.
[0010] In one optional implementation, the material state of a feature cluster is determined based on the material state of adjacent feature clusters, including: The material states of adjacent feature clusters are weighted by confidence to obtain weighted statistical results; Based on the weighted statistical results, the material state with the highest cumulative weight value is selected as the material state of the feature cluster.
[0011] In one alternative implementation, associating the material state with the three-dimensional geometric model data includes: The surface of the 3D geometric model data is divided into multiple surface elements; Determine the projection position of each surface element in the two-dimensional image data; Identify feature clusters that have spatial overlap or proximity with the projected location; When there are multiple feature clusters, the material states of the feature clusters are weighted and fused to obtain the material state of the surface element. Spatial smoothing is performed on the material state of surface elements in a 3D geometric model; Associate the material state after spatial smoothing with the corresponding surface element.
[0012] In a second aspect, the present invention provides a clothing data processing device, the device comprising: The acquisition module is used to acquire the two-dimensional image data and three-dimensional geometric model data of the garment to be processed; The registration module is used to spatially register two-dimensional image data with three-dimensional geometric model data to determine the main outline of clothing in the two-dimensional image data. The optical reflection area determination module is used to determine the optical reflection area within the outline of the main body of the garment; The extraction module is used to extract target features from the optical reflection region. The target features include target optical features and target morphological features. The material state determination module is used to determine the material state of the optical reflection region based on the target features. The association module is used to associate target features, material status, and 3D geometric model data.
[0013] Thirdly, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the clothing data processing method of the first aspect or any corresponding embodiment described above.
[0014] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the clothing data processing method of the first aspect or any corresponding embodiment described above.
[0015] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to execute the clothing data processing method described in the first aspect or any corresponding embodiment thereof.
[0016] Compared with the prior art, the present invention has the following beneficial effects: By acquiring two-dimensional image data and three-dimensional geometric model data of costumes such as those used in Gan Opera, and spatially registering them, the two-dimensional image information and three-dimensional geometric information can be effectively combined. Based on this, the main outline of the costume in the two-dimensional image is determined using the registered three-dimensional geometric model. This overcomes the problem of inaccurate costume outline recognition caused by the special optical properties of materials (such as high reflectivity) in existing technologies, ensuring the accurate extraction of the main costume area. Furthermore, by identifying optical reflection areas within the main costume outline and performing quantitative analysis to obtain optical and morphological features, the visual attributes of the costume material can be deeply explored, providing rich and accurate data support for subsequent material inference. Finally, based on these optical and morphological features, the material state corresponding to the optical reflection areas is inferred, and the optical features, morphological features, and material state are correlated with the corresponding areas in the two-dimensional image and the corresponding surfaces in the three-dimensional geometric model. This effectively solves the problems of distortion in digital results and damage to the authenticity and integrity of cultural relic information in existing technologies, improving the accuracy and integrity of digital images of costumes. Attached Figure Description
[0017] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of the first type of clothing data processing method according to an embodiment of the present invention; Figure 2 This is a structural block diagram of a clothing data processing device according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.
[0021] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0022] Traditional opera costumes often contain materials with special optical properties, such as highly reflective metallic threads used in embroidery. Existing automated image processing methods are poorly adapted to these materials, making it difficult to accurately identify the complete outline of the costumes. Faced with this problem, cultural relic experts have clearly stated that the outlines should not be corrected manually in post-production. This is because high-reflectivity is an important visual feature of the material and craftsmanship; removing it would result in information loss. Furthermore, manual processing is inefficient and inconsistent, violating the principle of "realistic restoration" and the requirements of automated processing. Therefore, it is necessary to achieve automated, high-precision processing through digital technology to ensure accurate outlines while preserving highlight information.
[0023] In the process of digital archiving, in addition to 2D image acquisition, high-precision spatial morphological data of clothing is simultaneously obtained through non-contact 3D scanning for structural analysis, virtual display, and restoration reference. The acquired, illumination-independent 3D geometric data can be used to reverse-calibrate the contour separation results of the 2D images. However, this process requires solving the following key technical problems: achieving high-precision spatial alignment between 2D images and 3D models; establishing accurate correspondence between pixels and geometric surfaces; overcoming differences in coordinate systems, image distortion, and scale; developing new algorithms to guide the correction of 2D separation results with 3D contours, especially in areas where high-light reflection causes failure; identifying and labeling high-light areas as special material properties, and accurately associating them with 2D pixels and 3D surfaces to form a closed loop of multi-source data integration and semantic information fusion.
[0024] In summary, there is an urgent need to develop a new automated data processing method that can collaboratively process two-dimensional images and three-dimensional geometric data in order to solve the problem of contour separation and feature preservation in the digitization of cultural relics made of highly reflective materials.
[0025] In view of this, according to an embodiment of the present invention, an embodiment of a clothing data processing method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0026] This embodiment provides a method for processing clothing data, which can be used on servers, terminals, and mobile terminals such as mobile phones and tablets. Figure 1 This is a flowchart of a clothing data processing method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps: Step S101: Obtain the two-dimensional image data and three-dimensional geometric model data of the garment to be processed.
[0027] The garments to be processed in this invention refer to garments made of materials with special optical properties, such as highly reflective metallic thread embroidery. In this embodiment, Gan opera costumes are used as an example. Two-dimensional image data refers to planar images of Gan opera costumes acquired through devices such as cameras and scanners, which contain visual information such as the color, texture, and brightness of the costumes. Three-dimensional geometric model data refers to three-dimensional data of Gan opera costumes constructed through 3D scanning, modeling, and other technologies, which contains information such as the geometric shape and surface topology of the costumes.
[0028] Step S102: Spatial registration is performed between the two-dimensional image data and the three-dimensional geometric model data to determine the main outline of the clothing in the two-dimensional image data.
[0029] Spatial registration refers to aligning two-dimensional image data with three-dimensional geometric model data in space, ensuring that each pixel in the two-dimensional image accurately corresponds to a surface element in the three-dimensional geometric model. This spatial registration process can be achieved using various registration algorithms, such as feature-point-based registration, region-based registration, or depth-information-based registration. Alternatively, several feature points in the two-dimensional image can be manually selected, and their corresponding three-dimensional points found in the three-dimensional geometric model. The transformation matrix from the two-dimensional image to the three-dimensional geometric model can then be calculated using the least squares method, achieving preliminary registration. Another approach is to utilize deep learning-based registration algorithms. By training a neural network, the correspondence between the two-dimensional image and the three-dimensional geometric model can be automatically learned, resulting in more accurate registration.
[0030] Furthermore, the projection information of the 3D geometric model can be used to generate an initial mask for the clothing region in the 2D image. This mask can then be optimized using image segmentation algorithms (such as GrabCut or semantic segmentation networks) to accurately extract the main outline of the clothing. The main outline of the clothing refers to the boundary line that separates the Gan opera costume from the background in the 2D image. Accurately determining the main outline of the clothing is a prerequisite for subsequent identification of optical reflection areas.
[0031] Step S103: Determine the optical reflection area within the main outline of the garment.
[0032] Optical reflection areas within the main outline of clothing can be determined by analyzing the brightness distribution and gradient information of an image. For example, brightness thresholding can be performed on pixels within the main outline of the clothing, identifying areas with brightness exceeding a preset threshold as potential optical reflection areas. Alternatively, specular detection algorithms can be used to identify areas in the image with specular reflection characteristics. Optical reflection areas refer to regions in a two-dimensional image that have high brightness or special lighting effects due to the optical properties of the clothing material (such as gloss, reflection, etc.). These areas typically reflect the true properties of the clothing material.
[0033] Step S104: Extract the target features of the optical reflection area. The target features include the target optical features and the target morphological features.
[0034] Optical features are quantitative indicators describing the illumination properties of an optically reflective region. These features can include peak brightness, brightness decay trend, gloss, etc. For example, the average brightness and maximum brightness of pixels within the optically reflective region can be calculated, and the rate of brightness decay from the center to the edge can be analyzed. Morphological features can include area, perimeter, roundness index, aspect ratio, etc. For example, the number of pixels in the optically reflective region can be calculated to represent its area, and the number of pixels at its boundary can be calculated to represent its perimeter.
[0035] Step S105: Determine the material state of the optical reflection region based on the target features.
[0036] Material state refers to the physical properties or visual appearance of clothing materials. This can be achieved by constructing a classification model that categorizes optically reflective areas into different material categories based on optical and morphological features, such as silk, cotton, linen, metal, and embroidery. For example, a support vector machine (SVM) or neural network model can be trained, taking optical and morphological features as input and outputting the corresponding material state.
[0037] Step S106: Associate the target features, material state, and three-dimensional geometric model data.
[0038] For example, the optical features, morphological features, and inferred material state of each optical reflection region can be stored as metadata and linked to the pixel coordinates of that region in the 2D image. Simultaneously, through spatial registration, this information is mapped and bound to the corresponding surface elements in the 3D geometric model, thereby achieving deep fusion of 2D image information and 3D geometric model information.
[0039] The application environment of this invention can be a computing platform integrating image processing, 3D modeling, and data analysis functions. This platform can be equipped with a high-performance processor, large-capacity memory, and a professional graphics processing unit to support complex data processing and computational tasks. The core of the Gan Opera costume data processing method proposed in this embodiment lies in the deep fusion and analysis of two-dimensional image data and three-dimensional geometric model data of Gan Opera costumes, thereby achieving accurate inference of the costume material state.
[0040] In this embodiment, the acquisition of two-dimensional image data and three-dimensional geometric model data of the Gan Opera costume lays the foundation for subsequent refined analysis. Two-dimensional image data provides rich visual details, while three-dimensional geometric model data provides precise spatial geometric information. Subsequently, spatial registration of these two types of data ensures that the visual information in the two-dimensional image can be accurately mapped to the corresponding surface of the three-dimensional geometric model, thus establishing a precise correspondence between the image and the model. Based on this, the spatially registered three-dimensional geometric model can more accurately determine the main outline of the costume in the two-dimensional image. This step is crucial for separating the costume from the complex background, providing clear boundaries for subsequent optical reflection area identification. Once the main outline of the costume is determined, the system can identify the optical reflection areas within the outline. These areas are usually formed due to the special optical properties of the costume material (such as gloss and reflection), and they carry key information about the material properties. Next, the identified optical reflection areas are quantitatively analyzed to obtain their optical and morphological features. Optical features (such as brightness and gloss) and morphological features (such as area and shape) are key indicators describing these reflection areas, objectively reflecting the visual performance of the material. Based on these quantified optical and morphological features, the system can infer the material state corresponding to the optical reflection area. This inference process utilizes data analysis and pattern recognition techniques to transform abstract visual features into specific material categories, such as silk or metal wire. Finally, the acquired optical and morphological features, along with the inferred material state, are correlated with the corresponding regions in the two-dimensional image and the corresponding surfaces in the three-dimensional geometric model. This correlation operation allows the visual information of the two-dimensional image, the quantified features of the optical reflection area, and the inferred material state to be closely integrated with the geometric structure of the three-dimensional geometric model. This not only enriches the semantic information of the two-dimensional image but, more importantly, endows the three-dimensional geometric model with realistic material properties, making the digitized Gan opera costume model more visually realistic and more complete in terms of information.
[0041] Overall, the method of this invention combines the visual details of two-dimensional images with the geometric structure of three-dimensional geometric models and performs refined analysis of optical reflection areas, achieving accurate inference and digital binding of the material state of clothing. This collaborative approach ensures the integrity and accuracy of the material information from raw data to final information, providing solid technical support for the digital protection and display of clothing made of materials with special optical properties, such as highly reflective metallic thread embroidery.
[0042] In some optional implementations, step S104 above, namely extracting the target features of the optical reflection region, includes: Step S1041: Divide the three-dimensional geometric model data into semantic regions to obtain multiple semantic regions.
[0043] Taking Gan Opera costumes as an example, this specifically refers to dividing the three-dimensional geometric model of Gan Opera costumes into multiple semantically specific regions based on their structure, function, or material properties. For instance, the three-dimensional geometric model of a Gan Opera costume can be divided into different semantic regions such as the collar, sleeves, body, skirt, and decorations. This division can be automated based on a pre-defined costume structure knowledge base, or it can be completed with the assistance of manual annotation or semi-automated tools. The purpose is to provide structured contextual information for subsequent optical reflection area analysis.
[0044] Step S1042: Based on the spatial location of the optical reflection region in the three-dimensional geometric model data, the optical reflection region is mapped to the corresponding semantic region to form a feature cluster.
[0045] In other words, optical reflection regions are categorized into feature clusters projected onto the 3D semantic regions based on their corresponding positions on the 3D geometric model. This can be understood as optical reflection regions identified in a 2D image being mapped onto a 3D geometric model through spatial registration. Then, these optical reflection regions are grouped according to their semantic regions on the 3D geometric model. For example, all optical reflection regions mapped to the "collar" semantic region will be categorized into a "collar feature cluster"; all optical reflection regions mapped to the "sleeve" semantic region will be categorized into a "sleeve feature cluster." Thus, each feature cluster represents all optical reflection information within a specific semantic region of the clothing. The purpose is to correlate dispersed 2D optical information with 3D structural and semantic information, providing a more representative dataset for subsequent quantitative analysis.
[0046] Step S1043: Perform optical feature extraction and morphological feature extraction on each optical reflection region in the feature cluster.
[0047] Specifically, this involves detailed image processing and analysis of each individual optical reflection region within each feature cluster. Optical features may include, but are not limited to, brightness, contrast, color saturation, gloss, and reflection intensity distribution; morphological features may include, but are not limited to, area, perimeter, shape, aspect ratio, roundness, and texture. The extraction of these features aims to accurately describe the visual attributes of each tiny reflection point, with the purpose of providing refined data support for subsequent material state inference.
[0048] Step S1044: The optical features and morphological features in the extracted feature clusters are aggregated to obtain the target optical features and target morphological features corresponding to the optical reflection region.
[0049] In other words, it involves statistically summarizing the optical and morphological characteristics of all optical reflection regions within a feature cluster. Specifically, after completing the quantitative analysis of all individual optical reflection regions within a feature cluster, the characteristics of these individual regions are aggregated. This aggregation can employ various statistical methods, such as calculating the mean, median, standard deviation, maximum, and minimum values, or performing histogram analysis, to obtain comprehensive optical and morphological characteristics representing the entire feature cluster. The aim is to eliminate noise or local anomalies that may exist in individual reflection regions, thereby obtaining a more stable and representative feature set that better reflects the overall material properties of the semantic region.
[0050] In this embodiment, the three-dimensional geometric model is first semantically divided, and based on this, the optical reflection regions in the two-dimensional image are categorized into feature clusters projected from the corresponding three-dimensional semantic regions, thus achieving structured management of the optical reflection regions. This preprocessing and grouping ensures that subsequent quantitative analysis of the optical reflection regions is no longer performed in isolation, but rather based on their semantic context. By finely quantifying each optical reflection region within each feature cluster and finally statistically summarizing the features of the entire feature cluster, more representative and robust optical and morphological features can be obtained, effectively solving the problem of inaccurate or incomplete feature extraction that may exist in traditional methods when processing complex clothing data.
[0051] Through the above technical solution, this invention can more accurately capture the material characteristics of different areas of costumes such as those used in Gan Opera, improving the accuracy and reliability of optical and morphological feature extraction. This semantic region-based quantitative analysis method effectively reduces the impact of local noise in a single optical reflection area on the overall feature extraction, enabling subsequent material state inference to be based on more stable and representative data, thereby significantly improving the accuracy and robustness of material state inference for costumes such as those used in Gan Opera.
[0052] In some optional implementations, step S1043 above, which involves extracting optical features and morphological features for each optical reflection region in the feature cluster, includes: Step a1: Determine whether the number of pixels in the optical reflection area is less than a preset threshold.
[0053] Specifically, when performing quantitative analysis on optical reflection regions, it is first necessary to determine whether the number of pixels contained in the optical reflection region is less than a preset threshold. This preset threshold can be set empirically or determined through training based on factors such as the actual application scenario, image resolution, noise level, and the required level of detail of the features. Its purpose is to distinguish between optical reflection regions that are smaller in size, may be more affected by noise, or have indistinct features, and optical reflection regions that are larger in size, have richer features, and are more stable.
[0054] Step a2: When the number of pixels in the optical reflection area is less than a preset threshold, calculate the brightness attenuation trend of the optical reflection area based on the local pixel brightness distribution of the feature cluster to which the optical reflection area belongs, and use it as an optical feature; determine the morphological features of the optical reflection area based on the preset morphological classification rules.
[0055] If the number of pixels in the optical reflection area is less than a preset threshold, it indicates that the area may be a tiny highlight or a minor reflection. In this case, to more accurately capture its optical characteristics, the brightness attenuation trend of the optical reflection area can be calculated based on the local pixel brightness distribution within the optical reflection area and its associated feature cluster.
[0056] Local pixel brightness distribution refers to the variation in brightness values of the optically reflective area and its immediately surrounding pixels. By analyzing this variation, the reflection characteristics of light in that area can be inferred, such as the degree of gloss diffusion. Brightness decay trends can be understood as the rate and pattern of brightness decrease from the center of the bright area outwards, which is important for distinguishing the gloss levels of different materials. Furthermore, the morphological features of such small areas can be acquired based on the optically reflective area and preset morphological classification rules. These preset morphological classification rules can be simplified rules for small areas, such as directly classifying them into basic shapes like dots, lines, or small blocks, or describing them based on simple geometric features of their pixel distribution.
[0057] Step a3: If the number of pixels in the optical reflection area is greater than or equal to a preset threshold, calculate the peak brightness and / or brightness decay trend of the optical reflection area and use them as optical features; calculate the area and perimeter of the optical reflection area and / or the roundness index and aspect ratio and use them as morphological features.
[0058] If the number of pixels in the optical reflection region is not less than a preset threshold, it indicates that the region is a relatively large and information-rich optical reflection region. In this case, the peak brightness and / or brightness decay trend of the optical reflection region can be calculated as optical features. Peak brightness refers to the highest brightness value of the pixels in the region, directly reflecting the specular reflection intensity of the material. The brightness decay trend can also be used to describe the diffusion characteristics of gloss, but for large regions, its calculation may be based on a wider pixel range. Furthermore, for obtaining morphological features, the area and perimeter of the optical reflection region and / or the roundness index and aspect ratio can be calculated. Area and perimeter are basic geometric features describing the size and boundary complexity of the region. Roundness index (e.g., 4π × area / perimeter^2) and aspect ratio can more precisely describe the shape of the region, such as whether it is closer to a circle, ellipse, or irregular shape. These morphological features are crucial for distinguishing the surface texture and structure of different materials.
[0059] This embodiment achieves adaptive quantization analysis of optical reflection regions of different sizes by introducing a judgment on the number of pixels in the optical reflection region. Because small-sized optical reflection regions may suffer from unstable feature extraction or be susceptible to noise due to the low pixel count, while large-sized regions provide richer detail information, this embodiment specifically designs two different feature extraction strategies. For regions with a small number of pixels, the focus is on using local pixel brightness distribution to calculate brightness decay trends and employing simplified morphological classification rules to avoid misjudgments due to insufficient data and improve the ability to capture tiny highlight points. For regions with a pixel count not less than a preset threshold, richer features can be extracted, such as peak brightness, area, perimeter, roundness index, and aspect ratio, thus providing a more comprehensive and accurate description of their optical and morphological characteristics. This divide-and-conquer strategy ensures that regardless of the size of the optical reflection region, the most effective features reflecting its material properties can be obtained, thereby overcoming the limitations of a single quantization method.
[0060] In some optional implementations, step S105 above, namely determining the material state of the optical reflection region based on the target features, includes: Step S1051: Normalize the target optical features and target morphological features in the feature cluster to obtain normalized features.
[0061] The optical and morphological features of each feature cluster are normalized to eliminate differences in the dimensions and numerical ranges of different features, ensuring that all features are comparable in subsequent matching degree calculations. For example, brightness values may be between 0 and 255, while areas may be between hundreds and thousands of pixels. Through normalization (such as min-max normalization or Z-score normalization), they can be mapped to a uniform numerical range.
[0062] Step S1052: Assign a preset weight to each normalized feature based on its ability to distinguish different material states.
[0063] Based on the ability of normalized features to distinguish different material states, a preset weight is assigned to each normalized feature. This means that features that show stronger discriminative power in distinguishing specific materials (such as the luster of silk or the texture roughness of cotton and linen) will be given higher weights to enhance their influence in material inference.
[0064] Step S1053: Based on normalized features and preset weights, calculate the matching score between the feature cluster and preset multiple material states.
[0065] This matching score can be implemented based on various algorithms. For example, it can be achieved by calculating the distance between the feature vector and the feature vector of a known material template (such as Euclidean distance or cosine similarity), or by training a machine learning model (such as a support vector machine or neural network) to predict the probability that each feature cluster belongs to different material states. These preset material states can be predefined typical costume materials for Gan opera, such as silk, cotton, linen, embroidery, and metal ornaments. After obtaining the matching score, the matching scores of various material states will be compared.
[0066] Step S1054: Determine whether the highest matching score exceeds the preset reliability threshold.
[0067] This preset confidence threshold is designed to ensure that the inference is adopted only when the inference is very clear, thus avoiding errors caused by low-confidence inferences.
[0068] Step S1055: If the highest matching score exceeds the preset confidence threshold, the material state corresponding to the highest matching score is taken as the material state of the feature cluster.
[0069] If the highest matching score exceeds the preset reliability threshold, the material state inference result of the feature cluster is considered to have high reliability, and the corresponding material state is directly inferred as the material state of the feature cluster.
[0070] Step S1056: If the highest matching score does not exceed the preset reliability threshold, obtain the feature clusters adjacent to the feature clusters.
[0071] If the highest matching score does not exceed the preset reliability threshold, it indicates that there is uncertainty or ambiguity in the inference of the material state of the current feature cluster. In this case, the system will obtain the inferred material state of the neighboring feature clusters within the 3D semantic region.
[0072] Step S1057: The material state of the feature cluster is determined by the material state of the adjacent feature clusters.
[0073] Generally, within a localized area of clothing, the material typically exhibits spatial continuity. By analyzing the material states of adjacent feature clusters, contextual information can be provided for inferring the material of the currently uncertain feature cluster. Subsequently, based on the majority inferred material states of adjacent feature clusters, the material state of the current feature cluster can be determined. For example, if the material inference of a feature cluster is uncertain, but most of its surrounding feature clusters are inferred as "silk," then that feature cluster is also very likely to be made of "silk."
[0074] Based on optical and morphological features, this method infers the material state of each feature cluster within a 3D semantic region and identifies material state differences between different feature clusters within the 3D semantic region. Specifically, after quantifying and classifying optical reflection regions into feature clusters, the method no longer directly infers the material state of each individual optical reflection region. Instead, the granularity of the inference is elevated to the feature cluster level. Feature clusters are formed by classifying optical reflection regions according to their corresponding positions on the 3D geometric model after semantic region division. Therefore, inferring the material state of each feature cluster means using the statistical summary of the optical and morphological features of all optical reflection regions within that cluster to comprehensively determine the material properties of the clothing portion represented by that cluster. For example, a pre-trained classification model can be used, taking the summarized features of the feature cluster as input, and outputting its most likely material state, such as silk, cotton / linen, metal, or embroidery. Furthermore, it identifies material state differences between different feature clusters within the 3D semantic region. This means that after inferring the material state of each feature cluster, the system further analyzes whether there are differences in the material states between different feature clusters (e.g., the main fabric area on the sleeve and the embroidered cuff area) within the same three-dimensional semantic region (e.g., the sleeve area of a garment). This difference identification helps verify the reasonableness of the inference results. For example, if adjacent feature clusters expected to have the same material are inferred as having different materials, further verification or correction may be needed; conversely, if feature clusters expected to have different materials are correctly identified as having differences, it indicates that the inference is highly precise. This identification process may include comparing the inferred material states of adjacent feature clusters, or comparing the confidence levels of their material state inferences, to discover potential inconsistencies or confirm expected material changes.
[0075] By elevating the inference of material state from a single optical reflection region to the feature cluster level, and further identifying the differences in material state between different feature clusters within the same 3D semantic region, this method effectively solves the problems of semantic inconsistency or insufficient precision in material inference results that may exist in traditional methods. Specifically, inferring the material state for each feature cluster can comprehensively utilize the quantified features of all optical reflection regions within that cluster, thereby reducing the impact of noise or outliers in a single region on the overall inference result, making the material inference more stable and accurate. At the same time, identifying the differences in material state between different feature clusters within the 3D semantic region enables the system to perceive local material changes in clothing with fine precision, such as distinguishing the material of the main fabric and the embroidery on the same sleeve, or providing prompts or corrections when unreasonable differences are found, thereby ensuring that the final material information is highly consistent with the actual structure and design intent of costumes such as those used in Gan opera.
[0076] This embodiment normalizes and assigns weights to optical and morphological features, ensuring that different features participate fairly and effectively in the material state matching calculation, thereby improving matching accuracy. Furthermore, by introducing a high confidence threshold, the reliability of the direct inference results is ensured. More importantly, when the confidence of the direct inference is insufficient, material state information from adjacent feature clusters is introduced. Utilizing the principle of spatial continuity of materials, this provides strong assistance for material inference in uncertain regions, effectively solving the problem of inference difficulties caused by insufficient or ambiguous information from a single feature cluster.
[0077] In some optional implementations, step S1057 above, namely, determining the material state of a feature cluster based on the material state of adjacent feature clusters, includes: The material states of adjacent feature clusters are weighted by confidence to obtain weighted statistical results; Based on the weighted statistical results, the material state with the highest cumulative weight value is selected as the material state of the feature cluster.
[0078] In this study, a confidence-weighted statistical analysis of the inferred material state of adjacent feature clusters is performed to more accurately reflect the influence of adjacent regions on the current material state of the feature cluster.
[0079] Specifically, the inferred material state of each adjacent feature cluster is not simply counted, but also weighted according to its own inference confidence. For example, if the inferred material state of an adjacent feature cluster has a high confidence level, its weight in the statistics will be greater, and vice versa. This weighted statistics can effectively avoid the interference of low-confidence inferences on the final result and improve the accuracy of auxiliary judgment. Furthermore, after obtaining the weighted statistical results, the material state with the highest number of votes is selected as the auxiliary material state for the feature cluster. Here, "highest number of votes" means that after weighted statistics, the cumulative weight value of a certain material state is the highest. This method is similar to a majority voting mechanism, but by introducing confidence weighting, the inference results are made more robust. Its purpose is to supplement the material state by using material information from the surrounding area when the direct matching degree is insufficient to determine the material state, thereby improving the accuracy and reliability of material inference.
[0080] This embodiment addresses the problem of effectively utilizing information from neighboring regions when direct matching scores are insufficient to determine material status by performing a confidence-weighted statistical analysis of the inferred material states of adjacent feature clusters and selecting the material state with the highest number of votes in the weighted statistical results. Specifically, during the material state inference process, when the material state of a feature cluster cannot be determined with high confidence using its own optical and morphological features, the material state information of its neighboring feature clusters is introduced for auxiliary judgment. By weighting the confidence of the inferred material states of adjacent feature clusters, it ensures that neighboring regions with more reliable inference results have a greater impact on the judgment of the material state of the current feature cluster, thereby avoiding errors that may be caused by simple majority voting. Thus, even when local information is insufficient, the accuracy and robustness of material state inference can be improved by combining contextual information.
[0081] In some optional implementations, step S106 above, which associates the material state with the three-dimensional geometric model data, includes: Step S1061: Divide the surface of the three-dimensional geometric model data into multiple surface elements.
[0082] These surface elements can be vertices, patches (such as triangles and quadrilaterals), or smaller geometric units in a 3D mesh model. By subdividing the surface into smaller elements, finer granularity of material mapping can be achieved.
[0083] Step S1062: Determine the projection position of each surface element in the two-dimensional image data.
[0084] This can be achieved through projection transformation in computer graphics, mapping the coordinates of surface elements in three-dimensional space to pixel coordinates on a two-dimensional image plane. The projection location can be a single pixel, a pixel region, or a contour.
[0085] Step S1063: Determine the feature clusters that have spatial overlap or proximity with the projection position.
[0086] Feature clusters refer to a group of optical reflection regions formed in a two-dimensional image after semantic region division and classification. They typically represent regions with similar material properties. By comparing the two-dimensional projection positions of surface elements with the positions of each feature cluster in the two-dimensional image, it is possible to determine which feature clusters may affect the material state of the surface element.
[0087] Step S1064: When there are multiple feature clusters, the material states of the feature clusters are weighted and fused to obtain the material states of the surface elements.
[0088] If a surface element overlaps with or is adjacent to multiple feature clusters, the material states of these clusters are weighted and fused based on the degree of overlap or spatial distance between their projected regions to obtain the material state of the surface element. This means that when a 3D surface element corresponds to multiple potential material information sources in a 2D image, instead of simply selecting one, the material states of all relevant feature clusters are comprehensively considered. Feature clusters with greater overlap or closer spatial distance contribute more to the current material state of the surface element. This weighted fusion mechanism helps resolve local uncertainties in material inference and provides a smoother and more reasonable material transition.
[0089] Step S1065: Spatial smoothing is performed on the material state of surface elements in the three-dimensional geometric model.
[0090] Even after weighted blending, subtle abrupt changes in the material states of adjacent surface elements may still exist. Spatial smoothing aims to eliminate these unnatural abrupt changes, ensuring that the material distribution on the surface of a 3D geometric model appears visually continuous and natural. This can be achieved through smoothing algorithms, such as Gaussian smoothing, median filtering, or graph-based smoothing algorithms, to make the material states of adjacent surface elements more consistent.
[0091] Step S1066: Associate the material state after spatial smoothing with the corresponding surface element.
[0092] The smoothed material state is bound to the corresponding surface element in the 3D geometry model. This means that the finalized and optimized material state information (such as material type, reflection parameters, etc.) is attached as an attribute to each surface element of the 3D geometry model, thereby completing the fine-grained construction of the material of the 3D geometry model.
[0093] This embodiment effectively addresses the technical challenge of accurately and smoothly mapping the material state inferred from a 2D image to the surface of a 3D geometric model by introducing surface element partitioning, weighted fusion of multiple feature clusters, and spatial smoothing of material state. Specifically, the 3D geometric model surface is subdivided into multiple surface elements, resulting in finer granularity of material mapping and capturing richer material details. When a 3D surface element corresponds to multiple 2D feature clusters, a weighted fusion mechanism based on overlap or spatial distance is used to comprehensively consider material information from different feature clusters, effectively resolving local uncertainties in material inference and avoiding errors that may arise from simple selection. Furthermore, spatial smoothing of the material state of all surface elements eliminates discontinuities in material distribution, ensuring visual coherence and realism of the 3D geometric model surface material, making the final 3D geometric model of costumes such as those from Gan opera more natural and realistic in terms of material representation.
[0094] Through the above technical solution, this invention can significantly improve the accuracy and visual quality of material mapping in the three-dimensional geometric models of costumes such as those used in Gan Opera. By finely dividing surface elements and weighted fusion of multiple feature clusters, material information in two-dimensional images can be mapped onto the three-dimensional geometric model more accurately, effectively handling the ambiguity of material inference in complex scenes. At the same time, spatial smoothing ensures the continuity and natural transition of the surface material of the three-dimensional geometric model, avoiding material patches or abrupt changes that may occur with traditional methods. This makes the material representation of digital Gan Opera costumes more realistic and delicate, greatly enhancing the user's immersive experience and visual perception of the three-dimensional geometric model.
[0095] In one embodiment of the present invention, step S1064, when multiple feature clusters exist, involves weighted fusion of the material states of the feature clusters to obtain the material state of the surface element, including: Based on the degree of overlap or spatial distance between the projection regions of the surface element and multiple feature clusters, the material states of the multiple feature clusters are weighted and fused to obtain the material state of the surface element. This step includes: Step b1: Obtain the overlap area between the projection area of the surface element in the two-dimensional image and the projection area of multiple feature clusters.
[0096] This can be understood as calculating the shared coverage area between the projected region of a surface element on a 2D image and the projected region of each feature cluster that has a spatial overlap or proximity with it on the 2D image. This overlap area reflects the spatial correlation of the contribution of the feature cluster to the material state of the surface element. For example, it can be obtained through pixel-level region intersection calculation.
[0097] Step b2: Obtain the confidence level of the material state inference for each of the multiple feature clusters.
[0098] Material state inference confidence refers to the reliability or credibility index of the inference result obtained when inferring the material state of each feature cluster. This confidence can be determined based on the probability value, matching score, or other statistical indicators output by the model during the inference process. For example, if the highest matching score of the material state inference module is much higher than the scores of other material states when inferring the material state of a certain feature cluster, then the confidence of the material state inference for that feature cluster is high.
[0099] Step b3: Infer confidence based on overlap area and material state, and determine the comprehensive weight of each feature cluster on the material state of surface elements.
[0100] Specifically, the comprehensive weight aims to quantify the importance of each feature cluster in determining the material state of surface elements. This comprehensive weight can be designed as a functional combination of overlap area and material state inference confidence, for example, through weighted averaging, product, or other nonlinear functions. Introducing adjustable parameters can balance the relative contributions of overlap area and material state inference confidence in the comprehensive weight calculation to adapt to the needs of different application scenarios.
[0101] Step b4: Based on the comprehensive weight, the material states of multiple feature clusters are weighted and fused to obtain the material state of the surface element.
[0102] This means that for each surface element, its final material state is not simply determined by a single feature cluster, but rather by a comprehensive consideration of the material states of all overlapping or neighboring feature clusters and their corresponding weights. For example, weighted voting, weighted averaging, or probability distribution-based fusion methods can be used to determine the final material state.
[0103] In this embodiment, the overlapping area between the projection region of the surface element in the 2D image and the projection regions of multiple feature clusters is obtained, along with the confidence level of the material state inference for each feature cluster. Based on these two factors, a comprehensive weight for each feature cluster in relation to the material state of the surface element is determined, thereby weighted fusion of the material states of multiple feature clusters. Because this method comprehensively considers both the spatial correlation between feature clusters and surface elements (reflected by the overlapping area) and the reliability of the material state inference of the feature clusters themselves (reflected by the confidence level), it enables a more accurate and reasonable allocation of the contribution of different feature clusters to the material state of the surface element when multiple feature clusters are associated with the same surface element. This method avoids simple majority voting or averaging, instead intelligently fusing based on the actual spatial correspondence and inference quality, thus improving the accuracy of material state allocation.
[0104] Through the above technical solution, in the process of associating material states with corresponding surfaces in a 3D geometric model, especially when a surface element overlaps or is adjacent to feature clusters formed by multiple optical reflection regions, the contribution of each feature cluster to the material state of the surface element can be evaluated more precisely. This effectively solves the problem of fuzzy or inaccurate material state allocation in traditional methods under multiple association scenarios, significantly improving the inference accuracy and robustness of the surface material state of the 3D geometric model. This makes the final material state bound to the surface elements of the 3D geometric model more consistent with reality, thereby enhancing the realism and expressiveness of the 3D geometric models of costumes such as those used in Gan opera.
[0105] As one embodiment of the present invention, step b3 above, namely, inferring confidence based on overlap area and material state, and determining the comprehensive weight of each feature cluster to the material state of surface elements, includes: Step c1: Combine the confidence scores of the overlapping area and material state using a preset function; Step c2 introduces adjustable parameters to balance the relative contributions of overlap area and material state to infer confidence; Step c3: Based on the results of the preset function combination and adjustable parameters, determine the comprehensive weight of each feature cluster on the material state of the surface element.
[0106] Specifically, the predefined function combination refers to taking the confidence level of the overlap area and material state inference as input, and processing it through a predefined mathematical function or algorithm to generate an initial weight value. This function can be a linear combination, a non-linear combination (such as a product, exponential function, logarithmic function, etc.), or a more complex machine learning model. Its purpose is to effectively integrate information from two different dimensions to form a unified evaluation metric.
[0107] Adjustable parameters refer to variables introduced into the preset function combination that can be adjusted according to actual application needs or experience. These parameters adjust the relative influence of the overlap area and material state inference confidence level in the final comprehensive weight calculation. For example, if the preset function is a weighted sum, the adjustable parameters can be their respective weight coefficients; if the preset function is a more complex nonlinear function, the adjustable parameters can be coefficients or thresholds within the function. By adjusting these parameters, the system can be made to prioritize confidence level in different scenarios, such as when image quality is poor, or prioritize overlap area when the overlap region is clear, thereby optimizing the calculation of the comprehensive weight.
[0108] In practical applications, balancing the relative contributions of overlapping area and material state inference confidence means that the roles of overlapping area and material state inference confidence in the comprehensive weight calculation can be dynamically adjusted according to specific circumstances by adjusting adjustable parameters. For example, when the material state inference confidence is high, it can be assigned a larger weight to ensure that the high-confidence inference result has a greater impact on the final determination of the material state; conversely, when the overlapping area is large and has a clear geometric correspondence, the overlapping area can be assigned a larger weight to ensure that the importance of the spatial correspondence is reflected. This balancing mechanism helps improve the accuracy and robustness of the comprehensive weight.
[0109] This embodiment effectively addresses the challenge of flexibly balancing the relative contributions of overlapping area and material state inference confidence when determining the comprehensive weight of feature clusters on the material state of surface elements by introducing preset function combinations and adjustable parameters. Specifically, the preset function combinations provide a structured framework for integrating these two key pieces of information, while the adjustable parameters empower the system to dynamically weight this information in different application scenarios. This flexible parameter adjustment mechanism allows the system to finely control the influence of overlapping area and material state inference confidence in the comprehensive weight calculation based on actual data characteristics or user needs. For example, in some cases, if image registration accuracy is high and the reliability of the overlapping area is stronger, the weight of the overlapping area can be increased by adjusting the parameters; conversely, if the material inference model exhibits higher confidence in a specific region, the weight of the material state inference confidence can be increased. This adaptive weight determination method makes the calculation of comprehensive weights more closely aligned with actual conditions, thus providing a more accurate foundation for subsequent material state weighted fusion.
[0110] This embodiment also provides a clothing data processing device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0111] This embodiment provides a clothing data processing device, such as... Figure 2 As shown, it includes: The acquisition module 201 is used to acquire two-dimensional image data and three-dimensional geometric model data of the garment to be processed; Registration module 202 is used to spatially register two-dimensional image data with three-dimensional geometric model data to determine the outline of the main body of clothing in the two-dimensional image data; The optical reflection area determination module 203 is used to determine the optical reflection area within the outline of the main body of the garment. Extraction module 204 is used to extract target features of the optical reflection region, including target optical features and target morphological features; The material state determination module 205 is used to determine the material state of the optical reflection region based on the target features; The association module 206 is used to associate the target features, material status and three-dimensional geometric model data.
[0112] In some alternative implementations, the extraction module 204 is specifically used for: The 3D geometric model data is divided into semantic regions to obtain multiple semantic regions; Based on the spatial location of the optical reflection region in the three-dimensional geometric model data, the optical reflection region is mapped to the corresponding semantic region to form a feature cluster; Optical feature extraction and morphological feature extraction are performed on each optical reflection region in the feature cluster. This includes: determining whether the number of pixels in the optical reflection region is less than a preset threshold; if the number of pixels in the optical reflection region is less than the preset threshold, calculating the brightness decay trend of the optical reflection region based on the local pixel brightness distribution of the feature cluster to which the optical reflection region belongs, and using this as an optical feature; determining the morphological features of the optical reflection region based on a preset morphological classification rule; if the number of pixels in the optical reflection region is greater than or equal to the preset threshold, calculating the peak brightness and / or brightness decay trend of the optical reflection region, and using this as an optical feature; and calculating the area and perimeter of the optical reflection region, and / or the roundness index and aspect ratio, and using this as a morphological feature.
[0113] The optical features and morphological features extracted from the feature clusters are aggregated to obtain the target optical features and target morphological features corresponding to the optical reflection region.
[0114] In some optional implementations, the material state determination module 205 is specifically used for: Normalize the target optical features and target morphological features in the feature cluster to obtain normalized features; Based on the ability of normalized features to distinguish different material states, a preset weight is assigned to each normalized feature. Based on normalized features and preset weights, the matching score between feature clusters and preset multiple material states is calculated. Determine whether the highest matching score exceeds a preset reliability threshold; If the highest matching score exceeds the preset reliability threshold, the material state corresponding to the highest matching score will be taken as the material state of the feature cluster. If the highest matching score does not exceed the preset reliability threshold, obtain the feature clusters adjacent to the feature clusters. The material state of a feature cluster is determined by using the material state of adjacent feature clusters. This includes performing confidence-weighted statistics on the material states of adjacent feature clusters to obtain weighted statistical results; and selecting the material state with the highest cumulative weight value as the material state of the feature cluster based on the weighted statistical results.
[0115] In some alternative implementations, the association module 206 is specifically used for: The surface of the 3D geometric model data is divided into multiple surface elements; Determine the projection position of each surface element in the two-dimensional image data; Identify feature clusters that have spatial overlap or proximity with the projected location; When there are multiple feature clusters, the material states of the feature clusters are weighted and fused to obtain the material state of the surface element. Spatial smoothing is performed on the material state of surface elements in a 3D geometric model; Associate the material state after spatial smoothing with the corresponding surface element.
[0116] The clothing data processing apparatus provided in this embodiment of the invention can execute the clothing data processing method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the various modules and units described above are the same as in the corresponding embodiments described above, and will not be repeated here.
[0117] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.
[0118] The following is a detailed reference. Figure 3 The diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present invention. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 301, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 302 or a program loaded from memory 308 into random access memory (RAM) 303. The RAM 303 also stores various programs and data required for the operation of the electronic device. The processor 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0119] Typically, the following devices can be connected to I / O interface 305: input devices 306 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 307 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 308 including, for example, magnetic tapes, hard disks, etc.; and communication devices 309. Communication device 309 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.
[0120] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 309, or installed from a memory 308, or installed from a ROM 302. When the computer program is executed by the processor 301, it performs the functions defined in the clothing data processing method of the embodiments of the present invention.
[0121] Figure 3 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0122] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the clothing data processing method shown in the above embodiments is implemented.
[0123] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0124] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for processing clothing data, characterized in that, The method includes: Acquire the two-dimensional image data and three-dimensional geometric model data of the garment to be processed; Spatial registration is performed between the two-dimensional image data and the three-dimensional geometric model data to determine the main outline of the clothing in the two-dimensional image data; Determine the optical reflection area within the main outline of the garment; Extract the target features of the optical reflection region, the target features including target optical features and target morphological features; Based on the target characteristics, the material state of the optical reflection region is determined; The target features, the material state, and the three-dimensional geometric model data are associated.
2. The method according to claim 1, characterized in that, The extraction of target features from the optical reflection region includes: The three-dimensional geometric model data is divided into semantic regions to obtain multiple semantic regions; Based on the spatial location of the optical reflection region in the three-dimensional geometric model data, the optical reflection region is mapped to the corresponding semantic region to form a feature cluster; Optical feature extraction and morphological feature extraction are performed on each of the optical reflection regions in the feature cluster; The extracted optical features and morphological features from the feature clusters are aggregated to obtain the target optical features and target morphological features corresponding to the optical reflection region.
3. The method according to claim 2, characterized in that, The step of extracting optical features and morphological features for each optical reflection region in the feature cluster includes: Determine whether the number of pixels in the optical reflection area is less than a preset threshold; When the number of pixels in the optical reflection region is less than a preset threshold, the brightness attenuation trend of the optical reflection region is calculated based on the local pixel brightness distribution of the feature cluster to which the optical reflection region belongs, and is used as the optical feature; the morphological feature of the optical reflection region is determined based on a preset morphological classification rule. If the number of pixels in the optical reflection area is greater than or equal to the preset threshold, calculate the peak brightness of the optical reflection area and / or the brightness decay trend, and use them as optical features; calculate the area and perimeter of the optical reflection area, and / or the roundness index and aspect ratio, and use them as morphological features.
4. The method according to claim 2, characterized in that, Determining the material state of the optical reflection region based on the target features includes: The target optical features and target morphological features in the feature cluster are normalized to obtain normalized features; Based on the ability of the normalized features to distinguish different material states, a preset weight is assigned to each of the normalized features; Based on the normalized features and the preset weights, calculate the matching score between the feature cluster and the preset multiple material states; Determine whether the highest matching score exceeds a preset reliability threshold; If the highest matching score exceeds a preset confidence threshold, the material state corresponding to the highest matching score is taken as the material state of the feature cluster. If the highest matching score does not exceed the preset reliability threshold, obtain the feature clusters adjacent to the feature clusters. The material state of the feature cluster is determined by using the material state of the adjacent feature clusters.
5. The method according to claim 4, characterized in that, The method of determining the material state of a feature cluster based on the material state of its adjacent feature clusters includes: The material states of the adjacent feature clusters are subjected to confidence-weighted statistics to obtain weighted statistical results; Based on the weighted statistical results, the material state with the highest cumulative weight value is selected as the material state of the feature cluster.
6. The method according to claim 2, characterized in that, Associating the material state with the three-dimensional geometric model data includes: The surface of the three-dimensional geometric model data is divided into multiple surface elements; Determine the projection position of each of the surface elements in the two-dimensional image data; Identify the feature clusters that have spatial overlap or proximity with the projected position; When there are multiple feature clusters, the material states of the feature clusters are weighted and fused to obtain the material state of the surface element; Spatial smoothing is performed on the material state of the surface elements in the three-dimensional geometric model; The material state after spatial smoothing is associated with the corresponding surface element.
7. A clothing data processing device, characterized in that, The device includes: The acquisition module is used to acquire the two-dimensional image data and three-dimensional geometric model data of the garment to be processed; The registration module is used to spatially register the two-dimensional image data with the three-dimensional geometric model data to determine the main outline of the clothing in the two-dimensional image data. An optical reflection area determination module is used to determine the optical reflection area within the outline of the main body of the garment; The extraction module is used to extract target features of the optical reflection region, the target features including target optical features and target morphological features; The material state determination module is used to determine the material state of the optical reflection region based on the target features. The association module is used to associate the target features, the material state, and the three-dimensional geometric model data.
8. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the clothing data processing method according to any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the clothing data processing method according to any one of claims 1 to 6.
10. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the clothing data processing method according to any one of claims 1 to 6.