Image processing device and program

The image processing device optically reads the label-side surface to detect line segments, accurately determining the backing sheet and label widths, thereby improving printing precision and reducing errors.

JP2025005693APending Publication Date: 2025-01-17BROTHER KOGYO KK
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2023105969
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-06-28
Publication Date
2025-01-17

AI Technical Summary

Technical Problem

Existing technologies fail to accurately determine the width of a backing sheet carrying a label, which is crucial for proper printing and labeling processes.

Method used

An image processing device that optically reads the label-side surface of a backing sheet to detect line segments, allowing for the identification of the backing sheet width and label width using these detected segments.

Benefits of technology

Enables accurate identification of the backing sheet and label widths, ensuring appropriate printing and reducing the likelihood of errors by preventing ink overflow or improper labeling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025005693000001_ABST
    Figure 2025005693000001_ABST
Patent Text Reader

Abstract

To identify a width relevant to a rear sheet on which a label is mounted.SOLUTION: An image processing device is configured to: acquire a read image obtained by optically reading out a surface of a label side of a rear sheet on which a label is mounted; detect a line segment by using the read image; and execute width identification processing which identifies one or both of a rear sheet width and a label width, by using the detected line segment.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] This disclosure relates to a technique for specifying widths relative to the backing sheet on which the label is placed. [Background technology]

[0002] Various printing media are used for printing. For example, various sizes of paper such as A4 size, letter size, postcard size, etc. are used for printing. A technology has been proposed to prevent an image of a size significantly different from that of the printing paper being printed when a printing paper of a size significantly different from that specified by a user is conveyed. For example, in the technology described in Patent Document 1, a reflective optical sensor is used to detect the width of the printing paper, and candidates for the printing paper size are identified according to the paper width, and printing is restricted if the size of the printing paper set as the print settings is not included in the candidates. [Prior art documents] [Patent documents]

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

[0004] Label-bearing backing sheets (also called liners) are used for various processes (e.g., printing, applying the label to a product, etc.) When label-bearing backing sheets are used, there has been room for creativity in specifying the associated width of the label-bearing backing sheet.

[0005] This specification discloses a technique for specifying a width relative to the backing sheet on which the label is placed. [Means for solving the problem]

[0006] The technology disclosed in this specification can be realized in the following application examples.

[0007] [Application Example 1] An image processing device comprising: an image acquisition unit that acquires a read image obtained by optically reading the label side surface of a back sheet having a label placed thereon; a line detection unit that detects lines using the read image; and a width determination unit that executes a width determination process that determines one or both of the back sheet width and the label width using the detected lines.

[0008] According to this configuration, the width specification process is performed using the line segment detected using the read image, so that one or both of the rear sheet width and the label width can be appropriately specified.

[0009] The technology disclosed in this specification can be realized in various forms, for example, in the form of an image processing method and an image processing device, a computer program for realizing the functions of those methods or devices, a recording medium on which that computer program is recorded (e.g., a non-temporary recording medium), etc. [Brief description of the drawings]

[0010] [Figure 1] 1 is a block diagram showing a printing device according to an embodiment; [Diagram 2] 1 is a cross-sectional view illustrating an internal configuration of a printing device 100. FIG. [Diagram 3] (A) is a diagram showing an example of a medium M. (B) is a diagram showing an example of a target image TI. (C) is a diagram showing an example of a printed label P1p. (D) is a diagram showing an example of a read image. [Figure 4] 10 is a flowchart illustrating an example of a print control process. [Diagram 5] 13 is a flowchart illustrating an example of a width process. [Figure 6] 13 is a flowchart illustrating an example of a width process. [Figure 7] 13A-13H are diagrams showing examples of images processed by width processing. [Figure 8]11 is a diagram showing the change in a portion PL of an image processed by width processing. FIG. [Figure 9] 1A is a diagram showing another example of a medium, and FIGS. 1B-1D are diagrams showing examples of images processed by width processing. [Figure 10] 1A is a diagram illustrating another example of a medium, and FIGS. 1B-1G are diagrams illustrating examples of images obtained from a scanned image of the medium Mc. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0011] A. First Example: 1 is a block diagram showing a printing device according to an embodiment of the present invention. The printing device 100 includes a control device 105, a display unit 140, an operation unit 150, a printing unit 160, a reading unit 170, and a communication interface 180. The control device 105 includes a processor 110 and a storage device 115. These elements are connected to each other via a bus.

[0012] The display unit 140 is a device configured to display images, such as a liquid crystal display or an organic EL display. The operation unit 150 is a device configured to receive operations by a user, such as a button, a lever, or a touch screen overlaid on the display unit 140. The communication interface 180 is an interface for communicating with other devices (for example, it includes one or more types of interfaces among IEEE802.3 wired LAN, IEEE802.11 wireless LAN, and Universal Serial Bus (USB)).

[0013] The printing unit 160 is a device that prints an image. The reading unit 170 is a device that optically reads an image printed by the printing unit 160. FIG. 2 is a cross-sectional view showing the internal configuration of the printing device 100. The printing device 100 includes a housing 2. The display unit 140 and the operation unit 150 are fixed to the outer surface of the housing 2. The housing 2 includes an outlet forming unit 21f that is a portion that forms the outlet 21 provided in the housing 2. The printing unit 160 and the reading unit 170 are housed inside the housing 2. In this embodiment, the printing unit 160 is an inkjet type printing device. The printing unit 160 includes a magazine 52, a shaft unit 51 rotatably attached to the magazine 52, a roll R attached to the shaft unit 51, a head 6, a conveying unit 3, and a cutting unit 50. The conveying section 3 has a first conveying section 10, a second conveying section 7, a third conveying section 15, a fourth conveying section 19, and a fifth conveying section 48. The first conveying section 10 is connected to a shaft section 51.

[0014] The roll R has a tube K and a long medium M wound around the tube K. When the roll R is attached to the shaft portion 51, the shaft portion 51 is located inside the tube K. The medium M has a long backing and labels attached to the backing (such medium M is also called a label sheet). As described below, the printing device 100 prints an image on the label on the backing. The printed label is peeled off from the backing and attached to a product (e.g., a multi-function printer).

[0015] FIG. 3(A) is a diagram showing an example of the medium M. In this embodiment, the medium M has a long base sheet P2 and a plurality of labels P1 arranged side by side on the base sheet P2. The base sheet P2 is a sheet of equal width extending in the extension direction D1. The width Wb in the figure is the width of the base sheet P2 in the direction perpendicular to the extension direction D1, and is the distance between the two long sides S2L and S2R of the base sheet P2. The label P1 is, in this embodiment, a substantially rectangular sheet (the four corners may be rounded). The label P1 is attached to the base sheet P2. On the base sheet P2, the short sides S1L and S1R of the label P1 are parallel to the extension direction D1, and the long sides S1U and S1D of the label P1 are perpendicular to the extension direction D1. On the base sheet P2, a plurality of labels P1 are arranged side by side in the extension direction D1 with a gap therebetween. In this embodiment, a template image SI is printed in advance on the label P1. The width Wa is the width of the label P1 in the direction perpendicular to the extension direction D1, and is the distance between the two short sides S1L and S1R of the label P1. In this embodiment, Wa < Wb. Note that the width Wa of the label P1 and the width Wb of the base sheet P2 can be various values depending on the type of the label. Also, in this embodiment, the widths Wa and Wb are expressed in units of mm.

[0016] In FIG. 2, a conveyance path Q of the medium M is shown. The printing unit 160 forms the conveyance path Q. The printing unit 160 has various members that form the conveyance path Q (for example, guide rails etc. (not shown)). The conveyance path Q extends from a roll R attached to the shaft portion 51, passes between the head 6 and the third conveyance unit 15, and reaches the discharge port 21. The medium M is conveyed along the conveyance path Q. The extension direction D1 of the base sheet P2 (FIG. 3(A)) is substantially parallel to the extending direction of the conveyance path Q.

[0017] As shown in FIG. 2, the first conveyance unit 10, the second conveyance unit 7, the head 6, the third conveyance unit 15, the fourth conveyance unit 19, the reading unit 170, the fifth conveyance unit 48, and the cutting unit 50 are arranged in this order along the conveyance path Q. The conveyance units 10, 7, 15, 19, 48 each have a drive device (for example, a stepping motor) not shown.

[0018] The first transport unit 10 is connected to the shaft unit 51. The first transport unit 10 transports the medium M in a forward direction F, which is a direction from the roll R to the discharge port 21, by rotation of the shaft unit 51 by a drive device (not shown). The first transport unit 10 transports the medium M in a reverse direction B, which is the opposite direction to the forward direction F, by reverse rotation of the shaft unit 51.

[0019] The second transport unit 7 has a transport roller 71 and a pinch roller 72. The medium M is sandwiched between the transport roller 71 and the pinch roller 72. The second transport unit 7 transports the medium M in a forward direction F by rotation of the transport roller 71 by a drive device (not shown). The second transport unit 7 transports the medium M in a reverse direction B by reverse rotation of the transport roller 71.

[0020] The third transport unit 15 is disposed below the head 6. The third transport unit 15 has a drive roller 13, a driven roller 14, and a loop-shaped belt 16 looped around the rollers 13 and 14. The belt 16 forms a flat upper surface 16s between the rollers 13 and 14. The upper surface 16s faces the lower surface 6s of the head 6. The medium M is supported on the upper surface 16s of the belt 16. The third transport unit 15 transports the medium M in the forward direction F by the rotation of the drive roller 13 by a drive device (not shown). The third transport unit 15 transports the medium M in the reverse direction B by the reverse rotation of the drive roller 13.

