Image processing apparatus and edge detection method

The image processing device enhances document edge detection accuracy by using differential filters to set darker and brighter edges as first and second edges, addressing the challenge of undetectable background-shadow boundaries for improved skew correction in image forming apparatuses.

JP2024176965APending Publication Date: 2024-12-19RICOH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2023095877
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-06-09
Publication Date
2024-12-19

AI Technical Summary

Technical Problem

Conventional image processing methods for correcting document skew in image forming apparatuses face challenges in accurately detecting document edges when the boundary between the background and shadow cannot be correctly identified.

Method used

An image processing device and method that calculates pixel values from the background to the document portion, using differential filters to detect edges as boundaries where pixel values change, setting the first edge as darker and the second edge as brighter, and determining the second edge as the document edge.

Benefits of technology

Improves the accuracy of document edge detection even when the boundary between the background and shadow is undetectable, enhancing the precision of skew correction in image forming apparatuses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024176965000001_ABST
    Figure 2024176965000001_ABST
Patent Text Reader

Abstract

To provide an image processing apparatus and an edge detection method that can improve accuracy of detecting a document edge when a boundary between the background and shadow of a document cannot be detected.SOLUTION: An image processing apparatus comprises: a processing unit that determines, from image data of a document read by a reading device, a value related to a difference between pixel values of pixels adjacent in a direction directed from a background portion to a document portion; a detection unit that detects an edge as a boundary where the pixel value changes on the basis of the value related to the difference determined by the processing unit; a setting unit that, when the detection unit detects an edge with a change of initially getting dark, sets the edge to a first edge, when the detection unit detects an edge with a change of getting bright before the detection of the first edge, sets the edge to a second edge, and when the detection unit detects an edge with a change of getting dark or a change of getting bright after the detection of the first edge, sets the edge to the second edge; and a determination unit that determines the second edge set by the setting unit as a document edge of the document.SELECTED DRAWING: Figure 6
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to an image processing device and an edge detection method. [Background technology]

[0002] Conventionally, in image forming devices such as copiers, skew that occurs when an automatic document feeder (ADF) reads an original document is corrected by a mechanical mechanism. In recent years, a correction technique that corrects skew by image processing instead of correcting skew by a mechanical mechanism has become known. The skew correction technique by image processing is a technique that detects a skew angle from a read image that is read when skew occurs in the original document, and performs correction by image processing based on the angle. In the skew correction technique by image processing, in order to detect the skew angle, it is necessary to accurately detect the edge of the original document from the read image.

[0003] Such a technology for detecting document edges includes a first boundary detection unit that detects the boundary between the background and the shadow of the detected object, and a second boundary detection unit that detects the boundary between the shadow of the detected object and the detected object; the detection results by the second boundary detection unit are divided into multiple regions, the tilt of each region is detected, and tilts of the multiple regions in the detection results by the second boundary detection unit that are abnormal due to damage to the document, etc. are removed; and if the tilts of the detection results by the first boundary detection unit and the detection results by the second boundary detection unit are close, a tilt correction is performed (for example, Patent Document 1).

[0004] Furthermore, in order to prevent vertical streak noise and brightness changes within the document from being mistakenly detected as the document edge, a configuration has been disclosed in which pixel candidate sets that form the boundary line of the document area are detected, an approximation line is calculated along the candidate pixels to obtain a provisional document boundary line, it is determined whether there is a shadow image caused by the document edge within a specified distance from the provisional document boundary line, and if there is a shadow image, it is determined that the correct document boundary is located near the provisional document boundary line (for example, Patent Document 2). Summary of the Invention [Problem to be solved by the invention]

[0005] However, conventional technology is based on the premise that the boundary between the background and the object to be detected (document) is correctly detected. If the boundary cannot be detected, there is a problem that the boundary between the document and the shadow, i.e., the document edge, cannot be detected.

[0006] The present invention has been made in consideration of the above, and aims to provide an image processing device and an edge detection method that can improve the accuracy of detecting document edges when the boundary between the background and the shadow of the document cannot be detected. [Means for solving the problem]

[0007] In order to solve the above-mentioned problems and achieve the object, the present invention is characterized in that it comprises a processing unit that calculates a value related to the difference in pixel values ​​between adjacent pixels in the image data of a document read by a reading device in a direction from the background part to the document part in the image data; a detection unit that searches for pixels in the direction and detects an edge as a boundary where pixel values ​​change based on the value related to the difference calculated by the processing unit; a setting unit that sets the edge as a first edge when the detection unit first detects an edge of a darkening change, sets the edge as a second edge when the detection unit detects an edge of a brightening change before detecting the first edge, and sets the edge as the second edge when the detection unit detects an edge of a darkening change or a brightening change after detecting the first edge; and a determination unit that determines the second edge set by the setting unit as the document edge of the document. Effect of the Invention

[0008] According to the present invention, it is possible to improve the accuracy of detecting the document edge when the boundary between the background and the shadow of the document cannot be detected. [Brief description of the drawings]

[0009] [Figure 1] FIG. 1 is a diagram showing an example of the overall configuration of an image forming apparatus according to the first embodiment. [Diagram 2] FIG. 2 is a diagram illustrating an example of the configuration of a scanner of the image forming apparatus according to the first embodiment. [Diagram 3] FIG. 3 is a diagram showing an example of the configuration of the ADF of the image forming apparatus according to the first embodiment. [Figure 4] FIG. 4 is a diagram showing a schematic configuration in the vicinity of the document reading position. [Diagram 5] FIG. 5 is a diagram illustrating an example of a hardware configuration of an image processing unit of the image forming apparatus according to the first embodiment. [Figure 6] FIG. 6 is a diagram illustrating an example of a functional block configuration of an image processing unit of the image forming apparatus according to the first embodiment. [Figure 7] FIG. 7 is a diagram showing an example of a state in which a white original is read. [Figure 8] FIG. 8 is a diagram illustrating an example of a differential filter. [Figure 9] FIG. 9 is a diagram for explaining the operation of detecting the document edge of a white document. [Figure 10] FIG. 10 is a diagram for explaining the operation of detecting the edge of a white original when the original shadow is difficult to appear. [Figure 11] FIG. 11 is a diagram for explaining the operation of detecting the document edge of a black document. [Figure 12] FIG. 12 is a flowchart showing an example of the flow of document edge detection processing by the image forming apparatus according to the first embodiment. [Figure 13] FIG. 13 is a flowchart showing an example of the flow of the edge search determination process by the image forming apparatus according to the first embodiment. [Figure 14] FIG. 14 is a diagram for explaining the operation of detecting the document edge of a black document when the document shadow is difficult to appear. [Figure 15] FIG. 15 is a flowchart showing an example of the flow of edge search determination processing by the image forming apparatus according to the second embodiment. [Figure 16]FIG. 16 is a diagram illustrating an example of the functional block configuration of an image processing unit of an image forming apparatus according to the third embodiment. [Figure 17] FIG. 17 is a diagram for explaining the operation of detecting the document edge of a white document when noise is present. [Figure 18] FIG. 18 is a flowchart showing an example of the flow of document edge detection processing by the image forming apparatus according to the third embodiment. [Figure 19] FIG. 19 is a diagram illustrating an example of the configuration of functional blocks of an image processing unit of an image forming apparatus according to the fourth embodiment. [Figure 20] FIG. 20 is a diagram for explaining the operation of detecting the document edge of a white document when an image is printed near the document edge. [Figure 21] FIG. 21 is a flowchart showing an example of the flow of document edge detection processing by the image forming apparatus according to the fourth embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0010] Hereinafter, with reference to the drawings, an embodiment of an image processing device and an edge detection method according to the present invention will be described in detail. Furthermore, the present invention is not limited to the following embodiment, and the components in the following embodiment include those that a person skilled in the art can easily conceive, those that are substantially the same, and those that are within the scope of what is called equivalent. Furthermore, various omissions, substitutions, modifications, and combinations of the components can be made without departing from the spirit of the following embodiment.

[0011] [First embodiment] (Overall configuration of image forming apparatus) Fig. 1 is a diagram showing an example of the overall configuration of an image forming apparatus according to the first embodiment. The overall configuration of an image forming apparatus 100 according to this embodiment will be described with reference to Fig. 1.

[0012] Image forming apparatus 100 shown in Fig. 1 is a multifunction peripheral (MFP) having at least two of a copy function, a printer function, a scanner function, and a facsimile function. Image forming apparatus 100 is an example of the "image processing apparatus" of the present invention. As shown in Fig. 1, image forming apparatus 100 includes a scanner 101 (reading device), an ADF 102, a paper feed unit 103, and an apparatus main body 104.

[0013] The image forming apparatus 100 includes a plotter 120, which is an image forming unit, in an apparatus body 104. The plotter 120 includes a tandem imaging unit 105, a registration roller 108 that supplies recording paper from a paper feed unit 103 to the imaging unit 105 via a transport path 107, an optical writing device 109, a fixing unit 110, and a double-sided tray 111.

[0014] The image forming unit 105 includes four photoconductor drums 112 arranged side by side to correspond to the four colors of Y (yellow), M (magenta), C (cyan), and K (black). Around each photoconductor drum 112, image forming elements including a charger, a developing unit 106, a transfer unit, a cleaner, and a static eliminator are arranged.

