A High-Efficiency Hair Image Generation Method

By simulating hair distribution and growth characteristics to generate hair image datasets, the problem of insufficient training data for hair detection models is solved, improving the flexibility and accuracy of the models, and making them suitable for biomedical imaging and personal care product development.

CN120431418BActive Publication Date: 2026-01-30ZHEJIANG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510492313.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2026-01-30
Estimated Expiration
2045-04-18

AI Technical Summary

Technical Problem

Existing technologies struggle to efficiently generate hair images for training hair detection models, particularly in terms of hair quantity and thickness statistics, and the lack of sufficient labeled data makes model training difficult.

Method used

By randomly generating hair follicles and whorls on a canvas, the growth angle, shape, and thickness of hair are simulated. A mask image is generated and fused with a bald head image to form a hair dataset, providing a large amount of training data to optimize the hair detection model.

Benefits of technology

It improves the flexibility and accuracy of hair detection models, making them suitable for biomedical imaging and personal care product development. It provides realistic hair images and accurate labeling information, solving the problem of insufficient training data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120431418B_ABST
    Figure CN120431418B_ABST
Patent Text Reader

Abstract

This invention discloses a high-efficiency hair image generation method, comprising: establishing a Cartesian coordinate system on a canvas and generating a set of hair follicle positions and hair whorl positions based on a two-dimensional Gaussian distribution function; connecting each hair follicle position to a hair whorl position to obtain the initial growth angle of the corresponding hair; randomly offsetting the initial growth angle of all hairs in all hair follicle positions to obtain the offset angle of the corresponding hair; simulating the shape and thickness of all hairs and generating hairs according to the offset angles of all hairs to obtain a mask image and labels for all hairs; fusing the mask image and the bald head image; and incorporating the label set formed by the corresponding mask image, fused image, and labels of all hairs into the hair dataset as data pairs, repeating the process until a preset number of data pairs are obtained to form a hair training set. This method can efficiently simulate a large amount of training data for optimizing various hair detection models, improving the flexibility and accuracy of hair detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision and image processing, and specifically relates to a high-efficiency method for generating hair images. Background Technology

[0002] In the field of computer vision, the accurate detection and localization of slender objects (such as hair and fibers) has significant practical application value, particularly in biomedical imaging and personal care product development. Scalp examinations often require manual counting of hair quantity and thickness, a tedious and time-consuming process. Furthermore, current technologies typically use deep learning models to classify hair follicles and estimate the severity of hair loss, which usually rely on large amounts of labeled data for training. This is particularly challenging for slender objects, as these often require fine-level annotations to capture their subtle features.

[0003] A common phenomenon in hair analysis is that two or even more hairs may grow from the same hair follicle. Although existing techniques, such as those by Kim et al. (Reference: Minki Kim, Sunwon Kang, and Byoung-Dai Lee. Evaluation of automated measurement of hair density using deep neural networks. Sensors, 22(2):650, 2022.), have used traditional object detection models to measure hair density, this requires cutting the hair short. Even so, because the publicly available datasets only have labels for hair follicle detection, the trained models do not have good discriminative ability for hairs growing from the same follicle, which limits their ability to statistically measure the length and thickness of long hairs. Furthermore, due to the directional and elongated shape of hair, even if a traditional object detection box is used to enclose the entire hair, there will still be a lot of blank information or even other hairs within the box, making traditional methods not entirely suitable for downstream tasks such as detection. Therefore, a high-efficiency hair image generation method is proposed. Summary of the Invention

[0004] The purpose of this invention is to address the above-mentioned problems by proposing a highly efficient hair image generation method that can efficiently simulate a large amount of training data to promote the optimization of various hair detection models and improve the flexibility and accuracy of hair detection tasks.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0006] This invention proposes a high-efficiency hair image generation method, comprising the following steps:

