A method and system for array pattern recognition based on machine vision

Through a machine vision-based method, the array pattern images are acquired and processed, the intervals and candidate spacing are calculated, and the matching and missing values are completed are solved, and the misidentification problems caused by lighting and environmental interference in array pattern recognition are improved, and the recognition accuracy and efficiency are improved.

CN120299013BActive Publication Date: 2025-08-12SHENZHEN RUIDA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510781170.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-12
Publication Date
2025-08-12
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, problems of more recognition or less recognition are prone to occur, resulting in insufficient recognition accuracy and efficiency.

Method used

Through a machine vision-based method, an image containing r row and c column array pattern is obtained, the array pattern dot matrix set P is determined, the interval and interval threshold are calculated, the candidate spacing set L is established, the core spacing range is filtered, the reference pattern dot matrix set Q is constructed, and the matching and missing values are completed are performed to output accurate array pattern recognition data.

Benefits of technology

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

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120299013B_ABST
    Figure CN120299013B_ABST
Patent Text Reader

Abstract

The present invention discloses a machine vision-based array pattern recognition method and system. The method comprises: recognizing an image containing an array pattern with r rows and c columns, determining an array pattern dot set P; calculating the intervals and interval thresholds between array pattern points; calculating candidate spacings between array pattern points, establishing a candidate spacing set L; traversing the candidate spacing set L, determining a core spacing range, and screening the candidate spacing set L; calculating a precise spacing h based on the screened candidate spacing set L; constructing a reference pattern dot set Q, matching the reference pattern dot set Q with the array pattern dot set P, determining an optimal array pattern dot set S; linearly interpolating missing values in the optimal array pattern dot set S, and outputting array pattern recognition data. The present invention can effectively complete the recognition of all array patterns and improve the accuracy of array pattern recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present 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 advancement of industrial automation, machine vision-based array pattern recognition and processing technologies have gained widespread attention and application in fields such as electronics manufacturing and packaging sorting. Array patterns typically refer to structures consisting of multiple identical or similar graphics arranged in a regular pattern, such as electronic component packaging and solar cell arrays. These scenarios place higher demands on recognition accuracy and processing efficiency. However, in practical applications, array patterns are prone to over- or under-recognition due to factors such as varying lighting conditions and environmental interference.

[0003] Therefore, the prior art has defects and is in urgent need of improvement. Summary of the Invention

[0004] In view of the above problems, the purpose of the present invention is to provide an array pattern recognition method and system 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] A first aspect of the present invention provides an array pattern recognition method based on machine vision, comprising:

[0006] Acquire an image containing an array pattern of r rows and c columns;

[0007] Identify the image containing the array pattern with r rows and c columns, and determine the array pattern dot set P;

[0008] Calculating the intervals and interval thresholds between array pattern points in the array pattern point set P;

[0009] Calculate candidate spacings between array pattern points based on the spacings between the array pattern points and a spacing threshold, and establish a candidate spacing set L;

[0010] Traversing the candidate spacing set L according to a preset spacing length, determining a core spacing range, and screening the candidate spacing set L based on the core spacing range;

[0011] Calculate the precise spacing h based on the filtered candidate spacing set L;

[0012] Constructing a reference pattern dot set Q, matching the reference pattern dot set Q with the array pattern dot set P, and determining an optimal array pattern dot set S;

[0013] Fill in the missing values in the optimal array pattern dot matrix set S by linear interpolation, and output the array pattern recognition data.

[0014] In this solution, the recognition of the image containing the array pattern with r rows and c columns to determine the array pattern dot matrix set P includes:

[0015] 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;

[0016] Add the matching position coordinates of all array pattern points to the array pattern dot matrix set P.

[0017] In this solution, the calculation of the intervals and interval thresholds between array pattern points in the array pattern dot matrix set P includes:

[0018] 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;

[0019] Calculate the interval n between array patterns according to the width w and height h of the minimum bounding rectangle:

[0020] ;

[0021] 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;

[0022] Calculate the interval threshold c1 according to the interval n between array patterns:

[0023] ;

[0024] where θ is the maximum allowable rotation angle of the array pattern.

