WO2022208623A1 - 対象物員数検査用の学習モデル生成方法及びプログラム - Google Patents

対象物員数検査用の学習モデル生成方法及びプログラム Download PDF

Info

Publication number
WO2022208623A1
WO2022208623A1 PCT/JP2021/013359 JP2021013359W WO2022208623A1 WO 2022208623 A1 WO2022208623 A1 WO 2022208623A1 JP 2021013359 W JP2021013359 W JP 2021013359W WO 2022208623 A1 WO2022208623 A1 WO 2022208623A1
Authority
WO
WIPO (PCT)
Prior art keywords
container
learning model
area
objects
image data
Prior art date
Application number
PCT/JP2021/013359
Other languages
English (en)
French (fr)
Inventor
国宗 駒池
Original Assignee
ヤマハ発動機株式会社
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by ヤマハ発動機株式会社 filed Critical ヤマハ発動機株式会社
Priority to JP2023509932A priority Critical patent/JP7481575B2/ja
Priority to US18/550,393 priority patent/US20240153253A1/en
Priority to PCT/JP2021/013359 priority patent/WO2022208623A1/ja
Priority to DE112021007085.1T priority patent/DE112021007085T5/de
Priority to CN202180095962.8A priority patent/CN117063061A/zh
Publication of WO2022208623A1 publication Critical patent/WO2022208623A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06MCOUNTING MECHANISMS; COUNTING OF OBJECTS NOT OTHERWISE PROVIDED FOR
    • G06M11/00Counting of objects distributed at random, e.g. on a surface
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/001Industrial image inspection using an image reference approach
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • G06T7/74Determining position or orientation of objects or cameras using feature-based methods involving reference images or patches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/761Proximity, similarity or dissimilarity measures
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • G01N2021/8883Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges involving the calculation of gauges, generating models
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/95Investigating the presence of flaws or contamination characterised by the material or shape of the object to be examined
    • G01N21/956Inspecting patterns on the surface of objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30164Workpiece; Machine component
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30242Counting objects in image

