Barcode recognition method and device
By loading the QR code feature library and image processing templates that match the user's location, the QR code recognition process is optimized, and the problem of insufficient QR code recognition accuracy under lighting changes is solved, and the recognition accuracy and efficiency are improved.
Patent Information
- Application Number
- CN202510206210.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-02-25
AI Technical Summary
The prior art has reduced the accuracy of QR code recognition in the lighting environment, resulting in insufficient recognition accuracy.
By obtaining the user's geographical location, loading the merchant QR code local stability feature library and actual image processing template that matches the user's location, extracting local stability features for comparison, and calling the corresponding image processing template for image optimization processing.
It significantly improves the recognition accuracy of barcode recognition, shortens the waiting time during the scanning process, and reduces the system's computing and bandwidth consumption.
Smart Images

Figure CN119692376B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of reading data carriers, and in particular to a barcode recognition method and device. Background Art
[0002] In recent years, with the popularization of mobile payment, QR code has been widely used in various payment scenarios as a link between online and offline.
[0003] In offline payment scenarios, when users use smartphones to scan QR codes, the environments they are in vary greatly. For example, changes in lighting will adversely affect the quality of the QR code image, resulting in a decrease in the accuracy of QR code recognition.
[0004] To solve this problem, existing solutions generally collect a large number of QR code images in advance, obtain the most universal image processing algorithm through a large amount of training, and pre-install it into the application to process the QR code images. Therefore, the existing technology sacrifices the accuracy of some image processing and reduces the accuracy of barcode recognition.
[0005] Therefore, the barcode recognition accuracy of the prior art still needs to be improved. Summary of the invention
[0006] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides a barcode recognition method and device, which can improve the recognition accuracy of barcode recognition.
[0007] In a first aspect, the present application provides a barcode recognition method, the barcode recognition method comprising the following steps:
[0008] Obtaining the user's geographic location, and based on the geographic location, obtaining from a database a local stable feature library of payment barcodes of merchants within a preset range around the user and an actual image processing template corresponding to each barcode;
[0009] When a user scans a merchant’s payment barcode sticker, local stable features are extracted from the camera image;
[0010] Compare the local stable feature with the local stable features of payment barcodes in the local stable feature library of payment barcodes to determine the local features of the target barcode whose matching degree with the barcode in the current shooting picture reaches a preset matching standard;
[0011] After matching the local features of the target barcode, calling the corresponding actual image processing template stored in the database to perform image optimization processing on the barcode image captured by the current camera;
[0012] Decode the barcode image optimized by the corresponding image processing template.
[0013] Optionally, the local stable features of the payment barcodes of the merchants in the database are determined by the following steps:
[0014] The payment barcode is a QR code;
[0015] Collect the QR code image of each merchant in advance;
[0016] A differentiated index is constructed for each QR code image constructed by a merchant, and the differentiated index is constructed by the following steps:
[0017] Based on different light intensities, the QR code images are divided into multiple environment categories through a preset environment definition table;
[0018] The environment definition table includes light intensity classification thresholds, and divides the environment categories according to the global brightness mean of the image calculated in real time;
[0019] Extracting a plurality of image feature descriptors from each two-dimensional code image respectively, wherein the confidence of each image feature descriptor is different in different environments;
[0020] The priority representation coefficient of each image feature descriptor under the corresponding environment category of each QR code image is obtained through a preset environment definition table;
[0021] The corresponding image feature descriptor and its corresponding priority representation coefficient are weightedly fused to generate a combined feature multidimensional vector;
[0022] The combined feature multidimensional vector of the same merchant and the unified identifier of the merchant are combined to form an association pair, thereby obtaining a differentiated index;
[0023] The differential index is used as a local stable feature of the merchant's payment barcode.
[0024] Optionally, the image features include ORB descriptors, SIFT descriptors and QR code locator features.
[0025] Optionally, when a user scans a payment barcode sticker of a merchant, a local stable feature is extracted from a camera image, and the local stable feature is compared with a barcode local feature in a payment barcode local stable feature library to determine a target barcode local feature whose matching degree with the barcode in the current shooting picture meets a preset matching standard, including the following steps:
[0026] The camera's real-time image is illuminated with light intensity, and the current environment category is determined based on the preset environment definition table;
[0027] Extracting ORB descriptors, SIFT descriptors and QR code locator features from the payment barcode sticker area to generate an original feature vector;
[0028] According to the current environment category obtained, the priority representation coefficients corresponding to each image feature descriptor in the corresponding environment are loaded;
[0029] The original feature vector is weightedly fused with the corresponding priority representation coefficient to generate a real-time query vector;
[0030] The real-time query vector is subjected to a nearest neighbor search in the differentiated index sub-subjects stored in the database to obtain the local stable features of the payment barcode whose matching degree reaches the preset matching standard, so as to determine the merchant where the current user is located.
[0031] Optionally, performing a nearest neighbor search on the real-time query vector in the differentiated index sub-sub ...
[0032] According to the order of the priority representation coefficients of the indexes under the current environment category, the image features with the highest weight are selected and weighted to form the first search vector;
[0033]
[0034] in, For the environment The feature with the highest weight The priority coefficient of Input the approximate nearest neighbor algorithm engine to retrieve the payment barcode local stable features that meet the preset similarity threshold from the payment barcode local stable features to form a candidate set ;
[0035] If | | = 1, then The local stable features of the payment barcode in the payment barcode are used as the local stable features of the payment barcode whose matching degree reaches the preset matching standard;
[0036] If | |>1, perform precise matching according to the following process:
[0037] Generate the second search vector:
[0038]
[0039] Use the second search vector to input the approximate nearest neighbor algorithm engine, and then Retrieving the most similar local stable feature of the payment barcode as the local stable feature of the payment barcode whose matching degree reaches the preset matching standard;
[0040] Among them, | | represents the candidate set The number of local stable features of the internal payment barcode; , and Respectively represent the priority representation coefficients of ORB descriptor, SIFT descriptor and QR code locator features, , and They represent ORB descriptor, SIFT descriptor and QR code locator features respectively.
[0041] Optionally, the actual image processing template of the merchant in the database is constructed by the following steps:
[0042] Collect the QR code of each merchant;
[0043] Adjust the characteristic parameters of the image processing algorithm, perform distortion correction and perspective transformation correction on the collected two-dimensional code image, and obtain a standardized two-dimensional code image with minimal background interference;
[0044] Extract the distortion correction parameters and filter configuration parameters used by the standard QR code image as the core parameter set;
[0045] The obtained core parameter set is used as the actual image processing template file, and is stored in the database after being associated with the merchant's unified logo, so that the user can quickly call and apply it when scanning the code for identification.
[0046] In a second aspect, the present application provides a barcode recognition device comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement a barcode recognition method as described in any one of the first aspects.
[0047] Compared with the prior art, the technical solution provided by this application has the following advantages:
[0048] One of its beneficial effects and its corresponding working principle is:
[0049] By quickly loading the merchant QR code template that matches the user's location based on the user's geographic location, the search range of code scanning and recognition is significantly narrowed, thereby reducing the overall system computing and bandwidth consumption, and effectively shortening the user's waiting time during the code scanning process.
[0050] The specific working principle is: when the user terminal obtains the current location, the system selects the merchant QR code template and its differentiated index that are most relevant to the user's location from the server according to the pre-set geographic fence, and then sends or loads these data to the user terminal. In this way, when the user scans a merchant QR code, the recognition process only needs to match within the limited template set related to the current location, without the need for a large-scale search in the global database. In actual use scenarios, this not only improves the efficiency of code scanning and recognition, but also greatly reduces the network traffic and computing load caused by an overly large database.
[0051] The second beneficial effect and its corresponding working principle are:
[0052] Since the texture of a merchant's QR code may be similar to other QR codes under different lighting environments, mismatches or feature conflicts are very likely to occur if a global search is performed without distinguishing the environment.
[0053] The setting environment of merchant QR codes is generally relatively fixed. Although the lighting of different merchants is different, the lighting in the store or indoor lighting conditions is relatively stable and is not prone to drastic changes.
[0054] This application takes advantage of this feature. When executing the nearest neighbor search algorithm, it uses environmental factors as the direction guide of the multi-dimensional search space to achieve rapid pruning of the search space, so as to quickly find the most matching results in a huge database with a smaller search depth, and quickly exclude those QR code candidates from different environments and similar textures but not in the same environment. This avoids making too many comparisons on irrelevant feature dimensions, which not only improves the overall retrieval efficiency, but also reduces missed scans, mis-scans and conflicts in huge databases. Even if there are deviations in the matching results in rare cases, the obtained index is also a template similar to the current merchant environment to be matched, and it still has a high degree of compatibility with subsequent actual scanning processing, retaining a certain degree of recognition feasibility.
[0055] Secondly, since the differentiated index sub-options formed by weighted fusion of this system can reflect the confidence level of each feature in different environments, image features with high confidence in the current environment will be given priority during matching, and those image features with low confidence in the current environment will be weakened, thereby reducing the misjudgment conflicts caused by the superposition of multiple features during multi-feature matching.
[0056] Based on the above principles, the differentiated index construction scheme provided in this application not only speeds up the matching and retrieval speed, but also enables the system to more effectively resolve conflicts and avoid mismatches in different environment types, thereby maintaining stable recognition accuracy and fast matching performance in real scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 A flowchart of a barcode recognition method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] The technical solution in this application will be described below in conjunction with the accompanying drawings.
[0059] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application can also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only part of the embodiments of the present application, not all of the embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0060] First, as Figure 1 As shown, the present application provides a barcode recognition method, which includes the following steps:
[0061] S101: Acquire the user's geographic location, and based on the geographic location, acquire from a database a payment barcode local stable feature library of merchants within a preset range around the user and an actual image processing template corresponding to each barcode;
[0062] Specifically, in the embodiment of the present application, the merchant's payment barcode local stable feature library is actually determined by the business district.
[0063] That is, multiple business districts are delineated on the map in advance according to location areas such as shopping malls, and the local stable features of the payment barcodes of each merchant in each business district are collected, so as to form a corresponding local stable feature library of payment barcodes for each business district.
[0064] When a user enters a certain business district, the data of the local stable feature library of the payment barcode within the business district is cached into the user's mobile device.
[0065] Specifically, in the embodiment of the present application, the local stability characteristics of the payment barcode of the merchant in the database are determined by the following steps:
[0066] The payment barcode is a QR code;
[0067] Collect the QR code image of each merchant in advance;
[0068] A differentiated index is constructed for each QR code image constructed by a merchant, and the differentiated index is constructed by the following steps:
[0069] Based on different light intensities, the QR code images are divided into multiple environment categories through a preset environment definition table;
[0070] The environment definition table includes light intensity classification thresholds, and divides the environment categories according to the global brightness mean of the image calculated in real time;
[0071] Extracting a plurality of image feature descriptors from each two-dimensional code image respectively, wherein the confidence of each image feature descriptor is different in different environments;
[0072] Specifically, the image features include an ORB descriptor (or ORB), a SIFT descriptor (or SIFT), and a QR code locator feature (i.e., an image texture feature at the locator, which can be obtained by convolving pixels in the area where the locator is located).
[0073] The priority representation coefficient of each image feature descriptor under the corresponding environment category of each QR code image is obtained through a preset environment definition table;
[0074] The corresponding image feature descriptor and its corresponding priority representation coefficient are weightedly fused to generate a combined feature multidimensional vector;
[0075] The combined feature multidimensional vector of the same merchant and the unified identifier of the merchant are combined to form an association pair, thereby obtaining a differentiated index;
[0076] The differential index is used as a local stable feature of the merchant's payment barcode.
[0077] For example, in the embodiments of the present application:
[0078] The environment definition table includes:
[0079] E1 (strong light): the average global brightness of the image is ≥ 180 (such as when light shines directly on the QR code scene);
[0080] E2 (moderate light): 90 ≤ average brightness <180 (such as normal indoor lighting scene)
[0081] E3 (low light): average brightness < 90 (such as dim environment)
[0082] Among them, due to the high contrast and blurred texture in strong light environment, SIFT performs poorly due to blurred texture and has a low confidence, while ORB is sensitive to high-contrast images and has a higher confidence. The locator feature is stable and visible, so it has a higher confidence.
[0083] In low-light environments, SIFT's scale invariance advantage is prominent and its confidence is high; in low-light environments, ORB binarization is prone to failure and its confidence is low, and the weight of the locator's noise interference caused by low light and high ISO is low.
[0084] Therefore, the embodiment of the present application formulates a priority characterization coefficient based on the characteristics of these two environments:
[0085] E1: ORB weight 0.8; SIFT weight 0.3; locator weight 0.7;
[0086] E2: ORB weight 0.6; SIFT weight 0.6; locator weight 0.8;
[0087] E3: ORB weight 0.2; SIFT weight 0.9; locator weight 0.5;
[0088] Collect ORB, SIFT and locator features from the merchant's QR code;
[0089] Combine the extracted image features with the corresponding priority representation coefficients. For example, if a merchant's environment is in E2 environment, then;
[0090] The merchant's combined feature multidimensional vector is: 0.6×[ORB feature vector]⊕0.6×[SIFT feature vector]⊕0.8×[locator feature vector];
[0091] Among them, ⊕ represents feature concatenation.
[0092] The merchant's identifier UID and its combined feature multidimensional vector are combined to obtain a differentiated index.
[0093] S102: When the user scans the merchant's payment barcode sticker, extract local stable features from the camera image;
[0094] Compare the local stable feature with the local features of the barcode in the payment barcode local stable feature library to determine the local features of the target barcode whose matching degree with the barcode in the current shooting picture meets the preset matching standard;
[0095] Specifically, the following steps are included:
[0096] The camera's real-time image is illuminated with light intensity, and the current environment category is determined based on the preset environment definition table;
[0097] Extracting ORB descriptors, SIFT descriptors and QR code locator features from the payment barcode sticker area to generate an original feature vector;
[0098] According to the current environment category obtained, the priority representation coefficients corresponding to each image feature descriptor in the corresponding environment are loaded;
[0099] The original feature vector is weightedly fused with the corresponding priority representation coefficient to generate a real-time query vector;
[0100] The real-time query vector is subjected to a nearest neighbor search in the differentiated index sub-subjects stored in the database to obtain the local stable features of the payment barcode whose matching degree reaches the preset matching standard, so as to determine the merchant where the current user is located.
[0101] Specifically, the image features with the highest weights are selected according to the order of the priority representation coefficients indexed under the current environment category, and the first search vector is formed by weighting;
[0102]
[0103] in, For the environment The feature with the highest weight The priority coefficient of Input the approximate nearest neighbor algorithm engine to retrieve the payment barcode local stable features that meet the preset similarity threshold from the payment barcode local stable features to form a candidate set ;
[0104] If | | = 1, then The local stable features of the payment barcode in the payment barcode are used as the local stable features of the payment barcode whose matching degree reaches the preset matching standard;
[0105] If | |>1, perform precise matching according to the following process:
[0106] Generate the second search vector:
[0107]
[0108] Use the second search vector to input the approximate nearest neighbor algorithm engine, and then Retrieving the most similar local stable feature of the payment barcode as the local stable feature of the payment barcode whose matching degree reaches the preset matching standard;
[0109] Among them, | | represents the candidate set The number of local stable features of the internal payment barcode; , and Respectively represent the priority representation coefficients of ORB descriptor, SIFT descriptor and QR code locator features, , and They represent ORB descriptor, SIFT descriptor and QR code locator features respectively.
[0110] For example, a user scans the QR code of merchant A in the E2 environment:
[0111] First, the current environment is classified through the image captured by the camera and determined to be an E2 environment.
[0112] Then, the ORB descriptor, SIFT descriptor, and QR code locator features of the current image are extracted in parallel to obtain the original feature vector;
[0113] The query vector is obtained by weighting the original feature vector using the priority representation coefficient in the E2 environment.
[0114] First, use the highest priority representation coefficient 0.8×[locator feature vector] to perform an approximate nearest neighbor algorithm match in the payment barcode local stable feature library to see if only one result with a similarity above the preset similarity threshold can be obtained;
[0115] If multiple results are obtained, use the combined feature multidimensional vector: 0.6×[ORB feature vector]⊕0.6×[SIFT feature vector]⊕0.8×[locator feature vector] to perform approximate nearest neighbor algorithm matching again among the multiple results to obtain the most matching local stable feature of the payment barcode as the local feature of the target barcode.
[0116] Approximate Nearest Neighbor (ANN) is a class of algorithms used to quickly find the data points that are most similar to the query vector in a high-dimensional space. Compared with the exact nearest neighbor search, ANN sacrifices some accuracy to significantly increase the retrieval speed.
[0117] In the embodiment of the present application, although the approximate nearest neighbor algorithm is a prior art, fast and highly accurate feature determination is achieved based on the process arrangement of the differential indexer and the nearest neighbor algorithm of the present application.
[0118] S103: After matching the local features of the target barcode, calling the corresponding actual image processing template stored in the database to perform image optimization processing on the barcode image captured by the current camera.
[0119] Specifically, the actual image processing template of the merchant in the database is constructed by the following steps:
[0120] Collect the QR code of each merchant;
[0121] Adjust the characteristic parameters of the image processing algorithm, perform distortion correction and perspective transformation correction on the collected two-dimensional code image, and obtain a standardized two-dimensional code image with minimal background interference;
[0122] Extract the distortion correction parameters and filter configuration parameters used by the standard QR code image as the core parameter set;
[0123] The obtained core parameter set is used as the actual image processing template file, and is stored in the database after being associated with the merchant's unified logo, so that the user can quickly call and apply it when scanning the code for identification.
[0124] S104: Decoding the barcode image optimized by the corresponding image processing template.
[0125] Compared with the prior art, the specific implementation provided by this application has the following advantages:
[0126] One of its beneficial effects and its corresponding working principle is:
[0127] By quickly loading the merchant QR code template that matches the user's location based on the user's geographic location, the search range of code scanning and recognition is significantly narrowed, thereby reducing the overall system computing and bandwidth consumption, and effectively shortening the user's waiting time during the code scanning process.
[0128] The specific working principle is: when the user terminal obtains the current location, the system selects the merchant QR code template and its differentiated index that are most relevant to the user's location from the server according to the pre-set geographic fence, and then sends or loads these data to the user terminal. In this way, when the user scans a merchant QR code, the recognition process only needs to match within the limited template set related to the current location, without the need for a large-scale search in the global database. In actual use scenarios, this not only improves the efficiency of code scanning and recognition, but also greatly reduces the network traffic and computing load caused by an overly large database.
[0129] The second beneficial effect and its corresponding working principle are:
[0130] Since the texture features of the merchant's QR code are blurred under different lighting environments, the texture features may be similar to other QR codes. If a global search is performed without distinguishing the environment, mismatches or feature conflicts are likely to occur.
[0131] The setting environment of merchant QR codes is generally relatively fixed. Although the lighting of different merchants is different, the lighting in the store or indoor lighting conditions is relatively stable and is not prone to drastic changes.
[0132] This application takes advantage of this feature. When executing the nearest neighbor search algorithm, it uses environmental factors as the direction guide of the multi-dimensional search space to achieve rapid pruning of the search space, so as to quickly find the most matching results in a huge database with a smaller search depth, and quickly exclude those QR code candidates from different environments and similar textures but not in the same environment. This avoids making too many comparisons on irrelevant feature dimensions, which not only improves the overall retrieval efficiency, but also reduces missed scans, mis-scans and conflicts in huge databases. Even if there are deviations in the matching results in rare cases, the obtained index is also a template similar to the current merchant environment to be matched, and it still has a high degree of compatibility with subsequent actual scanning processing, retaining a certain degree of recognition feasibility.
[0133] Secondly, since the differentiated index sub-options formed by weighted fusion of this system can reflect the confidence level of each feature in different environments, image features with high confidence in the current environment will be given priority during matching, and those image features with low confidence in the current environment will be weakened, thereby reducing the misjudgment conflicts caused by the superposition of multiple features during multi-feature matching.
[0134] Based on the above principles, the differentiated index construction scheme provided in this application not only speeds up the matching and retrieval speed, but also enables the system to more effectively resolve conflicts and avoid mismatches in different environment types, thereby maintaining stable recognition accuracy and fast matching performance in real scenarios.
[0135] In a second aspect, an embodiment of the present application provides a barcode recognition device, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement a barcode recognition method as described in any of the above embodiments.
[0136] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. In addition, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements. Moreover, in the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can represent A or B; "and / or" in this article is only a kind of association relationship describing the associated objects, indicating that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. Furthermore, in the description of the embodiments of the present application, “plurality” refers to two or more than two.
[0137] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A barcode recognition method, characterized in that: The barcode recognition method comprises the following steps: Obtaining the user's geographic location, and based on the geographic location, obtaining from a database a local stable feature library of payment barcodes of merchants within a preset range around the user and an actual image processing template corresponding to each barcode; When a user scans a merchant’s payment barcode sticker, local stable features are extracted from the camera image; Compare the local stable feature with the local stable features of payment barcodes in the local stable feature library of payment barcodes to determine the local features of the target barcode whose matching degree with the barcode in the current shooting picture reaches a preset matching standard; After matching the local features of the target barcode, calling the corresponding actual image processing template stored in the database to perform image optimization processing on the barcode image captured by the current camera; Decode the barcode image using the optimized image processing template; The local stable features of the payment barcodes of the merchants in the database are determined by the following steps: The payment barcode is a QR code; Collect the QR code image of each merchant in advance; A differentiated index is constructed for each QR code image constructed by a merchant, and the differentiated index is constructed by the following steps: Based on different light intensities, the QR code images are divided into multiple environment categories through a preset environment definition table; The environment definition table includes light intensity classification thresholds, and divides the environment categories according to the global brightness mean of the image calculated in real time; Extracting a plurality of image feature descriptors from each two-dimensional code image respectively, wherein the confidence of each image feature descriptor is different in different environments; The priority representation coefficient of each image feature descriptor under the corresponding environment category of each QR code image is obtained through a preset environment definition table; The corresponding image feature descriptor and its corresponding priority representation coefficient are weightedly fused to generate a combined feature multidimensional vector; The combined feature multidimensional vector of the same merchant and the unified identifier of the merchant are combined to form an association pair, thereby obtaining a differentiated index; The differential index is used as a local stable feature of the merchant's payment barcode.
2. The barcode recognition method according to claim 1, characterized in that: The image features include ORB descriptors, SIFT descriptors and two-dimensional code locator features.
3. The barcode recognition method according to claim 2, characterized in that: When a user scans a payment barcode sticker of a merchant, a local stable feature is extracted from the camera image, and the local stable feature is compared with the barcode local features in the payment barcode local stable feature library to determine the target barcode local features whose matching degree with the barcode in the current shooting picture reaches the preset matching standard, including the following steps: The camera's real-time image is illuminated with light intensity, and the current environment category is determined based on the preset environment definition table; Extracting ORB descriptors, SIFT descriptors and QR code locator features from the payment barcode sticker area to generate an original feature vector; According to the current environment category obtained, the priority representation coefficients corresponding to each image feature descriptor in the corresponding environment are loaded; The original feature vector is weightedly fused with the corresponding priority representation coefficient to generate a real-time query vector; The real-time query vector is subjected to a nearest neighbor search in the differentiated index sub-subjects stored in the database to obtain the local stable features of the payment barcode whose matching degree reaches the preset matching standard, so as to determine the merchant where the current user is located.
4. The barcode recognition method according to claim 3, characterized in that: Performing a nearest neighbor search on the real-time query vector in the differentiated index sub-sub ... According to the order of the priority representation coefficients of the indexes under the current environment category, the image features with the highest weight are selected and weighted to form the first search vector; in, For the environment The feature with the highest weight The priority coefficient of Input the approximate nearest neighbor algorithm engine to retrieve the payment barcode local stable features that meet the preset similarity threshold from the payment barcode local stable features to form a candidate set ; If | | = 1, then The local stable features of the payment barcode in the payment barcode are used as the local stable features of the payment barcode whose matching degree reaches the preset matching standard; If | | > 1, then perform precise matching according to the following process: Generate the second search vector: Use the second search vector to input the approximate nearest neighbor algorithm engine, and then Retrieving the most similar local stable feature of the payment barcode as the local stable feature of the payment barcode whose matching degree reaches the preset matching standard; Among them, | | represents the candidate set The number of local stable features of the internal payment barcode; , and Respectively represent the priority representation coefficients of ORB descriptor, SIFT descriptor and QR code locator features, , and They represent ORB descriptor, SIFT descriptor and QR code locator features respectively.
5. The barcode recognition method according to claim 1, characterized in that: The actual image processing template of the merchant in the database is constructed by the following steps: Collect the QR code of each merchant; Adjust the characteristic parameters of the image processing algorithm, perform distortion correction and perspective transformation correction on the collected two-dimensional code image, and obtain a standardized two-dimensional code image with minimal background interference; Extract the distortion correction parameters and filter configuration parameters used by the standard QR code image as the core parameter set; The obtained core parameter set is used as the actual image processing template file, and is stored in the database after being associated with the merchant's unified logo, so that the user can quickly call and apply it when scanning the code for identification.
6. A barcode recognition device, characterized in that: It includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the barcode recognition method as described in any one of claims 1-5.
Citation Information
Patent Citations
Intelligent scanning identification device, method and system
CN108763987A
A barcode recognition method and a computer using the method
CN109389000A