WO2020110711A1 - Inspection system, inspection method, and program - Google Patents

Inspection system, inspection method, and program Download PDF

Info

Publication number
WO2020110711A1
WO2020110711A1 PCT/JP2019/044387 JP2019044387W WO2020110711A1 WO 2020110711 A1 WO2020110711 A1 WO 2020110711A1 JP 2019044387 W JP2019044387 W JP 2019044387W WO 2020110711 A1 WO2020110711 A1 WO 2020110711A1
Authority
WO
WIPO (PCT)
Prior art keywords
inspection
image
unit
focus
evaluation
Prior art date
Application number
PCT/JP2019/044387
Other languages
French (fr)
Japanese (ja)
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 オムロン株式会社
Publication of WO2020110711A1 publication Critical patent/WO2020110711A1/en

Links

Images

Classifications

    • 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
    • GPHYSICS
    • G02OPTICS
    • G02BOPTICAL ELEMENTS, SYSTEMS OR APPARATUS
    • G02B7/00Mountings, adjusting means, or light-tight connections, for optical elements
    • G02B7/28Systems for automatic generation of focusing signals
    • GPHYSICS
    • G02OPTICS
    • G02BOPTICAL ELEMENTS, SYSTEMS OR APPARATUS
    • G02B7/00Mountings, adjusting means, or light-tight connections, for optical elements
    • G02B7/28Systems for automatic generation of focusing signals
    • G02B7/36Systems for automatic generation of focusing signals using image sharpness techniques, e.g. image processing techniques for generating autofocus signals
    • GPHYSICS
    • G03PHOTOGRAPHY; CINEMATOGRAPHY; ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ELECTROGRAPHY; HOLOGRAPHY
    • G03BAPPARATUS OR ARRANGEMENTS FOR TAKING PHOTOGRAPHS OR FOR PROJECTING OR VIEWING THEM; APPARATUS OR ARRANGEMENTS EMPLOYING ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ACCESSORIES THEREFOR
    • G03B13/00Viewfinders; Focusing aids for cameras; Means for focusing for cameras; Autofocus systems for cameras
    • G03B13/32Means for focusing
    • G03B13/34Power focusing
    • G03B13/36Autofocus systems
    • GPHYSICS
    • G03PHOTOGRAPHY; CINEMATOGRAPHY; ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ELECTROGRAPHY; HOLOGRAPHY
    • G03BAPPARATUS OR ARRANGEMENTS FOR TAKING PHOTOGRAPHS OR FOR PROJECTING OR VIEWING THEM; APPARATUS OR ARRANGEMENTS EMPLOYING ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ACCESSORIES THEREFOR
    • G03B15/00Special procedures for taking photographs; Apparatus therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules

