Array pattern recognition method and system based on machine vision

By calculating the spacing between array pattern points and matching reference pattern points, the problem of more recognition or less recognition in array pattern recognition is solved, and the recognition accuracy and efficiency are improved.

CN120299013AActive Publication Date: 2025-07-11SHENZHEN RUIDA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510781170.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-12
Publication Date
2025-07-11
Estimated Expiration
2045-06-12

AI Technical Summary

Technical Problem

In the prior art, due to factors such as changes in lighting conditions and environmental interference in array pattern recognition, the problem of more recognition or less recognition is insufficient, and the recognition accuracy and efficiency are insufficient.

Method used

By acquiring the array pattern images, calculating the interval and interval thresholds between pattern points, establishing a candidate spacing set, filtering the core spacing range, building a reference pattern dot matrix and matching, filling in the missing values, and outputting accurate identification data.

Benefits of technology

It realizes the accuracy and efficiency of array pattern recognition under light changes and environmental interference conditions, and ensures the complete recognition of all array patterns.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120299013A_ABST
    Figure CN120299013A_ABST
Patent Text Reader

Abstract

The invention discloses an array pattern recognition method and system based on machine vision, and the method comprises the steps: recognizing an image containing r rows and c columns of array patterns, and determining an array pattern dot matrix set P; calculating the interval between the array pattern points and an interval threshold value; calculating candidate spacing between the array pattern points, and establishing a candidate spacing set L; traversing the candidate interval set L, determining a core interval range, and screening the candidate interval set L; calculating a precise interval h according to the screened candidate interval set L; constructing a reference pattern dot matrix set Q, matching the reference pattern dot matrix set Q with the array pattern dot matrix set P, and determining an optimal array pattern dot matrix set S; and performing linear insertion completion on missing values in the optimal array pattern dot matrix set S, and outputting array pattern recognition data. According to the invention, identification of all array patterns can be effectively completed, and the accuracy of array pattern identification is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of array pattern recognition, and more specifically, to a method and system for array pattern recognition based on machine vision. Background Art

[0002] With the continuous improvement of industrial automation level, the technology of array pattern recognition and processing based on machine vision has received extensive attention and applications in fields such as electronic manufacturing and packaging sorting. Array patterns usually refer to structures in which multiple identical or similar graphics are arranged in a regular manner, such as electronic component packaging and solar cell arrangement. These scenarios pose higher requirements for recognition accuracy and processing efficiency. However, in actual application scenarios, due to factors such as changes in lighting conditions and environmental interference, problems such as over-recognition or under-recognition of array patterns are likely to occur.

[0003] Therefore, the existing technology has defects and urgent improvements are needed. Summary of the Invention

[0004] In view of the above problems, the purpose of the present invention is to provide a method and system for array pattern recognition based on machine vision, which can effectively complete the recognition of all array patterns and propose an efficient and reliable solution for array pattern recognition in the field of industrial automation.

[0005] The first aspect of the present invention provides a method for array pattern recognition based on machine vision, including: Obtain an image containing an array pattern with r rows and c columns; Recognize the image containing the array pattern with r rows and c columns to determine the array pattern dot matrix set P; Calculate the interval and interval threshold between the array pattern dots in the array pattern dot matrix set P; Calculate the candidate spacing between the array pattern dots based on the interval and interval threshold between the array pattern dots, and establish a candidate spacing set L; Traverse the candidate spacing set L according to a preset spacing length to determine the core spacing range, and screen the candidate spacing set L based on the core spacing range; Calculate the accurate spacing h according to the screened candidate spacing set L; Construct a reference pattern dot matrix set Q, match the reference pattern dot matrix set Q with the array pattern dot matrix set P to determine the optimal array pattern dot matrix set S; Perform linear interpolation to fill in the missing values in the optimal array pattern dot matrix set S, and output the array pattern recognition data.

[0006] In this solution, the step of recognizing the image containing the array pattern with r rows and c columns to determine the array pattern dot matrix set P includes: Perform template matching recognition on the image containing the array pattern with r rows and c columns according to the preset template image to determine the matching position coordinates of all array pattern points; Add the matching position coordinates of all the array pattern points to the array pattern dot matrix set P.

