Garlic identification method, system and sorting equipment with skin

Through the garlic tail feature recognition method, image processing and preset threshold judgment are used to solve the problem of low accuracy in identifying garlic with skin in the existing technology, and achieve high-accuracy identification and sorting of garlic with skin.

CN113139406BActive Publication Date: 2024-10-25HEFEI MEIYA OPTOELECTRONICS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010060637.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-01-19
Publication Date
2024-10-25
Estimated Expiration
2040-01-19

AI Technical Summary

Technical Problem

When using existing technology to identify garlic with skin, it is difficult to accurately identify garlic with light skin that is close to the color of garlic itself, resulting in low recognition accuracy.

Method used

By collecting garlic images, garlic tail characteristics are identified, including the steps of obtaining binary images, corrosion and expansion processing, determining area differences, sliding window recognition, spindle and edge analysis, etc., and using preset thresholds and models to determine whether there is garlic. Characteristics of tail whiskers to determine whether garlic is garlic with skin.

Benefits of technology

Effectively identify garlic with skin, reduce misidentification, improve identification accuracy, and improve sorting accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113139406B_ABST
    Figure CN113139406B_ABST
Patent Text Reader

Abstract

The present invention provides a method, system and sorting equipment for identifying garlic with skin, which comprises the following steps: collecting garlic images; identifying garlic tail features of garlic to be identified in the garlic images; if the garlic tail features exist, determining that the garlic to be identified is garlic with skin. The present invention can effectively identify garlic with skin, reduce misidentification, and improve the recognition accuracy of garlic with skin.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of sorting, and in particular to a method and system for identifying garlic with skin, and a sorting device. Background Art

[0002] At present, the garlic sold on the market includes peeled garlic and unpeeled garlic. Peeled garlic is obtained by peeling with a peeling machine, but the peeling efficiency of the peeling machine is limited. Therefore, sorting equipment, such as a color sorter, is needed to sort the peeled garlic again and remove the garlic with skin.

[0003] At present, color sorting machines mainly use the difference between the color of the garlic skin and the color of the garlic itself to sort garlic with skin. This method makes it difficult to effectively identify the light-skinned garlic that is closer to the color of the garlic itself, resulting in low recognition accuracy. Summary of the invention

[0004] The present invention aims to solve at least one of the above technical problems.

[0005] To this end, an object of the present invention is to provide a method for identifying garlic with skin, which can effectively identify garlic with skin, reduce misidentification, and improve the recognition accuracy of garlic with skin.

[0006] To this end, a second object of the present invention is to provide a garlic identification system with skin.

[0007] To this end, the third object of the present invention is to provide a sorting device.

[0008] In order to achieve the above object, an embodiment of the first aspect of the present invention provides a method for identifying garlic with skin, comprising the following steps:

[0009] Collect garlic images;

[0010] Performing garlic tail feature recognition on the garlic to be identified in the garlic image;

[0011] If the garlic tail feature is present, the garlic to be identified is determined to be garlic with skin.

[0012] According to the method for identifying garlic with skin in an embodiment of the present invention, garlic tail features are identified for the garlic to be identified in the collected garlic image. When the garlic tail features exist, it is determined that the garlic corresponding to the garlic tail features is garlic with skin, so that garlic with skin can be effectively identified, while reducing misidentification and improving the recognition accuracy of garlic with skin. When applied to the sorting of garlic with skin, the sorting accuracy can be improved.

[0013] In addition, the method for identifying garlic with skin according to the above embodiment of the present invention may also have the following additional technical features:

[0014] In some examples, garlic tail feature recognition is performed on the garlic to be identified in the garlic image, specifically including: obtaining a binary image of the garlic to be identified according to the garlic image; obtaining a first connected domain where the center point of the binary image of the garlic to be identified is located, corroding the first connected domain to obtain a first target connected domain; dilating the first target connected domain to obtain a second target connected domain; judging whether the area difference between the second target connected domain and the first connected domain is greater than a first preset threshold; if so, judging that the garlic to be identified has a garlic tail feature.

[0015] In some examples, garlic tail features are identified for the garlic to be identified in the garlic image, specifically including: using a preset target segmentation model to identify pixel points in a pending garlic tail region of the garlic to be identified in the garlic image; sliding a sliding window of a preset size in the pending garlic tail region, and determining whether the number of pixel points in the pending garlic tail region in the sliding window at a current position is greater than a preset number threshold; if so, determining the center point of the sliding window as a valid tail point, repeating this step until all pixel points in the pending garlic tail region are traversed or at least one valid tail point is determined; and determining whether the corresponding garlic to be identified has a garlic tail feature according to the valid tail points in the pending garlic tail region.

[0016] In some examples, garlic tail features are identified for the garlic to be identified in the garlic image, specifically including: determining the main axis of the garlic to be identified, obtaining a first intersection point and a second intersection point on the edge of the garlic to be identified that are farthest apart along the main axis direction, wherein the main axis is an axis that runs through the root region and the tail region of the garlic to be identified; along the main axis, respectively obtaining a first region of a preset length including the first intersection point and a second region of a preset length including the second intersection point on the garlic to be identified; and judging whether the garlic to be identified has a garlic tail feature according to the first region and the second region.

[0017] In some examples, judging whether the to-be-identified garlic has a garlic tail feature according to the first area and the second area includes: determining a first angle ∠A 1 O 1 B 1 , where A 1 and B 1 are the intersections of the first vertical line of the main axis and the boundary of the garlic to be identified, 1 is the first intersection point, and the distance from the first vertical line to the first intersection point is a first preset distance; determining the second angle ∠A 2 O 2B 2 , where A 2 and B 2 are the intersections of the second vertical line of the main axis and the boundary of the garlic to be identified, 2 is the second intersection point, and the distance from the second vertical line to the second intersection point is a second preset distance; if the first angle ∠A 1 O 1 B 1 and the second angle ∠A 2 O 2 B 2 If there is an angle less than a preset angle threshold in the garlic, it is determined that the garlic to be identified has a garlic tail feature.

[0018] In some examples, garlic tail features are identified for the garlic to be identified in the garlic image, including: determining the main axis of the garlic to be identified, obtaining a first intersection point and a second intersection point between the main axis and an edge of the garlic to be identified, wherein the main axis is an axis running through a root region and a tail region of the garlic to be identified; taking a first region of a preset length including the first intersection point and a second region of a preset length including the second intersection point on the garlic to be identified along the main axis; calculating a first boundary energy according to a curvature and a length of a garlic boundary corresponding to the first region, and calculating a second boundary energy according to a curvature and a length of a garlic boundary corresponding to the second region; and determining that the garlic to be identified has a garlic tail feature if a boundary energy greater than a preset energy threshold exists between the first boundary energy and the second boundary energy.