Definitions

  • This technology relates to inspection systems, inspection methods, and programs.
  • Patent Document 1 discloses a focus adjustment device having an autofocus function for searching a focus position of a focus lens based on a contrast evaluation value of a subject image. Further, Patent Document 1 discloses that such a focus adjustment device is applied to an industrial device for inspection.
  • an image focused on the inspection target part of the object When performing an inspection using the captured image, it is necessary to obtain an image focused on the inspection target part of the object.
  • an image focused on a portion different from the inspection target portion of the target object may be obtained depending on the state of the target object.
  • the focus may be deviated from the inspection target portion of the object due to individual differences in the size of the object.
  • the focus may deviate from the inspection target portion of the object depending on the state of the transfer device that transfers the object. In such a case, since the image is focused on a portion different from the inspection target portion even though the object is defective, the defect at the inspection target portion cannot be recognized and the defect is overlooked.
  • the present invention has been made in view of the above problems, and an object thereof is to provide an inspection system, an inspection method, and a program that can reduce the risk of overlooking a defect in an object.
  • an inspection system includes an optical system having a variable focus position, an image sensor that generates an image by receiving light from an object via the optical system, and a focus that adjusts the focus position.
  • An adjustment unit, an inspection unit, and an evaluation unit are provided.
  • the inspection unit inspects the target object based on the first region in the inspection image generated when the focus position is adjusted by the focus adjustment unit, and outputs the inspection result.
  • the evaluation unit evaluates the reliability of focusing of the target object on the inspection target portion based on the second region of the inspection image, and outputs the evaluation result.
  • the reliability of focusing on the inspection target portion is evaluated based on the second area different from the first area. Therefore, for example, even when the contrast of the first region to be inspected is low, the reliability of focusing on the inspection target portion can be evaluated based on the second region different from the first region. Then, based on the evaluation result, it can be recognized that the inspection cannot be performed accurately due to the shift of the focus position. As a result, it is possible to reduce the risk of missing a defective target object as a non-defective product by an inspection based on an image focused on a position different from the inspection target position.
  • the inspection system uses the relative position of the first area and the second area with respect to the inspection image based on the deviation of the position and orientation of the object in the inspection image with respect to the position and orientation of the object in the reference image generated in advance.
  • a correction unit that corrects the position and orientation is further provided.
  • the inspection system determines that the object is a non-defective item when the inspection result satisfies the predetermined first standard and the evaluation result satisfies the predetermined second standard. Is further provided.
  • the correction unit obtains the deviation based on the correlation value obtained by the correlation calculation between the reference image and the inspection image.
  • the inspection system when the inspection result further satisfies a predetermined first criterion, the evaluation result satisfies a predetermined second criterion, and the correlation value satisfies a predetermined third criterion. Further, a determination unit that determines that the object is a non-defective item is further provided.
  • the evaluation result includes the evaluation value calculated based on the focus degree in the second area of the inspection image.
  • the degree of focus can be easily recognized by checking the evaluation value.
  • the inspection system further includes a search unit that searches for a focus position that is a focus position that focuses on the object.
  • the inspection image is generated when the focus position is adjusted to the in-focus position by the focus adjustment unit. Accordingly, by confirming the evaluation result, it is possible to recognize that the inspection cannot be performed accurately because the search for the in-focus position by the search unit is not performed properly.
  • an optical system having a variable focus position, an imaging element that generates an image by receiving light from an object via the optical system, and a focus adjustment unit that adjusts the focus position.
  • the inspection method in the inspection system includes a step of inspecting an object based on a first region of an inspection image generated when the focus position is adjusted by the focus adjustment unit, and outputting an inspection result; Based on the second region of the above, the step of evaluating the reliability of focusing of the object with respect to the inspection target portion, and outputting the evaluation result.
  • a program is a program for causing a computer to execute the above inspection method.
  • FIG. 3 is a block diagram showing an example of a hardware configuration of an image processing apparatus according to an embodiment.
  • FIG. It is a figure showing an example of functional composition of an image processing device. It is the figure which showed typically the imaging of the work W by an imaging device. It is a figure which shows an example of the setting screen of an inspection area
  • FIG. 6 is a flowchart showing an example of the flow of an inspection process of the inspection system according to the embodiment. It is a schematic diagram which shows the inspection system which concerns on the modification 1. It is a figure which shows an example of the setting screen of an inspection area
  • 9 is a flowchart showing the flow of inspection processing of the inspection system according to Modification 1.
  • 13 is a flowchart showing the flow of inspection processing of the inspection system according to Modification 3.
  • FIG. 1 is a schematic diagram showing one application example of the inspection system according to the embodiment.
  • FIG. 2 is a diagram illustrating an example of an internal configuration of an image pickup apparatus included in the inspection system.
  • the inspection system 1 is realized as, for example, an appearance inspection system.
  • the inspection system 1 images an inspection target portion on an object (work W) placed on the stage 90 in, for example, a production line of an industrial product, and uses the obtained image to inspect the appearance of the work W. I do.
  • the work W is inspected for scratches, dirt, presence of foreign matter, dimensions, and the like.
  • the next work (not shown) is transported onto the stage 90.
  • the work W may stand still at a predetermined position on the stage 90 in a predetermined posture.
  • the work W may be imaged while the work W moves on the stage 90.
  • the inspection system 1 includes an imaging device 10 and an image processing device 20 as basic components.
  • the inspection system 1 further includes a PLC (Programmable Logic Controller) 30, an input device 40, and a display device 50.
  • PLC Programmable Logic Controller
  • the imaging device 10 is connected to the image processing device 20.
  • the imaging device 10 images a subject (workpiece W) existing in the imaging field of view according to a command from the image processing device 20, and generates image data including an image of the workpiece W.
  • the imaging device 10 and the image processing device 20 may be integrated.
  • the imaging device 10 includes an illumination unit 11, a lens module 12, an imaging device 13, an imaging device control unit 14, a lens control unit 16, registers 15 and 17, and a communication I/I. And an F (interface) unit 18.
  • the illumination unit 11 irradiates the work W with light.
  • the light emitted from the illumination unit 11 is reflected on the surface of the work W and enters the lens module 12.
  • the illumination unit 11 may be omitted.
  • the lens module 12 is an optical system for forming an image of the light from the work W on the image pickup surface 13a of the image pickup device 13.
  • the focus position of the lens module 12 is variable within a predetermined movable range.
  • the focal position is the position of a point where an incident light ray parallel to the optical axis intersects the optical axis.
  • the lens module 12 includes a lens 12a, a lens group 12b, a lens 12c, a movable portion 12d, and a focus adjusting portion 12e.
  • the lens 12a is a lens for changing the focal position of the lens module 12.
  • the focus adjustment unit 12e controls the lens 12a to adjust the focus position of the lens module 12.
  • the lens group 12b is a lens group for changing the focal length.
  • the zoom magnification is controlled by changing the focal length.
  • the lens group 12b is installed in the movable portion 12d and is movable along the optical axis direction.
  • the lens 12c is a lens fixed at a predetermined position in the image pickup apparatus 10.
  • the lens control unit 16 controls the focus adjustment unit 12e so that the focus position is in accordance with the instruction stored in the register 17.
  • the lens control unit 16 may adjust the position of the lens group 12b by controlling the movable unit 12d so that the size of the region included in the imaging field of view of the work W is substantially constant. In other words, the lens control unit 16 can control the movable unit 12d so that the size of the region of the work W included in the imaging visual field falls within a predetermined range.
  • the lens control unit 16 may adjust the position of the lens group 12b according to the distance between the imaging position and the work W. In this embodiment, zoom adjustment is not essential.
  • the image sensor 13 is a photoelectric conversion element such as a CMOS (Complementary Metal Oxide Semiconductor) image sensor, and generates an image signal by receiving light from the work W via the lens module 12.
  • CMOS Complementary Metal Oxide Semiconductor
  • the image sensor control unit 14 generates image data based on the image signal from the image sensor 13 when the focus position is adjusted by the focus adjustment unit 12e. At this time, the image sensor control unit 14 opens and closes the shutter so that the shutter speed (exposure time) is set in advance, and generates image data of the preset resolution. Information indicating the shutter speed and the resolution is stored in the register 15 in advance.
  • the communication I/F unit 18 sends and receives data to and from the image processing device 20.
  • the communication I/F unit 18 receives an imaging instruction from the image processing device 20.
  • the communication I/F unit 18 transmits the image data generated by the image sensor control unit 14 to the image processing device 20.
  • the PLC 30 is connected to the image processing device 20 and controls the image processing device 20.
  • the PLC 30 controls the timing for the image processing apparatus 20 to output an image capturing command (image capturing trigger) to the image capturing apparatus 10.
  • the input device 40 and the display device 50 are connected to the image processing device 20.
  • the input device 40 receives user's inputs regarding various settings of the inspection system 1.
  • the display device 50 displays information regarding the setting of the inspection system 1, the result of the image processing of the work W by the image processing device 20, and the like.
  • the image processing device 20 performs image processing on the image captured by the imaging device 10.
  • the image processing device 20 includes a setting unit 22, an inspection unit 25, and an evaluation unit 26.
  • the setting unit 22 sets the first area and the second area in the image indicated by the image data acquired from the image pickup apparatus 10 according to the input to the input apparatus 40.
  • the first area is an area to be inspected by the inspection unit 25 (hereinafter, referred to as “inspection area”).
  • the second area is an area (hereinafter, referred to as “reliability evaluation area”) used when evaluating the reliability of focus of the work W on the inspection target portion.
  • the inspection area is set according to the inspection target part. For example, when the work W is a glass substrate and it is desired to inspect for scratches near the center of the upper surface of the glass substrate, an area including the vicinity of the center of the upper surface is set as the inspection area.
  • the reliability evaluation area is used to evaluate the focus of the inspection target portion of the work W, an area having the same height as the inspection area of the inspection target portion of the work W and a high contrast is set. ..
  • the inspection unit 25 inspects the work W based on the inspection area in the inspection image indicated by the inspection image data received from the imaging device 10, and outputs the inspection result. Specifically, the inspection unit 25 inspects the work W by performing a process according to a pre-registered inspection program on the inspection area. The inspection unit 25 may perform the inspection using a known technique. When the inspection item is the presence/absence of scratches, the inspection result indicates “with scratches” or “without scratches”. When the inspection item is a dimension, the inspection result indicates whether or not the measured value of the dimension is within a predetermined range.
  • the evaluation unit 26 evaluates the reliability of focusing on the inspection target portion of the work W based on the reliability evaluation area in the inspection image represented by the inspection image data, and outputs the evaluation result. Specifically, the evaluation unit 26 evaluates the reliability of focusing on the inspection target portion of the work W by performing processing according to the evaluation program registered in advance on the reliability evaluation area. The evaluation unit 26 calculates, for example, an evaluation value that increases as the reliability increases, and outputs an evaluation result including the evaluation value.
  • the inspection system 1 includes the lens module 12 whose focal position is variable, the image sensor 13 which generates an image by receiving light from the work W via the lens module 12, and the focus.
  • a focus adjustment unit 12e for adjusting the position is provided.
  • the inspection system 1 includes an inspection unit 25 and an evaluation unit 26.
  • the inspection unit 25 inspects the work W based on the inspection region in the inspection image generated when the focus position is adjusted by the focus adjustment unit 12e, and outputs the inspection result.
  • the evaluation unit 26 evaluates the reliability of focusing on the inspection target portion of the work W based on the reliability evaluation region of the inspection image, and outputs the evaluation result.
  • the worker shifts the focus position. It is possible to recognize that the inspection cannot be performed accurately due to the fact that As a result, the worker can take appropriate measures such as reinspection of the work W.
  • FIG. 3 is a schematic diagram for explaining autofocus. To simplify the description, FIG. 3 shows only one lens of the lens module 12.
  • the distance from the principal point O of the lens module 12 to the target surface (the surface of the work W) is a
  • the distance from the principal point O of the lens module 12 to the imaging surface 13a is b
  • the lens module The distance (focal length) from the principal point O of 12 to the focal position (rear focal position) F of the lens module 12 is f.
  • the distance between the imaging surface 13a and the surface of the work W may change according to the height of the surface of the work W.
  • the focus position F of the lens module 12 is adjusted in order to obtain an image focused on the surface of the work W even when the distance between the imaging surface 13a and the surface of the work W changes.
  • the method of adjusting the focal position F of the lens module 12 includes the following method (A) and method (B).
  • the method (A) is a method in which at least one lens (for example, the lens 12a) forming the lens module 12 is translated in the optical axis direction.
  • the focal point F changes while the principal point O of the lens module 12 moves in the optical axis direction.
  • the distance b changes.
  • An image focused on the surface of the work W is obtained at the focal position F corresponding to the distance b satisfying the expression (1).
  • Method (B) is a method of changing the refraction direction of the lens 12a fixed at a fixed position. According to the method (B), the focal position F changes as the focal length f of the lens module 12 changes. An image focused on the surface of the work W is obtained at the focal position F corresponding to the focal length f that satisfies Expression (1).
  • the configuration of the lens 12a for changing the focal position F of the lens module 12 is not particularly limited. Below, the example of a structure of the lens 12a is demonstrated.
  • FIG. 4 is a diagram showing an example of a lens module whose focal position is variable.
  • the lens 12a forming the lens module 12 is moved in parallel.
  • at least one lens at least one of the lens 12a, the lens group 12b, and the lens 12c that configures the lens module 12 may be translated.
  • the focal position F of the lens module 12 changes according to the above method (A). That is, in the configuration shown in FIG. 4, the focus adjustment unit 12e moves the lens 12a along the optical axis direction. By moving the position of the lens 12a, the focus position F of the lens module 12 changes.
  • the focus adjusting lens is often composed of a plurality of lens groups.
  • the focus position F of the lens module 12 can be changed by controlling the movement amount of at least one lens forming the combined lens.
  • FIG. 5 is a diagram showing another example of a lens module whose focal position is variable.
  • the focal position F of the lens module 12 changes according to the above method (B).
  • the lens 12a shown in FIG. 5 is a liquid lens.
  • the lens 12a includes a translucent container 70, electrodes 73a, 73b, 74a, 74b, insulators 75a, 75b, and insulating layers 76a, 76b.
  • the conductive liquid 71 and the insulating liquid 72 are not mixed and have different refractive indexes.
  • the electrodes 73a and 73b are fixed between the insulators 75a and 75b and the translucent container 70, respectively, and are located in the conductive liquid 71.
  • the electrodes 74a and 74b are arranged near the ends of the interface between the conductive liquid 71 and the insulating liquid 72.
  • An insulating layer 76a is interposed between the electrode 74a and the conductive liquid 71 and the insulating liquid 72.
  • An insulating layer 76b is interposed between the electrode 74b and the conductive liquid 71 and the insulating liquid 72.
  • the electrodes 74a and 74b are arranged at positions symmetrical with respect to the optical axis of the lens 12a.
  • the focus adjustment unit 12e includes a voltage source 12e1 and a voltage source 12e2.
  • the voltage source 12e1 applies the voltage Va between the electrode 74a and the electrode 73a.
  • the voltage source 12e2 applies the voltage Vb between the electrode 74b and the electrode 73b.
  • the conductive liquid 71 is pulled by the electrode 74a.
  • the conductive liquid 71 is pulled by the electrode 74b.
  • the curvature of the interface between the conductive liquid 71 and the insulating liquid 72 changes. Since the conductive liquid 71 and the insulating liquid 72 have different refractive indexes, the focus position F of the lens module 12 changes as the curvature of the interface between the conductive liquid 71 and the insulating liquid 72 changes.
  • the curvature of the interface between the conductive liquid 71 and the insulating liquid 72 depends on the magnitude of the voltages Va and Vb. Therefore, the search unit 24 changes the focus position F of the lens module 12 by controlling the magnitudes of the voltages Va and Vb.
  • the voltage Va and the voltage Vb are controlled to the same value.
  • the interface between the conductive liquid 71 and the insulating liquid 72 changes symmetrically with respect to the optical axis.
  • the voltage Va and the voltage Vb may be controlled to different values.
  • the interface between the conductive liquid 71 and the insulating liquid 72 becomes asymmetric with respect to the optical axis, and the orientation of the imaging visual field of the imaging device 10 can be changed.
  • a liquid lens and a solid lens may be combined.
  • the focus position F of the lens module 12 is changed by using both the method (A) and the method (B) described above.
  • FIG. 6 is a block diagram showing an example of the hardware configuration of the image processing apparatus according to the embodiment.
  • the image processing apparatus 20 of the example illustrated in FIG. 6 includes a CPU (Central Processing Unit) 210 that is an arithmetic processing unit, a main memory 232 and a hard disk 234 that are storage units, a camera interface 216, an input interface 218, and a display controller. 220, PLC interface 222, communication interface 224, and data reader/writer 226. These units are connected to each other via a bus 228 so that they can communicate with each other.
  • a CPU Central Processing Unit
  • the CPU 210 expands the program (code) stored in the hard disk 234 into the main memory 232 and executes these in a predetermined order to perform various calculations.
  • the control program 236 includes an inspection program for inspecting the work W based on the inspection image and an evaluation program for evaluating the reliability of focusing on the work W.
  • the main memory 232 is typically a volatile storage device such as a DRAM (Dynamic Random Access Memory), and in addition to the program read from the hard disk 234, image data and work acquired by the imaging device 10 Holds data etc. Further, the hard disk 234 may store various setting values and the like. In addition to the hard disk 234 or in place of the hard disk 234, a semiconductor storage device such as a flash memory may be adopted.
  • a volatile storage device such as a DRAM (Dynamic Random Access Memory)
  • a semiconductor storage device such as a flash memory
  • the camera interface 216 mediates data transmission between the CPU 210 and the imaging device 10. That is, the camera interface 216 is connected to the imaging device 10 for imaging the work W and generating image data. More specifically, the camera interface 216 includes an image buffer 216a for temporarily storing image data from the image pickup apparatus 10. Then, when the image data of a predetermined number of frames is accumulated in the image buffer 216a, the camera interface 216 transfers the accumulated data to the main memory 232. The camera interface 216 also sends an image pickup command to the image pickup apparatus 10 in accordance with an internal command generated by the CPU 210.
  • the input interface 218 mediates data transmission between the CPU 210 and the input device 40. That is, the input interface 218 receives an operation command given by the operator operating the input device 40.
  • the display controller 220 is connected to the display device 50 and notifies the user of the result of processing in the CPU 210. That is, the display controller 220 controls the screen of the display device 50.
  • the PLC interface 222 mediates data transmission between the CPU 210 and the PLC 30. More specifically, the PLC interface 222 transmits the control command from the PLC 30 to the CPU 210.
  • the communication interface 224 mediates data transmission between the CPU 210 and the console (or personal computer or server device).
  • the communication interface 224 is typically composed of Ethernet (registered trademark) or USB (Universal Serial Bus).
  • Ethernet registered trademark
  • USB Universal Serial Bus
  • the data reader/writer 226 mediates data transmission between the CPU 210 and the memory card 206 which is a recording medium. That is, the memory card 206 circulates in a state in which a program executed by the image processing apparatus 20 is stored, and the data reader/writer 226 reads the program from the memory card 206. In addition, the data reader/writer 226 writes the image data acquired by the imaging device 10 and/or the processing result in the image processing device 20 to the memory card 206 in response to the internal command of the CPU 210.
  • the memory card 206 is a general-purpose semiconductor storage device such as SD (Secure Digital), a magnetic storage medium such as a flexible disk (Flexible Disk), or an optical storage medium such as a CD-ROM (Compact Disk Read Only Memory). Etc.
  • FIG. 7 is a diagram illustrating an example of the functional configuration of the image processing apparatus.
  • the image processing device 20 includes a command generation unit 21, a setting unit 22, a calculation unit 23, a search unit 24, an inspection unit 25, an evaluation unit 26, a determination unit 27,
  • the output unit 28 and the storage unit 230 are included.
  • the command generation unit 21, the setting unit 22, the calculation unit 23, the search unit 24, the inspection unit 25, the evaluation unit 26, and the determination unit 27 are realized by the CPU 210 shown in FIG. 6 executing the control program 236.
  • the storage unit 230 includes a main memory 232 and a hard disk 234 shown in FIG.
  • the output unit 28 is configured by the display controller 220 shown in FIG.
  • the command generation unit 21 receives a control command from the PLC 30 and outputs an imaging command (imaging trigger) to the imaging device 10.
  • the outline of the setting unit 22 is as described above.
  • the calculation unit 23 calculates the degree of focus from the image data generated by the imaging device 10.
  • the focus degree is a degree indicating how much the object is in focus, and is calculated using various known methods.
  • the calculation unit 23 extracts a high frequency component by applying a high pass filter to the image data, and calculates an integrated value of the extracted high frequency components as a focus degree.
  • Such a focus degree indicates a value that depends on the difference in brightness of the image.
  • the search unit 24 searches for a focus position which is a focus position where the work W is focused. Specifically, the search unit 24 acquires, from the calculation unit 23, the focus degree of each of the plurality of image data generated by changing the focal position of the lens module 12. The search unit 24 determines the focus position at which the acquired degree of focus reaches a peak as the focus position. The search unit 24 specifies the image data when the focal position of the lens module 12 is the in-focus position as the inspection image data. That is, the inspection image data is image data generated when the focus position is adjusted to the in-focus position by the focus adjustment unit 12e.
  • the hill climbing method is a focus at which the focus is maximized while changing the focus position of the lens module 12 within the set search range and ending the search when the focus position at which the focus is maximized is found.
  • This is a method of determining the position as the in-focus position.
  • the hill-climbing method is based on the magnitude relationship between the focus degree at the focus position at the start of the search and the focus degree at the adjacent focus position, and the direction of the focus position at which the focus degree increases becomes the search direction. decide.
  • the hill climbing method sequentially calculates the difference between the focus degree at the previous focus position and the focus degree at the next focus position while changing the focus position in the search direction. The focus position at the time of negative change is determined as the focus position.
  • the search unit 24 may specify the image data having the maximum focus degree as the inspection image data.
  • the all-scan method is to change the focal position of the lens module 12 over the entire set search range, obtain the in-focus degree at each in-focus position, and set the in-focus position to be the in-focus position with the maximum in-focus degree. It is a way to decide.
  • the full scan method also includes a method of performing a coarse second search process and then a fine second search process.
  • the first search process is a process of changing the focus position at a coarse pitch interval over the entire search range to search for the focus position having the maximum focus degree.
  • the second search process is a process of changing the focus position at fine pitch intervals in the entire local range including the focus position searched in the first search process, and searching the focus position with the maximum focus degree as the focus position. Is.
  • the search unit 24 stores the image data of each focus position, and specifies the image data of the focus position having the maximum focus degree as the inspection image data from the stored image data. To do.
  • the search unit 24 instructs the command generation unit 21 to output a command for adjusting the focus position to the in-focus position and outputting an image, and the image data received from the imaging device 10 according to the command is the inspection image data. May be specified as
  • the outline of the inspection unit 25 and the evaluation unit 26 is as described above. That is, the inspection unit 25 inspects the work W based on the inspection area in the inspection image indicated by the inspection image data specified by the search unit 24, and outputs the inspection result.
  • the evaluation unit 26 evaluates the reliability of focusing on the inspection target portion of the work W based on the reliability evaluation region of the inspection image indicated by the inspection image data specified by the search unit 24, and displays the evaluation result. Output.
  • the determination unit 27 makes a comprehensive determination of the work W based on the inspection result output from the inspection unit 25 and the evaluation result output from the evaluation unit 26.
  • the determination unit 27 determines whether the inspection result output from the inspection unit 25 satisfies a predetermined first criterion and the evaluation result output from the evaluation unit 26 satisfies a predetermined second criterion. It is determined that W is a good product.
  • the determination unit 27 determines that the work W is a defective product when the inspection result does not satisfy the first standard and the evaluation result satisfies the second standard. Further, when the evaluation result does not satisfy the second criterion, the determination unit 27 determines that the automatic adjustment of the focus position has a problem and the inspection cannot be performed accurately.
  • the output unit 28 outputs the determination result of the determination unit 27.
  • the output unit 28 causes the display device 50 to display the determination result.
  • the output unit 28 may also display the inspection result and the evaluation result on the display device 50.
  • the storage unit 230 stores various data, programs and the like.
  • the storage unit 230 stores the image data acquired from the imaging device 10 and the image data that has been subjected to predetermined processing.
  • the storage unit 230 may store the inspection result by the inspection unit 25, the evaluation result by the evaluation unit 26, and the determination result by the determination unit 27.
  • the storage unit 230 stores a program for causing the image processing apparatus 20 to execute various types of processing.
  • FIG. 8 is a diagram schematically showing the image pickup of the work W by the image pickup apparatus.
  • the work W has a region W1 and a region W2.
  • the region W1 is, for example, the surface of a transparent body (glass or the like).
  • the region W2 is a region surrounding the region W1 and is, for example, the surface of the housing of the electronic device.
  • an electronic device having a display a smartphone or a tablet in one example
  • the area W1 can be a display screen.
  • the region W1 does not have a clear pattern. That is, the area W1 is a plain area.
  • the inspection area A1 is set in the area W1.
  • An area including the inspection area A1 is imaged by the imaging device 10, and the image of the inspection area A1 is a target of image processing by the image processing apparatus 20.
  • the image processing apparatus 20 uses the image of the inspection area A1 to inspect whether the inspection area A1 has scratches, dirt, or foreign matter.
  • the setting unit 22 of the image processing apparatus 20 sets the inspection area and the reliability evaluation area in advance for the work W.
  • the worker places the reference work W0 at a predetermined position on the stage 90 (see FIG. 1) in a predetermined posture.
  • the image processing device 20 outputs an imaging command to the imaging device 10 and acquires reference image data from the imaging device 10.
  • the reference image data indicates a reference image including the reference work W0 placed at a predetermined position in a predetermined posture.
  • the setting unit 22 of the image processing device 20 causes the display device 50 to display the reference image represented by the reference image data acquired from the imaging device 10, and prompts the operator to specify the inspection region and the reliability evaluation region.
  • FIG. 9 is a diagram showing an example of a setting screen for the inspection area and the reliability evaluation area.
  • the setting unit 22 causes the screen of the display device 50 to display the reference image 80 indicated by the reference image data acquired from the imaging device 10.
  • the setting unit 22 sets the inspection area A1 and the reliability evaluation area B1 according to the input to the input device 40.
  • the worker inputs four vertices of the inspection area A1 and the reliability evaluation area B1 which are rectangular.
  • the operator designates a region having the same height as the inspection region A1 of the reference work W0 and including a high contrast as the reliability evaluation region B1.
  • a region including the edge portion of the reference work W0 is designated as the reliability evaluation region B1.
  • the high-contrast portion includes, in addition to the edge portion, a character printed on the surface, a pattern formed on the surface, a portion to which parts such as screws are attached, and the like.
  • a rectangular inspection area A1 and a reliability evaluation area B1 are set, but the shape of each area is not limited to this.
  • the shape of at least one of the inspection area A1 and the reliability evaluation area B1 may be circular or any free shape capable of forming an area.
  • at least one of the inspection area A1 and the reliability evaluation area B1 does not have to be limited to a single area.
  • at least one of the inspection area A1 and the reliability evaluation area B1 may be a plurality of areas that exist in a distributed manner.
  • FIG. 10 is a diagram showing another example of a setting screen for the inspection area and the reliability evaluation area.
  • a frame-shaped reliability evaluation area B1 is set along the edge portion of the reference work W0.
  • the setting unit 22 generates information for identifying each of the set inspection area A1 and reliability evaluation area B1, and stores the generated information in the storage unit 230.
  • the evaluation unit 26 calculates an evaluation value indicating the reliability of the focus on the inspection target portion of the work W based on the focus degree of the reliability evaluation area B1 in the inspection image represented by the inspection image data.
  • the focus degree is, for example, an integrated value of high frequency components extracted from the image of the reliability evaluation area B1.
  • the reference focus degree is, for example, the focus degree calculated from the reliability evaluation area B1 in the image focused on the inspection target portion of the reference work W0, and is calculated in advance by an experiment.
  • the evaluation unit 26 causes the in-focus level g and the second in-focus level g of the first peak of the in-focus level waveform obtained in the in-focus position search process.
  • the focus degree waveform is a waveform showing a change in the focus degree with respect to the focus position when the focus position of the lens module 12 is changed.
  • the first peak is the peak with the highest degree of focus.
  • the second peak is the peak having the second highest focus degree.
  • FIG. 11 is a diagram showing an example of the focus degree waveform.
  • the focus degree waveform of the example shown in FIG. 11 includes two peaks at focus positions F1 and F2.
  • the focus position F1 is the focus position when focusing on the inspection target portion of the work W. Therefore, when the autofocus process is normally performed, the focus degree waveform includes only one peak at the focus position F1. However, for some reason, a peak may occur at a focus position different from the focus position F1. For example, when a sheet on which a high-contrast pattern is formed is reflected in the inspection image, a peak occurs at a focus position different from the focus position F1.
  • the focus position F2 different from the focus position F1 is erroneously determined as the focus position, and the image data when adjusted to the focus position F2 is the inspection image data.
  • an evaluation value that increases as the reliability of focusing of the inspection target portion of the work W increases.
  • the evaluation unit 26 may calculate an evaluation value that becomes smaller as the reliability of focusing of the inspection target portion of the work W becomes higher.
  • the evaluation unit 26 may calculate the evaluation value using a known technique.
  • the evaluation unit 26 uses the technology described in International Publication No. 2017/056557 (Patent Document 2), JP 2010-78681 A (Patent Document 3), and JP 10-170817 A (Patent Document 4). You may use and calculate an evaluation value.
  • the determination unit 27 of the image processing apparatus 20 determines that the inspection result satisfies the predetermined first criterion and the evaluation result output from the evaluation unit 26 satisfies the predetermined second criterion.
  • the work W is a good product.
  • the first standard indicates that the inspection result is “no damage”.
  • the inspection item is a dimension
  • the first standard indicates that the measured value of the dimension is within a predetermined range.
  • the evaluation result includes an evaluation value that increases as the reliability of focusing on the inspection target portion of the work W increases
  • the second criterion indicates that the evaluation value exceeds a predetermined threshold value.
  • the first standard and the second standard are created in advance and stored in the storage unit 230.
  • the determination unit 27 reads the first criterion and the second criterion from the storage unit 230 and makes a comprehensive determination.
  • FIG. 12 is a flowchart showing an example of the flow of the inspection process of the inspection system according to the embodiment.
  • the setting unit 22 of the image processing apparatus 20 sets the inspection area A1 and the reliability evaluation area B1 using the image data including the reference work W0.
  • the inspection process shown in FIG. 12 is executed.
  • the work W is placed on the stage 90 at a predetermined position in a predetermined posture by the transfer device.
  • step S1 the imaging device 10 and the image processing device 20 execute a focus position search process (step S1).
  • step S1 the lens control unit 16 of the imaging device 10 changes the focal position of the lens module 12 within the search range.
  • the calculation unit 23 of the image processing apparatus 20 calculates the focus degree of the entire area for each of the plurality of image data generated by changing the focus position.
  • the search unit 24 of the image processing device 20 searches for a focus position at which the calculated focus degree has a peak as the focus position.
  • the search unit 24 identifies the image data when the focus position of the lens module 12 is adjusted to the in-focus position as inspection image data (step S2).
  • the inspection unit 25 of the image processing apparatus 20 inspects the work W based on the inspection area A1 in the inspection image indicated by the inspection image data, and outputs the inspection result (step S3).
  • the evaluation unit 26 of the image processing apparatus 20 calculates an evaluation value indicating the reliability of focus of the work W on the inspection target portion based on the reliability evaluation area B1 in the inspection image, and the calculated evaluation value.
  • the evaluation result including is output (step S4).
  • the processing order of step S3 and step S4 is not limited to this, and step S3 may be executed after step S4, or step S3 and step S4 may be executed in parallel.
  • the determination unit 27 of the image processing apparatus 20 makes a comprehensive determination based on the inspection result and the evaluation result (step S5). After that, the output unit 28 displays the determination result on the display device 50 (step S6). After step S6, the inspection process ends.
  • the determination result may be output to the PLC 30 other than the display device 50 and used for controlling other devices.
  • the transport device (not shown) transports the work W on the transport path for transporting the work W to the next process.
  • the transport device transports the work W to the defective product storage space.
  • the transfer device transfers the work W to the re-inspection product storage area.
  • the workpiece W to be inspected is assumed to be placed in a predetermined posture on the stage 90 by a transfer device (not shown).
  • the image processing device of the inspection system according to the first modification uses the inspection area A1 for the inspection image and the reliability evaluation based on the deviation of the position and orientation of the work W in the inspection image with respect to the position and orientation of the reference work in the reference image.
  • the relative position and orientation of the area B1 is corrected. As a result, even if the position and orientation of the work W included in the inspection image changes, it is possible to suppress deterioration of inspection accuracy and reliability evaluation accuracy.
  • FIG. 13 is a schematic diagram showing an inspection system according to Modification 1.
  • the inspection system 1A according to Modification 1 is different from the inspection system 1 shown in FIG. 1 in that an image processing apparatus 20A is provided instead of the image processing apparatus 20.
  • the image processing apparatus 20A is different from the image processing apparatus 20 shown in FIG. 1 in that it includes a setting unit 22A instead of the setting unit 22 and further includes a correction unit 29.
  • the setting unit 22A sets the inspection area A1 and the reliability evaluation area B1 from the reference image. Further, the setting unit 22A sets a model area from the reference image.
  • the model area is an area including a characteristic portion of the reference work W0 placed in a predetermined posture at a predetermined position.
  • the characteristic portion is a portion capable of specifying the position and orientation of the reference work W0.
  • FIG. 14 is a diagram showing an example of a setting screen for the inspection area, the reliability evaluation area, and the model area.
  • regions including two non-adjacent corners of the four corners of the rectangular reference work W0 in plan view are set as model regions C1 and C2.
  • the setting unit 22A stores in the storage unit 230 each image of the set model regions C1 and C2 and information indicating the position and orientation of the model regions C1 and C2 in the reference image.
  • FIG. 15 is a diagram illustrating the processing of the correction unit.
  • the correction unit 29 searches the inspection image 81 for the same partial image as the images of the model regions C1 and C2 in the reference image 80 using a known template matching method.
  • the correction unit 29 reads the images of the model areas C1 and C2 as the first and second template images from the storage unit 230, respectively.
  • the correction unit 29 searches the inspection image 81 for the first partial image D1 having the same pattern as the first template image corresponding to the model region C1, and at the same time, the second portion having the same pattern as the second template image corresponding to the model region C2.
  • the image D2 is searched from the inspection image 81.
  • the correction unit 29 performs the correlation calculation between the first template image and the inspection image 81 while changing the position and orientation of the first template image, and the first template having the highest degree of similarity indicated by the correlation value. Search the position and orientation of the image. Then, the correction unit 29 specifies the image of the region overlapping the first template image of the searched position and orientation as the first partial image D1. Similarly, by the method, the correction unit 29 identifies the image of the region overlapping the second template image of the position and orientation having the highest degree of similarity indicated by the correlation value as the second partial image D2.
  • the correction unit 29 may search for the position and orientation of the template image having the minimum correlation value.
  • the correction unit 29 may search the position and orientation of the template image whose correlation value is closest to 1.
  • the correction unit 29 compares the position and orientation of the searched partial images D1 and D2 with the position and orientation of the model areas C1 and C2, respectively, to determine the position and orientation of the reference work W0 in the reference image 80 (hereinafter, referred to as “reference position”).
  • the deviation of the position/orientation of the work W in the inspection image 81 with respect to the “orientation” is calculated (calculated).
  • the deviations indicate deviation amounts ⁇ X, ⁇ Y, and ⁇ in the X direction, the Y direction, and the rotation direction ( ⁇ direction), respectively.
  • the correction unit 29 corrects the relative position and orientation of the inspection area A1 and the reliability evaluation area B1 with respect to the inspection image 81 based on the calculated deviation. That is, the correction unit 29 corrects the position and orientation of the inspection area A1 and the reliability evaluation area B1 by the calculated deviation. Specifically, the correction unit 29 translates the inspection area A1 and the reliability evaluation area B1 by ⁇ X in the X direction and ⁇ Y in the Y direction with the inspection image 81 fixed, and ⁇ . Only rotate and move.
  • the correction unit 29 may correct the position and orientation of the inspection image 81 while fixing the inspection area A1 and the reliability evaluation area B1. In this case, the correction unit 29 may perform the reverse conversion of the position and orientation of the inspection area A1 and the reliability evaluation area B1 on the position and orientation of the inspection image 81.
  • FIG. 16 is a flowchart showing the flow of the inspection process of the inspection system according to the first modification.
  • the flowchart shown in FIG. 16 differs from the flowchart shown in FIG. 12 in that it further includes steps S11 and S12.
  • the correction unit 29 of the image processing device 20A calculates the deviation of the position and orientation of the work W in the inspection image 81 from the reference position and orientation in step S11.
  • step S12 the correction unit 29 corrects the relative position and orientation of the inspection area A1 and the reliability evaluation area B1 with respect to the inspection image 81 based on the calculated deviation. Then, the inspection of the workpiece W is executed using the corrected inspection area A1 (step S3), and the reliability evaluation is executed using the corrected reliability evaluation area B1 (step S4).
  • model areas C1 and C2 and the reliability evaluation area B1 are set separately. However, the same area as the reliability evaluation area B1 may be set as the model area. That is, the reliability evaluation area B1 may be shared as a model area.
  • the inspection system according to Modification 2 is a further modification of the inspection system according to Modification 1.
  • the determination unit 27 performs the following processing.
  • the determination unit 27 determines that the workpiece It is determined that W is a good product.
  • the correlation value calculated by the correction unit 29 does not satisfy the third criterion, the determination unit 27 determines that the work W is not normally imaged.
  • the correlation value calculated by the correction unit 29 indicates the degree of similarity between the template images of the model areas C1 and C2 and the partial images D1 and D2 searched from the inspection image.
  • the degree of similarity indicated by the correlation value is low, there is a high possibility that the work W to be inspected cannot be normally imaged for some reason. For example, the position of the work W on the stage 90 is largely deviated from the predetermined position, so that the work W is not included in the image.
  • the third criterion is, for example, a criterion that the degree of similarity indicated by the correlation value between the template images of the model areas C1 and C2 and the partial images D1 and D2 is higher than a predetermined degree of similarity. For example, when the higher the degree of similarity is, the smaller the correlation value is, the third criterion indicates that the correlation value is lower than a predetermined threshold value.
  • the second modification it is possible to further reduce the risk of overlooking a defective work W as a non-defective product even though the work W is not normally imaged.
  • the inspection system according to Modification 3 is a further modification of the inspection system according to Modification 1.
  • the autofocus process is executed using the reliability evaluation area B1 corrected by the correction unit 29.
  • FIG. 17 is a flowchart showing the flow of the inspection process of the inspection system according to the modified example 3.
  • the flowchart shown in FIG. 17 differs from the flowchart shown in FIG. 16 in that it includes steps S21 to S23 instead of steps S2, S11 and S12, and further includes steps S24 and S25.
  • step S1 the search unit 24 of the image processing apparatus 20 identifies the image data when the focus position of the lens module 12 is adjusted to the in-focus position as the correction image data in step S21.
  • the correction unit 29 calculates the deviation of the position and orientation of the work W in the correction image indicated by the correction image data from the reference position and orientation (step S22).
  • the correction unit 29 corrects the relative position and orientation of the inspection area A1 and the reliability evaluation area B1 with respect to the correction image based on the calculated deviation (step S23).
  • the correction unit 29 corrects the position and orientation of the inspection area A1 and the reliability evaluation area B1 with the correction image fixed, as in the first modification.
  • the correction unit 29 may correct the position and orientation of the correction image while the inspection area A1 and the reliability evaluation area B1 are fixed.
  • the image processing device 20 executes a focus position search process based on the corrected reliability evaluation area B1 (step S24). Specifically, the calculation unit 23 calculates the degree of focus of the reliability evaluation area B1 of each of the plurality of image data. The search unit 24 determines the focus position where the calculated focus degree is the peak, as the focus position.
  • the search unit 24 identifies the image data generated at the searched in-focus position as inspection image data (step S25). After that, the inspection of the work W is executed using the corrected inspection area A1 in the inspection image indicated by the inspection image data (step S3), and the reliability is evaluated using the corrected reliability evaluation area B1. Is executed (step S4).
  • the in-focus position searching process is executed again based on the corrected reliability evaluation area B1, and the inspection image data is generated. Therefore, it becomes easy to obtain the inspection image data focused on the inspection target portion.
  • the output unit 28 outputs the determination result by the determination unit 27.
  • the inspection system may not include the determination unit 27, and the output unit 28 may output the inspection result by the inspection unit 25 and the evaluation result by the evaluation unit 26.
  • the operator can recognize that there is some problem in the adjustment of the focal position and the inspection cannot be performed accurately by confirming the evaluation result. As a result, it is possible to reduce the risk of overlooking a defective work W as a non-defective product by an inspection based on an image focused on a position different from the inspection target part of the work W.
  • the search unit 24 searches for the in-focus position where the work W is in focus, based on a plurality of image data generated by changing the focal position of the lens module 12.
  • the imaging device 10 may include a distance measuring sensor that measures the distance to the work W, and the search unit 24 may search for the in-focus position based on the measurement result of the distance measuring sensor.
  • the distance-measuring sensor for example, emits infrared rays or ultrasonic waves toward the work W, and then is reflected by the work W and returned to the work W based on the distance a from the lens module 12 to the work W (see FIG. 3). Measurement).
  • the search unit 24 may determine the focus position F where the measured distance a satisfies the above expression (1) as the focus position. However, in this case, since a distance measuring sensor is required, the number of parts of the imaging device 10 increases. In order to suppress an increase in the number of components of the image pickup apparatus 10, it is preferable that the search unit 24 search for a focus position based on a plurality of image data generated by changing the focus position of the lens module 12.
  • the imaging device 10 changes the focus position and outputs a plurality of image data. Then, the image processing device 20 searches for a focus position at which the inspection target portion of the work W is focused from the plurality of focus positions.
  • the lens control unit 16 of the imaging device 10 may control the focal position of the lens module 12 so as to be a fixed position that is predetermined according to the type of the work W and the inspection target location. That is, the focus adjustment unit 12e adjusts the focus position of the lens module 12 to a predetermined fixed position. In this case, the image processing device 20 does not have to include the search unit 24.
  • the imaging device 10 and the work W may be different depending on the individual difference in the size of the work W or the state of the carrying device that carries the work W.
  • the distance from the inspection target varies. Therefore, it is not always possible to always obtain an inspection image focused on the inspection target portion of the work W. In such a case, it is possible to recognize that the image processing apparatus 20 includes the above-described evaluation unit 26, and that the inspection cannot be performed accurately due to the shift of the focus position.
  • (Structure 1) An optical system (12) whose focal position is variable, An image sensor (13) that generates an image by receiving light from an object (W) through the optical system (12); A focus adjustment unit (12e) for adjusting the focus position, An inspection unit (25) that inspects the object (W) based on the first region of the inspection image generated when the focus position is adjusted by the focus adjustment unit (12e) and outputs the inspection result. , 210), An inspection system (1), comprising: an evaluation unit (26, 210) that evaluates the reliability of focusing of the object with respect to the inspection object location based on the second region of the inspection image and outputs the evaluation result. , 1A).
  • (Structure 2) Based on the deviation of the position and orientation of the object (W) in the inspection image with respect to the position and orientation of the object (W) in the reference image generated in advance, the first region and the second region with respect to the inspection image.
  • a determination unit (27, 210) that determines that the object is a good product when the inspection result satisfies a predetermined first standard and the evaluation result satisfies a predetermined second standard.
  • the inspection system (1, 1A) according to Configuration 1 or 2 further provided.
  • the correction unit (29, 210) obtains the deviation based on a correlation value obtained by a correlation calculation between the reference image and the inspection image,
  • the inspection system (1A) further includes When the inspection result satisfies a predetermined first criterion, the evaluation result satisfies a predetermined second criterion, and the correlation value satisfies a predetermined third criterion, the target
  • the inspection system (1A) according to the configuration 2, further including a determination unit (27, 210) that determines that the product is non-defective.
  • the inspection system (1, 1A) according to any one of configurations 1 to 5, wherein the inspection image is generated when the focus position is adjusted to the in-focus position by the focus adjustment unit (12e).
  • (Structure 7) An optical system (12) whose focal position is variable, An image sensor (13) that generates an image by receiving light from an object (W) through the optical system (12); An inspection method in an inspection system including a focus adjustment unit (12e) for adjusting the focus position, Inspecting the object (W) based on a first region of an inspection image generated when the focus position is adjusted by the focus adjusting unit (12e), and outputting an inspection result, Based on a second region of the inspection image, evaluating the reliability of focusing of the object with respect to the inspection target portion, and outputting the evaluation result.
  • (Structure 8) An optical system (12) whose focal position is variable, An image sensor (13) that generates an image by receiving light from an object (W) through the optical system (12); A program for causing a computer to execute an inspection method in an inspection system including a focus adjustment unit (12e) for adjusting the focus position, The inspection method is Inspecting the object (W) based on a first region of an inspection image generated when the focus position is adjusted by the focus adjusting unit (12e), and outputting an inspection result, A step of evaluating the reliability of focusing of the object with respect to the inspection target portion based on the second region of the inspection image, and outputting the evaluation result.
  • 1, 1A inspection system 10 imaging device, 11 illumination unit, 12 lens module, 12a, 12c lens, 12b lens group, 12d movable part, 12e1 and 12e2 voltage source, 12e focus adjustment unit, 13 imaging device, 13a imaging surface, 14 image sensor control unit, 15, 17 register, 16 lens control unit, 18 communication I/F unit, 20, 20A image processing device, 21 command generation unit, 22, 22A setting unit, 23 calculation unit, 24 search unit, 25 Inspection unit, 26 evaluation unit, 27 judgment unit, 28 output unit, 29 correction unit, 30 PLC, 40 input device, 50 display device, 70 translucent container, 71 conductive liquid, 72 insulating liquid, 73a, 73b, 74a, 74b electrode, 75a, 75b insulator, 76a, 76b insulating layer, 80 reference image, 81 inspection image, 90 stage, 206 memory card, 216 camera interface, 216a image buffer, 218 input interface, 220 display controller, 222 PLC Interface, 224 communication interface, 226 data reader/writer, 228 bus