Definitions

  • the present invention relates to a method of generating a learning model used in machine learning for automatically inspecting the number of objects, and a program therefor.
  • Japanese Patent Laid-Open No. 2002-200002 discloses a technique of creating a large number of teacher image data by changing the positions and orientations of parts based on an actual image of a tray containing parts, and performing machine learning. .
  • each component is not always clearly visible in a recognizable manner. For example, when recognizing images of parts by edge extraction processing, if the edges are not clear or if the parts overlap each other, the recognition performance is degraded. Therefore, even if machine learning is performed using teacher image data created based on actual images, an accurate learning model may not be obtained.
  • An object of the present invention is to provide a learning model generation method that can accurately create a learning model used in machine learning for performing processing for inspecting the number of objects.
  • a method of generating a learning model for inspecting the number of objects is a method of generating a learning model used in machine learning for automatically inspecting the number of objects contained in a container. a step of inputting model data expressing shapes of the container and the object into the learning model generation device; By creating a plurality of bodies and arbitrarily arranging the unit arrangement bodies in a container area corresponding to the container, shape image data of the container containing the objects at an arbitrary density is created. and adding a process of giving the texture of the actual container and the object to the shape image-like data to create teacher image data used when constructing the learning model. It is characterized by
  • a program for generating a learning model for inspection of the number of objects contained in a container for automatically inspecting the number of objects contained in a container.
  • a program for causing the learning model generation device to create a program comprising a step of receiving input of model data expressing the shape of the container and the object with an image; and by arbitrarily arranging the unit arrangement bodies in the container area corresponding to the container, the container housing the objects at an arbitrary density. creating shape image data; adding processing to the shape image data to give a texture of the actual container and the object to create teacher image data used when constructing the learning model; and are executed by the learning model generation device.
  • FIG. 1 is a block diagram showing the configuration of an automatic quantity inspection system according to a first embodiment, to which the learning model generation method according to the present invention is applied.
  • FIG. 2 is a block diagram showing the functional configuration of the teacher image data creating section.
  • FIG. 3 is a flowchart schematically showing teaching image data creation processing according to the first embodiment.
  • FIG. 4 is a schematic diagram showing the implementation status of the teacher image data creation process.
  • FIGS. 5A and 5B are diagrams showing the state of creation of the unit arrangement body in stage 1 of FIG.
  • FIGS. 6A and 6B are diagrams showing free fall processing performed when creating a unit arrangement.
  • FIGS. 7A to 7E are diagrams showing the implementation status of the arrangement processing of the unit arrangement body in the mix area in stage 2 of FIG. FIG.
  • FIG. 8 is a diagram showing another example of processing for arranging the unit arrangement in the mix area.
  • FIGS. 9A to 9C are diagrams showing the implementation status of the process of arranging the mix area to the container area in stage 3 of FIG. 10A to 10E are diagrams showing specific examples of teacher image data.
  • FIG. 11 is a flowchart showing teacher image data creation processing according to the first embodiment.
  • FIG. 12 is a block diagram showing the configuration of an automatic quantity inspection system according to the second embodiment.
  • FIGS. 13A and 13B are diagrams showing how the degree of similarity between the synthetic teacher image and the actual image is determined.
  • FIG. 14 is a schematic diagram showing the implementation status of the teacher image data creation process according to the third embodiment.
  • FIGS. 15A and 15B are diagrams showing the implementation status of the arrangement processing of unit arranged bodies in the fourth embodiment.
  • FIG. 16 is a flowchart showing teacher image data creation processing according to the fourth embodiment.
  • FIGS. 17A to 17E are diagrams for explaining problems in creating teacher image data based on actual images.
  • the learning model created in the present invention performs an inspection to grasp the number (number) of objects contained in a container, or an inspection to determine whether or not a required number of objects are contained in a container. It is used when the processing device of the above is automatically executed by image recognition processing.
  • a learning model for quantity inspection is created by performing machine learning using images of objects stored in containers in various layouts as teacher image data.
  • a synthetic image created based on shape image data such as CAD data is used instead of using an actual image (actual image) of a container containing an object as a teacher image.
  • the inspection object of the present invention is not particularly limited, and any object that can be recognized as an individual in the captured image can be the inspection object.
  • the container is also not particularly limited as long as it can accommodate a required number of objects and has openings that enable imaging of all the objects contained therein.
  • objects include parts such as mechanical parts and electronic parts, small-sized finished products, agricultural products such as grains, fruits, vegetables, and root vegetables, and processed foods.
  • Examples of the container include a storage box with an upper opening, a tray, a flat plate, a container, and the like.
  • FIG. 1 is a block diagram showing the configuration of an automatic quantity inspection system 1 according to a first embodiment, to which a learning model generation method according to the present invention is applied.
  • an automatic quantity inspection system 1 that performs an inspection for grasping the number of parts C (objects) housed in a container T such as a parts tray is illustrated. After inspection, the parts C in the container T are picked by, for example, a robot hand.
  • the automatic quantity inspection system 1 includes a learning model generation device 10 , an inspection camera 14 , an inspection processing section 15 and an inspection display section 16 .
  • the learning model generation device 10 uses, as training image data, a composite image of a container T in which parts C are arranged in various arrangements, and performs learning using a predetermined machine learning algorithm to create a learning model.
  • the inspection camera 14 captures an actual image of the container T containing the parts C to be inspected.
  • the inspection processing unit 15 applies the learning model created by the learning model generation device 10 to the actual image captured by the inspection camera 14, and detects the number of parts C contained in the container T in the actual image.
  • the inspection processing unit 15 includes an image processing unit 151 and a number recognition unit 152 .
  • the image processing unit 151 performs necessary image processing such as contrast and brightness correction processing, noise removal processing, enlargement/reduction processing, edge enhancement processing, and trimming processing on the actual image data captured by the inspection camera 14 .
  • the image processing unit 151 may be omitted if no special image processing is performed.
  • the number-of-pieces recognition unit 152 applies the learning model to the actual image data after image processing, and detects the number of parts C recognized in the actual image data.
  • the inspection display unit 16 displays the number of components C recognized by the inspection processing unit 15, or the pass/fail determination result based on the number.
  • the learning model generation device 10 includes a teacher image data creation unit 11, a learning processing unit 12, and a learning model storage unit 13.
  • the teacher image data creation unit 11 creates a wide variety of teacher image data as learning materials by image synthesis.
  • the learning processing unit 12 uses a large amount of teacher image data created by the teacher image data creation unit 11 to perform supervised learning by a machine learning algorithm to create a learning model.
  • a machine learning algorithm deep learning such as CNN (Convolution Neural Network), which is machine learning using a neural network, can be used.
  • the learning model storage unit 13 stores the learning model created by the learning processing unit 12 .
  • FIG. 2 is a block diagram showing the functional configuration of the teacher image data creation unit 11.
  • the teacher image data creation section 11 includes a processing device 2, a data input section 26, an operation section 27 and a display section .
  • the processing device 2 is the main body of a personal computer, and the operation section 27 and display section 28 are the keyboard and monitor of the personal computer.
  • the software installed in the personal computer corresponds to the learning model generation program for inspecting the number of objects to be inspected according to the present invention.
  • the data input unit 26 inputs to the processing device 2 the model data representing the three-dimensional shapes of the part C and the container T for which a composite image is to be created.
  • the data input unit 26 is another computer device that creates three-dimensional CAD data, or a server device that stores the three-dimensional CAD data.
  • the operation unit 27 receives necessary operations for the processing device 2 from the operator when creating a composite image that serves as teacher image data.
  • the display unit 28 displays the synthesized image to be created.
  • the processing device 2 is functionally provided with a constraint area setting unit 21 , a unit arrangement creation unit 22 , a component layout image creation unit 23 , a rendering unit 24 and a data storage unit 25 .
  • the restricted area setting unit 21 creates a restricted area that is a unit area that accommodates an arbitrary number of parts C created by model data.
  • the unit arrangement body creating section 22 executes a process of causing an arbitrary number of parts C to freely fall into the restraint area by physical simulation. By this processing, a unit arrangement 3 (FIG. 4) is created in which an arbitrary number of parts C are arranged arbitrarily within the constraint area.
  • the component layout image creation unit 23 creates shape image data of the container T containing the components C at an arbitrary density by arbitrarily arranging the unit arrangement body 3 in the container area corresponding to the container T. .
  • the rendering unit 24 creates a composite image by applying processing to give textures of the actual container T and part C to the shape image data.
  • the data of this synthesized image becomes teacher image data used when the learning processing unit 12 builds a learning model.
  • the data storage unit 25 stores information indicating the arrangement of each part C in the shape image data as correct data indicating the arrangement of the parts C present in the teacher image data.
  • FIG. 3 is a flowchart schematically showing the teaching image data creation processing of the first embodiment
  • FIG. 4 is a schematic diagram showing the implementation status of the teaching image data creation processing.
  • the teaching image data creation process of this embodiment includes the process of creating a plurality of unit arranged bodies 3 (stage 1), the process of arranging the plurality of unit arranged bodies 3 in the mix area 4 (stage 2), and the A three-stage process is performed, ie, placement in the container area 4 and texture imparting process, that is, finishing process for the teacher image 5 (stage 3).
  • the unit arrangement 3 created on the stage 1 consists of a component CA created with three-dimensional CAD data and a constraint area 31 that limits its placement area.
  • a plurality of unit arrangement bodies 3 are created in which an arbitrary number of parts CA are arranged in different manners. Specifically, a plurality of unit arranged bodies 3 having different sizes of the constraining areas 31, the number of parts CA to be arranged, and the arrangement directions of the parts CA are created.
  • the restricted area 31 is set to a size smaller than the container area TA corresponding to the container T. As shown in FIG.
  • FIG. 4 a plurality of each of four types of unit arrangement bodies 3A to 3D of types A to D are illustrated.
  • the type A unit arrangement 3A two parts CA are randomly arranged in a restricted area 31A having a predetermined size.
  • the type B unit arrangement 3B three parts CA are randomly arranged in a constraining area 31A having the same size as that of the type A. That is, in the unit arrangement 3B, the components CA are arranged with a higher density than in the unit arrangement 3A.
  • the type C unit layout body 3C four parts CA are randomly arranged in a constraining area 31B larger than the constraining area 31A.
  • the type D unit arrangement 3D five parts CA are randomly arranged in a constraining area 31C that is even larger than the constraining area 31B.
  • stage 2 the unit arrangement bodies 3 created in stage 1 are arbitrarily combined and arranged in the mix area 4 to create diversity in the arrangement of the parts CA.
  • the mix area 4 is set to a size equal to or smaller than the container area TA and larger than the restraint area 31 .
  • a plurality of mixed areas 4 are created in which the unit arranged bodies 3A to 3D differ in the number of arrangement of the unit arranged bodies 3 in the mixed area 4, arrangement position, arrangement direction, density state, and the like.
  • FIG. 4 three types of mix areas 4A to 4C of arrangement patterns A to C are illustrated.
  • the layout pattern of the components CA is formed by combining the type A and B unit layout bodies 3A and 3B.
  • the layout pattern of the components CA is formed by combining the unit layout bodies 3A, 3B, and 3C of types A, B, and C.
  • FIG. in the mixed area 4C of the layout pattern C a layout pattern is formed by combining the type B, C, and D unit layout bodies 3B, 3C, and 3D.
  • stage 3 the mix area 4 created in stage 2 is arranged in an arbitrary position in an arbitrary direction within the container area TA to create shape image data. Further, rendering processing is applied to the shape image data to give a texture that matches the actual part C and container T. FIG. By the processing in stage 3, data of the teacher image 5 is generated which is composed of an image comparable to the actual image of the container T containing the parts C.
  • the teacher image 5A is an image obtained by applying a texture to shape image data created by arranging the mix area 4A of the arrangement pattern A near the upper left of the container area TA by rendering processing.
  • the teacher image 5B is an image obtained by performing rendering processing on the shape image data created by arranging the mix area 4B of the arrangement pattern B on the lower right side of the container area TA.
  • the parts CA included in the shape image data are processed into parts CAR having actual textures in the teacher images 5A and 5B.
  • the texture of the actual container T is also given to the container area TA.
  • ⁇ Stage 1> 5A and 5B are diagrams showing the state of creation of the unit arrangement 3 on the stage 1 of FIG.
  • the restricted area 31 is expressed as a restricted container 32 on the physical simulator.
  • the restraining container 32 has four sides 321 in the XY directions, a bottom wall 322 arranged below the sides 321, and a tapered portion 323 between the sides 321 and the bottom wall 322.
  • the size of the restricted area 31 in the XY direction can be automatically set or manually set, for example, by the following equations.
  • X long side direction size of component CA ⁇ expansion factor
  • Y short side direction size of part CA ⁇ number of parts CA ⁇ expansion factor ⁇
  • the expansion coefficient ⁇ in the above formula is a coefficient that sets the density of the parts CA per unit area in the restricted area 31 .
  • the expansion coefficient ⁇ can be set, for example, in the range of 1.0 to 2.0 in increments of 0.1.
  • the tolerance of the actual field part C shall be reflected.
  • the size in the XY direction can be determined by multiplying the size of one side by the expansion coefficient ⁇ .
  • the size in the XY direction can be determined by multiplying the diameter size by the expansion coefficient ⁇ .
  • the unit arrangement 3 is created by arbitrarily arranging an arbitrary number of parts CA within the constraint area 31.
  • a method for this arbitrary arrangement in this embodiment, a method is adopted in which an arbitrary number of parts CA are allowed to freely fall into the restraint area 31 (restraint container 32) by physical simulation.
  • the reason why the arrangement of the parts CA is created by free fall is to prevent the arrangement of the parts CA from being created in a manner contrary to the physical phenomenon of the parts CA.
  • the restraint area 31 the chaotic rolling of the parts CA after free fall is restricted, and the range in which the parts CA are arbitrarily arranged is restricted within the restraint area 31 .
  • a group of unit arranged bodies 3 having the same arrangement density of components CA per unit area but different arrangement postures (for example, a group of unit arranged bodies 3A in FIG. 4) is created, or a group of unit arranged bodies 3A having different arrangement densities and arrangement postures is created. It becomes easy to create a group of different unit arrangement bodies 3 (for example, a group of unit arrangement bodies 3A and 3B). In addition, since the frame of the unit layout body 3 is stylized, it becomes easier to arrange it in the mix area 4 thereafter.
  • FIG. 5A shows an example in which two parts CA are allowed to freely fall into the restraint container 32.
  • FIG. 5(B) is an example in which three parts CA are allowed to freely fall into a restraint container 32 of the same size.
  • part of the component CA reaches the tapered portion 323 and is in an unnatural state. After free fall, the restraining container 32 is removed on the physics simulator.
  • FIGS. 5(A) and (B) show the arrangement of the parts CA within the restricted area 31 after the restricted container 32 is removed.
  • a plurality of parts CA included in this restraint area 31 constitute a part group of one unit arrangement 3 .
  • the restraining area 31 of FIG. 5A there is no change in the posture of the component CA before and after the restraining container 32 is removed.
  • the posture of some of the components CA is changed before and after the restraining container 32 is removed.
  • the attitude of the component since the attitude of the component may change, a predetermined time after the removal of the restraint container 32 is set as the standby time, and the stabilization of the variation in the position and attitude of the component CA is awaited. After the waiting time has elapsed, the center of the restraint area 31 is set as the parts group center GC in the unit arrangement 3, and the relative position and orientation data of each part CA with respect to the parts group center GC is saved.
  • FIGs. 6(A) and (B) are schematic diagrams showing an execution example of the free fall of the part CA.
  • the state in which the plurality of parts CA start free fall against one restraint container 32 may be the same or different among the plurality of parts CA.
  • FIG. 6A shows an example in which two parts C11 and C12 are allowed to fall freely from the same position at the same height in the same rotational state and posture.
  • the rotations of the parts C11 and C12 are rotations around the Z-axis, and the attitudes are rotations around the X-axis and/or the Y-axis.
  • the part C11 shown in FIG. 6(A) (A1) is dropped from the part group center GC from a drop start height h1 that is higher by ⁇ h1 than the reference height h0, which is the plane height of the restraint container 32 (restraint area 31). It is free-falling along a falling axis R extending vertically upward.
  • the component C11 is rotated about the Z-axis so that the longitudinal direction of the component C11 is aligned with the X-axis, but is not rotated about the X-axis and the Y-axis.
  • the part C12 shown in the figure is free-falling along the drop axis R from the same fall start height h1 as the part C11 with the same rotation and attitude. On the restraint container 32, the part C12 is on top of the part C11.
  • FIG. 6(B) shows an example in which two parts C13 and C14 are free-falling from different positions in different postures, although they have the same drop starting height.
  • the component C13 shown in FIG. 6B (B1) is freely dropped into the restraint container 32 from a position shifted with respect to the drop axis R in the same rotational state and attitude as the component C11 described above.
  • the part C14 shown in FIG. (B2) is rotated about the Y-axis, unlike the part C13, and is free-falling into the restraint container 32 from a position different from that of the part C13.
  • the part C13 and the part C14 are arranged side by side with their positions shifted.
  • the method of free fall of parts CA by physical simulation is used. Specific bias is less likely to occur. Therefore, it is possible to create unit arrangement bodies 3 that take various placement postures within the constraint area 31, and to create shape image data having various densities or densities of parts CA.
  • FIGS. 7A to 7E are diagrams showing the implementation status of the arrangement processing of the unit arranged bodies 3 in the mix area 4 in the stage 2 of FIG.
  • the mix area 4 is set equal to or smaller than the container area TA on the physical simulator.
  • the reduction coefficient ⁇ is a coefficient for setting the mix area 4 to a size that allows a plurality of unit arranged bodies 3 to be arranged within the container area TA.
  • the container area TA is a rectangular area having XY sides
  • the mix area 4 is set to a size having XY side lengths obtained by multiplying the XY side lengths by a reduction factor ⁇ .
  • the reduction factor ⁇ can be set in the range of 0.8 to 1.0, for example.
  • FIG. 7A shows an example in which four unit arranged bodies 3 are arranged in the mix area 4 .
  • These four unit arrangement bodies 3 are called component groups G1, G2, G3, and G4, respectively.
  • the arrangement of the parts groups G1 to G4 is determined with reference to the parts group center GC.
  • the arrangement coordinates of the parts group center GC of the parts group G1 within the mix area 4 are determined arbitrarily, and the arrangement of the parts group G1 is determined by arbitrarily rotating around the parts group center GC.
  • the arrangement of the parts group G1 is set so that the parts CA do not protrude from the mix area 4.
  • the constraint area 31, which is the layout frame for the parts group G1 may protrude from the mix area 4.
  • the parts group G2 is arranged in the mix area 4.
  • the arrangement coordinates and rotation of the parts group center GC of the parts group G2 within the mix area 4 are arbitrarily set.
  • an interference check is performed to confirm whether or not the component CA of the component group G2 interferes with the component CA of the previously arranged component group G1.
  • the unit arrangement 3 as illustrated in FIG. 5(B), it is assumed that the components CA are placed in interference with each other. Therefore, the parts groups G1 to G4 are arranged so as not to interfere with each other.
  • FIG. 7A shows an example in which the components CA of the component groups G1 to G4 are arranged without interfering with each other. Note that the restraint areas 31 may interfere with each other.
  • FIG. 7B shows an example in which some of the components CA of the component groups G1 to G4 arranged in the mix area 4 interfere with each other. Specifically, the parts CA of the parts group G3 and the parts CA of the parts group G4 overlap each other. If such interference occurs, change processing of (a) or (b) below is performed.
  • (b) A process of canceling the placement coordinates of the parts group center GC of the parts group G3 or G4 and setting new placement coordinates and rotation is performed.
  • FIG. 7(C) shows an example of the change processing of (a) above, in which the arrangement coordinates of the parts group G3 are shifted diagonally upward to the right to avoid interference between the parts group G3 and the parts group G4. ing.
  • the arrangement coordinates of the parts group G4 may be shifted, or the parts group G3 or parts group G4 may be rotated around the parts group center GC to avoid the interference.
  • FIG. 7D shows an example of the change processing of (b) above. The arrangement coordinates of the parts group G3 set in FIG. 7B are canceled, and the arrangement coordinates and rotation of the new parts group G3 are set.
  • the arrangement coordinates of the parts group G4 may be canceled and the arrangement coordinates and rotation of the new parts group G4 may be set.
  • the components CA can be arranged in various ways in the mix area 4 while maintaining the component arrangement relationship of each of the component groups G1 to G4 created in the stage 1. FIG.
  • FIG. 7E shows an example in which the minimum rectangular area (outermost shape) that can surround the parts groups G1 to G4 is defined as the mixed parts group area 41, and the area outside this area 41 is deleted.
  • the form of processing for removing the area outside the outermost shape is not limited to the setting of the minimum rectangular area, and any removal method may be employed. Also, the removal operation itself may be omitted and the mix area 4 may be used as it is.
  • the arrangement state of the component groups G1 to G4 in the mixed component group area 41 is saved.
  • the mixed parts group center MGC which is the center coordinates of the mixed parts group area 41, as the reference coordinates
  • the arrangement coordinates and rotation angles of the parts group centers GC of the parts groups G1 to G4 are stored in the storage device.
  • the stored data are the values of "xn, yn, ⁇ n" indicating coordinate values in the x and y directions with respect to the mixed parts group center MGC and the rotation angle ⁇ of the parts group center GC about the z-axis. is.
  • FIG. 8 is a diagram showing another example of processing for arranging the unit arrangement 3 in the mix area 4.
  • the examples of FIGS. 7A to 7E show examples in which the entire mix area 4 is used as the area where the unit arrangement 3 can be arranged.
  • FIG. 8 shows an example in which a disposition-impossible region 42 is set in the mix area 4 in which the unit layout body 3 is not to be laid out.
  • the unit arrangement 3 is arranged in the arrangement possible area in the mix area 4 so that not only the interference between the components CA of the unit arrangement 3 but also the interference between the parts CA and the arrangement impossible area 42 is avoided. placed.
  • the setting of the arrangement-impossible area 42 contributes to the creation of the teacher image data assuming such an arrangement.
  • FIGS. 9A to 9C are diagrams showing the implementation status of the process of arranging the mixed parts group area 41 in the container area TA.
  • the mixed parts group area 41 is arranged in the container area TA by arbitrarily setting the arrangement coordinates (xn, yn) of the mixed parts group center MGC and the rotation angle ( ⁇ n) around the mixed parts group center MGC axis. be.
  • the set range of arrangement coordinates is the range of the difference between the container area TA and the mixed parts group area 41 .
  • FIG. 9A is an example in which the mixed parts group area 41 is arranged near the upper left of the container area TA.
  • FIG. 9B shows an example in which the mixed parts group area 41 is arranged on the lower right side of the container area TA.
  • a side wall area TAW and a bottom wall area TAB on which parts are actually placed are set in the container area TA.
  • the mixed parts group area 41 in FIGS. 9A and 9B is an example in which both are contained within the bottom wall region TAB and satisfy the layout requirements (layout OK).
  • FIG. 9(C) is an example that does not satisfy the placement requirements (placement NG).
  • the arrangement coordinates of the mixed parts group center MGC in the mixed parts group area 41 are the center of the container area TA.
  • the parts groups G1 and G4 are rotated clockwise by 90 degrees around the center MGC axis. is on the verge of In such an arrangement, a process of changing the rotation angle of the mixed parts group area 41 or resetting the arrangement coordinates and rotation angle of the mixed parts group center MGC is executed.
  • rendering is then performed to give texture to the container area TA and parts CA.
  • a physically based rendering tool is preferably used for this process.
  • One of the rendering processes is the setting of the optical system for imaging the container area TA in which the component CA is arranged. This imaging optical system is set on the assumption that the inspection camera 14 (FIG. 1) images the container area TA where the component C is actually arranged. That is, a pseudo camera assuming the inspection camera 14 and a pseudo lighting assuming the environment of the inspection room are set.
  • parameters such as exposure (aperture, shutter speed and ISO sensitivity), depth of field, angle of view, and camera placement angle are set.
  • exposure aperture, shutter speed and ISO sensitivity
  • depth of field In the actual imaging by the inspection camera 14, images with different degrees of focus, images with different imaging directions, and the like are captured, and there may be cases where a uniform image cannot be obtained.
  • a variation range is set for parameters that are expected to fluctuate and affect image quality.
  • it is a variation value within a range that conforms to the physical phenomenon. This makes it possible to cover images that may be acquired by the inspection camera 14, and to create teacher image data that matches the actual situation.
  • Lighting conditions may also vary due to various factors. For example, lighting conditions temporarily change due to a shadow of a worker passing near the imaging position of the inspection camera 14 . For this reason, among the above parameters, a variation range is set for those parameters that are expected to fluctuate.
  • Another one of the rendering processes is the setting of materials for the parts CA and the container area TA.
  • materials for the parts CA and the container area TA For example, if the actual part C is a metal bolt, parameters such as metallic luster, reflection due to unevenness of the threaded portion, and roughness are set. Also for the component CA, parameters such as the material, color, and surface gloss of the actual container T are set. These material settings also serve as texture adjustments for the part CA and the container area TA. In addition, since the texture of the actual part C and the container T varies, a variation range is set for the material parameter.
  • FIG. 10A to 10E are diagrams showing specific examples of the teacher image 5.
  • FIG. 10(A) is a composite image in which the parts CAR are evenly arranged in the bottom wall region TAB of the container area TA.
  • FIG. 10B is a composite image in which the component CAR is arranged along the side wall region TAW.
  • FIG. 10(C) is a composite image in which parts CAR are densely arranged on about half of the bottom wall area TAB.
  • Figures 10(D) and (E) are composite images in which a pair of parts CAR are closely spaced in the bottom wall region TAB. Since the physical-based rendering is executed after creating the unit arrangement body 3 and the mixed area 4 to diversify the parts arrangement, the teacher image 5 is generated in accordance with the physical phenomenon and rich in variations of the parts arrangement. be able to.
  • FIG. 11 is a flow chart showing a teaching image data creation process according to the first embodiment executed by the teaching image data creating section 11 shown in FIG.
  • the processing device 2 of the teacher image data creation unit 11 receives from the data input unit 26 input of model data representing the three-dimensional shapes of various parts C and containers T for creating a composite image that will be the teacher image 5. (Step S1).
  • the model data is input to the processing device 2 in the form of a CAD file, for example.
  • the unit arrangement creation unit 22 selects the type and number of parts CA that constitute the unit arrangement 3 (FIG. 4) created by the physical simulator (step S2).
  • the constraint area setting unit 21 sets the constraint area 31 having the required size in the XY directions using the long side/short side size and the expansion coefficient ⁇ of the selected part CA.
  • the restricted area setting unit 21 generates a restricted container 32 (FIG. 5) on the physical simulator based on the restricted area 31 (step S3).
  • the unit arrangement body creating section 22 sets the free fall condition of the part CA selected in step S2 to the restraint container 32 created in step S3 (step S4). What is set is the free fall start position and the component posture of the component CA.
  • the free fall start position is set by the XY coordinate position indicating the position on the XY plane and the Z coordinate position corresponding to the drop start height h1 (FIG. 6A).
  • the component posture is set by the rotation angle around each of the XYZ axes.
  • the unit arrangement body creating section 22 allows the number of parts CA to freely fall into the restraint container 32 under the set free-fall conditions by physical simulation (step S5).
  • the unit arrangement body creating section 22 After the attitude of the free-falling part CA is stabilized, the unit arrangement body creating section 22 performs the removal process of the restraint container 32, and after the removal process, waits for a predetermined waiting time to elapse. The production of one unit arrangement 3 is completed when there is no more variation in the parts CA. After that, the unit arrangement creation section 22 saves the data of the relative XY position coordinates of each part CA with respect to the parts group center GC of the created unit arrangement 3 and the rotation angle around each axis in the data storage section 25. (Step S6). The process of creating the unit arrangement 3 as described above is executed for the required number of the unit arrangement 3 .
  • the component layout image creation section 23 sets the unit layout bodies 3 to be laid out in the mix area 4 (FIG. 4) and the number thereof (step S7). After that, the component layout image creating unit 23 sets the mix area 4 on the physical simulator (step S8).
  • the size of the mix area 4 is set using the size of the container area TA and the reduction factor ⁇ , as described above.
  • the component layout image creation unit 23 executes processing for arranging the unit layout body 3 in the mix area 4 at an arbitrary position and rotation angle, as illustrated in FIG. 7 (step S9). During this process, the component layout image creating section 23 performs an interference check between the component groups G1 to G4 corresponding to each unit layout body 3. FIG. When the interference occurs, the component layout image creation unit 23 shifts or rearranges any of the component groups G1 to G4 so as to eliminate the interference (FIGS. 7(C), (D) ).
  • the component layout image creation unit 23 determines from the outermost shape of each component and removes the area in which the component CA is not arranged in the mixed area 4, so that the mixed component group area 41 (FIG. 7(E)) becomes is set (step S10).
  • the parts arrangement image creating unit 23 stores the arrangement coordinates and the rotation angle of each parts group center GC of the parts groups G1 to G4 in the data storage unit 25 (step S11). .
  • the component layout image creation unit 23 executes processing for randomly arranging the mixed component group areas 41 in the container area TA, as illustrated in FIG. 9 (step S12).
  • the parts arrangement image creating unit 23 stores the arrangement coordinates (xn, yn) of the mixed parts group center MGC and the rotation angle ( ⁇ n) about the mixed parts group center MGC axis after the arrangement of the mixed parts group area 41 in the data storage unit. 25.
  • the stored arrangement information serves as correct data indicating the arrangement of the parts CA present in the teacher image data.
  • the component layout image creating unit 23 associates the identification number of the teacher image data with the correct data and stores them in the data storage unit 25 .
  • the rendering unit 24 executes a process of adding texture to the container area TA and the parts CA by physically based rendering. Specifically, the rendering unit 24 sets the optical system (camera and lighting) for imaging the container area TA in which the component CA is arranged, and sets the variation range (step S13). Further, the rendering unit 24 sets the materials of the part CA and the container area TA, and sets the variation range thereof (step S14).
  • the rendering unit 24 sets the optical system (camera and lighting) for imaging the container area TA in which the component CA is arranged, and sets the variation range (step S13). Further, the rendering unit 24 sets the materials of the part CA and the container area TA, and sets the variation range thereof (step S14).
  • the rendering unit 24 executes a physics-based rendering process to generate synthetic image data (teacher image data) that will become the teacher image 5 (step S15).
  • the created teacher image data is stored in the data storage unit 25 (step S16).
  • the teacher image data in the data storage unit 25 is provided to the learning model generation device 10 as needed.
  • FIG. 12 is a block diagram showing the configuration of an automatic quantity inspection system 1A according to the second embodiment.
  • the automatic quantity inspection system 1A differs from the automatic quantity inspection system 1 of the first embodiment in that a model update processing unit 17 is added.
  • the model update processing unit 17 compares the teacher image from which the learning model was created stored in the learning model storage unit 13 and the actual image captured by the inspection camera 14 in the latest quantity inspection. Then, when there is a discrepancy between the tendencies of both images, the model update processing unit 17 causes the learning model generation device 10 to execute the learning model updating process.
  • the tendency to place the part C on the container T may change. For example, it is assumed that the preceding worker A tends to place the parts C in the container T in an evenly distributed manner. On the other hand, it is assumed that the worker B who took over the same work tends to place the parts C in the container T in a concentrated state in a biased position. Even if the learning model currently stored in the learning model storage unit 13 has a high number determination accuracy under the work of the worker A, the number determination accuracy is also high under the work of the worker B who has a different work tendency. Not exclusively. Assuming such an event, the model update processing unit 17 periodically determines the accuracy of the learning model.
  • the model update processing unit 17 functionally includes an image similarity evaluation unit 171 and a relearning determination unit 172 .
  • the image similarity evaluation unit 171 compares the actual image of the container T containing the parts C actually acquired by the inspection camera 14 during the automatic inspection of the quantity and the teacher image 5 created by the teacher image data creating unit 11. Compare and evaluate the similarity of both images.
  • the image similarity can be evaluated, for example, by a method such as template matching, and can be evaluated by, for example, SWD (Sliced Wasserstein Distance).
  • the relearning determination unit 172 determines the necessity of updating the learning model, that is, relearning using the teacher image data. If the image similarity is lower than a predetermined threshold, the relearning determination unit 172 updates the learning model by additionally creating teacher image data that follows the trend of the currently acquired real image. Give instructions to the generator 10 .
  • FIGS. 13A and 13B are diagrams showing how the degree of similarity between the synthetic teacher image and the actual image is determined.
  • FIG. 13A illustrates five synthetic teacher images T1 to T5.
  • the synthetic teacher images T1 to T5 are the same as the teacher images illustrated in FIGS. 10A to 10E.
  • the real image AD1 on the left side of FIG. 13B the parts C are accommodated in the container T in a relatively dispersed manner.
  • the real image AD2 on the right side the parts C are densely packed near the center and stored in the container T.
  • the synthetic teacher image T1 has the highest degree of similarity to the actual image AD1
  • the synthetic teacher image T2 has the second highest degree of similarity.
  • the synthetic teacher images T3, T4, and T5 have a low degree of similarity to the actual image AD1.
  • the synthesized teacher image T3 has the highest degree of similarity to the actual image AD2
  • the synthesized teacher images T4 and T5 have the second highest degree of similarity.
  • the synthetic teacher images T1 and T2 have a low degree of similarity to the actual image AD2.
  • the performance of the learning model is improved by learning more component-dispersed teacher images as shown in the synthetic teacher images T1 and T2. improves. Conversely, when the acquired images tend to be the actual image AD2, the performance of the learning model is improved by learning more dense teacher images such as those shown in synthetic teacher images T3 to T5.
  • the model update processing unit 17 updates the synthetic teacher images T3 to T5, particularly the synthetic image along the tendency of T3.
  • An instruction is given to the learning model generation device 10 to create a large number of variations, re-learn, and update the learning model.
  • the learning model is adjusted to match the actual situation. It can be updated to improve its performance.
  • FIG. 14 is a schematic diagram showing the implementation status of the teacher image data creation process according to the third embodiment.
  • the third embodiment an example is shown in which teacher image data is created with foreign matter other than the original component CA.
  • the automatic quantity inspection system 1 can be added with a foreign matter presence/absence inspection function in addition to the quantity inspection.
  • a foreign substance 61 that simulates an actual foreign substance and is created as three-dimensional data is created together with the unit arrangement body 3 by the teacher image data creation unit 11 .
  • the foreign matter 61 it is desirable to prepare other types of parts that may actually be mixed in the container T in which the parts CA of the unit arrangement 3 are accommodated.
  • FIG. 14 shows an example in which a plurality of foreign matter blocks 6 each including one foreign matter 61 are created by a physical simulator.
  • FIG. 14 shows an example in which two foreign matter blocks 6 are arranged in the mix area 4 in addition to the two types of unit arrangement bodies 3A and 3B.
  • shape image data is created by arbitrarily arranging the mix area 4 including the foreign matter block 6 in the container area TA. Further, the shape image data is subjected to rendering to give a texture, and a teacher image 5 is created. In the teacher image 5, the foreign object 61 is also given the texture of the modeled actual foreign object, so the part CA and the foreign object 61 are expressed as the part CAR and the foreign object 61R, respectively, which have the texture.
  • the inspection processing unit 15 detects that the foreign matter is mixed in the container T. becomes identifiable. Therefore, it is possible to check so that the container in which foreign matter is mixed in the component C does not flow out to the next step.
  • the fourth embodiment an example of simplifying the process of creating shape image data before performing the rendering process will be described.
  • the unit arrangement 3 generated by free-falling the component CA is arbitrarily arranged in the mix area 4 and arbitrarily arranged in the container area TA to create the shape image data.
  • the shape image data is created by allowing the part CA to freely fall directly into the container area TA will be described.
  • FIG. 15 is a diagram showing the implementation status of the arrangement processing of the unit arrangement 3 in the fourth embodiment.
  • the restraint container 32 constrains the arrangement range of the free-falling component CA.
  • the arrangement range of the component CA is restricted by restricting the free fall start position.
  • the drop start height h2 at which the free fall of the parts C11 and C12 is started is set to a height higher by ⁇ h2 than the reference height h0 of the free fall surface 32A (an arbitrary position of the object Set to a drop start height that can maintain the state.
  • the drop start height h2 is lower than the drop start height h1 shown in FIG. It is a height that does not cause much disturbance. Therefore, if the arrangement relationship of the parts C11 and C12 is determined in advance and they are allowed to fall freely, the parts C11 and C12 can be arranged within the range of the free fall plane 32A having the arrangement area shown in FIG. 15(A). Become. Therefore, the free fall surface 32A can be treated as the unit arrangement body 3. FIG. In addition, since the arrangement relationship of the parts C11 and C12 before free fall can be maintained to some extent, even if the arrangement step in the mix area 4 is omitted and the parts are dropped directly into the container area TA, the density of the parts can be varied to some extent. Shape image data can be created.
  • FIG. 15(B) is a diagram showing an example in which the component groups C31, C32, C33, and C34 are directly free-falling into the container area TA.
  • the component arrangement relationship of the component groups C31 to C34 is determined in advance before the free fall, and the component groups are free-falled from a height position corresponding to the above-described drop start height h2 on the physics simulator.
  • the component arrangement relationship of the free-falling component groups C31 to C34 generally maintains the component arrangement relationship before the free fall.
  • This free-falling process creates shape image data in which a plurality of parts are arbitrarily arranged in the container area TA. After that, the shape image data is subjected to texture imparting processing in stage 3 of FIG. 3 to create teacher image data.
  • FIG. 16 is a flowchart showing teacher image data creation processing of the fourth embodiment.
  • the teacher image data creation unit 11 shown in FIG. 2 creates teacher image data.
  • the processing device 2 receives, from the data input unit 26, input of model data representing the three-dimensional shapes of various parts C and containers T for creating a composite image that will be the teacher image 5 (step S21).
  • the unit layout body creation unit 22 selects the types and the number of components that constitute the component groups C31 to C34 to be created by the physical simulator (step S22).
  • the unit arrangement creation section 22 sets the free fall conditions for the parts groups C31 to C34 selected in step S22 (step S23). What is set is the free-fall start position and component orientation of the component groups C31 to C34.
  • the free fall start position is set by the XY coordinate position indicating the position on the XY plane and the Z coordinate position corresponding to the drop start height h2.
  • the component posture is set by the rotation angle around each of the XYZ axes.
  • the unit arrangement body creating section 22 causes the component groups C31 to C34 to freely fall into the container area TA under the set free-fall conditions by physics simulation (step S24). After the postures of the free-falling component groups C31 to C34 are stabilized, the data of the XY position coordinates and rotation angles around the respective axes of the components constituting the component groups C31 to C34 are stored in the data storage unit 25 (step S25). .
  • the rendering unit 24 executes a process of giving a texture to the container area TA and the parts groups C31 to C34 by physically based rendering (steps S26 to S28). Since the rendering process to be executed is the same as the process described in steps S13 to S15 of FIG. 11, description thereof will be omitted.
  • the created teacher image data is stored in the data storage unit 25 (step S29).
  • the simulated shape image data as shown in FIGS. 9A and 9B are created using the container area TA and the part CA created from the model data.
  • the shape image data is created by arranging a plurality of unit arrangement bodies 3 in the mix area 4 and arbitrarily arranging the mixed parts group area 41 in the container area TA. Since the unit arrangement body 3 itself is created by arbitrarily arranging a plurality of parts CA, it is possible to easily synthesize shape image data with various density or sparseness of the parts CA (first embodiment). ). Further, if the component groups C31 to C34 are allowed to freely fall directly into the container area TA as in the fourth embodiment, shape image data can be easily synthesized even if the variation in component arrangement is slightly reduced.
  • the data of the teacher image 5 is created by applying the texture of the actual container T and the part C to the shape image data. Therefore, it is possible to obtain teacher image data that is comparable to an actual image of the container T containing the component C that is actually captured. Therefore, it is possible to improve the performance of a learning model generated by performing machine learning using the teacher image data.
  • 17A and 17B are diagrams for explaining a problem when creating teacher image data based on an actual image.
  • image synthesis is performed based on the obtained two-dimensional actual image.
  • a large number of actual images may be acquired and these may be used as teacher images, but this requires an enormous amount of time and effort.
  • FIG. 17A shows a bolt-shaped object cut out from a certain real image.
  • the edges of the original shape of the object are clearly recognized.
  • FIG. 17(B) is an example where the edge of the object is unclear
  • FIG. 17(C) is an example where the edge is missing.
  • FIG. 17D shows an example of edges recognized when objects overlap each other
  • 17E shows an example of edges recognized when objects are adjacent to each other.
  • a three-dimensional composite image not only a single target object but also multiple target objects are arranged in a state where they overlap or are adjacent to each other. Even if it is, the arrangement relationship can be clearly grasped. Therefore, according to this embodiment, it is possible to create teacher image data that accurately correspond to correct data indicating the arrangement of objects.
  • a method of generating a learning model for inspecting the number of objects is a method of generating a learning model used in machine learning for automatically inspecting the number of objects contained in a container. a step of inputting model data expressing shapes of the container and the object into the learning model generation device; By creating a plurality of bodies and arbitrarily arranging the unit arrangement bodies in a container area corresponding to the container, shape image data of the container containing the objects at an arbitrary density is created. and adding a process of giving the texture of the actual container and the object to the shape image-like data to create teacher image data used when constructing the learning model. It is characterized by
  • a program for generating a learning model for inspection of the number of objects contained in a container for automatically inspecting the number of objects contained in a container.
  • a program for causing the learning model generation device to create a program comprising a step of receiving input of model data expressing the shape of the container and the object with an image; and by arbitrarily arranging the unit arrangement bodies in the container area corresponding to the container, the container housing the objects at an arbitrary density. creating shape image data; adding processing to the shape image data to give a texture of the actual container and the object to create teacher image data used when constructing the learning model; and are executed by the learning model generation device.
  • simulated shape image data is created using model data of containers and objects.
  • This shape image data is created by arbitrarily arranging a plurality of unit arrangement bodies in the container area. Since the unit arrangement body itself is created by arbitrarily arranging a plurality of objects, it is possible to easily synthesize shape image data with various densities or sparseness of the objects. Further, the shape image-like data is subjected to a process of imparting a texture of the actual container and the object to create teacher image data. Therefore, it is possible to obtain teacher image data that is comparable to an actual image of the object-containing container. Therefore, it is possible to improve the performance of a learning model generated by performing machine learning using the teacher image data.
  • the unit arrangement body may be created by presetting a restricted area smaller than the container area and arbitrarily arranging an arbitrary number of the objects in the restricted area. desirable.
  • the step of creating the shape image data includes setting a mix area equal to or smaller than the container area and larger than the constraint area, and setting the plurality of unit arrangement bodies in the mix area. arbitrarily arranging and arranging the mixing area in which the unit arrangement is arranged at an arbitrary position in the container area in an arbitrary direction.
  • the mixed area is arbitrarily arranged in the container area. Therefore, it is possible to create shape image data having various densities or sparsenesses of objects, such as shape image data in which the objects are arranged dispersedly or unevenly in the container.
  • the plurality of unit arranged bodies are allowed to freely fall into the container area from a drop start position where the arbitrary arrangement state of the object can be maintained by physics simulation.
  • the unit arrangement body can be arbitrarily arranged.
  • this learning model generation method it is possible to arbitrarily arrange the unit arrangement body directly in the container area while maintaining the arbitrary arrangement state of the object. Therefore, creation of shape image data can be simplified.
  • the information indicating the arrangement of each of the objects in the shape image data is treated as correct data indicating the arrangement of the objects in the teacher image data
  • the learning model generation device Preferably, the teacher image data and the correct answer data are associated and stored in a storage device provided in the.
  • this learning model generation method compared to the case of deriving correct data based on actual images, it is possible to more accurately associate the placement of objects in the teacher image data with the correct data.
  • the process of imparting the texture includes setting the imaging optical system of the object and the container and setting the range of variation thereof, and setting the material of the object and the container and the range of variation thereof. It is preferably performed with physically based rendering, including
  • this learning model generation method it is possible to give the object and the container a texture that corresponds to the situation of the actual quantity inspection. Therefore, it is possible to generate teacher image data closer to a real image.
  • the actual image of the container containing the object which is actually acquired during automatic inspection of the number of objects, is compared with the teacher image data, and the similarity between the two is determined. If it is lower than a predetermined threshold, it is desirable to additionally create teacher image data along the tendency of the real image to update the learning model.
  • the learning model when the teacher image data tends to deviate from the actual image during the actual automatic inspection of the number of objects, the learning model can be adjusted according to the actual situation. It can be updated to improve its performance.
  • the step of creating the shape image data preferably includes the step of arranging a foreign substance other than the target object in the container area.
  • the learning model generation method shape image data containing foreign matter is created. Therefore, the learning model can be applied not only to the quantity inspection but also to the presence/absence inspection of foreign matter.
  • a learning model generation method and a learning model generation program capable of accurately creating a learning model used in machine learning for performing processing for inspecting the number of objects. be able to.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Multimedia (AREA)
  • Quality & Reliability (AREA)
  • Computer Graphics (AREA)
  • Image Generation (AREA)
  • Image Analysis (AREA)