[0019] In some examples, determining the main axis of the garlic to be identified specifically includes: calculating the minimum circumscribed moment of the garlic to be identified; determining the long central axis of the minimum circumscribed moment; and using the long central axis as the main axis of the garlic to be identified.

[0020] In some examples, determining the main axis of the garlic to be identified specifically includes: extracting all boundary points of the garlic to be identified; fitting an ellipse according to the coordinates of all boundary points; and using the major axis of the ellipse as the main axis of the garlic to be identified.

[0021] In some examples, after collecting the garlic image, the method further includes: identifying the garlic to be identified in the garlic image with skin by using a trained recognition model based on a convolutional neural network or by color sorting to obtain a target area; scaling the target area to obtain a new target area; extracting a second connected domain where the center point of the new target area is located, corroding the second connected domain to obtain a third target connected domain; dilating the third target connected domain to obtain a fourth target connected domain; determining whether the area difference between the fourth target connected domain and the second connected domain is greater than a second preset threshold; if so, determining that the garlic to be identified is garlic with skin.

[0022] In order to achieve the above-mentioned purpose, an embodiment of the second aspect of the present invention proposes a garlic with skin identification system, comprising: an acquisition module, used to acquire garlic images; an identification module, used to identify the garlic tail features of the garlic to be identified in the garlic image; and a processing module, used to determine that the garlic to be identified is garlic with skin when the garlic tail features exist.

[0023] According to the garlic with skin identification system of the embodiment of the present invention, the garlic tail feature is identified for the garlic to be identified in the collected garlic image. When the garlic tail feature exists, the garlic corresponding to the garlic tail feature is determined to be garlic with skin, so that the garlic with skin can be effectively identified, while reducing misidentification and improving the recognition accuracy of garlic with skin.

[0024] In order to achieve the above-mentioned purpose, an embodiment of the third aspect of the present invention provides a sorting device, including the garlic identification system with skin described in the above-mentioned embodiment of the present invention.

[0025] The sorting device according to the embodiment of the present invention can effectively identify garlic with skin, reduce misidentification, and improve the accuracy of garlic sorting.

[0026] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0028] Figure 1 is a flow chart of a method for identifying garlic with skin according to an embodiment of the present invention;

[0029] Figure 2 is a schematic diagram of a first angle and a second angle according to a specific embodiment of the present invention;

[0030] Figure 31 is a structural block diagram of a system for identifying garlic with skin according to an embodiment of the present invention. DETAILED DESCRIPTION

[0031] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0032] In the description of the present invention, it is necessary to understand that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.

[0033] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0034] The following describes a method, system and sorting equipment for identifying garlic with skin according to an embodiment of the present invention in conjunction with the accompanying drawings.

[0035] Figure 1 FIG. 1 is a flow chart of a method for identifying garlic with skin according to an embodiment of the present invention. Figure 1 As shown, the method for identifying garlic with skin comprises the following steps:

[0036] Step S1: Collect garlic images.

[0037] Specifically, the garlic here can be garlic to be sorted, mainly peeled garlic, some of which also have some skinned garlic left. It is garlic to be separated from garlic without skin, such as garlic output after being peeled by a peeling machine, some of which may be partially peeled, and some may not be peeled at all.

[0038] A high-speed camera can be used to capture images of garlic being normally transported on a conveyor belt to obtain garlic images.

[0039] Step S2: Recognize the garlic tail feature of the garlic to be identified in the garlic image. That is, recognize the garlic tail feature so as to sort the garlic with skin based on the presence or absence of the garlic tail feature. The garlic tail feature is a feature that can indicate the presence of garlic tails.

[0040] Specifically, in one embodiment of the present invention, the garlic image contains a plurality of garlics to be identified, and the process of identifying the garlic tail features of each garlic to be identified may be the same. When the present embodiment is actually implemented, each garlic to be identified must be identified.

[0041] Specifically, the process of identifying the garlic tail feature of the garlic to be identified in the garlic image specifically includes: (1) obtaining a binary image of the garlic to be identified based on the garlic image, specifically, removing the background of the collected garlic image, using the minimum circumscribed rectangle to intercept the garlic to be identified, and obtaining the binary image of the garlic to be identified, or first using the minimum circumscribed rectangle to intercept the garlic to be identified from the garlic image, and then binarizing the intercepted image to obtain the binary image of the garlic to be identified. (2) obtaining a first connected domain where the center point of the binary image of the garlic to be identified is located, corroding the first connected domain to obtain a first target connected domain. (3) dilating the first target connected domain to obtain a second target connected domain. (4) judging whether the area difference between the second target connected domain and the first connected domain is greater than a first preset threshold; (5) if the area difference between the second target connected domain and the first connected domain is greater than the first preset threshold, it is determined that the garlic to be identified has the garlic tail feature. The first preset threshold value may be determined according to the area of ​​the tail whiskers, such as calculating the average area of ​​the tail whiskers of some garlic in the batch of garlic to be identified, and using the average area as the first preset threshold value.

[0042] In a specific embodiment, the above-mentioned process of corroding the first connected domain can be implemented based on a corrosion core of a preset size, and the corrosion core of the preset size can be selected according to the actual scene requirements, for example, a corrosion core of 3*3 size is selected. The above-mentioned process of dilating the first target connected domain can be implemented based on a dilating core of a preset size, and the dilating core of the preset size can be selected according to the actual scene requirements, for example, a dilating core of 3*3 size is selected. For example, the background of the collected garlic image is removed to extract the binary image of the garlic to be identified; the first connected domain where the center point of the binary image of the garlic to be identified is located is obtained, and the first connected domain is corroded using a 3*3 erosion kernel. The connected domain after the corrosion is the first target connected domain, recorded as erode_area; the first target connected domain is dilated, and the dilation kernel is also 3*3 in size. The connected domain after the dilation is the second target connected domain, recorded as dilate_area; the dilate_area is subjected to area difference processing with the connected domain before the corrosion processing, that is, the first connected domain, to determine whether the result after the difference is greater than a first preset threshold value. If it is greater than the first preset threshold value, it is determined that the garlic to be identified has garlic tail features.

