WO2020039920A1 - 画像処理システム、画像処理方法およびプログラム - Google Patents

画像処理システム、画像処理方法およびプログラム Download PDF

Info

Publication number
WO2020039920A1
WO2020039920A1 PCT/JP2019/031040 JP2019031040W WO2020039920A1 WO 2020039920 A1 WO2020039920 A1 WO 2020039920A1 JP 2019031040 W JP2019031040 W JP 2019031040W WO 2020039920 A1 WO2020039920 A1 WO 2020039920A1
Authority
WO
WIPO (PCT)
Prior art keywords
focus position
image
image processing
area
target
Prior art date
Application number
PCT/JP2019/031040
Other languages
English (en)
French (fr)
Inventor
加藤 豊
Original Assignee
オムロン株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by オムロン株式会社 filed Critical オムロン株式会社
Publication of WO2020039920A1 publication Critical patent/WO2020039920A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G02OPTICS
    • G02BOPTICAL ELEMENTS, SYSTEMS OR APPARATUS
    • G02B21/00Microscopes
    • G02B21/24Base structure
    • 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
    • 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

  • the present invention relates to an image processing system, an image processing method, and a program.
  • Patent Document 1 discloses a focus adjustment device that determines focus within a limited range using a contrast detection method or a phase difference detection method.
  • an image processing system captures an image of an object, generates an image including the object, acquires an image of the object from the image capturing unit, and performs predetermined image processing on the image.
  • an image processing unit that executes processing.
  • the imaging unit can change the focus position.
  • the image processing unit includes, in the image of the object, a reference region serving as a reference of the focus position and a target region serving as a target of predetermined processing by the image processing unit. Is set, and the focus position of each of the reference area and the target area is registered.
  • the image processing unit sets the target area based on the focus position of the reference area in the image acquired by the imaging unit and the registered focus positions of the reference area and the target area. To determine the focus position.
  • the imaging unit images the target area at the determined focus position.
  • the image processing unit sets the reference region and the target region, and registers the focus position of each of the reference region and the target region.
  • the reference area is an area serving as a reference for the focus position.
  • the image processing unit focuses on the registered focus position and a focus position for imaging the target region based on the focus position of the reference region in the image acquired by the imaging unit in the second mode.
  • Ask for. The focus position of the target area in the second mode can be determined from the relationship between the focus position of the reference area in the first mode and the second mode and the focus position of the target area in the first mode. Therefore, the imaging unit can accurately and / or quickly focus on the target area.
  • the reference region and the target region are each defined so that at least a part thereof overlaps each other.
  • the reference region and the target region can include a common region.
  • the image processing unit compares the position of the reference region in the image captured by the imaging unit with the position of the reference region registered in the first mode in the second mode, and performs the comparison.
  • the position of the object in the image is corrected based on the result of (1).
  • the reference region can be used also as a model for correcting positional deviation. Therefore, not only can the image focused on the target be obtained, but also the displacement of the position of the target area in the image can be corrected.
  • the image processing unit uses the difference between the focus position of the registered reference region and the focus position of the reference region acquired in the second mode to register the registered target.
  • the focus position of the target area is determined by correcting the focus position of the area.
  • the focus position of the target area can be determined by relatively simple calculation.
  • the target area includes a plain area. According to this disclosure, even when the target area is a plain area (that is, an area having no clear pattern), the focus position of the target area can be determined.
  • the plain region is a region with low contrast. For this reason, it may not be easy to adjust the focus when imaging a solid area.
  • the image processing unit determines the focus position of the target region based on an image obtained by the imaging unit imaging a pattern temporarily formed in the target region in the first mode. .
  • the focus position of the target area can be determined by the pattern temporarily formed in the target area. Therefore, in the second mode, the focus position of the target area can be determined more accurately.
  • the image processing unit obtains a height difference between the reference region and the target region from the information on the three-dimensional shape of the target object, and obtains the height difference and the reference difference.
  • the focus position of the target area is determined using the focus position of the area.
  • the focus position of the target area can be determined from the focus position and the height information of the reference area. Therefore, the focus position of the target area can be determined by relatively simple calculation.
  • an image processing method includes: an imaging unit that captures an image of an object and generates an image including the object; acquires an image of the object from the imaging unit; An image processing method by an image processing system including an image processing unit that executes processing.
  • the imaging unit can change the focus position.
  • an image processing unit in a first mode in which a focus position of an object is set in advance, an image processing unit includes a reference area serving as a reference of a focus position in an image of the object, and a predetermined process performed by the image processing unit.
  • the image processing unit sets the image acquired by the imaging unit. Determining the focus position of the target region based on the focus position of the reference region and the registered focus position of each of the reference region and the target region.
  • the imaging unit determines the determined focus position. Imaging the target area at the position; and the image processing unit uses the image of the target imaged at the determined focus position to determine the location. And a step of performing a process.
  • the focus position of the target area in the second mode is determined from the relationship between the focus position of the reference area in the first mode and the second mode, and the focus position of the target area in the first mode. Can be determined. Therefore, the imaging unit can accurately and / or quickly focus on the target area.
  • a program is a program for executing a predetermined process using an image obtained by imaging an object using an imaging device.
  • the imaging device can change the focus position.
  • the program sets, in the image of the object, a reference region serving as a reference of the focus position and a target region serving as a target of predetermined processing.
  • the focus position of the target area in the second mode is determined from the relationship between the focus position of the reference area in the first mode and the second mode, and the focus position of the target area in the first mode. Can be determined. Therefore, the image processing unit can acquire an image of the focused target area. Thereby, the accuracy of the processing by the image processing unit (for example, the accuracy of image recognition) can be improved.
  • ADVANTAGE OF THE INVENTION in a system which images a target object using the imaging system which can change a focus position and processes the image of the target object, it is possible to accurately and / or quickly focus on the target object. become.
  • FIG. 2 is a schematic diagram showing one application example of the image processing system according to the present embodiment.
  • FIG. 3 is a diagram illustrating an example of an internal configuration of the imaging device.
  • FIG. 3 is a schematic diagram for explaining adjustment of a focus position.
  • FIG. 3 is a diagram illustrating an example of a configuration of a lens. It is a figure which shows another example of a lens for focus position adjustment.
  • FIG. 3 is a diagram schematically illustrating imaging of a workpiece by an imaging device.
  • FIG. 3 is a diagram illustrating an area of an imaging target on a work.
  • FIG. 4 is a diagram showing a region for focus adjustment according to the present embodiment.
  • FIG. 4 is a diagram for explaining registration of a focus position.
  • FIG. 3 is a diagram illustrating an example of an internal configuration of the imaging device.
  • FIG. 3 is a schematic diagram for explaining adjustment of a focus position.
  • FIG. 3 is a diagram illustrating an example of a configuration of a lens. It
  • FIG. 7 is a diagram for explaining adjustment of a focus position at the time of inspection.
  • FIG. 9 is a diagram for describing an example of designation of a reference area.
  • FIG. 9 is a diagram for describing an example of specifying an inspection area.
  • 5 is a flowchart illustrating a flow of a method of setting a focus position. It is an example of a jig for obtaining a focus position of an inspection area.
  • FIG. 15 is a diagram showing a method of obtaining a focus position of an inspection area using the jig shown in FIG. 5 is a flowchart illustrating a flow of an inspection method.
  • FIG. 1 is a schematic diagram showing one application example of the image processing system according to the present embodiment.
  • the image processing system 1 is realized, for example, as a visual inspection system.
  • the appearance inspection system images a plurality of inspection target positions on the work W placed on the stage 90 in, for example, a production line of an industrial product, and performs an appearance inspection of the work W using the obtained images. .
  • the work W is inspected for scratches, dirt, presence or absence of foreign matter, dimensions, and the like.
  • the next work (not shown) is transported onto the stage 90.
  • the work W may be stationary 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 image processing system 1 includes an imaging device 10 and an image processing device 20 as basic components.
  • the image processing system 1 further includes a PLC (Programmable Logic Controller) 50 and an input / display device 60.
  • PLC Programmable Logic Controller
  • the imaging device 10 is connected to the image processing device 20.
  • the imaging device 10 captures an image of a subject (work W) present in an imaging field of view in accordance with a command from the image processing device 20, and generates image data including an image of the work W.
  • the imaging device 10 is an imaging system capable of changing a focus position.
  • the imaging device 10 and the image processing device 20 may be integrated.
  • the imaging device 10 includes a lens module with a variable focus position.
  • the focus position means a position where an image of the work W is formed.
  • the focus position of the lens module is changed according to the distance between the imaging device 10 and the work W. Accordingly, an image in which the work W is focused can be captured.
  • the imaging device 10 has an autofocus function, and can automatically focus on the work W.
  • the image processing device 20 acquires an image of the work W from the imaging device 10.
  • the image processing device 20 performs a predetermined process on the image.
  • the image processing device 20 includes a determination unit 21, an output unit 22, a storage unit 23, and a command generation unit 24.
  • the determination unit 21 performs a predetermined process on the image data generated by the imaging device 10 to determine whether the appearance of the work W is good.
  • the output unit 22 outputs the result of the determination by the determination unit 21. For example, the output unit 22 causes the input / display device 60 to display the determination result.
  • the storage unit 23 stores various data, programs, and the like. For example, the storage unit 23 stores the image data acquired from the imaging device 10 and the image data subjected to a predetermined process. The storage unit 23 may store the determination result by the determination unit 21. Further, the storage unit 23 stores a program for causing the image processing device 20 to execute various processes.
  • the command generation unit 24 receives a control command from the PLC 50 and outputs an imaging command (imaging trigger) to the imaging device 10.
  • the image processing device 20 is connected to the PLC 50.
  • the PLC 50 controls the image processing device 20.
  • the PLC 50 controls the timing at which the image processing device 20 outputs an imaging command (imaging trigger) to the imaging device 10.
  • the input / display device 60 is connected to the image processing device 20.
  • the input / display device 60 receives a user input regarding various settings of the image processing system 1. Further, the input / display device 60 displays information such as information on the settings of the image processing system 1 and the result of the image processing of the workpiece W by the image processing device 20 (for example, the result of determining whether the appearance of the product is good or bad).
  • the image processing device 20 in the first mode in which the focus position of the work W is set in advance, the image processing device 20 Is set, and the focus position of each of the reference region and the target region is registered.
  • the image processing device 20 determines the focus position of the reference region in the image acquired by the imaging device 10 and the registered focus position of each of the reference region and the target region. , The focus position of the target area is determined.
  • the imaging device 10 images the target area at the determined focus position.
  • the reference area is an area serving as a reference for the focus position.
  • the focus position of the target area in the second mode can be determined from the relationship between the focus position of the reference area in the first mode and the second mode and the focus position of the target area in the first mode. Thereby, the imaging device 10 can accurately focus on the target area. Further, in the second mode, the imaging device 10 can quickly focus on the target area.
  • FIG. 2 is a diagram illustrating an example of the internal configuration of the imaging device 10.
  • the imaging device 10 includes an illumination unit 11, a lens module 12, an imaging element 13, an imaging element control unit 14, a lens control unit 16, registers 15, 17, a communication I / O F section 18.
  • the illumination unit 11 irradiates the work W with light. Light emitted from the illumination unit 11 is reflected on the surface of the work W and enters the lens module 12. The lighting unit 11 may be omitted.
  • the lens module 12 forms the reflected light from the work W on the imaging surface 13 a of the imaging device 13.
  • the lens module 12 has a lens 12a, a lens group 12b, a lens 12c, a movable unit 12d, and a focus adjustment unit 12e.
  • the lens 12a is a lens for mainly changing a focus position.
  • the focus adjustment unit 12e controls the lens 12a to change the focus position.
  • 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 provided on the movable part 12d and is movable along the optical axis direction.
  • the lens 12c is a lens fixed at a predetermined position in the imaging device 10.
  • the imaging device 13 is a photoelectric conversion device such as a CMOS (Complementary Metal Oxide Semiconductor) image sensor, for example, and converts light from an imaging visual field into an image signal.
  • CMOS Complementary Metal Oxide Semiconductor
  • the imaging device control unit 14 Upon receiving an imaging command from the image processing device 20 via the communication I / F unit 18, the imaging device control unit 14 opens a shutter (not shown) to perform exposure, and generates image data based on an image signal from the imaging device 13. I do. At this time, the imaging element control unit 14 opens and closes the shutter so as to have a shutter speed (exposure time) corresponding to the imaging position, and generates image data of a preset resolution. Information indicating the shutter speed and the resolution corresponding to the imaging position is stored in the register 15 in advance. The imaging device control unit 14 outputs the generated image data to the image processing device 20 via the communication I / F unit 18.
  • the lens controller 16 adjusts the focus of the imaging device 10 according to the command stored in the register 17. Specifically, the lens control unit 16 controls the focus adjustment unit 12e so that the focus position changes according to the region of the work W where the work W is imaged.
  • the focus adjustment unit 12e adjusts the position of the lens 12a under the control of the lens control unit 16. That is, the lens control unit 16 controls the lens 12a so that the focus is on the imaging target area of the work W. “Focused” means that an image of the imaging target area of the work W is formed on the imaging surface 13 a of the imaging element 13. The lens 12a will be described later in detail.
  • the lens control unit 16 may control the movable unit 12d to adjust the position of the lens group 12b 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 such that the size of a region included in the imaging field of view of the workpiece W is within a predetermined range.
  • the lens controller 16 may adjust the position of the lens group 12b according to the distance between the imaging position and the work W. Note that in this embodiment, zoom adjustment is not essential.
  • FIG. 3 is a schematic diagram for explaining the adjustment of the focus position. For simplicity, FIG. 3 shows only one lens (lens 12a).
  • the distance from the principal point O of the lens 12a to the target surface is a
  • the distance from the principal point O of the lens 12a to the imaging surface 13a is b
  • the distance from the principal point O of the lens 12a is The distance (focal length) from the point O to the focal point F of the lens 12a is defined as f.
  • the working distance (WD) can change according to the height of the surface of the work W.
  • the working distance is defined as a distance from the surface of the lens 12a on the work W side to the work W.
  • Expression (1) it is possible to capture an image in a state where the surface of the work W is in focus. For example, the focus can be adjusted by changing the distance b.
  • the change amount of the distance b can be represented as an offset from a reference distance.
  • this offset is referred to as “lens extension amount”.
  • the amount of lens movement for obtaining an image focused on the surface of the work W can be determined.
  • the reference value of the distance b can be arbitrarily determined.
  • the reference value of the distance b may be set as the value of the focal length f.
  • the imaging device 10 has an autofocus function. Therefore, the imaging device 10 determines the degree of focusing from the image of the work W and adjusts the focus position.
  • the configuration of the lens 12a for adjusting the focus position is not particularly limited. Hereinafter, an example of the configuration of the lens 12a will be described.
  • FIG. 4 is a diagram showing an example of the configuration of the lens 12a.
  • the focus adjustment unit 12e moves the lens 12a along the optical axis direction.
  • the extension amount of the lens 12a changes. Therefore, the lens 12a moves so that an image of the work W is formed on the imaging surface 13a according to a change in the working distance WD.
  • FIGS. 3 and 4 show an example of one lens.
  • an FA lens is often composed of a plurality of grouped lenses.
  • the combined focal length f and the position of the lens principal point can be obtained using the focal length f of each lens and the positional relationship between the lenses.
  • WD can be calculated by using the characteristic values.
  • FIG. 4 shows an example in which the focus position is adjusted by a mechanical method.
  • the method of adjusting the focus position is not limited to a mechanical method.
  • FIG. 5 is a diagram illustrating another example of the focus position adjusting lens.
  • the lens 12a includes a translucent container 70, electrodes 73a, 73b, 74a, 74b, insulators 75a, 75b, and insulating layers 76a, 76b.
  • the sealed space in the translucent container 70 is filled with a conductive liquid 71 such as water and an insulating liquid 72 such as oil.
  • 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 end 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 electrode 74a and the electrode 74b are arranged at positions symmetric 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 a voltage Va between the electrode 74a and the electrode 73a.
  • Voltage source 12e2 applies voltage Vb between electrode 74b and electrode 73b.
  • the curvature of the interface depends on the magnitude of the voltages Va and Vb. Therefore, by changing the magnitudes of the voltages Va and Vb, the focus position of the lens 12a can be adjusted so that an image is formed on the imaging surface 13a even when the working distance WD changes.
  • voltage Va and voltage Vb are controlled to the same value. Thereby, 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. Thereby, the interface between the conductive liquid 71 and the insulating liquid 72 becomes asymmetric with respect to the optical axis, and the direction of the imaging visual field of the imaging device 10 can be changed.
  • a liquid lens and a solid lens may be combined.
  • the position of the principal point of the lens changes in addition to the focal length f. Accordingly, since the distance b changes, the focus adjustment may be performed in consideration of the change.
  • the image processing device 20 includes a CPU (Central Processing Unit), a RAM (Random Access Memory), a ROM (Read Only Memory), an auxiliary storage device, a communication I / F, and performs information processing.
  • the auxiliary storage device includes, for example, a hard disk drive, a solid state drive, and the like, and stores a program executed by the CPU.
  • the determination unit 21 of the image processing device 20 binarizes the difference image between the image of the non-defective work and the image of the non-defective work stored in the storage unit 23 in advance, and determines the number of pixels exceeding the threshold value and the reference value.
  • the quality of the inspection target position may be determined by collation.
  • the output unit 22 of the image processing device 20 may display the determination result on the input / display device 60.
  • FIG. 6 is a diagram schematically illustrating imaging of the work W by the imaging device.
  • FIG. 7 is a diagram showing a region of the workpiece W to be imaged.
  • the work W has an area W1 and an area W2.
  • the region W1 is, for example, the surface of a transparent body (such as glass).
  • the region W2 is a region surrounding the region W1, for example, a surface of a housing of the electronic device.
  • Examples of such a work W include an electronic device having a display (for example, a smartphone or a tablet). That is, the area W1 can be a display screen. Further, the region W1 does not have a clear pattern. That is, the area W1 is a plain area.
  • An inspection area A1 is set in the area W1.
  • the inspection area A1 is imaged by the imaging device 10.
  • an area including the inspection area A1 is imaged by the imaging device 10, and an image of the inspection area A1 is subjected to predetermined processing by the image processing device 20 (not shown).
  • the image processing device 20 uses the image of the inspection area A1 to inspect whether there is a flaw, dirt, or foreign matter in the inspection area A1.
  • the focus adjustment has two modes.
  • the first mode is a mode in which a focus position in a designated area is determined in advance.
  • the designated area is a reference area serving as a reference for the focus position and a target area to be subjected to predetermined processing by the image processing unit.
  • the second mode is a mode for determining a focus position in an actual inspection.
  • FIG. 8 is a diagram showing an area for focus adjustment according to the present embodiment.
  • an area (reference area B1) serving as a focus reference is set separately from the inspection area A1.
  • the reference area B1 includes a part of the area W2.
  • the reference area is an area including an end of the area W2 and includes an outline of the work W. Therefore, the reference area B1 includes a boundary between the work W and the periphery of the work W. Thereby, the reference area B1 can include a clear pattern.
  • the image of the reference area B1 has such a contrast that the degree of focus can be determined.
  • the reference region B1 and the inspection region A1 are each defined so that at least a part thereof overlaps each other.
  • the reference region B1 and the inspection region A1 can include a common region. Therefore, when determining the focus position of the inspection area A1 in the second mode, it is possible to accurately and / or quickly focus on the inspection area A1.
  • "at least a part of the reference region B1 and the inspection region A1 overlap each other" is not limited to the above example.
  • the reference area B1 may be included in the inspection area A1.
  • the inspection area A1 may be included in the reference area B1.
  • at least a part of the reference region B1 and the inspection region A1 do not necessarily have to overlap each other. That is, the reference region B1 and the inspection region A1 do not have to overlap at all.
  • the reference region B1 and the inspection region A1 are both rectangular, but the shapes of the reference region B1 and the inspection region A1 are not limited to rectangles.
  • the shape of at least one of the reference region B1 and the inspection region A1 may be circular or any free shape capable of forming a region.
  • at least one of the reference region B1 and the inspection region A1 does not need to be limited to a single region.
  • at least one of the reference region B1 and the inspection region A1 may be a plurality of regions that are distributed.
  • FIG. 9 is a diagram for explaining registration of a focus position.
  • a sample work W is imaged by imaging device 10 to obtain an image of work W.
  • the reference region B1 and the inspection region A1 are respectively specified from the image of the work W, and the images of the reference region B1 and the inspection region A1 are registered in the image processing device 20.
  • the focus position when the focus is on the reference area B1 and the focus position when the focus is on the inspection area A1 are registered in the image processing device 20. It is assumed that the focus positions of the reference area B1 and the inspection area A1 are f0 and f1, respectively.
  • the image processing device 20 registers the value of the focus position (f0, f1) inside the image processing device 20. Alternatively, the image processing device 20 may convert the value of the focus position into the amount of extension of the lens and store the value of the amount of extension.
  • FIG. 10 is a diagram for explaining adjustment of the focus position at the time of inspection.
  • work W to be inspected is imaged by imaging device 10.
  • the image processing device 20 searches the reference area B1 from the image of the work W, and obtains a focus position of the reference area B1.
  • the focus position is set to f2.
  • the focus position of the inspection area A1 is calculated based on the focus position.
  • the imaging device 10 images the work W according to the focus position f3.
  • the image processing device 20 inspects the inspection area A1 using the image.
  • FIG. 11 is a diagram for explaining an example of specifying a reference area.
  • FIG. 12 is a diagram for explaining an example of specifying an inspection area.
  • the input / display device 60 has a display.
  • the display displays an image of the work W captured by the imaging device 10.
  • the user specifies the reference area B1 while viewing the image of the work W (see FIG. 11).
  • the user designates the inspection area A1 while referring to the same image.
  • the user specifies each of the reference region B1 and the inspection region A1 using a pointing device such as a mouse.
  • a frame indicating the area designated by the user is displayed on the display of the input / display device 60.
  • a frame indicating the reference area B1 may be displayed at the same time.
  • FIG. 13 is a flowchart showing a flow of a method of setting a focus position. Note that the processing illustrated in FIG. 13 corresponds to the processing of the imaging device 10 and the image processing device 20 in the above “first mode”. The processing of the flowchart described below is executed by the determination unit 21 of the image processing device 20 reading out the program stored in the storage unit 23. The same applies to the processing shown in FIG. 16 described later.
  • imaging apparatus 10 images a sample of the inspection object (hereinafter, “work sample”).
  • the image processing device 20 acquires image data of a work sample from the imaging device 10.
  • the reference area B1 is set.
  • the image of the work sample is displayed on the display of the input / display device 60, for example.
  • an input device such as a pointing device
  • a partial area of the image is set as a reference area.
  • the image processing device 20 stores the image data of the reference area B1 in the storage unit 23.
  • step S13 the focus position of the reference area B1 is set.
  • the imaging device 10 images a work sample while changing the focus position of the lens 12a. Thereby, a plurality of images of the reference area B1 are obtained. Each of the plurality of images is determined, and the most in-focus image is selected from the images. The focus position corresponding to the image is determined as the focus position f0 of the reference area B1. The value of f0 is stored in the storage unit 23 of the image processing device 20.
  • the method for selecting the most focused image from among the plurality of images is not limited.
  • the user may select one image from a plurality of images.
  • the image processing device 20 may determine the image that is most focused out of the plurality of images. For example, the image processing device 20 may select an image having the largest change in color, brightness, or the like at the edge of the workpiece W from among the plurality of images.
  • step S14 the inspection area A1 is set.
  • the image of the work sample acquired by the process of step S11 is displayed on the display of the input / display device 60.
  • an input device such as a pointing device
  • a partial area of the image is set as the inspection area A1.
  • the image processing device 20 stores the image data of the inspection area A1 in the storage unit 23.
  • step S15 the focus position f1 of the inspection area A1 is set.
  • the following method can be exemplified.
  • the first method is to determine the focus position f1 using a jig.
  • FIG. 14 is an example of a jig for obtaining the focus position f1 of the inspection area A1.
  • FIG. 15 is a diagram showing a method of obtaining the focus position f1 of the inspection area A1 using the jig shown in FIG.
  • the jig 100 is a transparent glass flat plate having a printing surface 101 on which a black-and-white pattern 102 is printed.
  • the jig 100 is set so that the pattern 102 of the jig 100 contacts the area W1 of the work sample.
  • a temporary pattern 102 is formed on the work sample region W1 as viewed from the imaging device 10.
  • the focus position of the inspection area A1 can be accurately determined by the temporarily formed pattern. Using this focus position, the focus position of the inspection area A1 is determined in the actual inspection (second mode). In the second mode, no clear pattern exists in the inspection area A1. However, a more accurate focus position of the inspection area A1 can be determined.
  • the focus position f1 can be obtained by the autofocus of the imaging device 10 using the pattern 102 as a clue. Note that the jig 100 is exaggerated in FIG. 14 to clearly show the pattern 102 of the jig 100.
  • the method for forming the temporary pattern 102 in the inspection area A1 is not limited to the method using the jig 100.
  • a specific pattern may be projected onto the inspection area A1 only for a predetermined time using a projector.
  • the second method is a method of adjusting the focus of the imaging device 10 visually by the user.
  • the imaging area 10 is imaged by the imaging apparatus 10 while changing the focus of the imaging apparatus 10. Thereby, a plurality of images are obtained.
  • the user selects the most focused image from the plurality of images.
  • the focus position corresponding to the image is set as the focus position f1 of the inspection area A1. If there is a trigger for focusing, such as a faint pattern or a scratch, in the inspection area A1, the focus position f1 of the inspection area A1 can be set using the second method.
  • a plurality of candidate images may be selected in advance by the autofocus of the imaging device 10, and the user may select an appropriate image from the candidate images.
  • the third method is a method of setting the focus position f1 using information on the three-dimensional shape of the work.
  • a difference in height between the reference region B1 and the inspection region A1 can be acquired from the information on the three-dimensional shape.
  • the focus position f0 of the reference area B1 is converted into a working distance (WD).
  • the working distance of the inspection area A1 is calculated by adding the height difference to the converted working distance.
  • the focus position f1 is set by converting the working distance to the focus position.
  • the conversion from the focus position to the working distance and the conversion from the working distance to the focus position are executed by the image processing device 20, for example.
  • the focus position of the inspection area A1 can be determined from the focus position of the reference area B1 and the height information. Therefore, the focus position of the inspection area A1 can be determined by relatively simple calculation.
  • FIG. 16 is a flowchart showing the flow of the inspection method.
  • the processing illustrated in FIG. 16 corresponds to the processing of the imaging device 10 and the image processing device 20 in the above “second mode”.
  • the image processing system 1 for example, the image processing device 20
  • the reference area B1 is searched for in the search space determined by the focus position when imaging the work W and the image of the work W.
  • step S22 the image processing device 20 obtains a focus position when an image including the reference area B1 obtained by the search in step S21 is captured. Thereby, the focus position f2 of the reference area B1 is obtained.
  • step S23 the image processing device 20 obtains the XY position shift of the reference area B1.
  • XY position shift means a relative position shift of the image of the reference region acquired by the process of step S21 with respect to the image of the reference region acquired in step S12 (see FIG. 12). This displacement includes the amount of displacement along each of two orthogonal axes (X axis and Y axis) in the plane and the rotation angle in the plane.
  • the image processing device 20 obtains the XY position shift by comparing the images of the two reference areas.
  • the reference area B1 can be used also as a model for correcting a displacement. Therefore, not only can an image focused on the work W be obtained, but also the displacement of the position of the inspection area A1 in the image can be corrected. Note that the processing in step S23 is optional and not essential.
  • step S24 the image processing device 20 obtains the focus position f3 of the inspection area A1.
  • the focus position f3 of the inspection area A1 is obtained by a relatively simple calculation from the registered focus positions f0 and f1 and the focus position f2 obtained in step S22. Therefore, the focus position f3 can be determined in a short time.
  • step S25 the imaging device 10 adjusts the focus according to the focus position f3, and images the inspection area A1 of the work W.
  • the image processing device 20 acquires an image of the inspection area A1 from the imaging device 10. This image is an image of the inspection area A1 in a state where the inspection area A1 is in focus.
  • step S26 the determination unit 21 of the image processing device 20 processes the image captured by the imaging device 10.
  • step S27 the determination unit 21 determines whether the appearance of the workpiece W is good or bad based on the processed image.
  • the output unit 22 of the image processing device 20 outputs the inspection result (determination result).
  • the processing in step S28 ends, the processing returns to step S21 for the inspection of the next work.
  • the focus positions of the reference area and the inspection area are obtained. Since the reference area is an area having a clear pattern, it is easy to obtain a focused image. Therefore, the focus position can be obtained with high accuracy.
  • the focus position of the inspection area is corrected using the shift of the focus position of the reference area. Even if the inspection area does not have a clear pattern (a pattern that is easy to focus on), an image of the focused inspection area can be obtained. Therefore, the accuracy of the inspection result can be improved.
  • An imaging unit (10) configured to capture an image of the object (W) and generate an image including the object (W);
  • An image processing unit (20) that acquires an image of the object (W) from the imaging unit (10) and performs a predetermined process on the image;
  • the imaging unit (10) is capable of changing a focus position, In a first mode in which the focus position of the object (W) is set in advance, the image processing unit (20) includes a reference area serving as a reference of the focus position in the image of the object (W).
  • (B1) and a target area (A1) to be subjected to the predetermined processing by the image processing unit (20) are set, and the focus of each of the reference area (B1) and the target area (A1) is set.
  • the image processing unit (20) includes a focus position of the reference area (B1) in the image acquired by the imaging unit (10) and the reference area (B1). And determining the focus position of the target area (A1) based on each registered focus position of the target area (A1); The image processing system (1), wherein in the second mode, the imaging unit (10) captures an image of the target area (A1) at a determined focus position.
  • Configuration 2 The image processing system (1) according to Configuration 1, wherein the reference area (B1) and the target area (A1) are each defined such that at least a part thereof overlaps each other.
  • the image processing unit (20) registers a position of the reference area (B1) in the image captured by the imaging unit (10) in the first mode.
  • the image processing system (1) according to Configuration 1, wherein the position of the object (W) in the image is corrected based on a result of the comparison with a position of a reference area (B1).
  • the image processing unit (20) is configured to control the focus position of the registered reference area (B1) and the focus position of the reference area (B1) acquired in the second mode.
  • Image processing system (1) is configured to control the focus position of the registered reference area (B1) and the focus position of the reference area (B1) acquired in the second mode.
  • the image processing unit (20) is configured to perform an operation based on the image obtained by the imaging unit (10) capturing a pattern temporarily formed in the target area (A1).
  • the image processing system (1) according to Configuration 5, wherein the focus position of the target area (A1) is determined.
  • the image processing unit (20) calculates a difference in height between the reference region (B1) and the target region (A1) from information on a three-dimensional shape of the target object (W).
  • An imaging unit (10) that captures an image of the object (W) and generates an image including the object (W); and acquires an image of the object (W) from the imaging unit (10),
  • the imaging unit (10) is capable of changing a focus position,
  • the image processing method includes: In a first mode in which the focus position of the object (W) is set in advance, the image processing unit (20) includes a reference area serving as a reference of the focus position in the image of the object (W).
  • the image processing unit (20) In the second mode for executing the predetermined processing, the image processing unit (20) is configured to control the focus position of the reference area (B1) in the image acquired by the imaging unit (10) and the reference area (B1). And determining the focus position of the target area (A1) based on each registered focus position of the target area (A1); In the second mode, the imaging section (10) imaging the target area (A1) at the determined focus position; The image processing unit (20) performing the predetermined processing using the image of the object (W) captured at the determined focus position.
  • the program is stored in a computer (20).
  • a reference area (B1) serving as a reference of the focus position in the image of the object (W);
  • the focus position of the reference area (B1) in the image acquired by the imaging device (10), and each of the reference area (B1) and the target area (A1) Determining the focus position of the target area (A1) based on the registered focus position of Executing the predetermined process using the image of the object (W) captured at the determined focus position.
  • Reference Signs List 1 image processing system 10 imaging device, 11 illumination unit, 12 lens module, 12a, 12c lens, 12b lens group, 12d movable unit, 12e1, 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 image processing unit, 21 judgment unit, 22 output unit, 23 storage unit, 24 command generation unit, 60 display unit, 70 transmission Optical container, 71 conductive liquid, 72 insulating liquid, 73a, 73b, 74a, 74b electrode, 75a, 75b insulator, 76a, 76b insulating layer, 90 stage, 100 jig, 101 printing surface, 102 pattern, A1 Inspection area, B1 reference area, F focal point, O principal point, S11- 15, S21 ⁇ S28 step, W workpiece, W1, W2 region, f0 ⁇ f3 focus position.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Optics & Photonics (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)
  • Automatic Focus Adjustment (AREA)