[0025] In this solution, the calculation of the candidate spacing between array pattern points based on the interval and interval threshold between array pattern points, and the establishment of the candidate spacing set L includes:

[0026] Calculate the absolute difference d of the x coordinate i between the first array pattern point P j and the second array pattern point P in the array pattern dot matrix set P x and the absolute difference d of the y coordinate y ;

[0027] When d x < n and d y < n, if d x < c1 and d y > c1 are also satisfied, or d x> c1 and d y <c1, or satisfy d x <c1 and d y <If c1, then calculate the first array pattern point P<0000​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

[0041] In this solution, matching the reference pattern dot set Q with the array pattern dot set P to determine the optimal array pattern dot set S includes:

[0042] Fixing all array pattern points in the array pattern point set P, moving the reference pattern point set Q in the form of a sliding window, and calculating the sum of the Euclidean distances between each reference pattern point in the reference pattern point set Q and the nearest array pattern point;

[0043] When the sum of the distances is a minimum value, the array pattern point corresponding to each reference pattern point in the reference pattern point array set Q is determined as the optimal array pattern point;

[0044] An optimal array pattern point set S is established according to the optimal array pattern points.

[0045] In this solution, the method of linearly filling the missing values in the optimal array pattern dot set S and outputting array pattern recognition data includes:

[0046] Traversing the optimal array pattern point set S to determine missing values;

[0047] Determine the x-coordinate mean of the upper and lower array pattern points at the position corresponding to the missing value as the x-coordinate of the filling pattern point corresponding to the missing value;

[0048] Determine the y-coordinate mean of the left and right array pattern points at the position corresponding to the missing value as the y-coordinate of the filling pattern point corresponding to the missing value;

[0049] When there is an array pattern point in only one direction of the up and down directions or the left and right directions of the missing value, a linear difference calculation is performed based on two consecutive array pattern points in the single direction to determine the x coordinate or y coordinate of the filling pattern point corresponding to the missing value.

[0050] A second aspect of the present invention provides an array pattern recognition system based on machine vision, comprising:

[0051] A data acquisition module, configured to acquire an image containing an array pattern of r rows and c columns;

[0052] An image recognition module, configured to recognize the image containing the array pattern of r rows and c columns, and determine the array pattern dot set P;

[0053] a dot spacing calculation module, configured to calculate the spacing and spacing threshold between array pattern points in the array pattern dot set P; calculate candidate spacings between array pattern points based on the spacing and spacing threshold, and establish a candidate spacing set L; traverse the candidate spacing set L according to a preset spacing length to determine a core spacing range, and filter the candidate spacing set L based on the core spacing range; and calculate a precise spacing h based on the filtered candidate spacing set L;

[0054] A dot matrix matching module is used 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, and determine the optimal array pattern dot matrix set S;

[0055] The missing value filling module is used to perform linear interpolation to fill the missing values in the optimal array pattern dot set S and output array pattern recognition data.

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

[0057] The present invention discloses a machine vision-based array pattern recognition method and system. The method comprises: recognizing an image containing an array pattern with r rows and c columns, determining an array pattern dot set P; calculating the intervals and interval thresholds between array pattern points; calculating candidate spacings between array pattern points, establishing a candidate spacing set L; traversing the candidate spacing set L, determining a core spacing range, and screening the candidate spacing set L; calculating a precise spacing h based on the screened candidate spacing set L; constructing a reference pattern dot set Q, matching the reference pattern dot set Q with the array pattern dot set P, determining an optimal array pattern dot set S; linearly interpolating missing values in the optimal array pattern dot set S, and outputting array pattern recognition data. The present invention can effectively complete the recognition of all array patterns and improve the accuracy of array pattern recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 A flow chart of a method for array pattern recognition based on machine vision provided by the present invention is shown;

[0059] Figure 2 A flow chart showing a method for obtaining an array pattern dot set P provided by the present invention is shown;

[0060] Figure 3A flow chart showing a method for calculating the intervals between array pattern points and the interval threshold value in an array pattern dot set P provided by the present invention is shown;

[0061] Figure 4 A block diagram of an array pattern recognition system based on machine vision provided by the present invention is shown;

[0062] Figure 5 shows a schematic diagram of a sliding window provided by the present invention;