[0043] Alternatively, in another embodiment of the present invention, the process of identifying the garlic tail feature of the garlic to be identified in the garlic image specifically includes: using a preset target segmentation model to identify the pixel points of the pending garlic tail region of the garlic to be identified in the garlic image; setting a sliding window of a preset size, sliding the sliding window in the pending garlic tail region, and judging whether the number of pixel points of the pending garlic tail region in the sliding window at the current position is greater than a preset number threshold; if so, the center point of the sliding window is determined as a valid tail point, otherwise the center point of the sliding window can be determined as an invalid tail point, and this step is repeated until all the pixel points in the pending garlic tail region are traversed or at least one valid tail point is determined; judging whether the corresponding garlic to be identified has a garlic tail feature according to the valid tail point in the pending garlic tail region. Among them, the preset number threshold can be set according to experience, and the value can also be adjusted and determined according to the feedback of the actual recognition result. The target segmentation model is obtained by training a neural network, and the pixels of the garlic tail region are marked in the garlic sample used for training. The target segmentation model obtained in this way can identify the pixels of the garlic tail region in the garlic image.

[0044] Among them, the process of judging whether the corresponding garlic to be identified has the garlic tail feature according to the effective tail points in the to-be-determined garlic tail area may include: if the effective tail point is identified or the number of the effective tail points identified reaches a predetermined value, it is determined that the corresponding garlic to be identified has the garlic tail feature.

[0045] As mentioned above, the garlic to be identified may be partially peeled garlic, or it may be completely unpeeled garlic. There may be small pieces of skin on the surface of this kind of garlic with skin. The small pieces of skin are generally in a tilted state, which makes it similar to the garlic tail, which is easy to cause misidentification, thereby affecting the accuracy of sorting. The embodiment of the present invention identifies the pixel points of the pending garlic tail region of the garlic to be identified through a preset target segmentation model. The pending garlic tail region here may be the garlic tail region, or it may be small pieces of skin. Therefore, to avoid misidentification, further identification and determination are required to exclude small pieces of skin. Slide a preset sliding window in the pending garlic tail region, and determine whether the number of pixel points of the pending garlic tail region existing in the sliding window at the current position is greater than the preset number threshold; if so, the center point of the sliding window is determined as a valid tail point, otherwise the center point of the sliding window is determined as an invalid tail point, and this step is repeated until all pixel points in the pending garlic tail region are traversed or at least one valid tail point is determined. Specifically, the number of pixels identified in the garlic tail region is large, while the area of ​​the small peel is small and the number of pixels is small. Therefore, by comparing and analyzing the number of pixels captured in the sliding window to determine whether it is the garlic tail region, the garlic tail region and the small peel can be accurately distinguished, thereby improving the accuracy of identifying the garlic tail region, and further preventing misidentification caused by the influence of the small peel, thereby improving the accuracy of identifying garlic with skin.

[0046] In a specific embodiment, the preset target segmentation model is obtained by pre-training, and is used to identify the pixels of the undetermined garlic tail region of the garlic to be identified. The sliding window of the preset size can be selected according to the actual scene requirements, for example, a sliding window of 10*10 is selected. Or, in another embodiment of the present invention, the process of identifying the garlic tail feature of the garlic to be identified in the garlic image specifically includes: determining the main axis of the garlic to be identified, obtaining the first intersection and the second intersection with the farthest distance along the main axis direction on the edge of the garlic to be identified, that is, the straight line segment distance between any two other points on the edge of the garlic in the direction of the main axis is smaller than the straight line segment distance between the first intersection and the second intersection in the direction of the main axis, wherein the main axis is the axis running through the root region and the tail region of the garlic; along the main axis, the first region of the preset length including the first intersection and the second region of the preset length including the second intersection are respectively taken on the garlic; it should be noted that the width of the first region and the second region in the direction perpendicular to the main axis should cover the width of the garlic in this direction, that is, the complete width of the garlic is intercepted in this direction. Further, based on the first area and the second area, it is determined whether the garlic to be identified has a garlic tail feature.

[0047] It should be noted that the first vertical line may coincide with the boundary of the first region, and the second vertical line may coincide with the boundary of the second region. Figure 2As shown, of course, in other embodiments, non-overlapping is also possible.

[0048] In a specific embodiment, in combination Figure 2 As shown, the process of judging whether the garlic to be identified has the garlic tail feature according to the first area and the second area specifically includes: determining the first angle ∠A 1 O 1 B 1 , where A 1 and B 1 are the intersection points of the first vertical line of the main axis and the boundary of the garlic to be identified, O 1 is the first intersection point, and the distance from the first vertical line to the first intersection point is the first preset distance; determine the second angle ∠A 2 O 2 B 2 , where A 2 and B 2 are the intersection points of the second perpendicular line of the main axis and the boundary of the garlic to be identified, O 2 is the second intersection point, and the distance from the second vertical line to the second intersection point is the second preset distance; if the first angle ∠A 1 O 1 B 1 and the second angle ∠A 2 O 2 B 2 If there is an angle less than the preset angle threshold in the angle, it is determined that the garlic to be identified has garlic tail features. The preset angle threshold can be set according to actual experience, or the value can be adjusted and determined according to feedback from actual recognition results. The first preset distance and the second preset distance can be set according to actual needs, and the two can be the same or different.

[0049] In another embodiment, after taking a first area of ​​a preset length including a first intersection and a second area of ​​a preset length including a second intersection on the to-be-identified garlic along the main axis, the method may further include: determining the area change amplitude of the first area and the second area, and taking the one with a larger area change amplitude as the to-be-identified garlic tail area. After determining the garlic tail area, the angle is calculated for the to-be-identified garlic tail area in a similar angle calculation method as described above, and whether there is a garlic tail feature is determined based on the size of the angle. The specific calculation method can refer to the aforementioned related content, which will not be described in detail here.

[0050] Alternatively, in one embodiment of the present invention, the process of identifying the garlic tail feature of the garlic to be identified in the garlic image specifically includes: determining the main axis of the garlic to be identified, obtaining the first intersection point and the second intersection point of the main axis and the edge of the garlic to be identified, wherein the main axis is an axis that runs through the root area and the tail area of ​​the garlic to be identified; taking a first area of ​​a preset length including the first intersection point and a second area of ​​a preset length including the second intersection point on the garlic to be identified along the main axis; calculating the first boundary energy according to the curvature and length of the garlic boundary corresponding to the first area, and calculating the second boundary energy according to the curvature and length of the garlic boundary corresponding to the second area; if there is a boundary energy greater than a preset energy threshold in the first boundary energy and the second boundary energy, it is determined that the garlic to be identified has the garlic tail feature. The above-mentioned preset energy threshold can be set according to actual experience, or the value can be adjusted and determined according to feedback from actual recognition results.

[0051] The curvature of the garlic boundary corresponding to the first area includes the curvature of each boundary point of the garlic boundary in the first area, and the curvature of the garlic boundary corresponding to the second area includes the curvature of each boundary point of the garlic boundary in the second area. The curvature calculation step of the boundary point specifically includes:

[0052] Along the garlic boundary in the area to be calculated, starting from the boundary point k to be calculated in the area to be calculated, determine two boundary points at the positions where the boundary point is moved n boundary points in two directions respectively, and obtain the angle θ(k) formed by two line segments from the boundary point to be calculated to the two determined boundary points respectively, then the curvature of the garlic boundary point corresponding to the area to be calculated is ψ(k)=π-θ(k).

[0053] The above-mentioned method of calculating the first boundary energy according to the curvature and length of the garlic boundary corresponding to the first area and the method of calculating the second boundary energy according to the curvature and length of the garlic boundary corresponding to the second area can be performed in the following manner. The method of calculating the boundary energy according to the curvature and length of the garlic boundary corresponding to the area to be calculated specifically includes: Among them, E is the boundary energy, and L is the length of the garlic boundary corresponding to the area to be calculated.

[0054] Among them, the area to be calculated is the first area or the second area, k is the boundary point sequence number of the garlic boundary corresponding to the area to be calculated, when the area to be calculated is the first area, the curvature of the garlic boundary in the first area can be calculated, thereby calculating the first boundary energy; when the area to be calculated is the second area, the curvature of the garlic boundary in the second area can be calculated, thereby calculating the second boundary energy.

[0055] Among them, in one embodiment, the process of determining the main axis of the garlic to be identified specifically includes: calculating the minimum circumscribed moment of the garlic to be identified; determining the long central axis of the minimum circumscribed moment; and using the long central axis as the main axis of the garlic to be identified. The long central axis of the minimum circumscribed moment is the axis passing through the centers of the two short sides of the minimum circumscribed moment. The longest length of garlic is usually the length along the direction of passing through the root area and the tail area. The calculated long side of the minimum circumscribed moment is also along the direction of the longest length of garlic. Therefore, the probability that the long central axis passes through the root area and the tail area of ​​garlic is very high and is close to the axis passing through the center of the root area and the tail area of ​​garlic. The accuracy of determining the long central axis as the main axis of the garlic to be identified is also higher. It should be noted that an intersection point of the first short side of the minimum circumscribed moment and the edge of the garlic can be used as the first intersection point, and an intersection point of the second short side and the edge of the garlic can be used as the second intersection point. Or, in another embodiment, the process of determining the main axis of the garlic to be identified specifically includes: extracting all boundary points of the garlic to be identified; fitting an ellipse according to the coordinates of all boundary points, such as obtaining an ellipse by tracing all boundary points; and using the long axis of the ellipse as the main axis of the garlic to be identified. In addition, for any garlic, all boundary points of the garlic are extracted and saved, and based on all boundary points of the garlic, a corresponding ellipse is obtained through ellipse fitting. In this way, the main axis of the garlic to be identified is obtained, the processing process is simple, and the accuracy is high, which is not only conducive to improving the accuracy of garlic recognition with skin, but also conducive to improving the recognition efficiency.

[0056] It should be noted that the above-mentioned multiple methods for identifying the characteristics of garlic tails can be used separately, or at least two of them can be used in combination.

[0057] Step S3: If there is a garlic tail feature, the garlic corresponding to the garlic tail feature is determined to be garlic with skin. Specifically, the garlic tail feature is identified in step S2. If it is determined that there is a garlic tail feature, the garlic is determined to be garlic with skin. In this way, shallow-skinned garlic with tails can also be effectively identified, thereby reducing misidentification and improving the recognition accuracy of garlic with skin.

[0058] In one embodiment of the present invention, after collecting the garlic image, the method may further include the following steps: identifying the garlic to be identified in the garlic image with skin by using a trained recognition model based on a convolutional neural network or by color sorting to obtain a target area; scaling the target area to obtain a new target area; extracting the second connected domain where the center point of the new target area is located, corroding the second connected domain to obtain a third target connected domain; dilating the third target connected domain to obtain a fourth target connected domain; judging whether the area difference between the fourth target connected domain and the second connected domain is greater than a second preset threshold; if so, judging that the corresponding garlic to be identified is garlic with skin. The second preset threshold can be set based on experience, such as being set to a number greater than 50%. Of course, the value can also be adjusted and determined based on feedback from actual recognition results.

[0059] In a specific embodiment, a recognition model based on a convolutional neural network is obtained by the following method: collecting a certain amount of garlic image samples; performing data augmentation processing on the collected garlic image samples to quickly obtain samples and make the samples richer, and the recognition model can have good recognition accuracy and robustness through training, and the data augmentation processing specifically includes: rotation at different angles, mirroring, adding noise, changing light intensity, etc.; further, manually annotating the garlic with skin in the garlic image samples after the data augmentation processing, and only the tail area of ​​the garlic with skin can be annotated, or the entire garlic with skin can be annotated; further, the annotated garlic image samples are used as training data to train the convolutional neural network to obtain a recognition model.

[0060] Furthermore, the scaling factor of the target area can be selected according to the actual scene requirements, such as scaling by 1.2 times. For example, the identified target area is scaled by 1.2 times to obtain a new target area, and the second connected domain where the center point is located is extracted. The second connected domain is corroded using a 3*3 erosion kernel. The connected domain after the corrosion is the third target connected domain, recorded as erode_area. The connected domain after the corrosion is dilated. The dilation kernel is also 3*3 in size. The connected domain after the dilation is the fourth target connected domain, recorded as dilate_area. The dilate_area is subtracted from the second connected domain before the corrosion, and it is determined whether the result after the subtraction is greater than the second preset threshold. If it is greater than the second preset threshold, the garlic to be identified is determined to be garlic with skin. Otherwise, that is, the result after the subtraction is less than or equal to the second preset threshold, the garlic to be identified is determined to be garlic without skin. This process is the process of removing the misidentification of garlic with skin when identifying garlic with skin by a recognition model or color sorting method.

[0061] That is to say, the method for identifying garlic with skin in the embodiment of the present invention can identify garlic with skin in two ways. One is to perform garlic tail feature recognition on the garlic to be identified in the collected garlic image, and judge whether the garlic is garlic with skin according to whether the garlic tail feature exists; the other is to perform garlic with skin recognition on the garlic to be identified in the garlic image through a recognition model or color sorting method to obtain a target area, and further remove misidentification of the target area, thereby further improving the recognition accuracy of garlic with skin.

[0062] It should be noted that the two methods for identifying garlic with skin described in the embodiments of the present invention, namely, the method for identifying garlic with skin based on the characteristics of garlic tails and the method for identifying garlic with skin based on a recognition model of a convolutional neural network, can be independent of each other or can complement each other.

