IMAGE PROCESSING APPARATUS, IMAGE PROCESSING METHOD, AND IMAGE PROCESSING PROGRAM

The image processing device and method address the limitation of existing systems by inspecting barcode appearance across the entire bar area, not just the predefined defect detection area, thereby ensuring accurate detection of scratches and chips.

JP7658211B2Active Publication Date: 2025-04-08OMRON CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2021130264
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2021-08-06
Publication Date
2025-04-08
Estimated Expiration
2041-08-06

AI Technical Summary

Technical Problem

Existing barcode inspection systems fail to detect scratches and chips occurring outside the predefined defect detection area, leading to false negatives and incomplete assessment of barcode appearance.

Method used

An image processing device and method that identifies bar areas in captured images, determines an inspection area by enlarging the bar area, extracts partial regions with features corresponding to bars, calculates the longitudinal length of these regions, and determines the barcode appearance as defective if the minimum length falls below a threshold.

Benefits of technology

Enables comprehensive inspection of barcode appearance regardless of the location of scratches or chips, ensuring accurate detection and assessment of barcode defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007658211000001
    Figure 0007658211000001
  • Figure 0007658211000002
    Figure 0007658211000002
  • Figure 0007658211000003
    Figure 0007658211000003
Patent Text Reader

Abstract

To provide a technique that can inspect the appearance of a bar code regardless of the place of occurrence of blurring or chipping.SOLUTION: An image processing apparatus 100 comprises: a receiving unit that receives a picked-up image obtained by picking up an image of a bar code C; a specification unit that specifies a bar area corresponding to a plurality of bars B in the picked-up image; a decision unit that decides an inspection target area based on the bar area; an extraction unit that extracts, from the inspection target area, one or more partial areas composed of pixels having characteristics corresponding to the plurality of bars B; a calculation unit that calculates the length in a longitudinal direction of each of the extracted one or more partial areas; and a determination unit that, when the minimum value of the length is less than a threshold, determines that the appearance of the bar code C is defective.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present disclosure relates to an image processing device, an image processing method, and an image processing program. [Background technology]

[0002] Japanese Patent Application Laid-Open Publication No. 2013-40895 (Patent Document 1) discloses an inspection system for inspecting the appearance of a barcode. The inspection system sets a defect detection area in an image of a barcode, and identifies a blurred or chipped area (defective area) based on a change in density value in the defect detection area. The inspection system determines that the appearance of the barcode is defective if the defective area is equal to or larger than a predetermined area. [Prior art documents] [Patent documents]

[0003] [Patent Document 1] JP 2013-40895 A Summary of the Invention [Problem to be solved by the invention]

[0004] The smears and chipping may occur at the longitudinal tip of the bar. In the above-mentioned inspection system, in order to prevent erroneous detection of the edge, the defect detection area is set to an area obtained by reducing the area of ​​the barcode by a predetermined amount in the longitudinal direction of the bar. Therefore, the above-mentioned inspection system does not detect smears and chipping that occur in areas outside the defect detection area. Since smears and chipping that occur in areas outside the defect detection area may impair the appearance of the barcode, a technology is required that can inspect the appearance of the barcode regardless of where the smears and chipping occur.

[0005] An object of the present disclosure is to provide an image processing device, an image processing method, and an image processing program capable of inspecting the appearance of a barcode regardless of where smudges or chipping occurs. [Means for solving the problem]

[0006] An image processing device according to one aspect of the present disclosure includes a receiving unit that receives an image of a barcode including a plurality of bars, a determination unit that identifies a bar region corresponding to the plurality of bars in the captured image, a determination unit that determines an inspection target region based on the bar region, an extraction unit that extracts at least one partial region composed of pixels having characteristics corresponding to the plurality of bars from the inspection target region, a calculation unit that calculates the longitudinal length of each of the at least one extracted partial region, and a determination unit that determines that the appearance of the barcode is poor if the minimum value of the lengths is less than a threshold value.

[0007] This makes it possible to inspect the appearance of the barcode regardless of where the smudges or chips occur.

[0008] In the above disclosure, the inspection target area is preferably an area obtained by expanding the bar area by a predetermined width in all directions.

[0009] This makes it possible to include the tip of the bar in the region extracted as the partial region.

[0010] In the above disclosure, the image processing device preferably further includes a first setting section which sets the predetermined width based on an input operation by a user.

[0011] This makes it possible for the user to change the predetermined width.

[0012] In the above disclosure, the image processing device preferably further includes a second setting section which sets the threshold value based on an input operation by a user.

[0013] This makes it possible for the user to change the threshold value.

[0014] In the above disclosure, preferably, the receiving unit further receives a reference image of the barcode. The image processing device further includes a second setting unit configured to set the threshold value based on a minimum value of a longitudinal length of at least one partial region of the reference image.

