Method and device for determining number of hair roots in hair root area

Through scalp image processing technology, the number of hair roots in the hair root area is determined, which solves the time-consuming and labor-intensive and inaccurate problems of hair root number evaluation in the prior art, and achieves accurate and efficient measurement of hair root number.

CN119151848APending Publication Date: 2024-12-17BEIJING JINGDONG TUOXIAN TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202310708569.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-15
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

In the prior art, doctors use hair lenses to observe the number of hair roots and are not accurate enough, making it difficult to accurately determine the number of hair roots in the hair root area, affecting the accuracy of hair health assessment.

Method used

By acquiring scalp images, multiple detection angles and angle connections are determined, and the detection angles are combined according to the proportion of hair pixel points on the angle connections to form an angle set, and the number of angle sets is calculated to determine the number of hair roots in the hair root area.

Benefits of technology

This method can reduce the workload of doctors, accurately and efficiently determine the number of hair roots in the hair root area, and improve the accuracy of hair health assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119151848A_ABST
    Figure CN119151848A_ABST
Patent Text Reader

Abstract

The invention discloses a method and device for determining the number of hair roots in a hair root area, and relates to the technical field of skin health. A specific embodiment of the method comprises the steps of obtaining a scalp image, wherein the scalp image comprises a target hair root area; determining a plurality of detection angles; aiming at each detection angle, determining an angle connecting line corresponding to the detection angle; determining the detection angle as a hair extension angle in response to the condition that the proportion of the hair pixel points on the angle connecting line is greater than a proportion threshold value; determining at least one angle set in response to existence of a plurality of detection angles which are hair extension angles; wherein the angle set comprises a plurality of continuous detection angles, and each detection angle in the angle set is a hair extension angle; and determining the number of hair roots in the target hair root area according to the number of the angle sets. According to the embodiment, the workload of doctors can be relieved, and the number of hair roots in the hair root area can be accurately determined.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of skin health, and in particular to a method and device for determining the number of hair roots in a hair root area. Background Art

[0002] Hair diseases are common diseases in dermatology clinics. Clinical indicators such as the density and diameter of a patient's hair are important bases for doctors' clinical treatment. In order to obtain the density and diameter of a patient's hair, it is usually necessary to first obtain the number of hair roots growing in the hair root area of ​​the patient's head. In addition, the number of hair roots growing in the hair root area of ​​the patient's head often represents the health of the patient's hair. In the prior art, doctors usually determine the number of hair roots growing in the hair root area of ​​a patient through observation with a trichoscope, which is time-consuming, labor-intensive, and inaccurate. Summary of the invention

[0003] In view of this, an embodiment of the present invention provides a method and device for determining the number of hair roots in a hair root area, which can reduce the workload of doctors and accurately determine the number of hair roots in a hair root area.

[0004] In a first aspect, an embodiment of the present invention provides a method for determining the number of hair roots in a hair root area, comprising:

[0005] Acquire a scalp image, wherein the scalp image includes: a target hair root area;

[0006] Determine multiple detection angles;

[0007] For each of the detection angles, determine an angle line corresponding to the detection angle; in response to a proportion of hair pixel points on the angle line being greater than a proportion threshold, determine the detection angle as a hair extension angle; wherein the angle between the angle line and the reference line is the detection angle, and both the angle line and the reference line pass through the target hair root area;

[0008] In response to the presence of multiple detection angles being hair extension angles, determining at least one angle set; wherein the angle set includes multiple continuous detection angles, and each detection angle in the angle set is a hair extension angle;

[0009] The number of hair roots in the target hair root area is determined according to the number of the angle sets.

[0010] Optionally, after acquiring the scalp image, the method further includes:

[0011] Binarization is performed on the scalp image so that hair pixels and scalp pixels correspond to different pixel values ​​respectively;

[0012] Before determining the detected angle as the hair extension angle in response to the proportion of hair pixels on the angle line being greater than a proportion threshold, the method further includes:

[0013] Obtain each pixel point on the angle line;

[0014] Determining a hair pixel among the pixels according to the pixel values ​​of the pixels;

[0015] Determine the proportion of hair pixels on the angle line.

[0016] Optionally, determining the number of hair roots in the target hair root area according to the number of the angle sets includes:

[0017] In response to the number of the angle sets being greater than 1, determining whether there is an angle set corresponding to penetrating hair in the at least one angle set;

[0018] In response to the existence of an angle set corresponding to the penetrating hair, deleting the angle set corresponding to the penetrating hair from the at least one angle set;

[0019] The number of remaining angle sets is determined as the number of hair roots in the target hair root area.

[0020] Optionally, the determining whether there is an angle set corresponding to penetrating hair in the at least one angle set includes:

[0021] Determining a first angle set and a second angle set from the at least one angle set;

[0022] Determine the set angles corresponding to the first angle set and the second angle set respectively;

[0023] Calculating a set angle difference between the first angle set and the second angle set;

[0024] In response to the set angle difference being within the angle difference range, it is determined that both the first angle set and the second angle set are angle sets corresponding to penetrating hair.

[0025] Optionally, determining the angle line corresponding to the detection angle includes:

[0026] Determine a target area from the scalp image, wherein the target area includes: the target hair root area;

[0027] Determining an edge point corresponding to the detection angle from the edge of the target area;

[0028] The line connecting the target hair root area and the edge point is determined as the angle line corresponding to the detection angle.

[0029] Optionally, determining a plurality of detection angles includes:

[0030] In the angle range from 0 to 360 degrees, a plurality of detection angles are acquired in sequence with a preset angle as a step length.

[0031] In a second aspect, an embodiment of the present invention provides a method for determining hair diameter, comprising:

[0032] Acquire a scalp image, wherein the scalp image includes: a target hair root area;

[0033] Using the method for determining the number of hair roots in a hair root area described in any of the above embodiments, at least one angle set corresponding to the target hair root area is determined;

[0034] Determine a target angle set from the at least one angle set, and determine that the target angle set corresponds to the target hair in the target hair root area;

[0035] Determining a hair extension direction corresponding to the target hair according to each detection angle in the target angle set;