Abstract

学習モデル生成方法は、容器内に収容される対象物の員数を自動検査する処理を行うための、機械学習に用いられる学習モデルの生成方法である。前記方法は、前記学習モデルの生成装置に、前記容器及び対象物の形状を画像で表現するモデルデータを入力するステップと、前記モデルデータを用いて、複数個の対象物を任意に配置した単位配置体を複数体作成させると共に、前記容器に対応する容器エリア内に前記単位配置体を任意に配置することで、前記対象物を任意の密集度で収容している前記容器の形状画像データを作成させるステップと、前記形状画像状データに、現実の前記容器及び前記対象物の質感を与える処理を加え、前記学習モデルを構築する際に使用される教師画像データを作成させるステップと、を実行させる。

Description

対象物員数検査用の学習モデル生成方法及びプログラム
 本発明は、対象物の員数を自動検査する処理を行うための機械学習に使用される学習モデルの生成方法、及びそのプログラムに関する。
 ロボット等によりトレイ(容器)に収容された部品(対象物)のピッキング等を行わせるに際し、当該トレイに収容されている部品の員数(個数)を確認する検査、或いは所要員数の部品が容器に収容されているか否かの検査が行われる場合がある。この場合、部品入りのトレイを撮像し、画像認識処理によって前記トレイ内の部品個数を自動的に特定する手法が採られることがある。前記画像認識を的確に行わせるために、多数の部品入りトレイの画像を教師画像データとして機械学習させ、検査用の学習モデルを作成することが考えられる。
 特許文献1には、部品入りトレイを実際に撮像した実画像をベースに、部品の位置、向きなどを異ならせて多数の教師画像データを作成し、機械学習を行わせる技術が開示されている。しかし、実画像において、各部品が認識可能に明瞭に映っているとは限らない。例えば、エッジ抽出処理によって部品を画像認識する場合、そのエッジが明瞭でなかったり、部品同士が重なっていたりすると、認識性能が低下する。従って、実画像をベースとして作成された教師画像データを用いて機械学習を行わせても、的確な学習モデルが得られないことがあった。
