Image processing apparatus, image forming apparatus, image processing method, and storage medium
The image processing apparatus uses edge analysis to enhance boundary detection accuracy by analyzing pixel changes and continuity, addressing the issue of varying shadow widths in image detection systems.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2026-03-06
AI Technical Summary
Existing image detection technologies struggle to accurately detect the boundary position between an object and its background when the width of the shadow changes due to factors like document thickness or illumination angle, leading to decreased detection accuracy.
An image processing apparatus that includes an edge amount calculation unit, edge determination unit, edge continuity determination unit, and boundary position detection unit to analyze pixel changes and continuity, allowing for precise boundary detection even when shadow width varies.
Accurately detects the boundary position between an object and its background, preventing erroneous detection and maintaining high accuracy despite changes in shadow width.
Smart Images

Figure 2026037723000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to an image processing apparatus, an image forming apparatus, an image processing method, and a program. [Background technology]
[0002] Conventionally, in image forming devices having a copy function, etc., an electronic skew correction technique has been known in which an original document skew and a misalignment between the main and sub registrations are corrected by image processing based on the skew angle detected from an image read by an automatic document feeder and a scanner. In the electronic skew correction technique, it is necessary to accurately detect the position of the boundary between the background material and the original document from the read image.
[0003] Patent document 1 discloses a configuration in which it is determined whether the luminance difference between pixels that are a first distance away from a pixel of interest exceeds a first threshold, and it is further determined whether the luminance difference between the maximum luminance value and the minimum luminance value within a range of a second distance that is greater than the first distance is smaller than a second threshold, and if both conditions are met, the pixel of interest is determined to be the position of the boundary between the background material and the document. Summary of the Invention [Problem to be solved by the invention]
[0004] However, the technology disclosed in Patent Document 1 had a problem in that when the width of the shadow of the object to be detected changes depending on the thickness of the document, which is the object to be detected, the angle of illumination, etc., the detection accuracy of the boundary position (boundary position) between the object to be detected and the background material decreases.
[0005] The present invention has been made in view of the above, and an object of the present invention is to detect the boundary position with high accuracy even when the width of the shadow of the detection object changes. [Means for solving the problem]
[0006] In order to solve the above-mentioned problems and achieve the object, the present invention provides an image processing apparatus that includes image data of a detection object and a background component, and that includes an edge amount calculation unit that calculates an edge amount indicating a change in pixel value between a target pixel selected sequentially from a plurality of pixels constituting the image data or a plurality of pixels surrounding the target pixel, in an area between the detection object and the background component; an edge determination unit that determines whether the target pixel is an edge based on the edge amount calculated by the edge amount calculation unit; an edge continuity determination unit that, when the edge determination unit determines that the target pixel is an edge, determines whether the edges of the target pixel are continuous; an edge continuity calculation unit that calculates an edge continuity number, which is the number of consecutive target pixels determined by the edge continuity determination unit to have continuous edges; and a boundary position detection unit that, when the edge determination unit determines that the target pixel is not an edge, detects the position of the boundary between the detection object and the background component using the edge amount of the edges continuing up to the target pixel selected before the target pixel, if the edge determination unit determines that the target pixel is not an edge and the calculated edge continuity number up to the target pixel selected before the target pixel is greater than a predetermined number. [Effects of the Invention]
[0007] According to the present invention, it is possible to accurately detect the boundary position even when the width of the shadow of the detection object changes. [Brief explanation of the drawings]
[0008] [Figure 1] FIG. 1 is a cross-sectional view schematically showing the general configuration of an image forming apparatus according to a first embodiment. [Figure 2] FIG. 2 is a cross-sectional view that schematically shows the overall configuration of the scanner. [Figure 3] FIG. 3 is a cross-sectional view that schematically shows the general configuration of the ADF. [Figure 4] FIG. 4 is a diagram showing a schematic configuration in the vicinity of the document reading position. [Figure 5] FIG. 5 is a block diagram showing the hardware configuration of the image forming apparatus. [Figure 6]FIG. 6 is a block diagram showing the functions of the image processing unit according to the first embodiment. [Figure 7] FIG. 7 is a diagram showing an example of image data. [Figure 8] FIG. 8 is a diagram showing an example of the detected boundary position. [Figure 9] FIG. 9 is a diagram showing the relationship between pixel values, edge amounts, and boundary positions of image data. [Figure 10] FIG. 10 is a diagram illustrating an example of weighting coefficients of a differential filter. [Figure 11] FIG. 11 is a flowchart schematically showing the flow of the boundary detection process according to the first embodiment. [Figure 12] FIG. 12 is a flowchart schematically showing the flow of the edge analysis process according to the first embodiment. [Figure 13] FIG. 13 illustrates an example of the boundary detection process according to the first embodiment. [Figure 14] FIG. 14 is a diagram illustrating another example of the boundary detection process according to the first embodiment. [Figure 15] FIG. 15 is a block diagram illustrating functions of an image processing unit according to the second embodiment. [Figure 16] FIG. 16 is a flowchart schematically showing the flow of edge analysis processing according to the second embodiment. [Figure 17] FIG. 17 is a block diagram showing the functions of the edge continuity determining unit according to the third embodiment. [Figure 18] FIG. 18 is a flowchart schematically showing the flow of edge analysis processing according to the third embodiment. [Figure 19] FIG. 19 illustrates an example of the boundary detection process according to the third embodiment. [Figure 20] FIG. 20 is a block diagram showing the functions of the edge continuity determining unit according to the fourth embodiment. [Figure 21] FIG. 21 is a flowchart schematically showing the flow of edge analysis processing according to the fourth embodiment. [Figure 22]FIG. 22 is a diagram illustrating an example of the boundary detection process according to the fourth embodiment. [Figure 23] FIG. 23 is a diagram illustrating an example of the configuration of an inspection device according to the fifth embodiment. [Figure 24] FIG. 24 is a diagram showing an outline of the inspection process in the inspection device. DETAILED DESCRIPTION OF THE INVENTION
[0009] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, embodiments of an image processing apparatus, an image forming apparatus, an image processing method, and a program will be described in detail with reference to the accompanying drawings.
[0010] (First embodiment) 1 is a cross-sectional view schematically illustrating the configuration of an image forming apparatus 100 according to a first embodiment. The image forming apparatus 100 is a multifunction peripheral having at least two of a copy function, a printer function, a scanner function, and a facsimile function.
[0011] As shown in FIG. 1, an image forming apparatus 100 includes a paper feed unit 103, an apparatus main body 104, a scanner 101, and an automatic document feeder (ADF) .
[0012] The image forming apparatus 100 includes a plotter 140, which is an image forming unit, inside the apparatus main body 104. The plotter 140 includes a tandem imaging unit 105, registration rollers 108 that supply recording paper from the 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.
[0013] The image forming unit 105 has four photosensitive drums 112 arranged side by side corresponding to four colors: Y (yellow), M (magenta), C (cyan), and K (key plate (black)). Around each photosensitive drum 112, image forming elements including a charger, a developing device 106, a transfer device, a cleaner, and a static eliminator are arranged.
[0014] 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 driving roller and a driven roller.
[0015] In the tandem image forming apparatus 100 configured as described above, an optical writing device 109 optically writes onto photosensitive drums 112 corresponding to each of the Y, M, C, and K colors based on an original image read by scanner 101 from an original document, which is an object to be detected and sent from ADF 102, and the optical writing device 109 develops each color with toner in developing device 106, and primarily transfers the image onto intermediate transfer belt 113 in the order of Y, M, C, and K, for example. Then, the image forming apparatus 100 secondarily transfers the full-color image, in which the four colors are superimposed by the primary transfer, 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.
[0016] Next, the scanner 101 will be described.
[0017] Fig. 2 is a cross-sectional view showing a schematic configuration of scanner 101. As shown in Fig. 2, scanner 101 includes first carriage 25, second carriage 26, imaging lens 27, and imaging unit 28, and each of these components is an image reading device disposed inside main body frame 101a of scanner 101.
[0018] Furthermore, first and second rails (not shown) are provided inside the main frame 101a of the scanner 101 so as to extend in the sub-scanning direction (left and right direction in FIG. 2). The first rail consists of two rails arranged at a predetermined interval in the main scanning direction (direction perpendicular to the paper surface of FIG. 2) which is orthogonal to the sub-scanning direction. The second rail has the same configuration as the first rail.
[0019] The first carriage 25 is slidably mounted on the first rail and configured to be reciprocable 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 first carriage drive wire (not shown). The first carriage 25 is provided with a light source 24 and a first mirror member 25a.
[0020] The second carriage 26 is slidably mounted on the second rail and is configured to be movable back and forth in the sub-scanning direction between the positions indicated by the solid lines and the broken lines in Fig. 2 by a drive motor (not shown) via a second carriage drive wire (not shown). The second carriage 26 is provided with a second mirror member 26a and a third mirror member 26b.
[0021] 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 movement speed, even if the first carriage 25 and the second carriage 26 move, the optical path length of the light from the surface of the document placed on the contact glass 8 to the imaging lens 27 does not change.
[0022] The imaging lens 27 focuses the reflected light from the original that has entered through each mirror member onto the imaging unit 28. The imaging unit 28 is made up of an imaging element such as a CCD (Charge Coupled Device), and photoelectrically converts the reflected light image of the original that has been imaged through the imaging lens 27, and outputs an analog image signal that is the read image.
[0023] Next, the ADF 102 mounted on the top of the scanner 101 will be described.
[0024] Fig. 3 is a cross-sectional view showing a schematic configuration of the ADF 102. As shown in Fig. 3, the ADF 102 includes a document tray 11 on which documents are placed. The document tray 11 includes a movable document table 41 that rotates in directions a and b in the figure, with its base end serving as a fulcrum, and a pair of side guide plates 42 that position the documents in the left-right direction relative to the document feed direction. By rotating the movable document table 41, the front end of the document in the feed direction can be adjusted to an appropriate height.
[0025] Furthermore, document length detection sensors 89 and 90 that detect whether the document is oriented vertically or horizontally are provided spaced apart in the feeding direction on document tray 11. Note that the document length detection sensors 89 and 90 may be reflective sensors that perform non-contact detection using optical means, or contact-type actuator sensors.
[0026] 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.
[0027] 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. In addition, 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 locus of the tip of the set filler 46. In other words, the document set sensor 82 detects whether a document has been set in the ADF 102 based on whether the set filler 46 has rotated and come off the document set sensor 82.
[0028] The ADF 102 includes a conveying section 50 that includes a separation 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.
[0029] The separation and feeding section 51 has a pickup roller 61 arranged near a paper feed port 60 through which the document is fed, and a paper feed belt 62 and a reverse roller 63 arranged opposite each other across the transport path.
[0030] Pickup roller 61 is supported by 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 separate position away from the document stack via a cam mechanism (not shown). At the contact position, pickup roller 61 picks up several documents (ideally one document) from the documents stacked on document tray 11.
[0031] The paper feed belt 62 rotates in the feeding direction, and 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.
[0032] The pull-out unit 52 has a pair of pull-out rollers 65 arranged on either side of the conveying path 52a. The pull-out unit 52 performs primary abutment alignment (so-called skew correction) of the sent-out document by the drive timing of the pull-out roller 65 and the pickup roller 61, and then pulls out and conveys the aligned document.
[0033] 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 that curves 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 with the surface of the document facing downward by the reading entrance roller 67 to the vicinity of the slit glass 7, which is the document reading position (image capture position).
[0034] 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.
[0035] The first reading transport unit 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 unit 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 using 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 their home positions. The first reading transport unit 54 further transports the document after reading using the first reading exit roller 69.
[0036] 4 is a diagram showing a schematic configuration of the vicinity of the document reading position, in which the document is transported from left to right.
[0037] As shown in Fig. 4, the ADF 102 is provided with a background member 92, which 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 document 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.
[0038] 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 opposite the second reading section 91 across the conveying path 55a, and a second reading exit roller 71 arranged downstream in the conveying direction of the second reading section 91.
[0039] 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 its back side has been read is transported toward the paper discharge outlet by the second reading exit rollers 71. The second reading rollers 70 prevent 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 directly through the second reading section 91.
[0040] 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.
[0041] The ADF 102 is also 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 to control the transport distance, transport speed, and the like of the document.
[0042] Furthermore, a document width sensor 85 is provided between the pull-out roller 65 and the intermediate roller 66. The length of the document in the transport direction is detected from the motor pulses by reading the leading and trailing edges of the document with abutment sensor 84 and registration sensor 81.
[0043] Next, the hardware configuration of the image forming apparatus 100 will be described.
[0044] 5 is a block diagram showing the hardware configuration of the image forming apparatus 100. As shown in FIG. 5, the image forming apparatus 100 includes a scanner 101, an image processing device 120, and a plotter 140.
[0045] The scanner 101 has a function of reading images to be copied or output to an external interface. The image processing device 120 performs predetermined processing on the image read by the scanner 101, generates digital image data (hereinafter referred to as image data), and outputs the generated data to the plotter 140. The plotter 140 has a function of printing the image data that has been image-processed by the image processing device 120. The image processing device 120 also has an image processing unit 200 and an HDD (Hard Disk Drive) 211.
[0046] The image processing unit 200 includes a CPU (Central Processing Unit) 201, a ROM (Read Only Memory) 202, a main memory 205, a chipset 206, an image processing ASIC 207, a controller ASIC 208, a main memory 209, and an I / O ASIC 210. Note that ASIC is an abbreviation for Application Specific Integrated Circuit.
[0047] The CPU 201 controls the image forming apparatus 100. The main memory 205 is used as a work area in which the programs used by the CPU 201 to control the image forming apparatus 100 are loaded. The main memory 205 is also an image memory that temporarily stores image data to be handled. The chipset 206 is used together with the CPU 201 and controls access to the main memory 205 by the controller ASIC 208 and the I / O ASIC 210.
[0048] The image processing ASIC 207 performs image processing on the image read by the scanner 101 and outputs the image data to the controller ASIC 208. The image processing ASIC 207 also processes the image data from the controller ASIC 208 so that it can be printed by the plotter 140, and sends the image data in accordance with the printing timing of the plotter 140.
[0049] The controller ASIC 208 rotates and edits image data handled by the image forming apparatus 100 using the main memory 205 via the chipset 206, stores the data in the HDD 211, and transmits and receives the image data to and from the image processing ASIC 207. The main memory 209 is used as an image memory for image processing by the controller ASIC 208. The HDD 211 is used to temporarily store the image data that has undergone image processing.
[0050] 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 is equipped with interfaces such as a network interface, a Universal Serial Bus (USB), a Secure Digital (SD) card, an operation unit, a Serial Peripheral Interface (SPI), an Inter Integrated Circuit (I2C), and a document width sensor 85, as well as a hardware accelerator for accelerating image processing, an encryption processing circuit, and the like.
[0051] Next, the functions performed by the image processing unit 200 will be described.
[0052] 6 is a block diagram showing the functions of the image processing unit 200 according to this embodiment. Here, among the functions performed by the image processing unit 200, the characteristic functions of this embodiment will be described.
[0053] 6, the image processing unit 200 has an edge amount calculation unit 310, an edge determination unit 320, an edge continuity determination unit 330, an edge continuity calculation unit 340, and a boundary position detection unit 350. In this embodiment, for example, the controller ASIC 208 has these functional units. However, this is not a limitation, and these functional units may be realized by the CPU 201 executing a program.
[0054] The image processing unit 200 receives image data read by the scanner 101 and generated by the image processing ASIC 207 .
[0055] FIG. 7 is a diagram showing an example of image data. As shown in FIG. 7, image data P includes a background region 400 representing background member 92, a document region 401 representing the object to be detected (document), and a shadow region 402. Document region 401 may be tilted with respect to the XY coordinates in FIG. 7 due to tilt of the document caused when the user places the document on document tray 11 or due to the way the document is caught on pickup roller 61 or each transport roller. Here, the X direction is the main scanning direction of reading by scanner 101, and the Y direction is the sub-scanning direction of reading by scanner 101. Image data P is read so that background regions 400 are included on the top, bottom, left, and right of the document so that the entire document region 401 can be read even if the document is tilted.
[0056] The shadow region 402 is the region between the detection target and the background member 92. It is a shadow region that occurs between the background region 400 and the document region 401 when the document blocks the light from the light source 24. The shadow region 402 occurs at the top, bottom, left, and right boundaries of the document region 401. The enlarged view on the right side of FIG. 7 shows the periphery of the shadow region 402 above the document region 401. The shadow region 402 includes a region 410 in which the shadow gradually darkens from the background region 400 and a region 411 in which the shadow lightens near the document boundary. In this embodiment, the position in region 411 where the edge amount (described later) is maximum is detected as the boundary position (boundary position) between the document, which is the detection target, and the background member 92. The image processing device 120 can calculate information such as the document tilt, origin, and size using the detected boundary position. Furthermore, the image processing device 120 can output image data including the document region 401 that is not tilted with respect to the X and Y axes to the plotter 140 by performing skew correction processing using this information.
[0057] FIG. 8 is a diagram showing an example of detected boundary positions. The process of detecting boundary positions (boundary detection process) is performed in both the X and Y directions. However, performing the boundary detection process on all pixels of the image data P poses problems such as an enormous processing load and the detection of noise due to minute changes in pixel values. For this reason, the image processing device 120 performs the boundary detection process by sequentially selecting target pixels (pixels to be detected for processes such as edge amount calculation and edge amount determination) in the X and Y directions for each line 420 spaced at regular intervals, as shown by the dotted lines in FIG. 8 . Black dots in FIG. 8 indicate boundary positions 430 detected by the boundary detection process for each line 420. In this way, one or two boundary positions 430 are detected by the boundary detection process for each line 420. The image processing device 120 includes a tilt detection unit (not shown), which detects the tilt of the object by calculating an approximate straight line from the multiple boundary positions detected by the boundary detection process using, for example, a least squares method or a Hough transform. That is, the tilt detection unit can obtain the straight lines corresponding to the four sides of the document, which is the detection object, and the tilt of the straight lines. The image processing device 120 also includes a correction unit (not shown), which performs skew correction processing to correct the tilt of the detection object included in the image data P using the tilt detected by the tilt detection unit.
[0058] Next, the boundary detection process of this embodiment, which is performed by each functional unit in FIG. 6, will be described with reference to FIGS. 9 to 12. FIG. 9 is a diagram showing the relationship between pixel values, edge amounts, and boundary positions 430 of image data P. The edge amount is an amount that represents the change in pixel value of a target pixel, and is determined, for example, from the amount of change in pixel value in the X and Y directions of surrounding pixels adjacent to the target pixel. FIG. 9(a) is an enlarged view of the periphery of a shadow region 402 of image data P. As shown in FIG. 9(a), boundary detection process is performed on a line 420 in the Y direction, and a boundary position 430 is detected.
[0059] FIG. 9(b) is a diagram showing pixel values (gradation values) at each position in the Y direction on the line 420. The pixel value is lightness or luminance, and is large for bright pixels and small for dark pixels. As the pixel value moves from the background region 400 to the shadow region 402 along the Y direction, it decreases from 210 [digits] to 20 [digits]. Next, as the pixel value moves from the shadow region 402 to the document region 401, it increases to 230 [digits].
[0060] 9(c) is a diagram showing the edge amount at each position in the Y direction on the line 420. The edge amount calculation unit 310 calculates the edge amount indicating a change (increase or decrease) in pixel value in a shadow region 402, which is a region between the detection object (document) and the background member 92 of the image data P including the detection object and the background member 92 captured by the imaging unit 28 of the scanner 101. The edge amount indicates a change in pixel value between a plurality of pixels, including the target pixel and its surrounding pixels (surrounding pixels), and can be calculated using, for example, a differential filter.
[0061] FIG. 10 is a diagram illustrating an example of weighting coefficients of a differential filter. The edge amount calculation unit 310 can calculate, as an edge amount, a differential amount obtained by multiplying pixel values in a 5×5 pixel area centered on the pixel for which the edge amount is to be calculated by a 5×5 weighting coefficient as shown in FIG. 10. Here, the weighting coefficient in FIG. 10(a) is used when calculating an edge amount indicating a pixel change in the X direction, and the weighting coefficient in FIG. 10(b) is used when calculating an edge amount indicating a pixel change in the Y direction. Furthermore, the weighting coefficient in FIG. 10(c) is used when calculating an edge amount indicating a pixel change in the −X direction, and the weighting coefficient in FIG. 10(d) is used when calculating an edge amount indicating a pixel change in the −Y direction. When the differential filter in FIG. 10 is used, the weighting coefficient corresponding to the target pixel is 0, so the edge amount of the target pixel is calculated as a value indicating a change in pixel values among multiple surrounding pixels.
[0062] For example, the edge amount calculation unit 310 can calculate an edge amount indicating a pixel change in the Y direction, as shown in FIG. 9(c), for the pixel values shown in FIG. 9(a) using the weighting coefficients shown in FIG. 10(b). Hereinafter, unless otherwise specified, the edge amount indicates a pixel change in the X or Y direction. Note that the size of the differential filter is not limited to 5×5. For example, it may be 3×3 or 7×5. Furthermore, the weighting coefficient may be a value other than 1, 0, or −1, or a non-integer value. Furthermore, the edge amount may be something other than a differential amount. For example, the difference in pixel value between the target pixel and a surrounding pixel may be calculated as the edge amount. In this case, it is desirable to perform a smoothing process on the pixel values in advance to prevent the edge amount from being affected by noise.
[0063] The edge determination unit 320 determines whether a target pixel is an edge based on the edge amount calculated by the edge amount calculation unit 310. In this embodiment, a target pixel is called an "edge" if its edge amount is sufficiently large. The edge determination unit 320 can determine that a target pixel is an edge if the edge amount of the target pixel is greater than a predetermined threshold e. The threshold e may be set in advance at a production factory or the like through experiments, for example. This value may be set to a single value or may be set to a different value for each type of document. It may also be dynamically changed depending on the usage status of the scanner 101, etc. As shown in FIG. 9(c), the edge determination unit 320 determines that a target pixel included in a region 410 where the edge amount is less than -e and a region 411 where the edge amount is greater than e is an edge. Here, region 410 is an edge region where pixel values change to darker and the edge amount is negative, and region 411 is an edge region where pixel values change to brighter and the edge amount is positive.
[0064] When the edge determination unit 320 determines that the target pixel is an edge, the edge continuity determination unit 330 determines whether the edge of the target pixel is continuous. For example, when the sign indicating the positive or negative edge amount of the target pixel is the same as the sign of the edge amount of the adjacent pixel (the sign of the edge amount does not change), the edge continuity determination unit 330 determines that the edge of the target pixel is continuous. When boundary detection processing is performed on each pixel of the line 420 in order in the X direction, the adjacent pixel is the pixel adjacent to the left of the target pixel. When boundary detection processing is performed on each pixel of the line 420 in order in the Y direction, the adjacent pixel is the pixel adjacent above the target pixel. Note that if the sign of the edge amount is positive, the pixel value increases, and if it is negative, the pixel value decreases. Therefore, in the above example, the edge continuity determination unit 330 determines whether the edge is continuous based on whether the direction of increase or decrease of the pixel value of the target pixel is the same as the direction of increase or decrease of the pixel value of the adjacent pixel.
[0065] The edge continuity calculation unit 340 calculates the edge continuity, which is the number of consecutive pixels determined by the edge continuity determination unit 330 to have consecutive edges.
[0066] If the target pixel is not an edge, the boundary position detection unit 350 detects, as the boundary position, the pixel position with the largest edge amount among the edges continuing to the pixel preceding the target pixel, if the number of consecutive edges continuing to the target pixel selected before the target pixel is greater than a predetermined number N. The boundary position detection unit 350 similarly detects the boundary position even when it is determined that the edges of the target pixel are not consecutive.
[0067] In the example of Fig. 9(c), the position where the edge amount in region 411 is maximum (the position corresponding to boundary position 430 in Fig. 9(a)) is detected as the position where the edge amount is maximum among the continuous edges. In Fig. 9, edges are also continuous in region 410, but in this embodiment, the boundary position is detected in region 411 where the pixel value changes to become brighter, and therefore the boundary position is not detected in region 410 where the pixel value changes to become darker.
[0068] The number N is a natural number that is set in advance at a production factory or the like through experiments, for example. By setting the number N to an appropriate value, it is possible to prevent erroneous detection of the boundary position from an area where pixel values change due to the influence of dust, scratches, etc. The value of N may be set to only one, or different values may be set for each type of document. Furthermore, the value may be dynamically changed depending on the usage status of the scanner 101, etc.
[0069] In this way, the boundary position detection unit 350 extracts a section (edge continuous section) in which edge pixels continue for more than a predetermined number N, and detects the boundary position using the edge amount in the edge continuous section. In the above example, the pixel position with the largest edge amount in the edge continuous section was determined as the boundary position, but this is not limited to this. For example, the positions of the pixel with the largest edge amount and the pixel with the second largest edge amount in the edge continuous section may be obtained, and the weighted average of these positions may be determined as the boundary position. In this case, for example, the largest edge amount and the second largest edge amount may be used as weights.
[0070] Furthermore, the boundary position detection unit 350 may omit the process of detecting the boundary position when it is determined that the edge of the target pixel is not continuous. For example, if the target pixel is an edge, there is a high probability that the edge is continuous, so it is possible to omit the process of detecting the boundary position when it is determined that the edge of the target pixel is not continuous.
[0071] FIG. 11 is a flowchart outlining the flow of boundary detection processing according to this embodiment. The image processing unit 200 sets a target pixel (step S10) and performs edge analysis processing shown in FIG. 12 for the target pixel (step S11). The edge analysis processing analyzes the edge amount of the target pixel, as described below, updates the number of consecutive edges, and detects the boundary position. Note that when boundary detection processing is performed in the X direction for each pixel of a line 420 shown horizontally in FIG. 8, the target pixel is set to the leftmost pixel of the line 420 in step S10. Also, when boundary detection processing is performed in the Y direction for each pixel of a line 420 shown vertically in FIG. 8, the target pixel is set to the topmost pixel of the line 420 in step S10.
[0072] Next, if the boundary position has been detected by the edge analysis process (step S12: Yes), the boundary detection process ends. On the other hand, if the boundary position has not been detected by the edge analysis process (step S12: No), the image processing unit 200 changes the target pixel (step S13) and performs edge analysis process on the changed target pixel (step S11). Note that when boundary detection process is performed in the X direction for each pixel of the line 420 shown horizontally in FIG. 8, the target pixel is changed to the pixel adjacent to the right in step S13. Note that when boundary detection process is performed in the Y direction for each pixel of the line 420 shown vertically in FIG. 8, the target pixel is changed to the pixel adjacent below in step S13.
[0073] 12 is a flowchart showing the outline of the flow of edge analysis processing according to this embodiment. First, the edge amount calculation unit 310 calculates the edge amount of a target pixel (step S101). Note that the edge amount may be calculated for each target pixel, or the edge amount of each pixel in the line 420 may be calculated in advance and stored in the main memory 205, main memory 209, HDD 211, etc., and read out when the target pixel is subjected to edge analysis processing.
[0074] Next, the edge determination unit 320 determines whether the target pixel is an edge. If it is an edge (step S102: Yes), the process proceeds to step S103. If it is not an edge (step S102: No), the process proceeds to step S105.
[0075] In step S103, the edge continuity determination unit 330 determines whether the edges of the target pixel are continuous, and if the edges are continuous (step S103: Yes), the edge continuity calculation unit 340 adds 1 to the edge continuity count (step S104). On the other hand, if the edges are not continuous (step S103: No), the process proceeds to step S105. In this way, if the edges are continuous, the edge continuity count is updated (1 is added to the edge continuity count). It is assumed that the edge continuity count is reset to zero at the start of the boundary detection process.
[0076] In step S105, if the number of consecutive edges is greater than the number N (step S105: Yes), the boundary position detection unit 350 detects the position of the pixel with the largest edge amount among the consecutive edges as the boundary position (step S106).On the other hand, if the number of consecutive edges is not greater than N (step S105: No), the process proceeds to step S107.
[0077] In step S107, the edge continuation number calculation unit 340 resets the edge continuation number to zero.
[0078] The above description describes the process of detecting the boundary of the left side of the document by shifting the target pixel in the X direction from the left end of line 420, or the process of detecting the boundary of the top side of the document by shifting the target pixel in the Y direction from the top end of line 420. Because the pixel value changes in the right and bottom sides of the document in the opposite direction to the left and top sides, similar detection can be performed using a differential filter such as that shown in FIG. 10(c) for the boundary detection process of the right side of the document, and a differential filter such as that shown in FIG. 10(d) for the boundary detection process of the bottom side of the document. In this case, the boundary position is detected in the area where the pixel value changes to a darker shade. It is also possible to use the differential filters shown in FIG. 10(a) and FIG. 10(b) for the right and left sides, respectively. In this case, the boundary position detection unit 350 can be configured to detect the pixel position with the smallest edge amount among the consecutive edges as the boundary position when the number of consecutive edges is greater than a predetermined number N.
[0079] Next, the effect of the above-described boundary detection process will be described with reference to FIGS.
[0080] FIG. 13 illustrates an example of boundary detection processing according to this embodiment. Image data P in FIG. 13(a) is the same as image data P in FIG. 9(a). In the prior art disclosed in Patent Document 1, a determination is made as to whether the difference in pixel values between pixels p1 and p2, which are a first distance away from a pixel of interest p0 shown in FIG. 13(b), exceeds a first threshold. In this example, the difference in pixel values between pixels p1 and p2 exceeds the first threshold, so pixel of interest p0 is a candidate for the boundary position between the document and the background material. In this embodiment, the edge continuity determination unit 330 determines that the pixels in region 411 shown in FIG. 13(c) have continuous edges, and the boundary position detection unit 350 detects the position in region 411 where the edge amount is maximum as boundary position 430.
[0081] 14 is a diagram showing another example of the boundary detection process according to this embodiment. The image data P in FIG. 14(a) has a wider shadow region 402 than the image data P in FIG. 9(a). For example, the width of the shadow region 402 in the image data may be wider due to factors such as an increase in the thickness of the document, a shallower illumination angle, or a greater than normal distance between the document and the background member 92. The width of the shadow region 402 may also be wider due to deterioration of the MTF (Modulation Transfer Function) of the lens included in the light source 24 or the use of a lens with a low MTF due to variations in lens performance (individual differences).
[0082] In the prior art, it is determined whether the difference in pixel values between pixels p1 and p2, which are a first distance away from a pixel of interest p0 shown in FIG. 14(b), exceeds a first threshold. In this example, the difference in pixel values between pixels p1 and p2 is smaller than the first threshold, so the pixel of interest p0 is not a candidate for the boundary position, and the desired boundary position cannot be detected. In contrast, in this embodiment, the edge continuity determination unit 330 determines that the pixels in region 411 shown in FIG. 14(c) have continuous edges, and the boundary position detection unit 350 detects the position in region 411 where the edge amount is maximum as the boundary position 430.
[0083] As described above, in the conventional technology, there are cases where a candidate boundary position cannot be detected when the width of the shadow region 402 changes. On the other hand, according to this embodiment, the boundary position can be detected with high accuracy even when the width of the shadow region 402 changes.
[0084] As described above, according to this embodiment, an edge amount indicating a change in pixel value of image data is calculated, and if it is determined based on the calculated edge amount that the target pixel is not an edge or that the edge of the target pixel is not continuous, the pixel position with the largest edge amount among the edges that are continuous up to the pixel preceding the target pixel is detected as the boundary position if the number of continuous edges is greater than a predetermined number N. This prevents erroneous detection of the boundary position due to dust, scratches, etc., and enables accurate detection of the boundary position even when the width of the shadow of the detection target object changes.
[0085] (Second embodiment) Next, a second embodiment will be described.
[0086] In this embodiment, when an edge is determined to be continuous, a position (candidate position) that is a candidate for a boundary position is updated. In the following description of the second embodiment, the description of the same parts as in the first embodiment will be omitted, and only the parts that are different from the first embodiment will be described.
[0087] FIG. 15 is a block diagram showing the functions of the image processing unit 200 according to this embodiment. Here, we will explain the characteristic functions of this embodiment among the functions performed by the image processing unit 200. The difference from the first embodiment is that the image processing unit 200 further includes a candidate storage unit 360. In this embodiment, for example, the controller ASIC 208 has each functional unit of the image processing unit 200. However, this is not a limitation, and these functional units may be realized by the CPU 201 executing a program.
[0088] The candidate storage unit 360 stores a candidate edge amount, which is the edge amount of the pixel with the largest edge amount among the consecutive edges, and a candidate position, which is the position of the pixel. More specifically, if the target pixel is a consecutive edge and the edge amount is greater than the candidate edge amount, the candidate storage unit 360 stores the edge amount as a new candidate edge amount. The candidate storage unit 360 also stores the position of the target pixel as a candidate position. The candidate edge amount and candidate position are stored in the main memory 205, the main memory 209, the HDD 211, etc. The initial value of the candidate edge amount is, for example, zero, and the initial value of the candidate position is, for example, the target pixel position at the start of the boundary detection process.
[0089] If the boundary position detection unit 350 determines that the target pixel is not an edge, or that the edge of the target pixel is not continuous, and the number of consecutive edges is greater than a predetermined number N, the boundary position detection unit 350 detects the candidate position stored in the candidate storage unit 360 as the boundary position. As a result, similar to the first embodiment, it is possible to detect the pixel position with the largest edge amount among the edges continuing up to the pixel preceding the target pixel as the boundary position. Note that in this embodiment, the candidate storage unit 360 updates the candidate edge amount and candidate position when the edge amount of the target pixel is greater than the candidate edge amount. Therefore, these values are not updated in the region 410 in FIG. 9C, and pixel positions included in the region 410 are not candidates for the boundary position.
[0090] 16 is a flowchart showing the outline of the flow of edge analysis processing according to the present embodiment. The difference from the first embodiment is that in steps S205 to S207, the stored candidate edge amounts and candidate positions are updated, and in step S209, the most recent candidate position stored is detected as the boundary position. Note that the operations in steps S201 to S204, S208, and S210 are the same as the operations in steps S101 to S104, S105, and S107 in FIG. 12.
[0091] In step S205, the candidate storage unit 360 compares the edge amount of the target pixel with the candidate edge amount. If the edge amount of the target pixel is greater than the candidate edge amount (step S205: Yes), the candidate storage unit 360 stores the edge amount of the target pixel as a new candidate edge amount (step S206) and stores the position of the target pixel as a new candidate position (step S207). On the other hand, if the edge amount of the target pixel is not greater than the candidate edge amount (step S205: No), the candidate edge amount and candidate position are not updated, and the edge analysis process ends.
[0092] In step S209, the boundary position detection unit 350 detects the most recent stored candidate position as the boundary position (step S209).
[0093] As described above, according to this embodiment, when it is determined that the edges are continuous, the candidate positions are updated, and when it is determined that the target pixel is not an edge or that the edges of the target pixel are not continuous, the latest candidate position is detected as the boundary position if the number of continuous edges is greater than a predetermined number N. This prevents erroneous detection of the boundary position due to dust, scratches, etc., and enables accurate detection of the boundary position even when the width of the shadow of the document changes.
[0094] (Third embodiment) Next, a third embodiment will be described.
[0095] In this embodiment, whether an edge is continuous or not is determined by comparing the magnitude of the edge amount with the magnitude of the candidate edge amount along with the change in the sign of the edge amount. In the following description of the third embodiment, the same parts as in the second embodiment will be omitted, and only the parts that differ from the second embodiment will be described.
[0096] 17 is a block diagram showing the functions of the edge continuity determining unit 330 according to this embodiment. Here, among the functions performed by the edge continuity determining unit 330, the characteristic functions of this embodiment will be described.
[0097] 17, the edge continuity determination unit 330 has a sign determination unit 331 and an edge amount comparison unit 332. In this embodiment, for example, the controller ASIC 208 has each functional unit of the edge continuity determination unit 330. However, this is not a limitation, and these functional units may be realized by the CPU 201 executing a program.
[0098] The sign determination unit 331 determines whether the sign indicating the positive or negative edge amount of the target pixel is the same as the sign of the edge amount of the adjacent pixel (whether the sign of the edge amount has changed). In the first and second embodiments, for example, whether the edges are continuous is determined based on the determination result of the sign determination unit 331. In this embodiment, whether the edges are continuous is further determined based on the comparison result of the edge amount comparison unit 332.
[0099] The edge amount comparison unit 332 compares the magnitude of the edge amount of the target pixel with the magnitude of the candidate edge amount. For example, the edge amount comparison unit 332 obtains a value obtained by dividing the magnitude of the edge amount of the target pixel by the magnitude of the candidate edge amount (the ratio of the magnitude of the edge amount of the target pixel to the magnitude of the candidate edge amount). In addition, the edge amount comparison unit 332 obtains a difference value obtained by subtracting the magnitude of the edge amount of the target pixel from the magnitude of the candidate edge amount.
[0100] The edge continuity determination unit 330 determines that the edge of the target pixel is discontinuous, for example, if the ratio calculated by the edge amount comparison unit 332 is smaller than a predetermined ratio R. The edge continuity determination unit 330 also determines that the edge of the target pixel is discontinuous, for example, if the difference value calculated by the edge amount comparison unit 332 is larger than a predetermined value D. That is, even if the sign of the edge amount of the target pixel is the same as the sign of the edge amount of the adjacent pixel, the edge of the target pixel is determined to be discontinuous if the magnitude of the edge amount is reduced by more than the ratio R or more than the value D compared to the magnitude of the candidate edge amount. The ratio R and the value D may be preset, for example, at a production factory or the like, through experiments or the like. Each value may be set to a single value, or different values may be set for each type of document. Furthermore, they may be dynamically changed depending on the usage status of the scanner 101, etc.
[0101] 18 is a flowchart showing the outline of the flow of edge analysis processing according to this embodiment. The difference from the second embodiment is that it is determined whether edges are continuous in steps S303 and S304. Note that the operations in steps S301, S302, and S305 to S311 are the same as the operations in steps S201, S202, and S204 to S210 in FIG. 16.
[0102] The sign determination unit 331 of the edge continuity determination unit 330 determines whether the sign of the edge amount of the target pixel is the same as that of the adjacent pixel (step S303). If the signs are the same (step S303: Yes), the process proceeds to step S304. On the other hand, if the signs are not the same (step S303: No), the edge continuity determination unit 330 determines that the edges are not contiguous, and the process proceeds to step S309.
[0103] The edge amount comparison unit 332 of the edge continuity determination unit 330 calculates the ratio of the edge amount of the target pixel to the magnitude of the candidate edge amount. If the ratio is not smaller than R (step S304: No), the edge continuity determination unit 330 determines that the edges are continuous, and the process proceeds to step S305. On the other hand, if the ratio is smaller than R (step S304: Yes), the edge continuity determination unit 330 determines that the edges are not continuous, and the process proceeds to step S309.
[0104] Next, the effect of the boundary detection process of this embodiment will be described with reference to FIG.
[0105] FIG. 19 is a diagram showing an example of boundary detection processing according to this embodiment. Image data P in FIG. 19(a) is obtained by scanning a document having a pattern, and document area 401 has pixel values corresponding to the pattern. For this image data P, the pixel values in line 420 are as shown in FIG. 19(b), and the edge amount is as shown in FIG. 19(c). In such a case, as shown in FIG. 19(c), the edge amount is greatest at pixel p6 below boundary position 430 (pixel p4), so in the boundary detection processing of the first or second embodiment, the boundary position may be erroneously detected as being at position p6.
[0106] 19(c) is smaller than the edge amount (candidate edge amount) of pixel p4, the edge continuity determination unit 330 in this embodiment can determine that the edge is not continuous at pixel p5. Therefore, in this embodiment, it is determined that the edge is continuous in the region 411 shown in FIG. 19(c), and the boundary position detection unit 350 can detect the position of pixel p4 where the edge amount is maximum in the region 411 as the boundary position 430.
[0107] In this way, according to this embodiment, whether an edge is continuous or not is determined by comparing the magnitude of the edge amount with the magnitude of the candidate edge amount along with the change in the sign of the edge amount, which prevents erroneous detection of the boundary position due to the influence of changes in pixel values within the document area and enables accurate detection of the boundary position.
[0108] (Fourth embodiment) Next, a fourth embodiment will be described.
[0109] In this embodiment, whether an edge is continuous or not is determined using the magnitude of the edge amount together with the change in the sign of the edge amount. In the following description of the third embodiment, the same parts as in the first embodiment will be omitted, and only the parts that are different from the first embodiment will be described.
[0110] 20 is a block diagram showing the functions of the edge continuity determining unit 330 according to this embodiment. Here, among the functions performed by the edge continuity determining unit 330, the characteristic functions of this embodiment will be described.
[0111] 20, the edge continuity determination unit 330 has a sign determination unit 331 and an edge amount determination unit 333. In this embodiment, for example, the controller ASIC 208 has each functional unit of the edge continuity determination unit 330. However, this is not a limitation, and these functional units may be realized by the CPU 201 executing a program.
[0112] The sign determination unit 331, like the sign determination unit 331 in the third embodiment, determines whether the sign indicating the positive or negative edge amount of the target pixel is the same as the sign of the edge amount of the adjacent pixel.
[0113] The edge amount determination unit 333 determines whether the magnitude of the edge amount of the target pixel is greater than an edge limit value E. The edge limit value E is a threshold value for determining an extremely large edge amount caused by side reflection at the edge of a document when reading a thick document such as a credit card or a point card. The value of E is set in advance, for example, at a production factory through experiments. The value of E may be set to a single value, or different values may be set for different types of documents. Furthermore, the value of E may be dynamically changed depending on the usage status of the scanner 101, etc.
[0114] If the edge amount determination unit 333 determines that the magnitude of the edge amount of the target pixel is greater than the edge limit value E, the edge continuity determination unit 330 determines that the edge of the target pixel is not continuous.
[0115] 21 is a flowchart showing the outline of the flow of edge analysis processing according to this embodiment. The difference from the first embodiment is that it is determined whether the edges are continuous in steps S403 and S404. Note that the operations in steps S401, S402, and S405 to S408 are the same as the operations in steps S101, S102, and S104 to S107 in FIG. 12.
[0116] The sign determination unit 331 of the edge continuity determination unit 330 determines whether the sign of the edge amount of the target pixel is the same as that of the adjacent pixel (step S403). If the signs are the same (step S403: Yes), the process proceeds to step S404. On the other hand, if the signs are not the same (step S403: No), the edge continuity determination unit 330 determines that the edges are not contiguous, and the process proceeds to step S406.
[0117] The edge amount determination unit 333 of the edge continuity determination unit 330 determines whether the magnitude of the edge amount of the target pixel is greater than the edge limit value E. If the magnitude of the edge amount is not greater than E (step S404: No), the edge continuity determination unit 330 determines that the edges are continuous, and the process proceeds to step S405. On the other hand, if the magnitude of the edge amount is greater than E (step S404: Yes), the edge continuity determination unit 330 determines that the edges are not continuous, and the process proceeds to step S406.
[0118] Next, the effect of the boundary detection process of this embodiment will be described with reference to FIG.
[0119] FIG. 22 shows an example of boundary detection processing according to this embodiment. The right diagram of FIG. 22(a) is an enlarged view of image data P corresponding to the top edge portion of the card shown on the left. As shown in FIG. 22(a), the bottom edge of shadow area 402 includes a white area of side reflection from the edge of the card. For this image data P, the pixel values at line 420 are as shown in FIG. 22(b), and the edge amount is as shown in FIG. 22(c). As shown in FIG. 22(c), the edge amount becomes extremely large in the side reflection area, and the edge amount exceeds the edge limit value E at the adjacent pixel processed next to pixel p7.
[0120] In such a case, in this embodiment, the edge continuity determination unit 330 determines that the pixels in the region 411 including pixel p7 have continuous edges, and the boundary position detection unit 350 can detect the position of pixel p7 where the edge amount is maximum in the region 411 as the boundary position 430. Note that in the example of Fig. 22, the number of continuous edges in the region 411 where edges are continuous is small. Therefore, for documents such as cards that have side reflections at their edges, the predetermined number N can be set small.
[0121] In this way, according to this embodiment, whether an edge is continuous or not is determined using the magnitude of the edge amount as well as the change in the sign of the edge amount, which makes it possible to accurately detect the boundary position even for objects such as cards that generate side reflections at their edges.
[0122] (Fifth embodiment) Next, a fifth embodiment will be described.
[0123] In this embodiment, the image processing device 120 according to the first to fourth embodiments is used in an apparatus such as an FA (Factory Automation) inspection device. In the following description of the fifth embodiment, the description of the same parts as those in the first to fourth embodiments will be omitted, and only the parts that differ from the first to fourth embodiments will be described.
[0124] 23 is a diagram showing an example of the configuration of an inspection device according to this embodiment. The inspection device 500 includes an imaging unit 501, a control unit 502, a platform 503, and a belt conveyor 504. The inspection device 500 is a device that uses the imaging unit 501 to read a device under test 700, which is an object to be detected and is transported by the belt conveyor 504, and inspects the appearance of the device under test 700.
[0125] The control unit 502 controls the overall operation of the inspection device 500. The control unit 502 also includes the image processing device 120 according to the first to fourth embodiments, and performs image processing on the image data of the device under test 700 read by the imaging unit 501.
[0126] FIG. 24 is a diagram showing an overview of the inspection process performed by the inspection device 500. In FIG. 24(a), a read image P10 is image data obtained by reading the device under test 700 when the imaging unit 501 is tilted, and a corrected image P11 is image data obtained after the image processing device 120 has performed skew correction on the read image P10. Similarly, in FIG. 24(b), a read image P20 is image data obtained by reading the device under test 700 different from that shown in FIG. 24(a) with the imaging unit 501, and a corrected image P21 is image data obtained after performing skew correction on P20. In addition, in FIGS. 24(a) and 24(b), a correct image P0 is image data obtained by capturing a device under test 600 with a correct appearance without tilting it.
[0127] 24(a), the image processing device 120 detects the boundary position of the device under test 700 in the scanned image P10 by the boundary detection process according to the first to fourth embodiments, and performs skew correction using the detected boundary position. Then, the image processing device 120 compares the corrected image P11 after skew correction with the correct image P0 to inspect whether there are any problems with the appearance. In this example, it is determined that the component shapes and component positions on the board of the device under test 700 are the same as those of the device under test 600 in the correct image P0.
[0128] 24(b), the image processing device 120 detects the boundary position of the device under test 700 in the scanned image P20, performs skew correction, and compares the corrected image P21 after skew correction with the correct image P0 to check whether there is a problem with the appearance. In this example, the shape of the component 701 on the board of the device under test 700 is different from that of the device under test 600 in the correct image P0, so it is determined that there is an abnormality in the appearance.
[0129] As described above, according to this embodiment, it is possible to provide an inspection device that can accurately detect the boundary position of the DUT 700 by the boundary detection processing according to the first to fourth embodiments, perform skew correction using the detected boundary position, and perform visual inspection. Note that, although the above description has been given using the DUT 700 as an example of the object to be detected by the inspection device 500, the object to be detected is not limited to the DUT 700 as long as the tilt of the object can be detected based on the boundary with the background member (the belt conveyor 504 in this embodiment).
[0130] In each of the above embodiments, the object to be detected is transported and an image is acquired using a fixed imaging unit, but conversely, a method in which the imaging unit moves the object to be detected while it is stationary and detects the inclination of the object to be detected may also be used.
[0131] In the first to fourth embodiments, the image processing device of the present invention has been described as being applied to a multifunction device having at least two of the functions of a copy function, a printer function, a scanner function, and a facsimile function, but the present invention can be applied to any image processing device such as a copier, printer, scanner device, or facsimile device.
[0132] In addition, the programs executed by the image forming apparatus 100, image processing apparatus 120, and inspection apparatus 500 of each embodiment may be configured to be provided by being recorded in an installable or executable format on a computer-readable recording medium such as a CD-ROM, a flexible disk (FD), a CD-R, or a DVD (Digital Versatile Disk).
[0133] Furthermore, the programs executed by the image forming apparatus 100 and the image processing apparatus 120 of each embodiment may be stored on a computer connected to a network such as the Internet and provided by being downloaded via the network. Also, the programs executed by the image forming apparatus 100 and the image processing apparatus 120 of each embodiment may be provided or distributed via a network such as the Internet.
[0134] The programs of the embodiments may be provided in a state where they are pre-installed in a ROM or the like.
[0135] The program executed by each device in each embodiment has a modular structure including each of the functional units described above, and in actual hardware, the CPU (processor) reads the program from the storage medium and executes it, loading each of the above units onto the main memory device and generating each functional unit on the main memory device.
[0136] Each function of each of the above-described embodiments can be realized by one or more processing circuits. Here, the term "processing circuit" in this specification includes a processor programmed to perform each function by software, such as a processor implemented by an electronic circuit, as well as devices such as an ASIC (Application Specific Integrated Circuit), a DSP (Digital Signal Processor), an FPGA (Field Programmable Gate Array), and conventional circuit modules designed to perform each of the above-described functions.
[0137] Although various embodiments of the present invention have been described above, the above-described embodiments are presented as examples and are not intended to limit the scope of the invention. These novel embodiments can be implemented in various other forms, and various combinations, omissions, substitutions, and modifications can be made without departing from the spirit of the invention. These novel embodiments and modifications thereof are included within the scope and spirit of the invention, as well as within the scope of the invention and its equivalents as set forth in the claims. Furthermore, components from different embodiments and modifications may be combined as appropriate.
[0138] For example, aspects of the present invention are as follows. <1> an edge amount calculation unit that calculates an edge amount indicating a change in pixel value between a target pixel sequentially selected from a plurality of pixels constituting the image data, or a plurality of peripheral pixels of the target pixel, in an area between the detection object and a background member of the image data including the detection object and the background member; an edge determination unit that determines whether the target pixel is an edge based on the edge amount calculated by the edge amount calculation unit; an edge continuity determination unit that determines whether the edge of the target pixel is continuous when the edge determination unit determines that the target pixel is an edge; an edge continuity calculation unit that calculates an edge continuity number, which is the number of consecutive target pixels determined by the edge continuity determination unit to have consecutive edges; a boundary position detection unit that, when the edge determination unit determines that the target pixel is not an edge, detects the position of the boundary between the detection object and the background member using the edge amount of the edge continuing up to the target pixel selected before the target pixel if the calculated number of consecutive edges up to the target pixel selected before the target pixel is greater than a predetermined number; The image processing device is characterized by comprising: <2> the edge amount calculation unit calculates edge amounts of target pixels sequentially selected along a predetermined direction; The predetermined direction is at least two directions that are perpendicular to each other. <1> 2 is an image processing device according to the first embodiment. <3> The edge continuity determination unit determines that edges are continuous when the sign of the edge amount of the target pixel is the same as the sign of the edge amount of a target pixel selected before the target pixel. <1> or <2> 2 is an image processing device according to the first embodiment. <4> When the edge continuity determination unit determines that the edge of the target pixel is not continuous, if the number of continuous edges of the edges continuing up to the target pixel selected before the target pixel is greater than a predetermined number, the boundary position detection unit detects the position of the boundary between the background member and the detection target object using the edge amount of the continuous edges. <1> ~ <3> 10. The image processing device according to claim 9, wherein: <5> the boundary position detection unit detects the position of a pixel having the largest edge amount among the continuous edges as the position of the boundary between the background member and the detection object; <1> ~ <4> 10. The image processing device according to claim 9, wherein: <6> The number of consecutive edges is reset after the boundary position detection unit determines whether the number of consecutive edges is greater than a predetermined number. <1> ~ <5> 10. The image processing device according to claim 9, wherein: <7> a candidate storage unit that stores, when the edge continuity determination unit determines that the edges are continuous, a candidate edge amount that is the edge amount of a pixel having the largest edge amount among the edges that are continuous up to the target pixel, and a candidate position that is the position of the pixel; When it is determined that the target pixel is not an edge, or when it is determined that the edges of the target pixel are not continuous, if the number of continuous edges is greater than the predetermined number, the boundary position detection unit detects the candidate position stored in the candidate storage unit as the position of the boundary. <4> ~ <6> 10. The image processing device according to claim 9, wherein: <8> The edge continuity determination unit determines that the edge of the target pixel is not continuous when a ratio of the magnitude of the edge amount of the target pixel to the magnitude of the candidate edge amount is smaller than a predetermined ratio. <7> 2 is an image processing device according to the first embodiment. <9> The edge continuity determination unit determines that the edge of the target pixel is not continuous when the magnitude of the edge amount of the target pixel is greater than a predetermined value. <1> ~ <8> 10. The image processing device according to claim 9, wherein: <10> a boundary position detection unit that extracts a section in an area between a detection object and a background member of image data including the detection object and the background member, where a target pixel selected from a plurality of pixels constituting the image data or a plurality of pixels surrounding the target pixel have a change in pixel value that is greater than a predetermined threshold and where the number of consecutive pixels exceeds a predetermined number, and detects a boundary position that is the position of a boundary between the detection object and the background member using the change in pixel value in the section; an inclination detection unit that detects an inclination of the detection object using the plurality of boundary positions detected by the boundary position detection unit; a correction unit that corrects the tilt of the detection object included in the image data using the tilt detected by the tilt detection unit; The image processing device is characterized by comprising: <11> The aforementioned <1> ~ <10> an image processing device according to any one of the above; an image forming unit that forms an image based on image data processed by the image processing device; The image forming apparatus is characterized by comprising: <12> an edge amount calculation step of calculating an edge amount indicating a change in pixel value between a target pixel sequentially selected from a plurality of pixels constituting the image data, or a plurality of peripheral pixels of the target pixel, in an area between the detection object and a background member of the image data including the detection object and the background member; an edge determination step of determining whether the target pixel is an edge based on the edge amount calculated in the edge amount calculation step; an edge continuity determination step of determining whether or not the edge of the target pixel is continuous when the target pixel is determined to be an edge by the edge determination step; an edge continuity calculation step of calculating an edge continuity number, which is the number of consecutive target pixels determined to have continuous edges in the edge continuity determination step; a boundary position detection step of detecting a position of a boundary between the detection object and the background member using an edge amount of an edge continuing up to a target pixel selected before the target pixel when the target pixel is determined not to be an edge by the edge determination step and the calculated number of consecutive edges up to the target pixel selected before the target pixel is greater than a predetermined number; The image processing method is characterized by comprising: <13> Computer, an edge amount calculation means for calculating an edge amount indicating a change in pixel value between a target pixel sequentially selected from a plurality of pixels constituting the image data, or a plurality of pixels surrounding the target pixel, in an area between the detection object and a background member of the image data including the detection object and the background member; an edge determination means for determining whether the target pixel is an edge based on the edge amount calculated by the edge amount calculation means; an edge continuity determination means for determining whether the edge of the target pixel is continuous or not when the edge determination means determines that the target pixel is an edge; an edge continuity calculation means for calculating an edge continuity number, which is the number of consecutive target pixels determined by the edge continuity determination means to have consecutive edges; a boundary position detection means for detecting a position of a boundary between the detection object and the background member using an edge amount of an edge continuing up to a target pixel selected before the target pixel when the target pixel is determined not to be an edge by the edge determination means and the calculated number of consecutive edges up to the target pixel selected before the target pixel is greater than a predetermined number; The program is characterized by functioning as follows. [Explanation of symbols]
[0139] 7 Slit Glass 8 Contact Glass 11 Document tray 12 Output tray 24 Light source 25 1st Carriage 26 Second Carriage 27 Imaging Lens 28,501 Imaging unit 41 Movable manuscript table 42 Side guide plate 46 Set Filler 50 Conveying section 51 Separation feeding section 52 Pull-out section 53 Turn section 54 First reading and conveying section 55 Second reading and conveying section 56 Paper output section 60 Paper feed slot 61 Pickup roller 62 Paper feed belt 63 Reverse Roller 64 Support arm member 65 Pull-out 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 Document set sensor 83 Paper ejection sensor 84 sensors 85 Document width sensor 89,90 Document length detection sensor 91 Second reading unit 92 Background material 100 Image forming device 101 Scanner 102 Automatic Document Feeder (ADF) 103 Paper feed section 104 Device body 105 Image creation section 106 Developer 107 Transport path 108 Registration roller 109 Optical writing device 110 Fixing unit 111 Double-sided tray 112 Photosensitive drum 113 Intermediate transfer belt 120 Image Processing Device 140 Plotter 200 Image processing section 201 CPU(Central Processing Unit) 202 ROM (Read Only Memory) 205,209 main memory 206 chipset 207 Image Processing ASIC 208 Controller ASIC 210 ASIC 211 HDD (Hard Disk Drive) 310 Edge amount calculation unit 320 Edge detection section 330 Edge continuity determination unit 331 Sign determination section 332 Edge amount comparison section 333 Edge amount determination unit 340 Edge continuity calculation unit 350 Boundary position detection unit 360 Candidate storage unit 400 background area 401 Original area 402 Shadow area 430 Boundary position [Prior art documents] [Patent documents]
[0140] [Patent Document 1] Japanese Patent Application Publication No. 2018-098723
Claims
1. an edge amount calculation unit that calculates an edge amount indicating a change in pixel value between a target pixel sequentially selected from a plurality of pixels constituting the image data, or a plurality of peripheral pixels of the target pixel, in an area between the detection object and a background member of the image data including the detection object and the background member; an edge determination unit that determines whether the target pixel is an edge based on the edge amount calculated by the edge amount calculation unit; an edge continuity determination unit that determines whether the edge of the target pixel is continuous when the edge determination unit determines that the target pixel is an edge; an edge continuity calculation unit that calculates an edge continuity number, which is the number of consecutive target pixels determined by the edge continuity determination unit to have consecutive edges; a boundary position detection unit that, when the edge determination unit determines that the target pixel is not an edge, detects the position of the boundary between the detection object and the background member using the edge amount of the edge continuing up to the target pixel selected before the target pixel if the calculated number of consecutive edges up to the target pixel selected before the target pixel is greater than a predetermined number; An image processing device comprising:
2. the edge amount calculation unit calculates edge amounts of target pixels sequentially selected along a predetermined direction; The image processing device according to claim 1 , wherein the predetermined directions are at least two directions that are perpendicular to each other.
3. The image processing device according to claim 1 , wherein the edge continuity determination unit determines that the edges are continuous when the sign of the edge amount of the target pixel is the same as the sign of the edge amount of a target pixel selected before the target pixel.
4. 2. The image processing device according to claim 1, wherein when the edge continuity determination unit determines that the edge of the target pixel is not continuous, if the number of continuous edges of the edges continuing up to the target pixel selected before the target pixel is greater than a predetermined number, the boundary position detection unit detects the position of the boundary between the background member and the detected object using the edge amount of the continuous edges.
5. The image processing device according to claim 1 , wherein the boundary position detection unit detects the position of a pixel having a maximum edge amount among the continuous edges as the position of the boundary between the background member and the detection object.
6. The image processing device according to claim 1 , wherein the edge continuation number is reset after the boundary position detection unit determines whether the edge continuation number is greater than a predetermined number.
7. a candidate storage unit that stores, when the edge continuity determination unit determines that the edges are continuous, a candidate edge amount that is the edge amount of a pixel having the largest edge amount among the edges that are continuous up to the target pixel, and a candidate position that is the position of the pixel; 5. The image processing device according to claim 4, wherein the boundary position detection unit detects a candidate position stored in the candidate storage unit as the position of the boundary if the target pixel is determined to not be an edge or if the edge of the target pixel is determined to not be continuous and the number of continuous edges is greater than the predetermined number.
8. The image processing device according to claim 7 , wherein the edge continuity determination unit determines that the edge of the target pixel is not continuous when a ratio of the magnitude of the edge amount of the target pixel to the magnitude of the candidate edge amount is smaller than a predetermined ratio.
9. The image processing device according to claim 4 , wherein the edge continuity determining unit determines that the edge of the target pixel is not continuous when the magnitude of the edge amount of the target pixel is greater than a predetermined value.
10. a boundary position detection unit that extracts a section in an area between a detection object and a background member of image data including the detection object and the background member, where a target pixel selected from a plurality of pixels constituting the image data or a plurality of pixels surrounding the target pixel have a change in pixel value that is greater than a predetermined threshold and where the number of consecutive pixels exceeds a predetermined number, and detects a boundary position that is the position of a boundary between the detection object and the background member using the change in pixel value in the section; an inclination detection unit that detects an inclination of the detection object using the plurality of boundary positions detected by the boundary position detection unit; a correction unit that corrects the tilt of the detection object included in the image data using the tilt detected by the tilt detection unit; An image processing device comprising:
11. An image processing device according to any one of claims 1 to 10; an image forming unit that forms an image based on image data processed by the image processing device; An image forming apparatus comprising:
12. an edge amount calculation step of calculating an edge amount indicating a change in pixel value between a target pixel sequentially selected from a plurality of pixels constituting the image data, or a plurality of peripheral pixels of the target pixel, in an area between the detection object and a background member of the image data including the detection object and the background member; an edge determination step of determining whether the target pixel is an edge based on the edge amount calculated in the edge amount calculation step; an edge continuity determination step of determining whether or not the edge of the target pixel is continuous when the target pixel is determined to be an edge by the edge determination step; an edge continuity calculation step of calculating an edge continuity number, which is the number of consecutive target pixels determined to have continuous edges in the edge continuity determination step; a boundary position detection step of detecting a position of a boundary between the detection object and the background member using an edge amount of an edge continuing up to a target pixel selected before the target pixel when the target pixel is determined not to be an edge by the edge determination step and the calculated number of consecutive edges up to the target pixel selected before the target pixel is greater than a predetermined number; An image processing method comprising:
13. Computer, an edge amount calculation means for calculating an edge amount indicating a change in pixel value between a target pixel sequentially selected from a plurality of pixels constituting the image data, or a plurality of pixels surrounding the target pixel, in an area between the detection object and a background member of the image data including the detection object and the background member; an edge determination means for determining whether the target pixel is an edge based on the edge amount calculated by the edge amount calculation means; an edge continuity determination means for determining whether the edge of the target pixel is continuous or not when the edge determination means determines that the target pixel is an edge; an edge continuity calculation means for calculating an edge continuity number, which is the number of consecutive target pixels determined by the edge continuity determination means to have consecutive edges; a boundary position detection means for detecting a position of a boundary between the detection object and the background member using an edge amount of an edge continuing up to a target pixel selected before the target pixel when the target pixel is determined not to be an edge by the edge determination means and the calculated number of consecutive edges up to the target pixel selected before the target pixel is greater than a predetermined number; A program characterized by functioning as
Citation Information
Patent Citations
Image reading device, image forming apparatus, reading method, and image forming system
JP2018098723A