Coding pattern detection method and device, electronic equipment and storage medium

By performing initial and clustered elliptical fitting of coded images in harsh environments, the problems of low recognition accuracy and poor anti-interference ability of traditional encoding recognition technology in the case of deficiencies or occlusions are solved, and higher recognition accuracy is achieved and anti-interference ability ensure effective tracking and management of industrial equipment.

CN119204060APending Publication Date: 2024-12-27CISDI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411300896.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

Traditional one-dimensional code and QR code identification technology has low recognition accuracy and poor anti-interference ability in harsh environments such as high dust, water and oil pollution, making it difficult to accurately analyze coded information under debris or occlusion, resulting in industrial equipment tracking. and management failure.

Method used

By obtaining the encoded images of the device to be inspected, performing initial ellipse fitting and clustered ellipse fitting, extracting outline edge information, performing sequential positioning detection and encoding identification, and using threshold values ​​and grayscale values ​​to perform image encoding information matching detection, improving identification Accuracy and anti-interference ability.

Benefits of technology

When the coded pattern is damaged or blocked, the coded pattern is restored through two elliptical fittings, which improves the recognition accuracy and anti-interference ability, and ensures effective tracking and management of industrial equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119204060A_ABST
    Figure CN119204060A_ABST
Patent Text Reader

Abstract

The invention provides a coding pattern detection method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a to-be-detected coding image of to-be-detected equipment, carrying out the initial ellipse fitting according to the contour edge information corresponding to the to-be-detected coding image, and obtaining a plurality of initial fitting ellipses, clustering ellipse fitting of the same coding pattern is carried out based on the initial ellipse circle center distance, the long and short axis distance and the centrifugal angle difference between the initial fitting ellipses, a plurality of target fitting ellipses are obtained, sequence positioning detection and coding identification recognition are carried out on the target fitting ellipses, image coding information is obtained, and image coding is carried out. Performing information matching detection on the to-be-detected equipment according to the image coding information; according to the method, when the coding pattern is stained or shielded, the coding pattern can be recovered through two times of ellipse fitting, and the recognition accuracy and the anti-interference capability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image recognition technology, and in particular to a coding pattern detection method, device, electronic device and storage medium. Background Art

[0002] In the rapid development of modern industrial production, the application of intelligent technology has become an important force in promoting industrial upgrading. Among them, the tracking and management of industrial equipment through automatic identification technologies such as one-dimensional codes and two-dimensional codes has greatly improved the automation and efficiency of the production process, reduced manual intervention, and enhanced the real-time and accuracy of data. These technologies are widely used in inventory management, equipment maintenance, production traceability and other links, providing strong support for the refined management and efficient operation of enterprises. However, with the increasing complexity and diversity of industrial application scenarios, especially in harsh environments such as high dust, water pollution and oil pollution, traditional one-dimensional code and two-dimensional code recognition technologies face severe challenges. These environmental factors are not only easy to cause contamination, blurring or even partial occlusion on the surface of the identification code, but may also cause the performance of the optical sensor of the identification device to decline, thereby significantly reducing the recognition rate and anti-interference ability. Specifically, when the pattern on the identification code is covered by dust, water stains or oil stains, or is partially blocked by other objects, traditional recognition algorithms often find it difficult to accurately parse the original information, resulting in decoding failure, and thus unable to achieve effective tracking and management of industrial equipment.

[0003] In the field of industrial technology, how to overcome the limitations of harsh environments on one-dimensional codes, two-dimensional codes and other identification technologies and improve the stability and reliability of the identification system has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] The present invention provides a coding pattern detection method, device, electronic device and storage medium to solve the above-mentioned technical problems of low recognition accuracy and poor anti-interference ability of the general barcode recognition technology in harsh environments.

[0005] In one embodiment of the present application, the present application provides a coding pattern detection method, including: obtaining a coded image to be inspected of a device to be inspected; performing initial ellipse fitting according to the contour edge information corresponding to the coded image to be inspected to obtain multiple initial fitting ellipses; performing clustered ellipse fitting of the same coding pattern based on the difference in the initial ellipse center distance, the major and minor axis spacing, and the eccentric angle between each of the initial fitting ellipses to obtain multiple target fitting ellipses; performing sequential positioning detection and coding identification recognition on each of the target fitting ellipses to obtain image coding information, so as to perform information matching detection on the device to be inspected according to the image coding information.

[0006] In one embodiment of the present application, cluster ellipse fitting of the same coding pattern is performed based on the initial ellipse center distance, the major and minor axis spacing, and the difference in eccentric angle between each of the initial fitting ellipses to obtain a target fitting ellipse, including: if an initial ellipse center distance is less than a preset first threshold, and the major axis difference is less than a preset second threshold, and the minor axis difference is less than a preset third threshold, and the difference in eccentric angle is less than a preset angle threshold, then the corresponding two initial fitting ellipses are determined as different contour edges of the same coding pattern; all contour edges of the same coding pattern are clustered ellipse fitting to obtain a target fitting ellipse; wherein the major and minor axis spacing includes the major axis difference and the minor axis difference.