[0015] Between the transfer unit and the photosensitive drum 112, an intermediate transfer belt 113 is disposed, which is sandwiched in the nip between the transfer unit and the photosensitive drum 112 and stretched between a drive roller and a driven roller.

[0016] In the tandem type image forming apparatus 100 configured in this manner, optical writing device 109 optically writes onto photoconductor drums 112 corresponding to each color of Y, M, C, and K based on an original image read by scanner 101 from an original serving as a detection object sent from ADF 102, develops each color with toner in developer 106, and primarily transfers onto intermediate transfer belt 113 in the order of Y, M, C, and K, for example. Then, image forming apparatus 100 secondary transfers the full-color image formed by the primary transfer, in which the four colors are superimposed, onto recording paper supplied from paper feed unit 103, and then fixes the image in fixing unit 110 and discharges the paper, thereby forming a full-color image on the recording paper.

[0017] (Scanner configuration) 2 is a diagram showing an example of the configuration of a scanner of the image forming apparatus according to the first embodiment. The configuration of the scanner 101 of the image forming apparatus 100 according to the present embodiment will be described with reference to FIG.

[0018] As shown in FIG. 2, the scanner 101 of the image forming device 100 includes a first carriage 25, a second carriage 26, an imaging lens 27, and an imaging unit 28, and each of these components is disposed inside the main body frame 101a of the scanner 101.

[0019] Furthermore, inside main body frame 101a of scanner 101, a first rail and a second rail (not shown) are provided to extend in the sub-scanning direction (left and right direction in FIG. 2). The first rail is made up of two rails arranged at a predetermined interval in the main scanning direction perpendicular to the sub-scanning direction. The second rail has the same configuration as the first rail.

[0020] The first carriage 25 is slidably attached to the first rail, and is configured to be movable back and forth in the sub-scanning direction between the position indicated by the solid line and the position indicated by the dashed line in Fig. 2 by a drive motor (not shown) via a drive wire for the first carriage (not shown). The first carriage 25 includes a light source 24 and a first mirror member 25a.

[0021] The second carriage 26 is slidably attached to the second rail, and is configured to be movable back and forth in the sub-scanning direction between the position indicated by the solid line and the position indicated by the dashed line in Fig. 2 by a drive motor (not shown) via a drive wire for the second carriage (not shown). The second carriage 26 includes a second mirror member 26a and a third mirror member 26b.

[0022] Here, the first carriage 25 and the second carriage 26 move in the sub-scanning direction at a speed ratio of 2: 1. Due to this relationship in moving speed, even if the first carriage 25 and the second carriage 26 move, the optical path length of the light from the document surface of the document placed on the contact glass 8 to the imaging lens 27 does not change.

[0023] The imaging lens 27 focuses the reflected light from the original document incident through each mirror member onto the imaging unit 28. The imaging unit 28 is composed of an imaging element such as a CCD (Charge-Coupled Device) or a CMOS (Complementary Metal Oxide Semiconductor), and photoelectrically converts the reflected light image of the original document imaged through the imaging lens 27 to output an analog image signal that is a read image.

[0024] (ADF Configuration) Fig. 3 is a diagram showing an example of the configuration of the ADF of the image forming apparatus according to the first embodiment. Fig. 4 is a diagram showing a schematic configuration in the vicinity of the document reading position. The configuration of the ADF 102 of the image forming apparatus 100 according to the present embodiment will be described with reference to Figs. 3 and 4.

[0025] As shown in Fig. 3, the ADF 102 is equipped with a document tray 11 on which a document is placed. The document tray 11 has a movable document table 41 that rotates in the directions a and b in the figure with its base end as a fulcrum, and a pair of side guide plates 42 that position the document in the left and right directions relative to the document feed direction. By rotating the movable document table 41, the front end of the document in the feed direction is adjusted to an appropriate height.

[0026] Further, the document length detection sensors 89, 90 are sensors which detect whether the document is oriented vertically or horizontally, and are provided spaced apart in the paper feed direction in the document tray 11. Note that the document length detection sensors 89, 90 may be reflective sensors which perform detection by optical means without contact, or may be contact-type actuator-type sensors.

[0027] One side of the pair of side guide plates 42 is slidable in the left-right direction relative to the paper feed direction, and documents of different sizes can be placed on it.

[0028] A set filler 46 that rotates when a document is placed on it is provided on the fixed side of the pair of side guide plates 42. A document set sensor 82 that detects that a document has been placed on the document tray 11 is provided at the bottom of the movement trajectory of the tip of the set filler 46. In other words, the document set sensor 82 detects the presence or absence of a document set in the ADF 102 based on whether the set filler 46 has rotated and come off the document set sensor 82.

[0029] 3, the ADF 102 includes a conveying section 50 including a separation and feeding section 51, a pull-out section 52, a turning section 53, a first reading and conveying section 54, a second reading and conveying section 55, and a paper ejection section 56. Each conveying roller of the conveying section 50 is rotated by one or more conveying motors.

[0030] The separation and feeding section 51 has a pickup roller 61 arranged near a paper feed port 60 for feeding the document, and a paper feed belt 62 and a reverse roller 63 arranged to face each other across the transport path.

[0031] Pickup roller 61 is supported by a support arm member 64 attached to paper feed belt 62, and moves up and down in directions c and d in the figure between a contact position where it contacts the document stack and a separated position away from the document stack via a cam mechanism (not shown). Pickup roller 61 picks up several documents (ideally one document) from the documents loaded on document tray 11 at the contact position.

[0032] The paper feed belt 62 rotates in the feeding direction. The reverse roller 63 rotates in the opposite direction to the feeding direction. When multiple documents are fed, the reverse roller 63 rotates in the opposite direction to the paper feed belt 62. However, when the reverse roller 63 is in contact with the paper feed belt 62 or when only one document is being conveyed, the reverse roller 63 rotates together with the paper feed belt 62 due to the action of a torque limiter (not shown). This prevents multiple documents from being fed.

[0033] The pull-out unit 52 has a pair of pull-out rollers 65 arranged to sandwich the transport path 52a. The pull-out unit 52 performs primary abutment alignment (so-called skew correction) of the sent document by the drive timing of the pull-out roller 65 and the pickup roller 61, and pulls out and transports the document after alignment.

[0034] The turning unit 53 has a pair of rollers, an intermediate roller 66 and a reading entrance roller 67, arranged to sandwich a conveying path 53a curved from top to bottom. The turning unit 53 turns the document drawn and conveyed by the intermediate roller 66 by conveying it along the curved conveying path, and conveys it by the reading entrance roller 67 with the front surface of the document facing downward to the vicinity of the slit glass 7, which is the reading position (imaging position) of the document.

[0035] Here, the transport speed of the document from the pull-out section 52 to the turn section 53 is set to be faster than the transport speed in the first reading transport section 54. This reduces the transport time of the document transported to the first reading transport section 54.

[0036] The first reading transport section 54 has a first reading roller 68 arranged to face the slit glass 7, and a first reading exit roller 69 arranged on the transport path 55a after reading is completed. The first reading transport section 54 transports the document that has been transported close to the slit glass 7 while bringing the surface of the document into contact with the slit glass 7 by the first reading roller 68. At this time, the document is read by the scanner 101 through the slit glass 7. At this time, the first carriage 25 and the second carriage 26 of the scanner 101 are stopped at the home position. The first reading transport section 54 further transports the document after reading by the first reading exit roller 69.

[0037] Here, a configuration in the vicinity of the document reading position is shown typically in Fig. 4. In Fig. 4, the document is transported from left to right.

[0038] As shown in Fig. 4, the ADF 102 is provided with a background member 92 that serves as an imaging background at a position facing the slit glass 7. The background member 92 is, for example, white and is used for shading correction. The original is transported between the slit glass 7 and the background member 92. The scanner 101 reads the image at the position of the reading line shown in Fig. 4.

[0039] The second reading conveying section 55 has a second reading section 91 that reads the back side of the document, a second reading roller 70 arranged to face the second reading section 91 across the conveying path 55a, and a second reading exit roller 71 arranged downstream of the second reading section 91 in the conveying direction.

[0040] In the second reading transport section 55, the back side of the document after the front side has been read is read by the second reading section 91. The document after the back side has been read is transported toward the paper discharge outlet by the second reading exit rollers 71. The second reading rollers 70 suppress the document from floating in the second reading section 91, and also serve as a reference white area for acquiring shading data in the second reading section 91. When double-sided reading is not performed, the document passes straight through the second reading section 91.

[0041] The paper discharge unit 56 is provided with a pair of paper discharge rollers 72 in the vicinity of the paper discharge outlet, and discharges the document conveyed by the second reading outlet rollers 71 onto the paper discharge tray 12.

[0042] In addition, the ADF 102 is provided with various sensors along the transport path, such as a bump sensor 84, a registration sensor 81, and a paper discharge sensor 83, which are used for transport control such as the transport distance and transport speed of the document.

[0043] Furthermore, an original width sensor 85 is provided between the pull-out roller 65 and the intermediate roller 66. The length of the original in the transport direction is detected from the motor pulses by reading the leading and trailing ends of the original with an abutment sensor 84 or a registration sensor 81.