[0063] Figure 6 A schematic diagram showing the optimal array pattern provided by the present invention is shown. DETAILED DESCRIPTION

[0064] In order to more clearly understand the above-mentioned objects, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that, in the absence of conflict, the embodiments of the present application and the features therein can be combined with each other.

[0065] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the scope of protection of the present invention is not limited to the specific embodiments disclosed below.

[0066] Figure 1 The flowchart of the array pattern recognition method based on machine vision provided by the present invention is shown.

[0067] like Figure 1 As shown, the present invention discloses an array pattern recognition method based on machine vision, comprising:

[0068] S102, acquiring an image containing an array pattern of r rows and c columns;

[0069] S104, identifying an image containing an array pattern with r rows and c columns, and determining an array pattern dot set P;

[0070] S106, calculating the intervals and interval thresholds between array pattern points in the array pattern point set P;

[0071] S108, calculating candidate spacings between array pattern points based on the spacings between array pattern points and the spacing threshold, and establishing a candidate spacing set L;

[0072] S110, traversing the candidate spacing set L according to the preset spacing length, determining a core spacing range, and screening the candidate spacing set L based on the core spacing range;

[0073] S112, calculating the precise distance h based on the screened candidate distance set L;

[0074] S114, constructing a reference pattern dot set Q, matching the reference pattern dot set Q with the array pattern dot set P, and determining the optimal array pattern dot set S;

[0075] S116 , performing linear interpolation to fill in the missing values in the optimal array pattern point set S, and outputting array pattern recognition data.

[0076] According to an embodiment of the present invention, after receiving a user-entered image containing an array pattern with r rows and c columns, the system randomly selects a relatively prominent pattern in a row and column from a database (which stores template images of various array patterns, collected and organized through the Internet and other means) as a template image. Template matching is performed using a low template matching score threshold, and the matching position coordinates of all array pattern matching centers are determined. These matching position coordinates are then added to the array pattern dot set P. Ideally, all array patterns will be recognized, meaning the system can exit without performing the following steps. However, in practice, due to image blur and other factors, misrecognition may occur, so the following steps are necessary.

[0077] The spacing and spacing threshold between array patterns are roughly estimated by combining the minimum circumscribed rectangle of the array pattern dot set P with the number of rows r and columns c of the array pattern. Calculate the candidate spacing between each point in the array pattern dot set P, and add the candidate spacing to the candidate spacing set L. Sort the candidate spacings in the candidate spacing set L from small to large, determine the minimum candidate spacing, determine the starting spacing range in combination with the user-preset spacing length, traverse the candidate spacing set L using a sliding spacing range, and determine the spacing range containing the most candidate spacings as the core spacing range. Filter the candidate spacing set L according to the core spacing range, and remove the spacing range that is not in the core spacing range from the candidate spacing set L. Calculate the precise spacing h using the remaining candidate spacings in the candidate spacing set L. Construct a dot matrix of r rows and c columns based on the number of rows r and columns c of the array pattern input by the user and the precise spacing h, and complete the construction of the reference pattern dot set Q. All array pattern points in the fixed array pattern dot set P remain stationary, and the reference pattern dot set Q is continuously moved in the form of a sliding window. After each movement, the sum of the distances between all reference pattern points in the reference pattern dot set Q and the nearest array pattern point is calculated. The array pattern point corresponding to the reference pattern dot set Q with the smallest sum of distances is selected as the optimal array pattern point, and this optimal array pattern point is added to the optimal array pattern dot set S. By analyzing the optimal array pattern dot set S, the missing array pattern points, i.e., the missing values, are determined. The coordinates of the complementary pattern points corresponding to the missing values are calculated using the x- and y-coordinates of the other array pattern points surrounding the missing values. The final optimal array pattern dot set S is determined and output as array pattern recognition data.

[0078] Figure 2 A flow chart of a method for acquiring an array pattern dot set P provided by the present invention is shown.

[0079] like Figure 2 As shown, according to an embodiment of the present invention, an image containing an array pattern of r rows and c columns is recognized to determine an array pattern dot set P, including:

[0080] S202, performing template matching recognition on an image containing an array pattern with r rows and c columns according to a preset template image, and determining matching position coordinates of all array pattern points;