[0036] Determining the extension point of the target hair according to the extension direction of the hair;

[0037] Determine at least one detection point from the line connecting the target hair root area to the extension point;

[0038] For each of the detection points, according to the extension direction, determine the hair diameter corresponding to the detection point;

[0039] The hair diameter corresponding to the target hair is determined according to the hair diameter corresponding to each of the detection points.

[0040] Optionally, determining the hair diameter corresponding to the detection point according to the extension direction includes:

[0041] Determine the pixel length of the vertical line segment corresponding to the detection point; wherein the vertical line segment passes through the detection point and is perpendicular to the extension direction, and each pixel point on the vertical line segment is a hair pixel point;

[0042] The hair diameter corresponding to the detection point is determined according to the pixel length of the vertical line segment.

[0043] In a third aspect, an embodiment of the present invention provides a method for determining the number of hair roots in a hair root area, comprising:

[0044] Acquire scalp images;

[0045] identifying at least one hair root region included in the scalp image;

[0046] Using the method for determining the number of hair roots in the hair root area described in any of the above embodiments, the number of hair roots in each of the hair root areas is obtained respectively;

[0047] The hair density corresponding to the scalp image is determined according to the number of hair roots in each of the hair root areas, the pixel area of ​​the scalp image and the pixel ratio parameter of the scalp image.

[0048] In a fourth aspect, an embodiment of the present invention provides a device for determining the number of hair roots in a hair root area, comprising:

[0049] An image acquisition module is used to acquire a scalp image, wherein the scalp image includes: a target hair root area;

[0050] An angle determination module, used for determining a plurality of detection angles;

[0051] A detection module, for determining, for each detection angle, an angle line corresponding to the detection angle; in response to a proportion of hair pixel points on the angle line being greater than a proportion threshold, determining the detection angle as a hair extension angle; wherein the angle between the angle line and a reference line is the detection angle, and both the angle line and the reference line pass through the target hair root area;

[0052] A set determination module, used to determine at least one angle set; wherein the angle set includes a plurality of continuous detection angles, and each detection angle in the angle set is a hair extension angle;

[0053] The hair root number determination module is used to determine the number of hair roots in the target hair root area according to the number of the angle sets.

[0054] Optionally, it also includes:

[0055] A processing module, used for performing binarization processing on the scalp image so that hair pixels and scalp pixels correspond to different pixel values ​​respectively;

[0056] The detection module is specifically used for:

[0057] Obtain each pixel point on the angle line;

[0058] Determining a hair pixel among the pixels according to the pixel values ​​of the pixels;

[0059] The proportion of hair pixels on the angle line is determined.

[0060] Optionally, the root number determination module is specifically used to:

[0061] In response to the number of the angle sets being greater than 1, determining whether there is an angle set corresponding to penetrating hair in the at least one angle set;

[0062] In response to the existence of an angle set corresponding to the penetrating hair, deleting the angle set corresponding to the penetrating hair from the at least one angle set;

[0063] The number of remaining angle sets is determined as the number of hair roots in the target hair root area.

[0064] Optionally, the root number determination module is specifically used to:

[0065] Determining a first angle set and a second angle set from the at least one angle set;

[0066] Determine the set angles corresponding to the first angle set and the second angle set respectively;

[0067] Calculating a set angle difference between the first angle set and the second angle set;

[0068] In response to the set angle difference being within the angle difference range, it is determined that both the first angle set and the second angle set are angle sets corresponding to penetrating hair.

[0069] Optionally, the detection module is specifically used to:

[0070] Determine a target area from the scalp image, wherein the target area includes: the target hair root area;

[0071] Determining an edge point corresponding to the detection angle from the edge of the target area;

[0072] The line connecting the target hair root area and the edge point is determined as the angle line corresponding to the detection angle.

[0073] Optionally, the angle determination module is specifically used to:

[0074] In the angle range from 0 to 360 degrees, a plurality of detection angles are acquired in sequence with a preset angle as a step length.

[0075] In a fifth aspect, an embodiment of the present invention provides a device for determining hair diameter, comprising:

[0076] An image acquisition module is used to acquire a scalp image, wherein the scalp image includes: a target hair root area;

[0077] A set determination module, configured to determine at least one angle set corresponding to the target hair root area by using the method for determining the number of hair roots in the hair root area described in any of the above embodiments;

[0078] A hair determination module, configured to determine a target angle set from the at least one angle set, and determine that the target angle set corresponds to target hair in the target hair root area;

[0079] a direction determination module, used to determine the hair extension direction corresponding to the target hair according to each detection angle in the target angle set;

[0080] An extension point determination module is used to determine the extension point of the target hair according to the extension direction of the hair; and to determine at least one detection point from the line connecting the target hair root to the extension point;

[0081] The diameter determination module is used to determine the hair diameter corresponding to each detection point according to the extension direction; and determine the hair diameter corresponding to the target hair according to the hair diameter corresponding to each detection point.

[0082] Optionally, the diameter determination module is specifically used to:

[0083] Determine the pixel length of the vertical line segment corresponding to the detection point; wherein the vertical line segment passes through the detection point and is perpendicular to the extension direction, and each pixel point on the vertical line segment is a hair pixel point;

[0084] The hair diameter corresponding to the detection point is determined according to the pixel length of the vertical line segment.

[0085] In a sixth aspect, an embodiment of the present invention provides a device for determining hair density, comprising:

[0086] An image acquisition module, used for acquiring a scalp image;

[0087] a hair root recognition module, configured to recognize at least one hair root region included in the scalp image;

[0088] A hair root number determination module, configured to obtain the number of hair roots in each hair root area by using the method for determining the number of hair roots in the hair root area described in any of the above embodiments;

[0089] The density determination module is used to determine the hair density corresponding to the scalp image according to the number of hair roots in each of the hair root areas, the pixel area of ​​the scalp image and the pixel ratio parameter of the scalp image.

[0090] In a seventh aspect, an embodiment of the present invention provides an electronic device, including:

[0091] one or more processors;

[0092] a storage device for storing one or more programs,

[0093] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the above embodiments.

