Two-dimensional code image repairing and recognizing method and device, electronic equipment and storage medium
By calculating the fusion features of the feature information and additional information of the QR code image, selecting the best color channel and enhancing the contrast, and merging high-quality image frames, the problem of decreased recognition rate when the QR code image is damaged is solved, and efficient QR code image restoration and recognition are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-16
- Publication Date
- 2026-04-07
AI Technical Summary
In existing technologies, when QR code images are damaged or soiled, the recognition rate decreases, making it difficult to effectively repair and recognize them.
By calculating the fusion features of feature information and additional information of multiple frames of QR code images, the best color channel is selected and contrast is enhanced. High-quality image frames are then merged to repair the QR code image and improve the recognition rate.
It significantly improves the quality and recognition rate of QR code images, while reducing computational load and system power consumption.
Smart Images

Figure CN116309117B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a two-dimensional code image repairing and recognizing method and device, an electronic device and a storage medium. BACKGROUND
[0002] A two-dimensional code stores feature data in a two-dimensional image space, and the two-dimensional code maintains a certain data redundancy, so that the two-dimensional code information can be normally read even if the two-dimensional code is incomplete or has a stain. Common two-dimensional codes include color bar codes, PDF417 codes, QR codes, Hanxin codes, EZ codes, Aztec codes, QuickMark and Data Matrix, etc. Image defects of a two-dimensional code image can cause a decrease in two-dimensional code recognition rate, and the image defects of the two-dimensional code image mainly include: two-dimensional code device jitter, which can cause a blurred two-dimensional code image; insufficient ambient light or light compensation, which can cause a two-dimensional code image with contrast; two-dimensional code device rotation / movement, which can cause a two-dimensional code image with multiple defects. SUMMARY
[0003] The present application provides a two-dimensional code image repairing and recognizing method and device, an electronic device and a storage medium, which can solve the above problems in the prior art.
[0004] In a first aspect, the present application provides a two-dimensional code image repairing method. The two-dimensional code image repairing method includes: respectively pre-processing a plurality of frames of collected two-dimensional code original images to obtain a sequence of pre-processed two-dimensional code images; calculating feature information and additional information of the plurality of frames of two-dimensional code images in the sequence of pre-processed two-dimensional code images; calculating fusion features of the feature information and the additional information of the plurality of frames of two-dimensional code images, and selecting the two-dimensional code images based on the fusion features; and merging the selected plurality of frames of two-dimensional code images into a repaired image. In the present application, fusion features of a plurality of types of feature information and additional information of a two-dimensional code image are calculated, and the fusion features are used to select two-dimensional code images; and then the selected two-dimensional code images are merged into a repaired image, which greatly improves the quality of the two-dimensional code image.
[0005] In an implementation form of the first aspect, the pre-processing the collected multiple frames of raw QR code images respectively to obtain a sequence of pre-processed QR code images comprises: obtaining an optimal color channel based on imaging quality of different channels of the multiple frames of raw QR code images; performing filtering processing on the raw QR code images respectively to retain image data of the optimal color channel; and enhancing contrast of the image data of the optimal color channel to obtain the sequence of pre-processed QR code images. In this implementation form, the optimal color channel is screened, and then other color channels are filtered out, which is advantageous for reducing the calculation amount, and has obvious advantages in terms of QR code image repair speed and system power consumption. Meanwhile, the image data of the optimal color channel is subjected to contrast enhancement processing, which can greatly improve the quality of the repaired QR code image.
[0006] In an implementation form of the first aspect, the feature information comprises at least one of a code point feature, a code point feature correlation degree, a code point feature, and a code point feature correlation degree.
[0007] In an implementation form of the first aspect, the additional information comprises at least one of a timestamp, a color channel, a QR code region, and a feature information completeness degree.
[0008] In an implementation form of the first aspect, the selecting the QR code image based on the fusion feature comprises: evaluating availability of the QR code image based on the fusion feature, the availability being used to quantify the fusion feature; and selecting a single frame of QR code image based on the availability.
[0009] In an implementation form of the first aspect, the evaluating the availability of the QR code image based on the fusion feature comprises: performing weighted evaluation on the feature information and the additional information to obtain a weighted evaluation score of each frame of QR code image, the weighted evaluation score being a score of availability of the QR code image.
[0010] In an implementation form of the first aspect, the selecting a single frame of QR code image based on the availability comprises: screening a QR code image with availability greater than a threshold value as a selected single frame of QR code image.
[0011] In an implementation form of the first aspect, the merging the selected multiple frames of QR code images into a repaired image comprises: aligning the selected multiple frames of QR code images; and merging the aligned multiple frames of QR code images into a repaired image.
[0012] In an implementation form of the first aspect, the aligning the selected multiple frames of QR code images comprises: aligning the selected multiple frames of QR code images based on code point features of the QR code images.
[0013] In a second aspect, the present application provides a method for recognizing a two-dimensional code image. The method comprises: aligning a plurality of selected two-dimensional code images based on code eye features of the two-dimensional code images, by using the method for repairing a two-dimensional code image according to the first aspect of the present application.
[0014] In a third aspect, the present application provides a device for repairing a two-dimensional code image. The device comprises: a preprocessing module configured to preprocess a plurality of collected two-dimensional code original images respectively to obtain a sequence of preprocessed two-dimensional code images; an information calculation module configured to calculate feature information and additional information of a plurality of two-dimensional code images in the sequence of preprocessed two-dimensional code images; a selection module configured to calculate fusion features of the feature information and the additional information of the plurality of two-dimensional code images, and select the two-dimensional code images based on the fusion features; and a repairing module configured to combine a plurality of selected two-dimensional code images into a repaired image. In the present application, the device for repairing a two-dimensional code image calculates fusion features of a plurality of feature information and additional information of a two-dimensional code image, and the fusion features are used to select a single two-dimensional code image; and then combines a sequence of selected two-dimensional code images into a repaired image, thereby greatly improving the quality of a two-dimensional code image.
[0015] In a fourth aspect, the present application provides a device for recognizing a two-dimensional code image. The device comprises: an image repairing module configured to perform image repairing based on a plurality of two-dimensional code images to obtain a repaired two-dimensional code image; and an identification calculation module configured to identify the repaired two-dimensional code image and calculate a feature code. In the present application, the device for recognizing a two-dimensional code image first calculates fusion features of a plurality of feature information and additional information of a two-dimensional code image, and the fusion features are used to select a single two-dimensional code image; and then combines a sequence of selected two-dimensional code images into a repaired image, thereby obtaining a high-quality two-dimensional code image, and then using the two-dimensional code image for two-dimensional code recognition, thereby greatly improving the recognition rate.
[0016] In a fifth aspect, the present application provides an electronic device. The electronic device comprises: a memory configured to store a computer program; and a processor configured to invoke the computer program to execute the method for repairing a two-dimensional code image according to the first aspect of the present application and / or the method for recognizing a two-dimensional code according to the second aspect of the present application.
[0017] In a sixth aspect, the present application provides a computer readable storage medium having a computer program stored thereon. The computer program is executed to implement the two-dimensional code image repairing method according to the first aspect of the present application and / or the two-dimensional code recognition method according to the second aspect of the present application.
[0018] In the two-dimensional code image repairing and recognition method and device, the electronic device and the storage medium according to the present application, the fusion features of the multiple feature information and the additional information of the two-dimensional code image are calculated, the fusion features are used to select single-frame two-dimensional code images, and the selected two-dimensional code image sequence is merged into a repaired image, which is further used for two-dimensional code recognition, thereby greatly improving the recognition rate. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 A structural schematic diagram of a two-dimensional code scanning gun is shown.
[0020] Figure 2 A two-dimensional code image with image defects is shown.
[0021] Figure 3 A flowchart of a two-dimensional code image repairing method according to an embodiment of the present application is shown.
[0022] Figure 4 A flowchart of two-dimensional code image preprocessing according to an embodiment of the present application is shown.
[0023] Figure 5 A flowchart of merging the selected multiple two-dimensional code images into a repaired image according to an embodiment of the present application is shown.
[0024] Figure 6 A flowchart of a two-dimensional code image repairing method according to another embodiment of the present application is shown.
[0025] Figure 7 A structural block diagram of a two-dimensional code image repairing device according to an embodiment of the present application is shown.
[0026] Figure 8 A structural block diagram of a selection module in a two-dimensional code image repairing device according to an embodiment of the present application is shown.
[0027] Figure 9 A structural block diagram of a two-dimensional code image recognition device according to an embodiment of the present application is shown.
[0028] Figure 10 A structural block diagram of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0029] Following make the application's implementation through specific concrete example, the person skilled in the art can easily understand the other advantages and efficacy of the application from the disclosure of this specification. The application can also be implemented or applied by another different specific implementation, and the details in the specification can be variously modified or changed based on different views and applications without departing from the spirit of the application. It should be noted that the following examples and features in the examples can be combined with each other without conflict.
[0030] It should be noted that the diagrams provided in the following examples only illustrate the basic concept of the application in a schematic manner, and only show the components related to the application in the diagrams, not drawn according to the number, shape and size of the components when actually implemented. The actual implementation of each component can be a random change in shape, number and proportion, and the component layout pattern can be more complex. In addition, in this paper, relational terms such as "first", "second" and the like 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 the entities or operations.
[0031] The following examples of the application provide a two-dimensional code image repairing and recognition method and device, electronic equipment and storage medium, including but not limited to for scanning gun, smart phone, PAD and other terminal devices with image acquisition function, which will be described below with two-dimensional code scanning gun as an example.
[0032] Figure 1 The structure diagram of a two-dimensional code scanning gun is shown. As shown in Figure 1 The two-dimensional code scanning gun includes LED light source, optical lens group, digital imaging unit and two-dimensional code recognition unit. In the process of collecting two-dimensional code image by two-dimensional code scanning gun, many factors will affect the quality of two-dimensional code image, including: two-dimensional code size, two-dimensional code detail size, imaging distance, imaging focal length, imaging unit size, imaging parameter of optical lens group, etc. Therefore, there are many image defects in the two-dimensional code image.
[0033] Figure 2 The two-dimensional code image with image defects is shown. The existing image defects include blurring, transparency, light scattering, pencil sketch, screen rasterization, film grain, plastic package effect, photocopy effect, etc. Due to the existence of various different image defects, the recognition rate of the image is greatly reduced. Therefore, the two-dimensional code image repairing and recognition method and device, electronic equipment and storage medium provided by the application first calculate the fusion features of the feature information and additional information of the two-dimensional code image, and the fusion features are used to select single frame two-dimensional code image; And the selected two-dimensional code image sequence is merged into a repaired image, and then the repaired two-dimensional code image is used for two-dimensional code recognition.
[0034] The technical solutions in the embodiments of the present application will be described in detail below with reference to the drawings in the embodiments of the present application.
[0035] Figure 3 A flowchart of a two-dimensional code image repairing method according to an embodiment of the present application is shown. As shown in the figure, Figure 3 the two-dimensional code image repairing method in the embodiment includes the following steps S11 to S14.
[0036] In step S11, the collected multiple frames of two-dimensional code original images are respectively preprocessed to obtain a sequence of preprocessed two-dimensional code images.
[0037] In the application scenario of scanning a two-dimensional code image by a scanning gun, when the scanning gun scans a two-dimensional code, the imaging sensor of the scanning gun will continuously scan multiple frames of images. Then, the present application calculates the fusion features of multiple characteristic information and additional information of the two-dimensional code image, and the fusion features are used to select a single frame of two-dimensional code image. The selected sequence of two-dimensional code images is merged into a repaired image, and the repaired image can repair multiple defects of the two-dimensional code image.
[0038] In a preferred embodiment, 5 to 8 frames of two-dimensional code images are continuously collected, and then the 5 to 8 frames of two-dimensional code images are preprocessed to form a sequence of preprocessed two-dimensional code images and used for subsequent characteristic information calculation and fusion.
[0039] Since the imaging quality of different color channels of a two-dimensional code image may have limited differences, the best color channel may have the best recognition effect, so the best color channel can be selected in the two-dimensional code preprocessing process. In addition, due to the limitation of environmental light or insufficient light compensation, the contrast of the image of the best color channel may also be low, which affects the recognition rate of the two-dimensional code, so the contrast of the best color channel needs to be enhanced based on the selection of the best color channel. Therefore, the image data of the best color channel can be further processed for contrast enhancement.
[0040] Figure 4 A flowchart of two-dimensional code image preprocessing according to an embodiment of the present application is shown. As shown in the figure, Figure 4 the preprocessing of the collected multiple frames of two-dimensional code images in the embodiment to obtain a sequence of preprocessed two-dimensional code images includes steps S111 to S113.
[0041] In step S111, the best color channel is obtained based on the imaging quality of different channels of the multiple frames of two-dimensional code original images.
[0042] The two-dimensional code scanning gun and the ambient light are the main factors affecting the optimal color channel. The two-dimensional code can also be recognized by using the RGB channel, and the use of a single channel is conducive to reducing the computational load of the entire system, and has obvious advantages in two-dimensional code image repair and system power consumption. Therefore, in order to reduce the computational load and improve the speed of image processing, the optimal color channel is selected through step S111. The selection of the optimal color channel includes a selection method based on two-dimensional code features or a selection method based on single-channel histogram corner point weighting.
[0043] The selection method based on two-dimensional code features is specifically: judging the completeness of the two-dimensional code features (code points, code eyes and random points) of the RGB color channels respectively; and optimizing the color channel with obvious code point and code eye features and fewer random points as the optimal color channel.
[0044] The selection method based on single-channel histogram corner point weighting is specifically: judging the corner point features of the RGB color channels respectively, taking the corner point surrounding frame area as the weight, and optimizing the color channel with the largest corner point weight as the optimal color channel.
[0045] In step S112, the two-dimensional code original image is respectively filtered to retain the image data of the optimal color channel.
[0046] In step S113, the contrast of the image data of the optimal color channel is enhanced to obtain the preprocessed two-dimensional code image sequence.
[0047] The contrast refers to the measurement of different brightness levels between the brightest white and the darkest black in the light and dark areas of an image. The greater the difference range, the greater the contrast, and the smaller the difference range, the smaller the contrast. Contrast enhancement can be achieved through equalization. Equalization can be understood as the process of value range compression and expansion. For example, the value range of the current optimal color channel is equalized from 50 to 100 to 0 to 255. Such operation can enhance the contrast of the image, thereby improving the recognition rate of subsequent two-dimensional code image recognition.
[0048] In step S12, the feature information and the additional information of the multiple two-dimensional code images in the preprocessed two-dimensional code image sequence are calculated.
[0049] The feature information includes at least one of the code eye feature, the code eye feature correlation, the code point feature and the code point feature correlation. The feature information has a relatively high weight relative to the additional information. The additional information includes at least one of the timestamp, the color channel, the two-dimensional code region and the feature information completeness, and the additional information has a relatively low weight relative to the feature information.
[0050] In step S13, the fusion feature of the feature information and the additional information of the multiple two-dimensional code images is calculated, and the two-dimensional code image is selected based on the fusion feature.
[0051] In the image repairing, the original two-dimensional code image sequence can be directly merged. However, when the image quality of a frame / multiple frames of images collected is extremely poor, the feature information calculated from the corresponding two-dimensional code image will be missing. If all the two-dimensional code images are merged to obtain the repaired two-dimensional code image at this time, the calculation resources will be greatly wasted, and the processing speed will be slowed down. Based on this, the application calculates the fusion feature of multiple feature information of each frame of two-dimensional code image through step S13. The fusion feature is used for selecting a single frame of two-dimensional code image. The availability is proportional to the quality of the two-dimensional code image. The higher the quality of the two-dimensional code image is, the higher the availability of the two-dimensional code image is. Thus, the selection of the two-dimensional code image can be realized, and the calculation speed of the algorithm can be improved.
[0052] In step S13, the two-dimensional code image is selected based on the fusion feature. The selection includes: evaluating the availability of the two-dimensional code image based on the fusion feature, the availability being used for quantifying the fusion feature; and selecting a single frame of two-dimensional code image based on the availability.
[0053] Preferably, the availability of each frame of two-dimensional code image is evaluated based on the feature information and the additional information. The evaluation includes: weighting and evaluating multiple feature information and additional information to obtain a weighted evaluation score of each frame of two-dimensional code image, the weighted evaluation score being the availability score of the two-dimensional code image. The selection of a single frame of two-dimensional code image based on the availability includes: screening the two-dimensional code image with the availability greater than a threshold value as the selected single frame of two-dimensional code image.
[0054] In step S14, the selected multiple frames of two-dimensional code images are merged into a repaired image.
[0055] Figure 5 A flowchart for merging the selected multiple frames of two-dimensional code images into a repaired image according to an embodiment of the application is shown. As shown in FIG. 14, the merging of the selected two-dimensional code image sequence into a repaired image in the embodiment includes steps S141 to S142. Figure 5
[0056] In step S141, the selected multiple frames of two-dimensional code images are aligned.
[0057] In a preferred embodiment, the selected multiple frames of two-dimensional code images are aligned based on the code eye feature of the two-dimensional code image. The two-dimensional code image includes three code eyes. The alignment of the multiple frames of two-dimensional code images, i.e., the alignment of the feature information of the multiple frames of two-dimensional code images, is realized by one-to-one alignment of the three code eyes.
[0058] In step S142, the aligned multiple frames of two-dimensional code images are merged into a repaired image.
[0059] The following will be described in a complete embodiment manner for the two-dimensional code image repairing method of the present application.
[0060] Figure 6 A flow chart of a two-dimensional code image repairing method according to another embodiment of the present application is shown. As shown in the figure, the two-dimensional code image repairing method in the present embodiment includes the following steps S21 to S24. Figure 6
[0061] In step S21, the collected multiple frames of two-dimensional code images are respectively pre-processed to obtain pre-processed two-dimensional code images, forming a first two-dimensional code image sequence.
[0062] In a preferred embodiment, 5 to 8 frames of two-dimensional code images are continuously collected, and then the 5 to 8 frames of two-dimensional code images are pre-processed to form a pre-processed two-dimensional code image sequence and used for subsequent characteristic information calculation and fusion.
[0063] Step S21 corresponds to step S11 in the above embodiment, and the pre-processing of the collected multiple frames of two-dimensional code images in step S21 includes: evaluating the imaging quality of the two-dimensional code and obtaining the best color channel of the two-dimensional code image; performing filtering processing on each frame of two-dimensional code image respectively to retain the image data of the best color channel; and performing contrast enhancement processing on the image data of the best color channel to obtain the pre-processed two-dimensional code image sequence.
[0064] In the present embodiment, the selection of the best color channel and the contrast enhancement processing of the image data of the best color channel are the same as the specific implementation manner in the above embodiment, which will not be described here.
[0065] In step S22, the characteristic information and additional information of the multiple frames of two-dimensional code images in the first two-dimensional code image sequence are calculated.
[0066] In the present embodiment, the characteristic information includes code dot feature, code dot feature correlation, code point feature and code point feature correlation. The characteristic information has a relatively high weight relative to the additional information. The additional information includes timestamp, color channel, two-dimensional code region and feature information completeness, etc., and the additional information has a relatively low weight relative to the characteristic information.
[0067] In step S23, the availability of each frame of two-dimensional code image in the first two-dimensional code image sequence is evaluated, the availability is used to quantify the fusion feature, and the two-dimensional code images with availability greater than a threshold value are screened and composed to form a second two-dimensional code image sequence.
[0068] The availability of each frame of the first sequence of two-dimensional code images is evaluated in the embodiment, which includes calculating additional information of each frame of the two-dimensional code images, and evaluating the availability of each frame of the two-dimensional code images based on the feature information and the additional information. In the embodiment, the availability of each frame of the two-dimensional code images is evaluated by using a weight method. Specifically, the feature information and the additional information are summed by weighting to obtain the availability score of each frame of the two-dimensional code images.
[0069] In step S24, the multiple frames of the second sequence of two-dimensional code images are merged to obtain a repaired two-dimensional code image. Specifically, the multiple frames of the two-dimensional code images are aligned based on the code dot features of the two-dimensional code images, and the selected sequence of two-dimensional code images is merged into a repaired image.
[0070] Based on the two-dimensional code image repairing method provided in the above embodiments, the application further provides a two-dimensional code recognition method. Specifically, in an embodiment of the application, the two-dimensional code recognition method includes: obtaining a repaired two-dimensional code image by using the two-dimensional code image repairing method in the above embodiments; and recognizing the repaired two-dimensional code image and calculating a feature code. In the embodiment, the specific implementation of the two-dimensional code image repairing method for obtaining the repaired two-dimensional code image has been described in detail in the above embodiments, and will not be repeated here.
[0071] In the two-dimensional code image repairing and recognition method provided in the application, the fusion features of multiple feature information and additional information of the two-dimensional code images are calculated, and the fusion features are used to select single-frame two-dimensional code images. Then, the selected sequence of two-dimensional code images is merged into a repaired image, which greatly improves the quality of the two-dimensional code image and further improves the recognition rate of the two-dimensional code recognition. In the two-dimensional code image repairing process, the best color channel is selected from multiple images, and other color channels are filtered out, which is beneficial to reduce the calculation amount and has obvious advantages in the two-dimensional code image repairing speed and system power consumption. At the same time, the image data of the best color channel is subjected to contrast enhancement processing, which can greatly improve the quality of the repaired two-dimensional code image and further help to improve the recognition rate of the two-dimensional code recognition. In addition, the two-dimensional code images with low availability are screened out before the fusion of the feature information and the additional information of the multiple two-dimensional code images, which further reduces the system calculation load.
[0072] The protection scope of the two-dimensional code image repairing and recognition method in the embodiments of the application is not limited to the execution order of the steps listed in the embodiments. Any scheme realized by adding, replacing or replacing steps of the prior art according to the principles of the application is included in the protection scope of the application.
[0073] The application embodiment further provides a two-dimensional code image repairing device, which can implement the two-dimensional code image repairing method according to the application. However, the implementation device of the two-dimensional code image repairing method according to the application includes but is not limited to the structure of the two-dimensional code image repairing device listed in the embodiment. Any prior art structure deformation and replacement made according to the principle of the application is included in the protection scope of the application.
[0074] Figure 7 The figure shows a structure block diagram of the two-dimensional code image repairing device according to an embodiment of the application. As Figure 7 The two-dimensional code image repairing device 2 in the embodiment includes a preprocessing module 21 configured to respectively preprocess the collected multiple frames of two-dimensional code original images to obtain a sequence of preprocessed two-dimensional code images, an information calculation module 22 configured to calculate feature information and additional information of the multiple frames of two-dimensional code images in the sequence of preprocessed two-dimensional code images, a selection module 23 configured to calculate fusion features of the feature information and the additional information of the multiple frames of two-dimensional code images, and select the two-dimensional code images based on the fusion features, and a repairing module 24 configured to combine the selected multiple frames of two-dimensional code images into a repaired image.
[0075] Figure 8 The figure shows a structure block diagram of the selection module according to an embodiment of the application. In the embodiment, the selection module 23 includes a feature information and additional information extraction sub-module 231, a fusion evaluation sub-module 232 and a selection sub-module 233. The feature information and additional information extraction sub-module 231 calculates fusion features of the corresponding two-dimensional code images based on the feature information and the additional information of each frame of two-dimensional code images. The fusion evaluation sub-module 232 evaluates the availability of each frame of two-dimensional code images based on the additional information, and the availability is used to quantify the fusion features. The selection sub-module 233 selects a single frame of two-dimensional code images based on the availability.
[0076] The application embodiment further provides a two-dimensional code image recognizing device, which can implement the two-dimensional code image recognizing method according to the application. However, the implementation device of the two-dimensional code image recognizing method according to the application includes but is not limited to the structure of the two-dimensional code image recognizing device listed in the embodiment. Any prior art structure deformation and replacement made according to the principle of the application is included in the protection scope of the application.
[0077] Figure 9 The figure shows a structure block diagram of the two-dimensional code image recognizing device according to an embodiment of the application. As Figure 9The QR code image recognition device 3 in this embodiment includes an image restoration module 31, which is configured to perform image restoration based on multiple frames of QR code images to obtain a restored QR code image; and a recognition calculation module 32, which is configured to recognize the restored QR code image and calculate the feature code.
[0078] It should be noted that the image restoration module 31 in this example is equivalent to the above embodiment. Figure 7 or Figure 8 The QR code image restoration device 2 and image restoration module 31 presented herein can implement the QR code image recognition method described in this application.
[0079] In the embodiments provided in this application, it should be understood that the disclosed systems or methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or units may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or modules or units, and may be electrical, mechanical, or other forms.
[0080] Those skilled in the art will further recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0081] In addition, this application also provides an electronic device. Figure 10 The diagram shown is a structural block diagram of an electronic device according to an embodiment of this application. (Reference) Figure 10 In one embodiment of this application, the electronic device 4 includes a memory 41 and a processor 42. The memory 41 is configured to store a computer program. The processor 42 is communicatively connected to the memory 41 and is configured to invoke the computer program to execute the QR code image restoration method or the QR code image recognition method according to this application.
[0082] This application also provides a computer-readable storage medium storing a computer program thereon. The computer program is executed by a processor to implement the QR code image restoration method or the QR code image recognition method according to this application. Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing a processor. The program can be stored in a computer-readable storage medium, which is a non-transitory medium, such as random access memory, read-only memory, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disk, and any combination thereof. The above storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0083] This application embodiment may also provide a computer program product comprising one or more computer instructions. When the computer instructions are loaded and executed on a computing device, all or part of the processes or functions described in this application embodiment are generated. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0084] When the computer program product is executed by a computer, the computer performs the method described in the foregoing method embodiments. The computer program product can be a software installation package; when the foregoing method is required, the computer program product can be downloaded and executed on the computer.
[0085] The descriptions of the processes or structures corresponding to the above figures each have their own emphasis. For parts of a process or structure that are not described in detail, please refer to the relevant descriptions of other processes or structures.
[0086] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.
Claims
1. A method for restoring QR code images, characterized in that, include: The acquired multiple frames of original QR code images are preprocessed to obtain a preprocessed QR code image sequence. Calculate the feature information and additional information of multiple frames of QR code images in the preprocessed QR code image sequence; Calculate the fusion features of the feature information and the additional information of the multi-frame QR code images, and select the QR code image based on the fusion features; as well as Merge the selected multi-frame QR code images into a repaired image. Selecting the QR code image based on the fusion features includes: evaluating the usability of the QR code image based on the fusion features, wherein the usability is used to quantify the fusion features; And select a single-frame QR code image based on the availability.
2. The QR code image restoration method according to claim 1, characterized in that, The acquired multi-frame original QR code images are preprocessed to obtain a preprocessed QR code image sequence, including: The optimal color channel is obtained based on the imaging quality of different channels of the original QR code image across multiple frames; The original QR code image is filtered to retain the image data of the optimal color channels; and Enhance the contrast of the image data in the optimal color channel to obtain the preprocessed QR code image sequence.
3. The QR code image restoration method according to claim 1, characterized in that, The feature information includes at least one of code eye feature, code eye feature correlation, code point feature, and code point feature correlation.
4. The QR code image restoration method according to claim 1, characterized in that, The additional information includes at least one of the following: timestamp, color channel, QR code area, and feature information completeness.
5. The QR code image restoration method according to claim 1, characterized in that, The usability assessment of the QR code image based on the fusion features includes: performing a weighted assessment on the feature information and the additional information to obtain a weighted assessment score for each frame of the QR code image, wherein the weighted assessment score is the usability score of the QR code image.
6. The QR code image restoration method according to claim 1, characterized in that, Selecting a single-frame QR code image based on the availability includes: filtering QR code images with an availability greater than a threshold as the selected single-frame QR code images.
7. The QR code image restoration method according to claim 1, characterized in that, Merging selected multi-frame QR code images into a repaired image includes: Align the selected multi-frame QR code images; and The aligned multi-frame QR code images are merged into a repaired image.
8. The QR code image restoration method according to claim 7, characterized in that, Aligning the selected multi-frame QR code images includes aligning the selected multi-frame QR code images based on the eye features of the QR code images.
9. A QR code image recognition method, characterized in that, include: The QR code image is obtained using the QR code image restoration method according to any one of claims 1 to 8; as well as The QR code image is identified, and its feature code is calculated.
10. A QR code image restoration device, characterized in that, include: The preprocessing module is configured to preprocess the acquired multi-frame original QR code images to obtain a preprocessed QR code image sequence. The information calculation module is configured to calculate the feature information and additional information of multiple frames of QR code images in the preprocessed QR code image sequence; The selection module is configured to calculate the fusion features of the feature information and the additional information of the multi-frame QR code images, and select the QR code image based on the fusion features; as well as The repair module is configured to merge selected multi-frame QR code images into a repaired image. The selection module is configured to evaluate the usability of the QR code image based on the fusion features, the usability being used to quantify the fusion features, and to select a single frame of QR code image based on the usability.
11. A QR code image recognition device, characterized in that, include: The QR code image restoration device according to claim 10; as well as The recognition and calculation module recognizes the repaired QR code image and calculates the feature code.
12. An electronic device, characterized in that, include: Memory, configured to store computer programs; as well as The processor is configured to invoke the computer program to execute the QR code image restoration method according to any one of claims 1 to 8 and / or the QR code image recognition method according to claim 9.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer program is executed to implement the QR code image restoration method according to any one of claims 1 to 8 and / or the QR code image recognition method according to claim 9.
Citation Information
Patent Citations
Two-dimensional code recognition method and device, electronic equipment and storage medium
CN111488752A
Image processing method and image processing device using parameterized Thiele continued fraction interpolation
CN112132749A
Target object identification method and device
CN113671458A