WO2026009682A1 - 画像処理装置および画像処理方法 - Google Patents
画像処理装置および画像処理方法Info
- Publication number
- WO2026009682A1 WO2026009682A1 PCT/JP2025/021531 JP2025021531W WO2026009682A1 WO 2026009682 A1 WO2026009682 A1 WO 2026009682A1 JP 2025021531 W JP2025021531 W JP 2025021531W WO 2026009682 A1 WO2026009682 A1 WO 2026009682A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- model
- defect
- virtual
- image
- light source
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/84—Systems specially adapted for particular applications
- G01N21/88—Investigating the presence of flaws or contamination
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T19/00—Manipulating three-dimensional [3D] models or images for computer graphics
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
Definitions
- Patent Document 1 discloses technology for determining whether or not an object has defects based on captured images acquired using the principles of photometric stereo.
- the present disclosure aims to provide an image processing device and image processing method that can easily generate training data.
- an image processing device includes a virtual model generation unit that generates a virtual model that represents the three-dimensional shape of an object to be inspected in a virtual space, a defect model acquisition unit that acquires a defect model that is represented in the virtual space and includes defect data, and a defect imposition unit that impresses defects on the virtual model based on the defect model.
- the defect model may be constructed from a plane in which the shape of the defect to be added to the virtual model is specified using a grayscale image.
- the defect imparting unit may select at least one point from a predetermined group of points included in a replicated model that replicates a specific surface that is part of the surface of the virtual model, and set the position of the defect model so that the surface of the defect model intersects with the normal of the replicated model that passes through the selected point.
- the defect imparting unit may move each point of a predetermined group of points included on the surface of the defect model in the normal direction of the defect model, and identify contact points where each point comes into contact with the surface of the virtual model.
- the contact points may be identified based on the dot product of the normal vectors of each point in the point cloud included in the surface of the defect model and the inward vector of the virtual model.
- the system may also include a 3DCG image generation unit that generates at least three 3DCG images with different virtual light sources based on a virtual model with defects, at least three virtual light sources that illuminate the virtual model with defects, and a virtual imaging device that images the illuminated virtual model, and an image generation unit that generates images as training data based on the direction vectors of the surfaces of the virtual model derived from the at least three 3DCG images.
- a 3DCG image generation unit that generates at least three 3DCG images with different virtual light sources based on a virtual model with defects, at least three virtual light sources that illuminate the virtual model with defects, and a virtual imaging device that images the illuminated virtual model
- an image generation unit that generates images as training data based on the direction vectors of the surfaces of the virtual model derived from the at least three 3DCG images.
- an image processing method includes the steps of generating a virtual model that represents the three-dimensional shape of an object to be inspected in a virtual space, acquiring a defect model that is represented in the virtual space and includes defect data, and adding defects to the virtual model based on the defect model.
- This disclosure makes it easy to generate training data.
- FIG. 1 is a schematic diagram of an image processing system according to this embodiment.
- FIG. 2 is a schematic block diagram of the image processing system according to this embodiment.
- FIG. 3 is a block diagram showing an example of the functional configuration of the image processing apparatus according to this embodiment.
- FIG. 4 is a schematic diagram showing an example of a 3D graphic model generated in a virtual space.
- FIG. 5 is a diagram showing an example of a defect model according to this embodiment.
- FIG. 6 is a first diagram for explaining the positions of the virtual model, the replica model, and the defect model in the virtual space.
- FIG. 7 is a second diagram for explaining the positions of the virtual model, the replica model, and the defect model in the virtual space.
- FIG. 8 is a diagram showing how a point group included in a defect model is moved to a virtual model.
- FIG. 9 is a diagram for explaining the relationship between each point of the defect model and the contact point on the surface of the virtual model.
- FIG. 10 is a diagram showing an example of the first 3DCG image.
- FIG. 11 is a diagram showing an example of the second 3DCG image.
- FIG. 12 is a diagram showing an example of the third 3DCG image.
- FIG. 13 is a diagram illustrating an example of the first image.
- FIG. 14 is an explanatory diagram for explaining the direction vector of the surface of the inspection object illuminated by light from the first virtual light source.
- FIG. 15 is an explanatory diagram for explaining the direction vector of the surface of the inspection object illuminated by light from the second virtual light source.
- FIG. 16 is an explanatory diagram for explaining the direction vector of the surface of the inspection object illuminated by light from the third virtual light source.
- FIG. 17 is a diagram illustrating an example of an inspection model.
- FIG. 18 is a flowchart showing an example of an image processing method according to this embodiment.
- FIG. 1 is a schematic diagram of an image processing system 100 according to this embodiment.
- the image processing system 100 is an inspection system for performing an appearance inspection of an inspection object (object) 200.
- the X, Y, and Z directions are mutually orthogonal.
- the X and Y directions are horizontal directions, and the Z direction is the up-down direction.
- the image processing system 100 includes one imaging device 300, multiple light sources 400, and an image processing device 500.
- the inspection object 200 is an actual product that is placed in real space and undergoes visual inspection by the image processing system 100.
- the inspection object 200 is, for example, a general industrial product.
- the inspection object 200 is not limited to industrial products as long as it can be imaged by the imaging device 300.
- a part of the inspection object 200 may contain a defect 210, which is an abnormal portion.
- the defect 210 is formed on a part of the surface of the inspection object 200, and is, for example, a protrusion or depression formed on the surface of the inspection object 200.
- the defect 210 in the inspection object 200 is caused, for example, by corrosion causing the inspection object 200 to thin, by a foreign object being trapped during press working of the inspection object 200, or by a tool colliding with the surface of the inspection object 200.
- the imaging device 300 is a real camera placed in real space.
- the imaging device 300 is placed, for example, on an extension of the inspection object 200 in the +Z direction.
- the camera viewpoint of the imaging device 300 is located on an extension of the inspection object 200 in the +Z direction, and the imaging direction of the imaging device 300 is the -Z direction toward the inspection object 200.
- the imaging device 300 images the inspection object 200 from above.
- the imaging device 300 may also image the inspection object 200 from below or from the side.
- the imaging device 300 captures an image of the inspection object 200 and generates an image of the inspection object 200.
- the imaging device 300 outputs the generated image of the inspection object 200 to the image processing device 500.
- one imaging device 300 is placed for one inspection object 200.
- One imaging device 300 is placed facing the inspection object 200 so that the inspection object 200 is included in the imaging range. With the position of the imaging device 300 fixed, multiple images of the inspection object 200 are captured.
- At least three light sources 400 are prepared.
- the reason for using at least three light sources is to capture images of the inspection object 200 using photometric stereo.
- Photometric stereo is a three-dimensional measurement technique that captures images of the inspection object 200 illuminated from multiple different lighting directions and determines the normal vector, which is the directional vector of the surface of the inspection object 200, from the shading information.
- the normal vector is a vector perpendicular to the surface of the inspection object 200.
- photometric stereo is also known as photometric stereo.
- the multiple light sources 400 include a first light source 400A, a second light source 400B, and a third light source 400C.
- the first light source 400A, the second light source 400B, and the third light source 400C are actual light sources arranged in real space.
- the first light source 400A is arranged on the +Y side of the inspection object 200.
- the first direction L1 in which the light from the first light source 400A is emitted is the -Y direction and a direction tilted at -45 degrees from the horizontal when the position of the first light source 400A is taken as the reference position.
- the first direction L1 is the -Y direction with respect to the imaging direction of the imaging device 300 and a direction tilted at -45 degrees from the horizontal.
- the first light source 400A illuminates the inspection object 200 from the first direction L1.
- the second light source 400B is positioned on the +X side of the inspection object 200.
- the second direction L2 in which the light from the second light source 400B is emitted is the -X direction and a direction tilted at -45 degrees from the horizontal when the position of the second light source 400B is taken as the reference position.
- the second direction L2 is the -X direction with respect to the imaging direction of the imaging device 300 and a direction tilted at -45 degrees from the horizontal.
- the second light source 400B illuminates the inspection object 200 from the second direction L2, which is different from the first direction L1.
- the third light source 400C is positioned on the -Y side of the inspection object 200.
- the third direction L3 in which the light from the third light source 400C is emitted is the +Y direction and a direction tilted at -45 degrees from the horizontal when the position of the third light source 400C is taken as the reference position.
- the third direction L3 is the +Y direction with respect to the imaging direction of the imaging device 300 and a direction tilted at -45 degrees from the horizontal.
- the third light source 400C illuminates the inspection object 200 from the third direction L3, which is different from the first direction L1 and the second direction L2.
- the inspection object 200 in this embodiment is positioned so that it can be imaged from directly above by the imaging device 300, and so that it can be illuminated by the first light source 400A, second light source 400B, and third light source 400C from a 45° diagonal angle above at 90° intervals in the circumferential direction.
- the inspection object 200 is illuminated by light emitted from any of the first light source 400A, second light source 400B, and third light source 400C.
- the first light source 400A, the second light source 400B, and the third light source 400C are arranged at 90° intervals, such as 0°, 90°, and 180°, in the circumferential direction of the inspection object 200.
- the first light source 400A, the second light source 400B, and the third light source 400C may be arranged at equal 120° intervals, such as 0°, 120°, and 240°, in the circumferential direction of the inspection object 200.
- the multiple light sources 400 are composed of four light sources, the four light sources may be arranged at equal 90° intervals, such as 0°, 90°, 180°, and 270°, in the circumferential direction of the inspection object 200.
- the first light source 400A, the second light source 400B, and the third light source 400C illuminate the inspection object 200 from different directions.
- the number of light sources 400 is three.
- the number of light sources 400 need only be at least three, and is not limited to three.
- the image processing device 500 is electrically connected to the imaging device 300 and the multiple light sources 400, and controls the imaging device 300 and the multiple light sources 400.
- the image processing device 500 controls the imaging device 300 and the multiple light sources 400 to illuminate the inspection object 200 from different lighting directions at at least three different times in order to capture an image of the inspection object 200 using the photometric stereo method.
- the image processing device 500 controls the first light source 400A to irradiate the inspection object 200 with light in a first direction L1 at a first timing, thereby acquiring a first captured image of the illuminated inspection object 200.
- the image processing device 500 also controls the second light source 400B to irradiate the inspection object 200 with light in a second direction L2 at a second timing different from the first timing, thereby acquiring a second captured image of the illuminated inspection object 200.
- the second timing is, for example, a timing after the first timing.
- the image processing device 500 also controls the third light source 400C to irradiate the inspection object 200 with light in a third direction L3 at a third timing different from the first and second timings, thereby acquiring a third captured image of the illuminated inspection object 200.
- the third timing is, for example, a timing after the second timing.
- FIG. 2 is a schematic block diagram of the image processing system 100 according to this embodiment.
- the image processing device 500 includes an I/F 510, a storage device 520, a system bus 530, one or more processors 540, and one or more memories 550.
- the I/F 510 is an interface for communicating with the imaging device 300, the first light source 400A, the second light source 400B, and the third light source 400C.
- the image processing device 500 according to this embodiment also functions as a generation device that generates training data, as will be described in more detail below.
- the storage device 520 is composed of RAM, flash memory, HDD, etc., and holds various information necessary for the processing of the processor 540 described below.
- three-dimensional shape data is stored in the storage device 520.
- the three-dimensional shape data is data represented as a collection of line information and surface information each containing two points, and is data that can identify the three-dimensional shape of the virtual model 600 described below, for example.
- the three-dimensional shape data includes, for example, point cloud data, which is a collection of points composed of three-dimensional coordinates represented by X, Y, and Z.
- a 3D graphics model is created by converting this point cloud data into surface data.
- Surface data is data that forms the surfaces of the 3D graphics model, and is, for example, mesh data or surface data.
- a 3D graphics model is generated by converting point cloud data into mesh data or surface data.
- three-dimensional shape data representing the three-dimensional shape of the inspection object 200 is stored in the storage device 520.
- the three-dimensional shape data in this embodiment is, for example, 3D CAD data.
- the three-dimensional shape data is not limited to this, and may also be 3D data obtained by measuring the inspection object 200 and the defect 210 using a three-dimensional optical measuring device such as a laser displacement meter or a stereo imaging device, or an X-ray CT device.
- the system bus 530 electrically connects the I/F 510, storage device 520, processor 540, and memory 550, and is a transmission path for transmitting data between them.
- the processor 540 includes, for example, a CPU (Central Processing Unit).
- the memory 550 includes, for example, a ROM (Read Only Memory) and a RAM (Random Access Memory).
- the ROM is a storage element that stores programs and calculation parameters used by the CPU.
- the RAM is a storage element that temporarily stores data such as variables and parameters used in processing executed by the CPU.
- FIG. 3 is a block diagram showing an example of the functional configuration of an image processing device 500 according to this embodiment.
- the image processing device 500 includes a 3D graphic model generation unit (virtual model generation unit) 500a, a defect model acquisition unit 500b, a defect assignment unit 500c, a 3DCG image generation unit 500d, a first image generation unit (image generation unit) 500e, a captured image generation unit 500f, a second image generation unit 500g, a training data generation unit 500h, a model learning unit 500i, and an estimation unit 500j.
- a 3D graphic model generation unit virtual model generation unit
- the defect model acquisition unit 500b includes a defect model acquisition unit 500b, a defect assignment unit 500c, a 3DCG image generation unit 500d, a first image generation unit (image generation unit) 500e, a captured image generation unit 500f, a second image generation unit 500g, a training data generation unit 500h, a model learning unit 500i, and an estimation unit 500j.
- an estimation unit 500j an estimation
- the processor 540 shown in FIG. 2 cooperates with and executes the programs contained in the memory 550. This enables various processes to be performed, including the processes described below, by the 3D graphic model generation unit 500a, defect model acquisition unit 500b, defect assignment unit 500c, 3DCG image generation unit 500d, first image generation unit 500e, captured image generation unit 500f, second image generation unit 500g, teacher data generation unit 500h, model learning unit 500i, and estimation unit 500j.
- the 3D graphic model generation unit 500a generates a virtual model 600, which is a 3D graphic model that represents the three-dimensional shape of the inspection object 200 in a virtual space S, based on the three-dimensional shape data of the inspection object 200 stored in the storage device 520.
- the position and orientation of the virtual model 600, which is placed in the virtual space S and simulates the inspection object 200, are set to be the same as the position and orientation of the actual inspection object 200 shown in Figure 1.
- the 3D graphic model generation unit 500a also sets the camera viewpoint position and imaging direction of the virtual imaging device 700 within the virtual space S.
- the camera viewpoint position and imaging direction of the virtual imaging device 700 are set to be the same as the camera viewpoint and imaging direction of the actual imaging device 300 shown in Figure 1.
- 3D graphic model generation unit 500a sets the position and illumination direction of first virtual light source 800A in virtual space S.
- the position and illumination direction of first virtual light source 800A are set to be the same as the position and illumination direction of real first light source 400A shown in FIG. 1.
- 3D graphic model generation unit 500a sets the position and illumination direction of second virtual light source 800B in virtual space S.
- the position and illumination direction of second virtual light source 800B are set to be the same as the position and illumination direction of real second light source 400B shown in FIG. 1.
- 3D graphic model generation unit 500a sets the position and illumination direction of third virtual light source 800C in virtual space S.
- third virtual light source 800C are set to be the same as the position and illumination direction of real third light source 400C shown in FIG. 1.
- the first virtual light source 800A, the second virtual light source 800B, and the third virtual light source 800C are collectively referred to as the multiple virtual light sources 800.
- FIG. 4 is a schematic diagram showing an example of a 3D graphic model generated within virtual space S.
- a virtual model 600 simulating the inspection object 200 a virtual imaging device 700 simulating the imaging device 300, and multiple virtual light sources 800 simulating the multiple light sources 400 are arranged.
- the multiple virtual light sources 800 include at least three virtual light sources in order to capture images of the virtual model 600 simulating the inspection object 200 using a photometric stereo method.
- virtual model 600 is placed at a position corresponding to inspection object 200 shown in FIG. 1.
- virtual imaging device 700 is placed at a position corresponding to imaging device 300 shown in FIG. 1.
- first virtual light source 800A is placed at a position corresponding to first light source 400A shown in FIG. 1.
- second virtual light source 800B is placed at a position corresponding to second light source 400B shown in FIG. 1.
- third virtual light source 800C is placed at a position corresponding to third light source 400C shown in FIG. 1.
- virtual imaging device 700 is positioned on an extension line in the +Z direction relative to virtual model 600.
- first virtual light source 800A is positioned on the +Y direction side relative to virtual model 600.
- first direction L1 in which light from first virtual light source 800A is emitted is the -Y direction and a direction tilted at -45 degrees from the horizontal direction, when the position of first virtual light source 800A is taken as the reference position.
- first direction L1 is the -Y direction with respect to the imaging direction of virtual imaging device 700 and a direction tilted at -45 degrees from the horizontal direction.
- Second virtual light source 800B is positioned on the +X side of virtual model 600.
- second direction L2 in which light from second virtual light source 800B is emitted, is the -X direction and is tilted at -45 degrees from the horizontal when the position of second virtual light source 800B is taken as the reference position.
- second direction L2 is the -X direction with respect to the imaging direction of virtual imaging device 700 and is tilted at -45 degrees from the horizontal.
- Third virtual light source 800C is positioned on the -Y side of virtual model 600.
- third direction L3 in which light from third virtual light source 800C is emitted, is the +Y direction and is tilted at -45 degrees from the horizontal when the position of third virtual light source 800C is taken as the reference position.
- third direction L3 is the +Y direction with respect to the imaging direction of virtual imaging device 700 and is tilted at -45 degrees from the horizontal.
- virtual model 600 in this embodiment is positioned so that it can be imaged from directly above by virtual imaging device 700, and so that it can be illuminated from a 45° angle above at 90° intervals in the circumferential direction by first virtual light source 800A, second virtual light source 800B, and third virtual light source 800C.
- imaging direction of imaging device 300 and the first direction L1, second direction L2, and third direction L3 of the multiple light sources 400 shown in FIG. 1 are the same as the imaging direction of virtual imaging device 700 and the first direction L1, second direction L2, and third direction L3 of the multiple virtual light sources 800 shown in FIG. 4.
- creating a deep learning model requires a large number of captured images, for example, hundreds to tens of thousands, of training data in which defects 210 in the object 200 are identified.
- the inspection object 200 is a high-quality, low-volume product, such as an aircraft part
- captured images as training data are obtained during a repair process after the aircraft part is manufactured, it is impossible to obtain training data in advance before the aircraft part is manufactured. Therefore, it has been difficult to generate the wide variety of training data required to create a deep learning model.
- this embodiment includes a defect model acquisition unit 500b that acquires a wide variety of defect models for adding a wide variety of defects to a virtual model 600, which is a 3D graphic model of the inspection object 200.
- This embodiment also includes a defect assignment unit 500c that assigns defects to the virtual model 600 based on the wide variety of defect models acquired by the defect model acquisition unit 500b.
- Figure 5 is a diagram showing an example of a defect model 620 according to this embodiment.
- the defect model 620 is, for example, a planar 3D graphic model, and is generated based on three-dimensional shape data that represents the three-dimensional shape of the defect model 620 in virtual space.
- the defect model 620 is generated by converting point cloud data, which is the three-dimensional shape data of the defect model 620, into surface data such as mesh data or surface data.
- the image of the defect model 620 shown in Figure 5 is a grayscale image, as will be described in detail below, and the pixel value of each pixel in the image of Figure 5 is expressed in 256 shades ranging from "0" to "255.” The closer the pixel value is to "0,” the closer it is to black shown in Figure 5, and the closer the pixel value is to "255,” the closer it is to white shown in Figure 5.
- the defect model 620 includes image information, maximum value information, rotation angle information, and magnification information as defect data. Note that, in this embodiment, an example will be described in which the defect model 620 is a planar 3D graphic model; however, this is not limiting, and the defect model 620 may also be a three-dimensional 3D graphic model.
- the number of point clouds per unit area of the defect model 620 is the same as the number of point clouds per unit area of the virtual model 600. However, this is not limiting, and the number of point clouds per unit area of the defect model 620 may be greater than the number of point clouds per unit area of the virtual model 600. This allows the shape of the defect 610 assigned to the virtual model 600 to be more detailed. Furthermore, the number of point clouds per unit area of the defect model 620 may be less than the number of point clouds per unit area of the virtual model 600. This allows the shape of the defect 610 assigned to the virtual model 600 to be coarser.
- the image information is, for example, the grayscale image shown in FIG. 5.
- the grayscale image includes multiple pixels.
- the total number of pixels included in the grayscale image is the same as the total number of points in the predetermined point cloud included in the defect model 620.
- a pixel value for each pixel in the grayscale image is associated with each point in the point cloud of the defect model 620.
- the pixel value of each pixel in the grayscale image is expressed in 256 tones ranging from "0" to "255.”
- the pixel value of each pixel in the grayscale image is set to a value corresponding to the depth of the defect 610 assigned to the virtual model 600. For example, the deeper the defect 610, the closer the pixel value is to "255" (white in FIG.
- each pixel in the grayscale image corresponding to each point in the point cloud of the defect model 620 is shown.
- multiple types of grayscale images are prepared in advance. Therefore, multiple types of defect models 620 can be generated in virtual space depending on the type of grayscale image.
- the maximum value information is, for example, the maximum depth value or maximum height value of the defect 610 assigned to the virtual model 600. If the defect 610 is a depression, the maximum depth value is set as the maximum value information, and if the defect 610 is a protrusion, the maximum height value is set as the maximum value information. Specifically, for example, a value of "+5" mm is set as the maximum depth value of the defect 610. Also, for example, a value of "-5" mm is set as the maximum height value of the defect 610. In other words, the "+" or "-" sign in the maximum value information determines whether the defect 610 is a depression or a protrusion.
- the rotation angle information is a value that represents the orientation of the defect model 620, and is, for example, an angle value in the range of "0" degrees to "360” degrees.
- Figure 5 shows an example where the rotation angle information is the reference angle of "0" degrees.
- the magnification information is a value that represents the magnification of the defect model 620, and for example, the magnification information may be values such as "1", "0.5", or "2".
- Figure 5 shows an example where the magnification information is "1", which is the reference magnification.
- the defect model acquisition unit 500b acquires at least one defect model 620 represented in a virtual space. For example, the defect model acquisition unit 500b acquires a defect model 620 determined in response to an operator selecting each of the image information, maximum value information, rotation angle information, and magnification information. The defect model acquisition unit 500b also acquires a defect model 620 determined in response to an automatic random selection of each of the image information, maximum value information, rotation angle information, and magnification information. The defect model acquisition unit 500b may regularly vary and combine each of the image information, maximum value information, rotation angle information, and magnification information. For example, the defect model acquisition unit 500b may fix at least one of the image information, maximum value information, rotation angle information, and magnification information, and randomly vary the information other than the fixed information.
- the defect assignment unit 500c assigns defects 610 to the virtual model 600 based on the defect model 620 acquired by the defect model acquisition unit 500b.
- the process of assigning defects 610 to the virtual model 600 based on the defect model 620 is described below.
- Figure 6 is a first diagram illustrating the positions of the virtual model 600, the duplicate model 630, and the defect model 620 in virtual space.
- Figure 7 is a second diagram illustrating the positions of the virtual model 600, the duplicate model 630, and the defect model 620 in virtual space.
- the defect imparting unit 500c generates a duplicate model 630 by duplicating a specific surface SA1, which is part of the surface of the virtual model 600.
- the duplicate model 630 is a 3D graphic model, and is generated based on three-dimensional shape data that represents the three-dimensional shape of the specific surface SA1 of the virtual model 600 in virtual space.
- the duplicate model 630 is generated by converting point cloud data, which is the three-dimensional shape data of the specific surface SA1 of the virtual model 600, into surface data.
- the defect adding unit 500c translates the replica model 630 outward from the virtual model 600 along the normal direction of the geometric center point CE0 of the specific surface SA1.
- the defect adding unit 500c also selects at least one point from a predetermined group of points included in the replica model 630.
- the group of points included in the replica model 630 is a group of points that make up the surface data of the replica model 630.
- the at least one point is a point that is automatically selected at random by the defect adding unit 500c. However, this is not limited to this, and the at least one point may also be a point that is manually selected by an operator. In the example shown in Figures 6 and 7, the defect adding unit 500c selects the geometric center point CE1 of the replica model 630.
- the defect imparting unit 500c controls the orientation of the surface of the defect model 620 so that the normal direction of the surface of the defect model 620 coincides with the normal direction passing through the geometric center point CE1 of the replica model 630.
- the defect imparting unit 500c sets the orientation of the surface of the defect model 620 so that the normal direction of the geometric center point CE2 of the surface of the defect model 620 coincides with the normal direction of the geometric center point CE1 of the replica model 630.
- the defect assignment unit 500c also sets the position of the defect model 620 so that an extension line L11 extending in the normal direction of the replicated model 630, which passes through the selected geometric center point CE1, intersects with the surface of the defect model 620. For example, as shown in FIG. 6, the defect assignment unit 500c sets the position of the defect model 620 so that the extension line L11 intersects with the geometric center point CE2 of the surface of the defect model 620.
- FIG. 8 is a diagram showing how the point cloud included in the defect model 620 is moved to the virtual model 600.
- the point cloud included in the defect model 620 is a point cloud that constitutes the surface data of the defect model 620.
- the defect assignment unit 500c moves the point cloud included in the defect model 620 in a direction R2 opposite to the normal direction R1 of the surface of the defect model 620.
- the defect imparting unit 500c stops the movement at a position where the point cloud of the defect model 620 comes into contact with the surface of the virtual model 600.
- the first point P1, second point P2, and third point P3, which are the point clouds included in the defect model 620 have moved to the positions of the first contact point P11, second contact point P12, and third contact point P13 on the surface of the virtual model 600.
- Figure 9 is a diagram illustrating the relationship between each point on the defect model 620 and the contact points on the surface of the virtual model 600.
- the solid arrows indicate the inward vectors of the virtual model 600
- the hollow arrows indicate the normal vectors of the defect model 620.
- the fourth contact point P21 is located on an extension of the normal direction of the first contact point P11.
- the fifth contact point P22 is located on an extension of the normal direction of the second contact point P12.
- the sixth contact point P23 is located on an extension of the normal direction of the third contact point P13.
- the defect assignment unit 500c determines whether the dot product of the normal vector at each point on the defect model 620 and the inward vector at each contact point on the virtual model 600 is positive or negative. If the dot product is positive, the defect assignment unit 500c deselects the point on the defect model 620 as a contact point to be moved, and if the dot product is negative, it selects the point on the defect model 620 as a contact point to be moved.
- the dot products of the first contact point P11, second contact point P12, and third contact point P13 on the surface of the virtual model 600 and the normal vectors at each point of the defect model 620 are negative. Furthermore, the dot products of the fourth contact point P21, fifth contact point P22, and sixth contact point P23 on the surface of the virtual model 600 and the normal vectors at each point of the defect model 620 are positive. Therefore, the defect assignment unit 500c selects the first contact point P11, second contact point P12, and third contact point P13 on the surface of the virtual model 600 as the contact points to which the first point P1, second point P2, and third point P3 of the defect model 620 will move. In this way, the contact points on the surface of the virtual model 600 to which each point constituting the defect model 620 will move are identified.
- the defect imparting unit 500c forms a first displacement point P31 of the defect 610 in the virtual model 600 by displacing the selected first contact point P11 inward along the normal direction starting from the first contact point P11.
- the amount of displacement from the first contact point P11 to the first displacement point P31 is determined based on the maximum value information and image information. For example, if the maximum value information is "+5" mm and the pixel value of the grayscale image corresponding to the first point P1 of the defect model 620 is "50", the defect imparting unit 500c determines a displacement amount of "0.98" mm.
- the defect imparting unit 500c forms a second displacement point P32 of the defect 610 in the virtual model 600 by displacing the selected second contact point P12 inward along the normal direction with the second contact point P12 as the base point. Furthermore, the defect imparting unit 500c forms a third displacement point P33 of the defect 610 in the virtual model 600 by displacing the selected third contact point P13 inward along the normal direction with the third contact point P13 as the base point. In this way, the defect imparting unit 500c imparts a defect 610 to the virtual model 600 by displacing points on the surface of the virtual model 600 based on the defect model 620.
- the virtual model 600 with the defect 610 imparted thereto may be referred to as a defect-added virtual model or simply as a virtual model.
- the portion of the defect-added virtual model that contains only the defect 610 may be referred to as a defect shape model.
- the defect imparting unit 500c can impart multiple types of defects 610 to the virtual model 600. This allows multiple types of virtual models 600 to be generated that have a wide variety of defects 610.
- the 3DCG image generation unit 500d emits light from one of the multiple virtual light sources 800, virtually captures an image of the virtual model 600 illuminated by the light from that one virtual light source using the virtual imaging device 700, and generates a single 3DCG image. Specifically, the 3DCG image generation unit 500d generates a 3DCG image by performing physically based rendering on the virtual model 600. Physically based rendering calculates the image captured by the virtual imaging device 700 using real-world optical laws such as reflection, transmission, and diffusion. In this way, the 3DCG image generation unit 500d generates a 3DCG image based on the virtual model 600 to which the defect 610 has been added.
- the 3DCG image generation unit 500d virtually captures an image of the virtual model 600 using the virtual imaging device 700 while changing the direction of light irradiation from the multiple virtual light sources 800, and generates multiple 3DCG images. Specifically, the 3DCG image generation unit 500d first emits light from a first virtual light source 800A of the multiple virtual light sources 800, and virtually captures an image of the virtual model 600 illuminated by the light from the first virtual light source 800A using the virtual imaging device 700, thereby generating a first 3DCG image 710.
- the 3DCG image generation unit 500d emits light from a second virtual light source 800B of the multiple virtual light sources 800, and virtually captures an image of the virtual model 600 illuminated by the light from the second virtual light source 800B using the virtual imaging device 700, thereby generating a second 3DCG image 720.
- 3DCG image generation unit 500d emits light from third virtual light source 800C of the multiple virtual light sources 800, virtually captures an image of virtual model 600 illuminated by the light from third virtual light source 800C using virtual imaging device 700, and generates third 3DCG image 730.
- the first 3DCG image 710, the second 3DCG image 720, and the third 3DCG image 730 are images virtually captured at different times. Note that the first 3DCG image 710, the second 3DCG image 720, and the third 3DCG image 730 are images virtually captured using the photometric stereo method under the same or similar capturing conditions as the first captured image, the second captured image, and the third captured image.
- FIG. 10 is a diagram showing an example of a first 3DCG image 710.
- FIG. 11 is a diagram showing an example of a second 3DCG image 720.
- FIG. 12 is a diagram showing an example of a third 3DCG image 730.
- the first 3DCG image 710, the second 3DCG image 720, and the third 3DCG image 730 include images of the virtual model 600 and the defect 610 imparted to the surface of the virtual model 600.
- virtual model 600 is illuminated by light emitted in first direction L1 from first virtual light source 800A.
- a shadow region SH is formed at the end of virtual model 600 on the first direction L1 side.
- a shadow region SH is formed inside the depression on the first direction L1 side of defect 610.
- no shadow region SH is formed inside the depression on the opposite side of defect 610 from first direction L1 due to the light being illuminated.
- virtual model 600 is illuminated by light emitted from second virtual light source 800B in second direction L2.
- a shadow region SH is formed at the end of virtual model 600 on the second direction L2 side.
- a shadow region SH is formed inside the depression on the second direction L2 side of defect 610.
- no shadow region SH is formed inside the depression on the opposite side of defect 610 from second direction L2 due to the light being illuminated.
- virtual model 600 is illuminated by light emitted from third virtual light source 800C in third direction L3.
- a shadow region SH is formed at the end of virtual model 600 on the third direction L3 side.
- a shadow region SH is formed inside the depression on the third direction L3 side of defect 610.
- no shadow region SH is formed inside the depression on the opposite side of defect 610 from third direction L3 due to the light being illuminated.
- the first image generation unit 500e generates the first image 740 based on the direction vector of the surface of the virtual model 600 derived from the first 3DCG image 710, the second 3DCG image 720, and the third 3DCG image 730.
- the method for generating the first image 740 is described in detail below.
- FIG. 13 is a diagram showing an example of a first image 740.
- the first image 740 is a so-called normal map image.
- the normal map image is an image in which a direction vector n of the surface of the inspection object 200 or the virtual model 600 is derived for each pixel of a captured image of the inspection object 200 or a 3DCG image of the virtual model 600, and visualized as RGB pixel values.
- the direction vector n of the surface of the inspection object 200 or the virtual model 600 is derived using the following equation (1).
- the first method of deriving the direction vector n of the surface of the virtual model 600 and generating the first image 740, which is a normal map image is similar to the second method of deriving the direction vector n of the surface of the inspection object 200 and generating the second image, which is a normal map image. Therefore, the first method will be described in detail below, and a detailed description of the second method will be omitted.
- FIG. 14 is an explanatory diagram illustrating the direction vector n of the surface of virtual model 600 illuminated by light from first virtual light source 800A.
- FIG. 15 is an explanatory diagram illustrating the direction vector n of the surface of virtual model 600 illuminated by light from second virtual light source 800B.
- FIG. 16 is an explanatory diagram illustrating the direction vector n of the surface of virtual model 600 illuminated by light from third virtual light source 800C.
- l (a1, a2, a3) indicates the direction vector of first virtual light source 800A.
- i A indicates the luminance value, which is the pixel value of each pixel of first 3DCG image 710.
- n (x, y, z) indicates the direction vector of the surface.
- the luminance value i is expressed as the dot product of direction vector l of first virtual light source 800A and direction vector n of the surface.
- l (b1, b2, b3) indicates the direction vector of second virtual light source 800B.
- i B indicates the luminance value, which is the pixel value of each pixel of second 3DCG image 720.
- n (x, y, z) indicates the direction vector of the surface.
- the luminance value i is expressed as the dot product of direction vector l of second virtual light source 800B and direction vector n of the surface.
- l (c1, c2, c3) indicates the direction vector of third virtual light source 800C.
- i C indicates the luminance value, which is the pixel value of each pixel of third 3DCG image 730.
- n (x, y, z) indicates the direction vector of the surface.
- the luminance value i is expressed as the dot product of direction vector l of third virtual light source 800C and direction vector n of the surface.
- first virtual light source 800A, second virtual light source 800B, and third virtual light source 800C are known, the direction vector n of the surface can be derived by solving the simultaneous equations of formula (1) above.
- the surface direction vector n derived for each pixel must be visualized as RGB pixel values.
- the normal map image is derived using the following formulas (2) to (5).
- the following formula (2) expresses the pixels of the first 3DCG image 710, the second 3DCG image 720, and the third 3DCG image 730 arranged in a row as a matrix I.
- img1 receives the luminance values of pixels 1 to p of the first 3DCG image 710.
- img2 receives the luminance values of pixels 1 to p of the second 3DCG image 720.
- img3 receives the luminance values of pixels 1 to p of the third 3DCG image 730.
- the luminance values input to pixels 1 to p are values in the range of 0 to 255 normalized to values in the range of 0.0 to 1.0.
- the following formula (3) represents a pseudo-inverse matrix L ⁇ 1 obtained by converting a matrix L representing the direction vectors of first virtual light source 800A, second virtual light source 800B, and third virtual light source 800C.
- first direction L1 of first virtual light source 800A, second direction L2 of second virtual light source 800B, and third direction L3 of third virtual light source 800C are all tilted at +45° with respect to the horizontal direction with virtual model 600 as the reference.
- first direction L1, second direction L2, and third direction L3 may be tilted at ⁇ 45° with respect to the horizontal direction, or at an angle other than 45°.
- formula (3) shows an example in which matrix L is converted into pseudo-inverse matrix L ⁇ 1 , but matrix L may also be converted into an inverse matrix.
- the following formula (4) represents the matrix product L ⁇ 1 ⁇ I, which is the product of the matrix I in formula (2) and the pseudo-inverse matrix L ⁇ 1 in formula (3). Furthermore, the following formula (5) represents the matrix product of formula (4) with the magnitude of the vector at each pixel converted to 1.
- the first image generation unit 500e can generate the first image 740, which is the normal map image shown in FIG. 13, based on the first 3DCG image 710, second 3DCG image 720, and third 3DCG image 730 shown in FIGS. 10 to 12.
- the captured image generating unit 500f generates at least three captured images with different light sources based on at least a first light source 400A, a second light source 400B, and a third light source 400C that illuminate the inspection object 200, and an imaging device 300 that captures an image of the illuminated inspection object 200.
- the at least three captured images include a first captured image, a second captured image, and a third captured image.
- the first captured image is an image captured by the imaging device 300 of the inspection object 200 illuminated by light irradiated from the first light source 400A in a first direction L1.
- the second captured image is an image captured by the imaging device 300 of the inspection object 200 illuminated by light irradiated from the second light source 400B in a second direction L2.
- the third captured image is an image captured by the imaging device 300 of the inspection object 200 illuminated by light irradiated from the third light source 400C in a third direction L3.
- the second image generation unit 500g generates a second image based on the direction vector n of the surface of the object to be inspected 200 derived from at least three captured images generated by the captured image generation unit 500f. Specifically, the second image generation unit 500g generates a second image, which is a normal map image, based on the direction vector n of the surface of the object to be inspected 200 derived from the first captured image, the second captured image, and the third captured image.
- the normal map image, which is the second image is also derived using the above formulas (2) to (5), similar to the normal map image, which is the first image 740.
- the terms used in generating the first image 740 are replaced as follows: “virtual model 600" is replaced with “object to be inspected 200.” "first 3DCG image 710” is replaced with “first captured image.” “second 3DCG image 720” is replaced with “second captured image.” “Third 3DCG image 730” is read as "third captured image”. "First virtual light source 800A” is read as “first light source 400A”. “Second virtual light source 800B” is read as “second light source 400B”. “Third virtual light source 800C” is read as "third light source 400C”. The method for generating the second image is the same as the method for generating first image 740, so a detailed description will be omitted.
- the teacher data generation unit 500h generates correct answer data indicating the position of the defect 610 in the first image 740 based on the defect information of the defect 610 assigned by the defect assignment unit 500c.
- the point cloud data which is the three-dimensional shape data of the defect 610, includes coordinate information constituting the defect 610 in three-dimensional space, as well as position information indicating the position of the defect 610 and depth information indicating its depth.
- Information about the defect 610 including such position information indicating the position of the defect 610 and depth information indicating its depth, is also referred to as defect information.
- the defect information can be derived, for example, based on a defect shape model. For example, photometric stereo photography can be performed on the defect shape model as described above, and the obtained normal map image of only the defect 610 can be used as defect information.
- the teacher data generation unit 500h can generate correct answer data based on the defect information of the defect 610.
- the correct answer data is associated with pixels corresponding to the position of defect 610 in first image 740 as an abnormal location, for example, with the numerical value "1.” Furthermore, the correct answer data is associated with pixels corresponding to positions other than defect 610 in first image 740 as a normal location, for example, with the numerical value "0.”
- the correct answer data is associated with each pixel as a numerical value between "0" and "1" other than “0” based on the depth distribution at the position of the defect 610 in the first image 740. For example, for a pixel corresponding to the position of the defect 610, the deeper the defect 610, the closer to "1" the correct answer data is associated, and the shallower the defect 610, the closer to "0" the correct answer data is associated.
- pixel values change depending on the distance from the imaging surface of the virtual imaging device 700 to the virtual model 600.
- the pixel values in the first image 740 are expressed in 256 gradations ranging from "0" to "255.”
- the depth distribution of the defect 610 can be expressed by converting the pixel values.
- the deeper the defect 610 i.e., the closer the pixel value is to "255,” the closer to "1" the correct answer data is associated.
- the shallower the defect 610 i.e., the closer the pixel value is to "0,” the closer to "0" the correct answer data is associated.
- the correct answer data may be set to "0” or "1,” depending on whether the pixel value of the pixel corresponding to the position of defect 610 is equal to or greater than a predetermined threshold value within the range of "0" to "255.” For example, if the pixel value of the pixel corresponding to the position of defect 610 is less than the threshold value, "0" may be set as the correct answer data, and if the pixel value is equal to or greater than the threshold, "1" may be set as the correct answer data.
- the teacher data generation unit 500h associates the first image 740 with the correct answer data, collectively forms the teacher data, and stores it in the storage device 520.
- the teacher data generation unit 500h generates teacher data that associates the first image 740 with defect information about the defect 610, which includes at least the position information and depth information of the defect 610.
- the teacher data generation unit 500h generates multiple pieces of such teacher data.
- the 3DCG image generation unit 500d generates multiple types of first 3DCG images 710, second 3DCG images 720, and third 3DCG images 730 based on multiple types of virtual models 600 having a wide variety of defects 610.
- the 3DCG image generation unit 500d randomly changes the parameters of the imaging conditions of the virtual imaging device 700 to generate a wide variety of first 3DCG images 710, second 3DCG images 720, and third 3DCG images 730.
- the imaging conditions include the surface optical characteristics of the inspection object 200 in the virtual model 600, the orientation of the imaging surface of the virtual imaging device 700, the orientation of the virtual light source 800, the light intensity of the virtual light source 800, etc.
- the surface optical characteristics of the inspection object 200 include, for example, surface reflectance, diffuse reflectance, surface roughness, etc.
- changing the parameters of the imaging conditions is not a required condition, and the 3DCG image generation unit 500d may generate multiple types of first 3DCG images 710, second 3DCG images 720, and third 3DCG images 730 based on multiple types of virtual models 600 in which only the parameters of the defect 610 have been changed.
- the training data generation unit 500h stores the multiple types of training data generated in the storage device 520.
- the model learning unit 500i inputs multiple types of training data stored in the storage device 520 into the test model M, and trains the test model M so that output data that approximates the correct answer data contained in the training data is obtained.
- the inspection model M has, for example, a neural network (NN).
- the neural network is a convolutional neural network (CNN) trained using supervised learning.
- CNN convolutional neural network
- neural networks other than convolutional neural networks may also be used.
- learning models other than neural networks may also be used.
- the test model M is, for example, a deep learning model used in image analysis.
- the test model M is configured, for example, by combining the structure of a neural network and parameters that represent the strength of the connections between each neuron.
- Each connection between neurons is provided with a parameter that is a coefficient.
- Each parameter is configured to be adjustable.
- the internal state of the test model M is represented by a set of numerical values that are a combination of the structure of the neural network, known as internal variables, and the parameters between each neuron.
- Fig. 17 is a diagram showing an example of the test model M.
- training data is input to the test model M, and the training data passes through the neurons N1 , N2 , N3 , N4 , N5 , N -1 , and N- M , and as described above, output data is output in which the output node values 0 to 1 are associated with each pixel.
- the test model M is trained based on training data including the first image 740 to which correct answer data has been linked in advance.
- the training data is input to the test model M, and the values of the internal variables of the test model M are set so that the error between the output data of the test model M and the correct answer data linked to the first image 740 in the training data is minimized. In this way, the test model M is trained based on multiple types of training data.
- the model learning unit 500i may use the first image 740, which is not linked to any correct answer data, as training data.
- the model learning unit 500i may input the first image 740, which is not linked to any correct answer data, into the inspection model M, and train the inspection model M so that the error between the information indicating the position of the defect 610 output from the inspection model M and the correct answer data is small.
- the first image generation unit 500e functions as the training data generation unit.
- the model learning unit 500i may use the second image as training data in addition to the first image 740.
- the model learning unit 500i may input the first image 740 and the second image into the inspection model M, and train the inspection model M so that the error between the information indicating the position of the defect 610 output from the inspection model M and the correct data is reduced.
- the first image generation unit 500e and the second image generation unit 500g function as training data generation units.
- the estimation unit 500j inputs the second image generated by the second image generation unit 500g based on the first captured image, the second captured image, and the third captured image into the inspection model M.
- the inspection model M classifies each pixel of the second image, and defects 210 in the second image, i.e., pixels corresponding to defects 210, are associated as output nodes with values greater than "0" among the numerical values "0" to "1.” Furthermore, pixels corresponding to normal areas in the second image are associated as output nodes with the numerical value "0.”
- the second image input to the inspection model M is output in a semantic segmentation output format.
- the estimation unit 500j estimates the position of the defect 210 in the object to be inspected 200 included in the second image based on the output data of the inspection model M, i.e., the numerical values "0" to "1" as the output nodes, and further estimates the depth of the defect 210. Specifically, the estimation unit 500j estimates the position of the pixel associated with the numerical value of the output node other than "0" as the position of the defect 210. The estimation unit 500j also estimates the depth of the defect 210 depending on the magnitude of the numerical value of the output node other than "0". In this way, the estimation unit 500j estimates the position and depth distribution of the defect 210 depending on the position of the pixel associated with the numerical value of the output node other than "0" and the magnitude of the numerical value of the output node other than "0".
- the estimation unit 500j displays information indicating the estimated position of the defect 210 in the inspection object 200 and information indicating the estimated depth of the defect 210 (hereinafter also referred to as estimation result data) on a display (not shown). For example, the estimation unit 500j adds a predetermined color to the position of the defect 210 and superimposes it on the second image displayed on the display. At this time, the estimation unit 500j may superimpose and display the second image displayed on the display by changing the color depending on the depth of the defect 210. For example, the estimation unit 500j may superimpose and display color information on the second image so that the deeper the defect 210, the darker the color, and the shallower the depth, the lighter the color.
- FIG. 18 is a flowchart showing an example of an image processing method according to this embodiment.
- the 3D graphic model generation unit 500a generates a virtual model 600 that represents the three-dimensional shape of the inspection object 200 in a virtual space S based on the three-dimensional shape data of the inspection object 200 (step S100).
- the defect model acquisition unit 500b acquires a defect model 620 that is represented in the virtual space S and includes defect data (step S102).
- the defect adding unit 500c adds a defect 610 to the virtual model 600 based on the defect model 620 (step S104).
- the 3DCG image generating unit 500d generates at least three 3DCG images with different virtual light sources (step S106).
- the first image generating unit 500e generates a first image 740, which is a normal map image, based on the direction vector n of the surface of the virtual model 600 derived from the at least three 3DCG images (step S108).
- the teacher data generation unit 500h generates teacher data for the first image 740 in which correct answer data indicating the position of the defect 610 is associated (step S110).
- the model learning unit 500i inputs only the teacher data generated by the teacher data generation unit 500h into the inspection model M, and trains the inspection model M (step S112).
- the captured image generation unit 500f generates at least three captured images with different light sources (step S114).
- the second image generation unit 500g generates a second image, which is a normal map image, based on the direction vector of the surface of the inspection object 200 derived from the at least three captured images (step S116).
- the estimation unit 500j inputs the second image, which is a normal map image, into the trained inspection model M, and estimates the position of the defect 210 in the inspection object 200 contained in the second image (step S118).
- the image processing device 500 of this embodiment comprises a 3D graphic model generation unit 500a, a defect model acquisition unit 500b, and a defect assignment unit 500c.
- the 3D graphic model generation unit 500a generates a virtual model 600 that represents the three-dimensional shape of the inspection object 200 in a virtual space.
- the defect model acquisition unit 500b also acquires a defect model 620 that is represented in the virtual space and includes defect data.
- the defect assignment unit 500c also assigns defects 610 to the virtual model 600 based on the defect model 620. This makes it possible to easily assign a wide variety of defects 610 to the virtual model 600 according to the wide variety of defect models 620. As a result, a wide variety of training data can be easily generated.
- the defect model 620 is configured as a plane on which the shape of the defect 610 to be added to the virtual model 600 is specified using a grayscale image.
- the pixel value of each pixel in the grayscale image is set to a value corresponding to the depth of the defect 610. This makes it possible to easily add a wide variety of defects 610 to the virtual model 600 by preparing a wide variety of grayscale images in advance.
- the defect imparting unit 500c selects at least one point from a predetermined group of points included in the replicated model 630, which is a replica of a specific surface SA1 that is part of the surface of the virtual model 600, and sets the position of the defect model 620 so that the surface of the defect model 620 intersects with the normal of the replicated model 630 that passes through the selected point.
- the replicated model 630 it is possible to easily impart defects 610 to locations such as narrow sections and edges of the virtual model 600 that are difficult to select and set manually. Therefore, it is possible to reduce the likelihood of bias in the position of the defect 610 imparted to the virtual model 600.
- the defect imparting unit 500c moves each point of the point cloud included in the surface of the defect model 620 in the normal direction of the defect model 620, and identifies the contact points where each point comes into contact with the surface of the virtual model 600. This makes it possible to easily reflect the point cloud included in the defect model 620 on the surface of the virtual model 600.
- the contact points are identified based on the dot product of the normal vector of each point in the point cloud included on the surface of the defect model 620 and the inward vector of the virtual model 600. This prevents the point cloud included in the defect model 620 from being reflected in unintended locations on the surface of the virtual model 600.
- the image processing device 500 of this embodiment also includes a 3DCG image generation unit 500d and a first image generation unit 500e.
- the 3DCG image generation unit 500d generates at least three 3DCG images with different virtual light sources 800 based on a virtual model 600 with a defect 610, at least three virtual light sources 800 that illuminate the virtual model 600 with the defect 610, and a virtual imaging device 700 that captures an image of the illuminated virtual model 600.
- the first image generation unit 500e generates a first image 740, which is a normal map as training data, based on the directional vector of the surface of the virtual model 600 derived from the at least three 3DCG images. This makes it possible to generate a wide variety of training data corresponding to a wide variety of defect models 620. As a result, a large amount of training data can be generated by simulation, allowing the inspection model M to be trained with high accuracy.
- the first image 740 and the second image input to the inspection model M are both normal map images of the same type. Therefore, the difference in appearance between the first image 740 and the second image can be reduced, and as a result, the accuracy of the position of the defect 210 in the inspection object 200 estimated by the trained inspection model M can be improved.
- training data in which correct answer data indicating the position of the defect 610 is associated with the first image 740 is used. This makes it possible to improve the accuracy of the position of the defect 610 estimated by the inspection model M.
- the present disclosure is not limited to the above embodiments. It is clear that a person skilled in the art can conceive of various modifications or alterations within the scope of the claims, and it is understood that these naturally fall within the technical scope of the present disclosure.
- a depression is formed as the defect 610.
- a protrusion may be formed as the defect 610.
- the defect 610 added to the virtual model 600 may include both a depression and a protrusion.
- This disclosure can contribute, for example, to Goal 12 of the Sustainable Development Goals (SDGs), "Ensure sustainable consumption and production patterns.”
- Image processing system 200 Inspection object 300 Imaging device 400 Multiple light sources 400A First light source 400B Second light source 400C Third light source 500 Image processing device 600 Virtual model 700 Virtual imaging device 800 Multiple virtual light sources 800A First virtual light source 800B Second virtual light source 800C Third virtual light source
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Analytical Chemistry (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Health & Medical Sciences (AREA)
- Chemical & Material Sciences (AREA)
- Immunology (AREA)
- Pathology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Biochemistry (AREA)
- Health & Medical Sciences (AREA)
- Computer Graphics (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
Abstract
画像処理装置は、検査対象物の三次元形状データに基づいて、検査対象物の三次元形状を仮想空間内に表した仮想モデル(600)を生成する仮想モデル生成部と、仮想空間内に表され、欠陥データを含む欠陥モデル(620)を取得する欠陥モデル取得部と、欠陥モデル(620)に基づいて、仮想モデル(600)に欠陥を付与する欠陥付与部と、を備える。
Description
本開示は、画像処理装置および画像処理方法に関する。本出願は2024年7月4日に提出された日本特許出願第2024-108024号に基づく優先権の利益を主張するものであり、その内容は本出願に援用される。
従来、撮像装置を用いた対象物の外観検査が行われている。例えば、特許文献1には、フォトメトリックステレオの原理を用いて取得された撮像画像を基に対象物の欠陥の有無を判定する技術について開示がある。
ところで、画像解析における深層学習モデルを用いた対象物の外観検査において、深層学習モデルを作成するためには、多種多様な教師データが必要である。しかし、対象物が例えば高品質および少量生産の製品である場合、教師データとしての撮像画像の入手自体が困難である。したがって、深層学習モデルを作成するために必要な多種多様な教師データを生成することが困難であった。
本開示は、上記のような課題を考慮して、教師データの生成を容易にすることが可能な画像処理装置および画像処理方法を提供することを目的とする。
上記課題を解決するために、本開示の一態様に係る画像処理装置は、検査対象物の三次元形状を仮想空間内に表した仮想モデルを生成する仮想モデル生成部と、仮想空間内に表され、欠陥データを含む欠陥モデルを取得する欠陥モデル取得部と、欠陥モデルに基づいて、仮想モデルに欠陥を付与する欠陥付与部と、を備える。
欠陥モデルは、仮想モデルに付与する欠陥の形状をグレースケール画像で指定した平面で構成されてもよい。
欠陥付与部は、仮想モデルの表面の一部である特定面を複製した複製モデルに含まれる予め定められた点群から少なくとも一の点を選択し、選択した点を通過する複製モデルの法線上に欠陥モデルの面が交差するように、欠陥モデルの位置を設定してもよい。
欠陥付与部は、欠陥モデルの法線方向に、欠陥モデルの面に含まれる予め定められた点群の各点を移動させ、各点が仮想モデルの表面と接触する接触点を特定してもよい。
接触点は、欠陥モデルの面に含まれる点群の各点の法線ベクトルと、仮想モデルの内向きベクトルとの内積に基づいて特定されてもよい。
欠陥が付与された仮想モデルと、欠陥が付与された仮想モデルを照明する少なくとも3つの仮想光源と、照明された仮想モデルを撮像する仮想撮像装置とに基づいて、仮想光源が異なる少なくとも3つの3DCG画像を生成する3DCG画像生成部と、少なくとも3つの3DCG画像を基に導出された仮想モデルの面の方向ベクトルに基づいて、教師データとしての画像を生成する画像生成部と、を備えてもよい。
上記課題を解決するために、本開示の一態様に係る画像処理方法は、検査対象物の三次元形状を仮想空間内に表した仮想モデルを生成するステップと、仮想空間内に表され、欠陥データを含む欠陥モデルを取得するステップと、欠陥モデルに基づいて、仮想モデルに欠陥を付与するステップと、を含む。
本開示によれば、教師データの生成を容易にすることができる。
以下に添付図面を参照しながら、本開示の実施形態について詳細に説明する。かかる実施形態に示す具体的な寸法、材料および数値等は、理解を容易とするための例示にすぎず、特に断る場合を除き、本開示を限定するものではない。なお、本明細書および図面において、実質的に同一の機能、構成を有する要素については、同一の符号を付することにより重複説明を省略し、また本開示に直接関係のない要素は図示を省略する。
図1は、本実施形態に係る画像処理システム100の概略構成図である。画像処理システム100は、検査対象物(対象物)200の外観検査を行うための検査システムである。図1中、X方向、Y方向、Z方向は、互いに直交する方向である。X方向およびY方向は水平方向であり、Z方向は上下方向である。図1に示すように、画像処理システム100は、一の撮像装置300と、複数の光源400と、画像処理装置500とを含む。
検査対象物200は、現実空間に配置され、画像処理システム100により外観検査が行われる実物の製品である。本実施形態において、検査対象物200は、例えば、一般的な工業製品である。ただし、検査対象物200は、撮像装置300で撮像できるものであればよく、工業製品に制限されない。
本実施形態では、検査対象物200の一部に、異常箇所である欠陥210が含まれる場合がある。欠陥210は、検査対象物200の表面の一部に形成され、例えば、検査対象物200の表面に形成された突出部あるいは窪み部である。検査対象物200の欠陥210は、例えば、検査対象物200が腐食により減肉すること、検査対象物200のプレス加工時に異物が挟み込まれること、検査対象物200の表面に工具が衝突することなどにより生じる。
撮像装置300は、現実空間に配置される実物のカメラである。撮像装置300は、例えば、検査対象物200に対し+Z方向の延長線上に配置される。つまり、撮像装置300のカメラ視点は、検査対象物200に対し+Z方向の延長線上に位置し、撮像装置300の撮像方向は、検査対象物200に向かって、-Z方向である。このように、本実施形態では、撮像装置300は、上方から検査対象物200を撮像する。ただし、これに限定されず、撮像装置300は、下方から検査対象物200を撮像してもよいし、側方から検査対象物200を撮像してもよい。
撮像装置300は、検査対象物200を撮像し、検査対象物200の撮像画像を生成する。撮像装置300は、生成した検査対象物200の撮像画像を画像処理装置500に出力する。本実施形態では、1つの検査対象物200に対して、1つの撮像装置300が配置される。1つの撮像装置300は、撮像範囲に検査対象物200が含まれるように、検査対象物200に対向して配置される。撮像装置300の位置を固定した状態で、検査対象物200の撮像画像が複数撮像される。
光源400は、少なくとも3つ準備される。少なくとも3つの光源を用いる理由は、検査対象物200をフォトメトリックステレオ法により撮像するためである。フォトメトリックステレオ法は、検査対象物200を異なる複数の照明方向から照明した画像を撮像し、その陰影情報から検査対象物200の面の方向ベクトルである法線ベクトルを求める三次元計測の手法の一つである。ここで、法線ベクトルは、検査対象物200の面に対して垂直方向のベクトルである。なお、フォトメトリックステレオ法は、照度差ステレオ法とも呼ばれる。
複数の光源400は、第1光源400A、第2光源400B、第3光源400Cを含む。第1光源400A、第2光源400B、第3光源400Cは、現実空間に配置される実物の光源である。第1光源400Aは、検査対象物200に対し+Y方向側に配置される。このとき、第1光源400Aの光が照射される第1方向L1は、第1光源400Aの位置を基準位置とした場合、-Y方向、かつ、水平方向に対し-45°傾斜した方向である。換言すれば、第1方向L1は、撮像装置300の撮像方向に対し、-Y方向、かつ、水平方向に対し-45°傾斜した方向である。第1光源400Aは、第1方向L1から検査対象物200を照明する。
第2光源400Bは、検査対象物200に対し+X方向側に配置される。このとき、第2光源400Bの光が照射される第2方向L2は、第2光源400Bの位置を基準位置とした場合、-X方向、かつ、水平方向に対し-45°傾斜した方向である。換言すれば、第2方向L2は、撮像装置300の撮像方向に対し、-X方向、かつ、水平方向に対し-45°傾斜した方向である。第2光源400Bは、第1方向L1と異なる第2方向L2から検査対象物200を照明する。
第3光源400Cは、検査対象物200に対し-Y方向側に配置される。このとき、第3光源400Cの光が照射される第3方向L3は、第3光源400Cの位置を基準位置とした場合、+Y方向、かつ、水平方向に対し-45°傾斜した方向である。換言すれば、第3方向L3は、撮像装置300の撮像方向に対し、+Y方向、かつ、水平方向に対し-45°傾斜した方向である。第3光源400Cは、第1方向L1および第2方向L2と異なる第3方向L3から検査対象物200を照明する。
このように、本実施形態の検査対象物200は、直上から撮像装置300により撮像可能に、また、斜め45°上方から周方向90°間隔で第1光源400A、第2光源400B、第3光源400Cにより照射可能に配置される。第1光源400A、第2光源400B、第3光源400Cの位置を固定した状態で、第1光源400A、第2光源400B、第3光源400Cのいずれかの光源から発せられる光により、検査対象物200が照明される。
なお、本実施形態では、第1光源400A、第2光源400B、第3光源400Cは、検査対象物200の周方向において、例えば0°、90°、180°など90°間隔で配置される例について説明する。ただし、これに限定されず、第1光源400A、第2光源400B、第3光源400Cは、検査対象物200の周方向において、例えば0°、120°、240°など120°の等間隔で配置されてもよい。また、複数の光源400が4つの光源から構成される場合、4つの光源は、検査対象物200の周方向において、例えば0°、90°、180°、270°など90°の等間隔で配置されてもよい。
このように、第1光源400A、第2光源400B、第3光源400Cは、互いに異なる方向から検査対象物200を照明する。本実施形態では、複数の光源400の数は、3つである。しかし、複数の光源400の数は、少なくとも3つ以上であればよく、3つに限定されない。
画像処理装置500は、撮像装置300および複数の光源400と電気的に接続し、撮像装置300および複数の光源400を制御する。画像処理装置500は、検査対象物200をフォトメトリックステレオ法により撮像するために、少なくとも3つの異なるタイミングで、それぞれ異なる照明方向から検査対象物200を照明するように、撮像装置300および複数の光源400を制御する。
具体的に、画像処理装置500は、第1タイミングで第1光源400Aから検査対象物200に第1方向L1の光を照射させ、照明された検査対象物200の第1の撮像画像を取得するように制御する。また、画像処理装置500は、第1タイミングと異なる第2タイミングで第2光源400Bから検査対象物200に第2方向L2の光を照射させ、照明された検査対象物200の第2の撮像画像を取得するように制御する。第2タイミングは、例えば、第1タイミングの後のタイミングである。また、画像処理装置500は、第1タイミングおよび第2タイミングと異なる第3タイミングで第3光源400Cから検査対象物200に第3方向L3の光を照射させ、照明された検査対象物200の第3の撮像画像を取得するように制御する。第3タイミングは、例えば、第2タイミングの後のタイミングである。
図2は、本実施形態に係る画像処理システム100の概略ブロック図である。図2に示すように、画像処理装置500は、I/F510と、記憶装置520と、システムバス530と、1つまたは複数のプロセッサ540と、1つまたは複数のメモリ550とを含む。I/F510は、撮像装置300、第1光源400A、第2光源400B、第3光源400Cと通信を行うためのインターフェースである。なお、本実施形態に係る画像処理装置500は、詳しくは後述するように教師データを生成する生成装置としても機能する。
記憶装置520は、RAM、フラッシュメモリ、HDD等で構成され、以下に示すプロセッサ540の処理に必要な様々な情報を保持する。具体的に、記憶装置520には、三次元形状データが記憶されている。三次元形状データは、2点を含む線情報や面情報の集合体として表されるデータであり、例えば、後述する仮想モデル600の三次元形状を特定することが可能なデータである。三次元形状データは、例えば、X,Y,Zで表される三次元座標で構成された点の集合体である点群データを含む。この点群データを面データに変換したものが、3Dグラフィックモデルである。面データは、3Dグラフィックモデルの面を形成するデータであり、例えば、メッシュデータ、あるいは、サーフェスデータである。3Dグラフィックモデルは、点群データをメッシュデータ、あるいは、サーフェスデータに変換することで生成される。本実施形態では、記憶装置520には、検査対象物200の三次元形状を表す三次元形状データが記憶されている。本実施形態の三次元形状データは、例えば、3DCADデータである。ただし、これに限定されず、三次元形状データは、レーザ変位計やステレオ撮像装置等の三次元光学計測器やX線CT装置などを用いて、検査対象物200、および、欠陥210を測定した3Dデータであってもよい。
システムバス530は、I/F510、記憶装置520、プロセッサ540、メモリ550を電気的に接続し、これらの間でデータを伝送する伝送路である。
プロセッサ540は、例えば、CPU(Central Processing Unit)を含む。メモリ550は、例えば、ROM(Read Only Memory)およびRAM(Random Access Memory)などを含む。ROMは、CPUが使用するプログラムおよび演算パラメータ等を記憶する記憶素子である。RAMは、CPUにより実行される処理に用いられる変数およびパラメータ等のデータを一時記憶する記憶素子である。
図3は、本実施形態に係る画像処理装置500の機能構成の一例を示すブロック図である。例えば、図3に示されるように、画像処理装置500は、3Dグラフィックモデル生成部(仮想モデル生成部)500a、欠陥モデル取得部500b、欠陥付与部500c、3DCG画像生成部500d、第1画像生成部(画像生成部)500e、撮像画像生成部500f、第2画像生成部500g、教師データ生成部500h、モデル学習部500i、推定部500jを含む。
図2で示したプロセッサ540は、メモリ550に含まれるプログラムと協働し、メモリ550に含まれるプログラムを実行する。これにより、上記の3Dグラフィックモデル生成部500a、欠陥モデル取得部500b、欠陥付与部500c、3DCG画像生成部500d、第1画像生成部500e、撮像画像生成部500f、第2画像生成部500g、教師データ生成部500h、モデル学習部500i、推定部500jにより行われる以下で説明する処理を含む各種処理が実現される。
3Dグラフィックモデル生成部500aは、記憶装置520に記憶される検査対象物200の三次元形状データに基づいて、検査対象物200の三次元形状を仮想空間S内に表した3Dグラフィックモデルである仮想モデル600を生成する。仮想空間S内に設けられる検査対象物200を模した仮想モデル600の位置および向きは、図1に示される実物の検査対象物200の位置および向きと同じになるように設定される。
また、3Dグラフィックモデル生成部500aは、仮想空間S内における仮想撮像装置700のカメラ視点の位置および撮像方向を設定する。ここで、仮想撮像装置700のカメラ視点の位置および撮像方向は、図1に示される実物の撮像装置300のカメラ視点および撮像方向と同じになるように設定される。
また、3Dグラフィックモデル生成部500aは、仮想空間S内における第1仮想光源800Aの位置および照射方向を設定する。ここで、第1仮想光源800Aの位置および照射方向は、図1に示される実物の第1光源400Aの位置および照射方向と同じになるように設定される。3Dグラフィックモデル生成部500aは、仮想空間S内における第2仮想光源800Bの位置および照射方向を設定する。ここで、第2仮想光源800Bの位置および照射方向は、図1に示される実物の第2光源400Bの位置および照射方向と同じになるように設定される。3Dグラフィックモデル生成部500aは、仮想空間S内における第3仮想光源800Cの位置および照射方向を設定する。ここで、第3仮想光源800Cの位置および照射方向は、図1に示される実物の第3光源400Cの位置および照射方向と同じになるように設定される。第1仮想光源800A、第2仮想光源800B、第3仮想光源800Cをまとめて、複数の仮想光源800とも呼ぶ。
図4は、仮想空間S内に生成された3Dグラフィックモデルの一例を示す概略構成図である。図4に示すように、仮想空間Sには、検査対象物200を模した仮想モデル600、撮像装置300を模した仮想撮像装置700、複数の光源400を模した複数の仮想光源800が配置される。なお、複数の仮想光源800は、検査対象物200を模した仮想モデル600をフォトメトリックステレオ法により撮像するため、少なくとも3つの仮想光源を含む。
仮想空間S内のXYZ座標において、仮想モデル600は、図1に示す検査対象物200と対応する位置に配置される。また、仮想空間S内のXYZ座標において、仮想撮像装置700は、図1に示す撮像装置300と対応する位置に配置される。仮想空間S内のXYZ座標において、第1仮想光源800Aは、図1に示す第1光源400Aと対応する位置に配置される。仮想空間S内のXYZ座標において、第2仮想光源800Bは、図1に示す第2光源400Bと対応する位置に配置される。仮想空間S内のXYZ座標において、第3仮想光源800Cは、図1に示す第3光源400Cと対応する位置に配置される。
本実施形態では、仮想撮像装置700は、仮想モデル600に対し+Z方向の延長線上に配置される。また、第1仮想光源800Aは、仮想モデル600に対し+Y方向側に配置される。このとき、第1仮想光源800Aの光が照射される第1方向L1は、第1仮想光源800Aの位置を基準位置とした場合、-Y方向、かつ、水平方向に対し-45°傾斜した方向である。換言すれば、第1方向L1は、仮想撮像装置700の撮像方向に対し、-Y方向、かつ、水平方向に対し-45°傾斜した方向である。
第2仮想光源800Bは、仮想モデル600に対し+X方向側に配置される。このとき、第2仮想光源800Bの光が照射される第2方向L2は、第2仮想光源800Bの位置を基準位置とした場合、-X方向、かつ、水平方向に対し-45°傾斜した方向である。換言すれば、第2方向L2は、仮想撮像装置700の撮像方向に対し、-X方向、かつ、水平方向に対し-45°傾斜した方向である。第3仮想光源800Cは、仮想モデル600に対し-Y方向側に配置される。このとき、第3仮想光源800Cの光が照射される第3方向L3は、第3仮想光源800Cの位置を基準位置とした場合、+Y方向、かつ、水平方向に対し-45°傾斜した方向である。換言すれば、第3方向L3は、仮想撮像装置700の撮像方向に対し、+Y方向、かつ、水平方向に対し-45°傾斜した方向である。
このように、本実施形態の仮想モデル600は、直上から仮想撮像装置700により撮像可能に、また、斜め45°上方から周方向90°間隔で第1仮想光源800A、第2仮想光源800B、第3仮想光源800Cにより照射可能に配置される。
なお、図1に示す撮像装置300の撮像方向および複数の光源400の第1方向L1、第2方向L2、第3方向L3は、図4に示す仮想撮像装置700の撮像方向および複数の仮想光源800の第1方向L1、第2方向L2、第3方向L3と同じである。
ところで、画像解析における深層学習モデルを用いた検査対象物200の外観検査において、深層学習モデルを作成するためには、検査対象物200の欠陥210が判明している教師データとしての撮像画像が、例えば数百~数万枚と非常に多く必要である。
しかし、検査対象物200が例えば航空部品のように高品質および少量生産の製品である場合、教師データとしての撮像画像の入手自体が困難である。さらに、航空部品の製造後の補修工程で教師データとしての撮像画像が得られる場合、航空部品の製造前における教師データの事前入手自体が不可能である。したがって、深層学習モデルを作成するために必要な多種多様な教師データを生成することが困難であった。
そこで、本実施形態は、検査対象物200の3Dグラフィックモデルである仮想モデル600に対し多種多様な欠陥を付与するための多種多様な欠陥モデルを取得する欠陥モデル取得部500bを備える。また、本実施形態は、欠陥モデル取得部500bにより取得された多種多様な欠陥モデルに基づいて、仮想モデル600に対し欠陥を付与する欠陥付与部500cを備える。欠陥モデル取得部500bにより多種多様な欠陥モデルを取得し、欠陥付与部500cにより多種多様な欠陥モデルに基づく多種多様な欠陥を仮想モデル600に付与することで、多種多様な教師データとしての画像を得ることができる。その結果、深層学習モデルを容易に作成することができる。
図5は、本実施形態に係る欠陥モデル620の一例を示す図である。欠陥モデル620は、例えば、平面の3Dグラフィックモデルであり、仮想空間内における欠陥モデル620の三次元形状を表す三次元形状データに基づいて生成される。具体的に、欠陥モデル620の三次元形状データである点群データを、メッシュデータや、サーフェスデータなどの面データに変換することで欠陥モデル620が生成される。図5に示される欠陥モデル620の画像は、詳しくは後述するようにグレースケール画像であり、図5の画像の各画素の画素値が「0」~「255」までの256階調で表されている。画素値が「0」に近づくほど、図5に示される黒色に近づき、画素値が「255」に近づくほど、図5に示される白色に近づく。欠陥モデル620には、欠陥データとして、点群データの他に、画像情報、最大値情報、回転角情報、および、倍率情報が含まれる。なお、本実施形態では、欠陥モデル620が平面の3Dグラフィックモデルである例について説明するが、これに限定されず、欠陥モデル620は、立体的な3Dグラフィックモデルであってもよい。また、欠陥モデル620の単位面積当たりの点群の数は、仮想モデル600の単位面積当たりの点群の数と同じである。ただし、これに限定されず、欠陥モデル620の単位面積当たりの点群の数は、仮想モデル600の単位面積当たりの点群の数より多くてもよい。これにより、仮想モデル600に付与する欠陥610の形状をきめ細かくすることができる。また、欠陥モデル620の単位面積当たりの点群の数は、仮想モデル600の単位面積当たりの点群の数より少なくてもよい。これにより、仮想モデル600に付与する欠陥610の形状を粗くすることができる。
画像情報は、例えば、図5に示されるグレースケール画像である。グレースケール画像は、複数の画素を含む。グレースケール画像に含まれる総画素数と、欠陥モデル620に含まれる予め定められた点群の点の総数とは同じである。また、欠陥モデル620の点群の各点に対応して、グレースケール画像の各画素の画素値が紐付けられている。グレースケール画像の各画素の画素値は、「0」~「255」までの256階調で表される。グレースケール画像の各画素の画素値には、仮想モデル600に付与する欠陥610の深さに応じた値が設定される。例えば、欠陥610の深さが深いほど画素値が「255」(図5中、白色)に近づき、欠陥610の深さが浅いほど画素値が「0」(図5中、黒色)に近づく。図5に示す例では、欠陥モデル620の点群の各点に対応するグレースケール画像の各画素が表されている。本実施形態では、予め複数種類のグレースケール画像が用意されている。そのため、グレースケール画像の種類に応じ、仮想空間内に複数種類の欠陥モデル620を生成することができる。
最大値情報は、例えば、仮想モデル600に付与する欠陥610の最大深さの値、あるいは、最大高さの値である。欠陥610が窪み部である場合、最大深さの値が最大値情報に設定され、欠陥610が突出部である場合、最大高さの値が最大値情報に設定される。具体的に、欠陥610の最大深さの値として、例えば、「+5」mmという値が、最大値情報に設定される。また、欠陥610の最大高さの値として、例えば、「-5」mmという値が、最大値情報に設定される。つまり、最大値情報の「+」または「-」の記号により、欠陥610が窪み部であるのか、突出部であるのかが決定される。
回転角情報は、欠陥モデル620の向きを表す値であり、例えば、「0」°~「360」°の範囲におけるいずれかの角度の値である。図5では、回転角情報が基準角度である「0」°である場合の例を示している。
倍率情報は、欠陥モデル620の倍率を表す値であり、例えば、倍率情報は、「1」倍、「0.5」倍、「2」倍などの値である。図5では、倍率情報が基準倍率である「1」倍である場合の例を示している。
欠陥モデル取得部500bは、仮想空間内に表される少なくとも一の欠陥モデル620を取得する。欠陥モデル取得部500bは、例えば、画像情報、最大値情報、回転角情報、および、倍率情報のそれぞれが作業者により選択されたことに応じて決定された欠陥モデル620を取得する。また、欠陥モデル取得部500bは、例えば、画像情報、最大値情報、回転角情報、および、倍率情報のそれぞれがランダムに自動選択されたことに応じて決定された欠陥モデル620を取得する。なお、欠陥モデル取得部500bは、画像情報、最大値情報、回転角情報、および、倍率情報のそれぞれを、規則性をもって変化させて組み合わせてもよい。例えば、欠陥モデル取得部500bは、画像情報、最大値情報、回転角情報、および、倍率情報のうち少なくとも一つの情報を固定にし、当該固定にした情報以外の情報をランダムに変化させるようにしてもよい。
欠陥付与部500cは、欠陥モデル取得部500bにより取得された欠陥モデル620に基づいて、仮想モデル600に欠陥610を付与する。以下、欠陥モデル620に基づく仮想モデル600の欠陥610の付与処理について説明する。
図6は、仮想空間内における仮想モデル600、複製モデル630、および、欠陥モデル620の位置を説明するための第1図である。図7は、仮想空間内における仮想モデル600、複製モデル630、および、欠陥モデル620の位置を説明するための第2図である。
図6および図7に示すように、欠陥付与部500cは、仮想モデル600の表面の一部である特定面SA1を複製した複製モデル630を生成する。複製モデル630は、3Dグラフィックモデルであり、仮想空間内における仮想モデル600の特定面SA1の三次元形状を表す三次元形状データに基づいて生成される。具体的に、仮想モデル600の特定面SA1の三次元形状データである点群データを、面データに変換することで複製モデル630が生成される。
欠陥付与部500cは、特定面SA1の幾何中心点CE0の法線方向に沿って、複製モデル630を仮想モデル600の外方に平行移動させる。また、欠陥付与部500cは、複製モデル630に含まれる予め定められた点群のうち少なくとも一の点を選択する。ここで、複製モデル630に含まれる点群は、複製モデル630の面データを構成する点群である。少なくとも一の点は、欠陥付与部500cによりランダムに自動選択される点である。ただし、これに限定されず、少なくとも一の点は、作業者により手動選択された点であってもよい。図6および図7に示す例では、欠陥付与部500cは、複製モデル630の幾何中心点CE1を選択する。
欠陥付与部500cは、欠陥モデル620の面の法線方向を、複製モデル630の幾何中心点CE1を通る法線方向と一致させるように、欠陥モデル620の面の向きを制御する。例えば、欠陥付与部500cは、欠陥モデル620の面の幾何中心点CE2の法線方向を、複製モデル630の幾何中心点CE1の法線方向と一致させるように、欠陥モデル620の面の向きを設定する。
また、欠陥付与部500cは、選択した幾何中心点CE1を通過する複製モデル630の法線方向に延在する延在線L11と、欠陥モデル620の面が交差するように、欠陥モデル620の位置を設定する。例えば、欠陥付与部500cは、図6に示すように、延在線L11と欠陥モデル620の面の幾何中心点CE2が交差するように、欠陥モデル620の位置を設定する。
図8は、欠陥モデル620に含まれる点群を仮想モデル600に移動する様子を示す図である。ここで、欠陥モデル620に含まれる点群は、欠陥モデル620の面データを構成する点群である。図8に示すように、欠陥付与部500cは、欠陥モデル620に含まれる点群を、欠陥モデル620の面の法線方向R1と逆方向R2に向かって移動させる。
また、欠陥付与部500cは、欠陥モデル620の点群が仮想モデル600の表面と接触する位置で移動を停止させる。図8に示す例では、欠陥モデル620に含まれる点群である第1点P1、第2点P2、第3点P3が、仮想モデル600の表面の第1接触点P11、第2接触点P12、第3接触点P13の位置まで移動している。ここで、仮想モデル600の表面には、欠陥モデル620の各点が接触可能な2つの接触点がある。
図9は、欠陥モデル620の各点と仮想モデル600の表面の接触点との関係を説明するための図である。図9中、黒塗り矢印は、仮想モデル600の内向きベクトルを示し、白抜き矢印は、欠陥モデル620の法線ベクトルを示している。
図9に示すように、仮想モデル600の表面において、第1接触点P11の法線方向の延長線上には、第4接触点P21がある。また、第2接触点P12の法線方向の延長線上には、第5接触点P22がある。また、第3接触点P13の法線方向の延長線上には、第6接触点P23がある。
欠陥付与部500cは、欠陥モデル620の各点における法線ベクトルと仮想モデル600の各接触点における内向きベクトルの内積の正負を判定する。欠陥付与部500cは、内積が正である場合、欠陥モデル620の点を移動させる接触点として選択を解除し、内積が負である場合、欠陥モデル620の点を移動させる接触点として選択する。
図9に示す例では、仮想モデル600の表面における第1接触点P11、第2接触点P12、第3接触点P13において欠陥モデル620の各点における法線ベクトルとの内積が負となる。また、仮想モデル600の表面における第4接触点P21、第5接触点P22、第6接触点P23において欠陥モデル620の各点における法線ベクトルとの内積が正となる。そのため、欠陥付与部500cは、仮想モデル600の表面における第1接触点P11、第2接触点P12、第3接触点P13を、欠陥モデル620の第1点P1、第2点P2、第3点P3を移動させる接触点として選択する。こうして、仮想モデル600の表面において、欠陥モデル620を構成する各点の移動先である接触点が特定される。
欠陥付与部500cは、図9に示すように、選択した第1接触点P11を、第1接触点P11を基点とする法線方向に沿って内向きに変移させることで、仮想モデル600の欠陥610の第1変位点P31を形成する。第1接触点P11から第1変位点P31への変位量は、最大値情報および画像情報に基づいて決定される。例えば、最大値情報が「+5」mmであり、欠陥モデル620の第1点P1に対応するグレースケール画像の画素値が「50」である場合、欠陥付与部500cは、「0.98」mmの変位量を決定する。
同様に、欠陥付与部500cは、選択した第2接触点P12を、第2接触点P12を基点とする法線方向に沿って内向きに変移させることで、仮想モデル600の欠陥610の第2変位点P32を形成する。また、欠陥付与部500cは、選択した第3接触点P13を、第3接触点P13を基点とする法線方向に沿って内向きに変移させることで、仮想モデル600の欠陥610の第3変位点P33を形成する。このようにして、欠陥付与部500cは、欠陥モデル620に基づいて、仮想モデル600の表面の点を変位させることで、仮想モデル600に欠陥610を付与する。以下、欠陥610が付与された仮想モデル600を、欠陥付仮想モデル、あるいは、単に仮想モデルという場合がある。また、欠陥付仮想モデルのうち、欠陥610のみの部分を、欠陥形状モデルという場合がある。
欠陥モデル620の画像情報が予め複数種類用意されていることから、欠陥付与部500cは、仮想モデル600に複数種類の欠陥610を付与することができる。これにより、多種多様な欠陥610を有する複数種類の仮想モデル600が生成される。
3DCG画像生成部500dは、複数の仮想光源800のうち1つの仮想光源から光を照射させ、当該1つの仮想光源からの光により照明された仮想モデル600を仮想撮像装置700により仮想的に撮像し、1つの3DCG画像を生成する。具体的に、3DCG画像生成部500dは、仮想モデル600で物理ベースレンダリングを行うことで3DCG画像を生成する。物理ベースレンダリングは、反射、透過、拡散といった現実世界の光学法則により、仮想撮像装置700による撮像画像を計算することである。このように、3DCG画像生成部500dは、欠陥610が付与された仮想モデル600を基に、3DCG画像を生成する。
3DCG画像生成部500dは、複数の仮想光源800の光を照射する照射方向を変えながら、仮想モデル600を仮想撮像装置700により仮想的に撮像し、複数の3DCG画像を生成する。具体的に、まず、3DCG画像生成部500dは、複数の仮想光源800のうち第1仮想光源800Aから光を照射させ、第1仮想光源800Aからの光により照明された仮想モデル600を仮想撮像装置700により仮想的に撮像し、第1の3DCG画像710を生成する。つぎに、3DCG画像生成部500dは、複数の仮想光源800のうち第2仮想光源800Bから光を照射させ、第2仮想光源800Bからの光により照明された仮想モデル600を仮想撮像装置700により仮想的に撮像し、第2の3DCG画像720を生成する。最後に、3DCG画像生成部500dは、複数の仮想光源800のうち第3仮想光源800Cから光を照射させ、第3仮想光源800Cからの光により照明された仮想モデル600を仮想撮像装置700により仮想的に撮像し、第3の3DCG画像730を生成する。
第1の3DCG画像710、第2の3DCG画像720、第3の3DCG画像730は、それぞれ異なるタイミングで仮想的に撮像された画像である。なお、第1の3DCG画像710、第2の3DCG画像720、第3の3DCG画像730は、第1の撮像画像、第2の撮像画像、第3の撮像画像と同一あるいは近似した撮像条件、かつ、フォトメトリックステレオ法により仮想的に撮像された画像である。
図10は、第1の3DCG画像710の一例を示す図である。図11は、第2の3DCG画像720の一例を示す図である。図12は、第3の3DCG画像730の一例を示す図である。図10~図12に示すように、第1の3DCG画像710、第2の3DCG画像720、第3の3DCG画像730には、仮想モデル600および仮想モデル600の表面に付与された欠陥610の画像が含まれる。
図10に示されるように、仮想モデル600は、第1仮想光源800Aから第1方向L1に照射される光により照明される。その結果、図10に示されるように、仮想モデル600のうち第1方向L1側の端部において、ハッチングで示される影領域SHが形成される。また、欠陥610のうち第1方向L1側の窪みの内側に、ハッチングで示される影領域SHが形成される。また、欠陥610のうち第1方向L1側と反対側の窪みの内側には、光が照明されることにより影領域SHが形成されていない。
図11に示されるように、仮想モデル600は、第2仮想光源800Bから第2方向L2に照射される光により照明される。その結果、図11に示されるように、仮想モデル600のうち第2方向L2側の端部において、ハッチングで示される影領域SHが形成される。また、欠陥610のうち第2方向L2側の窪みの内側に、ハッチングで示される影領域SHが形成される。また、欠陥610のうち第2方向L2側と反対側の窪みの内側には、光が照明されることにより影領域SHが形成されていない。
図12に示されるように、仮想モデル600は、第3仮想光源800Cから第3方向L3に照射される光により照明される。その結果、図12に示されるように、仮想モデル600のうち第3方向L3側の端部において、ハッチングで示される影領域SHが形成される。また、欠陥610のうち第3方向L3側の窪みの内側に、ハッチングで示される影領域SHが形成される。また、欠陥610のうち第3方向L3側と反対側の窪みの内側には、光が照明されることにより影領域SHが形成されていない。
第1画像生成部500eは、第1の3DCG画像710、第2の3DCG画像720、第3の3DCG画像730を基に導出された仮想モデル600の面の方向ベクトルに基づいて、第1画像740を生成する。以下、第1画像740の生成方法について詳細に説明する。
図13は、第1画像740の一例を示す図である。第1画像740は、所謂、ノーマルマップ画像と呼ばれる画像である。ノーマルマップ画像は、検査対象物200を撮像した撮像画像あるいは仮想モデル600を撮像した3DCG画像の画素ごとに、検査対象物200あるいは仮想モデル600の面の方向ベクトルnを導出し、RGB画素値として可視化した画像である。検査対象物200あるいは仮想モデル600の面の方向ベクトルnは、下記数式(1)により導出される。なお、仮想モデル600の面の方向ベクトルnを導出し、ノーマルマップ画像である第1画像740を生成する第1方法は、検査対象物200の面の方向ベクトルnを導出し、ノーマルマップ画像である第2画像を生成する第2方法と同様である。そのため、以下では、第1方法について詳細に説明し、第2方法の詳細については説明を省略する。
図14は、第1仮想光源800Aからの光により照明された仮想モデル600の面の方向ベクトルnを説明するための説明図である。図15は、第2仮想光源800Bからの光により照明された仮想モデル600の面の方向ベクトルnを説明するための説明図である。図16は、第3仮想光源800Cからの光により照明された仮想モデル600の面の方向ベクトルnを説明するための説明図である。
図14中、l=(a1,a2,a3)は、第1仮想光源800Aの方向ベクトルを示す。i=Aは、第1の3DCG画像710の各画素の画素値である輝度値を示す。n=(x,y,z)は、面の方向ベクトルを示す。第1仮想光源800Aの方向ベクトルlと、輝度値iと、面の方向ベクトルnは、i=n・lの関係にある。つまり、輝度値iは、第1仮想光源800Aの方向ベクトルlと面の方向ベクトルnの内積で表される。
図15中、l=(b1,b2,b3)は、第2仮想光源800Bの方向ベクトルを示す。i=Bは、第2の3DCG画像720の各画素の画素値である輝度値を示す。n=(x,y,z)は、面の方向ベクトルを示す。第2仮想光源800Bの方向ベクトルlと、輝度値iと、面の方向ベクトルnは、i=n・lの関係にある。つまり、輝度値iは、第2仮想光源800Bの方向ベクトルlと面の方向ベクトルnの内積で表される。
図16中、l=(c1,c2,c3)は、第3仮想光源800Cの方向ベクトルを示す。i=Cは、第3の3DCG画像730の各画素の画素値である輝度値を示す。n=(x,y,z)は、面の方向ベクトルを示す。第3仮想光源800Cの方向ベクトルlと、輝度値iと、面の方向ベクトルnは、i=n・lの関係にある。つまり、輝度値iは、第3仮想光源800Cの方向ベクトルlと面の方向ベクトルnの内積で表される。
第1仮想光源800A、第2仮想光源800B、第3仮想光源800Cの方向ベクトルl、輝度値iが既知であることから、上記数式(1)の連立方程式を解くことで面の方向ベクトルnを導出することができる。
ノーマルマップ画像の生成には、画素ごとに導出された面の方向ベクトルnをRGB画素値として可視化する必要がある。本実施形態では、ノーマルマップ画像は、下記数式(2)~数式(5)により導出される。
下記数式(2)は、第1の3DCG画像710、第2の3DCG画像720、第3の3DCG画像730の各画素を一列に並べたものを行列Iで表したものである。数式(2)中、img1には、第1の3DCG画像710の画素1~画素pの輝度値が入力されている。img2には、第2の3DCG画像720の画素1~画素pの輝度値が入力されている。img3には、第3の3DCG画像730の画素1~画素pの輝度値が入力されている。画素1~画素pに入力される輝度値は、0~255の範囲の値が、0.0~1.0の範囲の値に正規化された値である。
下記数式(3)は、第1仮想光源800A、第2仮想光源800B、第3仮想光源800Cの方向ベクトルを表した行列Lを変換した疑似逆行列L-1を表したものである。なお、ここでは、第1仮想光源800Aの第1方向L1、第2仮想光源800Bの第2方向L2、第3仮想光源800Cの第3方向L3は、いずれも仮想モデル600を基準として水平方向に対し+45°傾斜している場合について説明する。しかし、これに限定されず、第1方向L1、第2方向L2、第3方向L3は、水平方向に対し-45°に傾斜していてもよいし、45°以外の角度で傾斜していてもよい。また、数式(3)では、行列Lを疑似逆行列L-1に変換した例を示しているが、行列Lを逆行列に変換してもよい。
下記数式(4)は、数式(2)の行列Iと数式(3)の疑似逆行列L-1の積である行列積L-1・Iを表すものである。また、下記数式(5)は、数式(4)の行列積の各画素におけるベクトルの大きさを1に変換したものを表している。
ノーマルマップ画像は、上記数式(5)の行列の最小値~最大値の範囲の値を、0~255の範囲の値に正規化することで、(R,G,B)=(x,y,z)としたものである。このようにして、第1画像生成部500eは、図10~図12に示す第1の3DCG画像710、第2の3DCG画像720、第3の3DCG画像730を基に、図13に示すノーマルマップ画像である第1画像740を生成することができる。
撮像画像生成部500fは、検査対象物200を照明する少なくとも第1光源400A、第2光源400B、第3光源400Cと、照明された検査対象物200を撮像する撮像装置300とに基づいて、光源が異なる少なくとも3つの撮像画像を生成する。少なくとも3つの撮像画像には、第1の撮像画像、第2の撮像画像、第3の撮像画像が含まれる。第1の撮像画像は、第1光源400Aから第1方向L1に照射される光により照明された検査対象物200を撮像装置300により撮像した画像である。第2の撮像画像は、第2光源400Bから第2方向L2に照射される光により照明された検査対象物200を撮像装置300により撮像した画像である。第3の撮像画像は、第3光源400Cから第3方向L3に照射される光により照明された検査対象物200を撮像装置300により撮像した画像である。
第2画像生成部500gは、撮像画像生成部500fにより生成された少なくとも3つの撮像画像を基に導出された検査対象物200の面の方向ベクトルnに基づいて、第2画像を生成する。具体的に、第2画像生成部500gは、第1の撮像画像、第2の撮像画像、第3の撮像画像を基に導出された検査対象物200の面の方向ベクトルnに基づいて、ノーマルマップ画像である第2画像を生成する。第2画像であるノーマルマップ画像も、第1画像740であるノーマルマップ画像と同様に、上記数式(2)~数式(5)により導出される。第2画像の生成において、第1画像740の生成で使用した用語は、以下のように読み替える。「仮想モデル600」は、「検査対象物200」と読み替える。「第1の3DCG画像710」は、「第1の撮像画像」と読み替える。「第2の3DCG画像720」は、「第2の撮像画像」と読み替える。「第3の3DCG画像730」は、「第3の撮像画像」と読み替える。「第1仮想光源800A」は、「第1光源400A」と読み替える。「第2仮想光源800B」は、「第2光源400B」と読み替える。「第3仮想光源800C」は、「第3光源400C」と読み替える。第2画像を生成する方法は、第1画像740を生成する方法と同様であるため、詳細な説明を省略する。
教師データ生成部500hは、欠陥付与部500cにより付与された欠陥610の欠陥情報に基づいて、第1画像740の欠陥610の位置を示す正解データを生成する。ここで、欠陥610の三次元形状データである点群データには、三次元空間における欠陥610を構成する座標の情報が含まれ、欠陥610の位置を示す位置情報や深さを示す深さ情報が含まれる。このような欠陥610の位置を示す位置情報および深さを示す深さ情報を含む欠陥610に関する情報を、欠陥情報ともいう。欠陥情報は、例えば、欠陥形状モデルを基に導出することができる。例えば、欠陥形状モデルに対し、上述したようにフォトメトリックステレオ撮影を行い、得られた欠陥610のみのノーマルマップ画像を欠陥情報として使用してもよい。教師データ生成部500hは、欠陥610の欠陥情報を基に正解データを生成することができる。
正解データは、第1画像740の欠陥610の位置に対応する画素については、異常箇所であるとして、例えば、数値の「1」が紐付けられる。また、正解データは、第1画像740の欠陥610以外の位置に対応する画素については、正常箇所であるとして、例えば、数値の「0」が紐付けられる。
また、正解データは、第1画像740の欠陥610の位置における深さ分布に基づいて、各画素に「0」~「1」のうち「0」以外の数値が紐付けられる。例えば、正解データは、欠陥610の位置に対応する画素について、欠陥610の深さが深いほど「1」に近い数値が紐付けられ、欠陥610の深さが浅いほど「0」に近い数値が紐付けられる。
第1画像740では、仮想撮像装置700の撮像面から仮想モデル600までの距離に応じて画素値が変化する。例えば、第1画像740は、「0」~「255」までの256階調で画素値が表される。ここで、例えば、仮想撮像装置700の撮像面からの距離が近いほど画素値が「0」に近づき、撮像面から距離が遠いほど画素値が「255」に近づくとする。第1画像740の画素値が仮想撮像装置700の撮像面からの距離に関する距離情報を含むため、欠陥610の深さ分布は、画素値を換算して表すことができる。
例えば、正解データは、欠陥610の位置に対応する画素について、欠陥610の深さが深いほど、すなわち、画素値が「255」に近いほど、「1」に近い数値が紐付けられる。また、正解データは、欠陥610の位置に対応する画素について、欠陥610の深さが浅いほど、すなわち、画素値が「0」に近いほど、「0」に近い数値が紐付けられる。ただし、これに限定されず、正解データは、例えば、欠陥610の位置に対応する画素の画素値が「0」~「255」の範囲内の所定の閾値以上であるか否かに応じて、「0」あるいは「1」に設定されてもよい。例えば、欠陥610の位置に対応する画素の画素値が閾値未満である場合、正解データとして「0」が設定され、閾値以上である場合、正解データとして「1」が設定されてもよい。また、これに限定されず、例えば、欠陥610の位置に対応する画素の画素値が閾値未満である場合、正解データとして「0.5」が設定され、閾値以上である場合、正解データとして「1」が設定されてもよい。
教師データ生成部500hは、第1画像740と、正解データとを関連付け、これらをまとめて教師データとし、記憶装置520に記憶する。本実施形態では、教師データ生成部500hは、少なくとも欠陥610の位置情報および深さ情報を含む欠陥610に関する欠陥情報と、第1画像740とを関連付けた教師データを生成する。教師データ生成部500hは、このような教師データを複数生成する。
具体的に、3DCG画像生成部500dは、多種多様な欠陥610を有する複数種類の仮想モデル600を基に、複数種類の第1の3DCG画像710、第2の3DCG画像720、第3の3DCG画像730を生成する。このとき、3DCG画像生成部500dは、仮想撮像装置700の撮像条件のパラメータをランダムに変更し、多種多様な第1の3DCG画像710、第2の3DCG画像720、第3の3DCG画像730を生成する。撮像条件は、仮想モデル600における検査対象物200の表面光学特性、仮想撮像装置700の撮像面の向き、仮想光源800の向き、仮想光源800の光の強度などを含む。
検査対象物200の表面光学特性は、例えば、表面反射率、拡散反射率、表面粗さ等である。ただし、撮像条件のパラメータの変更は、必須条件ではなく、3DCG画像生成部500dは、欠陥610のパラメータのみが変更された複数種類の仮想モデル600を基に、複数種類の第1の3DCG画像710、第2の3DCG画像720、第3の3DCG画像730を生成してもよい。
少なくとも欠陥610のパラメータが変更されることで、複数の教師データを生成することができる。教師データ生成部500hは、生成した複数種類の教師データを記憶装置520に記憶する。
モデル学習部500iは、記憶装置520に記憶された複数種類の教師データを検査モデルMに入力し、教師データに含まれる正解データに近似した出力データが得られるように、検査モデルMを学習させる。
本実施形態の検査モデルMは、例えばニューラルネットワーク(NN)を有している。ニューラルネットワークは、教師あり学習で学習された畳み込みニューラルネットワーク(CNN)である。ただし、畳み込みニューラルネットワーク以外のニューラルネットワークを用いてもよい。また、ニューラルネットワーク以外の学習モデルを用いてもよい。
検査モデルMは、例えば、画像解析における深層学習モデル(ディープラーニング)である。本実施形態において、検査モデルMは、例えば、ニューラルネットワークの構造と各ニューロン間の結びつきの強さであるパラメータの組合せにより構成される。ニューロンとニューロンの間の結合部には、1つずつ係数であるパラメータが設けられている。各パラメータは、調節可能に構成される。検査モデルMの内部状態は、内部変数といわれるニューラルネットワークの構造と各ニューロン間のパラメータの組合せである数値の組によって表される。
図17は、検査モデルMの一例を示す図である。図17に示すように、検査モデルMには、教師データが入力され、各ニューロンN1、N2、N3、N4、N5、NM-1、NMを経ることで、上述したように各画素に出力ノードの値0~1が紐づけられた出力データが出力される。
検査モデルMは、予め正解データが紐づけられた第1画像740を含む教師データを基に学習される。検査モデルMに対し教師データを入力し、検査モデルMの出力データと教師データの第1画像740に紐づけられた正解データとの誤差が小さくなるように、検査モデルMの内部変数の値が設定される。このようにして、複数種類の教師データに基づいて、検査モデルMが学習される。
なお、モデル学習部500iは、正解データが紐づけられていない第1画像740を教師データとして使用してもよい。つまり、モデル学習部500iは、正解データが紐づけられていない第1画像740を検査モデルMに入力し、検査モデルMから出力される欠陥610の位置を示す情報と正解データとの誤差が小さくなるように、検査モデルMを学習させてもよい。その場合、第1画像生成部500eが、教師データ生成部として機能する。
また、モデル学習部500iは、第1画像740に加え、第2画像を教師データとして使用してもよい。つまり、モデル学習部500iは、第1画像740および第2画像を検査モデルMに入力し、検査モデルMから出力される欠陥610の位置を示す情報と正解データとの誤差が小さくなるように、検査モデルMを学習させてもよい。その場合、第1画像生成部500eおよび第2画像生成部500gが、教師データ生成部として機能する。
推定部500jは、第1の撮像画像、第2の撮像画像、第3の撮像画像を基に第2画像生成部500gで生成された第2画像を、検査モデルMに入力させる。このとき、検査モデルMは、第2画像の各画素を分類し、第2画像の欠陥210、すなわち、欠陥210に対応する画素には、出力ノードとして数値「0」~「1」のうち「0」より大きい値が紐付けられる。また、第2画像の正常箇所に対応する画素には、出力ノードとして数値「0」が紐付けられる。このように、本実施形態では、検査モデルMに入力された第2画像は、セマンティックセグメンテーションの出力形式で出力される。
推定部500jは、検査モデルMの出力データ、すなわち、出力ノードとしての数値「0」~「1」に基づき、第2画像に含まれる検査対象物200の欠陥210の位置を推定し、さらに欠陥210の深さを推定する。具体的に、推定部500jは、「0」以外の出力ノードの数値が紐付けられる画素の位置を、欠陥210の位置として推定する。また、推定部500jは、「0」以外の出力ノードの数値の大きさに応じて、欠陥210の深さを推定する。このようにして、推定部500jは、「0」以外の出力ノードの数値が紐付けられる画素の位置、および、「0」以外の出力ノードの数値の大きさに応じて、欠陥210の位置および深さ分布を推定する。
推定部500jは、推定した検査対象物200の欠陥210の位置を示す情報、および、推定した欠陥210の深さを示す情報(以下、推定結果データともいう)を不図示のディスプレイに表示させる。例えば、推定部500jは、ディスプレイに表示される第2画像に対し、欠陥210の位置に所定の色を付加して重畳表示する。このとき、推定部500jは、ディスプレイに表示される第2画像に対し、欠陥210の深さに応じて色を変化させて重畳表示してもよい。例えば、推定部500jは、欠陥210の深さが深くなるほど色が濃くなるように、深さが浅くなるほど色が薄くなるように、第2画像に色情報を重畳表示してもよい。
図18は、本実施形態に係る画像処理方法の一例を示すフローチャート図である。図18に示すように、3Dグラフィックモデル生成部500aは、検査対象物200の三次元形状データに基づいて、検査対象物200の三次元形状を仮想空間S内に表した仮想モデル600を生成する(ステップS100)。欠陥モデル取得部500bは、仮想空間S内に表され、欠陥データを含む欠陥モデル620を取得する。(ステップS102)。
欠陥付与部500cは、欠陥モデル620に基づいて、仮想モデル600に欠陥610を付与する(ステップS104)。3DCG画像生成部500dは、仮想光源が異なる少なくとも3つの3DCG画像を生成する(ステップS106)。第1画像生成部500eは、少なくとも3つの3DCG画像を基に導出された仮想モデル600の面の方向ベクトルnに基づいて、ノーマルマップ画像である第1画像740を生成する(ステップS108)。
教師データ生成部500hは、第1画像740に対し、欠陥610の位置を示す正解データが関連付けられた教師データを生成する(ステップS110)。モデル学習部500iは、教師データ生成部500hにより生成された教師データのみを、検査モデルMに入力させ、検査モデルMを学習させる(ステップS112)。
撮像画像生成部500fは、光源が異なる少なくとも3つの撮像画像を生成する(ステップS114)。第2画像生成部500gは、少なくとも3つの撮像画像を基に導出された検査対象物200の面の方向ベクトルに基づいて、ノーマルマップ画像である第2画像を生成する(ステップS116)。
推定部500jは、ノーマルマップ画像である第2画像を学習させた検査モデルMに入力させ、第2画像に含まれる検査対象物200の欠陥210の位置を推定する(ステップS118)。
以上、本実施形態の画像処理装置500は、3Dグラフィックモデル生成部500aと、欠陥モデル取得部500bと、欠陥付与部500cを備える。3Dグラフィックモデル生成部500aは、検査対象物200の三次元形状を仮想空間内に表した仮想モデル600を生成する。また、欠陥モデル取得部500bは、仮想空間内に表され、欠陥データを含む欠陥モデル620を取得する。また、欠陥付与部500cは、欠陥モデル620に基づいて、仮想モデル600に欠陥610を付与する。これにより、多種多様な欠陥モデル620に応じた多種多様な欠陥610を仮想モデル600に容易に付与することができる。その結果、多種多様な教師データを容易に生成することができる。
また、欠陥モデル620は、仮想モデル600に付与する欠陥610の形状をグレースケール画像で指定した平面で構成される。グレースケール画像の各画素の画素値には、欠陥610の深さに応じた値が設定される。これにより、予め多種多様なグレースケール画像を用意することで、仮想モデル600に多種多様な欠陥610を容易に付与することができる。
また、欠陥付与部500cは、仮想モデル600の表面の一部である特定面SA1を複製した複製モデル630に含まれる予め定められた点群から少なくとも一の点を選択し、選択した点を通過する複製モデル630の法線上に欠陥モデル620の面が交差するように、欠陥モデル620の位置を設定する。複製モデル630を用いることで、手動では選択および設定し難い仮想モデル600の狭隘部やエッジなどの箇所に欠陥610を容易に付与することができる。したがって、仮想モデル600に付与される欠陥610の位置に偏りを生じ難くさせることができる。
また、欠陥付与部500cは、欠陥モデル620の法線方向に、欠陥モデル620の面に含まれる点群の各点を移動させ、各点が仮想モデル600の表面と接触する接触点を特定する。これにより、仮想モデル600の表面に欠陥モデル620に含まれる点群を容易に反映させることができる。
また、接触点は、欠陥モデル620の面に含まれる点群の各点の法線ベクトルと、仮想モデル600の内向きベクトルとの内積に基づいて特定される。これにより、欠陥モデル620に含まれる点群が、仮想モデル600の表面の意図しない箇所に反映されることを防止することができる。
また、本実施形態の画像処理装置500は、3DCG画像生成部500dと、第1画像生成部500eとを備える。3DCG画像生成部500dは、欠陥610が付与された仮想モデル600と、欠陥610が付与された仮想モデル600を照明する少なくとも3つの仮想光源800と、照明された仮想モデル600を撮像する仮想撮像装置700とに基づいて、仮想光源800が異なる少なくとも3つの3DCG画像を生成する。第1画像生成部500eは、少なくとも3つの3DCG画像を基に導出された仮想モデル600の面の方向ベクトルに基づいて、教師データとしてのノーマルマップである第1画像740を生成する。これにより、多種多様な欠陥モデル620に応じた多種多様な教師データを生成することができる。その結果、シミュレーションによる教師データを大量に生成することができるため、検査モデルMを精度よく学習させることができる。
また、本実施形態では、検査モデルMに入力される第1画像740および第2画像は、ともに同種のノーマルマップ画像である。したがって第1画像740と第2画像の見た目の差を小さくすることができ、その結果、学習された検査モデルMにより推定される検査対象物200の欠陥210の位置の精度を向上させることができる。
また、本実施形態によれば、検査モデルMを学習させる際に、第1画像740に対し、欠陥610の位置を示す正解データが関連付けられた教師データが使用される。これにより、検査モデルMにより推定される欠陥610の位置の精度を向上させることができる。
以上、添付図面を参照しながら実施形態について説明したが、本開示は上記実施形態に限定されない。当業者であれば、特許請求の範囲に記載された範疇において、各種の変更例または修正例に想到し得ることは明らかであり、それらについても当然に本開示の技術的範囲に属するものと了解される。例えば、上記実施形態では、欠陥610として窪み部が形成される例について説明した。しかし、これに限定されず、欠陥610として突出部が形成されてもよい。例えば、欠陥モデル620の最大値情報の記号を「+」から「-」に変更することで、窪み部の欠陥610から突出部の欠陥610に変更することができる。また、仮想モデル600に付与される欠陥610は、窪み部と突出部の双方を含んでもよい。
本開示は、例えば、持続可能な開発目標(SDGs)の目標12「持続可能な消費と生産のパターンを確保する」に貢献することができる。
100 画像処理システム
200 検査対象物
300 撮像装置
400 複数の光源
400A 第1光源
400B 第2光源
400C 第3光源
500 画像処理装置
600 仮想モデル
700 仮想撮像装置
800 複数の仮想光源
800A 第1仮想光源
800B 第2仮想光源
800C 第3仮想光源
200 検査対象物
300 撮像装置
400 複数の光源
400A 第1光源
400B 第2光源
400C 第3光源
500 画像処理装置
600 仮想モデル
700 仮想撮像装置
800 複数の仮想光源
800A 第1仮想光源
800B 第2仮想光源
800C 第3仮想光源
Claims (7)
- 検査対象物の三次元形状を仮想空間内に表した仮想モデルを生成する仮想モデル生成部と、
前記仮想空間内に表され、欠陥データを含む欠陥モデルを取得する欠陥モデル取得部と、
前記欠陥モデルに基づいて、前記仮想モデルに欠陥を付与する欠陥付与部と、
を備える、
画像処理装置。 - 前記欠陥モデルは、前記仮想モデルに付与する前記欠陥の形状をグレースケール画像で指定した平面で構成される、
請求項1に記載の画像処理装置。 - 前記欠陥付与部は、
前記仮想モデルの表面の一部である特定面を複製した複製モデルに含まれる予め定められた点群から少なくとも一の点を選択し、
選択した前記点を通過する前記複製モデルの法線上に前記欠陥モデルの面が交差するように、前記欠陥モデルの位置を設定する、
請求項2に記載の画像処理装置。 - 前記欠陥付与部は、
前記欠陥モデルの法線方向に、前記欠陥モデルの面に含まれる予め定められた点群の各点を移動させ、前記各点が前記仮想モデルの前記表面と接触する接触点を特定する、
請求項3に記載の画像処理装置。 - 前記接触点は、前記欠陥モデルの面に含まれる前記点群の前記各点の法線ベクトルと、前記仮想モデルの内向きベクトルとの内積に基づいて特定される、
請求項4に記載の画像処理装置。 - 前記欠陥が付与された前記仮想モデルと、前記欠陥が付与された前記仮想モデルを照明する少なくとも3つの仮想光源と、前記照明された前記仮想モデルを撮像する仮想撮像装置とに基づいて、前記仮想光源が異なる少なくとも3つの3DCG画像を生成する3DCG画像生成部と、
前記少なくとも3つの3DCG画像を基に導出された前記仮想モデルの面の方向ベクトルに基づいて、教師データとしての画像を生成する画像生成部と、
を備える、
請求項1~5のいずれか1項に記載の画像処理装置。 - 検査対象物の三次元形状を仮想空間内に表した仮想モデルを生成するステップと、
前記仮想空間内に表され、欠陥データを含む欠陥モデルを取得するステップと、
前記欠陥モデルに基づいて、前記仮想モデルに欠陥を付与するステップと、
を含む、
画像処理方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2024-108024 | 2024-07-04 | ||
| JP2024108024 | 2024-07-04 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2026009682A1 true WO2026009682A1 (ja) | 2026-01-08 |
Family
ID=98318310
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/JP2025/021531 Pending WO2026009682A1 (ja) | 2024-07-04 | 2025-06-13 | 画像処理装置および画像処理方法 |
Country Status (1)
| Country | Link |
|---|---|
| WO (1) | WO2026009682A1 (ja) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2010281786A (ja) * | 2009-06-08 | 2010-12-16 | Denso Wave Inc | 視覚検査装置の評価システム |
| JP2019215240A (ja) * | 2018-06-12 | 2019-12-19 | シチズンファインデバイス株式会社 | 外観検査装置の教師画像生成方法 |
| JP2024051834A (ja) * | 2022-09-30 | 2024-04-11 | 株式会社Ihi | 検査システム |
-
2025
- 2025-06-13 WO PCT/JP2025/021531 patent/WO2026009682A1/ja active Pending
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2010281786A (ja) * | 2009-06-08 | 2010-12-16 | Denso Wave Inc | 視覚検査装置の評価システム |
| JP2019215240A (ja) * | 2018-06-12 | 2019-12-19 | シチズンファインデバイス株式会社 | 外観検査装置の教師画像生成方法 |
| JP2024051834A (ja) * | 2022-09-30 | 2024-04-11 | 株式会社Ihi | 検査システム |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Gomes et al. | Generation of gelsight tactile images for sim2real learning | |
| Shao et al. | From IC layout to die photograph: A CNN-based data-driven approach | |
| CN111507976B (zh) | 基于多角度成像的缺陷检测方法及系统 | |
| US20200057831A1 (en) | Real-time generation of synthetic data from multi-shot structured light sensors for three-dimensional object pose estimation | |
| CN112567428A (zh) | 摄影方法及摄影装置 | |
| TW201946185A (zh) | 生成可用於半導體試樣的檢查的訓練集 | |
| CN106056658A (zh) | 一种虚拟对象渲染方法及装置 | |
| EP4552072A1 (en) | Image acquisition system optimization in vision-based industrial automation | |
| JP7518784B2 (ja) | 外観検査装置、外観検査方法、画像生成装置および画像生成方法 | |
| US20260044961A1 (en) | Deep learning-enabled automated detection and measurement system for anti-corrosion properties of coatings | |
| CN115953347B (zh) | 一种单视角下工业缺陷检测方法及系统 | |
| CN112509127A (zh) | 一种高精度仿真点云模型的生成方法 | |
| CN113554636A (zh) | 一种基于生成对抗网络和计算全息的芯片缺陷检测方法 | |
| CN113962917B (zh) | 一种基于掩膜的数据增强方法 | |
| Mohammadikaji | Simulation-based planning of machine vision inspection systems with an application to laser triangulation | |
| KR102533365B1 (ko) | 오토인코더를 이용한 비전 검사를 위한 장치 및 이를 위한 방법 | |
| CN117853560A (zh) | 一种基于人工智能的平面目标面积测量方法及系统 | |
| JP7666440B2 (ja) | 教師あり機械学習用の訓練画像データ生成システムと生成方法及びプログラム | |
| CN116106318A (zh) | 一种物体表面缺陷检测方法和装置、三维扫描仪 | |
| Eastwood et al. | Autonomous close-range photogrammetry using machine learning | |
| Lin et al. | Enhancing the quality inspection process in the food manufacturing industry through automation | |
| WO2025110014A1 (ja) | 生成装置および生成方法 | |
| CN120726213A (zh) | 一种家具设计渲染方法、系统、设备及介质 | |
| JP2024051834A (ja) | 検査システム | |
| Ceron-Lopez et al. | Realism Assessment for Synthetic Images in Robot Vision through Performance Characterization |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 25832763 Country of ref document: EP Kind code of ref document: A1 |