[0015] This eliminates the need for the user to determine the threshold value, improving user convenience.

[0016] In another aspect of the present disclosure, an image processing method executed by a computer includes receiving an image of a barcode including a plurality of bars, identifying a bar region in the captured image corresponding to the plurality of bars, determining an inspection target area based on the bar region, extracting at least one partial area from the inspection target area composed of pixels having characteristics corresponding to the plurality of bars, calculating a longitudinal length of each of the at least one extracted partial area, and determining that the appearance of the barcode is poor if the minimum value of the lengths is less than a threshold value.

[0017] This makes it possible to inspect the appearance of the barcode regardless of where the smudges or chips occur.

[0018] In another aspect of the present disclosure, an image processing program causes a computer to execute the image processing method described above.

[0019] This makes it possible to inspect the appearance of the barcode regardless of where the smudges or chips occur. Effect of the Invention

[0020] According to the present disclosure, it is possible to provide an image processing device, an image processing method, and an image processing program capable of inspecting the appearance of a barcode regardless of where smudges or chipping occurs. [Brief description of the drawings]

[0021] [Figure 1] 1 is a schematic diagram showing an overall configuration of an image processing system including an image processing device according to an embodiment of the present invention. [Diagram 2] 1 is a block diagram showing a main hardware configuration of an image processing device according to an embodiment of the present invention; [Diagram 3] FIG. 2 is a block diagram showing an example of functions realized by the image processing device according to the present embodiment. [Figure 4] FIG. 13 is a diagram showing a method for specifying a bar region. [Diagram 5] FIG. [Figure 6] FIG. 13 is a diagram showing an example of a binarization level setting screen. [Figure 7] FIG. 13 is a diagram showing an example of a partial region and its vertical width. [Figure 8] FIG. 13 is a diagram showing an example of a margin width setting screen. [Figure 9] FIG. 13 is a diagram showing an example of a vertical width threshold setting screen. [Figure 10] FIG. 2 is a diagram illustrating an example of processing executed by the image processing device according to the present embodiment. [Figure 11] FIG. 11 is a diagram showing an example of an output form of the inspection result. [Figure 12] FIG. 11 is a diagram showing an example of a process in which one image is used as a correct image of a barcode. [Figure 13] 11A and 11B are diagrams illustrating an example of processing when a plurality of images are used as correct images of a barcode. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0022] Hereinafter, an embodiment according to the present invention will be described with reference to the drawings. In the following description, the same parts and components are given the same reference numerals. Their names and functions are also the same. Therefore, detailed description thereof will not be repeated. Note that the embodiments and modifications described below may be appropriately and selectively combined.

[0023] [Example of application] An application example of the present invention will be described with reference to Fig. 1. In this application example, an image processing device that executes an image processing program for inspecting the appearance of a barcode will be described.

[0024] Generally, barcodes are printed on various media (such as labels attached to product packaging). As a result, printing defects can cause the barcode to become smudged or chipped. In such cases, the appearance of the barcode becomes an issue, in addition to the readability of the barcode (whether it can be read by a barcode reader).

[0025] This is because if the appearance of the barcode is poor, it will cause anxiety to the user. Even if there is no problem with the readability of the barcode, there are many cases where products with poor appearance are returned. Therefore, it is necessary to inspect the appearance of the barcode.

[0026] 1 is a schematic diagram showing the overall configuration of an image processing system including an image processing device according to the present embodiment. The image processing system 1 includes an image processing device 100, an imaging device 500, an input device 600, and an output device 700. The imaging device 500, the input device 600, and the output device 700 are connected to the image processing device 100.

[0027] The imaging device 500 includes, for example, an imaging element partitioned into a plurality of pixels, such as a CCD (Coupled Charged Device) or a CMOS (Complementary Metal Oxide Semiconductor) sensor, in addition to an optical system such as a lens. The imaging device 500 captures an image of a barcode C including a plurality of bars B, and transmits image data acquired by the image capture (hereinafter also referred to as a "captured image") to the image processing device 100. In the example shown in FIG. 1, the barcode C is printed on a label L.

[0028] The image processing device 100 inspects the appearance of the barcode C by performing image processing on the captured image received from the imaging device 500. In detail, the image processing device 100 calculates the length of each bar B in the longitudinal direction (hereinafter also referred to as "vertical width" or "vertical width W") based on the captured image received from the imaging device 500. If a bar that should be a single bar is divided into several pieces due to smudges or chipping, the image processing device 100 calculates the vertical width W for each of the divided pieces. If the minimum value of the calculated vertical widths W is less than a threshold value, the image processing device 100 determines that the appearance of the barcode C is defective.

[0029] If the bar B is smudged or chipped, the vertical width W of the bar B will be shorter than the original vertical width regardless of where the smudge or chipping occurs. Therefore, the image processing device 100 can inspect the appearance of the barcode regardless of where the smudge or chipping occurs.

