Shape inspection method
The shape inspection method addresses the challenge of varying inclinations by using a fixed camera setup with tilt correction and hybrid defect detection, enabling efficient and accurate automation for resin molded products.
Patent Information
- Application Number
- JP2024078185
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-05-13
- Publication Date
- 2025-11-26
AI Technical Summary
Existing shape inspection methods struggle with inspecting workpieces that have multiple inspection areas with different inclinations relative to a reference plane, requiring multiple cameras and dedicated 3D measuring devices with different installation directions, which hinders automation and increases labor requirements.
A shape inspection method that uses a three-dimensional measuring device with a fixed camera installation direction, combined with an image processing device that performs tilt correction and defect judgment using a hybrid method of non-defective and self-master subtraction algorithms to ensure accurate inspection across varying inclinations.
Enables general-purpose automatic inspection by fixing the camera installation direction, reducing setup work, and accurately detecting both large and small defects without erroneous detections, suitable for complex resin molded products.
Smart Images

Figure 2025172591000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to a shape inspection method. [Background technology]
[0002] 2. Description of the Related Art Conventionally, a shape inspection method is known in which the surface shape of an inspected portion of a workpiece is inspected based on data captured by a camera.
[0003] For example, the three-dimensional shape inspection method disclosed in Patent Document 1 includes a process of determining the difference in a predetermined direction between the position of the surface of the workpiece and the position of the surface of a good product by comparing measurement data of the three-dimensional shape of the surface of the workpiece (object) with data on a good product, and a process of determining whether or not there is a shape defect in the workpiece. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] Japanese Patent Publication No. 2020-51762 Summary of the Invention [Problem to be solved by the invention]
[0005] In the embodiment disclosed in Figure 1 of Patent Document 1, the flat area of the recessed surface of a workpiece placed on a base (table) is the part to be inspected. The camera is installed directly above the workpiece with its optical axis perpendicular to the surface to be inspected (surface of the part to be inspected). However, depending on the shape of the workpiece, the surface to be inspected may be tilted relative to a reference plane such as the base, but Patent Document 1 does not mention how to deal with such cases.
[0006] In particular, when the workpiece is a resin molded product formed using a molding die, three-dimensional shape inspection can be difficult due to the fact that the part to be inspected may contain curved or uneven surfaces, and molding variations may occur. Conventionally, a method has been used to inspect multiple items by combining flat surface inspection (two-dimensional measurement) using a 2D camera and height inspection using a three-dimensional measuring device. To ensure inspection accuracy, the 2D camera and the camera of the three-dimensional measuring device are installed so that the optical axis is perpendicular to the surface of each part to be inspected.
[0007] Therefore, when inspecting a workpiece that has multiple inspection areas with different inclinations of the inspection surface relative to the reference plane, it is necessary to install multiple cameras at specific angles and positions for each inspection area.In addition, a dedicated 3D measuring device with a different camera installation direction is required for each type of workpiece, which requires setup changes and adjustment work, and has been a barrier to automation (labor reduction).
[0008] The present invention has been made in consideration of the above-mentioned problems, and its purpose is to provide a shape inspection method in which the installation direction of the camera of a three-dimensional measuring device is fixed for inspecting parts in multiple locations or multiple types of workpieces whose inspected surfaces have different inclinations relative to a reference plane. [Means for solving the problem]
[0009] In the shape inspection method of the present invention, a three-dimensional image including information on the surface shape of the inspected portion (T1 to T3) of the workpiece (W) in the height (Z) direction perpendicular to the reference plane as well as two-dimensional information in the direction parallel to the reference plane is captured by a camera (3) of a three-dimensional measuring device (30). The inspection image captured by the camera is processed by an image processing device (5).
[0010] The image processing device has a tilt correction unit (51) that corrects the inspection image captured by the camera to an image viewed from a direction perpendicular to the inspection surface based on the tilt angle (θ) between the inspection surface (St), which is the surface of the inspection part, and an optical axis perpendicular plane (Scv) that is perpendicular to the optical axis (Ac) of the camera. The image processing device inspects the surface shape of the inspection part using the inspection image corrected by the tilt correction unit.
[0011] This makes it possible to fix the installation direction of the camera of the coordinate measuring device while ensuring inspection accuracy for multiple parts to be inspected and multiple types of workpieces with different inclinations of the inspected surface relative to the reference plane. Therefore, it is possible to use a common installation direction for the camera for multiple parts to be inspected and to share the same coordinate measuring device for multiple types of workpieces. Since there is no need for setup or adjustment work, general-purpose automatic inspection using the coordinate measuring device can be realized.
[0012] However, in order to put general-purpose automatic inspection of resin molded products and the like into practical use, it is necessary to establish an appropriate measurement algorithm so that minute differences in the range of variation from the master image are not erroneously detected as defects.
[0013] Therefore, in the shape inspection method of the present invention, the image processing device preferably has an image comparison and judgment unit (52) that judges the presence or absence of defects in the inspected portion based on a difference image between the inspection image and the master image. The image comparison and judgment unit judges the presence or absence of defects in the inspected portion by a "non-defective master difference method" that uses a predetermined non-defective master image as the master image.
[0014] More preferably, the image comparison and judgment unit performs expansion and contraction processing on the binarized black-and-white inspection image based on the height information of the inspected part to create a self-master image for each inspected part, and further executes a "self-master subtraction method" using the self-master image as the master image. The image processing device judges the presence or absence of defects in the inspected part by using both the good product master subtraction method and the self-master subtraction method in combination.
[0015] The non-defective master subtraction method can correctly detect large defects, but it cannot correctly detect small defects below the variation range while preventing false detection of variations. The self-master subtraction method can correctly detect small defects by removing noise through expansion and contraction processing, but it cannot handle large defects. Therefore, the image processing device can properly detect both large and small defects by using a hybrid method that combines the non-defective master subtraction method and the self-master subtraction method. [Brief explanation of the drawings]
[0016] [Figure 1] FIG. 1 is a diagram showing the configuration of a system for implementing a shape inspection method according to an embodiment. [Figure 2] FIG. 1 is a diagram of an example of an inspected part of a workpiece (a snap-fit part of a resin molded product). [Figure 3] 1A to 1C are schematic diagrams illustrating a shape inspection method according to an embodiment. [Figure 4] 4A and 4B are diagrams of the inspection target part as viewed from the IVa and IVb directions in FIG. 3. [Figure 5] FIG. 10 is a schematic diagram showing a shape inspection method of a comparative example. [Figure 6] FIG. 10 is a diagram illustrating tilt correction. [Figure 7] FIG. 10 is a diagram illustrating a non-defective master difference method. [Figure 8] FIG. 10 is a diagram illustrating the self-master difference method. [Figure 9] 10 is a flowchart of the tilt correction and non-defective master difference method. [Figure 10] Flowchart of the self-master differential method. DETAILED DESCRIPTION OF THE INVENTION
[0017] (One embodiment) A shape inspection method according to one embodiment of the present invention will be described with reference to the drawings. In this shape inspection method, a three-dimensional image of the surface shape of the inspected portion of the workpiece is captured by a camera of a three-dimensional measuring device, and the inspection image captured by the camera is processed by an image processing device. Here, a "three-dimensional image" refers to an image that includes information in the height direction perpendicular to the reference plane in addition to two-dimensional information in a direction parallel to the reference plane.
[0018] Figure 1 shows the system configuration for carrying out a shape inspection method according to one embodiment. This inspection system includes a three-dimensional measuring device 30 and an image processing device 5, and an inspection image of a workpiece W captured by a camera 3 of the three-dimensional measuring device 30 is processed by the image processing device 5. The XY plane, which is the top surface of the base 1, is used as the reference plane, and the direction perpendicular to the reference plane is used as the height (Z) direction. The workpiece W placed on the base 1 is moved in the X or Y direction by a single-axis loader (conveyor).
[0019] A three-dimensional measuring device 30 having a camera 3 is provided above the workpiece W in the height (Z) direction. The three-dimensional measuring device 30 shown in FIG. 1 is a system having one camera 3 and a light source 4. With this system, the height Z of the workpiece W is calculated based on the difference between the time t1 it takes for light emitted by the light source 4 to reflect off the top surface of the workpiece W and reach the camera 3, and the time t2 it takes for the light to reflect off the top surface of the base 1 and reach the camera 3, as well as the light reflection angle α. In other words, if the speed of light is c (m / sec), the height Z can be calculated from the following relationship:
[0020] Z cosα=c(t2-t1)
[0021] 1, the camera 3 is shown tilted relative to the reference plane merely for the sake of convenience in explaining the principle of this type of three-dimensional measuring device 30. As shown in FIG. 3, in this embodiment, the camera 3 may be installed so that the optical axis Ac is perpendicular to the base 1. Furthermore, as will be described later in the "Other Embodiments" section, a stereo type three-dimensional measuring device that does not use a light source or a structured illumination type three-dimensional measuring device may also be applied.
[0022] The three-dimensional measuring device 30 captures a three-dimensional image including two-dimensional information in the X and Y directions parallel to the reference plane as well as information in the Z direction perpendicular to the reference plane. The image processing device 5 is composed of a PC or the like. The image processing device 5 inspects the shape of the inspected portion of the workpiece W based on the three-dimensional image of the workpiece W acquired from the three-dimensional measuring device 30.
[0023] The image processing device 5 includes a tilt correction unit 51 and an image comparison and judgment unit 52. As will be described in detail later, the tilt correction unit 51 corrects the inspection image of the inspection surface that is tilted with respect to a reference surface. The image comparison and judgment unit 52 judges whether or not there is a defect in the inspection portion based on a difference image between the inspection image and the master image.
[0024] 2 to 4 show examples of the shape of the workpiece W to which this embodiment is applied. This workpiece W is a resin molded product formed using a molding die. For example, resin parts such as heater cases and blower cases used in automotive air conditioning systems are molded using a multi-cavity molding die. In general, resin molded products have more curved and uneven surfaces and are more complex in shape than machined metal products. In addition, shape variations are likely to occur due to factors such as the drying conditions and molding conditions of the resin material.
[0025] As shown in Figures 2 and 3, the workpiece W has an approximately rectangular outer shape when projected onto a reference plane. Snap-fit portions are formed as inspection points T1, T2, and T3 at three locations on each side of the workpiece W that sandwich the symmetry axis M extending in the longitudinal direction. The snap-fit portions are made up of an outer frame with a rectangular opening on the inside. The snap-fit portions are used to assemble parts by engaging with the claws of a mating part through elastic deformation.
[0026] If a snap fit has molding defects such as insufficient filling of material, sink marks, chipping, or contamination with foreign matter, or if part of the shape is damaged due to impacts received during transportation after molding, the engaging function will be impaired. Therefore, to ensure quality, it is necessary to inspect all snap fit parts to ensure that the shape is normal.
[0027] For the inspected part T2 in Figure 3, the tilt angle θ between the inspected surface St, which is the surface of the inspected part, and the optical axis perpendicular plane Scv, which is perpendicular to the optical axis Ac of the camera 3, is shown. In this example, the optical axis Ac of the camera 3 is oriented in the Z direction, which is perpendicular to the reference plane. The tilt angles of the inspected parts T1, T2, and T3 are different from one another. The tilt angles of the inspected parts T1 and T3 on both sides are relatively small, while the tilt angle of the inspected part T2 in the middle is relatively large.
[0028] The shape of the inspected portion T2 viewed from the Z direction (direction IVa in FIG. 3) is shown in FIG. 4(a). The shape of the inspected portion T2 viewed from a direction perpendicular to the inspected surface St (direction IVb in FIG. 3) is shown in FIG. 4(b). FIGS. 4(a) and 4(b) will be referred to in the explanation of tilt correction with reference to FIG. 6. Note that the surface appearing in front of FIG. 4(b) is not necessarily a plane in the strict sense, but is treated as an approximation of a plane.
[0029] FIG. 5 shows a comparative example of a conventional shape inspection method. In the comparative example, multiple inspection items are inspected by combining a planar inspection (two-dimensional measurement) using a 2D camera and a height inspection using a three-dimensional measuring device. To ensure inspection accuracy, in the two-dimensional measurement, a 2D camera 21 is installed so that its optical axis Ac1 is perpendicular to the surface to be inspected of the inspection target part T1, and a 2D camera 22 is installed so that its optical axis Ac2 is perpendicular to the surface to be inspected of the inspection target part T2. Note that the inspection target part T3 is omitted. A dedicated light source 4 is provided for each of the inspection target parts T1 and T2. In the three-dimensional measurement, a camera 3 is also installed so that its optical axis Ac3 is perpendicular to the surface to be inspected.
[0030] As described above, the shape inspection method of the comparative example requires multiple cameras to be installed at specific angles and positions for each part to be inspected, which has a different inclination of the surface to be inspected. Also, a dedicated 3D measuring device with a different camera installation direction is required for each type of workpiece, which requires setup changeover and adjustment work, and is an obstacle to automation (labor reduction).
[0031] In contrast, the shape inspection method of this embodiment aims to inspect multiple inspection target parts T1, T2, and T3 using only a three-dimensional measuring device 30 with a fixed installation direction of the camera 3. Therefore, attention is focused on correcting the tilt of the inspection target surface by utilizing height Z information obtained by the three-dimensional measuring device.
[0032] Tilt correction will be explained with reference to Figure 6. The horizontal axis of the figure indicates the coordinate in the X or Y direction of the reference plane, and the vertical axis indicates the height Z. The image of the inspected part T2 before correction (upper row) viewed from above the paper corresponds to the "inspection image captured by the camera" shown in Figure 4(a). The image of the inspected part T2 after correction (lower row) viewed from above the paper corresponds to the "image viewed from a direction perpendicular to the inspected surface St" shown in Figure 4(b).
[0033] In the diagram of the correction process (middle), the plane perpendicular to the camera's optical axis Ac is referred to as the optical axis perpendicular plane Scv. The tilt correction unit 51 corrects the "inspection image captured by the camera" to "an image viewed from a direction perpendicular to the inspection surface St" based on the tilt angle θ between the inspection surface St and the optical axis perpendicular plane Scv. For example, the width of the outer frame of the snap-fit portion is corrected from L before correction to (L / cosθ) after correction. The image processing device 5 inspects the surface shape of the inspection portion T2 using the inspection image corrected by the tilt correction unit 51.
[0034] In the shape inspection method of this embodiment, instead of installing the camera of the three-dimensional measuring device perpendicular to each inspected part as in the comparative example, the inspection image captured by the camera with a fixed installation direction is corrected to "an image viewed from a direction perpendicular to the inspected surface St." This makes it possible to fix the installation direction of the camera 3 of the three-dimensional measuring device 30 while ensuring inspection accuracy. Therefore, it is possible to use a common installation direction for the camera for multiple inspected parts and to share the same three-dimensional measuring device for multiple types of workpieces. Since there is no need for setup or adjustment work, general-purpose automatic inspection using a three-dimensional measuring device is realized.
[0035] Next, with reference to Figs. 7 to 10, an algorithm for determining the presence or absence of defects in the inspected portion by the image comparison and determination unit 52 of the image processing device 5 will be described. As described above, the image comparison and determination unit 52 determines the presence or absence of defects in the inspected portion based on the difference image between the inspection image and the master image. In Figs. 7 and 8, the inspection image, master image, and difference image are represented as black and white inspection images binarized based on height information of the inspected portion. In the shape inspection method of this embodiment, a "good product master difference method" that uses a good product master image as the master image and a "self master difference method" that uses a self master image as the master image are used in combination.
[0036] In the non-defective master difference method shown in Figure 7, the image comparison and judgment unit 52 uses a predefined non-defective master image as the master image. In the non-defective master image, the width and position of the outer frame of the snap-fit portion are defined by a single representative value. Due to variations in the width and position of the outer frame of each workpiece W, the difference from the representative value of the non-defective master image appears in the difference image as, for example, a thin, linear "slight difference."
[0037] Here, (a) a large defect Db is exemplified as a state in which a portion of the outer frame is completely missing and the framework is torn. In the difference image, the area of the large defect Db is significantly larger than the area of the variation portion. Therefore, by setting the maximum value of the area of the variation portion as the threshold, the image comparison and judgment unit 52 can detect the large defect Db without erroneously detecting variations equivalent to small differences.
[0038] (b) An example of a small defect Ds is a defect in which a depression occurs midway along one side while maintaining the outer frame. In the difference image, the area of the small defect Ds is approximately the same as the area of the variation portion. If the threshold is set small enough to detect the small defect Ds, the difference in the variation range will be erroneously detected. If the threshold is set large enough to avoid erroneously detecting the difference in the variation range, the small defect Ds cannot be detected. In short, the terms "large defect" and "small defect" represent concepts of large and small that are defined based on the size of the variation range.
[0039] In the self-master difference method shown in Figure 8, the image comparison and judgment unit 52 performs expansion and contraction processing on a binarized black-and-white inspection image based on the height information of the inspection part to create a self-master image for each inspection part, and uses this as the master image. In the expansion processing, if there is even one white pixel around the target pixel, black is replaced with white to remove black noise. In the contraction processing, if there is even one black pixel around the target pixel, white is replaced with black to remove white noise. Expansion and contraction processing is well known as a processing technique for two-dimensional images, but its application to three-dimensional images containing height information has not previously been known.
[0040] In the self-master difference method, a single non-defective master image is not uniformly used for all inspected parts of the same type of workpiece W, but a self-master image is created for each inspected part, so it is not affected by variations. Therefore, (b) the image comparison and judgment unit 52 can appropriately detect small defects Ds using the difference image between the inspection image containing small defects Ds and the self-master image.
[0041] On the other hand, (a) large defects Db cannot be removed by the dilation / erosion process, and no difference is generated between the inspection image and the self-master image. Therefore, the self-master subtraction method cannot handle large defects Db.
[0042] As described above, the non-defective master subtraction method can correctly detect large defects, but it cannot correctly detect small defects that are below the variation range while preventing erroneous detection of variations. The self-master subtraction method can correctly detect small defects by removing noise through expansion and contraction processing, but it cannot handle large defects. Therefore, the image comparison and judgment unit 52 uses a hybrid method that combines the non-defective master subtraction method and the self-master subtraction method, allowing it to properly detect both large and small defects.
[0043] 9 and 10, a flow of tilt correction by the tilt correction unit 51 and a flow of determination of a difference image by the image comparison and determination unit 52 will be described. In the description of the flowcharts, the symbol "S" denotes a step.
[0044] <Tilt correction and non-defective master subtraction method> In S10 of Figure 9, an image of the inspection range (for example, the range of the snap-fit portion in Figure 2) is cut out from the entire image of the workpiece W. In S11, it is determined whether correction of the X and Y coordinates of the inspection range is necessary. If correction of the X and Y coordinates is not necessary, a NO decision is made in S11, and S12 to S15 are skipped. If correction of the X and Y coordinates is necessary, a YES decision is made in S11, and S12 to S15 are executed. In S12, pattern matching before tilt correction is performed, and based on the result, the X and Y coordinates are corrected in S13. In S14, the difference between the inspection image and the good product master image (for the image before tilt correction) is extracted. In S15, the difference value is plane-approximated.
[0045] In S21, as shown in Figure 6, plane correction processing is performed on the tilt angle θ of the XZ coordinates or YZ coordinates of the inspection image. In S22, pattern matching is performed using the tilt-corrected inspection image, and based on the results, the XY coordinates and XY angles are corrected in S23. In S24, the average Z value within the inspection range is obtained, and the Z coordinate is corrected in S25. In S26, the difference between the tilt-corrected inspection image and the good product master image (for the tilt-corrected image) is extracted. Thereafter, in S41, based on the difference, for example, the area converted from the difference is compared with a judgment threshold to determine whether or not there is a "large defect" in the inspection area.
[0046] <Self-master difference method> 10, the image of the inspection range is cut out in the same way as in the non-defective master subtraction method. Then, image processing is carried out in parallel to remove noise so as to leave the concave shape of the inspection image, and to remove noise so as to leave the convex shape of the inspection image.
[0047] In image processing that leaves a concave shape, the test image is expanded in S31K, contracted in S32K, and a self-master image is created in S33K. The reliability of the created self-master image is confirmed in S34K. In S35K, the difference between the test image and the self-master image "created to leave a concave shape" is extracted. This difference image is called the first difference image.
[0048] In image processing to preserve the convex shape, the inspection image is eroded in S31W, expanded in S32W, and a self-master image is created in S33W. The reliability of the created self-master image is confirmed in S34W. In S35W, the difference between the inspection image and the self-master image "created to preserve the convex shape" is extracted. This difference image is called the second difference image.
[0049] In S36, the first difference image and the second difference image are combined. In S42, based on the combined difference image, for example, by comparing the area converted from the difference with a determination threshold, the presence or absence of a "small defect" in the inspection area is determined.
[0050] According to the shape inspection method of this embodiment, a measurement algorithm is established by a hybrid method that combines the non-defective master subtraction method and the self-master subtraction method so that minute differences within the range of variation from the master image are not erroneously detected as defects. Therefore, this method is particularly effective for practical application of general-purpose automatic inspection of workpieces W such as resin molded products.
[0051] (Other embodiments) (1) The three-dimensional measuring device 30 is not limited to the type having one camera 3 and light source 4 (see FIG. 1). A stereo type using two cameras without a light source, or a structured illumination type three-dimensional measuring device may also be used.
[0052] (2) Even when the tilt angle θ between the inspected surface St and the optical axis perpendicular plane Scv is almost 0, the above tilt correction algorithm can be applied in the same way, assuming θ = 0 (i.e., cosθ = 1). Therefore, it is possible to achieve this without an algorithm that branches between the cases of θ = 0 and θ ≠ 0. However, in cases where the majority of the inspected surface St of the target workpiece is θ = 0, the total processing volume can be reduced by adding a conditional branching algorithm.
[0053] (3) The workpiece W to which the present invention is applicable is not limited to a resin molded product. However, the effects of the present invention are more effectively exhibited in products with relatively large shape variations than in products with high machining precision, such as metal machined products.
[0054] The present invention is not limited to the above-described embodiment, and can be embodied in various forms without departing from the spirit of the invention. [Explanation of symbols]
[0055] 30...3D measuring instrument, 3. Camera, 4. Light source, 5. Image processing device; 51. Tilt correction unit; 52. Image comparison and judgment unit; W: Workpiece, T1 to T3: Inspected part Ac: Camera optical axis, Scv: Plane perpendicular to the optical axis, St: Test surface, θ: Inclination angle.
Claims
1. A shape inspection method in which a three-dimensional image including information on the surface shape of an inspected portion (T1 to T3) of a workpiece (W) in a height (Z) direction perpendicular to the reference plane as well as two-dimensional information in a direction parallel to the reference plane is captured by a camera (3) of a three-dimensional measuring device (30), and the inspection image captured by the camera is processed by an image processing device (5), The image processing device has a tilt correction unit (51) that corrects the inspection image captured by the camera to an image viewed from a direction perpendicular to the inspection surface (St), which is the surface of the inspection part, based on the tilt angle (θ) between the inspection surface (St), which is the surface of the inspection part, and an optical axis perpendicular plane (Scv) that is perpendicular to the optical axis (Ac) of the camera, and a shape inspection method that inspects the surface shape of the inspection part using the inspection image corrected by the tilt correction unit.
2. the image processing device has an image comparison and determination unit (52) that determines whether or not there is a defect in the inspected portion based on a difference image between the inspection image and a master image, The image comparison and determination unit 2. The shape inspection method according to claim 1, wherein the presence or absence of a defect in the inspected portion is determined by a non-defective master subtraction method using a predetermined non-defective master image as the master image.
3. The image comparison and determination unit a self-master image is created for each of the inspection parts by performing expansion and contraction processing on the binarized black-and-white inspection image based on the height information of the inspection part, and a self-master difference method is further performed using the self-master image as the master image; 3. The shape inspection method according to claim 2, wherein the presence or absence of a defect in the inspected portion is determined by using both the non-defective master subtraction method and the self master subtraction method.
4. The shape inspection method according to any one of claims 1 to 3, wherein the workpiece is a resin molded product.
Citation Information
Patent Citations
Three-dimensional shape inspection device, three-dimensional shape inspection method, three-dimensional shape inspection program, and computer
JP2020051762A