Medical beauty 3D model construction method and system based on image large model
By using a large image model-based approach, the spatial coordinate distribution and texture generation guidance parameters of a 3D full-head point cloud model are analyzed and optimized. This solves the problem of incomplete acquisition of spatial structural information in the construction of traditional medical aesthetic 3D models, and improves the structural continuity and visual uniformity of the 3D model, especially in the natural and realistic appearance of areas of the human head that are difficult to capture.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2026-04-14
AI Technical Summary
Traditional methods for constructing 3D models for medical aesthetics rely on point cloud data acquisition in limited directions, making it difficult to obtain spatial structural information in all directions. This results in blind spots in some areas, limiting the degree of local detail restoration during manual repair. Color breaks and texture discontinuities are easily generated at the connection points between areas. Insufficient mapping of areas such as the back of the head and neck leads to unnatural rendering effects, making it difficult to adapt to different individual appearances and meet the needs of refined medical aesthetic effect simulation and diverse visual requirements.
A large-scale image model-based approach is adopted. By analyzing the spatial coordinate distribution of the 3D full-head point cloud model, calculating the two-dimensional projection position, integrating pixel spatial information, generating rasterized image data, judging the connectivity and color brightness changes of unmapped areas, optimizing texture generation guidance parameters, achieving multi-region texture fitting and boundary fusion, and using interpolation to correct boundary colors and Poisson equations to handle gradients, thereby improving the structural continuity and visual uniformity of the 3D model.
It enables 3D model texture coverage to no longer be limited to a single viewpoint. Locally generated texture content is highly integrated with the original area, and multi-part texture splicing is smoothly connected. Color transition and gradient fusion effectively eliminate regional abrupt changes, improving the structural continuity, visual unity and individual expression ability of 3D models, especially forming a natural and realistic appearance in areas where it is difficult to collect human head data.
Smart Images

