Media transport device, control method, and control program

The medium conveyance device accurately detects the end portion of a medium in the main scanning direction by using a conveyance unit, imaging unit, and output control unit to generate a cut-out image, excluding fluctuation regions, thereby enhancing image processing and medium handling precision.

JP7692507B2Active Publication Date: 2025-06-13PFU LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2024028621
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2024-02-28
Publication Date
2025-06-13
Estimated Expiration
2040-10-12

Smart Images

  • Figure 0007692507000003
    Figure 0007692507000003
  • Figure 0007692507000004
    Figure 0007692507000004
  • Figure 0007692507000005
    Figure 0007692507000005
Patent Text Reader

Abstract

To provide a media transport device, a control method, and a control program that can detect an end of a medium in the main scanning direction from an image with higher precision.SOLUTION: A media transport device includes a transport unit that transports a medium, an imaging unit that images the medium being transported, a storage unit that stores a low reliability region in an input image in which the medium is imaged by the imaging unit on the basis of positional relationship between the imaging position of the imaging unit and the arrangement position of the transport unit, an edge pixel detection unit that detects edge pixels from the input image, an end detection unit that detects an end of the medium in the main scanning direction on the basis of edge pixels detected from an area that does not include a low reliability area in the input image, and an output control unit that outputs information on the detected end.SELECTED DRAWING: Figure 8
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to a medium conveyance device, and more particularly to a medium conveyance device that detects an end portion of a medium from an image obtained by imaging the conveyed medium.

Background Art

[0002] Generally, a medium conveyance device such as a scanner that reads an image of a medium such as a document has a function of specifying a region in the read image where the medium is included in order to cut out the region where the medium is included from the read image. For this purpose, the medium conveyance device is required to accurately detect the end portion of the medium.

[0003] An image processing device is disclosed that determines whether the thickness of a document is constant based on the difference in brightness of the background region of the input image, and if the document has a non-constant thickness, binarizes the image with a threshold value corresponding to the brightness of the background region to identify the background region and the document region (see Patent Document 1).

Prior Art Documents

Patent Documents

[0004]

Patent Document 1

Summary of the Invention

[0005] In a medium conveyance device, it is desired to detect the end portion of the medium from the image with higher accuracy.

[0006] An object of the medium conveyance device, the control method, and the control program is to enable more accurate detection of the end portion of the medium in the main scanning direction from the image.

[0007] A medium conveyance device according to one aspect of the embodiment includes a conveyance unit that conveys a medium, an imaging unit that images the conveyed medium, Based on the extreme position in the main scanning direction of the medium in the area that does not include the specific area based on the positional relationship between the imaging position of the imaging unit and the arrangement position of the conveyance unit, a cut-out image obtained by cutting out the area of the medium is generated from the input image of the medium imaged by the imaging unit. and an output control unit that outputs.

[0008] In addition, a medium conveyance device according to an aspect of the embodiment includes a conveyance unit that conveys a medium, a reference member having a single color, an imaging unit that is disposed to face the reference member and images the conveyed medium and the reference member, and an output control unit that generates and outputs a cut-out image obtained by cutting out a region of the medium based on the outermost position in the main scanning direction of the medium in a region that does not include a variation region in which the gradation value varies with respect to peripheral pixels within the region including the reference member, from an input image in which the medium and the reference member are imaged by the imaging unit. The variation region is In the sub-scanning direction, the left edge pixel of the first horizontal line and the left edge pixel of the second horizontal line within a predetermined distance from the first horizontal line a difference in position in the main scanning direction is divided by the difference in the positions in the sub-scanning direction between the left edge pixel of the first horizontal line and the left edge pixel of the second horizontal line, or the a difference in position in the main scanning direction is divided by the difference in the positions in the sub-scanning direction between the right edge pixel of the first horizontal line and the right edge pixel of the second horizontal line, and any of the values obtained is a first horizontal line including a threshold value or more a region.

[0009] In addition, a control method according to an aspect of the embodiment is a control method for a medium conveyance device including a conveyance unit that conveys a medium and an imaging unit that images the conveyed medium, , is and includes: Based on the extreme position in the main scanning direction of the medium in the area that does not include the specific area based on the positional relationship between the imaging position of the imaging unit and the arrangement position of the conveyance unit, a cut-out image obtained by cutting out the area of the medium is generated from the input image of the medium imaged by the imaging unit. output.

[0010] In addition, a control method according to an aspect of the embodiment is a control method for a medium conveyance device including a conveyance unit that conveys a medium, a reference member having a single color, and an imaging unit that is disposed to face the reference member and images the conveyed medium and the reference member. The method includes generating and outputting a cut-out image obtained by cutting out a region of the medium based on the outermost position in the main scanning direction of the medium in a region that does not include a variation region in which the gradation value varies with respect to peripheral pixels within the region including the reference member, from an input image in which the medium and the reference member are imaged by the imaging unit. The variation region is In the sub-scanning direction, the left edge pixel of the first horizontal line and the left edge pixel of the second horizontal line within a predetermined distance from the first horizontal line a difference in position in the main scanning direction is divided by the difference in the positions in the sub-scanning direction between the left edge pixel of the first horizontal line and the left edge pixel of the second horizontal line, or the a difference in position in the main scanning direction is divided by the difference in the positions in the sub-scanning direction between the right edge pixel of the first horizontal line and the right edge pixel of the second horizontal line, and any of the values obtained is a first horizontal line including a threshold value or more a region.

[0011] In addition, a control program according to an aspect of the embodiment is a control program for a medium conveyance device including a conveyance unit that conveys a medium and an imaging unit that images the conveyed medium, , is and causes the medium conveyance device to execute Based on the extreme position in the main scanning direction of the medium in the area that does not include the specific area based on the positional relationship between the imaging position of the imaging unit and the arrangement position of the conveyance unit, a cut-out image obtained by cutting out the area of the medium is generated from the input image of the medium imaged by the imaging unit. outputting.

[0012] Further, a control program according to an aspect of the embodiment is a control program for a medium conveyance device including a conveyance unit that conveys a medium, a reference member having a single color, and an imaging unit that is disposed opposite to the reference member and images the conveyed medium and the reference member. The control program causes the medium conveyance device to generate and output a cut-out image obtained by cutting out a region of the medium based on the extreme position in the main scanning direction of the medium in a region that does not include a variation region in which the gradation value varies with respect to peripheral pixels within the region including the reference member, from an input image in which the medium and the reference member are imaged by the imaging unit. The variation region is In the sub-scanning direction, the left edge pixel of the first horizontal line and the left edge pixel of the second horizontal line within a predetermined distance from the first horizontal line a difference in position in the main scanning direction is divided by the difference in the positions in the sub-scanning direction between the left edge pixel of the first horizontal line and the left edge pixel of the second horizontal line, or the a difference in position in the main scanning direction is divided by the difference in the positions in the sub-scanning direction between the right edge pixel of the first horizontal line and the right edge pixel of the second horizontal line, and any of the values obtained is a first horizontal line including a threshold value or more a region.

Advantages of the Invention

[0013] According to the present embodiment, the medium conveyance device, the control method, and the control program can detect the end portion in the main scanning direction of the medium from the image with higher accuracy.

[0014] The object and advantages of the present invention will be recognized and achieved by using the components and combinations particularly pointed out in the claims. Both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention as set forth in the claims.

Brief Description of the Drawings

[0015]

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6A

Figure 6B

Figure 7A

Figure 7B

Figure 8

Figure 9

Figure 10

Figure 11

Figure 12

Figure 13

Figure 14

Figure 15

Figure 16

Figure 17

Figure 18

Figure 19

Embodiments for Carrying Out the Invention

[0016] Hereinafter, a medium transport device, a control method, and a control program according to one aspect of the present disclosure will be described with reference to the drawings. However, note that the technical scope of the present invention is not limited to those embodiments, and extends to the invention described in the claims and its equivalents.

[0017] FIG. 1 is a perspective view showing a media conveyance device 100 configured as an image scanner. The media conveyance device 100 conveys and images a medium that is an original. The medium is paper, cardboard, a card, or a passport, etc. The card is, for example, a plastic resin card. In particular, the card is an ID (Identification) card defined by ISO (International Organization for Standardization) / IEC (International Electrotechnical Commission) 7810. Note that the card may be other types of cards. The media conveyance device 100 may also be a facsimile machine, a copying machine, a printer multifunction peripheral (MFP), etc.

[0018] The media conveyance device 100 includes a lower housing 101, an upper housing 102, a placement table 103, a discharge table 104, an operation device 105, a display device 106, etc.

[0019] The upper housing 102 is disposed at a position covering the upper surface of the media conveyance device 100 and is engaged with the lower housing 101. The placement table 103 is engaged with the lower housing 101 so as to be able to place the conveyed medium. The discharge table 104 is engaged with the lower housing 101 so as to be able to hold the discharged medium.

[0020] The operation device 105 has an input device such as a button and an interface circuit that acquires a signal from the input device, receives an input operation by a user, and outputs an operation signal corresponding to the user's input operation. The display device 106 has a display including liquid crystal, organic EL (Electro-Luminescence), etc. and an interface circuit that outputs image data to the display, and displays the image data on the display.

[0021] FIG. 2 is a diagram for explaining a conveyance path inside the media conveyance device 100.

[0022] The conveyance path inside the media conveyance device 100 includes a first media sensor 111, a feed roller 112, a brake roller 113, a first conveyance roller 114, a second conveyance roller 115, a second media sensor 116, a first imaging device 117a, a second imaging device 117b, a third conveyance roller 118, a fourth conveyance roller 119, and the like. Note that the number of each roller is not limited to one, and the number of each roller may be plural. Hereinafter, the first imaging device 117a and the second imaging device 117b may be collectively referred to as the imaging device 117 in some cases.

[0023] The upper surface of the lower housing 101 forms a lower guide 107a of the media conveyance path, and the lower surface of the upper housing 102 forms an upper guide 107b of the media conveyance path. In FIG. 2, arrow A1 indicates the media conveyance direction. Hereinafter, the upstream refers to the upstream in the media conveyance direction A1, and the downstream refers to the downstream in the media conveyance direction A1.

[0024] The first media sensor 111 is disposed upstream of the feed roller 112 and the brake roller 113. The first media sensor 111 has a contact detection sensor and detects whether a media is placed on the mounting table 103. The first media sensor 111 generates and outputs a first media signal whose signal value changes between a state where a media is placed on the mounting table 103 and a state where no media is placed.

[0025] The feed roller 112 and the brake roller 113 are provided upstream of the first conveyance roller 114 and the second conveyance roller 115. The feed roller 112 is provided on the lower housing 101 and feeds the media placed on the mounting table 103 in order from below. The brake roller 113 is provided on the upper housing 102 and is disposed opposite to the feed roller 112.

[0026] The first conveyance roller 114 and the second conveyance roller 115 are provided downstream of the feed roller 112 and the brake roller 113. The first conveyance roller 114 is provided on the lower housing 101. The second conveyance roller 115 is provided on the upper housing 102 and is disposed opposite to the first conveyance roller 114.