[0007] S1. Establish a Cartesian coordinate system oxy on the canvas and randomly generate the hair follicle location set P and hair whorl location O based on a two-dimensional Gaussian distribution function, where P = {P1, P2, ..., P...} j , ..., P m}, P j This represents the location of the j-th hair follicle, where j = 1, 2, ..., m, and m is the number of hair follicle locations.

[0008] S2. Connect each hair follicle location to the hair whorl location O, and denote the connection vector between the j-th hair follicle location and the hair whorl location O as follows: And view connection vector The angle between the hair and the pre-selected coordinate axis is the initial growth angle of the hair at the j-th hair follicle location. Pre-select the coordinate axis as the x-axis or y-axis;

[0009] S3. Randomly offset the initial growth angle of all hairs in all hair follicle locations to obtain the offset angle of the i-th hair. Where i = 1, 2, ..., n, n ≥ m, and n is the number of hairs;

[0010] S4. Simulate the shape and thickness of all hairs, and generate hair according to the offset angle of all hairs to obtain the mask image I. mask And tags for all the hair;

[0011] S5, Mask image I mask And bald head image I bg Image fusion is performed to obtain fused image I fusion ;

[0012] S6. Transfer the corresponding mask image I mask fused image I fusion The label set (label) formed by the labels of all hairs is used as a data pair (I fusion ,I mask The data (label) is included in the hair dataset, and step S1 is returned until a preset number of data pairs (I, label) are obtained. fusion ,I mask ,label), using the hair dataset as the hair training set.

[0013] Preferably, the shape and thickness of all hairs are simulated, and hair is generated according to the offset angle of all hairs to obtain a mask image I. mask The tags for all the hair are as follows:

[0014] S41. Establish the shape simulation formula for the i-th hair and perform sampling to obtain the sampling point set of the i-th hair. To simulate the shape of the corresponding hair, where the set of x-coordinates of the sampling points... Sampling point ordinate set This represents the x-axis coordinate of the k-th sampling point of the i-th hair. Let represent the y-axis coordinate of the k-th sampling point of the i-th hair, where k = 1, 2, ..., num, and num represents the number of sampling points for the i-th hair. The formula for simulating the shape of the i-th hair is as follows:

[0015]

[0016] in, Let x represent the shape of the i-th hair. i This represents the x-axis coordinate of the i-th hair. This represents the bending frequency of the randomly generated i-th hair. This represents the bending phase of the randomly generated i-th hair, length i This represents the length of the randomly generated i-th hair;

[0017] S42. Perform a rotation and translation operation on the sampling point set of the corresponding hair according to the offset angle of each hair to obtain the transformed sampling point set of the corresponding hair. Then the sampling point set of the i-th hair is... The formulas for rotation and translation operations are as follows:

[0018]

[0019] in, This represents the x-axis coordinates of all sampled points after the corresponding hair has undergone a rotation and translation operation. This represents the y-axis coordinates of all sampled points after the corresponding hair has undergone a rotation and translation operation. That is, the set of transformed sampling points for the i-th hair, X T This represents the transpose of the set of x-coordinates of the sampled points before the rotation and translation operation on the corresponding hair, and Y represents the transpose of the set of x-coordinates. T This represents the transpose of the set of ordinates Y of the sampled points before the rotation and translation operation was performed on the corresponding hair. This represents the x-axis coordinate of the root of the i-th hair. This represents the y-axis coordinate of the root of the i-th hair;

[0020] S43. Based on the established formula for simulating the thickness of the i-th hair, obtain the width of all sampling points in the sampling point set of the corresponding hair to simulate the thickness of the corresponding hair. The formula for simulating the thickness of the i-th hair is as follows:

[0021]

[0022] in, It represents the width of the kth sampling point of the i-th hair, that is, the thickness of the kth sampling point of the i-th hair, and width0 represents the initial width of the randomly generated hair;

[0023] S44. Generate hair based on the conversion sampling point set of each hair and the width correspondence of all sampling points, and obtain the mask image I. mask And tags for all the hair.