[0044] (Hardware configuration of the image processing unit) Fig. 5 is a diagram showing an example of a hardware configuration of an image processing unit of the image forming apparatus according to the first embodiment. The hardware configuration of the image processing unit 200 of the image forming apparatus 100 according to the present embodiment will be described with reference to Fig. 5.

[0045] As shown in FIG. 5, the image forming apparatus 100 includes an image processing unit 200 that performs predetermined processing on an original image read by a scanner 101 and outputs the processed image to a plotter 120 as image data.

[0046] As shown in FIG. 5, the image processing unit 200 includes a CPU (Central Processing Unit) 201, a ROM (Read Only Memory) 202, a main memory (image memory) 205, a chipset 206, an image processing ASIC (Application Specific Integrated Circuit) 207, a controller ASIC 208, a main memory (image memory) 209, and an I / O ASIC 210.

[0047] The CPU 201 is a calculation device that controls the overall operation of the image forming apparatus 100. The ROM 202 is a non-volatile storage device that stores programs for the image forming apparatus 100. The main memory 205 is an image memory that is used as a work area in which the programs for the CPU 201 to control the image forming apparatus 100 are expanded and that temporarily stores image data to be handled.

[0048] Chipset 206 is an integrated circuit that is used in conjunction with CPU 201 to control access by controller ASIC 208 and I / O ASIC 210 to main memory 205 .

[0049] The scanner 101 is a reading device having the function of reading image data to be copied and image data to be output to an external interface. The plotter 120 is a printer device having the function of printing image data that has been image-processed by the controller ASIC 208.

[0050] The image processing ASIC 207 is an integrated circuit that performs image processing on image data read by the scanner 101 and outputs the image data to the controller ASIC 208. The image processing ASIC 207 also processes image data from the controller ASIC 208 so that the image data can be printed by the plotter 120, and sends the image data in accordance with the printing timing of the plotter 120.

[0051] The controller ASIC 208 is an integrated circuit that uses the main memory 205 via the chipset 206 to rotate and edit image data handled by the image forming apparatus 100, stores the image data in a hard disk drive (HDD) 211, and transmits and receives the image data to and from the image processing ASIC 207. The main memory 209 is an image memory that performs image processing by the controller ASIC 208. The HDD 211 is used to temporarily store the image data that has been subjected to image processing.

[0052] The I / O ASIC 210 is an external interface for providing additional functions to the image forming apparatus 100. For example, the I / O ASIC 210 includes interfaces such as a network interface, a Universal Serial Bus (USB), an SD card, an operation unit, an SPI, an I2C, and a document width sensor 85, or a hardware accelerator for accelerating image processing, an encryption processing circuit, and the like.

[0053] (Configuration and operation of functional blocks of image processing section) FIG. 6 is a diagram showing an example of the configuration of functional blocks of an image processing unit of an image forming apparatus according to a first embodiment. FIG. 7 is a diagram showing an example of a state in which a white original is read. FIG. 8 is a diagram showing an example of a differential filter. FIG. 9 is a diagram explaining the operation of detecting an original edge of a white original. FIG. 10 is a diagram explaining the operation of detecting an original edge of a white original when the original shadow is difficult to appear. FIG. 11 is a diagram explaining the operation of detecting an original edge of a black original. The configuration and operation of functional blocks of an image processing unit 200 of an image forming apparatus 100 according to this embodiment will be described with reference to FIGS. 6 to 11.

[0054] The image processing unit 200 shown in FIG. 6 inputs image data read by the scanner 101 as input image data, and detects the edges (document edges) of the image portion of the document (hereinafter sometimes simply referred to as the document) contained in the input image data.

[0055] Fig. 7 shows an example of image data when a white original is read by the scanner 101. In the example shown in Fig. 7, the up-down direction is the sub-scanning direction. As shown in Fig. 7, the image data includes a white original 401 which is an image portion of the white original, a background 400 which is an image portion of the background member 92, and an original shadow 402 which is an image portion of a shadow generated between the white original and the background member 92. The original shadow 402 also includes an area 500 which becomes darker from the background 400, and an area 501 which becomes brighter toward the white original 401. In this embodiment, when detecting the document edge (edge ​​of the upper side) of the document, the image data is scanned from the top to the bottom in the sub-scanning direction, and the boundary between the background 400 and the document shadow 402, which corresponds to the area 500 of the document shadow 402, is detected as the first edge, and then the scanning is continued to detect the boundary between the document shadow 402 and the white document 401, which corresponds to the area 501 of the document shadow 402, as the second edge, and the second edge is determined to be the document edge.

[0056] In this embodiment, the edge of the upper side of the document (white document 401 in FIG. 7) is detected as the document edge detection target as shown in FIG. 7, but the operation described below can be similarly applied to the case where the left side, right side, and lower side are detected as the document edges. Also, in FIG. 7 and subsequent figures, the description focuses only on the upper side of the document and the document shadow corresponding to the upper side.

[0057] As shown in FIG. 6, the image processing unit 200 has a filter processing unit 300 (processing unit), an edge detection unit 310 (detection unit), an edge search and determination unit 320 (setting unit), and a document edge determination unit 330 (determination unit).

[0058] The filter processing unit 300 is a functional unit that performs filter processing on input image data using a differential filter as shown in Fig. 8. Specifically, the filter processing unit 300 performs a convolution operation on pixel values ​​in the sub-scanning direction at a predetermined main scanning position 600 in the input image data as shown in Fig. 9(a) using the differential filter as shown in Fig. 8, thereby obtaining a differential amount for each pixel value.

[0059] Here, the graph shown in FIG. 9(b) shows a graph of pixel values ​​for a pixel at the main scanning position 600, with the horizontal axis representing pixel values ​​and the vertical axis representing sub-scanning positions. The graph shown in FIG. 9(c) shows a graph of the differential amount for a pixel at the main scanning position 600, with the horizontal axis representing differential amount and the horizontal axis representing sub-scanning positions. That is, the filter processing unit 300 performs filtering using a differential filter on the pixel values ​​at the main scanning position 600 in the graph of FIG. 9(b), thereby obtaining the graph of the differential amount in FIG. 9(c). This differential amount is equivalent to the slope of the pixel value graph (the rate of change in pixel value), and a negative value indicates a darkening change, and a positive value indicates a brightening change. A predetermined threshold value ±a is set in advance for this differential amount, and if it is equal to or less than the threshold value -a (an example of a first threshold value), it can be detected as an edge of a darkening change, and if it is equal to or more than the threshold value a (an example of a second threshold value), it can be detected as an edge of a brightening change. In the example of the differential graph shown in FIG. 9(c), the sub-scanning position corresponding to portion 510 where the value is equal to or less than threshold value -a corresponds to the edge of the darkening change (corresponding to the first edge mentioned above), and the sub-scanning position corresponding to portion 511 where the value is equal to or greater than threshold value a corresponds to the edge of the brightening change (corresponding to the second edge mentioned above).

[0060] Note that the differential filter shown in FIG. 8 shows an example of a 5×5 size filter, but is not limited thereto, and may be a differential filter of another size. The differential filter shown in FIG. 8 is a filter for detecting edges when a document is scanned in the sub-scanning direction, but the differential filter can be used in a similar manner to detect edges in the main scanning direction by transposing and calculating the differential filter. In addition, a method using a differential amount obtained by filtering using a differential filter has been described, but the present invention is not limited thereto, and a method using a pixel value difference as disclosed in Japanese Patent Application Laid-Open No. 2020-123940 can also be adopted. Specifically, Japanese Patent Application Laid-Open No. 2020-123940 discloses a method using the absolute value of the pixel value difference, but in this embodiment, in order to detect both edges of a brightening change and edges of a darkening change, the pixel value difference may be used with a sign. The above-mentioned differential amount for the pixel value indicates the rate of change in pixel value, that is, the amount of change in pixel value per unit change in the sub-scanning direction, so it can be said to be an example of a method using a pixel value difference. That is, the above-mentioned differential amount and the difference in pixel values ​​are examples of the "value related to the difference in pixel values" in the present invention.

[0061] The edge detection unit 310 is a functional unit that detects whether or not a target pixel corresponds to an edge, using a differential amount filtered by the filter processing unit 300, for pixels aligned in the sub-scanning direction at a specific main scanning position (for example, main scanning position 600 shown in FIG. 9) of the input image data. In the example shown in FIG. 9, the edge detection unit 310 detects whether or not the target pixel corresponds to the portion 510 or the portion 511.

[0062] Next, referring to FIG. 10, a case where the document shadow is difficult to appear between the white document and the background will be described. The case where the document shadow is difficult to appear includes, for example, a case where the arrangement of the light source 24 of the scanner 101 is nearly perpendicular to the document, or a case where the document is a transparent document such as thin paper or tracing paper that transmits part of the light. As shown in FIG. 10(a), the image data includes a white document 401a which is an image portion of the white document, a background 400 which is an image portion of the background member 92, and a document shadow 402a which is an image portion of the shadow generated between the white document and the background member 92. When the document shadow is difficult to appear, as shown in FIG. 10(a), the document shadow 402a becomes thinner in the sub-scanning direction or brighter than the document shadow 402 shown in FIG. 7 and FIG. 9. In this case, in the graph of differential amounts shown in FIG. 10(c) obtained by filtering the graph of pixel values ​​shown in FIG. 10(b) using a differential filter, a portion 521 corresponding to the edge of the boundary between the document shadow 402a and the white document 401a is detected as an edge because it is equal to or greater than the threshold a, whereas a portion 520 corresponding to the boundary between the background 400 and the document shadow 402a is not equal to or less than the threshold -a and therefore cannot be detected as an edge. Even in such a case, the image processing unit 200 of the image forming apparatus 100 according to this embodiment can detect the edge corresponding to the portion 521 as the document edge. Details of the document edge detection operation by the image processing unit 200 will be described later with reference to FIG. 12 and FIG. 13.