[0007] In one embodiment of the present application, an initial ellipse fitting is performed according to the contour edge information corresponding to the coded image to be checked to obtain multiple initial fitting ellipses, including: graying the coded image to be checked to obtain a grayscale image, and performing denoising on the grayscale image; thresholding the denoised grayscale image to obtain a binary image; extracting the contour edge information of the binary image; and performing initial ellipse fitting according to the contour edge information to obtain multiple initial fitting ellipses.

[0008] In one embodiment of the present application, sequential positioning detection and coding identification are performed on each of the target fitting ellipses to obtain image coding information, including: determining a marking ring and multiple coding circles based on the target ellipse center distance and the target ring diameter ratio between the target fitting ellipses; performing adjacent circle positioning on each of the coding circles based on the marking ring to obtain sequential positioning information of each of the coding circles; calculating the first average grayscale value of each of the coding circles, and determining the base coding identification of each of the coding circles based on each of the first average grayscale values; and determining the image coding information based on each of the sequential positioning information and each of the base coding identifications.

[0009] In one embodiment of the present application, a marking ring and a plurality of coded circles are determined according to a target ellipse center distance and a target ring diameter ratio between each of the target fitting ellipses, including: if a target ellipse center distance is less than a preset fourth threshold, the ring between the corresponding two target fitting ellipses is determined as a first candidate ring; if the inner and outer circle diameter ratio of the first candidate ring is greater than a preset fifth threshold, and the inner and outer circle diameter ratio of the first candidate ring is less than a preset sixth threshold, the first candidate ring is determined as a second candidate ring; if the second average gray value of the second candidate ring is less than a preset seventh threshold, the second candidate ring is determined as a positioning ring, and the positioning ring is The inner circle of the ring is determined as the region of interest; if the center distance of a target ellipse in the region of interest is less than the preset eighth threshold, the ring between the two corresponding target fitting ellipses in the region of interest is determined as the third candidate ring; if the inner and outer circle diameter ratio of the third candidate ring is greater than the preset ninth threshold, and the inner and outer circle diameter ratio of the third candidate ring is less than the preset tenth threshold, the third candidate ring is determined as the fourth candidate ring; if the third average gray value of the fourth candidate ring is less than the preset eleventh threshold, the fourth candidate ring is determined as the marked ring, and all other target fitting ellipses in the region of interest are determined as multiple coded circles.

[0010] In one embodiment of the present application, adjacent circle positioning is performed on each of the coded circles based on the marking ring to obtain sequential positioning information of each of the coded circles, including: determining the marking ring as the marking starting point; if a marking circle center distance is greater than a preset twelfth threshold, and the marking circle center distance is less than a preset thirteenth threshold, then determining a coded circle corresponding to the marking circle center distance as an adjacent circle of the marking starting point, and the marking circle center distance is used to characterize the distance between the center of the coded circle and the center of the marking starting point; performing a vector cross product operation on the vectors composed of the center of the marking starting point and the centers of all adjacent circles to obtain sequential positioning information of all adjacent circles; determining an adjacent circle as a new marking starting point to perform adjacent circle positioning according to the new marking starting point to obtain sequential positioning information of all coded circles.

[0011] In one embodiment of the present application, the base code identifier of the coding circle is determined according to the first average grayscale value, including: if a first average grayscale value is less than a preset fourteenth threshold, a preset first color is determined as the coding fill color of the coding circle; if a first average grayscale value is greater than a preset fourteenth threshold, a preset second color is determined as the coding fill color of the coding circle; and the base code identifier of the coding circle is determined according to the coding value corresponding to the coding fill color.

[0012] In one embodiment of the present application, the coded image to be inspected includes multiple coding patterns, each of the coding patterns includes a first circular ring pattern, a second circular ring pattern and eight code element circular patterns; the second circular ring pattern and each of the code element circular patterns are located in an inner circle of the first circular ring pattern, the second circular ring pattern and each of the code element circular patterns are distributed in an array, and the second circular ring pattern is used to perform sequential positioning detection on each of the code element circular patterns.

[0013] In one embodiment of the present application, the present application provides a coding pattern detection device, including: an image acquisition module, used to acquire a coded image to be inspected of a device to be inspected; an initial ellipse fitting module, used to perform initial ellipse fitting according to the contour edge information corresponding to the coded image to be inspected, and obtain multiple initial fitting ellipses; a clustered ellipse fitting module, used to perform clustered ellipse fitting of the same coding pattern based on the difference in the initial ellipse center distance, the major and minor axis spacing, and the eccentric angle between each of the initial fitting ellipses, and obtain multiple target fitting ellipses; a coding determination module, used to perform sequential positioning detection and coding identification recognition on each of the target fitting ellipses, and obtain image coding information, so as to perform information matching detection on the device to be inspected according to the image coding information.