[0024] Preferably, the sampling is uniform sampling.

[0025] Preferably, the image fusion formula is as follows:

[0026]

[0027] Among them, I fusion (·) represents the image fusion output result, i.e., the fused image I. fusion γ represents the hyperparameter.

[0028] Preferably, the hair follicle location set P and the hair whorl location O are obtained as follows:

[0029] Create a grid on the canvas;

[0030] Using each intersection point in the grid as a reference point, the position coordinates of the corresponding intersection points are randomly generated using a two-dimensional Gaussian distribution function as the hair follicle positions. All hair follicle positions together form the hair follicle position set P, and the reference point is the center point of the two-dimensional Gaussian distribution function.

[0031] Using the center point of the canvas as the reference point, the position O of the hair whorl is randomly generated using a two-dimensional Gaussian distribution function.

[0032] Preferably, before connecting each hair follicle location to the hair whorl location O, the following operation is also performed:

[0033] A first preset number of hair follicle positions are randomly generated on the canvas to update the number of hair follicle positions m, which is m+l, where l is the first preset number;

[0034] The number of hairs at each hair follicle location is at least one. When there are multiple hairs at the corresponding hair follicle location, a second preset number of hair follicle locations are randomly selected from the hair follicle location set P and marked to indicate that multiple hairs are generated at the marked hair follicle locations.

[0035] Preferably, the random angle is a random number between -π / 5 and π / 5.

[0036] Preferably, the label has a width of w, a length of h, and a rotation angle of [value missing] starting from the hair root. The rotating target detection bounding box, where w equals the average width of the hair, and h is less than or equal to the preset value H. lim .

[0037] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0038] This method aims to provide training data for various hair detection models to automatically capture and count the number and thickness of hairs, solving the training problem of hair detection models caused by the lack of sufficient labeled data in existing technologies. Specifically, by simulating real hair distribution, growth angle, hair shape, and thickness variations, and fusing images to generate realistic hair images, it achieves random generation of images and their corresponding custom labels according to the natural distribution of hair on the scalp surface. This generates hair images and accurate label information that can be used by machine learning algorithms, thereby simulating a large amount of usable training data. This data can be used to promote the optimization of various hair detection models in supervised learning environments, improving the flexibility and accuracy of hair detection tasks. It is also convenient, fast, and widely applicable, such as in biomedical imaging, seborrheic alopecia analysis, and personal care product development. Attached Figure Description

[0039] Figure 1 This is a flowchart of the high-efficiency hair image generation method of the present invention;

[0040] Figure 2 This is a schematic diagram of the mask image and the fused image generated by the present invention;

[0041] Figure 3 This is a schematic diagram of a real hair image. Detailed Implementation

[0042] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0043] It should be noted that, unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application.

[0044] like Figure 1 As shown, a high-efficiency hair image generation method includes the following steps:

[0045] S1. Establish a Cartesian coordinate system oxy on the canvas and randomly generate the hair follicle location set P and hair whorl location O based on a two-dimensional Gaussian distribution function, where P = {P1, P2, ..., P...} j , ..., Pm}, P j This represents the location of the j-th hair follicle, where j = 1, 2, ..., m, and m is the number of hair follicle locations.

[0046] In one embodiment, the hair follicle location set P and the hair whorl location O are obtained as follows:

[0047] Create a grid on the canvas;

[0048] Using each intersection point in the grid as a reference point, the position coordinates of the corresponding intersection points are randomly generated using a two-dimensional Gaussian distribution function as the hair follicle positions. All hair follicle positions together form the hair follicle position set P, and the reference point is the center point of the two-dimensional Gaussian distribution function.

[0049] Using the center point of the canvas as the reference point, the position O of the hair whorl is randomly generated using a two-dimensional Gaussian distribution function.

[0050] In one embodiment, before connecting each hair follicle location to the hair whorl location O, the following operation is performed:

[0051] A first preset number of hair follicle positions are randomly generated on the canvas to update the number of hair follicle positions m, which is m+l, where l is the first preset number;

[0052] The number of hairs at each hair follicle location is at least one. When there are multiple hairs at the corresponding hair follicle location, a second preset number of hair follicle locations are randomly selected from the hair follicle location set P and marked to indicate that multiple hairs are generated at the marked hair follicle locations.

[0053] The canvas can be white. Generally, the upper left corner of the canvas is the origin o of the rectangular coordinate system oxy. The horizontal direction is the x-axis and the vertical direction is the y-axis. The horizontal and vertical axes of the grid are parallel to the x-axis and y-axis of the rectangular coordinate system oxy, respectively, and the grid is formed with the origin of the rectangular coordinate system oxy as the starting point. Alternatively, it can be set arbitrarily according to actual needs.

[0054] Specifically, based on general dermatological observations and common sense, while hair follicles on the same part of the same person are not strictly equidistant, their distances are usually relatively consistent. Therefore, based on the hair follicle distribution density of a real hair dataset, a probability cloud map based on a grid distribution (grid density: 6-7 rows and columns) is generated on a canvas using a two-dimensional Gaussian distribution function to randomly generate the initial position of each hair follicle, simulating a non-strictly equidistant distribution. Under normal circumstances, each hair follicle grows only one hair; however, occasionally multiple hairs may grow from a single follicle. This is called "multiple hair follicles" or "multiple hairs." Therefore, this application randomly selects several hair follicle positions (0-7 random numbers) based on the randomly generated positions using the two-dimensional Gaussian distribution function to indicate that multiple hairs will be generated within that follicle position. In addition, a small number of random positions (0-8 random numbers) are generated to increase the robustness of subsequent hair detection on the real hair dataset. The hair follicle position is... Figure 1 The cross in the grid diagram indicates the position; the hair whorl position O is... Figure 1 PointO in the grid diagram, the hexagon indicates the location.

[0055] S2. Connect each hair follicle location to the hair whorl location O, and denote the connection vector between the j-th hair follicle location and the hair whorl location O as follows: And view connection vector The angle between the hair and the pre-selected coordinate axis is the initial growth angle of the hair at the j-th hair follicle location. The pre-selected coordinate axis is either the x-axis or the y-axis.

[0056] S3. Randomly offset the initial growth angle of all hairs in all hair follicle locations to obtain the offset angle of the i-th hair. Where i = 1, 2, ..., n, n ≥ m, and n is the number of hairs.

[0057] In one embodiment, the random angle is a random number between -π / 5 and π / 5. For each generated hair, its initial growth angle is randomly offset to obtain the corresponding hair offset angle. Preferably, the random angle is a random number between -π / 5 and π / 5, but it can be adjusted according to actual needs.

[0058] S4. Simulate the shape and thickness of all hairs, and generate hair according to the offset angle of all hairs to obtain the mask image I. mask And tags for all the hair.

[0059] In one embodiment, the shape and thickness of all hairs are simulated, and hair is generated according to the offset angle of all hairs to obtain a mask image I. maskThe tags for all the hair are as follows:

[0060] S41. Establish the shape simulation formula for the i-th hair and perform sampling to obtain the sampling point set of the i-th hair. To simulate the shape of the corresponding hair, where the set of x-coordinates of the sampling points... Sampling point ordinate set This represents the x-axis coordinate of the k-th sampling point of the i-th hair. Let represent the y-axis coordinate of the k-th sampling point of the i-th hair, where k = 1, 2, ..., num, and num represents the number of sampling points for the i-th hair. The formula for simulating the shape of the i-th hair is as follows:

[0061]

[0062] in, Let x represent the shape of the i-th hair. i This represents the x-axis coordinate of the i-th hair. This represents the bending frequency of the randomly generated i-th hair. This represents the bending phase of the randomly generated i-th hair, length i This represents the length of the randomly generated i-th hair;