[0063] Next, a case where a black original is read will be described with reference to Fig. 11. As shown in Fig. 11(a), the image data includes a black original 411 which is an image portion of the black original, a background 400 which is an image portion of the background member 92, and an original shadow 412 which is an image portion of a shadow generated between the black original and the background member 92. Fig. 11(b) shows a graph of pixel values, and Fig. 11(c) shows a graph of a differential amount obtained by filtering the graph of pixel values ​​shown in Fig. 11(b) using a differential filter. In the case of such a black original, the original shadow 412 includes an area that becomes darker from the background 400 and an area that becomes even darker toward the black original 411. When detecting the document edge of a black document in this way, image processing unit 200 scans from the top to the bottom in the sub-scanning direction of image data, detects the boundary between background 400 and document shadow 412, which corresponds to an area that becomes darker from background 400, as a first edge, and then continues scanning to detect the boundary between document shadow 412 and black document 411, which corresponds to an area that becomes even darker toward black document 411, as a second edge, and determines the second edge as the document edge. Specifically, edge detection unit 310 detects the sub-scanning position corresponding to portion 530 that is equal to or greater than threshold a as an edge of a change that becomes darker from background 400 (corresponding to the above-mentioned first edge), and detects the sub-scanning position corresponding to portion 531 that is equal to or greater than threshold a as an edge of a change that becomes even darker toward black document 411 (corresponding to the above-mentioned second edge).

[0064] In addition, although FIG. 11 illustrates an example of an achromatic black original, the same processing as described above is possible even for a highly saturated colored original by using the pixel value of a color that is the minimum value among the pixel values ​​of the three colors R (red), G (green), and B (blue).

[0065] The edge search determination unit 320 is a functional unit that determines whether or not to further search for the next edge in the sub-scanning direction, depending on the detection result by the edge detection unit 310. Note that the determination process by the edge search determination unit 320 will be described later with reference to FIG.

[0066] The document edge determination unit 330 is a functional unit that determines the last edge detected by the edge detection unit 310 as the final document edge when the edge search determination unit 320 determines that the search is terminated without searching for the next edge. The document edge determination unit 330 outputs document edge information including information on the sub-scanning position of the document edge. This document edge information is used in the subsequent document skew correction process.

[0067] The above-mentioned filter processing unit 300, edge detection unit 310, edge search determination unit 320, and document edge determination unit 330 are realized by executing a program by the CPU 201 shown in Fig. 5. Note that some or all of the filter processing unit 300, edge detection unit 310, edge search determination unit 320, and document edge determination unit 330 may be realized by a hardware circuit (integrated circuit) such as an FPGA (Field-Programmable Gate Array) or an ASIC, instead of a software program.

[0068] Note that the functions of each functional unit of the image processing unit 200 shown in Fig. 6 are conceptually shown, and the configuration is not limited to this. For example, the multiple functional units illustrated as independent functional units in the image processing unit 200 shown in Fig. 6 may be configured as one functional unit. On the other hand, the function of one functional unit in the image processing unit 200 shown in Fig. 6 may be divided into multiple functions and configured as multiple functional units.

[0069] (Flow of document edge detection process by image forming device) Fig. 12 is a flowchart showing an example of the flow of document edge detection processing by the image forming apparatus according to the first embodiment. Fig. 13 is a flowchart showing an example of the flow of edge search determination processing by the image forming apparatus according to the first embodiment. The flow of document edge detection processing by the image forming apparatus 100 according to this embodiment will be described with reference to Figs. 12 and 13.

[0070] <Step S11> The filter processing unit 300 of the image processing unit 200 calculates a differential amount for each pixel value by performing a convolution operation using a differential filter shown in Fig. 8 on pixel values ​​in the sub-scanning direction at a predetermined main scanning position in the input image data. Note that the filter processing unit 300 may perform a filter process using a differential filter on the pixel value of the target pixel for each detection process of the edge detection unit 310 in step S13. Then, the process proceeds to step S12.

[0071] <Step S12> The edge detection unit 310 of the image processing unit 200 sets a predetermined sub-scanning position (for example, the upper end position of the input image data) as the search start position. That is, the edge detection unit 310 sets the pixel at the search start position as the target pixel. Then, the process proceeds to step S13.

[0072] <Step S13> The edge detection unit 310 detects whether the target pixel corresponds to an edge using the differential amount filtered by the filter processing unit 300. Specifically, when the differential amount of the pixel value corresponding to the target pixel is equal to or less than the threshold value -a or equal to or more than the threshold value a, the edge detection unit 310 detects the target pixel as a pixel corresponding to an edge. On the other hand, when the differential amount of the pixel value corresponding to the target pixel exceeds the threshold value -a and is less than the threshold value a, the edge detection unit 310 detects the target pixel as a pixel not corresponding to an edge. Note that the filter processing unit 300 may detect, as a pixel corresponding to an edge, a pixel in a portion where the differential amount is a minimum value when pixels whose differential amount is equal to or less than the threshold value -a are consecutive, and a pixel in a portion where the differential amount is a maximum value when pixels whose differential amount is equal to or more than the threshold value a are consecutive. Then, the process proceeds to step S14.

[0073] <Step S14> The edge search determination unit 320 of the image processing unit 200 determines whether or not to further search for the next edge in the sub-scanning direction, depending on the detection result by the edge detection unit 310. Specifically, the edge search determination unit 320 executes edge search determination processing of steps S141 to S146 shown in FIG.

[0074] <<Step S141>> The edge search determination unit 320 determines whether or not an edge of a change from the background to lighter, that is, a first edge, has already been detected by the edge detection unit 310. If the first edge has not been detected (step S141: Yes), the process proceeds to step S142, and if the first edge has already been detected (step S141: No), the process proceeds to step S146.

[0075] <<Step S142>> The edge search determination unit 320 determines whether or not the target pixel has been detected as a pixel corresponding to an edge of a darkening change by the edge detection unit 310. If the target pixel has been detected as a pixel corresponding to an edge of a darkening change (step S142: Yes), the process proceeds to step S145, and if the target pixel has not been detected as a pixel corresponding to an edge of a darkening change (step S142: No), the process proceeds to step S143.

[0076] <<Step S143>> The edge search determination unit 320 determines whether or not the target pixel has been detected as a pixel corresponding to an edge of a brightening change by the edge detection unit 310. If the target pixel has been detected as a pixel corresponding to an edge of a brightening change (step S143: Yes), the process proceeds to step S144, and if the target pixel has not been detected as a pixel corresponding to an edge of a brightening change (step S143: No), it is determined that the second edge has not been detected, the edge search determination process is terminated, and the process proceeds to step S15.

[0077] <<Step S144>> If step S143: Yes, edge search determination unit 320 sets the target pixel detected by edge detection unit 310 as a pixel corresponding to the edge of a brightening change to a pixel corresponding to the second edge. Also, if step S146: Yes, edge search determination unit 320 sets the target pixel detected by edge detection unit 310 as a pixel for the edge of a darkening change or a brightening change to a pixel corresponding to the second edge. Then, regarding the second edge as having been detected, the edge search determination process ends and the process proceeds to step S15.

[0078] <<Step S145>> The edge search determination unit 320 sets the target pixel detected by the edge detection unit 310 as a pixel corresponding to the edge of the darkening change as a pixel corresponding to the first edge. Then, since it is determined that the second edge has not yet been detected, the edge search determination process ends and the process proceeds to step S15.

[0079] <<Step S146>> The edge search determination unit 320 determines whether the target pixel has been detected as a pixel corresponding to either an edge of a darkening or brightening change by the edge detection unit 310. If the target pixel has been detected as a pixel corresponding to either edge (step S146: Yes), the process proceeds to step S144, and if the target pixel has not been detected as a pixel corresponding to either edge (step S146: No), the process terminates the edge search determination process as it is determined that a second edge has not been detected, and proceeds to step S15.

[0080] <Step S15> If the edge search determination unit 320 determines that the second edge has been detected and the edge search is terminated (step S15: Yes), the process proceeds to step S16, and if the second edge has not been detected (step S15: No), the process proceeds to step S17.

[0081] <Step S16> When the edge search determination unit 320 detects a second edge and determines that the search is to end without searching for the next edge, the document edge determination unit 330 of the image processing unit 200 determines the second edge as the final document edge. In other words, the document edge determination unit 330 determines the sub-scanning position of the target pixel corresponding to the second edge as the position of the final document edge. Then, the document edge detection process ends.

[0082] <Step S17> The edge detection unit 310 judges whether the edge detection process is completed for the pixels in a predetermined search range in the sub-scanning direction. If the edge detection process is completed for the pixels in the predetermined search range (step S17: Yes), the process proceeds to step S18, and if not (step S17: No), the process proceeds to step S19.