[0030] The input device 600 includes at least one of a mouse, a keyboard, and a touch panel, and receives operations for the image processing device 100. The output device 700 includes a liquid crystal display, an organic EL (Electro Luminescence) display, etc., and displays various information. Note that the output device 700 may further include an indicator and a speaker in addition to the display.

[0031] The image processing system 1 may further include an illumination device that irradiates the barcode C imaged by the imaging device 500 with light.

[0032] (Hardware configuration of image processing device) The hardware configuration of the image processing device 100 will be described with reference to Fig. 2. Fig. 2 is a block diagram showing the main hardware configuration of the image processing device in this embodiment. The image processing device 100 includes a processor 101, a main memory 102, a communication interface 103, a camera interface 104, an input interface 105, an output interface 106, a memory card interface 107, and a storage device 120. These components are connected to each other via an internal bus 119 so as to be able to communicate with each other.

[0033] The processor 101 is, for example, configured with at least one integrated circuit. The integrated circuit is, for example, configured with at least one central processing unit (CPU), at least one application specific integrated circuit (ASIC), at least one field programmable gate array (FPGA), or a combination thereof.

[0034] The processor 101 realizes various processes according to the present embodiment by expanding the program 122 stored in the storage device 120 into the main memory 102 and executing it. The main memory 102 is composed of a volatile memory, and functions as a work memory required for the processor 101 to execute the program.

[0035] The communication interface 103 transmits and receives data and signals to and from external devices via the network.

[0036] Camera interface 104 corresponds to a “reception unit” that receives a captured image of a barcode including multiple bars from imaging device 500, and mediates data transmission between processor 101 and imaging device 500. In detail, when camera interface 104 receives a captured image from imaging device 500, it outputs the captured image to processor 101.

[0037] The input interface 105 mediates data transmission between the processor 101 and the input device 600. In other words, the input interface 105 accepts operation commands given by the user operating the input device 600.

[0038] The output interface 106 is connected to an output device 700, and outputs signals for outputting various types of information to the output device 700 in accordance with commands from the processor 101.

[0039] The memory card interface 107 mediates data transmission between the processor 101 and the memory card 107A. The memory card 107A includes a general-purpose semiconductor storage device such as a Secure Digital (SD), a magnetic recording medium such as a flexible disk, and an optical recording medium such as a compact disk read only memory (CD-ROM).

[0040] The storage device 120 is, for example, a hard disk. As an example, the storage device 120 includes a program 122 for implementing various processes according to the present embodiment, and various setting information 124.

[0041] The program 122 is provided by being stored in a storage medium such as the memory card 107A. The program 122 is read from the memory card 107A by the memory card interface 107 and installed in the image processing device 100.

[0042] The program 122 may be provided not as a standalone program but as part of an arbitrary program. In this case, the program 122 cooperates with the arbitrary program to realize the processing according to the present embodiment. Even if the program does not include some of the modules, it does not deviate from the spirit of the image processing device 100 according to the present embodiment. In addition, some or all of the functions provided by the program 122 may be realized by dedicated hardware.

[0043] Furthermore, instead of installing the program 122 stored in the memory card 107A in the image processing device 100, a program downloaded from a distribution server or the like via the communication interface 103 may be installed in the image processing device 100.

[0044] The setting information 124 includes a margin width, a threshold value for the vertical width of a bar, etc., which will be described later. In the following, the storing of the margin width, the threshold value for the vertical width of a bar, etc., in the storage device 120 as the setting information 124 will be expressed as "being set."

[0045] (Image processing device functions) Functions realized by the image processing device 100 will be described with reference to Fig. 3. Fig. 3 is a block diagram showing an example of functions realized by the image processing device in this embodiment. In this embodiment, the image processing device 100 realizes a reception unit 131, a specification unit 132, a determination unit 133, an extraction unit 134, a calculation unit 135, a determination unit 136, a first setting unit 137, and a second setting unit 138.

[0046] The reception unit 131 is realized by the camera interface 104 shown in Fig. 2. The reception unit 131 receives, from the imaging device 500, a captured image of a barcode including a plurality of bars.

[0047] The identifying unit 132 , the deciding unit 133 , the extracting unit 134 , the calculating unit 135 , the judging unit 136 , the first setting unit 137 , and the second setting unit 138 are realized by the processor 101 executing the program 122 .

[0048] The identification unit 132 identifies a bar region in the captured image accepted by the acceptance unit 131. A barcode may include numbers in addition to a plurality of bars. The bar region is an area that corresponds to the plurality of bars in a barcode.