[0014] In one embodiment of the present application, the present application provides an electronic device, which includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the coding pattern detection method as described in any of the above embodiments.

[0015] In one embodiment of the present application, the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor of a computer, the computer executes the coding pattern detection method described in any of the above embodiments.

[0016] Beneficial effects of embodiments of the present invention: The present invention provides a coding pattern detection method, device, electronic device and storage medium. The embodiments of the present invention extract the contour edge information of the image and then perform secondary clustering ellipse fitting on the basis of primary ellipse fitting. When the coding pattern is damaged or blocked, the coding pattern can be restored through two ellipse fittings, thereby increasing the recognition accuracy and anti-interference ability.

[0017] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0019] Figure 1 A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied;

[0020] Figure 2 A schematic diagram of a process of a coding pattern detection method according to an embodiment of the present application is shown;

[0021] Figure 3 A schematic diagram of a coding pattern of a coding pattern detection method according to an embodiment of the present application is shown;

[0022] Figure 4 A schematic diagram showing the sorting of coding circles in a coding pattern detection method according to an embodiment of the present application is shown;

[0023] Figure 5 A block diagram of a coding pattern detection device according to an embodiment of the present application is shown;

[0024] Figure 6 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0025] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0026] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.

[0027] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.

[0028] See also Figure 1 , Figure 1 A schematic diagram of an exemplary system architecture to which the technical solution of the embodiment of the present application can be applied is shown. Figure 1 As shown, the system architecture may include a computer device 101 and an image acquisition device. The computer device 101 may be at least one of a desktop graphics processing unit (GPU) computer, a GPU computing cluster, a general-purpose computer, an embedded computer, a neural network computer, etc. The image acquisition device 102 is used to acquire the coded image to be inspected of the device to be inspected, and transmit it to the computer device 101 to obtain image coding information, so as to perform information matching detection on the device to be inspected according to the image coding information.

[0029] Exemplarily, after the computer device 101 obtains the coded image of the device to be inspected, it performs initial ellipse fitting according to the contour edge information corresponding to the coded image to be inspected to obtain multiple initial fitting ellipses; cluster ellipse fitting of the same coding pattern is performed based on the difference in the initial ellipse center distance, the major and minor axis distance, and the eccentric angle between each initial fitting ellipse to obtain multiple target fitting ellipses; sequential positioning detection and coding identification recognition are performed on each target fitting ellipse to obtain image coding information, so as to perform information matching detection on the device to be inspected according to the image coding information.

[0030] In the related technologies, universal barcode recognition technologies such as one-dimensional code and two-dimensional code cannot accurately identify information in harsh environments such as high dust and oil pollution, and have poor anti-interference capabilities.

[0031] In order to solve the above technical problems, the present application provides a coding pattern detection method, device, electronic device and storage medium. The implementation details of the technical solution of the embodiment of the present application are elaborated in detail below.

[0032] See also Figure 2 , Figure 2 FIG. 2 shows a schematic flow chart of a coding pattern detection method according to an embodiment of the present application. Figure 2 As shown, in an exemplary embodiment, the coding pattern detection method at least includes steps S210 to S240, which are described in detail as follows:

[0033] Step S210: obtaining a coded image of the device to be inspected.

[0034] In one embodiment of the present application, the device to be inspected includes industrial equipment.

[0035] In one embodiment of the present application, an image acquisition device is used to acquire a coded image to be inspected corresponding to a coded pattern of the device to be inspected, wherein the coded image to be inspected contains multiple coded patterns.

[0036] In one embodiment of the present application, the coded image to be inspected includes multiple coding patterns, each coding pattern includes a first ring pattern, a second ring pattern and eight code element circular patterns; the second ring pattern and each code element circular pattern are located in the inner circle of the first ring pattern, the second ring pattern and each code element circular pattern are distributed in an array, and the second ring pattern is used to perform sequential positioning detection on each code element circular pattern.

[0037] In one embodiment of the present application, different acquisition angles of the coded image to be inspected may cause graphic distortion of the circular pattern, so the initial fitting ellipse and the target fitting ellipse include a standard ellipse with unequal major and minor axes, and a special ellipse with equal major and minor axes, that is, a standard circle.

[0038] Step S220 , performing initial ellipse fitting according to the contour edge information corresponding to the coded image to be checked, to obtain a plurality of initial fitting ellipses.

[0039] In one embodiment of the present application, an initial ellipse fitting is performed according to the contour edge information corresponding to the coded image to be checked to obtain multiple initial fitting ellipses, including: graying the coded image to be checked to obtain a grayscale image, and performing denoising on the grayscale image; thresholding the denoised grayscale image to obtain a binary image; extracting the contour edge information of the binary image; and performing initial ellipse fitting according to the contour edge information to obtain multiple initial fitting ellipses.

