Image recognition method, image recognition device, inspection method, inspection device, program, and recording medium

By capturing multiple images with varying light source positions and using a trained model to separate static and dynamic reflections, the method enhances recognition accuracy and defect inspection on complex-shaped objects.

JP2024153809AActive Publication Date: 2024-10-29CANON KK
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
JP2024123209
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-10-29
Estimated Expiration
2040-10-27

AI Technical Summary

Technical Problem

Conventional image recognition methods struggle to accurately identify reflections on objects with complex shapes, leading to reduced recognition accuracy due to reflections on the object's surface, and existing techniques are inadequate for inspecting such objects.

Method used

A method involving capturing multiple images while changing the relative positions of the object and light source, using a trained model to extract static and dynamic reflections, and removing static reflections to enhance recognition accuracy.

Benefits of technology

Enables accurate identification and removal of reflections on complex-shaped objects, improving the precision of defect inspection by distinguishing between reflections and defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024153809000001_ABST
    Figure 2024153809000001_ABST
Patent Text Reader

Abstract

To provide an image recognition method capable of accurately identifying the reflection on an object from among captured images, even when an object having a complicated shape is captured.SOLUTION: An image recognition method is characterized in that a plurality of images is captured with a camera while changing the relative position between an object and a light source, the plurality of images are input to a trained model, then a static reflection image reflected on the object is extracted from the plurality of images, the extracted static reflection image is removed from the plurality of images, and a dynamic reflection image whose position changes when the relative positions between the object and the light source is changed is extracted from the plurality of images.SELECTED DRAWING: Figure 4
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to an image recognition method for recognizing, from an image of an object captured, illumination light or the like reflected on the object, and further to an inspection method for inspecting an article by applying the image recognition method. [Background technology]

[0002] In recent years, image recognition, which recognizes objects from images captured by cameras, has been used in various fields. For example, in the field of in-vehicle cameras, people on the road are recognized from captured images. In the field of factory automation (FA), parts are recognized from captured images.

[0003] In order to reliably capture an image of an object to be recognized, it is necessary to illuminate the object using a lighting device or to increase the imaging sensitivity of the camera. In this case, the illumination light, the illumination light reflected from the surroundings of the object, and the illumination light reflected multiple times inside the object are likely to be reflected on the surface of the object. If such reflections exist on the surface of the object, the accuracy of the recognition process will decrease when recognizing the object using the captured image.

[0004] Patent Document 1 addresses the problem of a device that uses a camera to capture an image of the area in front of a vehicle through the windshield to detect objects such as people outside the vehicle, where fixed objects on the vehicle are captured in the windshield. Patent Document 1 discloses a method of storing an image of the windshield captured under conditions in which fixed objects on the vehicle are captured as a reflected image in advance, and generating a difference image between the image to be processed and the reflected image.

[0005] Furthermore, Patent Document 2 addresses the problem of the occurrence of reflections (ghosts) due to multiple reflections of illumination light in an apparatus that uses light interference to inspect for streak-like unevenness defects in glass substrates having periodic patterns such as color filters. Therefore, Patent Document 2 utilizes the fact that when the angle or position of the illumination is changed, the position of the reflections (ghosts) moves but the position of the defects does not change, and separates the reflections (ghosts) from the streak-like unevenness defects using multiple inspection images. [Prior art documents] [Patent documents]

[0006] [Patent Document 1] JP 2010-79706 A [Patent Document 2] JP 2009-139209 A Summary of the Invention [Problem to be solved by the invention]

[0007] However, with conventional methods, there are cases where the accuracy of the recognition process cannot be made sufficiently high when reflections are present on the surface of the target object. The method disclosed in Patent Document 1 does not address the issue of reflections on the object to be detected (such as a person outside the vehicle), but rather on the window glass between the camera and the object, and is therefore not a direct solution. Patent Document 1 also compares the luminance values ​​between pixels of the stored reflected image and the image to be processed. For this reason, if the luminance of the object included in the image to be processed is close to the luminance of a fixed object on the vehicle included in the previously stored reflected image, there is a possibility that the object will be erroneously recognized as a reflection.

[0008] In addition, in the method disclosed in Patent Document 2, in an apparatus that uses light interference to inspect periodic patterns, a template image is created for the reflection, and the reflection is tracked between multiple images by pattern matching. The technology in Patent Document 2 works well when the inspection target is a flat plate such as a color filter, but it is difficult to apply to inspection targets with complex shapes. If the inspection target has a complex shape with curved surfaces or unevenness, it is difficult to inspect periodic patterns using light interference in the first place, and there are cases where streak-like unevenness defects and illumination reflections cannot be properly recognized. Therefore, there has been a demand for an image recognition method that can accurately identify reflections of objects in a captured image, even when the object has a complex shape. [Means for solving the problem]