[0049] Here, a method for specifying a bar region will be described with reference to Fig. 4. Fig. 4 is a diagram showing the method for specifying a bar region. A screen G1 is displayed on the output device 700 (see Fig. 1). The screen G1 includes a field 41 in which a captured image I acquired by the imaging device 500 (see Fig. 1) is displayed, and an input field 42 for inputting the approximate position of a barcode in the captured image I. In the example shown in Fig. 4, the captured image I includes an image of a barcode C (see Fig. 1) and an image of a label L (see Fig. 1) on which the barcode C is printed.

[0050] The user inputs the approximate position of the barcode by dragging the four vertices K1 to K4 of the area AR using an input device 600 such as a mouse (see FIG. 1). The coordinates of the vertices K1 and K3 are displayed in the input field 42. The user may input the approximate position of the barcode by inputting a numerical value in the input field 42. The input device 600 is used for inputting into the input field 42. The identification unit 132 (see FIG. 3) identifies the bar area P by performing image processing on the area AR using a known technique. It is not necessary to input the approximate position of the barcode. In that case, the identification unit 132 identifies the bar area P by performing image processing on the entire captured image I using a known technique.

[0051] 3 again, the determining unit 133 determines the inspection target area based on the bar area identified by the identifying unit 132. As an example, the determining unit 133 determines an area obtained by expanding the bar area by a predetermined width in the up, down, left, and right directions as the inspection target area. The predetermined width is stored in the storage device 120 as a margin width, which is one of the setting information 124. The predetermined width may be specified by the number of pixels (e.g., 10 pixels, etc.) or may be specified by a ratio to the bar area (e.g., 1.1 times, etc.).

[0052] Here, the inspection target area will be described with reference to Fig. 5. Fig. 5 is a diagram showing the inspection target area. The bar area P is indicated by the coordinates of four vertices E1 to E4. The inspection target area Q is indicated by the coordinates of four vertices F1 to F4. The inspection target area Q is an area obtained by expanding the bar area P in the up, down, left, and right directions by a predetermined width TH. In the following description, the arrangement direction of the multiple bars is defined as the X direction, and the direction perpendicular to the arrangement direction of the multiple bars in the captured image I is defined as the Y direction.

[0053] As an example, assume that 10 pixels are set as the predetermined width. In that case, the determination unit 133 (see FIG. 3) sets the X coordinate value of the vertex F1 to a value obtained by subtracting 10 pixels from the X coordinate value of the vertex E1, and sets the Y coordinate value of the vertex F1 to a value obtained by adding 10 pixels to the Y coordinate value of the vertex E1. The determination unit 133 also sets the X coordinate value of the vertex F2 to a value obtained by subtracting 10 pixels from the X coordinate value of the vertex E2, and sets the Y coordinate value of the vertex F2 to a value obtained by subtracting 10 pixels from the Y coordinate value of the vertex E2. The determination unit 133 also sets the X coordinate value of the vertex F3 to a value obtained by adding 10 pixels to the X coordinate value of the vertex E3, and sets the Y coordinate value of the vertex F3 to a value obtained by subtracting 10 pixels from the Y coordinate value of the vertex E3. In addition, the determination unit 133 sets the X coordinate value of vertex F4 to the X coordinate value of vertex E4 plus 10 pixels, and sets the Y coordinate value of vertex F4 to the Y coordinate value of vertex E4 plus 10 pixels.

[0054] In addition, when the specified width TH is specified in terms of the number of pixels, the specified width TH1 in the upward direction, the specified width TH3 in the downward direction, the specified width TH2 in the leftward direction, and the specified width TH4 in the rightward direction may be equal to each other, or at least one of them may be a different value.

[0055] Referring again to FIG. 3, the extraction unit 134 extracts at least one partial region consisting of pixels having a characteristic corresponding to the plurality of bars from the inspection target region. The characteristic corresponding to the plurality of bars is a characteristic of reflected light of the plurality of bars, more specifically, a color, a density (brightness), or the like. As an example, the extraction unit 134 extracts at least one partial region consisting of pixels having a color corresponding to the plurality of bars from the inspection target region. As another example, the extraction unit 134 extracts at least one partial region consisting of pixels having a density corresponding to the plurality of bars from the inspection target region. The processing by the extraction unit 134 corresponds to a labeling process in so-called image processing. The extraction unit 134 binarizes the inspection target region at a predetermined binarization level, and then extracts the partial region based on the density value. In detail, the extraction unit 134 binarizes the inspection target region at a predetermined binarization level, thereby extracting a group of pixels classified as black as one partial region. The binarization level indicates a range of density values ​​of pixels classified as black. The binarization level is set so that pixels constituting an image of bars, that is, pixels having a color corresponding to multiple bars or pixels having a density corresponding to multiple bars, are classified as black.

[0056] As a result, regions corresponding to each bar are extracted as partial regions by the extraction unit 134. Note that if a bar that should originally be a single bar is divided into multiple parts due to smudges or chipping, each of the divided parts is extracted as one partial region.