[0094] In an eighth aspect, an embodiment of the present invention provides a computer-readable medium having a computer program stored thereon, and when the program is executed by a processor, the method described in any of the above embodiments is implemented.

[0095] An embodiment of the above invention has the following advantages or beneficial effects: when the scalp image has a large magnification, a hair appears as a rectangular area. Each hair growing in the target hair root area can correspond to a group of adjacent angle lines passing through the target hair root area, and each angle line has a high proportion of hair pixels. An angle line corresponds to a detection angle, and a group of adjacent angle lines corresponds to an angle set, and the angle set includes multiple continuous detection angles. Therefore, the number of hair roots in the target hair root area can be determined by the number of angle sets.

[0096] The solution of the embodiment of the present invention first sets multiple detection angles, then determines the angle lines corresponding to the detection angles, and selects the angle lines with a higher hair pixel ratio. The detection angles of the angle lines with a higher hair pixel ratio are merged to obtain at least one angle set. Finally, the number of hair roots in the target hair root area is determined based on the number of angle sets. This solution can reduce the workload of doctors and accurately determine the number of hair roots in the hair root area.

[0097] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0098] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0099] Figure 1 is a schematic diagram of a process of a method for determining the number of hair roots in a hair root area provided by an embodiment of the present invention;

[0100] Figure 2 is a schematic diagram of a hair root area detection result provided by an embodiment of the present invention;

[0101] Figure 3 is a schematic diagram of a target area centered on a target hair root area provided by an embodiment of the present invention;

[0102] Figure 4 is a schematic diagram of a penetrating hair provided by an embodiment of the present invention;

[0103] Figure 5is a schematic diagram of a process of a method for determining hair diameter provided by an embodiment of the present invention;

[0104] Figure 6 is a schematic diagram of a hair diameter determination principle provided by an embodiment of the present invention;

[0105] Figure 7 is a schematic diagram of a process of a method for determining hair density provided by another embodiment of the present invention;

[0106] Figure 8 It is a schematic structural diagram of a device for determining the number of hair roots in a hair root area provided by an embodiment of the present invention;

[0107] Fig. 9 is a schematic structural diagram of a device for determining hair diameter provided by an embodiment of the present invention;

[0108] Fig.10 is a structural schematic diagram of a device for determining hair density provided by another embodiment of the present invention;

[0109] Fig.11 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0110] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0111] It should be noted that the acquisition, storage, use, and processing of data in the technical solutions of the embodiments of the present invention are in compliance with the relevant provisions of national laws and regulations.

[0112] Figure 1 FIG. 1 is a schematic diagram of a process of determining the number of hair roots in a hair root area provided by an embodiment of the present invention. Figure 1 As shown, the method includes:

[0113] Step 101: Acquire a scalp image, where the scalp image includes a target hair root area.

[0114] First, obtain a scalp image. Select a less obstructed area in the scalp image to perform hair root detection. Specifically, a faster-RCNN model can be used to train a hair root detector, and the hair root detector can be used to perform hair root detection. Figure 2FIG. 1 is a schematic diagram of a hair root area detection result provided by an embodiment of the present invention. Figure 2 As shown, for a scalp area with little occlusion, the position of the hair root area can be better identified. During the hair root area detection process, the same hair root area may correspond to multiple detection positions, and the detection positions with a high degree of overlap can be merged.

[0115] After the rooting area detection is completed, the target rooting area can be manually determined from the detected rooting area, or the target rooting area can be randomly selected by the system.

[0116] Step 102: Determine multiple detection angles.

[0117] From the angle range of 0 to 360 degrees, multiple detection angles are acquired in sequence with the preset angle as the step length. The preset angle can be determined according to the pixel ratio parameter of the scalp image, the detection accuracy, etc. The preset angle can be 0.1 degree, 0.5 degree, 1 degree, etc.

[0118] Step 103: for each detection angle, determine an angle line corresponding to the detection angle; in response to a proportion of hair pixels on the angle line being greater than a proportion threshold, determine the detection angle as a hair extension angle.

[0119] The reference line passes through the target hair root area, and the direction of the reference line can be set according to the needs. For the convenience of explanation, the direction passing through the target hair root area and horizontally to the right in the scalp image can be set as the direction of the reference line, and the counterclockwise direction can be set as the angle adjustment direction.

[0120] Choose any point in the direction of the baseline, and use the line connecting the target hair root area and the point as the baseline. With the target hair root area as the axis, rotate the baseline counterclockwise to various detection angles to obtain multiple angle lines. Among them, the angle between the angle line corresponding to the detection angle and the baseline is the detection angle.

[0121] Alternatively, any point may be selected in the direction corresponding to each detection angle, and the line connecting the target hair root area and the point is used as the angle line, so that the angle between the angle line corresponding to the detection angle and the reference line is the detection angle.

[0122] A target area can also be determined from the scalp image, the target area including: a target hair root area; an edge point corresponding to the detection angle is determined from the edge of the target area; and a line connecting the target hair root area and the edge point is determined as an angle line corresponding to the detection angle.

[0123] The target area is a regular shape with the target hair root area as the center. The target area can be a circle, an ellipse, an octagon, etc. with the target hair root area as the center. From the edge of the target area, an edge point corresponding to the detection angle is determined; the line between the target hair root area and the edge point is determined as the angle line corresponding to the detection angle. The angle between the angle line and the reference line is the detection angle.

[0124] Figure 3 FIG. 1 is a schematic diagram of a target area centered on a target hair root area provided by an embodiment of the present invention. Figure 3 As shown, the small circle in the middle corresponds to the detection position of the target hair root area, and the large circle is the target area. The center of the target area is located as the center of the target hair root area. Figure 3 The line segments numbered 1, 2, and 3 are angle lines corresponding to different detection angles.

[0125] In one embodiment of the present invention, after acquiring the scalp image, the method further includes: binarizing the scalp image so that the hair pixels and the scalp pixels correspond to different pixel values. In response to the proportion of hair pixels on the angle line of the edge point being greater than the proportion threshold, before determining the detection angle as the hair extension angle, the method further includes: acquiring each pixel on the angle line; determining the hair pixel among each pixel according to the pixel value of each pixel; and determining the proportion of hair pixels on the angle line.