[0063] S42. Perform a rotation and translation operation on the sampling point set of the corresponding hair according to the offset angle of each hair to obtain the transformed sampling point set of the corresponding hair. Then the sampling point set of the i-th hair is... The formulas for rotation and translation operations are as follows:

[0064]

[0065] in, This represents the x-axis coordinates of all sampled points after the corresponding hair has undergone a rotation and translation operation. This represents the y-axis coordinates of all sampled points after the corresponding hair has undergone a rotation and translation operation. That is, the set of transformed sampling points for the i-th hair, X T This represents the transpose of the set of x-coordinates of the sampled points before the rotation and translation operation on the corresponding hair, and Y represents the transpose of the set of x-coordinates. T This represents the transpose of the set of ordinates Y of the sampled points before the rotation and translation operation was performed on the corresponding hair. This represents the x-axis coordinate of the root of the i-th hair. This represents the y-axis coordinate of the root of the i-th hair;

[0066] S43. Based on the established formula for simulating the thickness of the i-th hair, obtain the width of all sampling points in the sampling point set of the corresponding hair to simulate the thickness of the corresponding hair. The formula for simulating the thickness of the i-th hair is as follows:

[0067]

[0068] in, It represents the width of the kth sampling point of the i-th hair, that is, the thickness of the kth sampling point of the i-th hair, and width0 represents the initial width of the randomly generated hair;

[0069] S44. Generate hair based on the conversion sampling point set of each hair and the width correspondence of all sampling points, and obtain the mask image I. mask And tags for all the hair.

[0070] Here, the hair root refers to the location of the hair follicle. The shape of the i-th hair is simulated using a formula for simulating the shape of the i-th hair, and a set of sampling points is obtained after sampling. This represents the num sampling points that make up a single hair; finally, the sampling point set is processed according to the offset angle of the i-th hair. Rotation and translation are performed to obtain the transformation sampling point set for all hair strands. Hair is then generated based on the transformation sampling point set for each hair strand and the width of all sampling points. That is, each hair curve is drawn on a white canvas as a black curve with varying thickness. After simulating all hair curves, a mask image I is obtained. mask (Black and white image). Simultaneously, labels required for training any subsequent hair detection model are generated at this stage. In this embodiment, It is randomly generated by a Gaussian function with a mean of 0.8 and a standard deviation of 0.3. for random number, length i The value is a random value of [0.1*meanHW, 0.7neanHW], and width0 is a random value of [10*meanHW / 2240, 35*meanHW / 2240]. meanHW = (canvas height + canvas width) / 2.

[0071] In one embodiment, sampling is uniform sampling.

[0072] In one embodiment, the label has a width of w, a length of h, and a rotation angle starting from the hair root. The rotating target detection bounding box, where w equals the average width of the hair, and h is less than or equal to the preset value H. lim That is, when the hair length is greater than the preset value H. lim Afterwards, the height of the rotated target detection box is equal to H. lim .

[0073] The average width w of the hair can be the average width of all sampling points of the corresponding hair, or it can be the average width of the generated hair as a whole. The label settings can also be adjusted according to actual needs.

[0074] S5, Mask image I mask And bald head image I bg Image fusion is performed to obtain fused image I fusion .

[0075] In one embodiment, the image fusion formula is as follows:

[0076]

[0077] Among them, I fusion (·) represents the image fusion output result, i.e., the fused image I. fusion γ represents the hyperparameter.

[0078] Among them, the mask image I is obtained through image fusion. mask (Black and white image) Using bald head image I bg Fill the background and blend it into a composite image that closely resembles the style of a realistic image. fusion This allows the subsequent hair detection model to better understand the image. In this embodiment, γ = 1.5 is used to determine the degree of blending between the two images.