Abstract

This inspection system comprises: an optical system having a variable focal point; an imaging element for generating an image due to reception of light from an object through the optical system; a focus adjustment unit for adjusting a focal point; an inspection unit for inspecting the object on the basis of a first region in an inspection image generated when a focal point is adjusted by the focus adjustment unit, and outputting the inspection results; and an assessment unit for assessing the reliability of focus on a site subject to inspection in the object on the basis of a second region in the inspection image, and outputting the assessment results. Accordingly, the risk of overlooking a defect in an object can be reduced.

Description

検査システム、検査方法およびプログラムInspection system, inspection method and program
 本技術は、検査システム、検査方法およびプログラムに関する。 This technology relates to inspection systems, inspection methods, and programs.
 特開2018-84701号公報(特許文献1)には、被写体像のコントラスト評価値に基づいてフォーカスレンズの合焦位置を探索するオートフォーカス機能を有する焦点調節装置が開示されている。さらに、特許文献1には、このような焦点調節装置が検査のための産業用機器に適用されることが開示されている。 Japanese Unexamined Patent Application Publication No. 2018-84701 (Patent Document 1) discloses a focus adjustment device having an autofocus function for searching a focus position of a focus lens based on a contrast evaluation value of a subject image. Further, Patent Document 1 discloses that such a focus adjustment device is applied to an industrial device for inspection.
特開2018-84701号公報Japanese Unexamined Patent Publication No. 2018-84701 国際公開第2017/056557号International Publication No. 2017/056557 特開2010-78681号公報JP, 2010-78681, A 特開平10-170817号公報JP, 10-170817, A
 撮像された画像を用いて検査を行なう場合、対象物の検査対象箇所に合焦した画像を得る必要がある。しかしながら、対象物の状態によって、対象物の検査対象箇所とは異なる箇所に合焦した画像が得られる可能性がある。例えば、対象物のサイズの個体差によって、対象物の検査対象箇所から焦点がずれる場合がある。あるいは、対象物を搬送する搬送装置の状態によって、対象物の検査対象箇所から焦点がずれる場合がある。このような場合、対象物が不良であるにも関わらず、検査対象箇所とは異なる箇所に合焦した画像であるため、検査対象箇所の不良を認識できず、当該不良を見逃してしまう。 When performing an inspection using the captured image, it is necessary to obtain an image focused on the inspection target part of the object. However, there is a possibility that an image focused on a portion different from the inspection target portion of the target object may be obtained depending on the state of the target object. For example, the focus may be deviated from the inspection target portion of the object due to individual differences in the size of the object. Alternatively, the focus may deviate from the inspection target portion of the object depending on the state of the transfer device that transfers the object. In such a case, since the image is focused on a portion different from the inspection target portion even though the object is defective, the defect at the inspection target portion cannot be recognized and the defect is overlooked.
 本発明は、上記の問題を鑑みてなされたものであり、その目的は、対象物の不良の見逃しのリスクを低減できる検査システム、検査方法およびプログラムを提供することである。 The present invention has been made in view of the above problems, and an object thereof is to provide an inspection system, an inspection method, and a program that can reduce the risk of overlooking a defect in an object.
 本開示の一例によれば、検査システムは、焦点位置が可変である光学系と、光学系を介して対象物からの光を受けることによって画像を生成する撮像素子と、焦点位置を調節するフォーカス調節部と、検査部と、評価部とを備える。検査部は、フォーカス調節部によって焦点位置が調節されたときに生成された検査画像のうちの第1領域に基づいて対象物を検査し、検査結果を出力する。評価部は、検査画像のうちの第2領域に基づいて、対象物の検査対象箇所に対する合焦の信頼性を評価し、評価結果を出力する。 According to an example of the present disclosure, an inspection system includes an optical system having a variable focus position, an image sensor that generates an image by receiving light from an object via the optical system, and a focus that adjusts the focus position. An adjustment unit, an inspection unit, and an evaluation unit are provided. The inspection unit inspects the target object based on the first region in the inspection image generated when the focus position is adjusted by the focus adjustment unit, and outputs the inspection result. The evaluation unit evaluates the reliability of focusing of the target object on the inspection target portion based on the second region of the inspection image, and outputs the evaluation result.
 この開示によれば、第1領域とは別の第2領域に基づいて、検査対象箇所に対する合焦の信頼性が評価される。そのため、例えば、検査の対象となる第1領域のコントラストが低い場合であっても、第1領域とは別の第2領域に基づいて、検査対象箇所に対する合焦の信頼性を評価できる。そして、評価結果に基づいて、焦点位置がずれていることに起因して精度良く検査できていないことが認識可能となる。その結果、検査対象箇所とは異なる箇所に合焦した画像に基づく検査によって不良の対象物を良品として見逃すリスクを低減できる。 According to this disclosure, the reliability of focusing on the inspection target portion is evaluated based on the second area different from the first area. Therefore, for example, even when the contrast of the first region to be inspected is low, the reliability of focusing on the inspection target portion can be evaluated based on the second region different from the first region. Then, based on the evaluation result, it can be recognized that the inspection cannot be performed accurately due to the shift of the focus position. As a result, it is possible to reduce the risk of missing a defective target object as a non-defective product by an inspection based on an image focused on a position different from the inspection target position.
 上述の開示において、検査システムは、予め生成された基準画像中の対象物の位置姿勢に対する検査画像中の対象物の位置姿勢の偏差に基づいて、検査画像に対する第1領域および第2領域の相対位置姿勢を補正する補正部をさらに備える。 In the above disclosure, the inspection system uses the relative position of the first area and the second area with respect to the inspection image based on the deviation of the position and orientation of the object in the inspection image with respect to the position and orientation of the object in the reference image generated in advance. A correction unit that corrects the position and orientation is further provided.
 この開示によれば、検査画像中の対象物の位置姿勢に変動が生じたとしても、検査精度および信頼性の評価精度の低下を抑制できる。 According to this disclosure, even if the position and orientation of the target object in the inspection image changes, it is possible to suppress deterioration of inspection accuracy and reliability evaluation accuracy.
 上述の開示において、検査システムは、検査結果が予め定められた第1基準を満たし、かつ、評価結果が予め定められた第2基準を満たす場合に、対象物が良品であると判定する判定部をさらに備える。 In the above disclosure, the inspection system determines that the object is a non-defective item when the inspection result satisfies the predetermined first standard and the evaluation result satisfies the predetermined second standard. Is further provided.
 この開示によれば、対象物の所望の箇所とは異なる箇所に合焦した画像に基づく検査によって不良の対象物を良品として見逃すリスクを低減しやすくなる。 According to this disclosure, it is easy to reduce the risk of overlooking a defective target object as a non-defective product by an inspection based on an image focused on a position different from the desired position of the target object.
 上述の開示において、補正部は、基準画像と検査画像との相関演算により得られる相関値に基づいて偏差を求める。検査システムは、さらに、検査結果が予め定められた第1基準を満たし、かつ、評価結果が予め定められた第2基準を満たし、かつ、相関値が予め定められた第3基準を満たす場合に、対象物が良品であると判定する判定部をさらに備える。 In the above disclosure, the correction unit obtains the deviation based on the correlation value obtained by the correlation calculation between the reference image and the inspection image. The inspection system, when the inspection result further satisfies a predetermined first criterion, the evaluation result satisfies a predetermined second criterion, and the correlation value satisfies a predetermined third criterion. Further, a determination unit that determines that the object is a non-defective item is further provided.
 この開示によれば、対象物を正常に撮像できていないにもかかわらず、不良の対象物を良品として見逃すリスクをさらに低減することができる。 According to this disclosure, it is possible to further reduce the risk of overlooking a defective target object as a non-defective product, even though the target object cannot be normally imaged.
 上述の開示において、評価結果は、検査画像のうちの第2領域における合焦度に基づいて算出される評価値を含む。これにより、評価値を確認することにより、合焦の度合いを容易に認識できる。 In the above disclosure, the evaluation result includes the evaluation value calculated based on the focus degree in the second area of the inspection image. Thus, the degree of focus can be easily recognized by checking the evaluation value.
 上述の開示において、検査システムは、対象物に合焦する焦点位置である合焦位置を探索する探索部をさらに備える。検査画像は、フォーカス調節部によって焦点位置が合焦位置に調節されたときに生成される。これにより、評価結果を確認することにより、探索部による合焦位置の探索が適切に実行されないことに起因して精度良く検査できていないことを認識できる。 In the above disclosure, the inspection system further includes a search unit that searches for a focus position that is a focus position that focuses on the object. The inspection image is generated when the focus position is adjusted to the in-focus position by the focus adjustment unit. Accordingly, by confirming the evaluation result, it is possible to recognize that the inspection cannot be performed accurately because the search for the in-focus position by the search unit is not performed properly.
 本開示の一例によれば、焦点位置が可変である光学系と、光学系を介して対象物からの光を受けることによって画像を生成する撮像素子と、焦点位置を調節するフォーカス調節部とを備える検査システムにおける検査方法は、フォーカス調節部によって焦点位置が調節されたときに生成された検査画像のうちの第1領域に基づいて対象物を検査し、検査結果を出力するステップと、検査画像のうちの第2領域に基づいて、対象物の検査対象箇所に対する合焦の信頼性を評価し、評価結果を出力するステップとを備える。 According to an example of the present disclosure, an optical system having a variable focus position, an imaging element that generates an image by receiving light from an object via the optical system, and a focus adjustment unit that adjusts the focus position are provided. The inspection method in the inspection system includes a step of inspecting an object based on a first region of an inspection image generated when the focus position is adjusted by the focus adjustment unit, and outputting an inspection result; Based on the second region of the above, the step of evaluating the reliability of focusing of the object with respect to the inspection target portion, and outputting the evaluation result.
 本開示の一例によれば、プログラムは、上記の検査方法をコンピュータに実行させるためのプログラムである。これらの開示によっても、対象物の不良の見逃しのリスクを低減できる。 According to an example of the present disclosure, a program is a program for causing a computer to execute the above inspection method. These disclosures can also reduce the risk of missing a defect in the object.
 本発明によれば、対象物の不良の見逃しのリスクを低減できる。 According to the present invention, it is possible to reduce the risk of overlooking a defect in an object.
実施の形態に係る検査システムの1つの適用例を示す模式図である。It is a schematic diagram which shows one application example of the inspection system which concerns on embodiment. 検査システムに備えられる撮像装置の内部構成の一例を示す図である。It is a figure which shows an example of an internal structure of the imaging device with which an inspection system is equipped. オートフォーカスを説明するための模式図である。It is a schematic diagram for explaining autofocus. 焦点位置が可変のレンズモジュールの一例を示す図である。It is a figure which shows an example of the lens module whose focal position is variable. 焦点位置が可変のレンズモジュールの別の例を示す図である。It is a figure which shows another example of the lens module whose focal position is variable. 実施の形態に係る画像処理装置のハードウェア構成の一例を示すブロック図である。3 is a block diagram showing an example of a hardware configuration of an image processing apparatus according to an embodiment. FIG. 画像処理装置の機能構成の一例を示す図である。It is a figure showing an example of functional composition of an image processing device. 撮像装置によるワークWの撮像を模式的に示した図である。It is the figure which showed typically the imaging of the work W by an imaging device. 検査領域および信頼性評価領域の設定画面の一例を示す図である。It is a figure which shows an example of the setting screen of an inspection area|region and a reliability evaluation area|region. 検査領域および信頼性評価領域の設定画面の別の例を示す図である。It is a figure which shows another example of the setting screen of an inspection area and a reliability evaluation area. 合焦度波形の一例を示す図である。It is a figure which shows an example of a focus degree waveform. 実施の形態に係る検査システムの検査処理の流れの一例を示すフローチャートである。6 is a flowchart showing an example of the flow of an inspection process of the inspection system according to the embodiment. 変形例1に係る検査システムを示す模式図である。It is a schematic diagram which shows the inspection system which concerns on the modification 1. 検査領域、信頼性評価領域およびモデル領域の設定画面の一例を示す図である。It is a figure which shows an example of the setting screen of an inspection area|region, a reliability evaluation area|region, and a model area|region. 補正部の処理を説明する図である。It is a figure explaining the process of a correction|amendment part. 変形例1に係る検査システムの検査処理の流れを示すフローチャートである。9 is a flowchart showing the flow of inspection processing of the inspection system according to Modification 1. 変形例3に係る検査システムの検査処理の流れを示すフローチャートである。13 is a flowchart showing the flow of inspection processing of the inspection system according to Modification 3.
 以下、図面を参照しつつ、本発明に従う実施の形態について説明する。以下の説明では、同一の部品および構成要素には同一の符号を付してある。それらの名称および機能も同じである。したがって、これらについての詳細な説明は繰り返さない。 Hereinafter, embodiments according to the present invention will be described with reference to the drawings. In the following description, the same parts and components are designated by the same reference numerals. Their names and functions are also the same. Therefore, detailed description thereof will not be repeated.
 §1 適用例
 まず、図1および図2を参照して、本発明が適用される場面の一例について説明する。図1は、実施の形態に係る検査システムの1つの適用例を示す模式図である。図2は、検査システムに備えられる撮像装置の内部構成の一例を示す図である。
