High-efficiency hair image generation method

By generating hair follicles and hair rotation positions on the canvas, simulating the growth angle and shape of the hair, and generating hair training data sets, the problem of insufficient training data of hair detection models in the prior art is solved, and the flexibility and accuracy of hair detection are improved.

CN120431418AActive Publication Date: 2025-08-05ZHEJIANG UNIV OF TECH
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently generate hair images for training hair detection models, especially in statistics of hair quantity and thickness, and traditional methods are not suitable for precise detection of elongated objects.

Method used

By establishing a rectangular coordinate system on the canvas, using a two-dimensional Gaussian distribution function to generate hair follicles and hair rotation positions, randomly simulate the growth angle and shape of the hair, generate masked images and fuse them with the optical head images, forming a hair training data set.

Benefits of technology

It realizes efficient training data generation of hair detection models, improves the flexibility and accuracy of hair detection, and is suitable for biomedical imaging and personal care product development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120431418A_ABST
    Figure CN120431418A_ABST
Patent Text Reader

Abstract

The invention discloses a high-efficiency hair image generation method. The method comprises the following steps: establishing a rectangular coordinate system on a canvas, and generating a hair follicle position set and a hair rotation position of hair based on a two-dimensional Gaussian distribution function; connecting each hair follicle position with the hair rotation position to obtain an initial growth angle of the corresponding hair; performing random angle deviation on the initial growth angles of all hair in all hair follicle positions to obtain deviation angles of the corresponding hair; simulating the shapes and thicknesses of all hair, correspondingly generating hair according to the deviation angles of all hair, and obtaining a mask image and labels of all hair; performing image fusion on the mask image and the optical head image; and taking a label set formed by the corresponding mask image, the fused image and the labels of all hair as a data pair to be included in a hair data set, and circularly executing until a preset number of data pairs are obtained to form a hair training set. A large amount of training data can be efficiently simulated and used for optimizing various hair detection models, and the flexibility and accuracy of hair detection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the fields of computer vision and image processing, and in particular relates to a high-efficiency hair image generation method. Background Art

[0002] In the field of computer vision, the precise detection and positioning of slender objects (such as hair, fibers, etc.) has important practical application value, especially in biomedical imaging, personal care product development, etc. Since scalp problem inspections often require personnel to manually count the number and thickness of hair, this process is tedious and time-consuming. At the same time, existing technologies usually use deep learning models to classify hair follicles and estimate the severity of hair loss. They usually rely on a large amount of labeled data to train the model, which is particularly challenging for slender objects because these objects often require fine-level annotation to capture their subtle features.

[0003] In particular, a common phenomenon in hair analysis is that two or even more hairs may grow from the same hair follicle. Although 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.) used a traditional target detection model to measure hair density in the prior art, the hair needs to be cut short. Even so, because the public dataset only has labels for hair follicle detection, the trained model does not have a good ability to distinguish hair growing from the same pore, which has limitations in counting the length and thickness of long hair. In addition, due to the directional and slender morphological characteristics of hair, even if the traditional target detection frame uses a rectangular frame to frame the entire hair, there will be a large amount of blank information in the frame, even other hair, making the traditional method not fully applicable to such downstream tasks, such as detection. Therefore, a high-efficiency hair image generation method is proposed. Summary of the Invention

[0004] The purpose of the present invention is to address the above-mentioned problems and propose a high-efficiency 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 object, the technical solution adopted by the present invention is:

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

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

[0008] S2. Connect each hair follicle position to the hair whorl position O respectively. The connection vector between the j-th hair follicle position and the hair whorl position O is recorded as Parallel connection vector The angle with the preselected coordinate axis is the initial growth angle of the hair at the jth hair follicle position The preselected coordinate axis is the x-axis or the y-axis;

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

[0010] S4. Simulate the shape and thickness of all hairs and generate hairs according to the offset angles of all hairs to obtain a mask image I mask and labels for all hair;

[0011] S5, mask image I mask and bald head image I bg Perform image fusion to obtain fused image I fusion ;

[0012] S6, 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 , label) into the hair data set, return to step S1, until a preset number of data pairs (I fusion ,I mask ,label), and the hair dataset is used as the hair training set.