[0079] S6. Transfer the corresponding mask image I mask fused image I fusion The label set (label) formed by the labels of all hairs is used as a data pair (I fusion ,I mask The data (label) is included in the hair dataset, and step S1 is returned until a preset number of data pairs (I, label) are obtained. fusion ,I mask ,label), using the hair dataset as the hair training set.

[0080] Specifically, in this embodiment, 2500 data pairs (I) are generated. fusion ,I mask (label), such as Figure 2 As shown, the mask image I in two data pairs is displayed. mask and fused image I fusion ,in, Figure 2 Image (a1) and image (b1) in the image correspond to a pair of mask images I. mask and fused image I fusion , Figure 2 Images (a2) and (b2) in the diagram correspond to a pair of mask images I. mask and fused image I fusionIt can be seen that the fused image I fusion Approaching Figure 3 The morphological features of hair in the real hair image shown. Figure 3 Images (a) and (b) are both real hair images. To meet the input size requirements of subsequent hair detection models, the generated mask image I can also be adjusted. mask fused image I fusion The resolution, such as being set to 1024×1024, is used to better complete the training of the subsequent hair detection model.

[0081] This method aims to provide training data for various hair detection models to achieve automatic statistical analysis of hair quantity and thickness through feature capture. It can generate an unlimited number of hair images and custom labels for downstream model training, solving the training problem of hair detection models caused by insufficient labeled data in existing technologies. Specifically, by simulating real hair distribution, growth angle, hair shape, and thickness variations, and fusing images to generate realistic hair images, it achieves random generation of images and corresponding custom labels according to the natural distribution of hair on the scalp surface. This generates hair images and accurate label information that can be used by machine learning algorithms, thus simulating a large amount of usable training data. This data can be used to promote the optimization of various hair detection models in supervised learning environments, improving the flexibility and accuracy of hair detection tasks. It is convenient, fast, and widely applicable, such as in biomedical imaging, seborrheic alopecia analysis, and personal care product development.

[0082] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0083] The embodiments described above are merely specific and detailed examples of the embodiments described in this application, and should not be construed as limiting the scope of the application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these modifications and improvements all fall within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the appended claims.

Claims

1. A high-efficiency hair image generation method, characterized by: The high-efficiency hair image generation method comprises the following steps: S1. Establish a Cartesian coordinate system oxy on the canvas and randomly generate the hair follicle location set P and hair whorl location O based on a two-dimensional Gaussian distribution function, where P = {P1, P2, ..., P...} j , ..., P m }, P j This represents the location of the j-th hair follicle, where j = 1, 2, ..., m, and m is the number of hair follicle locations. S2, connecting each follicle position with the spiral position O respectively, and recording the connecting vector of the jth follicle position and the spiral position O as and the angle between the connecting vector and the preselected coordinate axis as the initial growth angle of the hair in the jth follicle position The preselected coordinate axis is the x-axis or the y-axis; S3, a random angle offset is performed on the initial growth angle of all the hairs in all the follicle positions to obtain an offset angle of the ith hair wherein i = 1, 2, …, n, n > m, n is the number of hairs; S4, simulate the shape and thickness of all the hair, and generate the hair according to the offset angle of all the hair to obtain a mask image I mask and the label of all the hair; S5, the mask image I mask and the light head image I bg image fusion to obtain a fused image I fusion ; S6、the corresponding mask image I mask , the fusion image I fusion and the label set label formed by the labels of all the hairs are taken into the hair dataset as the data pair (I fusion , I mask , label), and the step S1 is returned to be executed until a preset number of data pairs (I fusion , I mask , label) are obtained, and the hair dataset is taken as a hair training set.

