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

By analyzing the angle connections and hair pixel proportions in scalp images, the number of hair roots in the hair root area is determined, and the inaccuracy of hair root number evaluation in the prior art is solved, and a fast and accurate number of hair roots is achieved Measurement.

WO2024255530A1PCT designated stage expired Publication Date: 2024-12-19BEIJING JINGDONG TUOXIAN TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/093797
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-15
Filing Date
2024-05-17
Publication Date
2024-12-19

AI Technical Summary

Technical Problem

In the prior art, doctors observe the number of hair roots through hair lenses for time-consuming and laborious and inaccurate 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 quickly and accurately determine the number of hair roots in the hair root area, reduce the workload of doctors, and improve the accuracy of hair health assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024093797_19122024_PF_FP_ABST
    Figure CN2024093797_19122024_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure provides a method and device for determining the number of hairs in a hair root area. One specific embodiment of the method comprises: acquiring a scalp image, wherein the scalp image comprises a target hair root area; determining a plurality of detection angles; for the detection angles, determining angle connecting lines corresponding to the detection angles; in response to the proportion of hair pixel points on each angle connecting line being greater than a proportion threshold, determining the detection angles as hair extension angles; in response to the plurality of detection angles being hair extension angles, determining at least one angle set, wherein the angle set comprises a plurality of consecutive detection angles, and the detection angles in the angle set are all hair extension angles; and on the basis of the number of angle sets, determining the number of hairs in the target hair root area.
Need to check novelty before this filing date? Find Prior Art

Description

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

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This disclosure claims priority to Chinese invention patent application No. 202310708569.2 filed on June 15, 2023, the entire contents of which are incorporated herein by reference. Technical Field

[0003] The present disclosure 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

[0004] Hair disorders are common ailments seen in dermatology clinics. Clinical indicators such as hair density and diameter are crucial for doctors' clinical treatment decisions. To determine the density and diameter of a patient's hair, it's usually necessary to first determine the number of hair roots growing in the root region of the head. Furthermore, the number of hair roots in this region often represents the health of the patient's hair. In related techniques, doctors typically use a trichoscope to observe and determine the number of hair roots in the root region, a time-consuming, labor-intensive, and inaccurate method.

[0005] Summary of the Invention

[0006] In view of this, embodiments of the present disclosure provide a method and apparatus for determining the number of hair roots in a hair root area.

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

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

[0009] Determine multiple detection angles;

[0010] For each detected angle, determining an angle line corresponding to the detected angle; in response to a proportion of hair pixels on the angle line being greater than a proportion threshold, determining the detected angle as a hair extension angle; wherein the angle between the angle line and a baseline is the detected angle, and both the angle line and the baseline pass through the target hair root region;

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

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

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

[0014] Binarizing the scalp image so that hair pixels and scalp pixels correspond to different pixel values;

[0015] 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:

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

[0017] determining a hair pixel among the pixels according to the pixel values ​​of the pixels;

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

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

[0020] 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;

[0021] 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;

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

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

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

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

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

[0027] 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.

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

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

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

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

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

[0033] Within an angle range from 0 degrees to 360 degrees, a plurality of detection angles are sequentially acquired with a preset angle as a step size.

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

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

[0036] Determine at least one angle set corresponding to the target hair root area using the method for determining the number of hair roots in the hair root area described in any of the above embodiments;

[0037] Determining a target angle set from the at least one angle set, and determining that the target angle set corresponds to target hair in the target hair root area;

[0038] determining, according to each detection angle in the target angle set, a hair extension direction corresponding to the target hair;

[0039] determining an extension point of the target hair according to the hair extension direction;

[0040] Determining at least one detection point from a line connecting the target hair root area to the extension point;

[0041] For each detection point, determining the hair diameter corresponding to the detection point according to the extension direction;

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

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

[0044] Determining the pixel length of a 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;

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

[0046] In a third aspect, the present disclosure provides a method for determining the number of hair roots in a hair root area, comprising:

[0047] Acquire scalp images;

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

[0049] 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;

[0050] 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.

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

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

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

[0054] a detection module configured to determine, for each detection angle, an angle line corresponding to the detection angle; and 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; wherein the angle between the angle line and a baseline is the detection angle, and both the angle line and the baseline pass through the target hair root region;

