Hair line endpoint recognition method based on hair follicle detection robot
Through the image processing process of the hair follicle detection robot system, adaptive thresholding and refinement technology are used to identify hair follicle endpoints, solving the problem of hair damage caused by inaccurate hair line detection in the existing hair transplant robot system, and achieving higher accuracy of hair follicle extraction.
Patent Information
- Application Number
- CN202211048710.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-29
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2042-08-29
AI Technical Summary
The existing hair transplant robot system cannot accurately identify the hair follicle endpoints due to hair damage caused by the use of fitted linear methods in hair line detection.
The hair line endpoint recognition method based on the hair follicle detection robot is adopted to locate the hair follicle point through image extraction, filtering, and contour external rectangle center, and the contour point furthest from the center point is recorded as an endpoint. Combined with adaptive thresholding and refinement processing, the endpoint recognition accuracy is improved.
It improves the accuracy of hair follicle endpoint identification, reduces hair damage, and improves the accuracy and safety of hair follicle extraction.
Smart Images

Figure CN115424007B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of hair transplantation systems, and in particular is a hair line endpoint recognition method based on a hair follicle detection robot. Background Art
[0002] In recent years, the number of hair transplant surgeries in China has increased year by year, but they are mainly manual operations, and the operation process is time-consuming and labor-intensive. As artificial intelligence gradually enters people's field of vision, it is also slowly integrated into people's lives, subtly changing people's lifestyles and being widely used in various fields. The combination of artificial intelligence and medicine has brought far-reaching impacts on the medical system. Robotic hair transplant technology, with its advantages of convenient operation and short learning curve, can effectively reduce doctors' surgical fatigue and bring patients higher quality medical services.
[0003] Existing hair transplant robotic systems, powered by artificial intelligence, can assess the number and distribution of hair follicles in real time, accurately analyze the direction and angle of hair follicles, and can also be used to extract large numbers of follicular units. Specifically, "follicular units" are naturally occurring, closely spaced follicles randomly distributed on the scalp surface. To prevent damage to the follicular units during the harvesting process, the planning and execution of the hair transplant procedure requires locating and identifying the endpoints of each tuft of hair in the follicular unit. One endpoint, called the tail, is the point where one or more hairs of the follicular unit emerge from the skin, while the other endpoint, called the head, corresponds to the top of each tuft of hair in the follicular unit above the skin surface.
[0004] The existing technology uses a straight line fitting detection method to detect hair lines. However, in actual applications, the straight line recognition is inaccurate due to the curvature of the hair line, resulting in damage to the hair when extracting hair follicles. Summary of the Invention
[0005] Purpose of the invention: To provide a hair line endpoint recognition method based on a hair follicle detection robot to solve the above-mentioned problems existing in the prior art.
[0006] Technical solution: A hair line endpoint recognition method based on a hair follicle detection robot includes: S1. An image extraction unit extracts a ROI region from an image.
[0007] S2. The image filtering unit performs median filtering and binarization on the ROI region extracted by the image extraction unit.
[0008] S3. The hair follicle point selection unit selects the center of the circumscribed rectangle within the ROI region binarized by the image filtering unit and defines the center of the circumscribed rectangle as the hair follicle point.
[0009] S4. The hair follicle point selection unit obtains the contour point of each hair follicle point that is farthest from the center point, and records the contour point as the endpoint.
[0010] In a further embodiment, in S2, when the image filtering unit binarizes the predetermined area, a binarization threshold of the predetermined area is determined according to the distribution of neighboring pixels within a surrounding predetermined range, and the predetermined area is binarized according to the binarization threshold.
[0011] In a further embodiment, in S3, the hair follicle point selection unit first finds all contours.
[0012] Then, qualified hair contours that meet the conditions are screened out based on the area and perimeter conditions of the contours.
[0013] Then, the circumscribed rectangle of the qualified hair contour is found, and it is determined whether the center of the circumscribed rectangle is within the qualified hair contour, so as to determine whether the screened hair follicle points exist within the qualified hair contour.
[0014] In a further embodiment, in S3 , the follicle point selection unit records the outline of the follicle point as mark 1 .
[0015] The image filtering unit performs a thinning process on the binary area of the ROI area again.
[0016] Then, the hair follicle point selection unit finds the thinned outline of Mark 1 in the thinned ROI area and records it as Mark 2.
[0017] In a further embodiment, the image filtering unit performs a thinning process on the binary region of the ROI region in a thinning method including:
[0018] S3-1. The image filtering unit copies the binary image of the ROI region as a temporary image.
[0019] S3-2. The image filtering unit scans the temporary image once, retrieves points with predetermined pixel values, and determines whether the retrieved points meet the following conditions: a. 2<= p2+p3+p4+p5+p6+p7+p8+p9<=6.
[0020] b. In the sequence of p2-p9, the number of 01 patterns is 1.
[0021] c. p2*p4*p6 = 0.
[0022] d. p4*p6*p8 = 0.
[0023] Among them, the retrieved point is p1, and the positions of its eight neighboring points p2-p9 are sorted in a clockwise direction, with p2 being directly above p1. Here, the pixel grayscale values of p2, ..., p9 are 1 or 0.
[0024] Delete the points that meet the conditions a, b, c and d at the same time, that is, set the grayscale value of pixel p1 to 0.
[0025] S3-3. The temporary image is then scanned again to retrieve points with predetermined pixel values and determine whether the retrieved points meet the following condition: e. 2 <= p2+p3+p4+p5+p6+p7+p8+p9 <= 6.
[0026] f. In the order of p2-p9, the number of 01 patterns is 1.
[0027] g. p2*p4*p8 = 0.
[0028] h. p2*p6*p8 = 0.
[0029] Delete the points that meet the conditions e, f, g and h at the same time, that is, set the grayscale value of pixel p1 to 0.
[0030] S3-4. Steps S3-2 and S3-3 are iterated at least once to complete the refinement process and obtain a refinement map. By removing redundant pixels to obtain a refinement map, the accuracy of the hair follicle point selection unit in selecting qualified hair contours can be improved.
[0031] In a further embodiment, the thinning method further includes: S3-3.1. Retrieving a point of a predetermined pixel value and determining whether the retrieved point satisfies the following conditions: i. (p2*p8=1)&& (p5=0).
[0032] j. (p4*p6=1)&& (p9=0).
[0033] k. (p6*p8=1)&& (p3=0).
[0034] l. (p2*p4=1)&& (p7=0).
[0035] Delete the points that meet the conditions e, f, g and h at the same time, that is, set the grayscale value of pixel p1 to 0.
[0036] S3-4.1. Steps S3-2, S3-3, and S3-3.1 are iterated at least once to complete the refinement process and obtain a refined image, which can further reduce pixel redundancy.
[0037] In a further embodiment, in S1, the image extraction unit extracts the ROI area of the image including: S1-1. Establishing Figure 1 A mask image of the same size is generated and all pixels are initialized to 0.
[0038] S1-2. Set all pixel values in the ROI area in the mask image to predetermined values.
[0039] S1-3. Perform an AND operation on the original image and the mask image to obtain the result image.
[0040] Beneficial effects: The present invention discloses a hair line endpoint recognition method based on a hair follicle detection robot. By extracting the ROI area of the image and performing median filtering and binarization on the ROI area, the interfering pixels in the image can be removed, thereby quickly obtaining the hair follicle point and the contour of the hair follicle point. By recording the contour point farthest from the center point as the endpoint and directly obtaining the endpoint position, the accuracy of endpoint acquisition can be improved, solving the problem of damage to hair during hair follicle extraction caused by inaccurate endpoint acquisition in the existing straight line fitting method. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a flowchart of the method of this application.
[0042] Figure 2 This is a schematic diagram of the original image.
[0043] Figure 3 This is a schematic diagram of the image after binarization in this application.
[0044] Figure 4 This is an image diagram of the hair follicle point found by this application.
[0045] Figure 5 This is a schematic diagram of the image after refinement processing in this application.
[0046] Figure 6 This is an image diagram of how this application finds the endpoints of the hair line. DETAILED DESCRIPTION
[0047] In the following description, numerous specific details are provided to provide a more thorough understanding of the present invention. However, it will be apparent to those skilled in the art that the present invention may be practiced without one or more of these details. In other instances, certain technical features well known in the art are not described to avoid confusion with the present invention.
[0048] The present invention provides a hair line endpoint identification method that can directly obtain endpoints and thus reduce the hair damage rate when extracting hair follicles.
[0049] The hair line endpoint recognition method includes: S1. The image extraction unit extracts the ROI area of the image. In this embodiment, in S1, the image extraction unit extracts the ROI area of the image, including: S1-1. Establishing the original Figure 1 A mask image of the same size is prepared and all pixels are initialized to 0. S1-2. All pixel values of the ROI area in the mask image are set to predetermined values, such as Figures 2 to 6In the embodiment shown, all pixel values are set to 255. S1-3. An AND operation is performed on the original image and the mask image to obtain a result image.
[0050] S2. The image filtering unit performs median filtering and binarization on the ROI region extracted by the image extraction unit, wherein the median filtering is denoising, and the binarization and thinning processing is contour thinning.
[0051] S3. The hair follicle point selection unit selects the center of the outline circumscribed rectangle in the ROI area binarized by the image filtering unit and defines the center of the outline circumscribed rectangle as the hair follicle point. The outline circumscribed rectangle is the minimum rectangle that includes the hair follicle outline.
[0052] S4. The hair follicle point selection unit obtains the contour point of each hair follicle point that is farthest from the center point, and records the contour point as the endpoint.
[0053] In this embodiment, the image extraction unit, the image filtering unit, the hair follicle point selection unit and the hair follicle point selection unit are all units of the image processing system of the hair follicle detection robot. After the visual device of the hair follicle detection robot collects the image, it transmits the image to the image processing system, and then the image processing system identifies the hair line endpoints of the image through the hair line endpoint recognition method.
[0054] Working principle: By extracting the ROI area of the image and performing median filtering and binarization on the ROI area, the interfering pixels in the image can be removed, so that the hair follicle point and the contour of the hair follicle point can be quickly obtained. By recording the contour point farthest from the center point as the endpoint and directly obtaining the endpoint position, the accuracy of endpoint acquisition can be improved, solving the problem of damage to hair when extracting hair follicles caused by inaccurate endpoint acquisition in the existing fitting straight line method.
[0055] In a further embodiment, in the prior art, due to interference factors such as brightness, contrast, and texture during image acquisition, there is a problem in which the numerical difference between the contour pixels and background pixels of the hair follicle points in the image area after binarization is small, resulting in incorrect contour point acquisition.
[0056] To solve the above problem, in S2, when the image filtering unit binarizes the predetermined area, the binarization threshold of the predetermined area is determined according to the distribution of neighboring pixels within a predetermined range, and the predetermined area is binarized according to the binarization threshold.
[0057] The advantages of this approach are: 1. The binarization threshold at each pixel is determined by the distribution of its surrounding pixels and is not fixed. 2. Brighter image regions generally have higher binarization thresholds, while lower brightness regions generally have lower binarization thresholds, making it suitable for binarizing ROIs within an image. 3. Local image regions with different brightness, contrast, and texture will have corresponding local binarization thresholds.
[0058] By performing adaptive thresholding operations with reference to the distribution of surrounding neighborhood pixels, local image areas with different brightness, contrast, and texture will have corresponding local binarization thresholds, and the predetermined area will be binarized using this binarization threshold, which can overcome the problem of incorrect contour point acquisition in existing technologies due to interference factors resulting in a small numerical difference between contour pixels and background pixels.
[0059] In a further embodiment, in S3, the follicle point selection unit first finds all contours.
[0060] Then, qualified hair contours that meet the conditions are screened out based on the area and perimeter conditions of the contours.
[0061] Then find the circumscribed rectangle of the qualified hair contour and determine whether the center of the circumscribed rectangle is within the qualified hair contour.
[0062] It is used to determine whether the selected hair follicle points exist in the qualified hair contour. By judging whether the center of the circumscribed rectangle of the contour is in the qualified hair contour, the hair contour can be classified, further reducing the damage rate to the hair when taking hair follicles.
[0063] In a further embodiment, in S3 , the follicle point selection unit records the outline of the follicle point as mark 1 .
[0064] The image filtering unit further refines the binary area of the ROI area.
[0065] Then, the hair follicle point selection unit finds the refined outline of marker 1 in the refined ROI area and records it as marker 2.
[0066] By refining the image after binarization to obtain a refined map, the contour position, area, perimeter and other information can be further refined, thereby improving the accuracy of obtaining hair endpoints.
[0067] In this embodiment, the thinning method for thinning the binary region of the ROI region includes:
[0068] S3-1. The image filtering unit copies the binarized image of the ROI region as a temporary image.
[0069] S3-2. The image filtering unit scans the temporary image once, retrieves points with predetermined pixel values, and determines whether the retrieved points meet the following conditions: a. 2<= p2+p3+p4+p5+p6+p7+p8+p9<=6.
[0070] b. In the sequence of p2-p9, the number of 01 patterns is 1.
[0071] c. p2*p4*p6 = 0.
[0072] d. p4*p6*p8 = 0.
[0073] Among them, the retrieved point is p1, and the positions of its eight neighboring points p2-p9 are sorted in a clockwise direction, with p2 being directly above p1. Here, the pixel grayscale values of p2, ..., p9 are 1 or 0.
[0074] Among them, conditions a and b ensure that there are connected target points in the 8-neighborhood of target point p1, which still constitute the basis of the skeleton after deleting the point. Conditions c and d indicate that the target point is at the edge of the contour and is not a skeleton pixel point. Therefore, points that meet conditions a, b, c and d at the same time are deleted, that is, the grayscale value of p1 pixel is set to 0.
[0075] S3-3. The temporary image is then scanned again to retrieve points with predetermined pixel values and determine whether the retrieved points meet the following condition: e. 2 <= p2+p3+p4+p5+p6+p7+p8+p9 <= 6.
[0076] f. In the order of p2-p9, the number of 01 patterns is 1.
[0077] g. p2*p4*p8 = 0.
[0078] h. p2*p6*p8 = 0.
[0079] Delete the points that meet the conditions e, f, g and h at the same time, that is, set the grayscale value of pixel p1 to 0.
[0080] S3-4. Steps S3-2 and S3-3 are iterated at least once to complete the refinement process and obtain a refined graph.
[0081] Working principle: To extract the skeleton of a binary image, we assume that the image we are processing is a binary image with a black background and a value of 0. The pixel value of the foreground object to be refined is 1. There is a point p1 in the image that meets the pixel conditions. The decision on whether to delete the point p1 is based on the actual situation of the neighborhood of the point p1. That is, the unnecessary contour points are deleted and only the skeleton points are retained to obtain the refined image.
[0082] In a further embodiment, the thinning algorithm cannot completely skeletonize the tilted hairline. The fundamental reason is that conditions b and d prevent the deletion of some tilted pixels, resulting in redundant pixels and making the thinned skeleton less than a single pixel wide.
[0083] To solve the above problem, the refinement method further includes: S3-3.1. Retrieving a point with a predetermined pixel value and determining whether the retrieved point satisfies the following conditions: i. (p2*p8=1)&& (p5=0).
[0084] j. (p4*p6=1)&& (p9=0).
[0085] k. (p6*p8=1)&& (p3=0).
[0086] l. (p2*p4=1)&& (p7=0).
[0087] The points that meet the i and j conditions are non-skeleton pixels that can be deleted when the pixel line is in the northeast-southwest direction. The points that meet the k and l conditions are non-skeleton pixels that can be deleted when the pixel line is in the northwest-southeast direction. Therefore, the points that meet the e, f, g and h conditions at the same time are deleted, that is, the grayscale value of the p1 pixel is set to 0, which can further reduce the redundancy of the pixels.
[0088] S3-4.1. Steps S3-2, S3-3, and S3-3.1 are iterated at least once to complete the refinement process and obtain a refined graph.
[0089] The above four conditions solve the problem that some oblique pixels cannot be deleted due to conditions b and d, eliminate the redundant pixels in the refinement process, and achieve the effect of refining the skeleton into a single pixel width.
[0090] As described above, although the present invention has been shown and described with reference to specific preferred embodiments, it should not be construed as limiting the present invention itself. Various changes may be made to it in form and detail without departing from the spirit and scope of the present invention as defined in the appended claims.
Claims
1. A hair line endpoint recognition method based on a hair follicle detection robot, characterized in that: include: S1. The image extraction unit extracts the ROI region of the image; S2. The image filtering unit performs denoising and contour refinement on the ROI region extracted by the image extraction unit; S3. The follicle point selection unit selects the center of the circumscribed rectangle of the contour within the ROI region binarized by the image filtering unit and defines the center of the circumscribed rectangle as the follicle point. The follicle point selection unit first finds all contours; then selects qualified hair contours that meet the conditions based on the area and perimeter of the contours; then finds the circumscribed rectangle of the qualified hair contours and determines whether the center of the circumscribed rectangle is within the qualified hair contour; S3-1. The image filtering unit copies the binary image of the ROI region as a temporary image; S3-2. The image filtering unit scans the temporary image once, retrieves a point with a predetermined pixel value, and determines whether the retrieved point satisfies the following conditions: a. 2<= p2+p3+p4+p5+p6+p7+p8+p9<=6; b. In the order of p2-p9, the number of 01 patterns is 1; c. p2*p4*p6 = 0; d. p4*p6*p8 = 0; Among them, if the retrieved point is p1, then its eight neighboring points p2-p9 are sorted in a clockwise direction, with p2 being directly above p1. Here, the pixel grayscale values of p2, ..., p9 are 1 or 0; Delete the points that meet the conditions a, b, c and d at the same time, that is, set the grayscale value of pixel p1 to 0; S3-3. The temporary image is then scanned again to retrieve a predetermined pixel value to determine whether the retrieved point satisfies the following conditions: e. 2 <= p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 <= 6; f. In the order of p2-p9, the number of 01 patterns is 1; g. p2*p4*p8 = 0; h. p2*p6*p8 = 0; Delete the points that meet the conditions e, f, g and h at the same time, that is, set the grayscale value of pixel p1 to 0; S3-3.
1. Retrieve a point with a predetermined pixel value and determine whether the retrieved point satisfies the following conditions: i.(p2*p8=1)&&(p5=0); j.(p4*p6=1)&&(p9=0); k.(p6*p8=1)&&(p3=0); l.(p2*p4=1)&&(p7=0); Delete the points that meet the conditions of i, j, k and l at the same time, that is, set the gray value of pixel p1 to 0; S3-4. Steps S3-2 and S3-3 are iterated at least once to complete the refinement process to obtain a refined graph; S3-4.
1. Steps S3-2, S3-3, and S3-3.1 are iterated at least once to complete the refinement process to obtain a refined graph; S4. The hair follicle point selection unit obtains the contour point of each hair follicle point that is farthest from the center point, and records the contour point as the endpoint.
2. The hair line endpoint recognition method based on the hair follicle detection robot according to claim 1, characterized in that: In S2, when the image filtering unit binarizes the predetermined area, it determines a binarization threshold of the predetermined area according to the distribution of neighboring pixels within a predetermined range, and binarizes the predetermined area according to the binarization threshold.
3. The hair line endpoint recognition method based on the hair follicle detection robot according to claim 1, characterized in that: In S3, the hair follicle point selection unit records the outline of the hair follicle point as mark 1; The image filtering unit further refines the binary region of the ROI region; Then, the hair follicle point selection unit finds the thinned outline of Mark 1 in the thinned ROI area and records it as Mark 2.
4. The hair line endpoint recognition method based on a hair follicle detection robot according to claim 1, characterized in that: In S1, the image extraction unit extracts the ROI area of the image by the following method: S1-1. Create a mask image of the same size as the original image and initialize all pixels to 0. S1-2. All pixel values in the ROI area of the mask image are set to predetermined values; S1-3. Perform an AND operation on the original image and the mask image to obtain the result image.
Citation Information
Patent Citations
System and method for classifying follicular units
CN101506825A
Off-line Chinese character stroke extraction method based on template matching
CN104156721A