[0027] The second medium sensor 116 is disposed downstream of the first conveyance roller 114 and the second conveyance roller 115 and upstream of the imaging device 117. The second medium sensor 116 detects whether a medium exists at its position. The second medium sensor 116 includes a light emitter and a light receiver provided on one side with respect to the conveyance path of the medium, and a reflecting member such as a mirror provided at a position facing the light emitter and the light receiver with the conveyance path therebetween. The light emitter irradiates light toward the conveyance path. On the other hand, the light receiver receives the light irradiated by the light emitter and reflected by the reflecting member, and generates and outputs a second medium signal which is an electrical signal corresponding to the intensity of the received light. When a medium exists at the position of the second medium sensor 116, the light irradiated by the light emitter is blocked by the medium, so that the signal value of the second medium signal changes between the state where a medium exists and the state where no medium exists at the position of the second medium sensor 116. Note that the light emitter and the light receiver may be provided at positions facing each other with the conveyance path therebetween, and the reflecting member may be omitted.

[0028] The first imaging device 117a and the second imaging device 117b are examples of imaging units. The first imaging device 117a includes a first imaging sensor 121a and a first reference member 122a. The second imaging device 117b includes a second imaging sensor 121b, a second reference member 122b, and a conveyance guide 123b.

[0029] The first imaging sensor 121a is a line sensor using a CIS (Contact Image Sensor) of an equal magnification optical system type having imaging elements made of CMOS (Complementary Metal Oxide Semiconductor) linearly arranged in the main scanning direction. The first imaging sensor 121a is disposed to face a second reference member 122b that functions as a backing. The first imaging device 117a includes a lens that forms an image on the imaging element, and an A / D converter that amplifies an electrical signal output from the imaging element and performs analog / digital (A / D) conversion. The first imaging device 117a sequentially generates and outputs line images by imaging the surface and the periphery of the medium being conveyed at regular intervals at the imaging position P1. That is, the number of pixels in the vertical direction (sub-scanning direction) of the line image is 1, and the number of pixels in the horizontal direction (main scanning direction) is plural. A predetermined number of line images are synthesized by a processing circuit described later to generate an input image. That is, the input image is an image obtained by imaging the medium by the imaging device 117.

[0030] When the medium is not being conveyed, the first imaging sensor 121a images the second reference member 122b. The surface of the second reference member 122b facing the first imaging sensor 121a has a single color (for example, white). The medium conveyance device 100 corrects an image such as shading based on the image signal obtained by imaging the second reference member 122b.

[0031] The second imaging sensor 121b is a line sensor using a CIS of an equal magnification optical system type having an imaging element composed of CMOSs linearly arranged in the main scanning direction. The second imaging sensor 121b is arranged so as to face a first reference member 122a that functions as a backing. Further, the second imaging device 117b includes a lens that forms an image on the imaging element, and an A / D converter that amplifies an electrical signal output from the imaging element and performs analog / digital (A / D) conversion. The second imaging device 117b sequentially generates and outputs line images by imaging the back surface of the medium being conveyed and the periphery of the medium at regular intervals at the imaging position P2. A predetermined number of line images are synthesized by a processing circuit described later to generate an input image. That is, the input image is an image obtained by imaging the medium by the imaging device 117.

[0032] When the medium is not being conveyed, the second imaging sensor 121b images the first reference member 122a. The surface of the first reference member 122a facing the second imaging sensor 121b has a single color (for example, white). The medium conveyance device 100 corrects an image such as shading based on the image signal obtained by imaging the first reference member 122a.

[0033] The transport guide 123b is an example of a member that moves in conjunction with the second imaging device 117b. The transport guide 123b is provided integrally with the second imaging device 117b. The transport guide 123b has a bracket-like shape and guides the medium conveyed by the first transport roller 114 and the second transport roller 115 between the first imaging device 117a and the second imaging device 117b. On the upper surface of the transport guide 123b, the other end of a spring (not shown) whose one end is supported by the upper housing 102 is attached, and the transport guide 123b is biased in the direction toward the first imaging device 117a by that spring. The second imaging device 117b is provided so as to be movable upward in the height direction A8 orthogonal to the medium transport direction. On the other hand, the first imaging device 117a is fixed to the lower housing 101. When a medium having a predetermined thickness and high rigidity, such as cardboard, a card, or a passport, is conveyed, the transport guide 123b moves upward by that medium, and the second imaging device 117b moves upward in conjunction with the movement of the transport guide 123b. In this way, the second imaging device 117b is provided so as to be movable upward by being pushed up by the conveyed medium.

[0034] The transport guide 123b is formed of a member separate from the second imaging device 117b. Note that the transport guide 123b may be formed of a member integral with the second imaging device 117b. Also, the second imaging device 117b may be fixed and the first imaging device 117a may be arranged to be movable in the height direction A8, and the transport guide 123b may be provided integrally with the first imaging device 117a. In that case, the transport guide 123b moves downward by the conveyed medium, and the first imaging device 117a moves downward in conjunction with the movement of the transport guide 123b. Also, the transport guide 123b may be omitted, and the first imaging device 117a or the second imaging device 117b may be provided so as to be movable in the height direction A8 by the conveyed medium.

[0035] Note that the medium transport device 100 may arrange only one of the first imaging device 117a and the second imaging device 117b and read only one side of the medium. Further, instead of the line sensor of the same magnification optical system type CIS including an imaging element using a CMOS, a line sensor of the same magnification optical system type CIS including an imaging element using a CCD (Charge Coupled Device) may be used. Further, a line sensor of a reduced optical system type including an imaging element using a CMOS or a CCD may be used. Hereinafter, the first imaging sensor 121a and the second imaging sensor 121b may be collectively referred to as the imaging sensor 121. Further, the first reference member 122a and the second reference member 122b may be collectively referred to as the reference member 122.

[0036] The third transport roller 118 and the fourth transport roller 119 are provided downstream of the imaging device 117. The third transport roller 118 is provided on the lower housing 101. The fourth transport roller 119 is provided on the upper housing 102 and is arranged to face the third transport roller 118.

[0037] The medium placed on the mounting table 103 is transported in the medium transport direction A1 between the lower guide 107a and the upper guide 107b by the rotation of the feed roller 112 in the direction of arrow A2 in FIG. 2. The brake roller 113 rotates in the direction of arrow A3 during medium transport. By the action of the feed roller 112 and the brake roller 113, when a plurality of media are placed on the mounting table 103, only the medium in contact with the feed roller 112 among the media placed on the mounting table 103 is separated. Thereby, it operates so that the transport of media other than the separated media is restricted (prevention of double feed).

[0038] The medium is fed between the first conveyance roller 114 and the second conveyance roller 115 while being guided by the lower guide 107a and the upper guide 107b. The medium is fed between the first imaging device 117a and the second imaging device 117b as the first conveyance roller 114 and the second conveyance roller 115 rotate in the directions of arrow A4 and arrow A5 respectively. The medium read by the imaging device 117 is discharged onto the discharge table 104 as the third conveyance roller 118 and the fourth conveyance roller 119 rotate in the directions of arrow A6 and arrow A7 respectively. The feed roller 112, the brake roller 113, the first conveyance roller 114, the second conveyance roller 115, the third conveyance roller 118, and the fourth conveyance roller 119 are an example of a conveyance unit and convey the medium.

[0039] FIG. 3 is a block diagram showing a schematic configuration of the medium conveyance device 100.

[0040] In addition to the above-described configuration, the medium conveyance device 100 further includes a motor 131, an interface device 132, a storage device 140, a processing circuit 150, and the like.

[0041] The motor 131 includes one or a plurality of motors and rotates the feed roller 112, the brake roller 113, the first conveyance roller 114, the second conveyance roller 115, the third conveyance roller 118, and the fourth conveyance roller 119 according to a control signal from the processing circuit 150 to convey the medium.

[0042] The interface device 132 has an interface circuit conforming to a serial bus such as USB, and is electrically connected to an information processing device (for example, a personal computer, a mobile information terminal, etc.) (not shown) to transmit and receive images and various types of information. Further, instead of the interface device 132, a communication unit having an antenna for transmitting and receiving radio signals and a wireless communication interface device for transmitting and receiving signals through a wireless communication line according to a predetermined communication protocol may be used. The predetermined communication protocol is, for example, a wireless LAN (Local Area Network).

[0043] The storage device 140 includes a memory device such as a RAM (Random Access Memory) or a ROM (Read Only Memory), a fixed disk device such as a hard disk, or a portable storage device such as a flexible disk or an optical disk. Further, the storage device 140 stores a computer program, a database, a table, etc. used for various processes of the medium transport device 100. The computer program may be installed in the storage device 140 from a computer-readable portable recording medium using a known setup program or the like. The portable recording medium is, for example, a CD-ROM (compact disc read only memory), a DVD-ROM (digital versatile disc read only memory), or the like.

[0044] Further, the storage device 140 stores, as data, a region table indicating low-reliability regions in the input image. The low-reliability regions are regions in the input image where the gradation values of the pixels in which the reference member 122 is imaged in the sub-scanning direction are likely to vary. When detecting the end portion of the medium in the main scanning direction from the input image, the processing circuit 150 detects the end portion without using the edge pixels detected from the low-reliability regions. Details of the region table will be described later. The storage device 140 is an example of a storage unit.

[0045] The processing circuit 150 operates based on a program stored in the storage device 140 in advance. Note that instead of the processing circuit 150, a DSP (digital signal processor), an LSI (large scale integration), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array), or the like may be used.

[0046] The processing circuit 150 is connected to an operating device 105, a display device 106, a first medium sensor 111, a second medium sensor 116, an imaging device 117, a motor 131, an interface device 132, a storage device 140, etc., and controls these respective parts. The processing circuit 150 performs drive control of the motor 131, imaging control of the imaging device 117, etc., acquires an image, and transmits it to an information processing device (not shown) via the interface device 132. Further, the processing circuit 150 detects the end of the medium based on the image captured by the imaging device 117.

[0047] FIG. 4 is a diagram showing a schematic configuration of the storage device 140 and the processing circuit 150.

[0048] As shown in FIG. 4, the storage device 140 stores a setting program 141, a control program 142, an image acquisition program 143, an edge pixel detection program 144, an end detection program 145, a medium width detection program 146, an output control program 147, a variation region detection program 148, etc. These respective programs are functional modules implemented by software operating on a processor. The processing circuit 150 reads each program stored in the storage device 140 and operates according to each read program. Thereby, the processing circuit 150 functions as a setting unit 151, a control unit 152, an image acquisition unit 153, an edge pixel detection unit 154, an end detection unit 155, a medium width detection unit 156, an output control unit 157, and a variation region detection unit 158.

[0049] FIG. 5 is a diagram showing an example of the data structure of the region table.

[0050] As shown in FIG. 5, the area table stores a low-reliability area for each combination of the imaging device 117 and the transport unit. The imaging devices 117 for which the low-reliability area is set include the first imaging device 117a and the second imaging device 117b. The transport units for which the low-reliability area is set include the pair of the feed roller 112 and the brake roller 113, the pair of the first transport roller 114 and the second transport roller 115, and the pair of the third transport roller 118 and the fourth transport roller 119. The low-reliability area is set based on the positional relationship between the imaging position of the imaging device 117 and the arrangement position of the transport unit. As the low-reliability area, when the medium sandwiched between the transport units contacts the transport guide 123b, the area imaged by each imaging device 117 in the input image is set. When the transport guide 132 is omitted, as the low-reliability area, when the medium sandwiched between the transport units contacts the second imaging device 117b, the area imaged by each imaging device 117 in the input image is set. Alternatively, as the low-reliability area, when the leading end or the trailing end of the transported medium passes through each transport unit, the area imaged by each imaging device 117 in the input image is set.