[0040] In one embodiment of the present application, after grayscale processing is performed on the coded image to be inspected, a grayscale image is generated, noise reduction processing is performed on the grayscale image through Gaussian filtering, and threshold segmentation is performed on the grayscale image after noise reduction to obtain a binary image.

[0041] In one embodiment of the present application, the contour edge information in the binary image is extracted by using the Canny edge detection algorithm, and an initial ellipse fitting is performed after discarding a preset number of edge points.

[0042] In one embodiment of the present application, the initial ellipse fitting includes: inputting the pixel point coordinates (x, y) of each edge into a preset universal ellipse equation, and obtaining the value of the constant term in the preset ellipse equation by the least squares method.

[0043] In one embodiment of the present application, the preset universal ellipse equation is as follows:

[0044] ax 2 +bxy+cy 2 +dx+ey+f=0 Formula (1)

[0045] Among them, a, b, c, d, e, and f are constant terms of the preset elliptic equation, x is the horizontal coordinate, and y is the vertical coordinate.

[0046] In one embodiment of the present application, the coordinates of the center of the initial fitting ellipse are as follows:

[0047]

[0048] Among them, x0 is the horizontal coordinate of the center of the initial fitting ellipse, y0 is the vertical coordinate of the center of the initial fitting ellipse, and a, b, c, d, e, and f are constant terms of the preset ellipse equation respectively.

[0049] In one embodiment of the present application, initial ellipse fitting is performed through contour edge information, and multiple coding patterns can be initially identified to obtain multiple initial fitting ellipses.

[0050] Step S230, performing cluster ellipse fitting of the same coding pattern based on the difference between the initial ellipse center distance, the major and minor axis distance, and the eccentric angle between the initial fitting ellipses, to obtain a plurality of target fitting ellipses.

[0051] In one embodiment of the present application, clustered ellipse fitting of the same coding pattern is performed based on the initial ellipse center distance, the major and minor axis spacing, and the difference in eccentricity between each initial fitting ellipse to obtain a target fitting ellipse, including: if an initial ellipse center distance is less than a preset first threshold, and the major axis difference is less than a preset second threshold, and the minor axis difference is less than a preset third threshold, and the difference in eccentricity is less than a preset angle threshold, then the corresponding two initial fitting ellipses are determined as different contour edges of the same coding pattern; all contour edges of the same coding pattern are clustered ellipse fitting to obtain a target fitting ellipse; wherein the major and minor axis spacing includes the major axis difference and the minor axis difference.

[0052] In one embodiment of the present application, the centers of all the initial fitted ellipses are clustered, and the preset first threshold may be 5 pixels; the preset second threshold and the preset third threshold may be the same, which is 8 pixels.

[0053] In one embodiment of the present application, when the distance between the initial ellipse centers is less than 5 pixels, and the major axis difference and the minor axis difference between the initial fitting ellipses are both less than 8 pixels, and the difference in the eccentric angles is less than a preset angle threshold, it indicates that the two initial fitting ellipses are generated by fitting the contour edges of different parts of the same coding pattern, and the contour edges corresponding to the two initial fitting ellipses are stored in the same type of contour edges. Similarly, the contour edges of different parts of the same coding pattern are all stored in the same type of contour edges, and the target fitting ellipse corresponding to the coding pattern is refitted to generate the target fitting ellipse. When the coding pattern is damaged or blocked, the coding pattern can be restored by clustering the fitted ellipses.

[0054] Step S240 , sequentially positioning and detecting and identifying coding marks are performed on each target fitting ellipse to obtain image coding information, so as to perform information matching detection on the device to be inspected according to the image coding information.

[0055] In one embodiment of the present application, sequential positioning detection and coding identification are performed on each target fitting ellipse to obtain image coding information, including: determining a marking ring and multiple coding circles based on the target ellipse center distance and the target ring diameter ratio between each target fitting ellipse; performing adjacent circle positioning on each coding circle based on the marking ring to obtain sequential positioning information of each coding circle; calculating the first average grayscale value of each coding circle, and determining the base coding identification of each coding circle based on each first average grayscale value; and determining the image coding information based on each sequential positioning information and each base coding identification.

[0056] In one embodiment of the present application, a marking ring and a plurality of coded circles are determined according to a target ellipse center distance and a target ring diameter ratio between target fitting ellipses, including: if a target ellipse center distance is less than a preset fourth threshold, the ring between the corresponding two target fitting ellipses is determined as a first candidate ring; if the inner and outer circle diameter ratio of the first candidate ring is greater than a preset fifth threshold, and the inner and outer circle diameter ratio of the first candidate ring is less than a preset sixth threshold, the first candidate ring is determined as a second candidate ring; if the second average gray value of the second candidate ring is less than a preset seventh threshold, the second candidate ring is determined as a positioning ring, and The inner circle of the positioning ring is determined as the region of interest; if the center distance of a target ellipse in the region of interest is less than the preset eighth threshold, the ring between the two corresponding target fitting ellipses in the region of interest is determined as the third candidate ring; if the inner and outer circle diameter ratio of the third candidate ring is greater than the preset ninth threshold, and the inner and outer circle diameter ratio of the third candidate ring is less than the preset tenth threshold, the third candidate ring is determined as the fourth candidate ring; if the third average gray value of the fourth candidate ring is less than the preset eleventh threshold, the fourth candidate ring is determined as the marking ring, and all other target fitting ellipses in the region of interest are determined as multiple coded circles.