[0057] Here, the setting of the binarization level will be described with reference to FIG. 6. FIG. 6 is a diagram showing an example of a binarization level setting screen. Screen G2 is an example of a binarization level setting screen. Screen G2 is displayed on output device 700 (see FIG. 1). Screen G2 includes an input field 61 for inputting the binarization level, and a button 62. In input field 61, a range of density values ​​of pixels classified as black is input as the binarization level. When a user inputs a numerical value in input field 61 and presses button 62, processor 101 (see FIG. 2) sets the numerical value input in input field 61 as the binarization level. When the values ​​shown in FIG. 6 are set as the binarization level, extraction unit 134 (see FIG. 3) classifies pixels with density values ​​of 0 to 159 as black.

[0058] Generally, the color of the bar is black, but the darkness of the black varies according to the color of the label the barcode is printed on. Therefore, by adjusting the value entered in entry field 61, it is possible to set the pixels that make up the image of the bar to be classified as black.

[0059] 3, calculation unit 135 calculates the length in the longitudinal direction (vertical width) of at least one partial region extracted by extraction unit 134. This calculates the vertical width of the bar. If a bar that should be a single piece is divided into multiple pieces due to smudges or chipping, the vertical width of each of the divided pieces is calculated.

[0060] The determining unit 136 determines that the appearance of the barcode is defective when the minimum value of the vertical width calculated by the calculating unit 135 is less than a threshold value. The threshold value is stored in the storage device 120 as the setting information 124.

[0061] Here, the determination method by the determination unit 136 will be described with reference to Fig. 7. Fig. 7 is a diagram showing an example of partial regions and their vertical widths. For convenience of illustration, Fig. 7 shows only partial regions R1-R4 corresponding to bars B1-B4 out of the multiple partial regions R, but in reality, regions corresponding to each of the bars B are extracted as partial regions R by processing by the extraction unit 134 (see Fig. 3).

[0062] Bars B1 and B2 are examples of a bar that should be a single bar but is divided into multiple bars due to smudges or chipping. Partial region R2 corresponding to bar B2 is an example of a partial region having the shortest vertical width W among partial regions R extracted by extraction unit 134. In this example, the vertical width W of partial region R1 calculated by calculation unit 135 (see FIG. 3) is 60 pixels, and the vertical width W of partial region R2 calculated by calculation unit 135 is 20 pixels.

[0063] Bar B3 is an example of a bar with a missing tip. In this example, the vertical width W of partial region R3 calculated by calculation unit 135 is 89 pixels.

[0064] Bar B4 is an example of a case where no blurring or chipping occurs. In this example, the vertical width W calculated by calculation unit 135 for each of the partial regions R, excluding partial regions R1, R2, and R3, is 100 pixels.

[0065] In this example, the smallest value of the vertical width W for each partial region R calculated by calculation unit 135 is the vertical width W of partial region R2, which is 20 pixels. If 90 pixels were set as the threshold value for the vertical width W, the minimum value of the vertical width W calculated by calculation unit 135 (20 pixels) would be less than the threshold value for the vertical width W (90 pixels), and therefore determination unit 136 (see FIG. 3) would determine that the appearance of the barcode is defective.

[0066] 3 again, the first setting unit 137 sets the predetermined width based on an input operation by the user. In detail, the first setting unit 137 stores a value (predetermined width) input from the input device 600 as the margin width in the storage device 120. Note that the image processing device 100 does not need to include the first setting unit 137, and in that case, it is assumed that a value (predetermined width) previously determined as the margin width is stored in the storage device 120.

[0067] Here, a method for setting the margin width will be described with reference to Fig. 8. Fig. 8 is a diagram showing an example of a margin width setting screen. Screen G3 is an example of a margin width setting screen. Screen G3 is displayed on output device 700 (see Fig. 1). Screen G3 includes an input field 81 for inputting a value (predetermined width), and a button 82. When the user inputs a value in input field 81 and presses button 82, processor 101 (see Fig. 2) saves the value input in input field 81 as the margin width in storage device 120 (see Fig. 3).

[0068] 3, the second setting unit 138 sets the vertical width threshold value based on an input operation by the user. As an example, the second setting unit 138 stores a value input from the input device 600 in the storage device 120 as the vertical width threshold value.

[0069] Here, a method for setting the vertical width threshold will be described with reference to Fig. 9. Fig. 9 is a diagram showing an example of a vertical width threshold setting screen. Screen G4 is an example of a vertical width threshold setting screen. Screen G4 is displayed on output device 700 (see Fig. 1). Screen G4 includes an input field 91 for inputting a value, and a button 92. When the user inputs a value in input field 91 and presses button 92, processor 101 (see Fig. 2) saves the value input in input field 91 as the vertical width threshold in storage device 120 (see Fig. 3).