[0051] FIGS. 6A, 6B, 7A, and 7B are schematic diagrams for explaining the low-reliability area.

[0052] FIG. 6A is a schematic diagram for explaining the area imaged by each imaging device 117 in the input image when the medium sandwiched between the feed roller 112 and the brake roller 113 contacts the second imaging device 117b.

[0053] As shown in FIG. 6A, in the height direction A8, the nip position N1 between the feed roller 112 and the brake roller 113 is disposed above the imaging surface (transport surface) of the first imaging device 117a. When a medium M having a predetermined thickness and high rigidity is transported, the transported medium M is sandwiched between the feed roller 112 and the brake roller 113 and is transported so that the leading end moves along the imaging surface of the first imaging device 117a. That is, the medium M is transported with the leading end inclined downward. Therefore, the medium M contacts the upstream end of the second imaging device 117b (transport guide 123b) at a specific timing, and the second imaging device 117b is pushed up by the medium M and moves upward. When the second imaging device 117b moves upward, the distance between the first imaging device 117a and the second imaging device 117b increases. Therefore, in the input image, the gradation values of the pixels in which the second reference member 122b is imaged by the first imaging sensor 121a before and after this timing, and the gradation values of the pixels in which the first reference member 122a is imaged by the second imaging sensor 121b before and after this timing vary.

[0054] The setting unit 151 sets, as a low-reliability region, the region imaged by each imaging device 117 when the tip of the medium that abuts against the imaging surface of the first imaging device 117a and is sandwiched between the feed roller 112 and the brake roller 113 contacts the upstream end of the second imaging device 117b. The setting unit 151 sets, as the tip position of the medium, the position where the straight line passing through the nip position N1 of the feed roller 112 and the brake roller 113 and the upstream end of the second imaging device 117b abuts against the imaging surface of the first imaging device 117a. The setting unit 151 sets, as a low-reliability position, the position corresponding to the relative positions of the imaging positions P1 and P2 of each imaging device 117 with respect to the set tip position, for the position in the input image where the tip of the medium is included in the vertical direction (sub-scanning direction). Then, the setting unit 151 sets, as a low-reliability region, a region within a predetermined range (for example, 5 pixels) centered on the set low-reliability position in the vertical direction in the input image. Note that depending on the conveyance speed of the medium or the members of the medium conveyance path, after the second imaging device 117b moves upward, it may bounce (vibrate), and the period during which the gradation value of the reference member 122 fluctuates in the input image may become long. The predetermined range is set in consideration of the influence of the conveyance speed of the medium or the members of the medium conveyance path, etc.

[0055] Thereby, the medium conveyance device 100 can suppress erroneously detecting, as the edge of the medium, the region where the gradation value of the background fluctuates in the input image.

[0056] FIG. 6B is a schematic diagram for explaining the region imaged by each imaging device 117 in the input image when the rear end of the conveyed medium passes through the feed roller 112 and the brake roller 113.

[0057] As shown in FIG. 6B, when the rear end of the medium M passes through the nip position N1 between the feed roller 112 and the brake roller 113, the medium M vibrates due to the impact of separating from the feed roller 112 and the brake roller 113. Therefore, the second imaging device 117b pushed up by the medium M vibrates in conjunction with the medium M. When the second imaging device 117b vibrates, the distance between the first imaging device 117a and the second imaging device 117b changes. Therefore, in the input image, the gradation values of the pixels in which the second reference member 122b is imaged by the first imaging sensor 121a before and after this timing, and the gradation values of the pixels in which the first reference member 122a is imaged by the second imaging sensor 121b before and after this timing fluctuate.

[0058] The setting unit 151 sets, as a low-reliability region, the region imaged by each imaging device 117 when the rear end of the conveyed medium passes through the feed roller 112 and the brake roller 113. The setting unit 151 sets, as the leading edge position of the medium, the position downstream by the length of the long side (or the length of the short side) of the ID card defined in ISO / IEC 7810 with respect to the nip position N1 of the feed roller 112 and the brake roller 113. The setting unit 151 sets, as a low-reliability position, the position corresponding to the relative positions of the imaging positions P1 and P2 of each imaging device 117 with respect to the set leading edge position, with respect to the position where the leading edge of the medium is included in the vertical direction in the input image. Then, the setting unit 151 sets, as a low-reliability region, a region within a predetermined range centered on the set low-reliability position in the vertical direction in the input image. Thereby, the medium conveyance device 100 can suppress erroneously detecting, as the edge of the medium, the region where the gradation value of the background fluctuates in the input image.

[0059] FIG. 7A is a schematic diagram for explaining the region imaged by each imaging device 117 in the input image when the leading edge of the conveyed medium passes through the third conveyance roller 118 and the fourth conveyance roller 119.

[0060] As shown in FIG. 7A, when the leading end of the medium M passes through the third conveyance roller 118 and the fourth conveyance roller 119, it collides with the third conveyance roller 118 or the fourth conveyance roller 119 and is guided to the nip position N3 of the third conveyance roller 118 and the fourth conveyance roller 119. Since the medium M vibrates due to the impact of colliding with the third conveyance roller 118 or the fourth conveyance roller 119, the second imaging device 117b that has been pushed up by the medium M vibrates in conjunction with the medium M.

[0061] The setting unit 151 sets, as a low-reliability area, the area imaged by each imaging device 117 when the leading end of the conveyed medium passes through the third conveyance roller 118 and the fourth conveyance roller 119. The setting unit 151 sets the nip position N3 of the third conveyance roller 118 and the fourth conveyance roller 119 as the leading end position of the medium. The setting unit 151 sets, as a low-reliability position, the position corresponding to the relative positions of the imaging positions P1 and P2 of each imaging device 117 with respect to the set leading end position, with respect to the position where the leading end of the medium is included in the vertical direction within the input image. Then, the setting unit 151 sets, as a low-reliability area, an area within a predetermined range centered on the set low-reliability position in the vertical direction within the input image. Thereby, the medium conveyance device 100 can suppress erroneously detecting, as the edge of the medium, an area where the gradation value of the background fluctuates within the input image.

[0062] FIG. 7B is a schematic diagram for explaining the area imaged by each imaging device 117 within the input image when the trailing end of the conveyed medium passes through the first conveyance roller 114 and the second conveyance roller 115.

[0063] As shown in FIG. 7B, when the trailing end of the medium M passes through the nip position N2 of the first conveyance roller 114 and the second conveyance roller 115, the medium M vibrates due to the impact of separating from the first conveyance roller 114 and the second conveyance roller 115. Therefore, the second imaging device 117b that has been pushed up by the medium M vibrates in conjunction with the medium M.

[0064] The setting unit 151 sets, as a low-reliability area, the area imaged by each imaging device 117 when the rear end of the conveyed medium passes through the first conveying roller 114 and the second conveying roller 115. The setting unit 151 sets, with respect to the nip position N2 of the first conveying roller 114 and the second conveying roller 115, the position on the downstream side by the length of the long side (or the length of the short side) of the ID card defined in ISO / IEC 7810 as the leading edge position of the medium. The setting unit 151 sets, as a low-reliability position, the position corresponding to the relative positions of the imaging positions P1 and P2 of each imaging device 117 with respect to the set leading edge position, with respect to the position in the input image where the leading edge of the medium is included in the vertical direction. Then, the setting unit 151 sets, as a low-reliability area, the area within a predetermined range centered on the set low-reliability position in the vertical direction within the input image. Thereby, the medium conveying device 100 can be suppressed from erroneously detecting, as the edge of the medium, the area where the gradation value of the background fluctuates within the input image.

[0065] Note that the setting unit 151 does not need to set all the above-described areas as low-reliability areas, and may set at least one area as a low-reliability area. In particular, in the area imaged when the medium contacts the second imaging device 117b, which is described with reference to FIG. 6A, the amount of fluctuation of the gradation value of the background is small. Therefore, the setting unit 151 does not necessarily need to set that area as a low-reliability area.

[0066] FIGS. 8 and 9 are flowcharts showing examples of the operation of the medium reading process of the medium conveying device 100.

[0067] Hereinafter, an example of the operation of the medium reading process of the medium conveying device 100 will be described with reference to the flowcharts shown in FIGS. 8 and 9. Note that the flow of the operation described below is mainly executed by the processing circuit 150 in cooperation with each element of the medium conveying device 100 based on a program stored in advance in the storage device 140. The flow of the operation shown in FIGS. 8 and 9 is executed periodically.

[0068] First, the control unit 152 waits until an instruction to read a medium is input by the user using the operating device 105 and it receives an operation signal for instructing the reading of the medium from the operating device 105 (step S101).

[0069] Next, the control unit 152 determines whether a medium is placed on the mounting table 103 based on the first medium signal received from the first medium sensor 111 (step S102).

[0070] If no medium is placed on the mounting table 103, the control unit 152 returns the process to step S101 and waits until it newly receives an operation signal from the operating device 105.

[0071] On the other hand, if a medium is placed on the mounting table 103, the control unit 152 drives the motor 131 to rotate the feed roller 112, the brake roller 113, and the first to fourth transport rollers 114, 115, 118, and 119 to transport the medium (step S103).

[0072] Next, the image acquisition unit 153 causes the imaging device 117 to image the transported medium to acquire a line image (step S104). Note that the image acquisition unit 153 may determine whether the leading end of the medium has passed the position of the second medium sensor 116 based on the second medium signal received from the second medium sensor 116, and start imaging with the imaging device 117 when the leading end of the medium passes the position of the second medium sensor 116. The image acquisition unit 153 periodically acquires the second medium signal from the second medium sensor 116, and determines that the leading end of the medium has passed the position of the second medium sensor 116 when the signal value of the second medium signal changes from a value indicating the absence of the medium to a value indicating the presence of the medium.

[0073] Next, the image acquisition unit 153 determines whether the end portion of the medium in the main scanning direction at the leading end has been detected by the end detection unit 155 (step S105). The end portion of the medium in the main scanning direction at the leading end is detected in step S110 described later. If the end portion of the medium in the main scanning direction at the leading end has been detected, the image acquisition unit 153 proceeds to step S112.

[0074] On the other hand, if the end portion of the medium in the main scanning direction at the leading end has not been detected, the image acquisition unit 153 determines whether a predetermined number of line images have been acquired from the imaging device 117 (step S106). The predetermined number is preset to one or a plurality of values (for example, 100) that are considered to surely include the end portion of the medium in the main scanning direction at the leading end. The predetermined number may be set to a value that includes the entire medium. The larger the predetermined number is, the more surely the medium conveyance device 100 can detect the end portion, and the smaller the predetermined number is, the earlier the end portion can be detected. If the predetermined number of line images have not been acquired yet, the image acquisition unit 153 returns the process to step S104 and repeats the processes of steps S104 to S106.

