QR Code Localization via Mesh Segmentation and Binarization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current QR code localization methods are time-consuming and inefficient due to the interference of background regions, leading to reduced recognition speed and accuracy, especially when the QR code image is rotated.
Innovation Solution
The method partitions the QR code image into mesh regions, assigning values based on the presence of black points, and scans for continuous regions with value 1 to identify potential QR code areas, effectively distinguishing between object and background regions, and uses pattern characteristics to localize the QR code region rapidly.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If traversal scanning is carried out on the binarized QR code image to localize the horizontal and vertical regions, then the QR code region can be localized, but the data calculation quantity is large and the processing time is increased
Solution Approach 1:
The patent segments the QR code image into multiple mesh regions (dividing the image into a grid of small regions). By analyzing each mesh region independently to detect black points and determine presence/absence values, the method breaks down the large-scale traversal scanning into smaller, parallelizable units, thereby reducing overall processing time while maintaining localization accuracy.
Solution Approach 2:
The patent performs preliminary binarization of the QR code image before localization, converting all pixels to black or white. This preliminary processing step simplifies subsequent analysis by eliminating grayscale variations, allowing faster detection of black points in mesh regions and reducing the computational complexity of the localization process.
2Manufacturing precision
If the QR code image is rotated, then the corner characteristics may be filtered out when screened according to height threshold, but using a fixed threshold reduces adaptability to rotation
Solution Approach 1:
The patent changes the detection parameter from fixed height threshold to mesh-based spatial distribution analysis. Instead of relying on absolute height values that fail when rotated, the method analyzes the spatial arrangement of black points within mesh regions and their relationships across adjacent meshes, making the detection invariant to rotation while maintaining corner detection precision.
Solution Approach 2:
The patent transitions from one-dimensional height-based filtering to two-dimensional spatial relationship analysis within mesh regions. By examining the distribution patterns of black points across both horizontal and vertical dimensions in the mesh grid, the method can detect corner characteristics regardless of image rotation angle.
3Measurement precision
If line-by-line scanning is used to search for key characteristics, then the object region position can be found, but part of data in non-object regions are searched and efficiency is reduced
Solution Approach 1:
The patent divides the image into mesh regions and uses the union of continuous value-1 meshes in each line and column to define the object region. This segmentation approach allows the method to quickly identify potential object regions without scanning every pixel in non-object areas, thereby improving search efficiency while maintaining localization precision.
Solution Approach 2:
The patent extracts only the essential information (presence/absence of black points in each mesh) needed for localization, discarding unnecessary data from non-object regions. By focusing computation only on meshes with value 1 and their continuous regions, the method eliminates wasted processing on background areas while preserving accurate object region detection.
Data Source
Figure 1
Figure 2~3
Figure 4~5
AI summary
The invention provides a primary localization method and system for QR codes. The primary localization method for QR codes comprises the steps: S1, binarizing pixel points of a received image containing a QR code; S2, partitioning the image containing the QR code into at least one mesh region including m*n pixel points; S3, recording the number of black pixel points in each mesh region, assigning the value 1 to mesh regions including black points, and assigning the value 0 to mesh regions not including black points; S4, marking the image containing the QR code as a non-object region after values are assigned to the mesh regions; S5, scanning the non-object region line-by-line and column by column and marking the union of the mesh regions continuously with the value 1 for the first time in each line and the mesh regions continuously with the value 1 for the first time in each column as an object region; S6, judging whether the object region is the QR code region or not, if not, returning to step S5 to perform corresponding operation again, and if yes, outputting the line numbers and the column numbers of the pixel points corresponding to the boundaries of the object region. The method is rapid and accurate.