ArUco QR code corner recognition methods, devices, equipment, media and products
By constructing a set of L-shaped convolution operators with multiple preset kernel sizes, the weight image of the target image is convolved, which solves the inaccuracy problem of OpenCV library functions in recognizing ArUco QR code corners, and achieves more refined corner recognition and higher recognition accuracy.
Patent Information
- Application Number
- CN202510645154.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2045-05-19
AI Technical Summary
In existing technologies, OpenCV library functions are not accurate enough in recognizing corner points of ArUco QR codes, which leads to reduced performance in subsequent tasks.
The weighted image of the target image is convolved using a set of L-shaped convolution operators with multiple preset kernel sizes. By constructing basic and deformed L-shaped convolution operators, the recognition of QR code corner points is refined. Combined with Gaussian blur and rotation operations, the accuracy of corner point recognition is improved.
This improved the accuracy of ArUco QR code corner recognition, enhancing the precision and robustness of subsequent tasks.
Smart Images

Figure CN120579564B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of QR code corner recognition, and in particular to an ArUco QR code corner recognition method, apparatus, equipment, medium and product. Background Technology
[0002] As precise and identifiable markers, ArUco QR codes have wide applications in sensor calibration, object pose estimation, augmented reality, and robot navigation. Accurate recognition of ArUco QR codes is crucial for the accuracy and robustness of subsequent tasks such as localization and pose estimation. Furthermore, the accuracy of recognizing the corner points of the overall contour of the ArUco QR code directly affects the accuracy of pose estimation and the success of decoding.
[0003] The relevant technology uses OpenCV library functions to recognize and decode ArUco QR codes, obtain the corner points and code meanings of the QR codes, and use them to estimate the position and orientation of the QR code placement plane. However, the corner points of ArUco QR codes recognized by OpenCV library functions are not accurate, which leads to a decrease in the performance of subsequent tasks. Summary of the Invention
[0004] The purpose of this application is to provide an ArUco QR code corner recognition method, device, equipment, medium, and product that can obtain more accurate corner recognition results.
[0005] To achieve the above objectives, this application provides the following solution:
[0006] Firstly, this application provides an ArUco QR code corner recognition method, including:
[0007] A set of L-shaped convolution operators with multiple preset kernel sizes is constructed. The set of L-shaped convolution operators includes a basic L-shaped convolution operator and multiple modified L-shaped convolution operators obtained by processing the basic L-shaped convolution operator. The basic L-shaped convolution operator is a convolution operator in which the grayscale value of all pixels on the first and second connecting lines is 1, and the grayscale value of all pixels other than those on the first and second connecting lines is 0. The first connecting line is the line connecting the center pixel of the operator to the top-left pixel of the operator. The second connecting line is the line connecting the center pixel of the operator to the bottom-left pixel of the operator.
[0008] The set of L-shaped convolution operators with preset kernel sizes is used to convolve the weight image of the target image. Based on the weight image after convolution with preset kernel sizes, the weight image after convolution of the target image is determined. The target image includes one or more ArUco QR codes.
[0009] If the target image includes an ArUco QR code, then the corner points of the ArUco QR code are determined based on the set of contour points of the ArUco QR code in the weighted image after convolution of the target image.
[0010] If the target image includes multiple ArUco QR codes, for any ArUco QR code in the target image, the corner points of the ArUco QR code are determined according to the set of contour points of the ArUco QR code in the weighted image after convolution of the target image.
[0011] In one embodiment, the process of determining the weight image of the target image is as follows: according to the formula Obtain the weighted image of the target image, where I w The weighted image representing the target image, I u I represents the first convolution result obtained by processing the grayscale image of the target image using the Sobel convolution operator. v This represents the second convolution result obtained by processing the grayscale image of the target image using the transpose of the Sobel convolution operator.
[0012] In one embodiment, an L-shaped convolution operator set with preset kernel sizes is used to convolve the weight image of the target image, and the weight image after convolution of the target image is determined based on the weight image after convolution with each preset kernel size. Specifically, this includes:
[0013] For any preset convolution kernel size, each L-type convolution operator in the set of L-type convolution operators under the preset convolution kernel size is used to perform convolution processing on the weight image of the target image to obtain multiple convolution weight images under the preset convolution kernel size.
[0014] Calculate the average value of multiple convolution weight images to obtain the weight image after convolution processing at the preset convolution kernel size;
[0015] For any pixel in the weight image after convolution of the target image, the maximum gray value in the set of gray values corresponding to the pixel at that position is determined as the gray value of the pixel at that position in the weight image after convolution of the target image; the set of gray values corresponding to the pixel at that position includes the gray values corresponding to the pixel at that position in the weight image after convolution processing under all preset convolution kernel sizes.
[0016] In one embodiment, the process of determining the deformed L-shaped convolution operator is as follows:
[0017] The mask value corresponding to each first target pixel is obtained by calculating the distance between each first target pixel and its nearest neighbor pixel in the basic L-shaped convolution operator; the first target pixel is the pixel with a gray value of 0, and the nearest neighbor pixel is the pixel with a gray value of 1 that is closest to the first target pixel.
[0018] In the basic L-shaped convolution operator, the mask value corresponding to each second target pixel is determined to be 0; the second target pixel is a pixel with a grayscale value of 1.
[0019] The distance matrix is obtained based on the mask value corresponding to each first target pixel and the mask value corresponding to each second target pixel;
[0020] A first normal distribution matrix is constructed with a preset number of dimensions as the variance and the mean of each value in the distance matrix as the mean, and a first mask matrix is obtained based on the first normal distribution matrix;
[0021] A second normal distribution matrix is constructed with a preset dimension as the variance and the reciprocal of each value in the first mask matrix as the mean. The second mask matrix is then obtained based on the second normal distribution matrix.
[0022] Use the second mask matrix to add Gaussian blur to all pixels with a gray value of 0 in the basic L-shaped convolution operator, and set the minimum gray value of the basic L-shaped convolution operator after adding Gaussian blur to be greater than 0.
[0023] By rotating the basic L-shaped convolution operator after adding Gaussian blur N times, N deformed L-shaped convolution operators are obtained.
[0024] In one embodiment, the corner points of the ArUco QR code are determined based on the set of contour points in the weighted image after convolution of the target image, specifically including:
[0025] For any pixel in the contour point set of the ArUco QR code in the weighted image after convolution of the target image, the position of the pixel is adjusted according to the gray values of the four nearest neighbors of the target pixel to obtain the adjusted contour point set of the ArUco QR code in the weighted image after convolution of the target image; the target pixel is the pixel in the grayscale image of the target image.
[0026] The corner points of the ArUco QR code are determined based on the adjusted contour point set.
[0027] In one embodiment, if the target image includes multiple ArUco QR codes, the determination process for the contour point set of each ArUco QR code in the weighted image after convolution of the target image includes:
[0028] Denoise and classify all pixels in the weight image after convolution of the target image to obtain all pixels corresponding to each ArUco QR code;
[0029] Based on all the pixels corresponding to each ArUco QR code, the contour point set of each ArUco QR code in the weighted image after convolution of the target image is obtained.
[0030] Secondly, this application provides an ArUco QR code corner recognition device, comprising:
[0031] A construction module is used to construct a set of L-shaped convolution operators with multiple preset kernel sizes. The set of L-shaped convolution operators includes a basic L-shaped convolution operator and multiple modified L-shaped convolution operators obtained by processing the basic L-shaped convolution operator. The basic L-shaped convolution operator is a convolution operator in which the grayscale value of all pixels on the first and second connecting lines is 1, and the grayscale value of all pixels other than those on the first and second connecting lines is 0. The first connecting line is the line connecting the center pixel of the operator to the top-left pixel of the operator; the second connecting line is the line connecting the center pixel of the operator to the bottom-left pixel of the operator.
[0032] The convolution module is used to perform convolution processing on the weight image of the target image using a set of L-shaped convolution operators with preset convolution kernel sizes, and to determine the weight image of the target image after convolution based on the weight image after convolution processing with preset convolution kernel sizes; the target image includes one or more ArUco QR codes;
[0033] The corner point determination module is used to determine the corner points of an ArUco QR code based on the set of contour points of the ArUco QR code in the weighted image after convolution of the target image if the target image includes an ArUco QR code; and to determine the corner points of any ArUco QR code in the target image based on the set of contour points of the ArUco QR code in the weighted image after convolution of the target image if the target image includes multiple ArUco QR codes.
[0034] Thirdly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the ArUco QR code corner recognition method described in any of the above claims.
[0035] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the ArUco QR code corner recognition method described in any of the preceding claims.
[0036] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the ArUco QR code corner recognition method described in any of the above claims.
[0037] According to the specific embodiments provided in this application, this application has the following technical effects:
[0038] This application provides a method, apparatus, device, medium, and product for corner recognition of ArUco QR codes. When OpenCV library functions extract corners from ArUco QR codes, the resulting contours are often inaccurate, leading to inaccurate corner recognition results when used for subsequent corner recognition. To address this, the proposed ArUco QR code corner extraction method uses an L-shaped convolution operator to process the weighted image to obtain a more refined basic contour compared to the contour extracted using OpenCV library functions. This is because the L-shaped convolution operator does not directly process the original image but further enhances the features corresponding to the QR code corners based on the weighted image, thus achieving a more precise basic contour. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 A flowchart illustrating an ArUco QR code corner recognition method provided in an embodiment of this application;
[0041] Figure 2 A schematic diagram illustrating the principle of an ArUco QR code corner recognition method provided in an embodiment of this application;
[0042] Figure 3 This is a schematic diagram of contour pixel adjustment provided in an embodiment of this application;
[0043] Figure 4 A functional module diagram of an ArUco QR code corner recognition device provided in an embodiment of this application;
[0044] Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0045] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0046] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0047] In one exemplary embodiment, such as Figure 1 and Figure 2 As shown, an ArUco QR code corner recognition method is provided, including the following steps:
[0048] Step 201: Construct a set of L-shaped convolution operators with multiple preset kernel sizes; the set of L-shaped convolution operators includes a basic L-shaped convolution operator and multiple modified L-shaped convolution operators obtained by processing the basic L-shaped convolution operator; the basic L-shaped convolution operator is a convolution operator in which the gray value of all pixels on the first connection and the second connection is 1, and the gray value of all pixels other than those on the first connection and the second connection is 0; the first connection is the connection between the center pixel of the operator and the top left pixel of the operator; the second connection is the connection between the center pixel of the operator and the bottom left pixel of the operator.
[0049] Step 202: Using a set of L-shaped convolution operators with preset kernel sizes, perform convolution processing on the weight image of the target image, and determine the weight image of the target image after convolution based on the weight image after convolution processing with preset kernel sizes; the target image includes one or more ArUco QR codes.
[0050] Step 203: If the target image includes an ArUco QR code, then determine the corner points of the ArUco QR code based on the set of contour points of the ArUco QR code in the weighted image after convolution of the target image.
[0051] Step 204: If the target image includes multiple ArUco QR codes, for any ArUco QR code in the target image, determine the corner points of the ArUco QR code based on the set of contour points in the weighted image after convolution of the ArUco QR code in the target image.
[0052] In another exemplary embodiment of this application, the grayscale image acquisition process of the target image is as follows:
[0053] Connect the camera to the computer, configure the camera driver, and start the camera. Place the camera in front of the target area, ensuring the camera's image size is compatible with the target area. Use the camera to photograph the target area, obtain the target image, and convert it into a grayscale image (I).
[0054] In another exemplary embodiment of this application, the weight image determination process for the target image is as follows: according to the formula Obtain the weighted image of the target image, where I w The weighted image representing the target image, I u I represents the first convolution result obtained by processing the grayscale image of the target image using the Sobel convolution operator U. v This represents the second convolution result obtained by processing the grayscale image of the target image using the transpose V of the Sobel convolution operator.
[0055] In another exemplary embodiment of this application, the process for determining the deformed L-shaped convolution operator is as follows:
[0056] The mask value corresponding to each first target pixel is obtained by calculating the distance between each first target pixel and its nearest neighbor pixel in the basic L-shaped convolution operator; the first target pixel is the pixel with a gray value of 0, and the nearest neighbor pixel is the pixel with a gray value of 1 that is closest to the first target pixel.
[0057] In the basic L-shaped convolution operator, the mask value corresponding to each second target pixel is determined to be 0; the second target pixel is a pixel with a grayscale value of 1.
[0058] The distance matrix is obtained based on the mask values corresponding to each first target pixel and each second target pixel. Specifically, assuming the basic L-shaped convolution operator is 2 rows and 2 columns, including 4 pixel values, where the mask value corresponding to the pixel in the first row and first column is m11, then the distance matrix is...
[0059] Due to noise, a first normal distribution matrix is constructed with a preset number of dimensions as the variance and the values in the distance matrix as the mean. A first mask matrix is then obtained based on this first normal distribution matrix. Specifically, for any value in the distance matrix, a normal distribution corresponding to that value is constructed with that value as the mean and a preset number of dimensions as the variance. A first normal distribution matrix is constructed based on the normal distributions corresponding to all values in the distance matrix. For any normal distribution in the first normal distribution matrix, a value is randomly selected from the probabilities between [mean - standard deviation] and [mean + standard deviation] as the mask value corresponding to this normal distribution. The preset number of dimensions can be 2.
[0060] To ensure that the mask is sensitive to the boundaries and corners of the ArUco code during convolution, a second normal distribution matrix is constructed with a preset dimension as the variance and the reciprocal of each value in the first mask matrix as the mean. The second mask matrix is then obtained based on the second normal distribution matrix.
[0061] The second mask matrix is used to add Gaussian blur to all pixels with a gray value of 0 in the basic L-shaped convolution operator, and the minimum gray value of the basic L-shaped convolution operator after adding Gaussian blur is set to be greater than 0.
[0062] By rotating the basic L-shaped convolution operator after adding Gaussian blur N times, N deformed L-shaped convolution operators are obtained.
[0063] In another exemplary embodiment of this application, a set of L-shaped convolution operators C = {c1, c2, c3, c4} with a preset kernel size l is constructed, where l is a positive odd number. The specific process is as follows:
[0064] The default value of the grayscale value of each pixel in the basic L-shaped convolution operator is set to 0. Then, the grayscale value of the pixel at the center of the operator is set to 1. The grayscale value of the pixels on the straight line (first line) formed by the pixel at the center of the operator and the pixel at the top left corner of the operator is set to 1. The grayscale value of the pixels on the straight line (second line) formed by the pixel at the center of the operator and the pixel at the bottom left corner of the operator is set to 1. This yields the basic L-shaped convolution operator c1 in the set of L-shaped convolution operators with the preset kernel size l.
[0065] For the 0-value pixels in the basic L-shaped convolution operator c1, first calculate the distance to the nearest 1-value pixel to obtain the mask value of each pixel. Then, determine that the mask value of the 1-value pixels in the basic L-shaped convolution operator c1 is 0. Based on the above mask values, construct the first normal distribution matrix with the mean as the mean and the variance as the dimension 2, and obtain the first mask matrix based on the first normal distribution matrix. Using a preset dimension as the variance and the reciprocal of each value in the first mask matrix as the mean, a normal distribution is fitted to obtain a second normal distribution matrix. Based on the second normal distribution matrix, a second mask matrix is obtained. Gaussian blur is added to all zero-value regions in the basic L-shaped convolution operator using the second mask matrix. The values in the second mask matrix corresponding to the zero-value regions in the basic L-shaped convolution operator are replaced with the original zero values in the basic L-shaped convolution operator, and a minimum threshold is set to prevent them from being zero. Operator c1 is rotated clockwise by 90 degrees, 180 degrees, and 270 degrees respectively to obtain three deformed L-shaped convolution operators c2, c3, and c4 in the set of L-shaped convolution operators with a preset convolution kernel size l, thus obtaining the required four L-shaped convolution operators c1, c2, c3, and c4.
[0066] In another exemplary embodiment of this application, an L-shaped convolution operator set with each preset convolution kernel size is used to perform convolution processing on the weight image of the target image, and the weight image after convolution of the target image is determined based on the weight image after convolution processing with each preset convolution kernel size, specifically including:
[0067] For any preset convolution kernel size, each L-type convolution operator in the set of L-type convolution operators under the preset convolution kernel size is used to perform convolution processing on the weight image of the target image to obtain multiple convolution weight images under the preset convolution kernel size.
[0068] The average value of multiple convolution weight images is calculated to obtain the weight image after convolution processing at the preset convolution kernel size. Taking the preset convolution kernel size l as an example, the specific formula is as follows: in, This represents the weight image after convolution processing with a preset kernel size l.
[0069] For any pixel in the weight image after convolution of the target image, the maximum gray value in the set of gray values corresponding to that pixel is determined as the gray value of that pixel in the weight image after convolution of the target image. The set of gray values corresponding to that pixel includes the gray values corresponding to the pixels in the weight images after convolution processing under all preset convolution kernel sizes. Specifically, taking three preset convolution kernel sizes l1, l2, and l3 as examples, the weight images after convolution processing under the corresponding preset convolution kernel sizes can be obtained through the above steps. For any pixel in the weight image after convolution of the target image, The largest gray value among the gray values corresponding to the pixels at the specified positions is used as the weight image I after convolution of the target image. c The grayscale value of the pixel at the specified location.
[0070] In another exemplary embodiment of this application, if the target image includes multiple ArUco QR codes, the process of determining the contour point set of each ArUco QR code in the weighted image after convolution of the target image includes:
[0071] Denoising and classifying all pixels in the weight image after convolution of the target image yields all pixels corresponding to each ArUco QR code. Specifically, the MaxMean thresholding method is used to segment the weight image I after convolution of the target image. c Thresholding segmentation is performed to obtain a binary image I. bThe 0-value regions represent the background, while the 1-value regions contain the pixels corresponding to the ArUco QR codes and some noise. The DBSCAN method is used to process the 1-value regions for denoising and classification, obtaining the pixels corresponding to each ArUco QR code. If the image contains n ArUco QR codes, then the set of pixels corresponding to the i-th ArUco QR code is P. i .
[0072] Based on all pixels corresponding to each ArUco QR code, the contour point set of each ArUco QR code in the weighted image after convolution with the target image is obtained. Specifically: (1) Contour preservation. In two-dimensional space, P i It contains the outline of numerous pixels in the same row and column, and P i The set of pixels P at the top of each column i a The set of pixels at the bottom of each column The set of rightmost pixels in each row The set of pixels at the far left of each row Extracted as a set of contour points
[0073] In another exemplary embodiment of this application, if the target image includes an ArUco QR code, the process of determining the contour point set of the ArUco QR code in the weighted image after convolution of the target image includes: in two-dimensional space, extracting the topmost pixel set of each column, the bottommost pixel set of each column, the rightmost pixel set of each row, and the leftmost pixel set of each row as contour point sets in the weighted image after convolution of the target image.
[0074] In another exemplary embodiment of this application, the corner points of the ArUco QR code are determined based on the set of contour points in the weighted image after convolution of the target image, specifically including:
[0075] For any pixel in the contour point set of the ArUco QR code in the weighted image after convolution of the target image, the position of the pixel is adjusted according to the gray values of the four nearest neighbors of the target pixel to obtain the adjusted contour point set of the ArUco QR code in the weighted image after convolution of the target image; the target pixel is the pixel in the grayscale image of the target image. Specifically: (2) Contour point adjustment. For each pixel p in the contour point set i If p i If the gray value in grayscale image I is greater than the average of its eight nearest neighbor gray values in I, it indicates that the pixel p i Located outside the ArUco QR code boundary, the position of this point needs to be adjusted. This can be done based on p iThe gray value in grayscale image I is paired with the gray values of its four nearest neighbors in grayscale image I. i The pixel positions are adjusted. The specific logic of the adjustment strategy is as follows: the grayscale of the ArUco QR code boundary should be the minimum value among its four nearest neighbors, which can be achieved by comparing the first-order difference d between the horizontal and vertical pixels. ub With d lr The size of the value is used to determine the direction of the current pixel adjustment. For example... Figure 3 As shown, p i There are four types of pixel distribution types for four nearest neighbors: Type 1, Figure 3 As shown in section (a), the absolute value of the gray-level difference between the upper and lower ends (the first-order difference of the horizontal pixels) is greater than or equal to the absolute value of the gray-level difference between the left and right ends (the first-order difference of the vertical pixels) (|d ub |≥|d lr |), and the difference d obtained by subtracting the gray value of the lower pixel from the gray value of the upper pixel ub ≥0 indicates that the boundary of the AruCo QR code is below the current pixel, and p can be... i The position is adjusted downwards. Type 2, Figure 3 As shown in section (b), |d ub |≥|d lr |and d ub <0 at this time p can be i Position adjusted upwards, type 3 Figure 3 As shown in section (c), |d ub |<|d lr |and d ub ≥0 at this time p can be i Position adjusted to the right and type 4 Figure 3 As shown in section (d), |d ub |<|d lr |and d ub <0 at this time p can be i Adjust its position to the left.
[0076] The corner points of the ArUco QR code are determined based on the adjusted contour point set.
[0077] The overall logic for corner point extraction is to fit four boundaries using the contour pixels of the ArUco QR code, and the intersection of two adjacent boundaries is the corner point of the QR code in the image. Therefore, in another exemplary embodiment of this application, the corner points of the ArUco QR code are determined based on the adjusted contour point set, specifically including: (3) Line fitting. Four contour lines are extracted from the contour point set using the RANSAC line fitting method. (4) Corner point calculation. The intersection points of two adjacent lines are calculated respectively, and the four intersection points are the corner points of the ArUco QR code.
[0078] This application designs a dedicated L-shaped convolution operator to extract the contour features of QR codes in images, which can extract the pixels corresponding to the outer contour of the QR code more precisely. Then, through the contour adjustment strategy designed in this application, combined with the image grayscale information, the pixel positions in the outer contour of the QR code are adjusted, and most non-QR code contour pixels are removed more precisely, resulting in more refined ArUco QR code contour pixels. This improves the accuracy of subsequent line fitting and further ensures the accuracy of corner point calculation results.
[0079] This application can adaptively identify the number of ArUco QR codes contained in an image and extract the corner points of each QR code in batches.
[0080] Based on the same inventive concept, this application also provides an ArUco QR code corner recognition device for implementing the ArUco QR code corner recognition method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations of one or more ArUco QR code corner recognition device embodiments provided below can be found in the limitations of the ArUco QR code corner recognition method described above, and will not be repeated here.
[0081] In one exemplary embodiment, such as Figure 4 As shown, an ArUco QR code corner recognition device is provided, comprising:
[0082] Module A1 is used to construct a set of L-shaped convolution operators with multiple preset kernel sizes. The set of L-shaped convolution operators includes a basic L-shaped convolution operator and multiple modified L-shaped convolution operators obtained by processing the basic L-shaped convolution operator. The basic L-shaped convolution operator is a convolution operator in which the grayscale value of all pixels on the first and second connecting lines is 1, and the grayscale value of all pixels other than those on the first and second connecting lines is 0. The first connecting line is the line connecting the center pixel of the operator to the top-left pixel of the operator. The second connecting line is the line connecting the center pixel of the operator to the bottom-left pixel of the operator.
[0083] Convolution module A2 is used to perform convolution processing on the weight image of the target image using a set of L-shaped convolution operators with preset convolution kernel sizes, and to determine the weight image of the target image after convolution based on the weight image after convolution processing with preset convolution kernel sizes; the target image includes one or more ArUco QR codes;
[0084] The corner point determination module A3 is used to determine the corner points of the ArUco QR code based on the set of contour points of the ArUco QR code in the weighted image after convolution of the target image if the target image includes one ArUco QR code; and to determine the corner points of the ArUco QR code based on the set of contour points of the ArUco QR code in the weighted image after convolution of the target image if the target image includes multiple ArUco QR codes.
[0085] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 5 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores ArUco QR code corner recognition data. The I / O interfaces are used for information exchange between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements an ArUco QR code corner recognition method.
[0086] Those skilled in the art will understand that Figure 5 The structures shown are merely block diagrams of some structures related to the present application and do not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method embodiments.
[0087] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the above-described method embodiments.
[0088] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the above-described method embodiments.
[0089] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0090] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0091] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0092] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0093] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. An ArUco two-dimensional code corner point recognition method, characterized in that, The ArUco two-dimensional code corner point recognition method comprises: An L-shaped convolution operator set under each preset kernel size is constructed; the L-shaped convolution operator set comprises a basic L-shaped convolution operator and a plurality of deformed L-shaped convolution operators obtained by processing the basic L-shaped convolution operator; the basic L-shaped convolution operator is a convolution operator in which the gray values of all pixel points on a first connecting line and a second connecting line are 1, and the gray values of all pixel points except the pixel points on the first connecting line and the second connecting line are 0; the first connecting line is a connecting line between a center pixel point of the operator and a top-left pixel point of the operator; and the second connecting line is a connecting line between the center pixel point of the operator and a top-right pixel point of the operator; The L-shaped convolution operator set under each preset kernel size is used to perform convolution processing on a weight image of a target image, and a weight image of the target image after convolution is determined based on the weight image of the target image after convolution under each preset kernel size; the target image comprises one or more ArUco two-dimensional codes; If the target image comprises one ArUco two-dimensional code, a corner point of the ArUco two-dimensional code is determined according to a contour point set of the ArUco two-dimensional code in the weight image of the target image after convolution; If the target image comprises a plurality of ArUco two-dimensional codes, for any one ArUco two-dimensional code in the target image, a corner point of the ArUco two-dimensional code is determined according to a contour point set of the ArUco two-dimensional code in the weight image of the target image after convolution.
2. The ArUco QR code corner detection method of claim 1, wherein, The weight image determination process of the target image comprises: According to the formula A weight image of the target image is obtained, wherein I w represents the weight image of the target image, I u represents a first convolution result obtained by processing the gray image of the target image by using a sobel convolution operator, I v represents a second convolution result obtained by processing the gray image of the target image by using a transpose of the sobel convolution operator.
3. The ArUco QR code corner detection method of claim 1, wherein, The L-shaped convolution operator set under each preset kernel size is used to perform convolution processing on a weight image of a target image, and a weight image of the target image after convolution is determined based on the weight image of the target image after convolution under each preset kernel size; the target image comprises one or more ArUco two-dimensional codes; For any one preset kernel size, each L-shaped convolution operator in the L-shaped convolution operator set under the preset kernel size is used to perform convolution processing on the weight image of the target image, to obtain a plurality of convolution weight images under the preset kernel size; An average value of the plurality of convolution weight images is calculated to obtain the weight image of the target image after convolution under the preset kernel size; For a pixel point at any position of the weight image of the target image after convolution, a maximum gray value in a gray value set corresponding to the pixel point at the position is determined as a gray value of the pixel point at the position of the weight image of the target image after convolution; the gray value set corresponding to the pixel point at the position comprises gray values of the pixel point at the position in the weight images after convolution under all preset kernel sizes.
4. The ArUco QR code corner detection method of claim 1, wherein, The determination process of the deformed L-shaped convolution operator comprises: The distances between each first target pixel point and a nearest neighbor pixel point in the basic L-shaped convolution operator are calculated to obtain a mask value corresponding to each first target pixel point; the first target pixel point is a pixel point with a gray value of 0, and the nearest neighbor pixel point is a pixel point with a gray value of 1 closest to the first target pixel point; A mask value corresponding to each second target pixel point in the basic L-shaped convolution operator is determined as 0; the second target pixel point is a pixel point with a gray value of 1. According to the mask values corresponding to each first target pixel point and the mask values corresponding to each second target pixel point, a distance matrix is obtained; A first normal distribution matrix is constructed with the preset dimension number as the variance and each value in the distance matrix as the mean, and a first mask matrix is obtained based on the first normal distribution matrix; A second normal distribution matrix is constructed with the preset dimension number as the variance and the reciprocal of each value in the first mask matrix as the mean, and a second mask matrix is obtained based on the second normal distribution matrix; The second mask matrix is used to add Gaussian blur to the pixel points with a gray value of 0 in all pixel points of the basic L-shaped convolution operator, and the minimum gray value of the basic L-shaped convolution operator after adding Gaussian blur is set to be greater than 0; The basic L-shaped convolution operator after adding Gaussian blur is rotated N times to obtain N deformed L-shaped convolution operators.
5. The ArUco QR code corner detection method of claim 1, wherein, According to the contour point set of the ArUco two-dimensional code in the weight image after convolution of the target image, the corner points of the ArUco two-dimensional code are determined, specifically including: For any one pixel point in the contour point set of the ArUco two-dimensional code in the weight image after convolution of the target image, the position of the pixel point is adjusted according to the gray values of the four near-neighbor points of the target pixel point to obtain an adjusted contour point set of the ArUco two-dimensional code in the weight image after convolution of the target image; the target pixel point is the pixel point of the pixel point in the gray image of the target image; Based on the adjusted contour point set, the corner points of the ArUco two-dimensional code are determined.
6. The ArUco QR code corner detection method of claim 1, wherein, If the target image includes multiple ArUco two-dimensional codes, the determination process of the contour point set of each ArUco two-dimensional code in the weight image after convolution of the target image includes: All pixel points in the weight image after convolution of the target image are denoised and classified to obtain all pixel points corresponding to each ArUco two-dimensional code; Based on all pixel points corresponding to each ArUco two-dimensional code, the contour point set of each ArUco two-dimensional code in the weight image after convolution of the target image is obtained.
7. An ArUco QR code corner point recognition device, characterized by, The ArUco two-dimensional code corner point recognition device includes: A construction module is configured to construct a set of L-shaped convolution operators with a plurality of preset kernel sizes; the set of L-shaped convolution operators includes a basic L-shaped convolution operator and a plurality of deformed L-shaped convolution operators obtained by processing the basic L-shaped convolution operator; the basic L-shaped convolution operator has a gray value of 1 for all pixel points on a first connecting line and a second connecting line, and a gray value of 0 for all pixel points except the pixel points on the first connecting line and the second connecting line; the first connecting line is a connecting line between a center pixel point of the operator and a top-left pixel point of the operator; the second connecting line is a connecting line between the center pixel point of the operator and a top-right pixel point of the operator; A convolution module is configured to perform convolution processing on a weight image of a target image by using the set of L-shaped convolution operators with the plurality of preset kernel sizes, and determine a weight image after convolution of the target image based on the weight images after convolution with the plurality of preset kernel sizes; the target image includes one or more ArUco two-dimensional codes. The corner point determination module is configured to: if the target image comprises one ArUco two-dimensional code, determine the corner points of the ArUco two-dimensional code according to a contour point set of the ArUco two-dimensional code in a weight image after convolution of the target image; and if the target image comprises a plurality of ArUco two-dimensional codes, for any one ArUco two-dimensional code in the target image, determine the corner points of the ArUco two-dimensional code according to a contour point set of the ArUco two-dimensional code in a weight image after convolution of the target image.
8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the ArUco two-dimensional code corner point identification method of any one of claims 1-6.
9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the ArUco two-dimensional code corner point identification method of any one of claims 1-6.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the ArUco two-dimensional code corner point identification method of any one of claims 1-6. The computer program is executed by the processor to implement the ArUco two-dimensional code corner point identification method of any one of claims 1-6.
Citation Information
Patent Citations
Corner point detection method based on circular target
CN103606146A
Automatic photographing device based on image recognition
CN117061868A