[0075] On the other hand, if the predetermined number of line images have been acquired, the image acquisition unit 153 synthesizes the predetermined number of line images to generate an input image (step S107). That is, the input image is an image obtained by imaging the medium by the imaging device 117 and generated by the image acquisition unit 153. Note that the imaging device 117 may synthesize the predetermined number of line images to generate the input image, and the image acquisition unit 153 may acquire the input image from the imaging device 117.

[0076] FIG. 10 is a schematic diagram showing an example of the input image 1000.

[0077] The input image 1000 shown in FIG. 10 includes a medium 1001, and further includes a reference member 122 as a background 1002. The background 1002 includes vertical stripe noises 1003, 1004, burst noises 1005, 1006, and horizontal stripe noises 1007, 1008, 1009. The vertical stripe noises 1003, 1004 are noises generated by foreign matters such as paper dust, dust, glue, etc. attached to the imaging surface (glass surface) of the imaging device 117, or uneven sensitivity of the line sensor. The burst noises are noises generated when amplifying the electrical signal output from the imaging element in the imaging device 117, or noises generated due to differences in characteristics of each component. The horizontal stripe noises are noises generated when the second imaging device 117b moves in the height direction A8.

[0078] The horizontal stripe noise 1007 is a noise generated when the rear end of the medium 1001 passes through the feed roller 112 and the brake roller 113. The horizontal stripe noise 1008 is a noise generated when the front end of the medium 1001 passes through the third transport roller 118 and the fourth transport roller 119. The horizontal stripe noise 1009 is a noise generated when the rear end of the medium 1001 passes through the first transport roller 114 and the second transport roller 115. In the example shown in FIG. 10, in the area imaged by the imaging device 117 when the medium sandwiched between the feed roller 112 and the brake roller 113 contacts the second imaging device 117b, the amount of variation in the gradation value is sufficiently small and no horizontal stripe noise is generated.

[0079] Next, the edge pixel detection unit 154 reads the area table from the storage device 140 and identifies the low-reliability area (step S108). In the example described with reference to FIG. 10, as the low-reliability area, when the rear end of the medium passes through the feed roller 112 and the brake roller 113, when the front end of the medium passes through the third transport roller 118 and the fourth transport roller 119, and when the rear end of the medium passes through the first transport roller 114 and the second transport roller 115, it is assumed that the areas imaged by each imaging device 117 in the input image are set. On the other hand, when the medium sandwiched between the transport units contacts the second imaging device 117b, it is assumed that the areas imaged by each imaging device 117 in the input image are not set as low-reliability areas.

[0080] Next, the edge pixel detection unit 154 detects edge pixels in a plurality of sub-scanning directions from the input image (step S109). The edge pixel detection unit 154 detects edge pixels in the sub-scanning direction based on the gradation values of a plurality of pixels whose positions in the main scanning direction are the same in the input image and whose distances in the sub-scanning direction are within a predetermined range from each other.

[0081] For each vertical line extending in the vertical direction (sub-scanning direction) in the input image, the edge pixel detection unit 154 calculates, in order from the upper side, the absolute value of the difference in gradation values between two pixels adjacent to each pixel in the vertical direction within each vertical line (hereinafter referred to as the adjacent difference value). The edge pixel detection unit 154 detects, as edge pixels, pixels in each vertical line whose adjacent difference value exceeds the gradation threshold value. The edge pixel detection unit 154 designates the first detected edge pixel in each vertical line, that is, the pixel located at the uppermost side, as the upper end edge pixel and detects it as an edge pixel in the sub-scanning direction. The gradation value is a luminance value, a color value (R value, G value, or B value), or the like. The gradation threshold value is set, for example, to a difference in luminance values (e.g., 20) that allows a person to visually distinguish the difference in luminance on the image.

[0082] Note that the edge pixel detection unit 154 may calculate, as the adjacent difference value, the absolute value of the difference in gradation values between two pixels that are separated from each pixel in the input image by a predetermined distance in the vertical direction. Further, the edge pixel detection unit 154 may detect edge pixels by comparing the gradation value of each pixel in the input image with a threshold value. For example, when the gradation value of a specific pixel is less than the threshold value and the gradation value of a pixel adjacent to the specific pixel in the vertical direction or a pixel separated from the specific pixel by a predetermined distance is greater than or equal to the threshold value, the edge pixel detection unit 154 detects the specific pixel as an edge pixel.

[0083] Further, the edge pixel detection unit 154 may detect edge pixels in the sub-scanning direction not for all pixels in the input image, but for every certain interval (for example, 4 pixels) in the main scanning direction in the input image. The edge pixel detection unit 154 extracts target lines for detecting edge pixels in the sub-scanning direction at every certain interval from the vertical lines in the input image, and detects edge pixels in the sub-scanning direction for the extracted target lines. Thereby, the edge pixel detection unit 154 can reduce the time required for detecting the edge of the medium, and can reduce the processing time and processing load of the medium reading process.

[0084] The edge pixel detection unit 154 specifies the position of the edge pixel in the sub-scanning direction detected at the uppermost side in the input image as the position including the leading end of the medium, and specifies the region set as the low-reliability region based on the specified position. The edge pixel detection unit 154 does not detect edge pixels in the sub-scanning direction from the specified low-reliability region, and detects edge pixels in the sub-scanning direction only from the region in the input image that does not include the low-reliability region.

[0085] Note that the edge pixel detection unit 154 may specify the low-reliability region imaged by each imaging device 117 in the input image when the trailing end of the medium passes through the feed roller 112 and the brake roller 113 based on the first medium signal received from the first medium sensor 111. In that case, the edge pixel detection unit 154 periodically acquires the first medium signal from the first medium sensor 111. The edge pixel detection unit 154 determines that the trailing end of the medium is positioned immediately before the nip position of the feed roller 112 and the brake roller 113 when the signal value of the first medium signal changes from a value indicating the presence of the medium to a value indicating the absence of the medium. The edge pixel detection unit 154 specifies the region in the input image imaged by each imaging device 117 within a certain time after determining that the trailing end of the medium is positioned immediately before the nip position of the feed roller 112 and the brake roller 113 as the low-reliability region.

[0086] Similarly, the edge pixel detection unit 154 may identify a low-reliability area imaged by each imaging device 117 in the input image when the rear end of the medium passes through the first transport roller 114 and the second transport roller 115, based on the first medium signal received from the first medium sensor 111. After determining that the rear end of the medium is positioned immediately before the nip position of the feed roller 112 and the brake roller 113, the edge pixel detection unit 154 determines that the rear end of the medium is positioned immediately before the first transport roller 114 and the second transport roller 115 when a predetermined time corresponding to a predetermined medium movement amount has elapsed. The edge pixel detection unit 154 identifies, as a low-reliability area, an area within the input image imaged by each imaging device 117 within a certain time after determining that the rear end of the medium is positioned immediately before the first transport roller 114 and the second transport roller 115.

[0087] FIG. 11 is a schematic diagram for explaining the upper edge pixel.

[0088] Figure 11 shows the input image 1000 shown in Figure 10. In Figure 11, the dotted line extending in the vertical direction indicates the vertical line extracted as the target line. In the example shown in Figure 11, pixels T1 to T14 are detected as upper edge pixels. The upper edge pixels T1 and T2 are pixels corresponding to the burst noises 1005 and 1006 respectively. The upper edge pixel T3 is a pixel corresponding to the left side of the medium. The upper edge pixels T4 to T14 are pixels corresponding to the upper side of the medium. As shown in Figure 11, since each vertical stripe noise 1003, 1004 extends in the vertical direction and the tone values of the pixels within each vertical stripe noise 1003, 1004 are within a certain range, the pixels corresponding to each vertical stripe noise 1003, 1004 are not detected as upper edge pixels. Note that the vertical stripe noises that occur or disappear during the reading (during the medium conveyance) have a change in tone value at their ends, and thus are detected in the same way as the burst noises 1005, 1006. Such vertical stripe noises that occur or disappear during the reading (during the medium conveyance) are processed in the same way as the burst noises 1005, 1006 in the subsequent processing and are not erroneously detected as the ends of the medium. Also, since the peripheries of the horizontal stripe noises 1007, 1008, 1009 are set as low reliability regions, the pixels corresponding to the horizontal stripe noises 1007, 1008, 1009 are not detected as upper edge pixels.

[0089] Next, the end detection unit 155 detects the end in the main scanning direction of the leading edge of the medium based on the edge pixels in the sub-scanning direction detected from the region in the input image that does not include the low reliability region (step S110). The end detection unit 155 detects the end in the main scanning direction of the leading edge of the medium based on the positional relationship between the plurality of edge pixels in the sub-scanning direction detected by the edge pixel detection unit 154.

[0090] For example, as the positional relationship between a plurality of edge pixels in the sub-scanning direction, the end detection unit 155 calculates the number or ratio of edge pixels in the sub-scanning direction within a certain range in the main scanning direction, that is, the density of edge pixels in the sub-scanning direction within a certain range in the main scanning direction. For each target line extracted from the vertical line, the end detection unit 155 calculates the number or ratio of target lines in which edge pixels in the sub-scanning direction are detected among the target lines located within a certain range from each target line. The certain range is set so that the number of calculation targets for the number or ratio is a predetermined number (for example, 5) or more. The end detection unit 155 extracts a group of target lines in which target lines with the calculated number being equal to or greater than a threshold value (for example, 3), or target lines with the calculated ratio being equal to or greater than a threshold value (for example, 0.6) are adjacent to each other and continuous.

[0091] The end detection unit 155 detects the range in the main scanning direction of the group of target lines with the largest number of target lines included among the extracted groups of target lines as the leading edge range of the medium in the main scanning direction. Note that the end detection unit 155 may detect, as the leading edge range of the medium in the main scanning direction, a range reduced by a predetermined margin from the detected range, or a range expanded by a predetermined margin from the detected range. The end detection unit 155 detects the positions of both ends of the group of target lines detected as the leading edge range of the medium in the main scanning direction as the ends of the medium in the main scanning direction of the leading edge.

[0092] In the example shown in FIG. 11, the range from the target line including the upper-edge pixel T3 to the target line including the upper-edge pixel T14 is detected as the leading-edge range of the medium. Then, the target line including the upper-edge pixel T3 and the target line including the upper-edge pixel T14 are detected as the ends in the main scanning direction of the leading edge of the medium. That is, the pixels corresponding to the vertical stripe noises 1003 and 1004 are not detected as upper-edge pixels and thus are not included in the leading-edge range of the medium. Also, since the target lines including the upper-edge pixels T1 and T2 corresponding to the burst noises 1005 and 1006 are discretely located, they are not included in the leading-edge range of the medium. Further, the pixels corresponding to the horizontal stripe noises 1007, 1008, and 1009 are not detected as upper-edge pixels and thus are not included in the leading-edge range of the medium. Also, even if, for some of the target lines corresponding to the leading edge of the medium, the difference in gradation values between the background and the medium is small and the upper-edge pixels are not detected, if the upper-edge pixels are detected in the surrounding target lines, those some target lines are also included in the leading-edge range of the medium.