[0055] a set determining module, configured 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;

[0056] 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.

[0057] Optionally, it also includes:

[0058] a processing module, configured to perform binarization processing on the scalp image so that hair pixels and scalp pixels correspond to different pixel values;

[0059] The detection module is specifically used for:

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

[0061] determining a hair pixel among the pixels according to the pixel values ​​of the pixels;

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

[0063] Optionally, the root number determination module is specifically configured to:

[0064] 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;

[0065] 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;

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

[0067] Optionally, the root number determination module is specifically configured to:

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

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

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

[0071] 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.

[0072] Optionally, the detection module is specifically configured to:

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

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

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

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

[0077] Within an angle range from 0 degrees to 360 degrees, a plurality of detection angles are sequentially acquired with a preset angle as a step size.

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

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

[0080] 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;

[0081] 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;

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

[0083] 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;

[0084] 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.

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

[0086] Determining the pixel length of a 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;

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

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

[0089] An image acquisition module, used for acquiring scalp images;

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

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

[0092] The density determination module is configured to determine the hair density corresponding to the scalp image based on 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.

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

[0094] one or more processors;

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

[0096] 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 one of the above embodiments.

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

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

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

[0100] FIG1 is a schematic diagram of a process of a method for determining the number of hair roots in a hair root area provided by one embodiment of the present disclosure;

[0101] FIG2 is a schematic diagram of a hair root area detection result provided by an embodiment of the present disclosure;

[0102] FIG3 is a schematic diagram of a target area centered on a target hair root area provided by one embodiment of the present disclosure;

[0103] FIG4 is a schematic diagram of a penetrating hair provided by one embodiment of the present disclosure;

[0104] FIG5 is a schematic diagram of a process of a method for determining hair diameter provided by an embodiment of the present disclosure;

[0105] FIG6 is a schematic diagram of a hair diameter determination principle provided by an embodiment of the present disclosure;

[0106] FIG7 is a schematic diagram of a process of a method for determining hair density provided by yet another embodiment of the present disclosure;

[0107] FIG8 is a schematic structural diagram of a device for determining the number of hair roots in a hair root area according to an embodiment of the present disclosure;

[0108] FIG9 is a schematic structural diagram of a device for determining hair diameter provided by one embodiment of the present disclosure;

[0109] FIG10 is a schematic structural diagram of a device for determining hair density provided in yet another embodiment of the present disclosure;

[0110] FIG11 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 disclosure. DETAILED DESCRIPTION

[0111] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0112] The embodiments of the present disclosure have the following advantages or beneficial effects: In scalp images with a high magnification, a single hair appears as a rectangular area. Each hair growing in the target root area can be associated with a set of adjacent angle lines passing through the target root area, each of which has a high hair pixel ratio. Each angle line corresponds to a detection angle, and a set of adjacent angle lines corresponds to an angle set, which includes multiple consecutive detection angles. Therefore, the number of hairs in the target root area can be determined based on the number of angle sets.

[0113] The solution in this disclosed embodiment first sets multiple detection angles, then determines the angle lines corresponding to the detected angles, selecting the angle lines with a higher hair pixel ratio. The detected angles of the angle lines with a higher hair pixel ratio are then combined to form at least one angle set. Finally, based on the number of angle sets, the number of hair roots in the target hair root area is determined. This solution can reduce the workload of doctors and accurately determine the number of hair roots in the hair root area.

[0114] Various embodiments are described in detail below.

[0115] FIG1 is a schematic diagram of a method for determining the number of hair roots in a hair root area according to an embodiment of the present disclosure. As shown in FIG1 , the method includes:

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

[0117] In one possible embodiment, a scalp image can be first acquired using an image acquisition device, such as a camera. A less obstructed area of ​​the scalp image is then selected for hair root detection. Specifically, a hair root detector can be trained using the Faster-RCNN model, and this hair root detector is then used for hair root detection. Figure 2 is a schematic diagram of hair root region detection results provided by one embodiment of the present disclosure. As shown in Figure 2, for a less obstructed scalp region, the location of the hair root region can be relatively well identified. During hair root region detection, the same hair root region may correspond to multiple detection locations, and detection locations with high overlap can be merged.

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