[0083] <Step S18> The document edge determination unit 330 outputs a detection error (detection abnormality) indicating that the document edge could not be detected, and then ends the document edge detection process.

[0084] <Step S19> The edge detection unit 310 sets the pixel next to the target pixel in the sub-scanning direction as the new target pixel, and returns to step S13. Note that the pixel next to the target pixel may be an adjacent pixel in the sub-scanning direction, or may be a pixel a predetermined number of pixels ahead (for example, the number of pixels in the sub-scanning direction of the differential filter).

[0085] Through the above steps S11 to S19, the document edge detection process is executed.

[0086] For example, when detecting the edge of a white original with an original shadow as shown in Fig. 9 described above, the edge detection unit 310 detects an edge of a darkening change at the sub-scanning position of portion 510 where background 400 changes to original shadow 402, and the edge search determination unit 320 sets the edge as the first edge in step S145. For pixels at subsequent sub-scanning positions, the edge search determination unit 320 determines in step S141 that the first edge has been detected, and the process proceeds to step S146. On the front side of the sub-scanning position of portion 511, the edge search determination unit 320 determines in step S146 that neither an edge of a darkening change nor an edge of a brightening change has been detected, and the edge search process continues. Then, when the sub-scanning position of portion 511 where the document shadow 402 changes to the white document 401 is reached, the edge detection unit 310 detects an edge of a change to brighter, and in step S146 the edge search determination unit 320 determines that an edge of a change to brighter has been detected, and in step S144 the edge is set as the second edge, ending the edge search process. Then, in step S16 the document edge determination unit 330 determines that the second edge is the final document edge.

[0087] In addition, when detecting the edge of a white original in which the original shadow is unlikely to appear as shown in FIG. 10, the edge detection unit 310 does not detect the edge of the darkening change at the sub-scanning position of the portion 520 where the background 400 changes to the original shadow 402a, and the process proceeds from step S141 to step S142 and step S143. Even after that, the edge detection unit 310 does not determine that the edge has been detected before the sub-scanning position of the portion 521 in steps S142 and S143. Then, when the sub-scanning position of the portion 521 where the original shadow 402a changes to the white original 401a is reached, the edge detection unit 310 detects the edge of the brightening change, and the edge search determination unit 320 determines that the edge of the brightening change has been detected in step S143. The edge is set as the second edge by the edge search determination unit 320 in step S144, and the edge search process ends. Then, in step S16, the original edge determination unit 330 determines that the second edge is the final original edge.

[0088] 11, an edge of a darkening change is detected at the sub-scanning position of portion 530 where background 400 changes to document shadow 412, and the edge is set as the first edge in step S145. In pixels at subsequent sub-scanning positions, edge search determination unit 320 determines in step S141 that the first edge has been detected, and the process proceeds to step S146. On the front side of the sub-scanning position of portion 531, edge search determination unit 320 determines in step S146 that neither an edge of a darkening change nor an edge of a brightening change has been detected, and the edge search process continues. Then, when the sub-scanning position of portion 531 where the document shadow 412 changes to the black document 411 is reached, edge detection unit 310 detects the edge of the darkening change, and in step S146 edge search determination unit 320 determines that the edge of the darkening change has been detected, and in step S144 this edge is set as the second edge, terminating the edge search process. Then, in step S16, document edge determination unit 330 determines that the second edge is the final document edge.

[0089] As described above, in the image forming apparatus 100 according to the present embodiment, the filter processing unit 300 obtains the differential amount of pixel values ​​in the image data from the image data of the document read by the scanner 101 in the direction from the background portion to the document portion, the edge detection unit 310 searches for pixels in the direction and detects an edge as a boundary where the pixel value changes based on the differential amount obtained by the filter processing unit 300, the edge search determination unit 320 sets the edge as a first edge when the filter processing unit 300 detects an edge of a darkening change first, sets the edge as a second edge when the filter processing unit 300 detects an edge of a brightening change before the detection of the first edge, sets the edge as a second edge when the filter processing unit 300 detects an edge of a darkening change or a brightening change after the detection of the first edge, and the document edge determination unit 330 determines the second edge set by the edge search determination unit 320 as the document edge of the document. Therefore, even when the boundary between the background and the document shadow cannot be detected, the detection accuracy of the document edge can be improved.

[0090] Moreover, the image forming apparatus 100 according to the present embodiment corrects the skew of the document based on the document edge determined by the document edge determination unit 330. Therefore, by improving the detection accuracy of the document edge as described above, the skew correction accuracy is also improved.

[0091] [Second embodiment] The image forming apparatus 100 according to the second embodiment will be described, focusing on the differences from the image forming apparatus 100 according to the first embodiment. In this embodiment, an operation capable of detecting an original edge even when an original shadow is unlikely to appear between a black original and the background will be described. Note that the overall configuration of the image forming apparatus 100 according to this embodiment, the configuration of the scanner 101, the configuration of the ADF 102, the hardware configuration of the image processing unit 200, and the configuration of the functional blocks are the same as those of the first embodiment described above.

[0092] (When it is difficult to get a shadow between a black document and the background) 14 is a diagram for explaining the operation of detecting the document edge of a black document when the document shadow is difficult to appear. With reference to FIG. 14, a case where the document shadow is difficult to appear between the black document and the background will be described.

[0093] 14(a), the image data includes a black original 411a which is an image portion of a black original, a background 400 which is an image portion of a background member 92, and an original shadow 412a which is an image portion of a shadow generated between the black original and the background member 92. Also, it is assumed that the black original 411a includes an image portion such as a printed portion 421 as shown in FIG.

[0094] FIG. 14(b) shows a graph of pixel values, and FIG. 14(c) shows a graph of differential amounts obtained by filtering the graph of pixel values ​​shown in FIG. 14(b) with a differential filter. In this case, in the graph of differential amounts shown in FIG. 14(c), a portion 541 corresponding to the edge of the boundary between the document shadow 412a and the black document 411a is detected as an edge because it is equal to or less than the threshold value -a, whereas a portion 540 corresponding to the boundary between the background 400 and the document shadow 412a is not equal to or less than the threshold value -a and cannot be detected as an edge. Then, the edge of the dark change in the portion 541 corresponding to the edge of the boundary between the document shadow 412a and the black document 411a is detected as the first edge, and the next edge is searched for. If there is no next edge, a detection error occurs when the search range is exceeded, and if the edge of the printed portion 421 inside the black document 411a is detected as an edge, it will be significantly deviated from the correct document edge. Even in such a case, the image processing unit 200 of the image forming apparatus 100 according to the present embodiment can detect the edge corresponding to the portion 541 as the document edge. Details of the document edge detection operation by the image processing unit 200 will be described later with reference to FIG.

[0095] (Flow of document edge detection process by image forming device) Fig. 15 is a flowchart showing an example of the flow of edge search determination processing by the image forming apparatus according to the second embodiment. The flow of edge search determination processing by the image forming apparatus 100 according to this embodiment will be described with reference to Fig. 15. Note that since the overall flow of the document edge detection processing by the image forming apparatus 100 according to this embodiment is similar to the flow of the document edge detection processing shown in Fig. 12 above, the operation of this embodiment will be described in detail for the edge search determination processing corresponding to step S14.

[0096] <Steps S141 to S143> The process of steps S141 to S143 is the same as the process of steps S141 to S143 shown in the above-mentioned Fig. 13. Note that in step S141, if the first edge has already been detected (step S141: No), the process proceeds to step S146a.

[0097] <Step S144> If step S143: Yes, the edge search determination unit 320 sets the target pixel detected by the edge detection unit 310 as a pixel corresponding to the edge of a brightening change to a pixel corresponding to the second edge. If step S146: Yes, the edge search determination unit 320 sets the target pixel detected by the edge detection unit 310 as a pixel for the edge of a darkening change or a brightening change to a pixel corresponding to the second edge. If step S147: No, the edge search determination unit 320 sets the first edge detected by the edge detection unit 310 as the edge of a darkening change first to the second edge. Then, regarding the second edge as having been detected, the edge search determination process is terminated and the process proceeds to step S15.

[0098] <Step S145> The process of step S145 is similar to the process of step S145 shown in FIG.

[0099] <Step S146a> The edge search determination unit 320 determines whether the target pixel has been detected as a pixel corresponding to either an edge of a darkening or brightening change by the edge detection unit 310. If the target pixel has been detected as a pixel corresponding to either edge (step S146a: Yes), the process proceeds to step S144, and if the target pixel has not been detected as a pixel corresponding to either edge (step S146a: No), the process proceeds to step S147.

[0100] <Step S147> The edge search determination unit 320 determines whether the distance between the sub-scanning position of the first edge and the current sub-scanning position, i.e., the sub-scanning position of the target pixel, is less than a predetermined threshold (third threshold). If the distance is less than the threshold (step S147: Yes), it is determined that the second edge has not been detected, and the edge search determination process is terminated and the process proceeds to step S15. On the other hand, if the distance is equal to or greater than the threshold (step S147: No), the process proceeds to step S144.