[0007] In this solution, calculating the interval between the array pattern points in the array pattern dot matrix set P and the interval threshold includes: Calculate the minimum bounding rectangle of the array pattern dot matrix set P, and determine the width w and height h of the minimum bounding rectangle; Calculate the interval n between the array patterns according to the width w and height h of the minimum bounding rectangle: ; where r and c are the number of rows and columns of the array pattern in the input image respectively, c0 is an interval constant, and the max() function is to take the larger value of the two; Calculate the interval threshold c1 according to the interval n between the array patterns: ; where θ is the maximum allowable rotation angle of the array pattern.

[0008] In this solution, calculating the candidate spacing between the array pattern points based on the interval between the array pattern points and the interval threshold, and establishing the candidate spacing set L includes: Calculate the absolute difference d of the x coordinates i and the absolute difference d of the y coordinates j between the first array pattern point P x and the second array pattern point P y in the array pattern dot matrix set P; When d x < n and d y < n, if it also satisfies d x < c1 and d y > c1, or satisfies d x > c1 and d y < c1, or satisfies d x < c1 and d y < c1, then calculate the Euclidean distance between the first array pattern point P i and the second array pattern point P j to determine the candidate spacing; Add the candidate spacing to the candidate spacing set L.

[0009] In this solution, traversing the candidate spacing set L according to the preset spacing length to determine the core spacing range, and screening the candidate spacing set L based on the core spacing range includes: Determine the starting interval range (L min , L min , L min +m) according to the minimum candidate spacing L in the candidate spacing set L; Perform a sliding traversal of the candidate spacing set L according to the starting interval range (L min , L min +m) to determine the number of candidate spacings within each interval range; Determine the interval range with the largest number of candidate spacings as the core spacing range; Remove the candidate spacings in the candidate spacing set L that are not within the core spacing range.

[0010] In this solution, calculating the precise spacing h according to the filtered candidate spacing set L includes: Calculate the precise spacing h according to the remaining candidate spacings L q in the candidate spacing set L; ; where k is the size of the candidate spacing set L, and L q is the q-th remaining candidate spacing in the candidate spacing set L, and q ≤ k.

[0011] In this solution, constructing the reference pattern dot matrix set Q includes: Determine r×c reference pattern points according to the number of rows r and columns c of the array pattern, and form a reference pattern dot matrix with r rows and c columns; Calculate the coordinates of each reference pattern point according to the precise spacing h, and construct the reference pattern dot matrix set Q.

[0012] In this solution, matching the reference pattern dot matrix set Q with the array pattern dot matrix set P to determine the optimal array pattern dot matrix set S includes: Fix all the array pattern points in the array pattern dot matrix set P, and move the reference pattern dot matrix set Q in the form of a sliding window, and calculate the sum of the Euclidean distances between each reference pattern point in the reference pattern dot matrix set Q and the nearest array pattern point; When the sum of the distances is the minimum value, determine the array pattern points corresponding to each reference pattern point in the reference pattern dot matrix set Q as the optimal array pattern points; Establish the optimal array pattern dot matrix set S according to the optimal array pattern points.

[0013] In this solution, linearly interpolating and filling the missing values in the optimal array pattern dot matrix set S and outputting the array pattern recognition data includes: Traverse the optimal array pattern dot matrix set S to determine the missing values; Determine the average value of the x - coordinates of the array pattern points above and below the position corresponding to the missing value as the x - coordinate of the complemented pattern point corresponding to the missing value; Determine the average value of the y - coordinates of the array pattern points to the left and right of the position corresponding to the missing value as the y - coordinate of the complemented pattern point corresponding to the missing value; When there are array pattern points only in a single direction among the up - down direction or the left - right direction of the missing value, perform linear interpolation calculation based on two consecutive array pattern points in the single direction to determine the x - coordinate or y - coordinate of the complemented pattern point corresponding to the missing value.

[0014] The second aspect of the present invention provides a machine - vision - based array pattern recognition system, including: A data acquisition module, configured to acquire an image containing an array pattern with r rows and c columns; An image recognition module, configured to recognize the image containing the array pattern with r rows and c columns to determine an array pattern dot matrix set P; A dot - matrix spacing calculation module, configured to calculate the intervals and interval thresholds between the array pattern points in the array pattern dot matrix set P; calculate candidate intervals between the array pattern points based on the intervals and interval thresholds between the array pattern points to establish a candidate interval set L; traverse the candidate interval set L according to a preset interval length to determine a core interval range, and screen the candidate interval set L based on the core interval range; calculate an accurate interval h according to the screened candidate interval set L; A dot - matrix matching module, configured to construct a reference pattern dot matrix set Q, match the reference pattern dot matrix set Q with the array pattern dot matrix set P to determine an optimal array pattern dot matrix set S; A missing - value complementing module, configured to linearly interpolate and complement the missing values in the optimal array pattern dot matrix set S and output array pattern recognition data.