[0119] Step 102: Determine multiple detection angles.

[0120] Multiple detection angles are acquired sequentially within an angle range of 0 to 360 degrees, with a preset angle as the step size. The preset angle can be determined based on the pixel ratio parameters of the scalp image, detection accuracy, etc. The preset angle can be 0.1 degrees, 0.5 degrees, 1 degree, etc.

[0121] 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.

[0122] The baseline passes through the target hair root area, and its direction can be set as needed. For ease of illustration, the direction through the target hair root area in the scalp image and pointing horizontally to the right can be set as the baseline direction, and the counterclockwise direction can be set as the angle adjustment direction.

[0123] Select a point along the baseline and use the line connecting the target hair root area and that point as the baseline. Using the target hair root area as the axis, rotate the baseline counterclockwise to various test angles to obtain multiple angle lines. The angle between the angle line corresponding to the test angle and the baseline is the test angle.

[0124] 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 may be 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.

[0125] A target area can also be determined from the scalp image, including a target hair root area; an edge point corresponding to a 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.

[0126] The target area is a regular shape centered on the target hair root area. The target area can be a circle, ellipse, octagon, or other shape centered on the target hair root area. The edge point corresponding to the detection angle is determined 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. The angle between this angle line and the baseline is the detection angle.

[0127] Figure 3 is a schematic diagram of a target area centered on the target hair root area, according to one embodiment of the present disclosure. As shown in Figure 3, the small circle in the center corresponds to the detection location of the target hair root area, while the large circle represents the target area. The center of the target area is located at the center of the target hair root area. The line segments numbered 1, 2, and 3 in Figure 3 represent angle lines corresponding to different detection angles.

[0128] In one embodiment of the present disclosure, after acquiring a scalp image, the method further includes: binarizing the scalp image so that hair pixels and scalp pixels correspond to different pixel values. In response to the ratio of hair pixels on the angle line connecting the edge points being greater than a ratio threshold, and before determining the detected angle as the hair extension angle, the method further includes: acquiring each pixel on the angle line; determining, based on the pixel values ​​of each pixel, that among the pixels are hair pixels; and determining the ratio of hair pixels on the angle line.

[0129] To determine whether each pixel on the angle line is a hair pixel, the scalp image must first be binarized to obtain an image with the hair and scalp background segmented. For example, a hair pixel can have a value of 0, while a scalp pixel can have a value of 1. Alternatively, a hair pixel can have a value of 1, while a scalp pixel can have a value of 0, and so on.

[0130] 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 detected angle is determined as the hair extension angle.

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

[0132] The multiple detection angles corresponding to the hair extension angle are divided into at least one angle set, each of which includes multiple consecutive detection angles. The consecutive detection angles are related to the step size of the detection angles. If the step size is 0.5 degrees, then 0.5 degrees, 1 degree, 1.5 degrees, 2 degrees, and so on are consecutive detection angles. If the step size is 1 degree, then 11 degrees, 12 degrees, 13 degrees, 14 degrees, 15 degrees, and so on are consecutive detection angles.

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

[0134] Determine the proportion of hair pixels corresponding to each angle line. Set the proportion threshold to 0.8. Then, angle lines with hair pixel proportions exceeding 0.8 correspond to detection angles of 117, 118, 119, 120, 121, 136, 137, 138, 139, and 140 degrees, respectively. These detected angles are all hair extension angles. Combining these detected angles yields two angle sets: 117-121 degrees and 136-140 degrees. 117-121 degrees corresponds to the hair slightly to the right of the target hair root in Figure 3, while 136-140 degrees corresponds to the hair slightly to the left of the target hair root in Figure 3. As can be seen, the number of hair roots extending from the target hair root in Figure 3 is 2.

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

[0136] 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.

[0137] 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 for penetrating hair can be used to obtain the number of hair roots in the target hair root area.

[0138] After determining the number of hair roots in the target root area, the result can be displayed on a computer or a mobile terminal using text, voice, etc., but is not limited to this.