§1 Application Example First, an example of a scene to which the present invention is applied will be described with reference to FIGS. 1 and 2. FIG. 1 is a schematic diagram showing one application example of the inspection system according to the embodiment. FIG. 2 is a diagram illustrating an example of an internal configuration of an image pickup apparatus included in the inspection system.
 図1に示すように、本実施の形態に係る検査システム1は、たとえば外観検査システムとして実現される。検査システム1は、たとえば工業製品の生産ラインなどにおいて、ステージ90上に載置された対象物(ワークW)上の検査対象箇所を撮像し、得られた画像を用いて、ワークWの外観検査を行う。外観検査では、ワークWの傷、汚れ、異物の有無、寸法などが検査される。 As shown in FIG. 1, the inspection system 1 according to the present embodiment is realized as, for example, an appearance inspection system. The inspection system 1 images an inspection target portion on an object (work W) placed on the stage 90 in, for example, a production line of an industrial product, and uses the obtained image to inspect the appearance of the work W. I do. In the visual inspection, the work W is inspected for scratches, dirt, presence of foreign matter, dimensions, and the like.
 ステージ90上に載置されたワークWの外観検査が完了すると、次のワーク(図示せず)がステージ90上に搬送される。ワークWの撮像の際、ワークWは、ステージ90上の所定位置に所定姿勢で静止してもよい。あるいは、ワークWがステージ90上を移動しながら、ワークWが撮像されてもよい。 When the visual inspection of the work W placed on the stage 90 is completed, the next work (not shown) is transported onto the stage 90. When capturing the image of the work W, the work W may stand still at a predetermined position on the stage 90 in a predetermined posture. Alternatively, the work W may be imaged while the work W moves on the stage 90.
 図1に示すように、検査システム1は、基本的な構成要素として、撮像装置10と、画像処理装置20とを備える。この実施の形態では、検査システム1は、さらに、PLC(Programmable Logic Controller)30と、入力装置40と、表示装置50とを備える。 As shown in FIG. 1, the inspection system 1 includes an imaging device 10 and an image processing device 20 as basic components. In this embodiment, the inspection system 1 further includes a PLC (Programmable Logic Controller) 30, an input device 40, and a display device 50.
 撮像装置10は、画像処理装置20に接続される。撮像装置10は、画像処理装置20からの指令に従って、撮像視野に存在する被写体(ワークW)を撮像して、ワークWの像を含む画像データを生成する。撮像装置10と画像処理装置20とは一体化されていてもよい。 The imaging device 10 is connected to the image processing device 20. The imaging device 10 images a subject (workpiece W) existing in the imaging field of view according to a command from the image processing device 20, and generates image data including an image of the workpiece W. The imaging device 10 and the image processing device 20 may be integrated.
 図2に示されるように、撮像装置10は、照明部11と、レンズモジュール12と、撮像素子13と、撮像素子制御部14と、レンズ制御部16と、レジスタ15,17と、通信I/F(インターフェース)部18とを含む。 As shown in FIG. 2, the imaging device 10 includes an illumination unit 11, a lens module 12, an imaging device 13, an imaging device control unit 14, a lens control unit 16, registers 15 and 17, and a communication I/I. And an F (interface) unit 18.
 照明部11は、ワークWに対して光を照射する。照明部11から照射された光は、ワークWの表面で反射し、レンズモジュール12に入射する。照明部11は省略されてもよい。 The illumination unit 11 irradiates the work W with light. The light emitted from the illumination unit 11 is reflected on the surface of the work W and enters the lens module 12. The illumination unit 11 may be omitted.
 レンズモジュール12は、ワークWからの光を撮像素子13の撮像面13a上に結像させるための光学系である。レンズモジュール12の焦点位置は、所定の可動範囲内で可変である。焦点位置とは、光軸に平行な入射光線が光軸と交わる点の位置である。 The lens module 12 is an optical system for forming an image of the light from the work W on the image pickup surface 13a of the image pickup device 13. The focus position of the lens module 12 is variable within a predetermined movable range. The focal position is the position of a point where an incident light ray parallel to the optical axis intersects the optical axis.
 レンズモジュール12は、レンズ12aと、レンズ群12bと、レンズ12cと、可動部12dと、フォーカス調節部12eとを有する。レンズ12aは、レンズモジュール12の焦点位置を変化させるためのレンズである。フォーカス調節部12eは、レンズ12aを制御して、レンズモジュール12の焦点位置を調節する。 The lens module 12 includes a lens 12a, a lens group 12b, a lens 12c, a movable portion 12d, and a focus adjusting portion 12e. The lens 12a is a lens for changing the focal position of the lens module 12. The focus adjustment unit 12e controls the lens 12a to adjust the focus position of the lens module 12.
 レンズ群12bは、焦点距離を変更するためのレンズ群である。焦点距離が変更されることにより、ズーム倍率が制御される。レンズ群12bは、可動部12dに設置され、光軸方向に沿って可動する。レンズ12cは、撮像装置10内の予め定められた位置に固定されるレンズである。 The lens group 12b is a lens group for changing the focal length. The zoom magnification is controlled by changing the focal length. The lens group 12b is installed in the movable portion 12d and is movable along the optical axis direction. The lens 12c is a lens fixed at a predetermined position in the image pickup apparatus 10.
 レンズ制御部16は、レジスタ17が記憶する命令に従った焦点位置になるようにフォーカス調節部12eを制御する。 The lens control unit 16 controls the focus adjustment unit 12e so that the focus position is in accordance with the instruction stored in the register 17.
 レンズ制御部16は、ワークWのうち撮像視野内に含まれる領域の大きさが略一定になるように、可動部12dを制御して、レンズ群12bの位置を調節してもよい。言い換えると、レンズ制御部16は、ワークWのうち撮像視野内に含まれる領域の大きさが予め定められた範囲内になるように、可動部12dを制御することができる。レンズ制御部16は、撮像位置とワークWとの距離に応じてレンズ群12bの位置を調節すればよい。なお、この実施の形態では、ズームの調節は必須ではない。 The lens control unit 16 may adjust the position of the lens group 12b by controlling the movable unit 12d so that the size of the region included in the imaging field of view of the work W is substantially constant. In other words, the lens control unit 16 can control the movable unit 12d so that the size of the region of the work W included in the imaging visual field falls within a predetermined range. The lens control unit 16 may adjust the position of the lens group 12b according to the distance between the imaging position and the work W. In this embodiment, zoom adjustment is not essential.
 撮像素子13は、たとえばCMOS(Complementary Metal Oxide Semiconductor)イメージセンサなどの光電変換素子であり、レンズモジュール12を介してワークWからの光を受けることによって画像信号を生成する。 The image sensor 13 is a photoelectric conversion element such as a CMOS (Complementary Metal Oxide Semiconductor) image sensor, and generates an image signal by receiving light from the work W via the lens module 12.
 撮像素子制御部14は、フォーカス調節部12eによって焦点位置が調節されたときの撮像素子13からの画像信号に基づいて画像データを生成する。このとき、撮像素子制御部14は、予め設定されたシャッター速度(露光時間)となるようにシャッターを開閉し、予め設定された解像度の画像データを生成する。シャッター速度および解像度を示す情報は、予めレジスタ15に記憶されている。 The image sensor control unit 14 generates image data based on the image signal from the image sensor 13 when the focus position is adjusted by the focus adjustment unit 12e. At this time, the image sensor control unit 14 opens and closes the shutter so that the shutter speed (exposure time) is set in advance, and generates image data of the preset resolution. Information indicating the shutter speed and the resolution is stored in the register 15 in advance.
 通信I/F部18は、画像処理装置20との間でデータを送受信する。通信I/F部18は、撮像指示を画像処理装置20から受信する。通信I/F部18は、撮像素子制御部14によって生成された画像データを画像処理装置20に送信する。 The communication I/F unit 18 sends and receives data to and from the image processing device 20. The communication I/F unit 18 receives an imaging instruction from the image processing device 20. The communication I/F unit 18 transmits the image data generated by the image sensor control unit 14 to the image processing device 20.
 図1に戻って、PLC30は、画像処理装置20に接続され、画像処理装置20を制御する。例えばPLC30は、画像処理装置20が撮像指令(撮像トリガ)を撮像装置10に出力するためのタイミングを制御する。 Returning to FIG. 1, the PLC 30 is connected to the image processing device 20 and controls the image processing device 20. For example, the PLC 30 controls the timing for the image processing apparatus 20 to output an image capturing command (image capturing trigger) to the image capturing apparatus 10.
 入力装置40および表示装置50は、画像処理装置20に接続される。入力装置40は、検査システム1の各種の設定に関するユーザの入力を受け付ける。表示装置50は、検査システム1の設定に関する情報、画像処理装置20によるワークWの画像処理の結果などを表示する。 The input device 40 and the display device 50 are connected to the image processing device 20. The input device 40 receives user's inputs regarding various settings of the inspection system 1. The display device 50 displays information regarding the setting of the inspection system 1, the result of the image processing of the work W by the image processing device 20, and the like.
 画像処理装置20は、撮像装置10によって撮像された画像に対して画像処理を行なう。画像処理装置20は、設定部22と、検査部25と、評価部26とを備える。 The image processing device 20 performs image processing on the image captured by the imaging device 10. The image processing device 20 includes a setting unit 22, an inspection unit 25, and an evaluation unit 26.
 設定部22は、入力装置40への入力に従って、撮像装置10から取得した画像データで示される画像のうち第1領域と第2領域とを設定する。第1領域は、検査部25が検査を行なう対象となる領域(以下、「検査領域」という)である。第2領域は、ワークWの検査対象箇所に対する合焦の信頼性を評価する際に用いる領域(以下、「信頼性評価領域」という)である。 The setting unit 22 sets the first area and the second area in the image indicated by the image data acquired from the image pickup apparatus 10 according to the input to the input apparatus 40. The first area is an area to be inspected by the inspection unit 25 (hereinafter, referred to as “inspection area”). The second area is an area (hereinafter, referred to as “reliability evaluation area”) used when evaluating the reliability of focus of the work W on the inspection target portion.
 検査領域は、検査対象箇所に応じて設定される。例えば、ワークWがガラス基板であり、ガラス基板の上面中央付近の傷の有無を検査したい場合、当該上面中央付近を含む領域が検査領域として設定される。 The inspection area is set according to the inspection target part. For example, when the work W is a glass substrate and it is desired to inspect for scratches near the center of the upper surface of the glass substrate, an area including the vicinity of the center of the upper surface is set as the inspection area.
 信頼性評価領域は、ワークWの検査対象箇所に対する合焦を評価するために用いられるため、ワークWの検査対象箇所における検査領域と同じ高さであり、かつ、コントラストの高い領域が設定される。 Since the reliability evaluation area is used to evaluate the focus of the inspection target portion of the work W, an area having the same height as the inspection area of the inspection target portion of the work W and a high contrast is set. ..
 検査部25は、撮像装置10から受けた検査画像データで示される検査画像のうちの検査領域に基づいてワークWを検査し、検査結果を出力する。具体的には、検査部25は、検査領域に対して予め登録された検査プログラムに従った処理を施すことにより、ワークWを検査する。検査部25は、公知の技術を用いて検査を行なえばよい。検査項目が傷の有無である場合、検査結果は「傷あり」または「傷なし」を示す。検査項目が寸法である場合、検査結果は寸法の計測値が所定範囲内であるか否かを示す。 The inspection unit 25 inspects the work W based on the inspection area in the inspection image indicated by the inspection image data received from the imaging device 10, and outputs the inspection result. Specifically, the inspection unit 25 inspects the work W by performing a process according to a pre-registered inspection program on the inspection area. The inspection unit 25 may perform the inspection using a known technique. When the inspection item is the presence/absence of scratches, the inspection result indicates “with scratches” or “without scratches”. When the inspection item is a dimension, the inspection result indicates whether or not the measured value of the dimension is within a predetermined range.
 評価部26は、検査画像データで示される検査画像のうちの信頼性評価領域に基づいて、ワークWの検査対象箇所に対する合焦の信頼性を評価し、評価結果を出力する。具体的には、評価部26は、信頼性評価領域に対して予め登録された評価プログラムに従った処理を施すことにより、ワークWの検査対象箇所に対する合焦の信頼性を評価する。評価部26は、例えば、信頼性が高い程大きくなる評価値を算出し、当該評価値を含む評価結果を出力する。 The evaluation unit 26 evaluates the reliability of focusing on the inspection target portion of the work W based on the reliability evaluation area in the inspection image represented by the inspection image data, and outputs the evaluation result. Specifically, the evaluation unit 26 evaluates the reliability of focusing on the inspection target portion of the work W by performing processing according to the evaluation program registered in advance on the reliability evaluation area. The evaluation unit 26 calculates, for example, an evaluation value that increases as the reliability increases, and outputs an evaluation result including the evaluation value.
 このように、実施の形態に係る検査システム1は、焦点位置が可変であるレンズモジュール12と、レンズモジュール12を介してワークWからの光を受けることによって画像を生成する撮像素子13と、焦点位置を調節するフォーカス調節部12eとを備える。さらに、検査システム1は、検査部25と評価部26とを備える。検査部25は、フォーカス調節部12eによって焦点位置が調節されたときに生成された検査画像のうちの検査領域に基づいてワークWを検査し、検査結果を出力する。評価部26は、検査画像のうちの信頼性評価領域に基づいて、ワークWの検査対象箇所に対する合焦の信頼性を評価し、評価結果を出力する。 As described above, the inspection system 1 according to the embodiment includes the lens module 12 whose focal position is variable, the image sensor 13 which generates an image by receiving light from the work W via the lens module 12, and the focus. A focus adjustment unit 12e for adjusting the position is provided. Furthermore, the inspection system 1 includes an inspection unit 25 and an evaluation unit 26. The inspection unit 25 inspects the work W based on the inspection region in the inspection image generated when the focus position is adjusted by the focus adjustment unit 12e, and outputs the inspection result. The evaluation unit 26 evaluates the reliability of focusing on the inspection target portion of the work W based on the reliability evaluation region of the inspection image, and outputs the evaluation result.
 これにより、検査結果および評価結果を確認することにより、ワークWの不良の見逃しのリスクを低減できる。例えば、検査結果が「傷なし」を示す場合であっても、ワークWの検査対象箇所に対する合焦の信頼性が低いことを示す評価結果が得られたときには、作業者は、焦点位置がずれていることに起因して精度良く検査できていないことを認識できる。その結果、作業者は、ワークWの再検査などの適切な対応を行なうことができる。 With this, by checking the inspection result and the evaluation result, the risk of overlooking the defect of the work W can be reduced. For example, even when the inspection result indicates “no scratch”, when the evaluation result indicating that the focus of the work W on the inspection target portion is low in reliability is obtained, the worker shifts the focus position. It is possible to recognize that the inspection cannot be performed accurately due to the fact that As a result, the worker can take appropriate measures such as reinspection of the work W.
 §2 具体例
 <A.オートフォーカスのための構成例>
 図3は、オートフォーカスを説明するための模式図である。説明を簡単にするため、図3には、レンズモジュール12のうちの1枚のレンズのみを示している。
§2 Specific example <A. Configuration example for autofocus>
FIG. 3 is a schematic diagram for explaining autofocus. To simplify the description, FIG. 3 shows only one lens of the lens module 12.
 図3に示すように、レンズモジュール12の主点Oから対象面(ワークWの表面)までの距離をaとし、レンズモジュール12の主点Oから撮像面13aまでの距離をbとし、レンズモジュール12の主点Oからレンズモジュール12の焦点位置(後側焦点位置)Fまでの距離(焦点距離)をfとする。ワークWの像が撮像面13aの位置で結ばれる場合に、以下の式(1)が成立する。
1/a+1/b=1/f・・・(1)
すなわち、式(1)が成り立つときに、ワークWの表面に合焦した画像を撮像することができる。「合焦する」とは、ワークWの像が撮像素子13の撮像面13a(図2参照)に形成されることを意味する。
As shown in FIG. 3, the distance from the principal point O of the lens module 12 to the target surface (the surface of the work W) is a, the distance from the principal point O of the lens module 12 to the imaging surface 13a is b, and the lens module The distance (focal length) from the principal point O of 12 to the focal position (rear focal position) F of the lens module 12 is f. When the image of the work W is formed at the position of the imaging surface 13a, the following expression (1) is established.
1/a+1/b=1/f (1)
That is, when the formula (1) is satisfied, an image focused on the surface of the work W can be captured. “In focus” means that an image of the work W is formed on the image pickup surface 13a (see FIG. 2) of the image pickup device 13.
 ワークWの表面の高さに応じて、撮像面13aとワークWの表面との距離が変化し得る。撮像面13aとワークWの表面との距離が変化した場合であってもワークWの表面に合焦した画像を得るために、レンズモジュール12の焦点位置Fが調節される。レンズモジュール12の焦点位置Fを調節する方法には、以下の方法(A)および方法(B)がある。 The distance between the imaging surface 13a and the surface of the work W may change according to the height of the surface of the work W. The focus position F of the lens module 12 is adjusted in order to obtain an image focused on the surface of the work W even when the distance between the imaging surface 13a and the surface of the work W changes. The method of adjusting the focal position F of the lens module 12 includes the following method (A) and method (B).
 方法(A)は、レンズモジュール12を構成する少なくとも1つのレンズ(例えばレンズ12a)を光軸方向に平行移動させる方法である。方法(A)によれば、レンズモジュール12の主点Oが光軸方向に移動するとともに、焦点位置Fが変化する。その結果、距離bが変化する。式(1)を満たす距離bに対応する焦点位置Fのときに、ワークWの表面に合焦した画像が得られる。 The method (A) is a method in which at least one lens (for example, the lens 12a) forming the lens module 12 is translated in the optical axis direction. According to the method (A), the focal point F changes while the principal point O of the lens module 12 moves in the optical axis direction. As a result, the distance b changes. An image focused on the surface of the work W is obtained at the focal position F corresponding to the distance b satisfying the expression (1).
 方法(B)は、定位置に固定されたレンズ12aの屈折方向を変化させる方法である。方法(B)によれば、レンズモジュール12の焦点距離fが変化することに伴い、焦点位置Fが変化する。式(1)を満たす焦点距離fに対応する焦点位置Fのときに、ワークWの表面に合焦した画像が得られる。 Method (B) is a method of changing the refraction direction of the lens 12a fixed at a fixed position. According to the method (B), the focal position F changes as the focal length f of the lens module 12 changes. An image focused on the surface of the work W is obtained at the focal position F corresponding to the focal length f that satisfies Expression (1).
 レンズモジュール12の焦点位置Fを変化させるためのレンズ12aの構成は特に限定されない。以下に、レンズ12aの構成の例を説明する。 The configuration of the lens 12a for changing the focal position F of the lens module 12 is not particularly limited. Below, the example of a structure of the lens 12a is demonstrated.
 図4は、焦点位置が可変のレンズモジュールの一例を示す図である。図4に示す例では、レンズモジュール12を構成するレンズ12aを平行移動させる。ただし、レンズモジュール12を構成する少なくとも1つのレンズ(レンズ12a、レンズ群12bおよびレンズ12cのうちの少なくとも1つのレンズ)を平行移動させてもよい。 FIG. 4 is a diagram showing an example of a lens module whose focal position is variable. In the example shown in FIG. 4, the lens 12a forming the lens module 12 is moved in parallel. However, at least one lens (at least one of the lens 12a, the lens group 12b, and the lens 12c) that configures the lens module 12 may be translated.
 図4に示す構成のレンズ12aを用いることにより、上記の方法(A)に従って、レンズモジュール12の焦点位置Fが変化する。すなわち、図4に示した構成では、フォーカス調節部12eは、レンズ12aを光軸方向に沿って移動させる。レンズ12aの位置を移動させることによって、レンズモジュール12の焦点位置Fが変化する。 By using the lens 12a having the configuration shown in FIG. 4, the focal position F of the lens module 12 changes according to the above method (A). That is, in the configuration shown in FIG. 4, the focus adjustment unit 12e moves the lens 12a along the optical axis direction. By moving the position of the lens 12a, the focus position F of the lens module 12 changes.
 図4では、1枚のレンズ12aの例が示されている。通常では、フォーカス調節用のレンズは複数枚の組レンズで構成されることが多い。しかしながら、組レンズにおいても、組レンズを構成する少なくとも1枚のレンズの移動量を制御することにより、レンズモジュール12の焦点位置Fを変化させることができる。 In FIG. 4, an example of one lens 12a is shown. Usually, the focus adjusting lens is often composed of a plurality of lens groups. However, also in the combined lens, the focus position F of the lens module 12 can be changed by controlling the movement amount of at least one lens forming the combined lens.
 図5は、焦点位置が可変のレンズモジュールの別の例を示す図である。図5に示す構成のレンズ12aを用いることにより、上記の方法(B)に従って、レンズモジュール12の焦点位置Fが変化する。 FIG. 5 is a diagram showing another example of a lens module whose focal position is variable. By using the lens 12a having the configuration shown in FIG. 5, the focal position F of the lens module 12 changes according to the above method (B).
 図5に示すレンズ12aは液体レンズである。レンズ12aは、透光性容器70と、電極73a,73b,74a,74bと、絶縁体75a,75bと、絶縁層76a,76bとを含む。 The lens 12a shown in FIG. 5 is a liquid lens. The lens 12a includes a translucent container 70, electrodes 73a, 73b, 74a, 74b, insulators 75a, 75b, and insulating layers 76a, 76b.
 透光性容器70内の密閉空間には、水などの導電性液体71と、油などの絶縁性液体72とが充填される。導電性液体71と絶縁性液体72とは混合せず、互いに屈折率が異なる。 A conductive space 71, such as water, and an insulating liquid 72, such as oil, are filled in the sealed space inside the transparent container 70. The conductive liquid 71 and the insulating liquid 72 are not mixed and have different refractive indexes.
 電極73a,73bは、絶縁体75a,75bと透光性容器70との間にそれぞれ固定され、導電性液体71中に位置する。 The electrodes 73a and 73b are fixed between the insulators 75a and 75b and the translucent container 70, respectively, and are located in the conductive liquid 71.
 電極74a,74bは、導電性液体71と絶縁性液体72との界面の端部付近に配置される。電極74aと導電性液体71および絶縁性液体72との間には絶縁層76aが介在する。電極74bと導電性液体71および絶縁性液体72との間には絶縁層76bが介在する。電極74aと電極74bとは、レンズ12aの光軸に対して対称な位置に配置される。 The electrodes 74a and 74b are arranged near the ends of the interface between the conductive liquid 71 and the insulating liquid 72. An insulating layer 76a is interposed between the electrode 74a and the conductive liquid 71 and the insulating liquid 72. An insulating layer 76b is interposed between the electrode 74b and the conductive liquid 71 and the insulating liquid 72. The electrodes 74a and 74b are arranged at positions symmetrical with respect to the optical axis of the lens 12a.
 図5に示す構成において、フォーカス調節部12eは、電圧源12e1と、電圧源12e2とを含む。電圧源12e1は、電極74aと電極73aとの間に電圧Vaを印加する。電圧源12e2は、電極74bと電極73bとの間に電圧Vbを印加する。 In the configuration shown in FIG. 5, the focus adjustment unit 12e includes a voltage source 12e1 and a voltage source 12e2. The voltage source 12e1 applies the voltage Va between the electrode 74a and the electrode 73a. The voltage source 12e2 applies the voltage Vb between the electrode 74b and the electrode 73b.
 電極74aと電極73aとの間に電圧Vaを印加すると、導電性液体71は、電極74aに引っ張られる。同様に、電極74bと電極73bとの間に電圧Vbを印加すると、導電性液体71は、電極74bに引っ張られる。これにより、導電性液体71と絶縁性液体72との界面の曲率が変化する。導電性液体71と絶縁性液体72との屈折率が異なるため、導電性液体71と絶縁性液体72との界面の曲率が変化することにより、レンズモジュール12の焦点位置Fが変化する。 When the voltage Va is applied between the electrode 74a and the electrode 73a, the conductive liquid 71 is pulled by the electrode 74a. Similarly, when the voltage Vb is applied between the electrode 74b and the electrode 73b, the conductive liquid 71 is pulled by the electrode 74b. As a result, the curvature of the interface between the conductive liquid 71 and the insulating liquid 72 changes. Since the conductive liquid 71 and the insulating liquid 72 have different refractive indexes, the focus position F of the lens module 12 changes as the curvature of the interface between the conductive liquid 71 and the insulating liquid 72 changes.
 導電性液体71と絶縁性液体72との界面の曲率は、電圧Va,Vbの大きさに依存する。そのため、探索部24は、電圧Va,Vbの大きさを制御することにより、レンズモジュール12の焦点位置Fを変化させる。 The curvature of the interface between the conductive liquid 71 and the insulating liquid 72 depends on the magnitude of the voltages Va and Vb. Therefore, the search unit 24 changes the focus position F of the lens module 12 by controlling the magnitudes of the voltages Va and Vb.
 通常は、電圧Vaと電圧Vbとは同値に制御される。これにより、導電性液体71と絶縁性液体72との界面は、光軸に対して対称に変化する。ただし、電圧Vaと電圧Vbとが異なる値に制御されてもよい。これにより、導電性液体71と絶縁性液体72との界面が光軸に対して非対称となり、撮像装置10の撮像視野の向きを変更することができる。 Normally, the voltage Va and the voltage Vb are controlled to the same value. As a result, the interface between the conductive liquid 71 and the insulating liquid 72 changes symmetrically with respect to the optical axis. However, the voltage Va and the voltage Vb may be controlled to different values. As a result, the interface between the conductive liquid 71 and the insulating liquid 72 becomes asymmetric with respect to the optical axis, and the orientation of the imaging visual field of the imaging device 10 can be changed.
 さらに液体レンズと固体レンズとを組み合わせてもよい。この場合、上記の方法(A)および方法(B)の両方を用いてレンズモジュール12の焦点位置Fを変化させる。 Furthermore, a liquid lens and a solid lens may be combined. In this case, the focus position F of the lens module 12 is changed by using both the method (A) and the method (B) described above.
 <B.画像処理装置のハードウェア構成>
 図6は、実施の形態に係る画像処理装置のハードウェア構成の一例を示すブロック図である。図6に示す例の画像処理装置20は、演算処理部であるCPU(Central Processing Unit)210と、記憶部としてのメインメモリ232およびハードディスク234と、カメラインターフェース216と、入力インターフェース218と、表示コントローラ220と、PLCインターフェース222と、通信インターフェース224と、データリーダ/ライタ226とを含む。これらの各部は、バス228を介して、互いにデータ通信可能に接続される。