[0015] The third aspect of the present invention provides a computer - readable storage medium, which includes a program of a machine - vision - based array pattern recognition method. When the program of the machine - vision - based array pattern recognition method is executed by a processor, the steps of the machine - vision - based array pattern recognition method as described above are implemented.

[0016] The present invention discloses a method and system for identifying an array pattern based on machine vision. The method includes: identifying an image containing an array pattern with r rows and c columns to determine an array pattern dot matrix set P; calculating the intervals between the array pattern dots and an interval threshold; calculating the candidate spacings between the array pattern dots to establish a candidate spacing set L; traversing the candidate spacing set L to determine the core spacing range and screening the candidate spacing set L; calculating the accurate spacing h according to the screened candidate spacing set L; constructing a reference pattern dot matrix set Q, matching the reference pattern dot matrix set Q with the array pattern dot matrix set P to determine an optimal array pattern dot matrix set S; linearly interpolating and filling the missing values in the optimal array pattern dot matrix set S, and outputting the array pattern recognition data. The present invention can effectively complete the identification of all array patterns and improve the accuracy of array pattern identification. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 FIG. shows a flowchart of a method for identifying an array pattern based on machine vision provided by the present invention; Figure 2 FIG. shows a flowchart of a method for obtaining the array pattern dot matrix set P provided by the present invention; Figure 3 FIG. shows a flowchart of a method for calculating the intervals between the array pattern dots and the interval threshold in the array pattern dot matrix set P provided by the present invention; Figure 4 FIG. shows a block diagram of a system for identifying an array pattern based on machine vision provided by the present invention; Figure 5 FIG. shows a schematic diagram of a sliding window provided by the present invention; Figure 6 FIG. shows a schematic diagram of an optimal array pattern provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0018] In order to more clearly understand the above objects, features and advantages of the present invention, the present invention will be further described in detail below with reference to the drawings and specific embodiments. It should be noted that, without conflict, the embodiments of the present application and the features in the embodiments may be combined with each other.

[0019] In the following description, many specific details are set forth in order to fully understand the present invention. However, the present invention may be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited by the specific embodiments disclosed below.

[0020] Figure 1 FIG. shows a flowchart of a method for identifying an array pattern based on machine vision provided by the present invention.

[0021] As Figure 1As shown, the present invention discloses a method for identifying an array pattern based on machine vision, including: S102, obtaining an image containing an array pattern with r rows and c columns; S104, identifying the image containing the array pattern with r rows and c columns to determine the array pattern dot matrix set P; S106, calculating the intervals between the array pattern dots in the array pattern dot matrix set P and the interval threshold; S108, calculating the candidate spacings between the array pattern dots based on the intervals between the array pattern dots and the interval threshold, and establishing a candidate spacing set L; S110, traversing the candidate spacing set L according to a preset spacing length to determine the core spacing range, and screening the candidate spacing set L based on the core spacing range; S112, calculating the precise spacing h according to the screened candidate spacing set L; S114, constructing a reference pattern dot matrix set Q, matching the reference pattern dot matrix set Q with the array pattern dot matrix set P to determine the optimal array pattern dot matrix set S; S116, linearly interpolating and filling the missing values in the optimal array pattern dot matrix set S, and outputting the array pattern recognition data.

[0022] According to the embodiment of the present invention, after obtaining the image containing the array pattern with r rows and c columns input by the user, the system randomly selects a relatively obvious pattern in a certain row and a certain column from the database (the database stores template images of various array patterns, which are collected and sorted through networks and other means) as the template image, performs template matching with a relatively low template matching score threshold, determines the matching position coordinates of the matching centers of all array patterns, and adds the matching position coordinates to the array pattern dot matrix set P. In an ideal state, the identification of all array patterns will be completed, that is, it can exit without performing the following steps. However, in practice, due to reasons such as blurred images, there may be misidentifications, so the following steps are required.