[0070] 3 again, as another example, the second setting unit 138 may set the threshold value of the vertical width based on a correct image of the barcode. The correct image of the barcode is acquired by imaging device 500 capturing an image of a correctly printed barcode, and is accepted by the accepting unit 131. Details will be described later.

[0071] It should be noted that the image processing device 100 does not necessarily have to include the second setting unit 138. In that case, it is assumed that a predetermined value is stored in the storage device 120 as the threshold value of the vertical width.

[0072] (Processing performed by the image processing device) The process executed by the image processing device 100 will be described with reference to Fig. 10. Fig. 10 is a diagram showing an example of the process executed by the image processing device in this embodiment. The process shown in Fig. 10 is realized by the processor 101 shown in Fig. 2 executing the program 122 (see Fig. 2).

[0073] In step S1, the processor 101 receives a captured image of a barcode including a plurality of bars from the imaging device 500 (see FIG. 2) via the camera interface 104 (see FIG. 2).

[0074] In step S2, the processor 101 identifies a bar region in the captured image. The process of step S2 is executed by the identification unit 132 (see FIG. 3).

[0075] In step S3, the processor 101 determines an inspection target region based on the bar region. The process of step S3 is executed by the determination unit 133 (see FIG. 3).

[0076] In step S4, the processor 101 extracts at least one partial region consisting of pixels having characteristics corresponding to a plurality of bars from the inspection target region. The process of step S4 is a so-called labeling process in image processing. The process of step S4 is executed by the extraction unit 134 (see FIG. 3).

[0077] In step S5, processor 101 calculates the vertical width of each of the partial regions extracted in step S4. The process of step S5 is executed by calculation unit 135 (see FIG. 3).

[0078] In step S6, processor 101 determines whether the minimum value of the vertical width calculated in step S5 is less than the threshold value. If the minimum value of the vertical width calculated in step S5 is less than the threshold value (YES in step S6), processor 101 shifts the process to step S7. On the other hand, if the minimum value of the vertical width calculated in step S5 is equal to or greater than the threshold value (NO in step S6), processor 101 shifts the process to step S8.

[0079] In step S7, the processor 101 determines that the appearance of the barcode is defective.

[0080] In step S8, processor 101 determines that the appearance of the barcode is good. The processes in steps S6 to S8 are executed by determination unit 136 (see FIG. 3).

[0081] After step S7 or step S8, processor 101 ends the series of processes shown in FIG.

[0082] (Test result output format) Fig. 11 is a diagram showing an example of an output form of the inspection results. Screen G5 is an example of a screen showing the inspection results. Screen G5 is displayed on output device 700 (see Fig. 1). Screen G5 includes a field 11 in which the results of the visual inspection of the barcode are displayed, and a field 12 in which the minimum vertical width calculated in step S5 (see Fig. 10) is displayed. Screen G5 also includes a field 13 in which an image (captured image I) of the barcode acquired by imaging device 500 (see Fig. 1) is displayed.

[0083] The user can know the results of the visual inspection of the barcode from screen G5. The user can also know the minimum vertical width calculated in step S5 (see FIG. 10) from screen G5. The user can know if there are any smudges or chips in the bars by comparing the value displayed in column 12 with the threshold value for the vertical width that was set.

[0084] It is sufficient that screen G5 includes at least field 11. Furthermore, screen G5 may include, in addition to field 11, a field in which a value set as a threshold value for the vertical width of a bar is displayed.

[0085] Also, information indicating bars whose vertical width is less than the threshold value may be further displayed in column 13. This allows the user to know which bars have smudges or chips. Also, information indicating bars whose vertical width is less than the threshold value and the vertical width of the bars may be further displayed in column 13. This allows the user to know which bars have smudges or chips and the vertical width of the bars.

[0086] The test result may be output by voice or by lighting an indicator.

[0087] (How to set the vertical threshold based on the correct barcode image) Among the methods for setting the threshold value, a method for setting the threshold value of the vertical width based on a correct image of a barcode will be described with reference to Figures 12 and 13. The method for setting the threshold value of the vertical width based on a correct image of a barcode is a method for setting the threshold value of the vertical width based on the minimum value of the vertical width of a bar calculated based on the correct image of a barcode. The method will be described separately for the case where one image is used as the correct image of a barcode and the case where multiple images are used.

[0088] Fig. 12 is a diagram showing an example of a process in which one image is used as a correct image of a barcode. The process shown in Fig. 12 is realized by the processor 101 shown in Fig. 2 executing the program 122 (see Fig. 2).

[0089] In step S21, the processor 101 receives one correct image of a barcode from the imaging device 500 (see FIG. 2) via the camera interface 104 (see FIG. 2). The correct image of the barcode is acquired by the imaging device 500 capturing an image of a correctly printed barcode.

[0090] In step S22, the processor 101 identifies a bar region in the correct image. The process of step S22 is executed by the identification unit 132 (see FIG. 3).