[0063] According to the method for identifying garlic with skin in an embodiment of the present invention, garlic tail features are identified for the garlic to be identified in the collected garlic image. When the garlic tail features exist, it is determined that the garlic corresponding to the garlic tail features is garlic with skin, so that garlic with skin can be effectively identified, while reducing misidentification and improving the recognition accuracy of garlic with skin. When applied to the sorting of garlic with skin, the sorting accuracy can be improved.

[0064] A further embodiment of the present invention also provides a garlic identification system with skin.

[0065] Figure 3 FIG. 1 is a structural block diagram of a system for identifying garlic with skin according to an embodiment of the present invention. Figure 3 As shown, the garlic identification system 100 includes: a collection module 110 , an identification module 120 and a processing module 130 .

[0066] Specifically, the acquisition module 110 is used to acquire garlic images.

[0067] Specifically, the garlic here can be garlic to be sorted, mainly peeled garlic, some of which also have some skinned garlic left. It is garlic to be separated from garlic without skin, such as garlic output after being peeled by a peeling machine, some of which may be partially peeled, and some may not be peeled at all.

[0068] A high-speed camera can be used to capture images of garlic being normally transported on a conveyor belt to obtain garlic images.

[0069] The recognition module 120 is used to identify the garlic tail feature of the garlic to be identified in the garlic image. That is, the garlic tail feature is identified to locate the garlic tail, so as to sort the garlic with skin based on whether the garlic tail area exists. The garlic tail feature is a feature that can indicate that the garlic has a tail.

[0070] Specifically, in an embodiment of the present invention, the garlic image contains a plurality of garlics to be identified, and the process of identifying the tail features of each garlic to be identified by the identification module 120 may be the same. When the present embodiment is actually implemented, each garlic to be identified is identified.

[0071] Specifically, the process of identifying the garlic tail feature of the garlic to be identified in the garlic image by the identification module 120 specifically includes: (1) obtaining a binary image of the garlic to be identified based on the garlic image, specifically, removing the background of the collected garlic image, using the minimum bounding rectangle to intercept the garlic to be identified, and obtaining the binary image of the garlic to be identified, or firstly using the minimum bounding rectangle to intercept the garlic to be identified from the garlic image, and then binarizing the intercepted image to obtain the binary image of the garlic to be identified. (2) obtaining a first connected domain where the center point of the binary image of the garlic to be identified is located, corroding the first connected domain, and obtaining a first target connected domain. (3) dilating the first target connected domain, and obtaining a second target connected domain. (4) judging whether the area difference between the second target connected domain and the first connected domain is greater than a first preset threshold; (5) if the area difference between the second target connected domain and the first connected domain is greater than the first preset threshold, it is determined that the garlic to be identified has the garlic tail feature. The first preset threshold value may be determined according to the area of ​​the tail whiskers, such as calculating the average area of ​​the tail whiskers of some garlic in the batch of garlic to be identified, and using the average area as the first preset threshold value.

[0072] In a specific embodiment, the above-mentioned process of corroding the first connected domain can be implemented based on a corrosion core of a preset size, and the corrosion core of the preset size can be selected according to the actual scene requirements, for example, a corrosion core of 3*3 size is selected. The above-mentioned process of dilating the first target connected domain can be implemented based on a dilating core of a preset size, and the dilating core of the preset size can be selected according to the actual scene requirements, for example, a dilating core of 3*3 size is selected. For example, the background of the collected garlic image is removed to extract the binary image of the garlic to be identified; the first connected domain where the center point of the binary image of the garlic to be identified is located is obtained, and the first connected domain is corroded using a 3*3 erosion kernel. The connected domain after the corrosion is the first target connected domain, recorded as erode_area; the first target connected domain is dilated, and the dilation kernel is also 3*3 in size. The connected domain after the dilation is the second target connected domain, recorded as dilate_area; the dilate_area is subjected to area difference processing with the connected domain before the corrosion processing, that is, the first connected domain, to determine whether the result after the difference is greater than a first preset threshold value. If it is greater than the first preset threshold value, it is determined that the garlic to be identified has garlic tail features.

[0073] Alternatively, in another embodiment of the present invention, the recognition module 120 performs garlic tail feature recognition on the garlic to be recognized in the garlic image, specifically comprising: using a preset target segmentation model to identify the pixel points of the pending garlic tail region of the garlic to be recognized in the garlic image; setting a sliding window of a preset size, sliding the sliding window in the pending garlic tail region, and judging whether the number of pixel points of the pending garlic tail region existing in the sliding window is greater than a preset number threshold; if so, the center point of the sliding window is determined as a valid tail point, otherwise the center point of the sliding window can be determined as an invalid tail point, repeating this step until all the pixel points in the pending garlic tail region are traversed or at least one valid tail point is determined; judging whether the corresponding garlic to be recognized has garlic tail features according to the valid tail points in the pending garlic tail region. Among them, the preset number threshold can be set according to experience, and the value can also be adjusted and determined according to the feedback of the actual recognition result. The target segmentation model is obtained by training a neural network, and the pixels of the garlic tail region are marked in the garlic sample used for training. The target segmentation model obtained in this way can identify the pixel points in the garlic tail area in the garlic image.

[0074] Among them, the process of judging whether the corresponding garlic to be identified has the garlic tail feature according to the effective tail points in the to-be-determined garlic tail area may include: if the effective tail point is identified or the number of the effective tail points identified reaches a predetermined value, it is determined that the corresponding garlic to be identified has the garlic tail feature.

[0075] As mentioned above, the garlic to be identified may be partially peeled garlic, or it may be completely unpeeled garlic. There may be small pieces of skin on the surface of this kind of garlic with skin. The small pieces of skin are generally in a tilted state, which makes it similar to the garlic tail, which is easy to cause misidentification, thereby affecting the accuracy of sorting. The embodiment of the present invention identifies the pixel points of the pending garlic tail region of the garlic to be identified through a preset target segmentation model. The pending garlic tail region here may be the garlic tail region, or it may be small pieces of skin. Therefore, to avoid misidentification, further identification and determination are required to exclude small pieces of skin. Slide a preset sliding window in the pending garlic tail region, and determine whether the number of pixel points of the pending garlic tail region existing in the sliding window at the current position is greater than the preset number threshold; if so, the center point of the sliding window is determined as a valid tail point, otherwise the center point of the sliding window is determined as an invalid tail point, and this step is repeated until all pixel points in the pending garlic tail region are traversed or at least one valid tail point is determined. Specifically, the number of pixels identified in the garlic tail region is large, while the area of ​​the small peel is small and the number of pixels is small. Therefore, by comparing and analyzing the number of pixels captured in the sliding window to determine whether it is the garlic tail region, the garlic tail region and the small peel can be accurately distinguished, thereby improving the accuracy of identifying the garlic tail region, and further preventing misidentification caused by the influence of the small peel, thereby improving the accuracy of identifying garlic with skin.