[0081] S204: Add the matching position coordinates of all array pattern points to the array pattern point set P.

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

[0083] Figure 3 The flowchart of the method for calculating the interval and interval threshold between array pattern points in the array pattern dot set P provided by the present invention is shown.

[0084] like Figure 3 As shown, according to an embodiment of the present invention, calculating the interval and the interval threshold between array pattern points in the array pattern point set P includes:

[0085] S302, calculating the minimum bounding rectangle of the array pattern dot set P, and determining the width w and height h of the minimum bounding rectangle;

[0086] S304, calculating the interval n between array patterns based on the width w and height h of the minimum circumscribed rectangle:

[0087] ;

[0088] Where r and c are the number of rows and columns of the array pattern in the input image, c0 is the interval constant, and the max() function takes the larger value of the two;

[0089] S306, calculating the interval threshold c1 according to the interval n between the array patterns:

[0090] ;

[0091] Where θ is the maximum rotation angle allowed by the array pattern.

[0092] It should be noted that first, the minimum bounding rectangle of the array pattern dot matrix set P is determined by the matching position coordinates of each array pattern dot in the array pattern dot matrix set P. According to the width w and height h of the minimum bounding rectangle, and the number of rows r and columns c of the image containing r rows and c columns of array patterns, the interval n between the 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. The maximum allowable rotation angle θ of the array pattern is usually set by the user input.

[0093] According to an embodiment of the present invention, a candidate spacing between array pattern dots is calculated based on the spacing between array pattern dots and a spacing threshold, and a candidate spacing set L is established, including:

[0094] Calculate the absolute difference d of the x coordinate between the first array pattern dot P i and the second array pattern dot P j ; x and the absolute difference d of the y coordinate y ;

[0095] 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 dot P i and the second array pattern dot P j to determine the candidate spacing;

[0096] Add the candidate spacing to the candidate spacing set L.

[0097] It should be noted that each array pattern dot in the array pattern dot matrix set P is analyzed in turn. The selected array pattern dot is determined as the first array pattern dot P i , and the other array pattern dots other than this array pattern dot are determined as the second array pattern dot P j . Calculate the absolute difference d of the x coordinate between the first array pattern dot P i and each second array pattern dot P j and the absolute difference d of the y coordinate x . The absolute difference d of the x coordinate y and the absolute difference d of the y coordinate x are used to verify each second array pattern dot P y in turn. When d j <n and d x <n and d yWhen n satisfies the following conditions, if d also meets the requirements x <c1 and d y >c1, or d x >c1 and d y <c1, or d x <c1 and d y <c1, when any of these three conditions is met, calculate P i and the Euclidean distance between the corresponding P j two points, and add the calculated Euclidean distance as a candidate spacing to the candidate spacing set L. After traversing all the array pattern dots in the array pattern dot matrix set P, the calculation of the candidate spacing set is completed.

[0098] According to an embodiment of the present invention, 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, including:

[0099] Determine the initial interval range (L min , L min , L min +m) according to the minimum candidate spacing L in the candidate spacing set L

[0100] and the preset spacing length m; min Based on the starting interval range (L min +m), slide and traverse the candidate spacing set L to determine the number of candidate spacings within each interval range;

[0101] Determine the interval range with the largest number of candidate spacings as the core spacing range;

[0102] Remove the candidate spacings in the candidate spacing set L that are not within the core spacing range.

[0103] It should be noted that the core spacing range is determined by using the method of sliding the spacing range. First, sort the candidate spacings in the candidate spacing set L from small to large to determine the minimum candidate spacing L min , and combine it with the preset spacing length m set by the user to determine the initial interval range (L min , L min +m), and then slide and traverse the spacing set L in turn, and select the interval range with the largest number of candidate spacings as the core interval range. For example, if 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 (this interval only contains the candidate spacing 30) and sliding continuously, 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.

[0104] In addition, if the number of candidate intervals included is the same, the interval range of the minimum starting candidate interval is taken as the core range.

[0105] According to an embodiment of the present invention, calculating the precise distance h based on the filtered candidate distance set L includes:

[0106] According to the remaining candidate spacing L in the candidate spacing set L q Calculate the precise spacing h;