[0093] The end detection unit 155 can highly accurately detect the leading-edge range of the medium and its ends by reducing the influence of noise and the influence of omission in detecting the upper-edge pixels by using the number or ratio of edge pixels in the sub-scanning direction within a certain range. In particular, since the horizontal stripe noises are detected as edge pixels in the sub-scanning direction, they become a factor for erroneously detecting the leading-edge range of the medium when using the edge pixels in the sub-scanning direction to detect the leading-edge range of the medium. The end detection unit 155 can highly accurately detect the leading-edge range of the medium and its ends by using the upper-edge pixels by excluding the region where the horizontal stripe noises occur from the region where the upper-edge pixels are detected.

[0094] Note that the end detection unit 155 may detect edge pixels in the sub-scanning direction that are continuously detected in the main scanning direction as the positional relationship between a plurality of edge pixels in the sub-scanning direction. In that case, the end detection unit 155 calculates the number (continuous number) of edge pixels in the sub-scanning direction that are continuously detected in the main scanning direction. The end detection unit 155 extracts a group of target lines in which the target lines where edge pixels in the sub-scanning direction are detected are adjacent to each other and continue for a predetermined number (for example, three) or more.

[0095] The end detection unit 155 detects the range in the main scanning direction of the group of target lines with the largest number of target lines included among the extracted groups of target lines as the leading edge range of the medium in the main scanning direction. Note that the end detection unit 155 may detect, as the leading edge range of the medium in the main scanning direction, a range reduced by a predetermined margin from the detected range, or a range expanded by a predetermined margin from the detected range. The end detection unit 155 detects the positions of both ends of the group of target lines detected as the leading edge range of the medium in the main scanning direction as the ends in the main scanning direction of the leading edge of the medium.

[0096] In the example shown in FIG. 11, the range from the target line including the upper end edge pixel T3 to the target line including the upper end edge pixel T14 is detected as the leading edge range of the medium. Then, the target line including the upper end edge pixel T3 and the target line including the upper end edge pixel T14 are detected as the ends in the main scanning direction of the leading edge of the medium. That is, the pixels corresponding to the vertical bar noises 1003 and 1004 are not detected as upper end edge pixels and thus are not included in the leading edge range of the medium. Also, the target lines including the upper end edge pixels T1 and T2 corresponding to the burst noises 1005 and 1006 are discretely positioned and thus are not included in the leading edge range of the medium. Further, the pixels corresponding to the horizontal bar noises 1007, 1008, and 1009 are not detected as upper end edge pixels and thus are not included in the leading edge range of the medium.

[0097] In this case, if upper edge pixels are not detected in some of the target lines within the target line corresponding to the tip of the medium, the tip range of the medium is not correctly detected. However, the number of consecutive edge pixels in the sub-scanning direction is calculated in a shorter time than the number or ratio of edge pixels in the sub-scanning direction within a certain range. Therefore, the end detection unit 155 can detect the tip range of the medium and its end in a shorter time and with a lower load while reducing the influence of noise by relying on the edge pixels in the sub-scanning direction that are continuously detected in the main scanning direction. In particular, the end detection unit 155 can accurately detect the tip range of the medium and its end by using the upper edge pixels by excluding the region where horizontal stripe noise occurs from the region where the upper edge pixels are detected.

[0098] Also, the end detection unit 155 may calculate the approximation of the positions in the sub-scanning direction as the positional relationship between a plurality of edge pixels in the sub-scanning direction. For example, the end detection unit 155 calculates the distance in the sub-scanning direction between a plurality of edge pixels in the sub-scanning direction as the approximation of the positions in the sub-scanning direction. The end detection unit 155 extracts a group of target lines in which the target lines where edge pixels in the sub-scanning direction are detected are located within a first distance from each other in the main scanning direction and the edge pixels in the sub-scanning direction detected in each target line are located within a second distance in the sub-scanning direction. The first distance is set to a predetermined multiple (e.g., 2 times) of the distance between adjacent target lines, for example. The second distance is set to a predetermined multiple (e.g., 2 times) of the distance between adjacent target lines, for example.

[0099] The end detection unit 155 detects the range in the main scanning direction of the group of target lines with the largest number of included target lines among the extracted groups of target lines as the tip range of the medium in the main scanning direction. Note that the end detection unit 155 may detect, as the tip range of the medium in the main scanning direction, a range reduced by a predetermined margin from the detected range, or a range enlarged by a predetermined margin from the detected range. The end detection unit 155 detects the positions at both ends of the group of target lines detected as the tip range of the medium in the main scanning direction as the ends of the medium in the main scanning direction of the tip.

[0100] In the example shown in FIG. 11, the range from the target line including the upper edge pixel T4 to the target line including the upper edge pixel T14 is detected as the leading edge range of the medium. That is, the pixels corresponding to the vertical stripe noises 1003 and 1004 are not detected as upper edge pixels and thus are not included in the leading edge range of the medium. Also, the target lines including the upper edge pixels T1 and T2 corresponding to the burst noises 1005 and 1006 are discretely located and thus are not included in the leading edge range of the medium. Further, the pixels corresponding to the horizontal stripe noises 1007, 1008, and 1009 are not detected as upper edge pixels and thus are not included in the leading edge range of the medium. Also, the upper edge pixel T3 corresponding to the left side of the medium 1001 is separated in the main scanning direction from the upper edge pixels T4 and T5 located in the vicinity in the sub-scanning direction, and thus the target line including the upper edge pixel T3 is not included in the leading edge range of the medium.

[0101] Also, even if burst noise occurs in the vicinity of the medium in the main scanning direction, if the burst noise is separated from the leading edge of the medium in the sub-scanning direction, the burst noise is not included in the leading edge range of the medium. The end detection unit 155 can reduce the influence of noise and the influence of the side of the medium by using the distance in the sub-scanning direction between the edge pixels in the sub-scanning direction, and can detect the leading edge range of the medium and its end with high accuracy. In particular, the end detection unit 155 can detect the leading edge range of the medium and its end with high accuracy by using the upper edge pixels by excluding the region where the horizontal stripe noise occurs from the region where the upper edge pixels are detected.

[0102] Further, as the approximation of the position in the sub-scanning direction, the edge pixel frequency in the sub-scanning direction for each line in the main scanning direction may be calculated by the end detection unit 155. The end detection unit 155 calculates the number of edge pixels detected in the sub-scanning direction on each line in the main scanning direction. The end detection unit 155 generates a histogram with the position in the sub-scanning direction of each line in the main scanning direction as the class and the number calculated for each line in the main scanning direction as the frequency. The end detection unit 155 extracts, as a target line group, the target lines in which edge pixels in the sub-scanning direction are detected within a class range where the frequency is equal to or higher than a frequency threshold in the generated histogram. The frequency threshold is set in advance to a predetermined value (for example, 3). Note that the frequency threshold may be set dynamically according to the generated histogram. In that case, the frequency threshold is set to, for example, 1 / 2 of the maximum frequency.

[0103] The end detection unit 155 detects the range in the main scanning direction of the extracted target line group as the leading edge range of the medium in the main scanning direction. Note that the end detection unit 155 may detect, as the leading edge range of the medium in the main scanning direction, a range reduced by a predetermined margin from the detected range, or a range enlarged by a predetermined margin from the detected range. The end detection unit 155 detects the positions of both ends of the target line group detected as the leading edge range of the medium in the main scanning direction as the ends of the medium in the main scanning direction of the leading edge.

[0104] FIG. 12 is a schematic diagram for explaining the histogram 1200 generated by the end detection unit 155.

[0105] FIG. 12 shows a histogram 1200 generated from the input image 1000 shown in FIG. 10. In FIG. 12, the vertical axis represents the position (class) in the sub-scanning direction of the lines in each main scanning direction, and the horizontal axis represents the number (frequency) calculated for each line in the main scanning direction. In the example shown in FIG. 12, in the sub-scanning direction, the frequency is high in the range where the upper edge pixels T4 to T14 corresponding to the upper side of the medium exist. On the other hand, the frequency is low at the positions where the upper edge pixels T1, T2 corresponding to the burst noises 1005, 1006, and the upper edge pixel T3 corresponding to the left side of the medium exist.

[0106] Therefore, in the example shown in FIG. 11, the range from the target line including the upper edge pixel T4 to the target line including the upper edge pixel T14 is detected as the leading edge range of the medium. That is, the target lines including the upper edge pixels T1, T2 corresponding to the burst noises 1005, 1006, and the target line including the upper edge pixel T3 corresponding to the left side of the medium 1001 are not included in the leading edge range of the medium. The end detection unit 155 can reduce the influence of noise and the influence of the side of the medium by using the frequency of the edge pixels in the sub-scanning direction for each line in the main scanning direction, and can detect the leading edge range of the medium and its end with high accuracy. In particular, the end detection unit 155 can detect the leading edge range of the medium and its end with high accuracy by using the upper edge pixels by excluding the region where horizontal stripe noise occurs from the region where the upper edge pixels are detected.

[0107] Next, the medium width detection unit 156 detects the medium width based on the ends in the main scanning direction of the leading edge of the medium detected by the end detection unit 155 (step S111). The medium width detection unit 156 detects, for example, the Euclidean distance between both ends in the main scanning direction of the leading edge of the medium as the medium width. The medium width detection unit 156 calculates the Euclidean distance W between both ends in the main scanning direction of the leading edge of the medium according to the following formula (1).

Equation

[0108] Note that the medium width detection unit 156 may detect the distance in the main scanning direction between both ends in the main scanning direction of the leading end of the medium as the medium width. In that case, the medium width detection unit 156 calculates the distance W in the main scanning direction between both ends in the main scanning direction of the leading end of the medium according to the following formula (2).

Equation

[0109] Next, the image acquisition unit 153 determines whether the entire medium has been imaged (step S112). The image acquisition unit 153 determines, for example, whether the trailing end of the medium has passed the position of the second medium sensor 116 based on the second medium signal received from the second medium sensor 116. The image acquisition unit 153 periodically acquires the second medium signal from the second medium sensor 116, and when the signal value of the second medium signal changes from a value indicating the presence of the medium to a value indicating the absence of the medium, it determines that the leading end of the medium has passed the position of the second medium sensor 116. The image acquisition unit 153 determines that the entire medium has been imaged when a predetermined time has elapsed after the trailing end of the medium has passed the position of the second medium sensor 116 and the trailing end of the medium has passed the imaging position of the imaging device 117. Note that the image acquisition unit 153 may determine that the entire conveyed medium has been imaged when it has acquired a predetermined number of line images from the imaging device 117.

[0110] If the entire conveyed medium has not yet been imaged, the image acquisition unit 153 returns the process to step S104 and repeats the processes of steps S104 to S112.

[0111] On the other hand, when the entire conveyed medium has been imaged, the image acquisition unit 153 generates a read image by combining all the acquired line images (step S113). Note that when the number of lines (predetermined number) included in the input image is set to a value that includes the entire medium, the image acquisition unit 153 may use the input image as the read image.

[0112] Next, the edge pixel detection unit 154 detects a plurality of edge pixels in the main scanning direction from the read image (step S114). The edge pixel detection unit 154 detects the edge pixels in the main scanning direction based on the gradation values of a plurality of pixels whose positions in the sub-scanning direction are the same and whose distances in the main scanning direction are within a predetermined range in the read image. Further, the edge pixel detection unit 154 detects the edge pixels in the main scanning direction within a range of a predetermined distance from two end portions in the main scanning direction of the leading end of the medium detected by the end portion detection unit 155 in the main scanning direction.