特開2020-126414号公報
 本発明は、対象物の員数を検査する処理を行うための機械学習に使用される学習モデルを的確に作成することができる学習モデル生成方法を提供することを目的とする。
 本発明の一局面に係る対象物員数検査用の学習モデル生成方法は、容器内に収容される対象物の員数を自動検査する処理を行うための、機械学習に用いられる学習モデルの生成方法であって、前記学習モデルの生成装置に、前記容器及び対象物の形状を画像で表現するモデルデータを入力するステップと、前記モデルデータを用いて、複数個の対象物を任意に配置した単位配置体を複数体作成させると共に、前記容器に対応する容器エリア内に前記単位配置体を任意に配置することで、前記対象物を任意の密集度で収容している前記容器の形状画像データを作成させるステップと、前記形状画像状データに、現実の前記容器及び前記対象物の質感を与える処理を加え、前記学習モデルを構築する際に使用される教師画像データを作成させるステップと、を実行させることを特徴とする。
 本発明の他の局面に係る対象物員数検査用の学習モデル生成プログラムは、容器内に収容される対象物の員数を自動検査する処理を行うための、機械学習に用いられる学習モデルを、所定の学習モデル生成装置に作成させるためのプログラムであって、前記容器及び対象物の形状を画像で表現するモデルデータの入力を受け付けるステップと、前記モデルデータを用いて、複数個の対象物を任意に配置した単位配置体を複数体作成させると共に、前記容器に対応する容器エリア内に前記単位配置体を任意に配置することで、前記対象物を任意の密集度で収容している前記容器の形状画像データを作成させるステップと、前記形状画像状データに、現実の前記容器及び前記対象物の質感を与える処理を加え、前記学習モデルを構築する際に使用される教師画像データを作成させるステップと、を前記学習モデル生成装置に実行させることを特徴とする。