[0107] ;

[0108] Among them, k is the size of the candidate interval set L, L q is the qth remaining candidate spacing in the candidate spacing set L, q≤k.

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

[0110] According to an embodiment of the present invention, constructing a reference pattern dot set Q includes:

[0111] Determine 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 of r rows and c columns;

[0112] The coordinates of each reference pattern point are calculated according to the precise spacing h, and a reference pattern dot matrix set Q is constructed.

[0113] It should be noted that after forming the reference pattern dot matrix of r rows and c columns, the coordinates of each reference pattern point can be calculated by combining the precise spacing h with the number of rows and columns of the reference pattern points. Taking the reference pattern point in the rth row and cth column as an example, the coordinates (x b ,y b ) is calculated as:

[0114] ;

[0115] .

[0116] According to an embodiment of the present invention, matching the reference pattern dot set Q with the array pattern dot set P to determine the optimal array pattern dot set S includes:

[0117] All array pattern points in the fixed array pattern point set P are fixed, and the reference pattern point set Q is moved in the form of a sliding window. The sum of the Euclidean distances between each reference pattern point in the reference pattern point set Q and the nearest array pattern point is calculated;

[0118] When the sum of the distances is the minimum, the array pattern point corresponding to each reference pattern point in the reference pattern point array set Q is determined as the optimal array pattern point;

[0119] An optimal array pattern point set S is established based on the optimal array pattern points.

[0120] It should be noted that when the sum of the distances is the minimum value, it indicates that the position of the reference pattern dot set Q and the array pattern dot set P substantially coincide with each other.

[0121] like Figure 5 As shown, taking 3 rows and 4 columns as an example, the red circle is the recognized array pattern dot set P. Due to reasons such as lighting, some points are recognized more or less (for example, an array pattern point is missing on the right). The blue circle is the optimal array pattern dot set S found through the sliding window form.

[0122] Add the array pattern points corresponding to the red circle within 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 follows: Figure 6 shown.

[0123] According to an embodiment of the present invention, linear interpolation is performed on missing values in the optimal array pattern dot set S to output array pattern recognition data, including:

[0124] Traverse the optimal array pattern point set S to determine the missing values;

[0125] The x-coordinate mean of the upper and lower array pattern points at the position corresponding to the missing value is determined as the x-coordinate of the filling pattern point corresponding to the missing value;

[0126] The y-coordinate mean of the left and right array pattern points at the position corresponding to the missing value is determined as the y-coordinate of the filling pattern point corresponding to the missing value;

[0127] When there is an array pattern point in only one direction of the missing value, a linear difference calculation is performed based on two consecutive array pattern points in the single direction to determine the x-coordinate or y-coordinate of the complementary pattern point corresponding to the missing value.

[0128] It should be noted that for some scenarios, due to recognition issues, it is easy to miss recognition, so the optimal array pattern needs to be supplemented. By traversing the optimal array pattern dot set S, checking each position in r rows and c columns, if the optimal array pattern corresponding to a row or column is missing, it is determined to be a missing value and supplemented.

[0129] The method of filling is that if there are other array pattern points above, below, left and right at the position, the x-coordinate average of the upper and lower array pattern points is used as the x-coordinate of the filling pattern point, and the y-coordinate average of the left and right array pattern points is used as the y-coordinate. If there is only a single direction of up, down or left and right, the coordinates of the point in that single direction are used as a reference for estimation, such as Figure 6 As shown, row 2, column 4 is missing, with no points to the right and only points to the left. Linear interpolation is then used to estimate the y coordinates of row 2, column 4 using the y coordinates of row 2, column 3 and row 2, column 2 on the left. The same process is repeated for other directions. Finally, the missing values in the optimal array pattern dot set S are filled in, and the final array pattern recognition data is obtained.

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

[0131] like Figure 4 As shown, the second aspect of the present invention provides an array pattern recognition system based on machine vision, comprising:

[0132] A data acquisition module, configured to acquire an image containing an array pattern of r rows and c columns;

[0133] An image recognition module is used to recognize an image containing an array pattern with r rows and c columns, and determine a set of array pattern dots P;