[0013] Preferably, the shape and thickness of all hairs are simulated, and hairs are generated according to the offset angles of all hairs to obtain a mask image I mask And the labels for all hair are as follows:

[0014] S41. Establish the shape simulation formula of 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 sampling point abscissa set Sampling point ordinate set Represents the x-axis coordinate value of the k-th sampling point of the i-th hair, represents the y-axis coordinate value of the k-th sampling point of the i-th hair, k = 1, 2, ..., num, num represents the number of sampling points of the i-th hair, and the shape simulation formula of the i-th hair is as follows:

[0015]

[0016] in, represents the shape of the i-th hair, x i Indicates the x-axis coordinate value of the i-th hair, represents the bending frequency of the randomly generated i-th hair, Indicates the bending phase of the randomly generated i-th hair, length i Represents the length of the randomly generated i-th hair;

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

[0018]

[0019] in, Indicates the x-axis coordinate values of all sampling points after the rotation and translation operations are performed on the corresponding hair. Indicates the y-axis coordinate values of all sampling points after the rotation and translation operations are performed on the corresponding hair. That is, the conversion sampling point set of the i-th hair, X T Indicates the transpose of the sampling point horizontal coordinate set X before the rotation and translation operation of the corresponding hair, Y T Represents the transpose of the Y coordinate set of the sampling points before the rotation and translation operation is performed on the corresponding hair. represents the x-axis coordinate value of the root of the i-th hair, represents the y-axis coordinate value of the root of the i-th hair;

[0020] S43. According to the established simulation formula for the thickness of the i-th hair, the widths of all sampling points in the sampling point set of the corresponding hair are obtained to simulate the thickness of the corresponding hair. The simulation formula for the thickness of the i-th hair is as follows:

[0021]

[0022] in, 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 according to the conversion sampling point set of each hair and the width of all sampling points to obtain a mask image I mask And all hair labels.

[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, that is, the fused image I fusion , γ represents a hyperparameter.

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

[0029] Create a grid on the canvas;

[0030] Each intersection point in the grid is used as a reference point, and the position coordinates of the corresponding intersection point are randomly generated using a two-dimensional Gaussian distribution function as the hair follicle position. 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] Taking the center point of the canvas as the reference point, the hair whorl position O is randomly generated using a two-dimensional Gaussian distribution function.

[0032] Preferably, before connecting each hair follicle position to the hair whorl position O, the following operations are further performed:

[0033] Randomly generate a first preset number of hair follicle positions on the canvas to update the number m of hair follicle positions to m+l, where l is the first preset number;

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

[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 The rotation target detection frame, w is equal to the average width of the hair, h is less than or equal to the preset value H lim .

[0037] Compared with the prior art, the present invention has the following beneficial effects:

[0038] This method aims to provide training data for various hair detection models to achieve feature capture and automatic counting of hair quantity and thickness, solving the existing problem of hair detection model training caused by the lack of sufficient labeled data. Specifically, by simulating the actual hair distribution, growth angle, hair shape and thickness changes, and fusing images to generate realistic hair images, it is possible to randomly generate images and their corresponding custom labels according to the natural distribution of hair on the scalp surface. In other words, hair images and precise label information are generated for use by machine learning algorithms, thereby simulating a large amount of available training data. This can be used to promote the optimization of various hair detection models in a supervised learning environment, improve the flexibility and accuracy of hair detection tasks, and is convenient and fast, with a wide range of applications, such as in biomedical imaging, seborrheic alopecia analysis, and personal care product development. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0040] Figure 2 Schematic diagram of the mask image and fused image generated by the present invention;

[0041] Figure 3 Schematic diagram of a real hair image. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts 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 those skilled in the art in the art of this application. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

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

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

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

[0047] Create a grid on the canvas;

[0048] Each intersection point in the grid is used as a reference point, and the position coordinates of the corresponding intersection point are randomly generated using a two-dimensional Gaussian distribution function as the hair follicle position. 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] Taking the center point of the canvas as the reference point, the hair whorl position O is randomly generated using a two-dimensional Gaussian distribution function.

[0050] In one embodiment, before connecting each hair follicle position to the hair whorl position O, the following operations are further performed:

[0051] Randomly generate a first preset number of hair follicle positions on the canvas to update the number m of hair follicle positions to m+l, where l is the first preset number;

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