図1は、本発明の係る学習モデル生成方法が適用される、第1実施形態に係る員数自動検査システムの構成を示すブロック図である。 図2は、教師画像データ作成部の機能構成を示すブロック図である。 図3は、第1実施形態の教師画像データ作成処理を大略的に示すフローチャートである。 図4は、教師画像データ作成処理の実施状況を示す模式図である。 図5(A)、(B)は、図3のステージ1における単位配置体の作成状況を示す図である。 図6(A)、(B)は、単位配置体の作成に際に行われる自由落下処理を示す図である。 図7(A)~(E)は、図3のステージ2におけるミックスエリアへの単位配置体の配置処理の実施状況を示す図である。 図8は、ミックスエリアへの単位配置体の配置処理の他の例を示す図である。 図9(A)~(C)は、図3のステージ3におけるは、ミックスエリアの容器エリアへの配置処理の実施状況を示す図である。 図10(A)~(E)は、教師画像データの具体例を示す図である。 図11は、第1実施形態の教師画像データ作成処理を示すフローチャートである。 図12は、第2実施形態に係る員数自動検査システムの構成を示すブロック図である。 図13(A)及び(B)は、合成教師画像と実画像の類似度の判定状況を示す図である。 図14は、第3実施形態に係る教師画像データ作成処理の実施状況を示す模式図である。 図15(A)及び(B)は、第4実施形態における単位配置体の配置処理の実施状況を示す図である。 図16は、第4実施形態の教師画像データ作成処理を示すフローチャートである。 図17(A)~(E)は、実画像に基づき教師画像データを作成する場合の不具合を説明するための図である。
 以下、図面に基づいて、本発明に係る対象物員数検査用の学習モデル生成方法の実施形態について詳細に説明する。本発明において作成する学習モデルは、容器に収容されている対象物の員数(個数)を把握する検査、或いは、容器に所要の員数の対象物が収容されているか否かの検査等を、所定の処理装置に画像認識処理によって自動的に実行させる際に用いられる。容器に多様な配置形態で収容される対象物の画像を教師画像データとして機械学習させることで、員数検査用の学習モデルを作成する。本発明では、教師画像として、対象物を収容した容器の実際の画像(実画像)を用いるのではなく、CADデータ等の形状画像データに基づいて作成される合成画像を用いる。
 本発明の検査対象物については特に制限はなく、撮像された画像において個体として認識可能な物体であれば検査対象物となり得る。容器についても特に制限はなく、所要数の対象物を収容可能であって、収容している対象物の全てを撮像可能な開口を有する容器であれば良い。対象物としては、機械部品や電子部品等の部品、小サイズの完成品、穀類、果実、野菜、根菜等の農産物、加工食品などを例示することができる。容器としては、上面開口の収容箱、トレイ、平皿、コンテナなどを例示することができる。
 [第1実施形態/員数自動検査システムの構成]
 図1は、本発明に係る学習モデル生成方法が適用される、第1実施形態に係る員数自動検査システム1の構成を示すブロック図である。ここでは、部品トレイ等の容器Tに収容されている部品C(対象物)の個数を把握する検査を行う員数自動検査システム1を例示する。検査後、容器Tの部品Cは、例えばロボットハンドでピッキングされる。
 員数自動検査システム1は、学習モデル生成装置10、検査カメラ14、検査処理部15及び検査表示部16を備える。学習モデル生成装置10は、部品Cを様々な配置態様で収容した容器Tの合成画像を教師画像データとして用い、所定の機械学習アルゴリズムによる学習を実行し、学習モデルを作成する。検査カメラ14は、員数検査の対象となる部品Cを収容した容器Tの実画像を撮像する。
 検査処理部15は、検査カメラ14が撮像した実画像に、学習モデル生成装置10が作成した学習モデルを適用して、当該実画像において容器Tに収容されている部品Cの個数を検出する。検査処理部15は、画像処理部151及び員数認識部152を含む。画像処理部151は、検査カメラ14が撮像した実画像データに、コントラストや明るさの補正処理、ノイズ除去処理、拡大・縮小処理、エッジ強調処理、トリミング処理等の、必要な画像処理を施す。特段の画像処理を施さない場合は、画像処理部151を省いても良い。員数認識部152は、画像処理後の前記実画像データに前記学習モデルを適用して、当該実画像データにおいて部品Cと認識された個数を検出する。検査表示部16は、検査処理部15が認識した部品Cの個数、或いは前記個数に基づく合否判定結果等を表示する。
 学習モデル生成装置10は、教師画像データ作成部11、学習処理部12及び学習モデル記憶部13を備える。教師画像データ作成部11は、学習素材となる多種多様な教師画像データを、画像合成により作成する。学習処理部12は、教師画像データ作成部11が作成した多数の教師画像データを用いて、機械学習アルゴリズムにより教師あり学習を実行し、学習モデルを作成する。機械学習アルゴリズムとしては、ニューラルネットワークを用いた機械学習であるCNN(Convolution Neural Network)などのディープラーニングを用いることができる。学習モデル記憶部13は、学習処理部12が作成した学習モデルを記憶する。
 図2は、教師画像データ作成部11の機能構成を示すブロック図である。教師画像データ作成部11は、処理装置2、データ入力部26、操作部27及び表示部28を含む。例えば、処理装置2はパーソナルコンピュータの本体部、操作部27及び表示部28は前記パーソナルコンピュータのキーボード及びモニタである。前記パーソナルコンピュータにインストールされるソフトウェアが、本発明に係る対象物員数検査用の学習モデル生成プログラムに相当する。
 データ入力部26は、合成画像を作成する部品C及び容器Tの三次元形状を画像で表現するモデルデータを、処理装置2に入力する。例えばデータ入力部26は、三次元CADデータを作成する他のコンピュータ装置、或いは前記三次元CADデータを記憶しているサーバ装置等である。操作部27は、教師画像データとなる合成画像の作成に際して、処理装置2に対して必要な操作をオペレータから受け付ける。表示部28は、作成される合成画像の表示等を行う。
 処理装置2は、機能的に、拘束エリア設定部21、単位配置体作成部22、部品配置画像作成部23、レンダリング部24及びデータ記憶部25を備えている。拘束エリア設定部21は、モデルデータで作成された任意数の部品Cを収容する単位領域となる拘束エリアを作成する。単位配置体作成部22は、物理シミュレーションにより、前記拘束エリアに任意数の部品Cを自由落下させる処理を実行する。この処理により、前記拘束エリア内に任意数の部品Cが任意に配置された単位配置体3(図4)が作成される。
 部品配置画像作成部23は、容器Tに対応する容器エリア内に単位配置体3を任意に配置することで、部品Cを任意の密集度で収容している容器Tの形状画像データを作成する。レンダリング部24は、前記形状画像データに、現実の容器T及び部品Cの質感を与える処理を加えた合成画像を作成する。この合成画像のデータは、学習処理部12が学習モデルを構築する際に使用される教師画像データとなる。データ記憶部25は、前記形状画像データにおける部品Cの各々の配置を示す情報を、前記教師画像データに存在する部品Cの配置を示す正解データとして記憶する。
 [教師画像データ作成の全体的な流れ]
 図3は、第1実施形態の教師画像データ作成処理を大略的に示すフローチャート、図4は、前記教師画像データ作成処理の実施状況を示す模式図である。本実施形態の教師画像データ作成処理は、複数体の単位配置体3の作成処理(ステージ1)、複数体の単位配置体3のミックスエリア4への配置処理(ステージ2)、及び、ミックスエリア4の容器エリアへの配置及び質感付与処理、すなわち教師画像5への仕上げ処理(ステージ3)の、三段階の処理が行われる。
 ステージ1で作成される単位配置体3は、三次元CADデータで作成された部品CAと、その配置領域を制限する拘束エリア31とからなる。ステージ1では、任意数の部品CAが異なる態様で配置された複数体の単位配置体3が作成される。具体的には、拘束エリア31のサイズ、部品CAの配置個数、及び部品CAの配置方向が異なる複数体の単位配置体3が作成される。但し、拘束エリア31は、容器Tに対応する容器エリアTAよりも小さいサイズに設定される。
 図4では、タイプA~Dの4種の単位配置体3A~3Dが、各々複数体例示されている。タイプAの単位配置体3Aは、所定サイズを有する拘束エリア31Aに2個の部品CAがランダムに配置されている。タイプBの単位配置体3Bは、タイプAと同サイズの拘束エリア31Aに3個の部品CAがランダムに配置されている。つまり、単位配置体3Bは、単位配置体3Aよりも高い密集度で部品CAが配置されている。タイプCの単位配置体3Cは、拘束エリア31Aよりも大きい拘束エリア31Bに4個の部品CAがランダムに配置されている。タイプDの単位配置体3Dは、拘束エリア31Bよりもさらに大きい拘束エリア31Cに、5個の部品CAがランダムに配置されている。
 ステージ2では、ステージ1で作成された単位配置体3を任意に組み合わせてミックスエリア4に配置し、部品CAの配置の多様性を創出する。ミックスエリア4は、容器エリアTAと同等又は小さく、拘束エリア31よりも大きいサイズに設定される。単位配置体3A~3Dでは、ミックスエリア4内における単位配置体3の配置数、配置位置、配置方向、粗密状態等を異ならせた複数のミックスエリア4が作成される。
 図4では、配置パターンA~Cの3種のミックスエリア4A~4Cが例示されている。配置パターンAのミックスエリア4Aには、タイプA、Bの単位配置体3A、3Bを組み合わせにより、部品CAの配置パターンが形成されている。配置パターンBのミックスエリア4Bには、タイプA、B、Cの単位配置体3A、3B、3Cの組み合わせにより、部品CAの配置パターンが形成されている。配置パターンCのミックスエリア4Cには、タイプB、C、Dの単位配置体3B、3C、3Dの組み合わせにより、の配置パターンが形成されている。このようなミックスエリア4の形成手法を取ることで、ミックスエリア4内に部品CAがまんべんなく分散配置された合成画像データだけでなく、部品CAが偏って配置される合成画像データも作成できる。従って、多様な密集度乃至は粗密度合いで部品CAが配置された合成画像データを作成できる。
 ステージ3では、ステージ2で作成したミックスエリア4を、容器エリアTA内の任意の位置に任意の方向で配置して形状画像データを作成する。さらに、前記形状画像データにレンダリング処理を施し、実際の部品C及び容器Tにマッチする質感を与える。ステージ3の処理により、部品Cを収容した容器Tを撮像した実画像と遜色のない画像からなる、教師画像5のデータが生成される。
 図4では、2種の教師画像5A、5Bが例示されている。教師画像5Aは、配置パターンAのミックスエリア4Aを容器エリアTAの左上寄りに配置して作成された形状画像データに、レンダリング処理により質感を与えた画像である。教師画像5Bは、配置パターンBのミックスエリア4Bを容器エリアTAの右下寄りに配置して作成された形状画像データに、レンダリング処理を施した画像である。前記形状画像データに含まれている部品CAは、教師画像5A、5Bにおいては、実際の質感を有する部品CARに加工されている。容器エリアTAも、実際の容器Tが持つ質感が与えられている。
 [各ステージにおける処理の詳細]
 以下、上述のステージ1~3において実行される処理の具体例を説明する。これらの処理に際しては、物理シミュレータが使用される。
 <ステージ1>
 図5(A)、(B)は、図3のステージ1における単位配置体3の作成状況を示す図である。拘束エリア31は、物理シミュレータ上では拘束容器32として表現される。拘束容器32は、XY方向の4つの側辺321と、側辺321よりも下側に配置される底壁322と、側辺321と底壁322との間のテーパ部323とを有している。拘束エリア31のXY方向のサイズは、例えば次式で自動設定又はマニュアル設定することができる。
  X=部品CAの長辺方向サイズ×拡張係数β
  Y=部品CAの短辺方向サイズ×部品CAの個数×拡張係数β
 上式の拡張係数βは、拘束エリア31における単位面積当たりの部品CAの密集度を設定する係数となる。拡張係数βは、例えば1.0~2.0の範囲で、0.1刻みで設定することができる。部品CAについては、実際野部品Cの公差を反映させるものとする。なお、正方形の部品CAの場合は、一辺のサイズに拡張係数βを乗じることで、XY方向のサイズを定めることができる。また、円形の部品CAの場合は、直径のサイズに拡張係数βを乗じることで、XY方向のサイズを定めることができる。
 単位配置体3は、任意数の部品CAを拘束エリア31内に任意に配置することによって作成される。この任意配置の手法として本実施形態では、物理シミュレーションにより、拘束エリア31(拘束容器32)内に任意数の部品CAを自由落下させる手法が採られる。自由落下により部品CAの配置状態を作るのは、部品CAの物理現象に反するような配置状態が作られてしまうのを防止するためである。但し、拘束エリア31の設定により、自由落下後の部品CAの無秩序な転動が制限され、部品CAが任意配置される範囲が拘束エリア31内に規制される。このため、単位面積当たりの部品CAの配置密度を同一として配置姿勢の異なる単位配置体3の群(例えば図4の単位配置体3Aの群)の作成や、配置密度を異ならせると共に配置姿勢の異なる単位配置体3の群(例えば単位配置体3Aと3Bの群)の作成が行い易くなる。また、単位配置体3の枠が定型化されるので、その後のミックスエリア4への配置が行い易くなる。
 ある高さ、姿勢を持った部品CAを拘束容器32に自由落下させると、拘束容器32内で部品CAは様々な姿勢を取る。図5(A)は、2個の部品CAを拘束容器32に自由落下させた例である。この例では、2個の部品CAが拘束容器32の底壁322上に収まっている。図5(B)は、同じサイズの拘束容器32に3個の部品CAを自由落下させた例である。この例では、一部の部品CAがテーパ部323に差し掛かり、不自然な状態となっている。自然落下後、物理シミュレータ上で拘束容器32が除去される。
 図5(A)及び(B)の右図は、拘束容器32を除去後における拘束エリア31内の部品CAの配置を示している。この拘束エリア31内に含まれる複数の部品CAが、一つの単位配置体3の部品群となる。図5(A)の拘束エリア31では、拘束容器32の除去前後で部品CAの姿勢に変更はない。一方、図5(B)の拘束エリア31では、拘束容器32の除去前後で一部の部品CAの姿勢が変わっている。このように、部品姿勢が変わることがあるので、拘束容器32の除去後、所定の時間を待機時間として定め、部品CAの位置や姿勢に変動の安定を待つ。前記待機時間の経過後、拘束エリア31のセンターを当該単位配置体3における部品群センターGCとし、その部品群センターGCに対する各部品CAの相対的な位置及び姿勢のデータを保存する。
 図6(A)、(B)は、部品CAの自由落下の実行例を示す模式図である。一つの拘束容器32に対して複数の部品CAの自由落下を開始させるときの状態は、複数の部品CA間で同一であっても、異なっていても良い。図6(A)は、二つの部品C11、C12を同一の高さの同位置から、同一の回転状態及び姿勢で自由落下させる例を示している。なお、部品C11、C12の前記回転は、Z軸周りの回転であり、前記姿勢は、X軸及び/又はY軸回りの回転である。
 図6(A)の(A1)図に示す部品C11は、拘束容器32(拘束エリア31)の平面高さである基準高さh0よりもΔh1だけ高い落下開始高さh1から、部品群センターGCより鉛直上方に延びる落下軸Rに沿って自由落下されている。部品C11には、当該部品C11の長手方向がX軸に沿うようにZ軸周りの回転が与えられている一方、X軸及びY軸回りの回転は与えられていない。(A2)図に示す部品C12は、部品C11と同一の落下開始高さh1から、同一の回転及び姿勢で、落下軸Rに沿って自由落下されている。拘束容器32上では、部品C11の上に部品C12が乗り上げた状態となっている。
 図6(B)は、二つの部品C13、C14を、同一の落下開始高さであるものの、異なる位置から、異なる姿勢で自由落下させる例を示している。図6(B)の(B1)図に示す部品C13は、落下軸Rに対してシフトした位置から、先述の部品C11と同じ回転状態及び姿勢で拘束容器32に自由落下されている。一方、(B2)図に示す部品C14は、部品C13とは異なりY軸周りに回転された姿勢で、部品C13とは異なる位置から拘束容器32に自由落下されている。拘束容器32上では、部品C13と部品C14とが位置ズレして並んだ状態となっている。
 以上の通り、本実施形態では物理シミュレーションによる部品CAの自由落下の手法を用いるので、任意数の部品CAが拘束エリア31へ任意配置された単位配置体3を多数作成するに際して、部品配置状態に特定の偏りが生じ難くなる。従って、拘束エリア31内で様々な配置姿勢を取る単位配置体3を作成でき、部品CAの多様な密集度乃至は粗密度合いを有する形状画像データを作成することできる。
 <ステージ2>
 図7(A)~(E)は、図3のステージ2におけるミックスエリア4への単位配置体3の配置処理の実施状況を示す図である。物理シミュレータ上でミックスエリア4は、容器エリアTAと同等若しくは小さく設定される。ミックスエリア4のサイズは、例えば次式で自動設定させることができる。
  ミックスエリア4のサイズ=容器エリアTAのサイズ×縮小係数α
 縮小係数αは、容器エリアTA内で複数体の単位配置体3を配置できるサイズにミックスエリア4を設定するための係数である。例えば、容器エリアTAはXYの辺を有する矩形のエリアである場合、ミックスエリア4は、そのXYの辺長に縮小係数αを乗じたXYの辺長を有するサイズに設定される。縮小係数αは、例えば0.8~1.0の範囲で設定することができる。
 ステージ1において作成された複数体の単位配置体3が、ミックスエリア4内に任意に配置される。図7(A)では、4つの単位配置体3がミックスエリア4内に配置されている例を示している。これら4つの単位配置体3を、それぞれ部品群G1、G2、G3、G4と呼ぶ。部品群G1~G4の配置は、部品群センターGCを基準として決定される。先ず、部品群G1の部品群センターGCのミックスエリア4内における配置座標を任意に定めると共に、部品群センターGC回りに任意に回転させることで、部品群G1の配置を定める。部品群G1の配置は、部品CAがミックスエリア4からはみ出ないように設定される。但し、部品群G1の配置枠である拘束エリア31は、ミックスエリア4からはみ出ても良い。
 次いで、部品群G2がミックスエリア4内に配置される。上記と同様に、部品群G2の部品群センターGCのミックスエリア4内における配置座標と回転とを任意に設定する。その後、部品群G2の部品CAが先配置した部品群G1の部品CAと干渉しているか否かを確認する干渉チェックが行われる。単位配置体3については、図5(B)に例示したように、部品CA同士の干渉配置を想定しているので、ミックスエリア4への単位配置体3の配置段階では、処理の簡素化のため部品群G1~G4同士の干渉を発生させない配置とする。
 前記干渉チェックの結果、干渉が発生していなければ、続いて部品群G3がミックスエリア4内に配置される。引き続き、前記干渉チェックの後、部品群G4がミックスエリア4内に配置される。図7(A)では、部品群G1~G4の部品CA同士が互いに干渉することなく配置された例を示している。なお、拘束エリア31同士は、互いに干渉していても構わない。
 図7(B)は、ミックスエリア4内に配置された部品群G1~G4の部品CAの一部に干渉が生じている例を示している。具体的には、部品群G3と部品群G4の部品CA同士に重なりが生じている。このような干渉が生じている場合、下記(a)又は(b)の変更処理を行う。
 (a)干渉を回避できるよう、部品群G3又は部品群G4のいずれかの部品群センターGCの配置座標をシフトさせる処理、若しくは、部品群センターGC回りに回転させる処理を行う。
 (b)部品群G3又は部品群G4の部品群センターGCの配置座標をキャンセルして、新たな配置座標及び回転を設定する処理を行う。
 図7(C)は、上記(a)の変更処理の例を示しており、部品群G3の配置座標を右斜め上方向にシフトさせることで、部品群G3及び部品群G4の干渉を回避している。図7(C)の例に代えて、部品群G4の配置座標をシフトさせる、若しくは、部品群G3又は部品群G4を部品群センターGC回りに回転させて、前記干渉を回避しても良い。図7(D)は、上記(b)の変更処理の例を示す。図7(B)で設定された部品群G3の配置座標がキャンセルされ、新たな部品群G3の配置座標及び回転が設定されている。もちろん、部品群G4の配置座標をキャンセルし、新たな部品群G4の配置座標及び回転を設定しても良い。以上の手順により、ステージ1で作成された部品群G1~G4各々の部品配置関係を維持したまま、ミックスエリア4内に多様に部品CAを配置することができる。
 続いて、図7(E)に示すように、ミックスエリア4において部品CAが配置されていない領域をデータ上で除去する処理が行われる。これにより、ミックスエリア4内に配置された部品群G1~G4の、容器エリアTAへの配置自由度を高めるこができる。図7(E)では、部品群G1~G4を取り囲むことができる最小矩形エリア(最外形)をミックス部品群エリア41として定め、このエリア41より外側の領域を削除している例を示している。なお、最外形より外側の領域を除く処理の形態は、最小矩形エリアの設定に限らず、任意の除去手法を採用しても良い。また、除去作業自体を省き、ミックスエリア4をそのまま用いても良い。
 その後、ミックス部品群エリア41内における部品群G1~G4の配置状態が保存される。具体的には、ミックス部品群エリア41の中心座標であるミックス部品群センターMGCを基準座標として、部品群G1~G4の各部品群センターGCの配置座標と回転角とが記憶装置に格納される。格納されるデータは、ミックス部品群センターMGCを基準とするx方向及びy方向の座標値、及び、部品群センターGCのz軸回りの回転角θを示す、「xn、yn、θn」の値である。
 図8は、ミックスエリア4への単位配置体3の配置処理の他の例を示す図である。図7(A)~(E)の例では、ミックスエリア4の全域を単位配置体3の配置可能領域として使用する例を示した。これに代えて、図8では、ミックスエリア4内に、単位配置体3を配置させない配置不可領域42が設定される例を示している。この例の場合、単位配置体3の部品CA同士の干渉だけでなく、部品CAと配置不可領域42との干渉が回避されるように、単位配置体3がミックスエリア4内の配置可能領域に配置される。実際の部品Cの補填作業において、部品Cが容器Tの縁付近に偏って配置される場合も想定される。このような配置を想定した教師画像データの作成に、配置不可領域42の設定は寄与する。
 <ステージ3>
 ステージ3では、ステージ2で作成したミックス部品群エリア41又はミックスエリア4を、容器エリアTA内に配置する処理が実行される。図9(A)~(C)は、ミックス部品群エリア41の容器エリアTAへの配置処理の実施状況を示す図である。ミックス部品群エリア41は、ミックス部品群センターMGCの配置座標(xn、yn)と、ミックス部品群センターMGC軸回りの回転角(θn)とを任意に設定することによって、容器エリアTAに配置される。但し、配置座標の設定範囲は、容器エリアTAとミックス部品群エリア41との差分の範囲である。
 図9(A)は、ミックス部品群エリア41が容器エリアTAの左上寄りに配置されている例である。図9(B)は、ミックス部品群エリア41が容器エリアTAの右下寄りに配置されている例である。容器エリアTAには、側壁領域TAWと、実際に部品が載置される底壁領域TABとが設定されている。図9(A)及び(B)のミックス部品群エリア41は、いずれも底壁領域TAB内に収まっており、配置要件を満たしている例である(配置OK)。
 一方、図9(C)は、配置要件を満たさない例である(配置NG)。ミックス部品群エリア41のミックス部品群センターMGCの配置座標は、容器エリアTAの中心である。しかし、図9(A)のミックス部品群エリア41に対して、図9(C)の例ではセンターMGC軸回りに時計方向に90度回転されているため、部品群G1及びG4が側壁領域TAWに差し掛かっている。このような配置となった場合、ミックス部品群エリア41の回転角を変更する、或いはミックス部品群センターMGCの配置座標及び回転角を再設定する処理が実行される。
 ステージ3では、続いてレンダリングにより容器エリアTA及び部品CAに質感を与える処理が実行される。この処理には、物理ベースレンダリングツールを用いることが望ましい。レンダリング処理の一つは、部品CAが配置された容器エリアTAを撮像する光学系の設定である。この撮像光学系の設定は、検査カメラ14(図1)で実際に部品Cが配置された容器エリアTAを撮像するケースを想定して行われる。つまり、検査カメラ14を想定した疑似カメラ、及び検査室の環境を想定した疑似照明を設定する。
 疑似カメラについては、露出(絞り、シャッター速度及びISO感度)、被写界深度、画角、カメラ配置角などのパラメータが設定される。実際の検査カメラ14による撮像では、合焦度が異なる画像や、撮像方向の変動した画像等が撮像され、画一的な画像を取得できないケースが想定される。このため、上記パラメータのうち、変動が予想され画質に影響を与えるパラメータについてはバラツキ範囲を設定する。但し、あくまで物理現象に即した範囲でのバラツキ値である。これにより、検査カメラ14にて取得される可能性のある画像をカバーすることができ、実情に即した教師画像データを作成できる。
 疑似照明については、使用する照明のタイプ、明るさ、色合い、照明方向、検査室の反射条件などのパラメータが設定される。照明条件も、種々の要因で変動し得る。例えば、作業員が検査カメラ14による撮像位置付近を通過した際の影により、一時的に照明条件が変動する。このため、上記パラメータのうち、変動が予想されるパラメータについては、バラツキ範囲を設定する。
 レンダリング処理の他の一つは、部品CA及び容器エリアTAの材質設定である。例えば、実際の部品Cが金属ボルトである場合、金属光沢、ねじ部分の凹凸による反射感、ざらつき感などのパラメータの設定が行われる。部品CAについても、実際の容器Tの材質、色、表面光沢などのパラメータの設定が行われる。これら材質の設定が、部品CA及び容器エリアTAの質感調整ともなる。また、実際の部品C及び容器Tの質感にはバラツキが有るので、材質パラメータにバラツキ範囲を設定する。
 上述のようにして、部品CA及び容器エリアTAのレンダリング設定が完了したら、物理ベースレンダリングを実行して教師画像5を作成し、その教師画像データを保存する。図10(A)~(E)は、教師画像5の具体例を示す図である。質感が付与された容器エリアTAの底壁領域TABに、質感が付与された複数の部品CARが載置された合成画像からなる教師画像5が、部品数や配置状態を異ならせて多数作成される。
 図10(A)は、部品CARが容器エリアTAの底壁領域TABに満遍なく配置された合成画像である。図10(B)は、部品CARが側壁領域TAWに沿うように配置された合成画像である。図10(C)は、底壁領域TABの約半面に密集して部品CARが配置された合成画像である。図10(D)及び(E)は、部品CARのペアが、底壁領域TABに密接して配置された合成画像である。単位配置体3及びミックスエリア4を作成して部品配置を多様化した上で、物理ベースレンダリングを実行しているので、物理現象に即し且つ部品配置のバリエーションに富んだ教師画像5を生成することができる。
 [教師画像データ作成処理のフロー]
 図11は、図2に示す教師画像データ作成部11が実行する、第1実施形態に係る教師画像データ作成処理を示すフローチャートである。教師画像データ作成部11の処理装置2は、教師画像5となる合成画像を作成する各種の部品C及び容器Tの三次元形状を画像で表現するモデルデータの入力を、データ入力部26から受け付ける(ステップS1)。前記モデルデータは、例えばCADファイルの形式で処理装置2に入力される。
 続いて、単位配置体作成部22が、物理シミュレータで作成する単位配置体3(図4)を構成する部品CAの種別及び員数を選定する(ステップS2)。一方、拘束エリア設定部21は、上述した通り、選定された部品CAの長辺・短辺方向サイズ及び拡張係数βを用いて、所要のXY方向のサイズを備えた拘束エリア31を設定する。さらに、拘束エリア設定部21は、当該拘束エリア31に基づいて、物理シミュレータ上に拘束容器32(図5)を生成する(ステップS3)。
 次に単位配置体作成部22は、ステップS3で生成した拘束容器32に、ステップS2で選定した部品CAの自由落下条件を設定する(ステップS4)。設定されるのは、部品CAの自由落下開始位置及び部品姿勢である。自由落下開始位置は、XY平面上の位置を示すXY座標位置と、落下開始高さh1(図6(A))に相当するZ座標位置とで設定される。部品姿勢は、XYZの各軸回りの回転角にて設定される。その後、単位配置体作成部22は、物理シミュレーションにより、設定された自由落下条件にて、拘束容器32内に員数分の部品CAを自由落下させる(ステップS5)。
 自由落下させた部品CAの姿勢安定後、単位配置体作成部22は、拘束容器32の除去処理を行い、さらに前記除去処理後、所定の待機時間の経過を待つ。部品CAの変動がなくなった時点で、一つの単位配置体3の作成が完了する。その後、単位配置体作成部22は、作成した単位配置体3の部品群センターGCに対する各部品CAの相対的なXY位置座標及び各軸回りの回転角のデータを、データ記憶部25に保存する(ステップS6)。以上のような単位配置体3の作成処理が、所要の単位配置体3の体数分だけ実行される。
 次に、部品配置画像作成部23は、ミックスエリア4(図4)に配置する単位配置体3及びその個数を設定する(ステップS7)。その後、部品配置画像作成部23は、物理シミュレータ上にミックスエリア4を設定する(ステップS8)。ミックスエリア4のサイズは、上述の通り、容器エリアTAのサイズと縮小係数αとを用いて設定される。
 続いて部品配置画像作成部23は、図7に例示したように、ミックスエリア4に単位配置体3を任意の位置及び回転角で配置する処理を実行する(ステップS9)。この処理の際、部品配置画像作成部23は、各単位配置体3に対応する部品群G1~G4同士の干渉チェックを行う。前記干渉が生じている場合、部品配置画像作成部23は、その干渉を解消するように、部品群G1~G4のいずれかのシフト又は再配置を実行する(図7(C)、(D))。
 その後、部品配置画像作成部23は、ミックスエリア4において部品CAが配置されていない領域を、各部品の最外形から判断して除くことで、ミックス部品群エリア41(図7(E))が設定される(ステップS10)。そして、部品配置画像作成部23は、ミックス部品群センターMGCを基準座標として、部品群G1~G4の各部品群センターGCの配置座標と回転角とをデータ記憶部25に格納する(ステップS11)。
 さらに、部品配置画像作成部23は、図9に例示したように、容器エリアTA内にミックス部品群エリア41をランダムに配置する処理を実行する(ステップS12)。部品配置画像作成部23は、ミックス部品群エリア41の配置後における、ミックス部品群センターMGCの配置座標(xn、yn)及びミックス部品群センターMGC軸回りの回転角(θn)も、データ記憶部25に格納する。格納された配置情報は、教師画像データに存在する部品CAの配置を示す正解データとなる。部品配置画像作成部23は、教師画像データの識別番号とその正解データとを関連付けてデータ記憶部25に記憶させる。
 続いて、レンダリング部24が、物理ベースレンダリングにより容器エリアTA及び部品CAに質感を付与する処理を実行する。具体的には、レンダリング部24は、部品CAが配置された容器エリアTAを撮像する光学系(カメラ及び照明)の設定、及びそのバラツキ範囲を設定する(ステップS13)。また、レンダリング部24は、部品CA及び容器エリアTAの材質の設定、及びそのバラツキ範囲を設定する(ステップS14)。
 しかる後、レンダリング部24は、物理ベースレンダリング処理を実行し、教師画像5となる合成画像データ(教師画像データ)を生成する(ステップS15)。作成された教師画像データは、データ記憶部25に保存される(ステップS16)。データ記憶部25の教師画像データは、必要に応じて学習モデル生成装置10に提供される。
 [第2実施形態]
 図12は、第2実施形態に係る員数自動検査システム1Aの構成を示すブロック図である。員数自動検査システム1Aは、第1実施形態の員数自動検査システム1に比較して、モデル更新処理部17が追加されている点で相違する。モデル更新処理部17は、学習モデル記憶部13に格納されている学習モデルの作成元となった教師画像と、最近の員数検査において検査カメラ14が撮像している実画像とを比較する。そして、両画像の傾向に齟齬が生じている場合、モデル更新処理部17は学習モデル生成装置10に学習モデルの更新処理を実行させる。
 作業者(或いはロボット)によって、部品Cを容器Tに載置する傾向が変わる場合がある。例えば、先行の作業者Aが、部品Cを容器Tに満遍なく分散して載置する作業傾向があったとする。一方、同作業を引き継いだ作業者Bが、部品Cを容器Tの偏った位置に密集状態にして載置する作業傾向があったとする。現状で学習モデル記憶部13に格納されている学習モデルが、作業者Aの作業下では員数判定精度が高かったとしても、作業傾向が異なる作業者Bの作業下でも員数判定精度が高いとは限らない。このような事象を想定して、モデル更新処理部17は、定期的に学習モデルの精度を判定する。
 モデル更新処理部17は、機能的に画像類似度評価部171及び再学習判定部172を備えている。画像類似度評価部171は、員数自動検査の際に実際に検査カメラ14によって取得されている部品Cを収容した容器Tの実画像と、教師画像データ作成部11によって作成された教師画像5と比較し、両者の画像類似度を評価する。画像類似度は、例えばテンプレートマッチング等の手法で評価することができ、例えばSWD(Sliced Wasserstein Distance)にて評価することができる。
 再学習判定部172は、画像類似度評価部171が評価結果に基づいて、学習モデルの更新、すなわち教師画像データを用いた再学習の必要性を判定する。再学習判定部172は、画像類似度が所定の閾値よりも低い場合に、現状で取得されている実画像の傾向に沿った教師画像データを追加作成して学習モデルを更新するよう、学習モデル生成装置10に指示を与える。
 図13(A)及び(B)は、合成教師画像と実画像の類似度の判定状況を示す図である。図13(A)には、5種の合成教師画像T1~T5が例示されている。合成教師画像T1~T5は、図10(A)~(E)に例示した教師画像と同じである。図13(B)の左側の実画像AD1は、部品Cが比較的分散して容器Tに収容されている。一方、右側の実画像AD2は、部品Cが中央付近に密集して容器Tに収容されている。
 合成教師画像T1~T5のうち、実画像AD1に最も類似度が高いのは合成教師画像T1であり、次に類似度が高いのは合成教師画像T2である。これに対し、合成教師画像T3、T4、T5は、実画像AD1に対して類似度が低い。一方、実画像AD2に最も類似度が高いのは合成教師画像T3であり、次に類似度が高いのは合成教師画像T4、T5である。これに対し、合成教師画像T1、T2は、実画像AD2に対して類似度が低い。
 実際の員数検査で取得されている画像が実画像AD1の傾向である場合、合成教師画像T1、T2に示すような部品分散型の教師画像をより多く学習させた方が、学習モデルの性能が向上する。逆に、取得画像が実画像AD2の傾向である場合は、合成教師画像T3~T5に示すような密集型の教師画像をより多く学習させた方が、学習モデルの性能が向上する。
 例えば、検査カメラ14が撮像している画像の傾向が実画像AD1から実画像AD2に変化した場合、モデル更新処理部17は、合成教師画像T3~T5、特にT3の傾向に沿った合成画像のバリエーションを多数作成して再学習し、学習モデルを更新するよう学習モデル生成装置10に指示を与える。以上の第2実施形態によれば、部品員数の自動検査を実際に行っていくうちに、教師画像データが実画像とかけ離れる傾向が生じたような場合に、学習モデルを実情に沿うように更新させてその性能を高めることができる。
 [第3実施形態]
 図14は、第3実施形態に係る教師画像データ作成処理の実施状況を示す模式図である。第3実施形態では、本来の部品CA以外の異物を交えて教師画像データを作成する例を示す。これにより、員数自動検査システム1に、員数検査だけでなく、異物の有無検査機能を付加することができる。
 第3実施形態では、図3のステージ1の段階で、実際の異物を模擬して三次元データにて作成された異物61が、教師画像データ作成部11によって単位配置体3と共に作成される。異物61としては、単位配置体3の部品CAが収容される容器Tに、実際に混入する可能性のある他種の部品を作成することが望ましい。図14では、物理シミュレータにより、一つの異物61を含む異物ブロック6が複数作成されている例を示している。
 ステージ2のミックスエリア4への配置ステップでは、複数体の単位配置体3と共に、異物ブロック6も配置される。図14では、2種類の単位配置体3A、3Bに加えて、2個の異物ブロック6がミックスエリア4内に配置されている例を示している。
 続くステージ3では、異物ブロック6を含むミックスエリア4を容器エリアTAに任意に配置して形状画像データが作成される。さらに、当該形状画像データにレンダリングを施すことで質感を与える処理が実行され、教師画像5が作成される。教師画像5においては、異物61に対してもモデルとした実際の異物が持つ質感が与えられるので、部品CA及び異物61は各々質感を有する部品CAR及び異物61Rとして表現される。
 異物61R入りの教師画像5を作成しておけば、検査カメラ14で取得された検査画像に想定した異物が含有されているとき、検査処理部15は前記異物が容器Tに混入していることが識別可能となる。従って、部品Cの中に異物が混入した容器が、次段の工程に流出しないようにチェックすることができる。
 [第4実施形態]
 第4実施形態では、レンダリング処理を施す前の形状画像データの作成処理を簡素化する例を示す。第1実施形態では、部品CAを自由落下させて生成した単位配置体3をミックスエリア4に任意配置し、これを容器エリアTAに任意配置して形状画像データを作成する例を示した。これに対し、第4実施形態では、容器エリアTAに部品CAを直接自由落下させることで、形状画像データを作成する例を示す。
 図15は、第4実施形態における単位配置体3の配置処理の実施状況を示す図である。第1実施形態では、自由落下させる部品CAの配置範囲を拘束容器32で拘束した。これに代えて第4実施形態では、自由落下開始位置を制限することで、部品CAの配置範囲を拘束する。図15(A)に示すように、部品C11及びC12の自由落下を開始させる落下開始高さh2を、自由落下面32Aの基準高さh0よりもΔh2だけ高い高さ(対象物の任意は位置状態を維持できる落下開始高さ)に設定する。
 落下開始高さh2は、図6(A)に示した落下開始高さh1よりも低い高さ(Δh1>Δh2)であって、自由落下面32Aへの衝突後に部品C11、C12の配置関係が大きく乱れない高さである。従って、部品C11、C12の配置関係を予め定めて自由落下をさせると、図15(A)に示す配置エリアを持つ自由落下面32Aの範囲内に、部品C11、C12を配置することが可能となる。このため、自由落下面32Aを単位配置体3と扱うことができる。また、自由落下前の部品C11、C12の配置関係をある程度維持できるため、ミックスエリア4への配置ステップを省いて、直接容器エリアTAに自由落下させても、ある程度は部品密集度のバラエティーに富んだ形状画像データを作成することができる。
 図15(B)は、容器エリアTAに部品群C31、C32、C33、C34を直接自由落下させている例を示す図である。部品群C31~C34の部品配置関係は、自由落下前に予め定められ、物理シミュレータ上において上述の落下開始高さh2に相当する高さ位置から自由落下される。自由落下された部品群C31~C34の部品配置関係は、概ね自由落下前の部品配置関係を維持している。この自由落下処理により、容器エリアTAに複数の部品が任意に配置された形状画像データが作成される。その後、当該形状画像データに対して、図3のステージ3の質感付与処理が施され、教師画像データが作成される。
 図16は、第4実施形態の教師画像データ作成処理を示すフローチャートである。本実施形態においても、図2に示す教師画像データ作成部11が教師画像データを作成する。処理装置2は、教師画像5となる合成画像を作成する各種の部品C及び容器Tの三次元形状を画像で表現するモデルデータの入力を、データ入力部26から受け付ける(ステップS21)。続いて、単位配置体作成部22が、物理シミュレータで作成する部品群C31~C34を構成する部品の種別及び員数を選定する(ステップS22)。
 次に単位配置体作成部22は、ステップS22で選定した部品群C31~C34の自由落下条件を設定する(ステップS23)。設定されるのは、部品群C31~C34の自由落下開始位置及び部品姿勢である。自由落下開始位置は、XY平面上の位置を示すXY座標位置と、落下開始高さh2に相当するZ座標位置とで設定される。部品姿勢は、XYZの各軸回りの回転角にて設定される。
 その後、単位配置体作成部22は、物理シミュレーションにより、設定された自由落下条件にて、容器エリアTAに部品群C31~C34を自由落下させる(ステップS24)。自由落下させた部品群C31~C34の姿勢安定後、部品群C31~C34を構成する各部品のXY位置座標及び各軸回りの回転角のデータを、データ記憶部25に保存する(ステップS25)。
 その後、レンダリング部24が、物理ベースレンダリングにより容器エリアTA及び部品群C31~C34に質感を付与する処理を実行する(ステップS26~S28)。実行されるレンダリング処理は、図11のステップS13~S15で説明した処理と同じであるので、説明を省く。作成された教師画像データは、データ記憶部25に保存される(ステップS29)。
 [作用効果]
 以上説明した実施形態によれば、モデルデータから作成された容器エリアTA及び部品CAを用いて、図9(A)、(B)に示したような模擬的な形状画像データが作成される。前記形状画像データは、複数体の単位配置体3をミックスエリア4に配置し、さらにミックス部品群エリア41を容器エリアTA内に任意に配置して作成される。単位配置体3自体が、複数個の部品CAを任意に配置して作成されるので、部品CAの密集度乃至は粗密が多様な形状画像データを容易に合成することができる(第1実施形態)。また、第4実施形態のように、容器エリアTAに部品群C31~C34を直接自由落下させれば、部品配置のバリエーションは若干低下するとしても、簡易に形状画像データを合成することができる。さらに、前記形状画像状データに、現実の容器T及び部品Cの質感を与える処理を施して教師画像5のデータが作成される。このため、部品Cを収容した容器Tを実際に撮像した実画像と遜色のない教師画像データを得ることができる。従って、当該教師画像データを用いて機械学習を行って生成される学習モデルの性能を高めることができる。
 さらに、実画像から教師画像を作成するのではなく、最初から画像合成により教師画像を作成するので、より学習に適した教師画像データを作成することができる。図17は、実画像に基づき教師画像データを作成する場合の不具合を説明するための図である。実画像から教師画像を作成する場合、取得された二次元の実画像をベースにして画像合成を行うことになる。もちろん、実画像を多数枚取得してこれを教師画像としても良いが、撮像に膨大な手間を要する。
 二次元画像から部品等の対象物を認識するためには、エッジ抽出等の画像処理が必要となる。図17(A)は、ある実画像から切り出されたボルト型の対象物を示している。この切り出し画像では、対象物のオリジナル形状のエッジが明瞭に認識されている。しかし、二次元の実画像から対象物とその背景とを切り出した画像では、対象物のエッジを明確に認識できない場合が多々ある。図17(B)は対象物のエッジが不明瞭な例、図17(C)はエッジが欠落している例である。また、対象物同士が重なり合ったり接近したりしていると、対象物のオリジナル形状とは異なる形状を認識してしまう。図17(D)は、対象物同士が重なっている場合に認識されるエッジの例、図17(E)は、対象物同士が隣接している場合に認識されるエッジの例である。これに対し、上述した実施形態のように、三次元の合成画像の場合は、対象物が単体で配置されている場合はもちろんのこと、複数の対象物が重なりや隣接している状態で配置されている場合でも、その配置関係を明確に把握することができる。従って、本実施形態によれば、対象物の配置を示す正解データと正確に対応した教師画像データを作成することができる。
 [上記実施形態に含まれる発明]
 本発明の一局面に係る対象物員数検査用の学習モデル生成方法は、容器内に収容される対象物の員数を自動検査する処理を行うための、機械学習に用いられる学習モデルの生成方法であって、前記学習モデルの生成装置に、前記容器及び対象物の形状を画像で表現するモデルデータを入力するステップと、前記モデルデータを用いて、複数個の対象物を任意に配置した単位配置体を複数体作成させると共に、前記容器に対応する容器エリア内に前記単位配置体を任意に配置することで、前記対象物を任意の密集度で収容している前記容器の形状画像データを作成させるステップと、前記形状画像状データに、現実の前記容器及び前記対象物の質感を与える処理を加え、前記学習モデルを構築する際に使用される教師画像データを作成させるステップと、を実行させることを特徴とする。
 本発明の他の局面に係る対象物員数検査用の学習モデル生成プログラムは、容器内に収容される対象物の員数を自動検査する処理を行うための、機械学習に用いられる学習モデルを、所定の学習モデル生成装置に作成させるためのプログラムであって、前記容器及び対象物の形状を画像で表現するモデルデータの入力を受け付けるステップと、前記モデルデータを用いて、複数個の対象物を任意に配置した単位配置体を複数体作成させると共に、前記容器に対応する容器エリア内に前記単位配置体を任意に配置することで、前記対象物を任意の密集度で収容している前記容器の形状画像データを作成させるステップと、前記形状画像状データに、現実の前記容器及び前記対象物の質感を与える処理を加え、前記学習モデルを構築する際に使用される教師画像データを作成させるステップと、を前記学習モデル生成装置に実行させることを特徴とする。
 この学習モデル生成方法又は学習モデル生成プログラムによれば、容器及び対象物のモデルデータを用いて模擬的な形状画像データが作成される。この形状画像データは、複数体の単位配置体を容器エリア内に任意に配置して作成される。前記単位配置体自体が、複数個の対象物を任意に配置して作成されるので、前記対象物の密集度乃至は粗密が多様な形状画像データを容易に合成することができる。さらに、前記形状画像状データに、現実の前記容器及び前記対象物の質感を与える処理を施して教師画像データが作成される。このため、対象物入り容器を実際に撮像した実画像と遜色のない教師画像データを得ることができる。従って、当該教師画像データを用いて機械学習を行って生成される学習モデルの性能を高めることができる。
 上記の学習モデル生成方法において、前記単位配置体は、前記容器エリアよりも小さい拘束エリアを予め設定し、任意数の前記対象物を前記拘束エリア内に任意に配置することにより作成されることが望ましい。
 この学習モデル生成方法によれば、単位配置体の範囲が拘束エリアによって定型化されるので、その後の容器エリア内への前記単位配置体の配置が行い易くなる。
 上記の学習モデル生成方法において、物理シミュレーションにより、前記拘束エリア内に前記任意数の対象物を自由落下させることにより、当該対象物を前記拘束エリア内に任意に配置することが望ましい。
 この学習モデル生成方法によれば、物理シミュレーションによる自由落下を用いるので、任意数の対象物の前記拘束エリア内への任意配置に特定の偏りが生じ難くなる。従って、拘束エリア内で様々な配置姿勢を取る単位配置体を作成でき、対象物の多様な密集度乃至は粗密度合いを有する形状画像データを作成することできる。
 上記の学習モデル生成方法において、前記形状画像データを作成させるステップは、前記容器エリアと同等又は小さく、前記拘束エリアよりも大きいミックスエリアを設定し、前記ミックスエリア内に前記複数体の単位配置体を任意に配置するステップと、前記単位配置体が配置された前記ミックスエリアを、前記容器エリア内の任意の位置に任意の方向で配置するステップと、を含むことが望ましい。
 この学習モデル生成方法によれば、複数体の単位配置体をミックスエリア内に任意配置した上で、さらに当該ミックスエリアを容器エリア内に任意配置する。このため、容器内に対象物が分散した配置或いは偏った配置の形状画像データを作成できる等、より一層対象物の多様な密集度乃至は粗密度合いを有する形状画像データを作成できる。
 上記の学習モデル生成方法において、物理シミュレーションにより、前記複数体の単位配置体を、前記対象物の任意配置状態を維持できる落下開始位置から、前記容器エリア内に自由落下させることで、容器エリア内に前記単位配置体を任意に配置することができる。
 この学習モデル生成方法によれば、対象物の任意配置状態を維持したまま、直接容器エリア内に前記単位配置体を任意に配置できる。従って、形状画像データの作成を簡素化することができる。
 上記の学習モデル生成方法において、前記形状画像データにおける前記対象物の各々の配置を示す情報を、前記教師画像データに存在する前記対象物の配置を示す正解データとして扱い、前記学習モデルの生成装置が備える記憶装置に、前記教師画像データと前記正解データとを関連付けて記憶させることが望ましい。
 この学習モデル生成方法によれば、実画像に基づき正解データを導出する場合に比べて、教師画像データにおける対象物の配置と、その正解データとを正確に紐付けることができる。
 上記の学習モデル生成方法において、前記質感を与える処理は、前記対象物及び前記容器の撮像光学系の設定及びそのバラツキ範囲の設定、並びに、前記対象物及び前記容器の材質及びそのバラツキ範囲の設定を含む、物理ベースレンダリングにて実行されることが望ましい。
 この学習モデル生成方法によれば、実際の員数検査の状況に応じた質感を前記対象物及び前記容器に与えることが可能となる。従って、より実画像に近い教師画像データを生成させることができる。
 上記の学習モデル生成方法において、前記対象物の員数の自動検査の際に実際に取得される前記対象物を収容した容器の実画像と、前記教師画像データとを対比し、両者の類似度が所定の閾値よりも低い場合に、前記実画像の傾向に沿った教師画像データを追加作成して前記学習モデルを更新することが望ましい。
 この学習モデル生成方法によれば、前記対象物の員数の自動検査を実際に行っていくうちに、教師画像データが実画像とかけ離れる傾向が生じたような場合に、学習モデルを実情に沿うように更新させてその性能を高めることができる。
 上記の学習モデル生成方法において、前記形状画像データを作成させるステップは、前記対象物以外の異物を、前記容器エリア内に配置するステップを含むことが望ましい。
 この学習モデル生成方法によれば、異物を含んだ形状画像データが作成される。このため、員数検査だけでなく、異物の有無検査にも学習モデルを適用することが可能となる。
 以上説明した本発明によれば、対象物の員数を検査する処理を行うための機械学習に使用される学習モデルを的確に作成することができる学習モデル生成方法、及び学習モデル生成プログラムを提供することができる。

