Image reading device, control method and control program
The image reading device enhances edge detection accuracy by using edge pixel detection based on positional relationships in the sub-scanning direction, effectively mitigating noise and improving precision in identifying medium edges.
Patent Information
- Application Number
- JP2020172088
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-10-12
- Publication Date
- 2025-01-15
- Estimated Expiration
- 2040-10-12
AI Technical Summary
Existing image reading devices struggle to accurately detect the edges of a medium, such as the leading or trailing edges, in the main scanning direction with high precision, particularly due to issues like vertical streak noise and sudden noise.
The image reading device employs an imaging unit to capture input images with consistent positions in the main scanning direction and varying distances in the sub-scanning direction, utilizing edge pixel detection units to identify edges based on the positional relationship between edge pixels in the sub-scanning direction, and outputs precise edge information.
This approach allows for the accurate detection of medium edges in the main scanning direction, reducing the impact of noise and improving edge detection precision by analyzing the positional relationship and density of edge pixels in the sub-scanning direction.
Smart Images

Figure 0007613874000003 
Figure 0007613874000004 
Figure 0007613874000005
Abstract
Description
[Technical field]
[0001] The present invention relates to an image reading device, and more particularly to an image reading device that detects the edge of a medium from an image. [Background technology]
[0002] In general, image reading devices such as scanners that read images of a medium such as a document have a function of identifying an area in the read image that includes the medium in order to extract the area that includes the medium from the read image. For this reason, the image reading device is required to detect the edges of the medium with high accuracy.
[0003] An image reading device that obtains edge portions from digital image data has been disclosed (see Patent Document 1). This image reading device detects pixels in the digital image data where the color changes from the background color as edge portions, and assigns a value of "1" to pixels detected as edge portions and a value of "0" to pixels not detected as edge portions. The image reading device performs a logical sum operation in the sub-scanning direction for each position in the main scanning direction, and calculates the calculation result as edge information for each pixel in the main scanning direction, assigning a value of "1" to pixels in which an edge image has been detected even once and a value of "0" to pixels in which an edge has not been detected even once. The image reading device checks the edge information pixel by pixel from both directions in the main scanning direction, and when a predetermined number of pixels set to a value of "1" are consecutive in the edge information, it determines that the first pixel is an edge portion.
[0004] An image reading device has been disclosed that estimates the size of a document based on the edges of the document detected on two detection lines located on either side of a reference line corresponding to the center line of the width of the document's transport path in scanned image data (see Patent Document 2).
[0005] An image reading device that acquires boundary coordinate values between a background part in a read image and a part of an original image has been disclosed (see Patent Document 3). This image reading device scans the read image in the sub-scanning direction to acquire differential information related to the sub-scanning direction of the read image, and acquires binary information in which the differential information value is set to 1 when it exceeds a threshold value and 0 otherwise. The image reading device acquires the x-coordinate value of the pixel with the smallest x-coordinate value and the x-coordinate value of the pixel with the largest x-coordinate value among the pixels in each horizontal line whose binary information is 1, as the boundary coordinate values between the background part and the part of the original image. [Prior art documents] [Patent documents]
[0006] [Patent Document 1] JP 2017-92561 A [Patent Document 2] JP 2011-35530 A [Patent Document 3] JP 2008-124828 A Summary of the Invention [Problem to be solved by the invention]
[0007] In an image reading device, it is desirable to detect the edge of a medium from an image with higher accuracy.
[0008] An object of the present invention is to provide an image reading device, a control method, and a control program that are capable of detecting the leading or trailing edge of a medium in the main scanning direction from an image with higher accuracy. [Means for solving the problem]
[0009] An image reading device according to one aspect of the present invention has an imaging unit that images a medium, an edge pixel detection unit that detects edge pixels in the sub-scanning direction based on the gradation values of a plurality of pixels that are identical in position in the main scanning direction and whose distance in the sub-scanning direction is within a predetermined range in an input image of the medium imaged by the imaging unit, an end detection unit that detects an end in the main scanning direction of the leading or trailing end of the medium based on the positional relationship between the plurality of sub-scanning direction edge pixels detected by the edge pixel detection unit, and an output control unit that outputs information related to the detected end.
[0010] Furthermore, a control method according to one aspect of the present invention is a control method for an image reading device having an imaging unit that images a medium to generate an input image, which detects edge pixels in the sub-scanning direction based on the gradation values of a plurality of pixels that are identical to each other in the main scanning direction and whose distance in the sub-scanning direction is within a predetermined range from each other in the input image, detects an end in the main scanning direction of the leading or trailing end of the medium based on the positional relationship between the detected plurality of sub-scanning direction edge pixels, and outputs information regarding the detected end.
[0011] Furthermore, a control program according to one aspect of the present invention is a control program for an image reading device having an imaging unit that images a medium to generate an input image, and causes the image reading device to detect edge pixels in the sub-scanning direction based on the gradation values of a plurality of pixels that are identical to each other in the main scanning direction and whose distance in the sub-scanning direction is within a predetermined range from each other in the input image, detect ends in the main scanning direction of the leading or trailing end of the medium based on the positional relationship between the detected plurality of sub-scanning direction edge pixels, and output information regarding the detected ends. Effect of the Invention
[0012] According to the present invention, the image reading device, the control method, and the control program are capable of detecting the leading or trailing edge of a medium in the main scanning direction from an image with higher accuracy. [Brief description of the drawings]
[0013] [Figure 1]1 is a perspective view showing an image reading device 100 according to an embodiment. [Diagram 2] 2 is a diagram for explaining a transport path inside the image reading device 100. FIG. [Diagram 3] 1 is a block diagram showing a schematic configuration of an image reading device 100. FIG. [Figure 4] FIG. 2 is a diagram showing a schematic configuration of a storage device 140 and a processing circuit 150. [Diagram 5] 10 is a flowchart illustrating an example of the operation of a medium reading process. [Figure 6] 10 is a flowchart illustrating an example of the operation of a medium reading process. [Figure 7] FIG. 7 is a schematic diagram showing an example of an input image 700. [Figure 8] FIG. 13 is a schematic diagram for explaining an upper edge pixel. [Figure 9] FIG. 9 is a schematic diagram for explaining a histogram 900. [Figure 10] FIG. 13 is a schematic diagram for explaining grouping. [Figure 11A] FIG. 13 is a perspective view showing another image reading device 200. [Figure 11B] FIG. 13 is a perspective view showing another image reading device 200. [Figure 12] FIG. 2 is a cross-sectional view of the image reading device 200. [Figure 13] FIG. 13 is a diagram showing a schematic configuration of a processing circuit 350 in another image reading device. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0014] Hereinafter, an image reading device, a control method, and a control program according to one aspect of the present invention will be described with reference to the drawings. However, it should be noted that the technical scope of the present invention is not limited to the embodiments, but extends to the inventions described in the claims and their equivalents.
[0015] FIG. 1 is a perspective view showing an image reading device 100 configured as an image scanner. The image reading device 100 conveys a medium, which is an original, and captures an image. The medium is paper, cardboard, a card, a passport, or the like. The card is, for example, a resin card made of plastic. 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 image reading device 100 may be a facsimile, a copier, a printer / multifunction peripheral (MFP), or the like.
[0016] The image reading 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, and the like.
[0017] The upper housing 102 is disposed in a position covering the top surface of the image reading device 100, and engages with the lower housing 101. The placement table 103 engages with the lower housing 101 so that a medium to be transported can be placed on it. The ejection table 104 engages with the lower housing 101 so that it can hold the ejected medium.
[0018] The operation device 105 has an input device such as a button and an interface circuit for acquiring a signal from the input device, accepts an input operation by a user, and outputs an operation signal according to the input operation by the user. The display device 106 has a display including a liquid crystal, an organic EL (Electro-Luminescence), or the like, and an interface circuit for outputting image data to the display, and displays the image data on the display.
[0019] FIG. 2 is a diagram for explaining a transport path inside the image reading device 100. As shown in FIG.
[0020] The transport path inside the image reading device 100 includes a first medium sensor 111, a feed roller 112, a brake roller 113, a first transport roller 114, a second transport roller 115, a second medium sensor 116, a first imaging device 117a, a second imaging device 117b, a third transport roller 118, and a fourth transport roller 119. The number of each roller is not limited to one, and each roller may be multiple. Hereinafter, the first imaging device 117a and the second imaging device 117b may be collectively referred to as the imaging device 117.
[0021] The top surface of the lower housing 101 forms a lower guide 107a of the medium transport path, and the bottom surface of the upper housing 102 forms an upper guide 107b of the medium transport path. In Fig. 2, arrow A1 indicates the medium transport direction. In the following, "upstream" refers to the upstream side of the medium transport direction A1, and "downstream" refers to the downstream side of the medium transport direction A1.
[0022] The first medium sensor 111 is disposed upstream of the feed roller 112 and the brake roller 113. The first medium sensor 111 has a contact detection sensor, and detects whether or not a medium is placed on the placement table 103. The first medium sensor 111 generates and outputs a first medium signal whose signal value changes depending on whether a medium is placed on the placement table 103 or not.
[0023] The feed roller 112 and the brake roller 113 are provided upstream of the first conveyor roller 114 and the second conveyor roller 115. The feed roller 112 is provided in the lower housing 101, and feeds the media placed on the placement table 103 from the bottom up. The brake roller 113 is provided in the upper housing 102, and is disposed opposite the feed roller 112.
[0024] The first conveyor roller 114 and the second conveyor roller 115 are provided downstream of the feed roller 112 and the brake roller 113. The first conveyor roller 114 is provided in the lower housing 101. The second conveyor roller 115 is provided in the upper housing 102 and disposed opposite the first conveyor roller 114. The feed roller 112, the brake roller 113, the first conveyor roller 114, and the second conveyor roller 115 are an example of a conveying section, and convey the medium to the imaging device 117.
[0025] The second medium sensor 116 is disposed downstream of the first conveying roller 114 and the second conveying roller 115 and upstream of the imaging device 117. The second medium sensor 116 detects whether or not a medium is present at that position. The second medium sensor 116 includes a light emitter and a light receiver provided on one side of the medium conveying path, and a reflecting member such as a mirror provided at a position facing the light emitter and the light receiver across the conveying path. The light emitter irradiates light toward the conveying 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 according to the intensity of the received light. When a medium is present 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 depending on whether a medium is present at the position of the second medium sensor 116 or not. The light emitter and the light receiver are provided at positions facing each other across the conveying path, and the reflecting member may be omitted.
[0026] The first imaging device 117a has a line sensor using a CIS (Contact Image Sensor) of a life-size optical system type having imaging elements using CMOS (Complementary Metal Oxide Semiconductor) linearly arranged in the main scanning direction. The first imaging device 117a also has a lens that forms an image on the imaging element, and an A / D converter that amplifies and analog-to-digital (A / D) converts the electrical signal output from the imaging element. The first imaging device 117a captures an image of an area facing the line sensor on the surface of the medium transported by the transport unit at regular intervals, sequentially generates line images, and outputs them. That is, the line image has one pixel in the vertical direction (sub-scanning direction) and multiple pixels in the horizontal direction (main scanning direction).
[0027] The second imaging device 117b is disposed above the first imaging device 117a, facing the first imaging device 117a. The second imaging device 117b has a line sensor using a CIS of a life-size optical system type having imaging elements using CMOS arranged linearly in the main scanning direction. The second imaging device 117b also has a lens that forms an image on the imaging element, and an A / D converter that amplifies and analog-to-digital (A / D) converts the electrical signal output from the imaging element. The second imaging device 117b captures an image of an area facing the line sensor on the back side of the medium transported by the transport unit at regular intervals, sequentially generating and outputting line images.
[0028] The first imaging device 117a and the second imaging device 117b are an example of an imaging unit. The image reading device 100 may have only one of the first imaging device 117a and the second imaging device 117b arranged to read only one side of the medium. Instead of a line sensor based on a CIS of an equal magnification optical system type having an imaging element based on a CMOS, a line sensor based on a CIS of an equal magnification optical system type having an imaging element based on a CCD (Charge Coupled Device) may be used. A line sensor based on a reduced optical system type having an imaging element based on a CMOS or CCD may be used.
[0029] The third conveyor roller 118 and the fourth conveyor roller 119 are provided downstream of the imaging device 117. The third conveyor roller 118 is provided in the lower housing 101. The fourth conveyor roller 119 is provided in the upper housing 102, and is disposed opposite the third conveyor roller 118.
[0030] The medium placed on the mounting table 103 is transported between the lower guide 107a and the upper guide 107b in the medium transport direction A1 by the rotation of the feed roller 112 in the direction of the arrow A2 in Fig. 2. The brake roller 113 rotates in the direction of the arrow A3 when transporting the medium. When multiple media are placed on the mounting table 103, the feed roller 112 and the brake roller 113 function to separate only the media placed on the mounting table 103 that is in contact with the feed roller 112. This operates to restrict the transport of media other than the separated media (preventing double feeding).
[0031] The medium is fed between the first conveyor roller 114 and the second conveyor 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 conveyor roller 114 and the second conveyor roller 115 rotate in the directions of the arrows A4 and A5, respectively. The medium read by the imaging device 117 is discharged onto the discharge tray 104 as the third conveyor roller 118 and the fourth conveyor roller 119 rotate in the directions of the arrows A6 and A7, respectively.
[0032] FIG. 3 is a block diagram showing a schematic configuration of the image reading device 100. As shown in FIG.
[0033] In addition to the above-mentioned components, the image reading device 100 further includes a motor 131, an interface device 132, a storage device 140, a processing circuit 150, and the like.
[0034] The motor 131 includes one or more motors, and rotates the feed roller 112, the brake roller 113, the first conveying roller 114, the second conveying roller 115, the third conveying roller 118, and the fourth conveying roller 119 to convey the medium in response to a control signal from the processing circuit 150.
[0035] 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 (not shown, for example, a personal computer, a mobile information terminal, etc.) to transmit and receive images and various information. Also, instead of the interface device 132, a communication unit having an antenna for transmitting and receiving wireless signals and a wireless communication interface device for transmitting and receiving signals through a wireless communication line in accordance with a predetermined communication protocol may be used. The predetermined communication protocol is, for example, a wireless LAN (Local Area Network).
[0036] The storage device 140 includes a memory device such as a random access memory (RAM) or a read only memory (ROM), a fixed disk device such as a hard disk, or a portable storage device such as a flexible disk or an optical disk. The storage device 140 also stores computer programs, databases, tables, and the like used for various processes of the image reading device 100. The computer programs 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 compact disc read only memory (CD-ROM), a digital versatile disc read only memory (DVD-ROM), or the like.
[0037] The processing circuit 150 operates based on a program previously stored in the storage device 140. Note that instead of the processing circuit 150, a digital signal processor (DSP), a large scale integration (LSI), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or the like may be used.
[0038] The processing circuit 150 is connected to the operation device 105, the display device 106, the first medium sensor 111, the second medium sensor 116, the imaging device 117, the motor 131, the interface device 132, the storage device 140, etc., and controls each of these components. The processing circuit 150 performs drive control of the motor 131, image capture control of the imaging device 117, etc., acquires images, and transmits them to an information processing device (not shown) via the interface device 132. The processing circuit 150 also detects the edge of the medium based on the image captured by the imaging device 117.
[0039] FIG. 4 is a diagram showing a schematic configuration of the storage device 140 and the processing circuit 150. As shown in FIG.
[0040] 4, the storage device 140 stores a control program 141, an image acquisition program 142, an edge pixel detection program 143, an end detection program 144, a medium width detection program 145, a side detection program 146, an output control program 147, and the like. Each of these programs is a functional module implemented by software that runs on a processor. The processing circuit 150 reads each program stored in the storage device 140 and operates according to the read program. As a result, the processing circuit 150 functions as a control unit 151, an image acquisition unit 152, an edge pixel detection unit 153, an end detection unit 154, a medium width detection unit 155, a side detection unit 156, and an output control unit 157.
[0041] 5 and 6 are flowcharts showing an example of the operation of the medium reading process of the image reading device 100. FIG.
[0042] An example of the operation of the medium reading process of the image reading device 100 will be described below with reference to the flowcharts shown in Figures 5 and 6. The flow of the operation described below is executed mainly by the processing circuit 150 in cooperation with each element of the image reading device 100 based on a program previously stored in the storage device 140. The flow of the operation shown in Figures 5 and 6 is executed periodically.
[0043] First, the control unit 151 waits until a user inputs an instruction to read a medium using the operation device 105 and an operation signal instructing to read a medium is received from the operation device 105 (step S101).
[0044] Next, control unit 151 determines whether or not a medium is placed on placement table 103 based on the first medium signal received from first medium sensor 111 (step S102).
[0045] If no medium is placed on the placement table 103, the control unit 151 returns the process to step S101 and waits until a new operation signal is received from the operation device 105.
[0046] On the other hand, if a medium is placed on the placement table 103, the control unit 151 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).
[0047] Next, image acquisition unit 152 causes imaging device 117 to capture an image of the transported medium to acquire a line image (step S104). Note that image acquisition unit 152 may determine whether or not the leading edge of the medium has passed the position of second medium sensor 116 based on the second medium signal received from second medium sensor 116, and cause imaging device 117 to start capturing an image when the leading edge of the medium has passed the position of second medium sensor 116. Image acquisition unit 152 periodically acquires the second medium signal from second medium sensor 116, and determines that the leading edge of the medium has passed the position of second medium sensor 116 when the signal value of the second medium signal changes from a value indicating that the medium is not present to a value indicating that the medium is present.
[0048] Next, the image acquisition unit 152 determines whether the leading edge of the medium in the main scanning direction has been detected by the edge detection unit 154 (step S105). The leading edge of the medium in the main scanning direction is detected in step S109, which will be described later. If the leading edge of the medium in the main scanning direction has been detected, the image acquisition unit 152 transitions to step S111.
[0049] On the other hand, if the leading edge of the medium in the main scanning direction has not been detected, the image acquisition unit 152 determines whether or not a predetermined number of line images have been acquired from the imaging device 117 (step S106). The predetermined number is preset to one or more values (e.g., 100) that are considered to certainly include the leading edge of the medium in the main scanning direction. The predetermined number may be set to a value that includes the entire medium. The larger the predetermined number, the more certainly the image reading device 100 can detect the edge, and the smaller the predetermined number, the more quickly the image reading device 100 can detect the edge. If the predetermined number of line images has not yet been acquired, the image acquisition unit 152 returns the process to step S104 and repeats the processes of steps S104 to S106.
[0050] On the other hand, when a predetermined number of line images have been acquired, the image acquiring unit 152 synthesizes the predetermined number of line images to generate an input image (step S107). That is, the input image is an image obtained by capturing an image of a medium using the imaging device 117 and generating the input image by the image acquiring unit 152. Note that the imaging device 117 may synthesize a predetermined number of line images to generate the input image, and the image acquiring unit 152 may acquire the input image from the imaging device 117.
[0051] FIG. 7 is a schematic diagram showing an example of an input image 700. As shown in FIG.
[0052] 7 includes a medium 701, and further includes vertical stripe noise 702, 703 and sudden noise 704, 705 in the background. The vertical stripe noise 702, 703 are noises generated by foreign matter such as paper powder, dust, glue, etc. attached to the imaging surface (glass surface) of the imaging device 117, or uneven sensitivity of the line sensor, etc. The sudden noise is noises generated when amplifying an electrical signal output from an imaging element in the imaging device 117, or noises generated due to differences in characteristics between parts, etc.
[0053] Next, the edge pixel detection unit 153 detects edge pixels in the sub-scanning direction from the input image (step S108). The edge pixel detection unit 153 detects edge pixels in the sub-scanning direction based on the gradation values of a plurality of pixels that are located at the same positions in the main scanning direction in the input image and whose distances in the sub-scanning direction are within a predetermined range from each other.
[0054] The edge pixel detection unit 153 calculates the absolute value of the difference in gradation value between the pixels adjacent to each other in the vertical direction (sub-scanning direction) of each pixel in each vertical line in the input image, starting from the top end. The edge pixel detection unit 153 detects pixels in each vertical line whose adjacent difference value exceeds a gradation threshold as edge pixels. The edge pixel detection unit 153 detects the first edge pixel detected in each vertical line, that is, the pixel located at the top, as an upper edge pixel, and detects it as an edge pixel in the sub-scanning direction. The gradation value is a luminance value or a color value (R value, G value, or B value), etc. The gradation threshold is set to a luminance value difference (e.g., 20) that allows a person to visually distinguish the difference in luminance on the image.
[0055] The edge pixel detection unit 153 may calculate, as the adjacent difference value, the absolute value of the difference in gradation values between two pixels that are vertically separated by a predetermined distance from each pixel in the input image. The edge pixel detection unit 153 may also detect edge pixels by comparing the gradation value of each pixel in the input image with a threshold. For example, when the gradation value of a specific pixel is less than the threshold and the gradation value of a pixel vertically adjacent to the specific pixel or a pixel separated by a predetermined distance from the specific pixel is equal to or greater than the threshold, the edge pixel detection unit 153 detects the specific pixel as an edge pixel.
[0056] Furthermore, edge pixel detection unit 153 may detect edge pixels in the sub-scanning direction at regular intervals (e.g., every four pixels) in the main scanning direction in the input image, rather than detecting edge pixels in the sub-scanning direction for all pixels in the input image. Edge pixel detection unit 153 extracts target lines for detecting edge pixels in the sub-scanning direction at regular intervals from among vertical lines in the input image, and detects edge pixels in the sub-scanning direction for the extracted target lines. This enables edge pixel detection unit 153 to reduce the time required to detect the edge of a medium, and reduce the processing time and processing load of the medium reading process.
[0057] FIG. 8 is a schematic diagram for explaining the upper edge pixel.
[0058] FIG. 8 shows the input image 700 shown in FIG. 7. In FIG. 8, the dotted line extending vertically indicates a vertical line extracted as a target line. In the example shown in FIG. 8, pixels T1 to T14 are detected as upper edge pixels. The upper edge pixels T1 and T2 are pixels corresponding to the sudden noises 704 and 705, 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 FIG. 8, the vertical stripe noises 702 and 703 extend vertically and the gradation values of the pixels in the vertical stripe noises 702 and 703 are within a certain range, so the pixels corresponding to the vertical stripe noises 702 and 703 are not detected as upper edge pixels. Note that vertical stripe noises that occur or disappear during reading (during medium transport) have a change in gradation value at their ends, so they are detected in the same way as the sudden noises 704 and 705. Such vertical stripe noise that occurs or disappears during reading (during medium transport) is processed in the same manner as the sudden noises 704 and 705 in the process described below, and is not erroneously detected as the edge of the medium.
[0059] Next, the edge detection unit 154 detects the edge of the leading edge of the medium in the main scanning direction based on the edge pixels in the sub-scanning direction (step S109). The edge detection unit 154 detects the edge of the leading edge of the medium in the main scanning direction based on the positional relationship between the multiple edge pixels in the sub-scanning direction detected by the edge pixel detection unit 153.
[0060] For example, the end detection unit 154 calculates the number or ratio of edge pixels in the sub-scanning direction within a certain range in the main scanning direction as the positional relationship between multiple edge pixels in the sub-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 a vertical line, the end detection unit 154 calculates the number or ratio of target lines in which edge pixels in the sub-scanning direction are detected among target lines located within a certain range from each target line. The certain range is set so that the number or ratio calculation target is a predetermined number equal to or greater than 2 (e.g., 5). The end detection unit 154 extracts a group of target lines in which the calculated number is equal to or greater than a threshold value (e.g., 3) or the calculated ratio is equal to or greater than a threshold value (e.g., 0.6) and the target lines are adjacent to each other and are continuous.
[0061] The end detection unit 154 detects the range in the main scanning direction of the target line group that contains the largest number of target lines among the extracted target line groups as the leading edge range of the medium in the main scanning direction. Note that the end detection unit 154 may detect a range that is reduced by a predetermined margin from the detected range, or a range that is expanded by a predetermined margin from the detected range, as the leading edge range of the medium in the main scanning direction. The end detection unit 154 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 in the main scanning direction of the leading edge of the medium.
[0062] In the example shown in FIG. 8, the range from the target line including the top edge pixel T3 to the target line including the top edge pixel T14 is detected as the leading edge range of the medium. Then, the target line including the top edge pixel T3 and the target line including the top edge pixel T14 are detected as the end portions in the main scanning direction of the leading edge of the medium. That is, the pixels corresponding to the vertical stripe noise 702, 703 are not detected as top edge pixels and are therefore not included in the leading edge range of the medium. In addition, the target lines including the top edge pixels T1, T2 corresponding to the sudden noise 704, 705 are located discretely and therefore are not included in the leading edge range of the medium. In addition, even if the difference in gradation value between the background and the medium is small in some of the target lines corresponding to the leading edge of the medium and no top edge pixels are detected, if top edge pixels are detected in the surrounding target lines, those parts of the target lines are also included in the leading edge range of the medium. By using the number or proportion of edge pixels in the sub-scanning direction within a certain range, the edge detection unit 154 can reduce the effects of noise and the effects of missed detection of top-end edge pixels, thereby enabling it to detect the leading edge range and its ends of the medium with high accuracy.
[0063] The end detection unit 154 may detect edge pixels in the sub-scanning direction that are detected consecutively in the main scanning direction as the positional relationship between a plurality of edge pixels in the sub-scanning direction. In this case, the end detection unit 154 calculates the number of edge pixels in the sub-scanning direction that are detected consecutively in the main scanning direction (the number of consecutive pixels). The end detection unit 154 extracts a group of target lines in which edge pixels in the sub-scanning direction are detected adjacent to each other and consecutive for a predetermined number (e.g., three or more).
[0064] The end detection unit 154 detects the range in the main scanning direction of the target line group that contains the largest number of target lines among the extracted target line groups as the leading edge range of the medium in the main scanning direction. Note that the end detection unit 154 may detect a range that is reduced by a predetermined margin from the detected range, or a range that is expanded by a predetermined margin from the detected range, as the leading edge range of the medium in the main scanning direction. The end detection unit 154 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 in the main scanning direction of the leading edge of the medium.
[0065] In the example shown in FIG. 8, the range from the target line including the top edge pixel T3 to the target line including the top edge pixel T14 is detected as the leading edge range of the medium. Then, the target line including the top edge pixel T3 and the target line including the top edge pixel T14 are detected as the end of the leading edge of the medium in the main scanning direction. That is, the pixels corresponding to the vertical stripe noise 702, 703 are not detected as the top edge pixels, and therefore are not included in the leading edge range of the medium. Also, the target lines including the top edge pixels T1, T2 corresponding to the sudden noise 704, 705 are located discretely, and therefore are not included in the leading edge range of the medium. In this case, if the top edge pixels are not detected in some of the target lines corresponding to the leading edge of the medium, the leading edge range of the medium is not detected correctly. However, the number of consecutive edge pixels in the sub-scanning direction is calculated in a short time from the number or ratio of edge pixels in the sub-scanning direction within a certain range. Therefore, by being based on edge pixels in the sub-scanning direction that are detected consecutively in the main scanning direction, the end detection unit 154 can detect the leading edge range and its ends of the medium in a shorter time and with less load while reducing the effects of noise.
[0066] The end detection unit 154 may also calculate the closeness of 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 154 calculates the distance in the sub-scanning direction between a plurality of edge pixels in the sub-scanning direction as the closeness of positions in the sub-scanning direction. The end detection unit 154 extracts a group of target lines in which target lines in which edge pixels in the sub-scanning direction are detected are located within a first distance from each other in the main scanning direction and 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, for example, to a predetermined multiple (for example, twice) of the distance between adjacent target lines. The second distance is set, for example, to a predetermined multiple (for example, twice) of the distance between adjacent target lines.
[0067] The end detection unit 154 detects the range in the main scanning direction of the target line group that contains the largest number of target lines among the extracted target line groups as the leading edge range of the medium in the main scanning direction. Note that the end detection unit 154 may detect a range that is reduced by a predetermined margin from the detected range, or a range that is expanded by a predetermined margin from the detected range, as the leading edge range of the medium in the main scanning direction. The end detection unit 154 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 in the main scanning direction of the leading edge of the medium.
[0068] In the example shown in FIG. 8, the range from the target line including the top edge pixel T4 to the target line including the top edge pixel T14 is detected as the leading edge range of the medium. That is, the pixels corresponding to the vertical stripe noises 702 and 703 are not detected as top edge pixels, and therefore are not included in the leading edge range of the medium. In addition, the target lines including the top edge pixels T1 and T2 corresponding to the sudden noises 704 and 705 are located discretely, and therefore are not included in the leading edge range of the medium. In addition, the top edge pixel T3 corresponding to the left side of the medium 701 is separated in the main scanning direction from the top edge pixels T4 and T5 located nearby in the sub-scanning direction, and therefore the target line including the top edge pixel T3 is not included in the leading edge range of the medium. In addition, even if sudden noise occurs near the medium in the main scanning direction, if the sudden noise is separated from the leading edge of the medium in the sub-scanning direction, the sudden noise is not included in the leading edge range of the medium. By using the distance in the sub-scanning direction between edge pixels in the sub-scanning direction, the edge detection unit 154 can reduce the effects of noise and the sides of the medium and detect the leading edge range and its edges of the medium with high accuracy.
[0069] Furthermore, the end detection unit 154 may calculate the frequency of edge pixels in the sub-scanning direction for each of a plurality of lines in the main scanning direction as the closeness of positions in the sub-scanning direction. The end detection unit 154 calculates the number of edge pixels in the sub-scanning direction detected on each line in the main scanning direction for each line in the main scanning direction. The end detection unit 154 generates a histogram in which the positions in the sub-scanning direction of each main scanning direction line are used as classes, and the calculated number for each line in the main scanning direction is used as a frequency. The end detection unit 154 extracts, as a group of target lines, target lines in which edge pixels in the sub-scanning direction are detected within a class range in which the frequency is equal to or greater than a frequency threshold in the generated histogram. The frequency threshold is set to a predetermined value (e.g., 3). The frequency threshold may be dynamically set according to the generated histogram. In this case, the frequency threshold is set to, for example, 1 / 2 of the maximum frequency.
[0070] The end detection unit 154 detects the range of the extracted target line group in the main scanning direction as the leading edge range of the medium in the main scanning direction. The end detection unit 154 may detect a range that is reduced by a predetermined margin from the detected range, or a range that is expanded by a predetermined margin from the detected range, as the leading edge range of the medium in the main scanning direction. The end detection unit 154 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 in the main scanning direction of the leading edge of the medium.
[0071] FIG. 9 is a schematic diagram for explaining a histogram 900 generated by the edge detection unit 154. As shown in FIG.
[0072] Fig. 9 shows a histogram 900 generated from the input image 700 shown in Fig. 7. In Fig. 9, the vertical axis shows the position (class) in the sub-scanning direction of each main scanning direction line, and the horizontal axis shows the number (frequency) calculated for each main scanning direction line. In the example shown in Fig. 9, the frequency is high in the sub-scanning direction in the range where top edge pixels T4 to T14 corresponding to the top side of the medium exist. On the other hand, the frequency is low in the positions where top edge pixels T1 and T2 corresponding to the sudden noises 704 and 705, and top edge pixel T3 corresponding to the left side of the medium exist.
[0073] 8, the range from the target line including top edge pixel T4 to the target line including top edge pixel T14 is detected as the leading edge range of the medium. In other words, the target lines including top edge pixels T1 and T2 corresponding to the sudden noises 704 and 705, and the target line including top edge pixel T3 corresponding to the left side of the medium 701 are not included in the leading edge range of the medium. By using the frequency of edge pixels in the sub-scanning direction for each line in the main scanning direction, the edge detection unit 154 can reduce the effects of noise and the effects of the sides of the medium and detect the leading edge range of the medium and its edges with high accuracy.
[0074] Next, the medium width detection unit 155 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 154 (step S110). The medium width detection unit 155 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 155 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).
number
[0075] The medium width detection unit 155 may detect the distance in the main scanning direction between both ends of the leading edge of the medium in the main scanning direction as the medium width. In this case, the medium width detection unit 155 calculates the distance W in the main scanning direction between both ends of the leading edge of the medium in the main scanning direction according to the following formula (2).
number
[0076] Next, the image acquisition unit 152 determines whether the entire medium has been imaged (step S111). For example, the image acquisition unit 152 determines whether the rear 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 152 periodically acquires the second medium signal from the second medium sensor 116, and determines that the front 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 presence of the medium to a value indicating the absence of the medium. The image acquisition unit 152 determines that the rear end of the medium has passed the imaging position of the imaging device 117 and the entire medium has been imaged when a predetermined time has elapsed since the rear end of the medium passed the position of the second medium sensor 116. Note that the image acquisition unit 152 may determine that the entire transported medium has been imaged when it acquires a predetermined number of line images from the imaging device 117.
[0077] If the entire conveyed medium has not yet been imaged, the image acquisition unit 152 returns the process to step S104, and repeats the processes of steps S104 to S111.
[0078] On the other hand, when the entire conveyed medium is imaged, the image acquisition unit 152 generates a read image by combining all the acquired line images (step S112). 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 152 may use the input image as the read image.
[0079] Next, the side edge detection unit 156 detects edge pixels in the main scanning direction from the read image (step S113). The side edge detection unit 156 detects edge pixels in the main scanning direction based on the gradation values of a plurality of pixels that are mutually identical in the sub-scanning direction position in the read image and whose distance in the main scanning direction is within a predetermined range.
[0080] The side edge detection unit 156 calculates the absolute value of the difference in gradation values between the pixels adjacent to each pixel in the horizontal direction (main scanning direction) in each horizontal line in the read image, starting from the left end. The side edge detection unit 156 detects pixels in each horizontal line whose adjacent difference value exceeds a gradation threshold as edge pixels. The side edge detection unit 156 determines the edge pixel detected first in each horizontal line, i.e., the pixel located at the leftmost position, as the left edge pixel, and the edge pixel detected last in each horizontal line, i.e., the pixel located at the rightmost position, as the right edge pixel. The side edge detection unit 156 may detect edge pixels in order from the right end, and may determine the edge pixel detected first in each horizontal line as the right edge pixel. The side edge detection unit 156 detects the left edge pixel and the right edge pixel as edge pixels in the main scanning direction.
[0081] The side detection unit 156 may calculate the absolute value of the difference in gradation values between two pixels that are horizontally separated by a predetermined distance from each pixel in the read image as the adjacent difference value. The side detection unit 156 may also detect edge pixels by comparing the gradation value of each pixel in the read image with a threshold. For example, when the gradation value of a specific pixel is less than the threshold and the gradation value of a pixel horizontally adjacent to the specific pixel or a pixel separated by a predetermined distance from the specific pixel is equal to or greater than the threshold, the side detection unit 156 detects the specific pixel as an edge pixel.
[0082] Also, side edge detection unit 156 may detect edge pixels in the main scanning direction at regular intervals (e.g., every four pixels) in the sub-scanning direction in the read image, rather than detecting edge pixels in the main scanning direction for all pixels in the read image. Side edge detection unit 156 extracts target lines for detecting edge pixels in the main scanning direction at regular intervals from horizontal lines in the read image, and detects edge pixels in the main scanning direction for the extracted target lines. This enables side edge detection unit 156 to reduce the time required to detect the edge of a medium, and reduces the processing time and processing load of the medium reading process.
[0083] FIG. 10 is a schematic diagram for explaining the left edge pixel and the right edge pixel.
[0084] FIG. 10 shows the input image 700 shown in FIG. 7. In FIG. 10, a dotted line extending in the horizontal direction indicates a horizontal line extracted as a target line. In the example shown in FIG. 10, pixels L1 to L15 are detected as left edge pixels, and pixels R1 to R15 are detected as right edge pixels. The left edge pixels L1, L3, L6, L10, L12, and L13 are pixels corresponding to the vertical stripe noise 702. The left edge pixels L2, L5, L7, L8, L11, and L14 are pixels corresponding to the left side of the medium. The left edge pixels L4 and L9 are pixels corresponding to the sudden noises 704 and 705, respectively. The left edge pixel L15 is a pixel corresponding to the bottom side of the medium. The right edge pixel R1 is a pixel corresponding to the top side of the medium. The right edge pixels R2, R4, R5, R7, R8, R14, and R15 correspond to the right side of the medium, and the right edge pixels R3, R6, R9, R10, R11, R12, and R13 correspond to the vertical stripe noise 703.
[0085] Next, the side detection unit 156 detects the side of the medium based on the edge pixels in the main scanning direction and the end in the main scanning direction of the leading edge of the medium detected by the end detection unit 154 (step S114).
[0086] First, the side detection unit 156 groups the extracted left edge pixels and right edge pixels. For example, the side detection unit 156 groups the left edge pixels located around a specific straight line and the right edge pixels located around a specific straight line into the same group.
[0087] For example, the side edge detection unit 156 sets the left edge pixel located at the uppermost end side among the extracted left edge pixels as the pixel of interest. The side edge detection unit 156 scans the left edge pixels toward the lower end, and when the inclination of the line passing through the pixel of interest and a specific left edge pixel is equal to or less than a predetermined angle (for example, 45°), the side edge detection unit 156 extracts the specific left edge pixel as a candidate pixel and sets the line as a candidate line. When a left edge pixel whose distance from the candidate line is equal to or less than a predetermined distance exists further below the candidate pixel, the side edge detection unit 156 groups the pixel of interest, the candidate pixel, and the left edge pixel whose distance from the candidate line is equal to or less than the predetermined distance into one group. When a candidate pixel is not extracted, or when there is no left edge pixel whose distance from the candidate line is equal to or less than the predetermined distance below the candidate pixel, the side edge detection unit 156 does not group the pixel of interest. The side edge detection unit 156 repeats the same process for the left edge pixels that are not grouped into groups. Moreover, the side detection unit 156 performs the same process on the right edge pixel.
[0088] In the example shown in Fig. 10, the left edge pixels L1, L3, L6, L10, L12, and L13 are arranged in a substantially straight line and are located near the same straight line, so they are grouped together. Similarly, the left edge pixels L2, L5, L7, L8, L11, and L14 are arranged in a substantially straight line and are located near the same straight line, so they are grouped together. The left edge pixels L4, L9, and L15 are not grouped because there is no straight line that has two or more other left edge pixels located near it.
[0089] Also, the right edge pixels R2, R4, R5, R7, R8, R14, and R15 are arranged in a substantially straight line and are located near the same line, so they are grouped together. Similarly, the right edge pixels R3, R6, R9, R10, R11, R12, and R13 are arranged in a substantially straight line and are located near the same line, so they are grouped together. The right edge pixel R1 is not grouped because there is no line with two or more other right edge pixels located near it.
[0090] Next, the side edge detection unit 156 extracts, from among the groups, the group in which the distance between the candidate line and the end in the main scanning direction of the leading edge of the medium detected by the end detection unit 154 is the smallest, as the group corresponding to the side edge of the medium. The side edge detection unit 156 uses the least squares method to detect a line passing through each edge pixel included in the extracted group as the side edge of the medium. Note that the side edge detection unit 156 may also use a Hough transform to detect a line passing through each edge pixel included in the extracted group as the side edge of the medium.
[0091] 10, a group of left edge pixels L2, L5, L7, L8, L11, and L14 and a group of right edge pixels R2, R4, R5, R7, R8, R14, and R15 are extracted as groups corresponding to the sides of the medium. In this way, the side edge detection unit 156 detects the side of the medium based on the end in the main scanning direction of the leading edge of the medium detected by the end detection unit 154, and can detect the side of the medium with high accuracy without being affected by vertical stripe noise and the like. In other words, the side edge detection unit 156 can improve the reliability of the detected side of the medium.
[0092] It should be noted that the side edge detection unit 156 may detect the side edges of the medium by other methods. For example, the side edge detection unit 156 detects a left edge pixel and a right edge pixel in an area within a predetermined distance in the main scanning direction from the two ends in the main scanning direction of the leading edge of the medium detected by the end detection unit 154. The side edge detection unit 156 detects a straight line passing through the detected left edge pixel and a straight line passing through the detected right edge pixel as the side edges of the medium. In this case as well, the side edge detection unit 156 can detect the side edges of the medium with high accuracy without being affected by vertical stripe noise and the like.
[0093] Next, edge detection unit 154 detects the edge of the rear end of the medium in the main scanning direction (step S115). Edge pixel detection unit 153 detects edge pixels in the input image or scanned image in the same manner as in step S108, and detects the pixel located at the bottommost position in each vertical line as the bottom edge pixel (edge pixel in the sub-scanning direction). Edge detection unit 154 detects the edge of the rear end of the medium in the main scanning direction based on the bottom edge pixel in the same manner as in step S109.
[0094] Next, the output control unit 157 generates a cut-out image by cutting out the area of the medium from the read image (step S116). The output control unit 157 uses the least squares method or Hough transform to detect a straight line passing through the upper edge pixels as the upper side of the medium, and detects a straight line passing through the lower edge pixels 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 sides of the medium detected by the side detection unit 156 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.
[0095] Next, the output control unit 157 outputs the generated cut-out image by transmitting it to the information processing device via the interface device 132 (step S117). The output control unit 157 may output the generated cut-out image by displaying it on the display device 106. The side of the medium in the cut-out image is detected based on the leading edge of the medium detected by the edge detection unit 154, and the cut-out image is an example of information about the edge detected by the edge detection unit 154. Note that the output control unit 157 may transmit the read image to the information processing device without generating a cut-out image, and transmit coordinates indicating the position of the leading edge of the medium detected in the read image by the edge detection unit 154 to the information processing device as information about the edge. In this case, the information processing device generates a cut-out image from the read image based on the received coordinates.
[0096] Also, in step S109, the output control unit 157 may determine whether the medium is a card or paper based on the leading edge of the medium detected by the edge detection unit 154. In this case, the output control unit 157 determines that the medium is a card when the distance between the leading edges of the medium is equal to or less than a threshold value, and determines that the medium is paper when the distance between the leading edges of the medium is greater than the threshold value. The threshold value is set to a value that includes a margin in addition to the longitudinal size of a card defined by ISO / IEC7810, for example. The output control unit 157 transmits information indicating whether the medium is a card or paper to the information processing device as information regarding the edge of the medium. In this case, the information processing device classifies the received image according to whether the medium is a card or paper. Also, the output control unit 157 may periodically determine whether or not a double feed of the medium being transported has occurred based on an ultrasonic signal output from an ultrasonic sensor (not shown), and may stop the transport of the medium when a double feed of the medium has occurred. In this case, the output control unit 157 may determine that a double feed of the medium has not occurred when the medium is a card. This makes it possible for the output control unit 157 to suppress erroneous determination that a multi-feed of media has occurred when a card is transported.
[0097] The output control unit 157 may also detect the size of the medium based on the leading edge of the medium detected by the edge detection unit 154, and change the rotation speed of the third conveyor roller 118 and the fourth conveyor roller 119 (medium discharge speed) according to the detected size of the medium. In this case, the output control unit 157 detects the distance between the leading edges of the medium as the size of the medium. Then, when it is determined in step S111 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 speed of the third conveyor roller 118 and the fourth conveyor roller 119 according to the detected size of the medium. The output control unit 157 changes the rotation speed of the motor 131 so that the smaller the size of the medium, the lower (slower) the rotation speed becomes, and the larger the size of the medium, the higher (faster) the rotation speed becomes. In this way, the image reading device 100 can prevent small-sized media from being discharged forcefully and scattering on the discharge table 104, and can improve the alignment of the media on the discharge table 104.
[0098] Furthermore, in step S109, the output control unit 157 may determine whether or not a skew of the medium has occurred based on the leading edge of the medium detected by the edge detection unit 154. In this case, the image reading device 100 stores in advance in the storage device 140 a table in which the range of the position of the leading edge of the medium and the range of the inclination of the leading edge of the medium (angle with respect to the main scanning direction) are set, where the skew of the medium is deemed to have occurred. The output control unit 157 calculates the inclination of a straight line passing through the two leading edges of the medium detected by the edge detection unit 154. The output control unit 157 determines whether or not a skew of the medium has occurred based on whether or not the two leading edges of the medium detected by the edge detection unit 154 and the calculated inclination are included in a preset range. If the output control unit 157 determines that a skew of the medium has occurred, it stops the motor 131 to stop the transport of the medium, and outputs information indicating that a transport abnormality of the medium has occurred as information on the edges of the medium, and notifies the user.
[0099] Next, control unit 151 determines whether or not a medium remains on mounting table 103 based on the first medium signal received from first medium sensor 111 (step S118). If a medium remains on mounting table 103, control unit 151 returns the process to step S104, and repeats the processes of steps S104 to S118.
[0100] On the other hand, if there are no media remaining on mounting table 103, control unit 151 stops motor 131 (step S119) and ends the series of steps.
[0101] The process of step S110 may be omitted. Moreover, the processes of steps S113 to S116 may be omitted, and the output control unit 157 may output the scanned image in step S117.
[0102] As described above in detail, the image reading device 100 detects the leading edge of the medium in the main scanning direction based on the positional relationships between multiple edge pixels in the sub-scanning direction (density in the main scanning direction, number of continuities in the main scanning direction, and closeness of position in the sub-scanning direction). That is, the image reading device 100 detects the leading edge of the medium in the main scanning direction based on the grouping of multiple edge pixels in the sub-scanning direction. This makes it possible for the image reading device 100 to reduce the effects of vertical stripe noise, sudden noise, and the like, and to more accurately detect the leading or trailing edge of the medium in the main scanning direction from the image.
[0103] In particular, the image reading device 100 is now capable of reducing the effects of vertical stripe noise even when a foreign object in an image cannot be removed using a reference image acquired in advance, such as when a foreign object adheres to or peels off from the imaging device 117 during medium reading.
[0104] In addition, the image reading device 100 detects the end of the leading edge of the medium in the main scanning direction based on an input image containing a predetermined number of line images before the entire medium is imaged, making it possible to detect the end of the leading edge of the medium in the main scanning direction early (in real time).
[0105] 11A and 11B are perspective views showing an image reading device 200 according to another embodiment. Fig. 11A is a perspective view of the image reading device 200 with the cover 202 closed, and Fig. 11B is a perspective view of the image reading device 200 with the cover 202 open.
[0106] 11A and 11B, the image reading device 200 is, for example, a flatbed type scanner device, etc. The image reading device 200 has a housing 201, a cover 202, etc.
[0107] The housing 201 has a glass plate 203 and the like. The glass plate 203 is a member on which a medium is placed, and is provided on the upper surface of the housing 201. The glass plate 203 forms a surface on which the medium is placed.
[0108] The cover 202 has a reference member 204 and the like. The cover 202 is provided so as to be openable and closable with respect to the housing 201. When the cover 202 is open, a medium can be placed on the glass plate 203 of the housing 201. When the cover 202 is closed, the reference member 204 faces an imaging device provided below the glass plate 203 (inside the housing 201).
[0109] FIG. 12 is a cross-sectional view of the image reading device 200 taken along the line AA' in FIG. 11A with the cover 202 closed.
[0110] As shown in Fig. 12, the housing 201 has an imaging device 205. The imaging device 205 is provided at a position facing a reference member 204 provided on the cover 202 in a closed state, sandwiching the glass plate 203. The imaging device 205 is parallel to the glass plate 203 and extends in a direction (main scanning direction) perpendicular to the direction of the arrow A21 in Fig. 12 so as to be able to capture an image from one end to the other end of the glass plate 203. The imaging device 205 is also provided movably along the direction of the arrow A21 (sub-scanning direction) so as to be able to capture an image from one end to the other end of the glass plate 203.
[0111] The imaging device 205 is an example of an imaging section, and captures an image of a medium placed on the glass plate 203. The imaging device 205 has a similar structure to the imaging device 117 of the image reading device 100.
[0112] Image reading device 200 has each unit included in image reading device 100 shown in Fig. 3. However, image reading device 200 does not have first medium sensor 111 and second medium sensor 116, and has imaging device 205 instead of imaging device 117. Also, in image reading device 200, motor 131 is provided so as to move imaging device 205 via a movement mechanism such as a pulley, belt, gear, rack, and pinion, rather than rotating a roller for transporting a medium.
[0113] The processing circuit 150 executes the medium reading process shown in Fig. 5 and Fig. 6. However, the process of step S102 is omitted, and when the control unit 151 receives an operation signal from the operation device 105, the process proceeds to step S103. In step S103, the control unit 151 drives the motor 131 to move the imaging device 205. In addition, in step S111, the image acquisition unit 152 determines that the entire conveyed medium has been imaged when the movement of the imaging device 205 over the entire width in the sub-scanning direction is completed. In addition, the process of step S118 is omitted, and when the control unit 151 completes reading of one medium, the process proceeds to step S119. In step S119, the control unit 151 stops the motor 131 to stop the imaging device 205.
[0114] As described above in detail, the image reading device 200 is now able to detect the leading or trailing edge of the medium in the main scanning direction from the image with higher accuracy, even when the imaging device 205 is moved to image the medium.
[0115] 13 is a diagram showing a schematic configuration of a processing circuit 350 in an image reading device according to yet another embodiment. The processing circuit 350 is used in place of the processing circuit 150 in the image reading device 100 or 200, and executes a medium reading process. The processing circuit 350 has a control circuit 351, an image acquisition circuit 352, an edge pixel detection circuit 353, an end detection circuit 354, a medium width detection circuit 355, a side detection circuit 356, an output control circuit 357, and the like. Each of these components may be formed by an independent integrated circuit, microprocessor, firmware, and the like.
[0116] The control circuit 351 is an example of a control unit, and has the same functions as the control unit 151. The control circuit 351 receives an operation signal from the operation device 105 and a medium detection signal from the first medium sensor 111, and drives the motor 131 in response to each of the received signals to control the transportation of the medium or the movement of the imaging device 205.
[0117] The image acquisition circuit 352 is an example of an image acquisition unit, and has the same function as the image acquisition unit 152. The image acquisition circuit 352 receives a second medium signal from the second medium sensor 116, receives a line image from the imaging device 117 or the imaging device 205, generates an input image, and stores the line image and the input image in the storage device 140.
[0118] The edge pixel detection circuit 353 is an example of an edge pixel detection unit, and has the same function as the edge pixel detection unit 153. The edge pixel detection circuit 353 reads out the input image from the storage device 140, detects edge pixels in the sub-scanning direction from the input image, and stores the detection result in the storage device 140.
[0119] The edge detection circuit 354 is an example of an edge detection unit, and has the same function as the edge detection unit 154. The edge detection circuit 354 reads out the input image and the detection results of the edge pixels in the sub-scanning direction from the storage device 140, detects the edge of the leading edge of the medium in the main scanning direction based on the edge pixels in the sub-scanning direction, and stores the detection results in the storage device 140.
[0120] The medium width detection circuit 355 is an example of a medium width detection unit, and has the same function as the medium width detection unit 155. The medium width detection circuit 355 reads the detection result of the leading edge of the medium in the main scanning direction from the storage device 140, detects the medium width based on the leading edge of the medium in the main scanning direction, and stores the detection result in the storage device 140.
[0121] The side detection circuit 356 is an example of a side detection unit, and has the same function as the side detection unit 156. The side detection circuit 356 reads out the line image and the detection results of the end of the leading edge of the medium in the main scanning direction from the storage device 140, detects the side of the medium based on the end of the leading edge of the medium in the main scanning direction, and stores the detection results in the storage device 140.
[0122] The output control circuit 357 is an example of an output control unit, and has the same function as the output control unit 157. The output control circuit 357 reads out a line image from the storage device 140 to generate a read image. The output control circuit 357 also reads out the detection result of the edge of the leading edge of the medium in the main scanning direction, generates a cut-out image based on the edge of the leading edge of the medium in the main scanning direction, and transmits it to an information processing device (not shown) via the interface device 132.
[0123] As described above in detail, even when the image reading device uses the processing circuit 350, it is possible to detect the leading or trailing edge of the medium in the main scanning direction from the image with high accuracy. [Explanation of symbols]
[0124] 100 Image reader 112 Feeding roller 113 Brake roller 114 First conveyor roller 115 Second conveyor roller 117, 205 Imaging device 131 Motor 153 Edge pixel detection unit 154 End detection unit 155 Media width detector 156 Side detection unit 157 Output control section
Claims
1. an imaging unit that images a medium; an edge pixel detection unit that detects edge pixels in a sub-scanning direction based on gradation values of a plurality of pixels that are located at the same position in the main scanning direction and whose distance in the sub-scanning direction is within a predetermined range in an input image of a medium captured by the imaging unit; an edge detection unit that detects a range corresponding to the leading edge or trailing edge of a medium in a main scanning direction based on a positional relationship between a plurality of edge pixels in the sub-scanning direction detected by the edge pixel detection unit, and detects an end of the detected range as an end in the main scanning direction of the leading edge or trailing edge of the medium; an output control unit that outputs information related to the detected edge portion; 1. An image reading device comprising:
2. The image reading device according to claim 1 , wherein the edge detection unit detects a range corresponding to a leading edge or a trailing edge of the medium in the main scanning direction based on a number or a ratio of edge pixels in the sub-scanning direction within a certain range in the main scanning direction.
3. The image reading device according to claim 1 , wherein the edge detection unit detects a range corresponding to a leading edge or a trailing edge of the medium in the main scanning direction based on edge pixels in the sub-scanning direction that are detected consecutively in the main scanning direction.
4. The image reading device according to claim 1 , wherein the edge detection unit detects a range corresponding to a leading edge or a trailing edge of a medium in the main scanning direction based on a distance in the sub-scanning direction between the plurality of edge pixels in the sub-scanning direction.
5. The image reading device according to claim 1 , wherein the edge detection unit detects a range corresponding to a leading edge or a trailing edge of the medium in the main scanning direction based on a frequency of edge pixels in the sub-scanning direction for each of a plurality of lines in the main scanning direction.
6. 6. The image reading device according to claim 1, wherein the edge pixel detection section detects edge pixels in the sub-scanning direction at regular intervals in the main scanning direction within the input image.
7. 7. The image reading device according to claim 1, further comprising a medium width detection unit that detects a medium width based on the edge detected by the edge detection unit.
8. 8. The image reading device according to claim 1, further comprising a side edge detection section that detects a side edge of a medium based on the edge detected by the edge detection section.
9. The recording medium further includes a conveying unit that conveys the medium.
9. The image reading device according to claim 1, wherein the imaging unit captures an image of the medium being transported by the transport unit.
10. 10. The image reading device according to claim 1, further comprising a motor for moving the imaging unit.
11. A method for controlling an image reading device having an imaging unit that captures an image of a medium and generates an input image, comprising the steps of: Detecting edge pixels in the sub-scanning direction based on the gradation values of a plurality of pixels that are located at the same position in the main scanning direction and whose distances in the sub-scanning direction are within a predetermined range from each other in the input image; detecting a range corresponding to a leading edge or a trailing edge of the medium in a main scanning direction based on a positional relationship between the detected plurality of edge pixels in the sub-scanning direction, and detecting an end of the detected range as an end in the main scanning direction of the leading edge or the trailing edge of the medium; outputting information about the detected edges; A control method comprising:
12. A control program for an image reading device having an imaging unit that captures an image of a medium and generates an input image, comprising: Detecting edge pixels in the sub-scanning direction based on the gradation values of a plurality of pixels that are located at the same position in the main scanning direction and whose distances in the sub-scanning direction are within a predetermined range from each other in the input image; detecting a range corresponding to a leading edge or a trailing edge of the medium in a main scanning direction based on a positional relationship between the detected plurality of edge pixels in the sub-scanning direction, and detecting an end of the detected range as an end in the main scanning direction of the leading edge or the trailing edge of the medium; outputting information about the detected edges; A control program for causing the image reading device to execute the above steps.
Citation Information
Patent Citations
Image scanner, image scanning method, and program for executing the method
JP2008124828A
Image reader
JP2011035530A
Image reading device and image reading method
JP2017092561A
Image processing apparatus
JP2018022961A
Image processing apparatus, method for processing image, and image processing program
JP2020149148A