[0053] Among them, the canvas can be a white canvas. 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 axis and vertical axis of the grid map are respectively parallel to the x-axis and y-axis of the rectangular coordinate system oxy, and the grid is formed with the origin of the rectangular coordinate system oxy as the starting point, or it can be set arbitrarily according to actual needs.

[0054] Specifically, based on general observations and common sense in dermatology, on the same part of the same person, although there is no strict equidistant distribution between hair follicles, the distance between them is usually relatively consistent; therefore, based on the hair follicle distribution density of the real hair dataset, a two-dimensional Gaussian distribution function is used to generate a probability cloud map based on the grid distribution on the canvas (grid density: the number of rows and columns are both between 6-7), so as to randomly generate the initial position of each hair follicle and simulate a non-strictly equidistant distribution. Under normal circumstances, each hair follicle only grows one hair. However, occasionally a hair follicle grows multiple hairs, which is called "multiple follicles" or "multiple hairs". Therefore, this application randomly selects several hair follicle positions based on the hair follicle positions randomly generated by the above-mentioned two-dimensional Gaussian distribution function for marking (the number is a random number between 0-7), indicating that multiple hairs will be generated in the hair follicle position; in addition, a small number of random positions (the number is a random number between 0-8) of hair follicle positions will be 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, and the hair spin position O is Figure 1 Point O in the grid diagram, the hexagonal number indicates the position.

[0055] S2. Connect each hair follicle position to the hair whorl position O respectively. The connection vector between the j-th hair follicle position and the hair whorl position O is recorded as Parallel connection vector The angle with the preselected coordinate axis is the initial growth angle of the hair at the jth hair follicle position The preselected coordinate axis is the x-axis or the y-axis.

[0056] S3. Randomly offset the initial growth angles of all hairs in all hair follicle positions to obtain the offset angle of the i-th hair. Wherein, 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, a random angle offset is applied to its initial growth angle to obtain the offset angle of the corresponding hair. Preferably, the random angle is a random number between -π / 5 and π / 5, and the specific angle can be adjusted based on actual needs.

[0058] S4. Simulate the shape and thickness of all hairs and generate hairs according to the offset angles of all hairs to obtain a mask image I mask And all hair labels.

[0059] In one embodiment, the shape and thickness of all hairs are simulated, and hairs are generated according to the offset angles of all hairs to obtain a mask image I maskAnd the labels for all hair are as follows:

[0060] S41. Establish the shape simulation formula of 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 sampling point abscissa set Sampling point ordinate set Represents the x-axis coordinate value of the k-th sampling point of the i-th hair, represents the y-axis coordinate value of the k-th sampling point of the i-th hair, k = 1, 2, ..., num, num represents the number of sampling points of the i-th hair, and the shape simulation formula of the i-th hair is as follows:

[0061]

[0062] in, represents the shape of the i-th hair, x i Indicates the x-axis coordinate value of the i-th hair, represents the bending frequency of the randomly generated i-th hair, Indicates the bending phase of the randomly generated i-th hair, length i Represents the length of the randomly generated i-th hair;

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

[0064]

[0065] in, Indicates the x-axis coordinate values of all sampling points after the rotation and translation operations are performed on the corresponding hair. Indicates the y-axis coordinate values of all sampling points after the rotation and translation operations are performed on the corresponding hair. That is, the conversion sampling point set of the i-th hair, X T Indicates the transpose of the sampling point horizontal coordinate set X before the rotation and translation operation of the corresponding hair, Y T Represents the transpose of the Y coordinate set of the sampling points before the rotation and translation operation is performed on the corresponding hair. represents the x-axis coordinate value of the root of the i-th hair, represents the y-axis coordinate value of the root of the i-th hair;

[0066] S43. According to the established simulation formula for the thickness of the i-th hair, the widths of all sampling points in the sampling point set of the corresponding hair are obtained to simulate the thickness of the corresponding hair. The simulation formula for the thickness of the i-th hair is as follows:

[0067]

[0068] in, 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 according to the conversion sampling point set of each hair and the width of all sampling points to obtain a mask image I mask And all hair labels.