<B. Hardware configuration of image processing device>
FIG. 6 is a block diagram showing an example of the hardware configuration of the image processing apparatus according to the embodiment. The image processing apparatus 20 of the example illustrated in FIG. 6 includes a CPU (Central Processing Unit) 210 that is an arithmetic processing unit, a main memory 232 and a hard disk 234 that are storage units, a camera interface 216, an input interface 218, and a display controller. 220, PLC interface 222, communication interface 224, and data reader/writer 226. These units are connected to each other via a bus 228 so that they can communicate with each other.
 CPU210は、ハードディスク234に格納されたプログラム(コード)をメインメモリ232に展開して、これらを所定順序で実行することで、各種の演算を実施する。制御プログラム236は、検査画像に基づいてワークWを検査するための検査プログラムと、ワークWに対する合焦の信頼性を評価するための評価プログラムとを含む。 The CPU 210 expands the program (code) stored in the hard disk 234 into the main memory 232 and executes these in a predetermined order to perform various calculations. The control program 236 includes an inspection program for inspecting the work W based on the inspection image and an evaluation program for evaluating the reliability of focusing on the work W.
 メインメモリ232は、典型的には、DRAM(Dynamic Random Access Memory)などの揮発性の記憶装置であり、ハードディスク234から読み出されたプログラムに加えて、撮像装置10によって取得された画像データ、ワークデータなどを保持する。さらに、ハードディスク234には、各種設定値などが格納されてもよい。なお、ハードディスク234に加えて、あるいは、ハードディスク234に代えて、フラッシュメモリなどの半導体記憶装置を採用してもよい。 The main memory 232 is typically a volatile storage device such as a DRAM (Dynamic Random Access Memory), and in addition to the program read from the hard disk 234, image data and work acquired by the imaging device 10 Holds data etc. Further, the hard disk 234 may store various setting values and the like. In addition to the hard disk 234 or in place of the hard disk 234, a semiconductor storage device such as a flash memory may be adopted.
 カメラインターフェース216は、CPU210と撮像装置10との間のデータ伝送を仲介する。すなわち、カメラインターフェース216は、ワークWを撮像して画像データを生成するための撮像装置10と接続される。より具体的には、カメラインターフェース216は、撮像装置10からの画像データを一時的に蓄積するための画像バッファ216aを含む。そして、カメラインターフェース216は、画像バッファ216aに所定コマ数の画像データが蓄積されると、その蓄積されたデータをメインメモリ232へ転送する。また、カメラインターフェース216は、CPU210が発生した内部コマンドに従って、撮像装置10に対して撮像指令を送る。 The camera interface 216 mediates data transmission between the CPU 210 and the imaging device 10. That is, the camera interface 216 is connected to the imaging device 10 for imaging the work W and generating image data. More specifically, the camera interface 216 includes an image buffer 216a for temporarily storing image data from the image pickup apparatus 10. Then, when the image data of a predetermined number of frames is accumulated in the image buffer 216a, the camera interface 216 transfers the accumulated data to the main memory 232. The camera interface 216 also sends an image pickup command to the image pickup apparatus 10 in accordance with an internal command generated by the CPU 210.
 入力インターフェース218は、CPU210と入力装置40との間のデータ伝送を仲介する。すなわち、入力インターフェース218は、作業者が入力装置40を操作することで与えられる操作指令を受付ける。 The input interface 218 mediates data transmission between the CPU 210 and the input device 40. That is, the input interface 218 receives an operation command given by the operator operating the input device 40.
 表示コントローラ220は、表示装置50と接続され、CPU210における処理の結果などをユーザに通知する。すなわち、表示コントローラ220は、表示装置50の画面を制御する。 The display controller 220 is connected to the display device 50 and notifies the user of the result of processing in the CPU 210. That is, the display controller 220 controls the screen of the display device 50.
 PLCインターフェース222は、CPU210とPLC30との間のデータ伝送を仲介する。より具体的には、PLCインターフェース222は、PLC30からの制御指令をCPU210へ伝送する。 The PLC interface 222 mediates data transmission between the CPU 210 and the PLC 30. More specifically, the PLC interface 222 transmits the control command from the PLC 30 to the CPU 210.
 通信インターフェース224は、CPU210とコンソール(あるいは、パーソナルコンピュータやサーバ装置)などとの間のデータ伝送を仲介する。通信インターフェース224は、典型的には、イーサネット(登録商標)やUSB(Universal Serial Bus)などからなる。なお、後述するように、メモリカード206に格納されたプログラムを画像処理装置20にインストールする形態に代えて、通信インターフェース224を介して、配信サーバなどからダウンロードしたプログラムを画像処理装置20にインストールしてもよい。 The communication interface 224 mediates data transmission between the CPU 210 and the console (or personal computer or server device). The communication interface 224 is typically composed of Ethernet (registered trademark) or USB (Universal Serial Bus). As will be described later, instead of installing the program stored in the memory card 206 in the image processing apparatus 20, the program downloaded from a distribution server or the like via the communication interface 224 is installed in the image processing apparatus 20. May be.
 データリーダ/ライタ226は、CPU210と記録媒体であるメモリカード206との間のデータ伝送を仲介する。すなわち、メモリカード206には、画像処理装置20で実行されるプログラムなどが格納された状態で流通し、データリーダ/ライタ226は、このメモリカード206からプログラムを読出す。また、データリーダ/ライタ226は、CPU210の内部指令に応答して、撮像装置10によって取得された画像データおよび/または画像処理装置20における処理結果などをメモリカード206へ書込む。なお、メモリカード206は、SD(Secure Digital)などの汎用的な半導体記憶デバイスや、フレキシブルディスク(Flexible Disk)などの磁気記憶媒体や、CD-ROM(Compact Disk Read Only Memory)などの光学記憶媒体等からなる。 The data reader/writer 226 mediates data transmission between the CPU 210 and the memory card 206 which is a recording medium. That is, the memory card 206 circulates in a state in which a program executed by the image processing apparatus 20 is stored, and the data reader/writer 226 reads the program from the memory card 206. In addition, the data reader/writer 226 writes the image data acquired by the imaging device 10 and/or the processing result in the image processing device 20 to the memory card 206 in response to the internal command of the CPU 210. The memory card 206 is a general-purpose semiconductor storage device such as SD (Secure Digital), a magnetic storage medium such as a flexible disk (Flexible Disk), or an optical storage medium such as a CD-ROM (Compact Disk Read Only Memory). Etc.
 <C.画像処理装置の機能構成>
 図7を参照して、画像処理装置20の機能構成の一例について説明する。図7は、画像処理装置の機能構成の一例を示す図である。図7に示されるように、画像処理装置20は、指令生成部21と、設定部22と、算出部23と、探索部24と、検査部25と、評価部26と、判定部27と、出力部28と、記憶部230とを含む。指令生成部21、設定部22、算出部23、探索部24、検査部25、評価部26および判定部27は、図6に示すCPU210が制御プログラム236を実行することにより実現される。記憶部230は、図6に示すメインメモリ232およびハードディスク234によって構成される。出力部28は、図6に示す表示コントローラ220によって構成される。
<C. Functional configuration of image processing device>
An example of the functional configuration of the image processing apparatus 20 will be described with reference to FIG. 7. FIG. 7 is a diagram illustrating an example of the functional configuration of the image processing apparatus. As shown in FIG. 7, the image processing device 20 includes a command generation unit 21, a setting unit 22, a calculation unit 23, a search unit 24, an inspection unit 25, an evaluation unit 26, a determination unit 27, The output unit 28 and the storage unit 230 are included. The command generation unit 21, the setting unit 22, the calculation unit 23, the search unit 24, the inspection unit 25, the evaluation unit 26, and the determination unit 27 are realized by the CPU 210 shown in FIG. 6 executing the control program 236. The storage unit 230 includes a main memory 232 and a hard disk 234 shown in FIG. The output unit 28 is configured by the display controller 220 shown in FIG.
 指令生成部21は、PLC30からの制御指令を受けて、撮像装置10に撮像指令(撮像トリガ)を出力する。設定部22の概要について上述したとおりである。 The command generation unit 21 receives a control command from the PLC 30 and outputs an imaging command (imaging trigger) to the imaging device 10. The outline of the setting unit 22 is as described above.
 算出部23は、撮像装置10によって生成された画像データから合焦度を算出する。合焦度とは、対象物に対して焦点がどの程度合っているかを表す度合いであり、公知の種々の方法を用いる算出される。たとえば、算出部23は、画像データに対してハイパスフィルタを適用することにより高周波成分を抽出し、抽出された高周波成分の積算値を合焦度として算出する。このような合焦度は、画像の明暗差に依存した値を示す。 The calculation unit 23 calculates the degree of focus from the image data generated by the imaging device 10. The focus degree is a degree indicating how much the object is in focus, and is calculated using various known methods. For example, the calculation unit 23 extracts a high frequency component by applying a high pass filter to the image data, and calculates an integrated value of the extracted high frequency components as a focus degree. Such a focus degree indicates a value that depends on the difference in brightness of the image.
 探索部24は、ワークWに合焦する焦点位置である合焦位置を探索する。具体的には、探索部24は、レンズモジュール12の焦点位置を変えて生成された複数の画像データの各々の合焦度を算出部23から取得する。探索部24は、取得した合焦度がピークとなる焦点位置を合焦位置として決定する。探索部24は、レンズモジュール12の焦点位置が合焦位置であるときの画像データを検査画像データとして特定する。すなわち、検査画像データは、フォーカス調節部12eによって焦点位置が合焦位置に調節されたときに生成される画像データである。 The search unit 24 searches for a focus position which is a focus position where the work W is focused. Specifically, the search unit 24 acquires, from the calculation unit 23, the focus degree of each of the plurality of image data generated by changing the focal position of the lens module 12. The search unit 24 determines the focus position at which the acquired degree of focus reaches a peak as the focus position. The search unit 24 specifies the image data when the focal position of the lens module 12 is the in-focus position as the inspection image data. That is, the inspection image data is image data generated when the focus position is adjusted to the in-focus position by the focus adjustment unit 12e.
 合焦位置の探索方法としては、山登り法と全スキャン法とがあり、いずれを用いてもよい。 As methods for searching the in-focus position, there are a hill climbing method and a full scan method, and either method may be used.
 山登り法とは、レンズモジュール12の焦点位置を設定された探索範囲内で変化させながら、合焦度が極大となる焦点位置を見つけた時点で探索を終了し、合焦度が極大となる焦点位置を合焦位置として決定する方法である。具体的には、山登り法は、探索開始時の焦点位置における合焦度と隣の焦点位置における合焦度との大小関係に基づいて、合焦度が大きくなる焦点位置の方向を探索方向として決定する。さらに、山登り法は、探索方向に焦点位置を変化させながら、先の焦点位置での合焦度と次の焦点位置での合焦度との差を順次演算し、この差が正からゼロまたは負に変化した時点の焦点位置を合焦位置として決定する。 The hill climbing method is a focus at which the focus is maximized while changing the focus position of the lens module 12 within the set search range and ending the search when the focus position at which the focus is maximized is found. This is a method of determining the position as the in-focus position. Specifically, the hill-climbing method is based on the magnitude relationship between the focus degree at the focus position at the start of the search and the focus degree at the adjacent focus position, and the direction of the focus position at which the focus degree increases becomes the search direction. decide. Furthermore, the hill climbing method sequentially calculates the difference between the focus degree at the previous focus position and the focus degree at the next focus position while changing the focus position in the search direction. The focus position at the time of negative change is determined as the focus position.
 山登り法では、探索部24は、合焦度が極大を示した画像データを検査画像データとして特定すればよい。 In the hill climbing method, the search unit 24 may specify the image data having the maximum focus degree as the inspection image data.
 全スキャン法とは、レンズモジュール12の焦点位置を設定された探索範囲の全域で変化させ、各焦点位置での合焦度を取得し、合焦度が最大となる焦点位置を合焦位置として決定する方法である。全スキャン法には、粗い第1探索処理を行なった後に細かい第2探索処理を行なう方法も含む。第1探索処理は、粗いピッチ間隔で焦点位置を探索範囲の全域で変化させ、合焦度が最大となる焦点位置を探索する処理である。第2探索処理は、第1探索処理で探索された焦点位置を含む局所範囲の全域において細かいピッチ間隔で焦点位置を変化させ、合焦度が最大となる焦点位置を合焦位置として探索する処理である。 The all-scan method is to change the focal position of the lens module 12 over the entire set search range, obtain the in-focus degree at each in-focus position, and set the in-focus position to be the in-focus position with the maximum in-focus degree. It is a way to decide. The full scan method also includes a method of performing a coarse second search process and then a fine second search process. The first search process is a process of changing the focus position at a coarse pitch interval over the entire search range to search for the focus position having the maximum focus degree. The second search process is a process of changing the focus position at fine pitch intervals in the entire local range including the focus position searched in the first search process, and searching the focus position with the maximum focus degree as the focus position. Is.
 全スキャン法では、探索部24は、各焦点位置の画像データを記憶しておき、記憶している画像データの中から、合焦度が最大となる焦点位置の画像データを検査画像データとして特定する。もしくは、探索部24は、焦点位置を合焦位置に調節して撮像する指令を出力するように指令生成部21に指示し、当該指令に応じて撮像装置10から受けた画像データを検査画像データとして特定してもよい。 In the full scan method, the search unit 24 stores the image data of each focus position, and specifies the image data of the focus position having the maximum focus degree as the inspection image data from the stored image data. To do. Alternatively, the search unit 24 instructs the command generation unit 21 to output a command for adjusting the focus position to the in-focus position and outputting an image, and the image data received from the imaging device 10 according to the command is the inspection image data. May be specified as
 検査部25および評価部26の概要については、上述したとおりである。すなわち、検査部25は、探索部24によって特定された検査画像データで示される検査画像のうちの検査領域に基づいてワークWを検査し、検査結果を出力する。評価部26は、探索部24によって特定された検査画像データで示される検査画像のうちの信頼性評価領域に基づいて、ワークWの検査対象箇所に対する合焦の信頼性を評価し、評価結果を出力する。 The outline of the inspection unit 25 and the evaluation unit 26 is as described above. That is, the inspection unit 25 inspects the work W based on the inspection area in the inspection image indicated by the inspection image data specified by the search unit 24, and outputs the inspection result. The evaluation unit 26 evaluates the reliability of focusing on the inspection target portion of the work W based on the reliability evaluation region of the inspection image indicated by the inspection image data specified by the search unit 24, and displays the evaluation result. Output.
 判定部27は、検査部25から出力された検査結果と評価部26から出力された評価結果とに基づいて、ワークWの総合判定を行なう。判定部27は、検査部25から出力された検査結果が予め定められた第1基準を満たし、かつ、評価部26から出力された評価結果が予め定められた第2基準を満たす場合に、ワークWが良品であると判定する。 The determination unit 27 makes a comprehensive determination of the work W based on the inspection result output from the inspection unit 25 and the evaluation result output from the evaluation unit 26. The determination unit 27 determines whether the inspection result output from the inspection unit 25 satisfies a predetermined first criterion and the evaluation result output from the evaluation unit 26 satisfies a predetermined second criterion. It is determined that W is a good product.
 判定部27は、検査結果が第1基準を満たさず、かつ、評価結果が第2基準を満たす場合に、ワークWが不良品であると判定する。さらに、判定部27は、評価結果が第2基準を満たさない場合に、焦点位置の自動調節に不具合があり精度良く検査できていないと判定する。 The determination unit 27 determines that the work W is a defective product when the inspection result does not satisfy the first standard and the evaluation result satisfies the second standard. Further, when the evaluation result does not satisfy the second criterion, the determination unit 27 determines that the automatic adjustment of the focus position has a problem and the inspection cannot be performed accurately.
 出力部28は、判定部27による判定結果を出力する。たとえば、出力部28は、表示装置50に判定結果を表示させる。出力部28は、検査結果および評価結果も表示装置50に表示させてもよい。 The output unit 28 outputs the determination result of the determination unit 27. For example, the output unit 28 causes the display device 50 to display the determination result. The output unit 28 may also display the inspection result and the evaluation result on the display device 50.
 記憶部230は、各種のデータ、プログラム等を記憶する。たとえば記憶部230は、撮像装置10から取得された画像データ、および所定の処理が施された画像データを保存する。記憶部230は、検査部25による検査結果、評価部26による評価結果、および判定部27による判定結果を保存してもよい。さらに、記憶部230は、各種の処理を画像処理装置20に実行させるためのプログラムを記憶する。 The storage unit 230 stores various data, programs and the like. For example, the storage unit 230 stores the image data acquired from the imaging device 10 and the image data that has been subjected to predetermined processing. The storage unit 230 may store the inspection result by the inspection unit 25, the evaluation result by the evaluation unit 26, and the determination result by the determination unit 27. Further, the storage unit 230 stores a program for causing the image processing apparatus 20 to execute various types of processing.
 <D.ワークの例およびオートフォーカスの課題>
 図8は、撮像装置によるワークWの撮像を模式的に示した図である。図8に示した例において、ワークWは、領域W1と領域W2とを有する。領域W1は、たとえば透明体(ガラスなど)の表面である。領域W2は領域W1を囲む領域であり、たとえば電子機器の筐体の表面である。このようなワークWの例として、ディスプレイを有する電子機器(一例では、スマートフォンあるいはタブレットなど)を挙げることができる。すなわち領域W1は、表示画面でありえる。また、領域W1は、明確なパターンを有していない。すなわち領域W1は無地の領域である。