Abstract

画像処理装置(20)は、ワーク(W)の画像の中にフォーカス位置の基準となる基準領域と、画像処理装置(20)による所定の処理の対象となる対象領域とを設定して、基準領域および対象領域の各々のフォーカス位置を登録する。所定の処理を実行するモードにおいて、画像処理装置(20)は、撮像装置(10)が取得した画像における基準領域のフォーカス位置、および基準領域および対象領域の各々の登録されたフォーカス位置に基づいて、対象領域のフォーカス位置を決定する。撮像装置(10)は、決定されたフォーカス位置で対象領域を撮像する。

Description

画像処理システム、画像処理方法およびプログラム
 本発明は、画像処理システム、画像処理方法およびプログラムに関する。
 一般にカメラの分野では、合焦状態を判定し、被写体に合焦するようにレンズユニットのフォーカスレンズを移動させるオートフォーカス機能が知られている。たとえば特開2018-84701号公報(特許文献1)は、コントラスト検出方式または位相差検出方式を用いて、制限された範囲内で合焦を判断する焦点調節装置を開示する。
特開2018-84701号公報
 たとえば製品の検査を行う産業用機器においては、正確な検査のために製品にフォーカスの合った画像が得られることが望まれる。製造ラインを流れる製品を撮像する場合、製品ごとに、カメラからの距離が変動し得る。したがってカメラは、製品を撮像するたびにフォーカスを調整する必要がある。上記の産業用機器に限られないが、フォーカス位置を変更可能な撮像系を用いて対象物を撮像し、かつ、その対象物の画像を処理するシステムでは、正確かつ高速にフォーカスを調整することが望まれる。
 本発明の目的は、フォーカス位置を変更可能な撮像系を用いて対象物を撮像して、その対象物の画像を処理するシステムにおいて、正確および/または高速に対象物にフォーカスを合わせることを可能にすることである。
 本開示の一例によれば、画像処理システムは、対象物を撮像して、対象物を含む画像を生成する撮像部と、撮像部から対象物の画像を取得して、画像に対して所定の処理を実行する画像処理部とを備える。撮像部は、フォーカス位置を変化させることが可能である。対象物のフォーカス位置を予め設定する第1のモードにおいて、画像処理部は、対象物の画像の中にフォーカス位置の基準となる基準領域と、画像処理部による所定の処理の対象となる対象領域とを設定して、基準領域および対象領域の各々のフォーカス位置を登録する。所定の処理を実行する第2のモードにおいて、画像処理部は、撮像部が取得した画像における基準領域のフォーカス位置、および基準領域および対象領域の各々の登録されたフォーカス位置に基づいて、対象領域のフォーカス位置を決定する。第2のモードにおいて、撮像部は、決定されたフォーカス位置で対象領域を撮像する。
 この開示によれば、画像処理部は、第1のモードにおいて、基準領域と、対象領域とを設定して、基準領域および対象領域の各々のフォーカス位置を登録する。基準領域は、フォーカス位置の基準となる領域である。第2のモードにおいて、画像処理部は、その登録されたフォーカス位置、および、第2のモードにおいて撮像部が取得した画像における基準領域のフォーカス位置に基づいて、対象領域を撮像するためのフォーカス位置を求める。第1のモードおよび第2のモードでの基準領域のフォーカス位置の関係と、第1のモードにおける対象領域のフォーカス位置から、第2のモードでの対象領域のフォーカス位置を決定することができる。したがって撮像部は、正確および/または高速に対象領域にフォーカスを合わせることが可能である。
 上述の開示において、基準領域と対象領域とは、少なくとも一部が互いに重なり合うように各々定められる。
 この開示によれば、基準領域と対象領域とが共通の領域を含むことができる。これにより、第2のモードにおいて対象領域のフォーカス位置を決定する際に、正確および/または高速に対象領域にフォーカスを合わせることが可能である。
 上述の開示において、画像処理部は、第2のモードにおいて、撮像部により撮像された画像内の基準領域の位置を、第1のモードにおいて登録された基準領域の位置と比較して、その比較の結果に基づいて、画像内の対象物の位置を修正する。
 この開示によれば、基準領域を、位置ずれ修正用のモデルに兼用することができる。したがって、対象物にフォーカスの合った画像を得られるだけでなく、画像内における対象領域の位置のずれを修正することもできる。
 上述の開示において、画像処理部は、第2のモードにおいて、登録された基準領域のフォーカス位置と、第2のモードにおいて取得された基準領域のフォーカス位置との差を用いて、登録された対象領域のフォーカス位置を補正して、対象領域のフォーカス位置を決定する。
 この開示によれば、第2のモードにおいて、対象領域のフォーカス位置を比較的単純な計算によって、決定することができる。
 上述の開示において、対象領域は無地の領域を含む。
 この開示によれば、対象領域が無地の領域(すなわち明確なパターンを有さない領域)であっても、その対象領域のフォーカス位置を決定することができる。無地の領域とは、コントラストの低い領域である。このため、無地の領域の撮像において、フォーカスを合わせることが容易ではない場合がある。一方、この開示によれば、明確なパターンを有する基準領域でのフォーカス位置を用いて対象領域のフォーカス位置を決定することができる。したがって、無地の領域を含む対象領域を、フォーカスの合った状態で撮像することができる。
 上述の開示において、画像処理部は、第1のモードにおいて、対象領域に一時的に形成されたパターンを撮像部が撮像することにより得られた画像に基づいて、対象領域のフォーカス位置を決定する。
 この開示によれば、フォーカス位置の決定に有利なパターンを対象領域に形成することができる。たとえば対象領域自体が明確なパターンを有さない領域であっても、一時的に対象領域に形成されたパターンにより、対象領域のフォーカス位置を決定することができる。したがって、第2のモードにおいて、対象領域のフォーカス位置をより正確に決定することができる。
 上述の開示において、画像処理部は、第1のモードにおいて、対象物の三次元形状の情報から基準領域と対象領域との間の高さの差分を取得して、高さの差分と、基準領域のフォーカス位置とを用いて、対象領域のフォーカス位置を決定する。
 この開示によれば、基準領域のフォーカス位置と高さ情報とから、対象領域のフォーカス位置を決定することができる。したがって対象領域のフォーカス位置を比較的単純な計算によって、決定することができる。
 本開示の一例によれば、画像処理方法は、対象物を撮像して、対象物を含む画像を生成する撮像部と、撮像部から対象物の画像を取得して、画像に対して所定の処理を実行する画像処理部とを備えた画像処理システムによる画像処理方法である。撮像部は、フォーカス位置を変化させることが可能である。画像処理方法は、対象物のフォーカス位置を予め設定する第1のモードにおいて、画像処理部が、対象物の画像の中にフォーカス位置の基準となる基準領域と、画像処理部による所定の処理の対象となる対象領域とを設定して、基準領域および対象領域の各々のフォーカス位置を登録するステップと、所定の処理を実行する第2のモードにおいて、画像処理部が、撮像部が取得した画像における基準領域のフォーカス位置、および基準領域および対象領域の各々の登録されたフォーカス位置に基づいて、対象領域のフォーカス位置を決定するステップと、第2のモードにおいて、撮像部が、決定されたフォーカス位置で対象領域を撮像するステップと、画像処理部が、決定されたフォーカス位置で撮像された対象物の前記画像を用いて前記所定の処理を実行するステップとを備える。
 この開示によれば、第1のモードおよび第2のモードでの基準領域のフォーカス位置の関係と、第1のモードにおける対象領域のフォーカス位置から、第2のモードでの対象領域のフォーカス位置を決定することができる。したがって撮像部は、正確および/または高速に対象領域にフォーカスを合わせることが可能である。
 本開示の一例によれば、プログラムは、撮像装置によって対象物を撮像することにより得られた画像を用いて所定の処理を実行するためのプログラムである。撮像装置は、フォーカス位置を変化させることが可能である。プログラムは、コンピュータに、対象物のフォーカス位置を予め設定する第1のモードにおいて、対象物の画像の中にフォーカス位置の基準となる基準領域と、所定の処理の対象となる対象領域とを設定して、基準領域および対象領域の各々のフォーカス位置を登録するステップと、所定の処理を実行する第2のモードにおいて、撮像装置が取得した画像における基準領域のフォーカス位置、および基準領域および対象領域の各々の登録されたフォーカス位置に基づいて、対象領域のフォーカス位置を決定するステップと、決定されたフォーカス位置で撮像された対象物の画像を用いて所定の処理を実行するステップとを実行させる。
 この開示によれば、第1のモードおよび第2のモードでの基準領域のフォーカス位置の関係と、第1のモードにおける対象領域のフォーカス位置から、第2のモードでの対象領域のフォーカス位置を決定することができる。したがって画像処理部は、フォーカスの合った対象領域の画像を取得することができる。これにより画像処理部による処理の精度(たとえば画像の認識の正確度)を高めることができる。
 本発明によれば、フォーカス位置を変更可能な撮像系を用いて対象物を撮像して、その対象物の画像を処理するシステムにおいて、正確および/または高速に対象物にフォーカスを合わせることが可能になる。
