A two-dimensional code recognition method for a history system
By combining global perspective correction with non-rigid fine-tuning, the problem of non-rigid deformation of QR code images is solved, enabling quantitative evaluation of correction quality and improving the success rate and robustness of QR code recognition.
Patent Information
- Application Number
- CN202511432100.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-09
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-10-09
AI Technical Summary
Existing technologies cannot effectively cope with the non-rigid deformation of QR code images and lack quantitative evaluation of geometric correction quality, resulting in insufficient QR code recognition success rate and robustness.
A two-step correction method combining global perspective correction and non-rigid fine-tuning is adopted. Global correction is performed by calculating the perspective transformation matrix, and non-rigid adjustment is performed by generating the residual displacement field. The correction quality is quantitatively evaluated by combining the geometric consistency measurement system.
It improves the success rate and robustness of QR code recognition in complex scenarios, reduces invalid decoding attempts, and improves processing efficiency.
Smart Images

Figure CN120911498B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of QR code recognition, specifically relating to a QR code recognition method for a resume system. Background Technology
[0002] QR codes are a high-density, highly reliable information encoding method used in numerous fields such as mobile payment, product traceability, information retrieval, and identity authentication. The QR code recognition process typically includes image acquisition, preprocessing, positioning, correction, and decoding. A crucial step is using three positioning patterns in the QR code image to determine the precise position, rotation angle, and orientation of the code area. Based on the center points of these three positioning patterns, combined with the QR code's version information, the position of the fourth corner point can be calculated, constructing a quadrilateral region. By calculating a global perspective transformation matrix, or homography matrix, this distorted quadrilateral region is corrected into a standard square, eliminating perspective distortion introduced by factors such as tilted shooting angles. This correction method based on global perspective transformation is the foundation of current mainstream QR code recognition technology, and its effectiveness highly depends on the assumption that the QR code is attached to an ideal plane.
[0003] However, in real-world applications, the above assumptions are often difficult to uphold. After multiple printings and scans, the QR code images in the record system exhibit complex nonlinear and non-rigid deformations. When using a wide-angle lens or shooting at close range, the barrel or pincushion distortion of the lens itself will also be superimposed on the image. For such complex geometric distortions, a single global perspective transformation model is powerless because it can only correct linear projection relationships between planes. Forcibly applying the global perspective transformation model will result in significant local deviations between the corrected image grid and the actual data module positions, causing subsequent sampling points to deviate severely from the module center, leading to binarization errors and decoding failures. Therefore, existing technologies generally lack the ability to effectively address such non-rigid deformations, and there is also a lack of an effective mechanism for quantitatively evaluating the quality of geometric correction before decoding. It is difficult to determine whether the correction results are reliable enough to support successful decoding, limiting the recognition success rate and robustness of QR codes in complex scenarios. Summary of the Invention
[0004] This invention provides a QR code recognition method for a resume system to solve the technical problems in the prior art that it cannot effectively cope with the non-rigid deformation of QR code images and lacks an effective mechanism for quantitative evaluation of geometric correction quality, which limits its recognition success rate and robustness in complex scenarios.
[0005] In a first aspect, the present invention provides a QR code recognition method for a resume system, comprising the following steps:
[0006] S1, acquire the original image containing the QR code in the resume system, detect candidate positioning graphics in the original image and calculate the sub-pixel center of the candidate positioning graphics; identify the center of three positioning graphics from the candidate positioning graphics, take the center of the positioning graphics as the vertex, and at the same time use the position of at least one detected correction graphic to determine the fourth vertex of the QR code area.
[0007] S2, calculate the perspective transformation matrix based on the four vertices, perform global perspective correction on the QR code area to obtain the globally corrected image; generate a residual displacement field based on the local positional deviation between the actual grid lines and the ideal grid lines in the globally corrected image, and perform non-rigid adjustment on the globally corrected image to obtain the final corrected image.
[0008] S3, calculate the geometric consistency metric of the final corrected image, which is a weighted sum of at least two of the following: (1) the geometric regularity of the isosceles right triangle formed by the three positioning graphic centers after correction; (2) the conformity between the one-dimensional Fourier transform main frequency of the time sequence graphic and the theoretical frequency of the QR code module size; (3) the grid regularity of the QR code data area in the two-dimensional Fourier transform spectrum.
[0009] S4. When the geometric consistency metric meets the preset judgment conditions, the final corrected image is binarized and decoded to achieve the recognition of the QR code.
[0010] Furthermore, the centers of three positioning patterns are identified from the candidate positioning patterns, and the fourth vertex of the QR code region is determined using the position of at least one detected correction pattern, including:
[0011] (a) Calculate the preliminary coordinates of the fourth vertex by performing vector operations on the centers of the three positioning figures;
[0012] (b) Calculate the theoretical position of at least one correction graphic based on the center of the three positioning graphics and the version information of the QR code;
[0013] (c) Calculate the displacement correction vector between the theoretical position obtained in step (b) and the actual position of the correction pattern detected in the image;
[0014] (d) Apply the displacement correction vector to the preliminary coordinates obtained in step (a) to determine the coordinates of the fourth vertex.
[0015] Furthermore, a residual displacement field is generated to perform non-rigid adjustments on the global correction image, including:
[0016] The actual grid line positions are detected by performing horizontal and vertical projection analysis on the global correction image;
[0017] Calculate the one-dimensional deviation between the actual grid line position and the corresponding ideal grid line position;
[0018] One-dimensional bias interpolation is used to generate a two-dimensional residual displacement field covering the entire QR code area;
[0019] The pixel positions in the global correction image are remapped using a two-dimensional residual displacement field to achieve non-rigid adjustment.
[0020] Furthermore, the geometric regularity of the isosceles right triangle formed by the three locating graphic centers after correction is calculated using the following methods:
[0021] Calculate the deviation of the ratio of the lengths of the two shorter sides of the triangle formed by the centers of the three positioning figures from 1, and the deviation of the included angle of the two shorter sides of the triangle from 90 degrees.
[0022] The geometric regularity is inversely proportional to the weighted sum of the two deviations.
[0023] Furthermore, the calculation method for the consistency between the one-dimensional Fourier transform dominant frequency of the time-series graph and the theoretical frequency of the QR code module size includes:
[0024] Extract the centerline pixel grayscale sequence of the horizontal and vertical temporal patterns in the corrected image;
[0025] Perform a one-dimensional Fourier transform on the grayscale sequence of the centerline pixels to determine the dominant frequency;
[0026] The degree of conformity is inversely proportional to the absolute value of the difference between the dominant frequency and the theoretical frequency determined according to the QR code version.
[0027] Furthermore, the grid regularity of the QR code data area in the two-dimensional Fourier transform spectrum is calculated using the following methods:
[0028] Perform a two-dimensional Fourier transform on the data region of the final corrected image;
[0029] In the obtained spectrum, the harmonic peak lattice generated by the periodic structure of the data module is detected;
[0030] Calculate the average deviation between the position of each peak point in the harmonic peak lattice and the position of the ideal Fourier lattice point;
[0031] Grid regularity is inversely proportional to average deviation.
[0032] Furthermore, the final corrected image is binarized, including:
[0033] A local adaptive thresholding method is adopted, which calculates an independent binarization threshold for each pixel based on the gray-level statistical characteristics of the neighborhood of each pixel in the final corrected image, and generates a binarized image based on the binarization threshold.
[0034] Furthermore, a thin-plate spline interpolation model or a radial basis function interpolation model is used to interpolate the one-dimensional deviation to generate a two-dimensional residual displacement field covering the entire QR code area.
[0035] Furthermore, in S4, the Sovora adaptive thresholding method is used to process the final corrected image to eliminate the influence of uneven illumination.
[0036] Furthermore, the original image is an RGB format image.
[0037] The beneficial effects are as follows: This invention employs a two-step correction method combining global perspective correction and non-rigid fine-tuning, which can correct complex nonlinear geometric distortions caused by curved surfaces, wrinkles, and other factors. This overcomes the limitation of a single perspective transformation model, which can only handle planar deformations, and improves the geometric correction accuracy of QR codes on non-ideal planes. Furthermore, the geometric consistency measurement system proposed in this invention quantitatively evaluates and filters the quality of the corrected image before decoding, enabling pre-judgment of the reliability of the correction results. This reduces invalid decoding attempts on images that still exhibit severe distortion, ensuring a high recognition success rate while reducing unnecessary computational overhead and enhancing the processing efficiency of QR code recognition methods in practical record-keeping systems. Attached Figure Description
[0038] Figure 1 This is a flowchart of a QR code recognition method used in a resume system. Detailed Implementation
[0039] An embodiment of the QR code recognition method for a resume system provided by the present invention:
[0040] like Figure 1 As shown, the QR code recognition method for a resume system includes the following steps:
[0041] S1, acquire the original image containing the QR code in the resume system, detect candidate positioning graphics in the original image and calculate the sub-pixel center of the candidate positioning graphics; identify the center of three positioning graphics from the candidate positioning graphics, take the center of the positioning graphics as the vertex, and at the same time use the position of at least one detected correction graphic to determine the fourth vertex of the QR code area.
[0042] The obtained original image is grayscaled and binarized. The original image is a color image in RGB format. For example, the Otsu method is used for global threshold segmentation. The contour detection algorithm is used to find all closed contours, and candidate positioning patterns with a nested structure of a square within a square are selected according to the hierarchical relationship and area ratio of the closed contours. For each candidate positioning pattern, pixels are scanned horizontally, vertically, and diagonally along the center of the candidate positioning pattern to check whether the ratio of black and white pixels of the pattern satisfies the characteristic of 1:1:3:1:1. For the positioning patterns that pass the inspection, the centroid of the innermost black area of the positioning pattern is calculated as the initial center, and the center coordinates with sub-pixel accuracy are calculated within the neighborhood of the initial center by methods such as the gray centroid method or Gaussian surface fitting.
[0043] All combinations of the centers of the candidate positioning patterns are traversed. By calculating the interior angles of the triangles formed by any three points, a set of three points that form an approximate right triangle are found, which are the three positioning patterns of the QR code. The right-angled vertex is the upper-left positioning pattern. The upper-right and lower-left positioning patterns are determined according to the cross product result or relative position relationship. For low-version QR codes without correction patterns, the position of the fourth vertex is directly deduced by vector operation rules, that is, the coordinates of the fourth vertex are equal to the sum of the coordinates of the upper-right and lower-left vertices minus the coordinates of the upper-left vertex. For high-version QR codes, first, the version and module size of the QR code are estimated based on the distances between the three positioning patterns, the theoretical position of the correction pattern is predicted, the correction pattern is searched and accurately positioned near the theoretical position, and the position of the fourth vertex is calculated using the accurate position of the correction pattern and the centers of the other two positioning patterns.
[0044] In an optional embodiment, the fourth vertex of the QR code area is determined by combining the centers of the three positioning patterns identified from the candidate positioning patterns and using the positions of at least one detected correction pattern, including:
[0045] (a) Calculate the preliminary coordinates of the fourth vertex by performing vector operations on the centers of the three positioning patterns;
[0046] (b) Calculate the theoretical positions of at least one correction pattern based on the centers of the three positioning patterns and the version information of the QR code;
[0047] (c) Calculate the displacement correction vector between the theoretical position of the correction pattern obtained in step (b) and the actual position of the detected correction pattern in the original image;
[0048] (d) Apply the displacement correction vector to the preliminary coordinates obtained in step (a) to determine the coordinates of the fourth vertex.
[0049] Assume that the center points of the three positioning patterns have been found through original image processing, denoted as P A , PB P C In a standard QR code, these three points would form an isosceles right triangle. Further assume P... A It is the center of the positioning figure that serves as the right-angle vertex. Consider these three points as vectors in a coordinate system. From P... A Point to P B The vector is V AB =P B -P A Similarly, from P A Point to P C The vector is V AC =P C -P A In a parallelogram, the diagonal vector is obtained by adding the two edge vectors originating from a single vertex. The initial coordinates of the fourth vertex are P. D Position can be obtained by vector translation. A simple calculation method is: P D =P A +V AB +V AC After simplification, we get: P D =P B +P C -P A Using P A P B P C Establish a coordinate system for the QR code itself. For example, we can define P. A Let P be the origin (0,0). B The direction is the X-axis, P C The direction is the Y-axis. During the recognition process, the version number of the QR code is determined based on the number of modules between the positioning graphics. For example, a QR code with version number 7 has 45x45 modules. According to the QR code standard, the correction graphics of a specific version have fixed coordinates. For example, a QR code with version number 7 has only one correction graphic, and theoretically its center is located at the module coordinates (34, 34). It is necessary to convert the theoretical module coordinates (34, 34) into pixel coordinates in the original image, preferably through an affine perspective transformation matrix, which is P A P B P C The known module coordinates of these three points and their original image pixel coordinates are used to determine the position. After transformation, the theoretical pixel coordinates of the corrected image in the current original image are obtained. The center of the corrected image is searched and precisely located in the original image to obtain its actual pixel coordinates. The displacement correction vector is the difference between the actual position and the theoretical position. The correction vector is added to the preliminary coordinates calculated in step (a) to obtain the coordinates of the fourth vertex.
[0050] S2, calculate the perspective transformation matrix based on the four vertices, perform global perspective correction on the QR code area to obtain the globally corrected image; generate a residual displacement field based on the local positional deviation between the actual grid lines and the ideal grid lines in the globally corrected image, and perform non-rigid adjustment on the globally corrected image to obtain the final corrected image.
[0051] Using the four detected vertices as the source quadrilateral and the four vertices of a standard square as the target quadrilateral, a 3×3 perspective transformation matrix is calculated using a direct linear transformation algorithm. This matrix is then used to perform a global perspective transformation on the QR code region in the original image, yielding the corrected image. On the corrected image, pixel projection is performed on the rows and columns to detect actual grid lines at locations such as the temporal graphic. The positions of these actual grid lines are compared to ideal grid lines that should theoretically be in equidistant straight line positions, calculating a series of local position deviation vectors at grid intersections. Using these sparse deviation vectors as control points, a smooth and continuous residual displacement field covering the entire corrected image region is generated using a thin-plate spline interpolation model or a radial basis function interpolation model. This residual displacement field is then applied to the corrected image, performing non-rigid position adjustments pixel-by-pixel to obtain the final corrected image.
[0052] In an optional embodiment, a residual displacement field is generated to perform non-rigid fine-tuning on the corrected image, including:
[0053] The actual grid line positions are detected by performing horizontal and vertical projection analysis on the corrected image;
[0054] Calculate the one-dimensional deviation between the actual grid line position and the corresponding ideal grid line position;
[0055] One-dimensional bias interpolation is used to generate a two-dimensional residual displacement field covering the entire QR code area;
[0056] The pixel positions in the corrected image are remapped using the two-dimensional residual displacement field to complete non-rigid fine-tuning.
[0057] While global perspective correction can resolve most linear deformations, its effectiveness is limited for local nonlinear deformations caused by curved surfaces or lens distortion. To address this issue, this method performs projection analysis on the corrected image. This involves accumulating pixel grayscale values along the horizontal and vertical directions to form two one-dimensional projection curves. In an ideal original image, these curves would exhibit regular peaks and valleys due to grid lines. By detecting the positions of these peaks and valleys, the actual grid line coordinates can be determined.
[0058] By comparing the detected actual grid line positions with the ideal grid line positions calculated based on the QR code version and size, a series of one-dimensional deviation values can be obtained. For example, in vertical projection, the ideal position of the tenth grid line is the 100th pixel column, while the detected actual position is the 102nd pixel column, resulting in a horizontal deviation of +2 pixels. All the discrete deviation values calculated in the horizontal and vertical directions are then expanded into a two-dimensional vector field covering the entire original image—the residual displacement field—using bilinear interpolation or more complex interpolation methods. Each vector in this field indicates the direction and distance that the corresponding pixel needs to move. Pixel remapping of the original image using the residual displacement field corrects local non-rigid deformations.
[0059] S3, calculate the geometric consistency metric of the final corrected image, which is a weighted sum of at least two of the following: (1) the geometric regularity of the isosceles right triangle formed by the three positioning graphic centers after correction; (2) the conformity between the one-dimensional Fourier transform main frequency of the time sequence graphic and the theoretical frequency of the QR code module size; (3) the grid regularity of the QR code data area in the two-dimensional Fourier transform spectrum.
[0060] For the first item, the sub-pixel centers of the three original positioning patterns are mapped onto the final corrected image through the complete two-step correction transformation described above. The length difference of the two right-angled sides of the triangle formed by the new coordinates and the deviation of the vertex angle from 90 degrees are calculated to obtain the geometric regularity H. For the second item, a one-dimensional pixel sequence is extracted along the horizontal and vertical temporal patterns in the final corrected image. A one-dimensional fast Fourier transform is performed to detect the dominant frequency of the sequence's spectrum. The dominant frequency of the spectrum is compared with the theoretical fundamental frequency calculated based on the corrected module size. The closer the two are, the higher the consistency score. For the third item, a two-dimensional fast Fourier transform is performed on the entire data area of the final corrected image. The spectrum is analyzed. An ideal grid will exhibit a regular grid-like energy distribution in the spectrum. The grid regularity is quantified by evaluating the sharpness of the spectral peaks and the neatness of the grid arrangement. The calculated metrics are multiplied by their respective weighting coefficients and then summed to obtain the geometric consistency metric.
[0061] In an optional embodiment, the geometric regularity H of the isosceles right triangle formed by the three positioning graphic centers after correction is calculated as follows:
[0062] Calculate the deviation of the ratio of the lengths of the two shorter sides of the triangle formed by the centers of the three positioning figures from 1, i.e., the length deviation E, and the deviation of the included angle of the two shorter sides of the triangle from 90 degrees, i.e., the angle deviation F.
[0063] The geometric regularity H is inversely proportional to the weighted sum of the two deviations.
[0064] A perfect correction should restore the centers of the three positioning figures to a standard isosceles right triangle layout. To do this, calculate the lengths of the two shorter sides of the triangle formed by the three center points, denoted as L1 and L2, and the included angle between these two sides, denoted as A. Ideally, L1 should equal L2, and the included angle A should be 90 degrees. Calculate the length deviation E, i.e. For example, if L1 is 200 pixels and L2 is 202 pixels, then the deviation is 0.01.
[0065] Calculate the second deviation, which is the absolute difference between the included angle A and 90 degrees. If the measured included angle is 88 degrees, the angle deviation F is 2 degrees. The geometrical regularity H is designed to be inversely proportional to the weighted sum of these two deviations. For example, the geometrical regularity H can be expressed as: The weighting coefficients w1 and w2 can be set empirically to adjust the relative importance of length consistency and angular perpendicularity. A lower weighting bias will result in a higher geometric regularity H, indicating high correction quality and well-recovered QR code geometry.
[0066] In an optional embodiment, the calculation of the conformity between the one-dimensional Fourier transform dominant frequency of the time-series graph and the theoretical frequency of the QR code module size includes:
[0067] Extract the centerline pixel grayscale sequence of the horizontal and vertical temporal patterns in the corrected image;
[0068] Perform a one-dimensional Fourier transform on the grayscale sequence of the centerline pixels to determine the dominant frequency;
[0069] The degree of conformity is inversely proportional to the absolute value of the difference between the dominant frequency and the theoretical frequency determined according to the QR code version.
[0070] The temporal pattern consists of alternating black and white module stripes in a QR code, and the periodicity of these stripes is directly related to the size of the QR code module. To evaluate the accuracy of the corrected module size, grayscale values of pixels are extracted along the center lines of the horizontal and vertical temporal patterns, forming two one-dimensional signal sequences. Theoretically, this one-dimensional signal sequence should be a square wave signal, with its fundamental frequency determined by the width of the black and white module stripes. For example, if each black and white module strip occupies 8 pixels in width in the corrected image, then the period of this signal is 16 pixels.
[0071] Perform Fast Fourier Transform (FFT) on both one-dimensional signal sequences. A significant peak, the dominant frequency, will appear in the transformed spectrum, corresponding to the actual spatial frequency of the time series graph. On the other hand, a theoretical spatial frequency can be calculated based on the QR code version and the total size of the corrected image. For example, for a QR code with version number 1 corrected to a width of 210 pixels, containing 21 QR code modules, the theoretical module width is 10 pixels, and the theoretical spatial frequency is one cycle per pixel. The degree of agreement is inversely proportional to the absolute value of the difference between the measured dominant frequency and the theoretical spatial frequency; the smaller the difference, the higher the degree of agreement, indicating that the corrected QR code module size is closer to the ideal value.
[0072] In an optional embodiment, the grid regularity of the QR code data area in the two-dimensional Fourier transform spectrum is calculated including:
[0073] Perform a two-dimensional Fourier transform on the data region of the final corrected image;
[0074] In the obtained spectrum, the harmonic peak points generated by the periodic structure of the QR code data area are detected;
[0075] Calculate the average deviation between the position of each peak point in the harmonic peak point array and the position of the ideal Fourier lattice point;
[0076] The grid regularity is inversely proportional to the average deviation.
[0077] The data area of a QR code is itself a two-dimensional grid structure. This regular, periodic structure, after a two-dimensional Fourier transform, will produce a similarly regular lattice of harmonic peaks in the spectral space. If the original image is undistorted, the two-dimensional Fourier spectrum of the QR code data area will present a very regular grid composed of bright peaks. The spacing of this spectral grid is inversely proportional to the size of the QR code data area.
[0078] To calculate this regularity, the positions of these harmonic peaks are detected in the spectrum. An ideal set of Fourier grid positions is calculated based on the QR code version and the original image size. By comparing the detected actual peak positions with the closest ideal grid positions, the displacement deviation of each peak can be calculated. Averaging the displacement deviations of all major peaks yields an index measuring the overall degree of spectral grid distortion. Grid regularity is inversely proportional to the average deviation. A small average deviation indicates a high degree of fit between the actual and ideal spectrum, suggesting that the overall grid structure of the QR code is very complete and distortion-free, achieving high grid regularity.
[0079] S4. When the geometric consistency metric meets the preset judgment conditions, the final corrected image is binarized and decoded to achieve the recognition of the QR code.
[0080] The calculated geometric consistency metric is compared to a pre-defined empirical threshold. If the metric is greater than the threshold, the correction quality is considered high enough for decoding. At this point, a local binarization algorithm, such as the Sovora adaptive thresholding method, is used to process the final corrected image to eliminate the effects of uneven illumination. The center of each QR code module is sampled on the binarized image according to ideal grid coordinates, obtaining a bitstream of 0s or 1s. The bitstream is then demultiplexed, error-correcting code checked, and data restored according to QR code encoding standards, for example, using the Reed-Solomon decoding algorithm, to recover the original information.
[0081] In an optional embodiment, binarizing the final corrected image includes:
[0082] A local adaptive thresholding method is adopted, which calculates an independent binarization threshold for each pixel based on the gray-level statistical characteristics of the neighborhood of each pixel in the final corrected image, and generates a binarized image based on the binarization threshold.
[0083] When the original image has uneven lighting, such as half in shadow and half in sunlight, using a single global threshold for binarization will result in information loss. Local adaptive thresholding methods can effectively handle this situation. Instead of using a globally uniform local adaptive threshold, a separate binarization threshold is calculated for each pixel in the original image. The binarization threshold is calculated based on the pixel's grayscale value within a neighborhood window of a specific size. For example, an 11×11 pixel neighborhood window can be set.
[0084] For a given pixel in the original image, the algorithm calculates the average grayscale value or Gaussian weighted average value of all pixels within its neighborhood window. This average value reflects the local lighting environment of the pixel. A small constant value is subtracted from this local average value. This constant value is set manually based on the actual situation; for example, a constant value of 5 is used. The result is the binarization threshold for the center pixel. For instance, in a darker area, the neighborhood average grayscale value might be 80, and the binarization threshold might be set to 75; while in a brighter area, the neighborhood average grayscale value might be 190, and the binarization threshold might be set to 185. In this way, each pixel is determined to be black or white based on its local environment, accurately converting the original image into the binarized form required for subsequent decoding even under complex lighting conditions.
[0085] The above are all preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Therefore, all equivalent changes made in accordance with the structure, shape and principle of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A QR code recognition method for a resume system, characterized in that, Includes the following steps: S1, acquire the original image containing the QR code in the resume system, detect candidate positioning graphics in the original image and calculate the sub-pixel center of the candidate positioning graphics; identify the center of three positioning graphics from the candidate positioning graphics, take the center of the positioning graphics as the vertex, and at the same time use the position of at least one detected correction graphic to determine the fourth vertex of the QR code area. S2, calculate the perspective transformation matrix based on the four vertices, perform global perspective correction on the QR code area to obtain the globally corrected image; generate a residual displacement field based on the local positional deviation between the actual grid lines and the ideal grid lines in the globally corrected image, and perform non-rigid adjustment on the globally corrected image to obtain the final corrected image; S3, calculate the geometric consistency measure of the final corrected image. The geometric consistency measure is a weighted sum of at least two of the following: (1) the geometric regularity of the isosceles right triangle formed by the three positioning graphic centers after correction; (2) the conformity between the one-dimensional Fourier transform main frequency of the time sequence graphic and the theoretical frequency of the QR code module size; (3) the grid regularity of the QR code data area in the two-dimensional Fourier transform spectrum. S4. When the geometric consistency metric meets the preset judgment condition, the final corrected image is binarized and decoded to realize the recognition of the QR code. Generate a residual displacement field and perform non-rigid adjustments on the global correction image, including: The actual grid line positions are detected by performing horizontal and vertical projection analysis on the global correction image; Calculate the one-dimensional deviation between the actual grid line position and the corresponding ideal grid line position; One-dimensional bias interpolation is used to generate a two-dimensional residual displacement field covering the entire QR code area; The pixel positions in the global correction image are remapped using a two-dimensional residual displacement field to achieve non-rigid adjustment.
2. The QR code recognition method for a resume system according to claim 1, characterized in that, The center of three positioning patterns is identified from the candidate positioning patterns, and the fourth vertex of the QR code region is determined using the position of at least one detected correction pattern, including: (a) Calculate the preliminary coordinates of the fourth vertex by performing vector operations on the centers of the three positioning figures; (b) Calculate the theoretical position of at least one correction graphic based on the center of the three positioning graphics and the version information of the QR code; (c) Calculate the displacement correction vector between the theoretical position obtained in step (b) and the actual position of the correction pattern detected in the image; (d) Apply the displacement correction vector to the preliminary coordinates obtained in step (a) to determine the coordinates of the fourth vertex.
3. The QR code recognition method for a resume system according to claim 1, characterized in that, The geometric regularity of the isosceles right triangle formed by the centers of the three positioned figures after correction is calculated using the following methods: Calculate the deviation of the ratio of the lengths of the two shorter sides of the triangle formed by the centers of the three positioning figures from 1, and the deviation of the included angle of the two shorter sides of the triangle from 90 degrees. The geometric regularity is inversely proportional to the weighted sum of the two deviations.
4. The QR code recognition method for a resume system according to claim 1, characterized in that, The calculation method for the consistency between the one-dimensional Fourier transform dominant frequency of the time-series graph and the theoretical frequency of the QR code module size includes: Extract the centerline pixel grayscale sequence of the horizontal and vertical temporal patterns in the corrected image; Perform a one-dimensional Fourier transform on the grayscale sequence of the centerline pixels to determine the dominant frequency; The degree of conformity is inversely proportional to the absolute value of the difference between the dominant frequency and the theoretical frequency determined according to the QR code version.
5. The QR code recognition method for a resume system according to claim 4, characterized in that, The grid regularity of the QR code data area in the two-dimensional Fourier transform spectrum is calculated using the following methods: Perform a two-dimensional Fourier transform on the data region of the final corrected image; In the obtained spectrum, the harmonic peak lattice generated by the periodic structure of the data module is detected; Calculate the average deviation between the position of each peak point in the harmonic peak lattice and the position of the ideal Fourier lattice point; Grid regularity is inversely proportional to average deviation.
6. The QR code recognition method for a resume system according to claim 1, characterized in that, Binarization of the final corrected image includes: A local adaptive thresholding method is adopted, which calculates an independent binarization threshold for each pixel based on the gray-level statistical characteristics of the neighborhood of each pixel in the final corrected image, and generates a binarized image based on the binarization threshold.
7. The QR code recognition method for a resume system according to claim 1, characterized in that, A thin-plate spline interpolation model or a radial basis function interpolation model is used to interpolate the one-dimensional deviation to generate a two-dimensional residual displacement field covering the entire QR code area.
8. The QR code recognition method for a resume system according to claim 1, characterized in that, In S4, the Sovora adaptive thresholding method is used to process the final corrected image to eliminate the effects of uneven illumination.
9. The QR code recognition method for a resume system according to any one of claims 1-8, characterized in that, The original image is in RGB format.
Citation Information
Patent Citations
Two-dimension code recognition method and terminal
CN104268498A
QR code recognizing method based on image processing
CN104809422A
Method and device for correcting two-dimensional code
CN113850100A