Claims (10)

  1.  容器内に収容される対象物の員数を自動検査する処理を行うための、機械学習に用いられる学習モデルの生成方法であって、前記学習モデルの生成装置に、
     前記容器及び対象物の形状を画像で表現するモデルデータを入力するステップと、
     前記モデルデータを用いて、複数個の対象物を任意に配置した単位配置体を複数体作成させると共に、前記容器に対応する容器エリア内に前記単位配置体を任意に配置することで、前記対象物を任意の密集度で収容している前記容器の形状画像データを作成させるステップと、
     前記形状画像状データに、現実の前記容器及び前記対象物の質感を与える処理を加え、前記学習モデルを構築する際に使用される教師画像データを作成させるステップと、
    を実行させることを特徴とする対象物員数検査用の学習モデル生成方法。
  2.  請求項1に記載の学習モデル生成方法において、
     前記単位配置体は、前記容器エリアよりも小さい拘束エリアを予め設定し、任意数の前記対象物を前記拘束エリア内に任意に配置することにより作成される、対象物員数検査用の学習モデル生成方法。
  3.  請求項2に記載の学習モデル生成方法において、
     物理シミュレーションにより、前記拘束エリア内に前記任意数の対象物を自由落下させることにより、当該対象物を前記拘束エリア内に任意に配置する、対象物員数検査用の学習モデル生成方法。
  4.  請求項2又は3に記載の学習モデル生成方法において、
     前記形状画像データを作成させるステップは、
      前記容器エリアと同等又は小さく、前記拘束エリアよりも大きいミックスエリアを設定し、前記ミックスエリア内に前記複数体の単位配置体を任意に配置するステップと、
      前記単位配置体が配置された前記ミックスエリアを、前記容器エリア内の任意の位置に任意の方向で配置するステップと、を含む、対象物員数検査用の学習モデル生成方法。
  5.  請求項1に記載の学習モデル生成方法において、
     物理シミュレーションにより、前記複数体の単位配置体を、前記対象物の任意配置状態を維持できる落下開始位置から、前記容器エリア内に自由落下させることで、容器エリア内に前記単位配置体を任意に配置する、対象物員数検査用の学習モデル生成方法。
  6.  請求項1~5のいずれか1項に記載の学習モデル生成方法において、
     前記形状画像データにおける前記対象物の各々の配置を示す情報を、前記教師画像データに存在する前記対象物の配置を示す正解データとして扱い、
     前記学習モデルの生成装置が備える記憶装置に、前記教師画像データと前記正解データとを関連付けて記憶させる、対象物員数検査用の学習モデル生成方法。
  7.  請求項1~6のいずれか1項に記載の学習モデル生成方法において、
     前記質感を与える処理は、前記対象物及び前記容器の撮像光学系の設定及びそのバラツキ範囲の設定、並びに、前記対象物及び前記容器の材質及びそのバラツキ範囲の設定を含む、物理ベースレンダリングにて実行される、対象物員数検査用の学習モデル生成方法。
  8.  請求項1~7のいずれか1項に記載の学習モデル生成方法において、
     前記対象物の員数の自動検査の際に実際に取得される前記対象物を収容した容器の実画像と、前記教師画像データとを対比し、
     両者の類似度が所定の閾値よりも低い場合に、前記実画像の傾向に沿った教師画像データを追加作成して前記学習モデルを更新する、対象物員数検査用の学習モデル生成方法。
  9.  請求項1~8のいずれか1項に記載の学習モデル生成方法において、
     前記形状画像データを作成させるステップは、前記対象物以外の異物を、前記容器エリア内に配置するステップを含む、対象物員数検査用の学習モデル生成方法。
  10.  容器内に収容される対象物の員数を自動検査する処理を行うための、機械学習に用いられる学習モデルを、所定の学習モデル生成装置に作成させるためのプログラムであって、
     前記容器及び対象物の形状を画像で表現するモデルデータの入力を受け付けるステップと、
     前記モデルデータを用いて、複数個の対象物を任意に配置した単位配置体を複数体作成させると共に、前記容器に対応する容器エリア内に前記単位配置体を任意に配置することで、前記対象物を任意の密集度で収容している前記容器の形状画像データを作成させるステップと、
     前記形状画像状データに、現実の前記容器及び前記対象物の質感を与える処理を加え、前記学習モデルを構築する際に使用される教師画像データを作成させるステップと、
    を前記学習モデル生成装置に実行させることを特徴とする対象物員数検査用の学習モデル生成プログラム。