[0076] In a specific embodiment, the preset target segmentation model is obtained by pre-training, and is used to identify the pixels of the undetermined garlic tail region of the garlic to be identified. The preset sliding window size can be selected according to the actual scene requirements, for example, a sliding window of 10*10 is selected. Or, in another embodiment of the present invention, the recognition module 120 performs garlic tail feature recognition on the garlic to be identified in the garlic image, specifically including: determining the main axis of the garlic to be identified, obtaining the first intersection and the second intersection with the farthest distance along the main axis direction on the edge of the garlic to be identified, wherein the main axis is the axis running through the root area and the tail area of ​​the garlic; along the main axis, respectively taking the first area of ​​the preset length including the first intersection and the second area of ​​the preset length including the second intersection on the garlic; it should be noted that the width of the first area and the second area in the direction perpendicular to the main axis should cover the width of the garlic in this direction, that is, the complete width of the garlic is intercepted in this direction. Further, according to the first area and the second area, it is judged whether the garlic to be identified has the garlic tail feature.

[0077] In a specific embodiment, in combination Figure 2 As shown, the identification module 120 determines whether the garlic to be identified has the garlic tail feature according to the first area and the second area, specifically including: determining the first angle ∠A 1 O 1 B1 , where A 1 and B 1 are the intersection points of the first vertical line of the main axis and the boundary of the garlic to be identified, O 1 is the first intersection point, and the distance from the first vertical line to the first intersection point is the first preset distance; determine the second angle ∠A 2 O 2 B 2 , where A 2 and B 2 are the intersection points of the second perpendicular line of the main axis and the boundary of the garlic to be identified, O 2 is the second intersection point, and the distance from the second vertical line to the second intersection point is the second preset distance; if the first angle ∠A 1 O 1 B 1 and the second angle ∠A 2 O 2 B 2 If there is an angle less than the preset angle threshold in the angle, it is determined that the garlic to be identified has garlic tail features. The preset angle threshold can be set according to actual experience, or the value can be adjusted and determined according to feedback from actual recognition results. The first preset distance and the second preset distance can be set according to actual needs, and the two can be the same or different.

[0078] In another embodiment, after taking a first area of ​​a preset length including a first intersection and a second area of ​​a preset length including a second intersection on the to-be-identified garlic along the main axis, the method may further include: determining the area change amplitude of the first area and the second area, and taking the one with a larger area change amplitude as the to-be-identified garlic tail area. After determining the garlic tail area, the angle is calculated for the to-be-identified garlic tail area in a similar angle calculation method as described above, and whether there is a garlic tail feature is determined based on the size of the angle. The specific calculation method can refer to the aforementioned related content, which will not be described in detail here.

[0079] Alternatively, in one embodiment of the present invention, the process of identifying the garlic tail feature of the garlic to be identified in the garlic image specifically includes: determining the main axis of the garlic to be identified, obtaining the first intersection point and the second intersection point of the main axis and the edge of the garlic to be identified, wherein the main axis is an axis that runs through the root area and the tail area of ​​the garlic to be identified; taking a first area of ​​a preset length including the first intersection point and a second area of ​​a preset length including the second intersection point on the garlic to be identified along the main axis; calculating the first boundary energy according to the curvature and length of the garlic boundary corresponding to the first area, and calculating the second boundary energy according to the curvature and length of the garlic boundary corresponding to the second area; if there is a boundary energy greater than a preset energy threshold in the first boundary energy and the second boundary energy, it is determined that the garlic to be identified has the garlic tail feature. The above-mentioned preset energy threshold can be set according to actual experience, or the value can be adjusted and determined according to feedback from actual recognition results.

[0080] The curvature of the garlic boundary corresponding to the first area includes the curvature of each boundary point of the garlic boundary in the first area, and the curvature of the garlic boundary corresponding to the second area includes the curvature of each boundary point of the garlic boundary in the second area. The curvature calculation step of the boundary point specifically includes:

[0081] Along the garlic boundary in the area to be calculated, starting from the boundary point k to be calculated in the area to be calculated, determine two boundary points at the positions where the boundary point is moved n boundary points in two directions respectively, and obtain the angle θ(k) formed by two line segments from the boundary point to be calculated to the two determined boundary points respectively, then the curvature of the garlic boundary point corresponding to the area to be calculated is ψ(k)=π-θ(k).

[0082] The above-mentioned method of calculating the first boundary energy according to the curvature and length of the garlic boundary corresponding to the first area and the method of calculating the second boundary energy according to the curvature and length of the garlic boundary corresponding to the second area can be performed in the following manner. The method of calculating the boundary energy according to the curvature and length of the garlic boundary corresponding to the area to be calculated specifically includes: Among them, E is the boundary energy, and L is the length of the garlic boundary corresponding to the area to be calculated.

[0083] Among them, the area to be calculated is the first area or the second area, k is the boundary point sequence number of the garlic boundary corresponding to the first area, when the area to be calculated is the first area, the curvature of the garlic boundary in the first area can be calculated, thereby calculating the first boundary energy; when the area to be calculated is the second area, the curvature of the garlic boundary in the second area can be calculated, thereby calculating the second boundary energy.

[0084] In one embodiment, the process of determining the main axis of the garlic to be identified specifically includes: calculating the minimum circumscribed moment of the garlic to be identified; determining the long central axis of the minimum circumscribed moment; and using the long central axis as the main axis of the garlic to be identified. The long central axis of the minimum circumscribed moment is an axis passing through the centers of the two short sides of the minimum circumscribed moment. The longest length of the garlic is usually the length along the direction passing through the root region and the tail region. The calculated long side of the minimum circumscribed moment is also along the direction of the longest length of the garlic. Therefore, the probability that the long central axis passes through the root region and the tail region of the garlic is very high and is close to the axis passing through the centers of the root region and the tail region of the garlic. The accuracy of determining the long central axis as the main axis of the garlic to be identified is also higher.