[0023] Roughly estimate the spacing and spacing threshold between the array patterns by combining the minimum bounding rectangle of the set P of dot matrices of the array pattern dot matrix and the number of rows r and columns c of the array pattern. Calculate the candidate spacings between the points in the set P of dot matrices of the array pattern, and add the candidate spacings to the candidate spacing set L. Sort the candidate spacings in the candidate spacing set L from smallest to largest, determine the minimum candidate spacing, determine the starting spacing range in combination with the preset spacing length by the user, traverse the candidate spacing set L in the way of sliding the spacing range, and determine the spacing range with the most candidate spacings as the core spacing range. Screen the candidate spacing set L according to the core spacing range, and remove the spacing ranges not in the core spacing range from the candidate spacing set L. Calculate the precise spacing h from the remaining candidate spacings in the candidate spacing set L. Construct a dot matrix of r rows and c columns according to the number of rows r and columns c of the array pattern input by the user and the precise spacing h to complete the construction of the set Q of dot matrices of the reference pattern. Fix all the array pattern points in the set P of dot matrices of the array pattern and continuously move the set Q of dot matrices of the reference pattern in the form of a sliding window. After each movement position, calculate the sum of the distances between all the reference pattern points in the set Q of dot matrices of the reference pattern and the nearest array pattern points. When the sum of the distances is the smallest, the array pattern points corresponding to the set Q of dot matrices of the reference pattern are the optimal array pattern points, and add the optimal array pattern points to the optimal array pattern dot matrix set S. By analyzing the optimal array pattern dot matrix set S, determine the missing array pattern points therein, that is, the missing values. Calculate the coordinates of the complement pattern points at the corresponding positions of the missing values through the x coordinates and y coordinates of other array pattern points around the missing values, determine the final optimal array pattern dot matrix set S, and output it as array pattern recognition data.

[0024] Figure 2 The flowchart of the method for obtaining the set P of dot matrices of the array pattern provided by the present invention is shown.

[0025] As Figure 2 shown, according to the embodiment of the present invention, for an image containing an array pattern of r rows and c columns, identify the set P of dot matrices of the array pattern, including: S202, perform template matching recognition on the image containing the array pattern of r rows and c columns according to a preset template image to determine the matching position coordinates of all array pattern points; S204, add the matching position coordinates of all array pattern points to the set P of dot matrices of the array pattern.

[0026] It should be noted that for the input image containing an array pattern of r rows and c columns, a pattern that is relatively obvious in a certain row and a certain column is randomly selected from the database as the template image, and template matching is performed using a relatively low template matching score threshold preset by the system to obtain the matching position coordinates of the matching centers of all array pattern points.

[0027] Figure 3The flowchart shows the method for calculating the interval between array pattern points and the interval threshold in the array pattern dot matrix set P provided by the present invention.

[0028] As Figure 3 shown, according to an embodiment of the present invention, calculating the interval between array pattern points and the interval threshold in the array pattern dot matrix set P includes: S302, calculating the minimum circumscribed rectangle of the array pattern dot matrix set P, and determining the width w and height h of the minimum circumscribed rectangle; S304, calculating the interval n between array patterns according to the width w and height h of the minimum circumscribed rectangle: ; where r and c are respectively the number of rows and columns of the array pattern in the input image, c0 is an interval constant, and the max() function is to take the larger value of the two; S306, calculating the interval threshold c1 according to the interval n between array patterns: ; where θ is the maximum allowable rotation angle of the array pattern.

[0029] It should be noted that first, the minimum circumscribed rectangle of the array pattern dot matrix set P is determined through the matching position coordinates of each array pattern point in the array pattern dot matrix set P. According to the width w and height h of the minimum circumscribed rectangle, and the number of rows r and columns c of the image containing the array pattern with r rows and c columns, the interval n between array patterns is calculated. Among them, the specific value of the interval constant c0 is set by the system. The interval constant c0 usually takes a certain value between 1.1 and 1.5, and the maximum allowable rotation angle θ of the array pattern is usually set by the user input.

[0030] According to an embodiment of the present invention, calculating the candidate spacing between array pattern points based on the interval between array pattern points and the interval threshold, and establishing a candidate spacing set L, includes: Calculating the absolute difference d of the x coordinate i between the first array pattern point P j and the second array pattern point P x and the absolute difference d of the y coordinate y ; When satisfying d x <n and d y <n, if also satisfying d x <c1 and d y >c1, or satisfying d x >c1 and d y <c1, or satisfying d x <c1 and d y <c1, then calculate the first array pattern point P iand the second array pattern point P j to determine the candidate pitch according to the Euclidean distance; Add the candidate pitch to the candidate pitch set L.