[0009] A first aspect of the present invention is an image recognition method comprising: capturing a plurality of images with a camera while changing the relative position of an object and a light source; inputting the plurality of images into a trained model; extracting a static reflected image reflected in the object from the plurality of images; removing the extracted static reflected image from the plurality of images; and extracting a dynamic reflected image whose position changes when the relative position of the object and the light source is changed from the plurality of images from which the static reflected image has been removed.

[0010] In addition, a second aspect of the present invention is an image recognition device comprising: a light source that illuminates an object; a camera that can capture an image of the object; a trained model that has been machine-learned to capture a static reflected image, whose position does not change even if the relative position of the object and the light source is changed, among the reflected images reflected on the object; and a computer, wherein the computer executes the following processes: capture a plurality of images with the camera while changing the relative position of the object and the light source, input the plurality of images to the trained model, extract a static reflected image reflected on the object from the plurality of images, remove the extracted static reflected image from the plurality of images, and extract a dynamic reflected image, whose position changes when the relative position of the object and the light source is changed, from the plurality of images from which the static reflected image has been removed.

[0011] In addition, a third aspect of the present invention is an inspection method comprising: capturing a plurality of images with a camera while changing the relative position of an object to be inspected and a light source; inputting the plurality of images into a trained model; extracting from the plurality of images a static reflected image reflected in the object to be inspected; removing the extracted static reflected image from the plurality of images; and extracting from the plurality of images a dynamic reflected image whose position changes when the relative position of the object to be inspected and the light source is changed.

[0012] In addition, a fourth aspect of the present invention is an inspection device comprising: a light source that illuminates an inspection object; a camera that can capture an image of the inspection object; a trained model that has been machine-learned to capture a static reflected image, whose position does not change even if the relative position of the inspection object and the light source is changed, among the reflected images reflected on the inspection object, and a computer, wherein the computer executes a process of capturing a plurality of images with the camera while changing the relative position of the inspection object and the light source, inputting the plurality of images to the trained model, extracting a static reflected image reflected on the inspection object from the plurality of images, removing the extracted static reflected image from the plurality of images, extracting a dynamic reflected image, whose position changes when the relative position of the inspection object and the light source is changed, from the plurality of images, and inspecting the presence or absence of defects in the inspection object using the plurality of images from which the static reflected image and the dynamic reflected image have been removed. Effect of the Invention

[0013] According to the present invention, it is possible to provide an image recognition method that can accurately identify reflections on an object from within a captured image, even when the object has a complex shape. [Brief description of the drawings]

[0014] [Figure 1] FIG. 1 is a schematic diagram showing a schematic configuration of an inspection device according to an embodiment. [Diagram 2] 1 is a flowchart showing a method for creating a trained model according to an embodiment. [Diagram 3] 1A is an example of a model image according to an embodiment, FIG. 1B is an example of automatic annotation according to an embodiment, FIG. 1C is an example of annotation region correction according to an embodiment, and FIG. 1D is an example of a composite image of annotation regions after correction according to an embodiment. [Figure 4] 4 is a flowchart showing an inspection method according to the embodiment. [Diagram 5] (a) An example of a captured image in the Nth frame, (b) an example of a captured image in the N+1th frame. [Figure 6](a) An example of an Nth frame test image. (b) An example of an N+1th frame test image. (c) An example of feature points of the Nth frame test image after expansion processing. (d) An example of feature points of the N+1th frame test image after expansion processing. (e) An example showing the product of feature points after expansion. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0015] An embodiment of the present invention will be described with reference to the drawings. First, an inspection device according to the embodiment and a method for creating a trained model included in the inspection device will be described, and then an inspection method (image recognition method) according to the embodiment will be described. In the drawings referred to in the following description of the embodiments and examples, elements denoted by the same reference numbers have the same functions unless otherwise specified.

[0016] [Inspection equipment] 1 is a schematic diagram showing a schematic configuration of an inspection device according to an embodiment of the present invention. The inspection device 101 includes a base 102 for holding a workpiece W (an object to be inspected), a light source 103, a moving device 104 for moving the light source 103, a camera 105 as an imaging device, a computer 106, and a display device 107.

[0017] In this embodiment, the workpiece W is a lens, which is an optical component, and the inspection device 101 inspects the lens surface for scratches, dirt, etc. based on its appearance. The lens is an example of an object to be inspected, and the workpiece W may be another optical component or other components. The inspection device of the embodiment can perform highly reliable inspection processing on an object whose reflection state changes when the illumination position is changed, such as an object having a curved surface or an uneven shape. Here, the reflection on the object to be inspected includes a reflection image of the illumination light source itself, a reflection image caused by the illumination light reflected by surrounding structures, and an image caused by the illumination light being multiple-reflected inside the object to be inspected. In addition, the illumination light here includes not only the light source 103 provided in the inspection device 101, but also light from an external light source such as a fluorescent lamp. The workpiece W is held on the base 102 in a position and orientation that allows an image to be captured by the camera 105. The base 102 is fixed to a stand or the like (not shown).