[0057] In one embodiment of the present application, by performing a threshold comparison on the ratio of the inner and outer circle diameters of the target fitting ellipse, the problem of inaccurate calculation of the center distance caused by graphic distortion can be reduced, thereby more accurately determining the positioning ring and the marking ring.

[0058] In one embodiment of the present application, the first circular ring pattern is identified by identifying the positioning circular ring, the second circular ring pattern is identified by identifying the marking circular ring, and the symbol circular pattern is identified by identifying the coding circle.

[0059] In one embodiment of the present application, the target ellipse center distance is the Euclidean distance between two target fitting ellipses.

[0060] In one embodiment of the present application, all target fitting ellipses are screened to obtain a positioning ring.

[0061] In one embodiment of the present application, the preset fifth threshold and the preset sixth threshold are determined based on a preset positioning ratio of the inner diameter to the outer diameter of the positioning ring; the preset ninth threshold and the preset tenth threshold are determined based on a preset marking ratio of the inner diameter to the outer diameter of the marking ring.

[0062] In one embodiment of the present application, the preset positioning ratio may be set to 4:5, and the preset fifth threshold and the preset sixth threshold may be set to 0.75 and 0.85, respectively.

[0063] In one embodiment of the present application, the preset marking ratio may be set to 1:2, and the preset ninth threshold and the preset tenth threshold may be set to 0.45 and 0.55, respectively.

[0064] In one embodiment of the present application, the second average grayscale value of the second candidate circular ring is determined by: subtracting the inner circular image area from the outer circular image area of ​​the second candidate circular ring to obtain the first circular ring image area, and calculating the second average grayscale value of the first circular ring image area. When the second average grayscale value is less than a preset seventh threshold value, the first circular ring image area is a solid area, and the second candidate circular ring is determined as a marked circular ring.

[0065] In one embodiment of the present application, the first circular image area is filled with black as the positioning fill color.

[0066] In one embodiment of the present application, the inner circle in the positioning ring is used as the region of interest (ROI) to be detected, and the preset universal ellipse equation corresponding to the inner circle of the positioning ring is converted into a preset standard ellipse equation, as shown below:

[0067]

[0068] Among them, a1 is the inner circle major axis of the positioning ring, b1 is the inner circle minor axis of the positioning ring, x is the horizontal coordinate, and y is the vertical coordinate.

[0069] In one embodiment of the present application, the four vertex coordinates (x i ,y i ) are assigned to the horizontal and vertical coordinates of formula (3), i is the order of vertex coordinates. When all satisfy When , it means that the coordinates of the four vertices of the target fitting ellipse are all within the ROI area, that is, it means that the target fitting ellipse is within the ROI area. After finding all the target fitting ellipses within the ROI area, they are screened to obtain the position of the marked ring.

[0070] In one embodiment of the present application, if the center distance of a target ellipse in the ROI area is less than a preset eighth threshold, the ring between the corresponding target fitting ellipses is determined as the third candidate ring; the diameter ratio of the inner circle to the outer circle of the third candidate ring is calculated, and if the ratio is greater than 0.45 and less than 0.55, it is used as the fourth candidate ring; the outer circle image area of ​​the fourth candidate ring is subtracted from the inner circle image area to obtain the second ring image area between the outer circle and the inner circle, and the third average grayscale value of the second ring image area is calculated. When the third average grayscale value is less than the preset eleventh threshold, the fourth candidate ring is determined as the marked ring; wherein the second ring image area is filled with black as the marking fill color.

[0071] In one embodiment of the present application, adjacent circle positioning is performed on each coded circle based on the marking ring to obtain sequential positioning detection information of each coded circle, including: determining the marking ring as the marking starting point; if a marking circle center distance is greater than a preset twelfth threshold, and a marking circle center distance is less than a preset thirteenth threshold, then a coded circle corresponding to a marking circle center distance is determined as an adjacent circle of the marking starting point, and the marking circle center distance is used to characterize the distance between the center of a coded circle and the center of the marking starting point; performing vector cross product operations on vectors composed of the center of the marking starting point and the centers of all adjacent circles, to obtain sequential positioning information of all adjacent circles; determining an adjacent circle as a new marking starting point to perform adjacent circle positioning according to the new marking starting point, to obtain sequential positioning information of all coded circles.