[0101] As a threshold value for determining the distance between the sub-scanning position of the first edge and the current position, for example, the maximum width that can occur as a document shadow may be set. In other words, even if the first detected edge of the darkening change (first edge) is assumed to be the boundary between the background and the document shadow, if the next edge is not detected even after moving in the sub-scanning direction by the width of the document shadow, it can be determined that the first detected edge (first edge) was not the boundary between the background and the document shadow, but the boundary between the document shadow and the black document, i.e., the document edge.

[0102] The edge search determination process is executed by the above steps S141 to S145, S146a and S147.

[0103] For example, when detecting the edge of a black original in which the original shadow is unlikely to appear as shown in FIG. 14, the edge detection unit 310 does not detect an edge of a darkening change at the sub-scanning position of the portion 540 where the background 400 changes to the original shadow 412a, and the process proceeds from step S141 to step S142 and step S143. Even after that, the edge detection unit 310 does not determine that an edge has been detected before the sub-scanning position of the portion 541 in steps S142 and S143. Then, when the sub-scanning position of the portion 541 where the original shadow 412a changes to the black original 411a is reached, the edge detection unit 310 detects an edge of a darkening change, and the edge search determination unit 320 determines in step S142 that an edge of a darkening change has been detected, and the edge search determination unit 320 sets the edge to the first edge in step S145. If no edge is detected in step S146a at any subsequent sub-scanning position, edge search determination unit 320 determines in step S147 whether the distance between the sub-scanning position of the first edge and the current position, i.e., the sub-scanning position of the target pixel, is less than a predetermined threshold. If the distance is equal to or greater than the threshold, the process proceeds to step S144, where edge search determination unit 320 sets the first edge detected by edge detection unit 310 as the edge of the first darkening change as the second edge, and the edge search process ends. Then, in step S16, document edge determination unit 330 determines the second edge as the final document edge.

[0104] As described above, in the image forming apparatus 100 according to this embodiment, after detecting a first edge, the edge search determination unit 320 determines whether or not the distance between the position of the first edge and the position of the target pixel is less than a predetermined threshold, and if the distance is equal to or greater than the predetermined threshold, sets the first edge as the second edge. This makes it possible to accurately detect the document edge even when the document shadow is unlikely to appear between the black document and the background.

[0105] [Third embodiment] The image forming apparatus 100 according to the third embodiment will be described, focusing on the differences from the image forming apparatus 100 according to the first embodiment. In this embodiment, an operation capable of detecting the document edge even when noise occurs outside the image area of ​​the document will be described. Note that the overall configuration of the image forming apparatus 100 according to this embodiment, the configuration of the scanner 101, the configuration of the ADF 102, and the hardware configuration of the image processing unit 200 are the same as those of the first embodiment described above.

[0106] (Configuration and operation of functional blocks of image processing section) Fig. 16 is a diagram showing an example of the configuration of functional blocks of an image processing unit of an image forming apparatus according to a third embodiment. Fig. 17 is a diagram for explaining the operation of detecting the document edge of a white document when noise is present. The configuration and operation of the functional blocks of an image processing unit 200a of the image forming apparatus 100 according to this embodiment will be described with reference to Figs. 16 and 17.

[0107] The image processing unit 200a shown in Fig. 16 receives image data read by the scanner 101 as input image data, and detects edges of a document included in the input image data as document edges. As shown in Fig. 16, the image processing unit 200a has a filter processing unit 300 (processing unit), an edge detection unit 310 (detection unit), an edge continuation number counting unit 340 (counting unit), an edge search determination unit 320 (setting unit), and a document edge determination unit 330 (determination unit). The functions of the filter processing unit 300, the edge detection unit 310, the edge search determination unit 320, and the document edge determination unit 330 are as described in the first embodiment.

[0108] Here, a case where a document edge of a document in the presence of noise is detected will be described with reference to Fig. 17. As shown in Fig. 17(a), the image data includes a white document 401b which is an image portion of a white document, a background 400 which is an image portion of a background member 92, a document shadow 402b which is an image portion of a shadow generated between the white document and the background member 92, and a noise 700 which is an image portion of noise existing outside the image area of ​​the white document 401b. Such noise 700 is generated, for example, by dust adhering to the imaging lens 27 or background member 92 of the scanner 101, or dust adhering to the imaging unit 28. In this case, in the graph of the differential amount shown in FIG. 17(b) obtained by filtering the graph of the pixel value in the sub-scanning direction at the main scanning position 600 with a differential filter, it is desirable that a portion 550 corresponding to the boundary between the background 400 and the document shadow 402b, which corresponds to the area that becomes darker from the background 400, is detected as the first edge, and a portion 551 corresponding to the boundary between the document shadow 402b and the white document 401b, which corresponds to the area that becomes brighter toward the white document 401b, is detected as the second edge. However, if noise 700 is present in the image area in front of the document shadow 402b, a portion 552 that is neither the first edge nor the second edge becomes equal to or smaller than the threshold value -a, and may be detected as an incorrect edge. Even in such a case, the image processing unit 200a of the image forming apparatus 100 according to this embodiment can detect the edge corresponding to the portion 551 as the document edge. Details of the document edge detection operation by the image processing unit 200a will be described later with reference to FIG. 18.

[0109] The edge consecutive number counting section 340 is a functional section that counts the number of consecutive pixels that correspond to either a darkening transition or an edge or a brightening transition edge when such pixels are detected consecutively.

[0110] The above-mentioned filter processing unit 300, edge detection unit 310, edge continuation number counting unit 340, edge search determination unit 320, and document edge determination unit 330 are realized by executing a program by the CPU 201 shown in Fig. 5. Note that some or all of the filter processing unit 300, edge detection unit 310, edge continuation number counting unit 340, edge search determination unit 320, and document edge determination unit 330 may be realized by a hardware circuit (integrated circuit) such as an FPGA or ASIC, rather than a software program.

[0111] Note that the functions of each functional unit of the image processing unit 200a shown in Fig. 16 are conceptually shown, and are not limited to such a configuration. For example, the multiple functional units illustrated as independent functional units in the image processing unit 200a shown in Fig. 16 may be configured as one functional unit. On the other hand, the function of one functional unit in the image processing unit 200a shown in Fig. 16 may be divided into multiple functions and configured as multiple functional units.

[0112] (Flow of document edge detection process by image forming device) 18 is a flowchart showing an example of the flow of document edge detection processing by the image forming apparatus according to the third embodiment. The flow of document edge detection processing by the image forming apparatus 100 according to the present embodiment will be described with reference to FIG.

[0113] <Steps S11 to S13> The processing in steps S11 to S13 is similar to that in steps S11 to S13 shown in the above-mentioned Fig. 12. After the processing in step S13 is executed, the process proceeds to step S20.

[0114] <Step S20> When the pixel immediately preceding the target pixel is detected as an edge by the edge detection unit 310, the edge consecutive number count unit 340 determines whether the pixel of the target pixel has been detected as an edge by the edge detection unit 310 and the detection result is similar to the detection result for the pixel immediately preceding the target pixel. If the pixel of the target pixel has been detected as an edge by the edge detection unit 310 and the detection result is similar to the detection result for the pixel immediately preceding the target pixel (step S20: Yes), the process proceeds to step S21. On the other hand, if the pixel of the target pixel has not been detected as an edge by the edge detection unit 310 or the detection result by the edge detection unit 310 is not similar to the detection result for the pixel immediately preceding the target pixel (step S20: No), the process proceeds to step S22.

[0115] <Step S21> The edge consecutive number counting unit 340 adds (counts) the number of consecutive times that the edge detection unit 310 has obtained a detection result for the target pixel that is the same as the detection result for the immediately preceding pixel. Then, the process proceeds to step S14.

[0116] <Step S22> The edge consecutive number counting unit 340 resets the consecutive number of times that the edge detection unit 310 has obtained a detection result for the target pixel that is the same as the detection result for the immediately preceding pixel. Then, the process proceeds to step S14.

[0117] <Step S14> The edge search determination unit 320 of the image processing unit 200a determines whether or not to further search for the next edge in the sub-scanning direction, depending on the detection result by the edge detection unit 310. Specifically, the edge search determination unit 320 executes the edge search determination process of steps S141 to S146 shown in Fig. 13. Among these, the following processes are performed for steps S142 and S143.

[0118] The processing of step S14 is not limited to the edge search determination processing of steps S141 to S146 shown in FIG. 13, but may be the edge search determination processing of steps S141 to S145, S146a, and S147 shown in FIG. 15.

[0119] <<Step S142>> The edge search determination unit 320 determines whether or not the number of consecutive pixels detected as corresponding to an edge of a darkening change, which is added by the edge consecutive number counting unit 340, exceeds a predetermined threshold (fourth threshold). That is, when the number of consecutive pixels detected as corresponding to an edge of a darkening change, which is added by the edge consecutive number counting unit 340, exceeds the predetermined threshold, the edge search determination unit 320 determines that the target pixel has been detected by the edge detection unit 310 as a pixel corresponding to an edge of a darkening change. When the consecutive number exceeds the predetermined threshold (step S142: Yes), the process proceeds to step S145, and when the consecutive number does not exceed the predetermined threshold (step S142: No), the process proceeds to step S143.