PCT/JP2021/013359 2021-03-29 2021-03-29 対象物員数検査用の学習モデル生成方法及びプログラム WO2022208623A1 (ja)

Priority Applications (5)

Application Number Priority Date Filing Date Title
JP2023509932A JP7481575B2 (ja) 2021-03-29 2021-03-29 対象物員数検査用の学習モデル生成方法及びプログラム
US18/550,393 US20240153253A1 (en) 2021-03-29 2021-03-29 Method and program for generating trained model for inspecting number of objects
PCT/JP2021/013359 WO2022208623A1 (ja) 2021-03-29 2021-03-29 対象物員数検査用の学習モデル生成方法及びプログラム
DE112021007085.1T DE112021007085T5 (de) 2021-03-29 2021-03-29 Verfahren und Programm zur Erzeugung eines trainierten Modells zur Inspektion einer Anzahl von Objekten
CN202180095962.8A CN117063061A (zh) 2021-03-29 2021-03-29 对象物个数检查用学习模型生成方法及程序

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2021/013359 WO2022208623A1 (ja) 2021-03-29 2021-03-29 対象物員数検査用の学習モデル生成方法及びプログラム

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/957,578 Continuation US20230028630A1 (en) 2020-03-30 2022-09-30 Computer system and method for controlling generation of virtual model