[0072] In one embodiment of the present application, the marking circle center distance is the Euclidean distance between the center of a coding circle and the center of the marking starting point.

[0073] In one embodiment of the present application, the center of the circle marking the starting point and the centers of the two adjacent circles form vectors, and the value of the vector cross product operation of the two vectors is compared with zero to distinguish the serial numbers of the two adjacent circles.

[0074] Mark the starting point

[0075] In one embodiment of the present application, in the related art, a coordinate axis is established through a positioning circle and two orientation circles, and the coordinate position of the coding circle is determined through the coordinate axis, thereby determining the order of the coding circles. The positioning method is relatively complex and is easily interfered with, resulting in inaccurate positioning. However, the present application determines the initial marking starting point through a marking ring, and performs a vector cross product operation on two vectors composed of the initial marking starting point and the centers of two adjacent circles, determines the order of the two adjacent circles, and updates the marking starting point according to the adjacent circles, thereby performing sequential positioning of other coding circles according to the new marking starting point, thereby reducing the positioning complexity and improving the accuracy.

[0076] In one embodiment of the present application, the base code identifier of the coding circle is determined according to the first average grayscale value, including: if a first average grayscale value is less than a preset fourteenth threshold, a preset first color is determined as the coding fill color of the coding circle; if a first average grayscale value is greater than a preset fourteenth threshold, a preset second color is determined as the coding fill color of the coding circle; and the base code identifier of the coding circle is determined according to the coding value corresponding to the coding fill color.

[0077] In one embodiment of the present application, the preset first color includes black, and the preset second color is white.

[0078] In one embodiment of the present application, the preset coding value corresponding to the first color is "0", and the preset coding value corresponding to the second color is "1"; or, the preset coding value corresponding to the first color is "1", and the preset coding value corresponding to the second color is "0".

[0079] In one embodiment of the present application, see Figure 3 , Figure 3 FIG. 2 shows a schematic diagram of a coding pattern of a coding pattern detection method according to an embodiment of the present application. Figure 3 As shown, the outermost circle is a solid filled positioning ring, and the marking ring and the coding circle are located in the inner circle area of ​​the positioning ring; the ratio of the outer circle to the inner circle diameter of the positioning ring is 5:4; 9 circular patterns are distributed in a nine-square grid in the inner circle area, including 1 marking ring and 8 coding circles of the same size, and the preset distance between two adjacent circle centers can be set to 3 times the radius. The diameter ratio between the outer circle and the inner circle of the marking ring is 2:1. The function of the marking ring is to determine the starting position of the coding circle. The value of the coding circle filled with black indicates "0", and the value of the coding circle filled with white indicates "1".

[0080] In one embodiment of the present application, the preset twelfth threshold and the preset thirteenth threshold are obtained based on a preset distance. For example, the preset twelfth threshold is 2.5 times the radius, and the preset thirteenth threshold is 3.5 times the radius.

[0081] In one embodiment of the present application, see Figure 4 , Figure 4 FIG. 2 shows a schematic diagram of the sorting of coding circles in a coding pattern detection method according to an embodiment of the present application. Figure 4 As shown, the marked ring is used as the starting point to sort the numbers of the 8 coded circles. The steps are as follows: Get the center position of all target fitting ellipses in the ROI area, take the marked ring as the starting point, record the major axis of the coding circle as the radius R, calculate the Euclidean distance between the center of all coding circles and the center of the marked ring, when the distance value is greater than 2.5R and less than 3.5R, it is the coded circles of sequence number 1 and sequence number 3, the center of the marked ring is recorded as O, and the centers of the two adjacent target fitting ellipses are recorded as B and P. The two vectors between the center of the marked ring and the centers of the two adjacent coding circles are recorded as: and Compute the cross product of vectors when Then B is in the clockwise direction of P, which means that the serial number of the coding circle corresponding to B is 1, and the serial number of the coding circle corresponding to P is 3. Conversely, when , the serial numbers of the coding circles corresponding to B and P are swapped; starting from the coding circle with serial number 1, repeating the above steps, the coding circles with serial numbers 2 and 4 can be obtained, and the serial numbers of all coding circles can be obtained by analogy, thereby obtaining the sequential positioning information of all coding circles.

[0082] In one embodiment of the present application, the coding circle of sequence number 3 may be directly used as the starting point to obtain the coding circles of sequence number 6 and sequence number 4.

[0083] In one embodiment of the present application, please continue to refer to Figure 4 ,like Figure 4 As shown, the serial numbers 1-8 of the coding circle correspond to bits 1-8 from high to low in binary. The first average grayscale value in the coding circle is detected. When the first average grayscale value is less than the preset fourteenth threshold, the coding circle is judged to be "●" and the corresponding value is "0". Otherwise, the coding circle is judged to be "○" and the corresponding value is "1". The image coding information is 10101111.