[0113] The end detection unit 155 calculates, for each horizontal line extending in the horizontal direction (main scanning direction) within the read image, the horizontal adjacent difference value of each pixel in each horizontal line in order from the left within a range of a predetermined distance from the left end of the leading edge of the medium detected by the end detection unit 155. The end detection unit 155 detects, as edge pixels, the pixels in each horizontal line whose adjacent difference value exceeds the gradation threshold value. The end detection unit 155 designates, as the left end edge pixel, the first detected edge pixel in each horizontal line, that is, the pixel located most to the left within a range of a predetermined distance from the left end of the leading edge of the medium detected by the end detection unit 155. Similarly, the end detection unit 155 detects edge pixels in order from the right within a range of a predetermined distance from the right end of the leading edge of the medium detected by the end detection unit 155. The end detection unit 155 designates, as the right end edge pixel, the first detected edge pixel in each horizontal line, that is, the pixel located most to the right within a range of a predetermined distance from the right end of the leading edge of the medium detected by the end detection unit 155. The end detection unit 155 detects the left end edge pixel and the right end edge pixel as the edge pixels in the main scanning direction.

[0114] Note that the end detection unit 155 may calculate, as the adjacent difference value, the absolute value of the difference between the gradation values of two pixels that are separated from each pixel in the read image by a predetermined distance in the horizontal direction. Further, the end detection unit 155 may detect edge pixels by comparing the gradation value of each pixel in the read image with a threshold value. For example, when the gradation value of a specific pixel is less than the threshold value and the gradation value of a pixel adjacent to the specific pixel in the horizontal direction or a pixel separated by a predetermined distance is greater than or equal to the threshold value, the end detection unit 155 detects the specific pixel as an edge pixel.

[0115] Further, instead of detecting edge pixels in the main scanning direction for all pixels in the read image, the end detection unit 155 may detect edge pixels in the main scanning direction at regular intervals (for example, every 4 pixels) in the sub-scanning direction within the read image. The end detection unit 155 extracts target lines for detecting edge pixels in the main scanning direction at regular intervals from among the horizontal lines in the read image, and detects edge pixels in the main scanning direction for the extracted target lines. Thereby, the end detection unit 155 can reduce the time required for detecting the end of the medium, and can reduce the processing time and processing load of the medium reading process.

[0116] Also, similar to the case of detecting edge pixels in the sub-scanning direction, the edge pixel detection unit 154 does not detect edge pixels in the main scanning direction from the low-reliability region, and detects edge pixels in the main scanning direction only from regions in the input image that do not include the low-reliability region.

[0117] FIG. 13 is a schematic diagram for explaining the left-end edge pixels and the right-end edge pixels.

[0118] FIG. 13 shows the input image 1000 shown in FIG. 10. In FIG. 10, the dotted lines extending in the horizontal direction indicate the horizontal lines extracted as target lines. In the example shown in FIG. 13, pixels L1 to L11 are detected as left-end edge pixels, and pixels R1 to R11 are detected as right-end edge pixels. The left-end edge pixels L1 to L11 are pixels corresponding to the left side of the medium, respectively. The right-end edge pixels R1 to R11 are pixels corresponding to the right side of the medium, respectively. Each edge pixel is detected within a range of a predetermined distance in the main scanning direction from each end T3, T14 of the leading end of the medium detected by the end detection unit 155. Therefore, the edge pixels corresponding to the side of the medium are detected well without being affected by the vertical stripe noises 1003, 1004 and the burst noises 1005, 1006. Also, the peripheries of the horizontal stripe noises 1007, 1008, 1009 are set as low-reliability regions. Therefore, the edge pixels corresponding to the side of the medium are detected well without being affected by the horizontal stripe noises 1007, 1008, 1009.

[0119] Next, the end detection unit 155 detects the side edges of the medium as the ends in the main scanning direction of the medium based on the edge pixels in the main scanning direction (step S115). The end detection unit 155 uses the least squares method to detect the straight line passing through each left end edge pixel as the left side of the medium, and the straight line passing through each right end edge pixel as the right side of the medium. Note that the end detection unit 155 may use the Hough transform to detect the straight line passing through each edge pixel as the side edge of the medium.

[0120] Next, the end detection unit 155 detects the end in the main scanning direction of the rear end of the medium (step S116). The edge pixel detection unit 154 detects edge pixels in the input image or the read image in the same manner as the process in step S109, and detects the edge pixel located at the lowermost side in each vertical line as the lower end edge pixel (the edge pixel in the sub-scanning direction). The end detection unit 155 detects the end in the main scanning direction of the rear end of the medium based on the lower end edge pixel in the same manner as the process in step S110.

[0121] Next, the output control unit 157 generates a cut-out image by cutting out the area of the medium from the read image (step S117). The output control unit 157 uses the least squares method or the Hough transform to detect the straight line passing through the upper end edge pixel as the upper side of the medium, and the straight line passing through the lower end edge pixel as the lower side of the medium. The output control unit 157 detects the area surrounded by the detected upper and lower sides and the two side edges of the medium detected by the end detection unit 155 as the area of the medium. The output control unit 157 cuts out the detected area of the medium to generate a cut-out image.

[0122] Next, the output control unit 157 outputs the generated cut-out image by transmitting it to the information processing apparatus via the interface device 132 (step S118). The output control unit 157 may output the generated cut-out image by displaying it on the display device 106. The side edge of the medium in the cut-out image is the end in the main scanning direction of the medium detected by the end detection unit 155, and the cut-out image is an example of information regarding the end detected by the end detection unit 155. Note that the output control unit 157 may transmit the read image to the information processing apparatus without generating a cut-out image, and transmit coordinates indicating the position of the end in the main scanning direction of the medium detected by the end detection unit 155 within the read image to the information processing apparatus as information regarding the end. In that case, the information processing apparatus generates a cut-out image from the read image based on the received coordinates.

[0123] Also, in step S110, the output control unit 157 may determine whether the medium is a card or paper based on the end of the leading edge of the medium detected by the end detection unit 155. In that case, when the distance between the ends of the leading edge of the medium is equal to or less than a threshold value, the output control unit 157 determines that the medium is a card, and when the distance between the ends of the leading edge of the medium is greater than the threshold value, the output control unit 157 determines that the medium is paper. The threshold value is set to a value obtained by adding a margin to the size in the longitudinal direction of the card defined in ISO / IEC 7810, for example. The output control unit 157 transmits information indicating whether the medium is a card or paper to the information processing apparatus as information regarding the end of the medium. In this case, the information processing apparatus classifies the received image according to whether the medium is a card or paper. Also, the output control unit 157 periodically determines whether double feeding of the conveyed medium has occurred based on an ultrasonic signal output from an ultrasonic sensor (not shown), and may stop the conveyance of the medium when double feeding of the medium has occurred. In that case, when the medium is a card, the output control unit 157 may determine that double feeding of the medium has not occurred. Thereby, the output control unit 157 can suppress erroneously determining that double feeding of the medium has occurred when the card is conveyed.

[0124] Further, the output control unit 157 may detect the size of the medium based on the end portions of the medium in the main scanning direction detected by the end detection unit 155, and change the rotation speeds (the discharge speed of the medium) of the third conveyance roller 118 and the fourth conveyance roller 119 according to the detected size of the medium. In that case, the output control unit 157 detects the distance between the end portions in the main scanning direction of the medium as the size of the medium. And when it is determined in step S112 that the entire medium has been imaged, the output control unit 157 changes the rotation speed of the motor 131 so as to change the rotation speeds of the third conveyance roller 118 and the fourth conveyance roller 119 according to the detected size of the medium. The output control unit 157 changes the rotation speed of the motor 131 such that the smaller the size of the medium, the lower (slower) the rotation speed, and the larger the size of the medium, the higher (faster) the rotation speed. Thereby, the medium conveyance device 100 can suppress the small-sized medium from being discharged forcefully and scattered on the discharge table 104, and can improve the alignment of the media on the discharge table 104.

[0125] Also, in step S110, the output control unit 157 may determine whether skew of the medium has occurred based on the end portions of the leading edge of the medium detected by the end detection unit 155. In that case, the medium conveyance device 100 stores in advance in the storage device 140 a table in which the range of the position of the end portion of the leading edge of the medium, which is regarded as the occurrence of skew of the medium, and the range of the inclination (angle with respect to the main scanning direction) of the leading edge of the medium are set. The output control unit 157 calculates the inclination of the straight line passing through the two end portions of the leading edge of the medium detected by the end detection unit 155. The output control unit 157 determines whether skew of the medium has occurred based on whether the two end portions of the leading edge of the medium detected by the end detection unit 155 and the calculated inclination are included in a preset range. When the output control unit 157 determines that skew of the medium has occurred, it stops the motor 131 to stop the conveyance of the medium, and outputs, as information regarding the end portion of the medium, information indicating that an abnormality has occurred in the conveyance of the medium, and notifies the user.

[0126] Next, the control unit 152 determines whether there is any medium remaining on the mounting table 103 based on the first medium signal received from the first medium sensor 111 (step S119). If there is any medium remaining on the mounting table 103, the control unit 152 returns the process to step S104 and repeats the processes of steps S104 to S119.

[0127] On the other hand, if there is no medium remaining on the mounting table 103, the control unit 152 stops the motor 131 (step S120) and ends the series of steps.

[0128] Note that the process of step S111 may be omitted. Also, the processes of steps S114 to S117 may be omitted, and in step S118, the output control unit 157 may output the read image. Further, in step S109, the edge pixel detection unit 154 may detect edge pixels in the sub-scanning direction from the entire area within the input image. In that case, in step S110, the end detection unit 155 detects the end in the main scanning direction of the medium based only on the edge pixels in the sub-scanning direction detected from the area that does not include the low-reliability area among the edge pixels detected by the edge pixel detection unit 154 within the input image. Similarly, in step S114, the edge pixel detection unit 154 may detect edge pixels in the main scanning direction from the entire area within the input image. In that case, in step S115, the end detection unit 155 detects the end in the main scanning direction of the medium based only on the edge pixels in the main scanning direction detected from the area that does not include the low-reliability area among the edge pixels detected by the edge pixel detection unit 154 within the input image.

[0129] As described in detail above, the medium conveyance device 100 detects the end in the main scanning direction of the medium without using the edge pixels in the low-reliability area where the gradation value of the reference member 122 changes when a medium such as a highly rigid card is conveyed within the input image. Thereby, the medium conveyance device 100 can remove the influence of the noise generated by the movement in the height direction A8 of the second imaging device 117b and detect the end in the main scanning direction of the medium from the image with higher accuracy.

[0130] In particular, even when the medium conveyance device 100 cannot remove foreign matter in an image using a reference image acquired in advance, such as when foreign matter adheres to or detaches from the imaging device 117 during medium reading, it is possible to reduce the influence of vertical stripe noise.

[0131] Also, the medium conveyance device 100 can detect the end portion of the medium in the main scanning direction at the leading edge of the medium earlier (in real time) because it detects the end portion of the medium in the main scanning direction at the leading edge of the medium based on an input image including a predetermined number of line images before the entire medium is imaged.