[0134] A dot spacing calculation module is configured to calculate the spacing and spacing threshold between array pattern points in an array pattern dot set P; calculate candidate spacings between array pattern points based on the spacing and spacing threshold, and establish a candidate spacing set L; traverse the candidate spacing set L according to a preset spacing length, determine a core spacing range, and screen the candidate spacing set L based on the core spacing range; and calculate a precise spacing h based on the screened candidate spacing set L;

[0135] A dot matrix matching module is used 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, and determine the optimal array pattern dot matrix set S;

[0136] The missing value filling module is used to linearly fill the missing values in the optimal array pattern point set S and output array pattern recognition data.

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

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

[0139] The present invention discloses a machine vision-based array pattern recognition method and system. The method comprises: recognizing an image containing an array pattern with r rows and c columns, determining an array pattern dot set P; calculating the intervals and interval thresholds between array pattern points; calculating candidate spacings between array pattern points, establishing a candidate spacing set L; traversing the candidate spacing set L, determining a core spacing range, and screening the candidate spacing set L; calculating a precise spacing h based on the screened candidate spacing set L; constructing a reference pattern dot set Q, matching the reference pattern dot set Q with the array pattern dot set P, determining an optimal array pattern dot set S; linearly interpolating missing values in the optimal array pattern dot set S, and outputting array pattern recognition data. The present invention can effectively complete the recognition of all array patterns and improve the accuracy of array pattern recognition.

[0140] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0141] The units described above as separate components may or may not be physically separated, and the components displayed 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 may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.

[0142] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0143] Those skilled in the art will appreciate that all or part of the steps of the above-mentioned method embodiments may be implemented by hardware associated with program instructions, and the aforementioned program may be stored in a computer-readable storage medium. When the program is executed, the program executes the steps of the above-mentioned method embodiments. The aforementioned storage medium includes various media that can store program codes, such as mobile storage devices, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.

[0144] Alternatively, if the integrated units described above are implemented as software modules and sold or used as standalone products, they can also be stored on a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present invention, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product, stored on a storage medium, includes instructions for enabling a computer device (such as a personal computer, server, or network device) to execute all or part of the methods described in various embodiments of the present invention. The aforementioned storage media include various media capable of storing program code, such as removable storage devices, ROM, RAM, magnetic disks, or optical disks.

Claims

1. A method for array pattern recognition based on machine vision, characterized in that: include: Acquire an image containing an array pattern of r rows and c columns; Identify the image containing the array pattern with r rows and c columns, and determine the array pattern dot set P; Calculating the intervals and interval thresholds between array pattern points in the array pattern point set P; Calculate candidate spacings between array pattern points based on the spacings between the array pattern points and a spacing threshold, and establish a candidate spacing set L; Traversing the candidate spacing set L according to a preset spacing length, determining a core spacing range, and screening the candidate spacing set L based on the core spacing range; Calculate the precise spacing h based on the filtered candidate spacing set L; Constructing a reference pattern dot set Q, matching the reference pattern dot set Q with the array pattern dot set P, and determining an optimal array pattern dot set S; Perform linear interpolation to fill missing values in the optimal array pattern point set S, and output array pattern recognition data; The calculating the intervals and the interval thresholds between array pattern points in the array pattern point set P includes: Calculating the minimum bounding rectangle of the array pattern dot set P, and determining the width w and height h of the minimum bounding rectangle; The interval n between array patterns is calculated based on the width w and height h of the minimum circumscribed rectangle: ; Where r and c are the number of rows and columns of the array pattern in the input image, c0 is the interval constant, and the max() function takes the larger value of the two; Calculate the interval threshold c1 according to the interval n between the array patterns: ; Where θ is the maximum rotation angle allowed by the array pattern; The traversing the candidate spacing set L according to the preset spacing length, determining a core spacing range, and screening the candidate spacing set L based on the core spacing range includes: According to the minimum candidate distance L in the candidate distance set L min and the preset spacing length m to determine the starting interval range (L min , L min +m); According to the starting interval range (L min , L min +m) performing a sliding traversal of the candidate spacing set L to determine the number of candidate spacings within each interval; The interval range containing the largest number of candidate intervals is determined as the core interval range; Eliminate candidate spacings that are not within the core spacing range from the candidate spacing set L; Calculating the precise distance h based on the filtered candidate distance set L includes: According to the remaining candidate spacing L in the candidate spacing set L q Calculate the precise spacing h; ; Among them, k is the size of the candidate interval set L, L q is the qth remaining candidate spacing in the candidate spacing set L, q≤k.