[0021] A plurality of nozzles (not shown) are provided on the bottom surface 6s of the head 6. Hereinafter, the bottom surface 6s is also referred to as the nozzle surface 6s. An actuator (not shown, e.g., a piezoelectric element, a heater, etc.) for ejecting ink is provided inside each nozzle. Ink is supplied to the head 6 from an ink tank (not shown). The head 6 ejects ink droplets from the plurality of nozzles toward the medium M. As a result, ink dots are formed on the medium M. An image is formed on the medium M by the plurality of ink dots. In this embodiment, an image is printed on a label P1 placed on a backing paper P2.

[0022] FIG. 3(B) shows an example of a target image TI printed on a label P1. The target image TI is a rectangular image having two sides parallel to a first direction Dx and two sides parallel to a second direction Dy perpendicular to the first direction Dx. In the figure, the first direction Dx indicates the right direction, and the opposite direction to the first direction Dx indicates the left direction. The second direction Dy is parallel to the extension direction of the transport path Q (FIG. 2), that is, the transport direction of the medium M. In this embodiment, the medium M is transported in the extension direction D1 (FIG. 3(A)). The second direction Dy corresponds to the opposite direction to the extension direction D1.

[0023] In this embodiment, the target image TI includes a first code image C1 and a second code image C2. The first code image C1 represents a one-dimensional code (e.g., a barcode). The second code image C2 represents a two-dimensional code (e.g., a QR code (registered trademark)). The information represented by the code images C1 and C2 may be any information. The first code image C1 may represent, for example, the serial number of a product to which the label P1 is to be affixed. The second code image C2 may represent, for example, a Uniform Resource Locator (URL) to a web page for supporting the product.

[0024] 3C is a diagram showing an example of a label P1 (also called a printed label P1p) representing a printed target image TI. As shown in the figure, code images C1 and C2 of the target image TI are arranged in the blank portion of the template image SI.

[0025] The fourth transport unit 19 (FIG. 2) has a transport roller 17 and a pinch roller 18. The medium M is sandwiched between the transport roller 17 and the pinch roller 18. The fourth transport unit 19 transports the medium M in a forward direction F by rotation of the transport roller 17 by a drive device (not shown). The fourth transport unit 19 transports the medium M in a reverse direction B by reverse rotation of the transport roller 17.

[0026] The reading unit 170 generates data of a read image by optically reading the medium M (here, a backing P2 on which a label P1 is placed). The reading unit 170 has an optical sensor (not shown) (e.g., a Contact Image Sensor (CIS) or a Charge Coupled Device (CCD)). The reading unit 170 generates data of a read image representing the read object by optically reading the object. The data format of the read image data may be in various formats. In this embodiment, the data of the read image is grayscale bitmap data. As will be described later, the reading unit 170 reads the backing P2 on which the label P1 representing the printed target image TI is placed in order to inspect the target image TI printed on the label P1. The reading unit 170 also reads the backing P2 on which the label P1 is placed before printing in order to determine whether the medium M is suitable for an image to be printed.

[0027] FIG. 3(D) shows an example of a read image. This read image IMp shows a backing sheet P2 on which a printed label P1p (FIG. 3(C)) is placed, and a background BG. In this embodiment, the read image IMp is a rectangular image having two sides parallel to the first direction Dx and two sides parallel to the second direction Dy. As described above, the second direction Dy is parallel to the direction in which the transport path Q extends (i.e., the second direction Dy is substantially parallel to the extension direction D1 of the backing sheet P2). The read image IMp includes one entire printed label P1p. The read image IMp is used to inspect a printed target image TI (details will be described later).

[0028] The fifth transport unit 48 (FIG. 2) has a transport roller 46 and a pinch roller 47. The medium M is sandwiched between the transport roller 46 and the pinch roller 47. The fifth transport unit 48 transports the medium M in the forward direction F by the rotation of the transport roller 46 by a drive device (not shown). The fifth transport unit 48 transports the medium M in the reverse direction B by the reverse rotation of the transport roller 46.

[0029] The cutting unit 50 has a blade 50a extending downward and a drive unit (not shown). The drive unit is, for example, a motor. The blade 50a moves up and down by the drive unit to cut the medium M. The portion of the medium M cut off by the cutting unit 50 is discharged from the discharge port 21.

[0030] The processor 110 (FIG. 1) is a device configured to process data. The processor 110 is, for example, a Central Processing Unit (CPU) or a System on a chip (SoC). The storage device 115 includes a volatile storage device 120 and a non-volatile storage device 130. The volatile storage device 120 is, for example, a DRAM, and the non-volatile storage device 130 is, for example, a flash memory.

[0031] The non-volatile storage device 130 stores data of the program PG and width information 132. The data of the program PG and the width information 132 are stored in the non-volatile storage device 130 when the printing device 100 is manufactured.

[0032] A2.Print control process: FIG. 4 is a flowchart showing an example of the print control process. The print control process is a process for printing a target image TI on a label P1 (FIG. 3(C)). First, the user attaches the roll R to the shaft 51 of the magazine 52 of the printing device 100 (FIG. 2). The user pulls out the leading end of the medium M of the roll R from the roll R and places the medium M on the transport path Q. Here, the position of the medium M in the forward direction F (and thus the position of the label P1 in the forward direction F) is placed at a predetermined initial position. For example, the user may place the leading end of the medium M at an initial position on the transport path Q (e.g., a portion sandwiched by the second transport unit 7). The positions of the multiple labels P1 on the medium M relative to the leading end of the medium M are predetermined. The processor 110 can specify the positions of the labels P1 on the transport path Q when the medium M is transported at various transport amounts, on the premise that the leading end of the medium M is located at the initial position at the start of the process for printing (e.g., the print control process). Alternatively, the printing device 100 may have a detection unit that detects the medium M (not shown). The detection unit may be disposed, for example, between the head 6 and the second transport unit 7 on the transport path Q. The detection unit detects the passage of the leading edge of the medium M transported in the forward direction F. The processor 110 can identify the position of each label P1 on the transport path Q using the transport amount from the state where the leading edge of the medium M is detected by the detection unit. At the start of processing for printing (for example, print control processing), the processor 110 may use the detection unit to identify the position of the medium M on the transport path Q, i.e., the position of each label P1 on the transport path Q.

[0033] A user inputs a print instruction by operating the operation unit 150 of the printing device 100 (FIG. 1). The print instruction includes image designation information that designates data of a target image to be printed. The image designation information may designate various image data. For example, the target image data may be data stored in the storage device 115 (e.g., the non-volatile storage device 130) of the printing device 100, a storage device (e.g., a USB flash drive) not shown connected to the communication interface 180 of the printing device 100, or a storage device of a communication device (e.g., a personal computer not shown) that can communicate with the printing device 100. The format of the target image data may be various data formats. In this embodiment, the format of the target image data is a bitmap format (e.g., JPEG (Joint Photographic Experts Group)). In this embodiment, the ratio of the number of pixels on the target image to the length on the medium M (unit: mm) is determined in advance.

[0034] The print instruction may further include width-related information relating to the width Wb of the mount P2 and the width Wa of the label P1. The width-related information may be, for example, a label model number (the label model number is associated in advance with the width Wb of the mount P2 and the width Wa of the label P1). The print instruction may further include a specification of an allowable direction level (details will be described later).

[0035] In addition, the user may attach an incorrect roll to the shaft portion 51 of the magazine 52. For example, a roll having a label with a width smaller than the intended width may be attached to the shaft portion 51 of the magazine 52. In addition, the user may specify incorrect target image data. For example, target image data for a label with a width larger than the intended width may be specified. When such an error occurs, the printing device 100 may perform improper printing. For example, the printing device 100 may print an image in an area outside the label (e.g., a mount). In addition, ink ejected toward the outside of the mount may stain an unintended portion inside the printing device 100. In order to reduce the possibility of such a malfunction, in this embodiment, the processor 110 determines whether the width of the label is appropriate before printing (details will be described later).

[0036] Processor 110 executes print control processing (FIG. 4) in accordance with program PG in response to a print instruction. In S110, processor 110 acquires a print instruction. Processor 110 acquires target image data in accordance with image designation information included in the print instruction. If the print instruction includes other information, processor 110 also acquires the other information included in the print instruction (for example, either or both of width-related information and allowable direction level).

[0037] In S120, the processor 110 executes width processing. The width processing is processing for identifying one or both of the width Wa of the label P1 (FIG. 3(A)) and the width Wb of the mount P2. FIGS. 5 and 6 are flowcharts showing an example of the width processing. The width processing includes a line segment detection processing PA (FIGS. 5 and 6) and a width identification processing PB (FIG. 6). In this embodiment, the line segment detection processing PA includes S220-S350 (FIGS. 5 and 6), and the width identification processing PB includes S360-S440 (FIG. 6).

[0038] In S210, the processor 110 drives the transport unit 3 (FIG. 2) to transport the medium M to the reading position of the reading unit 170. For example, the processor 110 transports the label P1 on the furthest forward direction F side of the multiple labels P1 on the medium M, past the position of the head 6, to the reading position of the reading unit 170. In S220, the processor 110 causes the reading unit 170 to read the medium M, thereby acquiring data of the read image from the reading unit 170.

[0039] 7(A)-7(H) are diagrams showing examples of images processed by width processing. Fig. 7(A) shows an example of a read image. Read image IM1 shows a backing P2 carrying a label P1 before the target image TI is printed, and a background BG. The configuration of read image IM1 is similar to the configuration of read image IMp (Fig. 3(D)), except that the target image TI is not printed.