[0132] FIG. 14 and FIG. 15 are flowcharts showing examples of operations of other medium reading processes. The flowcharts shown in FIGS. 14 and 15 are executed instead of the flowcharts shown in FIGS. 8 and 9. Since the processes of steps S201 to S207, S211 to S213, and S218 to S221 in FIGS. 14 and 15 are the same as the processes of steps S101 to S107, S111 to S113, and S117 to S120 in FIGS. 8 and 9, detailed descriptions thereof are omitted. Hereinafter, only steps S208 to S210 and S214 to S217 will be described.

[0133] In step S208, the edge pixel detection unit 154 detects a plurality of edge pixels in the sub-scanning direction from the input image in the same manner as the process of step S109 in FIG. 7 (step S208). However, the edge pixel detection unit 154 detects edge pixels in the sub-scanning direction from the entire area within the input image.

[0134] Next, the variation region detection unit 158 detects a variation region in which the gradation value varies with respect to peripheral pixels within the region including the reference member 122 in the input image (step S209). The variation region detection unit 158 detects the variation region based on the positional relationship of the plurality of edge pixels in the sub-scanning direction detected by the edge pixel detection unit 154.

[0135] For example, for each horizontal line in the input image, the variable region detection unit 158 detects the pixel detected as the leftmost edge pixel in the sub-scanning direction at the leftmost side as the left end edge pixel, and the pixel detected as the rightmost edge pixel in the sub-scanning direction at the rightmost side as the right end edge pixel. The variable region detection unit 158 calculates the variation values of the positions of the left end edge pixel and the right end edge pixel of each horizontal line with respect to the left end edge pixel and the right end edge pixel of the horizontal line adjacent to or within a predetermined distance below that horizontal line in the sub-scanning direction. The variable region detection unit 158 calculates, as the variation value of the position of each edge pixel, a division value obtained by dividing the difference in the main scanning direction position of the corresponding two edge pixels by the difference in the sub-scanning direction position of the two edge pixels.

[0136] The variable region detection unit 158 scans each horizontal line from the uppermost horizontal line downward, and detects the position of the horizontal line at which the magnitude of the variation value of either the left end edge pixel or the right end edge pixel first becomes greater than or equal to the variation threshold as the leading edge position of the medium. The variable region detection unit 158 further scans each horizontal line downward from the horizontal line detected as the leading edge position. The variable region detection unit 158 detects, as the variable region, the region below the horizontal line at which the magnitude of the variation value of either the left end edge pixel or the right end edge pixel once becomes less than the variation threshold and then becomes greater than or equal to the variation threshold again, or the horizontal line above that horizontal line by a predetermined margin.

[0137] FIG. 16 is a schematic diagram for explaining the variable region.

[0138] The graph 1600 in FIG. 16 is a graph showing the positions of the left-edge pixel and the right-edge pixel in the input image 1000. In the graph 1600, the vertical axis indicates the position in the sub-scanning direction within the input image, and the horizontal axis indicates the position in the main-scanning direction within the input image. In the graph 1600, the solid line 1601 indicates the position of the left-edge pixel, and the dotted line 1602 indicates the position of the right-edge pixel. The area 1603 within the solid line 1601 corresponds to the left side of the medium 1001. The area 1604 corresponds to the horizontal stripe noise 1007. The area 1605 within the dotted line 1602 corresponds to the upper side of the medium 1001. The area 1606 corresponds to the right side of the medium 1001. The area 1607 corresponds to the horizontal stripe noise 1007.

[0139] The graph 1620 in FIG. 16 is a graph showing the change in the positions of the left-edge pixel and the right-edge pixel in the input image 1000. In the graph 1620, the vertical axis indicates the position in the sub-scanning direction within the input image, and the horizontal axis indicates the fluctuation value. In the graph 1620, the solid line 1621 indicates the fluctuation value for the left-edge pixel, and the dotted line 1622 indicates the fluctuation value for the right-edge pixel. The areas 1623 - 1624 within the solid line 1621 correspond to the areas 1603 - 1604 within the solid line 1601, and the areas 1625 - 1627 within the dotted line 1622 correspond to the areas 1605 - 1607 within the dotted line 1602.

[0140] When looking at the fluctuation values from the top in the graph 1620, first, the absolute value of the fluctuation value is large in the area 1625 of the right-edge pixel corresponding to the upper side of the medium 1001. Then, the absolute value of the fluctuation value is small in the area 1623 of the left-edge pixel corresponding to the left side of the medium 1001 and the area 1626 of the right-edge pixel corresponding to the right side of the medium 1001. And the absolute value of the fluctuation value becomes large again in the area 1624 of the left-edge pixel corresponding to the horizontal stripe noise 1007 and the area 1627 of the right-edge pixel corresponding to the horizontal stripe noise 1007. Therefore, in the sub-scanning direction, the area below the area 1624 or the area 1627, that is, the area below the horizontal stripe noise 1007, is detected as the fluctuation area.

[0141] Next, the end detection unit 155 detects the end in the main scanning direction of the leading edge of the medium based on the edge pixels in the sub-scanning direction detected from the region that does not include the variation region detected by the variation region detection unit 158 in the input image (step S210). The end detection unit 155 detects the end in the main scanning direction of the leading edge of the medium in the same manner as the process in step S110.

[0142] Also, in step S214, the edge pixel detection unit 154 detects a plurality of edge pixels in the main scanning direction from the read image in the same manner as the process in step S114 of FIG. 8 (step S214). However, the edge pixel detection unit 154 detects the edge pixels in the main scanning direction from the entire region in the read image.

[0143] Next, the variation region detection unit 158 detects a variation region based on the positional relationship of the plurality of edge pixels in the main scanning direction detected by the edge pixel detection unit 154 (step S215).

[0144] The variation region detection unit 158 detects a variation region using the left end edge pixels and the right end edge pixels of each horizontal line detected in step S214. The variation region detection unit 158 calculates the variation values of the positions of the left end edge pixels and the right end edge pixels of the horizontal lines adjacent to or within a predetermined distance from that horizontal line in the downward direction in the sub-scanning direction with respect to the left end edge pixels and the right end edge pixels of each horizontal line. The variation region detection unit 158 calculates, as the variation value of the position of each edge pixel, a division value obtained by dividing the difference in the main scanning direction position of the corresponding two edge pixels by the difference in the sub-scanning direction position of the two edge pixels.

[0145] The variation region detection unit 158 scans each horizontal line downward from the horizontal line at the leading edge position of the medium detected in step S210. The variation region detection unit 158 detects, as the variation region, a region in which the magnitude of the variation value of either the left end edge pixel or the right end edge pixel becomes equal to or greater than the variation threshold in the sub-scanning direction, or a region obtained by expanding that region by a predetermined margin.

[0146] FIG. 17 is a schematic diagram for explaining a variable region.

[0147] Graph 1700 in FIG. 17 is a graph showing the positions of the left-end edge pixel and the right-end edge pixel in input image 1000. In graph 1700, the vertical axis indicates the position in the sub-scanning direction within the input image, and the horizontal axis indicates the position in the main scanning direction within the input image. In graph 1700, solid line 1701 indicates the position of the left-end edge pixel, and dotted line 1702 indicates the position of the right-end edge pixel. Region 1703 within solid line 1701 corresponds to vertical stripe noise 1003. Region 1704 corresponds to burst noise 1005 and horizontal stripe noise 1007. Region 1705 corresponds to horizontal stripe noise 1008. Region 1706 corresponds to burst noise 1006. Region 1707 corresponds to horizontal stripe noise 1009. Region 1708 within dotted line 1702 corresponds to vertical stripe noise 1004. Region 1709 corresponds to horizontal stripe noise 1007. Region 1710 corresponds to horizontal stripe noise 1008. Region 1711 corresponds to horizontal stripe noise 1009.

[0148] Graph 1720 in FIG. 17 is a graph showing the change in the positions of the left-end edge pixel and the right-end edge pixel in input image 1000. In graph 1720, the vertical axis indicates the position in the sub-scanning direction within the input image, and the horizontal axis indicates the variation value. In graph 1720, solid line 1721 indicates the variation value for the left-end edge pixel, and dotted line 1722 indicates the variation value for the right-end edge pixel. Regions 1723 to 1727 within solid line 1721 correspond to regions 1703 to 1707 within solid line 1701, and regions 1728 to 1731 within dotted line 1722 correspond to regions 1708 to 1711 within dotted line 1702.

[0149] When looking at the variation value in graph 1720 from the tip position of the medium downward, the absolute value of the variation value is large in the regions corresponding to horizontal stripe noises 1007, 1008, 1009, and the regions corresponding to burst noises 1005, 1006. Therefore, in the sub-scanning direction, the regions corresponding to horizontal stripe noises 1007, 1008, 1009, and the regions corresponding to burst noises 1005, 1006 are detected as variable regions.

[0150] FIG. 18 is a schematic diagram for explaining other variable regions.

[0151] Graph 1800 in FIG. 18 is a graph showing the positions of the left - end edge pixel and the right - end edge pixel when vertical stripe noises 1003 and 1004 do not exist in the input image 1000. In graph 1800, the vertical axis represents the position in the sub - scanning direction within the input image, and the horizontal axis represents the position in the main - scanning direction within the input image. In graph 1800, the solid line 1801 indicates the position of the left - end edge pixel, and the dotted line 1802 indicates the position of the right - end edge pixel. Region 1803 within the solid line 1801 corresponds to the left side of the medium 1001. Region 1804 corresponds to the burst noise 1005 and the horizontal stripe noise 1007. Region 1805 corresponds to the horizontal stripe noise 1008. Region 1806 corresponds to the burst noise 1006. Region 1807 corresponds to the horizontal stripe noise 1009. Region 1808 corresponds to the lower side of the medium 1001. Region 1809 within the dotted line 1802 corresponds to the upper side of the medium 1001. Region 1810 corresponds to the right side of the medium 1001. Region 1811 corresponds to the horizontal stripe noise 1007. Region 1812 corresponds to the horizontal stripe noise 1008. Region 1813 corresponds to the horizontal stripe noise 1009.

[0152] Graph 1820 in FIG. 18 is a graph showing the change in the positions of the left - end edge pixel and the right - end edge pixel within the input image 1000. In graph 1820, the vertical axis represents the position in the sub - scanning direction within the input image, and the horizontal axis represents the variation value. In graph 1820, the solid line 1821 indicates the variation value for the left - end edge pixel, and the dotted line 1822 indicates the variation value for the right - end edge pixel. Regions 1823 - 1728 within the solid line 1821 correspond to regions 1803 - 1808 within the solid line 1801, and regions 1829 - 1833 within the dotted line 1822 correspond to regions 1809 - 1813 within the dotted line 1802.

[0153] When looking downward from the tip position of the medium at the fluctuation values in Graph 1820, the absolute values of the fluctuation values are large in the regions corresponding to the horizontal stripe noises 1007, 1008, 1009 and the regions corresponding to the burst noises 1005, 1006. Therefore, in the sub-scanning direction, the regions corresponding to the horizontal stripe noises 1007, 1008, 1009 and the regions corresponding to the burst noises 1005, 1006 are detected as fluctuation regions.