[0085] Alternatively, in another embodiment, the process of determining the main axis of the garlic to be identified specifically includes: extracting all boundary points of the garlic to be identified; fitting an ellipse according to the coordinates of all boundary points, such as obtaining an ellipse by tracing all boundary points; and using the major axis of the ellipse as the main axis of the garlic to be identified. In addition, for any garlic, all boundary points of the garlic are extracted and saved, and based on all boundary points of the garlic, a corresponding ellipse is obtained by ellipse fitting. Obtaining the main axis of the garlic to be identified in this way has a simple processing process and a high accuracy rate, which is not only conducive to improving the accuracy rate of identifying garlic with skin, but also conducive to improving the recognition efficiency.

[0086] It should be noted that the above-mentioned multiple methods for identifying the characteristics of garlic tails can be used separately, or at least two of them can be used in combination.

[0087] The processing module 130 is used for determining, when a garlic tail feature is to be identified, that the garlic corresponding to the garlic tail feature is garlic with skin.

[0088] In one embodiment of the present invention, the recognition module 120 is also used to identify the garlic to be identified in the garlic image with skin by using a trained recognition model based on a convolutional neural network or by color sorting to obtain a target area; scale the target area to obtain a new target area; extract the second connected domain where the center point of the new target area is located, corrode the second connected domain to obtain a third target connected domain; dilate the third target connected domain to obtain a fourth target connected domain; determine whether the area difference between the fourth target connected domain and the second connected domain is greater than a second preset threshold; if so, determine that the corresponding garlic to be identified is garlic with skin. The second preset threshold can be set based on experience, such as being set to a number greater than 50%. Of course, the value can also be adjusted and determined based on feedback from actual recognition results.

[0089] In a specific embodiment, a recognition model based on a convolutional neural network is obtained by the following method: collecting a certain amount of garlic image samples; performing data augmentation processing on the collected garlic image samples to quickly obtain samples and make the samples richer, and the recognition model can have good recognition accuracy and robustness through training, and the data augmentation processing specifically includes: rotation at different angles, mirroring, adding noise, changing light intensity, etc.; further, manually annotating the garlic with skin in the garlic image samples after the data augmentation processing, and the annotation range can be to the tail of the garlic with skin, or the entire garlic with skin can be annotated; further, the annotated garlic image samples are used as training data to train the convolutional neural network to obtain a recognition model.

[0090] Furthermore, the scaling factor of the target area can be selected according to the actual scene requirements, such as scaling by 1.2 times. For example, the identified target area is scaled by 1.2 times to obtain a new target area, and the second connected domain where the center point is located is extracted. The second connected domain is corroded using a 3*3 erosion kernel. The connected domain after the corrosion is the third target connected domain, recorded as erode_area. The connected domain after the corrosion is dilated. The dilation kernel is also 3*3 in size. The connected domain after the dilation is the fourth target connected domain, recorded as dilate_area. The dilate_area is subtracted from the second connected domain before the corrosion, and it is determined whether the result after the subtraction is greater than the second preset threshold. If it is greater than the second preset threshold, the garlic to be identified is determined to be garlic with skin. Otherwise, that is, the result after the subtraction is less than or equal to the second preset threshold, the garlic to be identified is determined to be garlic without skin. This process is the process of removing the misidentification of garlic with skin when identifying garlic with skin by a recognition model or color sorting method.

[0091] That is to say, the garlic with skin identification system of the embodiment of the present invention can identify garlic with skin in two ways. One is to perform garlic tail feature recognition on the garlic to be identified in the collected garlic image, and judge whether the garlic is garlic with skin according to whether the garlic tail feature exists; the other is to perform garlic with skin recognition on the garlic to be identified in the garlic image through a recognition model or color sorting method to obtain a target area, and further remove misidentification of the target area, thereby further improving the recognition accuracy of garlic with skin.

[0092] It should be noted that the two methods for identifying garlic with skin described in the embodiments of the present invention, namely, the method for identifying garlic with skin based on the characteristics of garlic tails and the method for identifying garlic with skin based on a recognition model of a convolutional neural network, can be independent of each other or can complement each other.

[0093] It should be noted that the specific execution steps of each module of the peeled garlic identification system of the embodiment of the present invention are similar to the specific implementation methods of the peeled garlic identification method of the embodiment of the present invention. For other specific details, please refer to the description of the corresponding parts above.

[0094] According to the garlic with skin identification system of the embodiment of the present invention, the garlic tail feature is identified for the garlic to be identified in the collected garlic image. When the garlic tail feature exists, the garlic corresponding to the garlic tail feature is determined to be garlic with skin, so that the garlic with skin can be effectively identified, while reducing misidentification and improving the recognition accuracy of garlic with skin. When applied to the sorting of garlic with skin, the sorting accuracy can be improved.

[0095] A further embodiment of the present invention further provides a sorting device, which includes the garlic identification system with skin described in any one of the above embodiments of the present invention. Therefore, the specific implementation of the sorting device in the embodiment of the present invention is similar to the specific implementation of the garlic identification system with skin in the embodiment of the present invention. For details, please refer to the description of the system part. In order to reduce redundancy, it will not be repeated here.

[0096] In a specific embodiment, the sorting device is, for example, a color sorter.

[0097] According to the sorting device of the embodiment of the present invention, the garlic tail feature is identified for the garlic to be identified in the collected garlic image. When the garlic tail feature exists, it is determined that the garlic corresponding to the garlic tail feature is garlic with skin, so that the garlic with skin can be effectively identified, while reducing misidentification and improving the accuracy.

[0098] In addition, other structures and functions of the sorting device according to the embodiment of the present invention are known to ordinary technicians in the field and will not be described in detail to reduce redundancy.

[0099] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0100] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

Claims