[0031] It should be noted that each array pattern point in the array pattern dot matrix set P is analyzed in sequence, and the selected array pattern point is determined as the first array pattern point P i , and the other array pattern points other than this array pattern point are determined as the second array pattern point P j , and calculate the absolute difference d of the x coordinate between the first array pattern point P i and each second array pattern point P j respectively. And the absolute difference d of the y coordinate x and d y . Through the absolute difference d of the x coordinate x and the absolute difference d of the y coordinate y , each second array pattern point P j is verified in sequence. When d x <n and d y <n, if the three conditions of d x <c1 and d y >c1, or d x >c1 and d y <c1, or d x <c1 and d y <c1 are satisfied, calculate the Euclidean distance between P i and the corresponding P j , and add the calculated Euclidean distance as the candidate pitch to the candidate pitch set L. After traversing all the array pattern points in the array pattern dot matrix set P, the calculation of the candidate pitch set is completed.

[0032] According to the embodiment of the present invention, traverse the candidate pitch set L according to the preset pitch length to determine the core pitch range, and screen the candidate pitch set L based on the core pitch range, including: Determine the initial interval range (L min , L min +m) according to the minimum candidate pitch L in the candidate pitch set L min and the preset pitch length m; Perform a sliding traversal of the candidate pitch set L according to the starting interval range (L min , L min +m) to determine the number of candidate pitches in each interval range; Determine the interval range with the largest number of candidate pitches as the core pitch range; Eliminate the candidate pitches in the candidate pitch set L that are not within the core pitch range.

[0033] It should be noted that the core spacing range is determined by adopting the method of sliding spacing range. First, the candidate spacings in the candidate spacing set L are sorted from small to large to determine the minimum candidate spacing L min , and the initial interval range (L min , L min + m) is determined in combination with the preset spacing length m set by the user. Then, the spacing set L is traversed by sliding in turn, and the interval range containing the largest number of candidate spacings is selected as the core interval range. For example, the candidate spacing set is {30, 40, 41, 42, 100}, and the preset spacing length is m = 5. Starting from the interval range 30 - 35 as the starting interval range and sliding continuously (this interval only contains 30), finally, the interval range from 40 to 45 contains the largest number of candidate spacings, that is, 3 candidate spacings. Therefore, the core spacing range is from 40 to 45.

[0034] In addition, if the number of candidate spacings included is the same, the interval range with the smallest starting candidate spacing is taken as the core range.

[0035] According to the embodiment of the present invention, calculating the accurate spacing h based on the filtered candidate spacing set L includes: Calculating the accurate spacing h according to the remaining candidate spacings L in the candidate spacing set L q ; ; where k is the size of the candidate spacing set L, and L q is the q-th remaining candidate spacing in the candidate spacing set L, and q ≤ k.

[0036] It should be noted that k is the size of the candidate spacing set L, that is, there are still k remaining candidate spacings in the candidate spacing set L. First, calculate the sum of the spacings of all the remaining candidate spacings in the candidate spacing set L, and then calculate the ratio of it to the size k of the candidate spacing set L to determine the accurate spacing h.

[0037] According to the embodiment of the present invention, constructing the reference pattern dot matrix set Q includes: Determining r × c reference pattern points according to the number of rows r and the number of columns c of the array pattern to form a reference pattern dot matrix with r rows and c columns; Calculating the coordinates of each reference pattern point according to the accurate spacing h to construct the reference pattern dot matrix set Q.

[0038] It should be noted that after forming the reference pattern dot matrix with r rows and c columns, the coordinates of each reference pattern point can be calculated by combining the accurate spacing h with the number of rows and columns of the reference pattern point. Taking the reference pattern point in the r-th row and c-th column as an example, the calculation method of the coordinates (x b , y b ) of the reference pattern point in the r-th row and c-th column is: ; 。

[0039] According to the embodiments of the present invention, matching the reference pattern dot matrix set Q with the array pattern dot matrix set P to determine the optimal array pattern dot matrix set S includes: Fixing all the array pattern dots in the array pattern dot matrix set P and moving the reference pattern dot matrix set Q in the form of a sliding window, and calculating the sum of the Euclidean distances between each reference pattern dot in the reference pattern dot matrix set Q and the nearest array pattern dot; When the sum of the distances is the minimum value, determining the array pattern dots corresponding to each reference pattern dot in the reference pattern dot matrix set Q as the optimal array pattern dots; Establishing the optimal array pattern dot matrix set S according to the optimal array pattern dots.