[0091] In step S23, the processor 101 determines the inspection target region based on the bar region. The process of step S23 is executed by the determination unit 133 (see FIG. 3).

[0092] In step S24, the processor 101 extracts at least one partial region consisting of pixels having characteristics corresponding to a plurality of bars from the inspection target region. The process of step S24 is a so-called labeling process in image processing. The process of step S24 is executed by the extraction unit 134 (see FIG. 3).

[0093] In step S25, processor 101 calculates the vertical width of each of the partial regions extracted in step S24. The process of step S25 is executed by calculation unit 135 (see FIG. 3).

[0094] In step S26, the processor 101 determines the minimum value of the vertical width calculated in step S25 as the vertical width threshold value.

[0095] In step S27, processor 101 stores the value determined in step S26 in storage device 120 (see FIG. 3) as the vertical width threshold. This completes the setting of the vertical width threshold. The processes in steps S26 and S27 are executed by second setting unit 138 (see FIG. 3).

[0096] After step S27, the processor 101 ends the series of processes shown in FIG.

[0097] Fig. 13 is a diagram showing an example of a process in which a plurality of images are used as a correct image of a barcode. The process shown in Fig. 13 is realized by the processor 101 shown in Fig. 2 executing the program 122 (see Fig. 2).

[0098] In step S31, the processor 101 receives N (N≧2) correct images of a barcode from the imaging device 500 (see FIG. 2) via the camera interface 104 (see FIG. 2). The correct images of the barcode are acquired by the imaging device 500 capturing an image of a correctly printed barcode.

[0099] In step S32, the processor 101 sets a variable n (n≧1) to 1.

[0100] In step S33, the processor 101 identifies a bar region in the n-th correct answer image. The process of step S33 is executed by the identification unit 132 (see FIG. 3).

[0101] In step S34, the processor 101 determines the inspection target region based on the bar region. The process of step S34 is executed by the determination unit 133 (see FIG. 3).

[0102] In step S35, the processor 101 extracts at least one partial region consisting of pixels having characteristics corresponding to a plurality of bars from the inspection target region. The process of step S35 is a so-called labeling process in image processing. The process of step S35 is executed by the extraction unit 134 (see FIG. 3).

[0103] In step S36, processor 101 calculates the vertical width of each of the partial regions extracted in step S35. The process of step S36 is executed by calculation unit 135 (see FIG. 3).

[0104] In step S37, the processor 101 stores the minimum vertical width calculated in step S in the storage device 120 (see FIG. 2) or the main memory 102 (see FIG. 2).

[0105] In step S38, the processor 101 determines whether n is equal to or greater than N. If n is equal to or greater than N (YES in step S38), the processor 101 shifts the process to step S40. On the other hand, if n is less than N (NO in step S38), the processor 101 shifts the process to step S39.

[0106] In step S39, the processor 101 increments n by 1, and returns the process to step S33.

[0107] In step S40, processor 101 determines a height threshold based on the minimum height of each correct image stored in step S37. As one example, processor 101 determines the average value of the minimum height of each correct image stored in step S37 as the height threshold. As another example, processor 101 determines the smallest value among the minimum heights of each correct image stored in step S37 as the height threshold. As another example, processor 101 determines the largest value among the minimum heights of each correct image stored in step S37 as the height threshold.

[0108] In step S41, the processor 101 stores the value determined in step S40 in the storage device 120 (see FIG. 3) as the vertical width threshold. This completes the setting of the vertical width threshold. The processes in steps S37 to S41 are executed by the second setting unit 138 (see FIG. 3).

[0109] After step S41, the processor 101 ends the series of processes shown in FIG.

[0110] In this way, according to this embodiment, the vertical width of each bar is calculated based on an image of a barcode including multiple bars, and the appearance of the barcode is judged based on the minimum value of the calculated vertical widths. If a bar is smudged or chipped, the vertical width of the bar will be shorter than the original vertical width regardless of where the smudge or chipping occurs. Therefore, according to this embodiment, it is possible to inspect the appearance of a barcode regardless of where the smudge or chipping occurs.

[0111] In addition, the inspection target area is determined based on the bar area, which ensures inspection accuracy even if the barcode is misaligned from its intended printing position.

[0112] In the above embodiment, the inspection target area is an area obtained by expanding the bar area by a predetermined width in the up, down, left and right directions, but the inspection target area may be the bar area itself.

[0113] In addition, in the above embodiment, the judgment unit 136 judges that the appearance of the barcode is poor when the minimum value of the vertical width calculated by the calculation unit 135 is less than a threshold value, but the judgment unit 136 may judge that the appearance of the barcode is poor when the minimum value of the vertical width calculated by the calculation unit 135 is equal to or less than the threshold value.

[0114] [Note] The above-described embodiment includes the following technical ideas.