[0126] In order to determine whether each pixel on the angle line is a hair pixel, the scalp image must be binarized first to obtain a picture after the hair and scalp background are segmented. For example, the pixel value of the hair pixel is 0, and the pixel value of the scalp pixel is 1. Or, the pixel value of the hair pixel is 1, and the pixel value of the scalp pixel is 0, etc.

[0127] The proportion threshold can be set according to business needs, such as 0.8, 0.85, etc. If the proportion of hair pixels on the angle line of the edge point is greater than the proportion threshold, the edge point may correspond to a hair from the target hair root area, and the detection angle is determined as the hair extension angle.

[0128] Step 104: In response to the presence of multiple detection angles being hair extension angles, determining at least one angle set; wherein the angle set includes multiple continuous detection angles, and each detection angle in the angle set is a hair extension angle.

[0129] The multiple detection angles corresponding to the hair extension angle are divided into at least one angle set, each angle set including multiple continuous detection angles. The continuous detection angles are related to the step length of the detection angle. If the step length is 0.5 degrees, then 0.5 degrees, 1 degree, 1.5 degrees, 2 degrees, etc. are continuous detection angles. If the step length is 1 degree, then 11 degrees, 12 degrees, 13 degrees, 14 degrees, 15 degrees, etc. are continuous detection angles.

[0130] like Figure 3 In the target area shown, the direction through the target hair root area and horizontally to the right is set as the direction of the baseline. The counterclockwise direction is set as the angle adjustment direction. The step length is set to 1 degree. The detection angles are 0 degrees, 1 degree, 2 degrees, ..., 358 degrees and 359 degrees. Determine the angle line corresponding to each detection angle, and the angle between the angle line and the baseline is the detection angle.

[0131] Determine the proportion of hair pixels corresponding to each angle connection. Set the proportion threshold to 0.8, and the angle connection with hair pixels exceeding 0.8 corresponds to the detection angles of 117 degrees, 118 degrees, 119 degrees, 120 degrees, 121 degrees, 136 degrees, 137 degrees, 138 degrees, 139 degrees and 140 degrees. The above detection angles are all hair extension angles. Combine the above detection angles to get two angle sets: 117 degrees - 121 degrees, and 136 degrees - 140 degrees. Among them, 117 degrees - 121 degrees corresponds to Figure 3 For the hair on the right side of the target hair root, 136 degrees to 140 degrees corresponds to Figure 3 The hair on the left side of the target hair root. Figure 3 The number of hair roots extending from the target hair root is 2.

[0132] Step 105: Determine the number of hair roots in the target hair root area according to the number of angle sets.

[0133] If there are not multiple detected angles that are hair extension angles, or the number of angle sets is 0, it is determined that the number of hair roots in the target hair root area is 0, that is, there is no hair in the target hair root area.

[0134] If the number of angle sets is greater than 0, the number of angle sets can be used as the number of hair roots in the target hair root area. Alternatively, the number of angle sets minus the number of angle sets of penetrating hair can be used to obtain the number of hair roots in the target hair root area.

[0135] In an embodiment of the present invention, the target area is a regular pattern centered on the target hair root area. When the target area has a large magnification, each hair growing in the target hair root area may correspond to an angle set, which includes multiple continuous detection angles, and each detection angle corresponds to an angle line with a higher proportion of hair pixels. The solution of the embodiment of the present invention determines at least one angle set by determining the angle line with a higher proportion of hair pixels, and then determines the number of hair roots in the target hair root area according to the number of angle sets. It can reduce the workload of doctors and accurately determine the number of hair roots in the hair root area.

[0136] The embodiment of the present invention further provides a method for determining the number of hair roots in a target hair root area, the method using an arc scanning method to calculate the number of hair roots in the target area, the method comprising:

[0137] S01: Binarize the scalp image to obtain a picture after the hair and scalp background are segmented. The pixel value corresponding to the hair area is 0, and the pixel value corresponding to the scalp area is 1.

[0138] S02: Draw a circle with the target hair root area as the center as the target area. Use 0 to 359 degrees as the detection angle, and calculate the proportion of pixels with a pixel value of 0 on each angle line. The angle line is the radius line segment from the center of the circle to the edge of the target area. For example, Figure 3 The detection angle of the edge segment with number 1 is 85 degrees, and the proportion of pixels with a pixel value of 0 is 0.05, that is, f(85) = 0.05. The detection angle of the edge segment with number 2 is 117 degrees, and the proportion of pixels with a pixel value of 0 is 1, that is, f(117) = 1. The detection angle of the edge segment with number 3 is 139 degrees, and the proportion of pixels with a pixel value of 0 is 1, that is, f(139) = 1.