[0018] The light source 103 is an illumination device that irradiates illumination light onto the workpiece W. The light source 103 irradiates the workpiece W with an appropriate amount of light so that the camera 105 can image the workpiece W with the brightness and contrast required for inspection. The type of light-emitting device used for the light source 103 is not particularly limited, and for example, an LED or a halogen lamp can be used. The light emission shape of the light source 103 may be an appropriate light emission shape such as a ring illumination or a bar illumination. In addition, an optical element such as a diffuser or a lens may be provided in a part of the light source 103 to adjust the orientation characteristics of the illumination light.

[0019] The moving device 104 is a device that movably supports the light source 103, and includes a base that directly supports the light source 103, and a moving mechanism (such as a drive motor) that moves the base. Here, it is desirable that the moving device 104 be movable while supporting the light source 103 so that the optical axis of the illumination light maintains a constant angle with respect to the workpiece W. The moving device 104 can be configured, for example, by a linear stage or an articulated robot.

[0020] The direction in which the moving device 104 moves the light source 103 is preferably a direction in which defects such as scratches on the inspection object are easily detected by moving the light source 103, but it may be a direction in which the reflection on the object changes due to the movement. When the shape of the workpiece W is highly symmetrical, such as the workpiece W illustrated in FIG. 1, if a bar light with a line-shaped light emitting part is used as the light source 103, it is preferable to move the light source 103 along a direction intersecting the symmetric axis of the workpiece W (vertical direction in FIG. 1) (horizontal direction in FIG. 1). In addition, when a ring light with a ring-shaped light emitting part is used as the light source 103, it is preferable to move the light source 103 along a direction parallel to the symmetric axis of the workpiece W (vertical direction in FIG. 1). In this way, by appropriately setting the direction in which the light source 103 is moved according to the shape of the workpiece W, the shape of the light emitting part of the light source used, the shape of the reflection and defects observed on the workpiece, etc., it is possible to improve the identification of the reflection in the inspection process described later.

[0021] The camera 105 is a digital camera that captures an image of the workpiece W and outputs image data. For example, a digital camera equipped with an area sensor such as a CMOS image sensor or a CCD image sensor is preferably used.

[0022] The computer 106 is a computer that controls the operation of the inspection device 101, and includes a CPU as a processing unit, a storage unit capable of reading and writing data, and various input / output interfaces and man-machine interfaces. The computer 106 may include a GPU dedicated to image processing as a processing unit. The computer 106 may include a storage unit such as a flexible disk, an optical disk, a magneto-optical disk, a magnetic tape, a non-volatile memory such as a USB memory, and a recording medium such as an SSD. In addition, the computer 106 may include an input device such as a keyboard, a jog dial, a mouse, a pointing device, and a voice input device as a man-machine interface. The computer 106 not only controls the operation of each part of the inspection device 101, but also can perform image processing on the captured image captured by the camera 105. The computer 106 creates teacher data for deep learning using the image captured by the camera 105, and performs image processing on the captured image for inspection to detect defects in the target object. In addition, a learned model can be formed in a partial area of ​​the computer 106.

[0023] The display device 107 can operate as a display unit of the inspection device 101. For example, it displays images captured by the camera 105 and images processed by the computer 106, allowing an operator to easily set coordinate values, parameters, and the like. The display device 107 is configured using a display device such as a liquid crystal display or an organic EL display.

[0024] In this embodiment, the camera 105 is fixed to a stand or other structure so that the relative position with respect to the workpiece W set on the pedestal 102 does not change. The inspection device 101 can change the relative position between the light source 103 and the workpiece W by moving the light source 103. In other words, by moving the light source 103 with the moving device 104, the irradiation position at which the light source 103 irradiates the workpiece W can be relatively changed.

[0025] As a method for changing the light irradiation position, a configuration in which the light source 103 is moved using the moving device 104 will be described, but the present invention is not limited to this. A configuration in which multiple light sources are arranged at different positions and each light source is turned on in sequence to irradiate the workpiece W from each irradiation position in turn may also be used. 1 illustrates a configuration in which the light source 103 is installed on the opposite side of the workpiece W from the camera 105 to provide transmitted illumination, but the light source 103 may be installed on the same side of the workpiece W as the camera 105 to provide direct illumination. The layout of the light sources can be set appropriately depending on the properties of the workpiece W (transparent, opaque, etc.).