1. A method for identifying garlic with skin, characterized in that: Applied in the field of garlic sorting technology, the method comprises the following steps: Collect garlic images; Performing garlic tail feature recognition on the garlic to be identified in the garlic image; If the garlic tail feature is present, the garlic to be identified is determined to be garlic with skin; Using at least one of the following four methods to identify the garlic tail features of the garlic to be identified in the garlic image; Method 1: performing garlic tail feature recognition on the garlic to be recognized in the garlic image, specifically comprising: According to the garlic image, a binary image of the garlic to be identified is obtained; Acquire a first connected domain where the center point of the binary image of the to-be-identified garlic is located, and perform corrosion processing on the first connected domain to obtain a first target connected domain; Performing expansion processing on the first target connected domain to obtain a second target connected domain; Determine whether the area difference between the second target connected domain and the first connected domain is greater than a first preset threshold; If yes, it is determined that the garlic to be identified has garlic tail features; Method 2: performing garlic tail feature recognition on the garlic to be recognized in the garlic image, specifically comprising: Using a preset target segmentation model, identifying pixel points in a to-be-identified garlic caudal region of the to-be-identified garlic in the garlic image; A sliding window of a preset size is slid in the pending garlic tail whisker region, and it is determined whether the number of pixel points of the pending garlic tail whisker region in the sliding window at the current position is greater than a preset number threshold; if yes, the center point of the sliding window is determined as a valid tail whisker point, and this step is repeated until all pixel points in the pending garlic tail whisker region are traversed or at least one valid tail whisker point is determined; Judging whether the corresponding garlic to be identified has garlic tail features according to the effective tail points in the to-be-determined garlic tail area; Method 3: performing garlic tail feature recognition on the garlic to be recognized in the garlic image, specifically comprising: Determine the main axis of the garlic to be identified, and obtain the first intersection point and the second intersection point on the edge of the garlic to be identified that are the farthest apart along the main axis direction, wherein the main axis is an axis that runs through the root area and the tail area of ​​the garlic to be identified; A first area of ​​a preset length including the first intersection and a second area of ​​a preset length including the second intersection are respectively taken on the to-be-identified garlic along the main axis; According to the first area and the second area, determining whether the to-be-identified garlic has a garlic tail feature; Method 4: performing garlic tail feature recognition on the garlic to be recognized in the garlic image, including: Determine the main axis of the garlic to be identified, and obtain a first intersection point and a second intersection point of the main axis with the edge of the garlic to be identified, wherein the main axis is an axis that runs through the root region and the tail region of the garlic to be identified; A first area of ​​a preset length including the first intersection and a second area of ​​a preset length including the second intersection are respectively taken on the to-be-identified garlic along the main axis; Calculating a first boundary energy according to the curvature and length of the garlic boundary corresponding to the first area, and calculating a second boundary energy according to the curvature and length of the garlic boundary corresponding to the second area; If there is a boundary energy greater than a preset energy threshold value between the first boundary energy and the second boundary energy, it is determined that the to-be-identified garlic has a garlic tail feature.

2. The method for identifying garlic with skin according to claim 1, characterized in that: The step of judging whether the to-be-identified garlic has a garlic tail feature according to the first area and the second area includes: Determine the first angle ∠ ,in, and are the intersections of the first vertical line of the main axis and the boundary of the garlic to be identified, is the first intersection point, and the distance from the first vertical line to the first intersection point is a first preset distance; Determine the second angle ∠ ,in, and are the intersections of the second perpendicular line of the main axis and the boundary of the garlic to be identified, is the second intersection point, and the distance from the second vertical line to the second intersection point is a second preset distance; If the first angle ∠ and the second angle ∠ If there is an angle less than a preset angle threshold in the garlic, it is determined that the garlic to be identified has a garlic tail feature.

3. The method for identifying garlic with skin according to claim 1, characterized in that: Determining the main axis of the garlic to be identified specifically includes: Calculating the minimum circumscribed moment of the garlic to be identified; Determining the major central axis of the minimum circumscribed moment; The long central axis is used as the main axis of the garlic to be identified.

4. The method for identifying garlic with skin according to claim 1, characterized in that: Determining the main axis of the garlic to be identified specifically includes: Extracting all boundary points of the garlic to be identified; Fit an ellipse according to the coordinates of all boundary points; The major axis of the ellipse is used as the main axis of the garlic to be identified.

5. The method for identifying garlic with skin according to any one of claims 1 to 2, characterized in that: After collecting garlic images, it also includes: The garlic to be identified in the garlic image is identified with the skin of the garlic by using a trained recognition model based on a convolutional neural network or by color sorting to obtain a target area; Scaling the target area to obtain a new target area; Extracting a second connected domain where the center point of the new target area is located, and performing corrosion processing on the second connected domain to obtain a third target connected domain; Performing expansion processing on the third target connected domain to obtain a fourth target connected domain; Determine whether the area difference between the fourth target connected domain and the second connected domain is greater than a second preset threshold; If yes, it is determined that the garlic to be identified is garlic with skin.

6. A garlic identification system with skin, characterized in that: Applied in the field of garlic sorting technology, including: A collection module, used for collecting garlic images; A recognition module, used for identifying the garlic tail features of the garlic to be identified in the garlic image; A processing module, used for determining that the garlic to be identified is garlic with skin when the garlic tail feature exists; The processing module is also used to perform garlic tail feature recognition on the garlic to be recognized in the garlic image using at least one of the following four methods; Method 1: obtaining a binary image of the garlic to be identified according to the garlic image; Acquire a first connected domain where the center point of the binary image of the to-be-identified garlic is located, and perform corrosion processing on the first connected domain to obtain a first target connected domain; Performing expansion processing on the first target connected domain to obtain a second target connected domain; Determine whether the area difference between the second target connected domain and the first connected domain is greater than a first preset threshold; If yes, it is determined that the garlic to be identified has garlic tail features; Method 2: using a preset target segmentation model to identify pixel points in the undetermined garlic caudal region of the garlic to be identified in the garlic image; A sliding window of a preset size is slid in the pending garlic tail whisker region, and it is determined whether the number of pixel points of the pending garlic tail whisker region in the sliding window at the current position is greater than a preset number threshold; if yes, the center point of the sliding window is determined as a valid tail whisker point, and this step is repeated until all pixel points in the pending garlic tail whisker region are traversed or at least one valid tail whisker point is determined; Judging whether the corresponding garlic to be identified has garlic tail features according to the effective tail points in the to-be-determined garlic tail area; Method three: determining the main axis of the garlic to be identified, and obtaining the first intersection point and the second intersection point on the edge of the garlic to be identified that are the farthest apart along the main axis direction, wherein the main axis is an axis that runs through the root area and the tail area of ​​the garlic to be identified; A first area of ​​a preset length including the first intersection and a second area of ​​a preset length including the second intersection are respectively taken on the to-be-identified garlic along the main axis; According to the first area and the second area, determining whether the to-be-identified garlic has a garlic tail feature; Method 4: determining the main axis of the garlic to be identified, and obtaining a first intersection point and a second intersection point of the main axis with the edge of the garlic to be identified, wherein the main axis is an axis that runs through the root region and the tail region of the garlic to be identified; A first area of ​​a preset length including the first intersection and a second area of ​​a preset length including the second intersection are respectively taken on the to-be-identified garlic along the main axis; Calculating a first boundary energy according to the curvature and length of the garlic boundary corresponding to the first area, and calculating a second boundary energy according to the curvature and length of the garlic boundary corresponding to the second area; If there is a boundary energy greater than a preset energy threshold value between the first boundary energy and the second boundary energy, it is determined that the to-be-identified garlic has a garlic tail feature.

7. A sorting device, characterized in that: The invention comprises the garlic identification system with skin as claimed in claim 6.