[0120] <<Step S143>> The edge search determination unit 320 determines whether or not the number of consecutive pixels detected as corresponding to an edge of a brightening change, which is added by the edge consecutive number counting unit 340, exceeds a predetermined threshold (fourth threshold). That is, when the number of consecutive pixels detected as corresponding to an edge of a brightening change, which is added by the edge consecutive number counting unit 340, exceeds the predetermined threshold, the edge search determination unit 320 determines that the target pixel has been detected by the edge detection unit 310 as a pixel corresponding to an edge of a brightening change. When the number of consecutive pixels exceeds the predetermined threshold (step S143: Yes), the process proceeds to step S144, and when the number of consecutive pixels does not exceed the predetermined threshold (step S143: No), the process terminates the edge search determination process as it is determined that a second edge has not been detected, and proceeds to step S15.

[0121] As described above, in the image forming apparatus 100 according to this embodiment, the edge continuation counting unit 340 counts the number of consecutive occurrences of similar edge detection results obtained by the edge detection unit 310, and the edge search determination unit 320 determines that an edge of a darkening change has been detected by the edge detection unit 310 when the consecutive number counted by the edge continuation counting unit 340 corresponding to an edge of a darkening change exceeds a predetermined threshold, and determines that an edge of a brightening change has been detected by the edge detection unit 310 when the consecutive number counted by the edge continuation counting unit 340 corresponding to an edge of a brightening change exceeds a predetermined threshold. This makes it possible to accurately detect the document edge even when noise occurs outside the image area of ​​the document.

[0122] [Fourth embodiment] The image forming apparatus 100 according to the fourth embodiment will be described, focusing on the differences from the image forming apparatus 100 according to the first embodiment. In this embodiment, an operation will be described in which, when a pixel value is less than a predetermined threshold, the sub-scanning position corresponding to the pixel value is determined to be the document edge. Note that the overall configuration of the image forming apparatus 100 according to this embodiment, the configuration of the scanner 101, the configuration of the ADF 102, and the hardware configuration of the image processing unit 200 are the same as those of the first embodiment described above.

[0123] (Configuration and operation of functional blocks of image processing section) Fig. 19 is a diagram showing an example of the configuration of functional blocks of an image processing unit of an image forming apparatus according to a fourth embodiment. Fig. 20 is a diagram for explaining the operation of detecting the document edge of a white document when an image is printed near the document edge. The configuration and operation of the functional blocks of the image processing unit 200b of the image forming apparatus 100 according to this embodiment will be explained with reference to Figs. 19 and 20.

[0124] The image processing unit 200b shown in Fig. 19 receives image data read by the scanner 101 as input image data, and detects edges of a document included in the input image data as document edges. As shown in Fig. 19, the image processing unit 200b has a filter processing unit 300 (processing unit), a pixel value determination unit 350 (determination unit), an edge detection unit 310 (detection unit), an edge search determination unit 320 (setting unit), and a document edge determination unit 330 (determination unit). The functions of the filter processing unit 300, the edge detection unit 310, the edge search determination unit 320, and the document edge determination unit 330 are as described in the first embodiment.

[0125] Here, a case where a document shadow is unlikely to appear between a white document and the background and a black border is present on the white document will be described with reference to FIG.

[0126] 20(a), the image data includes a white original 401c which is an image portion of a white original, a background 400 which is an image portion of a background member 92, and an original shadow 402c which is an image portion of a shadow generated between the white original and the background member 92. In addition, it is assumed that the white original 401c includes an image portion of a black-painted border portion 422, for example, as shown in FIG.

[0127] FIG. 20(b) shows a graph of pixel values, and FIG. 20(c) shows a graph of differential amounts obtained by filtering the graph of pixel values ​​shown in FIG. 20(b) with a differential filter. In this case, in the graph of differential amounts shown in FIG. 20(c), a portion 560 corresponding to the edge of the boundary between the document shadow 402c and the white document 401c (bordering portion 422) is detected as an edge because it is equal to or less than the threshold value -a, whereas a portion corresponding to the boundary between the background 400 and the document shadow 402c is not equal to or less than the threshold value -a and cannot be detected as an edge. In this case, the portion 560 is detected as the first edge. Furthermore, a portion 561 corresponding to the boundary between the bordering portion 422 and the white portion of the white document 401c is equal to or more than the threshold value a, so that the portion 561 is detected as the second edge and is determined as the document edge, which is significantly different from the correct document edge. To avoid such a situation, the image processing unit 200b of the image forming apparatus 100 according to this embodiment determines the sub-scanning position of the document edge to be the sub-scanning position of a portion 570 where the pixel value is less than a predetermined threshold value b in the pixel value graph shown in Fig. 20(b). Details of the document edge detection operation by the image processing unit 200b will be described later with reference to Fig. 21.

[0128] The pixel value determination unit 350 is a functional unit that determines whether the pixel value of the target pixel is less than a predetermined threshold value b (an example of a fifth threshold value). Here, as the threshold value b, for example, the lower limit value of the pixel value that the document shadow can take may be set.

[0129] The above-mentioned filter processing unit 300, pixel value determination unit 350, edge detection unit 310, edge search determination unit 320, and document edge determination unit 330 are realized by executing a program by the CPU 201 shown in Fig. 5. Note that some or all of the filter processing unit 300, pixel value determination unit 350, edge detection unit 310, edge search determination unit 320, and document edge determination unit 330 may be realized by a hardware circuit (integrated circuit) such as an FPGA or ASIC, rather than a software program.

[0130] Note that the functions of each functional unit of the image processing unit 200b shown in Fig. 19 are conceptually shown, and the configuration is not limited to this. For example, the multiple functional units illustrated as independent functional units in the image processing unit 200b shown in Fig. 19 may be configured as one functional unit. On the other hand, the function of one functional unit in the image processing unit 200b shown in Fig. 19 may be divided into multiple functions and configured as multiple functional units.

[0131] (Flow of document edge detection process by image forming device) 21 is a flowchart showing an example of the flow of document edge detection processing by the image forming apparatus according to the fourth embodiment. The flow of document edge detection processing by the image forming apparatus 100 according to the present embodiment will be described with reference to FIG.

[0132] <Steps S11 and S12> The processes in steps S11 and S12 are similar to those in steps S11 and S12 shown in the above-described Fig. 12. After the process in step S12 is executed, the process proceeds to step S23.

[0133] <Step S23> The pixel value determination unit 350 of the image processing unit 200b determines whether the pixel value of the target pixel is less than a predetermined threshold b. If the pixel value of the target pixel is less than the threshold b (step S23: Yes), the process proceeds to step S24. If the pixel value of the target pixel is equal to or greater than the threshold b (step S23: No), the process proceeds to step S13.

[0134] <Step S24> The document edge determination unit 330 of the image processing unit 200b sets the target pixel as the second edge and determines the second edge as the final document edge. That is, the document edge determination unit 330 determines the sub-scanning position of the target pixel as the second edge as the position of the final document edge. This makes it possible to improve the detection accuracy of the document edge even when the document shadow is unlikely to appear between the white document and the background and a black border is present on the white document. Then, the document edge detection process ends.

[0135] <Steps S13 to S19> The processing in steps S13 to S19 is similar to that in steps S13 to S19 shown in the above-mentioned Fig. 12. After the processing in step S19 is executed, the process returns to step S23.

[0136] As described above, in the image forming apparatus 100 according to this embodiment, the pixel value determination unit 350 determines whether the pixel value of the target pixel is less than a predetermined threshold value, and the document edge determination unit 330 determines the position of the target pixel as the position of the document edge when the pixel value determination unit 350 determines that the pixel value of the target pixel is less than the predetermined threshold value. This makes it difficult for a document shadow to appear between the white document and the background, and makes it possible to accurately detect the document edge even when the white document has a black border.

[0137] In each of the above-mentioned embodiments, when at least one of the functional units of the image processing units 200, 200a, and 200b of the image forming apparatus 100 is realized by executing a program, the program is provided by being pre-installed in a ROM or the like. In each of the above-mentioned embodiments, the program executed by the image processing units 200, 200a, and 200b of the image forming apparatus 100 may be provided by being recorded in a computer-readable recording medium such as a CD-ROM (Compact Disc Read Only Memory), a flexible disk (FD), a CD-R (Compact Disk-Recordable), or a DVD (Digital Versatile Disc) in an installable or executable format file. In each of the above-mentioned embodiments, the program executed by the image processing units 200, 200a, and 200b of the image forming apparatus 100 may be provided by being stored on a computer connected to a network such as the Internet and downloaded via the network. In each of the above-mentioned embodiments, the program executed by the image processing units 200, 200a, and 200b of the image forming apparatus 100 may be provided or distributed via a network such as the Internet. In each of the above-mentioned embodiments, the program executed by the image processing units 200, 200a, and 200b of the image forming apparatus 100 has a modular structure including at least any one of the above-mentioned functional units, and in terms of actual hardware, the CPU 201 reads out the program from the above-mentioned storage device and executes it, whereby each of the above-mentioned functional units is loaded onto the main storage device and generated.