[0026] [How to create a trained model] Next, a method for creating a trained model according to an embodiment will be described. Fig. 2 is a flowchart for explaining the method for creating a trained model according to an embodiment. In this embodiment, a trained model that extracts static reflection areas contained in an image by inference is created using a deep learning technique. Here, the static reflection area refers to an area in an image reflected on a defect-free object where there is a (static) reflection that changes little even when the light source 103 is moved (the lighting position is changed).

[0027] An image captured to check for defects such as scratches on an object contains images of the defects (if they exist) and the reflected light image on the object. To accurately determine the presence or absence of defects such as scratches, it is important to be able to properly distinguish between defects such as scratches and the reflected light image. Defect images such as scratches and reflected images of lighting have the following properties. If the relative positions of the object and the camera are fixed, when the lighting position is changed and multiple images are captured, the position of the defect image such as a scratch is unlikely to change between images. On the other hand, when the reflected image of lighting on the object is captured in the same manner as described above, there are dynamic reflected images whose position changes between images, and static reflected images whose position does not change. In particular, when the object is a part with a complex shape such as an aspheric lens and has been subjected to a rough surface processing, both types are prominent.

[0028] For dynamic reflected images, a moving reflected portion can be identified by performing correlation analysis using multiple captured images, and thus it is possible to distinguish the dynamic reflected image from a defect image such as a scratch. On the other hand, for static reflected images, even if multiple inspection images are captured by changing the illumination position, the position of the static reflected image does not change between images, just like a defect image such as a scratch, so it is difficult to distinguish the static reflected image from a defect image such as a scratch.

[0029] In general, images of defects such as scratches vary greatly depending on the type and shape of the defect, so even if you try to create a trained model using machine learning, you would need to collect a huge amount of training data, and it is not easy to create a trained model.In contrast, static reflection images change little in the image even if the lighting position is changed, so it is relatively easy to collect training data for machine learning. Therefore, in the embodiment, a trained model is created that extracts, by inference, an area in an image where a static reflection image exists (static reflection area) according to the flowchart in FIG.

[0030] First, in step S201, a teacher work for creating a trained model is set on the pedestal 102 of the inspection device 101. Here, a work (sample) without defects such as scratches is selected in advance from among workpieces of the same type as the workpiece W to be inspected, and used as the teacher workpiece. Taking into consideration the shape variation of the workpiece W to be inspected, it is desirable to prepare multiple teacher workpieces. The teacher workpiece is set on the pedestal 102 in the same position and orientation as the workpiece W is set at the time of inspection. In other words, it is a position and orientation in which the inspected surface of the workpiece is reflected when imaged by the camera 105.

[0031] Next, in step S202, the computer 106 sends a command to the moving device 104 to move the light source 103 to a predetermined illumination position. As will be described later, during inspection, the light source 103 is moved to a plurality of illumination positions in sequence, and an inspection image is captured by the camera 105 for each illumination position. In step S202, the light source 103 is moved to one of the plurality of illumination positions used during inspection. Next, in step S203, the computer 106 causes the camera 105 to capture an image of the teacher workpiece illuminated by the light source 103, and imports the image data into the storage unit of the computer 106 as a model image.

[0032] Next, in step S204, the computer 106 determines whether or not imaging of the teacher workpiece set on the base 102 has been completed for all of the multiple lighting positions used during inspection. If imaging has not been completed for all of the multiple illumination positions used during the inspection (step S204: NO), the process returns to step S202, and the computer 106 moves the light source 103 to a position among the multiple illumination positions to which it has not yet been moved. After that, steps S202 to S204 are repeatedly executed for the set teacher workpiece until imaging has been completed for all of the multiple illumination positions used during the inspection.

[0033] If imaging of the set teacher work has been completed for all of the multiple lighting positions used during inspection (step S204: YES), proceed to step S205 and determine whether imaging of all of the prepared teacher work has been completed. If imaging of all the teacher workpieces has not been completed (step S205: NO), the process returns to step S201, and teacher workpieces that have not yet been imaged are set on the base 102, and the same steps as those described above are repeated. Furthermore, if there is variation in the position and orientation of the workpiece each time the workpiece is set on the base 102, in order to enrich the training data for machine learning, the same training workpiece may be reset on the base 102 multiple times and the above-mentioned imaging may be performed each time.

[0034] When the necessary imaging has been completed for all the teaching works (step S205: YES), the process proceeds to step S206, where the computer 106 automatically performs annotation processing on the stored model images. In the automatic annotation process, a feature amount is calculated based on a preselected feature amount, and a binarization process is performed using a predetermined feature amount threshold so that the reflection area becomes a bright pixel. A feature amount that can extract only the reflection is selected, and a threshold value used in the binarization process is set to a value that can sufficiently extract the reflection area. In this embodiment, a standard difference is used as the feature amount.