2. The high-efficiency hair image generation method of claim 1, wherein: The simulation all hair shape and thickness, and according to all hair offset angle corresponding generation hair, obtain mask image I mask And all hair label, specific as follows: S41, a shape simulation formula of the i-th hair is established and sampling is performed to obtain a sampling point set of the i-th hair to simulate the shape of the corresponding hair, wherein the sampling point abscissa set the sampling point ordinate set an x-axis coordinate value of the k-th sampling point of the i-th hair, a y-axis coordinate value of the k-th sampling point of the i-th hair, k = 1, 2, …, num, num representing the number of sampling points of the i-th hair, and the shape simulation formula of the i-th hair being as follows: wherein, represents the shape of the i-th hair, x i represents the x-axis coordinate value of the i-th hair, represents the bending frequency of the i-th hair generated randomly, represents the bending phase of the i-th hair generated randomly, length i represents the length of the i-th hair generated randomly; S42、According to the offset angle of each hair, a rotation translation operation of the sampling point set of the corresponding hair is performed to obtain a converted sampling point set of the corresponding hair, and the rotation translation operation formula of the sampling point set of the i-th hair is as follows: The rotation translation operation formula of the sampling point set of the i-th hair is as follows: wherein, represents the x-axis coordinate values of all the sampling points after performing the rotation translation operation on the corresponding hair, represents the y-axis coordinate values of all the sampling points after performing the rotation translation operation on the corresponding hair, i.e. the transformed sampling point set of the i-th hair, X T represents the transpose of the sampling point horizontal coordinate set X before performing the rotation translation operation on the corresponding hair, Y T represents the transpose of the sampling point vertical coordinate set Y before performing the rotation translation operation on the corresponding hair, represents the x-axis coordinate values of the hair root of the i-th hair, represents the y-axis coordinate values of the hair root of the i-th hair; S43, according to the established thickness simulation formula of the ith hair, the width of all sampling points in the sampling point set of the corresponding hair is obtained to simulate the thickness of the corresponding hair, and the thickness simulation formula of the ith hair is as follows: wherein, widthk represents the width of the kth sampling point of the ith hair, that is, the thickness of the kth sampling point of the ith hair, and width0 represents the initial width of the randomly generated hair; S44, generate the hair according to the conversion sampling point set of each hair and the width of all sampling points, obtain the mask image I mask and the label of all hairs.

3. The high-efficiency hair image generation method of claim 2, wherein: The sampling is uniform sampling.

4. The high-efficiency hair image generation method of claim 1, wherein: The image fusion formula is as follows: where I fusion (·) represents the image fusion output result, i.e., the fusion image I fusion , γ represents a hyperparameter.

5. The high-efficiency hair image generation method of claim 1, wherein: The hair follicle position set P and the hair curl position O are obtained as follows: A grid chart is established on the canvas; respectively, the position coordinates of the corresponding intersection points are randomly generated as the hair follicle positions by using the two-dimensional Gaussian distribution function, and all the hair follicle positions form the hair follicle position set P, wherein the reference point is the center point of the two-dimensional Gaussian distribution function; The center point of the canvas is taken as the reference point, and the hair curl position O is randomly generated by using the two-dimensional Gaussian distribution function.

6. The high-efficiency hair image generation method of claim 1, wherein: Before connecting each hair follicle position to the hair curl position O, the following operation is performed: A first predetermined number of hair follicle positions are randomly generated on the canvas to update the number m of hair follicle positions to m+l, wherein l is the first predetermined number; The number of hairs of each hair follicle position is at least one, and when the corresponding hair follicle position is a plurality of hairs, a second predetermined number of hair follicle positions are randomly selected from the hair follicle position set P to be marked, indicating that a plurality of hairs are generated at the marked hair follicle positions.

7. The high-efficiency hair image generation method of claim 1, wherein: The random angle is a random number between -π / 5 and π / 5.

8. The high-efficiency hair image generation method of claim 1, wherein: The label is a rotation target detection frame with a width w, a length h, and a rotation angle from the root, w is equal to the average width of the hair, h is less than or equal to a preset value H lim .

Citation Information

Patent Citations

  • Dynamic hair modeling method based on single-view-angle video

    CN110930500A

  • Arbitrary angle target detection method based on coarse mask smooth label supervision

    CN115393710A