Method for generating quick response code and printing device
By identifying and generating QR codes covering color or grayscale images in monochrome images, the problem of low recognition rate of QR codes printed by monochrome printers is solved, and a higher recognition rate is achieved.
Patent Information
- Application Number
- CN202411355251.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2020-01-10
- Publication Date
- 2025-01-17
AI Technical Summary
The fast response code recognition rate of the monochrome printer prints color or grayscale images is low, resulting in errors in recognition or unrecognized problems.
By obtaining the original image of the QR code, identifying its information and generating a monochrome image, overwriting the original image, ensuring that the printed image is a monochrome image, which is suitable for monochrome printers.
The recognition rate of fast response codes is improved, ensuring that the printed QR code is easier to identify on monochrome printers.
Smart Images

Figure CN119323229A_ABST
Abstract
Description
[0001] This application is a divisional application of the invention patent application with application date of January 10, 2020, application number 202010024132.3, and invention name “Method and printing device for generating quick response code”. Technical Field
[0002] The present disclosure relates to a method for generating a quick response code and a printing device. Background Art
[0003] At present, Quick Response (QR) codes are increasingly used in life. In many cases, merchants need to print out QR codes for customers to scan and identify. Summary of the invention
[0004] According to one aspect of the present disclosure, a method for generating a quick response QR code is provided, comprising: acquiring an original image of a QR code, wherein the original image of the QR code is a bitmap image and is a color image or a grayscale image; acquiring information contained in the QR code; and generating a monochrome image of the QR code based on the information.
[0005] In some embodiments according to the present disclosure, the original image of the QR code is included in a first image, and the method further includes: determining a position of the original image of the QR code in the first image; and covering the original image of the QR code in the first image with the monochrome image of the QR code according to the position.
[0006] In some embodiments according to the present disclosure, generating the monochrome image of the QR code based on the information includes: determining the size of the original image of the QR code according to the position of the original image of the QR code in the first image; and generating the monochrome image of the QR code according to the size of the original image of the QR code.
[0007] In some embodiments according to the present disclosure, the size of the original image of the QR code is smaller than or equal to the size of the monochrome image of the QR code.
[0008] In some embodiments according to the present disclosure, the monochrome image is a black and white image.
[0009] According to another aspect of the present disclosure, there is provided a printing method, comprising: generating a quick response QR code according to the above method; and printing a monochrome image of the QR code.
[0010] According to another aspect of the present disclosure, a printing apparatus is provided, comprising: a processor and a printing device, wherein the processor is configured to: obtain an original image of a quick response QR code, wherein the original image of the QR code is a bitmap image and is a color image or a grayscale image; obtain information contained in the QR code; and generate a monochrome image of the QR code based on the information, and the printing device is configured to print the monochrome image of the QR code.
[0011] In some embodiments according to the present disclosure, the original image of the QR code is included in a first image, and the processor is further configured to: determine a position of the original image of the QR code in the first image; and cover the original image of the QR code in the first image with the monochrome image of the QR code according to the position.
[0012] In some embodiments according to the present disclosure, generating the monochrome image of the QR code based on the information includes: determining the size of the original image of the QR code according to the position of the original image of the QR code in the first image; and generating the monochrome image of the QR code according to the size of the original image of the QR code.
[0013] In some embodiments according to the present disclosure, the size of the original image of the QR code is the same as the size of the monochrome image of the QR code.
[0014] In some embodiments according to the present disclosure, the monochrome image is a black and white image.
[0015] In some embodiments according to the present disclosure, the printing device is a monochrome printing device.
[0016] According to another aspect of the present disclosure, an invoice printing device is provided, comprising: a printer and a processor, wherein the processor is configured to: obtain an electronic invoice file, wherein the electronic invoice file contains an original image of a QR code, wherein the original image of the QR code is a color image or a grayscale image; obtain information contained in the QR code; generate a monochrome image of the QR code based on the information; replace the original image of the QR code with the monochrome image of the QR code, thereby generating a new electronic invoice file; and print the new electronic invoice file through the printer.
[0017] In some embodiments according to the present disclosure, the processor is further configured to: perform format conversion on the electronic invoice file so that the format of the electronic invoice file changes to a bitmap format.
[0018] In some embodiments according to the present disclosure, the printer is a monochrome printer.
[0019] Other features and advantages of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0021] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
[0022] Figure 1 A flowchart of a method for generating a QR code according to an embodiment of the present disclosure is shown.
[0023] Figure 2 A flowchart of a method for generating a QR code according to an embodiment of the present disclosure is shown.
[0024] Figure 3 A schematic diagram of a printing device according to an embodiment of the present disclosure is shown.
[0025] Figure 4 A schematic diagram of a first image according to an embodiment of the present disclosure is shown.
[0026] Figure 5 A schematic diagram of an invoice printing device according to an embodiment of the present disclosure is shown.
[0027] Note that in the embodiments described below, the same reference numerals are sometimes used in common between different drawings to represent the same parts or parts with the same functions, and their repeated descriptions are omitted. In this specification, similar reference numerals and letters are used to represent similar items, so once an item is defined in one drawing, it does not need to be further discussed in subsequent drawings.
[0028] For ease of understanding, the positions, sizes, and ranges of various structures shown in the drawings and the like may not represent actual positions, sizes, and ranges, etc. Therefore, the disclosed invention is not limited to the positions, sizes, and ranges disclosed in the drawings and the like. DETAILED DESCRIPTION
[0029] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.
[0030] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0031] Technologies, methods, and apparatus known to ordinary technicians in the relevant field may not be discussed in detail, but where appropriate, such technologies, methods, and apparatus should be considered part of the authorization specification.
[0032] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0033] The specific implementation methods of the present disclosure are further described in detail below with reference to the accompanying drawings.
[0034] Usually, people use monochrome printers (such as black and white printers) to print QR codes. For example, a color image containing a QR code can be input into a monochrome printer for printing.
[0035] However, the inventors of the present disclosure have discovered that when the color image is a bitmap image (eg, a file with a file name suffix of bmp, jpg, png, gif, etc.), the recognition rate of the QR code printed by a monochrome printer is low.
[0036] Figure 3 FIG. 1 shows a schematic diagram of a device for printing a QR code according to the present disclosure. Figure 3 As shown, the device 300 for printing a QR code includes a storage device 301, a processor 302, and a printer 303. The storage device 301 may store an image of a QR code or an image containing a QR code. The processor 302 may process the QR code, generate a monochrome image of the QR code, and use the monochrome image to replace the original QR code image. The printer 303 may print a monochrome image of the QR code or an image containing a QR code, and in the printed image, the original QR code is replaced with a monochrome image. In addition, in some embodiments according to the present disclosure, the printer 303 may be a monochrome printer, such as a black and white printer.
[0037] Figure 1 FIG. 1 is a flow chart showing a method for generating a QR code according to an embodiment of the present disclosure. Figure 1 As shown, the method for generating a QR code mainly includes the following steps.
[0038] First, the original image of the QR code is obtained (step 110). The original image of the QR code can be a color image or a grayscale image. Here, the original image is a bitmap image. A bitmap image is also called a dot matrix image or a raster image, and is composed of a single point called a pixel. In the bitmap image, the position and color value of each pixel are recorded. For example, the original image of the QR code can be pre-stored in the storage device 301, and the processor 302 can read the original image of the QR code from the storage device 301.
[0039] Then, obtain the information contained in the QR code (step 120). For example, the processor 302 can identify the QR code through various QR code recognition algorithms, thereby obtaining the information contained in the QR code. In this step, since the processor 302 directly identifies the original image of the QR code through the QR code recognition algorithm, a relatively high recognition rate can be achieved, and thus the information contained in the QR code can be accurately obtained.
[0040] Finally, the processor 302 generates a monochrome image of the QR code based on the obtained information (step 130). Since the newly generated image of the QR code is a monochrome image (such as a black and white image), even if the newly generated QR code is printed by a monochrome printer subsequently, a relatively high recognition rate can still be achieved.
[0041] In addition, in many cases, the image to be printed (i.e., the first image) may contain other contents in addition to the QR code. For example, Figure 4 FIG. shows the first image 400, which contains the QR code 401, the text 402, and the picture 403. That is, when the printer prints the first image 400, not only the QR code 401 needs to be printed, but also the text 402 and the picture 403 need to be printed. The following will be described in conjunction with Figure 2 this process.
[0042] Figure 2 FIG. shows a flowchart of a method for generating a QR code according to an embodiment of the present disclosure. As Figure 2 shown, the method includes the following steps.
[0043] First, obtain the original image of the QR code (step 210). For example, the processor 302 can read the first image 400 from the memory 301. The first image 400 contains various contents such as the QR code 401, the text 402, and the picture 403.
[0044] Then, the processor 302 can use image recognition to determine the position of the QR code 401 in the first image 400 (step 220). For example, the QR code is usually square, and a pattern similar to a "hui" character is set at three of the four corners, and this "hui" character pattern can be used to determine the position of the QR code. The processor 302 can determine the positions of the four corners of the QR code in the first image 400 through an image recognition algorithm, and based on the positions of these four corners, the position of the QR code can be determined.
[0045] Next, the processor 302 can determine the size of the QR code (step 230). For example, the processor 302 can obtain the size of the QR code according to the positions of the four corners of the QR code determined in step 220.
[0046] Next, the processor 302 may obtain information contained in the QR code (step 240). For example, the processor 302 may decode the QR code using a decoding algorithm to obtain the information contained in the QR code.
[0047] Next, the processor 302 generates a monochrome image of the QR code based on the information contained in the QR code (step 250). For example, the processor 302 can generate a new QR code that is a monochrome image, and the information contained in the new QR code is the same as the information contained in the original QR code. In addition, when the processor 302 generates the new QR code, the size of the new QR code is the same as the size of the original QR code.
[0048] Next, the processor 302 may use the new QR code to cover the original QR code 401 in the first image 400, thereby obtaining a new image (step 260). For example, the processor 302 may cover the new QR code on the original QR code according to the position of the original QR code in the first image 400 obtained in step 220. Since the new QR code and the original QR code have the same size, the original QR code may be completely covered without covering other parts of the first image 400.
[0049] Finally, the processor 302 may send the new image to the printer 303, which prints it out. Since the QR code in the new image is a monochrome image (e.g., a black and white image), the QR code in the image printed out by the printer 303 is also a monochrome image. In addition, as described above, in some embodiments according to the present disclosure, the printer 303 may be a monochrome printer, such as a black and white printer.
[0050] In addition, in some embodiments according to the present disclosure, the size of the new QR code may be larger than the size of the original QR code, so that the new QR code can completely cover the original QR code.
[0051] People can use the camera of a mobile device such as a mobile phone or other device to shoot the image printed by the printer 303, so as to identify the QR code in the image. The inventor of the present disclosure has found that compared with the prior art in which the monochrome printer 303 directly prints the first image 400 and then shoots and identifies it, the new image obtained through the above-mentioned processing process of the present disclosure has a higher recognition rate. That is, when shooting through a camera and identifying the QR code through the shot image, the monochrome image of the QR code printed by the monochrome printer 303 is easier to be recognized, while if the color image or grayscale image of the QR code is directly printed by the monochrome printer 303, the problem of failure to recognize or recognition error often occurs.
[0052] At present, electronic invoices are used more and more widely. A QR code is usually provided on the electronic invoice. People can scan and identify the QR code on the electronic invoice through mobile phones and other devices to confirm the information of the electronic invoice. In this way, for example, the authenticity of the electronic invoice can be identified, the duplicate reimbursement of electronic invoices can be prevented, or the electronic invoice can be quickly entered into the system. Electronic invoices are usually provided by, for example, the tax bureau, such as files in PDF format. However, if the electronic invoice provided by the tax bureau is directly printed out through a monochrome printer, the QR code on the electronic invoice is usually a color image or a grayscale image. As mentioned above, in this case, the recognition rate of the QR code in the printed invoice is low.
[0053] Figure 5 An invoice printing device according to some embodiments of the present disclosure is shown. Figure 5 As shown, the invoice printing device 500 includes: a receiving device 504, a storage device 501, a processor 502 and a printer 503.
[0054] The receiving device 504 can receive, for example, an electronic invoice file sent from a server of the tax bureau and store it in the storage device 501. The electronic invoice file can be in a bitmap format or other formats, such as PDF format, etc. The electronic invoice contains a QR code, and the image of the QR code is usually a color image or a grayscale image.
[0055] When the electronic invoice needs to be printed, the processor 502 obtains the electronic invoice file from the storage device 501 .
[0056] The processor 502 may then determine the position and size of the QR code in the electronic invoice by, for example, image recognition.
[0057] In some embodiments of the present disclosure, if the format of the electronic invoice is not a bitmap format (such as a PDF format or other formats, etc.), the processor 502 may also perform a format conversion operation on the electronic invoice file before performing the image recognition operation, thereby converting the format of the electronic invoice file into a bitmap format.
[0058] Next, the processor 502 may obtain the information contained in the QR code.
[0059] Next, the processor 502 can generate a new QR code image based on the information contained in the QR code, wherein the new QR code image is a monochrome image (e.g., a black and white image) and contains the same information as the original QR code. In addition, the size of the new QR code image is also the same as the size of the original QR code image.
[0060] Then, the processor 502 overlays the image of the new QR code on the image of the original QR code to obtain a new electronic invoice file.
[0061] Finally, the processor 502 sends the new electronic invoice file to the printer 503, which prints it into a paper invoice.
[0062] In some embodiments according to the present disclosure, the printer 503 may be a monochrome printer, such as a black and white printer.
[0063] By using the invoice printing device disclosed herein, the QR code on the printed paper invoice is easier to recognize and has a higher recognition rate.
[0064] In the description of the present disclosure, the term "monochrome image" means that the pixel value of each pixel in the image can take one of two values (e.g., black and white). For most applications, the preferred example of a monochrome image is a black and white image. However, in some applications, other monochrome image schemes may also be used, such as only red and white pixels, or only green and white pixels in another example. Therefore, in the present disclosure, a "grayscale image" is not a "monochrome image" because the pixel value of each pixel in a grayscale image includes a grayscale value in addition to black and white.
[0065] According to some embodiments of the present disclosure, the following technical solutions may also be adopted:
[0066] 1. A method for generating a quick response QR code, comprising:
[0067] Acquire an original image of the QR code, wherein the original image of the QR code is a bitmap image and is a color image or a grayscale image;
[0068] Obtaining information contained in the QR code; and
[0069] A monochrome image of the QR code is generated based on the information.
[0070] 2. The method according to 1, wherein the original image of the QR code is contained in the first image, and the method further comprises:
[0071] Determining a position of the original image of the QR code in the first image; and
[0072] The original image of the QR code in the first image is overwritten with the monochrome image of the QR code according to the position.
[0073] 3. The method according to 2, wherein generating the monochrome image of the QR code based on the information comprises:
[0074] determining a size of the original image of the QR code according to a position of the original image of the QR code in the first image; and
[0075] The monochrome image of the QR code is generated according to the size of the original image of the QR code.
[0076] 4. The method according to 3, wherein the size of the original image of the QR code is smaller than or equal to the size of the monochrome image of the QR code.
[0077] 5. The method according to any one of 1 to 4, wherein the monochrome image is a black and white image.
[0078] 6. A printing method, comprising:
[0079] Generate a quick response QR code according to any one of the methods 1-5; and
[0080] Print a monochrome image of the QR code.
[0081] 7. A printing device, comprising: a processor and a printing device,
[0082] Wherein, the processor is configured to:
[0083] Acquire an original image of a quick response QR code, wherein the original image of the QR code is a bitmap image and is a color image or a grayscale image;
[0084] Obtaining information contained in the QR code; and
[0085] generating a monochrome image of the QR code based on the information,
[0086] The printing device is configured to print a monochrome image of the QR code.
[0087] 8. The printing device according to item 7, wherein the original image of the QR code is included in the first image, and the processor is further configured to:
[0088] Determining a position of the original image of the QR code in the first image; and
[0089] The original image of the QR code in the first image is overwritten with the monochrome image of the QR code according to the position.
[0090] 9. The printing device according to 8, wherein generating the monochrome image of the QR code based on the information comprises:
[0091] determining a size of the original image of the QR code according to a position of the original image of the QR code in the first image; and
[0092] The monochrome image of the QR code is generated according to the size of the original image of the QR code.
[0093] 10. The printing device according to 9, wherein the size of the original image of the QR code is the same as the size of the monochrome image of the QR code.
[0094] 11. The printing device according to any one of 7 to 10, wherein the monochrome image is a black-and-white image.
[0095] 12. The printing apparatus according to item 7, wherein the printing device is a monochrome printing device.
[0096] 13. An invoice printing device, comprising: a printer and a processor, wherein
[0097] The processor is configured to:
[0098] Acquire an electronic invoice file, wherein the electronic invoice file includes an original image of a quick response QR code, wherein the original image of the QR code is a color image or a grayscale image;
[0099] Obtaining information contained in the QR code;
[0100] generating a monochrome image of the QR code based on the information; and
[0101] replacing the original image of the QR code with the monochrome image of the QR code, thereby generating a new electronic invoice file,
[0102] The printer is configured to print the new electronic invoice file.
[0103] 14. The invoice printing device according to 13, wherein the processor is further configured to:
[0104] Perform format conversion on the electronic invoice file so that the format of the electronic invoice file changes to a bitmap format.
[0105] 15. The invoice printing device according to 13, wherein the printer is a monochrome printer.
[0106] The words "front", "rear", "top", "bottom", "above", "below", etc., if present, in the specification and claims are used for descriptive purposes and are not necessarily used to describe invariant relative positions. It should be understood that the words so used are interchangeable under appropriate circumstances, such that the embodiments of the disclosure described herein, for example, are capable of operation in other orientations than those illustrated or otherwise described herein.
[0107] As used herein, the word "exemplary" means "serving as an example, instance, or illustration," rather than as a "model" to be exactly copied. Any implementation described as an example herein is not necessarily to be construed as preferred or advantageous over other implementations. Furthermore, the present disclosure is not limited by any expressed or implied theory given in the above technical field, background technology, summary of the invention, or detailed description.
[0108] As used herein, the term "substantially" is intended to include any minor variations due to design or manufacturing imperfections, device or component tolerances, environmental influences, and / or other factors. The term "substantially" also allows for deviations from a perfect or ideal condition due to parasitic effects, noise, and other practical considerations that may exist in actual implementations.
[0109] In addition, certain terms may be used in the following description for reference purposes only and are not intended to be limiting. For example, the words "first," "second," and other such numerical words referring to structures or elements do not imply a sequence or order unless the context clearly indicates otherwise.
[0110] It should also be understood that when the term “include / comprises” is used in this document, it indicates the presence of the specified features, integers, steps, operations, units and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, units and / or components and / or their combinations.
[0111] Those skilled in the art will appreciate that the boundaries between the above operations are merely illustrative. Multiple operations can be combined into a single operation, a single operation can be distributed in additional operations, and operations can be performed at least partially overlapping in time. Moreover, alternative embodiments may include multiple instances of specific operations, and the order of operations may be changed in other various embodiments. However, other modifications, variations, and replacements are equally possible. Therefore, this specification and accompanying drawings should be considered illustrative, not restrictive.
[0112] Although some specific embodiments of the present disclosure have been described in detail by way of example, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present disclosure. The various embodiments disclosed herein may be combined in any manner without departing from the spirit and scope of the present disclosure. It should also be understood by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.
Claims
1. A method for generating a quick response QR code, comprising: Acquire an original image of a QR code, wherein the original image of the QR code is a bitmap image and is a color image or a grayscale image, and wherein the original image of the QR code is included in the first image; Determining a position of the original image of the QR code in the first image; Determining the size of the original image of the QR code according to the position of the original image of the QR code in the first image; Obtaining information contained in the QR code; as well as The monochrome image of the QR code is generated based on the information according to the size of the original image of the QR code, wherein the size of the original image of the QR code is smaller than the size of the monochrome image of the QR code.
2. The method according to claim 1, wherein: The method further comprises: The original image of the QR code in the first image is overwritten with the monochrome image of the QR code according to the position.
3. The method according to any one of claims 1 to 2, wherein: The monochrome image is a black and white image.
4. A printing method, comprising: Generate a quick response QR code according to the method of any one of claims 1-3; as well as Print a monochrome image of the QR code.
5. A printing device, comprising: processor and printing device, Wherein, the processor is configured to: Acquire an original image of a quick response QR code, wherein the original image of the QR code is a bitmap image and is a color image or a grayscale image, and wherein the original image of the QR code is included in the first image; Determining a position of the original image of the QR code in the first image; Determining the size of the original image of the QR code according to the position of the original image of the QR code in the first image; Obtaining information contained in the QR code; and generating a monochrome image of the QR code based on the information according to the size of the original image of the QR code, wherein the size of the original image of the QR code is smaller than the size of the monochrome image of the QR code, and The printing device is configured to print a monochrome image of the QR code.
6. The printing device according to claim 5, wherein: The processor is further configured to: The original image of the QR code in the first image is overwritten with the monochrome image of the QR code according to the position.
7. The printing device according to any one of claims 5 to 6, wherein: The monochrome image is a black and white image.
8. The printing device according to claim 5, wherein: The printing device is a monochrome printing device.