2. The array pattern recognition method based on machine vision according to claim 1, characterized in that: The step of identifying the image having the array pattern of r rows and c columns and determining the array pattern dot set P includes: Performing 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; The matching position coordinates of all array pattern points are added to the array pattern point set P.

3. The array pattern recognition method based on machine vision according to claim 1, characterized in that: The step of calculating candidate spacings between array pattern points based on the spacings between array pattern points and a spacing threshold, and establishing a candidate spacing set L, comprises: Calculate the first array pattern point P in the array pattern point set P i and the second array pattern point P j The absolute difference d of the x-coordinates x The absolute difference d between the y coordinate and y ; When d satisfies x < n and d y < n, if it also satisfies that d x < c1 and d y > c1, or satisfies that d x > c1 and d y < c1, or satisfies that d x < c'1 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; It should be noted that there seems to be a typo in the original text where "c1" appears twice in the context of "d < c1 and d < c1" which might be incorrect. Also, "c'1" in the translation is an assumption as there might be a missing or incorrect character in the original "c1" in that particular condition. If this is a real error in the original text, it should be corrected before translation for a more accurate result. The candidate distance is added to the candidate distance set L.

4. The array pattern recognition method based on machine vision according to claim 1, characterized in that: The step of constructing a reference pattern dot set Q includes: Determine 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 of r rows and c columns; The coordinates of each reference pattern point are calculated according to the precise spacing h, and a reference pattern dot array set Q is constructed.

5. The array pattern recognition method based on machine vision according to claim 1, characterized in that: The matching of the reference pattern dot set Q with the array pattern dot set P to determine the optimal array pattern dot set S includes: Fixing all array pattern points in the array pattern point set P, moving the reference pattern point set Q in the form of a sliding window, and calculating the sum of the Euclidean distances between each reference pattern point in the reference pattern point set Q and the nearest array pattern point; When the sum of the distances is a minimum value, the array pattern point corresponding to each reference pattern point in the reference pattern point array set Q is determined as the optimal array pattern point; An optimal array pattern point set S is established according to the optimal array pattern points.

6. The array pattern recognition method based on machine vision according to claim 1, characterized in that: The step of linearly filling missing values in the optimal array pattern dot set S and outputting array pattern recognition data includes: Traversing the optimal array pattern point set S to determine missing values; Determine the x-coordinate mean of the upper and lower array pattern points at the position corresponding to the missing value as the x-coordinate of the filling pattern point corresponding to the missing value; Determine the y-coordinate mean of the left and right array pattern points at the position corresponding to the missing value as the y-coordinate of the filling pattern point corresponding to the missing value; When there is an array pattern point in only one direction of the up and down directions or the left and right directions of the missing value, a linear difference calculation is performed based on two consecutive array pattern points in the single direction to determine the x coordinate or y coordinate of the filling pattern point corresponding to the missing value.

7. A machine vision-based array pattern recognition system, used to implement the machine vision-based array pattern recognition method according to any one of claims 1 to 6, characterized in that: include: 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 the image containing the array pattern of r rows and c columns, and determine the array pattern dot set P; a dot spacing calculation module, configured to calculate the intervals and interval thresholds between array pattern points in the array pattern dot set P; Calculating candidate spacings between array pattern points based on the spacings between the array pattern points and the spacing threshold, and establishing a candidate spacing set L; traversing the candidate spacing set L according to a preset spacing length, determining a core spacing range, and screening the candidate spacing set L based on the core spacing range; Calculate the precise spacing h based on the filtered candidate spacing set L; A dot matrix matching module is used 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, and determine the optimal array pattern dot matrix set S; The missing value filling module is used to perform linear interpolation to fill the missing values in the optimal array pattern dot set S and output array pattern recognition data.

Citation Information

Patent Citations

  • Lattice target regularity detection method based on machine vision

    CN114897846A