[0040] It should be noted that when the sum of the distances is the minimum value, it means that the position where the reference pattern dot matrix set Q is located basically coincides with the array pattern dot matrix set P.

[0041] As Figure 5 shown, taking 3 rows and 4 columns as an example, the red circles are the recognized array pattern dot matrix set P, and due to reasons such as illumination, some dots are recognized more or less (for example, an array pattern dot is missing on the right), and the blue circles are the optimal array pattern dot matrix set S found through the sliding window form.

[0042] Adding the array pattern dots corresponding to the red circles within the range of the blue circle area to the optimal array pattern dot matrix set S, and the obtained optimal array pattern dot matrix set S is as Figure 6 shown.

[0043] According to the embodiments of the present invention, linearly interpolating and filling the missing values in the optimal array pattern dot matrix set S and outputting the array pattern recognition data includes: Traversing the optimal array pattern dot matrix set S to determine the missing values; Determining the x - coordinate mean value of the upper and lower array pattern dots at the position corresponding to the missing value as the x - coordinate of the complemented pattern dot corresponding to the missing value; Determining the y - coordinate mean value of the left and right array pattern dots at the position corresponding to the missing value as the y - coordinate of the complemented pattern dot corresponding to the missing value; When there are array pattern dots only in a single direction in the up - down direction or left - right direction of the missing value, performing linear interpolation calculation based on two consecutive array pattern dots in the single direction to determine the x - coordinate or y - coordinate of the complemented pattern dot corresponding to the missing value.

[0044] It should be noted that for some scenarios, due to recognition problems, it is easy to cause under-recognition, and the optimal array pattern needs to be supplemented. By traversing the dot matrix set S of the optimal array pattern and checking each position of the r-th row and c-th column, if the optimal array pattern corresponding to a certain row and column is missing, it is determined as a missing value and supplemented.

[0045] The supplementation method is as follows: if there are other array pattern points above, below, left, and right of this position, the average value of the x coordinates of the upper and lower array pattern points is used as the x coordinate of the supplemented pattern point, and the average value of the y coordinates of the left and right array pattern points is used as the y coordinate. If there is only a single direction above and below or left and right, the coordinates of the single-direction points are used as a reference for estimation. For example, Figure 6 as shown, the position in the 4th column of the 2nd row is missing, there is no point on its right, and there are points only on its left. Then, the y coordinate of the position in the 4th column of the 2nd row is estimated by linearly interpolating the two y coordinates of the positions in the 3rd column and 2nd column of the 2nd row on the left. The same principle applies to other directions. Finally, the missing values in the dot matrix set S of the optimal array pattern are supplemented to obtain the final array pattern recognition data.

[0046] Figure 4 The block diagram of an array pattern recognition system based on machine vision provided by the present invention is shown.

[0047] As Figure 4 shown, in the second aspect of the present invention, an array pattern recognition system based on machine vision is provided, including: A data acquisition module, configured to acquire an image containing an array pattern of r rows and c columns; An image recognition module, configured to recognize an image containing an array pattern of r rows and c columns and determine the dot matrix set P of the array pattern; A dot matrix spacing calculation module, configured to calculate the intervals between array pattern points and the interval threshold in the dot matrix set P of the array pattern; calculate the candidate intervals between array pattern points based on the intervals between array pattern points and the interval threshold, and establish a candidate interval set L; traverse the candidate interval set L according to a preset interval length to determine the core interval range, and screen the candidate interval set L based on the core interval range; calculate the accurate interval h according to the screened candidate interval set L; A dot matrix matching module, configured to construct a reference pattern dot matrix set Q, match the reference pattern dot matrix set Q with the dot matrix set P of the array pattern, and determine the optimal array pattern dot matrix set S; A missing value supplementation module, configured to linearly interpolate and supplement the missing values in the optimal array pattern dot matrix set S and output the array pattern recognition data.

[0048] In a third aspect of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium includes a program for a machine vision-based array pattern recognition method. When the program for the machine vision-based array pattern recognition method is executed by a processor, the steps of the above-mentioned machine vision-based array pattern recognition method are implemented.