<D. Workpiece examples and autofocus issues>
FIG. 8 is a diagram schematically showing the image pickup of the work W by the image pickup apparatus. In the example shown in FIG. 8, the work W has a region W1 and a region W2. The region W1 is, for example, the surface of a transparent body (glass or the like). The region W2 is a region surrounding the region W1 and is, for example, the surface of the housing of the electronic device. As an example of such a work W, an electronic device having a display (a smartphone or a tablet in one example) can be cited. That is, the area W1 can be a display screen. Moreover, the region W1 does not have a clear pattern. That is, the area W1 is a plain area.
 領域W1内を検査したい場合、領域W1内に検査領域A1が設定される。検査領域A1を含む領域が撮像装置10により撮像され、検査領域A1の画像が画像処理装置20による画像処理の対象となる。画像処理装置20は、検査領域A1の画像を用いて、検査領域A1内に傷、汚れ、あるいは異物が有るかどうかを検査する。 When it is desired to inspect the area W1, the inspection area A1 is set in the area W1. An area including the inspection area A1 is imaged by the imaging device 10, and the image of the inspection area A1 is a target of image processing by the image processing apparatus 20. The image processing apparatus 20 uses the image of the inspection area A1 to inspect whether the inspection area A1 has scratches, dirt, or foreign matter.
 検査領域A1に合焦していない状態で撮像された場合、取得された画像から、検査領域A1内の傷などを検出できない可能性がある。精度の高い検査を行うためには、検査領域A1に合焦した画像であるか否かを評価することが求められる。しかし上述の例のように、検査領域A1が無地の領域の一部である場合、検査領域A1には明確なパターンが形成されていない。このような場合、検査領域A1内でのコントラストが低いため、検査領域A1の画像だけでは、検査領域A1に合焦しているか否かの評価が難しいという課題がある。 If the image is taken in a state where the inspection area A1 is out of focus, there is a possibility that a scratch or the like in the inspection area A1 cannot be detected from the acquired image. In order to perform a highly accurate inspection, it is required to evaluate whether or not the image is focused on the inspection area A1. However, as in the above example, when the inspection area A1 is a part of the plain area, a clear pattern is not formed in the inspection area A1. In such a case, since the contrast in the inspection area A1 is low, it is difficult to evaluate whether or not the inspection area A1 is in focus only with the image of the inspection area A1.
 <E.検査領域および信頼性評価領域の設定>
 本実施の形態によれば、画像処理装置20の設定部22は、ワークWに対して、検査領域とともに信頼性評価領域を予め設定しておく。
<E. Setting inspection area and reliability evaluation area>
According to the present embodiment, the setting unit 22 of the image processing apparatus 20 sets the inspection area and the reliability evaluation area in advance for the work W.
 作業者は、ステージ90(図1参照)の所定位置に基準ワークW0を所定姿勢の状態で置く。画像処理装置20は、撮像指令を撮像装置10に出力し、撮像装置10から基準画像データを取得する。基準画像データは、所定位置に所定姿勢の状態で置かれた基準ワークW0を含む基準画像を示す。 The worker places the reference work W0 at a predetermined position on the stage 90 (see FIG. 1) in a predetermined posture. The image processing device 20 outputs an imaging command to the imaging device 10 and acquires reference image data from the imaging device 10. The reference image data indicates a reference image including the reference work W0 placed at a predetermined position in a predetermined posture.
 画像処理装置20の設定部22は、撮像装置10から取得した基準画像データで示される基準画像を表示装置50に表示させ、検査領域および信頼性評価領域の指定を作業者に促す。 The setting unit 22 of the image processing device 20 causes the display device 50 to display the reference image represented by the reference image data acquired from the imaging device 10, and prompts the operator to specify the inspection region and the reliability evaluation region.
 図9は、検査領域および信頼性評価領域の設定画面の一例を示す図である。図9に示されるように、設定部22は、表示装置50の画面に、撮像装置10から取得した基準画像データで示される基準画像80を表示させる。 FIG. 9 is a diagram showing an example of a setting screen for the inspection area and the reliability evaluation area. As shown in FIG. 9, the setting unit 22 causes the screen of the display device 50 to display the reference image 80 indicated by the reference image data acquired from the imaging device 10.
 設定部22は、入力装置40への入力に応じて、検査領域A1および信頼性評価領域B1を設定する。例えば、作業者は、矩形である検査領域A1および信頼性評価領域B1の各々の4頂点を入力する。作業者は、基準ワークW0における検査領域A1と同じ高さであり、かつ、コントラストの高い部分を含む領域を信頼性評価領域B1として指定する。図9に示す例では、基準ワークW0のエッジ部分を含む領域が信頼性評価領域B1として指定されている。コントラストの高い部分としては、エッジ部分の他にも、表面に印刷された文字、表面に形成された模様、ネジなどの部品が取り付けられた部分などが含まれる。 The setting unit 22 sets the inspection area A1 and the reliability evaluation area B1 according to the input to the input device 40. For example, the worker inputs four vertices of the inspection area A1 and the reliability evaluation area B1 which are rectangular. The operator designates a region having the same height as the inspection region A1 of the reference work W0 and including a high contrast as the reliability evaluation region B1. In the example shown in FIG. 9, a region including the edge portion of the reference work W0 is designated as the reliability evaluation region B1. The high-contrast portion includes, in addition to the edge portion, a character printed on the surface, a pattern formed on the surface, a portion to which parts such as screws are attached, and the like.
 図9に示す例では、矩形の検査領域A1および信頼性評価領域B1が設定されているが、各領域の形状はこれに限定されない。例えば、検査領域A1および信頼性評価領域B1の少なくとも一方の形状が、円形、あるいは領域を形成することが可能な任意の自由な形状であってもよい。また、検査領域A1および信頼性評価領域B1の少なくとも一方は、1つにまとまった領域であると限定される必要はない。たとえば、検査領域A1および信頼性評価領域B1の少なくとも一方は、分散して存在する複数の領域であってもよい。 In the example shown in FIG. 9, a rectangular inspection area A1 and a reliability evaluation area B1 are set, but the shape of each area is not limited to this. For example, the shape of at least one of the inspection area A1 and the reliability evaluation area B1 may be circular or any free shape capable of forming an area. Further, at least one of the inspection area A1 and the reliability evaluation area B1 does not have to be limited to a single area. For example, at least one of the inspection area A1 and the reliability evaluation area B1 may be a plurality of areas that exist in a distributed manner.
 図10は、検査領域および信頼性評価領域の設定画面の別の例を示す図である。図10に示す例では、基準ワークW0のエッジ部分に沿った枠状の信頼性評価領域B1が設定されている。 FIG. 10 is a diagram showing another example of a setting screen for the inspection area and the reliability evaluation area. In the example shown in FIG. 10, a frame-shaped reliability evaluation area B1 is set along the edge portion of the reference work W0.
 設定部22は、設定した検査領域A1および信頼性評価領域B1の各々を特定するための情報を生成し、生成した情報を記憶部230に格納する。 The setting unit 22 generates information for identifying each of the set inspection area A1 and reliability evaluation area B1, and stores the generated information in the storage unit 230.
 <F.評価方法>
 次に、評価部26による信頼性の評価方法について説明する。評価部26は、検査画像データで示される検査画像のうちの信頼性評価領域B1の合焦度に基づいて、ワークWの検査対象箇所に対する合焦の信頼性を示す評価値を算出する。合焦度は、例えば、信頼性評価領域B1の画像から抽出された高周波成分の積算値である。
<F. Evaluation method>
Next, a method of evaluating reliability by the evaluation unit 26 will be described. The evaluation unit 26 calculates an evaluation value indicating the reliability of the focus on the inspection target portion of the work W based on the focus degree of the reliability evaluation area B1 in the inspection image represented by the inspection image data. The focus degree is, for example, an integrated value of high frequency components extracted from the image of the reliability evaluation area B1.
 例えば、評価部26は、検査画像の信頼性評価領域B1から算出した合焦度cと、予め定められた基準合焦度dとの比(=c/d)を評価値として算出する。この場合、評価値が大きいほど、ワークWの検査対象箇所に対する合焦の信頼性が高い。基準合焦度は、例えば基準ワークW0の検査対象箇所に合焦した画像における信頼性評価領域B1から算出した合焦度であり、予め実験により算出される。 For example, the evaluation unit 26 calculates, as an evaluation value, a ratio (=c/d) between the focus degree c calculated from the reliability evaluation area B1 of the inspection image and a predetermined reference focus degree d. In this case, the larger the evaluation value, the higher the reliability of focusing on the inspection target portion of the work W. The reference focus degree is, for example, the focus degree calculated from the reliability evaluation area B1 in the image focused on the inspection target portion of the reference work W0, and is calculated in advance by an experiment.
 あるいは、探索部24が全スキャン法に従って合焦位置を探索する場合、評価部26は、合焦位置の探索処理の際に得られる合焦度波形の第1ピークの合焦度gと第2ピークの合焦度hとの比(=g/h)を評価値として算出してもよい。合焦度波形とは、レンズモジュール12の焦点位置を変化させたときの焦点位置に対する合焦度の変化を示す波形である。第1ピークは、合焦度が最も大きいピークである。第2ピークは、合焦度が2番目に大きいピークである。 Alternatively, when the search unit 24 searches for the in-focus position according to the full scan method, the evaluation unit 26 causes the in-focus level g and the second in-focus level g of the first peak of the in-focus level waveform obtained in the in-focus position search process. The ratio (=g/h) of the peak to the focusing degree h may be calculated as the evaluation value. The focus degree waveform is a waveform showing a change in the focus degree with respect to the focus position when the focus position of the lens module 12 is changed. The first peak is the peak with the highest degree of focus. The second peak is the peak having the second highest focus degree.
 図11は、合焦度波形の一例を示す図である。図11に示す例の合焦度波形は、焦点位置F1,F2の2つのピークを含む。焦点位置F1は、ワークWの検査対象箇所に合焦するときの焦点位置である。そのため、オートフォーカス処理が正常に行なわれた場合、合焦度波形は、焦点位置F1の1つのピークのみを含む。しかしながら、何らかの原因により、焦点位置F1とは別の焦点位置にピークが生じ得る。例えば、検査画像中にコントラストの高い模様が形成されたシートが映り込んだ場合に、焦点位置F1とは別の焦点位置にピークが生じる。 FIG. 11 is a diagram showing an example of the focus degree waveform. The focus degree waveform of the example shown in FIG. 11 includes two peaks at focus positions F1 and F2. The focus position F1 is the focus position when focusing on the inspection target portion of the work W. Therefore, when the autofocus process is normally performed, the focus degree waveform includes only one peak at the focus position F1. However, for some reason, a peak may occur at a focus position different from the focus position F1. For example, when a sheet on which a high-contrast pattern is formed is reflected in the inspection image, a peak occurs at a focus position different from the focus position F1.
 図11に示す例の合焦度波形が得られた場合、焦点位置F1とは異なる焦点位置F2が合焦位置として誤って判定され、焦点位置F2に調節されたときの画像データが検査画像データとして特定され得る。 When the focus degree waveform of the example shown in FIG. 11 is obtained, the focus position F2 different from the focus position F1 is erroneously determined as the focus position, and the image data when adjusted to the focus position F2 is the inspection image data. Can be specified as
 そこで、評価部26は、検査画像の信頼性評価領域B1から算出した合焦度を第1ピークの合焦度gとして取得する。さらに、評価部26は、合焦度が2番目に大きい第2ピークの合焦度を第2ピークの合焦度hとして取得する。評価部26は、合焦度g,hに基づいて評価値(=g/h)を算出する。 Therefore, the evaluation unit 26 acquires the focus degree calculated from the reliability evaluation area B1 of the inspection image as the focus degree g of the first peak. Furthermore, the evaluation unit 26 acquires the focus degree of the second peak having the second highest focus degree as the focus degree h of the second peak. The evaluation unit 26 calculates an evaluation value (=g/h) based on the focusing degrees g and h.
 なお、上記の例では、ワークWの検査対象箇所に対する合焦の信頼性が高いほど大きくなる評価値が算出される。しかしながら、評価部26は、ワークWの検査対象箇所に対する合焦の信頼性が高いほど小さくなる評価値を算出してもよい。 In the above example, an evaluation value that increases as the reliability of focusing of the inspection target portion of the work W increases. However, the evaluation unit 26 may calculate an evaluation value that becomes smaller as the reliability of focusing of the inspection target portion of the work W becomes higher.
 その他、評価部26は、公知の技術を用いて評価値を算出してもよい。例えば、評価部26は、国際公開第2017/056557号(特許文献2)、特開2010-78681号公報(特許文献3)、特開平10-170817号公報(特許文献4)に記載の技術を用いて評価値を算出してもよい。 In addition, the evaluation unit 26 may calculate the evaluation value using a known technique. For example, the evaluation unit 26 uses the technology described in International Publication No. 2017/056557 (Patent Document 2), JP 2010-78681 A (Patent Document 3), and JP 10-170817 A (Patent Document 4). You may use and calculate an evaluation value.
 <G.総合判定方法>
 上述したように、画像処理装置20の判定部27は、検査結果が予め定められた第1基準を満たし、かつ、評価部26から出力された評価結果が予め定められた第2基準を満たす場合に、ワークWが良品であると判定する。例えば、検査項目が傷の有無である場合、第1基準は、検査結果が「傷なし」であることを示す。検査項目が寸法である場合、第1基準は、寸法の計測値が所定範囲内であることを示す。さらに、ワークWの検査対象箇所に対する合焦の信頼性が高いほど大きくなる評価値が評価結果に含まれる場合、第2基準は、評価値が予め定められた閾値を超えることを示す。
<G. Overall judgment method>
As described above, the determination unit 27 of the image processing apparatus 20 determines that the inspection result satisfies the predetermined first criterion and the evaluation result output from the evaluation unit 26 satisfies the predetermined second criterion. First, it is determined that the work W is a good product. For example, when the inspection item is the presence/absence of scratches, the first standard indicates that the inspection result is “no damage”. When the inspection item is a dimension, the first standard indicates that the measured value of the dimension is within a predetermined range. Furthermore, when the evaluation result includes an evaluation value that increases as the reliability of focusing on the inspection target portion of the work W increases, the second criterion indicates that the evaluation value exceeds a predetermined threshold value.
 第1基準および第2基準は、予め作成され、記憶部230に格納される。判定部27は、記憶部230から第1基準および第2基準を読み出して、総合判定を行なう。 The first standard and the second standard are created in advance and stored in the storage unit 230. The determination unit 27 reads the first criterion and the second criterion from the storage unit 230 and makes a comprehensive determination.
 <H.検査の流れ>
 次に、図12を参照して、本実施の形態に係る検査処理の流れについて説明する。図12は、実施の形態に係る検査システムの検査処理の流れの一例を示すフローチャートである。なお、図12に示す検査方法の前に、画像処理装置20の設定部22は、基準ワークW0を含む画像データを用いて、検査領域A1および信頼性評価領域B1を設定している。
<H. Flow of inspection>
Next, the flow of the inspection process according to the present embodiment will be described with reference to FIG. FIG. 12 is a flowchart showing an example of the flow of the inspection process of the inspection system according to the embodiment. Prior to the inspection method shown in FIG. 12, the setting unit 22 of the image processing apparatus 20 sets the inspection area A1 and the reliability evaluation area B1 using the image data including the reference work W0.
 検査対象となるワークWがステージ90(図1参照)に図示しない搬送装置によって搬送されるたびに、図12に示す検査処理が実行される。なお、本実施の形態では、ワークWは、搬送装置によって、ステージ90上の所定位置に所定姿勢の状態で載置されるものとする。 Each time the workpiece W to be inspected is transported to the stage 90 (see FIG. 1) by a transport device (not shown), the inspection process shown in FIG. 12 is executed. In the present embodiment, the work W is placed on the stage 90 at a predetermined position in a predetermined posture by the transfer device.
 まず、撮像装置10および画像処理装置20は、合焦位置の探索処理を実行する(ステップS1)。ステップS1において、撮像装置10のレンズ制御部16は、レンズモジュール12の焦点位置を探索範囲内で変える。画像処理装置20の算出部23は、焦点位置を変えて生成された複数の画像データの各々について、全領域の合焦度を算出する。画像処理装置20の探索部24は、算出された合焦度がピークとなる焦点位置を合焦位置として探索する。 First, the imaging device 10 and the image processing device 20 execute a focus position search process (step S1). In step S1, the lens control unit 16 of the imaging device 10 changes the focal position of the lens module 12 within the search range. The calculation unit 23 of the image processing apparatus 20 calculates the focus degree of the entire area for each of the plurality of image data generated by changing the focus position. The search unit 24 of the image processing device 20 searches for a focus position at which the calculated focus degree has a peak as the focus position.
 次に、探索部24は、レンズモジュール12の焦点位置が合焦位置に調節されたときの画像データを検査画像データとして特定する(ステップS2)。 Next, the search unit 24 identifies the image data when the focus position of the lens module 12 is adjusted to the in-focus position as inspection image data (step S2).
 次に、画像処理装置20の検査部25は、検査画像データで示される検査画像のうちの検査領域A1に基づいてワークWを検査し、検査結果を出力する(ステップS3)。 Next, the inspection unit 25 of the image processing apparatus 20 inspects the work W based on the inspection area A1 in the inspection image indicated by the inspection image data, and outputs the inspection result (step S3).
 さらに、画像処理装置20の評価部26は、検査画像のうちの信頼性評価領域B1に基づいて、ワークWの検査対象箇所に対する合焦の信頼性を示す評価値を算出し、算出した評価値を含む評価結果を出力する(ステップS4)。なお、ステップS3およびステップS4の処理順序はこれに限定されず、ステップS4の後にステップS3が実行されてもよいし、ステップS3とステップS4とが並行して実行されてもよい。 Further, the evaluation unit 26 of the image processing apparatus 20 calculates an evaluation value indicating the reliability of focus of the work W on the inspection target portion based on the reliability evaluation area B1 in the inspection image, and the calculated evaluation value. The evaluation result including is output (step S4). The processing order of step S3 and step S4 is not limited to this, and step S3 may be executed after step S4, or step S3 and step S4 may be executed in parallel.
 次に、画像処理装置20の判定部27は、検査結果および評価結果に基づいて総合判定を行なう(ステップS5)。その後、出力部28は、判定結果を表示装置50に表示させる(ステップS6)。ステップS6の後、検査処理は終了する。 Next, the determination unit 27 of the image processing apparatus 20 makes a comprehensive determination based on the inspection result and the evaluation result (step S5). After that, the output unit 28 displays the determination result on the display device 50 (step S6). After step S6, the inspection process ends.
 なお、判定結果は、表示装置50以外にもPLC30に出力され、他の装置の制御のために用いられてもよい。例えば、ワークWが良品であることを示す判定結果である場合、図示しない搬送装置は、次工程にワークWを搬送するための搬送経路上にワークWを搬送する。ワークWが不良品であることを示す判定結果である場合、搬送装置は、不良品置き場にワークWを搬送する。精度良く検査できていないことを示す判定結果である場合、搬送装置は、再検査品置き場にワークWを搬送する。 Note that the determination result may be output to the PLC 30 other than the display device 50 and used for controlling other devices. For example, when the determination result indicates that the work W is a non-defective product, the transport device (not shown) transports the work W on the transport path for transporting the work W to the next process. When the determination result indicates that the work W is a defective product, the transport device transports the work W to the defective product storage space. When the determination result indicates that the inspection has not been performed accurately, the transfer device transfers the work W to the re-inspection product storage area.
 §3 変形例
 <変形例1>
 上記の説明では、検査対象となるワークWは、図示しない搬送装置によって、ステージ90上の所定位置に所定姿勢の状態で載置されるものとした。しかしながら、搬送装置の搬送精度が低い場合、検査画像に含まれるワークWの位置姿勢が変動し得る。そこで、変形例1に係る検査システムの画像処理装置は、基準画像中の基準ワークの位置姿勢に対する検査画像中のワークWの位置姿勢の偏差に基づいて、検査画像に対する検査領域A1および信頼性評価領域B1の相対位置姿勢を補正する。これにより、検査画像に含まれるワークWの位置姿勢が変動したとしても、検査精度および信頼性の評価精度の低下を抑制できる。