[0154] Next, the end detection unit 155 detects the side edge of the medium as the end in the main scanning direction of the medium based on the edge pixels in the main scanning direction detected from the region that does not include the fluctuation region detected by the fluctuation region detection unit 158 in the read image (step S216). In this case, the edge pixel detection unit 154 detects a plurality of edge pixels in the main scanning direction from the read image again in the same manner as the process in step S114. That is, the edge pixel detection unit 154 detects the edge pixels in the main scanning direction within the region within a predetermined distance from the two ends in the main scanning direction of the tip of the medium detected by the end detection unit 155 in the main scanning direction. Then, the end detection unit 155 detects the end of the medium in the main scanning direction in the same manner as the process in step S115.

[0155] Next, the end detection unit 155 detects the end in the main scanning direction of the rear end of the medium based on the edge pixels in the sub-scanning direction detected from the region that does not include the fluctuation region detected by the fluctuation region detection unit 158 in the read image (step S217).

[0156] The edge pixel detection unit 154 detects edge pixels in the input image or the read image in the same manner as the process in step S208, and detects the pixel located at the lowermost position in each vertical line as the lower end edge pixel (the edge pixel in the sub-scanning direction). Further, the end detection unit 155 detects the end in the main scanning direction of the rear end of the medium based on the lower end edge pixel in the same manner as the process in step S209. The variation region detection unit 158 scans each horizontal line upward from the horizontal line located at the lowermost position, and detects the position of the horizontal line at which the magnitude of the variation value of either the left end edge pixel or the right end edge pixel first becomes equal to or greater than the variation threshold value as the rear end position of the medium. The variation region detection unit 158 further scans each horizontal line upward from the horizontal line detected as the rear end position. The variation region detection unit 158 detects, as the variation region, the region above the horizontal line at which the magnitude of the variation value of either the left end edge pixel or the right end edge pixel once becomes less than the variation threshold value and then becomes equal to or greater than the variation threshold value again, or the horizontal line located a predetermined margin below that horizontal line.

[0157] As described in detail above, the medium conveyance device 100 can detect the end in the main scanning direction of the medium with higher accuracy even when detecting the end in the main scanning direction of the medium without using the edge pixels in the dynamically detected variation region.

[0158] In particular, the medium conveyance device 100 can detect the end of the medium from the image regardless of the size or type of the medium by automatically detecting without presetting a region that does not use edge pixels.

[0159] FIG. 19 is a diagram showing a schematic configuration of a processing circuit 250 in an image reading apparatus according to still another embodiment. The processing circuit 250 is used in place of the processing circuit 150 of the medium conveyance apparatus 100 and executes a medium reading process. The processing circuit 250 includes a setting circuit 251, a control circuit 252, an image acquisition circuit 253, an edge pixel detection circuit 254, an end detection circuit 255, a medium width detection circuit 256, an output control circuit 257, a variation region detection circuit 258, and the like. Note that each of these units may be configured by an independent integrated circuit, microprocessor, firmware, or the like.

[0160] The setting circuit 251 is an example of a setting unit and has the same function as the setting unit 151. The setting circuit 251 sets a low-reliability region and stores it in the storage device 140.

[0161] The control circuit 252 is an example of a control unit and has the same function as the control unit 152. The control circuit 252 receives an operation signal from the operation device 105 and a medium detection signal from the first medium sensor 111, drives the motor 131 according to each received signal, and controls the conveyance of the medium.

[0162] The image acquisition circuit 253 is an example of an image acquisition unit and has the same function as the image acquisition unit 153. The image acquisition circuit 253 receives a second medium signal from the second medium sensor 116, receives a line image from the imaging device 117, generates an input image, and stores the line image and the input image in the storage device 140.

[0163] The edge pixel detection circuit 254 is an example of an edge pixel detection unit and has the same function as the edge pixel detection unit 154. The edge pixel detection circuit 254 reads an input image from the storage device 140, detects edge pixels from the input image, and stores the detection result in the storage device 140.

[0164] The end detection circuit 255 is an example of an end detection unit and has the same function as the end detection unit 155. The end detection circuit 255 reads out the input image, the detection result of edge pixels, and the setting information of the low-reliability region or the detection result of the fluctuation region from the storage device 140. The end detection circuit 255 detects the end in the main scanning direction of the medium based on the edge pixels detected from the region in the input image that does not include the low-reliability region or the fluctuation region, and stores the detection result in the storage device 140.

[0165] The medium width detection circuit 256 is an example of a medium width detection unit and has the same function as the medium width detection unit 156. The medium width detection circuit 256 reads out the detection result of the end in the main scanning direction of the medium from the storage device 140, detects the medium width based on the end in the main scanning direction of the medium, and stores the detection result in the storage device 140.

[0166] The output control circuit 257 is an example of an output control unit and has the same function as the output control unit 157. The output control circuit 257 reads out the line image from the storage device 140 to generate a read image. Further, the output control circuit 257 reads out the detection result of the end in the main scanning direction of the medium, generates a cut-out image based on the end in the main scanning direction of the medium, and transmits it to an information processing device (not shown) via the interface device 132.

[0167] The fluctuation region detection circuit 258 is an example of a fluctuation region detection unit and has the same function as the fluctuation region detection unit 158. The fluctuation region detection circuit 258 reads out the input image and the detection result of edge pixels from the storage device 140, detects the fluctuation region based on the positional relationship of a plurality of edge pixels, and stores the detection result in the storage device 140.

[0168] As described in detail above, even when the image reading apparatus uses the processing circuit 250, it is possible to detect the end in the main scanning direction of the medium from the image with higher accuracy.

Description of Reference Numerals

[0169] 100 Medium conveyance device 112 Feed roller 113 Brake roller 114 First conveying roller 115 Second conveying roller 117 Imaging device 122 Reference member 118 Third conveying roller 119 Fourth conveying roller 140 Storage device 154 Edge pixel detection unit 155 End detection unit 156 Medium width detection unit 157 Output control unit 158 Fluctuation region detection unit

Claims

1. A transport unit that transports the medium; an imaging unit that images the medium being conveyed; an output control unit that generates a cut-out image by cutting out an area of ​​the medium from an input image of the medium captured by the imaging unit based on an end position in a main scanning direction of the medium in an area that does not include a specific area based on a positional relationship between the imaging position of the imaging unit and the arrangement position of the transport unit, and outputs the cut-out image; A medium transport device comprising:

2. The medium transport device according to claim 1 , wherein the specific area is an area imaged by the imaging section when a leading edge or a trailing edge of the transported medium passes through the transport section.

3. the imaging unit is provided so as to be movable upward by being pushed up by a medium being conveyed; The medium conveying device according to claim 1 or 2, wherein the specific area is an area that is imaged by the imaging unit when the medium clamped in the conveying unit comes into contact with either the imaging unit or a member that moves in conjunction with the imaging unit.

4. A transport unit that transports the medium; A reference member having a single color; an imaging unit that is disposed opposite the reference member and captures an image of the medium and the reference member being conveyed; an output control unit that generates and outputs a cut-out image of an area of ​​the medium based on an end position in a main scanning direction of the medium in an area that does not include a variable area in which a gradation value varies with respect to surrounding pixels within an area that includes the reference member from an input image in which the medium and the reference member are imaged by the imaging unit, The variable region is a region including the first horizontal line for which either a value obtained by dividing a positional difference in the main scanning direction between a left-end edge pixel of a first horizontal line and a left-end edge pixel of a second horizontal line within a predetermined distance from the first horizontal line by a positional difference in the sub-scanning direction between the left-end edge pixel of the first horizontal line and the left-end edge pixel of the second horizontal line, or a value obtained by dividing a positional difference in the main scanning direction between a right-end edge pixel of the first horizontal line and a right-end edge pixel of the second horizontal line by a positional difference in the sub-scanning direction between the right-end edge pixel of the first horizontal line and the right-end edge pixel of the second horizontal line, is equal to or greater than a threshold value. A medium transport device comprising:

5. A method for controlling a medium conveying device having a conveying unit that conveys a medium and an imaging unit that images the conveyed medium, comprising: generating a cut-out image by cutting out an area of ​​the medium from an input image of the medium captured by the imaging unit, based on an end position in a main scanning direction of the medium in an area that does not include a specific area based on a positional relationship between an imaging position of the imaging unit and an arrangement position of the transport unit, and outputting the cut-out image; A control method comprising:

6. A method for controlling a medium transport device having a transport unit that transports a medium, a reference member having a single color, and an imaging unit that is disposed opposite the reference member and captures an image of the transported medium and the reference member, comprising: generating and outputting a cut-out image of an area of ​​the medium based on an end position in a main scanning direction of the medium in an input image in which the medium and the reference member are imaged by the imaging unit, in an area including the reference member and not including a variable area in which a gradation value varies with respect to surrounding pixels; a control method characterized in that the variable area is an area including the first horizontal line for which either a value obtained by dividing the positional difference in the main scanning direction between the left-most edge pixel of a first horizontal line and the left-most edge pixel of a second horizontal line within a predetermined distance from the first horizontal line by the positional difference in the sub-scanning direction between the left-most edge pixel of the first horizontal line and the left-most edge pixel of the second horizontal line, or a value obtained by dividing the positional difference in the main scanning direction between the right-most edge pixel of the first horizontal line and the right-most edge pixel of the second horizontal line by the positional difference in the sub-scanning direction between the right-most edge pixel of the first horizontal line and the right-most edge pixel of the second horizontal line, is greater than or equal to a threshold value.

7. A control program for a medium conveying device having a conveying unit that conveys a medium and an imaging unit that images the conveyed medium, the control program comprising: generating a cut-out image by cutting out an area of ​​the medium from an input image of the medium captured by the imaging unit, based on an end position in a main scanning direction of the medium in an area that does not include a specific area based on a positional relationship between an imaging position of the imaging unit and an arrangement position of the transport unit, and outputting the cut-out image; A control program for causing the medium transport device to execute the above steps.

8. A control program for a medium conveying device having a conveying unit that conveys a medium, a reference member having a single color, and an imaging unit that is disposed opposite the reference member and captures an image of the conveyed medium and the reference member, the control program comprising: causing the medium conveying device to generate and output a cut-out image obtained by cutting out an area of ​​the medium from an input image in which the medium and the reference member are imaged by the imaging unit, based on an end position in a main scanning direction of the medium in an area that does not include a variable area in which a gradation value varies with respect to surrounding pixels within the area that includes the reference member; a control program characterized in that the variable area is an area including the first horizontal line for which either a value obtained by dividing the positional difference in the main scanning direction between a left-end edge pixel of a first horizontal line and a left-end edge pixel of a second horizontal line within a predetermined distance from the first horizontal line by the positional difference in the sub-scanning direction between the left-end edge pixel of the first horizontal line and the left-end edge pixel of the second horizontal line, or a value obtained by dividing the positional difference in the main scanning direction between a right-end edge pixel of the first horizontal line and a right-end edge pixel of the second horizontal line by the positional difference in the sub-scanning direction between the right-end edge pixel of the first horizontal line and the right-end edge pixel of the second horizontal line, is greater than or equal to a threshold value.

Citation Information

Patent Citations

  • Reading apparatus and program

    JP2015211321A

  • Image processing apparatus, image processing method, and image processing program

    JP2018157417A

  • Image processing apparatus and image processing method

    JP2019193159A