本実施の形態に係る画像処理システムの1つの適用例を示す模式図である。 撮像装置の内部構成の一例を示す図である。 フォーカス位置の調整を説明するための模式図である。 レンズの構成の一例を示す図である。 フォーカス位置調整用レンズの他の一例を示す図である。 撮像装置によるワークの撮像を模式的に示した図である。 ワークにおける撮像対象の領域を示した図である。 本実施の形態によるフォーカス調整のための領域を示した図である。 フォーカス位置の登録を説明するための図である。 検査時のフォーカス位置の調整を説明するための図である。 基準領域の指定の例を説明するための図である。 検査領域の指定の例を説明するための図である。 フォーカス位置の設定方法のフローを示したフローチャートである。 検査領域のフォーカス位置を求めるための治具の例である。 図14に示す治具を用いて検査領域のフォーカス位置を求める方法を示した図である。 検査方法のフローを示したフローチャートである。
 §1 適用例
 まず、図1を参照して、本発明が適用される場面の一例について説明する。図1は、本実施の形態に係る画像処理システムの1つの適用例を示す模式図である。
 図1に示すように、本実施の形態に係る画像処理システム1は、たとえば外観検査システムとして実現される。外観検査システムは、たとえば工業製品の生産ラインなどにおいて、ステージ90上に載置されたワークW上の複数の検査対象位置を撮像し、得られた画像を用いて、ワークWの外観検査を行う。外観検査では、ワークWの傷、汚れ、異物の有無、寸法などが検査される。
 ステージ90上に載置されたワークWの外観検査が完了すると、次のワーク(図示せず)がステージ90上に搬送される。ワークWの撮像の際、ワークWは、ステージ90上の予め定められた位置に予め定められた姿勢で静止してもよい。あるいは、ワークWがステージ90上を移動しながら、ワークWが撮像されてもよい。
 図1に示すように、画像処理システム1は、基本的な構成要素として、撮像装置10と、画像処理装置20とを備える。この実施の形態では、画像処理システム1は、さらに、PLC(Programmable Logic Controller)50と、入力/表示装置60とを備える。
 撮像装置10は、画像処理装置20に接続される。撮像装置10は、画像処理装置20からの指令に従って、撮像視野に存在する被写体(ワークW)を撮像して、ワークWの像を含む画像データを生成する。本実施の形態では、撮像装置10は、フォーカス位置を変化させることが可能な撮像系である。撮像装置10と画像処理装置20とは一体化されていてもよい。
 撮像装置10は、フォーカス位置が可変のレンズモジュールを含む。フォーカス位置とは、ワークWの像が形成される位置を意味する。撮像装置10とワークWとの間の距離に応じてレンズモジュールのフォーカス位置が変更される。これにより、ワークWにフォーカスの合った画像を撮像することができる。なお、撮像装置10はオートフォーカス機能を有し、ワークWに自動的にフォーカスを合わせることができる。
 画像処理装置20は、撮像装置10からワークWの画像を取得する。画像処理装置20は、その画像に対して所定の処理を実行する。画像処理装置20は、判定部21と、出力部22と、記憶部23と、指令生成部24とを含む。
 判定部21は、撮像装置10によって生成された画像データに対して予め定められた処理を実行することにより、ワークWの外観の良否を判定する。出力部22は、判定部21による判定結果を出力する。たとえば、出力部22は、入力/表示装置60に判定結果を表示させる。
 記憶部23は、各種のデータ、プログラム等を記憶する。たとえば記憶部23は、撮像装置10から取得された画像データ、および所定の処理が施された画像データを保存する。記憶部23は、判定部21による判定結果を保存してもよい。さらに、記憶部23は、各種の処理を画像処理装置20に実行させるためのプログラムを記憶する。
 指令生成部24は、PLC50からの制御指令を受けて、撮像装置10に撮像指令(撮像トリガ)を出力する。
 画像処理装置20はPLC50に接続される。PLC50は画像処理装置20を制御する。たとえばPLC50は、画像処理装置20が撮像指令(撮像トリガ)を撮像装置10に出力するためのタイミングを制御する。
 入力/表示装置60は、画像処理装置20に接続される。入力/表示装置60は、画像処理システム1の各種の設定に関するユーザの入力を受け付ける。さらに、入力/表示装置60は、画像処理システム1の設定に関する情報、画像処理装置20によるワークWの画像処理の結果(たとえば製品の外観の良否を判定した結果)などの情報を表示する。
 本実施の形態では、ワークWのフォーカス位置を予め設定する第1のモードにおいて、画像処理装置20は、ワークWの画像の中にフォーカス位置の基準となる基準領域と、画像処理装置20による所定の処理の対象となる対象領域とを設定して、基準領域および対象領域の各々のフォーカス位置を登録する。所定の処理を実行する第2のモードにおいて、画像処理装置20は、撮像装置10が取得した画像における基準領域のフォーカス位置、および、基準領域および対象領域の各々の登録されたフォーカス位置に基づいて、対象領域のフォーカス位置を決定する。第2のモードにおいて、撮像装置10は、決定されたフォーカス位置で対象領域を撮像する。
 基準領域は、フォーカス位置の基準となる領域である。第1のモードおよび第2のモードでの基準領域のフォーカス位置の関係と、第1のモードにおける対象領域のフォーカス位置から、第2のモードでの対象領域のフォーカス位置を決定することができる。これにより撮像装置10は、対象領域に正確にフォーカスを合わせることが可能である。また、撮像装置10は、第2のモードにおいて、対象領域に高速にフォーカスを合わせることができる。
 図2は、撮像装置10の内部構成の一例を示す図である。図2に示されるように、撮像装置10は、照明部11と、レンズモジュール12と、撮像素子13と、撮像素子制御部14と、レンズ制御部16と、レジスタ15,17と、通信I/F部18とを含む。
 照明部11は、ワークWに対して光を照射する。照明部11から照射された光は、ワークWの表面で反射し、レンズモジュール12に入射する。照明部11は省略されてもよい。
 レンズモジュール12は、ワークWからの反射光を撮像素子13の撮像面13a上に結像させる。レンズモジュール12は、レンズ12aと、レンズ群12bと、レンズ12cと、可動部12dと、フォーカス調整部12eとを有する。レンズ12aは、主としてフォーカス位置を変更するためのレンズである。フォーカス調整部12eは、レンズ12aを制御して、フォーカス位置を変更する。
 レンズ群12bは、焦点距離を変更するためのレンズ群である。焦点距離が変更されることにより、ズーム倍率が制御される。レンズ群12bは、可動部12dに設置され、光軸方向に沿って可動する。レンズ12cは、撮像装置10内の予め定められた位置に固定されるレンズである。
 撮像素子13は、たとえばCMOS(Complementary Metal Oxide Semiconductor)イメージセンサなどの光電変換素子であり、撮像視野からの光を画像信号に変換する。
 撮像素子制御部14は、通信I/F部18を介して画像処理装置20から撮像指令を受けると、図示しないシャッターを開いて露光し、撮像素子13からの画像信号に基づいて画像データを生成する。このとき、撮像素子制御部14は、撮像位置に対応するシャッター速度(露光時間)となるようにシャッターを開閉し、予め設定された解像度の画像データを生成する。撮像位置に対応するシャッター速度および解像度を示す情報は、予めレジスタ15に記憶されている。撮像素子制御部14は、生成した画像データを通信I/F部18を介して画像処理装置20に出力する。
 レンズ制御部16は、レジスタ17が記憶する命令に従って、撮像装置10のフォーカスを調整する。具体的には、レンズ制御部16は、ワークWの撮像される領域に応じてフォーカス位置が変化するように、フォーカス調整部12eを制御する。フォーカス調整部12eは、レンズ制御部16の制御により、レンズ12aの位置を調整する。つまり、レンズ制御部16は、ワークWの撮像対象領域にフォーカスが合うように、レンズ12aを制御する。「フォーカスが合う」とは、ワークWの撮像対象領域の像が撮像素子13の撮像面13aに形成されることを意味する。レンズ12aについては、後で詳細に説明する。
 レンズ制御部16は、ワークWのうち撮像視野内に含まれる領域の大きさが略一定になるように、可動部12dを制御して、レンズ群12bの位置を調整してもよい。言い換えると、レンズ制御部16は、ワークWのうち撮像視野内に含まれる領域の大きさが予め定められた範囲内になるように、可動部12dを制御することができる。レンズ制御部16は、撮像位置とワークWとの距離に応じてレンズ群12bの位置を調整すればよい。なお、この実施の形態では、ズームの調整は必須ではない。
 §2 具体例
 <A.フォーカス調整のための構成例>
 図3は、フォーカス位置の調整を説明するための模式図である。説明を簡単にするため、図3には、1枚のレンズ(レンズ12a)のみを示している。
 図3に示すように、レンズ12aの主点Oから対象面(ワークWの表面)までの距離をaとし、レンズ12aの主点Oから撮像面13aまでの距離をbとし、レンズ12aの主点Oからレンズ12aの焦点Fまでの距離(焦点距離)をfとする。ワークWの像の位置が撮像面13aの位置に等しい場合、以下の式(1)が成立する。
 1/a+1/b=1/f・・・(1)
 ワークWの表面の高さに応じて、ワーキングディスタンス(WD)が変化し得る。ワーキングディスタンスは、レンズ12aのワークW側の面から、ワークWまでの距離であると定義される。式(1)が成り立つときに、ワークWの表面にフォーカスが合った状態の画像を撮像することができる。たとえば距離bを変化させることによって、フォーカスの調整が可能である。
 距離bの変化量は、基準となる距離からのオフセットとして表すことができる。本実施の形態では、このオフセットを「レンズの繰り出し量」と呼ぶ。レンズ12aのワークW側の面からワークWの表面までの距離をレンズ操出し量に関連づけることによって、ワークWの表面にフォーカスの合った画像を得るためのレンズ操出し量を決定することができる。なお、距離bの基準値は任意に定めることができる。たとえば距離bの基準値を焦点距離fの値としてもよい。
 上述のように、撮像装置10は、オートフォーカス機能を有する。したがって、撮像装置10が、ワークWの画像から合焦の度合いを判断して、フォーカス位置を調整する。フォーカス位置を調整するためのレンズ12aの構成は特に限定されない。以下に、レンズ12aの構成の例を説明する。
 図4は、レンズ12aの構成の一例を示す図である。図4に示した構成では、フォーカス調整部12eは、レンズ12aを、光軸方向に沿って移動させる。レンズ12aの位置を変更することによって、レンズ12aの繰り出し量が変化する。したがって、ワーキングディスタンスWDの変化に応じて、ワークWの像が撮像面13aに形成されるように、レンズ12aが移動する。
 なお、図3および図4では、1枚のレンズの例が示されている。通常では、FA用のレンズは複数枚の組レンズで構成されることが多い。しかしながら、組レンズにおいても、各レンズの焦点距離fと、レンズ間の位置関係を用いて、合成された焦点距離fおよびレンズ主点の位置を求めることができる。その特性値を用いることでWDを計算することができる。
 図4では、機械的な方式によりフォーカス位置が調整される例が示される。しかし、フォーカス位置の調整の方式は機械的な方式に限定されない。図5は、フォーカス位置調整用レンズの他の一例を示す図である。
 図5に例示されているのは、液体レンズである。レンズ12aは、透光性容器70と、電極73a,73b,74a,74bと、絶縁体75a,75bと、絶縁層76a,76bとを含む。
 透光性容器70内の密閉空間には、水などの導電性液体71と、油などの絶縁性液体72とが充填される。導電性液体71と絶縁性液体72とは混合せず、互いに屈折率が異なる。
 電極73a,73bは、絶縁体75a,75bと透光性容器70との間にそれぞれ固定され、導電性液体71中に位置する。
 電極74a,74bは、導電性液体71と絶縁性液体72との界面の端部付近に配置される。電極74aと導電性液体71および絶縁性液体72との間には絶縁層76aが介在する。電極74bと導電性液体71および絶縁性液体72との間には絶縁層76bが介在する。電極74aと電極74bとは、レンズ12aの光軸に対して対称な位置に配置される。
 図5に示す構成において、フォーカス調整部12eは、電圧源12e1と、電圧源12e2とを含む。電圧源12e1は、電極74aと電極73aとの間に電圧Vaを印加する。電圧源12e2は、電極74bと電極73bとの間に電圧Vbを印加する。
 電極74aと電極73aとの間に電圧Vaを印加すると、導電性液体71は、電極74aに引っ張られる。同様に、電極74bと電極73bとの間に電圧Vbを印加すると、導電性液体71は、電極74bに引っ張られる。これにより、導電性液体71と絶縁性液体72との界面の曲率が変化する。導電性液体71と絶縁性液体72との屈折率が異なるため、導電性液体71と絶縁性液体72との界面の曲率が変化することにより、レンズ12aの焦点距離(図3に示す焦点距離fに相当)が変化する。当該界面の曲率は、電圧Va,Vbの大きさに依存する。そのため、電圧Va,Vbの大きさを変えることにより、ワーキングディスタンスWDが変化しても撮像面13aに像が形成されるように、レンズ12aのフォーカス位置を調整することができる。
 通常は、電圧Vaと電圧Vbとは同値に制御される。これにより、導電性液体71と絶縁性液体72との界面は、光軸に対して対称に変化する。ただし、電圧Vaと電圧Vbとが異なる値に制御されてもよい。これにより、導電性液体71と絶縁性液体72との界面が光軸に対して非対称となり、撮像装置10の撮像視野の向きを変更することができる。
 さらに液体レンズと固体レンズとを組み合わせてもよい。この場合、焦点距離fに加えてレンズの主点の位置が変化する。したがって距離bが変化するため、その変化分を考慮したフォーカス調整を行えばよい。
 <B.画像処理装置>
 画像処理装置20は、CPU(Central Processing Unit)、RAM(Random Access Memory)、ROM(Read Only Memory)、補助記憶装置、通信I/F等を含み、情報処理を行なう。補助記憶装置は、たとえば、ハードディスクドライブ、ソリッドステートドライブ等で構成され、CPUが実行するプログラム等を記憶する。
 画像処理装置20の判定部21は、たとえば、記憶部23に予め記憶しておいた良品ワークの画像との間の差分画像を2値化し、しきい値を超えた画素数と基準値とを照合することにより、検査対象位置の良否を判定してもよい。画像処理装置20の出力部22は、判定結果を入力/表示装置60に表示してもよい。
 <C.ワークの例およびフォーカス調整の課題>
 図6は、撮像装置によるワークWの撮像を模式的に示した図である。図7は、ワークWにおける撮像対象の領域を示した図である。図6および図7に示した例において、ワークWは、領域W1と領域W2とを有する。領域W1は、たとえば透明体(ガラスなど)の表面である。領域W2は領域W1を囲む領域であり、たとえば電子機器の筐体の表面である。このようなワークWの例として、ディスプレイを有する電子機器(一例では、スマートフォンあるいはタブレットなど)を挙げることができる。すなわち領域W1は、表示画面でありえる。また、領域W1は、明確なパターンを有していない。すなわち領域W1は無地の領域である。
 領域W1内に、検査領域A1が設定される。検査領域A1は、撮像装置10によって撮像される。外観検査では、検査領域A1を含む領域が撮像装置10により撮像されて、検査領域A1の画像が画像処理装置20(図示せず)による所定の処理の対象となる。画像処理装置20は、検査領域A1の画像を用いて、検査領域A1内に傷、汚れ、あるいは異物が有るかどうかを検査する。
 検査領域A1にフォーカスが合っていない状態で検査領域A1を撮像した場合、取得された画像から、検査領域A1内の傷などを検出できない可能性がある。精度の高い外観検査を行うためには、撮像装置10のフォーカスを検査領域A1に合わせることが求められる。しかし上述の例のように、検査領域A1が無地の領域の一部である場合、検査領域A1には明確なパターンが形成されていない。このような場合、検査領域A1内でのコントラストの差が小さいため、撮像装置10がフォーカスの合った検査領域A1の画像を撮像するのが難しいという課題がある。
 <D.本実施の形態によるフォーカス調整>
 本実施の形態によれば、フォーカス調整は、2つのモードを有する。第1のモードは、指定された領域におけるフォーカス位置を予め決定するモードである。指定された領域は、フォーカス位置の基準となる基準領域、および画像処理部による所定の処理の対象となる対象領域である。第2のモードは実際の検査において、フォーカス位置を決定するモードである。
 図8は、本実施の形態によるフォーカス調整のための領域を示した図である。本実施の形態では、検査領域A1とは別に、フォーカスの基準となる領域(基準領域B1)を設定する。
 図8に示す例によれば、基準領域B1は、領域W2の一部を含む。たとえば基準領域は、領域W2の端部を含む領域であり、ワークWの外郭線を含む。したがって基準領域B1は、ワークWと、ワークWの周囲との境界を含む。これにより、基準領域B1は、明確なパターンを含むことができる。このように、基準領域B1の画像は、合焦度を判定可能な程度のコントラストを有している。
 図8に示すように、一つの実施例では、基準領域B1と検査領域A1とは、少なくとも一部が互いに重なり合うように各々定められる。これにより基準領域B1と検査領域A1とが共通の領域を含むことができる。したがって、第2のモードにおいて検査領域A1のフォーカス位置を決定する際に、正確および/または高速に検査領域A1にフォーカスを合わせることが可能である。なお、「基準領域B1と検査領域A1との少なくとも一部が互いに重なり合う」とは、上述の例に限定されない。基準領域B1が検査領域A1に含まれていてもよい。逆に、検査領域A1が基準領域B1に含まれていてもよい。また、本実施の形態では、必ずしも、基準領域B1と検査領域A1との少なくとも一部が互いに重なり合っていなくてもよい。すなわち基準領域B1と検査領域A1とが全く重なり合っていなくてもよい。
 また、図8の例では、基準領域B1および検査領域A1は、いずれも矩形であるが、基準領域B1および検査領域A1の各々の形状は、矩形であると限定されない。たとえば基準領域B1および検査領域A1の少なくとも一方の形状が、円形、あるいは領域を形成することが可能な任意の自由な形状であってもよい。また、基準領域B1および検査領域A1の少なくとも一方は、1つにまとまった領域であると限定される必要はない。たとえば、基準領域B1および検査領域A1の少なくとも一方は、分散して存在する複数の領域であってもよい。
 本実施の形態では、実際の検査に先立って、基準領域および検査領域を設定するとともに、それらの領域のフォーカス位置を画像処理装置20に登録する。図9は、フォーカス位置の登録を説明するための図である。図9を参照して、サンプルのワークWを撮像装置10により撮像して、ワークWの画像を取得する。ワークWの画像から基準領域B1および検査領域A1がそれぞれ指定されて、基準領域B1および検査領域A1の画像が画像処理装置20に登録される。
 さらに、基準領域B1にフォーカスが合うときのフォーカス位置、および検査領域A1にフォーカスが合うときのフォーカス位置がそれぞれ画像処理装置20に登録される。基準領域B1および検査領域A1のそれぞれのフォーカス位置がf0,f1であるとする。画像処理装置20は、フォーカス位置の値(f0,f1)を画像処理装置20の内部に登録する。あるいは、画像処理装置20は、フォーカス位置の値をレンズの繰り出し量に変換して、その繰り出し量の値を記憶するのでもよい。
 図10は、検査時のフォーカス位置の調整を説明するための図である。図10を参照して、検査対象のワークWが撮像装置10により撮像される。画像処理装置20は、ワークWの画像から基準領域B1を検索して、その基準領域B1のフォーカス位置を求める。そのフォーカス位置をf2とする。
 次に、そのフォーカス位置に基づいて、検査領域A1のフォーカス位置を算出する。このときの検査領域A1のフォーカス位置であるf3は、f3=f1+(f2-f0)と表される。上記のようにして、検査領域A1のフォーカス位置f3が決定されると、そのフォーカス位置f3に従って、撮像装置10はワークWを撮像する。画像処理装置20は、その画像を用いて、検査領域A1を検査する。
 図11は、基準領域の指定の例を説明するための図である。図12は、検査領域の指定の例を説明するための図である。図11および図12に示すように、入力/表示装置60は、ディスプレイを有する。ディスプレイは、撮像装置10によって撮像されたワークWの画像を表示する。ユーザは、ワークWの画像を見ながら、基準領域B1を指定する(図11を参照)。次に、ユーザは、同じ画像を参照しながら、検査領域A1を指定する。たとえばユーザは、マウス等のポインティングデバイスを用いて、基準領域B1および検査領域A1の各々を指定する。このとき、ユーザの指定する領域を示す枠線が入力/表示装置60のディスプレイに表示される。なお、検査領域A1を指定する際に、基準領域B1を示す枠線が同時に表示されていてもよい。
 図13は、フォーカス位置の設定方法のフローを示したフローチャートである。なお、図13に示す処理は、上述の「第1のモード」における撮像装置10および画像処理装置20の処理に対応する。また、以下に説明するフローチャートの処理は、画像処理装置20の判定部21が、記憶部23に記憶されたプログラムを読み出すことにより実行される。後述する図16に示す処理も同様である。
 図13を参照して、ステップS11において、撮像装置10は、検査対象物のサンプル(以下、「ワークサンプル」)を撮像する。画像処理装置20は、撮像装置10からワークサンプルの画像データを取得する。
 ステップS12において、基準領域B1が設定される。上述のように、たとえば入力/表示装置60のディスプレイにワークサンプルの画像が表示される。ユーザが、ポインティングデバイス等の入力デバイスを操作することにより、画像の一部の領域が基準領域として設定される。画像処理装置20は、基準領域B1の画像データを記憶部23に格納する。
 ステップS13において、基準領域B1のフォーカス位置が設定される。たとえば撮像装置10は、レンズ12aのフォーカス位置を変化させながらワークサンプルを撮像する。これにより、基準領域B1の複数の画像が得られる。複数の画像の各々を判定して、中から最もフォーカスが合った画像が選択される。その画像に対応したフォーカス位置が、基準領域B1のフォーカス位置f0として決定される。f0の値は、画像処理装置20の記憶部23に格納される。
 複数の画像の中から最もフォーカスが合った画像を選択するための方法は限定されない。ユーザが複数の画像の中から1つの画像を選択してもよい。画像処理装置20が、複数の画像の中から最もフォーカスが合った画像を判定してもよい。たとえば画像処理装置20は、複数の画像のうち、ワークWのエッジでの色あるいは明るさ等の変化が最も大きい画像を選択してもよい。
 ステップS14において、検査領域A1が設定される。ステップS12の処理と同様に、入力/表示装置60のディスプレイに、ステップS11の処理により取得されたワークサンプルの画像が表示される。ユーザが、ポインティングデバイス等の入力デバイスを操作することにより、画像の一部の領域が検査領域A1として設定される。画像処理装置20は、検査領域A1の画像データを記憶部23に格納する。
 ステップS15において、検査領域A1のフォーカス位置f1が設定される。フォーカス位置f1を求める方法として、たとえば以下の方法を例示することができる。
 第1の方法は、治具を用いてフォーカス位置f1を求める方法である。図14は、検査領域A1のフォーカス位置f1を求めるための治具の例である。図15は、図14に示す治具を用いて検査領域A1のフォーカス位置f1を求める方法を示した図である。図14および図15に示すように、治具100は、白黒のパターン102が印刷された印刷面101を有する透明ガラス平板である。治具100のパターン102がワークサンプルの領域W1に接するように、治具100が設置される。これにより、撮像装置10から見て、ワークサンプルの領域W1上に一時的なパターン102が形成される。一時的に形成されたパターンにより、検査領域A1のフォーカス位置を精度よく決定することができる。このフォーカス位置を用いて、実際の検査(第2のモード)において、検査領域A1のフォーカス位置を決定する。第2のモードにおいては検査領域A1には明確なパターンが存在しない。しかしながら、検査領域A1のより正確なフォーカス位置を決定することができる。
 治具100の印刷面101の高さと、ワークサンプルの領域W1の高さとは、ほぼ同じである。したがって、パターン102を手掛かりとして、撮像装置10のオートフォーカスにより、フォーカス位置f1を求めることができる。図14では、治具100のパターン102を明示するために、治具100が誇張して描かれていることに留意されたい。
 なお、一時的なパターン102を検査領域A1に形成するための方法は、治具100を用いる方法に限定されない。たとえば、投影機を用いて、特定のパターンを検査領域A1に所定の時間のみ投影するのでもよい。
 第2の方法は、ユーザの目視により撮像装置10のフォーカスを調整する方法である。撮像装置10のフォーカスを変化させながら、撮像装置10により検査領域A1を撮像する。これにより、複数の画像が得られる。ユーザは、複数の画像から、最もフォーカスの合った画像を選択する。その画像に対応するフォーカス位置が検査領域A1のフォーカス位置f1に設定される。検査領域A1内に、かすかなパターン、傷などといった、焦点合わせのきっかけとなるものが存在する場合、第2の方法を用いて検査領域A1のフォーカス位置f1を設定することができる。なお、撮像装置10のオートフォーカスにより複数の候補画像を予め選んでおき、ユーザが、それら候補画像の中から適切な画像を選択してもよい。
 第3の方法は、ワークの三次元形状に関する情報を用いてフォーカス位置f1を設定する方法である。ワークの三次元形状が予め分かっている場合、その三次元形状の情報から、基準領域B1と検査領域A1との間の高さの差分を取得することができる。基準領域B1のフォーカス位置f0を、ワーキングディスタンス(WD)に変換する。その変換されたワーキングディスタンスに高さの差分を加算して、検査領域A1のワーキングディスタンスを算出する。そのワーキングディスタンスをフォーカス位置に変換することによりフォーカス位置f1を設定する。フォーカス位置からワーキングディスタンスへの変換、ワーキングディスタンスからフォーカス位置への変換は、たとえば画像処理装置20によって実行される。この方法では、基準領域B1のフォーカス位置と高さ情報とから、検査領域A1のフォーカス位置を決定することができる。したがって検査領域A1のフォーカス位置を比較的単純な計算によって、決定することができる。
 図16は、検査方法のフローを示したフローチャートである。図16に示す処理は、上述の「第2のモード」における撮像装置10および画像処理装置20の処理に対応する。図16に示すように処理が開始されると、ステップS21において、画像処理システム1(たとえば画像処理装置20)は、基準領域B1を探索する。ステップS21において、ワークWを撮像するときのフォーカス位置、およびワークWの画像により決定される探索空間内で基準領域B1が探索される。
 ステップS22において、画像処理装置20は、ステップS21での探索により得られた基準領域B1を含む画像を撮像したときのフォーカス位置を求める。これにより、基準領域B1のフォーカス位置f2が求められる。
 ステップS23において、画像処理装置20は、基準領域B1のXY位置ずれを求める。「XY位置ずれ」とは、ステップS12(図12を参照)で取得された基準領域の画像に対する、ステップS21の処理により取得された基準領域の画像の相対的な位置ずれを意味する。この位置ずれは、平面内の直交する2軸(X軸、Y軸)の各々の軸の方向にそったずれの量、および、その平面内での回転角度を含む。画像処理装置20は、2つの基準領域の画像を比較することによりXY位置ずれを求める。基準領域B1を、位置ずれ修正用のモデルに兼用することができる。したがって、ワークWにフォーカスの合った画像を得られるだけでなく、画像内における検査領域A1の位置のずれを修正することもできる。なお、ステップS23の処理は、オプションであり、必須ではない。
 ステップS24において、画像処理装置20は、検査領域A1のフォーカス位置f3を求める。上述したf3=f1+(f2-f0)の式に従ってフォーカス位置f3が求められる。このように、検査領域A1のフォーカス位置f3は、登録されたフォーカス位置f0,f1と、ステップS22において求められたフォーカス位置f2から、比較的単純な計算によって求められる。したがって、フォーカス位置f3を短時間で決定することができる。
 ステップS25において、撮像装置10は、フォーカス位置f3に従ってフォーカスを調整して、ワークWの検査領域A1を撮像する。画像処理装置20は、撮像装置10から、検査領域A1の画像を取得する。この画像は、検査領域A1にフォーカスが合った状態の検査領域A1の画像である。
 ステップS26において、画像処理装置20の判定部21は、撮像装置10によって撮像された画像を処理する。
 ステップS27において、判定部21は、処理された画像に基づいて、ワークWの外観の良否を判定する。ステップS28において、画像処理装置20の出力部22は、検査の結果(判定結果)を出力する。ステップS28の処理が終了すると、次のワークの検査のため、処理はステップS21に戻される。
 本実施の形態によれば、フォーカス位置の設定の際に、基準領域および検査領域のフォーカス位置を求める。基準領域は明確なパターンを有する領域であるので、フォーカスの合った画像を取得しやすい。したがって、フォーカス位置を高い精度で得ることができる。検査の際には、基準領域のフォーカス位置のずれを用いて検査領域のフォーカス位置を補正する。検査領域が明確なパターン(フォーカスを合わせやすいパターン)を有していない場合であっても、フォーカスの合った検査領域の画像を得ることができる。したがって、検査結果の正確性を高めることができる。
 <E.付記>
 以上のように、本実施の形態は以下のような開示を含む。
 (構成1)
 対象物(W)を撮像して、前記対象物(W)を含む画像を生成する撮像部(10)と、
 前記撮像部(10)から前記対象物(W)の画像を取得して、前記画像に対して所定の処理を実行する画像処理部(20)とを備え、
 前記撮像部(10)は、フォーカス位置を変化させることが可能であり、
 前記対象物(W)の前記フォーカス位置を予め設定する第1のモードにおいて、前記画像処理部(20)は、前記対象物(W)の前記画像の中に前記フォーカス位置の基準となる基準領域(B1)と、前記画像処理部(20)による前記所定の処理の対象となる対象領域(A1)とを設定して、前記基準領域(B1)および前記対象領域(A1)の各々の前記フォーカス位置を登録し、
 前記所定の処理を実行する第2のモードにおいて、前記画像処理部(20)は、前記撮像部(10)が取得した画像における前記基準領域(B1)のフォーカス位置、および前記基準領域(B1)および前記対象領域(A1)の各々の登録されたフォーカス位置に基づいて、前記対象領域(A1)の前記フォーカス位置を決定し、
 前記第2のモードにおいて、前記撮像部(10)は、決定されたフォーカス位置で前記対象領域(A1)を撮像する、画像処理システム(1)。
 (構成2)
 前記基準領域(B1)と前記対象領域(A1)とは、少なくとも一部が互いに重なり合うように各々定められる、構成1に記載の画像処理システム(1)。
 (構成3)
 前記第2のモードにおいて、前記画像処理部(20)は、前記撮像部(10)により撮像された前記画像内の前記基準領域(B1)の位置を、前記第1のモードにおいて登録された前記基準領域(B1)の位置と比較して、その比較の結果に基づいて、前記画像内の前記対象物(W)の位置を修正する、構成1に記載の画像処理システム(1)。
 (構成4)
 前記第2のモードにおいて、前記画像処理部(20)は、登録された前記基準領域(B1)の前記フォーカス位置と、前記第2のモードにおいて取得された前記基準領域(B1)の前記フォーカス位置との差を用いて、登録された前記対象領域(A1)の前記フォーカス位置を補正して、前記対象領域(A1)の前記フォーカス位置を決定する、構成1から構成3のいずれかに記載の画像処理システム(1)。
 (構成5)
 前記対象領域(A1)は無地の領域を含む、構成1から構成4のいずれかに記載の画像処理システム(1)。
 (構成6)
 前記第1のモードにおいて、前記画像処理部(20)は、前記対象領域(A1)に一時的に形成されたパターンを前記撮像部(10)が撮像することにより得られた前記画像に基づいて、前記対象領域(A1)の前記フォーカス位置を決定する、構成5に記載の画像処理システム(1)。
 (構成7)
 前記第1のモードにおいて、前記画像処理部(20)は、前記対象物(W)の三次元形状の情報から前記基準領域(B1)と前記対象領域(A1)との間の高さの差分を取得して、前記高さの差分と、前記基準領域(B1)の前記フォーカス位置とを用いて、前記対象領域(A1)の前記フォーカス位置を決定する、構成5に記載の画像処理システム(1)。
 (構成8)
 対象物(W)を撮像して、前記対象物(W)を含む画像を生成する撮像部(10)と、前記撮像部(10)から前記対象物(W)の画像を取得して、前記画像に対して所定の処理を実行する画像処理部(20)とを備えた画像処理システム(1)による画像処理方法であって、
 前記撮像部(10)は、フォーカス位置を変化させることが可能であり、
 前記画像処理方法は、
 前記対象物(W)の前記フォーカス位置を予め設定する第1のモードにおいて、前記画像処理部(20)が、前記対象物(W)の前記画像の中に前記フォーカス位置の基準となる基準領域(B1)と、前記画像処理部(20)による前記所定の処理の対象となる対象領域(A1)とを設定して、前記基準領域(B1)および前記対象領域(A1)の各々の前記フォーカス位置を登録するステップと、
 前記所定の処理を実行する第2のモードにおいて、前記画像処理部(20)が、前記撮像部(10)が取得した画像における前記基準領域(B1)のフォーカス位置、および前記基準領域(B1)および前記対象領域(A1)の各々の登録されたフォーカス位置に基づいて、前記対象領域(A1)の前記フォーカス位置を決定するステップと、
 前記第2のモードにおいて、前記撮像部(10)が、決定されたフォーカス位置で前記対象領域(A1)を撮像するステップと、
 前記画像処理部(20)が、前記決定されたフォーカス位置で撮像された前記対象物(W)の前記画像を用いて前記所定の処理を実行するステップとを備える、画像処理方法。
 (構成9)
 撮像装置(10)によって対象物(W)を撮像することにより得られた画像を用いて所定の処理を実行するためのプログラムであって、
 前記撮像装置(10)は、フォーカス位置を変化させることが可能であり、
 前記プログラムは、コンピュータ(20)に、
 前記対象物(W)の前記フォーカス位置を予め設定する第1のモードにおいて、前記対象物(W)の前記画像の中に前記フォーカス位置の基準となる基準領域(B1)と、前記所定の処理の対象となる対象領域(A1)とを設定して、前記基準領域(B1)および前記対象領域(A1)の各々の前記フォーカス位置を登録するステップと、
 前記所定の処理を実行する第2のモードにおいて、前記撮像装置(10)が取得した画像における前記基準領域(B1)のフォーカス位置、および前記基準領域(B1)および前記対象領域(A1)の各々の登録されたフォーカス位置に基づいて、前記対象領域(A1)の前記フォーカス位置を決定するステップと、
 前記決定されたフォーカス位置で撮像された前記対象物(W)の前記画像を用いて前記所定の処理を実行するステップとを実行させる、プログラム。
 本発明の実施の形態について説明したが、今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は請求の範囲によって示され、請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。
 1 画像処理システム、10 撮像装置、11 照明部、12 レンズモジュール、12a,12c レンズ、12b レンズ群、12d 可動部、12e1,12e2 電圧源、12e フォーカス調整部、13 撮像素子、13a 撮像面、14 撮像素子制御部、15,17 レジスタ、16 レンズ制御部、18 通信I/F部、20 画像処理装置、21 判定部、22 出力部、23 記憶部、24 指令生成部、60 表示装置、70 透光性容器、71 導電性液体、72 絶縁性液体、73a,73b,74a,74b 電極、75a,75b 絶縁体、76a,76b 絶縁層、90 ステージ、100 治具、101 印刷面、102 パターン、A1 検査領域、B1 基準領域、F 焦点、O 主点、S11~S15,S21~S28 ステップ、W ワーク、W1,W2 領域、f0~f3 フォーカス位置。