[0070] The hair root is the location of the hair follicle. The shape of the i-th hair is simulated by the shape simulation formula of the i-th hair, and the sampling point set is obtained after sampling. Represents the num sampling points that make up a hair; finally, the sampling point set is sorted according to the offset angle of the i-th hair Perform rotation and translation to obtain the conversion sampling point set of all hairs. Generate hair according to the conversion sampling point set of each hair and the width of all sampling points. That is, each hair curve is drawn on the white canvas in the form of a black curve with varying thickness. When all hair curves are simulated, a mask image I is obtained. mask (black and white image). At the same time, the labels required for any subsequent hair detection model training are generated at this stage. In this embodiment, Randomly generated by a Gaussian function with a mean of 0.8 and a standard deviation of 0.3, for Random number, length i is a random value in the range of [0.1*meanHW, 0.7neanHW], width0 is a random value in the range of [10*meanHW / 2240, 35*meanHW / 2240], and meanHW = (height of the canvas + width of the canvas) / 2.

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

[0072] In one embodiment, the label is a hair root with a width of w, a length of h, and a rotation angle of The rotation target detection frame, w is equal to the average width of the hair, h is less than or equal to the preset value H lim When the hair length is greater than the preset value H lim After that, the height of the rotation target detection frame is equal to H lim .

[0073] The average width w of the hair may be the average width of all sampling points corresponding to the hair, or may be the average width of the entire generated hair. The setting of the label may also be adjusted according to actual needs.

[0074] S5, mask image I mask and bald head image I bg Perform image fusion 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, that is, the fused image I fusion , γ represents a hyperparameter.

[0078] Among them, the mask image I is fused by image fusion mask (Black and white image) Using the light head image I bg Fill in the background and integrate it into a fusion image close to the real image style I fusion , so that the subsequent hair detection model can better understand the image. In this embodiment, γ=1.5 is taken to determine the degree of mixing of the two images.

[0079] S6, 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 , label) into the hair data set, return to step S1, until a preset number of data pairs (I fusion ,I mask ,label), and the hair dataset is used as the hair training set.

[0080] Specifically, in this embodiment, 2500 data pairs (I fusion ,I mask ,label), such as Figure 2 As shown, the mask image I in two data pairs is shown mask and fused image I fusion ,in, Figure 2 The (a1) and (b1) images in the image correspond to a pair of mask images I mask and fused image I fusion , Figure 2 The (a2) and (b2) images in the figure 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 Figures (a) and (b) are both real hair images. In order to meet the input size requirements of the subsequent hair detection model, the generated mask image I can also be adjusted. mask , fused image I fusion The resolution is set to 1024×1024, for example, 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 feature capture and automatic counting of hair quantity and thickness. It can infinitely generate hair images and customized labels for downstream model training, solving the problem of hair detection model training in the existing technology due to the lack of sufficient labeled data. Specifically, by simulating the actual hair distribution, growth angle, hair shape and thickness changes, and fusing images to generate realistic hair images, it is possible to randomly generate images and their corresponding customized labels according to the natural distribution pattern of hair on the scalp surface. In other words, hair images and accurate label information that can be used by machine learning algorithms are generated, thereby simulating a large amount of available training data. This can be used to promote the optimization of various hair detection models in a supervised learning environment, improve the flexibility and accuracy of hair detection tasks, and is convenient and fast, with a wide range of applications, such as in biomedical imaging, seborrheic alopecia analysis, personal care product development, etc.

[0082] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned 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 above-described embodiments merely represent specific and detailed examples of the present application and should not be construed as limiting the scope of the present application. It should be noted that a person skilled in the art may make various modifications and improvements without departing from the spirit of the present application, and such modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall 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 rectangular coordinate system oxy on the canvas and randomly generate a set of hair follicle positions P and hair whorl positions O based on a two-dimensional Gaussian distribution function, where P = {P1, P2, ..., P j ,…,P m }, P j represents the jth hair follicle position, j = 1, 2…m, m is the number of hair follicle positions; S2. Connect each hair follicle position to the hair whorl position O respectively. The connection vector between the j-th hair follicle position and the hair whorl position O is recorded as Parallel connection vector The angle with the preselected coordinate axis is the initial growth angle of the hair at the jth hair follicle position The preselected coordinate axis is the x-axis or the y-axis; S3. Randomly offset the initial growth angles of all hairs in all hair follicle positions to obtain the offset angle of the i-th hair. Where i = 1, 2, ..., n, n ≥ m, n is the number of hairs; S4. Simulate the shape and thickness of all hairs and generate hairs according to the offset angles of all hairs to obtain a mask image I mask and labels for all hair; S5, mask image I mask and bald head image I bg Perform image fusion to obtain fused image I fusion ; S6, 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 , label) into the hair data set, return to step S1, until a preset number of data pairs (I fusion ,I mask ,label), and the hair dataset is used as the hair training set.