[0035] The standard deviation of all pixels within a certain distance from the pixel of interest is calculated, and this is set as the standard deviation value of the pixel of interest. The standard deviation value is then calculated for each pixel in the model image. If the lighting is sufficiently bright, the brightness of the inspection image is saturated, and the edge pixels of the reflection are extracted. The edge part of the reflection is a closed area, so the closed area is filled in and used as the annotation area.

[0036] For the edge part of the reflection, the adjacent pixels of the pixel on the model image are checked, and pixels with a certain brightness or more are set as edge pixels again, and the closed area can be filled in. In this case, a general algorithm for filling in a closed area can be used. The feature amount is selected from among an average value calculated using a method similar to standard deviation, and an average value calculated by dividing the model image into a certain number of sections, calculating a co-occurrence matrix for each section, and calculating contrast and entropy from the co-occurrence matrix. Alternatively, binarization may be performed using a brightness threshold without calculating the feature amount. In addition, in order to reflect more information on the edge part of the reflection by automatic annotation in the model, the annotation area may be expanded to an annotation image set to be several pixels wider than the actual reflection.

[0037] Once the automatic annotation process has been executed, the process proceeds to step S207, where the computer 106 displays the results of the automatic annotation process on the display device 107. The results of the automatic annotation process are displayed so that the operator (model creator) can easily compare the model image and the annotation region. For example, the model creator can arbitrarily switch between the model image and an annotation region composite image in which the annotation region of the model image is filled in on the screen. Also, an annotation image in which the annotation region is visualized may be created, and the model image and the annotation image may be displayed side by side, or the model image and the annotation region may be layered and composited and displayed so that they can be compared in a single image.

[0038] Next, in step S208, the model creator checks the result of the automatic annotation process displayed on the display device 107, and if the automatic annotation result differs from the actual reflected area, corrects the annotation area. The model creator performs necessary editing work such as removing the reflected area or re-inputting it, for example, by operating the mouse. Note that the annotation area may be corrected using a device such as a touch panel.

[0039] 3(a) to 3(d) are schematic diagrams for explaining a series of steps from displaying the annotation region in step S207 to the correction process in step S208. FIG. 3(a) is an example of a captured model image, and shows a teacher's workpiece 301 and an image 302 reflected in the teacher's workpiece 301. Fig. 3(b) shows an automatic annotation region 303 in the automatic annotation process in step S206. By filling the automatic annotation region 303 with an arbitrary color and embedding it in the model image, it is possible to create the annotation region composite image shown in Fig. 3(c).

[0040] When the model creator recognizes from the annotation region composite image displayed on the display device 107 that there is a difference between the actual reflected image 302 and the automatic annotation region 303, the model creator corrects it in step S208. The model creator corrects the area with the difference by filling it with the same color as the automatic annotation region, and creates a corrected annotation region composite image shown in Fig. 3(d) as training data. Note that 306 is the corrected annotation region.

[0041] Next, proceed to step S209, and perform deep learning using the teacher data to create a trained model. Using teacher data in which the model image and the annotation area corresponding to the model image are associated, for example, machine learning is performed on U-NET, which is a type of full-layer convolutional network. Then, machine learning is performed on an area where a static reflection image, which is a reflection whose position does not change even if the lighting position is changed, to create a trained model. The trained model is stored in a storage unit in the computer 106 or in another storage unit. In addition, in order to reflect more reflection states in the model, image transformation processing such as affine transformation may be used to translate, rotate, enlarge, reduce, etc. the set of the model image and the annotation area to enrich the teacher data and perform deep learning. In this way, a trained model is formed that can identify areas in a captured image where a static reflection image exists.

[0042] [Testing method] Next, an inspection method (image recognition method) according to an embodiment will be described. A workpiece W as an object to be inspected is illuminated from multiple lighting positions and captured by a camera to obtain multiple inspection images. Then, a trained model is used to extract (estimate) static reflection images in the inspection images and remove them from the inspection images. Furthermore, feature points are extracted from images contained in the multiple inspection images from which static reflections have been removed, and the presence or absence of movement between the multiple inspection images is detected for each feature point. If a feature point moves, the image is estimated to be a dynamic reflection image, and if a feature point that does not move is detected, the image is extracted as a defect (candidate).

[0043] FIG. 4 is a flowchart showing the inspection method according to the embodiment. First, in step S501, a workpiece W, which is an object to be inspected, is set on the pedestal 102 of the inspection device 101. The workpiece W is set on the pedestal 102 in the same position and orientation as the teacher workpiece was set when the trained model was created. In other words, the position and orientation are such that when the workpiece W is imaged by the camera 105, the inspected surface of the workpiece W is reflected in the captured image.