[0139] In the disclosed embodiment, the target area is a regular pattern centered on the target hair root area. When the target area has a high magnification, each hair growing in the target hair root area can correspond to an angle set consisting of multiple consecutive detection angles, with each detection angle corresponding to an angle line having a high hair pixel ratio. The disclosed embodiment identifies at least one angle set by determining the angle line with a high hair pixel ratio. The number of hair roots in the target hair root area is then determined based on the number of angle sets. This reduces the workload of the doctor and accurately determines the number of hair roots in the hair root area.

[0140] The present disclosure also provides a method for determining the number of hair roots in a target hair root area. The method uses an arc scanning method to calculate the number of hair roots in the target area. The method includes:

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

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

[0143] S03: Set the percentage threshold to 0.8. The percentage threshold is not set to 1 because hair reflects light and has a certain curvature, which may cause pixels with a value of 1 on the angle line corresponding to the hair. Find x∈{0,1,…,359} such that f(x)≥0.85, and obtain the set of extension direction degrees R.

[0144] S04: Merge the consecutive 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. As shown in Figure 3, the method of the disclosed embodiment can obtain two angle sets: 117 to 121 degrees, and 136 to 140 degrees. It should be noted that during the detection angle merging process, 359 and 0 degrees are counted as consecutive detection angles.

[0145] In one embodiment of the present disclosure, determining the number of hair roots in a target hair root area based on the number of angle sets includes: in response to the number of angle sets being greater than one, determining whether an angle set corresponding to penetrating hair exists in at least one angle set; in response to the existence of an angle set corresponding to penetrating hair, deleting the angle set corresponding to the penetrating hair from the 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.

[0146] If hair from other root areas passes through the target root area, the hair from other root areas is considered a penetrating hair in the target root area. Penetrating hair can cause redundant hair to be detected. Figure 4 is a schematic diagram of penetrating hair according to an embodiment of the present disclosure. As shown in Figure 4, the small circle in the middle corresponds to the detection location of the target root area, while the large circle represents the target area. It can be seen that only one hair originates from the target root area, but the method of this embodiment of the disclosure will detect three hairs. A single penetrating hair may be mistakenly detected as two hairs from the target root area, and the total number of hairs in the target root area should be reduced by two.

[0147] In one embodiment of the present disclosure, determining whether at least one angle set includes an angle set corresponding to penetrating hair includes: determining a first angle set and a second angle set from the at least one angle set; determining 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; 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.

[0148] 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 detected 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 detected angle in the second angle set can be used as the set angle of the second angle set. The set angle of the first angle set is subtracted from the set angle of the second angle set to obtain the set angle difference between the first angle set and the second angle set.

[0149] The angle difference range is an angle range centered around 180 degrees, and can range from 178.5 to 181.5 degrees, 175 to 185 degrees, and so on. As shown in Figure 4, the angle difference between the first and second angle sets corresponding to penetrating hair is close to 180 degrees. The solution of the disclosed embodiment introduces a ray detection mechanism. If there are two angle sets whose collective angles differ by approximately 180 degrees, the hair corresponding to these two angle sets will be identified as penetrating hair at the target hair root.

[0150] FIG5 is a schematic diagram of a process of a method for determining hair diameter provided by an embodiment of the present disclosure. As shown in FIG5 , the method includes:

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

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

[0153] Using the method for determining the number of hair roots in a hair root region provided by any embodiment of the present disclosure, at least one angle set corresponding to a target hair root region is determined. Each angle set corresponds to a hair from the target hair root region.

[0154] 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.

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

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

[0157] The mean or median of each detected 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 points horizontally to the right can be set as the baseline direction. 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. The hair extension direction can then be (117 + 123) / 2 = 120 degrees, i.e., the hair extension direction is the direction of the baseline rotated 120 degrees counterclockwise.

[0158] 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 on the line connecting the target hair root and the extension point.

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

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

[0161] Determine the pixel length of a 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; determine the hair diameter corresponding to the detection point based on the pixel length of the vertical line segment.

[0162] Pixel length is the number of pixels. For example, if the pixel length of the vertical line segment corresponding to a test point is N, meaning there are N pixels on the vertical line segment, then the hair diameter corresponding to the test point is X*N. X is the pixel scale parameter of the scalp image, which is the ratio of the actual size to the pixel size of the captured image. The unit of the pixel scale parameter can be microns / pixel.