[0084] In one embodiment of the present application, performing information matching detection on the device to be inspected based on the image coding information includes: obtaining a digital number through the image coding information, inputting the digital number and the device number of the device to be inspected into the material system for query, and ensuring that the device number is correct.

[0085] In one embodiment of the present application, please continue to refer to Figure 4 ,like Figure 4 As shown, the image coding information is 10101111 and the corresponding digital number is 175.

[0086] See also Figure 5 , Figure 5 A block diagram of a coding pattern detection device according to an embodiment of the present application is shown. The device can be applied to Figure 1 The implementation environment shown in the figure is specifically configured in the computer device 101. The device can also be applied to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the device is applied.

[0087] like Figure 5 As shown, a coding pattern detection device 500 according to an embodiment of the present application includes: an image acquisition module 501, an initial ellipse fitting module 502, a clustered ellipse fitting module 503 and a coding determination module 504.

[0088] The image acquisition module 501 is used to acquire the coded image of the device to be inspected;

[0089] An initial ellipse fitting module 502 is used to perform initial ellipse fitting according to the contour edge information corresponding to the coded image to be checked, and obtain a plurality of initial fitting ellipses;

[0090] The cluster ellipse fitting module 503 is used to perform cluster ellipse fitting of the same coding pattern based on the difference between the initial ellipse center distance and the major and minor axis distance and the eccentric angle between the initial fitting ellipses to obtain multiple target fitting ellipses;

[0091] The coding determination module 504 is used to perform sequential positioning detection and coding identification recognition on each target fitting ellipse to obtain image coding information, so as to perform information matching detection on the device to be inspected according to the image coding information.

[0092] It should be noted that the coding pattern detection device provided in the above embodiment and the coding pattern detection method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment, and will not be repeated here. In practical applications, the coding pattern detection device provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.

[0093] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the electronic device implements the coding pattern detection method provided in the above-mentioned embodiments.

[0094] See also Figure 6 , Figure 6The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 6 The computer system 600 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0095] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage part 608 to the random access memory (RAM) 603, such as executing the method in the above embodiment. In the RAM 603, various programs and data required for system operation are also stored. The CPU 601, ROM 602 and RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0096] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read therefrom is installed into the storage section 608 as needed.

[0097] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 609, and / or installed from a removable medium 611. When the computer program is executed by a central processing unit (CPU) 601, various functions defined in the system of the present application are executed.

[0098] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0099] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0100] The units involved in the embodiments described in the present application can be implemented by software or by hardware, and the units described can also be set in a processor. Among them, the names of these units do not constitute a limitation on the units themselves under certain circumstances. Therefore, the technical solution according to the implementation mode of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including a number of instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation mode of the present application.

[0101] Another aspect of the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor of a computer, enables the computer to execute the coding pattern detection method provided in each of the above embodiments. The computer-readable storage medium may be included in the electronic device described in the above embodiments, or may exist independently without being assembled into the electronic device.

[0102] In the above embodiments, unless otherwise specified, by using serial numbers such as "first" and "second" to describe common objects, it only means that they refer to different instances of the same object, rather than indicating that the objects being described must adopt a given order, whether in time, space, sorting or any other way.

[0103] The above embodiments are merely illustrative of the principles and effects of the present application, and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. A coding pattern detection method, characterized in that: The method comprises: Obtain the coded image of the device to be inspected; Performing initial ellipse fitting according to the contour edge information corresponding to the coded image to be inspected, to obtain a plurality of initial fitting ellipses; Perform cluster ellipse fitting of the same coding pattern based on the difference between the initial ellipse center distance, the major and minor axis distance, and the eccentric angle between the initial fitting ellipses to obtain multiple target fitting ellipses; Sequential positioning detection and coding mark identification are performed on each of the target fitting ellipses to obtain image coding information, so as to perform information matching detection on the device to be inspected according to the image coding information.

2. The coding pattern detection method according to claim 1, characterized in that: Performing cluster ellipse fitting of the same coding pattern based on the difference between the initial ellipse center distance, the major and minor axis distance, and the eccentric angle between the initial fitting ellipses to obtain a target fitting ellipse includes: If the distance between the centers of an initial ellipse is less than a preset first threshold, the major axis difference is less than a preset second threshold, the minor axis difference is less than a preset third threshold, and the difference in the eccentric angles is less than a preset angle threshold, then the corresponding two initial fitting ellipses are determined as different contour edges of the same coding pattern; Perform cluster ellipse fitting on all contour edges of the same coding pattern to obtain a target fitting ellipse; The major-minor axis distance includes the major axis difference and the minor axis difference.

3. The coding pattern detection method according to claim 2, characterized in that: Performing initial ellipse fitting according to the contour edge information corresponding to the coded image to be inspected to obtain a plurality of initial fitting ellipses, including: Graying the to-be-checked coded image to obtain a grayscale image, and performing noise reduction processing on the grayscale image; Threshold segmentation is performed on the grayscale image after noise reduction to obtain a binary image; Extracting the contour edge information of the binary image; An initial ellipse fitting is performed according to the contour edge information to obtain a plurality of initial fitting ellipses.

