Automatic identification processing method and system for packaging hawthorn sticks, terminal and storage medium
Through automatic identification and processing methods, image acquisition and edge detection technology are used to solve the problem of low efficiency in hawthorn rod selection, and efficient and accurate hawthorn rod selection and packaging are achieved.
Patent Information
- Application Number
- CN202411400542.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-02-07
AI Technical Summary
In the prior art, the selection efficiency of hawthorn rods is relatively low, mainly due to manual removal, which is inefficient.
A method of automatic identification and processing of hawthorn rods for packaging is adopted to automatically identify and eliminate defects or non-compliant hawthorn rods through steps such as image acquisition, edge extraction, comparison and detection.
It improves the selection efficiency and accuracy of hawthorn rods, and can quickly identify and eliminate defective hawthorn rods, ensuring that the pattern facing upwards is correctly packaged.
Smart Images

Figure CN119399753A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of finished hawthorn packaging, and in particular to a method, system, terminal and storage medium for automatically identifying and processing hawthorn sticks for packaging. Background Art
[0002] After the hawthorn sticks are processed and formed, they need to be packaged. In order to ensure the quality of the hawthorn sticks, the defective products need to be removed, and at the same time, the hawthorn sticks need to be packaged with the patterned side facing upwards.
[0003] However, in the related art, before the hawthorn sticks are packaged, the selection of hawthorn sticks is mostly done by manual sorting, which results in low efficiency in selecting the hawthorn sticks. Summary of the invention
[0004] In order to improve the efficiency of selecting hawthorn sticks, the present application provides a method, system, terminal and storage medium for automatically identifying and processing hawthorn sticks for packaging.
[0005] In the first aspect, the present application provides a method for automatically identifying and processing hawthorn sticks for packaging, which adopts the following technical solution: A method for automatically identifying and processing hawthorn sticks for packaging, comprising: Collecting original images of the hawthorn sticks delivered to an image collection location, wherein each hawthorn stick has the same position at the image collection location; Extracting the edge contour of the original image; Comparing the edge profile with a pre-collected standard profile of a normal hawthorn stick to generate an edge comparison result; If the edge comparison result is mismatch, the current hawthorn stick is discarded; If the edge comparison result is a match, then the pattern initial detection step is entered; According to the pattern initial detection step, generating a pattern initial comparison result; If the initial comparison result of the pattern is mismatch, the current hawthorn stick is discarded; If the initial pattern comparison result is a match, then entering the pattern similarity detection step; According to the pattern similarity detection step, generating a pattern similarity comparison result; If the pattern similarity comparison result is mismatch, the current hawthorn stick is discarded; If the pattern similarity comparison result is a match, the current hawthorn stick continues to be transmitted.
[0006] By adopting the above technical scheme, edge detection can directly remove defective hawthorn sticks; pattern initial detection can directly remove those with inconsistent patterns, for example, the pattern is on the back of the hawthorn stick; pattern similarity detection can again detect the hawthorn sticks with the pattern facing upward to detect whether there are defects in the pattern, so as to remove the defective ones again; since edge detection and pattern initial detection can quickly remove defective hawthorn sticks, and pattern similarity detection can then detect hawthorn sticks with less obvious defects, it is possible to achieve rapid selection of hawthorn sticks and improve the accuracy of hawthorn stick selection.
[0007] Optionally, the specific steps of comparing the edge contour with a pre-collected standard contour of a normal hawthorn stick to generate an edge comparison result include: Mapping the edge contour into the standard contour; Selecting a first reference point on the standard contour; Selecting a second reference point on the edge contour corresponding to the position of the first reference point; Obtaining a matching distance between the first reference point and the corresponding second reference point; Determining whether the matching interval is within a preset error interval; If so, the edge comparison result is a match; If not, the edge comparison result is mismatch.
[0008] By adopting the above technical solution, since the position of the current hawthorn stick at the image acquisition location is the same as the position of the hawthorn stick when the standard contour is acquired, after extracting the edge contour of the current hawthorn stick, the edge contour can be directly mapped into the standard contour, thereby making a judgment based on the distance between the first reference point and the corresponding second reference point to improve the speed of judgment.
[0009] Optionally, after the edge result is mismatched, the following steps are performed: The standard profile is rotated 180° counterclockwise with the midpoint of the standard profile length as the rotation point, and the edge profile is compared with the standard profile again.
[0010] By adopting the technical solution, it is possible to avoid rejecting hawthorn sticks that are placed in reverse with correct edges, thereby further improving the accuracy of hawthorn stick selection.
[0011] Optionally, the pattern initial detection step includes: Determining whether the edge contour is unique; If so, the initial pattern comparison result is mismatch; If not, constructing a two-dimensional coordinate axis based on the largest edge contour; Based on the two-dimensional coordinate axis, obtaining the original position of the redundant contour; Comparing the original position with the position of the pattern in the pre-acquired standard image; If there is a match between the original position and the expected position, the initial pattern comparison result is a match; If there is no original position that matches the expected position, the initial pattern comparison result is mismatch.
[0012] By adopting the above technical solution, the initial detection of the pattern can be judged based on whether the edge contour is unique. If it is unique, it means that the pattern is facing downward, so it can be directly eliminated; if it is not unique, it means that there may be a pattern, so the position of the redundant contour can be further obtained and compared with the position of the pattern in the standard image. If they match, it means that the pattern exists, so it can be said that the pattern is facing upward, thereby achieving a quick judgment that the pattern is facing upward.
[0013] Optionally, after the initial pattern comparison result is mismatch, the method further comprises: The redundant contour is translated, and the translation length is the length of the largest edge contour; Each time the translation is performed, the current original position of the redundant contour is obtained; Determine whether there is the current original position that matches the expected position; If yes, then the initial pattern comparison result is a match; If not, the initial pattern comparison result is mismatch.
[0014] By adopting the above technical solution, when the position of the redundant contour does not match the position of the pattern in the standard image, it is possible that there is a pattern in the hawthorn stick, but the direction of the hawthorn stick is opposite, which will also cause position mismatch. Therefore, in order to ensure the accuracy of hawthorn stick selection, the redundant contour can be translated. After translating to the length of the maximum edge contour, it can be determined during the translation process whether the position of the redundant contour after each translation matches the position of the pattern in the standard image.
[0015] Optionally, the similarity detection step includes: Mapping a redundant contour corresponding to the current original position that should be matched in position into a pattern contour of the standard image; Selecting a third reference point from the redundant contour and selecting a fourth reference point corresponding to the position of the third reference point from the pattern contour; Acquire a similar distance between the third reference point and the fourth reference point; Determine whether all the similarity intervals are smaller than a preset similarity error interval; If so, the pattern similarity comparison result generated is a match; If not, the generated pattern similarity comparison result is a mismatch.
[0016] By adopting the above technical solution, after determining that the pattern is facing upward, it is possible to further judge whether the pattern has defects, thereby further improving the accuracy of hawthorn stick selection.
[0017] Optionally, the automatic identification processing method further includes: Get the ambient brightness value; Determining whether the ambient brightness value matches a standard brightness value corresponding to a standard image; If not, adjust the brightness of the fill light.
[0018] By adopting the above technical solution, it is possible to avoid environmental factors affecting the recognition and judgment of images.
[0019] In the second aspect, the present application provides an automatic identification and processing system for packaging hawthorn sticks, which adopts the following technical solutions: An automatic identification and processing system for hawthorn sticks for packaging, comprising: An image acquisition module, used for acquiring original images of the hawthorn sticks delivered to an image acquisition location, wherein each hawthorn stick has the same position at the image acquisition location; An edge extraction module, used to extract the edge contour of the original image; An edge comparison module, used for comparing the edge contour with a pre-collected standard contour of a normal hawthorn stick, and generating an edge comparison result; A rejection module, used for rejecting the current hawthorn stick when the edge comparison result is mismatch; A pattern initial comparison module, used for generating a pattern initial comparison result according to the pattern initial detection step when the edge comparison result is a match; The elimination module is used to eliminate the current hawthorn stick when the initial pattern comparison result is mismatch; A pattern similarity comparison module, used for generating a pattern similarity comparison result according to the pattern similarity detection step when the initial pattern comparison result is a match; The elimination module is used to eliminate the current hawthorn stick when the pattern similarity comparison result is mismatch.
[0020] By adopting the above technical scheme, edge detection can directly remove defective hawthorn sticks; pattern initial detection can directly remove those with inconsistent patterns, for example, the pattern is on the back of the hawthorn stick; pattern similarity detection can again detect the hawthorn sticks with the pattern facing upward to detect whether there are defects in the pattern, so as to remove the defective ones again; since edge detection and pattern initial detection can quickly remove defective hawthorn sticks, and pattern similarity detection can then detect hawthorn sticks with less obvious defects, it is possible to achieve rapid selection of hawthorn sticks and improve the accuracy of hawthorn stick selection.
[0021] In a third aspect, the present application provides a terminal, which adopts the following technical solution: A terminal, comprising: A memory storing an automatic identification and processing program for hawthorn sticks for packaging; The processor is used to execute the program stored in the memory to implement the steps of the above-mentioned method for automatically identifying and processing hawthorn sticks for packaging.
[0022] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution: A computer-readable storage medium stores a computer program that can be loaded by a processor and execute the above-mentioned automatic identification and processing method for packaging hawthorn sticks.
[0023] In summary, the present application has at least the following beneficial effects: The purpose of setting the edge detection step, the pattern initial detection step and the pattern similarity detection step is that, edge detection can directly remove defective hawthorn sticks; pattern initial detection can directly remove those with inconsistent patterns, for example, the pattern is on the back of the hawthorn stick; pattern similarity detection can again detect the hawthorn sticks with the pattern facing upward to detect whether there are defects in the pattern, so as to remove the defective ones again; since edge detection and pattern initial detection can quickly remove defective hawthorn sticks, and pattern similarity detection can detect hawthorn sticks with less obvious defects, it can not only achieve rapid selection of hawthorn sticks, but also improve the accuracy of hawthorn stick selection. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a structural block diagram of the network architecture of this application; Figure 2 It is a flowchart of an embodiment of the method of the present application; Figure 3 It is a flowchart of a specific method of edge comparison; Figure 4 is a flowchart of the initial pattern detection step; Figure 5 It is a flowchart of the pattern similarity detection step; Figure 6 It is a structural block diagram of an embodiment of the system of the present application.
[0025] Explanation of the reference numerals: 101, image acquisition module; 102, edge extraction module; 103, edge comparison module; 104, elimination module; 105, pattern initial comparison module; 106, pattern similarity comparison module; 201, belt conveyor; 202, industrial camera; 203, host computer; 204, air blowing structure; 205, fill light. DETAILED DESCRIPTION
[0026] To make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the following will be combined with the appended drawings of the embodiments of the present invention. Figure 1 -Attached Figure 6 , the technical solutions in the embodiments of the present invention are clearly and completely described. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] The automatic identification processing method of this application is implemented based on a network architecture. Figure 1 , the network architecture includes a belt conveyor 201, an industrial camera 202, a host computer 203, an air blowing structure 204 and a fill light 205. Among them, the belt conveyor 201 is used to transport hawthorn sticks to the packaging place. The conveyor belt of the belt conveyor 201 is provided with negative pressure suction holes along the length direction, which are used to suck the hawthorn sticks on the belt conveyor 201 to prevent the hawthorn sticks from moving in direction during transmission. The industrial camera 202 is installed on the belt conveyor 201 and is located in the middle section of the transmission. The industrial camera 202 is aligned with the belt conveyor 201 as the image acquisition point. Each hawthorn stick recognized by the industrial camera 202 has the same position at the image acquisition point. The host computer 203 is connected to the belt conveyor 201, the industrial camera 202 and the air blowing structure 204 in communication to control the start and stop of the belt conveyor 201, control the image acquisition, image reception and recognition of the industrial camera 202, and control the action of the air blowing structure 204. When the hawthorn stick is defective, the host computer 203 controls the blowing structure 204 to blow the defective hawthorn stick off the belt conveyor 201; the blowing structure 204 is installed at the industrial camera 202 and is a conventional blowing structure 204. The fill light 205 is connected to the host computer 203 for communication and is installed on one side of the industrial camera 202 to adjust the ambient brightness when the industrial camera 202 collects images. The automatic recognition processing system in this application runs on the host computer 203.
[0028] The first embodiment of the present application discloses a method for automatically identifying and processing hawthorn sticks for packaging. Figure 2As an implementation of the automatic identification processing method, the automatic identification processing method may include S101-S111: S101, collecting original images of hawthorn sticks transmitted to an image collection location, wherein each hawthorn stick has the same position at the image collection location; S102, extracting the edge contour of the original image; S103, comparing the edge contour with the pre-collected standard contour of a normal hawthorn stick to generate an edge comparison result; S104, if the edge comparison result is mismatch, the current hawthorn stick is discarded; S105, if the edge comparison result is a match, then enter the pattern initial detection step; S106, generating an initial pattern comparison result according to the pattern initial detection step; S107, if the initial pattern comparison result is mismatch, the current hawthorn stick is discarded; S108, if the initial pattern comparison result is a match, then enter the pattern similarity detection step; S109, generating a pattern similarity comparison result according to the pattern similarity detection step; S110, if the pattern similarity comparison result is mismatch, the current hawthorn stick is discarded; S111, if the pattern similarity comparison result is a match, continue to transmit the current hawthorn stick.
[0029] Specifically, after the original image of the hawthorn stick is collected, the edge contour of the original image is identified and extracted according to a conventional image edge recognition algorithm. After extraction, it is compared with the standard contour to generate an edge comparison result; the standard contour refers to collecting a standard image of a normal hawthorn stick, identifying the edge contour of the standard image according to the image edge recognition algorithm, and extracting it, and the standard contour does not include the contour of the pattern in the standard image.
[0030] For a specific implementation of S103, refer to Figure 2 , which may include S201-S207: S201, mapping the edge contour into the standard contour; S202, selecting a first reference point on the standard contour; S203, selecting a second reference point on the edge contour corresponding to the position of the first reference point; S204, obtaining a matching distance between the first reference point and the corresponding second reference point; S205, determining whether all matching intervals are within a preset error interval; S206, if yes, the edge comparison result is a match; S207, if not, the edge comparison result is mismatch.
[0031] Specifically, after mapping the edge contour to the standard contour, multiple first reference points can be selected on the standard contour, and multiple second reference points corresponding to the positions of the first reference points can be selected on the edge contour to obtain the matching spacing between the first reference points and the corresponding second reference points. If a matching spacing is within the error spacing, it means that the edge contour here matches the standard contour. If a matching spacing is not within the error spacing, it means that the edge contour here does not match the standard contour. If the matching spacings corresponding to all reference points are within the error spacing, it means that the edge comparison result is a match.
[0032] When the edge comparison result is mismatch, the midpoint of the standard contour length can be used as the rotation point, and the standard contour can be rotated 180° counterclockwise, and then the edge contour can be compared with the standard contour again according to the above edge comparison steps.
[0033] Reference Figure 4 , the pattern initial detection step may include S401-S407: S401, determining whether the edge contour is unique; S402, if yes, the initial pattern comparison result is mismatch; S403, if not, constructing a two-dimensional coordinate axis based on the largest edge contour; S404, obtaining the original position of the redundant contour based on the two-dimensional coordinate axis; S405, comparing the original position with the position of the pattern in the pre-obtained standard image; S406, if there is a match between an original position and the expected position, the initial pattern comparison result is a match; S407: If there is no original position that matches the expected position, the initial pattern comparison result is mismatch.
[0034] Specifically, if the pattern is facing downward, there is a high probability that there is only one edge contour; therefore, if there are multiple edge contours, the pattern may be facing upward; therefore, it is possible to first determine whether the edge contour is unique, thereby preliminarily determining whether the pattern is facing upward. When the edge contour is not unique, it is possible that the redundant contour is one or more of a defect contour and a pattern contour. Therefore, a two-dimensional coordinate axis can be constructed based on the largest edge contour. During construction, a corner point of the largest edge contour is selected as the origin, and then a circle is drawn for each redundant contour to cover the redundant contour, and then the center of the circle corresponding to each redundant contour is determined. The coordinates of the center of the circle can be obtained to characterize the original position corresponding to the redundant contour. As for obtaining the position where the pattern should be in the standard image, the standard contour can be overlapped with the corresponding point of the origin of the largest edge contour, so that the standard contour is placed on the two-dimensional coordinate axis, and then a circle is drawn for the pattern contour to cover the pattern contour, and the center of the pattern contour is determined. The coordinates of the center of the circle can be obtained to characterize the position where the pattern should be. When there is a center of a certain redundant contour corresponding to a circle near the center of the pattern contour, it means that the pattern is facing upward. If there is no redundant contour whose corresponding circle center is near the circle center of the pattern contour, the redundant contour can be translated, and the translation length is the length of the maximum edge contour. Each time the translation is performed, the current original position of the redundant contour is obtained, and it is determined whether there is a current original position that matches the position that should be; if there is a current original position that matches the position that should be after the translation is completed, it means that the initial pattern comparison result is a match.
[0035] Reference Figure 5 , the similarity detection step may include S501-S506: S501, mapping a redundant contour corresponding to a current original position that should be matched in position into a pattern contour of a standard image; S502, selecting a third reference point from the redundant contour and selecting a fourth reference point corresponding to the position of the third reference point from the pattern contour; S503, obtaining a similar distance between the third reference point and the fourth reference point; S504, determining whether all similarity intervals are smaller than a preset similarity error interval; S505, if yes, the generated pattern similarity comparison result is a match; S506: If not, the generated pattern similarity comparison result is mismatched.
[0036] Furthermore, in order to avoid the influence of ambient light on image recognition, the ambient light illumination sensor can be used to obtain the ambient brightness value, and determine whether the ambient brightness value matches the standard brightness value corresponding to the standard image when the standard image is collected; if not, the brightness of the fill light needs to be adjusted.
[0037] The implementation principle of this embodiment is: After the hawthorn stick is transported to the image acquisition location, the original image of the hawthorn stick is collected, and the edge contour of the original image is extracted, and then the edge contour is mapped into the standard contour, a first reference point is selected on the standard contour, and a second reference point is selected at a position corresponding to the edge contour, and a matching interval between the first reference point and the corresponding second reference point is obtained, and it is determined whether the matching interval is within the error interval. If the matching intervals corresponding to all reference points are within the error interval, it means that the edge comparison result is a match; then it is determined whether the edge contour is unique. If not, a two-dimensional coordinate axis is constructed based on the largest edge contour, so as to obtain the original positions of the remaining redundant contours except the edge contour, so as to determine whether a certain original position is consistent with the image. The pattern should match the position. If not, the redundant contour can be translated. Each time it is translated, the current original position of the redundant contour is obtained, and it is determined whether there is a current original position that matches the position that should be matched. If so, it means that the initial pattern comparison result is a match; then the redundant contour corresponding to the current original position that should match the position is mapped to the pattern contour, a third reference point is selected from the redundant contour, and a fourth reference point is selected from the corresponding position of the pattern contour, and then the similarity distance between the third reference point and the fourth reference point is obtained, and it is determined whether the similarity distance is less than the similarity error distance. If the similarity distances corresponding to all reference points are less than the similarity error distance, the generated pattern similarity comparison result is a match.
[0038] Based on the above method embodiment, the second embodiment of the present application discloses an automatic identification and processing system for packaging hawthorn sticks. Figure 6 As an embodiment of the automatic identification and processing system, the automatic identification and processing system may include: An image acquisition module 101 is used to acquire original images of the hawthorn sticks delivered to an image acquisition location, wherein each hawthorn stick has the same position at the image acquisition location; The edge extraction module 102 is used to extract the edge contour of the original image; An edge comparison module 103 is used to compare the edge contour with the pre-collected standard contour of a normal hawthorn stick and generate an edge comparison result; A rejection module 104, configured to reject the current hawthorn stick when the edge comparison result is mismatch; The pattern initial comparison module 105 is used to generate a pattern similarity comparison result according to the pattern similarity detection step when the edge comparison result is a match; The elimination module 104 is used to eliminate the current hawthorn stick when the pattern similarity comparison result is mismatch; The pattern similarity comparison module 106 is used to generate a pattern similarity comparison result according to the pattern similarity detection step when the pattern similarity comparison structure is matched; The elimination module 104 is used to eliminate the current hawthorn stick when the pattern similarity comparison result is dissimilar.
[0039] The modules of the system for automatically identifying and processing hawthorn sticks for packaging correspond to the method for automatically identifying and processing hawthorn sticks for packaging, and no further details will be given here.
[0040] The third embodiment of the present application provides a terminal. As an implementation of the terminal, the terminal may include: a memory and a processor; wherein: The memory is used for storing an automatic identification processing program for packaging hawthorn sticks; The processor is used to execute the program stored in the memory to implement the steps of the above-mentioned automatic identification and processing method for packaging hawthorn sticks.
[0041] The memory may be connected to the processor via a communication bus, and the communication bus may be an address bus, a data bus, a control bus, etc.
[0042] In addition, the memory may include a random access memory (RAM) and may also include a non-volatile memory (NVM), such as at least one disk storage.
[0043] And the processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0044] The fourth embodiment of the present application provides a computer-readable storage medium storing a computer program that can be loaded by a processor and execute the above-mentioned method for automatically identifying and processing hawthorn sticks for packaging.
[0045] Computer-readable storage media can be any available media that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives).
[0046] The above are all preferred embodiments of the present application, and are not intended to limit the protection scope of the present application in sequence. Any feature disclosed in this specification (including the abstract and drawings), unless otherwise stated, can be replaced by other equivalent or alternative features with similar purposes. That is, unless otherwise stated, each feature is only an example of a series of equivalent or similar features.
Claims
1. A method for automatically identifying and processing hawthorn sticks for packaging, characterized in that: include: Collecting original images of the hawthorn sticks delivered to an image collection location, wherein each hawthorn stick has the same position at the image collection location; Extracting the edge contour of the original image; Comparing the edge profile with a pre-collected standard profile of a normal hawthorn stick to generate an edge comparison result; If the edge comparison result is mismatch, the current hawthorn stick is discarded; If the edge comparison result is a match, then the pattern initial detection step is entered; According to the pattern initial detection step, generating a pattern initial comparison result; If the initial comparison result of the pattern is mismatch, the current hawthorn stick is discarded; If the initial pattern comparison result is a match, then entering the pattern similarity detection step; According to the pattern similarity detection step, generating a pattern similarity comparison result; If the pattern similarity comparison result is mismatch, the current hawthorn stick is discarded; If the pattern similarity comparison result is a match, the current hawthorn stick continues to be transmitted.
2. The method for automatically identifying and processing hawthorn sticks for packaging according to claim 1, characterized in that: The specific steps of comparing the edge contour with the pre-collected standard contour of a normal hawthorn stick to generate an edge comparison result include: Mapping the edge contour into the standard contour; Selecting a first reference point on the standard contour; Selecting a second reference point on the edge contour corresponding to the position of the first reference point; Obtaining a matching distance between the first reference point and the corresponding second reference point; Determining whether the matching interval is within a preset error interval; If so, the edge comparison result is a match; If not, the edge comparison result is mismatch.
3. The method for automatically identifying and processing hawthorn sticks for packaging according to claim 2, characterized in that: After the edge result is mismatched, it includes: The standard profile is rotated 180° counterclockwise with the midpoint of the standard profile length as the rotation point, and the edge profile is compared with the standard profile again.
4. The method for automatically identifying and processing hawthorn sticks for packaging according to claim 2, characterized in that: The pattern initial detection step comprises: Determining whether the edge contour is unique; If so, the initial pattern comparison result is mismatch; If not, constructing a two-dimensional coordinate axis based on the largest edge contour; Based on the two-dimensional coordinate axis, obtaining the original position of the redundant contour; Comparing the original position with the position of the pattern in the pre-acquired standard image; If there is a match between the original position and the expected position, the initial pattern comparison result is a match; If there is no original position that matches the expected position, the initial pattern comparison result is mismatch.
5. The method for automatically identifying and processing hawthorn sticks for packaging according to claim 4, characterized in that: After the initial pattern comparison result is mismatched, the method includes: The redundant contour is translated, and the translation length is the length of the largest edge contour; Each time the translation is performed, the current original position of the redundant contour is obtained; Determine whether there is the current original position that matches the expected position; If yes, then the initial pattern comparison result is a match; If not, the initial pattern comparison result is mismatch.
6. The method for automatically identifying and processing hawthorn sticks for packaging according to claim 4, characterized in that: The similarity detection step comprises: Mapping a redundant contour corresponding to the current original position that should be matched in position into a pattern contour of the standard image; Selecting a third reference point from the redundant contour and selecting a fourth reference point corresponding to the position of the third reference point from the pattern contour; Acquire a similar distance between the third reference point and the fourth reference point; Determine whether all the similarity intervals are smaller than a preset similarity error interval; If so, the pattern similarity comparison result generated is a match; If not, the generated pattern similarity comparison result is a mismatch.
7. The method for automatically identifying and processing hawthorn sticks for packaging according to claim 1, characterized in that: The automatic identification processing method also includes: Get the ambient brightness value; Determining whether the ambient brightness value matches a standard brightness value corresponding to a standard image; If not, adjust the brightness of the fill light.
8. An automatic identification and processing system for packaging hawthorn sticks, characterized in that: include: An image acquisition module (101) is used to acquire original images of hawthorn sticks delivered to an image acquisition location, wherein each hawthorn stick has the same position at the image acquisition location; An edge extraction module (102), used to extract the edge contour of the original image; An edge comparison module (103) is used to compare the edge contour with a pre-collected standard contour of a normal hawthorn stick and generate an edge comparison result; A rejection module (104), configured to reject the current hawthorn stick when the edge comparison result is a mismatch; A pattern initial comparison module (105), configured to generate a pattern initial comparison result according to the pattern initial detection step when the edge comparison result is a match; The rejection module (104) is used to reject the current hawthorn stick when the initial pattern comparison result is mismatch; A pattern similarity comparison module (106), configured to generate a pattern similarity comparison result according to the pattern similarity detection step when the initial pattern comparison result is a match; The rejection module (104) is used to reject the current hawthorn stick when the pattern similarity comparison result is mismatch.
9. A terminal, characterized in that: include: A memory storing an automatic identification and processing program for hawthorn sticks for packaging; A processor is used to execute the program stored in the memory to implement the steps of the automatic identification and processing method for packaging hawthorn sticks as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The invention stores a computer program which can be loaded by a processor and executes the method for automatically identifying and processing the packaged hawthorn sticks as claimed in any one of claims 1 to 7.