Glasses case pattern intelligent detection system and method
By using intelligent detection methods for glasses box patterns in glasses box production, the problem of inefficient manual screening is solved, and the efficiency of automatic sorting and pattern classification is achieved.
Patent Information
- Application Number
- CN202510157596.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-13
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2045-02-13
AI Technical Summary
During the production process of glasses boxes, manually screening glasses boxes with the same pattern is time-consuming and labor-intensive, and inefficient, resulting in excessive accumulation of glasses boxes in the finished product stacking area, affecting the smooth progress of production.
The glasses box pattern intelligent detection method is adopted to capture multi-angle high-definition images, synthesize panoramic images, perform glasses box recognition and image segmentation, extract glasses box patterns, calculate their similarity with other patterns, and perform pattern marking and automatic sorting.
Automatic identification and marking of glasses box patterns is realized, the efficiency of subsequent automatic sorting robot arms is improved, the time and cost of manual screening is reduced, and the success rate of pattern classification and comparison is improved through pattern expansion processing.
Smart Images

Figure CN119625324B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition technology, and in particular to a system and method for intelligently detecting patterns on eyeglass cases. Background Art
[0002] During the production process of eyeglass cases, the corresponding patterns need to be printed on the surface of the eyeglass cases according to customer needs. After the production is completed, the eyeglass cases are uniformly stacked in the finished product stacking area. Then, the eyeglass cases with the same patterns need to be screened out manually and placed in categories, and then packaged and boxed.
[0003] However, the manual screening method is time-consuming and labor-intensive, and the efficiency is very low, which easily leads to excessive accumulation of eyeglass case products in the finished product stacking area, which is not conducive to the smooth progress of production. Therefore, how to realize automatic recognition of eyeglass case patterns to facilitate subsequent classification, screening, storage, packaging, etc. is a very difficult technical problem that needs to be solved at present. Summary of the invention
[0004] In this regard, the present invention provides a method, system, electronic device, computer storage medium and computer program product for intelligent detection of eyeglass case patterns to solve the above technical problems.
[0005] The present invention discloses an intelligent detection method for eyeglass case patterns, the method comprising the following steps: shooting high-definition images from multiple angles of an area where eyeglass cases are mixed and stacked, synthesizing the high-definition images from multiple angles into a panoramic image, performing eyeglass case recognition and image segmentation on the panoramic image to obtain a number of eyeglass case images; extracting eyeglass case patterns from each of the eyeglass case images, and for any of the eyeglass case patterns, calculating a first similarity between the pattern and other eyeglass case patterns; if the first similarity is higher than a first similarity threshold, determining that the eyeglass case pattern and the other eyeglass case patterns are the same pattern; if the first similarity is lower than a second similarity threshold, determining that the eyeglass case pattern and the other eyeglass case patterns are independent patterns; if the first similarity is lower than the first similarity threshold and higher than the second similarity threshold, the eyeglass case pattern is identified as a plurality of eyeglass case patterns; The first similarity threshold is higher than the second similarity threshold; the glasses case pattern and / or the other glasses case patterns in the target pattern group are subjected to pattern expansion processing, and the second similarity between the glasses case pattern and the other glasses case patterns in the target pattern group after the pattern expansion processing is calculated; if the second similarity is higher than the first similarity threshold, it is determined that the glasses case pattern and the other glasses case patterns in the target pattern group are the same pattern; if the second similarity is lower than the second similarity threshold, it is determined that the glasses case pattern and the other glasses case patterns are independent patterns; the same label is marked for the identified multiple glasses cases with the same pattern, and different labels of corresponding types are marked for the identified multiple glasses cases with different patterns.
[0006] In some embodiments, for any of the glasses case patterns, calculating its first similarity with other glasses case patterns includes: evaluating the circular approximation of any of the glasses case patterns, determining the number of comparison angles based on the evaluated circular approximation, and determining a number of comparison angles based on the number of comparison angles; adjusting the glasses case pattern to each of the comparison angles, i.e., obtaining multiple comparison images of the number of comparison angles corresponding to the glasses case pattern; calculating the third similarity of each of the comparison images with the other glasses case patterns, calculating the average of each of the third similarities, and taking the average as the first similarity between the glasses case pattern and the other glasses case patterns.
[0007] In some embodiments, the circular approximation of any of the glasses case patterns is evaluated, and the number of comparison angles is determined based on the circular approximation obtained from the evaluation, including: blurring any of the glasses case patterns to a preset degree to obtain a corresponding glasses case blurred pattern, extracting the outline of the black area in the glasses case blurred pattern, and analyzing the circular approximation of the outline; determining the number of comparison angles based on the circular approximation and a preset negative correlation control relationship.
[0008] In some embodiments, the pattern expansion processing of the glasses case pattern and / or the other glasses case patterns in the target pattern group includes: determining a position set of the glasses case pattern and the other glasses case patterns in the corresponding glasses case image, and calculating an overall straight-line distance between the position set and the nearest edge line of the corresponding glasses case image; wherein the position set includes multiple pattern edge positions of the glasses case pattern and the other glasses case patterns; and performing pattern expansion processing on the glasses case pattern and / or the other glasses case patterns based on the direction of edge lines of the glasses case pattern and / or the other glasses case patterns whose overall straight-line distance is lower than a distance threshold.
[0009] In some embodiments, calculating the overall straight-line distance between the position set and the corresponding nearest edge of the glasses case image includes: calculating the straight-line sub-distance between each of the pattern edge positions contained in the position set and the corresponding nearest edge line in the glasses case image, and taking the average of each of the straight-line sub-distances as the overall straight-line distance.
[0010] The present invention also discloses an intelligent detection system for glasses case patterns, the system comprising a processor and a memory, the processor running a computer code stored in the memory to implement the following steps: taking high-definition images of multiple angles of a mixed stacking area of glasses cases, synthesizing the high-definition images of multiple angles into a panoramic image, performing glasses case recognition and image segmentation on the panoramic image to obtain a number of glasses case images; extracting glasses case patterns from each of the glasses case images, and for any of the glasses case patterns, calculating a first similarity between the pattern and other glasses case patterns; if the first similarity is higher than a first similarity threshold, determining that the glasses case pattern and the other glasses case patterns are the same pattern; if the first similarity is lower than a second similarity threshold, determining that the glasses case pattern and the other glasses case patterns are independent patterns; if the first similarity is lower than the first similarity threshold and is higher than a second similarity threshold, then the glasses case pattern and the other glasses case patterns are determined as a target pattern group; wherein the first similarity threshold is higher than the second similarity threshold; pattern expansion processing is performed on the glasses case pattern and / or the other glasses case patterns in the target pattern group, and the second similarity between the glasses case pattern and the other glasses case patterns in the target pattern group after the pattern expansion processing is calculated; if the second similarity is higher than the first similarity threshold, then it is determined that the glasses case pattern and the other glasses case patterns in the target pattern group are the same pattern; if the second similarity is lower than the second similarity threshold, then it is determined that the glasses case pattern and the other glasses case patterns are independent patterns; the same label is marked for multiple glasses cases with the same pattern that are identified, and different labels of corresponding types are marked for multiple glasses cases with different patterns that are identified.
[0011] In some embodiments, for any of the glasses case patterns, calculating its first similarity with other glasses case patterns includes: evaluating the circular approximation of any of the glasses case patterns, determining the number of comparison angles based on the evaluated circular approximation, and determining a number of comparison angles based on the number of comparison angles; adjusting the glasses case pattern to each of the comparison angles, i.e., obtaining multiple comparison images of the number of comparison angles corresponding to the glasses case pattern; calculating the third similarity of each of the comparison images with the other glasses case patterns, calculating the average of each of the third similarities, and taking the average as the first similarity between the glasses case pattern and the other glasses case patterns.
[0012] In some embodiments, the circular approximation of any of the glasses case patterns is evaluated, and the number of comparison angles is determined based on the circular approximation obtained from the evaluation, including: blurring any of the glasses case patterns to a preset degree to obtain a corresponding glasses case blurred pattern, extracting the outline of the black area in the glasses case blurred pattern, and analyzing the circular approximation of the outline; determining the number of comparison angles based on the circular approximation and a preset negative correlation control relationship.
[0013] In some embodiments, the pattern expansion processing of the glasses case pattern and / or the other glasses case patterns in the target pattern group includes: determining a position set of the glasses case pattern and the other glasses case patterns in the corresponding glasses case image, and calculating an overall straight-line distance between the position set and the nearest edge line of the corresponding glasses case image; wherein the position set includes multiple pattern edge positions of the glasses case pattern and the other glasses case patterns; and performing pattern expansion processing on the glasses case pattern and / or the other glasses case patterns based on the direction of edge lines of the glasses case pattern and / or the other glasses case patterns whose overall straight-line distance is lower than a distance threshold.
[0014] In some embodiments, calculating the overall straight-line distance between the position set and the corresponding nearest edge of the glasses case image includes: calculating the straight-line sub-distance between each of the pattern edge positions contained in the position set and the corresponding nearest edge line in the glasses case image, and taking the average of each of the straight-line sub-distances as the overall straight-line distance.
[0015] The present invention also discloses an electronic device, comprising: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor executes the computer program to implement the method described in any of the preceding items.
[0016] The present invention also discloses a computer storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement any of the above methods.
[0017] The present invention also discloses a computer program product. When the computer program product is run on a terminal, the terminal implements any of the above methods when executing the computer program product.
[0018] The beneficial effects of the present invention are as follows: on the one hand, the present invention can realize automatic recognition and marking of glasses case patterns, which is conducive to the subsequent automatic sorting of glasses cases by an automatic sorting robot arm; on the other hand, some glasses cases are not directly facing the lens, resulting in incomplete glasses case patterns in the captured glasses case images. At this time, the present invention uses pattern expansion processing to properly restore the incomplete image, thereby improving the success rate of glasses case pattern classification and comparison. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 The present invention is a flowchart of a method for intelligently detecting a pattern on a glasses case disclosed in an embodiment of the present invention.
[0021] Figure 2 It is a comparative schematic diagram of the pattern expansion processing disclosed in the embodiment of the present invention.
[0022] Figure 3 It is a structural schematic diagram of a glasses case pattern intelligent detection system disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0023] The following is a description of the implementation of the present application by specific specific embodiments. People familiar with the technology can easily understand other advantages and effects of the present application from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0024] In addition, the technical features involved in the different embodiments of the present application described below can be combined with each other as long as they do not conflict with each other.
[0025] like Figure 1As shown, an embodiment of the present invention discloses an intelligent detection method for glasses case patterns, the method comprising the following steps: taking high-definition images from multiple angles of a mixed stacking area of glasses cases, synthesizing the high-definition images from multiple angles into a panoramic image, performing glasses case recognition and image segmentation on the panoramic image to obtain a number of glasses case images; extracting glasses case patterns from each of the glasses case images, and for any of the glasses case patterns, calculating a first similarity between the patterns and other glasses case patterns; if the first similarity is higher than a first similarity threshold, determining that the glasses case pattern and the other glasses case patterns are the same pattern; if the first similarity is lower than a second similarity threshold, determining that the glasses case pattern and the other glasses case patterns are independent patterns; if the first similarity is lower than the first similarity threshold and higher than the second similarity threshold, determining that the glasses case pattern and the other glasses case patterns are independent patterns. The glasses case pattern and the other glasses case patterns are determined as a target pattern group; wherein the first similarity threshold is higher than the second similarity threshold; pattern expansion processing is performed on the glasses case pattern and / or the other glasses case patterns in the target pattern group, and the second similarity between the glasses case pattern and the other glasses case patterns in the target pattern group after the pattern expansion processing is calculated; if the second similarity is higher than the first similarity threshold, it is determined that the glasses case pattern and the other glasses case patterns in the target pattern group are the same pattern; if the second similarity is lower than the second similarity threshold, it is determined that the glasses case pattern and the other glasses case patterns are independent patterns; the same label is marked for multiple glasses cases with the same pattern identified, and different labels of corresponding types are marked for multiple glasses cases with different patterns identified.
[0026] In the above scheme, the eyeglass case production factory uniformly stacks the manufactured eyeglass cases in a mixed stacking area. The eyeglass cases stacked in this area are printed with different patterns and need to be classified and screened for subsequent classification packaging and packing. The present invention uses image recognition technology to automatically identify the patterns of eyeglass cases and analyze whether the patterns of the eyeglass cases are the same. The eyeglass cases printed with the same pattern are marked with the same labels, and the eyeglass cases printed with different patterns are marked with corresponding types of labels. These marked labels can be subsequently sent to an automatic sorting robot arm, which grabs each eyeglass case and places the eyeglass case in a corresponding storage area according to the aforementioned marked labels for subsequent classification packaging and packing.
[0027] Specifically: high-definition cameras arranged in the mixed stacking area are used to capture high-definition images of the stacked glasses cases from multiple angles. The high-definition cameras here can be movable cameras, and the high-definition images from multiple angles are obtained by moving the shooting position; the high-definition cameras here can also be multiple distributed fixed cameras, each camera having a different shooting angle relative to the stacked glasses cases, so as to obtain the high-definition images from multiple angles. The high-definition images from multiple angles are spliced and synthesized in sequence according to the shooting angles, so as to obtain a panoramic image of all the glasses cases in the mixed stacking area.
[0028] Then, the glasses case recognition algorithm is used to identify each glasses case from the panoramic image, and the glasses case image corresponding to each glasses case is segmented from the panoramic image. Image segmentation can be performed using a region-based segmentation method, a mathematical morphology-based segmentation method, or a deep learning model-based segmentation method.
[0029] Next, the glasses case pattern located on the outer surface of the glasses case is further extracted from each glasses case image, and the first similarity between each identified glasses case pattern and other glasses case patterns is calculated. The first similarity is compared with the preset first similarity threshold and second similarity threshold to distinguish whether the two belong to the same pattern or independent schemes. Among them, if the first similarity is higher than the first similarity threshold, the two patterns are determined to be the same pattern; if the first similarity is lower than the second similarity threshold, the two patterns are determined to be independent patterns; and if the first similarity is lower than the first similarity threshold and higher than the second similarity threshold, the two patterns are determined to be the target pattern group.
[0030] Then, at least one of the glasses case patterns in the target pattern group is subjected to pattern expansion processing, such as expansion based on line direction, and the second similarity between the glasses case pattern in the target pattern group after pattern expansion processing and other glasses case patterns is calculated. At this time, the same comparison method as above is used to determine whether the glasses case pattern in the target pattern group and other glasses case patterns are the same pattern or independent patterns.
[0031] Finally, the above process is repeated to complete the similarity analysis of all the glasses cases in the panoramic image, and then the corresponding labels are marked for each glasses case, and the glasses cases with the same pattern are marked with the same label. The label can be used by the automatic sorting robot arm.
[0032] Therefore, on the one hand, the present invention can realize automatic recognition and marking of glasses case patterns, which is conducive to the subsequent automatic sorting of glasses cases by automatic sorting robot arms; on the other hand, some glasses cases are not directly facing the lens, resulting in incomplete glasses case patterns in the captured glasses case images. At this time, the present invention uses pattern expansion processing to properly restore the incomplete image, thereby improving the success rate of glasses case pattern classification and comparison.
[0033] In some embodiments, for any of the glasses case patterns, calculating its first similarity with other glasses case patterns includes: evaluating the circular approximation of any of the glasses case patterns, determining the number of comparison angles based on the evaluated circular approximation, and determining a number of comparison angles based on the number of comparison angles; adjusting the glasses case pattern to each of the comparison angles, i.e., obtaining multiple comparison images of the number of comparison angles corresponding to the glasses case pattern; calculating the third similarity of each of the comparison images with the other glasses case patterns, calculating the average of each of the third similarities, and taking the average as the first similarity between the glasses case pattern and the other glasses case patterns.
[0034] In the embodiment of the present invention, since the orientation angles of each eyeglass case are different, even the same pattern may be identified as a different pattern. Although the image rotation processing method can be used to adjust the pattern of each eyeglass case to a reference orientation, it is difficult to identify the reference orientation of the pattern of each eyeglass case (especially when the eyeglass case pattern has no specific meaning, such as an abstract pattern). Therefore, the present invention is configured to rotate the eyeglass case pattern to adjust it to a "eyeglass case pattern" at multiple angles, and then calculate the similarity of the "eyeglass case pattern" at each angle with other eyeglass case patterns, and use the average of each similarity as the final first similarity between the eyeglass case pattern and other eyeglass case patterns.
[0035] The number of the above-mentioned angles is determined based on the degree of circular approximation of the pattern of the glasses case, which will be explained in detail in the subsequent content and will not be repeated here.
[0036] In some embodiments, the circular approximation of any of the glasses case patterns is evaluated, and the number of comparison angles is determined based on the circular approximation obtained from the evaluation, including: blurring any of the glasses case patterns to a preset degree to obtain a corresponding glasses case blurred pattern, extracting the outline of the black area in the glasses case blurred pattern, and analyzing the circular approximation of the outline; determining the number of comparison angles based on the circular approximation and a preset negative correlation control relationship.
[0037] In an embodiment of the present invention, there is a negative correlation between the number of comparison angles and the degree of circular approximation of the glasses case pattern, that is, the higher the degree of circular approximation of the glasses case pattern (the closer the glasses case pattern as a whole is to a circle, that is, the degree of "protrusion" at the boundary is uniform and very low), the smaller the comparison difficulty is, so at this time, the fewer the number of comparison angles are set, that is, only fewer "glasses case patterns" are required to calculate the similarity with other glasses case patterns respectively, and then integrate to obtain the final first similarity; and when the degree of circular approximation of the glasses case pattern is lower (the less the glasses case pattern as a whole is like a circle, that is, the degree of "protrusion" at the boundary is uneven and very high), the difference between the "glasses case patterns" at different angles is large, and the comparison difficulty will be significantly increased. At this time, the more the number of comparison angles is set, that is, more "glasses case patterns" need to be calculated for similarity with other glasses case patterns respectively, and then integrated to obtain the final first similarity, which can ensure that the first similarity is as close to the actual situation as possible.
[0038] In addition, since the extracted glasses case pattern only includes some thin lines, it is difficult to directly analyze the degree of circular approximation of the glasses case pattern. In this regard, the present invention is provided to first perform a preset degree of blurring processing on any glasses case pattern to obtain a corresponding glasses case blurred pattern, and the lines in the glasses case blurred pattern will be formed into a series of black dots, which constitute a black area, and the black area represents the glasses case pattern before blurring processing. At this time, it is only necessary to analyze the degree of proximity between the outer contour of the black area and the circle, and the obtained circular approximation degree is the circular approximation degree of the glasses case pattern.
[0039] In some embodiments, the pattern expansion processing of the glasses case pattern and / or the other glasses case patterns in the target pattern group includes: determining a position set of the glasses case pattern and the other glasses case patterns in the corresponding glasses case image, and calculating an overall straight-line distance between the position set and the nearest edge line of the corresponding glasses case image; wherein the position set includes multiple pattern edge positions of the glasses case pattern and the other glasses case patterns; and performing pattern expansion processing on the glasses case pattern and / or the other glasses case patterns based on the direction of edge lines of the glasses case pattern and / or the other glasses case patterns whose overall straight-line distance is lower than a distance threshold.
[0040] In an embodiment of the present invention, since the stacking orientations of the glasses cases in the mixed stacking area are different, the glasses case patterns extracted from the glasses case images may not be complete. The present invention expands the edges of these glasses case patterns based on the direction of the edge lines to restore them as much as possible, and then performs a second similarity calculation.
[0041] Before performing edge expansion, it is necessary to first determine whether the glasses case pattern and other glasses case patterns in the target pattern group need to be expanded at the edge, that is, first determine whether these glasses case patterns are those that are not facing the front of the high-definition camera (that is, the side of the glasses case faces the lens). If this is the case, edge expansion is required. For those glasses case patterns facing the front of the high-definition camera, since the glasses case pattern already completely contains the pattern printed on the surface of the glasses case, there is no need to perform edge expansion processing. Specifically, determine the position set of the glasses case pattern and other glasses case patterns in the corresponding glasses case image (including multiple pattern edge positions of the glasses case pattern), and calculate the overall straight-line distance between these positions and the nearest edge line of the corresponding glasses case image. When the overall straight-line distance is lower than the distance threshold, it can be determined that the glasses case pattern is too close to the edge, and it has a higher probability of belonging to the above-mentioned situation of not facing the front of the high-definition camera (that is, the side of the glasses case faces the lens), and edge expansion is required.
[0042] The pattern extension in the present invention refers to line extension based on the line direction of the edge area of the glasses case pattern. For example, if the line in the edge area is a straight line, the straight line is extended toward the edge direction of the glasses case image. Figure 2 As shown, Figure 2 The left side in the middle is the original recognized glasses case pattern, and the right side is the glasses case pattern expanded based on the edge line direction of the glasses case pattern on the left (the dotted part in the figure is the partially expanded pattern). It is closer to the real glasses case pattern printed on the corresponding glasses case, and the conclusion drawn in the subsequent similarity analysis is more reliable.
[0043] In some embodiments, calculating the overall straight-line distance between the position set and the corresponding nearest edge of the glasses case image includes: calculating the straight-line sub-distance between each of the pattern edge positions contained in the position set and the corresponding nearest edge line in the glasses case image, and taking the average of each of the straight-line sub-distances as the overall straight-line distance.
[0044] In the embodiment of the present invention, the position set includes multiple pattern edge positions of a glasses case pattern, and each pattern edge position can be selected from the edge region of the glasses case pattern according to a preset sampling quantity. The nearest edge line corresponding to each pattern edge position in the glasses case image is calculated respectively, and the straight-line distance between the pattern edge position and the nearest edge line is calculated, and the average of all the straight-line distances is taken as the overall straight-line distance.
[0045] If the overall straight-line distance is too small, it means that the glasses case pattern is too close to the edge in the glasses case image, and there is a high probability that the pattern is incomplete. The incomplete pattern here is because the glasses case is not directly facing the camera lens, that is, some images are not captured due to oblique or sideways shooting.
[0046] like Figure 3 As shown, an embodiment of the present invention further discloses an intelligent detection system for glasses case patterns, the system comprising a processor and a memory, the processor running a computer code stored in the memory to implement the following steps: taking high-definition images from multiple angles of a mixed stacking area of glasses cases, synthesizing the high-definition images from multiple angles into a panoramic image, performing glasses case recognition and image segmentation on the panoramic image to obtain a number of glasses case images; extracting glasses case patterns from each of the glasses case images, and for any of the glasses case patterns, calculating a first similarity between the patterns and other glasses case patterns; if the first similarity is higher than a first similarity threshold, determining that the glasses case pattern and the other glasses case patterns are the same pattern; if the first similarity is lower than a second similarity threshold, determining that the glasses case pattern and the other glasses case patterns are independent patterns; if the first similarity is lower than a first similarity threshold, determining that the glasses case pattern and the other glasses case patterns are independent patterns; The first similarity threshold is higher than the second similarity threshold, then the glasses case pattern and the other glasses case patterns are determined as a target pattern group; wherein the first similarity threshold is higher than the second similarity threshold; pattern expansion processing is performed on the glasses case pattern and / or the other glasses case patterns in the target pattern group, and the second similarity between the glasses case pattern and the other glasses case patterns in the target pattern group after the pattern expansion processing is calculated; if the second similarity is higher than the first similarity threshold, then the glasses case pattern and the other glasses case patterns in the target pattern group are determined to be the same pattern; if the second similarity is lower than the second similarity threshold, then the glasses case pattern and the other glasses case patterns are determined to be independent patterns; the same label is marked for multiple glasses cases with the same pattern that are identified, and different labels of corresponding types are marked for multiple glasses cases with different patterns that are identified.
[0047] In some embodiments, for any of the glasses case patterns, calculating its first similarity with other glasses case patterns includes: evaluating the circular approximation of any of the glasses case patterns, determining the number of comparison angles based on the evaluated circular approximation, and determining a number of comparison angles based on the number of comparison angles; adjusting the glasses case pattern to each of the comparison angles, i.e., obtaining multiple comparison images of the number of comparison angles corresponding to the glasses case pattern; calculating the third similarity of each of the comparison images with the other glasses case patterns, calculating the average of each of the third similarities, and taking the average as the first similarity between the glasses case pattern and the other glasses case patterns.
[0048] In some embodiments, the circular approximation of any of the glasses case patterns is evaluated, and the number of comparison angles is determined based on the circular approximation obtained from the evaluation, including: blurring any of the glasses case patterns to a preset degree to obtain a corresponding glasses case blurred pattern, extracting the outline of the black area in the glasses case blurred pattern, and analyzing the circular approximation of the outline; determining the number of comparison angles based on the circular approximation and a preset negative correlation control relationship.
[0049] In some embodiments, the pattern expansion processing of the glasses case pattern and / or the other glasses case patterns in the target pattern group includes: determining a position set of the glasses case pattern and the other glasses case patterns in the corresponding glasses case image, and calculating an overall straight-line distance between the position set and the nearest edge line of the corresponding glasses case image; wherein the position set includes multiple pattern edge positions of the glasses case pattern and the other glasses case patterns; and performing pattern expansion processing on the glasses case pattern and / or the other glasses case patterns based on the direction of edge lines of the glasses case pattern and / or the other glasses case patterns whose overall straight-line distance is lower than a distance threshold.
[0050] In some embodiments, calculating the overall straight-line distance between the position set and the corresponding nearest edge of the glasses case image includes: calculating the straight-line sub-distance between each of the pattern edge positions contained in the position set and the corresponding nearest edge line in the glasses case image, and taking the average of each of the straight-line sub-distances as the overall straight-line distance.
[0051] An embodiment of the present invention further discloses an electronic device, comprising: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor executes the computer program to implement the method described in the above embodiment.
[0052] An embodiment of the present invention further discloses a computer storage medium, wherein the computer storage medium stores a computer program, and the computer program is executed by a processor to implement the method described in the above embodiment.
[0053] The embodiment of the present invention further discloses a computer program product. When the computer program product is run on a terminal, the terminal implements the method described in the above embodiment.
[0054] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0055] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0056] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0057] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention.
Claims
1. A method for intelligent detection of eyeglass case patterns, characterized in that The method comprises the following steps: taking high-definition images of a mixed stacking area of glasses cases from multiple angles, synthesizing the high-definition images of the multiple angles into a panoramic image, performing glasses case recognition and image segmentation on the panoramic image to obtain a number of glasses case images; extracting glasses case patterns from each of the glasses case images, and for any of the glasses case patterns, calculating its first similarity with other glasses case patterns; if the first similarity is higher than a first similarity threshold, determining that the glasses case pattern and the other glasses case patterns are the same pattern; if the first similarity is lower than a second similarity threshold, determining that the glasses case pattern and the other glasses case patterns are independent patterns; if the first similarity is lower than the first similarity threshold and higher than the second similarity threshold, determining the glasses case pattern and the other glasses case patterns as a target pattern group; wherein, the first similarity The threshold is higher than the second similarity threshold; the glasses case pattern and / or the other glasses case patterns in the target pattern group are subjected to pattern expansion processing, and the second similarity between the glasses case pattern in the target pattern group and the other glasses case patterns after the pattern expansion processing is calculated; if the second similarity is higher than the first similarity threshold, the glasses case pattern in the target pattern group and the other glasses case patterns are determined to be the same pattern; if the second similarity is lower than the second similarity threshold, the glasses case pattern and the other glasses case patterns are determined to be independent patterns; the same label is marked for the identified multiple glasses cases with the same pattern, and different labels of corresponding types are marked for the identified multiple glasses cases with different patterns; wherein the high-definition image is taken by a movable camera or multiple distributed fixed cameras; For any of the glasses case patterns, calculate its first similarity with other glasses case patterns, including: evaluate the circular approximation of any of the glasses case patterns, determine the number of comparison angles based on the evaluated circular approximation, and determine a number of comparison angles based on the number of comparison angles; adjust the glasses case pattern to each of the comparison angles, i.e., obtain multiple comparison images of the number of comparison angles corresponding to the glasses case pattern; calculate the third similarity of each of the comparison images with the other glasses case patterns, calculate the average of each of the third similarities, and use the average as the first similarity between the glasses case pattern and the other glasses case patterns.
2. The method for intelligently detecting a pattern of a glasses case according to claim 1, characterized in that: The circular approximation degree of any of the glasses case patterns is evaluated, and the number of comparison angles is determined based on the circular approximation degree obtained by the evaluation, including: blurring any of the glasses case patterns to a preset degree to obtain a corresponding glasses case blurred pattern, extracting the outline of the black area in the glasses case blurred pattern, and analyzing the circular approximation degree of the outline; determining the number of comparison angles based on the circular approximation degree and a preset negative correlation control relationship.
3. The method for intelligently detecting a pattern of a glasses case according to claim 2, characterized in that: Performing pattern expansion processing on the glasses case pattern and / or the other glasses case patterns in the target pattern group, including: determining a position set of the glasses case pattern and the other glasses case patterns in the corresponding glasses case image, and calculating an overall straight-line distance between the position set and the nearest edge line of the corresponding glasses case image; wherein the position set includes multiple pattern edge positions of the glasses case pattern and the other glasses case patterns; performing pattern expansion processing on the glasses case pattern and / or the other glasses case patterns based on the direction of edge lines of the glasses case pattern and / or the other glasses case patterns whose overall straight-line distance is lower than a distance threshold.
4. The method for intelligently detecting a pattern of a glasses case according to claim 3, characterized in that: Calculating the overall straight-line distance between the position set and the corresponding nearest edge of the glasses case image, including: calculating the straight-line sub-distances between each of the pattern edge positions contained in the position set and the corresponding nearest edge line in the glasses case image, and taking the average of each of the straight-line sub-distances as the overall straight-line distance.
5. A glasses case pattern intelligent detection system, the system comprising a processor and a memory, characterized in that: The processor runs the computer code stored in the memory to implement the following steps: taking high-definition images from multiple angles of a mixed stacking area of glasses cases, synthesizing the high-definition images from multiple angles into a panoramic image, performing glasses case recognition and image segmentation on the panoramic image to obtain a number of glasses case images; extracting glasses case patterns from each of the glasses case images, and for any of the glasses case patterns, calculating its first similarity with other glasses case patterns; if the first similarity is higher than a first similarity threshold, determining that the glasses case pattern and the other glasses case patterns are the same pattern; if the first similarity is lower than a second similarity threshold, determining that the glasses case pattern and the other glasses case patterns are independent patterns; if the first similarity is lower than the first similarity threshold and higher than the second similarity threshold, determining that the glasses case pattern and the other glasses case patterns are target pattern group; wherein the first similarity threshold is higher than the second similarity threshold; performing pattern expansion processing on the glasses case pattern and / or the other glasses case patterns in the target pattern group, and calculating the second similarity between the glasses case pattern in the target pattern group and the other glasses case patterns after the pattern expansion processing; if the second similarity is higher than the first similarity threshold, it is determined that the glasses case pattern in the target pattern group and the other glasses case patterns are the same pattern; if the second similarity is lower than the second similarity threshold, it is determined that the glasses case pattern and the other glasses case patterns are independent patterns; marking the same label for multiple glasses cases with the same pattern identified, and marking different labels of corresponding types for multiple glasses cases with different patterns identified; wherein the high-definition image is taken by a movable camera or multiple distributed fixed cameras; The method of calculating the first similarity between any of the glasses case patterns and other glasses case patterns includes: evaluating the circular approximation of any of the glasses case patterns, determining the number of comparison angles according to the circular approximation obtained by the evaluation, and determining a number of comparison angles according to the number of comparison angles; adjusting the glasses case pattern to each of the comparison angles, i.e., obtaining a plurality of comparison images of the number of comparison angles corresponding to the glasses case pattern; calculating the third similarity between each of the comparison images and the other glasses case patterns, obtaining the average of each of the third similarities, and taking the average as the first similarity between the glasses case pattern and the other glasses case patterns.
6. The intelligent detection system for eyeglass case patterns according to claim 5, characterized in that: The method of evaluating the circular approximation of any of the glasses case patterns and determining the number of comparison angles based on the circular approximation obtained from the evaluation comprises: blurring any of the glasses case patterns to a preset degree to obtain a corresponding glasses case blurred pattern, extracting the outline of a black area in the glasses case blurred pattern, and analyzing the circular approximation of the outline; and determining the number of comparison angles based on the circular approximation and a preset negative correlation control relationship.
7. The intelligent detection system for eyeglass case patterns according to claim 6, characterized in that: The pattern expansion processing of the glasses case pattern and / or the other glasses case patterns in the target pattern group includes: determining a position set of the glasses case pattern and the other glasses case patterns in the corresponding glasses case image, and calculating an overall straight-line distance between the position set and the nearest edge line of the corresponding glasses case image; wherein the position set includes multiple pattern edge positions of the glasses case pattern and the other glasses case patterns; and performing pattern expansion processing on the glasses case pattern and / or the other glasses case patterns based on the direction of edge lines of the glasses case pattern and / or the other glasses case patterns whose overall straight-line distance is lower than a distance threshold.
8. The intelligent detection system for eyeglass case patterns according to claim 7, characterized in that: The calculating of the overall straight-line distance between the position set and the corresponding nearest edge of the glasses case image includes: calculating the straight-line sub-distances between each of the pattern edge positions contained in the position set and the corresponding nearest edge line in the glasses case image, and taking the average of each of the straight-line sub-distances as the overall straight-line distance.
Citation Information
Patent Citations
Vehicle license plate recognition method based on video
CN104050450A
Image identification method and device, image processing method and device and storage medium
CN108573268A