[0040] In the figure, a center Cc, a center line Lc, and areas AL and AR are shown. The center Cc indicates the center of the first direction Dx of the read image IM1. The center line Lc is a line that is parallel to the second direction Dy and is located at the center Cc. The first area AL is a part of the read image IM1 on the left side (opposite side of the first direction Dx) of the center line Lc (the first area AL is also called the left area AL). The second area AR is a part of the read image IM1 on the right side (the first direction Dx side) of the center line Lc (the second area AR is also called the right area AR). In addition, in the figure, two types of areas Pc and Pr that form the read image IM1 are shown. Details of the areas Pc and Pr will be described later. The read image IM1 is used to determine whether the width of the label is appropriate. Therefore, the size of the read image IM1 in the second direction Dy may be large enough to represent multiple labels P1.

[0041] The reading unit 170 (FIG. 2) may have a line sensor composed of multiple photoelectric conversion elements arranged in a direction intersecting the transport path Q (for example, a direction perpendicular to the transport path Q). In this case, the processor 110 may acquire data of the read image IM1 by having the reading unit 170 read the medium M while the transport unit 3 transports the medium M. Alternatively, the reading unit 170 may have an area sensor composed of multiple photoelectric conversion elements arranged in a two-dimensional area. In this case, the processor 110 may acquire data of the read image IM1 by having the reading unit 170 read the medium M while the transport of the medium M is stopped.

[0042] In this embodiment, the reading resolution (unit: pixels per inch (ppi), for example) of the reading unit 170 is determined in advance. Alternatively, the reading unit 170 may read the medium M at a reading resolution selected from a plurality of reading resolutions. The print instruction (FIG. 4: S110) may include information that specifies the reading resolution.

[0043] In the width process (FIGS. 5 and 6), the processor 110 executes various image processes using the read image IM1. In each image process, the image processed in the previous image process is used. Hereinafter, the image to be processed is called the target image.

[0044] In S230 (FIG. 5), the processor 110 performs gamma correction for edge extraction on the read image IM1 using a so-called gamma curve. For the gamma correction, a so-called gamma curve is used. As described later, the processor 110 detects a plurality of line segments representing the sides S1L, S1R of the label P1 and the sides S2L, S2R of the mount P2 from the target image representing the medium M (FIG. 7(A)). The line segments in the image are represented by portions (also called edges) in which the color in the image changes significantly. The gamma curve is experimentally determined in advance so as to facilitate the detection of the line segments (i.e., the extraction of the edges). For example, the gamma curve may be experimentally determined in advance so as to increase the amount of color change in the portions representing the sides S1L, S1R, S2L, S2R in the read image IM1. The slope of the portions of the gamma curve that correspond to the gradation values ​​representing sides S1L, S1R, S2L, and S2R may be steeper than the slope of the portions that correspond to the other gradation values.

[0045] In S240, the processor 110 judges whether the resolution of the image of interest (here, the image processed by S230) is higher than the reference resolution Rth. If the resolution is too high, the number of pixels is large, so the burden of width processing is high. The reference resolution Rth is experimentally determined in advance as a sufficient resolution for appropriate width calculation (for example, 300 ppi).

[0046] If the resolution is higher than the reference resolution Rth (S240: Yes), in S250, the processor 110 converts the resolution of the image of interest (here, the image processed in S230) to the reference resolution Rth by a known resolution conversion (e.g., bicubic, bilinear, or nearest neighbor). Then, the processor 110 proceeds to S260. If the resolution is equal to or lower than the reference resolution Rth (S240: No), the processor 110 skips S250 and proceeds to S260. Note that in S220, the processor 110 may cause the reading unit 170 to generate data of the read image at the reference resolution Rth. In this case, S240 and S250 may be omitted.

[0047] In S260, the processor 110 judges whether or not width-related information is input in S110 (FIG. 4). If width-related information is input (S260: Yes), in S270, the processor 110 determines a deletion width based on the label size associated with the width-related information. As described later, the processor 110 detects lines from the target image representing the medium M (FIG. 7(A)). Here, the inner part of the label P1 (i.e., the part inside the sides S1L and S1R) can become noise in line detection. Therefore, in this embodiment, the processor 110 deletes the middle part Pc of the target image (i.e., the object in the middle part Pc is deleted). The deletion width is the width of this middle part Pc.

[0048] In this embodiment, the width information 132 (FIG. 1) represents the correspondence between the width-related information, the width of the label P1 (referred to as the reference label width), and the width of the mount P2 (referred to as the reference mount width). In this embodiment, these widths are represented in units of mm. The processor 110 refers to the width information 132 to obtain the reference label width associated with the width-related information. The processor 110 determines the deletion width by multiplying the reference label width by a coefficient k (the coefficient k is a constant less than 1, for example, 0.8).