[0163] Figure 6 is a schematic diagram illustrating a method for determining hair diameter according to an embodiment of the present disclosure. As shown in Figure 6 , the arrow indicates the extension direction of the target hair. The hair at the target hair root area is divided into K equally spaced segments, resulting in K detection points, where K is a positive integer. The pixel length of the vertical line segment at each detection point is calculated. Each vertical line segment is perpendicular to the extension direction of the hair, and all pixels on the vertical line segment are 0, where 0 is the pixel value of the hair pixel.

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

[0165] The mean, median, and mode of the hair diameters corresponding to each detection point can be used as the target hair's corresponding hair diameter. Some vertical line segments may not represent 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 detection accuracy.

[0166] In the disclosed embodiment, a target angle set corresponding to a target hair root region is determined, and the target angle set is determined to correspond to a target hair originating from the target hair root region. Based on 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 perpendicular to the hair extension direction, thereby accurately detecting the diameter of the target hair.

[0167] FIG7 is a schematic diagram of a process of a method for determining hair density provided by another embodiment of the present disclosure. As shown in FIG7 , the method includes:

[0168] Step 701: Acquire a scalp image.

[0169] Hold the image acquisition device close to the target scalp area, adjust the brightness and magnification, and capture a clear scalp image. The pixel ratio parameter for the scalp image can be determined by the magnification, field of view, and image resolution. The pixel ratio parameter is the ratio between the actual size and the pixel size of the captured image. The unit of the pixel ratio parameter can be microns / pixel.

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

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

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

[0173] Step 704: Determine the hair density corresponding to the scalp image based on 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.

[0174] 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.

[0175] In the disclosed embodiment, 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, thereby accurately evaluating the hair density corresponding to the scalp image, thereby enhancing the accuracy and robustness of the calculation.

[0176] The disclosed embodiments also provide a method for identifying less-occluded areas. These areas are defined as those in a scalp image where hair roots can be clearly identified. Detecting hair diameter and density based on these less-occluded areas can improve the reliability and accuracy of the final measurement results.

[0177] The scalp image can be divided into M*L subregions, where M and L are both positive integers. The following metrics are obtained for each subregion: the number of detected hair roots, the average confidence level of the hair root detection box, and the proportion of non-hair area after binarization. The weighted sum of these metrics is calculated for each subregion, and the subregions with the largest weighted sums are selected as candidate regions. Connect and merge these candidate regions to obtain the least occluded region.

[0178] FIG8 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 disclosure. As shown in FIG8 , the device includes:

[0179] 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;

[0180] An angle determination module 802, configured to determine a plurality of detection angles;

[0181] Detection module 803 is configured to determine, for each detection angle, an angle line corresponding to the detection angle; and in response to a ratio of hair pixels on the angle line exceeding a ratio threshold, determine the detection angle as a hair extension angle; wherein the angle between the angle line and the baseline is the detection angle, and both the angle line and the baseline pass through the target hair root region;

[0182] A set determining module 804 is configured to determine at least one angle set, wherein the angle set includes a plurality of consecutive detection angles, and each detection angle in the angle set is a hair extension angle;

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

[0184] Optionally, it also includes:

[0185] The 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;

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

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

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

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

[0190] Optionally, the root number determination module 805 is specifically configured to:

[0191] 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;

[0192] 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;

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

[0194] Optionally, the root number determination module 805 is specifically configured to:

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

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

[0197] Calculating a set angle difference between the first set of angles and the second set of angles;

[0198] 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.

[0199] Optionally, the detection module 803 is specifically configured to:

[0200] Determine a target area from the scalp image, the target area including: a target hair root area;

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

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

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

[0204] From the angle range of 0 degrees to 360 degrees, multiple detection angles are obtained in sequence with the preset angle as the step size.

[0205] FIG9 is a schematic diagram of a device for determining hair diameter according to an embodiment of the present disclosure. As shown in FIG9 , the device includes:

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

[0207] A set determination module 902 is configured to determine at least one angle set corresponding to a target hair root region using the method for determining the number of hair roots in a hair root region according to any of the above embodiments;

[0208] a hair determination module 903 for determining a target angle set from at least one angle set, and determining that the target angle set corresponds to target hair from a target hair root region;

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