[0139] S03: Set the ratio threshold to 0.8. The ratio threshold is not set to 1 because the hair is reflective and has a certain curvature, so there may be pixels with a pixel value of 1 on the angle line corresponding to the hair. Find x∈{0,1,…,359 so that f(x)≥0.85, and get the extension direction degree set R.

[0140] S04: Merge the continuous detected angles in R to obtain an angle set. The number of angle sets is the number of hairs extending from the target hair root. Figure 3 As shown, through the method of the embodiment of the present invention, two angle sets can be obtained: 117 degrees to 121 degrees, and 136 degrees to 140 degrees. It should be noted that in the process of detecting angle merging, 359 degrees and 0 degrees are counted as continuous detecting angles.

[0141] In one embodiment of the present invention, determining the number of hair roots in the target hair root area according to the number of angle sets includes: in response to the number of angle sets being greater than 1, determining whether there is an angle set corresponding to the penetrating hair in at least one angle set; in response to the existence of the angle set corresponding to the penetrating hair, deleting the angle set corresponding to the penetrating hair from at least one angle set; and determining the number of remaining angle sets as the number of hair roots in the target hair root area.

[0142] If the hair in other hair root areas passes through the target hair root area, the hair in other hair root areas is the penetrating hair of the target hair root area. The penetrating hair will cause the detection of redundant hair. Figure 4 FIG. 1 is a schematic diagram of a penetrating hair provided by an embodiment of the present invention. Figure 4 As shown, the small circle in the middle corresponds to the detection position of the target hair root area, and the large circle is the target area. It can be seen that only one hair comes from the target hair root area, but three hairs will be detected using the method of the embodiment of the present invention. One penetrating hair may be mistakenly detected as two hairs from the target hair root area, and the total number of hairs in the target hair root area should be reduced by 2.

[0143] In one embodiment of the present invention, determining whether there is an angle set corresponding to penetrating hair in at least one angle set includes: determining a first angle set and a second angle set from the at least one angle set; respectively determining set angles corresponding to the first angle set and the second angle set; calculating a set angle difference between the first angle set and the second angle set; and in response to the set angle difference being within an angle difference range, determining that both the first angle set and the second angle set are angle sets corresponding to penetrating hair.

[0144] From at least one angle set, two angle sets are arbitrarily determined: a first angle set and a second angle set. The set angle of the second angle set is greater than the set angle of the first angle set. The mean or median of each detection angle in the first angle set can be used as the set angle of the first angle set. Similarly, the mean or median of each detection angle in the second angle set can be used as the set angle of the second angle set. The set angle of the second angle set is subtracted from the set angle of the first angle set to obtain the set angle difference between the first angle set and the second angle.

[0145] The angle difference range is an angle range centered at 180 degrees, and the angle difference range can be 178.5 degrees-181.5 degrees, 175 degrees-185 degrees, etc. Figure 4As shown, the angle difference between the first angle set and the second angle set corresponding to the penetrating hair is close to 180 degrees. The solution of the embodiment of the present invention introduces a ray detection mechanism, and if there are two angle sets whose set angles differ by about 180 degrees, the hair corresponding to the two angle sets will be identified as the penetrating hair of the target hair root.

[0146] Figure 5 FIG. 1 is a schematic diagram of a process of determining a hair diameter provided by an embodiment of the present invention. Figure 5 As shown, the method includes:

[0147] Step 501: Acquire a scalp image, where the scalp image includes a target hair root area.

[0148] Step 502: Determine at least one angle set corresponding to the target hair root area.

[0149] By using the method for determining the number of hair roots in the hair root area provided by any embodiment of the present invention, at least one angle set corresponding to the target hair root area is determined. Each angle set corresponds to a hair from the target hair root area.

[0150] Step 503: Determine a target angle set from at least one angle set, and determine that the target angle set corresponds to target hair from a target hair root area.

[0151] The target angle set may be determined randomly from at least one angle set or according to a user's selection operation.

[0152] Step 504: Determine the hair extension direction corresponding to the target hair according to each detection angle in the target angle set.

[0153] The mean or median of each detection angle in the target angle set can be used as the hair extension direction corresponding to the target hair. For example, the direction in the target area that passes through the target hair root and is horizontally to the right can be set as the direction of the baseline. The counterclockwise direction is set as the angle adjustment direction. The target angle set includes: 117 degrees, 118 degrees, 119 degrees, 120 degrees, and 121 degrees. Then the hair extension direction can be (117+123) / 2=120 degrees, that is, the hair extension direction is the direction of rotating the baseline 120 degrees counterclockwise.

[0154] Step 505: Determine the extension point of the target hair according to the extension direction of the hair; and determine at least one detection point from the line connecting the target hair root to the extension point.

[0155] At least one detection point can be randomly selected from the line connecting the target hair root area to the extension point. At least one detection point can also be selected from the line connecting the target hair root area to the extension point at a preset length interval.

[0156] Step 506: For each detection point, determine the hair diameter corresponding to the detection point according to the extension direction.

[0157] The pixel length of the vertical line segment corresponding to the detection point is determined; wherein the vertical line segment passes through the detection point and is perpendicular to the extension direction, and each pixel point on the vertical line segment is a hair pixel point; according to the pixel length of the vertical line segment, the hair diameter corresponding to the detection point is determined.

[0158] The pixel length is the number of pixels. If the pixel length of the vertical line segment corresponding to the detection point is N, that is, there are N pixels on the vertical line segment, then the hair diameter corresponding to the detection point is X*N. X is the pixel ratio parameter of the scalp image. The pixel ratio parameter is the ratio of the actual size to the pixel size of the captured image. The unit of the pixel ratio parameter can be micrometer / pixel.

[0159] Figure 6 FIG. 1 is a schematic diagram of a hair diameter determination principle provided by an embodiment of the present invention. Figure 6 As shown in the figure, the arrow direction is the hair extension direction of the target hair. The hair in the target hair root area is divided into K segments at equal intervals to obtain K detection points, where K is a positive integer. The pixel length of the vertical line segment of each detection point is calculated. Each vertical line segment is perpendicular to the hair extension direction, and the pixel points on the vertical line segment are all 0, where 0 is the pixel value of the hair pixel point.

[0160] Step 507: Determine the hair diameter corresponding to the target hair according to the hair diameter corresponding to each detection point.

[0161] The mean, median and mode of the hair diameters corresponding to each detection point can be used as the hair diameter corresponding to the target hair. Some vertical line segments may not be the diameter of a single hair, but may be affected by other hairs, causing the diameter of a single hair to be larger than the actual diameter. Therefore, using the mean, median and mode of the hair diameters corresponding to the detection points as the final single hair diameter can improve the accuracy of detection.

[0162] In the embodiment of the present invention, a target angle set corresponding to a target hair root region is determined, and it is determined that the target angle set corresponds to a target hair from the target hair root region. According to each detection angle in the target angle set, the hair extension direction corresponding to the target hair is determined. The diameters of multiple detection points are calculated in a direction perpendicular to the hair extension direction, so as to accurately detect the diameter of the target hair.

[0163] Figure 7FIG. 1 is a schematic diagram of a process of determining hair density provided by another embodiment of the present invention. Figure 7 As shown, the method includes:

[0164] Step 701: Acquire a scalp image.

[0165] Use the image acquisition device to place it close to the scalp of the target area, adjust the brightness and magnification, and take a clear scalp image. The pixel ratio parameter of the scalp image can be obtained by the magnification, field of view size, and resolution of the captured image. The pixel ratio parameter is the ratio of the actual size to the pixel size of the captured image. The unit of the pixel ratio parameter can be micrometer / pixel.

[0166] Step 702: Identify at least one hair root region included in the scalp image.

[0167] Step 703: Obtain the number of hair roots in each hair root area respectively.

[0168] The method for determining the number of hair roots in the hair root area provided by any embodiment of the present invention is used to obtain the number of hair roots in each hair root area.

[0169] Step 704: Determine the hair density corresponding to the scalp image according to the number of hair roots in each hair root area, the pixel area of ​​the scalp image, and the pixel ratio parameter of the scalp image.

[0170] If the total number of hair roots in each root area is N, the pixel area of ​​the scalp image is S, and the pixel ratio parameter is X, then the final hair density is NX 2 / S.

[0171] In the embodiment of the present invention, the method for determining the number of hair roots in the hair root area is used to obtain the number of hair roots in each hair root area, and then accurately evaluate the hair density corresponding to the scalp image, thereby enhancing the accuracy and robustness of the calculation.

[0172] The embodiment of the present invention also provides a method for identifying a less-occluded area. The less-occluded area is an area in the scalp image where the hair roots can be clearly identified. Based on the less-occluded area, the hair diameter and density and other indicators are detected, which can improve the reliability and accuracy of the final measurement result.

[0173] The scalp image can be divided into M*L sub-regions, where M and L are both positive integers. The following indicators are obtained for each sub-region: the number of hair roots detected, the average confidence of the hair root detection frame, the proportion of non-hair areas after the image is binarized, etc. The weighted sum of the above indicators for each sub-region is calculated respectively, and several sub-regions with the largest weighted sum are selected as candidate regions. Connect and merge the candidate regions to obtain the less occluded region.

[0174] Figure 8 FIG. 1 is a schematic diagram of a device for determining the number of hair roots in a hair root area according to an embodiment of the present invention. Figure 8 As shown, the device comprises:

[0175] The image acquisition module 801 is used to acquire a scalp image, wherein the scalp image includes: a target area, and the target area includes: a target hair root area;

[0176] An angle determination module 802, used to determine multiple detection angles;

[0177] The detection module 803 is used to determine, for each detection angle, an angle line corresponding to the detection angle; in response to a proportion of hair pixel points on the angle line being greater than a proportion threshold, determine the detection angle as a hair extension angle; wherein the angle between the angle line and the reference line is the detection angle, and both the angle line and the reference line pass through a target hair root area;

[0178] A set determination module 804 is used to determine at least one angle set; wherein the angle set includes a plurality of continuous detection angles, and each detection angle in the angle set is a hair extension angle;

[0179] The hair root number determination module 805 is used to determine the number of hair roots in the target hair root area according to the number of angle sets.

[0180] Optionally, it also includes:

[0181] A processing module 806 is used to perform binarization processing on the scalp image so that the hair pixels and the scalp pixels correspond to different pixel values ​​respectively;

[0182] The detection module 803 is specifically used for:

[0183] Get each pixel point on the angle line;

[0184] Determine the hair pixel among the pixels according to the pixel value of each pixel;

[0185] Determine the ratio of hair pixels on the angle line.

[0186] Optionally, the root number determination module 805 is specifically used for:

[0187] In response to the number of angle sets being greater than 1, determining whether there is an angle set corresponding to penetrating hair in at least one angle set;

[0188] In response to the existence of an angle set corresponding to the penetrating hair, deleting the angle set corresponding to the penetrating hair from at least one angle set;

[0189] The number of remaining angle sets is determined as the number of hair roots in the target hair root area.

[0190] Optionally, the root number determination module 805 is specifically used for:

[0191] Determining a first angle set and a second angle set from at least one angle set;

[0192] Determine the set angles corresponding to the first angle set and the second angle set respectively;

[0193] Calculating a set angle difference between a first angle set and a second angle set;

[0194] In response to the set angle difference being within the angle difference range, it is determined that both the first angle set and the second angle set are angle sets corresponding to penetrating hair.

[0195] Optionally, the detection module 803 is specifically used for:

[0196] Determine a target area from the scalp image, the target area includes: a target hair root area;

[0197] From the edge of the target area, determine the edge point corresponding to the detection angle;

[0198] The line connecting the target hair root area and the edge point is determined as the angle line corresponding to the detection angle.

[0199] Optionally, the angle determination module 805 is specifically configured to:

[0200] From the angle range of 0 degrees to 360 degrees, multiple detection angles are acquired in sequence with the preset angle as the step length.

[0201] Fig. 9 FIG. 1 is a schematic diagram of a device for determining hair diameter provided by an embodiment of the present invention. Fig. 9 As shown, the device comprises:

[0202] The image acquisition module 901 is used to acquire a scalp image, wherein the scalp image includes: a target hair root area;

[0203] A set determination module 902 is used to determine at least one angle set corresponding to a target hair root area by using the method for determining the number of hair roots in a hair root area of ​​any of the above embodiments;

[0204] The hair determination module 903 is used to determine a target angle set from at least one angle set, and determine that the target angle set corresponds to target hair from a target hair root area;

[0205] A direction determination module 904, for determining a hair extension direction corresponding to the target hair according to each detection angle in the target angle set;

[0206] The extension point determination module 905 is used to determine the extension point of the target hair according to the extension direction of the hair; and determine at least one detection point from the line connecting the target hair root to the extension point;

[0207] The diameter determination module 906 is used to determine the hair diameter corresponding to each detection point according to the extension direction; and determine the hair diameter corresponding to the target hair according to the hair diameter corresponding to each detection point.

[0208] Optionally, the diameter determination module 906 is specifically configured to:

[0209] Determine the pixel length of the vertical line segment corresponding to the detection point; wherein the vertical line segment passes through the detection point and is perpendicular to the extension direction, and each pixel point on the vertical line segment is a hair pixel point;

[0210] According to the pixel length of the vertical line segment, the hair diameter corresponding to the detection point is determined.

[0211] Optionally, the diameter determination module 906 is specifically configured to:

[0212] Determine the pixel length of the vertical line segment corresponding to the detection point; wherein the vertical line segment passes through the detection point and is perpendicular to the extension direction, and each pixel point on the vertical line segment is a hair pixel point;

[0213] According to the pixel length of the vertical line segment, the hair diameter corresponding to the detection point is determined.

[0214] Fig.10 FIG. 1 is a schematic diagram of a structure of a device for determining hair density provided by another embodiment of the present invention. Fig.10 As shown, the device comprises:

[0215] An image acquisition module 1001 is used to acquire a scalp image;

[0216] A hair root recognition module 1002, configured to recognize at least one hair root region included in the scalp image;

[0217] The hair root number determination module 1003 is used to obtain the number of hair roots in each hair root area by using the method for determining the number of hair roots in the hair root area of ​​any of the above embodiments;

[0218] The density determination module 1004 is used to determine the hair density corresponding to the scalp image according to the number of hair roots in each hair root area, the pixel area of ​​the scalp image and the pixel ratio parameter of the scalp image.

[0219] An embodiment of the present invention provides an electronic device, including:

[0220] one or more processors;

[0221] a storage device for storing one or more programs,

[0222] When one or more programs are executed by one or more processors, the one or more processors implement the method of any of the above embodiments.

[0223] Reference below Fig.11 , which shows a schematic diagram of the structure of a computer system 1100 of a terminal device suitable for implementing an embodiment of the present invention. Fig.11 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0224] like Fig.11 As shown, the computer system 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage part 1108 into a random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the system 1100 are also stored. The CPU 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.