[0044] Next, in step S502, the computer 106 sends a command to the moving device 104 to move the light source 103 to a predetermined lighting position. During inspection, the light source 103 is moved to a plurality of lighting positions in sequence, and an inspection image is captured by the camera 105 for each lighting position. In step S502, the light source 103 is moved to one of the plurality of lighting positions.

[0045] Next, in step S503, the computer 106 causes the camera 105 to capture an image of the workpiece W illuminated by the light source 103, and stores the image in a storage unit within the computer 106 as inspection image data.

[0046] Next, in step S504, the computer 106 determines whether or not imaging of the workpiece W set on the base 102 has been completed for all of the multiple illumination positions. If imaging has not been completed for all of the multiple illumination positions (step S504: NO), the process returns to step S502, and the computer 106 moves the light source 103 to a position among the multiple illumination positions to which it has not yet been moved. Thereafter, steps S502 to S504 are repeatedly executed for the workpiece W to be inspected until imaging has been completed for all of the multiple illumination positions.

[0047] If imaging of the set workpiece W to be inspected at all of the multiple illumination positions has been completed (step S504: YES), the process proceeds to step S505. In step S505, the trained model processes the inspection image and infers the area in the inspection image where the static reflection image exists (static reflection area). Then, image data of the defect candidate extraction area excluding the static reflection area is extracted from the inspection image. The defect candidate extraction area may contain the dynamic reflection image and the defect image (if it exists).

[0048] Next, in step S506, the image data of the defect candidate extraction region is binarized using a preset brightness threshold value. This is to extract pixels (defect candidate pixels) that may contain defects from the defect candidate extraction region. The threshold value used in the binarization process is set to a brightness value that can sufficiently extract defects. Note that instead of extracting defect candidate pixels using brightness as the threshold value, defect candidate pixels may be extracted by detecting a specific spatial frequency using a band-pass filter. For convenience, the binarization results can be displayed, for example, as defect candidate pixels as bright pixels and pixels other than defect candidates as dark pixels.

[0049] Next, in step S507, feature points are extracted from among the defect candidate pixels (defect candidate regions). First, a labeling process is performed to assign the same label to pixels constituting one image among the defect candidate pixel group, and the number of defect candidate pixels with the same label is counted to calculate the area of ​​the defect candidate. Labels existing within a circular area equidistant from the center of any label are linked to integrate defect candidates with the same label. Note that instead of using the area of ​​the defect candidate, the defect candidates may be integrated using, for example, the length and width of the defect candidate, the average brightness, the maximum brightness, or the minimum brightness of the point group on the coordinates of the defect candidate. Note that at this stage, the integrated defect candidate may be a dynamic reflection image or a defect image.

[0050] Next, the center of gravity of the integrated defect candidates is extracted as a feature point. Here, a case where there is one feature point for the integrated defect candidates is described, but there may be multiple feature points. Also, in step S506, a case where feature points are extracted from an image obtained by performing image processing (binarization) on the inspection image captured by camera 105 is described, but the present invention is not limited to this. That is, feature points may be extracted directly from the inspection image, and for example, corner coordinate values ​​derived by Harris corner detection may be calculated as feature points.

[0051] Next, in step S508, it is identified whether the feature points of the integrated defect candidates move in the images captured by changing the illumination position. By identifying whether the feature points move, it is possible to extract dynamic reflection images from the defect candidates. With reference to Figures 5(a) and 5(b), it will be explained that dynamic reflection images can be extracted by identifying whether the feature points move.

[0052] Fig. 5(a) is an image of the Nth frame among images captured continuously while moving the light source 103, and shows images of a first defect candidate 601 and a second defect candidate 602. Reference numeral 603 denotes a feature point (e.g., center of gravity) of the first defect candidate 601, and 604 denotes a feature point (e.g., center of gravity) of the second defect candidate 602. It is not possible to distinguish from Fig. 5(a) alone whether each defect candidate is a defect image or a dynamic reflection image.

[0053] 5(b) is an image of the (N+1)th frame among images captured continuously while moving the light source 103, and shows a first defect candidate 601 and a second defect candidate 602. Reference numeral 603 denotes a feature point (e.g., center of gravity) of the first defect candidate 601, and reference numeral 604 denotes a feature point (e.g., center of gravity) of the second defect candidate 602.

[0054] Comparing FIG. 5(a) and FIG. 5(b), it can be seen that the feature point 603 of the first defect candidate 601 has moved, but the feature point 604 of the second defect candidate 602 has not moved. This makes it possible to determine that the first defect candidate 601 is a dynamic reflection image. Here, two consecutive frames are taken as an example, but it is possible to improve the accuracy of distinguishing between a dynamic reflection image and a defect image by tracking feature points using a larger number of captured images. For example, if the same feature point does not move in a predetermined number or more of consecutive images among multiple images captured continuously, the image is determined not to be a dynamic reflection image.