[0049] The information involved in this application (including but not limited to user device information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.), and signals (including but not limited to signals transmitted between user terminals and other devices, etc.) are all authorized by users or fully authorized by all parties. And the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions. For example, the "image containing an array pattern with r rows and c columns" and "preset spacing length m" involved in this disclosure are all obtained under sufficient authorization.

[0050] The present invention discloses a machine vision-based array pattern recognition method and system. The method includes: recognizing an image containing an array pattern with r rows and c columns to determine an array pattern dot matrix set P; calculating the intervals between array pattern dots and an interval threshold; calculating the candidate spacings between array pattern dots to establish a candidate spacing set L; traversing the candidate spacing set L to determine the core spacing range and screening the candidate spacing set L; calculating the accurate spacing h according to the screened candidate spacing set L; constructing a reference pattern dot matrix set Q, matching the reference pattern dot matrix set Q with the array pattern dot matrix set P to determine the optimal array pattern dot matrix set S; linearly interpolating and filling the missing values in the optimal array pattern dot matrix set S, and outputting the array pattern recognition data. The present invention can effectively complete the recognition of all array patterns and improve the accuracy of array pattern recognition.

[0051] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined, or integrated into another system, or some features can be ignored, or not executed. In addition, the couplings between the components shown or discussed, or direct couplings, or communication connections can be through some interfaces. The indirect couplings or communication connections between devices or units can be electrical, mechanical, or other forms.

[0052] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0053] In addition, in each embodiment of the present invention, each functional unit can be fully integrated into one processing unit, or each unit can be separately regarded as a unit, or two or more units can be integrated into one unit; the above-mentioned integrated unit can be implemented in the form of hardware, or in the form of a combination of hardware and software functional units.

[0054] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps including the above method embodiments; and the foregoing storage medium includes: removable storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks or optical discs and other various media that can store program codes.

[0055] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present invention, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the various embodiments of the present invention. And the foregoing storage medium includes: removable storage devices, ROM, RAM, magnetic disks or optical discs and other various media that can store program codes.

Claims

1. An array pattern recognition method based on machine vision, characterized in that, Including: Obtain an image containing an array pattern with r rows and c columns; Identify the image containing the array pattern with r rows and c columns, and determine the array pattern dot matrix set P; Calculate the intervals and interval thresholds between the array pattern dots in the array pattern dot matrix set P; Calculate the candidate spacings between the array pattern dots based on the intervals and interval thresholds between the array pattern dots, and establish a candidate spacing set L; Traverse the candidate spacing set L according to a preset spacing length, determine the core spacing range, and screen the candidate spacing set L based on the core spacing range; Calculate the precise spacing h based on the screened candidate spacing set L; Construct a reference pattern dot matrix set Q, match the reference pattern dot matrix set Q with the array pattern dot matrix set P, and determine the optimal array pattern dot matrix set S; Linearly interpolate and fill in the missing values in the optimal array pattern dot matrix set S, and output the array pattern recognition data.

2. The method for identifying an array pattern based on machine vision according to claim 1, wherein The identifying the image containing the array pattern with r rows and c columns and determining the array pattern dot matrix set P includes: Perform template matching recognition on the image containing the array pattern with r rows and c columns according to a preset template image, and determine the matching position coordinates of all array pattern dots; Add the matching position coordinates of all the array pattern dots to the array pattern dot matrix set P.

3. The method for identifying an array pattern based on machine vision according to claim 1, wherein The calculating the intervals and interval thresholds between the array pattern dots in the array pattern dot matrix set P includes: Calculate the minimum bounding rectangle of the array pattern dot matrix set P, and determine the width w and height h of the minimum bounding rectangle; Calculate the interval n between the array patterns according to the width w and height h of the minimum bounding rectangle: ; Where r and c are respectively the number of rows and columns of the array pattern in the input image, c0 is an interval constant, and the max() function is to take the larger value of the two; Calculate the interval threshold c1 according to the interval n between the array patterns: ; Where θ is the maximum allowable rotation angle of the array pattern.

4. The machine vision-based array pattern recognition method according to claim 1, characterized in that The calculating the candidate spacings between the array pattern dots based on the intervals and interval thresholds between the array pattern dots and establishing the candidate spacing set L includes: Calculate the absolute difference d in the x-coordinate between the first array pattern point P in the array pattern dot matrix set P i and the second array pattern point P j ; x and the absolute difference d in the y-coordinate y ; When d satisfies x < n and d y < n, if it also satisfies d x < c1 and d y > c1, or satisfies d x > c1 and d y < c1, or satisfies d x < c1 and d y < c1, then calculate the Euclidean distance between the first array pattern point P i and the second array pattern point P j to determine the candidate pitch; Add the candidate spacing to the candidate spacing set L.