[0225] The following components are connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed, so that a computer program read therefrom is installed into the storage section 1108 as needed.

[0226] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1109, and / or installed from the removable medium 1111. When the computer program is executed by the central processing unit (CPU) 1101, the above-mentioned functions defined in the system of the present invention are executed.

[0227] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0228] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0229] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, they may be described as: an image acquisition module, an angle determination module, a detection module, a set determination module, and a root number determination module. The names of these modules do not limit the modules themselves in some cases. For example, the image acquisition module may also be described as "a module for acquiring a scalp image, wherein the scalp image includes: a target area, wherein the target area includes: a target hair root".

[0230] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:

[0231] Acquire a scalp image, wherein the scalp image includes: a target hair root area;

[0232] Determine multiple detection angles;

[0233] For each of the detection angles, determine an angle line corresponding to the detection angle; in response to a proportion of hair pixel points on the angle line being greater than a proportion threshold, determine the detection angle as a hair extension angle; wherein the angle between the angle line and the reference line is the detection angle, and both the angle line and the reference line pass through the target hair root area;

[0234] In response to the presence of multiple detection angles being hair extension angles, determining at least one angle set; wherein the angle set includes multiple continuous detection angles, and each detection angle in the angle set is a hair extension angle;

[0235] The number of hair roots in the target hair root area is determined according to the number of the angle sets.