[0138] The aspects of the present invention are as follows. <1> a processing unit that calculates a value relating to a difference in pixel values ​​between adjacent pixels in a direction from a background portion to a document portion in image data of the document read by the reading device; a detection unit that searches for pixels in the direction and detects an edge as a boundary where a pixel value changes based on the value related to the difference obtained by the processing unit; a setting unit that sets the edge to a first edge when the detection unit first detects the edge of a darkening change, sets the edge to a second edge when the detection unit detects the edge of a brightening change before detecting the first edge, and sets the edge to the second edge when the detection unit detects the edge of a darkening change or a brightening change after detecting the first edge; a determination unit that determines the second edge set by the setting unit as a document edge of the document; The image processing device includes: <2> the processing unit performs a filter process on pixel values ​​of pixels in the direction using a differential filter to calculate a differential amount for the pixel values ​​as a value related to the difference. <1> The image processing device according to the present invention is <3> The detection unit is If the differential amount corresponding to the pixel value of the target pixel is equal to or less than a first threshold, the target pixel is detected as the edge of a darkening change; When the differential amount corresponding to the pixel value of the target pixel is equal to or greater than a second threshold value that is greater than the first threshold value, the target pixel is detected as the edge of a change that becomes brighter. <2> The image processing device according to the present invention is <4> The setting unit is After detecting the first edge, determining whether a distance between a position of the first edge and a position of the target pixel is less than a third threshold; If the distance is equal to or greater than the third threshold, the first edge is set to the second edge. <1> ~ <3> 1 is an image processing apparatus according to any one of claims 1 to 9. <5> The third threshold value is the maximum width that can occur as a document shadow of the document. <4> The image processing device according to the present invention is <6> A counting unit that counts the number of consecutive times that the detection unit obtains a similar edge detection result, The setting unit is When the number of consecutive occurrences corresponding to the edge of the darkening change counted by the counting unit exceeds a fourth threshold, it is determined that the edge of the darkening change has been detected by the detection unit; When the number of consecutive pixels corresponding to the edge of the brightening change counted by the counting unit exceeds the fourth threshold value, it is determined that the edge of the brightening change has been detected by the detection unit. <1> ~ <5> 1 is an image processing apparatus according to any one of claims 1 to 9. <7> a determination unit that determines whether or not a pixel value of the target pixel is less than a fifth threshold value, When the determining unit determines that the pixel value of the target pixel is less than the fifth threshold, the determining unit determines the position of the target pixel as the position of the document edge. <1> ~ <6> 1 is an image processing apparatus according to any one of claims 1 to 9. <8> the detection unit determines whether or not the edge detection process has been completed for pixels in a predetermined search range in the direction; the determining unit outputs a detection abnormality indicating that the document edge could not be detected when the detecting unit determines that the edge detection process has been completed for the pixels in the search range. <1> ~ <7> 1 is an image processing apparatus according to any one of claims 1 to 9. <9> The method of correcting a skew of the document based on the document edge determined by the determination unit. <1> ~ <8> 1 is an image processing apparatus according to any one of claims 1 to 9. <10> A processing step of calculating a value related to a difference in pixel values ​​between adjacent pixels in a direction from a background portion to a document portion in image data of the document read by the reading device; a detection step of searching pixels in the direction and detecting an edge as a boundary where pixel values ​​change based on a value related to the difference; a setting step of setting the edge as a first edge when the edge of a darkening change is detected first, setting the edge as a second edge when the edge of a brightening change is detected before the detection of the first edge, and setting the edge as the second edge when the edge of a darkening change or a brightening change is detected after the detection of the first edge; a determining step of determining the set second edge as a document edge of the document; The edge detection method has the following structure: [Explanation of symbols]

[0139] 7 Slit Glass 8 Contact Glass 11 Document Tray 12 Output tray 24 Light source 25 1st Carriage 25a First mirror member 26 2nd Carriage 26a Second mirror member 26b Third mirror member 27 Imaging Lens 28 Imaging unit 41 Movable manuscript table 42 Side guide plate 46 Set Filler 50 Conveyor 51 Separation feeding section 52 Pull-out section 52a Transport route 53 Turn section 53a Transport Route 54 First reading and conveying section 55 Second reading and conveying section 55a Transport Route 56 Paper output section 60 Paper feed slot 61 Pickup roller 62 Paper feed belt 63 Reverse Roller 64 Support arm member 65 Pullout roller 66 Intermediate Roller 67 Reading entrance roller 68 First reading roller 69 First reading exit roller 70 Second reading roller 71 Second reading exit roller 72 Paper ejection roller 81 Resist sensor 82 Original placement sensor 83 Paper ejection sensor 84 Stop sensor 85 Document width sensor 89 Document length detection sensor 90 Document length detection sensor 91 Second reading section 92 Background material 100 Image forming device 101 Scanner 101a Main frame 102 ADF 103 Paper feed section 104 Main unit 105 Imaging section 106 Developer 107 Transport Path 108 Registration roller 109 Optical writing device 110 Fixing unit 111 Double-sided tray 112 Photoconductor drum 113 Intermediate transfer belt 120 Plotter 200, 200a, 200b Image processing unit 201 CPU 202 ROM 205 Main Memory 206 Chipset 207 Image Processing ASIC 208 Controller ASIC 209 Main Memory 210 I / O ASIC 211 HDD 300 Filter processing section 310 Edge detection unit 320 Edge search and judgment unit 330 Document edge determination unit 340 Consecutive Edge Counting Unit 350 Pixel value determination unit 400 backgrounds 401, 401a~401c White manuscript 402, 402a~402c manuscript copy 411, 411a Black manuscript 412, 412a manuscript copy 421 Printing section 422 Border 500, 501 area 510, 511 part 520, 521 part 530, 531 part 540, 541 part 550, 551, 552 parts 560, 561 part 570 parts 600 Main scanning position 700 Noise [Prior art documents] [Patent documents]

[0140] [Patent Document 1] JP 2020-123940 A [Patent Document 2] JP 2014-072626 A

Claims

1. a processing unit that calculates a value relating to a difference in pixel values ​​between adjacent pixels in a direction from a background portion to a document portion in image data of the document read by the reading device; a detection unit that searches for pixels in the direction and detects an edge as a boundary where a pixel value changes based on the value related to the difference obtained by the processing unit; a setting unit that sets the edge to a first edge when the detection unit first detects the edge of a darkening change, sets the edge to a second edge when the detection unit detects the edge of a brightening change before detecting the first edge, and sets the edge to the second edge when the detection unit detects the edge of a darkening change or a brightening change after detecting the first edge; a determination unit that determines the second edge set by the setting unit as a document edge of the document; An image processing device comprising:

2. The image processing device according to claim 1 , wherein the processing unit calculates a differential amount for the pixel value as the value related to the difference by performing a filtering process on the pixel values ​​of the pixels in the direction using a differential filter.

3. The detection unit is If the differential amount corresponding to the pixel value of the target pixel is equal to or smaller than a first threshold, the target pixel is detected as the edge of a darkening change; The image processing apparatus according to claim 2 , wherein when the differential amount corresponding to the pixel value of the target pixel is equal to or greater than a second threshold value that is greater than the first threshold value, the target pixel is detected as the edge of a change that becomes brighter.

4. The setting unit is After detecting the first edge, it is determined whether or not a distance between a position of the first edge and a position of the target pixel is less than a third threshold value; 4. The image processing device according to claim 1, wherein the first edge is set to the second edge when the distance is equal to or greater than the third threshold.

5. The image processing apparatus according to claim 4 , wherein the third threshold value is a maximum width that can occur as a document shadow of the document.

6. A counting unit that counts the number of consecutive times that the detection unit obtains a similar edge detection result, The setting unit is When the number of consecutive occurrences corresponding to the edge of the darkening change counted by the counting unit exceeds a fourth threshold, it is determined that the edge of the darkening change has been detected by the detection unit; An image processing device according to any one of claims 1 to 3, wherein when the consecutive number corresponding to the edge of the brightening change counted by the counting unit exceeds the fourth threshold value, it is determined that the edge of the brightening change has been detected by the detection unit.

7. a determination unit that determines whether or not a pixel value of the target pixel is less than a fifth threshold value, 4. The image processing device according to claim 1, wherein the determination unit determines the position of the target pixel as the position of the document edge when the judgment unit judges that the pixel value of the target pixel is less than the fifth threshold.

8. the detection unit determines whether or not the edge detection process has been completed for pixels in a predetermined search range in the direction; An image processing device according to any one of claims 1 to 3, wherein the determination unit outputs a detection anomaly indicating that the document edge could not be detected when the detection unit determines that the edge detection process has been completed for the pixels in the search range.

9. 4. The image processing apparatus according to claim 1, further comprising: a step of correcting a skew of the document based on the document edge determined by the determination unit.

10. A processing step of calculating a value related to a difference in pixel values ​​between adjacent pixels in a direction from a background portion to a document portion in image data of the document read by the reading device; a detection step of searching pixels in the direction and detecting an edge as a boundary where pixel values ​​change based on a value related to the difference; a setting step of setting the edge as a first edge when the edge of a darkening change is detected first, setting the edge as a second edge when the edge of a brightening change is detected before the detection of the first edge, and setting the edge as the second edge when the edge of a darkening change or a brightening change is detected after the detection of the first edge; a determining step of determining the set second edge as a document edge of the document; The edge detection method has the following structure:

Citation Information

Patent Citations

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

    JP2014072626A

  • Inclination detection device, reading device, image processing apparatus, and inclination detection method

    JP2020123940A