[0049] In S280, the processor 110 executes a binarization process of the target image (here, the image processed by S230 or the image processed by S250). The binarization method may be various methods (e.g., Otsu's binarization). FIG. 7(B) shows an example of a binary image generated by the binarization process. The binary image IM2 represents the P mount P2 carrying the label P1 and the background BG using two types of pixels, object pixels and background pixels.

[0050] In S290 (FIG. 5), the processor 110 deletes an image included in the middle portion Pc having the deletion width from the binary image. FIG. 7(C) shows the binary image processed by S290. The binary image IM3 is obtained by deleting the middle portion Pc from the binary image IM2 (FIG. 7(B)). The middle portion Pc is a portion within the range of the deletion width Wc centered on the center line Lc. In the figure, sides ScL and ScR and a width Wc are shown. The side ScL is the left side of the middle portion Pc, and the side ScR is the right side of the middle portion Pc. These sides ScL and ScR are parallel to the second direction Dy. The deletion width Wc is the same as the distance between the sides ScL and ScR. The processor 110 calculates the number of pixels corresponding to the deletion width Wc on the binary image IM2 (FIG. 7(B)) using the resolution (unit: ppi, for example) of the binary image IM2.

[0051] The processor 110 sets each of the multiple pixels included in the middle portion Pc to a background pixel. As a result, objects (e.g., lines, characters, etc.) in the middle portion Pc are deleted. The binary image IM3 represents objects in the remaining portion Pr, which is the remaining portion excluding the middle portion Pc from the scanned image IM1 (FIG. 7(A)). After S290, the processor 110 proceeds to S310.

[0052] If the width-related information has not been input (S260: No), the processor 110 executes the binarization process in S300, and proceeds to S310 without deleting the middle portion Pc. The process of S300 is the same as the process of S280.

[0053] 8 is a diagram showing the change in a portion PL of an image processed by width processing. In the figure, a portion PL common to a binary image IM3 processed by S290 and a binary image IM2 processed by S300 is shown. This portion PL represents a part of a side S1L of a label P1. This portion PL includes a plurality of object pixels Po representing the side S1L (background pixels are omitted from the illustration). The plurality of object pixels Po form two continuous regions LA3a, LA3b that are separated from each other. In this way, on the binary images IM2, IM3, one side S1L can be represented by a plurality of continuous regions that are separated from each other.

[0054] In S310 (FIG. 5), processor 110 executes an expansion process on the image of interest (here, binary image IM3 processed by S290, or binary image IM2 processed by S300). The expansion process is a process for expanding the portion of the image that represents an object. FIG. 7(D) shows an example of a binary image processed by S310. This binary image IM4 is an image obtained from binary image IM3 (FIG. 7(C)). Hereinafter, it is assumed that this binary image IM4 is processed.

[0055] Various methods of expansion may be used. For example, when a plurality of pixels included in a first kernel (for example, a range of 3 rows and 3 columns) centered on a pixel of interest includes one or more object pixels, the processor 110 sets the pixel of interest to an object pixel. When all pixels of the first kernel are background pixels, the pixel of interest is maintained as a background pixel. FIG. 8 shows a portion PL of a binary image IM4 that has been expanded. As shown in the figure, the portion PL of the binary image IM4 shows one continuous region LA4. This continuous region LA4 is formed by the contact between the expanded first continuous region LA3a and the expanded second continuous region LA3b. In this way, a plurality of continuous regions representing the same side can be joined to form one continuous region by the expansion process.

[0056] In S320 (FIG. 5), processor 110 executes an erosion process on the image of interest (here, binary image IM4 processed by S310). The erosion process is a process for eroding a portion of the image that represents an object. FIG. 7(E) shows an example of a binary image processed by S320. This binary image IM5 is an image obtained from binary image IM4 (FIG. 7(D)).

[0057] The contraction method may be various methods. For example, when a plurality of pixels included in the second kernel (e.g., a range of 3 rows and 3 columns) centered on the pixel of interest includes one or more background pixels, the processor 110 sets the pixel of interest to a background pixel. When all pixels of the second kernel are object pixels, the pixel of interest is maintained as an object pixel. In this embodiment, the second kernel is the same as the first kernel. However, the second kernel may be different from the first kernel.

[0058] 8 shows a portion PL of a binary image IM5 that has been eroded. As shown in the figure, the portion PL of the binary image IM5 shows one continuous region LA5. This continuous region LA5 is thinner than the continuous region LA4 before erosion. Although not shown in the figure, the erosion process can delete small continuous regions (e.g., regions that represent noise).

[0059] The second kernel for the erosion process is preferably configured so that a single continuous region is not divided into multiple regions by the erosion process. For example, the second kernel may be the same as the first kernel for the dilation process. In this case, the possibility of the region being divided by the erosion process is reduced.

[0060] In S330 (FIG. 5), the processor 110 executes thinning processing of the image of interest (here, binary image IM5 processed by S320). Thinning processing is a process of forming thin lines by thinning a continuous region where multiple object pixels are continuous. Various thinning methods may be used. For example, Hilditch, Zhang-Suen, or Nagendraprasad-Wang-Gupta thinning may be adopted. FIG. 7(F) shows an example of a binary image processed by S330. This binary image IM6 is an image obtained from binary image IM5 (FIG. 7(E)).

[0061] 8 shows a portion PL of a binary image IM6 that has been subjected to thinning processing. As shown in the figure, the portion PL of the binary image IM6 shows one continuous region LA6. The continuous region LA6 represents a thin line. The width of the line is, for example, one pixel.

[0062] In S340 (FIG. 6), the processor 110 executes a line segment detection process for the image of interest (here, the binary image IM6 processed in S330 (FIG. 5)). There may be various methods for detecting the line segments. In this embodiment, the processor 110 uses a Hough transform to detect line segments that approximate a continuous region formed by a plurality of object pixels Po.

[0063] FIG. 7(G) shows an example of lines detected from the binary image IM6. In the figure, six lines dL1-dL6 are detected. The first line dL1 indicates the left side S2L of the mount P2, the second line dL2 indicates the left side S1L of the label P1, the third line dL3 indicates the left side ScL of the middle part Pc, the fourth line dL4 indicates the right side ScR of the middle part Pc, the fifth line dL5 indicates the right side S1R of the label P1, and the sixth line dL6 indicates the right side S2R of the mount P2. Although not shown, other lines may also be detected from the binary image IM6.

[0064] In S350 (FIG. 6), the processor 110 detects line segments extending in a direction within the allowable direction range from the line segments detected in S340. As described later, in order to specify the width Wa of the label P1 (FIG. 3(A)) and the width Wb of the mount P2, line segments representing the sides S1L, S1R of the label P1 and the sides S2L, S2R of the mount P2 in the binary image IM6 (FIG. 7(G)) are used. Ideally, these line segments are parallel to the second direction Dy in the binary image IM6. In reality, the extension direction D1 of the medium M (FIG. 3(A)) may be inclined with respect to the extension direction of the transport path Q (FIG. 2), that is, the transport direction of the medium M. Therefore, in the binary image IM6, the line segments dL2, dL5, dL1, dL6 representing the sides S1L, S1R, S2L, S2R may be inclined with respect to the second direction Dy.

[0065] The allowable direction range indicates the allowable range of the direction in which the line segment that can be tilted in this way extends. In this embodiment, the allowable direction range is the range of the allowable angle width centered on the second direction Dy (i.e., the conveying direction). The allowable angle width may be, for example, in the range of 0.1 degrees or more and 8 degrees or less. In other words, the upper limit of the angle between the second direction Dy and the line segment may be in the range of 0.05 degrees or more and 4 degrees or less. Such an allowable direction range can exclude line segments that represent objects different from the sides S1L, S1R, S2L, and S2R, such as line segments extending in the first direction Dx.

[0066] In this embodiment, processor 110 uses an allowable angle width associated with an allowable direction level (FIG. 4: S110). The allowable direction level is expressed in H stages from 1 to H (H is an integer equal to or greater than 2. For example, H is 5). The higher the level, the larger the allowable angle width. The H levels are associated with allowable angle widths in advance. If an allowable direction level is not specified in S110, processor 110 uses an allowable angle width associated with a predetermined standard level. Hereinafter, it is assumed that six line segments dL1-dL6 in FIG. 7(G) are detected in S350 (FIG. 6).

[0067] In S360, the processor 110 classifies the line segments detected in S350 into right and left, based on the coordinates of the center Cc of the image. Specifically, the processor 110 classifies the multiple line segments into left line segments included in the left area AL and right line segments included in the right area AR. In this embodiment, the position of the medium M in the first direction Dx in the read image IM1 (FIG. 7(A)) is approximately the center of the read image IM1. Therefore, in the example of FIG. 7(G), the left sides S2L, S1L, and ScL of the mount P2, the label P1, and the middle part Pc are included in the left area AL. The right sides S2R, S1R, and ScR of the mount P2, the label P1, and the middle part Pc are included in the right area AR.

[0068] In S370 (FIG. 6), the processor 110 forms line pairs that are combinations of right and left line segments in ascending order of distance from the coordinates of the center Cc. The processor 110 forms a first line pair LP1 consisting of the left line segment dL1 (FIG. 7(G)) that is the furthest from the center line Lc, and the right line segment dL6 that is the furthest from the center line Lc. The processor 110 forms a second line pair LP2 consisting of the left line segment dL2 that is the second furthest from the center line Lc, and the right line segment dL5 that is the second closest from the center line Lc. In this embodiment, the processor 110 forms a maximum of two line pairs.

[0069] The total number of line segments detected from each area AL, AR (i.e., the total number of left line segments and the total number of right line segments) can be various numbers. The total number NP of line pairs formed (also called the number of pairs NP) is limited by the total number of line segments detected from each area AL, AR. For example, if the total number of line segments detected from the left area AL is 1, the number of pairs NP is 1 or less. If the total number of line segments detected from the right area AR is zero, the number of pairs NP is zero. Thus, the number of pairs NP can be 0, 1, or 2.

[0070] In S380 (FIG. 6), the processor 110 determines whether the number of pairs NP is 1 or greater. If the number of pairs NP is 1 or greater (S380: Yes), in S400, the processor 110 adopts the distance of the widest line pair as the specific mount width dWb, which is the identified width of the mount P2. FIG. 7(H) shows an example of a width identified from the binary image IM6. The widest line pair is the first line pair LP1. The specific mount width dWb is the distance between the first line segment dL1 and the sixth line segment dL6 that form the first line pair LP1.

[0071] In addition, the two line segments forming the line pair may not be parallel. The distance of the line pair, i.e., the distance between the two line segments forming the line pair, may be a distance selected in advance from the longest distance, the shortest distance, or the average of the longest distance and the shortest distance.

[0072] In S410 (FIG. 6), the processor 110 determines whether the number of pairs NP is 2 or more. If the number of pairs NP is 2 or more (S410: Yes), in S420, the processor 110 adopts the distance of the second widest line pair as the specific label width dWa, which is the specified width of the label P1. In the example of FIG. 7(H), the second widest line pair is the second line pair LP2. The specific label width dWa is the distance between the second line segment dL2 and the fifth line segment dL5 that form the second line pair LP2.

[0073] In this embodiment, the widths dWa and dWb are expressed in units of mm. The processor 110 calculates the widths dWa and dWb expressed in such units by using the resolution (units are, for example, ppi) of the binary image IM6.

[0074] In S450, the processor 110 sets the progress flag FLG to ON. The ON progress flag FLG indicates that the specific label width dWa and the specific liner width dWb have been properly acquired. In S490, the processor 110 drives the transport unit 3 (FIG. 2) to transport the medium M (FIG. 2) in the reverse direction B to the position of the head 6. For example, the processor 110 transports the medium M so that the label P1 furthest to the forward direction F side among the multiple labels P1 of the medium M is positioned at a position for printing by the head 6. Then, the process of FIG. 6, i.e., S120 of FIG. 4, ends.

[0075] If the number of pairs NP is not 2 or more in S410 (here, L=1), in S430, processor 110 determines whether the reference label width is the same as the reference mount width based on the width-related information. Depending on the type of label, the label width may be the same as the mount width (described later). Note that if the width-related information is not input in S110 (FIG. 4), the determination result in S430 may be a predetermined determination result (e.g., No).

[0076] If the reference label width is equal to the reference liner width in S430 (S430: Yes), the processor 110 sets the specific label width dWa to the same value as the specific liner width dWb in S440. Then, the processor 110 proceeds to S450.

[0077] If the reference label width is different from the reference liner width in S430 (S430: No), a defect that is causing the two line pairs not to be detected may have occurred. The defect may be various defects, such as the use of an unintended roll R or bending of the medium M. If the determination result in S430 is No, in S460, the processor 110 sets the progress flag FLG to OFF. The OFF progress flag FLG indicates that one or both of the specific label width dWa and the specific liner width dWb have not been properly obtained. Then, the processor 110 proceeds to S490.

[0078] If the number of pairs NP is not equal to or greater than 1 in S380 (here, L=0), the processor 110 proceeds to S460.

[0079] As described above, processor 110 executes the width processing in FIGS. 5 and 6, that is, S120 in FIG.

[0080] After S120 (FIG. 4), in S130, the processor 110 determines whether the progress flag FLG is on. If the progress flag FLG is on (S130: Yes), in S140, the processor 110 determines whether the target image TI is within the specific label width dWa. As described above, in this embodiment, the ratio of the number of pixels on the target image to the length on the medium M (unit: mm) is predetermined. The processor 110 uses this ratio and the number of pixels in the first direction Dx of the target image TI to calculate the length in the first direction Dx (i.e., the width) of the target image TI. If the calculated width of the target image TI is equal to or smaller than the specific label width dWa, the processor 110 determines that the target image TI is within the specific label width dWa.

[0081] If the target image TI is within the specific label width dWa (S140: Yes), in S150, the processor 110 executes the printing process. The processor 110 uses the target image data to cause the printing unit 160 to print the target image TI on the medium M. As a result, the target image TI is printed on the label P1 (FIG. 3(C)). The printing process may include various processes. If the resolution of the target image data is different from the resolution for printing, the printing process may include a resolution conversion process that converts the resolution of the target image data to the printing resolution. If the color space of the target image data is different from the color space for printing, the printing process may include a color conversion process that converts the color space of the target image data to the color space for printing. The printing process may include a halftone process (e.g., an error diffusion method or a dither method).

[0082] In S160, the processor 110 drives the transport unit 3 (FIG. 2) to transport the printed label P1p (FIG. 3(C)) to the reading position of the reading unit 170. In S170, the processor 110 acquires data of the read image from the reading unit 170 by having the reading unit 170 read the medium M. The read image IMp in FIG. 3(D) is an example of the read image obtained in S170.

[0083] In S180, the processor 110 inspects the printed code images C1 and C2. Various defects may occur in printing, such as missing parts of an image or bleeding of an image. If the printed code images C1 and C2 have defects, the code images C1 and C2 may not be able to be decoded properly. In this embodiment, the processor 110 performs inspection related to decoding.

[0084] In this embodiment, S180 includes S183 and S186. In S183, the processor 110 decodes the code images C1 and C2 in the read image IMp, respectively. In S186, the processor 110 outputs evaluation information of the decoded result. If the printed code images C1 and C2 have defects (such as dirt or missing parts), the decoding may fail. The evaluation information may include information indicating whether the decoding was successful or not. The processor 110 may also determine whether the decoding result is correct or not. For example, the processor 110 may decode the code images C1 and C2 using data of the target image TI, respectively, and compare the decoded result from the target image TI with the decoded result from the read image IMp. If the printed code images C1 and C2 have defects, incorrect information may be decoded. The evaluation information may include the comparison result.

[0085] The evaluation information may be output by any method. For example, the processor 110 may output data representing the evaluation information to a storage device (e.g., the non-volatile storage device 130 or an external storage device (not shown) connected to the printing device 100 (so that the data of the evaluation information is stored in the storage device). The processor 110 may also output data representing the evaluation information (e.g., image data) to the display unit 140 (so that the evaluation information is displayed on the display unit 140).

[0086] In S190 (FIG. 4), the processor 110 drives the conveying unit 3 (FIG. 2) to discharge the backing sheet P2 carrying the printed label P1p (FIG. 3(C)) from the discharge port 21. Here, the processor 110 may drive the cutting unit 50 to separate the portion of the backing sheet P2 carrying the printed label P1p from the backing sheet P2 in the housing 2. After S190, the processor 110 ends the processing in FIG. 4.

[0087] If the progress flag FLG is off in S130 (S130: No), the processor 110 proceeds to S143. If the target image TI is not within the specific label width dWa in S140 (S140: No), the processor 110 proceeds to S143.

[0088] In S143, the processor 110 displays a selection screen on the display unit 140. Although not shown, the selection screen shows options for the progress of the process (here, "continue" and "cancel"). In S146, the user operates the operation unit 150 to input an instruction to select one option. Even if the progress flag FLG is off (S130: No) or the target image TI is not within the specific label width dWa (S140: No), the appropriateness of the target image data may have been confirmed by the user. In this case, the user may select "continue". If the instruction indicates "continue", the processor 110 proceeds to S150. If the instruction indicates "cancel", the processor 110 skips S150-S180 and ends the processing of FIG. 4.

[0089] Fig. 9(A) is a diagram showing another example of a medium. The only difference between medium Mb and medium M in Fig. 3(A) is that the width Wa of label P1b is the same as the width Wb of mount P2. The left side S1Lb of label P1b overlaps the left side S2L of mount P2. The right side S1Rb of label P1b overlaps the right side S2R of mount P2.

[0090] Figures 9(B)-9(D) are diagrams showing examples of images processed in the width processing (Figures 5 and 6). The binary image IM6b in Figure 9(B) shows an image generated in the thinning process (S330) when the width processing is performed using the scanned image of the medium Mb (Figure 9(A)). The sides S1Lb and S1Rb of the label P1b overlap the sides S2L and S2R of the mount P2, respectively.

[0091] FIG. 9(C) shows an example of lines detected from binary image IM6b in the line detection process (S340, S350 (FIG. 6)). Two line segments dLb1 and dLb2 are detected. The first line segment dLb1 indicates the left side S1Lb, S2L between label P1b and mount P2, and the second line segment dLb2 indicates the right side S1Rb, S2R between label P1b and mount P2. In S360, the first line segment dLb1 is classified as a left line segment (i.e., a line segment in the left area AL), and the second line segment dLb2 is classified as a right line segment (i.e., a line segment in the right area AR).

[0092] 9(D) shows the line pairs formed in S370 (FIG. 6). A first line pair LPb1 is formed from a first line segment dLb1 and a second line segment dLb2. It is assumed that one line pair LPb1 is formed from the binary image IM6b.

[0093] When such a binary image IM6b is processed, in S380 (FIG. 6), the number of pairs NP is 1 or more (S380: Yes). In S400, the specific mount width dWb is set to the distance between the first line segment dLb1 and the second line segment dLb2 that form the first line pair LPb1. In S410, the number of pairs NP is not 2 or more (S410: No). Here, it is assumed that width-related information is input in S110 (FIG. 4). And, it is assumed that the width-related information appropriately indicates the medium Mb (FIG. 9(A)). The reference label width and the reference mount width associated with such width-related information are the same. In S430, it is determined that the reference label width is the same as the reference mount width (S430: Yes). In S440, the specific label width dWa is set to the same value as the specific mount width dWb.

[0094] As described above, in this embodiment, the control device 105 of the printing device 100 (FIG. 1) executes the image processing described in FIG. 5 and FIG. 6. The control device 105 (and thus the printing device 100 having the control device 105) is an example of an image processing device. The processor 110 executes the following processing. In S220 (FIG. 5), the processor 110 acquires data of the read image IM1 (FIG. 7(A)). The read image IM1 is an optically read image of the label P1 side of the backing P2 on which the label P1 is placed (i.e., the side of the backing P2 on which the label P1 is placed, on which the label P1 is located). Such a read image IM1 is an optically read image of the label P1 side of both sides of the medium M (here, a label sheet having the label P1 and the backing P2 on which the label P1 is placed). The backing P2 is an example of a backing sheet (also called a liner). The backing sheet is a sheet that supports the label. The backing width (for example, backing width dWb) is an example of the back sheet width. In the line detection process PA (FIGS. 5 and 6), the processor 110 detects a line using the read image IM1. In the width specification process PB (FIG. 6), the processor 110 specifies the backing width dWb and the label width dWa using the detected line. In this way, the processor 110 can appropriately specify the backing width dWb and the label width dWa by using the line detected using the read image. As a comparative example of the process of specifying the widths dWa and dWb, for example, a process of directly detecting the label P1 and the backing P2 from the read image IM1 by template matching or the like and acquiring the respective widths of the detected label P1 and the backing P2 can be mentioned. Here, when the color difference between the background BG and the backing P2 is small, the backing P2 may not be appropriately detected. When the color difference between the backing P2 and the label P1 is small, the label P1 may not be appropriately detected. In this embodiment, since line segments detected using the scanned image (including, for example, a line segment representing the boundary between the background BG and the backing paper P2 and a line segment representing the boundary between the backing paper P2 and the label P1) are used, the processor 110 can appropriately identify the widths dWa and dWb. The identified widths dWa and dWb can be used for various processes. For example, the widths dWa and dWb may be used to determine whether the width-related information input in S110 (FIG. 4) is appropriate.

[0095] Furthermore, in this embodiment, the printing device 100 (FIGS. 1 and 2) includes a reading unit 170 and a printing unit 160. As explained in S220 (FIG. 5), the reading unit 170 generates a read image IM1 (FIG. 7(A)) by optically reading the backing sheet P2 on which the label P1 is placed. As explained in S150 (FIG. 4), the printing unit 160 prints a target image TI on the label P1. In this way, the printing device 100 can generate the read image IM1 and print the target image TI without using any other device different from the printing device 100.

[0096] In this embodiment, the printing device 100 (FIG. 2) further includes an outlet forming unit 21f. As described in S190 (FIG. 4), the outlet forming unit 21f is an example of an outlet unit that discharges the backing sheet P2 on which the printed label P1p (FIG. 3(C)) is placed. As described in FIG. 2, the printing unit 160 includes a transport unit 3 and a head 6. The transport unit 3 transports the backing sheet P2 on which the label P1 is placed along the transport path Q. The head 6 is an example of a print execution unit that prints a target image TI on the label P1 placed on the backing sheet P2 on the transport path Q. The reading unit 170 is disposed between the head 6 on the transport path Q and the outlet forming unit 21f. Therefore, by transporting the medium M in the forward direction F after printing by the printing unit 160, the reading unit 170 can read the printed label P1p. When the target image TI is printed on multiple labels P1 using the same roll R, the process for determining the appropriateness of the width (FIG. 4: S120-S146) needs to be performed once. After this, printing of the label P1 (S150), reading of the printed label P1p (S170), and inspection of the printed label P1p (S180) may be repeated. These processes can be performed by transporting the medium M in the forward direction F without transporting it in the reverse direction B. Therefore, the time required for the processes can be shortened compared to when transport in the reverse direction B is required.

[0097] In this embodiment, as described in S210 of Fig. 5, the transport unit 3 transports the liner P2 carrying the label P1 past the position of the head 6 to the position of the reading unit 170, before printing by the printing unit 160 (S150 of Fig. 4), in order for the reading unit 170 to read the liner P2 carrying the label P1. As described in S490 of Fig. 6, after the reading unit 170 reads the liner P2 carrying the label P1 (S220 of Fig. 5), the transport unit 3 transports the liner P2 carrying the label P1 from the position of the reading unit 170 to the position of the head 6 in order for the printing unit 160 to print. This allows the head 6 to properly print the target image TI on the label P1.

[0098] In this embodiment, as described in FIG. 3B, the target image TI printed by the printing unit 160 includes code images C1 and C2. As described in S170 of FIG. 4, the reading unit 170 optically reads the mount P2 on which the label P1p representing the printed target image TI is placed, thereby generating a code read image that is a read image IMp representing the printed target image TI. In S180 of FIG. 4, the processor 110 inspects the code images C1 and C2 represented by the code read image. Thus, the processor 110 can reduce the possibility that the label P1 representing a defective code image is used.

[0099] In this embodiment, in S110 (FIG. 4), the processor 110 acquires width-related information related to the width Wb of the mount P2 and the width Wa of the label P1. The line segment detection process PA (FIGS. 5 and 6) includes S290. In S290, the processor 110 deletes the middle portion Pc from the binary image IM2 obtained by using the read image IM1. As shown in FIG. 7(A) and FIG. 7(C), the middle portion Pc is located inside both ends (here, both sides S2L and S2R) of the mount P2 in the width direction and both ends (here, both sides S1L and S1R) of the label P1 in the width direction in the read image IM1. As described in S270 of FIG. 5, the width Wc of the middle portion Pc is determined based on the label size associated with the width-related information. That is, the middle portion Pc has a width Wc associated with the width-related information. Then, in S340-S350 (FIG. 6), the processor 110 detects lines using the remaining portion Pr obtained by removing the middle portion Pc from the scanned image IM1. Objects included in the middle portion Pc are objects unrelated to the widths Wa and Wb (such as text). By detecting lines from the remaining portion Pr, the processor 110 can properly detect lines associated with the widths Wa and Wb. In addition, since the possibility of detecting lines unrelated to the widths Wa and Wb is reduced, the accuracy of calculation of the specific label width dWa and the specific liner width dWb can be improved. In addition, since detection of lines from the middle portion Pc is omitted, the burden on the line detection process PA is reduced.

[0100] In this embodiment, the scanned image IM1 (FIG. 7(A)) includes a first area AL and a second area AR separated by a center line Lc. The center line Lc is an example of a reference line located inside both ends (here, both sides S1L, S1R) in the width direction of the label P1 in the scanned image IM1. The width specification process PB (FIG. 6) includes S380-S420. In S380 and S410, the numbers NL and NR are shown. The number NL is the number of line segments detected from the first area AL (i.e., the number of left line segments). The number NR is the number of line segments detected from the second area AR (i.e., the number of right line segments).

[0101] In this embodiment, when the condition that the number of pairs NP is 2 or more is satisfied (S380: Yes and S410: Yes), both S400 and S420 are executed. The number of pairs NP being 2 or more indicates that the number of left line segments NL is 2 or more and the number of right line segments NR is 2 or more. Hereinafter, the condition for executing both S400 and S420 is referred to as a first condition CD1.

[0102] In S400, the processor 110 specifies, as the mount width dWb, the distance between the first line segment (e.g., line segment dL1 (FIG. 7(G))) that is the farthest from the center line Lc among the NL left line segments, and the second line segment (e.g., line segment dL6) that is the farthest from the center line Lc among the NR right line segments. In S420, the processor 110 specifies, as the label width dWa, the distance between the third line segment (e.g., line segment dL2) that is the second farthest from the center line Lc among the NL left line segments, and the fourth line segment (e.g., line segment dL5) that is the second farthest from the center line Lc among the NR right line segments. In this way, the processor 110 can specify the appropriate label width dWa and the appropriate mount width dWb.

[0103] In this embodiment, both S400 and S440 are executed when the following conditions are met: the number of pairs NP is 1 (S380: Yes and S410: No) and the reference label width is the same as the reference mount width based on the width-related information (S430: Yes). The number of pairs NP being 1 indicates that one or both of the number of left line segments NL and the number of right line segments NR are 1. Hereinafter, the condition for executing both S400 and S440 is referred to as the second condition CD2.

[0104] In S440, the processor 110 sets the label width dWa to the same value as the liner width dWb. That is, the processor 110 specifies the distance between the first line segment and the second line segment that are farthest from the center line Lc as the liner width dWb and the label width dWa. In this way, when the width Wa of the label P1 is the same as the width Wb of the liner P2, the processor 110 can specify the appropriate label width dWa and the appropriate liner width dWb.

[0105] In this embodiment, in S110 (FIG. 4), the processor 110 acquires width-related information related to the width Wb of the mount P2 and the width Wa of the label P1. As shown in FIG. 6, the second condition CD2 includes a width condition (S430: Yes) indicating that the width-related information indicates that the width Wa of the label P1 is the same as the width Wb of the mount P2. If S380: Yes, S410: No, and S430: No, the processor 110 executes a process (referred to as a first determination process) different from the determination of the label width dWa (S440). In this embodiment, the first determination process includes S143-S146 in FIG. 4. Hereinafter, the condition for executing the first determination process is referred to as a third condition CD3. In this embodiment, the third condition CD3 includes that one or both of the number of left line segments NL and the number of right line segments NR are 1 (FIG. 6: S410: No) and that the width condition is not satisfied (S430: No). When such a third condition CD3 is satisfied, there is a possibility that an appropriate label width dWa cannot be specified from the line pair. When the third condition CD3 is satisfied, the processor 110 can reduce the possibility of using an inappropriate label width dWa by executing a first specification process. In this embodiment, the first specification process includes a process (S143-S146 in FIG. 4) that allows the user to select an option for proceeding with the process from a plurality of options including canceling the printing of the target image TI. Therefore, the possibility of inappropriate printing is reduced.

[0106] In this embodiment, the processor 110 specifies the label width dWa in S420 or S440 included in the width specification process PB (FIG. 6). In S140 (FIG. 4), the processor 110 uses the label width dWa to determine whether the target image TI is within the specified label width dWa. That is, the processor 110 determines whether the target image TI to be printed on the label P1 protrudes from the label P1 (in this embodiment, it is determined whether the target image TI protrudes in the width direction of the label P1). The processor 110 can switch the process depending on the result of this determination. In this embodiment, if it is determined that the target image TI protrudes from the label P1 (S140: No), in S143-S146, the processor 110 allows the user to select one option from a plurality of options including canceling the printing of the target image TI. The processor 110 can reduce the possibility of printing the target image TI protruding from the label P1.

[0107] In this embodiment, the width specification process PB (FIG. 6) includes S350. In S350, the processor 110 detects a line segment extending in a direction within the allowable direction range in the binary image IM6 (FIG. 7(G)). The binary image IM6 represents a binarized image of the read image IM1 (FIG. 7(A)). Therefore, the allowable direction range on the binary image IM6 indicates the same direction range on the read image IM1. The line segment detected in S350 indicates a line segment extending in a direction within the allowable direction range in the read image IM1. In the width specification process PB, the processor 110 uses such a line segment to specify the mount width dWb and the label width dWa. If no line segment extending in a direction within the allowable direction range is detected, the number of pairs NP is zero. In this case (FIG. 6: S380: No), the processor 110 executes a process (called a second specification process) different from the specification of the specific mount width dWb and the label width dWa (S400, S440). If a line segment extending in a direction within the allowable direction range is not detected, the medium M may have a defect (e.g., bending of the medium M, etc.). By executing the second specification process, the processor 110 can reduce the possibility of specifying the inappropriate widths dWb and dWa. In this embodiment, the second specification process includes S143-S146 in FIG. 4, that is, a process of having the user select an option for proceeding with the process from a plurality of options including canceling the printing of the target image TI. Therefore, the possibility of inappropriate printing is reduced.

[0108] In this embodiment, the line detection process PA (FIGS. 5 and 6) includes a first process PS1, a second process PS2, a third process PS3, and a fourth process PS4. The first process PS1 includes S230-S300 in FIG. 5. The first process PS1 includes binarization (S280 or S300). The processor 110 performs the first process PS1 using the read image IM1 to generate a binary image (called the first image. For example, the binary image IM3 (FIG. 7(C))). The second process PS2 includes S310 (expansion process) and S320 (erosion process). The processor 110 performs the second process PS2 using the first image to generate a processed image (called the second image. For example, the binary image IM5 (FIG. 7(E))). The third process PS3 includes S330 (thinning process). The processor 110 performs the third process PS3 using the second image to generate a processed image (referred to as the third image, for example, a binary image IM6 (FIG. 7(F))). The fourth process PS4 includes S340-S350 in FIG. 6. The processor 110 performs the fourth process PS4 using the third image to detect lines. As described above, the processor 110 can appropriately detect lines. For example, as described in FIG. 8, the expansion process (S310) can combine multiple continuous areas LA3a, LA3b representing one side S1L. The contraction process (S320) can thin the expanded continuous area LA4. The thinning process (S330) can further thin the continuous area LA5. By detecting lines using an image representing the thinned continuous area LA6, the errors in the position and direction of the lines are reduced. Therefore, the accuracy of the calculation of the widths dWa and dWb is improved.

[0109] B. Second Example: Fig. 10(A) is a diagram showing another example of a medium. The only difference between the medium Mc and the medium M of Fig. 3(A) is that the template image SI on the label P1c is omitted. Fig. 10(B)-Fig. 10(G) are diagrams showing examples of images obtained from the scanned image of the medium Mc.

[0110] Figures 10(B)-10(D) represent images processed when width-related information is input in S110 (Figure 4). Binary image IM6c in Figure 10(B) represents an image generated in S330 when width processing (Figures 5, 6) is performed using a scanned image of medium Mc (Figure 10(A)). Binary image IM6c is similar to binary image IM6 in Figure 7(F), except for the absence of an object in label P1c.

[0111] FIG. 10C shows an example of lines detected from the binary image IM6c in S340 and S350 (FIG. 6). Here, four lines dLc1-dLc4 are detected. The first line dLc1 indicates the left side S2L of the mount P2, the second line dLc2 indicates the left side S1L of the label P1, the third line dLc3 indicates the right side S1R of the label P1, and the fourth line dLc4 indicates the right side S2R of the mount P2. In S360 (FIG. 6), the lines dLc1 and dLc2 are classified as left lines (i.e., lines in the left area AL), and the lines dLc3 and dLc4 are classified as right lines (i.e., lines in the right area AR).

[0112] 10(D) shows the line pairs formed in S370 (FIG. 6). A first line pair LPc1 is formed from a first line segment dLc1 and a fourth line segment dLc4, and a second line pair LPc2 is formed from a second line segment dLc2 and a third line segment dLc3.

[0113] When such a binary image IM6c is processed, in S380 (FIG. 6), the number of pairs NP is 1 or more (S380: Yes). In S400, the specific mount width dWb is set to the distance between the line segments dLc1 and dLc4 that form the first line pair LPc1. In S410, the number of pairs NP is 2 or more (S410: Yes). In S420, the specific label width dWa is set to the distance between the line segments dLc2 and dLc3 that form the second line pair LPc2.

[0114] Figures 10(E)-10(G) show images that are processed when no width-related information is input at S110 (Figure 4). Figures 10(E)-10(G) show images at the same stages as Figures 10(B)-10(D), respectively. Binary image IM6d in Figure 10(E) is similar to binary image IM6c in Figure 10(B), except that the objects in the middle portion Pc have not been removed.

[0115] As shown in Fig. 10(F), in addition to the line segment dLc1-dLc4, which is the same as the example of Fig. 10(C), the line segment dLd5-dLd7 is detected from the binary image IM6d. The line segment dLd5-dLd7 indicates the long sides S1U, S1D of the label P1c, and is substantially parallel to the first direction Dx. Note that in S350 (Fig. 6), the line segment dLd5-dLd7 is not detected, but the line segment dLd5-dLd7 is detected.

[0116] As shown in Fig. 10(G), the same line pair LPc1, LPc2 as in the example of Fig. 10(D) is formed. The process performed using the line pair LPc1, LPc2 is the same as the process described in Fig. 10(D). Although not shown, the target image printed on the label P1c may be any image.

[0117] As described above, a blank label P1c may be used as the label. Also, the width-related information does not need to be input. In this case, the processor 110 can detect the line segments dLc1-dLc4 related to the respective widths of the label P1c and the mount P2 by the process of S350 (FIG. 6).

[0118] C. Variations: (1) The unit of width used in width processing (FIGS. 5 and 6) is not limited to mm, and may be any unit (for example, the number of pixels on the image to be processed). Furthermore, the width-related information (FIG. 4: S110) may be various information related to the backing paper width and the label width. For example, the width-related information may be the model number of the product to which the label is to be affixed (for example, a multifunction printer, a sewing machine, a cutting machine, a machine tool, etc.). Furthermore, the width-related information may represent the backing paper width and the label width (for example, the unit may be mm or the number of pixels).

[0119] (2) The code image included in the target image (for example, target image TI (FIG. 3(B))) is not limited to a barcode or a QR code, and may be various code images representing information. The total number of code images included in the target image may be various numbers equal to or greater than one. The inspection process of the printed code image may be any process for determining whether the code image is appropriate or not. For example, the inspection process may include a process of decoding the code image included in the read image, as in S180 of FIG. 4, and a process of outputting evaluation information of the decoding result (for example, information indicating whether the code image is appropriate or not). The inspection process may also include a process of calculating a similarity (for example, normalized cross correlation) between the code image in the read image and the code image in the target image, and a process of outputting information indicating whether the similarity is equal to or greater than a threshold. A similarity equal to or greater than the threshold indicates that the code image in the read image is appropriate. A similarity less than the threshold indicates that the code image in the read image is inappropriate.

[0120] Note that even if the target image includes a code image, the inspection process of the printed code image may be omitted. The target image may include other information (e.g., a character string, a logo mark, etc.) without including a code image.

[0121] (3) The reference line dividing the read image (e.g., read image IM1 (FIG. 7(A))) into the first area AL and the second area AR is not limited to the center line Lc, but may be any of a variety of lines located inside both ends of the label in the width direction (e.g., both sides S1L, S1R). For example, the reference line may be located on the first direction Dx side or the opposite side of the first direction Dx compared to the center line Lc. In general, it is preferable that the reference line is configured so that both ends of the label in the width direction (i.e., the two sides) are respectively positioned in two areas separated by the reference line.

[0122] (3) The line detection process is not limited to the line detection process PA in FIG. 5 and FIG. 6, but may be various processes that detect lines using a read image. The line detection process may be various processes including processes PS1, PS2, PS3, and PS4 (FIG. 5 and FIG. 6). Here, the first process PS1 may be various processes including binarization. From the first process PS1 in FIG. 5, one or more processes arbitrarily selected from gamma correction (S230), resolution conversion (S240-S250), and deletion of the middle part Pc (S270-S290) may be omitted. When the deletion of the middle part Pc (S270-S290) is omitted, S300 may be executed regardless of whether width-related information is input. In addition, the first process PS1 may include other image processes (for example, sharpness enhancement process before binarization).

[0123] The second process PS2 (FIG. 5) may be various processes including dilation and erosion. For example, dilation (S310) and erosion (S320) may be repeated alternately multiple times. The second process PS2 may include other image processes. For example, a noise removal process may be performed between the dilation and erosion. The noise removal process may be, for example, a process of removing small continuous regions formed by a plurality of object pixels Po and having an area equal to or smaller than a threshold value.

[0124] The third process PS3 (FIG. 5) may be a variety of processes including thinning. For example, the third process PS3 may include a noise removal process before thinning.

[0125] The fourth process PS4 (FIG. 6) may be any process for detecting line segments. For example, the processor 110 may detect line segments that approximate a continuous region formed by a plurality of object pixels Po by a least squares method.

[0126] Furthermore, the second identification process executed when no line segment extending in a direction within the allowable direction range is detected in S350 (S380: No) may be various processes other than the process of identifying the width. For example, the second identification process may include a process of displaying, on the display unit 140, warning information indicating that no line segment extending in a direction within the allowable direction range is detected.

[0127] The line detection process may be various other processes instead of the processes of the above embodiment or modified example. For example, one or more processes arbitrarily selected from gamma correction (S230), resolution conversion (S240-S250), deletion of the middle part Pc (S270-S290), expansion / contraction (S310-S320), and thinning process (S330) may be omitted. In addition, the line detection process may include a process of extracting a plurality of edge pixels from the read image, and a process of detecting a line segment using the plurality of edge pixels (for example, a Hough transform or a least square method).

[0128] (4) The width specification process is not limited to the width specification process PB in Fig. 6, and may be various processes that specify one or both of the liner width and the label width using line segments. The first condition CD1 for executing both S400 and S420 may be various conditions including "the number NL of line segments detected from the first area AL is 2 or more, and the number NR of line segments detected from the second area AR is 2 or more." For example, the first condition CD1 may further include that the difference between the reference liner width associated with the width-related information and the liner width specified in S400 is equal to or less than a threshold value.

[0129] Since both S400 and S440 are executed, the second condition CD2 may be various conditions including the following condition CDa. Condition CDa: One or both of the number NL of line segments detected from the first area AL and the number NR of line segments detected from the second area AR is 1. For example, "S430: Yes" may be omitted from the second condition CD2 (for example, if S410: No, the processor 110 may proceed to S440). Note that in the embodiment of FIG. 6, if S380: Yes and S410: No, the condition CDa is satisfied.

[0130] The third condition CD3 for executing the first specification process different from the process for specifying the width may be various conditions including the above condition CDa and the following condition CDb. Condition CDb: The width-related information does not indicate that the width Wa of the label P1 is the same as the width Wb of the mount P2 (S430: No). The first identification process may be various processes different from the process of identifying the width. For example, the first identification process may include a process of displaying warning information on the display unit 140 indicating that the total number of detected line pairs is 1 or less, although the total number should be 2 or more. The first identification process may be different from the above-mentioned second identification process. Alternatively, the first identification process may be the same as the second identification process. For example, the first identification process and the second identification process may include a process of displaying common warning information on the display unit 140.

[0131] (5) The width specified by the width process may be only one of the label width dWa and the specific mount width dWb. For example, the specification of the label width dWa (S410-S440) may be omitted. In S140 (FIG. 4), the processor 110 may determine whether the target image is within the specific mount width dWb (the target image may be allowed to protrude from the label). Note that the process executed when the result of the determination in S140 is No (for example, when it is determined that the target image protrudes from the label) is not limited to the processes in S143 and S146, and may be various processes. For example, the processor 110 may display warning information indicating that the target image is too large on the display unit 140. Also, it may be assumed that the label width Wa is smaller than the mount width Wb. Then, the specification of the mount width dWb (S400 in FIG. 6) may be omitted, and the label width dWa may be specified in S420.

[0132] (6) The width specified by the width processing may be used for various processes, not limited to judging whether the target image is within the label width or whether the target image is within the mount width. For example, the input of the width-related information may not be omitted. The condition for executing printing may include that the width specified by the width processing is appropriate in light of the width-related information. For example, when the difference between the reference label width associated with the width-related information and the label width dWa specified by the width processing exceeds a reference value, the processor 110 may judge that the label width is not appropriate. Then, the processor 110 may display warning information indicating that the label width is not appropriate on the display unit 140. Note that, in printing the target image (for example, FIG. 4: S150), the resolution (i.e., size) of the target image may be converted to a resolution suitable for the width-related information (i.e., a resolution suitable for the label size). In this case, S140 (FIG. 4) may be omitted.

[0133] Furthermore, the image processing including width processing is not limited to processing including printing, and may be various processing. For example, a label may be attached to a product (such as a multifunction printer) on a manufacturing line of the product. Here, whether or not the label is appropriate in light of the width-related information (such as the model number of the product) may be determined using the width (e.g., label width dWa) specified by the width processing. When the label is determined to be inappropriate in light of the width-related information, various processing may be performed (for example, warning information indicating that the label is inappropriate may be displayed on a display device (not shown)).

[0134] (7) The configuration of the printing device 100 may be various instead of the configuration in Figures 1 and 2. For example, the reading unit 170 is not limited to being located between the head 6 and the discharge port forming unit 21f, and may be located at another position on the transport path Q. The cutting unit 50 may be omitted. The configuration of the discharge unit that discharges the backing paper on which the printed label is placed is not limited to being the configuration of the discharge port forming unit 21f that forms the discharge port 21, and may be various. The discharge unit may include, for example, a case that stores the backing paper on which the printed label is placed.

[0135] The printing unit may be a printing device of another type (e.g., laser type, thermal transfer type) instead of an inkjet type. The print execution unit is not limited to the head 6, and may be various devices that form images (e.g., a photosensitive drum that transfers a toner image to a label).

[0136] (8) The reading unit may be a reading device (e.g., a digital camera or scanner) independent of the printing device. Image processing including width processing for specifying the width may be processing that does not include printing. In this case, the reading unit may have various configurations independent of printing. For example, the reading unit may have a configuration obtained by omitting the head 6 and the third conveying unit 15 from the printing device 100 in FIG. 2.

[0137] (9) The medium (i.e., the label sheet) may have various configurations including a label and a back sheet on which the label is placed. The back sheet may be formed using various materials such as paper and resin. The label may be used to display various information. The label may be formed using various materials such as paper and resin. The type of the medium may be a fan-hold type instead of a roll type. A plurality of labels may be arranged on the back sheet. The plurality of labels may be arranged on the back sheet without gaps. The back sheet may be separated for each label. That is, one label may be placed on one back sheet. The label may be formed by die-cutting a sheet of material attached on the back sheet. A portion (also called a matrix) that is cut off from the label by die-cutting may remain around the label on the back sheet. In this case, the processor 110 can also identify the label width dWa using a line segment that represents a boundary line between the matrix and the label (i.e., a cutting line by die-cutting).

[0138] In either case, in the width processing (e.g., FIG. 5, FIG. 6), a read image obtained by optically reading the label side surface of the back sheet on which the label is placed is processed (i.e., a read image obtained by optically reading the label side surface of a label sheet having a label and a back sheet on which the label is placed is processed). Here, in the read image, the entire back sheet may be hidden by the label. That is, in the read image, the label may be visible without the back sheet being visible. For example, on the back sheet, multiple labels may cover the entire back sheet. In this case, the read image shows the label without showing the back sheet. Also, when the medium Mb of FIG. 9(A) is used, the size in the second direction Dy of the read image (and therefore the binary image IM6b (FIG. 9(B))) may be smaller than the size in the second direction Dy of one label P1b. In this case, the read image may show the label without showing the back sheet. In this way, a read image showing the label without showing the backing sheet can be generated by optically reading the label side of the backing sheet on which the label is placed. In this case, the specific label width dWa may be set to the same value as the specific liner width dWb, as in the embodiment of Figures 9(A)-9(D).

[0139] (10) Image processing including width processing may be performed by a reading device (e.g., a digital camera or a scanner) instead of a printing device. Also, image processing including width processing may be performed by an image processing device (e.g., a personal computer, a smartphone, a tablet computer) connected to a printing device or a reading device. Also, multiple devices (e.g., computers) that can communicate with each other via a network may share part of the image processing functions of the image processing device, and provide the image processing functions as a whole (a system including these devices corresponds to an image processing device).

[0140] In each of the above embodiments, a part of the configuration realized by hardware may be replaced by software, and conversely, a part or all of the configuration realized by software may be replaced by hardware. For example, the process of S340 in Fig. 6 may be executed by a dedicated hardware circuit such as an Application Specific Integrated Circuit (ASIC).

[0141] Furthermore, when some or all of the functions of the present disclosure are realized by a computer program, the program can be provided in a form stored in a computer-readable recording medium (e.g., a non-transitory recording medium). The program can be used in a state stored in the same or a different recording medium (computer-readable recording medium) from when it was provided. The "computer-readable recording medium" is not limited to portable recording media such as memory cards and CD-ROMs, but may also include internal storage devices within a computer, such as various ROMs, and external storage devices connected to a computer, such as a hard disk drive.

[0142] The above-mentioned examples and modifications can be combined as appropriate. The above-mentioned examples and modifications are provided to facilitate understanding of the present disclosure, and do not limit the present invention. The present invention may be modified or improved without departing from the spirit of the present invention, and the present invention includes equivalents thereof. [Explanation of symbols]

[0143] Reference Signs List 2...housing, 3...transport section, 6...head, 6s...nozzle surface (lower surface), 7...second transport section, 10...first transport section, 13...driving roller, 14...driven roller, 15...third transport section, 16...belt, 16s...upper surface, 17...transport roller, 18...pinch roller, 19...fourth transport section, 21...discharge port, 46...transport roller, 47...pinch roller, 48...fifth transport section, 50...cutting section, 50a...blade, 51...shaft section, 52...magazine, 71...transport roller, 72...pinch Roller, 100...printing device, 110...processor, 115...storage device, 120...volatile storage device, 130...non-volatile storage device, 132...width information, PG...program, 140...display unit, 150...operation unit, 160...printing unit, 170...reading unit, 180...communication interface, R...roll, M...medium, Q...transport path, F...forward direction, B...reverse direction, P1, P1b, P1c...label, P1p...printed label, P2...backing paper, M, Mb, Mc...medium

Claims

1. An image processing device, an image acquisition unit that acquires a read image by optically reading the label side of the backing sheet on which the label is placed; a line segment detection unit that detects line segments using the scanned image; a width specifying unit that executes a width specifying process for specifying one or both of a rear sheet width and a label width by using the detected line segment; An image processing device comprising:

2. 2. The image processing device according to claim 1, further comprising: a reading unit that generates the read image by optically reading the label side surface of the back sheet on which the label is placed; a printing unit that prints a target image on the label; An image processing device comprising:

3. 3. The image processing device according to claim 2, further comprising: a discharge section for discharging the back sheet carrying the printed label; The printing unit includes: a conveying section that conveys the back sheet on which the label is placed along a conveying path; a print execution unit that prints the target image on the label placed on the back sheet on the conveying path; Including, the reading unit is disposed between the print execution unit and the discharge unit on the transport path; Image processing device.

4. 4. The image processing device according to claim 3, The conveying unit is before printing by the printing unit, the back sheet carrying the label is transported past the position of the print execution unit to the position of the reading unit so that the reading unit can read the label side surface of the back sheet carrying the label, after the reading unit reads the label side surface of the back sheet on which the label is placed, the back sheet on which the label is placed is transported from the position of the reading unit to the position of the print execution unit for the printing by the print unit; Image processing device.

5. 5. The image processing device according to claim 3, the target image printed by the printing unit includes a code image, the reading unit optically reads a label side surface of the back sheet on which the label representing the printed target image is placed, thereby generating a code read image which is a read image representing the printed target image; The image processing device further comprises: an inspection unit that inspects the code image represented by the code read image; Image processing device.

6. 5. The image processing device according to claim 1, further comprising: an information acquisition unit that acquires width-related information related to the back sheet width and the label width; the line segment detection unit detects a line segment by using a remaining portion of the read image obtained by excluding a middle portion of the read image that is located inside both ends of the back sheet in the width direction and both ends of the label in the width direction and has a width associated with the width-related information. Image processing device.

7. 5. The image processing device according to claim 1, the read image includes a first region and a second region separated by a reference line, the reference line being located on the inside of both ends of the label in a width direction in the read image, When a first condition is satisfied, the first condition includes that a number N L of line segments detected from the first region is 2 or more, and a number N R of line segments detected from the second region is 2 or more, The distance between a first line segment that is the furthest from the reference line among the NL line segments and a second line segment that is the furthest from the reference line among the NR line segments is specified as the back sheet width; A distance between a third line segment, which is the second farthest from the reference line among the NL line segments, and a fourth line segment, which is the second farthest from the reference line among the NR line segments, is specified as the label width. Image processing device.

8. 8. The image processing device according to claim 7, When a second condition is satisfied, the second condition includes that one or both of a number N L of line segments detected from the first region and a number N R of line segments detected from the second region are 1. The distance between the first line segment and the second line segment is specified as the back sheet width and the label width. Image processing device.

9. 9. The image processing device according to claim 8, an information acquisition unit that acquires width-related information related to the back sheet width and the label width; the second condition includes a width condition indicating that the width-related information indicates that the label width is the same as the back sheet width; The image processing device further comprises: a first identification processing unit that executes a first identification process different from the width identification process when a third condition is satisfied, the first identification process being different from the width identification process, the third condition including that one or both of a number NL of line segments detected from the first region and a number NR of line segments detected from the second region are 1 and the width condition is not satisfied; Image processing device.

10. 5. The image processing device according to claim 1, The width specifying unit specifies the label width, The image processing device further comprises: a determination unit that uses the label width to determine whether or not a target image to be printed on the label protrudes from the label; Image processing device.

11. 5. The image processing device according to claim 1, further comprising: the width specifying unit specifies one or both of the rear sheet width and the label width using a line segment extending in a direction within an allowable direction range in the read image; The image processing device further comprises: a second identification processing unit that executes a second identification process different from the width identification process when a line segment extending in a direction within the allowable direction range is not detected; Image processing device.

12. 5. The image processing device according to claim 1, The line segment detection unit performing a first process including binarization using the read image to generate a first image which is a binary image; performing a second process using the first image, the second process including dilation and erosion, to generate a second image; performing a third process using the second image, the third process including thinning, to generate a third image; detecting line segments using the third image; Image processing device.

13. A program for a computer that performs image processing, an image acquisition function that acquires an optically read image of the label side of the backing sheet on which the label is placed; a line detection function for detecting a line using the scanned image; a width determination function that performs a width determination process to determine one or both of a back sheet width and a label width using the detected line segment; A program that enables a computer to achieve the above.

Citation Information

Patent Citations

  • Print control apparatus, print control method and program

    JP2015009482A