[0236] When the scalp image has a large magnification, a hair appears as a rectangular area. Each hair growing in the target hair root area can correspond to a set of adjacent angle lines, which pass through the target hair root area, and each angle line has a higher proportion of hair pixels. An angle line corresponds to a detection angle, and a set of adjacent angle lines corresponds to an angle set, which includes multiple continuous detection angles. Therefore, the number of hair roots in the target hair root area can be determined by the number of angle sets.

[0237] The solution of the embodiment of the present invention first determines multiple detection angles, then determines the angle lines corresponding to the detection angles, and selects the angle lines with a higher hair pixel ratio. The detection angles of the angle lines with a higher hair pixel ratio are merged to obtain at least one angle set. Finally, the number of hair roots in the target hair root area is determined based on the number of angle sets. This solution can reduce the workload of doctors and accurately determine the number of hair roots in the hair root area.

[0238] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for determining the number of hair roots in a hair root area, It is characterized in that include: Acquire a scalp image, wherein the scalp image includes: a target hair root area; Determine multiple detection angles; For each of the detection angles, determine an angle line corresponding to the detection angle; in response to a proportion of hair pixel points on the angle line being greater than a proportion threshold, determine the detection angle as a hair extension angle; wherein the angle between the angle line and the reference line is the detection angle, and both the angle line and the reference line pass through the target hair root area; In response to the presence of multiple detection angles being hair extension angles, determining at least one angle set; wherein the angle set includes multiple continuous detection angles, and each detection angle in the angle set is a hair extension angle; The number of hair roots in the target hair root area is determined according to the number of the angle sets.

2. The method according to claim 1, It is characterized in that After acquiring the scalp image, the method further includes: Binarization is performed on the scalp image so that hair pixels and scalp pixels correspond to different pixel values ​​respectively; Before determining the detected angle as the hair extension angle in response to the proportion of hair pixels on the angle line being greater than a proportion threshold, the method further includes: Obtain each pixel point on the angle line; Determining a hair pixel among the pixels according to the pixel values ​​of the pixels; Determine the proportion of hair pixels on the angle line.

3. The method according to claim 1, It is characterized in that The step of determining the number of hair roots in the target hair root area according to the number of the angle sets includes: In response to the number of the angle sets being greater than 1, determining whether there is an angle set corresponding to penetrating hair in the at least one angle set; In response to the existence of an angle set corresponding to the penetrating hair, deleting the angle set corresponding to the penetrating hair from the at least one angle set; The number of remaining angle sets is determined as the number of hair roots in the target hair root area.

4. The method according to claim 3, It is characterized in that The step of determining whether there is an angle set corresponding to penetrating hair in the at least one angle set comprises: Determining a first angle set and a second angle set from the at least one angle set; Determine the set angles corresponding to the first angle set and the second angle set respectively; Calculating a set angle difference between the first angle set and the second angle set; In response to the set angle difference being within the angle difference range, it is determined that both the first angle set and the second angle set are angle sets corresponding to penetrating hair.

5. The method according to claim 1, It is characterized in that The determining of the angle line corresponding to the detection angle includes: Determine a target area from the scalp image, wherein the target area includes: the target hair root area; Determining an edge point corresponding to the detection angle from the edge of the target area; The line connecting the target hair root area and the edge point is determined as the angle line corresponding to the detection angle.