[0055] For example, the position of a feature point may change slightly between images due to the influence of a quantization error in a binarization process or an error that occurs in a process of integrating defect candidate pixels. Even if the position of a feature point moves only slightly, if this is determined to be a dynamic reflection, there is a possibility that a defect image may be erroneously determined to be a dynamic reflection image. Therefore, in the embodiment, even if the position of a feature point changes between images, if the amount of change is small, a process may be used to determine that the image is not a dynamic reflection image.

[0056] This process will be described with reference to Fig. 6(a) to Fig. 6(e). Fig. 6(a) shows an inspection image of the Nth frame, and Fig. 6(b) shows an inspection image of the N+1th frame. In this example, the positions of feature points 701 and 702 for the same defect candidate are shifted by several pixels. In order to absorb the minute shift of about several pixels, an expansion process (enlargement of the image region) is performed. Region 703 in Fig. 6(c) and region 704 in Fig. 6(d) are the result of the expansion process of the feature points of the inspection images of the Nth and N+1th frames, respectively. Also, Fig. 6(e) shows the logical product of the feature points of the same defect candidate after the expansion process in Fig. 6(c) and Fig. 6(d). When an intersection region 705 exists, it is considered that the feature points 701 and 702 have not moved, and it is estimated that this defect candidate is not a dynamic reflection. Although Fig. 6(a) to Fig. 6(e) show an example in which the expansion process is performed within a range of one pixel around the feature point, the range to be expanded is not limited to one pixel, and it is possible to set an appropriate range.

[0057] Returning to FIG. 4, in step S509, those determined to be dynamic reflection images in step S508 are excluded from the defect candidates. Then, in step S510, the remaining defect candidates are judged to be defects. However, if product standards or the like stipulate the shape or size of scratches that do not need to be treated as defects, the corresponding ones among the remaining defect candidates may be excluded from the defect judgment. Then, in step S511, the computer 106 compares the number and size of defects determined in step S510 with the pass / fail criteria registered in advance for the workpiece, and determines the pass / fail of the workpiece W to be inspected.

[0058] As described above, according to the image recognition method of the embodiment, even if the inspection object is a workpiece having a complex shape such as an aspheric lens, the image reflected on the workpiece can be automatically identified with high accuracy from the captured image. Therefore, the reflected image can be easily removed from the image of the inspection object, and the presence or absence of defects such as scratches can be inspected with high accuracy based on the image.

[0059] [Other embodiments] The present invention is not limited to the above-described embodiments and examples, and many modifications are possible within the technical concept of the present invention. A control program capable of executing the above-mentioned method for creating and inspecting a trained model, and a computer-readable non-transitory recording medium storing the control program are also included in embodiments of the present invention.

[0060] Furthermore, the inspection device and inspection method according to the embodiment can be suitably applied to the inspection of objects having complex shapes that are prone to illumination reflections, such as optical components such as aspherical lenses, and decorative exterior components.

[0061] The present invention can also be realized by a process in which a program for implementing one or more functions of the embodiments is supplied to a system or device via a network or a storage medium, and one or more processors in a computer of the system or device read and execute the program. The present invention can also be realized by a circuit (e.g., ASIC) that implements one or more functions. [Explanation of symbols]

[0062] 101···Inspection device / 102···Pedestal / 103···Light source / 104···Moving device / 105···Camera / 106···Computer / 107···Display device / 301···Teacher's workpiece / 302···Reflected image / 303···Automatic annotation area / 306···Corrected annotation area / 601···First defect candidate / 602···Second defect candidate / 603···Feature points of the first defect candidate / 604···Feature points of the second defect candidate / 701, 702···Feature points / 703, 704···Dilated feature points / 705···Intersection area / W···Workpiece

Claims

1. The camera captures multiple images while changing the relative position of the object and the light source. The plurality of images are input into a trained model, and a static reflection image reflected in the object is extracted from the plurality of images; removing the extracted static glare from the plurality of images; extracting a dynamic reflected image, the position of which changes when the relative position between the object and the light source is changed, from the plurality of images from which the static reflected image has been removed; 1. An image recognition method comprising:

2. The trained model is a trained model generated by deep learning in which a plurality of images are captured by the camera while changing the relative positions of a sample of the same type as the target object and the light source, annotation processing is performed on the plurality of images to create annotation images, and the annotation images are used as teacher data.

2. The image recognition method according to claim 1 .