Claims (9)

  1.  対象物を撮像して、前記対象物を含む画像を生成する撮像部と、
     前記撮像部から前記対象物の画像を取得して、前記画像に対して所定の処理を実行する画像処理部とを備え、
     前記撮像部は、フォーカス位置を変化させることが可能であり、
     前記対象物の前記フォーカス位置を予め設定する第1のモードにおいて、前記画像処理部は、前記対象物の前記画像の中に前記フォーカス位置の基準となる基準領域と、前記画像処理部による前記所定の処理の対象となる対象領域とを設定して、前記基準領域および前記対象領域の各々の前記フォーカス位置を登録し、
     前記所定の処理を実行する第2のモードにおいて、前記画像処理部は、前記撮像部が取得した画像における前記基準領域のフォーカス位置、および前記基準領域および前記対象領域の各々の登録されたフォーカス位置に基づいて、前記対象領域の前記フォーカス位置を決定し、
     前記第2のモードにおいて、前記撮像部は、決定されたフォーカス位置で前記対象領域を撮像する、画像処理システム。
  2.  前記基準領域と前記対象領域とは、少なくとも一部が互いに重なり合うように各々定められる、請求項1に記載の画像処理システム。
  3.  前記第2のモードにおいて、前記画像処理部は、前記撮像部により撮像された前記画像内の前記基準領域の位置を、前記第1のモードにおいて登録された前記基準領域の位置と比較して、その比較の結果に基づいて、前記画像内の前記対象物の位置を修正する、請求項1に記載の画像処理システム。
  4.  前記第2のモードにおいて、前記画像処理部は、登録された前記基準領域の前記フォーカス位置と、前記第2のモードにおいて取得された前記基準領域の前記フォーカス位置との差を用いて、登録された前記対象領域の前記フォーカス位置を補正して、前記対象領域の前記フォーカス位置を決定する、請求項1から請求項3のいずれか1項に記載の画像処理システム。
  5.  前記対象領域は無地の領域を含む、請求項1から請求項4のいずれか1項に記載の画像処理システム。
  6.  前記第1のモードにおいて、前記画像処理部は、前記対象領域に一時的に形成されたパターンを前記撮像部が撮像することにより得られた前記画像に基づいて、前記対象領域の前記フォーカス位置を決定する、請求項5に記載の画像処理システム。
  7.  前記第1のモードにおいて、前記画像処理部は、前記対象物の三次元形状の情報から前記基準領域と前記対象領域との間の高さの差分を取得して、前記高さの差分と、前記基準領域の前記フォーカス位置とを用いて、前記対象領域の前記フォーカス位置を決定する、請求項5に記載の画像処理システム。
  8.  対象物を撮像して、前記対象物を含む画像を生成する撮像部と、前記撮像部から前記対象物の画像を取得して、前記画像に対して所定の処理を実行する画像処理部とを備えた画像処理システムによる画像処理方法であって、
     前記撮像部は、フォーカス位置を変化させることが可能であり、
     前記画像処理方法は、
     前記対象物の前記フォーカス位置を予め設定する第1のモードにおいて、前記画像処理部が、前記対象物の前記画像の中に前記フォーカス位置の基準となる基準領域と、前記画像処理部による前記所定の処理の対象となる対象領域とを設定して、前記基準領域および前記対象領域の各々の前記フォーカス位置を登録するステップと、
     前記所定の処理を実行する第2のモードにおいて、前記画像処理部が、前記撮像部が取得した画像における前記基準領域のフォーカス位置、および前記基準領域および前記対象領域の各々の登録されたフォーカス位置に基づいて、前記対象領域の前記フォーカス位置を決定するステップと、
     前記第2のモードにおいて、前記撮像部が、決定されたフォーカス位置で前記対象領域を撮像するステップと、
     前記画像処理部が、前記決定されたフォーカス位置で撮像された前記対象物の前記画像を用いて前記所定の処理を実行するステップとを備える、画像処理方法。
  9.  撮像装置によって対象物を撮像することにより得られた画像を用いて所定の処理を実行するためのプログラムであって、
     前記撮像装置は、フォーカス位置を変化させることが可能であり、
     前記プログラムは、コンピュータに、
     前記対象物の前記フォーカス位置を予め設定する第1のモードにおいて、前記対象物の前記画像の中に前記フォーカス位置の基準となる基準領域と、前記所定の処理の対象となる対象領域とを設定して、前記基準領域および前記対象領域の各々の前記フォーカス位置を登録するステップと、
     前記所定の処理を実行する第2のモードにおいて、前記撮像装置が取得した画像における前記基準領域のフォーカス位置、および前記基準領域および前記対象領域の各々の登録されたフォーカス位置に基づいて、前記対象領域の前記フォーカス位置を決定するステップと、
     前記決定されたフォーカス位置で撮像された前記対象物の前記画像を用いて前記所定の処理を実行するステップとを実行させる、プログラム。
