Workpiece inspection device and workpiece inspection method
The workpiece inspection device and method address the challenge of low accuracy in identifying tilted or overlapping surfaces by using brightness thresholds and image processing to isolate and align the top surface image, improving precision in image inspection.
Patent Information
- Application Number
- JP2021100747
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-06-17
- Publication Date
- 2024-10-23
- Estimated Expiration
- 2041-06-17
AI Technical Summary
Existing image inspection techniques struggle to accurately identify and set inspection areas for workpieces mounted on box members, particularly when surfaces of the same color overlap or when the box member is tilted, leading to low inspection accuracy.
A workpiece inspection device and method that defines the surface closest to the mounting opening as the upper surface, using brightness thresholds to separate high brightness areas as the top surface image, and employs image processing to correct and align the coordinate system for precise identification.
Enables accurate detection of workpiece positions and colors even when tilted, reducing errors and increasing inspection precision by isolating the top surface image from other surfaces, thus enhancing the accuracy of image inspection.
Smart Images

Figure 0007571670000001 
Figure 0007571670000002 
Figure 0007571670000003
Abstract
Description
[Technical field]
[0001] The present invention relates to a technique for inspecting a workpiece. [Background technology]
[0002] The following Patent Document 1 describes a technology for image inspection using a camera to inspect components mounted on a box member called a power supply box. In this image inspection, an inspection area is set within the pixel area constituting the work in the image of the box member captured by the camera, and image analysis processing is performed to compare a value calculated from both the average value of the RGB total value of each pixel in the inspection area and the RGB total value of each pixel in the inspection area with a threshold value. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2019-8578 A Summary of the Invention [Problem to be solved by the invention]
[0004] However, when using the image inspection described in Patent Document 1, the box member cannot be correctly identified and it is difficult to set the inspection area for the following reasons, which causes a problem of low inspection accuracy for the workpiece attached to the box member.
[0005] For example, when a wire harness of the same color extends from a box member, it becomes difficult to capture the outline of the box member from the image information obtained by photographing with a camera, and it becomes difficult to accurately detect the relative position of the workpiece with respect to the box member. In addition, when a part of the wire harness goes under the box member and the box member becomes tilted, the workpiece is photographed from an oblique direction, which may cause a problem that the side image of the workpiece is erroneously determined to be an image of a different workpiece.
[0006] The present invention has been made in view of the above problems, and aims to provide a work inspection technique that is effective for performing image inspection of a work with high accuracy. [Means for solving the problem]
[0007] One aspect of the present invention is A work inspection device that inspects a work mounted in a box member through a mounting opening, The workpiece has a plurality of exposed surfaces, the plurality of exposed surfaces being the same color; An imaging unit that images the workpiece; an image processing unit that processes the captured image obtained by the imaging unit; Equipped with When the image processing unit defines a surface of the workpiece that is closest to the mounting opening of the box member among the plurality of exposed surfaces of the workpiece as the upper surface of the workpiece, Using a threshold value set between the brightness of the top surface and the brightness of exposed surfaces other than the top surface In the above image, the brightness is the above a work inspection device having an extraction unit that extracts a high brightness area exceeding a threshold value as a top surface image of the work; is located.
[0008] Another aspect of the present invention is A work inspection method for inspecting a work mounted in a box member through a mounting opening, comprising: The workpiece has a plurality of exposed surfaces, the plurality of exposed surfaces being the same color; The above workpiece is photographed by the photography section, When the surface of the workpiece that is closest to the mounting opening of the box member among the plurality of exposed surfaces of the workpiece is defined as the upper surface of the workpiece, Using a threshold value set between the brightness of the top surface and the brightness of exposed surfaces other than the top surface Among the images captured by the above-mentioned imaging section, the above A workpiece inspection method, comprising: extracting a high-brightness area exceeding a threshold value as a top surface image of the workpiece; is located. Effect of the Invention
[0009] In each of the above-mentioned aspects, the workpiece mounted on the box member is photographed by the photographing unit for inspection. Since the multiple exposed surfaces of the workpiece are the same color when mounted on the box member, the upper surface of the multiple exposed surfaces has a higher brightness than the surfaces other than the upper surface. Therefore, by utilizing the brightness difference between the brightness of the upper surface of the workpiece and the brightness of the surfaces other than the upper surface, it is possible to determine that a high-brightness area in the photographed image obtained by the photographing unit, whose brightness exceeds a threshold value, is the upper surface image of the workpiece.
[0010] This makes it possible to extract only the top surface image of the workpiece by separating it from the images of the surfaces other than the top surface, not only when the workpiece is photographed in a horizontal position with the box member placed horizontally, but also when the workpiece is photographed from an oblique direction with the box member placed tilted and tilted from the horizontal position. As a result, it becomes possible to accurately detect the attachment position of the workpiece by using the extracted top surface image. At this time, by preventing erroneous determination that an image of a surface other than the top surface of the workpiece is the top surface image of another workpiece, it is possible to suppress a decrease in the inspection accuracy in the image inspection of the workpiece.
[0011] As described above, according to each of the above-mentioned aspects, it is possible to provide a work inspection technique that is effective for performing image inspection of a work with high accuracy. [Brief description of the drawings]
[0012] [Figure 1] FIG. 1 is a diagram showing a schematic configuration of a work inspection device according to a first embodiment. [Diagram 2] 4 is a flowchart of image processing in the workpiece inspection method of the first embodiment. [Diagram 3] A diagram showing the distribution of hue and saturation on the top and side of the workpiece. [Figure 4] A diagram showing the distribution of hue and saturation only on the top surface of the workpiece. [Diagram 5] A diagram showing the brightness distribution on the top and side of the workpiece. [Figure 6] 3 is a diagram for explaining the top view image extraction process in the flowchart of FIG. 2; [Figure 7]FIG. 3 is a diagram for explaining the image rotation process in the flowchart of FIG. 2. [Figure 8] 3 is a diagram for explaining the image transformation process of the flowchart in FIG. 2; [Figure 9] FIG. 13 is a diagram showing a corrected image after image transformation processing. [Figure 10] FIG. 4 is a diagram showing a master image together with coordinate values according to the first embodiment. [Figure 11] FIG. 11 is a diagram showing a database of master images in FIG. 10. [Figure 12] FIG. 13 is a diagram showing a schematic configuration of a work inspection device according to a second embodiment. [Figure 13] 10 is a flowchart of image processing in the workpiece inspection method of the second embodiment. [Figure 14] FIG. 14 is a diagram for explaining the position vector calculation process in the flowchart of FIG. 13. [Figure 15] FIG. 11 is a diagram showing a database of master images according to the second embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] Preferred embodiments of the above aspects are described below.
[0014] In the work inspection device of the above-mentioned aspect, it is preferable that the image processing unit has a work judgment unit that judges the arrangement state of the work corresponding to the top surface image based on an extracted image including the top surface image extracted by the extraction unit and a master image in which the multiple works are attached in their correct positions in the box member.
[0015] According to this workpiece inspection device, it is possible to accurately determine the placement state of the workpiece by applying a master image to an extracted image including an extracted top surface image.
[0016] In the work inspection device of the above aspect, the shape of the top surface of the work is a rectangle with all four corners being equal, and the multiple workpieces include multiple first workpieces that are attached to the box member with a first edge of the top surface arranged along a first arrangement line, and multiple second workpieces that are attached to the box member with a second edge of the top surface perpendicular to the first edge of the top surface arranged along a second arrangement line perpendicular to the first arrangement line, the image processing unit has an image correction unit that corrects a coordinate system of the extracted image so that the first array line and the second array line form a rectangular coordinate system and the rectangular coordinate system overlaps with the rectangular coordinate system of the master image; It is preferable that the work judgment unit is configured to judge whether the position of the work is correct or not by comparing the coordinates of the top surface image contained in the corrected image obtained by the image correction unit with the coordinates of the top surface image pre-registered in the master image.
[0017] According to this workpiece inspection device, when inspecting a plurality of workpieces, all of which have a rectangular or square top surface shape, mounted on a box member, the image correction unit corrects the coordinate system of the extracted image based on a first arrangement line relating to the arrangement of the plurality of first workpieces and a second arrangement line relating to the arrangement of the plurality of second workpieces.Then, the workpiece judgment unit compares the coordinates of the top surface image contained in the corrected image with the coordinates of the top surface image of the master image.At this time, by comparing the corrected image and the master image with each other regarding the coordinates of the top surface image, it becomes possible to accurately judge whether the position of the workpiece is correct or not.
[0018] In the work inspection device of the above aspect, the image processing unit has a vector calculation unit that calculates a position vector of the top surface image in a coordinate system of the extracted image, It is preferable that the work judgment unit is configured to judge whether the position of the work is correct or not by comparing the unit vector coefficient of the position vector obtained by the vector calculation unit with a unit vector coefficient pre-registered for the top surface image in the coordinate system of the master image.
[0019] According to this workpiece inspection device, the position vector of the top surface image in the coordinate system of the extracted image is calculated by the vector calculation unit, and the unit vector coefficient of this position vector is compared with the unit vector coefficient of the top surface image in the coordinate system of the master image by the workpiece determination unit. At this time, by comparing the extracted image and the master image with each other regarding the unit vector coefficient of the top surface image, it becomes possible to determine whether the position of the workpiece is correct or not by simple processing and with high accuracy.
[0020] In the work inspection device of the above-mentioned aspect, it is preferable that the work judgment unit is configured to judge whether the color of the work is correct or not by comparing the hue and saturation of the top surface image of the extracted image with the hue and saturation of the top surface image pre-registered in the master image.
[0021] According to this workpiece inspection device, the hue and saturation of the top surface image of the extracted image are compared with those of the top surface image of the master image by the workpiece judgment unit. At this time, by comparing the hue and saturation of the top surface image of the extracted image and the master image, it becomes possible to judge with high accuracy whether the color of the workpiece is correct or not.
[0022] The work inspection device of the above-mentioned aspect is provided with an illumination unit having an illumination surface arranged parallel to the opening plane of the mounting opening of the box member, and it is preferable that the illumination unit is configured to irradiate illumination light in one direction from the illumination surface towards the work.
[0023] According to this workpiece inspection device, by irradiating the workpiece with illumination light from the illumination unit in one direction, the brightness difference between the brightness of the workpiece's top surface and the brightness of the surfaces other than the top surface can be made larger than when using shadowless illumination that irradiates illumination light from multiple directions. This makes it possible to improve the extraction accuracy when extracting the top surface image from the captured image.
[0024] In the work inspection method of the above-mentioned aspect, it is preferable to determine the positioning state of the work corresponding to the top surface image based on an extracted image including the extracted top surface image and a master image in which the multiple works are attached in their correct positions in the box member.
[0025] According to this workpiece inspection method, by applying a master image to an extracted image including an extracted top surface image, it becomes possible to accurately determine the placement state of the workpiece.
[0026] In the work inspection method of the above aspect, the shape of the top surface of the work is a rectangle with all four corners being equal, and the plurality of workpieces include a plurality of first workpieces attached to the box member with a first edge of the top surface arranged along a first arrangement line, and a plurality of second workpieces attached to the box member with a second edge of the top surface perpendicular to the first edge arranged along a second arrangement line perpendicular to the first arrangement line, It is preferable to correct the coordinate system of the extracted image so that the first array line and the second array line form rectangular coordinates and the rectangular coordinates overlap with the rectangular coordinates of the master image, and to determine whether the position of the work is correct by comparing the coordinates of the top surface image contained in the corrected image obtained by the correction with the coordinates of the top surface image registered in advance in the master image.
[0027] According to this workpiece inspection method, when inspecting a plurality of workpieces, all of which have a rectangular or square top surface shape mounted on a box member, the coordinate system of the extracted image is corrected based on a first arrangement line relating to the arrangement of the plurality of first workpieces and a second arrangement line relating to the arrangement of the plurality of second workpieces. Then, the coordinates of the top surface image contained in the corrected image are compared with the coordinates of the top surface image of the master image. At this time, by comparing the corrected image and the master image with each other regarding the coordinates of the top surface image, it becomes possible to accurately determine whether the position of the workpiece is correct or not.
[0028] In the workpiece inspection method of the above aspect, it is preferable to determine whether the position of the workpiece is correct by calculating a position vector of the top surface image in the coordinate system of the extracted image and comparing the unit vector coefficient of the position vector obtained by the calculation with a unit vector coefficient registered in advance for the top surface image in the coordinate system of the master image.
[0029] According to this workpiece inspection method, a position vector of the top surface image in the coordinate system of the extracted image is calculated, and a unit vector coefficient of this position vector is compared with a unit vector coefficient of the top surface image in the coordinate system of the master image. At this time, by comparing the extracted image and the master image with respect to the unit vector coefficient of the top surface image, it becomes possible to determine whether the position of the workpiece is correct or not with simple processing and with high accuracy.
[0030] In the work inspection method of the above-mentioned aspect, it is preferable to determine whether the color of the work is correct by comparing the hue and saturation of the top surface image of the extracted image with the hue and saturation of the top surface image pre-registered in the master image.
[0031] According to this workpiece inspection method, the hue and saturation of the top surface image of the extracted image are compared with the hue and saturation of the top surface image of the master image. By comparing the hue and saturation of the top surface images of the extracted image and the master image, it is possible to accurately determine whether the color of the workpiece is correct.
[0032] In the work inspection method of the above-mentioned aspect, when photographing the work by the photographing unit, it is preferable to irradiate illumination light in one direction toward the work from an irradiation surface arranged parallel to the opening plane of the mounting opening of the box member.
[0033] According to this workpiece inspection method, by irradiating the workpiece with illumination light from one direction, the brightness difference between the brightness of the workpiece's top surface and the brightness of the surfaces other than the top surface can be made larger than when using shadowless illumination, which irradiates the workpiece with illumination light from multiple directions. This makes it possible to improve the extraction accuracy when extracting the top surface image from the captured image.
[0034] Hereinafter, an embodiment for realizing an inspection technique for inspecting a workpiece will be described with reference to the drawings.
[0035] In the drawings for explaining the embodiments, unless otherwise specified, a first direction which is the horizontal direction is indicated by an arrow X, a second direction which is the horizontal direction and perpendicular to the first direction is indicated by an arrow Y, and a third direction which is the vertical direction is indicated by an arrow Z.
[0036] (Embodiment 1) As shown in FIG. 1, a workpiece inspection device (hereinafter simply referred to as “inspection device”) 101 of the first embodiment is a device for automatically performing image inspection of a workpiece 10.
[0037] The workpiece 10 is attached to a box member 1 through an attachment opening 2. This box member 1 is housed in a returnable box B for transportation. The box member 1 has a substantially rectangular outer shape when viewed from the attachment opening 2 side. In this embodiment, the workpiece 10 is inspected while still attached to the box member 1 housed in the returnable box B.
[0038] The workpiece 10 is an on-vehicle relay, and the box member 1 is a relay box in which the relay is mounted. A wire harness 3 for electrical connection with the outside extends from the box member 1 serving as a relay box.
[0039] The work 10 as a relay has an outer shape of a rectangular parallelepiped conforming to JIS and ISO standards. In this case, when the work 10 is attached to the box member 1 and viewed from the attachment opening 2 side, the shape of the top surface 11 of the work 10 is a rectangle (quadrilateral) with all four corners being equal. Each work 10 has one top surface 11 and four side surfaces 12, which are all exposed surfaces, and these top surfaces 11 and side surfaces 12 are all the same color. In addition, a color is set for each work 10. Here, the top surface 11 of the work 10 is defined as the surface closest to the attachment opening 2 of the box member 1 among the multiple exposed surfaces.
[0040] For example, when the box member 1 is a black resin member and the wire harness 3 is also black, it is difficult to accurately capture the outer contour of the box member 1 from the image information obtained by the camera. In addition, when part of the wire harness 3 goes under the box member 1 and the box member 1 becomes tilted, the work 10 is also photographed from an oblique direction in a tilted position relative to the horizontal position. The "horizontal position" here refers to a position in which the top surface 11 of the work 10 is approximately parallel to the bottom surface of the box member 1 and the opening plane A of the mounting opening 2.
[0041] In this case, since the captured image I includes the side surface 12 of the workpiece 10 in addition to the top surface 11, there is a risk that the side surface 12 may be erroneously determined to be the top surface 11 of another workpiece 10, making it difficult to correctly detect the position of the workpiece 10. In particular, when image inspection is performed on the box member 1 stored in the returnable box B, the box member 1 is likely to be tilted in the returnable box B, and this problem becomes apparent. In order to solve this problem, it is necessary to once remove the box member 1 from the returnable box B, set it horizontally on the inspection table, perform image inspection, and then return it to the returnable box B, which can result in a problem of increased inspection man-hours.
[0042] Therefore, the inspection device 101 of embodiment 1 is designed to solve such problems, and enables high-precision image inspection of the workpiece 10 not only when the workpiece 10 is photographed in a horizontal position, but also when the workpiece 10 is photographed from an oblique direction in a position tilted relative to the horizontal position.
[0043] The inspection device 101 includes at least an imaging unit 20, an illumination unit 30, and a control device 40. The control device 40 includes an image processing unit 41 and an illumination control unit 48. The control device 40 is mainly configured with a known CPU (Central Processing Unit).
[0044] The photographing unit 20 is a camera that photographs the workpiece 10 through the mounting opening 2 of the box member 1, and has an image sensor 21 built into the camera body. The photographing unit 20 is configured to capture an image by the image sensor 21 receiving light reflected from the surface of the workpiece 10, and transmit the photographed image I obtained by the photographing unit 20 to an image processing unit 41 of the control device 40. Typically, a CCD (Charge Coupled Device) image sensor or a CMOS (Complementary Metal Oxide Semiconductor) image sensor is used as the image sensor 21.
[0045] The lighting unit 30 is for irradiating the workpiece 10 with illumination light L, and is electrically connected to the control device 40. When the photographing unit 20 photographs the workpiece 10, the lighting unit 30 is put into an operating state in response to a control signal transmitted from a lighting control unit 48 of the control device 40.
[0046] The illumination unit 30 has an irradiation surface 31 disposed approximately parallel to the opening plane A of the mounting opening 2 of the box member 1. Here, the opening plane A is defined as a plane having the third direction Z as a normal direction. The illumination unit 30 is configured to irradiate illumination light L in one direction (direction along the third direction Z) from the irradiation surface 31 toward the workpiece 10. Note that the type of this illumination unit 30 is not particularly limited, but it is preferable to adopt LED lighting, which has excellent durability and energy-saving performance.
[0047] The image processing unit 41 is for processing the captured image I obtained by the imaging unit 20, and has a conversion unit 42, an extraction unit 43, an image correction unit 44, a workpiece determination unit 45, a storage unit 46, and an output unit 47. The image processing unit 41 has a known GPU (Graphics Processing Unit) for image processing, and a memory constituting the storage unit 46.
[0048] The conversion unit 42 is configured to convert RGB values of the captured image I into HSV values. The extraction unit 43 is configured to extract a specific area from the captured image I. The image correction unit 44 is configured to correct the extracted image Ic obtained by the extraction unit 43 to obtain corrected images Id and Ie.
[0049] The work judgment unit 45 is configured to judge the arrangement state of the work 10 corresponding to the top surface image Ia based on the extracted image Ic obtained by the extraction unit 43 and the master image Im, more specifically, by comparing the corrected image Ie obtained by the image correction unit 44 with the master image Im. The "judgment of the arrangement state of the work 10" here refers to judging whether the position of the work 10 is correct or not, and judging whether the work 10 is the correct color or not.
[0050] The storage unit 46 is configured to previously store programs and data used in image processing, as well as a master image Im and a threshold value Th, and to temporarily store various data before and after image processing as necessary.
[0051] The output unit 47 is configured to output information obtained during image processing by the image processing unit 41 and information stored in the memory unit 46 to an output means such as a monitor upon receiving an output instruction signal.
[0052] Next, a work inspection method of Embodiment 1 (hereinafter simply referred to as "inspection method") will be described. This inspection method is a method for inspecting a work 10 mounted through a mounting opening 2 on a box member 1. This method is preferably executed using the inspection apparatus 101 having the above-described configuration.
[0053] In the inspection method of Embodiment 1, first, with the imaging unit 20 and the illumination unit 30 prepared, a passing box B containing the box member 1 is set on the inspection table. Then, with the illumination light L irradiated from the illumination unit 30 toward the work 10, the work 10 is imaged by the imaging unit 20.
[0054] Thereafter, based on the captured image I obtained by the imaging unit 20, the image processing unit 41 sequentially executes a plurality of steps (steps from the first step S101 to the sixth step S106) for image processing according to the processing flow shown in FIG. 2.
[0055] (Conversion processing) The first step S101 is a step of performing a process of converting the RGB values of the captured image I obtained by the imaging unit 20 into HSV values. This process is executed by the conversion unit 42 of the image processing unit 41. Here, the RGB value is a color index representing a color space composed of three components: an R value (red), a G value (green), and a B value (blue). On the other hand, the HSV value is a color index representing a color space composed of three components: an H value (hue), an S value (saturation), and a V value (brightness). According to this first step S101, the RGB values are converted into HSV values using a known conversion processing program stored in advance in the storage unit 46.
[0056] This conversion processing program is not particularly limited, but as an example, one using the following conversion calculation formula can be used.
[0057] <H value (hue)> When the largest value among the R value, G value, and B value is "Max" and the smallest value is "Min", the H value can be calculated using the following four conversion calculation formulas. (1)H value (when the R value is at its maximum) = 60 × ((G value - B value) / (Max - Min)) (2)H value (when the G value is at its maximum) = 60 × ((B value - R value) / (Max - Min)) + 120 (3)H value (when the B value is at its maximum) = 60 × ((R value - G value) / (Max - Min)) + 240 (4)H value (when the R value, G value, and B value are the same) = 0
[0058] <S value (chroma)> When the largest value among the R value, G value, and B value is "Max" and the smallest value is "Min", the S value can be calculated using the following conversion formula. (5)S value = (Max - Min) / Max
[0059] <V value (brightness)> When the largest value among the R value, G value, and B value is "Max", the V value can be calculated using the following conversion formula. (6)V value = Max
[0060] The second step S102 is a step of extracting the area of a color (H value and S value) registered in advance from the captured image I after the implementation of the first step S101. This process is executed by the conversion unit 42 or the extraction unit 43 of the image processing unit 41. Here, information about the color (H value and S value) of the workpiece 10 assumed to be used is registered in advance in the storage unit 46. For example, assuming the use of a three-color relay of yellow, light blue, and purple as the workpiece 10, combinations of H values and S values for each color are registered in advance.
[0061] According to this second step S102, when there is an assumed area in the captured image I that corresponds to the combination pattern of the pre-registered H value and S value, this assumed area can be extracted from the captured image I. For example, when assuming the use of a three-color relay, at least one of the three assumed areas corresponding to the three combination patterns of H values and S values is extracted from the captured image I.
[0062] As shown in Figure 3, when the distribution of H value (hue) and S value (saturation) is viewed with the top surface 11 and side surface 12 of the workpiece 10 aligned, for example, an overlapping area may be formed between the light blue area and the purple area. For this reason, it is not possible to distinguish between light blue and purple based on the combination pattern of the H value and S value alone, making it difficult to identify the color of the workpiece 10.
[0063] In contrast, as shown in Fig. 4, when the distribution of H value (hue) and S value (saturation) is viewed only on the top surface 11 of the workpiece 10, it can be seen that, for example, no overlapping area is formed between the light blue area and the purple area, and the light blue and purple can be clearly distinguished from each other across the distinction line. This is because the angle between the side surface 12 and the illumination unit 30 is large with respect to the top surface 11, and therefore the reflected light from the side surface 12 has a large variation in the H value and S value. Therefore, if a top surface image Ia corresponding to the top surface 11 of the workpiece 10 can be extracted from the captured image I, it is effective in identifying the color of the workpiece 10.
[0064] Therefore, the present inventor has focused on extracting the top surface image Ia based on the V value (brightness). As shown in Fig. 5, for example, in the case of a workpiece 10 whose exposed surface is purple, it is found that there is a clear difference between the V value of the top surface 11 and the V value of the side surface 12. Therefore, a high-brightness area in the captured image I where the V value exceeds the threshold value Th can be determined to be a top surface image (top surface image Ia described later). On the other hand, a low-brightness area in the captured image I where the V value is below the threshold value Th can be determined to be a side surface image (side surface image Ib described later).
[0065] The threshold value Th is preferably set to an appropriate value based on the color of the workpiece 10 to be mounted in the box member 1, the irradiation conditions of the illumination light L from the illumination unit 30, the indoor lighting environment, and the like.
[0066] 6, when the workpiece 10 is photographed in a tilted position relative to the horizontal position, the photographed image I includes a top surface image Ia corresponding to the top surface 11 of the workpiece 10, as well as a side surface image Ib corresponding to the side surface 12 of the workpiece 10. The top surface image Ia is a parallelogram in which two pairs of opposing sides are parallel to each other and adjacent angles are different in size.
[0067] (Extraction process) 2 is executed after the second step S102 is executed. The third step S103 is a step of extracting a top surface image Ia from the captured image I. The third step S103 is executed by the extraction unit 43 of the image processing unit 41.
[0068] In Fig. 6, the top surface image Ia is a high brightness area where the V value exceeds the threshold value Th, and the side surface image Ib is a low brightness area where the V value is below the threshold value Th. Then, the high brightness area in the captured image I is determined to be the top surface image Ia of the workpiece 10, and a process is performed to erase the side surface image Ib, which is a low brightness area. Since only the top surface image Ia remains by this process, an extracted image Ic (see Fig. 7) including the top surface image Ia is obtained.
[0069] In addition, in a third step S103, the extraction unit 43 detects the top surface image Ia as well as the H value and S value of the top surface image Ia, and temporarily stores them in the storage unit 46. The H value and S value of the top surface image Ia at this time are used in a process of determining whether or not the workpiece 10 is the correct color in a sixth step S106 described later.
[0070] As shown in FIG. 7, the plurality of workpieces 10 includes a plurality of first workpieces 10A, a plurality of second workpieces 10B, and a third workpiece 10C.
[0071] The first workpieces 10A are attached to the box member 1 in a state in which the first edges 13, which are the short sides of the upper surfaces 11, are arranged along the first arrangement line M1. Therefore, in the extracted image Ic, an edge line image Ic1 corresponding to the first edges 13 is also formed to be aligned along the first arrangement line M1.
[0072] The second workpieces 10B are attached to the box member 1 with their second edges 14, which are the long sides perpendicular to the first edge 13 of their upper surfaces 11, arranged along a second arrangement line M2 perpendicular to the first arrangement line M1. Therefore, in the extracted image Ic, an edge line image Ic2 corresponding to the second edges 14 is also formed along the second arrangement line M2. The second workpieces 10B, one vertex of which is located at the intersection C of the first arrangement line M1 and the second arrangement line M2, also belong to the first workpiece 10A.
[0073] The third workpiece 10C is attached to the box member 1 in a state in which the first edge 13 of the upper surface 11 is disposed away from the first arrangement line M1 and the second edge 14 of the upper surface 11 is disposed away from the second arrangement line M2. In other words, the third workpiece 10C does not belong to either the first workpiece 10A or the second workpiece 10B.
[0074] (Image rotation processing) 2 is a step of performing an image rotation process on the extracted image Ic obtained in the third step S103. This fourth step S104 is executed by the image correction unit 44 of the image processing unit 41.
[0075] In the coordinate system of the extracted image Ic shown in Fig. 7, the inclination angle α of the first array line M1 with respect to the first reference line N1 extending in the second direction Y, which is the Y-axis direction, is obtained. Then, the entire extracted image Ic is rotated by α degrees around the intersection C of the first array line M1 and the second array line M2 so that the first array line M1 overlaps the first reference line N1. With this rotation, both the first reference line N1 and the second array line M2 rotate by α degrees around the intersection C. According to the fourth step S104, a first corrected image Id as shown in Fig. 8 is obtained.
[0076] (Image transformation processing) 2 is a step of performing an image transformation process on the first corrected image Id obtained in the fourth step S104. This fifth step S105 is executed by the image corrector 44 of the image processor 41.
[0077] In the coordinate system of the first corrected image Id shown in Fig. 8, the inclination angle β of the second array line M2 with respect to the second reference line N2 extending in the first direction X, which is the X-axis direction, is obtained. Then, while the first array line M1 is kept fixed, the second array line M1 is rotated by β degrees around the intersection point C until it overlaps with the second reference line N2, thereby deforming the entire first corrected image Id. This type of image deformation processing is generally called "skew (shear processing)".
[0078] According to the fifth step S105, the extracted image Ic is deformed so that the angle between the first arrangement line M1 and the second arrangement line M2 becomes a right angle, thereby obtaining a second corrected image Ie as shown in Fig. 9. The first corrected image Id is compressed into the second corrected image Ie, thereby converting the shape of the top surface image Ia from a parallelogram (a parallelogram in which two pairs of opposing sides are parallel and the sizes of two adjacent angles are different) to a rectangle. Therefore, even though the workpiece 10 is photographed in an inclined position, an image of the same shape as when the workpiece 10 is photographed in a horizontal position can be obtained.
[0079] As described above, the processing from the fourth step S104 to the fifth step S105 is generally processing for correcting the coordinate system of the extracted image Ic so that the first array line M1 and the second array line M2 form a rectangular coordinate and this rectangular coordinate overlaps with the rectangular coordinate of the master image Im.
[0080] (Work judgment processing) 2 is a step of determining the arrangement state of the workpiece 10 corresponding to the top surface image Ia by comparing the second corrected image Ie obtained in the fifth step S105 with a master image Im stored in advance in the storage unit 46. This sixth step S106 is executed by the workpiece determination unit 45 of the image processing unit 41.
[0081] Here, the master image Im will be described.
[0082] 10, the master image Im is an image of a state in which a plurality of workpieces 10 are mounted in normal positions (i.e., positions where they are planned to be mounted) on the box member 1. This master image Im is based on the assumption that the workpieces 10 will be mounted in a horizontal posture at all positions among positions 1 to 7 except for position 2. For this reason, only top surface images Ia corresponding to the top surfaces 11 of each workpiece 10 are arranged in the master image Im, and each top surface image Ia has a rectangular shape.
[0083] The master image Im may be a photographed image obtained by actually photographing the workpiece 10 and the box member 1 using the photographing unit 20 of the inspection device 101, or it may be an image created to imitate the workpiece 10 and the box member 1 using image creation software or the like.
[0084] 11, the XY coordinates of each position when the reference point D is set as the origin in the plane rectangular coordinate system of the master image Im, the presence or absence of the workpiece 10 at each position, and the correct color of the workpiece 10 at each position are registered. For example, position 1 has XY coordinates of (X1, Y1), is the planned mounting position of the workpiece 10 in the box member 1, and the color of the workpiece 10 to be mounted in the box member 1 is yellow. Moreover, position 2 has XY coordinates of (X1, Y2), and is the planned mounting position of the workpiece 10 in the box member 1.
[0085] In a sixth step S106, the coordinates of the top surface image Ia contained in the second corrected image Ie in Figure 9 are compared with the coordinates of the top surface image Ia pre-registered in the master image Im in Figure 10 to first determine whether the position of each work 10 is correct or not (hereinafter referred to as the "first determination process").
[0086] In this embodiment, the top surface image Ia of the master image Im is disposed at all positions among positions 1 to 7 except position 2, whereas the top surface image Ia included in the second corrected image Ie is similarly detected at all positions among positions 1 to 7 except position 2. For this reason, in the first determination process, the position of each workpiece 10 is determined to be correct. On the other hand, if the top surface image Ia of the second corrected image Ie is detected at position 2, it is determined that the position of the workpiece 10 corresponding to this top surface image Ia is incorrect.
[0087] Next, it is determined whether the color of the workpiece 10 corresponding to each top surface image Ia in the second corrected image Ie is correct (hereinafter referred to as "second determination process"). This second determination process is performed by reading out the H value and S value of the top surface image Ia of the extracted image Ic stored in the third step S103 from the storage unit 46 and comparing them with the H value and S value of the top surface image Ia registered in advance in the master image Im. At this time, since the H value and S value are those of the top surface image Ia of the workpiece 10 (the photographed image I from which the side surface image Ib has been deleted), as described in FIG. 4, even colors with similar hues (for example, light blue and purple) can be clearly distinguished.
[0088] For example, when the correlation between the H value and the S value of the top surface image Ia at the first position in the second corrected image Ie matches the correlation between the H value and the S value of the top surface image Ia at the first position in the master image Im (yellow region of the distribution in FIG. 4), it is determined that the color of the workpiece 10 actually placed at the first position is yellow and is the correct color. On the other hand, when the correlation between the H value and the S value of the top surface image Ia at the first position in the second corrected image Ie differs from the correlation between the H value and the S value of the top surface image Ia at the first position in the master image Im (yellow region of the distribution in FIG. 4), it is determined that the color of the workpiece 10 actually placed at the first position is a color other than yellow and is not the correct color (i.e., a workpiece 10 of a different color is placed at the first position).
[0089] In the first judgment process and the second judgment process, if the judgment results are both correct, the inspection result of the workpiece 10 is "pass", and if the judgment result is that at least one of them is incorrect, the inspection result of the workpiece 10 is "fail." At this time, the workpiece judgment unit 45 of the image processing unit 41 transmits an output instruction signal to the output unit 47 to output the inspection result of the workpiece 10.
[0090] The order of the first determination process and the second determination process is not particularly limited, and the second determination process may be performed before the first determination process.
[0091] Next, the effects of the above-mentioned embodiment 1 will be described.
[0092] In the first embodiment, the work 10 attached to the box member 1 is photographed by the photographing unit 20 for inspection. When the work 10 is attached to the box member 1, the multiple exposed surfaces 11, 12 are the same color, and therefore, among the multiple exposed surfaces 11, 12, the top surface 11 has a higher V value (brightness) than the side surface 12. Therefore, by utilizing the brightness difference between the V value of the top surface 11 of the work 10 and the V value of the side surface 12, it is possible to determine a high brightness region in the photographed image I obtained by the photographing unit 20 where the V value exceeds a threshold value Th as the top surface image Ia of the work 10.
[0093] This makes it possible to extract only the top surface image Ia of the work 10 separately from the side surface image Ib, not only when the work 10 is photographed in a horizontal position with the box member 1 placed horizontally, but also when the work 10 is photographed from an oblique direction with the box member 1 placed tilted and tilted from the horizontal position. As a result, it becomes possible to accurately detect the mounting position of the work 10 using the extracted top surface image Ia. At this time, by preventing erroneous determination that the side surface image Ib of the work 10 is the top surface image Ia of another work 10, it is possible to suppress a decrease in the inspection accuracy in the image inspection of the work 10.
[0094] Therefore, according to the first embodiment, it is possible to provide a work inspection technique that is effective for performing image inspection of the work 10 with high accuracy.
[0095] According to the first embodiment, by applying the master image Im to the extracted image Ic including the extracted top surface image Ia, it becomes possible to accurately determine the arrangement state of the workpiece 10. In particular, the coordinate system of the extracted image Ic is corrected based on the first arrangement line M1 relating to the arrangement of the multiple first workpieces 10A and the second arrangement line M2 relating to the arrangement of the multiple second workpieces 10B. Then, the coordinates of the top surface image Ia included in the second corrected image Ie obtained through the first corrected image Id are compared with the coordinates of the top surface image Ia of the master image Im. At this time, by comparing the second corrected image Ie and the master image Im with each other regarding the coordinates of the top surface image ia, it becomes possible to accurately determine whether the position of the workpiece 10 is correct or not.
[0096] According to the first embodiment, by comparing the H value and the S value of the top surface image Ia between the extraction image Ic and the master image Im, it becomes possible to accurately determine whether or not the color of the workpiece 10 is correct.
[0097] According to the first embodiment, by irradiating the illumination light L of the illumination unit 30 toward the workpiece 10 from one direction, the brightness difference between the brightness of the upper surface 11 and the brightness of the side surface 12 of the workpiece 10 can be made larger than in the case of using shadowless lighting that irradiates the illumination light L from multiple directions. This makes it possible to improve the extraction accuracy when extracting the upper surface image Ia from the captured image I.
[0098] The first embodiment is particularly effective in the case where the work 10 is an in-vehicle relay and the box member 1 is a relay box to which the relay is attached, for the following reasons. That is, since the relay box is likely to be tilted in the returnable box B due to the influence of the wire harness 3, in order to image-inspect the relay in a horizontal position, it is necessary to take the relay box out of the returnable box B and to return the relay box to the returnable box B after the image inspection. In contrast, by adopting the first embodiment, it is possible to perform image inspection of the relay while the relay box is still housed in the returnable box B. As a result, it is possible to reduce the manpower required for taking the relay box in and out, and it is also effective in completely reducing the manpower required for image inspection of the relay and transporting the relay box.
[0099] Hereinafter, other embodiments related to the above-mentioned embodiment 1 will be described with reference to the drawings. In the other embodiments, the same elements as those in embodiment 1 are given the same reference numerals, and the description of the same elements will be omitted.
[0100] (Embodiment 2) 12, the inspection device 102 of the second embodiment includes an image processing unit 41A that is different from the image processing unit 41 of the first embodiment. The image processing unit 41A includes a vector calculation unit 44A that replaces the image correction unit 44 of the first embodiment, and a work judgment unit 45A that performs processing different from that of the work judgment unit 45 of the first embodiment.
[0101] The vector calculation unit 44A is configured to calculate a position vector of the top surface image Ia in the coordinate system of the extracted image Ic. The work determination unit 45A is configured to determine whether the position of the workpiece 10 is correct by comparing the unit vector coefficient of the position vector obtained by the vector calculation unit 44A with the unit vector coefficient registered in advance for the top surface image Ia in the coordinate system of the master image Im.
[0102] The other configurations are the same as those in the first embodiment.
[0103] In the inspection method of embodiment 2, the image processing unit 41A sequentially executes multiple steps for image processing (the first step S201 to the sixth step S206) based on the captured image I obtained by the imaging unit 20 in accordance with the processing flow shown in FIG. 13.
[0104] It should be noted that the processing from the first step S201 to the second step S203 is the same as the processing from the first step S101 to the second step S103 in the first embodiment, and therefore the description thereof will be omitted.
[0105] (Position vector calculation processing) 13 is a step of calculating a position vector of the top surface image Ia included in the extracted image Ic obtained in the third step S203. This fourth step S204 is executed by the vector calculation unit 44A of the image processing unit 41A.
[0106] 14, it is assumed that, with the intersection point C as the origin, a unit vector X extends along the second arrangement line M2 parallel to the second edge 14, and a unit vector Y extends along the first arrangement line M1 parallel to the first edge 13. In this case, a position vector P at the center of gravity of each top image Ia is expressed by an arithmetic expression in which the product of an arbitrary coefficient m and the unit vector X is added to the product of an arbitrary coefficient n and the unit vector Y. Therefore, by using this arithmetic expression, it is possible to calculate the position vector P of each top image Ia.
[0107] (Unit vector coefficient extraction process) 13 is a step of extracting unit vector coefficients (m, n) of the position vector P calculated in the fourth step S204 by linking them to each top image Ia. Here, the unit vector coefficient m is the coefficient of the unit vector X, and the unit vector coefficient n is the coefficient of the unit vector Y. This fifth step S205 is executed by the vector calculation unit 44A of the image processing unit 41A. According to this fifth step S205, the unit vector coefficients (m, n) for each top image Ia can be obtained.
[0108] (Work judgment processing) In a sixth step S206 in Fig. 13, first, it is determined whether or not the position of each workpiece 10 is correct by comparing the unit vector coefficient (m, n) obtained in the fifth step S205 with the unit vector coefficient (m, n) of the top surface image Ia in the master image Im shown in Fig. 15 (first determination process). Then, as in the case of the first embodiment, it is determined whether or not the color of the workpiece 10 corresponding to each top surface image Ia is correct (second determination process).
[0109] The other processes are the same as those in the first embodiment.
[0110] According to the above-mentioned second embodiment, the position vector P of the top surface image I in the coordinate system of the extracted image Ic is calculated, and the unit vector coefficient (m, n) of this position vector P is compared with the unit vector coefficient (m, n) of the top surface image Ia in the coordinate system of the master image Im. At this time, by comparing the extracted image Ic and the master image Im with each other in terms of the unit vector coefficient (m, n), it becomes possible to determine with a simple process and with high accuracy whether the position of the workpiece 10 is correct or not.
[0111] In addition, the same effects as those of the first embodiment are achieved.
[0112] The present invention is not limited to the above-described embodiments, and various applications and modifications are possible without departing from the scope of the present invention. For example, the following embodiments may be applied to the present invention.
[0113] In the above embodiment, an example was given of a case in which the top surface image Ia extracted from the captured image I based on the V value and the threshold value Th is used to determine the placement state of the workpiece 10, but instead, the top surface image Ia can also be used to determine only the presence or absence of the workpiece 10.
[0114] In the above-described embodiment, an example has been given of a case in which the placement state of the workpiece 10 is judged by both judging whether the position of the workpiece 10 is correct (first judgment process) and judging whether the color of the workpiece 10 is correct (second judgment process). However, if necessary, either one of the first judgment process or the second judgment process can be omitted.
[0115] In the above-described embodiment, an example was given of a case in which illumination light L is irradiated in one direction toward the workpiece 10 from the irradiation surface 31 of the illumination unit 30. However, provided that the desired top surface image Ia can be accurately extracted from the captured image I, a structure in which illumination light L is irradiated toward the workpiece 10 from multiple directions, or a structure in which the illumination unit 30 itself is omitted by using indoor lighting, for example, may be adopted instead.
[0116] In the above embodiment, the work 10 is an in-vehicle relay, but the above embodiment can be applied to a technique for image inspection of a work 10 other than a relay as long as it has multiple exposed surfaces. In this case, the shape of the top surface 11 of the work 10 may be other than rectangular.
[0117] In the above embodiment, an example was given of a case in which image inspection of the work 10 attached to the box member 1 is performed while the box member 1 remains housed in the commuter box B. However, instead, when the commuter box B is not used, it is of course possible to perform image inspection of the work 10 with the box member 1 placed directly on the inspection table. [Explanation of symbols]
[0118] 1 Box member 2 Installation opening 10 Work 10A First work (work) 10B 2nd Work (Work) 11 Top surface (exposed surface) 12 Side (exposed surface) 13 First Edge 14 Second Edge 20. Photography Department 30 Lighting Department 31 Irradiation surface 41, 41A Image processing unit 43 Extraction part 44 Image correction section 44A Vector Calculation Unit 45,45A Work Judgment Unit 101, 102 Work inspection device (inspection device) A Aperture plane H value Hue I. Photographed image Ia top view Ic Extracted Image Ie 2nd corrected image (corrected image) Im Master Image L illumination light m,n unit vector coefficients M1 1st Array Line M2 2nd Array Line P position vector S value Saturation V value Lightness
Claims
1. A work inspection device that inspects a work mounted in a box member through a mounting opening, The workpiece has a plurality of exposed surfaces, the plurality of exposed surfaces being the same color; An imaging unit that images the workpiece; an image processing unit that processes the captured image obtained by the imaging unit; Equipped with The image processing unit is a work inspection device that has an extraction unit that, when the surface among the multiple exposed surfaces of the work that is closest to the mounting opening of the box member is defined as the top surface of the work, uses a threshold value set between the brightness of the top surface and the brightness of exposed surfaces other than the top surface to extract high-brightness areas in the captured image whose brightness exceeds the threshold value as a top surface image of the work.
2. The work inspection device of claim 1, wherein the image processing unit has a work judgment unit that judges the placement state of the work corresponding to the top surface image based on an extracted image including the top surface image extracted by the extraction unit and a master image in which the multiple works are attached in their correct positions in the box member.
3. The shape of the top surface of the workpiece is a rectangle with all four corners being equal, and the plurality of workpieces include a plurality of first workpieces attached to the box member with a first edge of the top surface arranged along a first arrangement line, and a plurality of second workpieces attached to the box member with a second edge of the top surface perpendicular to the first edge arranged along a second arrangement line perpendicular to the first arrangement line, the image processing unit has an image correction unit that corrects a coordinate system of the extracted image so that the first array line and the second array line form a rectangular coordinate system and the rectangular coordinate system overlaps with the rectangular coordinate system of the master image; The work inspection device of claim 2, wherein the work judgment unit is configured to judge whether the position of the work is correct or not by comparing the coordinates of the top surface image contained in the corrected image obtained by the image correction unit with the coordinates of the top surface image pre-registered in the master image.
4. the image processing unit has a vector calculation unit that calculates a position vector of the top surface image in a coordinate system of the extracted image, 3. The work inspection device according to claim 2, wherein the work judgment unit is configured to judge whether the position of the work is correct or not by comparing the unit vector coefficient of the position vector obtained by the vector calculation unit with a unit vector coefficient registered in advance for the top surface image in the coordinate system of the master image.
5. A work inspection device as described in claim 3 or 4, wherein the work judgment unit is configured to judge whether the color of the work is correct by comparing the hue and saturation of the top surface image of the extracted image with the hue and saturation of the top surface image pre-registered in the master image.
6. 6. The work inspection device according to claim 1, further comprising an illumination unit having an illumination surface arranged parallel to an opening plane of the mounting opening of the box member, the illumination unit being configured to irradiate illumination light in one direction from the illumination surface towards the work.
7. A work inspection method for inspecting a work mounted in a box member through a mounting opening, comprising: The workpiece has a plurality of exposed surfaces, the plurality of exposed surfaces being the same color; The above workpiece is photographed by the photography section, A work inspection method in which, when the surface among the multiple exposed surfaces of the work that is closest to the mounting opening of the box member is defined as the top surface of the work, a threshold value is set between the brightness of the top surface and the brightness of exposed surfaces other than the top surface, and a high-brightness area whose brightness exceeds the threshold value is extracted from the captured image obtained by the photographing unit as an image of the top surface of the work.
8. The work inspection method according to claim 7, further comprising determining the positioning state of the work corresponding to the top surface image based on an extracted image including the extracted top surface image and a master image in which the multiple workpieces are attached in their correct positions in the box member.
9. The shape of the top surface of the workpiece is a rectangle with all four corners being equal, and the plurality of workpieces include a plurality of first workpieces attached to the box member with a first edge of the top surface arranged along a first arrangement line, and a plurality of second workpieces attached to the box member with a second edge of the top surface perpendicular to the first edge arranged along a second arrangement line perpendicular to the first arrangement line, The work inspection method described in claim 8, further comprising correcting the coordinate system of the extracted image so that the first array line and the second array line form rectangular coordinates and the rectangular coordinates overlap with the rectangular coordinates of the master image, and determining whether the position of the work is correct by comparing the coordinates of the top surface image contained in the corrected image obtained by the correction with the coordinates of the top surface image pre-registered in the master image.
10. 9. The workpiece inspection method according to claim 8, further comprising the steps of: calculating a position vector of the top surface image in the coordinate system of the extracted image; and comparing a unit vector coefficient of the position vector obtained by the calculation with a unit vector coefficient registered in advance for the top surface image in the coordinate system of the master image, thereby determining whether or not the position of the workpiece is correct.
11. A work inspection method as described in claim 9 or 10, in which the hue and saturation of the top surface image of the extracted image are compared with the hue and saturation of the top surface image pre-registered in the master image to determine whether the color of the work is correct.
12. A work inspection method according to any one of claims 7 to 11, wherein, when the photographing unit photographs the work, illumination light is irradiated in one direction toward the work from an irradiation surface arranged parallel to an opening plane of the mounting opening of the box member.
Citation Information
Patent Citations
Inspection device, inspection method and program
JP2018200328A
Binarization processing program and binarization processing method in image inspection
JP2019008578A
Image processing system
JP2019095984A
Defect inspection device, defect inspection method, and program thereof
JP2019159889A
Method and system for improving ability of a machine vision system to discriminate features of a target
US20030161524A1