3. A light source for illuminating an object; A camera capable of capturing an image of the object; A trained model that has been machine-learned in advance to train a static reflection image that does not change position even if the relative position of the object and the light source is changed among the reflection images reflected on the object; A computer, The computer includes: Taking a plurality of images with the camera while changing the relative position of the object and the light source; The plurality of images are input to the trained model, and a static reflection image reflected in the object is extracted from the plurality of images; removing the extracted static glare from the plurality of images; executing a process of extracting a dynamic reflected image, the position of which changes when the relative position between the object and the light source is changed, from the plurality of images from which the static reflected image has been removed; 1. An image recognition device comprising:

4. The trained model is a trained model generated by deep learning in which a plurality of images are captured by the camera while changing the relative positions of a sample of the same type as the target object and the light source, annotation processing is performed on the plurality of images to create annotation images, and the annotation images are used as teacher data.

4. The image recognition device according to claim 3.

5. While changing the relative position of the inspection object and the light source, multiple images are taken with the camera. Inputting the plurality of images into a trained model, and extracting a static reflection image reflected in the inspection object from the plurality of images; removing the extracted static glare from the plurality of images; extracting a dynamic reflection image, the position of which changes when the relative position between the inspection object and the light source is changed, from the plurality of images; 13. An inspection method comprising:

6. The trained model is a trained model generated by deep learning in which a plurality of images are captured by the camera while changing the relative positions of a sample of the same type as the inspection object and the light source, annotation processing is performed on the plurality of images to create annotation images, and the annotation images are used as teacher data.

6. The inspection method according to claim 5.

7. Inspecting the object to be inspected for defects using the plurality of images from which the static reflected image and the dynamic reflected image have been removed.

7. The inspection method according to claim 5 or 6.

8. When extracting the dynamic reflected image, Identifying a defect candidate area from each of the plurality of images, and extracting feature points from each of the identified defect candidate areas; extracting the defect candidate areas in which the extracted feature points are present at different positions as the dynamic projection image; 8. The inspection method according to claim 5, wherein the first and second electrodes are arranged in a first direction.

9. When extracting the dynamic reflected image, Identifying a defect candidate area from each of the plurality of images, and extracting feature points from the identified defect candidate area; performing an expansion process for expanding an image region of the feature points for each of the plurality of images from which the feature points have been extracted; In each of the plurality of images from which the dilated feature points are extracted, the defect candidate area in which an overlapping area exists in an image of the dilated feature points is not extracted as the dynamic reflection image.

9. The inspection method according to claim 5, wherein the first and second electrodes are arranged in a first direction.

10. A light source for illuminating an object to be inspected; A camera capable of capturing an image of the inspection object; A trained model that has been machine-learned in advance to train a static reflection image, which does not change position even when the relative position of the inspection object and the light source is changed, among the reflection images reflected on the inspection object; A computer, The computer includes: Taking a plurality of images with the camera while changing the relative position of the inspection object and the light source; The plurality of images are input to the trained model, and a static reflection image reflected in the inspection object is extracted from the plurality of images; removing the extracted static glare from the plurality of images; extracting a dynamic reflection image whose position changes when a relative position between the inspection object and the light source is changed from the plurality of images; Executing a process of inspecting the object to be inspected for defects using the plurality of images from which the static reflected image and the dynamic reflected image have been removed. An inspection device characterized by:

11. The computer includes: The dynamic reflected image is Identifying a defect candidate area from each of the plurality of images, and extracting feature points from each of the identified defect candidate areas; extracting the defect candidate areas in which the extracted feature points are present at different positions as the dynamic projection image; 11. The inspection apparatus according to claim 10.

12. The computer includes: When extracting the dynamic reflected image, Identifying a defect candidate area from each of the plurality of images, and extracting feature points from each of the identified defect candidate areas; performing an expansion process for expanding an image region of the feature points for each of the plurality of images from which the feature points have been extracted; In each of the plurality of images from which the dilated feature points are extracted, the defect candidate area in which an overlapping area exists in an image of the dilated feature points is not extracted as the dynamic reflection image.

12. The inspection device according to claim 10 or 11.

13. The trained model is a trained model generated by deep learning in which a plurality of images are captured by the camera while changing the relative positions of a sample of the same type as the inspection object and the light source, annotation processing is performed on the plurality of images to create annotation images, and the annotation images are used as teacher data.

13. The inspection device according to claim 10, wherein the inspection device is a semiconductor laser.

14. A program for causing the computer included in the inspection apparatus according to claim 10 to execute the processing.

15. A non-transitory computer-readable recording medium having the program according to claim 14 recorded thereon.

Citation Information

Patent Citations

  • Image processing method and image processing system

    JP2011163766A

  • Inspection method, inspection device, image processor, program and record medium

    JP2017040598A

  • Visual line detection device, visual line detection program, and visual line detection method

    JP2018011681A

  • Method of removing reflection area, and eye tracking method and apparatus

    US20190129165A1

  • Defect inspection method

    JP2009139209A