5. The method for array pattern recognition based on machine vision according to claim 1, characterized in that The traversing the candidate spacing set L according to a preset spacing length, determining the core spacing range, and screening the candidate spacing set L based on the core spacing range includes: Determine the starting interval range (L min , L min + m) according to the minimum candidate spacing L in the candidate spacing set L min ; According to the starting interval range (L min , L min +m), perform a sliding traversal on the candidate pitch set L to determine the number of candidate pitches within each interval range; Determine the interval range with the largest number of candidate spacings as the core spacing range; Eliminate the candidate spacings in the candidate spacing set L that are not within the core spacing range.

6. The method for identifying an array pattern based on machine vision according to claim 5, wherein The calculating the precise spacing h based on the screened candidate spacing set L includes: Based on the remaining candidate spacing L in the candidate spacing set L q calculate the precise spacing h; ; where k is the size of the candidate spacing set L, and L q is the q-th remaining candidate spacing in the candidate spacing set L, where q ≤ k.

7. The method for identifying an array pattern based on machine vision according to claim 1, characterized in that The constructing the reference pattern dot matrix set Q includes: Determine r×c reference pattern dots according to the number of rows r and columns c of the array pattern, and form a reference pattern dot matrix with r rows and c columns; Calculate the coordinates of each reference pattern dot according to the precise spacing h, and construct the reference pattern dot matrix set Q.

8. The method for identifying an array pattern based on machine vision according to claim 1, wherein The matching the reference pattern dot matrix set Q with the array pattern dot matrix set P and determining the optimal array pattern dot matrix set S includes: Fix all the array pattern points in the array pattern dot matrix set P and move the reference pattern dot matrix set Q in the form of a sliding window, and calculate the sum of the Euclidean distances between each reference pattern point in the reference pattern dot matrix set Q and the nearest array pattern point; When the sum of the distances is the minimum value, determine the array pattern points corresponding to each reference pattern point in the reference pattern dot matrix set Q as the optimal array pattern points; Establish an optimal array pattern dot matrix set S according to the optimal array pattern points.

9. The method for identifying an array pattern based on machine vision according to claim 1, wherein Performing linear interpolation to fill in the missing values in the optimal array pattern dot matrix set S and outputting array pattern recognition data, including: Traverse the optimal array pattern dot matrix set S to determine the missing values; Determine the x coordinate of the filled pattern point corresponding to the missing value as the average value of the x coordinates of the array pattern points above and below the position corresponding to the missing value; Determine the y coordinate of the filled pattern point corresponding to the missing value as the average value of the y coordinates of the array pattern points to the left and right of the position corresponding to the missing value; When there are array pattern points only in a single direction among the up-down direction or the left-right direction of the missing value, perform linear difference calculation based on two consecutive array pattern points in the single direction to determine the x coordinate or y coordinate of the filled pattern point corresponding to the missing value.

10. An array pattern recognition system based on machine vision, which is used to implement the machine vision-based array pattern recognition method according to any one of claims 1-9, and is characterized in that, Including: A data acquisition module for acquiring an image containing an array pattern with r rows and c columns; An image recognition module for recognizing the image containing the array pattern with r rows and c columns to determine the array pattern dot matrix set P; A dot matrix spacing calculation module for calculating the intervals and interval thresholds between the array pattern points in the array pattern dot matrix set P; Calculate the candidate spacings between the array pattern points based on the intervals and interval thresholds between the array pattern points, and establish a candidate spacing set L; traverse the candidate spacing set L according to a preset spacing length to determine the core spacing range, and screen the candidate spacing set L based on the core spacing range; Calculate the accurate spacing h according to the screened candidate spacing set L; A dot matrix matching module for constructing a reference pattern dot matrix set Q, matching the reference pattern dot matrix set Q with the array pattern dot matrix set P, and determining the optimal array pattern dot matrix set S; A missing value filling module for linearly interpolating and filling the missing values in the optimal array pattern dot matrix set S and outputting array pattern recognition data.

Citation Information

Patent Citations

  • Lattice target regularity detection method based on machine vision

    CN114897846A