2. The high-efficiency hair image generation method according to claim 1, wherein: 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 And all hair labels, as follows: S41. Establish the shape simulation formula of 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 sampling point abscissa set Sampling point ordinate set Represents the x-axis coordinate value of the k-th sampling point of the i-th hair, represents the y-axis coordinate value of the k-th sampling point of the i-th hair, k=1, 2, ..., num, num represents the number of sampling points of the i-th hair, and the shape simulation formula of the i-th hair is as follows: in, represents the shape of the i-th hair, x i Indicates the x-axis coordinate value of the i-th hair, represents the bending frequency of the randomly generated i-th hair, Indicates the bending phase of the randomly generated i-th hair, length i Represents the length of the randomly generated i-th hair; S42: Perform a rotation and translation operation on the sampling point set corresponding to each hair according to the offset angle of each hair to obtain a transformed sampling point set corresponding to the hair. Then the sampling point set of the i-th hair is The rotation and translation operation formula is as follows: in, Indicates the x-axis coordinate values of all sampling points after the rotation and translation operations are performed on the corresponding hair. Indicates the y-axis coordinate values of all sampling points after the rotation and translation operations are performed on the corresponding hair. That is, the conversion sampling point set of the i-th hair, X T Indicates the transpose of the sampling point horizontal coordinate set X before the rotation and translation operation of the corresponding hair, Y T Represents the transpose of the Y coordinate set of the sampling points before the rotation and translation operation is performed on the corresponding hair. represents the x-axis coordinate value of the root of the i-th hair, represents the y-axis coordinate value of the root of the i-th hair; S43. According to the established simulation formula for the thickness of the i-th hair, the widths of all sampling points in the sampling point set of the corresponding hair are obtained to simulate the thickness of the corresponding hair. The simulation formula for the thickness of the i-th hair is as follows: in, 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; S44: Generate hair according to the conversion sampling point set of each hair and the width of all sampling points to obtain a mask image I mask And all hair labels.

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

4. The high-efficiency hair image generation method according to claim 1, wherein: The image fusion formula is as follows: Among them, I fusion (·) represents the image fusion output result, that is, the fused image I fusion , γ represents a hyperparameter.

5. The high-efficiency hair image generation method according to claim 1, wherein: The hair follicle position set P and hair whorl position O are obtained as follows: Create a grid on the canvas; Each intersection point in the grid is used as a reference point, and the position coordinates of the corresponding intersection point are randomly generated using a two-dimensional Gaussian distribution function as the hair follicle position. All hair follicle positions together form a hair follicle position set P, and the reference point is the center point of the two-dimensional Gaussian distribution function; Taking the center point of the canvas as the reference point, the hair whorl position O is randomly generated using a two-dimensional Gaussian distribution function.

6. The high-efficiency hair image generation method according to claim 1, wherein: Before connecting each hair follicle position to the hair whorl position O, the following operations are performed: Randomly generate a first preset number of hair follicle positions on the canvas to update the number m of hair follicle positions to m+l, where l is the first preset number; The number of hairs at each follicle position is at least one. When there are multiple hairs at the corresponding follicle position, a second preset number of follicle positions are randomly selected from the follicle position set P and marked, indicating that multiple hairs are generated at the marked follicle positions.

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

8. The high-efficiency hair image generation method according to claim 1, wherein: The label is w in width, h in length and has a rotation angle of The rotation target detection frame, w is equal to the average width of the hair, h is less than or equal to the 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

  • Hair diameter measuring and calculating method based on deep learning and digital image processing

    CN116245785A

  • Processing method and device based on scalp image data

    CN119251173A

  • Planning method and system for hair follicle extraction path, and storage medium

    WO2025002472A1