Figure CN121033262B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image generation technology, and in particular to a method and system for constructing medical aesthetic 3D models based on large image models. Background Technology
[0002] Image generation falls under the interdisciplinary field of computer graphics and artificial intelligence. It primarily studies how to reconstruct, generate, modify, and enhance image content using image processing algorithms and deep learning models. This technology is widely applied in various scenarios, including virtual reality, medical imaging, film and television production, and personalized visual content generation. Traditional methods for constructing 3D models in medical aesthetics involve acquiring facial or head images and depth information using a 3D scanner, constructing a 3D model using point cloud data, and then combining this with multi-view photography or limited manual retouching to generate local texture maps to complete the 3D head model.
[0003] In traditional medical aesthetic 3D modeling, the reliance on point cloud data acquisition in limited directions and simple texture stitching makes it difficult to obtain spatial structural information in all directions. Some areas are prone to coverage blind spots. When manually repairing missing areas, the degree of local detail restoration is limited. Color breaks and texture discontinuities are easily produced at the connection points of areas. Areas such as the back of the head and neck often have obvious blanks or abrupt color differences in rendering due to insufficient model mapping. The overall modeling process has limited adaptability to the appearance of different individuals, making it difficult to support the simulation of refined medical aesthetic effects and diverse visual needs. Summary of the Invention
[0004] To address the limitations of existing technologies that rely on point cloud data acquisition in limited directions and simple texture stitching, making it difficult to acquire spatial structural information comprehensively, resulting in blind spots in some areas, and limiting the degree of detail restoration when manually repairing missing areas, color breaks and texture discontinuities easily occur at area connections. Areas such as the back of the head and neck often exhibit noticeable blank spaces or abrupt color differences in rendering due to insufficient model mapping. Furthermore, the overall modeling process has limited adaptability to different individual appearances, making it difficult to support refined medical aesthetic effect simulation and diverse visual needs. Therefore, this invention provides a method and system for constructing medical aesthetic 3D models based on large image models. The technical solution is as follows:
[0005] On the one hand, a method for constructing medical aesthetic 3D models based on large image models is provided, including the following steps:
[0006] S1: Based on the 3D full-head point cloud model, analyze the spatial coordinate distribution, calculate the two-dimensional projection position of each point, determine whether there are uncovered areas, integrate pixel spatial information, and obtain rasterized image data;
[0007] S2: Based on the rasterized image data, determine the connectivity of unmapped pixels, analyze the spatial location of missing areas in the UV unfolded image, filter the hair and neck areas, calculate color brightness changes, and obtain texture generation guidance parameters.
[0008] S3: Based on the texture generation guidance parameters, analyze the partition prompts and pixel texture attributes, compare the color distribution of the generated texture with that of the input area, filter out content that matches the features of the top of the head and the back of the head, and obtain multi-region texture fitting index;
[0009] S4: Based on the multi-region texture fitting index, determine the spatial correspondence between pixels and the surface of the 3D model, analyze the inverse mapping path under rotation and camera parameters, optimize the mapping distribution of the UV unfolding map, and obtain the texture mapping adaptation structure.
[0010] S5: Based on the texture mapping adaptation structure, analyze the brightness, hue and saturation of the boundary region, calculate the parameter difference with the front face region, use interpolation to correct the boundary color, apply the Poisson equation to process the gradient, and obtain a continuous boundary fusion region.
[0011] On the other hand, the rasterized image data includes spatial mapping coordinates, two-dimensional pixel distribution, and data label type; the texture generation guidance parameters include regional feature labels, generation constraint content, and target style description; the multi-region texture fitting index includes regional fusion priority, texture stitching standard, and matching metric label; the texture mapping adaptation structure includes a UV index list, an adaptation rule set, and a boundary adjustment factor; and the continuous boundary fusion region includes pixel smooth distribution, transition zone label, and color fusion factor.
[0012] On the other hand, the specific steps for rasterizing the image data are as follows:
[0013] S101: Based on a 3D full-head point cloud model, calculate the projection position of each point under the conditions of set rotation angle and camera parameters, use matrix transformation to batch map the three-dimensional coordinates to the two-dimensional pixel plane, judge the abnormal coordinate situation that occurs during the projection process, and obtain the projection coordinate distribution characteristics.
[0014] S102: Based on the projection coordinate distribution characteristics, determine its distribution status in the pixel grid, filter all pixel grid points corresponding to the assigned 3D points, statistically analyze the coverage status of each pixel grid point, and mark the area for the pixel grid points without assigned 3D points to obtain the coverage area distribution identifier.
[0015] S103: Based on the coverage area distribution identifier, compare the three-dimensional spatial coordinates, normal vectors and pixel positions associated with the mapped pixels, organize them in a structured manner according to the pixel index, and collect the data corresponding to each pixel to obtain rasterized image data.
[0016] On the other hand, the steps for the texture generation guidance parameters are as follows:
[0017] S201: Based on the rasterized image data, analyze the spatial coordinates between unmapped pixels, determine the continuity of adjacent pixels in the spatial coordinate arrangement, group them according to the distance features between each pair of adjacent pixels and determine the affiliation of connected regions, and generate spatial connectivity grouping information.
[0018] S202: Based on the spatial connectivity grouping information, analyze the coordinate distribution of each missing region in the UV unfolding diagram, determine the belonging relationship of each missing region in the surface coordinate system, and filter the pixel positions corresponding to hair and neck through the regional spatial relationship to obtain the associated regional spatial data.
[0019] S203: Based on the associated regional spatial data, calculate the color channel value distribution and brightness value range of each pixel in the region, compare the associated parameters of the pixels outside the hair and neck regions, and combine the description content according to the data differences between regions to obtain texture generation guidance parameters.
[0020] On the other hand, the specific steps of the multi-region texture fitting index are as follows:
[0021] S301: Based on the texture generation guidance parameters, compare the spatial location and pixel color distribution corresponding to each prompt description, determine the correspondence between the description content and the actual regional texture features, summarize the matching results after all regional comparisons, and obtain the regional feature comparison identifier.
[0022] S302: Based on the region feature comparison identifier, compare the partition prompt with the actual pixel texture features, make separate judgments on the color channels and region brightness involved in each partition description, mark the pixel intervals where texture attributes differ, organize the difference comparison situation, and obtain the texture feature comparison set.
[0023] S303: Based on the texture feature comparison set, filter pixel features associated with the texture attributes of the top and back of the head, optimize the region marking and texture distribution, and statistically summarize the associated parameters according to the region logical order to obtain the multi-region texture fitting index.
[0024] On the other hand, the optimized region marking and texture distribution are achieved using the following formula:
[0025]
[0026] Calculate the optimized texture distribution value, filter pixel features associated with texture attributes of the top and back of the head regions, and optimize region marking and texture distribution, where M opt R represents the optimized value for texture distribution in each region, and W represents the total number of regions. r N represents the weight factor of the r-th region.r t represents the total number of pixel features in the r-th region. i,r This represents the texture parameter value of the i-th pixel within the r-th region. S represents the average value of all pixel texture parameter values in the r-th region. r This represents the standard value of the target texture distribution in the r-th region.
[0027] On the other hand, the specific steps of the texture mapping adaptation structure are as follows:
[0028] S401: Based on the multi-region texture bonding index, analyze the spatial position relationship between each pixel and the surface of the three-dimensional model, judge the bonding parameters and three-dimensional coordinate distribution of each region item by item, filter the pixels with spatial matching state differences, and assign corresponding spatial positions to obtain the pixel spatial matching parameters.
[0029] S402: Based on the pixel space matching parameters, determine the spatial trajectory corresponding to the rotation parameters and camera parameters, track the inverse correspondence between each two-dimensional texture coordinate and the three-dimensional model surface coordinate, adjust the coverage of the partition map on the UV unfolding map, and obtain the inverse mapping trajectory information.
[0030] S403: Based on the reverse mapping trajectory information, analyze the parameter distribution of texture boundaries in each region, judge and adjust the pixel arrangement of the region boundaries, update the content information synchronously, and integrate all texture data and mapping parameters to obtain the texture mapping adaptation structure.
[0031] On the other hand, the specific steps for merging the continuous boundary regions are as follows:
[0032] S501: Based on the texture mapping adaptation structure, analyze the brightness, hue and saturation characteristics of each pixel in the boundary region, compare the boundary pixels with the same parameters of the original front face region in turn, determine the degree of difference of the boundary pixels in the dimensions of brightness, hue and saturation, and obtain color distribution comparison data.
[0033] S502: Based on the color distribution comparison data, adjust the color distribution of each pixel in the boundary area, smooth the brightness and hue transition through interpolation, allocate the adjusted pixels back to the boundary area, and align them with the surrounding area to obtain the boundary transition adjustment parameters;
[0034] S503: Based on the boundary transition adjustment parameters, the color gradient direction and saturation distribution of each boundary pixel are adjusted point by point using the Poisson equation. The gradient changes in the boundary region are analyzed, and the data of the continuously changing segments are summarized to obtain the continuous boundary fusion region.
[0035] On the other hand, the method of smoothing brightness and hue transitions through interpolation, allocating adjusted pixels back to the boundary region, and aligning them with the surrounding region uses the following formula:
[0036]
[0037] Obtain the boundary transition adjustment parameters, where L z,j This represents the adjusted brightness of the pixel in the z-th row and j-th column of the boundary region. The value represents the original brightness of the boundary region in row z and column j, where α represents the adjustment coefficient. This represents the color distribution comparison data of the k-th pixel within the boundary region. represents the original color value of the k-th pixel within the boundary region, and N represents the total number of pixels in the boundary region involved in the calculation.
[0038] On the other hand, a medical aesthetic 3D model construction system based on large image models is provided. This system is applied to the method of constructing medical aesthetic 3D models based on large image models, including:
[0039] The 3D point cloud mapping module is based on a 3D full-head point cloud model. It analyzes the coordinate distribution in space, calculates the 2D projection position of each point under the selected rotation angle and camera parameters, optimizes the allocation method of points to pixels, determines whether there are uncovered areas in the mapping, summarizes the spatial information of all pixels, and obtains rasterized image data.
[0040] Based on the rasterized image data, the missing area feature extraction module determines the spatial connectivity of unmapped pixels, analyzes the spatial positional relationship of the missing parts in the UV unfolded image of the medical aesthetic 3D full-head model, filters the hair and neck related areas, calculates the color distribution and brightness changes of the areas, and obtains texture generation guidance parameters.
[0041] Based on the texture generation guidance parameters, the texture generation and filtering module analyzes the features of the corresponding region, parses the texture attributes of the partition prompts and the actual pixels, compares the consistency between the generated texture image and the color distribution of the input region, filters the content that matches the texture attributes of the top and back of the head region, and obtains the multi-region texture fitting index.
[0042] The UV mapping optimization module, based on the multi-region texture fitting index, determines the spatial matching relationship between each pixel and the surface of the 3D model, analyzes the inverse mapping trajectory under the rotation and camera parameters used, optimizes the mapping coverage of each region in the UV unfolded map, adjusts the texture boundary distribution and updates the content synchronously, and obtains the texture mapping adaptation structure.
[0043] The boundary blending smoothing module analyzes the brightness, hue, and saturation characteristics of the boundary region based on the texture mapping adaptation structure, calculates the actual difference between the pixel and the original front face region parameters, corrects the boundary color using interpolation, and applies the Poisson equation to process the color gradient point by point to obtain a continuous boundary blending region.
[0044] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following:
[0045] By performing multi-angle spatial reconstruction and detailed pixel mapping on 3D point cloud data, texture coverage is no longer limited to a single viewpoint. Spatial feature partitioning and target attribute recognition enable accurate supplementation of textures in missing areas. The locally generated texture content and the original input area are highly integrated in terms of color structure and detail. After spatial adaptation and boundary adaptive processing, multi-part texture splicing shows smooth connection. Color transition and gradient fusion effectively eliminate regional abrupt changes. The overall effect is a comprehensive improvement in the structural continuity, visual unity and personalized expression of 3D models. In particular, it forms a natural and realistic appearance in areas that are difficult to collect data from the human head, which strongly promotes the development of 3D model technology in the medical aesthetics industry. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1 This is a flowchart of the main steps of the present invention;
[0048] Figure 2 This is a flowchart of steps S1 of the present invention;
[0049] Figure 3 This is a flowchart of steps S2 of the present invention;
[0050] Figure 4 This is a flowchart of steps S3 of the present invention;
[0051] Figure 5 This is a flowchart of step S4 of the present invention;
[0052] Figure 6 This is a flowchart of steps S5 of the present invention;
[0053] Figure 7 This is a system block diagram of the present invention. Detailed Implementation
[0054] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0055] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.
[0056] In the embodiments of this invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, their intended meanings are consistent. Similarly, the terms "of," "corresponding (relevant)," and "corresponding" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, their intended meanings are consistent.
[0057] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.
[0058] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0059] This invention provides a method for constructing 3D medical aesthetic models based on large image models, such as... Figure 1 As shown, it includes the following steps:
[0060] S1: Based on the 3D full-head point cloud model, analyze the coordinate distribution in space, calculate the two-dimensional projection position of each point under the selected rotation angle and camera parameters, optimize the allocation method of points to pixels, determine whether there are uncovered areas in the mapping, summarize the spatial information of all pixels, organize them into an image structure, and obtain rasterized image data.
[0061] S2: Based on rasterized image data, determine the spatial connectivity of unmapped pixels, analyze the spatial positional relationship of missing parts in the UV unfolded image of the 3D full-head model of medical aesthetics, filter the hair and neck related areas, calculate the color distribution and brightness changes of the areas, assemble the description content as a generation prompt based on the actual differences of each area, and obtain texture generation guidance parameters.
[0062] S3: Based on the texture generation guidance parameters, analyze the features of the corresponding region, analyze the texture attributes of the partition prompts and the actual pixels, compare the consistency between the generated texture image and the color distribution of the input region, filter the content that matches the texture attributes of the top and back of the head region, and obtain the multi-region texture fitting index.
[0063] S4: Based on the multi-region texture fitting index, determine the spatial matching relationship between each pixel and the surface of the 3D model, analyze the inverse mapping trajectory under the rotation and camera parameters used, optimize the mapping coverage of each region in the UV unfolding map, adjust the texture boundary distribution and update the content synchronously to obtain the texture mapping adaptation structure.
[0064] S5: Based on the texture mapping adaptation structure, the brightness, hue and saturation characteristics of the boundary region are analyzed, the actual difference between the pixel and the original front face region parameters is calculated, the boundary color is corrected by interpolation, and the color gradient is processed point by point by Poisson equation to obtain a continuous boundary fusion region.
[0065] Rasterized image data includes spatial mapping coordinates, two-dimensional pixel distribution, and data label type. Texture generation guidance parameters include region feature labels, generation constraint content, and target style description. Multi-region texture fitting indicators include region fusion priority, texture stitching standard, and matching metric label. Texture mapping adaptation structure includes UV index list, adaptation rule set, and boundary adjustment factor. Continuous boundary fusion region includes pixel smooth distribution, transition zone label, and color fusion factor.
[0066] In the medical aesthetics industry, 3D facial scanning technology constructs 3D models by collecting facial images and depth information to assist in the design of personalized beauty plans. However, existing scanning instruments lack acquisition equipment for the sides, top of the head, and back of the head, resulting in incomplete structural data for the ears, neck, top of the head, and back of the head in the 3D full-head model. Corresponding texture maps are missing. Even if some data is integrated through non-rigid transformation and projection techniques, the problem of missing textures on the top of the head, back of the head, and sides cannot be solved. This seriously affects the realism and immersion of beauty effect simulation and surgical plan planning, limiting the application expansion of 3D models in the industry. To solve this problem, based on the complete full-head 3D model obtained by 3D full-head scanner, the missing parts such as hair and neck in the UV unfolded image are accurately textured using algorithms and data processing technology, thereby improving the integrity and application value of the 3D model.
[0067] The main steps are: acquiring a full-head 3D model → rasterizing the model and extracting multi-angle images → generating a large model based on the images → rasterization and texture mapping → UV image fusion → neck texture color transfer → Poisson fusion algorithm fusion → generating a new full-head texture UV image.
[0068] In S1, the 3D full-head point cloud model refers to the 3D point cloud dataset of the entire human head (including the front, side, and back of the head) obtained through a 3D scanner. Each point records the x, y, and z coordinates in space, representing the shape of the human head surface; coordinate distribution refers to the arrangement of the three-dimensional spatial positions of all points in the 3D point cloud model, used to describe the overall shape and spatial structure of the model; each point refers to a single three-dimensional point in the point cloud model, each point has unique three-dimensional coordinates (x, y, z), representing the local surface morphology; two-dimensional projection position means mapping the points in three-dimensional space to two-dimensional pixel coordinates on the camera plane through rotation and projection transformation, this step "captures" the 3D model into a 2D image; allocation method refers to how the projection result of each three-dimensional point is assigned to a specific pixel grid on the two-dimensional image after the three-dimensional points are projected, involving point-to-pixel mapping and pixel assignment strategies; uncovered area refers to the position on the two-dimensional image that is not covered by the projection of the three-dimensional points after point-to-pixel mapping, the area often represents uncollected data or blank space caused by model occlusion; spatial information refers to the spatial coordinates (x, y, z), normal vectors, point attributes, etc. of all three-dimensional points, which is the basic data set for describing the details of the 3D model.
[0069] In S2, spatial connectivity, in the field of image processing and 3D reconstruction, refers to the interconnectedness of pixels / points in a 2D image or 3D space, used to identify which unmapped pixels belong to the same continuous missing region in space; spatial positional relationship describes the specific spatial arrangement and relative position of the missing region or specific point / pixel in the overall model or UV unfolded map; actual difference assembly description refers to comparing the actual observation data such as color and brightness of areas such as hair and neck with the missing region data, extracting representative difference features for subsequent AI texture generation prompts; generation prompts refer to the descriptive information prepared for the AI large model input, such as regional features, color style, texture details, etc., used to guide the AI to generate texture content that meets actual needs.
[0070] In S3, the corresponding region features refer to the pixels at specific spatial locations involved in the texture generation prompt (such as the top of the head, the back of the head, and the neck), including the color, texture, distribution, and other attribute data of the original image; texture attributes refer to the image features that describe the texture and details on the surface of the image or model, commonly including dimensions such as color, brightness, pattern, and structure, used to measure the realism and adaptability of the generated texture; consistency refers to the degree of conformity between the generated new texture and the input region in terms of color, detail, and other features, emphasizing a natural transition between the old and new regions and similar data features; the matching content refers to selecting those generated textures that are closest to the original features of the top of the head and the back of the head in terms of color, texture, etc., and have a high degree of integration through comparison.
[0071] In S4, the 3D model surface is the outer curved surface of the 3D head point cloud model, and all textures need to be precisely fitted onto this spatial surface. Spatial matching relationship refers to how 2D texture pixels are established in a one-to-one correspondence with each specific position on the 3D model surface, realizing the mapping relationship between the "canvas" and the 3D surface. Inverse mapping trajectory is in the 3D reconstruction process. Inverse mapping refers to "reverse-engineering" the spatial position of 2D texture coordinates on the 3D model surface to ensure that the newly generated texture can accurately cover the specified parts. Mapping coverage refers to correctly mapping the content of the texture image to the missing area in the UV unfolding map, so as to achieve no blanks and no repetitions. Texture boundary distribution refers to the edge arrangement and changes at the junction of the old and new texture areas, involving the natural transition and detail processing of image stitching.
[0072] In S5, actual difference refers to the difference in the true values or distribution of parameters such as color, brightness, and saturation between the updated texture boundary pixels and the front face area; interpolation means using the information of surrounding pixels to "smooth the transition" or "complete" the color of boundary pixels, which is often used for transition bands and filling gaps; point-by-point color gradient processing is performed on each pixel during boundary blending, so that the color and brightness are continuous and smooth in the boundary area, usually using mathematical tools such as Poisson blending to achieve natural stitching.
[0073] For the x, y, z coordinates of the 3D model:
[0074] Let the model rotation be defined as [rotation angle around the y-axis, rotation angle around the x-axis], where counterclockwise rotation around the y-axis is positive and clockwise rotation around the x-axis is positive. Therefore, in order to obtain four images—side view, back side view, back of the head, and top of the head—the original model distribution is adjusted as follows:
[0075] Rotation of [90°, 0°], [120°, 0°], [180°, 0°], [180°, -90°]; and solving the rotation matrix based on the rotation angle for use in the rasterization stage.
[0076] Where the counterclockwise rotation matrix around the y-axis is:
[0077]
[0078] Where the clockwise rotation matrix around the x-axis is:
[0079]
[0080] Final rotation matrix:
[0081] R total =R x @R y ;
[0082] Here, @ represents performing matrix multiplication;
[0083] During rasterization, camera_pose also needs to be set, which is the camera's position coordinates relative to the model, and the height and width of the generated image (h = 1024, w = 1024), where:
[0084]
[0085] This represents the camera's distance from the model position as [0, 0, 300] (x, y, z coordinates) and the camera's fov = 60°.
[0086] like Figure 2 As shown, the specific steps for rasterizing image data are as follows:
[0087] S101: Based on a 3D full-head point cloud model, calculate the projection position of each point under the conditions of set rotation angle and camera parameters, use matrix transformation to batch map the three-dimensional coordinates to the two-dimensional pixel plane, judge the abnormal coordinate situation that occurs during the projection process, and obtain the projection coordinate distribution characteristics.
[0088] Information from all 3D points in the model is extracted, with each point having a spatial location identifier to represent different parts of the human head surface, such as the forehead, behind the ears, the base of the neck, and the back of the head. A fixed rotation parameter is then set, and the entire point set is rotated around a specified axis. This operation updates the 3D coordinates of the points in batches. Subsequently, a fixed shooting position of the camera relative to the model is set, and a projection transformation is performed based on the image output resolution, mapping the rotated 3D coordinates to a 2D image plane in batches. The pixel position of each point on the image plane is calculated through spatial transformation. If the projected pixel position is outside the image boundary, the point is marked as an anomaly. If the horizontal and vertical pixel coordinates of a point after projection are less than zero or exceed the maximum width and height of the image, it is considered to be out of bounds. The number of all abnormal points is counted and compared with the total number of points. If the proportion of abnormal points is higher than 5% of the total number of points, the angle setting of that group is recorded as a projection failure; otherwise, it is considered a success. The two-dimensional position of all successfully projected points is recorded, and density analysis is performed according to the image region. If the number of points per unit area in the central region of the image exceeds the set threshold, it is defined as a high-density region; if it is lower than the threshold, it is a sparse region. The two-dimensional positions of all non-abnormal points are classified into dense, sparse, or boundary regions according to their distribution, and the overall projection coordinate distribution characteristics are generated.
[0089] S102: Based on the distribution characteristics of projected coordinates, determine their distribution status in the pixel grid, filter all pixel grid points corresponding to the assigned 3D points, statistically analyze the coverage status of each pixel grid point, and mark the area for pixel grid points without assigned 3D points to obtain the coverage area distribution identifier.
[0090] After obtaining the projection coordinates, a complete two-dimensional pixel grid is constructed. Each pixel grid is initially marked as unoccupied. All mapped points are traversed, and the position of each point is rounded to the nearest pixel grid, which is then marked as occupied. Subsequently, the number of occupied and unoccupied pixel grids in the entire image is counted. All unoccupied grids are recorded as candidate missing regions. Connectivity analysis is performed on the regions according to the image topology. Adjacent unoccupied grids are clustered according to continuity. The number of pixels in each cluster is counted. If the number of pixels in a cluster exceeds 100 and is located at the edges of the image, it is judged as an occluded area; otherwise, it is a data missing area. Different region numbers are assigned to each region, and they are recorded using a color classification map or data structure. The pixel center coordinates and boundary positions of each region are also recorded. The coverage status data structure is finally recorded as a Boolean matrix, with one bit corresponding to each pixel grid, indicating whether it has been mapped by a three-dimensional point, and an additional region type classification number is attached. The final output coverage region distribution identifier includes whether each pixel grid is covered, the region number, and the connectivity attribute of the region.
[0091] S103: Based on the coverage area distribution identifier, compare the three-dimensional spatial coordinates, normal vectors and pixel positions associated with all mapped pixels, organize them in a structured manner according to the pixel index, and collect the data corresponding to each pixel to obtain rasterized image data;
[0092] Based on the identified coverage areas, all successfully mapped pixel grid points are assigned unique numbers in row and column order, and associated with their corresponding 3D spatial coordinates, surface normal vectors, and image pixel coordinates to construct pixel information structure units. Each unit contains a unique number and multiple descriptive attributes. By traversing all grid points, the corresponding 3D point coordinate information and their mapping position in the image are extracted item by item and organized in a fixed format. For example, if the image coordinates of a certain point are the image center and its 3D point originates from the back of the head, then the pixel structure unit records its center attribute value, the area number as the back of the head region, the area category as the coverage area, and the normal vector direction as mainly facing backward. After numbering and sorting all pixel structure units, they are classified and statistically analyzed according to the area number, summarizing the number of pixels and the proportion of each category. Finally, the structured data set constitutes a rasterized image dataset for subsequent texture feature judgment, AI prompt generation, and mapping restoration processing. Each row of the entire dataset represents the complete spatial information of a pixel.
[0093] like Figure 3 As shown, the specific steps for texture generation guidance parameters are as follows:
[0094] S201: Based on rasterized image data, analyze the spatial coordinates between unmapped pixels, determine the continuity of adjacent pixels in spatial coordinate arrangement, group and determine the affiliation of connected regions according to the distance features between each pair of adjacent pixels, and generate spatial connectivity grouping information.
[0095] Extract all pixels marked as unmapped, construct a 2D coordinate index structure in the image grid, traverse the list of unmapped points pixel by pixel, obtain the horizontal and vertical positions of each pixel in the image coordinates, and then call the pixel-to-3D coordinate lookup matrix stored in the corresponding 3D point cloud mapping record. Retrieve the actual spatial coordinates of the neighboring positions of the unmapped pixels through the pixel index. If neither adjacent pixel pair has 3D coordinate data, skip the current pixel pair. If at least one has a 3D mapping record, use that 3D coordinate as a reference to determine spatial proximity. Compare the Euclidean distance between two pixels in spatial coordinates. If this distance is less than a set connectivity threshold, the two points are considered to be spatially continuous. The connectivity threshold is set to 1.5mm. When the distance between pixels is less than a certain value, they are grouped into the same connected region; otherwise, they are assigned to different groups. Similarity processing is performed on all spatially adjacent pairs of unmapped pixels across the entire image. Spatial connectivity is retrieved sequentially using the four-neighbor relationship of left, right, top, and bottom neighbors. After constructing a preliminary connected candidate set, the pixel ID number is traversed sequentially to generate a unique number label for all pixel groups belonging to the same spatial range. This results in several spatially connected pixel sets, each assigned a unique identifier. The connected group index table records the region number to which each pixel belongs and the total number of corresponding pixels. If the number of pixels in a connected set is less than 20, the set is removed and considered an isolated point set. The remaining set is retained for subsequent region relationship screening and texture hint generation, thus obtaining spatial connected group information.
[0096] S202: Based on the spatial connectivity grouping information, analyze the coordinate distribution of each missing region in the UV unfolding diagram, determine the belonging relationship of each missing region in the surface coordinate system, and filter the pixel positions corresponding to the hair and neck through the regional spatial relationship to obtain the associated regional spatial data.
[0097] For each group of pixels, the center coordinates of the region are extracted. The horizontal and vertical distribution range of all pixels in the UV unwrapped image of the group are calculated, and the maximum and minimum boundary coordinates of the range are recorded. The position of the center point of the pixel group on the UV image is then calculated. The coordinates of the center points of all pixel groups on the UV image are clustered and classified. Groups whose center point x-coordinate is greater than two-thirds of the UV image width and whose y-coordinate is located in the upper-middle region are identified as candidates for hair regions. Groups whose x-coordinate is located in the center of the image and whose y-coordinate is within the bottom 30 rows are identified as candidates for neck regions. The total number of pixels and the coordinate expansion range of each group are then counted. If the vertical span or horizontal span of a group is less than 10 pixels, the group is removed. If a region is determined to be invalid, the remaining groups are further verified according to their spatial location, specifically the range of their corresponding point cloud positions in the 3D surface coordinates. The range of 3D coordinate values associated with each pixel is retrieved from the 3D point mapping index, and the proportion of pixels whose angle with the facial normal vector direction is between 60 and 90 degrees is extracted from the corresponding normal vector set. If the proportion is higher than 50%, it indicates that the direction of the region where the group is located deviates from the face, further verifying that it is in the direction of the back of the head or neck. Combined with the aforementioned judgment of the range of center point coordinates on the UV map, the final set of pixel positions for the hair and neck regions is confirmed. The corresponding numbers are recorded as the identified target region numbers, and a region index table is established to organize subsequent regional spatial data extraction tasks, thereby obtaining associated regional spatial data.
[0098] S203: Based on the spatial data of the associated region, calculate the color channel value distribution and brightness value range of each pixel in the region, compare the associated parameters of the pixels outside the hair and neck regions, combine the descriptive content according to the data differences between regions, and obtain the texture generation guidance parameters.
[0099] For each pixel in the target region, the color values of each channel in the corresponding image are read one by one, divided into three components: red, green, and blue. The R, G, and B values of all pixels in the region are extracted and statistically analyzed within each channel, recording the maximum, minimum, mean, and variance. This determines whether the color distribution within the region is concentrated. If the variance is below 200, the color is considered uniform; if it is above 1000, complex texture variations exist. Next, the brightness range of all pixels in the region is calculated. The brightness values are obtained through a weighted calculation method. Brightness ranges between 180 and 255 are defined as highlight areas, and between 80 and 120 are defined as shadow areas. For example, the overall brightness of the hair area is concentrated in the lower range, while the neck area is concentrated in the medium brightness range. Based on this information, pixels outside other areas are sampled. For comparison, the outer pixels closest to the edge of the region are selected, and their corresponding average R, G, B values and brightness values are calculated. These values are then compared with those inside the target region, and the color difference value ΔE is calculated. The proportion of pixels with a difference greater than 20 is counted. If this proportion exceeds 40%, the group is considered a region with significant feature differences. The color description of the region is encoded using a keyword combination method. The color keyword determines the dominant hue by the component with the maximum value of the channel. For example, if R is the largest, it is marked as a red dominant hue. The brightness range is combined to indicate the degree of darkness. For example, if it is a low-brightness red, a descriptive word "deep red" is generated. Finally, the texture style, hue variation, brightness level, boundary contrast, and other information of the region in the image are combined into a set of descriptive content and associated with its spatial location, region number, and other information for structured storage, forming texture generation guidance parameters.
[0100] like Figure 4 As shown, the specific steps for multi-region texture bonding metrics are as follows:
[0101] S301: Based on the texture generation guidance parameters, compare the spatial location and pixel color distribution corresponding to each prompt description, judge the correspondence between the description content and the actual area texture features, summarize the matching results after all area comparisons, and obtain the area feature comparison identifier.
[0102] Extract the spatial location index corresponding to each prompt description, and cross-reference it with the two-dimensional pixel coordinates and three-dimensional point coordinates recorded in the rasterized image data to confirm the actual location distribution of the described target area on the image. Then, decompose the keywords such as color, brightness, and texture structure involved in the description content, and convert the keywords into a comparable set of attributes. For example, "dark brown hair" is decomposed into the main color channel as red and green channels with average values in the mid-to-high range, and blue channel with low brightness and brightness in the dark range. The main color judgment criteria in the description features are set to channel average values between 150 and 200, and brightness range between 60 and 100. Then, iterate through the color channel values and brightness values of all pixels at the corresponding spatial location, and count the maximum value of each channel in the current region of pixels. The minimum, average, and standard deviation values are compared item by item with the description attributes based on the mean range. If any item deviates from the description range by more than 20%, it is recorded as a feature mismatch. For regions with multiple prompt descriptions, the comparison is performed sequentially and the matching status number is recorded. If more than 80% of the pixels in the region meet any of the main feature conditions in the description, the description is considered to match the current region. If the matching ratio is less than 50%, the description is marked as not suitable for this region. Finally, the comparison results of all prompt descriptions in their respective spatial locations are summarized. The matching ratio, matching degree and corresponding description number are statistically constructed into a comparison table structure according to the region number. The description index with the highest matching degree in each region is recorded and used as the association identifier for subsequent texture bonding processing to obtain the region feature comparison identifier.
[0103] S302: Based on the regional feature comparison identifier, compare the partition prompts with the actual pixel texture features, make separate judgments on the color channels and regional brightness involved in each partition description, mark the pixel intervals where texture attributes differ, organize the difference comparison situation, and obtain the texture feature comparison set;
[0104] Determine the hint index number corresponding to the matched description in each region. Then, further decompose the actual pixel texture of that region, reading the RGB channel values and luminance values of all pixels within the region. Aggregate the values by channel to calculate their mean and variance within the region. Using the channel setting range in the description parameters as a reference, compare the RGB value of each pixel with the mean of the primary color channel set in the description. If a channel value of a pixel deviates from the description value by more than a set threshold, it is marked as a difference pixel. This threshold is set to ±20% of the description channel reference value. Simultaneously, compare the luminance value with the luminance range set in the description to determine whether the current pixel is within the target brightness level range. Outside the defined range, if the difference is exceeded, it is marked again. The ratio of the number of pixels marked as differences to the total number of pixels in the entire region is counted. If the ratio exceeds 30%, it is marked as a region with significant texture differences. If it is between 10% and 30%, it is marked as a region with moderate differences. If it is below 10%, it is marked as a region with slight differences. Then, a texture feature comparison table is built for each region. For each region, its description index number, number of differences, difference ratio, maximum offset of the main color channel, brightness offset direction and other indicators are recorded. All regions are organized into a structured data set, named the texture feature comparison set, which is used to guide the content selection and fusion strategy construction in the next texture synthesis process.
[0105] S303: Based on the texture feature comparison set, filter pixel features associated with texture attributes of the top and back of the head, optimize region marking and texture distribution, and statistically summarize associated parameters according to region logical order to obtain multi-region texture fitting index.
[0106] To optimize region marking and texture distribution, the following formula is used:
[0107]
[0108] Calculate the optimized texture distribution value, filter pixel features associated with texture attributes of the top and back of the head regions, and optimize region marking and texture distribution, where M opt R represents the optimized value for texture distribution in each region, and W represents the total number of regions. r N represents the weight factor of the r-th region. r t represents the total number of pixel features in the r-th region. i,r This represents the texture parameter value (such as color brightness, texture feature value, etc.) of the i-th pixel within the r-th region. S represents the average value of all pixel texture parameter values in the r-th region. r The standard value representing the target texture distribution of the r-th region;
[0109] The texture distribution optimization value is calculated by weighted summing of the squared differences between the actual pixel texture parameters (such as color brightness, texture feature values, etc.) and the average texture parameters of each specified region (such as the top of the head and the back of the head). This sum is combined with the target texture distribution standard value set for each region. Finally, the weighted sum of texture differences from all regions is calculated and combined with the target distribution standard value. The result is a numerical result that measures the degree of deviation between the current texture distribution state and the expected texture distribution. It reflects the overall difference between the texture distribution of each region and the target state. The smaller the value, the closer the texture distribution of each region is to its respective target distribution standard.
[0110] M opt This value is used to evaluate the fit between the current model texture and the target texture. The smaller the value, the better the optimization effect and the more the texture matches the target requirements. R indicates how many regions in the entire model need texture optimization. W r The influence of different regions on the final optimization result is adjusted based on the size or importance of the regions. Regions with larger weights contribute more to the final optimization value. N r This determines the number of pixels involved in the calculation within that area, affecting the level of detail in the calculation. i,r Including color brightness, texture feature values, etc., the value of each pixel directly reflects the characteristics of that pixel on the texture surface. By calculating the mean of the texture feature values of all pixels in the region, the "overall" texture characteristics of the region can be obtained, S r Typically, an ideal value representing the texture of the area is set or derived through data analysis, and this value serves as the target for optimization.
[0111] The summation symbol in the formula represents a weighted summation of the optimization values from multiple regions. This ensures that the contribution of each region to the total optimization value is adjusted according to its weight, and the optimization value of each region is amplified or reduced in the final calculation based on its weight. (Squaring) The difference between each pixel and the average texture parameters of that region was calculated. By squaring the difference, the canceling effect of positive and negative differences was avoided, while emphasizing the importance of large differences, which aligns with the goal of texture optimization—minimizing error; average value When calculating the error for each region, the sum of squares of the differences among all pixels within that region is first calculated, and then divided by the total number of pixels in that region to obtain the average difference for that region. This process ensures the fairness of texture optimization for each region and avoids bias caused by too many or too few pixels in a region; subtraction (-S) r The expression indicates that the target standard value is subtracted from the weighted optimization value, ensuring that the calculation results in the formula not only reflect the differences in texture distribution, but also take into account the comparison with the target standard value.
[0112] The specific parameter values for texture distribution optimization are as follows:
[0113] Total number of regions R = 3;
[0114] Regional weighting factors: W1 = 0.5, W2 = 0.3, W3 = 0.2;
[0115] The number of pixels in the first region is N1 = 50, the number of pixels in the second region is N2 = 30, and the number of pixels in the third region is N3 = 20;
[0116] For region 1: Set the texture parameter value of this region to t. i,1 (The value is data obtained through 3D scanning calculations) S1 = 10, which represents the standard value of the target texture distribution in region 1, representing the average texture parameter value of all pixels in region 1.
[0117] For region 2: Set the texture parameter value for this region to... The average texture parameter values of all pixels in region 2 - S2 = 8;
[0118] For region 3: Set the texture parameter value for this region to... The average texture parameter values of all pixels in region 3 - S3 = 6;
[0119] Assume that in region 1, the sum of the squares of the differences in texture parameters and their mean is 100:
[0120]
[0121] First, calculate the difference of squares:
[0122]
[0123] Then substitute the values into the formula to perform the calculation:
[0124]
[0125] For regions 2 and 3, assuming the sum of squares of texture differences is 70 and 60 respectively, substitute them into the formula for calculation:
[0126] Area 2:
[0127]
[0128] Area 3:
[0129]
[0130] Final optimization value calculation
[0131] Based on the optimization values for the above regions, the final texture distribution optimization value M is... opt This can be obtained by weighted summation:
[0132]
[0133] The calculation yields:
[0134] M opt =-4.5-2.19-1.08=-7.77;
[0135] The calculated texture distribution optimization value is M. opt = -7.77 indicates that there is a large deviation between the current texture distribution and the target standard texture, especially in some areas (such as area 1 and area 2), indicating that the optimization effect is not ideal and the texture matching degree is poor. According to the preset target optimization range (such as -5 to 0), it indicates that parameters such as area weight and target standard value need to be further adjusted to reduce texture differences and optimize the overall matching degree.
[0136] like Figure 5 As shown, the specific steps for texture mapping adaptation are as follows:
[0137] S401: Based on multi-region texture bonding index, analyze the spatial position relationship between each pixel and the surface of the 3D model, judge the bonding parameters and 3D coordinate distribution of each region one by one, filter the pixels with spatial matching state differences, and assign corresponding spatial positions to obtain pixel spatial matching parameters.
[0138] The coordinate index of each 2D pixel in the UV map is obtained by dividing the region. Based on the mapping record between pixels and 3D points established in the previous texture generation, the 3D model surface point corresponding to each pixel is traced back one by one to extract the coordinate value of the point in 3D space. The surface direction of the point is determined by combining the local normal vector of the model surface. Then, it is compared with the theoretical 3D coordinate range recorded in the bonding parameters of the region. The Euclidean distance between the pixel mapping point and the expected 3D boundary of its region is compared. If the distance is greater than the set bonding tolerance threshold of 2.5mm, the pixel is marked as a point of inconsistency in spatial matching. Otherwise, it is considered a normal bonding point. Subsequently, a pixel-by-pixel comparison operation is performed within each texture region. The system records the specific pixel location, corresponding 3D point coordinates, spatial offset vector, and offset value of the inconsistency points, and organizes them into an inconsistency pixel index set by region number. Then, it re-counts the number and proportion of all matching and non-matching pixels by region. If the matching proportion in a certain texture region is less than 85%, the entire region is recorded as a failed bonding block; otherwise, it is considered to have a good bonding relationship on the 3D surface. Finally, all pixels are labeled as normal, deviated, or abnormal according to their 3D spatial correspondence and bonding status, and the pixel spatial structure table is updated simultaneously to generate a set of spatial matching parameters for each pixel. This set is used to further control the input basis of the reverse mapping and tracing process to obtain the pixel spatial matching parameters.
[0139] S402: Based on pixel space matching parameters, determine the spatial trajectory corresponding to rotation parameters and camera parameters, track the inverse correspondence between each two-dimensional texture coordinate and the three-dimensional model surface coordinate, adjust the coverage of the partition map on the UV unfolding map, and obtain the inverse mapping trajectory information.
[0140] Extract the UV coordinates, 3D model surface coordinates, and bonding status markers for each pixel according to the region number. Then, combine this with the camera position and rotation parameters recorded during the rasterization stage. By comparing the rotation angle of the image segment to which each pixel belongs, retrieve its corresponding camera extrinsic parameter matrix and image size range. Next, reverse-engineer the pixel's coordinates on the UV map back to the camera coordinate system. Combine this with the reverse sequence of rotation angles to determine its theoretical projection trajectory in 3D space. Track the corresponding position point on the 3D model for each 2D pixel, and compare this position with the actual model point item by item, recording the spatial distance offset value. If the offset value exceeds a 3mm threshold, then... The UV mapping range of this pixel is considered to require boundary adjustment. The shape of the mapping edge of the entire area is judged. If the boundary of the area presents an irregular patch shape, or the edge contour length is less than 20 pixels, the UV range of the area is replanned, and the texture boundary is extended by 5 pixels for spatial redundancy retention. The orientation of the pixels on the matching edge is corrected, and their UV mapping coordinate values are reset. At the same time, their region number, coordinates before and after correction, mapping accuracy level and other data are recorded. All coordinate change information after processing is summarized and a reverse mapping trajectory record table is established to form a traceable and correctable reverse mapping trajectory information between each texture area and the surface of the 3D model.
[0141] S403: Based on the reverse mapping trajectory information, analyze the parameter distribution of texture boundaries in each region, judge and adjust the pixel arrangement of the region boundaries, update the content information synchronously, and integrate all texture data and mapping parameters to obtain the texture mapping adaptation structure.
[0142] The boundary pixel set of each texture region is selected, and its UV coordinates are sorted clockwise to extract the continuous arrangement relationship. The uniformity of pixel spacing is then analyzed. If the distance between adjacent points exceeds two pixels, they are marked as discontinuous points. The distribution density and spacing of all discontinuous boundary points are then analyzed. If there are more than five consecutive intervals, they are marked as broken boundaries. Next, the color distribution data of the boundary pixels is imported into the boundary correction module, and the gradient change range of RGB values is extracted. If the gradient change exceeds 50 in any channel, it is determined to be an edge abrupt transition segment. The boundary position is then adjusted using pixel filling. The transition segments undergo pixel smoothing rearrangement, interpolation is used to fill in abnormally arranged areas, and the corresponding 3D point positions are corrected simultaneously. Each adjusted boundary point is marked as "correction complete", and the differences before and after correction are recorded in the boundary lookup table. Then, all corrected texture segments are reloaded into the overall UV unfolded map, and the reverse trajectory table is called to rebind the 3D model surface coordinates to achieve synchronous updates of texture content. At the same time, the UV index table, boundary control sequence, and region number list of all region textures are rewritten to form a texture mapping adaptation structure containing information such as UV position, 3D coordinates, mapping parameters, and boundary sequence.
[0143] like Figure 6 As shown, the specific steps for merging continuous boundary regions are as follows:
[0144] S501: Based on the texture mapping adaptation structure, analyze the brightness, hue and saturation characteristics of each pixel in the boundary region, compare the boundary pixels with the same parameters of the original front face region in turn, judge the degree of difference of the boundary pixels in the dimensions of brightness, hue and saturation, and obtain color distribution comparison data.
[0145] A two-dimensional coordinate list of all boundary pixels is extracted from the UV image structure. For each coordinate position, its RGB color value is obtained and converted into the corresponding values for brightness, hue, and saturation in the HSV color model. These three parameters for the boundary pixel region are then sorted by row and column position to establish a pixel parameter distribution table. Simultaneously, a set of pixels corresponding to the structure is extracted from the known mapped image of the frontal face region in the model, and its brightness, hue, and saturation values are obtained in the same way to construct a standard parameter set. The two sets are compared in the same color space, and the absolute difference between each boundary pixel value and the standard value is calculated. The brightness dimension is then set... The contrast threshold is 15, the hue dimension is 10 degrees, and the saturation dimension is 20. When the difference of any pixel in a certain dimension exceeds the corresponding threshold, it is marked as a difference pixel in that dimension. The number of difference pixels in each category is counted in turn, and after being classified by dimension, the proportion of difference pixels in each dimension to the total number of boundary pixels is calculated. If the brightness difference ratio exceeds 30%, it is marked as a significant brightness shift. If the hue difference ratio is between 10% and 30%, it is marked as a moderate color shift. If the saturation difference exceeds 40%, it is marked as a saturation imbalance. At the same time, the spatial location of each type of difference pixel is recorded and a region number and pixel number label are attached to construct a boundary color feature comparison structure.
[0146] S502: Based on color distribution comparison data, adjust the color distribution of each pixel in the boundary area, smooth the brightness and hue transition through interpolation, allocate the adjusted pixels back to the boundary area and align them with the surrounding area to obtain the boundary transition adjustment parameters;
[0147] The brightness and hue transitions are smoothed using interpolation, and the adjusted pixels are allocated back to the boundary region and aligned with the surrounding region, using the following formula:
[0148]
[0149] Obtain the boundary transition adjustment parameters, where L z,j This represents the adjusted brightness of the pixel in the z-th row and j-th column of the boundary region. The value represents the original brightness of the boundary region in row z and column j, where α represents the adjustment coefficient. This represents the color distribution comparison data of the k-th pixel within the boundary region. Represents the original color value of the k-th pixel within the boundary region, and N represents the total number of pixels in the boundary region involved in the calculation;
[0150] Boundary transition adjustment parameters refer to the parameters used in image processing to achieve a smooth transition of pixel values at the image boundary, so that the boundary blends naturally with the color, brightness, hue and other features of the surrounding area, avoiding abrupt edges. This process is usually to make the changes of the image boundary smoother and more continuous, thereby improving the visual effect of the image, especially in the texture matching and transition areas of the image.
[0151] The 3D point cloud model acquired through 3D scanning technology is preprocessed to obtain the original brightness value. Specifically, the head area is scanned using a sensor to extract the brightness value of each pixel. Assuming the brightness value obtained through scanning is 50 (brightness level), α represents the intensity of interpolation adjustment. In practical applications, this value is usually set based on comparative experiments. Assuming that α is set to 0.5 through experiments, it means that the brightness adjustment intensity is 50%. The color distribution of the area around the boundary is obtained by color analysis tools. Assume that the color value of a certain reference area is (50, 45, 60) and corresponds to the RGB value. N represents the color value of the original pixel within the boundary area. Suppose the original color value of a pixel is (55, 50, 65), which corresponds to the RGB value. N represents the number of pixels involved in the calculation. In this example, assume that there are 4 pixels in the calculation area involved in color adjustment, so N = 4.
[0152] If the color value range is 0 to 255, and brightness and color differences have been normalized:
[0153]
[0154] α = 0.5 indicates that the brightness adjustment intensity is 50%;
[0155] The reference area color values (RGB) are normalized to (0.196, 0.176, 0.235);
[0156] The original color values (RGB) of the boundary region are normalized to (0.216, 0.196, 0.255);
[0157] With N=4, there are 4 pixels in the calculation area involved in color adjustment. Through normalization, all color parameters have been converted to values in the range of [0, 1].
[0158] The adjusted brightness value is calculated using a formula. First, the color difference is calculated and averaged.
[0159]
[0160] For each pixel:
[0161] (0.196-0.216)=-0.02;
[0162] (0.176-0.196)=-0.02;
[0163] (0.235-0.255)=-0.02;
[0164] Summing yields:
[0165]
[0166] Calculate the average difference for each color channel:
[0167]
[0168] The adjusted brightness calculation is as follows:
[0169] L z,j =50 + 0.5 × (-0.02) = 50 - 0.01 = 49.99;
[0170] The adjusted brightness value is 49.99.
[0171] The results calculated by the formula show that the brightness value of the boundary area has been adjusted from the original 50 to 49.99. This means that under the influence of color difference, the brightness of the boundary area has been slightly reduced to make it consistent with the color characteristics of the reference area, thus achieving a smooth transition of brightness and avoiding abrupt brightness changes, thereby improving the natural transition between the boundary and the surrounding area.
[0172] This formula calculates and weights the differences in color distribution, using the mean of these differences and adjustment coefficients to make brightness adjustments more flexible and precise. This method effectively avoids color breaks and discontinuities that occur in traditional methods when handling boundary transitions, thus achieving a more natural and refined image adjustment effect.
[0173] S503: Based on the boundary transition adjustment parameters, the color gradient direction and saturation distribution of each boundary pixel are adjusted point by point using the Poisson equation. The gradient changes in the boundary region are analyzed, and the data of the continuously changing segments are summarized to obtain the continuous boundary fusion region.
[0174] Iterate through all boundary pixels marked as requiring fusion processing, extract their 2D positions in the UV map and their corresponding brightness, hue, and saturation values, construct a local neighborhood window for each pixel with a size of 5×5, and calculate the gradient for all pixels within the window. Calculate the difference in values between each pixel and its four neighbors (up, down, left, and right) in the three channels, and record it as a color gradient vector. Combine this with the current pixel's offset direction to confirm the continuity of its color distribution. If any gradient in any of the three directions exceeds 30 and the direction is opposite to the adjacent area, it is recorded as a color abrupt change point. Set the boundary fusion level to high for all abrupt change points, medium for gradients between 10 and 30, and mark areas with gradients below 10 as smooth areas. Then, apply Poisson interpolation to each abrupt change point. The gradient direction of each abrupt change point is adjusted sequentially within its local window. The average gradient of the surrounding smoothed pixel values is used as the target gradient of the current pixel. The brightness and saturation values are then adjusted based on the difference between the current pixel and the target gradient to ensure a smooth transition in the neighborhood. This process is repeated for each abrupt change point. All boundary regions are then traversed again, and regions with continuous gradient change directions and color value changes of less than 5 after adjustment are marked as fused segments. The number of pixels in these regions is counted, and their spatial continuity is recorded. Finally, all pixel sets identified as fused segments are integrated to create a boundary fusion data table with its spatial location index, the relationship between the original brightness and the corrected brightness, the saturation adjustment magnitude, and the fusion level identifier. The continuous boundary fusion region is then summarized and output.
[0175] like Figure 7 As shown, a medical aesthetic 3D model construction system based on large image models includes:
[0176] The 3D point cloud mapping module is based on a 3D full-head point cloud model. It analyzes the coordinate distribution in space, calculates the 2D projection position of each point under the selected rotation angle and camera parameters, optimizes the allocation method of points to pixels, determines whether there are uncovered areas in the mapping, summarizes the spatial information of all pixels, and obtains rasterized image data.
[0177] The missing area feature extraction module is based on rasterized image data. It determines the spatial connectivity of unmapped pixels, analyzes the spatial positional relationship of missing parts in the UV unfolded image of the medical aesthetic 3D full-head model, filters the hair and neck related areas, calculates the color distribution and brightness changes of the areas, and obtains texture generation guidance parameters.
[0178] The texture generation and filtering module analyzes the features of the corresponding region based on the texture generation guidance parameters, parses the texture attributes of the partition prompts and the actual pixels, compares the consistency between the generated texture image and the color distribution of the input region, filters the content that matches the texture attributes of the top and back of the head region, and obtains the multi-region texture fitting index.
[0179] The UV mapping optimization module is based on multi-region texture fitting index to determine the spatial matching relationship between each pixel and the surface of the 3D model, analyzes the inverse mapping trajectory under the rotation and camera parameters used, optimizes the mapping coverage of each region in the UV unfolded map, adjusts the texture boundary distribution and updates the content synchronously to obtain the texture mapping adaptation structure.
[0180] The boundary blending smoothing module is based on a texture mapping adaptation structure. It analyzes the brightness, hue and saturation characteristics of the boundary region, calculates the actual difference between the pixel and the original front face region parameters, uses interpolation to correct the boundary color, and applies the Poisson equation to process the color gradient point by point to obtain a continuous boundary blending region.
[0181] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.
[0182] In this invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be a single item or multiple items.
[0183] It should be understood that, in various embodiments of the present invention, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0184] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0185] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0186] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0187] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0188] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0189] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0190] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for constructing a medical aesthetic 3D model based on a large image model, characterized in that, The method includes: S1: Based on the 3D full-head point cloud model, analyze the spatial coordinate distribution, calculate the two-dimensional projection position of each point, determine whether there are uncovered areas, integrate pixel spatial information, and obtain rasterized image data; S2: Based on the rasterized image data, determine the connectivity of unmapped pixels, analyze the spatial location of missing areas in the UV unfolded image, filter the hair and neck areas, calculate color brightness changes, and obtain texture generation guidance parameters. The specific steps for specifying the texture generation guidance parameters are as follows: S201: Based on the rasterized image data, analyze the spatial coordinates between unmapped pixels, determine the continuity of adjacent pixels in the spatial coordinate arrangement, group them according to the distance features between each pair of adjacent pixels and determine the affiliation of connected regions, and generate spatial connectivity grouping information. S202: Based on the spatial connectivity grouping information, analyze the coordinate distribution of each missing region in the UV unfolding diagram, determine the belonging relationship of each missing region in the surface coordinate system, and filter the pixel positions corresponding to hair and neck through the regional spatial relationship to obtain the associated regional spatial data. S203: Based on the associated regional spatial data, calculate the color channel value distribution and brightness value range of each pixel in the region, compare the associated parameters of the pixels outside the hair and neck regions, and combine the description content according to the data differences between regions to obtain texture generation guidance parameters; S3: Based on the texture generation guidance parameters, analyze the partition prompts and pixel texture attributes, compare the color distribution of the generated texture with that of the input area, filter out content that matches the features of the top of the head and the back of the head, and obtain multi-region texture fitting index; The specific steps for the multi-region texture matching index are as follows: S301: Based on the texture generation guidance parameters, compare the spatial location and pixel color distribution corresponding to each prompt description, determine the correspondence between the description content and the actual regional texture features, summarize the matching results after all regional comparisons, and obtain the regional feature comparison identifier. S302: Based on the region feature comparison identifier, compare the partition prompt with the actual pixel texture features, make separate judgments on the color channels and region brightness involved in each partition description, mark the pixel intervals where texture attributes differ, organize the difference comparison situation, and obtain the texture feature comparison set. S303: Based on the texture feature comparison set, filter pixel features associated with texture attributes of the top and back of the head, optimize region marking and texture distribution, and statistically summarize associated parameters according to region logical order to obtain multi-region texture fitting index. S4: Based on the multi-region texture fitting index, determine the spatial correspondence between pixels and the surface of the 3D model, analyze the inverse mapping path under rotation and camera parameters, optimize the mapping distribution of the UV unfolding map, and obtain the texture mapping adaptation structure. S5: Based on the texture mapping adaptation structure, analyze the brightness, hue and saturation of the boundary region, calculate the parameter difference with the front face region, use interpolation to correct the boundary color, apply the Poisson equation to process the gradient, and obtain a continuous boundary fusion region.
2. The method for constructing a medical aesthetic 3D model based on a large image model according to claim 1, characterized in that, The rasterized image data includes spatial mapping coordinates, two-dimensional pixel distribution, and data label type. The texture generation guidance parameters include regional feature labels, generation constraint content, and target style description. The multi-region texture fitting index includes regional fusion priority, texture stitching standard, and matching metric label. The texture mapping adaptation structure includes a UV index list, an adaptation rule set, and a boundary adjustment factor. The continuous boundary fusion region includes pixel smooth distribution, transition zone label, and color fusion factor.
3. The method for constructing a medical aesthetic 3D model based on a large image model according to claim 1, characterized in that, The specific steps for rasterizing the image data are as follows: S101: Based on a 3D full-head point cloud model, calculate the projection position of each point under the conditions of set rotation angle and camera parameters, use matrix transformation to batch map the three-dimensional coordinates to the two-dimensional pixel plane, judge the abnormal coordinate situation that occurs during the projection process, and obtain the projection coordinate distribution characteristics. S102: Based on the projection coordinate distribution characteristics, determine its distribution status in the pixel grid, filter all pixel grid points corresponding to the assigned 3D points, statistically analyze the coverage status of each pixel grid point, and mark the area for the pixel grid points without assigned 3D points to obtain the coverage area distribution identifier. S103: Based on the coverage area distribution identifier, compare the three-dimensional spatial coordinates, normal vectors and pixel positions associated with the mapped pixels, organize them in a structured manner according to the pixel index, and collect the data corresponding to each pixel to obtain rasterized image data.
4. The method for constructing a medical aesthetic 3D model based on a large image model according to claim 1, characterized in that, The optimized region marking and texture distribution are based on the following formula: ; Calculate optimized texture distribution values, filter pixel features associated with texture attributes in the top and back of the head regions, and optimize region labeling and texture distribution. The optimized value representing the texture distribution in each region. Represents the total number of regions. Representing the Weighting factors for each region Representing the The total number of pixel features in each region Representing the The first region Texture parameter values for each pixel. Representing the The average value of all pixel texture parameter values in a region Representing the Standard values for the target texture distribution in each region.
5. The method for constructing a medical aesthetic 3D model based on a large image model according to claim 1, characterized in that, The specific steps of the texture mapping adaptation structure are as follows: S401: Based on the multi-region texture bonding index, analyze the spatial position relationship between each pixel and the surface of the three-dimensional model, judge the bonding parameters and three-dimensional coordinate distribution of each region item by item, filter the pixels with spatial matching state differences, and assign corresponding spatial positions to obtain the pixel spatial matching parameters. S402: Based on the pixel space matching parameters, determine the spatial trajectory corresponding to the rotation parameters and camera parameters, track the inverse correspondence between each two-dimensional texture coordinate and the three-dimensional model surface coordinate, adjust the coverage of the partition map on the UV unfolding map, and obtain the inverse mapping trajectory information. S403: Based on the reverse mapping trajectory information, analyze the parameter distribution of texture boundaries in each region, judge and adjust the pixel arrangement of the region boundaries, update the content information synchronously, and integrate all texture data and mapping parameters to obtain the texture mapping adaptation structure.
6. The method for constructing a medical aesthetic 3D model based on a large image model according to claim 1, characterized in that, The specific steps for merging the continuous boundary regions are as follows: S501: Based on the texture mapping adaptation structure, analyze the brightness, hue and saturation characteristics of each pixel in the boundary region, compare the boundary pixels with the same parameters of the original front face region in turn, determine the degree of difference of the boundary pixels in the dimensions of brightness, hue and saturation, and obtain color distribution comparison data. S502: Based on the color distribution comparison data, adjust the color distribution of each pixel in the boundary area, smooth the brightness and hue transition through interpolation, allocate the adjusted pixels back to the boundary area, and align them with the surrounding area to obtain the boundary transition adjustment parameters; S503: Based on the boundary transition adjustment parameters, the color gradient direction and saturation distribution of each boundary pixel are adjusted point by point using the Poisson equation. The gradient changes in the boundary region are analyzed, and the data of the continuously changing segments are summarized to obtain the continuous boundary fusion region.
7. The method for constructing a medical aesthetic 3D model based on a large image model according to claim 6, characterized in that, The process of smoothing brightness and hue transitions through interpolation, allocating adjusted pixels back to the boundary region, and aligning them with the surrounding region is achieved using the following formula: ; The boundary transition adjustment parameters are obtained, where, Representing the boundary region Line number Brightness after adjustment of column pixels, Representing the boundary region Line number Original brightness Represents the adjustment factor. Represents the first within the boundary area Color distribution comparison data of each pixel, Represents the first within the boundary area The original color value of each pixel. This represents the total number of pixels involved in the calculation within the boundary area.
8. A medical aesthetic 3D model construction system based on large image models, the system being used to implement the medical aesthetic 3D model construction method based on large image models as described in any one of claims 1-7, characterized in that, The system includes: The 3D point cloud mapping module is based on a 3D full-head point cloud model. It analyzes the coordinate distribution in space, calculates the 2D projection position of each point under the selected rotation angle and camera parameters, optimizes the allocation method of points to pixels, determines whether there are uncovered areas in the mapping, summarizes the spatial information of all pixels, and obtains rasterized image data. Based on the rasterized image data, the missing area feature extraction module determines the spatial connectivity of unmapped pixels, analyzes the spatial positional relationship of the missing parts in the UV unfolded image of the medical aesthetic 3D full-head model, filters the hair and neck related areas, calculates the color distribution and brightness changes of the areas, and obtains texture generation guidance parameters. Based on the texture generation guidance parameters, the texture generation and filtering module analyzes the features of the corresponding region, parses the texture attributes of the partition prompts and the actual pixels, compares the consistency between the generated texture image and the color distribution of the input region, filters the content that matches the texture attributes of the top and back of the head region, and obtains the multi-region texture fitting index. The UV mapping optimization module, based on the multi-region texture fitting index, determines the spatial matching relationship between each pixel and the surface of the 3D model, analyzes the inverse mapping trajectory under the rotation and camera parameters used, optimizes the mapping coverage of each region in the UV unfolded map, adjusts the texture boundary distribution and updates the content synchronously, and obtains the texture mapping adaptation structure. The boundary blending smoothing module analyzes the brightness, hue, and saturation characteristics of the boundary region based on the texture mapping adaptation structure, calculates the actual difference between the pixel and the original front face region parameters, corrects the boundary color using interpolation, and applies the Poisson equation to process the color gradient point by point to obtain a continuous boundary blending region.
Citation Information
Patent Citations
3D face model texture reconstruction method and device based on single image
CN115082640A
Method and apparatus for image-based photorealistic 3D face modeling
US20050063582A1