4. The coding pattern detection method according to any one of claims 1 to 3, characterized in that: Sequential positioning detection and coding mark recognition are performed on each of the target fitting ellipses to obtain image coding information, including: Determine a marking ring and a plurality of coding circles according to a target ellipse center distance and a target ring diameter ratio between the target fitting ellipses; Based on the marking ring, adjacent circles of each of the coded circles are positioned to obtain sequential positioning information of each of the coded circles; Calculating a first average grayscale value of each of the coding circles, and determining a base code identifier of each of the coding circles according to each of the first average grayscale values; The image coding information is determined according to each of the sequential positioning information and each of the binary coding identifiers.

5. The coding pattern detection method according to claim 4, characterized in that: Determining a marking ring and a plurality of coding circles according to a target ellipse center distance and a target ring diameter ratio between the target fitting ellipses includes: If the distance between the centers of a target ellipse is less than a preset fourth threshold, the circular ring between the corresponding two target fitting ellipses is determined as the first candidate circular ring; If the ratio of the inner and outer circle diameters of the first candidate circular ring is greater than a preset fifth threshold, and the ratio of the inner and outer circle diameters of the first candidate circular ring is less than a preset sixth threshold, the first candidate circular ring is determined as the second candidate circular ring; If the second average gray value of the second candidate circular ring is less than the preset seventh threshold, the second candidate circular ring is determined as the positioning circular ring, and the inner circle of the positioning circular ring is determined as the region of interest; If the center distance of a target ellipse in the region of interest is less than a preset eighth threshold, determining the ring between the two corresponding target fitting ellipses in the region of interest as the third candidate ring; If the inner and outer circle diameter ratio of the third candidate circular ring is greater than the preset ninth threshold value, and the inner and outer circle diameter ratio of the third candidate circular ring is less than the preset tenth threshold value, the third candidate circular ring is determined as the fourth candidate circular ring; If the third average grayscale value of the fourth candidate ring is less than the preset eleventh threshold, the fourth candidate ring is determined as the marked ring, and all other target fitting ellipses in the region of interest are determined as multiple coded circles.

6. The coding pattern detection method according to claim 4, characterized in that: Based on the marking ring, adjacent circles of each coded circle are positioned to obtain sequential positioning information of each coded circle, including: Determine the marking circle as the marking starting point; If a marking circle center distance is greater than a preset twelfth threshold value, and the marking circle center distance is less than a preset thirteenth threshold value, a coded circle corresponding to the marking circle center distance is determined as an adjacent circle of the marking starting point, and the marking circle center distance is used to represent the distance between the center of the coded circle and the center of the marking starting point; Performing a vector cross product operation on the vectors formed by the center of the circle of the marked starting point and the centers of all adjacent circles to obtain sequential positioning information of all adjacent circles; An adjacent circle is determined as a new marking starting point, so that the adjacent circle is positioned according to the new marking starting point, and the sequential positioning information of all the coded circles is obtained.

7. The coding pattern detection method according to claim 4, characterized in that: Determining the binary code identifier of the coding circle according to the first average grayscale value includes: If a first average grayscale value is less than a preset fourteenth threshold, the preset first color is determined as the coded filling color of the coded circle; If a first average grayscale value is greater than a preset fourteenth threshold, the preset second color is determined as the coded filling color of the coded circle; The base code identifier of the coding circle is determined according to the coding value corresponding to the coding filling color.

8. The coding pattern detection method according to any one of claims 1 to 3, characterized in that: The coded image to be checked includes a plurality of coded patterns, each of which includes a first circular pattern, a second circular pattern and eight code element circular patterns; The second circular ring pattern and each of the code element circular patterns are located in an inner circle of the first circular ring pattern, the second circular ring pattern and each of the code element circular patterns are distributed in an array, and the second circular ring pattern is used to perform sequential positioning detection on each of the code element circular patterns.

9. A coding pattern detection device, characterized in that: The device comprises: An image acquisition module is used to acquire a coded image of the device to be inspected; An initial ellipse fitting module is used to perform initial ellipse fitting according to the contour edge information corresponding to the coded image to be inspected, so as to obtain a plurality of initial fitting ellipses; A cluster ellipse fitting module, used to perform cluster ellipse fitting of the same coding pattern based on the difference between the initial ellipse center distance, the major and minor axis distance and the eccentric angle between the initial fitting ellipses, to obtain multiple target fitting ellipses; The coding determination module is used to perform sequential positioning detection and coding identification recognition on each of the target fitting ellipses to obtain image coding information, so as to perform information matching detection on the device to be inspected according to the image coding information.

10. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the electronic device to implement the coding pattern detection method as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the coding pattern detection method according to any one of claims 1 to 8.