PCT/JP2019/031040 2018-08-23 2019-08-07 画像処理システム、画像処理方法およびプログラム WO2020039920A1 (ja)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2018-156215 2018-08-23
JP2018156215A JP7135586B2 (ja) 2018-08-23 2018-08-23 画像処理システム、画像処理方法およびプログラム

Publications (1)

Publication Number Publication Date
WO2020039920A1 true WO2020039920A1 (ja) 2020-02-27

Family

ID=69593021

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2019/031040 WO2020039920A1 (ja) 2018-08-23 2019-08-07 画像処理システム、画像処理方法およびプログラム

Country Status (2)

Country Link
JP (1) JP7135586B2 (ja)
WO (1) WO2020039920A1 (ja)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001296478A (ja) * 2000-04-12 2001-10-26 Matsushita Electric Ind Co Ltd 生化学物質の観察装置及び観察方法

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5993133B2 (ja) 2011-11-24 2016-09-14 株式会社キーエンス 画像処理センサ、フォーカス調整方法及びコンピュータプログラム

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001296478A (ja) * 2000-04-12 2001-10-26 Matsushita Electric Ind Co Ltd 生化学物質の観察装置及び観察方法

Also Published As

Publication number Publication date
JP2020030338A (ja) 2020-02-27
JP7135586B2 (ja) 2022-09-13

