A two-dimensional code recognition method, device, storage medium, terminal and vehicle
By improving the quality of QR code images through super-resolution reconstruction and filtering noise reduction techniques, and combining detection and contrast enhancement strategies, the problem of low recognition rate of QR codes in complex scenarios is solved, and efficient QR code information recognition is achieved.
Patent Information
- Application Number
- CN202610236403.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-27
- Publication Date
- 2026-07-07
AI Technical Summary
QR codes have a low recognition rate in complex scenarios such as insufficient lighting, shadows, or blurriness, resulting in the inability to be recognized.
A target super-resolution reconstruction model is used to enhance the texture details of the QR code image. A filtering and noise reduction strategy is combined to remove artifact noise. The image clarity is improved by using a QR code detection model and a contrast enhancement strategy. Finally, the QR code information is recognized.
It significantly improves the recognition rate of QR codes in complex scenarios, especially under low light and blurry conditions, and achieves efficient acquisition of QR code information.
Smart Images

Figure CN122347159A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of QR codes, and more specifically, to a QR code recognition method, device, storage medium, terminal, and vehicle. Background Technology
[0002] QR codes are a widely used encoding method in many fields, which can record a large amount of information through black and white patterns on a two-dimensional plane.
[0003] However, QR code recognition is affected by a variety of factors, such as insufficient lighting, shadows, or blurry images in complex scenarios, which can lead to low QR code recognition rates and the inability to recognize QR codes. Summary of the Invention
[0004] This application provides a QR code recognition method, device, storage medium, terminal, and vehicle, aiming to improve the QR code recognition rate.
[0005] In a first aspect, embodiments of this application provide a QR code recognition method, the method comprising: The QR code image is input into the target super-resolution reconstruction model to obtain the enhanced QR code image; A filtering and denoising strategy is applied to the enhanced QR code image to obtain a target QR code image. The filtering and denoising strategy is used to perform edge-preserving denoising on the enhanced QR code image. The target QR code image is identified to obtain QR code information.
[0006] Optionally, the method further includes: Get the initial image containing the QR code; The initial image is cropped to obtain the QR code image.
[0007] Optionally, the initial image is cropped to obtain the QR code image, including: Perform QR code detection on the initial image to generate a QR code detection box; The QR code image is obtained by cropping according to the QR code detection frame.
[0008] Optionally, QR code detection is performed on the initial image to generate a QR code detection box, including: The QR code in the initial image is detected by a QR code detection model, and the QR code detection box is generated. The QR code detection model is trained based on multiple QR code first sample images, in which QR code detection boxes are marked.
[0009] Optionally, the proportion of the QR code in the first sample image of the QR code in the QR code detection frame is greater than a preset target proportion.
[0010] Optionally, the QR code detection model includes the YOLOv11n network model.
[0011] Optionally, the target super-resolution reconstruction model includes an ECBSR network model trained based on multiple second sample images of QR codes.
[0012] Optionally, a filtering and noise reduction strategy is applied to the enhanced QR code image to obtain the target QR code image, including: The enhanced QR code image is converted to grayscale to obtain a grayscale QR code image; The target QR code image is obtained by performing bilateral filtering on the grayscale image of the QR code.
[0013] Optionally, the target QR code image is recognized to obtain QR code information, including: After applying a contrast enhancement strategy to the target QR code image, a binarized image of the target QR code image is generated. Identify the QR code information in the binarized image.
[0014] Optionally, the contrast enhancement strategy includes histogram equalization or adaptive histogram equalization.
[0015] Optionally, generating a binarized image of the target QR code image includes: A binarized image of the target QR code image is generated based on any one of the mean adaptive thresholding method, Gaussian weighted adaptive thresholding method, and OTSU algorithm.
[0016] Secondly, embodiments of this application provide an electronic device, including a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the QR code recognition method as described in the first aspect of the embodiments.
[0017] Thirdly, embodiments of this application provide a readable storage medium on which a program or instruction is stored, and when the program or instruction is executed by a processor, it implements the QR code recognition method as described in the first aspect of the embodiments.
[0018] Fourthly, embodiments of this application provide a terminal, which is used to execute the QR code recognition method described in the first aspect of the embodiment, or includes the electronic device described in the second aspect of the embodiment.
[0019] Fifthly, embodiments of this application provide a vehicle for performing the QR code recognition method described in the first aspect of the embodiment, or including the electronic device described in the second aspect of the embodiment.
[0020] Beneficial effects: In the method provided in this application embodiment, the QR code image is first input into the target super-resolution reconstruction model to obtain an enhanced QR code image. The target super-resolution reconstruction model can enhance the texture details of the image. Then, a filtering and noise reduction strategy is performed on the enhanced QR code image to remove edge-preserving noise such as artifacts introduced by super-resolution reconstruction, thereby obtaining the target QR code image. The target QR code image is then recognized to obtain QR code information, which can improve the QR code recognition rate. Attached Figure Description
[0021] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application 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.
[0022] Figure 1 This is a flowchart of the steps of a QR code recognition method proposed in an embodiment of this application; Figure 2 This is a schematic diagram of the network structure of the ECBSR network model proposed in one embodiment of this application; Figure 3 This is a flowchart illustrating the execution of a QR code recognition method provided in an embodiment of this application; Figure 4 This is a functional block diagram of a QR code recognition device according to an embodiment of this application; Figure 5 This is a schematic diagram of an electronic device according to an embodiment of this application; Figure 6 This is a schematic diagram of a readable storage medium proposed in an embodiment of this application; Figure 7 This is a schematic diagram of a computer program product proposed in an embodiment of this application. Detailed Implementation
[0023] 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, 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.
[0024] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0025] URL: Uniform Resource Locator; YOLO: You Only Look Once, is a type of real-time object detection algorithm based on deep learning; SSD: Single Shot MultiBox Detector, a target detection algorithm that simultaneously classifies and locates targets in a single forward propagation, thus offering advantages such as fast detection speed and high accuracy. R-CNN: Region-CNN, based on algorithms such as convolutional neural networks, linear regression, and support vector machines, to achieve object detection technology; ECBSR: Edge-oriented Convolution Block for Real-time Super Resolution, is a lightweight image super-resolution model designed specifically for mobile devices; RGB image: Red-Green-Blue image, a digital image based on the RGB color mode, which represents each color in the image by combining the intensities of the three color channels: red, green, and blue. CLAHE algorithm: Contrast Limited Adaptive Histogram Equalization, is an algorithm for image enhancement that can effectively improve image contrast and detail; OTSU algorithm: The Otsu algorithm is a method for automatically determining the image binarization threshold by maximizing the inter-class variance to determine the optimal threshold.
[0026] A QR code (Quick Response Code) is a two-dimensional barcode, a two-dimensional matrix graphic composed of black and white squares, which can store a large amount of information, such as text information, URL links, contact information, payment information, and identity credentials.
[0027] QR codes are now widely used in more and more fields. When recognizing a QR code, it is necessary to collect an image, preprocess it, locate the QR code in the image, and decode it. However, due to insufficient lighting, shadows, or blurry images in complex scenarios, the QR code images obtained are not very clear, which leads to a low recognition rate and the problem of being unable to recognize the QR code.
[0028] In order to improve the recognition rate of QR codes, this application provides a QR code recognition method that can achieve a higher recognition rate for QR codes with low illumination, low contrast, and blurriness.
[0029] The following description, in conjunction with the accompanying drawings, details a QR code recognition method provided in this application through specific embodiments and application scenarios.
[0030] Reference Figure 1 The diagram illustrates a flowchart of a QR code recognition method provided in an embodiment of this application. The method specifically includes the following steps: S101: Input the QR code image into the target super-resolution reconstruction model to obtain an enhanced QR code image.
[0031] A QR code image refers to an image that includes a QR code, and the area of the QR code in the QR code image occupies a larger proportion than the target proportion of the entire QR code image.
[0032] Actual testing shows that when the QR code occupies a small portion of an image, the recognition rate decreases, while when the QR code occupies more than 70% of the image, the recognition rate increases.
[0033] Therefore, in this embodiment, the target ratio can be set to 70%, that is, when the area of the QR code in the QR code image accounts for more than 70% of the entire QR code image, the recognition rate of the QR code can be improved. In actual implementation, the target ratio can also be set according to the needs of the actual application, and this embodiment does not impose any restrictions.
[0034] However, due to limitations in the actual implementation process, such as the distance of the image being collected being far, the proportion of the QR code in the initial image may be small. Therefore, in this embodiment, the initial image is first preprocessed to obtain the QR code image.
[0035] In one feasible implementation, the process of obtaining a QR code image includes the following steps: A1: Get the initial image containing the QR code.
[0036] In actual implementation, the initial image containing the QR code is first obtained through an image acquisition tool, such as a camera or barcode scanner.
[0037] A2: Crop the initial image to obtain the QR code image.
[0038] First, the initial image is subjected to QR code detection to generate a QR code detection box.
[0039] In practice, a QR code detection model can be trained to identify the QR code in the initial image and generate a QR code detection box to mark the QR code in the initial image.
[0040] For example, the model network type of the QR code detection model can be selected according to the needs of the actual application. For example, the YOLO network series, SSD network and R-CNN network can be selected, etc. This application embodiment does not limit it; in order to meet the requirements of lightweight, accuracy and real-time performance, this application embodiment uses the yolov11n network model.
[0041] When training the QR code detection model, the YOLOv11n network model can be pre-trained using common object detection datasets, such as the COCO dataset, to update the model weight configuration of the YOLOv11n network model, so that the YOLOv11n network model has preliminary object detection performance. The pre-training process can be set according to the needs of actual applications, and this application embodiment does not impose any restrictions.
[0042] Since object detection datasets such as the COCO dataset may not include QR code targets, a QR code detection sample set can be further constructed to fine-tune the pre-trained yolov11n network model.
[0043] For example, when constructing a QR code detection sample set, N images containing QR codes in real-world scenarios can be manually annotated to obtain multiple QR code first sample images. The size of N can be set according to the actual application requirements, such as N being 200. The QR code detection box in each QR code first sample image is manually annotated, and the proportion of the QR code in the QR code detection box in the QR code first sample image is greater than the preset target proportion, such as 70%.
[0044] Then, a QR code detection sample set is constructed to fine-tune the pre-trained yolov11n network model until the yolov11n network model converges. When the test results on the test sample set meet the preset requirements, the QR code detection model is obtained.
[0045] By first pre-training the YOLOv11n network model on an object detection dataset and then fine-tuning it on a QR code detection sample set, the convergence speed of the YOLOv11n network model can be improved, thus increasing the efficiency of training the QR code detection model.
[0046] The QR code detection model based on the lightweight YOLOv11n network can improve the efficiency of QR code detection and QR code detection box generation, and has high real-time performance and accuracy.
[0047] Then, the QR code image is obtained by cropping according to the QR code detection box. Specifically, the image within the QR code detection box is used as the QR code image by cropping. Since the QR code detection model is fine-tuned based on the first sample image of the QR code in the QR code detection box with a proportion of more than 70%, the proportion of the QR code in the obtained QR code image after cropping the initial image according to the QR code detection box is also greater than 70%. The subsequent recognition process based on the QR code image can improve the recognition rate of the QR code.
[0048] However, due to insufficient lighting, occlusion, or blurriness, the QR code in the image is not clear enough, which can easily lead to QR code recognition failure.
[0049] Therefore, in order to improve the recognition rate of QR codes, after obtaining the QR code image, the QR code image can be input into a target super-resolution reconstruction model. The target super-resolution reconstruction model is used to enhance the texture details of the image. In this way, the texture details of the image can be enhanced by the target super-resolution reconstruction model, thereby improving the gradient between black and white pixel blocks in the QR code, so that the black and white pixel blocks in the QR code have sharper and clearer boundaries.
[0050] Specifically, the target super-resolution reconstruction model can adopt a lightweight ECBSR network model. In actual implementation, other network models capable of super-resolution reconstruction can also be used. This application embodiment does not impose any restrictions.
[0051] Reference Figure 2 The diagram shows a schematic of the network structure of the ECBSR network model provided in the embodiment of this application. The ECBSR network avoids multiple branches and dense connections to reduce memory access costs, and uses only one residual connection. By combining 3x3 convolution, expansion and compression operations, as well as first-order and second-order edge information extraction, it can extract image texture and edge information more effectively. At the same time, it can be accelerated during inference through reparameterization.
[0052] Furthermore, the network structure of the ECBSR network model is different during training and testing. Figure 2 The left side shows the network structure during training, where multiple branches learn the features of each square in the local area. During testing, to further reduce network complexity, the multiple branches on the left are integrated and mapped onto the right side. In the convolution module of 3, the computational power requirement is reduced without reducing the accuracy of reconstruction. This structure can significantly improve the running speed of the processing end while ensuring performance.
[0053] Specifically, the network structure during training includes the following: A standard 3x3 convolution is used to ensure basic performance. Expanding and compressing convolution consists of a 1x1 convolutional layer and a 3x3 convolutional layer. The 1x1 convolution expands the dimension (number of channels) of the feature map, and the 3x3 convolutional kernel shrinks and compresses the dimension of the feature map, resulting in a feature map with richer feature information. First-order edge information extraction includes two branches: one branch extracts horizontal edges, with features passed through a 1x1 convolution and then through a pre-defined Sobel convolution kernel Dx that can be learned by a scale factor; the other branch extracts vertical edges, with features passed through a 3x3 convolution and then through a pre-defined Sobel convolution kernel Dy that can be learned by a scale factor.
[0054] Second-order edge feature extraction consists of a 1x1 convolution and a pre-defined Laplacian convolution kernel with a learnable scale factor.
[0055] In the actual implementation process, when training the ECBSR network model to obtain the target super-resolution reconstruction model, the reconstruction sample set is first constructed.
[0056] For example, M images including QR codes are selected from the road sampling as second sample images of QR codes. An ECBSR network model is trained based on multiple second sample images of QR codes to obtain a target super-resolution reconstruction model. The size of M can be set according to the needs of actual applications, such as M being 800. This application embodiment does not impose any restrictions.
[0057] For example, the second sample image of each QR code is used as the original high-resolution image. Then, the original high-resolution image is downsampled to obtain the corresponding low-resolution image. The low-resolution image is input into the ECBSR network model, and the original high-resolution image is used as the ground truth label. Then, the ECBSR network model is iteratively updated. The performance of the model is tested periodically on an independent validation set, and the model with the best performance on the validation set is used as the target super-resolution reconstruction model.
[0058] S102: Perform a filtering and noise reduction strategy on the enhanced QR code image to obtain a target QR code image. The filtering and noise reduction strategy is used to perform edge-preserving noise reduction on the enhanced QR code image.
[0059] Although the enhanced QR code image obtained based on the target super-resolution reconstruction model has richer texture details and sharper and clearer boundaries between black and white pixel blocks in the QR code, the super-resolution reconstruction process also introduces artifact noise. In order to improve the accuracy and recognition rate of the QR code, it is necessary to filter and remove the artifact noise.
[0060] In one feasible implementation, a filtering and noise reduction strategy is applied to the enhanced QR code image to obtain the target QR code image, including the following steps: B1: Perform grayscale processing on the enhanced QR code image to obtain a grayscale QR code image.
[0061] Grayscale conversion is the process of converting a color image into a grayscale image in image processing. When performing super-resolution reconstruction on a QR code image based on RGB three channels, more texture details can be improved for blurry QR code images, such as enhancing the black and white boundaries.
[0062] The information in a QR code only exists in the brightness information of black and white pixels. Color information is redundant for QR code decoding. Therefore, each pixel in the enhanced QR code image can be converted from the three-channel RGB to the single-channel brightness value, which can reduce the amount of computation in the subsequent QR code recognition process. For example, converting a three-channel RGB image (e.g., 24-bit) to a single-channel grayscale image (8-bit) directly reduces the amount of computation to about 1 / 3 and can highlight the key information of the QR code.
[0063] B2: Perform bilateral filtering on the grayscale image of the QR code to obtain the target QR code image.
[0064] The main purpose of improving the QR code recognition rate is to preserve the sharp and clear boundaries between the black and white pixel blocks in the QR code. In order to preserve the useful details supplemented in the super-resolution reconstruction and remove noise such as artifacts, bilateral filtering is used to denoise the grayscale image of the QR code in this embodiment.
[0065] Bilateral filtering employs dual weighting of the spatial domain and pixel value domain, considering not only the spatial distance between pixels but also their grayscale similarity. This enables edge-preserving noise reduction. In flat areas (noise zones), where grayscale similarity is high, smooth noise reduction is achieved. At edges, where the grayscale values of pixels on both sides differ significantly, the weight is automatically reduced, allowing the edges to be perfectly preserved. Simultaneously, contrast is maintained. The interiors of black and white blocks within the QR code are smoothed, but the transition boundaries between black and white are protected, meeting the requirements of uniformity and sharp edges within the QR code.
[0066] Specifically, the formula for bilateral filtering is as follows:
[0067] Where (k,l) represents the center coordinates of the filtering window, (i,j) represents the coordinates of other positions within the filtering window, I represents the pixel value before bilateral filtering, and I' represents the pixel value after bilateral filtering. The standard deviation of the Gaussian kernel function in the spatial domain is used to control the weights of pixel positions; This represents the standard deviation of the Gaussian kernel function over the pixel value range, used to control the weight of pixel values.
[0068] In actual implementation, The value is set to greater than Experimental tests have shown that... > At that time, the recognition rate of QR codes improved even more, reaching about 2% on the actual dataset.
[0069] In practical implementation, the window radius, and The value can be set according to actual application requirements. For example, it can be set to: window radius of 7. It is 115, for 15.
[0070] In this embodiment, edge-preserving noise reduction is achieved by combining grayscale conversion and bilateral filtering. This effectively removes artifact noise introduced during the super-resolution reconstruction process while maximizing the preservation of the clear edges and internal module contrast of the QR code, thereby further improving the QR code recognition rate.
[0071] S103: Recognize the target QR code image to obtain QR code information.
[0072] In one feasible implementation, the process of recognizing the target QR code image to obtain QR code information includes the following steps: C1: After performing a contrast enhancement strategy on the target QR code image, a binarized image of the target QR code image is generated.
[0073] First, the pixel value difference between black and white squares in the QR code is enhanced by a contrast enhancement strategy. In actual implementation, the contrast enhancement strategy can adopt histogram equalization or adaptive histogram equalization, or other contrast enhancement methods, such as CLAHE algorithms, or contrast enhancement based on an end-to-end neural network model. This application embodiment does not impose any restrictions.
[0074] After enhancing the contrast of the target QR code image, the grayscale target QR code image is converted into an image containing only pure black and pure white pixel values through binarization, thereby clearly separating the QR code target in the image.
[0075] In actual implementation, the binarized image of the target QR code image can be generated based on any one of the mean adaptive thresholding method, Gaussian weighted adaptive thresholding method, and OTSU algorithm. Other binarization algorithms can also be selected for processing. This application embodiment does not impose any restrictions.
[0076] C2: Identify the QR code information in the binarized image.
[0077] In the binarized image obtained by the method provided in this application embodiment, compared with the original image, the QR code has enhanced contrast and clearer boundaries. It has a significant enhancement effect on QR codes with sufficient lighting, insufficient lighting, and certain blurriness. Based on the binarized image, the recognition and decoding of QR codes can improve the recognition rate of QR code information.
[0078] Reference Figure 3 The diagram illustrates an execution flowchart of a QR code recognition method provided in an embodiment of this application. In one feasible implementation, the process of recognizing a QR code includes the following steps: S1: Obtain the initial image containing the QR code.
[0079] S2: Input the initial image into the QR code detection model to obtain the QR code detection box.
[0080] S3: Based on the QR code detection frame, crop the QR code image.
[0081] S4: Input the QR code image into the target super-resolution reconstruction model to obtain the enhanced QR code image.
[0082] S5: Perform grayscale processing on the enhanced QR code image to obtain a grayscale QR code image.
[0083] S6: Perform bilateral filtering on the grayscale image of the QR code to obtain the target QR code image.
[0084] S7: Perform a contrast enhancement strategy on the target QR code image.
[0085] S8: Generate a binarized image of the target QR code image.
[0086] S9: Identify the QR code information in the binarized image.
[0087] In actual implementation, a large number of QR code images from actual parking lots were collected. 1382 images were selected from the QR code images that failed to be recognized as a failure dataset. Then, the QR code recognition method provided in this application embodiment was applied to the failure dataset for testing. The recognition rate can be improved from 0% to 42%. Moreover, the computing power required to execute this method is small. On average, the processing time for one image on an NVIDIA RTX A4000 server is about 1ms, which is easy to deploy on vehicles or apply to other terminals.
[0088] Reference Figure 4 The diagram illustrates a functional block diagram of a QR code recognition device according to an embodiment of this application. The device includes: The enhancement module 100 is used to input the QR code image into the target super-resolution reconstruction model to obtain the enhanced QR code image, wherein the target super-resolution reconstruction model is used to enhance the texture details of the image; The filtering and denoising module 200 is used to perform a filtering and denoising strategy on the enhanced QR code image to obtain a target QR code image. The filtering and denoising strategy is used to perform edge-preserving denoising on the enhanced QR code image. The information recognition module 300 is used to recognize the target QR code image to obtain QR code information.
[0089] Optionally, the device further includes a cutting module for: Get the initial image containing the QR code; The initial image is cropped to obtain the QR code image.
[0090] Optionally, the cropping module is further configured to: Perform QR code detection on the initial image to generate a QR code detection box; The QR code image is obtained by cropping according to the QR code detection frame.
[0091] Optionally, the cropping module is further configured to: The QR code in the initial image is detected by a QR code detection model, and the QR code detection box is generated. The QR code detection model is trained based on multiple QR code first sample images, in which QR code detection boxes are marked.
[0092] Optionally, the proportion of the QR code in the first sample image of the QR code in the QR code detection frame is greater than a preset target proportion.
[0093] Optionally, the QR code detection model includes the YOLOv11n network model.
[0094] Optionally, the target super-resolution reconstruction model includes an ECBSR network model trained based on multiple second sample images of QR codes.
[0095] Optionally, the filtering and noise reduction module is used for: The enhanced QR code image is converted to grayscale to obtain a grayscale QR code image; The target QR code image is obtained by performing bilateral filtering on the grayscale image of the QR code.
[0096] Optionally, the information recognition module is used for: After applying a contrast enhancement strategy to the target QR code image, a binarized image of the target QR code image is generated. Identify the QR code information in the binarized image.
[0097] Optionally, the contrast enhancement strategy includes histogram equalization or adaptive histogram equalization.
[0098] Optionally, generating a binarized image of the target QR code image includes: A binarized image of the target QR code image is generated based on any one of the mean adaptive thresholding method, Gaussian weighted adaptive thresholding method, and OTSU algorithm.
[0099] The QR code recognition device in this application embodiment can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. This application embodiment does not make specific limitations.
[0100] One QR code recognition device in this application embodiment can be a device with an operating system. The operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system.
[0101] Reference Figure 5 The diagram illustrates an electronic device provided in an embodiment of this application. The electronic device includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the various processes of the QR code recognition method embodiment described above and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0102] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0103] Reference Figure 6The diagram illustrates a readable storage medium provided in an embodiment of this application. The readable storage medium stores a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the QR code recognition method embodiment described above and achieve the same technical effect. To avoid repetition, the details will not be repeated here.
[0104] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0105] Reference Figure 7 The diagram illustrates a computer program product provided in an embodiment of this application, including a computer program / instruction. When the computer program / instruction is executed by a processor, it implements the various processes of the QR code recognition method embodiment described above and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0106] This application also provides a terminal, which is used to execute the QR code recognition method described in this application, or includes the electronic device described in this application; the terminal includes, but is not limited to, mobile phones and tablet computers.
[0107] This application also provides a vehicle for performing the QR code recognition method described in this application, or including the electronic device described in this application.
[0108] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0109] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal (which may be a computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0110] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. The description of the embodiments above is only for the purpose of helping to understand the method and core idea of this application. Those skilled in the art can make many forms under the guidance of this application without departing from the spirit and scope of protection of the claims, and all of these are within the protection scope of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation and application scope based on the idea of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A QR code recognition method, characterized in that, The method includes: The QR code image is input into the target super-resolution reconstruction model to obtain the enhanced QR code image; A filtering and denoising strategy is applied to the enhanced QR code image to obtain a target QR code image. The filtering and denoising strategy is used to perform edge-preserving denoising on the enhanced QR code image. The target QR code image is identified to obtain QR code information.
2. The method according to claim 1, characterized in that, The method further includes: Get the initial image containing the QR code; The initial image is cropped to obtain the QR code image.
3. The method according to claim 2, characterized in that, The initial image is cropped to obtain the QR code image, including: Perform QR code detection on the initial image to generate a QR code detection box; The QR code image is obtained by cropping according to the QR code detection frame.
4. The method according to claim 3, characterized in that, Perform QR code detection on the initial image to generate a QR code detection box, including: The QR code in the initial image is detected by a QR code detection model, and the QR code detection box is generated. The QR code detection model is trained based on multiple QR code first sample images, in which QR code detection boxes are marked.
5. The method according to claim 4, characterized in that, The proportion of the QR code in the first sample image of the QR code in the QR code detection frame is greater than the preset target proportion.
6. The method according to claim 4, characterized in that, The QR code detection model includes the yolov11n network model.
7. The method according to any one of claims 1-6, characterized in that, The target super-resolution reconstruction model includes an ECBSR network model trained based on multiple second sample images of QR codes.
8. The method according to any one of claims 1-6, characterized in that, Applying a filtering and noise reduction strategy to the enhanced QR code image to obtain the target QR code image includes: The enhanced QR code image is converted to grayscale to obtain a grayscale QR code image; The target QR code image is obtained by performing bilateral filtering on the grayscale image of the QR code.
9. The method according to claim 1, characterized in that, The target QR code image is recognized to obtain QR code information, including: After applying a contrast enhancement strategy to the target QR code image, a binarized image of the target QR code image is generated. Identify the QR code information in the binarized image.
10. The method according to claim 9, characterized in that, The contrast enhancement strategy includes histogram equalization or adaptive histogram equalization.
11. The method according to claim 9, characterized in that, Generating a binarized image of the target QR code image includes: A binarized image of the target QR code image is generated based on any one of the mean adaptive thresholding method, Gaussian weighted adaptive thresholding method, and OTSU algorithm.
12. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the QR code recognition method as described in any one of claims 1-11.
13. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions, which, when executed by a processor, implement the QR code recognition method as described in any one of claims 1-11.
14. A terminal, characterized in that, The terminal is used to execute the QR code recognition method according to any one of claims 1-11, or includes the electronic device according to claim 12.
15. A vehicle, characterized in that, The vehicle is used to perform the QR code recognition method according to any one of claims 1-11, or includes the electronic device according to claim 12.