§3 Modification Example <Modification Example 1>
In the above description, the workpiece W to be inspected is assumed to be placed in a predetermined posture on the stage 90 by a transfer device (not shown). However, when the transport accuracy of the transport device is low, the position and orientation of the work W included in the inspection image may change. Therefore, the image processing device of the inspection system according to the first modification uses the inspection area A1 for the inspection image and the reliability evaluation based on the deviation of the position and orientation of the work W in the inspection image with respect to the position and orientation of the reference work in the reference image. The relative position and orientation of the area B1 is corrected. As a result, even if the position and orientation of the work W included in the inspection image changes, it is possible to suppress deterioration of inspection accuracy and reliability evaluation accuracy.
 図13は、変形例1に係る検査システムを示す模式図である。変形例1に係る検査システム1Aは、図1に示す検査システム1と比較して、画像処理装置20の代わりに画像処理装置20Aを備える点で相違する。画像処理装置20Aは、図1に示す画像処理装置20と比較して、設定部22の代わりに設定部22Aを備えるとともに、さらに補正部29を備える点で相違する。 FIG. 13 is a schematic diagram showing an inspection system according to Modification 1. The inspection system 1A according to Modification 1 is different from the inspection system 1 shown in FIG. 1 in that an image processing apparatus 20A is provided instead of the image processing apparatus 20. The image processing apparatus 20A is different from the image processing apparatus 20 shown in FIG. 1 in that it includes a setting unit 22A instead of the setting unit 22 and further includes a correction unit 29.
 設定部22Aは、上記の設定部22と同様に、基準画像の中から検査領域A1および信頼性評価領域B1を設定する。さらに、設定部22Aは、基準画像の中からモデル領域を設定する、モデル領域は、所定位置に所定姿勢の状態で置かれた基準ワークW0の特徴部分を含む領域である。特徴部分は、基準ワークW0の位置姿勢を特定することが可能な部分である。 Like the setting unit 22 described above, the setting unit 22A sets the inspection area A1 and the reliability evaluation area B1 from the reference image. Further, the setting unit 22A sets a model area from the reference image. The model area is an area including a characteristic portion of the reference work W0 placed in a predetermined posture at a predetermined position. The characteristic portion is a portion capable of specifying the position and orientation of the reference work W0.
 図14は、検査領域、信頼性評価領域およびモデル領域の設定画面の一例を示す図である。図14に示す例では、基準画像80において、平面視矩形状の基準ワークW0の四隅のうち互いに隣り合わない二隅の各々を含む領域がモデル領域C1,C2として設定される。設定部22Aは、設定したモデル領域C1,C2の各々の画像と、基準画像中のモデル領域C1,C2の位置姿勢を示す情報とを記憶部230に格納する。 FIG. 14 is a diagram showing an example of a setting screen for the inspection area, the reliability evaluation area, and the model area. In the example shown in FIG. 14, in the reference image 80, regions including two non-adjacent corners of the four corners of the rectangular reference work W0 in plan view are set as model regions C1 and C2. The setting unit 22A stores in the storage unit 230 each image of the set model regions C1 and C2 and information indicating the position and orientation of the model regions C1 and C2 in the reference image.
 次に図15を参照して、補正部29の処理について説明する。図15は、補正部の処理を説明する図である。 Next, the processing of the correction unit 29 will be described with reference to FIG. FIG. 15 is a diagram illustrating the processing of the correction unit.
 補正部29は、公知のテンプレートマッチング方法を用いて、基準画像80のうちのモデル領域C1,C2の画像と同じ部分画像を検査画像81から探索する。補正部29は、モデル領域C1,C2の画像を第1、第2テンプレート画像として記憶部230からそれぞれ読み出す。補正部29は、モデル領域C1に対応する第1テンプレート画像と同じパターンの第1部分画像D1を検査画像81から探索するとともに、モデル領域C2に対応する第2テンプレート画像と同じパターンの第2部分画像D2を検査画像81から探索する。 The correction unit 29 searches the inspection image 81 for the same partial image as the images of the model regions C1 and C2 in the reference image 80 using a known template matching method. The correction unit 29 reads the images of the model areas C1 and C2 as the first and second template images from the storage unit 230, respectively. The correction unit 29 searches the inspection image 81 for the first partial image D1 having the same pattern as the first template image corresponding to the model region C1, and at the same time, the second portion having the same pattern as the second template image corresponding to the model region C2. The image D2 is searched from the inspection image 81.
 具体的には、補正部29は、第1テンプレート画像の位置姿勢を変化させながら、第1テンプレート画像と検査画像81との相関演算を行ない、相関値で示される類似度が最も高い第1テンプレート画像の位置姿勢を探索する。そして、補正部29は、探索された位置姿勢の第1テンプレート画像と重なる領域の画像を第1部分画像D1として特定する。同様に方法により、補正部29は、相関値で示される類似度が最も高い位置姿勢の第2テンプレート画像と重なる領域の画像を第2部分画像D2として特定する。 Specifically, the correction unit 29 performs the correlation calculation between the first template image and the inspection image 81 while changing the position and orientation of the first template image, and the first template having the highest degree of similarity indicated by the correlation value. Search the position and orientation of the image. Then, the correction unit 29 specifies the image of the region overlapping the first template image of the searched position and orientation as the first partial image D1. Similarly, by the method, the correction unit 29 identifies the image of the region overlapping the second template image of the position and orientation having the highest degree of similarity indicated by the correlation value as the second partial image D2.
 相関値としては、公知のSSD(Sum of Squared Difference)、SAD(Sum of Absolute Difference)、NCC(Normalized Cross-Correlation)などを用いることができる。なお、相関値としてSSDまたはSADを用いる場合には、補正部29は、相関値が最小となるテンプレート画像の位置姿勢を探索すればよい。相関値としてNCCを用いる場合には、補正部29は、相関値が1に最も近いテンプレート画像の位置姿勢を探索すればよい。 As the correlation value, known SSD (Sum of Squared Difference), SAD (Sum of Absolute Difference), NCC (Normalized Cross-Correlation), etc. can be used. When SSD or SAD is used as the correlation value, the correction unit 29 may search for the position and orientation of the template image having the minimum correlation value. When NCC is used as the correlation value, the correction unit 29 may search the position and orientation of the template image whose correlation value is closest to 1.
 補正部29は、探索した部分画像D1,D2の位置姿勢と、モデル領域C1,C2の位置姿勢とをそれぞれ比較することにより、基準画像80中の基準ワークW0の位置姿勢(以下、「基準位置姿勢」という)に対する検査画像81中のワークWの位置姿勢の偏差を求める(算出する)。偏差は、X方向、Y方向および回転方向(θ方向)のそれぞれのずれ量ΔX,ΔYおよびΔθを示す。 The correction unit 29 compares the position and orientation of the searched partial images D1 and D2 with the position and orientation of the model areas C1 and C2, respectively, to determine the position and orientation of the reference work W0 in the reference image 80 (hereinafter, referred to as “reference position”). The deviation of the position/orientation of the work W in the inspection image 81 with respect to the “orientation” is calculated (calculated). The deviations indicate deviation amounts ΔX, ΔY, and Δθ in the X direction, the Y direction, and the rotation direction (θ direction), respectively.
 補正部29は、算出された偏差に基づいて、検査画像81に対する検査領域A1および信頼性評価領域B1の相対位置姿勢を補正する。すなわち、補正部29は、算出された偏差分だけ、検査領域A1および信頼性評価領域B1の位置姿勢を補正する。具体的には、補正部29は、検査画像81を固定にした状態で、検査領域A1および信頼性評価領域B1を、X方向にΔXだけ並進移動させ、Y方向にΔYだけ並進移動させ、Δθだけ回転移動させる。 The correction unit 29 corrects the relative position and orientation of the inspection area A1 and the reliability evaluation area B1 with respect to the inspection image 81 based on the calculated deviation. That is, the correction unit 29 corrects the position and orientation of the inspection area A1 and the reliability evaluation area B1 by the calculated deviation. Specifically, the correction unit 29 translates the inspection area A1 and the reliability evaluation area B1 by ΔX in the X direction and ΔY in the Y direction with the inspection image 81 fixed, and Δθ. Only rotate and move.
 なお、補正部29は、検査領域A1および信頼性評価領域B1を固定にしたまま、検査画像81の位置姿勢を補正してもよい。この場合、補正部29は、上記の検査領域A1および信頼性評価領域B1の位置姿勢の変換とは逆の変換を、検査画像81の位置姿勢に対して行なえばよい。 The correction unit 29 may correct the position and orientation of the inspection image 81 while fixing the inspection area A1 and the reliability evaluation area B1. In this case, the correction unit 29 may perform the reverse conversion of the position and orientation of the inspection area A1 and the reliability evaluation area B1 on the position and orientation of the inspection image 81.
 図16は、変形例1に係る検査システムの検査処理の流れを示すフローチャートである。図16に示すフローチャートは、図12に示すフローチャートと比較して、ステップS11,S12をさらに含む点で異なる。 FIG. 16 is a flowchart showing the flow of the inspection process of the inspection system according to the first modification. The flowchart shown in FIG. 16 differs from the flowchart shown in FIG. 12 in that it further includes steps S11 and S12.
 撮像装置10から検査画像データを取得すると(ステップS2)、ステップS11において、画像処理装置20Aの補正部29は、基準位置姿勢に対する検査画像81中のワークWの位置姿勢の偏差を算出する。 When the inspection image data is acquired from the imaging device 10 (step S2), the correction unit 29 of the image processing device 20A calculates the deviation of the position and orientation of the work W in the inspection image 81 from the reference position and orientation in step S11.
 次に、ステップS12において、補正部29は、算出した偏差に基づいて、検査画像81に対する検査領域A1および信頼性評価領域B1の相対位置姿勢を補正する。その後、補正された検査領域A1を用いてワークWの検査が実行され(ステップS3)、補正された信頼性評価領域B1を用いて信頼性の評価が実行される(ステップS4)。 Next, in step S12, the correction unit 29 corrects the relative position and orientation of the inspection area A1 and the reliability evaluation area B1 with respect to the inspection image 81 based on the calculated deviation. Then, the inspection of the workpiece W is executed using the corrected inspection area A1 (step S3), and the reliability evaluation is executed using the corrected reliability evaluation area B1 (step S4).
 なお、上記の説明では、モデル領域C1,C2と信頼性評価領域B1とが別個に設定されるものとした。しかしながら、信頼性評価領域B1と同じ領域がモデル領域として設定されてもよい。すなわち、信頼性評価領域B1は、モデル領域として共用されてもよい。 In the above description, the model areas C1 and C2 and the reliability evaluation area B1 are set separately. However, the same area as the reliability evaluation area B1 may be set as the model area. That is, the reliability evaluation area B1 may be shared as a model area.
 <変形例2>
 変形例2に係る検査システムは、変形例1に係る検査システムのさらなる変形例である。変形例2に係る検査システムでは、判定部27は、以下のような処理を行なう。
<Modification 2>
The inspection system according to Modification 2 is a further modification of the inspection system according to Modification 1. In the inspection system according to Modification 2, the determination unit 27 performs the following processing.
 判定部27は、検査結果が第1基準を満たし、かつ、評価結果が第2基準を満たし、かる、補正部29によって算出された相関値が予め定められた第3基準を満たす場合に、ワークWが良品であると判定する。判定部27は、補正部29によって算出された相関値が第3基準を満たさない場合に、ワークWを正常に撮像できていないと判定する。 When the inspection result satisfies the first criterion, the evaluation result satisfies the second criterion, and the correlation value calculated by the correcting unit 29 satisfies the predetermined third criterion, the determination unit 27 determines that the workpiece It is determined that W is a good product. When the correlation value calculated by the correction unit 29 does not satisfy the third criterion, the determination unit 27 determines that the work W is not normally imaged.
 補正部29によって算出される相関値は、モデル領域C1,C2のテンプレート画像と、検査画像中から探索された部分画像D1,D2との類似度を示す。相関値で示される類似度が低い場合には、何らかの原因により検査対象となるワークWを正常に撮像できていない可能性が高い。例えば、ステージ90上においてワークWの位置が所定位置から大きくずれているために、画像内にワークWが収まっていない場合である。 The correlation value calculated by the correction unit 29 indicates the degree of similarity between the template images of the model areas C1 and C2 and the partial images D1 and D2 searched from the inspection image. When the degree of similarity indicated by the correlation value is low, there is a high possibility that the work W to be inspected cannot be normally imaged for some reason. For example, the position of the work W on the stage 90 is largely deviated from the predetermined position, so that the work W is not included in the image.
 第3基準は、例えば、モデル領域C1,C2のテンプレート画像と部分画像D1,D2との相関値で示される類似度が予め定められた類似度よりも高いという基準である。例えば、類似度が高いほど相関値が小さい場合、第3基準は、相関値が予め定められた閾値を下回ることを示す。 The third criterion is, for example, a criterion that the degree of similarity indicated by the correlation value between the template images of the model areas C1 and C2 and the partial images D1 and D2 is higher than a predetermined degree of similarity. For example, when the higher the degree of similarity is, the smaller the correlation value is, the third criterion indicates that the correlation value is lower than a predetermined threshold value.
 変形例2によれば、ワークWを正常に撮像できていないにもかかわらず、不良のワークWを良品として見逃すリスクをさらに低減することができる。 According to the second modification, it is possible to further reduce the risk of overlooking a defective work W as a non-defective product even though the work W is not normally imaged.
 <変形例3>
 変形例3に係る検査システムは、変形例1に係る検査システムのさらなる変形例である。変形例3に係る検査システムでは、補正部29によって補正された信頼性評価領域B1を用いてオートフォーカス処理が実行される。
<Modification 3>
The inspection system according to Modification 3 is a further modification of the inspection system according to Modification 1. In the inspection system according to Modification 3, the autofocus process is executed using the reliability evaluation area B1 corrected by the correction unit 29.
 図17は、変形例3に係る検査システムの検査処理の流れを示すフローチャートである。図17に示すフローチャートは、図16に示すフローチャートと比較して、ステップS2,S11およびS12の代わりにステップS21~S23を含み、さらにステップS24,S25をさらに含む点で異なる。 FIG. 17 is a flowchart showing the flow of the inspection process of the inspection system according to the modified example 3. The flowchart shown in FIG. 17 differs from the flowchart shown in FIG. 16 in that it includes steps S21 to S23 instead of steps S2, S11 and S12, and further includes steps S24 and S25.
 ステップS1の後、画像処理装置20の探索部24は、ステップS21において、レンズモジュール12の焦点位置が合焦位置に調節されたときの画像データを補正用画像データとして特定する。 After step S1, the search unit 24 of the image processing apparatus 20 identifies the image data when the focus position of the lens module 12 is adjusted to the in-focus position as the correction image data in step S21.
 次に、補正部29は、基準位置姿勢に対する、補正用画像データで示される補正用画像中のワークWの位置姿勢の偏差を算出する(ステップS22)。補正部29は、算出した偏差に基づいて、補正用画像に対する検査領域A1および信頼性評価領域B1の相対位置姿勢を補正する(ステップS23)。具体的には、補正部29は、変形例1と同様に、補正用画像を固定にしたまま、検査領域A1および信頼性評価領域B1の位置姿勢を補正する。もしくは、補正部29は、検査領域A1および信頼性評価領域B1を固定にしたまま、補正用画像の位置姿勢を補正してもよい。 Next, the correction unit 29 calculates the deviation of the position and orientation of the work W in the correction image indicated by the correction image data from the reference position and orientation (step S22). The correction unit 29 corrects the relative position and orientation of the inspection area A1 and the reliability evaluation area B1 with respect to the correction image based on the calculated deviation (step S23). Specifically, the correction unit 29 corrects the position and orientation of the inspection area A1 and the reliability evaluation area B1 with the correction image fixed, as in the first modification. Alternatively, the correction unit 29 may correct the position and orientation of the correction image while the inspection area A1 and the reliability evaluation area B1 are fixed.
 次に、画像処理装置20は、補正された信頼性評価領域B1に基づいて、合焦位置の探索処理を実行する(ステップS24)。具体的には、算出部23は、複数の画像データの各々の信頼性評価領域B1の合焦度を算出する。探索部24は、算出された合焦度がピークとなる焦点位置を合焦位置として決定する。 Next, the image processing device 20 executes a focus position search process based on the corrected reliability evaluation area B1 (step S24). Specifically, the calculation unit 23 calculates the degree of focus of the reliability evaluation area B1 of each of the plurality of image data. The search unit 24 determines the focus position where the calculated focus degree is the peak, as the focus position.
 次に、探索部24は、探索された合焦位置のときに生成された画像データを検査画像データとして特定する(ステップS25)。その後、検査画像データで示される検査画像のうちの、補正された検査領域A1を用いてワークWの検査が実行され(ステップS3)、補正された信頼性評価領域B1を用いて信頼性の評価が実行される(ステップS4)。 Next, the search unit 24 identifies the image data generated at the searched in-focus position as inspection image data (step S25). After that, the inspection of the work W is executed using the corrected inspection area A1 in the inspection image indicated by the inspection image data (step S3), and the reliability is evaluated using the corrected reliability evaluation area B1. Is executed (step S4).
 変形例3によれば、補正された信頼性評価領域B1に基づいて合焦位置の探索処理が再度実行され、検査画像データが生成される。そのため、検査対象箇所に合焦した検査画像データを得やすくなる。 According to the third modification, the in-focus position searching process is executed again based on the corrected reliability evaluation area B1, and the inspection image data is generated. Therefore, it becomes easy to obtain the inspection image data focused on the inspection target portion.
 <その他の変形例>
 上記の説明では、出力部28は、判定部27による判定結果を出力する。しかしながら、検査システムが判定部27を備えておらず、出力部28は、検査部25による検査結果と、評価部26による評価結果とを出力してもよい。これによっても、作業者は、評価結果を確認することにより、焦点位置の調節に何らかの問題があり、精度良く検査できていないことが認識できる。その結果、ワークWの検査対象箇所とは異なる箇所に合焦した画像に基づく検査によって、不良のワークWを良品として見逃すリスクを低減できる。
<Other modifications>
In the above description, the output unit 28 outputs the determination result by the determination unit 27. However, the inspection system may not include the determination unit 27, and the output unit 28 may output the inspection result by the inspection unit 25 and the evaluation result by the evaluation unit 26. Also by this, the operator can recognize that there is some problem in the adjustment of the focal position and the inspection cannot be performed accurately by confirming the evaluation result. As a result, it is possible to reduce the risk of overlooking a defective work W as a non-defective product by an inspection based on an image focused on a position different from the inspection target part of the work W.
 上記の説明では、探索部24は、レンズモジュール12の焦点位置を変えて生成された複数の画像データに基づいて、ワークWに合焦する合焦位置を探索する。しかしながら、撮像装置10がワークWとの距離を計測する測距センサを備え、探索部24は、測距センサの計測結果に基づいて、合焦位置を探索してもよい。測距センサは、例えば、赤外線または超音波をワークWに向けて発してから、ワークWで反射して戻ってくるまでの時間に基づいて、レンズモジュール12からワークWまでの距離a(図3参照)を計測する。探索部24は、計測された距離aが上記の式(1)を満たす焦点位置Fを合焦位置として決定すればよい。ただし、この場合、測距センサが必要となるため、撮像装置10の部品点数が多くなる。撮像装置10の部品点数の増大を抑制するためには、探索部24は、レンズモジュール12の焦点位置を変えて生成された複数の画像データに基づいて、合焦位置を探索することが好ましい。 In the above description, the search unit 24 searches for the in-focus position where the work W is in focus, based on a plurality of image data generated by changing the focal position of the lens module 12. However, the imaging device 10 may include a distance measuring sensor that measures the distance to the work W, and the search unit 24 may search for the in-focus position based on the measurement result of the distance measuring sensor. The distance-measuring sensor, for example, emits infrared rays or ultrasonic waves toward the work W, and then is reflected by the work W and returned to the work W based on the distance a from the lens module 12 to the work W (see FIG. 3). Measurement). The search unit 24 may determine the focus position F where the measured distance a satisfies the above expression (1) as the focus position. However, in this case, since a distance measuring sensor is required, the number of parts of the imaging device 10 increases. In order to suppress an increase in the number of components of the image pickup apparatus 10, it is preferable that the search unit 24 search for a focus position based on a plurality of image data generated by changing the focus position of the lens module 12.
 上記の説明では、撮像装置10は、焦点位置を変えて複数の画像データを出力する。そして、画像処理装置20は、複数の焦点位置からワークWの検査対象箇所に合焦する合焦位置を探索する。しかしながら、撮像装置10のレンズ制御部16は、ワークWの種類や検査対象箇所に応じて予め定められた固定位置となるようにレンズモジュール12の焦点位置を制御してもよい。すなわち、フォーカス調節部12eは、予め定められた固定位置にレンズモジュール12の焦点位置を調節する。この場合、画像処理装置20は、探索部24を備えていなくてもよい。 In the above description, the imaging device 10 changes the focus position and outputs a plurality of image data. Then, the image processing device 20 searches for a focus position at which the inspection target portion of the work W is focused from the plurality of focus positions. However, the lens control unit 16 of the imaging device 10 may control the focal position of the lens module 12 so as to be a fixed position that is predetermined according to the type of the work W and the inspection target location. That is, the focus adjustment unit 12e adjusts the focus position of the lens module 12 to a predetermined fixed position. In this case, the image processing device 20 does not have to include the search unit 24.
 レンズモジュール12の焦点位置が予め定められた固定位置に調節されたとしても、ワークWのサイズの個体差、あるいは、ワークWを搬送する搬送装置の状態に応じて、撮像装置10とワークWの検査対象箇所との距離が変動する。そのため、ワークWの検査対象箇所に合焦した検査画像を常に得られるとは限らない。このような場合に、画像処理装置20が上記の評価部26を備えることにより、焦点位置がずれていることに起因して精度良く検査できていないことが認識可能となる。 Even if the focal position of the lens module 12 is adjusted to a predetermined fixed position, the imaging device 10 and the work W may be different depending on the individual difference in the size of the work W or the state of the carrying device that carries the work W. The distance from the inspection target varies. Therefore, it is not always possible to always obtain an inspection image focused on the inspection target portion of the work W. In such a case, it is possible to recognize that the image processing apparatus 20 includes the above-described evaluation unit 26, and that the inspection cannot be performed accurately due to the shift of the focus position.
 §4 付記
 以上のように、実施の形態および変形例は以下のような開示を含む。