6. The method according to claim 1, It is characterized in that The determining of multiple detection angles comprises: In the angle range from 0 to 360 degrees, a plurality of detection angles are acquired in sequence with a preset angle as a step length.

7. A method for determining the diameter of hair, It is characterized in that include: Acquire a scalp image, wherein the scalp image includes: a target hair root area; Determine at least one angle set corresponding to the target hair root area using the method as described in any one of claims 1 to 6; Determine a target angle set from the at least one angle set, and determine that the target angle set corresponds to the target hair in the target hair root area; Determining a hair extension direction corresponding to the target hair according to each detection angle in the target angle set; Determining the extension point of the target hair according to the extension direction of the hair; Determine at least one detection point from the line connecting the target root to the extension point; For each of the detection points, according to the extension direction, determine the hair diameter corresponding to the detection point; The hair diameter corresponding to the target hair is determined according to the hair diameter corresponding to each of the detection points.

8. The method according to claim 7, It is characterized in that The step of determining the hair diameter corresponding to the detection point according to the extension direction includes: Determine the pixel length of the vertical line segment corresponding to the detection point; wherein the vertical line segment passes through the detection point and is perpendicular to the extension direction, and each pixel point on the vertical line segment is a hair pixel point; The hair diameter corresponding to the detection point is determined according to the pixel length of the vertical line segment.

9. A method for determining hair density, It is characterized in that include: Acquire scalp images; identifying at least one hair root region included in the scalp image; Using the method as described in any one of claims 1 to 6, respectively obtaining the number of hair roots in each hair root area; The hair density corresponding to the scalp image is determined according to the number of hair roots in each of the hair root areas, the pixel area of ​​the scalp image and the pixel ratio parameter of the scalp image.

10. A device for determining the number of hair roots in a hair root area, It is characterized in that include: An image acquisition module is used to acquire a scalp image, wherein the scalp image includes: a target hair root area; An angle determination module, used for determining a plurality of detection angles; A detection module, for determining, for each detection angle, an angle line corresponding to the detection angle; in response to a proportion of hair pixel points on the angle line being greater than a proportion threshold, determining the detection angle as a hair extension angle; wherein the angle between the angle line and a reference line is the detection angle, and both the angle line and the reference line pass through the target hair root area; A set determination module, used to determine at least one angle set; wherein the angle set includes a plurality of continuous detection angles, and each detection angle in the angle set is a hair extension angle; The hair root number determination module is used to determine the number of hair roots in the target hair root area according to the number of the angle sets.

11. The device according to claim 10, It is characterized in that Also includes: A processing module, used for performing binarization processing on the scalp image so that hair pixels and scalp pixels correspond to different pixel values ​​respectively; The detection module is specifically used for: Obtain each pixel point on the angle line; Determining a hair pixel among the pixels according to the pixel values ​​of the pixels; Determine the proportion of hair pixels on the angle line.

12. The device according to claim 10, It is characterized in that The root number determination module is specifically used for: In response to the number of the angle sets being greater than 1, determining whether there is an angle set corresponding to penetrating hair in the at least one angle set; In response to the existence of an angle set corresponding to the penetrating hair, deleting the angle set corresponding to the penetrating hair from the at least one angle set; The number of remaining angle sets is determined as the number of hair roots in the target hair root area.

13. The device according to claim 12, It is characterized in that The root number determination module is specifically used for: Determining a first angle set and a second angle set from the at least one angle set; Determine the set angles corresponding to the first angle set and the second angle set respectively; Calculating a set angle difference between the first angle set and the second angle set; In response to the set angle difference being within the angle difference range, it is determined that both the first angle set and the second angle set are angle sets corresponding to penetrating hair.

14. The device according to claim 10, It is characterized in that The detection module is specifically used for: Determine a target area from the scalp image, wherein the target area includes: the target hair root area; Determining an edge point corresponding to the detection angle from the edge of the target area; The line connecting the target hair root area and the edge point is determined as the angle line corresponding to the detection angle.

15. The device according to claim 10, It is characterized in that The angle determination module is specifically used for: In the angle range from 0 to 360 degrees, a plurality of detection angles are acquired in sequence with a preset angle as a step length.

16. A device for determining the diameter of hair, It is characterized in that include: An image acquisition module is used to acquire a scalp image, wherein the scalp image includes: a target hair root area; A set determination module, configured to determine at least one angle set corresponding to the target hair root area by using the method as described in any one of claims 1 to 6; A hair determination module, configured to determine a target angle set from the at least one angle set, and determine that the target angle set corresponds to target hair in the target hair root area; a direction determination module, used to determine the hair extension direction corresponding to the target hair according to each detection angle in the target angle set; An extension point determination module is used to determine the extension point of the target hair according to the extension direction of the hair; and to determine at least one detection point from the line connecting the target hair root to the extension point; The diameter determination module is used to determine the hair diameter corresponding to each detection point according to the extension direction; and determine the hair diameter corresponding to the target hair according to the hair diameter corresponding to each detection point.

17. The device according to claim 16, It is characterized in that The diameter determination module is specifically used for: Determine the pixel length of the vertical line segment corresponding to the detection point; wherein the vertical line segment passes through the detection point and is perpendicular to the extension direction, and each pixel point on the vertical line segment is a hair pixel point; The hair diameter corresponding to the detection point is determined according to the pixel length of the vertical line segment.

18. A device for determining hair density, It is characterized in that include: An image acquisition module, used for acquiring a scalp image; a hair root recognition module, configured to recognize at least one hair root region included in the scalp image; A hair root number determination module, used to obtain the number of hair roots in each hair root area respectively by using the method according to any one of claims 1 to 6; The density determination module is used to determine the hair density corresponding to the scalp image according to the number of hair roots in each of the hair root areas, the pixel area of ​​the scalp image and the pixel ratio parameter of the scalp image.

19. An electronic device, It is characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 9.

20. A computer readable medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Image processing method and device, electronic equipment and storage medium

    CN113763228A

  • Hair density measurement method, electronic equipment and storage medium

    CN114677702A

  • Hair follicle collection path determination device and method

    CN115886998A

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

    CN116245785A

  • System and method for classifying follicular units

    US20080049992A1