Publications (1)

Publication Number Publication Date
WO2022208623A1 true WO2022208623A1 (ja) 2022-10-06

Family

ID=83455786

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2021/013359 WO2022208623A1 (ja) 2021-03-29 2021-03-29 対象物員数検査用の学習モデル生成方法及びプログラム

Country Status (5)

Country Link
US (1) US20240153253A1 (ja)
JP (1) JP7481575B2 (ja)
CN (1) CN117063061A (ja)
DE (1) DE112021007085T5 (ja)
WO (1) WO2022208623A1 (ja)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019159440A1 (ja) * 2018-02-14 2019-08-22 株式会社イシダ 検査装置
JP2019191973A (ja) * 2018-04-26 2019-10-31 株式会社神戸製鋼所 学習画像生成装置及び学習画像生成方法、並びに画像認識装置及び画像認識方法
JP2019200533A (ja) * 2018-05-15 2019-11-21 パナソニックIpマネジメント株式会社 計数装置、会計システム、学習装置、及び、制御方法
US20200043171A1 (en) * 2018-07-31 2020-02-06 Element Ai Inc. Counting objects in images based on approximate locations
JP2020080003A (ja) * 2018-11-12 2020-05-28 株式会社イシダ 教師データ生成方法、教師データ生成プログラム、教師データ生成装置、及び商品識別装置
JP2020126313A (ja) * 2019-02-01 2020-08-20 株式会社計数技研 計数装置、学習器製造装置、計数方法、学習器製造方法、及びプログラム

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7200713B2 (ja) 2019-02-04 2023-01-10 株式会社島津製作所 機械学習用教師データ作成支援方法、及び機械学習用教師データ作成支援プログラム

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019159440A1 (ja) * 2018-02-14 2019-08-22 株式会社イシダ 検査装置
JP2019191973A (ja) * 2018-04-26 2019-10-31 株式会社神戸製鋼所 学習画像生成装置及び学習画像生成方法、並びに画像認識装置及び画像認識方法
JP2019200533A (ja) * 2018-05-15 2019-11-21 パナソニックIpマネジメント株式会社 計数装置、会計システム、学習装置、及び、制御方法
US20200043171A1 (en) * 2018-07-31 2020-02-06 Element Ai Inc. Counting objects in images based on approximate locations
JP2020080003A (ja) * 2018-11-12 2020-05-28 株式会社イシダ 教師データ生成方法、教師データ生成プログラム、教師データ生成装置、及び商品識別装置
JP2020126313A (ja) * 2019-02-01 2020-08-20 株式会社計数技研 計数装置、学習器製造装置、計数方法、学習器製造方法、及びプログラム

Also Published As

Publication number Publication date
JPWO2022208623A1 (ja) 2022-10-06
JP7481575B2 (ja) 2024-05-10
DE112021007085T5 (de) 2023-12-14
US20240153253A1 (en) 2024-05-09
CN117063061A (zh) 2023-11-14

Similar Documents

Publication Publication Date Title
CN101088718A (zh) 机器人模拟装置
KR101300968B1 (ko) 제조 조건 판정 방법, 제조 조건 판정 장치, 마운터 및프로그램
US5787269A (en) Process simulation apparatus and method for selecting an optimum simulation model for a semiconductor manufacturing process
CN109816624A (zh) 外观检查装置
US6963338B1 (en) Method for refining geometric description models using images
CN108629830A (zh) 一种三维环境信息显示方法及设备
US20190391562A1 (en) Toolpath adjustments based on 3-dimensional scan data of physically manufactured parts
CN113223091A (zh) 三维目标检测方法、抓取方法、装置及电子设备
DE102015002658A1 (de) Robotersimulationssystem, das einen Entnahmevorgang eines Werkstücks simuliert
US20210086359A1 (en) Efficient Programming of Robots for Processing Workpieces with Different Variants
WO2022208623A1 (ja) 対象物員数検査用の学習モデル生成方法及びプログラム
JP2020191096A5 (ja) 推論方法、推論プログラム、モデル生成方法、モデル生成プログラム、推論装置及び学習装置
JP6816068B2 (ja) ロボットプログラム生成装置
CN110216671A (zh) 一种基于计算机仿真的机械抓手训练方法及系统
JP7233858B2 (ja) ロボット制御装置、ロボット制御方法、及びロボット制御プログラム
CN109508707A (zh) 基于单目视觉的机器人稳定抓取物体的抓取点获取方法
JP5476943B2 (ja) 姿勢認識方法およびこの方法を用いた3次元視覚センサ
US10402512B2 (en) Systems and methods for mathematical regression with inexact feedback
Hedengren Methodology for automatic image-based inspection of industrial objects
JP7200713B2 (ja) 機械学習用教師データ作成支援方法、及び機械学習用教師データ作成支援プログラム
JP2000200351A (ja) テンプレ―トの作成方法
TW202225077A (zh) 拆垛方法及拆垛系統
JPH09134378A (ja) プリント基板設計方法及び装置
JP2003066590A (ja) マスクパターン評価システム及びその方法
JP7429293B2 (ja) シミュレーション装置およびシミュレーション方法

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: 21934796

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2023509932

Country of ref document: JP

WWE Wipo information: entry into national phase

Ref document number: 202180095962.8

Country of ref document: CN

WWE Wipo information: entry into national phase

Ref document number: 112021007085

Country of ref document: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21934796

Country of ref document: EP

Kind code of ref document: A1