[0115] [Configuration 1] a reception unit (131) for receiving a captured image (I) of a barcode (C) including a plurality of bars (B); An identification unit (132) that identifies a bar region (P) corresponding to the plurality of bars (B) in the captured image (I); A determination unit (133) that determines an inspection target area (Q) based on the bar area (P); an extraction unit (134) for extracting at least one partial region (R) composed of pixels having characteristics corresponding to the plurality of bars (B) from the inspection target region (Q); A calculation unit (135) that calculates the length of each of the at least one extracted partial region (R) in the longitudinal direction; and a determination unit (136) that determines that the appearance of the barcode (C) is defective if the minimum value of the length is less than a threshold value.

[0116] [Configuration 2] 2. The image processing device according to configuration 1, wherein the inspection target area (Q) is an area obtained by expanding the bar area (P) by a predetermined width (TH) in all directions.

[0117] [Configuration 3] 3. The image processing device according to configuration 2, further comprising a first setting unit that sets the predetermined width based on an input operation by a user.

[0118] [Configuration 4] The image processing device according to any one of configurations 1 to 3, further comprising a second setting unit (138) that sets the threshold value based on an input operation by a user.

[0119] [Configuration 5] The reception unit (131) further receives a correct image of the barcode (C), The image processing device (100) according to any one of configurations 1 to 3, further comprising a second setting unit (138) that sets the threshold value based on a minimum value of the length of the at least one partial region (R) of the correct image.

[0120] [Configuration 6] 1. A computer-implemented image processing method, comprising: Receiving a captured image (I) of a barcode (C) including a plurality of bars (B); Identifying a bar region (P) corresponding to the plurality of bars (B) in the captured image (I); determining an inspection area (Q) based on the bar area (P); Extracting at least one partial region (R) consisting of pixels having characteristics corresponding to the plurality of bars (B) from the inspection target region (Q); Calculating the length of each of the at least one extracted partial region (R) in the longitudinal direction; and determining that the appearance of the barcode (C) is poor if the minimum length value is less than a threshold value.

[0121] [Configuration 7] 7. An image processing program for causing a computer to execute the image processing method according to claim 6.

[0122] The embodiments disclosed herein should be considered to be illustrative and not restrictive in all respects. The scope of the present invention is defined by the claims, not the above description, and is intended to include all modifications within the meaning and scope of the claims. [Explanation of symbols]

[0123] 1 image processing system, 100 image processing device, 101 processor, 102 main memory, 103 communication interface, 104 camera interface, 105 input interface, 106 output interface, 107 memory card interface, 107A memory card, 119 internal bus, 120 storage device, 122 program, 124 setting information, 131 reception unit, 132 identification unit, 133 determination unit, 134 extraction unit, 135 calculation unit, 136 judgment unit, 137 first setting unit, 138 second setting unit, 500 imaging device, 600 input device, 700 output device, B, B1, B4 bar, C bar code, G1, G2, G3, G4, G5 screen, I captured image, L label, P bar area, Q inspection target area, R, R1, R2, R3, R4 Partial area, TH, TH1, TH2, TH3, TH4 specified width, W vertical width.

Claims

1. a reception unit that receives an image of a barcode including a plurality of bars; an identification unit that identifies a bar region corresponding to the plurality of bars in the captured image; A determination unit that determines an inspection target area based on the bar area; an extraction unit that extracts at least one partial area configured with pixels having characteristics corresponding to the plurality of bars from the inspection target area; A calculation unit that calculates a length in a longitudinal direction of each of the at least one extracted partial region; and a determination unit that determines that an appearance of the barcode is defective if the minimum length value is less than a threshold value.

2. The image processing apparatus according to claim 1 , wherein the inspection target area is an area obtained by expanding the bar area by a predetermined width in all directions.

3. The image processing device according to claim 2 , further comprising a first setting unit that sets the predetermined width based on an input operation by a user.

4. The image processing device according to any one of claims 1 to 3, further comprising a second setting unit that sets the threshold value based on an input operation by a user.

5. The reception unit further receives a correct image of the barcode, The image processing device according to any one of claims 1 to 3, further comprising a second setting unit configured to set the threshold value based on a minimum value of the length of the at least one partial region of the correct image.

6. 1. A computer-implemented image processing method, comprising: receiving an image of a barcode including a plurality of bars; Identifying a bar region corresponding to the plurality of bars in the captured image; determining an inspection target area based on the bar area; extracting at least one partial region from the inspection area, the partial region being composed of pixels having characteristics corresponding to the plurality of bars; Calculating a length in a longitudinal direction of each of the at least one extracted partial region; determining that the appearance of the barcode is defective if the minimum length is less than a threshold.

7. An image processing program for causing a computer to execute the image processing method according to claim 6.

Citation Information

Patent Citations

  • Visual inspection system

    JP2010054289A

  • Bar code visual inspection system, and bar code visual inspection method

    JP2013040895A