§4 Appendix As described above, the embodiments and modifications include the following disclosures.
 (構成1)
 焦点位置が可変である光学系(12)と、
 前記光学系(12)を介して対象物(W)からの光を受けることによって画像を生成する撮像素子(13)と、
 前記焦点位置を調節するフォーカス調節部(12e)と、
 前記フォーカス調節部(12e)によって前記焦点位置が調節されたときに生成された検査画像のうちの第1領域に基づいて前記対象物(W)を検査し、検査結果を出力する検査部(25,210)と、
 前記検査画像のうちの第2領域に基づいて、前記対象物の検査対象箇所に対する合焦の信頼性を評価し、評価結果を出力する評価部(26,210)とを備える、検査システム(1,1A)。
(Structure 1)
An optical system (12) whose focal position is variable,
An image sensor (13) that generates an image by receiving light from an object (W) through the optical system (12);
A focus adjustment unit (12e) for adjusting the focus position,
An inspection unit (25) that inspects the object (W) based on the first region of the inspection image generated when the focus position is adjusted by the focus adjustment unit (12e) and outputs the inspection result. , 210),
An inspection system (1), comprising: an evaluation unit (26, 210) that evaluates the reliability of focusing of the object with respect to the inspection object location based on the second region of the inspection image and outputs the evaluation result. , 1A).
 (構成2)
 予め生成された基準画像中の前記対象物(W)の位置姿勢に対する前記検査画像中の前記対象物(W)の位置姿勢の偏差に基づいて、前記検査画像に対する前記第1領域および前記第2領域の相対位置姿勢を補正する補正部(29,210)をさらに備える、構成1に記載の検査システム(1A)。
(Structure 2)
Based on the deviation of the position and orientation of the object (W) in the inspection image with respect to the position and orientation of the object (W) in the reference image generated in advance, the first region and the second region with respect to the inspection image. The inspection system (1A) according to configuration 1, further comprising a correction unit (29, 210) that corrects the relative position and orientation of the region.
 (構成3)
 前記検査結果が予め定められた第1基準を満たし、かつ、前記評価結果が予め定められた第2基準を満たす場合に、前記対象物が良品であると判定する判定部(27,210)をさらに備える、構成1または2に記載の検査システム(1,1A)。
(Structure 3)
A determination unit (27, 210) that determines that the object is a good product when the inspection result satisfies a predetermined first standard and the evaluation result satisfies a predetermined second standard. The inspection system (1, 1A) according to Configuration 1 or 2 further provided.
 (構成4)
 前記補正部(29,210)は、前記基準画像と前記検査画像との相関演算により得られる相関値に基づいて前記偏差を求め、
 前記検査システム(1A)は、さらに、
 前記検査結果が予め定められた第1基準を満たし、かつ、前記評価結果が予め定められた第2基準を満たし、かつ、前記相関値が予め定められた第3基準を満たす場合に、前記対象物が良品であると判定する判定部(27,210)をさらに備える、構成2に記載の検査システム(1A)。
(Structure 4)
The correction unit (29, 210) obtains the deviation based on a correlation value obtained by a correlation calculation between the reference image and the inspection image,
The inspection system (1A) further includes
When the inspection result satisfies a predetermined first criterion, the evaluation result satisfies a predetermined second criterion, and the correlation value satisfies a predetermined third criterion, the target The inspection system (1A) according to the configuration 2, further including a determination unit (27, 210) that determines that the product is non-defective.
 (構成5)
 前記評価結果は、前記検査画像のうちの前記第2領域における合焦度に基づいて算出される評価値を含む、構成1から4のいずれかに記載の検査システム(1,1A)。
(Structure 5)
The inspection system (1, 1A) according to any one of configurations 1 to 4, wherein the evaluation result includes an evaluation value calculated based on a focus degree in the second region of the inspection image.
 (構成6)
 前記対象物(W)に合焦する前記焦点位置である合焦位置を探索する探索部(24)をさらに備え、
 前記検査画像は、前記フォーカス調節部(12e)によって前記焦点位置が前記合焦位置に調節されたときに生成される、構成1から5のいずれかに記載の検査システム(1,1A)。
(Structure 6)
A search unit (24) for searching a focus position which is the focus position focused on the object (W),
The inspection system (1, 1A) according to any one of configurations 1 to 5, wherein the inspection image is generated when the focus position is adjusted to the in-focus position by the focus adjustment unit (12e).
 (構成7)
 焦点位置が可変である光学系(12)と、
 前記光学系(12)を介して対象物(W)からの光を受けることによって画像を生成する撮像素子(13)と、
 前記焦点位置を調節するフォーカス調節部(12e)とを備えた検査システムにおける検査方法であって、
 前記フォーカス調節部(12e)によって前記焦点位置が調節されたときに生成された検査画像のうちの第1領域に基づいて前記対象物(W)を検査し、検査結果を出力するステップと、
 前記検査画像のうちの第2領域に基づいて、前記対象物の検査対象箇所に対する合焦の信頼性を評価し、評価結果を出力するステップとを備える、検査方法。
(Structure 7)
An optical system (12) whose focal position is variable,
An image sensor (13) that generates an image by receiving light from an object (W) through the optical system (12);
An inspection method in an inspection system including a focus adjustment unit (12e) for adjusting the focus position,
Inspecting the object (W) based on a first region of an inspection image generated when the focus position is adjusted by the focus adjusting unit (12e), and outputting an inspection result,
Based on a second region of the inspection image, evaluating the reliability of focusing of the object with respect to the inspection target portion, and outputting the evaluation result.
 (構成8)
 焦点位置が可変である光学系(12)と、
 前記光学系(12)を介して対象物(W)からの光を受けることによって画像を生成する撮像素子(13)と、
 前記焦点位置を調節するフォーカス調節部(12e)とを備えた検査システムにおける検査方法をコンピュータに実行させるためのプログラムであって、
 前記検査方法は、
 前記フォーカス調節部(12e)によって前記焦点位置が調節されたときに生成された検査画像のうちの第1領域に基づいて前記対象物(W)を検査し、検査結果を出力するステップと、
 前記検査画像のうちの第2領域に基づいて、前記対象物の検査対象箇所に対する合焦の信頼性を評価し、評価結果を出力するステップとを備える、プログラム。
(Structure 8)
An optical system (12) whose focal position is variable,
An image sensor (13) that generates an image by receiving light from an object (W) through the optical system (12);
A program for causing a computer to execute an inspection method in an inspection system including a focus adjustment unit (12e) for adjusting the focus position,
The inspection method is
Inspecting the object (W) based on a first region of an inspection image generated when the focus position is adjusted by the focus adjusting unit (12e), and outputting an inspection result,
A step of evaluating the reliability of focusing of the object with respect to the inspection target portion based on the second region of the inspection image, and outputting the evaluation result.
 本発明の実施の形態について説明したが、今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は請求の範囲によって示され、請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。 Although the embodiments of the present invention have been described, the embodiments disclosed this time are to be considered as illustrative in all points and not restrictive. The scope of the present invention is shown by the claims, and is intended to include meanings equivalent to the claims and all modifications within the scope.
 1,1A 検査システム、10 撮像装置、11 照明部、12 レンズモジュール、12a,12c レンズ、12b レンズ群、12d 可動部、12e1,12e2 電圧源、12e フォーカス調節部、13 撮像素子、13a 撮像面、14 撮像素子制御部、15,17 レジスタ、16 レンズ制御部、18 通信I/F部、20,20A 画像処理装置、21 指令生成部、22,22A 設定部、23 算出部、24 探索部、25 検査部、26 評価部、27 判定部、28 出力部、29 補正部、30 PLC、40 入力装置、50 表示装置、70 透光性容器、71 導電性液体、72 絶縁性液体、73a,73b,74a,74b 電極、75a,75b 絶縁体、76a,76b 絶縁層、80 基準画像、81 検査画像、90 ステージ、206 メモリカード、216 カメラインターフェース、216a 画像バッファ、218 入力インターフェース、220 表示コントローラ、222 PLCインターフェース、224 通信インターフェース、226 データリーダ/ライタ、228 バス、230 記憶部、232 メインメモリ、234 ハードディスク、236 制御プログラム、A1 検査領域、B1 信頼性評価領域、C1,C2 モデル領域、D1 第1部分画像、D2 第2部分画像、W ワーク、W0 基準ワーク。 1, 1A inspection system, 10 imaging device, 11 illumination unit, 12 lens module, 12a, 12c lens, 12b lens group, 12d movable part, 12e1 and 12e2 voltage source, 12e focus adjustment unit, 13 imaging device, 13a imaging surface, 14 image sensor control unit, 15, 17 register, 16 lens control unit, 18 communication I/F unit, 20, 20A image processing device, 21 command generation unit, 22, 22A setting unit, 23 calculation unit, 24 search unit, 25 Inspection unit, 26 evaluation unit, 27 judgment unit, 28 output unit, 29 correction unit, 30 PLC, 40 input device, 50 display device, 70 translucent container, 71 conductive liquid, 72 insulating liquid, 73a, 73b, 74a, 74b electrode, 75a, 75b insulator, 76a, 76b insulating layer, 80 reference image, 81 inspection image, 90 stage, 206 memory card, 216 camera interface, 216a image buffer, 218 input interface, 220 display controller, 222 PLC Interface, 224 communication interface, 226 data reader/writer, 228 bus, 230 storage unit, 232 main memory, 234 hard disk, 236 control program, A1 inspection area, B1 reliability evaluation area, C1, C2 model area, D1 first part Image, D2 second partial image, W work, W0 reference work.

Claims (8)

  1.  焦点位置が可変である光学系と、
     前記光学系を介して対象物からの光を受けることによって画像を生成する撮像素子と、
     前記焦点位置を調節するフォーカス調節部と、
     前記フォーカス調節部によって前記焦点位置が調節されたときに生成された検査画像のうちの第1領域に基づいて前記対象物を検査し、検査結果を出力する検査部と、
     前記検査画像のうちの第2領域に基づいて、前記対象物の検査対象箇所に対する合焦の信頼性を評価し、評価結果を出力する評価部とを備える、検査システム。
    An optical system whose focal position is variable,
    An image sensor that generates an image by receiving light from an object through the optical system,
    A focus adjustment unit for adjusting the focus position,
    An inspection unit that inspects the object based on a first region of an inspection image generated when the focus position is adjusted by the focus adjustment unit and outputs an inspection result;
    An inspection system comprising: an evaluation unit that evaluates the reliability of focus of the object with respect to the inspection target location based on the second region of the inspection image and outputs the evaluation result.
  2.  予め生成された基準画像中の前記対象物の位置姿勢に対する前記検査画像中の前記対象物の位置姿勢の偏差に基づいて、前記検査画像に対する前記第1領域および前記第2領域の相対位置姿勢を補正する補正部をさらに備える、請求項1に記載の検査システム。 Based on the deviation of the position and orientation of the object in the inspection image with respect to the position and orientation of the object in the reference image generated in advance, the relative position and orientation of the first region and the second region with respect to the inspection image The inspection system according to claim 1, further comprising a correction unit that corrects.
  3.  前記検査結果が予め定められた第1基準を満たし、かつ、前記評価結果が予め定められた第2基準を満たす場合に、前記対象物が良品であると判定する判定部をさらに備える、請求項1または2に記載の検査システム。 The determination unit that determines that the object is a non-defective product when the inspection result satisfies a predetermined first standard and the evaluation result satisfies a predetermined second standard, The inspection system according to 1 or 2.
  4.  前記補正部は、前記基準画像と前記検査画像との相関演算により得られる相関値に基づいて前記偏差を求め、
     前記検査システムは、さらに、
     前記検査結果が予め定められた第1基準を満たし、かつ、前記評価結果が予め定められた第2基準を満たし、かつ、前記相関値が予め定められた第3基準を満たす場合に、前記対象物が良品であると判定する判定部をさらに備える、請求項2に記載の検査システム。
    The correction unit obtains the deviation based on a correlation value obtained by a correlation calculation between the reference image and the inspection image,
    The inspection system further comprises
    When the inspection result satisfies a predetermined first criterion, the evaluation result satisfies a predetermined second criterion, and the correlation value satisfies a predetermined third criterion, the target The inspection system according to claim 2, further comprising a determination unit that determines that the product is non-defective.
  5.  前記評価結果は、前記検査画像のうちの前記第2領域における合焦度に基づいて算出される評価値を含む、請求項1から4のいずれか1項に記載の検査システム。 The inspection system according to any one of claims 1 to 4, wherein the evaluation result includes an evaluation value calculated based on a focus degree in the second area of the inspection image.
  6.  前記対象物に合焦する前記焦点位置である合焦位置を探索する探索部をさらに備え、
     前記検査画像は、前記フォーカス調節部によって前記焦点位置が前記合焦位置に調節されたときに生成される、請求項1から5のいずれか1項に記載の検査システム。
    Further comprising a search unit that searches for a focus position that is the focus position that focuses on the object,
    The inspection system according to claim 1, wherein the inspection image is generated when the focus position is adjusted to the in-focus position by the focus adjustment unit.
  7.  焦点位置が可変である光学系と、
     前記光学系を介して対象物からの光を受けることによって画像を生成する撮像素子と、
     前記焦点位置を調節するフォーカス調節部とを備えた検査システムにおける検査方法であって、
     前記フォーカス調節部によって前記焦点位置が調節されたときに生成された検査画像のうちの第1領域に基づいて前記対象物を検査し、検査結果を出力するステップと、
     前記検査画像のうちの第2領域に基づいて、前記対象物の検査対象箇所に対する合焦の信頼性を評価し、評価結果を出力するステップとを備える、検査方法。
    An optical system whose focal position is variable,
    An image sensor that generates an image by receiving light from an object through the optical system,
    An inspection method in an inspection system including a focus adjustment unit for adjusting the focal position,
    Inspecting the object based on a first region in an inspection image generated when the focus position is adjusted by the focus adjusting unit, and outputting an inspection result,
    Based on a second region of the inspection image, evaluating the reliability of focusing of the object with respect to the inspection target portion, and outputting the evaluation result.
  8.  焦点位置が可変である光学系と、
     前記光学系を介して対象物からの光を受けることによって画像を生成する撮像素子と、
     前記焦点位置を調節するフォーカス調節部とを備えた検査システムにおける検査方法をコンピュータに実行させるためのプログラムであって、
     前記検査方法は、
     前記フォーカス調節部によって前記焦点位置が調節されたときに生成された検査画像のうちの第1領域に基づいて前記対象物を検査し、検査結果を出力するステップと、
     前記検査画像のうちの第2領域に基づいて、前記対象物の検査対象箇所に対する合焦の信頼性を評価し、評価結果を出力するステップとを備える、プログラム。
    An optical system whose focal position is variable,
    An image sensor that generates an image by receiving light from an object through the optical system,
    A program for causing a computer to execute an inspection method in an inspection system including a focus adjustment unit that adjusts the focus position,
    The inspection method is
    Inspecting the object based on a first region in an inspection image generated when the focus position is adjusted by the focus adjusting unit, and outputting an inspection result,
    A step of evaluating the reliability of focusing of the object with respect to the inspection target portion based on the second region of the inspection image, and outputting the evaluation result.
PCT/JP2019/044387 2018-11-27 2019-11-12 Inspection system, inspection method, and program WO2020110711A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2018221070A JP7047725B2 (en) 2018-11-27 2018-11-27 Inspection system, inspection method and program
JP2018-221070 2018-11-27

Publications (1)

Publication Number Publication Date
WO2020110711A1 true WO2020110711A1 (en) 2020-06-04

Family

ID=70852386

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2019/044387 WO2020110711A1 (en) 2018-11-27 2019-11-12 Inspection system, inspection method, and program

Country Status (2)

Country Link
JP (1) JP7047725B2 (en)
WO (1) WO2020110711A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023210313A1 (en) * 2022-04-28 2023-11-02 パナソニックIpマネジメント株式会社 Measurement method, measurement system, and information processing method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07306009A (en) * 1994-05-10 1995-11-21 Casio Comput Co Ltd Method for matching position of transparent substrate
JP2000180380A (en) * 1998-12-11 2000-06-30 Ckd Corp Visual inspection apparatus and visual inspection apparatus for ptp sheet and ptp-wrapping machine
JP2004038884A (en) * 2002-07-08 2004-02-05 Adoin Kenkyusho:Kk Image distortion correction method, image distortion correction device and image distortion correction program based on representative point measurement
JP2012202714A (en) * 2011-03-23 2012-10-22 Bridgestone Corp Tool for appearance inspection of transparent sheet material and appearance inspection method for transparent sheet material using the same
WO2012144025A1 (en) * 2011-04-20 2012-10-26 株式会社メガトレード Automatic inspection device and alignment method for automatic inspection device
JP2017107201A (en) * 2015-12-09 2017-06-15 由田新技股▲ふん▼有限公司 Dynamic autofocus system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5593750B2 (en) 2010-03-12 2014-09-24 オムロン株式会社 Image processing method and image processing apparatus
US9456120B2 (en) 2013-07-11 2016-09-27 Mitutoyo Corporation Focus height repeatability improvement in a machine vision inspection system
JP2018087860A (en) 2016-11-28 2018-06-07 オリンパス株式会社 Imaging device and control method for imaging device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07306009A (en) * 1994-05-10 1995-11-21 Casio Comput Co Ltd Method for matching position of transparent substrate
JP2000180380A (en) * 1998-12-11 2000-06-30 Ckd Corp Visual inspection apparatus and visual inspection apparatus for ptp sheet and ptp-wrapping machine
JP2004038884A (en) * 2002-07-08 2004-02-05 Adoin Kenkyusho:Kk Image distortion correction method, image distortion correction device and image distortion correction program based on representative point measurement
JP2012202714A (en) * 2011-03-23 2012-10-22 Bridgestone Corp Tool for appearance inspection of transparent sheet material and appearance inspection method for transparent sheet material using the same
WO2012144025A1 (en) * 2011-04-20 2012-10-26 株式会社メガトレード Automatic inspection device and alignment method for automatic inspection device
JP2017107201A (en) * 2015-12-09 2017-06-15 由田新技股▲ふん▼有限公司 Dynamic autofocus system

Also Published As

Publication number Publication date
JP2020085678A (en) 2020-06-04
JP7047725B2 (en) 2022-04-05

Similar Documents

Publication Publication Date Title
US8711275B2 (en) Estimating optical characteristics of a camera component using sharpness sweep data
KR101207198B1 (en) Board inspection apparatus
JP5841844B2 (en) Image processing apparatus and image processing method
WO2020110712A1 (en) Inspection system, inspection method, and program
JP6729960B2 (en) Camera module adjusting device and camera module adjusting method
WO2020110711A1 (en) Inspection system, inspection method, and program
JP2015108582A (en) Three-dimensional measurement method and device
JP2006258582A (en) Image input device and image input method
US10827114B2 (en) Imaging system and setting device
CN104880913B (en) A kind of focusing and leveling system for improving Technological adaptability
KR101826127B1 (en) optical apparatus for inspecting pattern image of semiconductor wafer
JP5531883B2 (en) Adjustment method
KR20070091236A (en) Defective particle measuring apparatus and defective particle measuring method
US11587260B2 (en) Method and apparatus for in-field stereo calibration
JP2006343143A (en) Inspection system for imaging device
JP7287533B2 (en) Inspection system, inspection method and program
JP7135586B2 (en) Image processing system, image processing method and program
CN115151945A (en) Converting coordinate system of three-dimensional camera into incident point of two-dimensional camera
JP7079569B2 (en) Inspection methods
JP2015105897A (en) Inspection method of mask pattern
JP2007205767A (en) Three-dimensional coordinate measuring device and method
JP7198731B2 (en) Imaging device and focus adjustment method
US20220398778A1 (en) Lens calibration method for digital imaging apparatus
CN112838018B (en) Optical measuring method
JP7087984B2 (en) Imaging system and setting device

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19890549

Country of ref document: EP

Kind code of ref document: A1