[0210] 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 on the line connecting the target hair root and the extension point;

[0211] 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.

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

[0213] 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;

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

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

[0216] 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;

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

[0218] FIG10 is a schematic diagram of a structure of a device for determining hair density provided by another embodiment of the present disclosure. As shown in FIG10 , the device includes:

[0219] Image acquisition module 1001, used to acquire scalp images;

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

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

[0222] The density determination module 1004 is configured to determine the hair density corresponding to the scalp image based on 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.

[0223] An embodiment of the present disclosure provides an electronic device, including:

[0224] one or more processors;

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

[0226] 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.

[0227] 11, which shows a schematic diagram of a computer system 1100 suitable for implementing an embodiment of the present disclosure. The terminal device shown in FIG11 is merely an example and should not limit the functionality and scope of use of the embodiment of the present disclosure.

[0228] As shown in FIG11 , a 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 unit 1108 into a random access memory (RAM) 1103. Various programs and data required for the operation of the system 1100 are also stored in the RAM 1103. 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.

[0229] The following components are connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, and the like; an output section 1107 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 1108 including a hard disk; and a communication section 1109 including a network interface card such as a LAN card or a modem. 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. Removable media 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 1110 as needed, so that computer programs read therefrom can be installed into the storage section 1108 as needed.

[0230] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1109, and / or installed from a 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 disclosure are performed.

[0231] It should be noted that the computer-readable medium described in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having 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 thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries 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 thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, or any suitable combination thereof.

[0232] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that 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 flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0233] The modules described in the embodiments of this disclosure may be implemented via software or hardware. The modules described may also be located within 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 hair root number determination module. In some cases, the names of these modules do not limit the modules themselves. For example, the image acquisition module may be described as "a module for acquiring a scalp image, the scalp image including a target area, and the target area including target hair roots."

[0234] As another aspect, the present disclosure further provides a computer-readable medium, which may be included in the device described in the above embodiments; or may exist independently and not be incorporated into the device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the device, the device includes:

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

[0236] Determine multiple detection angles;

[0237] For each detected angle, determining an angle line corresponding to the detected angle; in response to a proportion of hair pixels on the angle line being greater than a proportion threshold, determining the detected angle as a hair extension angle; wherein the angle between the angle line and a baseline is the detected angle, and both the angle line and the baseline pass through the target hair root region;

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

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

[0240] In a scalp image with a high magnification, a single hair appears as a rectangular area. Each hair growing in the target root area can be associated with a set of adjacent angle lines that pass through the target root area, each with a high percentage of hair pixels. Each angle line corresponds to a detection angle, and a set of adjacent angle lines corresponds to an angle set, which consists of multiple consecutive detection angles. Therefore, the number of angle sets can be used to determine the number of hairs in the target root area.

[0241] The solution of the disclosed embodiment first determines multiple detection angles, then identifies angle lines corresponding to the detected angles, selecting the angle lines with a higher hair pixel ratio. The detected angles of the angle lines with a higher hair pixel ratio are then combined to form at least one angle set. Finally, based on the number of angle sets, the number of hair roots in the target hair root area is determined. This solution can reduce the workload of doctors and accurately determine the number of hair roots in the hair root area.

[0242] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. A method for determining the number of hair roots in a hair root area, comprising: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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, wherein: The determining of the 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 hair diameter, comprising: 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, wherein: 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, comprising: 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, comprising: 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; The detection module is configured to determine, for each of the detection angles, 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, The detection angle is determined as the hair extension angle; wherein the angle between the angle connection line and the reference line is the detection angle, and both the angle connection 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 apparatus according to claim 10, further comprising: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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 hair diameter, comprising: 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; A diameter determination module is used to determine, for each of the detection points, according to the extension direction. Determine the hair diameter corresponding to the detection point; 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, wherein: 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, comprising: 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, comprising: 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, wherein 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

  • A method and apparatus for processing an image

    CN109087377A

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

    CN113763228A

  • Detection algorithm for hair health condition

    CN114708237A

  • Image processing method, computer device and storage medium

    CN114863502A

  • Method and apparatus for occlusion detection on target object, electronic device, and storage medium

    US20200034657A1