Barcode detection device, method, and program
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2026-04-07
Smart Images

Figure 2026059202000001_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a barcode discrimination device and method for discriminating the types of barcodes included in image data, and a program.
Background Art
[0002] When printing a barcode with an inkjet printer, the reading rank of the barcode becomes low due to the influence of bleeding, so image processing for barcodes such as reducing the ink density is performed.
[0003] Also, in Patent Document 1, in order to prevent a decrease in the reading rank of a barcode, a barcode determination process is performed by comparing the data of the printed barcode with the barcode data obtained by reading the printed barcode, and when it is determined as defective, a method of notifying an error to the printing device has been proposed.
Prior Art Documents
Patent Documents
[0004]
Patent Document 1
Summary of the Invention
Problems to be Solved by the Invention
[0005] Here, when performing image processing for barcodes as described above, when the barcode is a one-dimensional barcode, the degree of ink bleeding is different depending on the stretching direction of the bars of the barcode with respect to the paper feeding direction (printing direction) in the printing device, so it is preferable to perform different image processing.
[0006] Also, since two-dimensional barcodes are more affected by ink bleeding than one-dimensional barcodes, it is preferable to perform different image processing for one-dimensional barcodes and two-dimensional barcodes.
[0007] In other words, it is preferable to switch image processing depending on the orientation of the one-dimensional barcode and whether it is a one-dimensional or two-dimensional barcode.
[0008] However, performing complex image analysis to distinguish between one-dimensional and two-dimensional barcodes (QR codes®), and to determine the orientation of one-dimensional barcodes, can increase the software load and potentially lead to decreased productivity. Furthermore, requiring users to manually input the orientation of all barcodes in the image data would place a significant burden on them.
[0009] In view of the above circumstances, the present invention aims to provide a barcode determination device, method, and program that can determine the type of barcode with relatively low processing load and improve the barcode reading rank. [Means for solving the problem]
[0010] The barcode determination device of the present invention comprises a barcode area information acquisition unit that acquires information about the barcode area, a determination unit that determines the type of barcode based on the paper feeding direction in the printing section of the printing medium on which the barcode is printed and the ratio of the width and height of the barcode area, and an image processing unit that switches the image processing applied to the barcode image data according to the type of barcode. [Effects of the Invention]
[0011] According to the barcode determination device of the present invention, information about the barcode area is acquired, the type of barcode is determined based on the paper feeding direction in the printing section of the printing medium on which the barcode is printed and the ratio of the width and height of the barcode area, and the image processing applied to the barcode image data is switched according to the type of barcode. As a result, the type of barcode can be determined with relatively low processing load, and the barcode reading rank can be improved. [Brief explanation of the drawing]
[0012] [Figure 1]Block diagram showing the schematic configuration of a printing system using one embodiment of the barcode determination device of the present invention. [Figure 2] A diagram illustrating vertical and horizontal one-dimensional barcodes. [Figure 3] A diagram illustrating an example of line width correction processing. [Figure 4] Flowchart illustrating the processing flow of the printing system shown in Figure 1. [Figure 5] A diagram showing an example of a barcode area. [Figure 6] Diagram to explain column image data and row image data. [Modes for carrying out the invention]
[0013] A printing system using one embodiment of the barcode detection device of the present invention will be described in detail below with reference to the drawings. Figure 1 is a schematic diagram of the printing system 1 of this embodiment.
[0014] The printing system 1 of this embodiment comprises a print data generation device 10 and a printing device 20. The print data generation device 10 and the printing device 20 are connected by a wired or wireless communication line and are configured to send and receive various signals from each other.
[0015] As shown in Figure 1, the print data generation device 10 includes a barcode area information acquisition unit 11, a discrimination unit 12, an image processing unit 13, a display unit 14, and an input unit 15.
[0016] The barcode area information acquisition unit 11 acquires information about the barcode area specified by the user on the image data to be printed. The image data may be image data created by an editing application installed on the print data generation device 10, or image data obtained by scanning a document using a scanner (not shown).
[0017] The image data to be printed is displayed on the display unit 14. On the displayed image data, the user checks the position of the barcode and uses the input unit 15 to surround the periphery of the barcode with a rectangular area, thereby specifying the barcode area. The information of the barcode area is the coordinate information of the above-described rectangular area. Note that the display of the image data and the specification of the barcode area may be performed by a dedicated application installed in the print data generation device 10.
[0018] The discrimination unit 12 discriminates the type of the barcode based on the paper feeding direction in the printing device 20 of the printing medium on which the barcode is printed and the ratio of the width and height of the above-described barcode area. In the present embodiment, the width of the barcode area is the length in the horizontal direction in the display coordinate system of the image data, and the height is the length in the vertical direction.
[0019] Also, the paper feeding direction in the printing device 20 is the conveyance direction of the printing medium in the printing device 20, and may be the same as the vertical direction or the same as the horizontal direction in the display coordinate system of the image data. The paper feeding direction is set on the printer driver of the printing device 20 installed in the print data generation device 10 or set on the printing device 20 side. In the present embodiment, the paper feeding direction set on the printer driver is preferentially used.
[0020] Then, the discrimination unit 12 of the present embodiment discriminates whether the barcode included in the image data is a one-dimensional barcode in the vertical direction, a one-dimensional barcode in the horizontal direction, or a two-dimensional barcode based on the paper feeding direction of the printing medium and the ratio of the width and height of the barcode area as described above.
[0021] A one-dimensional barcode in the vertical direction is a barcode where the long side of the barcode area is perpendicular to the paper feed direction as shown in Fig. 2A, and a one-dimensional barcode in the horizontal direction is a barcode where the long side of the barcode area coincides with the paper feed direction as shown in Fig. 2B. A two-dimensional barcode is a barcode where the width and height of the barcode area are substantially the same, that is, the barcode area is approximately square. Note that the method for discriminating the type of barcode will be described in detail later.
[0022] The image processing unit 13 switches the image processing performed on the image data in the barcode area based on the type of barcode discriminated by the discrimination unit 12.
[0023] In the case where the barcode is a one-dimensional barcode in the vertical direction shown in Fig. 2A, the image processing unit 13 in this embodiment is easily affected by ink bleeding. Therefore, by reducing the ink density in the barcode area, ink bleeding is reduced and the reading rank of the barcode is improved. Specifically, in the case of a one-dimensional barcode in the vertical direction, the image processing unit 13 performs four processes of K monochromatic processing, density correction processing, line width correction processing, and printing rate correction processing on the image data in the barcode area to reduce the ink density.
[0024] The K monochromatic processing is a process of removing components of colors other than K (black) color when the image data in the barcode area contains such components.
[0025] The density correction processing is a process of reducing the number of printing drops of each pixel of the image data in the barcode area. In the density correction processing of this embodiment, for example, 2 drops are reduced.
[0026] The line width correction processing is a process of cutting the line width in the barcode area, and in this embodiment, 1 pixel is cut.
[0027] The printing rate correction processing is a process of setting non-printing pixels in a checkered pattern for the image data in the barcode area.
[0028] Furthermore, in this embodiment, when the barcode is a horizontal one-dimensional barcode or a two-dimensional barcode as shown in Figure 2B, the image processing unit 13 applies a process that reduces the ink density to a greater extent because the effect of ink bleeding is greater compared to a vertical one-dimensional barcode. Specifically, in the case of horizontal two-dimensional barcodes and two-dimensional barcodes, the image processing unit 13 applies the three processes described above: K monochromatization, line width correction, and density correction, but in the line width correction process, two pixels are cut.
[0029] The image processing unit 13 converts the input RGB image data into image data of C (cyan), M (magenta), Y (yellow), and K (black) components, generates ink drop data for each component from the image data of each component, and applies the density reduction image processing described above to the ink drop data. The ink drop data is data that represents the number of ink drops ejected from the nozzle of the inkjet head when forming one pixel (dot).
[0030] Figures 3A and 3B are diagrams illustrating examples of line width correction processing. Figure 3A shows an example of cutting one pixel, and Figure 3B shows an example of cutting two pixels. Of the black pixels labeled "1" in Figures 3A and 3B, the pixels shown in gray are cut by the line width correction processing.
[0031] The image processing unit 13 applies the above-described image processing to the image data within the barcode area according to the type of barcode, and after applying other known image processing to the entire image data, outputs the processed image data as print data to the printing device 20.
[0032] The display unit 14 includes a display device such as a liquid crystal display and displays image data including a barcode.
[0033] The input unit 15 includes, for example, an input device such as a mouse or keyboard, and accepts input from the barcode area described above.
[0034] The print data generation device 10 is composed of a computer and includes a CPU (Central Processing Unit), semiconductor memory such as ROM (Read Only Memory) and RAM (Random Access Memory), storage such as a hard disk, and a communication I / F (Interface).
[0035] The storage of the print data generation device 10 has a printer driver installed that includes one embodiment of the barcode determination program of the present invention. When the printer driver is started by the CPU, the functions of the barcode area information acquisition unit 11, determination unit 12, and image processing unit 13 described above are executed.
[0036] Furthermore, some or all of the functions performed by the barcode recognition program may be configured using hardware such as ASCI (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array), or other electrical circuits.
[0037] The printing device 20 performs printing based on the print data output from the print data generation device 10. The printing device 20 includes an inkjet head having multiple nozzles for ejecting ink and a transport mechanism for transporting the printing medium.
[0038] The inkjet head has an inkjet head that ejects C (cyan), M (magenta), Y (yellow), and K (black) inks. The inkjet head may be configured as a line head with multiple inkjet heads arranged in a direction perpendicular to the transport direction of the printing medium, or as a serial head with inkjet heads that scan in a direction perpendicular to the transport direction of the printing medium.
[0039] The conveying mechanism includes, for example, conveying rollers and conveying belts, and the direction in which the printing medium is conveyed by the conveying mechanism is the paper feeding direction described above.
[0040] Furthermore, when printing barcodes, the printing device 20 may print using K ink, or it may print using composite K, which represents K using C, M, and Y.
[0041] Next, the processing flow of the printing system 1 of this embodiment will be explained with reference to the flowchart shown in Figure 4.
[0042] First, image data including a barcode is generated by the editing application of the print data generation device 10 (S10). The image data including the barcode is displayed on the display unit 14 of the print data generation device 10.
[0043] The user then checks the barcodes included in the image data displayed on the display unit 14 and specifies the barcode area by enclosing the barcodes in a rectangular area using the input unit 15 (S12). Figure 5 is an example of image data containing two barcodes. In the case of the image data shown in Figure 5, areas R1 and R2 are specified as barcode areas. The paper feeding direction is set to the direction of the arrow shown in Figure 4. The barcode in area R1 is a vertical one-dimensional barcode, and the barcode in area R2 is a two-dimensional barcode. The information of the designated barcode area is acquired by the barcode area information acquisition unit 11.
[0044] Next, the discrimination unit 12 determines the type of barcode based on the barcode area acquired by the barcode area information acquisition unit 11. Specifically, the discrimination unit 12 first calculates the ratio of the width to the height of the barcode area and determines whether width / height > threshold or height / width > threshold (S14). The threshold is set in advance, for example, "1.2".
[0045] Then, if the ratio of the width to height of the barcode area is width / height > threshold or height / width > threshold (S14, YES), the discrimination unit 12 identifies the longer side of the barcode area and determines whether the extension direction of that longer side and the paper feeding direction are the same (S16).
[0046] Then, if the direction of the long side of the barcode area and the direction of paper feeding are the same (S16, YES), the discrimination unit 12 determines that it is a horizontal one-dimensional barcode, and the image processing unit 13 performs image processing on the image data within the barcode area for a horizontal one-dimensional barcode (S18). On the other hand, if the direction of the long side of the barcode area and the direction of paper feeding are different (orthogonal) (S16, NO), it determines that it is a vertical one-dimensional barcode, and the image processing unit 13 performs image processing on the image data within the barcode area for a vertical one-dimensional barcode (S20).
[0047] On the other hand, in S14, if the ratio of the width to height of the barcode area is not width / height > threshold or height / width > threshold (S14, NO), then column image data with a width of 1 pixel passing through the center of the horizontal side of the barcode area and parallel to the vertical side, and row image data with a width of 1 pixel passing through the center of the vertical side of the barcode area and parallel to the horizontal side are obtained (S22). Figure 6 shows an example of column image data CD and row image data LD.
[0048] The discrimination unit 12 then determines whether the number of changes from white pixels to black pixels and from black pixels to white pixels in either the column image data CD or the row image data LD is less than or equal to a threshold (for example, 5 times) (S24). If the number of changes between white pixels and black pixels in either the column image data CD or the row image data LD is not less than or equal to the threshold (S24, NO), the discrimination unit 12 determines that it is a two-dimensional barcode, and the image processing unit 13 performs image processing for a two-dimensional barcode on the image data within the barcode area (S26). In this embodiment, the determination of whether or not it is a two-dimensional barcode is made based on the number of changes between white pixels and black pixels, but for example, if the barcode area does not contain text such as numbers and only contains an image of a graphic pattern, the determination of whether or not it is a two-dimensional barcode may be made by determining whether either the column image data CD or the row image data LD consists entirely of black pixel data or entirely of white pixel data.
[0049] On the other hand, if the column image data CD and row image data LD have a number of changes between white and black pixels that is less than or equal to a threshold (S24, YES), the discrimination unit 12 further determines whether the data with a number of changes between white and black pixels that is less than or equal to a threshold is either the column image data CD or the row image data LD (S28). If the column image data CD or row image data LD with a number of changes between white and black pixels that is less than or equal to a threshold is the same as the paper feeding direction (S28, YES), the discrimination unit 12 determines that it is a vertical one-dimensional barcode, and the image processing unit 13 performs image processing on the image data within the barcode area for a vertical one-dimensional barcode (S30). On the other hand, if the column image data CD or row image data LD with a number of changes between white and black pixels that is less than or equal to a threshold is different from the paper feeding direction (S28, NO), the discrimination unit 12 determines that it is a horizontal one-dimensional barcode, and the image processing unit 13 performs image processing on the image data within the barcode area for a horizontal one-dimensional barcode (S32).
[0050] Then, after other image processing is performed on the entire image data in the image processing unit 13, the processed image data is output as print data from the print data generation device 10 to the printing device 20 (S34). At this time, the paper feeding direction set in the print data generation device 10 is also output to the printing device 20.
[0051] The printing device 20 controls the transport mechanism based on the input paper feeding direction to transport the printing medium, and controls the inkjet head based on the input print data to perform the printing process (S36), thereby generating a printed document including a barcode.
[0052] According to the printing system 1 of the above embodiment, information of the barcode area is acquired, the type of barcode is determined based on the paper feeding direction of the printing medium on which the barcode is printed in the printing device 20 and the ratio of the width and height of the barcode area, and the image processing applied to the barcode image data is switched according to the type of barcode. As a result, the type of barcode can be determined with relatively low processing load, and the barcode reading rank can be improved.
[0053] Furthermore, in the printing system 1 of the above embodiment, since it is configured to distinguish between horizontal one-dimensional barcodes where the paper feeding direction and the long side direction of the barcode area coincide, and vertical one-dimensional barcodes where the paper feeding direction and the long side direction of the barcode are perpendicular, the orientation of the one-dimensional barcode can be determined by a simple process, and more appropriate image processing can be performed.
[0054] Furthermore, in the printing system 1 of the above embodiment, since it is configured to distinguish between one-dimensional barcodes and two-dimensional barcodes, more appropriate image processing can be performed.
[0055] Furthermore, in the printing system 1 of the above embodiment, a two-dimensional barcode is determined to exist when the ratio of the width to height of the barcode area is below a preset threshold, and both the column image data CD and the row image data LD contain no white pixels and do not contain all black pixels. Therefore, two-dimensional barcodes can be determined with simpler processing.
[0056] Furthermore, in the printing system 1 of the above embodiment, image processing is applied to make the density lighter when the barcode is a vertical one-dimensional barcode compared to when it is a horizontal one-dimensional barcode. This allows for more appropriate image processing to be applied to vertical one-dimensional barcodes, which are more susceptible to blurring, thereby improving the readability rank.
[0057] In the above embodiment, the printer driver of the print data generation device 10 performs image processing on the barcode area image data. However, this is not limited to this. For example, if the print data generation device 10 outputs vector data, including PostScript data, as print data to the printing device 20, and the printing device 20 performs RIP (Raster Image Processor) processing to expand it, the printing device 20 may perform image processing on the barcode area image data. In this case, the barcode area information is also output from the print data generation device 10 to the printing device 20.
[0058] In other words, the image processing unit in the barcode determination device of the present invention may be provided on the printing device 20 side.
[0059] Furthermore, the present invention is not limited to the embodiments described above, and the components can be modified and implemented in practice without departing from the spirit of the invention. Also, various inventions can be formed by appropriate combinations of the multiple components disclosed in the embodiments. For example, all the components shown in the embodiments may be combined as appropriate. It goes without saying that various modifications and applications are possible without departing from the spirit of the invention.
[0060] The following further notes are disclosed regarding the present invention.
[0061] (Note 1) The barcode determination device of the present invention comprises a barcode area information acquisition unit that acquires information about the barcode area, a determination unit that determines the type of barcode based on the paper feeding direction in the printing section of the printing medium on which the barcode is printed and the ratio of the width and height of the barcode area, and an image processing unit that switches the image processing applied to the barcode image data according to the type of barcode.
[0062] (Note 2) In the barcode determination device described in Appendix 1, the determination unit can determine a two-dimensional barcode based on orthogonal 1-pixel wide column image data and row image data of the barcode area if the ratio of the long side to the short side of the barcode area is less than or equal to a preset threshold.
[0063] (Note 3) In the barcode determination device described in Appendix 1 or 2, the determination unit can distinguish between a vertical one-dimensional barcode where the paper feeding direction and the extension direction of the barcode bars coincide, and a horizontal one-dimensional barcode where the paper feeding direction and the extension direction of the barcode bars are perpendicular to each other.
[0064] (Note 4) In the barcode determination device described in Appendix 1 or 2, the determination unit can distinguish between one-dimensional barcodes and two-dimensional barcodes.
[0065] (Note 5) In the barcode determination device described in Appendix 3, the image processing unit can perform image processing to reduce the density of a barcode when it is a horizontal one-dimensional barcode compared to when it is a vertical one-dimensional barcode.
[0066] (Note 6) The printing system of the present invention comprises a barcode determination device as described in any one of appendices 1 to 5, and a printing device that transports a printing medium based on the paper feeding direction and performs printing on the printing medium based on image data processed by an image processing unit.
[0067] (Note 7) The barcode determination method of the present invention acquires information about the barcode area, determines the type of barcode based on the paper feeding direction in the printing area of the printing medium on which the barcode is printed and the ratio of the width and height of the barcode area, and switches the image processing applied to the barcode image data according to the type of barcode.
[0068] (Note 8) The barcode determination program of the present invention causes a computer to perform the following steps: acquire information about the barcode area; determine the type of barcode based on the paper feeding direction in the printing area of the printing medium on which the barcode is printed and the ratio of the width and height of the barcode area; and switch the image processing applied to the barcode image data according to the type of barcode. [Explanation of Symbols]
[0069] 1. Printing System 10 Print data generation device 11. Barcode area information acquisition unit 12 Discrimination part 13 Image Processing Unit 14 Display section 15 Input section 20 Printing device CD column image data LD row image data R1, R2 barcode area
Claims
1. A barcode area information acquisition unit that acquires information about the barcode area, A discrimination unit that determines the type of barcode based on the paper feeding direction in the printing area of the printing medium on which the barcode is printed and the ratio of the width and height of the barcode area, A barcode discrimination device comprising an image processing unit that switches the image processing applied to the barcode image data according to the type of barcode.
2. The barcode discrimination device according to claim 1, wherein the discrimination unit determines a two-dimensional barcode based on orthogonal 1-pixel wide column image data and row image data of the barcode area when the ratio of the width to height of the barcode area is less than or equal to a preset threshold.
3. The barcode discrimination device according to claim 1 or 2, wherein the discrimination unit distinguishes between a horizontal one-dimensional barcode where the paper feeding direction and the long side direction of the barcode area coincide, and a vertical one-dimensional barcode where the paper feeding direction and the long side direction of the barcode area are perpendicular to each other.
4. The barcode discrimination device according to claim 1 or 2, wherein the discrimination unit distinguishes between a one-dimensional barcode and a two-dimensional barcode.
5. The barcode discrimination device according to claim 3, wherein the image processing unit performs image processing to reduce the density of the barcode when it is a horizontal one-dimensional barcode compared to when it is a vertical one-dimensional barcode.
6. A barcode discrimination device according to any one of claims 1 to 5, A printing system comprising a printing device that transports a printing medium based on the aforementioned paper feeding direction and performs a printing process on the printing medium based on image data processed by the image processing unit.
7. Retrieve information from the barcode area, Based on the paper feeding direction in the printing area of the printing medium on which the barcode is printed and the ratio of the width and height of the barcode area, the type of barcode is determined. A barcode identification method that switches the image processing applied to the barcode image data according to the type of barcode.
8. Steps to obtain information from the barcode area, A step of determining the type of barcode based on the paper feeding direction in the printing area of the printing medium on which the barcode is printed and the ratio of the width and height of the barcode area, A barcode recognition program that causes a computer to perform the steps of switching the image processing applied to the barcode image data according to the type of barcode.
Citation Information
Patent Citations
Barcode printing system and its control method
JP1998055401A