Similar Documents

Publication Publication Date Title
TWI538508B (zh) 一種可獲得深度資訊的影像擷取系統與對焦方法
JP5547105B2 (ja) 寸法測定装置、寸法測定方法及び寸法測定装置用のプログラム
JP5997989B2 (ja) 画像測定装置、その制御方法及び画像測定装置用のプログラム
JP2016170122A (ja) 計測装置
WO2020110712A1 (ja) 検査システム、検査方法およびプログラム
US8810799B2 (en) Height-measuring method and height-measuring device
US11423528B2 (en) Image inspection apparatus
US11024049B2 (en) Image measurement apparatus
US20120050518A1 (en) Inspecting apparatus and inspection method
US10827114B2 (en) Imaging system and setting device
JP2015108582A (ja) 3次元計測方法と装置
JP2013246052A (ja) 距離測定装置
KR101826127B1 (ko) 광학적 웨이퍼 검사 장치
WO2020039920A1 (ja) 画像処理システム、画像処理方法およびプログラム
JP7047725B2 (ja) 検査システム、検査方法およびプログラム
JP5544894B2 (ja) ウエハ検査装置及びウエハ検査方法
JP5281815B2 (ja) 光学デバイス欠陥検査方法及び光学デバイス欠陥検査装置
JP6312410B2 (ja) アライメント装置、顕微鏡システム、アライメント方法、及びアライメントプログラム
JP2006343143A (ja) 撮像素子の検査装置
JP7287533B2 (ja) 検査システム、検査方法およびプログラム
WO2020039922A1 (ja) 画像処理システム、画像処理方法およびプログラム
JPH06281588A (ja) 曲面を有する透明物体の微小欠点検査方法
JP7198731B2 (ja) 撮像装置、及びフォーカス調整方法
JPH0854349A (ja) カメラ及び該カメラを用いた画質検査装置
KR101846189B1 (ko) 자동 초점 조절 장치 및 그 방법

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

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

Country of ref document: EP

Kind code of ref document: A1