JP7135586B2 - Image processing system, image processing method and program - Google Patents

Image processing system, image processing method and program Download PDF

Info

Publication number
JP7135586B2
JP7135586B2 JP2018156215A JP2018156215A JP7135586B2 JP 7135586 B2 JP7135586 B2 JP 7135586B2 JP 2018156215 A JP2018156215 A JP 2018156215A JP 2018156215 A JP2018156215 A JP 2018156215A JP 7135586 B2 JP7135586 B2 JP 7135586B2
Authority
JP
Japan
Prior art keywords
focus position
image
image processing
area
mode
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2018156215A
Other languages
Japanese (ja)
Other versions
JP2020030338A (en
Inventor
豊 加藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Omron Corp
Original Assignee
Omron Corp
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 Omron Corp filed Critical Omron Corp
Priority to JP2018156215A priority Critical patent/JP7135586B2/en
Priority to PCT/JP2019/031040 priority patent/WO2020039920A1/en
Publication of JP2020030338A publication Critical patent/JP2020030338A/en
Application granted granted Critical
Publication of JP7135586B2 publication Critical patent/JP7135586B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Description

本発明は、画像処理システム、画像処理方法およびプログラムに関する。 The present invention relates to an image processing system, an image processing method and a program.

一般にカメラの分野では、合焦状態を判定し、被写体に合焦するようにレンズユニットのフォーカスレンズを移動させるオートフォーカス機能が知られている。たとえば特開2018-84701号公報(特許文献1)は、コントラスト検出方式または位相差検出方式を用いて、制限された範囲内で合焦を判断する焦点調節装置を開示する。 Generally, in the field of cameras, an autofocus function is known that determines the in-focus state and moves the focus lens of the lens unit so as to bring the subject into focus. For example, Japanese Patent Application Laid-Open No. 2018-84701 (Patent Document 1) discloses a focus adjustment device that uses a contrast detection method or a phase difference detection method to determine focus within a limited range.

特開2018-84701号公報JP-A-2018-84701

たとえば製品の検査を行う産業用機器においては、正確な検査のために製品にフォーカスの合った画像が得られることが望まれる。製造ラインを流れる製品を撮像する場合、製品ごとに、カメラからの距離が変動し得る。したがってカメラは、製品を撮像するたびにフォーカスを調整する必要がある。上記の産業用機器に限られないが、フォーカス位置を変更可能な撮像系を用いて対象物を撮像し、かつ、その対象物の画像を処理するシステムでは、正確かつ高速にフォーカスを調整することが望まれる。 For example, in industrial equipment for inspecting products, it is desirable to obtain an image in which the product is in focus for accurate inspection. When imaging products flowing through a manufacturing line, the distance from the camera may vary from product to product. The camera therefore needs to adjust its focus each time it images a product. In a system that captures an image of an object using an imaging system that can change the focus position and processes the image of the object, the focus is adjusted accurately and at high speed. is desired.

本発明の目的は、フォーカス位置を変更可能な撮像系を用いて対象物を撮像して、その対象物の画像を処理するシステムにおいて、正確および/または高速に対象物にフォーカスを合わせることを可能にすることである。 An object of the present invention is to enable accurate and/or high-speed focusing on an object in a system that images an object using an imaging system that can change the focus position and processes the image of the object. is to be

本開示の一例によれば、画像処理システムは、対象物を撮像して、対象物を含む画像を生成する撮像部と、撮像部から対象物の画像を取得して、画像に対して所定の処理を実行する画像処理部とを備える。撮像部は、フォーカス位置を変化させることが可能である。対象物のフォーカス位置を予め設定する第1のモードにおいて、画像処理部は、対象物の画像の中にフォーカス位置の基準となる基準領域と、画像処理部による所定の処理の対象となる対象領域とを設定して、基準領域および対象領域の各々のフォーカス位置を登録する。所定の処理を実行する第2のモードにおいて、画像処理部は、撮像部が取得した画像における基準領域のフォーカス位置、および基準領域および対象領域の各々の登録されたフォーカス位置に基づいて、対象領域のフォーカス位置を決定する。第2のモードにおいて、撮像部は、決定されたフォーカス位置で対象領域を撮像する。 According to an example of the present disclosure, an image processing system includes an imaging unit that captures an image of an object and generates an image that includes the object; and an image processing unit that executes processing. The imaging unit can change the focus position. In the first mode in which the focus position of the object is set in advance, the image processing unit divides the image of the object into 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. to register the focus position of each of the reference area and the target area. In the second mode of executing the predetermined process, the image processing unit extracts the target region based on the focus position of the reference region in the image acquired by the imaging unit and the registered focus positions of the reference region and the target region. determines the focus position of the In the second mode, the imaging section images the target area at the determined focus position.

この開示によれば、画像処理部は、第1のモードにおいて、基準領域と、対象領域とを設定して、基準領域および対象領域の各々のフォーカス位置を登録する。基準領域は、フォーカス位置の基準となる領域である。第2のモードにおいて、画像処理部は、その登録されたフォーカス位置、および、第2のモードにおいて撮像部が取得した画像における基準領域のフォーカス位置に基づいて、対象領域を撮像するためのフォーカス位置を求める。第1のモードおよび第2のモードでの基準領域のフォーカス位置の関係と、第1のモードにおける対象領域のフォーカス位置から、第2のモードでの対象領域のフォーカス位置を決定することができる。したがって撮像部は、正確および/または高速に対象領域にフォーカスを合わせることが可能である。 According to this disclosure, in the first mode, the image processing unit sets a reference area and a target area, and registers focus positions of each of the reference area and the target area. The reference area is an area that serves as a reference for the focus position. In the second mode, the image processing unit determines a focus position for imaging the target region based on the registered focus position and 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 positions 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 focus on the target area accurately and/or quickly.

上述の開示において、基準領域と対象領域とは、少なくとも一部が互いに重なり合うように各々定められる。 In the above disclosure, the reference area and the target area are each defined so as to at least partially overlap each other.

この開示によれば、基準領域と対象領域とが共通の領域を含むことができる。これにより、第2のモードにおいて対象領域のフォーカス位置を決定する際に、正確および/または高速に対象領域にフォーカスを合わせることが可能である。 According to this disclosure, the reference region and the target region may include common regions. Thereby, when determining the focus position of the target area in the second mode, it is possible to focus on the target area accurately and/or at high speed.

上述の開示において、画像処理部は、第2のモードにおいて、撮像部により撮像された画像内の基準領域の位置を、第1のモードにおいて登録された基準領域の位置と比較して、その比較の結果に基づいて、画像内の対象物の位置を修正する。 In the above disclosure, the image processing unit, in the second mode, compares the position of the reference area in the image captured by the imaging unit with the position of the reference area registered in the first mode, and Correct the position of the object in the image based on the result of

この開示によれば、基準領域を、位置ずれ修正用のモデルに兼用することができる。したがって、対象物にフォーカスの合った画像を得られるだけでなく、画像内における対象領域の位置のずれを修正することもできる。 According to this disclosure, the reference area can also be used as a model for misregistration correction. Therefore, it is possible not only to obtain an image in which the object is in focus, but also to correct the displacement of the object area in the image.

上述の開示において、画像処理部は、第2のモードにおいて、登録された基準領域のフォーカス位置と、第2のモードにおいて取得された基準領域のフォーカス位置との差を用いて、登録された対象領域のフォーカス位置を補正して、対象領域のフォーカス位置を決定する。 In the above disclosure, the image processing unit uses the difference between the focus position of the registered reference region in the second mode and the focus position of the reference region acquired in the second mode to obtain the registered target The focus position of the target region is determined by correcting the focus position of the region.

この開示によれば、第2のモードにおいて、対象領域のフォーカス位置を比較的単純な計算によって、決定することができる。 According to this disclosure, in the second mode, the focus position of the region of interest can be determined by relatively simple calculations.

上述の開示において、対象領域は無地の領域を含む。
この開示によれば、対象領域が無地の領域(すなわち明確なパターンを有さない領域)であっても、その対象領域のフォーカス位置を決定することができる。無地の領域とは、コントラストの低い領域である。このため、無地の領域の撮像において、フォーカスを合わせることが容易ではない場合がある。一方、この開示によれば、明確なパターンを有する基準領域でのフォーカス位置を用いて対象領域のフォーカス位置を決定することができる。したがって、無地の領域を含む対象領域を、フォーカスの合った状態で撮像することができる。
In the above disclosure, the target area includes plain areas.
According to this disclosure, the focus position of a target area can be determined even if the target area is a plain area (ie, an area without a distinct pattern). Solid areas are areas of low contrast. For this reason, it may not be easy to focus when imaging a plain area. On the other hand, according to this disclosure, the focus position in a reference region with a well-defined pattern can be used to determine the focus position in the target region. Therefore, the target area including the plain area can be imaged in focus.

上述の開示において、画像処理部は、第1のモードにおいて、対象領域に一時的に形成されたパターンを撮像部が撮像することにより得られた画像に基づいて、対象領域のフォーカス位置を決定する。 In the above disclosure, in the first mode, the image processing unit determines the focus position of the target region based on the image obtained by the imaging unit capturing the pattern temporarily formed in the target region. .

この開示によれば、フォーカス位置の決定に有利なパターンを対象領域に形成することができる。たとえば対象領域自体が明確なパターンを有さない領域であっても、一時的に対象領域に形成されたパターンにより、対象領域のフォーカス位置を決定することができる。したがって、第2のモードにおいて、対象領域のフォーカス位置をより正確に決定することができる。 According to this disclosure, a pattern can be formed in the region of interest that is advantageous for determining the focus position. For example, even if the target region itself does not have a clear pattern, the pattern temporarily formed in the target region can determine the focus position of the target region. Therefore, in the second mode, the focus position of the target area can be determined more accurately.

上述の開示において、画像処理部は、第1のモードにおいて、対象物の三次元形状の情報から基準領域と対象領域との間の高さの差分を取得して、高さの差分と、基準領域のフォーカス位置とを用いて、対象領域のフォーカス位置を決定する。 In the above disclosure, in the first mode, the image processing unit obtains a height difference between the reference region and the target region from information on the three-dimensional shape of the target, and calculates the height difference and the reference The focus position of the region is used to determine the focus position of the region of interest.

この開示によれば、基準領域のフォーカス位置と高さ情報とから、対象領域のフォーカス位置を決定することができる。したがって対象領域のフォーカス位置を比較的単純な計算によって、決定することができる。 According to this disclosure, the focus position of the target area can be determined from the focus position and height information of the reference area. Therefore, the focus position of the region of interest can be determined by relatively simple calculations.

本開示の一例によれば、画像処理方法は、対象物を撮像して、対象物を含む画像を生成する撮像部と、撮像部から対象物の画像を取得して、画像に対して所定の処理を実行する画像処理部とを備えた画像処理システムによる画像処理方法である。撮像部は、フォーカス位置を変化させることが可能である。画像処理方法は、対象物のフォーカス位置を予め設定する第1のモードにおいて、画像処理部が、対象物の画像の中にフォーカス位置の基準となる基準領域と、画像処理部による所定の処理の対象となる対象領域とを設定して、基準領域および対象領域の各々のフォーカス位置を登録するステップと、所定の処理を実行する第2のモードにおいて、画像処理部が、撮像部が取得した画像における基準領域のフォーカス位置、および基準領域および対象領域の各々の登録されたフォーカス位置に基づいて、対象領域のフォーカス位置を決定するステップと、第2のモードにおいて、撮像部が、決定されたフォーカス位置で対象領域を撮像するステップと、画像処理部が、決定されたフォーカス位置で撮像された対象物の前記画像を用いて前記所定の処理を実行するステップとを備える。 According to an example of the present disclosure, an image processing method includes an image capturing unit that captures an image of a target object and generates an image including the target object; An image processing method using an image processing system including an image processing unit that executes processing. The imaging unit can change the focus position. In the image processing method, in a first mode in which the focus position of the object is set in advance, the image processing unit creates a reference area serving as a reference for the focus position in the image of the object and a predetermined process performed by the image processing unit. In a step of setting a target region to be targeted and registering the focus position of each of the reference region and the target region, and in a second mode of executing a predetermined process, the image processing unit processes the image acquired by the imaging unit determining the focus position of the target area based on the focus position of the reference area and the registered focus positions of each of the reference area and the target area; capturing an image of the target area at the position; and performing the predetermined process using the image of the target captured at the determined focus position.

この開示によれば、第1のモードおよび第2のモードでの基準領域のフォーカス位置の関係と、第1のモードにおける対象領域のフォーカス位置から、第2のモードでの対象領域のフォーカス位置を決定することができる。したがって撮像部は、正確および/または高速に対象領域にフォーカスを合わせることが可能である。 According to this disclosure, the focus position of the target area in the second mode is determined from the relationship between the focus positions 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 decide. Therefore, the imaging unit can focus on the target area accurately and/or quickly.

本開示の一例によれば、プログラムは、撮像装置によって対象物を撮像することにより得られた画像を用いて所定の処理を実行するためのプログラムである。撮像装置は、フォーカス位置を変化させることが可能である。プログラムは、コンピュータに、対象物のフォーカス位置を予め設定する第1のモードにおいて、対象物の画像の中にフォーカス位置の基準となる基準領域と、所定の処理の対象となる対象領域とを設定して、基準領域および対象領域の各々のフォーカス位置を登録するステップと、所定の処理を実行する第2のモードにおいて、撮像装置が取得した画像における基準領域のフォーカス位置、および基準領域および対象領域の各々の登録されたフォーカス位置に基づいて、対象領域のフォーカス位置を決定するステップと、決定されたフォーカス位置で撮像された対象物の画像を用いて所定の処理を実行するステップとを実行させる。 According to an example of the present disclosure, the program is a program for executing predetermined processing using an image obtained by imaging an object with an imaging device. The imaging device can change the focus position. The program sets a reference area serving as a reference for the focus position and a target area to be subjected to predetermined processing in the image of the object in a first mode in which the focus position of the object is preset in the computer. and registering the focus position of each of the reference region and the target region; determining the focus position of the target region based on each registered focus position; and executing a predetermined process using the image of the target object captured at the determined focus position. .

この開示によれば、第1のモードおよび第2のモードでの基準領域のフォーカス位置の関係と、第1のモードにおける対象領域のフォーカス位置から、第2のモードでの対象領域のフォーカス位置を決定することができる。したがって画像処理部は、フォーカスの合った対象領域の画像を取得することができる。これにより画像処理部による処理の精度(たとえば画像の認識の正確度)を高めることができる。 According to this disclosure, the focus position of the target area in the second mode is determined from the relationship between the focus positions 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 decide. Therefore, the image processing section can acquire an image of the target region in focus. As a result, the accuracy of processing by the image processing unit (for example, the accuracy of image recognition) can be improved.

本発明によれば、フォーカス位置を変更可能な撮像系を用いて対象物を撮像して、その対象物の画像を処理するシステムにおいて、正確および/または高速に対象物にフォーカスを合わせることが可能になる。 According to the present invention, in a system for capturing an image of an object using an imaging system capable of changing the focus position and processing the image of the object, it is possible to focus on the object accurately and/or at high speed. become.

本実施の形態に係る画像処理システムの1つの適用例を示す模式図である。1 is a schematic diagram showing one application example of an image processing system according to an embodiment; FIG. 撮像装置の内部構成の一例を示す図である。It is a figure which shows an example of an internal structure of an imaging device. フォーカス位置の調整を説明するための模式図である。FIG. 5 is a schematic diagram for explaining focus position adjustment; レンズの構成の一例を示す図である。It is a figure which shows an example of a structure of a lens. フォーカス位置調整用レンズの他の一例を示す図である。FIG. 10 is a diagram showing another example of a focus position adjusting lens; 撮像装置によるワークの撮像を模式的に示した図である。FIG. 4 is a diagram schematically showing imaging of a workpiece by an imaging device; ワークにおける撮像対象の領域を示した図である。FIG. 4 is a diagram showing an imaging target area in a work; 本実施の形態によるフォーカス調整のための領域を示した図である。FIG. 4 is a diagram showing areas for focus adjustment according to the present embodiment; フォーカス位置の登録を説明するための図である。FIG. 4 is a diagram for explaining registration of a focus position; FIG. 検査時のフォーカス位置の調整を説明するための図である。FIG. 10 is a diagram for explaining focus position adjustment during inspection; 基準領域の指定の例を説明するための図である。FIG. 10 is a diagram for explaining an example of designation of a reference area; 検査領域の指定の例を説明するための図である。FIG. 4 is a diagram for explaining an example of designation of an inspection area; FIG. フォーカス位置の設定方法のフローを示したフローチャートである。4 is a flow chart showing a flow of a method for setting a focus position; 検査領域のフォーカス位置を求めるための治具の例である。It is an example of a jig for obtaining a focus position of an inspection area. 図14に示す治具を用いて検査領域のフォーカス位置を求める方法を示した図である。FIG. 15 is a diagram showing a method of obtaining a focus position of an inspection area using the jig shown in FIG. 14; 検査方法のフローを示したフローチャートである。It is the flowchart which showed the flow of the inspection method.

§1 適用例
まず、図1を参照して、本発明が適用される場面の一例について説明する。図1は、本実施の形態に係る画像処理システムの1つの適用例を示す模式図である。
§1 Application Example First, an example of a scene to which the present invention is applied will be described with reference to FIG. FIG. 1 is a schematic diagram showing one application example of the image processing system according to the present embodiment.

図1に示すように、本実施の形態に係る画像処理システム1は、たとえば外観検査システムとして実現される。外観検査システムは、たとえば工業製品の生産ラインなどにおいて、ステージ90上に載置されたワークW上の複数の検査対象位置を撮像し、得られた画像を用いて、ワークWの外観検査を行う。外観検査では、ワークWの傷、汚れ、異物の有無、寸法などが検査される。 As shown in FIG. 1, an image processing system 1 according to this embodiment is implemented as, for example, a visual inspection system. The visual inspection system takes images of a plurality of positions to be inspected on a work W placed on a stage 90, for example, in a production line for industrial products, and uses the obtained images to perform visual inspection of the work W. . In the appearance inspection, the workpiece W is inspected for flaws, stains, presence of foreign matter, dimensions, and the like.

ステージ90上に載置されたワークWの外観検査が完了すると、次のワーク(図示せず)がステージ90上に搬送される。ワークWの撮像の際、ワークWは、ステージ90上の予め定められた位置に予め定められた姿勢で静止してもよい。あるいは、ワークWがステージ90上を移動しながら、ワークWが撮像されてもよい。 After completing the visual inspection of the work W placed on the stage 90 , the next work (not shown) is transferred onto the stage 90 . During imaging of the work W, the work W may stand still at a predetermined position on the stage 90 in a predetermined posture. Alternatively, the image of the work W may be captured while the work W is moving on the stage 90 .

図1に示すように、画像処理システム1は、基本的な構成要素として、撮像装置10と、画像処理装置20とを備える。この実施の形態では、画像処理システム1は、さらに、PLC(Programmable Logic Controller)50と、入力/表示装置60とを備える。 As shown in FIG. 1, the image processing system 1 includes an imaging device 10 and an image processing device 20 as basic components. In this embodiment, the image processing system 1 further includes a PLC (Programmable Logic Controller) 50 and an input/display device 60 .

撮像装置10は、画像処理装置20に接続される。撮像装置10は、画像処理装置20からの指令に従って、撮像視野に存在する被写体(ワークW)を撮像して、ワークWの像を含む画像データを生成する。本実施の形態では、撮像装置10は、フォーカス位置を変化させることが可能な撮像系である。撮像装置10と画像処理装置20とは一体化されていてもよい。 The imaging device 10 is connected to the image processing device 20 . The image capturing device 10 captures an image of a subject (work W) existing in the image capturing field of view according to a command from the image processing device 20, and generates image data including an image of the work W. FIG. In this embodiment, the imaging device 10 is an imaging system capable of changing the focus position. The imaging device 10 and the image processing device 20 may be integrated.

撮像装置10は、フォーカス位置が可変のレンズモジュールを含む。フォーカス位置とは、ワークWの像が形成される位置を意味する。撮像装置10とワークWとの間の距離に応じてレンズモジュールのフォーカス位置が変更される。これにより、ワークWにフォーカスの合った画像を撮像することができる。なお、撮像装置10はオートフォーカス機能を有し、ワークWに自動的にフォーカスを合わせることができる。 The imaging device 10 includes a lens module with a variable focus position. A 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 workpiece W. FIG. As a result, an image in which the workpiece W is in focus can be captured. Note that the imaging device 10 has an autofocus function, and can automatically focus on the work W. FIG.

画像処理装置20は、撮像装置10からワークWの画像を取得する。画像処理装置20は、その画像に対して所定の処理を実行する。画像処理装置20は、判定部21と、出力部22と、記憶部23と、指令生成部24とを含む。 The image processing device 20 acquires an image of the work W from the imaging device 10 . The image processing device 20 executes predetermined processing on the image. Image processing device 20 includes determination unit 21 , output unit 22 , storage unit 23 , and command generation unit 24 .

判定部21は、撮像装置10によって生成された画像データに対して予め定められた処理を実行することにより、ワークWの外観の良否を判定する。出力部22は、判定部21による判定結果を出力する。たとえば、出力部22は、入力/表示装置60に判定結果を表示させる。 The determination unit 21 determines whether the appearance of the workpiece W is good or bad by executing predetermined processing on the image data generated by the imaging device 10 . The output unit 22 outputs the result of determination by the determination unit 21 . For example, the output unit 22 causes the input/display device 60 to display the determination result.

記憶部23は、各種のデータ、プログラム等を記憶する。たとえば記憶部23は、撮像装置10から取得された画像データ、および所定の処理が施された画像データを保存する。記憶部23は、判定部21による判定結果を保存してもよい。さらに、記憶部23は、各種の処理を画像処理装置20に実行させるためのプログラムを記憶する。 The storage unit 23 stores various data, programs, and the like. For example, the storage unit 23 stores image data acquired from the imaging device 10 and image data that has undergone predetermined processing. The storage unit 23 may store the determination result by the determination unit 21 . Further, the storage unit 23 stores programs for causing the image processing device 20 to execute various types of processing.

指令生成部24は、PLC50からの制御指令を受けて、撮像装置10に撮像指令(撮像トリガ)を出力する。 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 .

画像処理装置20はPLC50に接続される。PLC50は画像処理装置20を制御する。たとえばPLC50は、画像処理装置20が撮像指令(撮像トリガ)を撮像装置10に出力するためのタイミングを制御する。 The image processing device 20 is connected to the PLC 50 . The PLC 50 controls the image processing device 20 . For example, the PLC 50 controls timing for the image processing device 20 to output an imaging command (imaging trigger) to the imaging device 10 .

入力/表示装置60は、画像処理装置20に接続される。入力/表示装置60は、画像処理システム1の各種の設定に関するユーザの入力を受け付ける。さらに、入力/表示装置60は、画像処理システム1の設定に関する情報、画像処理装置20によるワークWの画像処理の結果(たとえば製品の外観の良否を判定した結果)などの情報を表示する。 An input/display device 60 is connected to the image processing device 20 . The input/display device 60 receives user input regarding various settings of the image processing system 1 . Further, the input/display device 60 displays information regarding the settings of the image processing system 1, the result of image processing of the workpiece W by the image processing device 20 (for example, the result of judging the appearance of the product), and other information.

本実施の形態では、ワークWのフォーカス位置を予め設定する第1のモードにおいて、画像処理装置20は、ワークWの画像の中にフォーカス位置の基準となる基準領域と、画像処理装置20による所定の処理の対象となる対象領域とを設定して、基準領域および対象領域の各々のフォーカス位置を登録する。所定の処理を実行する第2のモードにおいて、画像処理装置20は、撮像装置10が取得した画像における基準領域のフォーカス位置、および、基準領域および対象領域の各々の登録されたフォーカス位置に基づいて、対象領域のフォーカス位置を決定する。第2のモードにおいて、撮像装置10は、決定されたフォーカス位置で対象領域を撮像する。 In the present embodiment, in the first mode in which the focus position of the work W is set in advance, the image processing device 20 includes a reference region serving as a reference for the focus position in the image of the work W, and a predetermined region by the image processing device 20. , and register the focus position of each of the reference area and the target area. In the second mode of executing predetermined processing, the image processing device 20 performs the following operations based on the focus position of the reference region in the image acquired by the imaging device 10 and the registered focus positions of the reference region and the target region. , to determine the focus position of the region of interest. In the second mode, the imaging device 10 images the target area at the determined focus position.

基準領域は、フォーカス位置の基準となる領域である。第1のモードおよび第2のモードでの基準領域のフォーカス位置の関係と、第1のモードにおける対象領域のフォーカス位置から、第2のモードでの対象領域のフォーカス位置を決定することができる。これにより撮像装置10は、対象領域に正確にフォーカスを合わせることが可能である。また、撮像装置10は、第2のモードにおいて、対象領域に高速にフォーカスを合わせることができる。 The reference area is an area that serves 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 positions of the reference area in the first mode and the second mode and the focus position of the target area in the first mode. This allows the imaging device 10 to accurately focus on the target region. In addition, the imaging device 10 can focus on the target area at high speed in the second mode.

図2は、撮像装置10の内部構成の一例を示す図である。図2に示されるように、撮像装置10は、照明部11と、レンズモジュール12と、撮像素子13と、撮像素子制御部14と、レンズ制御部16と、レジスタ15,17と、通信I/F部18とを含む。 FIG. 2 is a diagram showing an example of the internal configuration of the imaging device 10. As shown in FIG. As shown in FIG. 2, the imaging apparatus 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 interface. and F section 18 .

照明部11は、ワークWに対して光を照射する。照明部11から照射された光は、ワークWの表面で反射し、レンズモジュール12に入射する。照明部11は省略されてもよい。 The illumination unit 11 irradiates the work W with light. Light emitted from the illumination unit 11 is reflected by the surface of the work W and enters the lens module 12 . The lighting section 11 may be omitted.

レンズモジュール12は、ワークWからの反射光を撮像素子13の撮像面13a上に結像させる。レンズモジュール12は、レンズ12aと、レンズ群12bと、レンズ12cと、可動部12dと、フォーカス調整部12eとを有する。レンズ12aは、主としてフォーカス位置を変更するためのレンズである。フォーカス調整部12eは、レンズ12aを制御して、フォーカス位置を変更する。 The lens module 12 forms an image of the reflected light from the workpiece 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 portion 12d, and a focus adjustment portion 12e. The lens 12a is a lens mainly for changing the focus position. The focus adjustment unit 12e controls the lens 12a to change the focus position.

レンズ群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 12 c is a lens that is fixed at a predetermined position within the imaging device 10 .

撮像素子13は、たとえばCMOS(Complementary Metal Oxide Semiconductor)イメージセンサなどの光電変換素子であり、撮像視野からの光を画像信号に変換する。 The imaging element 13 is a photoelectric conversion element such as a CMOS (Complementary Metal Oxide Semiconductor) image sensor, and converts light from an imaging field into an image signal.

撮像素子制御部14は、通信I/F部18を介して画像処理装置20から撮像指令を受けると、図示しないシャッターを開いて露光し、撮像素子13からの画像信号に基づいて画像データを生成する。このとき、撮像素子制御部14は、撮像位置に対応するシャッター速度(露光時間)となるようにシャッターを開閉し、予め設定された解像度の画像データを生成する。撮像位置に対応するシャッター速度および解像度を示す情報は、予めレジスタ15に記憶されている。撮像素子制御部14は、生成した画像データを通信I/F部18を介して画像処理装置20に出力する。 When the imaging device control unit 14 receives 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) for exposure, and generates image data based on the image signal from the imaging device 13 . do. At this time, the imaging device control unit 14 opens and closes the shutter so that the shutter speed (exposure time) corresponds to the imaging position, and generates image data with a preset resolution. Information indicating the shutter speed and resolution corresponding to the imaging position is stored in the register 15 in advance. The imaging device control section 14 outputs the generated image data to the image processing device 20 via the communication I/F section 18 .

レンズ制御部16は、レジスタ17が記憶する命令に従って、撮像装置10のフォーカスを調整する。具体的には、レンズ制御部16は、ワークWの撮像される領域に応じてフォーカス位置が変化するように、フォーカス調整部12eを制御する。フォーカス調整部12eは、レンズ制御部16の制御により、レンズ12aの位置を調整する。つまり、レンズ制御部16は、ワークWの撮像対象領域にフォーカスが合うように、レンズ12aを制御する。「フォーカスが合う」とは、ワークWの撮像対象領域の像が撮像素子13の撮像面13aに形成されることを意味する。レンズ12aについては、後で詳細に説明する。 The lens control unit 16 adjusts the focus of the imaging device 10 according to the instructions 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 area of the work W to be imaged. The focus adjustment unit 12 e adjusts the position of the lens 12 a under the control of the lens control unit 16 . That is, the lens control unit 16 controls the lens 12a so that the imaging target area of the workpiece W is in focus. “In focus” means that an image of the imaging target area of the workpiece W is formed on the imaging surface 13 a of the imaging element 13 . Lens 12a will be described in detail later.

レンズ制御部16は、ワークWのうち撮像視野内に含まれる領域の大きさが略一定になるように、可動部12dを制御して、レンズ群12bの位置を調整してもよい。言い換えると、レンズ制御部16は、ワークWのうち撮像視野内に含まれる領域の大きさが予め定められた範囲内になるように、可動部12dを制御することができる。レンズ制御部16は、撮像位置とワークWとの距離に応じてレンズ群12bの位置を調整すればよい。なお、この実施の形態では、ズームの調整は必須ではない。 The lens control section 16 may control the movable section 12d to adjust the position of the lens group 12b so that the size of the area of the workpiece W included in the imaging field is substantially constant. In other words, the lens control section 16 can control the movable section 12d so that the size of the area of the workpiece W included in the imaging 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 workpiece W. Note that zoom adjustment is not essential in this embodiment.

§2 具体例
<A.フォーカス調整のための構成例>
図3は、フォーカス位置の調整を説明するための模式図である。説明を簡単にするため、図3には、1枚のレンズ(レンズ12a)のみを示している。
§2 Concrete example <A. Configuration Example for Focus Adjustment>
FIG. 3 is a schematic diagram for explaining focus position adjustment. For simplicity of explanation, FIG. 3 shows only one lens (lens 12a).

図3に示すように、レンズ12aの主点Oから対象面(ワークWの表面)までの距離をaとし、レンズ12aの主点Oから撮像面13aまでの距離をbとし、レンズ12aの主点Oからレンズ12aの焦点Fまでの距離(焦点距離)をfとする。ワークWの像の位置が撮像面13aの位置に等しい場合、以下の式(1)が成立する。 As shown in FIG. 3, let a be the distance from the principal point O of the lens 12a to the target surface (surface of the workpiece W), b be the distance from the principal point O of the lens 12a to the imaging surface 13a, and b be the distance from the principal point O of the lens 12a. Let f be the distance (focal length) from the point O to the focal point F of the lens 12a. When the position of the image of the workpiece W is equal to the position of the imaging surface 13a, the following formula (1) holds.

1/a+1/b=1/f・・・(1)
ワークWの表面の高さに応じて、ワーキングディスタンス(WD)が変化し得る。ワーキングディスタンスは、レンズ12aのワークW側の面から、ワークWまでの距離であると定義される。式(1)が成り立つときに、ワークWの表面にフォーカスが合った状態の画像を撮像することができる。たとえば距離bを変化させることによって、フォーカスの調整が可能である。
1/a+1/b=1/f (1)
The working distance (WD) can change according to the height of the surface of the work W. FIG. The working distance is defined as the distance from the work W side surface of the lens 12a to the work W. When the formula (1) holds, an image in which the surface of the workpiece W is in focus can be captured. For example, the focus can be adjusted by changing the distance b.

距離bの変化量は、基準となる距離からのオフセットとして表すことができる。本実施の形態では、このオフセットを「レンズの繰り出し量」と呼ぶ。レンズ12aのワークW側の面からワークWの表面までの距離をレンズ操出し量に関連づけることによって、ワークWの表面にフォーカスの合った画像を得るためのレンズ操出し量を決定することができる。なお、距離bの基準値は任意に定めることができる。たとえば距離bの基準値を焦点距離fの値としてもよい。 The amount of change in the distance b can be represented as an offset from the reference distance. In the present embodiment, this offset is referred to as "lens extension amount". By associating the distance from the surface of the lens 12a on the work W side to the surface of the work W with the lens movement amount, the lens movement amount for obtaining an image in focus on the surface of the work W can be determined. . Note that the reference value of the distance b can be arbitrarily determined. For example, the reference value of the distance b may be the value of the focal length f.

上述のように、撮像装置10は、オートフォーカス機能を有する。したがって、撮像装置10が、ワークWの画像から合焦の度合いを判断して、フォーカス位置を調整する。フォーカス位置を調整するためのレンズ12aの構成は特に限定されない。以下に、レンズ12aの構成の例を説明する。 As described above, the imaging device 10 has an autofocus function. Therefore, the imaging device 10 determines the degree of focus from the image of the workpiece W and adjusts the focus position. The configuration of the lens 12a for adjusting the focus position is not particularly limited. An example of the configuration of the lens 12a will be described below.

図4は、レンズ12aの構成の一例を示す図である。図4に示した構成では、フォーカス調整部12eは、レンズ12aを、光軸方向に沿って移動させる。レンズ12aの位置を変更することによって、レンズ12aの繰り出し量が変化する。したがって、ワーキングディスタンスWDの変化に応じて、ワークWの像が撮像面13aに形成されるように、レンズ12aが移動する。 FIG. 4 is a diagram showing an example of the configuration of the lens 12a. In the configuration shown in FIG. 4, the focus adjustment unit 12e moves the lens 12a along the optical axis direction. By changing the position of the lens 12a, the extension amount of the lens 12a changes. Therefore, the lens 12a moves so that the image of the workpiece W is formed on the imaging surface 13a according to the change in the working distance WD.

なお、図3および図4では、1枚のレンズの例が示されている。通常では、FA用のレンズは複数枚の組レンズで構成されることが多い。しかしながら、組レンズにおいても、各レンズの焦点距離fと、レンズ間の位置関係を用いて、合成された焦点距離fおよびレンズ主点の位置を求めることができる。その特性値を用いることでWDを計算することができる。 3 and 4 show an example of one lens. Normally, FA lenses are often composed of a combination of a plurality of lenses. However, even in the combined lens, 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 value.

図4では、機械的な方式によりフォーカス位置が調整される例が示される。しかし、フォーカス位置の調整の方式は機械的な方式に限定されない。図5は、フォーカス位置調整用レンズの他の一例を示す図である。 FIG. 4 shows an example in which the focus position is adjusted by a mechanical method. However, the method of adjusting the focus position is not limited to the mechanical method. FIG. 5 is a diagram showing another example of the focus position adjusting lens.

図5に例示されているのは、液体レンズである。レンズ12aは、透光性容器70と、電極73a,73b,74a,74bと、絶縁体75a,75bと、絶縁層76a,76bとを含む。 Illustrated 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 closed 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 indices.

電極73a,73bは、絶縁体75a,75bと透光性容器70との間にそれぞれ固定され、導電性液体71中に位置する。 Electrodes 73 a and 73 b are fixed between insulators 75 a and 75 b and translucent container 70 respectively and positioned in conductive liquid 71 .

電極74a,74bは、導電性液体71と絶縁性液体72との界面の端部付近に配置される。電極74aと導電性液体71および絶縁性液体72との間には絶縁層76aが介在する。電極74bと導電性液体71および絶縁性液体72との間には絶縁層76bが介在する。電極74aと電極74bとは、レンズ12aの光軸に対して対称な位置に配置される。 Electrodes 74 a and 74 b are arranged near the edges of the interface between conductive liquid 71 and insulating liquid 72 . An insulating layer 76a is interposed between the electrode 74a and the conductive liquid 71 and insulating liquid 72 . An insulating layer 76b is interposed between the electrode 74b and the conductive liquid 71 and insulating liquid 72 . The electrodes 74a and 74b are arranged at symmetrical positions 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 section 12e includes a voltage source 12e1 and a voltage source 12e2. The voltage source 12e1 applies a voltage Va between the electrodes 74a and 73a. Voltage source 12e2 applies voltage Vb between electrode 74b and electrode 73b.

電極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のフォーカス位置を調整することができる。 When a voltage Va is applied between the electrodes 74a and 73a, the conductive liquid 71 is pulled by the electrodes 74a. Similarly, when voltage Vb is applied between electrodes 74b and 73b, conductive liquid 71 is pulled toward electrode 74b. This changes the curvature of the interface between the conductive liquid 71 and the insulating liquid 72 . Since the refractive indices of the conductive liquid 71 and the insulating liquid 72 are different, the curvature of the interface between the conductive liquid 71 and the insulating liquid 72 changes, thereby increasing the focal length of the lens 12a (focal length f ) changes. The curvature of the interface depends on the magnitude of the voltages Va and Vb. Therefore, by changing 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 if the working distance WD changes.

通常は、電圧Vaと電圧Vbとは同値に制御される。これにより、導電性液体71と絶縁性液体72との界面は、光軸に対して対称に変化する。ただし、電圧Vaと電圧Vbとが異なる値に制御されてもよい。これにより、導電性液体71と絶縁性液体72との界面が光軸に対して非対称となり、撮像装置10の撮像視野の向きを変更することができる。 Normally, voltage Va and voltage Vb are controlled to have 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, voltage Va and 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 direction of the imaging field of view of the imaging device 10 can be changed.

さらに液体レンズと固体レンズとを組み合わせてもよい。この場合、焦点距離fに加えてレンズの主点の位置が変化する。したがって距離bが変化するため、その変化分を考慮したフォーカス調整を行えばよい。 Furthermore, a liquid lens and a solid lens may be combined. In this case, the position of the principal point of the lens changes in addition to the focal length f. Therefore, since the distance b changes, the focus adjustment should be performed in consideration of the change.

<B.画像処理装置>
画像処理装置20は、CPU(Central Processing Unit)、RAM(Random Access Memory)、ROM(Read Only Memory)、補助記憶装置、通信I/F等を含み、情報処理を行なう。補助記憶装置は、たとえば、ハードディスクドライブ、ソリッドステートドライブ等で構成され、CPUが実行するプログラム等を記憶する。
<B. Image processing device>
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, etc., and performs information processing. The auxiliary storage device is composed of, for example, a hard disk drive, a solid state drive, etc., and stores programs and the like executed by the CPU.

画像処理装置20の判定部21は、たとえば、記憶部23に予め記憶しておいた良品ワークの画像との間の差分画像を2値化し、しきい値を超えた画素数と基準値とを照合することにより、検査対象位置の良否を判定してもよい。画像処理装置20の出力部22は、判定結果を入力/表示装置60に表示してもよい。 The determination unit 21 of the image processing device 20 binarizes, for example, the difference image between the image of the non-defective work previously stored in the storage unit 23, and determines the number of pixels exceeding the threshold value and the reference value. The pass/fail of the position to be inspected 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 .

<C.ワークの例およびフォーカス調整の課題>
図6は、撮像装置によるワークWの撮像を模式的に示した図である。図7は、ワークWにおける撮像対象の領域を示した図である。図6および図7に示した例において、ワークWは、領域W1と領域W2とを有する。領域W1は、たとえば透明体(ガラスなど)の表面である。領域W2は領域W1を囲む領域であり、たとえば電子機器の筐体の表面である。このようなワークWの例として、ディスプレイを有する電子機器(一例では、スマートフォンあるいはタブレットなど)を挙げることができる。すなわち領域W1は、表示画面でありえる。また、領域W1は、明確なパターンを有していない。すなわち領域W1は無地の領域である。
<C. Examples of workpieces and focus adjustment issues>
FIG. 6 is a diagram schematically showing imaging of the workpiece W by the imaging device. FIG. 7 is a diagram showing a region of the workpiece W to be imaged. In the examples shown in FIGS. 6 and 7, the work W has a region W1 and a region W2. Region W1 is, for example, the surface of a transparent body (such as glass). A region W2 is a region surrounding the region W1, and is, for example, the surface of the housing of the electronic device. An example of such a work W is an electronic device having a display (one example is a smart phone or a tablet). That is, the area W1 can be the display screen. Also, the region W1 does not have a distinct pattern. That is, the area W1 is a blank area.

領域W1内に、検査領域A1が設定される。検査領域A1は、撮像装置10によって撮像される。外観検査では、検査領域A1を含む領域が撮像装置10により撮像されて、検査領域A1の画像が画像処理装置20(図示せず)による所定の処理の対象となる。画像処理装置20は、検査領域A1の画像を用いて、検査領域A1内に傷、汚れ、あるいは異物が有るかどうかを検査する。 An inspection area A1 is set within the area W1. The inspection area A1 is imaged by the imaging device 10 . In the appearance inspection, an area including the inspection area A1 is imaged by the imaging device 10, and the 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 scratch, stain, or foreign matter in the inspection area A1.

検査領域A1にフォーカスが合っていない状態で検査領域A1を撮像した場合、取得された画像から、検査領域A1内の傷などを検出できない可能性がある。精度の高い外観検査を行うためには、撮像装置10のフォーカスを検査領域A1に合わせることが求められる。しかし上述の例のように、検査領域A1が無地の領域の一部である場合、検査領域A1には明確なパターンが形成されていない。このような場合、検査領域A1内でのコントラストの差が小さいため、撮像装置10がフォーカスの合った検査領域A1の画像を撮像するのが難しいという課題がある。 If an image of the inspection area A1 is captured while the inspection area A1 is out of focus, there is a possibility that a flaw or the like in the inspection area A1 cannot be detected from the acquired image. In order to perform a highly accurate appearance inspection, it is required that the imaging device 10 be focused on the inspection area A1. However, if the inspection area A1 is part of a blank area, as in the example above, no distinct pattern is formed in the inspection area A1. In such a case, since the difference in contrast within the inspection area A1 is small, there is a problem that it is difficult for the imaging device 10 to capture an image of the inspection area A1 that is in focus.

<D.本実施の形態によるフォーカス調整>
本実施の形態によれば、フォーカス調整は、2つのモードを有する。第1のモードは、指定された領域におけるフォーカス位置を予め決定するモードである。指定された領域は、フォーカス位置の基準となる基準領域、および画像処理部による所定の処理の対象となる対象領域である。第2のモードは実際の検査において、フォーカス位置を決定するモードである。
<D. Focus Adjustment According to the Present Embodiment>
According to this embodiment, focus adjustment has two modes. A first mode is a mode in which a focus position in a designated area is determined in advance. The designated areas are a reference area that serves as a reference for the focus position, and a target area that is subject to predetermined processing by the image processing unit. The second mode is the mode for determining the focus position in the actual inspection.

図8は、本実施の形態によるフォーカス調整のための領域を示した図である。本実施の形態では、検査領域A1とは別に、フォーカスの基準となる領域(基準領域B1)を設定する。 FIG. 8 is a diagram showing areas for focus adjustment according to this embodiment. In the present embodiment, an area (reference area B1) serving as a focus reference is set apart from the inspection area A1.

図8に示す例によれば、基準領域B1は、領域W2の一部を含む。たとえば基準領域は、領域W2の端部を含む領域であり、ワークWの外郭線を含む。したがって基準領域B1は、ワークWと、ワークWの周囲との境界を含む。これにより、基準領域B1は、明確なパターンを含むことができる。このように、基準領域B1の画像は、合焦度を判定可能な程度のコントラストを有している。 According to the example shown in FIG. 8, the reference area B1 includes part of the area W2. For example, the reference area is an area that includes the edge of area W2 and includes the outline of workpiece W. FIG. Therefore, the reference area B1 includes the boundary between the work W and its surroundings. This allows the reference area B1 to contain a distinct pattern. In this way, the image of the reference area B1 has a contrast that allows determination of the degree of focus.

図8に示すように、一つの実施例では、基準領域B1と検査領域A1とは、少なくとも一部が互いに重なり合うように各々定められる。これにより基準領域B1と検査領域A1とが共通の領域を含むことができる。したがって、第2のモードにおいて検査領域A1のフォーカス位置を決定する際に、正確および/または高速に検査領域A1にフォーカスを合わせることが可能である。なお、「基準領域B1と検査領域A1との少なくとも一部が互いに重なり合う」とは、上述の例に限定されない。基準領域B1が検査領域A1に含まれていてもよい。逆に、検査領域A1が基準領域B1に含まれていてもよい。また、本実施の形態では、必ずしも、基準領域B1と検査領域A1との少なくとも一部が互いに重なり合っていなくてもよい。すなわち基準領域B1と検査領域A1とが全く重なり合っていなくてもよい。 As shown in FIG. 8, in one embodiment, the reference area B1 and the inspection area A1 are each defined so as to at least partially overlap each other. This allows the reference area B1 and the inspection area A1 to include a common area. Therefore, when determining the focus position of the inspection area A1 in the second mode, it is possible to focus on the inspection area A1 accurately and/or at high speed. Note that "at least a part of the reference area B1 and the inspection area A1 overlap each other" is not limited to the above example. The reference area B1 may be included in the inspection area A1. Conversely, the inspection area A1 may be included in the reference area B1. Further, in the present embodiment, at least a portion of the reference area B1 and the inspection area A1 do not necessarily have to overlap each other. That is, the reference area B1 and the inspection area A1 may not overlap at all.

また、図8の例では、基準領域B1および検査領域A1は、いずれも矩形であるが、基準領域B1および検査領域A1の各々の形状は、矩形であると限定されない。たとえば基準領域B1および検査領域A1の少なくとも一方の形状が、円形、あるいは領域を形成することが可能な任意の自由な形状であってもよい。また、基準領域B1および検査領域A1の少なくとも一方は、1つにまとまった領域であると限定される必要はない。たとえば、基準領域B1および検査領域A1の少なくとも一方は、分散して存在する複数の領域であってもよい。 In the example of FIG. 8, both the reference area B1 and the inspection area A1 are rectangular, but the shape of each of the reference area B1 and the inspection area A1 is not limited to being rectangular. For example, the shape of at least one of the reference area B1 and the inspection area A1 may be circular or any free shape that can form the area. Also, at least one of the reference area B1 and the inspection area A1 need not be limited to being a unified area. For example, at least one of the reference area B1 and the inspection area A1 may be a plurality of dispersed areas.

本実施の形態では、実際の検査に先立って、基準領域および検査領域を設定するとともに、それらの領域のフォーカス位置を画像処理装置20に登録する。図9は、フォーカス位置の登録を説明するための図である。図9を参照して、サンプルのワークWを撮像装置10により撮像して、ワークWの画像を取得する。ワークWの画像から基準領域B1および検査領域A1がそれぞれ指定されて、基準領域B1および検査領域A1の画像が画像処理装置20に登録される。 In this embodiment, prior to actual inspection, a reference area and an inspection area are set, and the focus positions of these areas are registered in the image processing device 20 . FIG. 9 is a diagram for explaining registration of the focus position. Referring to FIG. 9, an image of a sample workpiece W is captured by an imaging device 10 to obtain an image of the workpiece W. As shown in FIG. A reference area B1 and an inspection area A1 are respectively designated from the image of the workpiece W, and the images of the reference area B1 and the inspection area A1 are registered in the image processing device 20 .

さらに、基準領域B1にフォーカスが合うときのフォーカス位置、および検査領域A1にフォーカスが合うときのフォーカス位置がそれぞれ画像処理装置20に登録される。基準領域B1および検査領域A1のそれぞれのフォーカス位置がf0,f1であるとする。画像処理装置20は、フォーカス位置の値(f0,f1)を画像処理装置20の内部に登録する。あるいは、画像処理装置20は、フォーカス位置の値をレンズの繰り出し量に変換して、その繰り出し量の値を記憶するのでもよい。 Furthermore, the focus position when the reference region B1 is in focus and the focus position when the inspection region A1 is in focus are registered in the image processing device 20, respectively. Assume 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 focus position values (f0, f1) inside the image processing device 20 . Alternatively, the image processing device 20 may convert the value of the focus position into a lens extension amount and store the value of the extension amount.

図10は、検査時のフォーカス位置の調整を説明するための図である。図10を参照して、検査対象のワークWが撮像装置10により撮像される。画像処理装置20は、ワークWの画像から基準領域B1を検索して、その基準領域B1のフォーカス位置を求める。そのフォーカス位置をf2とする。 FIG. 10 is a diagram for explaining focus position adjustment during inspection. Referring to FIG. 10, an image of workpiece W to be inspected is captured by imaging device 10 . The image processing device 20 searches the reference area B1 from the image of the workpiece W and obtains the focus position of the reference area B1. Assume that the focus position is f2.

次に、そのフォーカス位置に基づいて、検査領域A1のフォーカス位置を算出する。このときの検査領域A1のフォーカス位置であるf3は、f3=f1+(f2-f0)と表される。上記のようにして、検査領域A1のフォーカス位置f3が決定されると、そのフォーカス位置f3に従って、撮像装置10はワークWを撮像する。画像処理装置20は、その画像を用いて、検査領域A1を検査する。 Next, the focus position of the inspection area A1 is calculated based on the focus position. The focus position f3 of the inspection area A1 at this time is expressed as f3=f1+(f2-f0). When the focus position f3 of the inspection area A1 is determined as described above, the imaging device 10 images the workpiece W according to the focus position f3. The image processing device 20 inspects the inspection area A1 using the image.

図11は、基準領域の指定の例を説明するための図である。図12は、検査領域の指定の例を説明するための図である。図11および図12に示すように、入力/表示装置60は、ディスプレイを有する。ディスプレイは、撮像装置10によって撮像されたワークWの画像を表示する。ユーザは、ワークWの画像を見ながら、基準領域B1を指定する(図11を参照)。次に、ユーザは、同じ画像を参照しながら、検査領域A1を指定する。たとえばユーザは、マウス等のポインティングデバイスを用いて、基準領域B1および検査領域A1の各々を指定する。このとき、ユーザの指定する領域を示す枠線が入力/表示装置60のディスプレイに表示される。なお、検査領域A1を指定する際に、基準領域B1を示す枠線が同時に表示されていてもよい。 FIG. 11 is a diagram for explaining an example of designation of a reference area. FIG. 12 is a diagram for explaining an example of specifying an inspection area. As shown in FIGS. 11 and 12, input/display device 60 has a display. The display displays an image of the work W imaged by the imaging device 10 . The user designates the reference area B1 while looking at the image of the workpiece W (see FIG. 11). Next, the user designates an inspection area A1 while referring to the same image. For example, the user uses a pointing device such as a mouse to designate each of the reference area B1 and the inspection area A1. At this time, a frame line indicating the area designated by the user is displayed on the display of the input/display device 60 . Note that when specifying the inspection area A1, a frame line indicating the reference area B1 may be displayed at the same time.

図13は、フォーカス位置の設定方法のフローを示したフローチャートである。なお、図13に示す処理は、上述の「第1のモード」における撮像装置10および画像処理装置20の処理に対応する。また、以下に説明するフローチャートの処理は、画像処理装置20の判定部21が、記憶部23に記憶されたプログラムを読み出すことにより実行される。後述する図16に示す処理も同様である。 FIG. 13 is a flow chart showing the flow of the focus position setting method. Note that the processing shown in FIG. 13 corresponds to the processing of the imaging device 10 and the image processing device 20 in the "first mode" described above. Further, 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, which will be described later.

図13を参照して、ステップS11において、撮像装置10は、検査対象物のサンプル(以下、「ワークサンプル」)を撮像する。画像処理装置20は、撮像装置10からワークサンプルの画像データを取得する。 Referring to FIG. 13, in step S11, imaging device 10 images a sample of an inspection object (hereinafter, "work sample"). The image processing device 20 acquires image data of the work sample from the imaging device 10 .

ステップS12において、基準領域B1が設定される。上述のように、たとえば入力/表示装置60のディスプレイにワークサンプルの画像が表示される。ユーザが、ポインティングデバイス等の入力デバイスを操作することにより、画像の一部の領域が基準領域として設定される。画像処理装置20は、基準領域B1の画像データを記憶部23に格納する。 In step S12, a reference area B1 is set. An image of the work sample is displayed, for example, on the display of the input/display device 60, as described above. A partial area of the image is set as the reference area by the user operating an input device such as a pointing device. The image processing device 20 stores the image data of the reference region B1 in the storage unit 23. FIG.

ステップS13において、基準領域B1のフォーカス位置が設定される。たとえば撮像装置10は、レンズ12aのフォーカス位置を変化させながらワークサンプルを撮像する。これにより、基準領域B1の複数の画像が得られる。複数の画像の各々を判定して、中から最もフォーカスが合った画像が選択される。その画像に対応したフォーカス位置が、基準領域B1のフォーカス位置f0として決定される。f0の値は、画像処理装置20の記憶部23に格納される。 In step S13, the focus position of the reference area B1 is set. For example, the imaging device 10 images the 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 multiple images is determined and the most focused image is selected from among them. A 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. FIG.

複数の画像の中から最もフォーカスが合った画像を選択するための方法は限定されない。ユーザが複数の画像の中から1つの画像を選択してもよい。画像処理装置20が、複数の画像の中から最もフォーカスが合った画像を判定してもよい。たとえば画像処理装置20は、複数の画像のうち、ワークWのエッジでの色あるいは明るさ等の変化が最も大きい画像を選択してもよい。 The method for selecting the most focused image from multiple images is not limited. A user may select one image from a plurality of images. The image processing device 20 may determine the most focused image among the plurality of images. For example, the image processing device 20 may select, from among the plurality of images, the image in which the edge of the work W has the greatest change in color, brightness, or the like.

ステップS14において、検査領域A1が設定される。ステップS12の処理と同様に、入力/表示装置60のディスプレイに、ステップS11の処理により取得されたワークサンプルの画像が表示される。ユーザが、ポインティングデバイス等の入力デバイスを操作することにより、画像の一部の領域が検査領域A1として設定される。画像処理装置20は、検査領域A1の画像データを記憶部23に格納する。 In step S14, an inspection area A1 is set. As in the process of step S12, the display of the input/display device 60 displays the image of the work sample obtained by the process of step S11. A partial area of the image is set as the inspection area A1 by the user operating an input device such as a pointing device. The image processing device 20 stores the image data of the inspection area A1 in the storage unit 23 .

ステップS15において、検査領域A1のフォーカス位置f1が設定される。フォーカス位置f1を求める方法として、たとえば以下の方法を例示することができる。 In step S15, the focus position f1 of the inspection area A1 is set. As a method of obtaining the focus position f1, for example, the following method can be exemplified.

第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のより正確なフォーカス位置を決定することができる。 A first method is to obtain the focus position f1 using a jig. FIG. 14 shows 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. As shown in FIGS. 14 and 15, 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 installed so that the pattern 102 of the jig 100 is in contact with the work sample region W1. As a result, a temporary pattern 102 is formed on the area W1 of the work sample as seen from the imaging device 10 . The temporarily formed pattern can accurately determine the focus position of the inspection area A1. Using this focus position, the focus position of the inspection area A1 is determined in the actual inspection (second mode). In the second mode, there is no distinct pattern in inspection area A1. However, a more accurate focus position of inspection area A1 can be determined.

治具100の印刷面101の高さと、ワークサンプルの領域W1の高さとは、ほぼ同じである。したがって、パターン102を手掛かりとして、撮像装置10のオートフォーカスにより、フォーカス位置f1を求めることができる。図14では、治具100のパターン102を明示するために、治具100が誇張して描かれていることに留意されたい。 The height of the printing surface 101 of the jig 100 and the height of the work sample region W1 are substantially the same. Therefore, with the pattern 102 as a clue, the focus position f1 can be obtained by the autofocus of the imaging device 10 . Note that the jig 100 is exaggerated in FIG. 14 in order to clearly show the pattern 102 of the jig 100 .

なお、一時的なパターン102を検査領域A1に形成するための方法は、治具100を用いる方法に限定されない。たとえば、投影機を用いて、特定のパターンを検査領域A1に所定の時間のみ投影するのでもよい。 Note that the method for forming the temporary pattern 102 in the inspection area A1 is not limited to the method using the jig 100. FIG. For example, a projector may be used to project a specific pattern onto the inspection area A1 for a predetermined period of time.

第2の方法は、ユーザの目視により撮像装置10のフォーカスを調整する方法である。撮像装置10のフォーカスを変化させながら、撮像装置10により検査領域A1を撮像する。これにより、複数の画像が得られる。ユーザは、複数の画像から、最もフォーカスの合った画像を選択する。その画像に対応するフォーカス位置が検査領域A1のフォーカス位置f1に設定される。検査領域A1内に、かすかなパターン、傷などといった、焦点合わせのきっかけとなるものが存在する場合、第2の方法を用いて検査領域A1のフォーカス位置f1を設定することができる。なお、撮像装置10のオートフォーカスにより複数の候補画像を予め選んでおき、ユーザが、それら候補画像の中から適切な画像を選択してもよい。 A second method is a method of adjusting the focus of the imaging device 10 visually by the user. The inspection area A1 is imaged by the imaging device 10 while changing the focus of the imaging device 10 . This results in multiple images. The user selects the most focused image from multiple images. The focus position corresponding to the image is set to the focus position f1 of the inspection area A1. If there is a trigger for focusing, such as a faint pattern or flaw, in the inspection area A1, the second method can be used to set the focus position f1 of the inspection area A1. Alternatively, a plurality of candidate images may be selected in advance by autofocusing of the imaging device 10, and the user may select an appropriate image from among the candidate images.

第3の方法は、ワークの三次元形状に関する情報を用いてフォーカス位置f1を設定する方法である。ワークの三次元形状が予め分かっている場合、その三次元形状の情報から、基準領域B1と検査領域A1との間の高さの差分を取得することができる。基準領域B1のフォーカス位置f0を、ワーキングディスタンス(WD)に変換する。その変換されたワーキングディスタンスに高さの差分を加算して、検査領域A1のワーキングディスタンスを算出する。そのワーキングディスタンスをフォーカス位置に変換することによりフォーカス位置f1を設定する。フォーカス位置からワーキングディスタンスへの変換、ワーキングディスタンスからフォーカス位置への変換は、たとえば画像処理装置20によって実行される。この方法では、基準領域B1のフォーカス位置と高さ情報とから、検査領域A1のフォーカス位置を決定することができる。したがって検査領域A1のフォーカス位置を比較的単純な計算によって、決定することができる。 A third method is to set the focus position f1 using information about the three-dimensional shape of the workpiece. When the three-dimensional shape of the workpiece is known in advance, the height difference between the reference area B1 and the inspection area A1 can be obtained from the three-dimensional shape information. A 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. A focus position f1 is set by converting the working distance into a focus position. Conversion from the focus position to the working distance and conversion from the working distance to the focus position are performed by the image processing device 20, for example. With this method, the focus position of the inspection area A1 can be determined from the focus position and height information of the reference area B1. Therefore, the focus position of the inspection area A1 can be determined by a relatively simple calculation.

図16は、検査方法のフローを示したフローチャートである。図16に示す処理は、上述の「第2のモード」における撮像装置10および画像処理装置20の処理に対応する。図16に示すように処理が開始されると、ステップS21において、画像処理システム1(たとえば画像処理装置20)は、基準領域B1を探索する。ステップS21において、ワークWを撮像するときのフォーカス位置、およびワークWの画像により決定される探索空間内で基準領域B1が探索される。 FIG. 16 is a flow chart showing the flow of the inspection method. The processing shown in FIG. 16 corresponds to the processing of the imaging device 10 and the image processing device 20 in the "second mode" described above. When the process is started as shown in FIG. 16, in step S21, the image processing system 1 (for example, the image processing device 20) searches for the reference area B1. In step S21, the reference area B1 is searched within the search space determined by the focus position when the workpiece W is imaged and the image of the workpiece W. FIG.

ステップS22において、画像処理装置20は、ステップS21での探索により得られた基準領域B1を含む画像を撮像したときのフォーカス位置を求める。これにより、基準領域B1のフォーカス位置f2が求められる。 In step S22, the image processing device 20 obtains the focus position when the 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.

ステップS23において、画像処理装置20は、基準領域B1のXY位置ずれを求める。「XY位置ずれ」とは、ステップS12(図12を参照)で取得された基準領域の画像に対する、ステップS21の処理により取得された基準領域の画像の相対的な位置ずれを意味する。この位置ずれは、平面内の直交する2軸(X軸、Y軸)の各々の軸の方向にそったずれの量、および、その平面内での回転角度を含む。画像処理装置20は、2つの基準領域の画像を比較することによりXY位置ずれを求める。基準領域B1を、位置ずれ修正用のモデルに兼用することができる。したがって、ワークWにフォーカスの合った画像を得られるだけでなく、画像内における検査領域A1の位置のずれを修正することもできる。なお、ステップS23の処理は、オプションであり、必須ではない。 In step S23, the image processing device 20 obtains the XY positional deviation of the reference area B1. “XY positional deviation” means relative positional deviation of the image of the reference area obtained by the process of step S21 with respect to the image of the reference area obtained in step S12 (see FIG. 12). This positional deviation includes the amount of deviation along each of the two orthogonal axes (X-axis and Y-axis) in the plane and the rotation angle within the plane. The image processing device 20 obtains the XY positional deviation by comparing the images of the two reference areas. The reference area B1 can also be used as a model for correcting the positional deviation. Therefore, it is possible not only to obtain an image in which the workpiece W is in focus, but also to correct the displacement of the inspection area A1 in the image. Note that the process of step S23 is optional and not essential.

ステップS24において、画像処理装置20は、検査領域A1のフォーカス位置f3を求める。上述したf3=f1+(f2-f0)の式に従ってフォーカス位置f3が求められる。このように、検査領域A1のフォーカス位置f3は、登録されたフォーカス位置f0,f1と、ステップS22において求められたフォーカス位置f2から、比較的単純な計算によって求められる。したがって、フォーカス位置f3を短時間で決定することができる。 In step S24, the image processing device 20 obtains the focus position f3 of the inspection area A1. The focus position f3 is obtained according to the above formula f3=f1+(f2-f0). In this way, the focus position f3 of the inspection area A1 can be obtained by 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.

ステップS25において、撮像装置10は、フォーカス位置f3に従ってフォーカスを調整して、ワークWの検査領域A1を撮像する。画像処理装置20は、撮像装置10から、検査領域A1の画像を取得する。この画像は、検査領域A1にフォーカスが合った状態の検査領域A1の画像である。 In step S25, the imaging device 10 images the inspection area A1 of the workpiece W by adjusting the focus according to the focus position f3. 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 with the inspection area A1 in focus.

ステップS26において、画像処理装置20の判定部21は、撮像装置10によって撮像された画像を処理する。 In step S<b>26 , the determination unit 21 of the image processing device 20 processes the image captured by the imaging device 10 .

ステップS27において、判定部21は、処理された画像に基づいて、ワークWの外観の良否を判定する。ステップS28において、画像処理装置20の出力部22は、検査の結果(判定結果)を出力する。ステップS28の処理が終了すると、次のワークの検査のため、処理はステップS21に戻される。 In step S27, the determination unit 21 determines whether the appearance of the workpiece W is good or bad based on the processed image. In step S28, the output unit 22 of the image processing device 20 outputs the inspection result (determination result). When the process of step S28 ends, the process returns to step S21 for inspection of the next workpiece.

本実施の形態によれば、フォーカス位置の設定の際に、基準領域および検査領域のフォーカス位置を求める。基準領域は明確なパターンを有する領域であるので、フォーカスの合った画像を取得しやすい。したがって、フォーカス位置を高い精度で得ることができる。検査の際には、基準領域のフォーカス位置のずれを用いて検査領域のフォーカス位置を補正する。検査領域が明確なパターン(フォーカスを合わせやすいパターン)を有していない場合であっても、フォーカスの合った検査領域の画像を得ることができる。したがって、検査結果の正確性を高めることができる。 According to this embodiment, the focus positions of the reference area and the inspection area are obtained when setting the focus position. Since the reference area is an area with a distinct pattern, it is easy to acquire a focused image. Therefore, the focus position can be obtained with high accuracy. During inspection, the focus position of the inspection area is corrected using the deviation 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), a focused image of the inspection area can be obtained. Therefore, the accuracy of inspection results can be enhanced.

<E.付記>
以上のように、本実施の形態は以下のような開示を含む。
<E. Note>
As described above, the present embodiment includes the following disclosures.

(構成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)。
(Configuration 1)
an imaging unit (10) that captures an image of an object (W) and generates an image containing the object (W);
An image processing unit (20) that acquires an image of the object (W) from the imaging unit (10) and performs predetermined processing on the image,
The imaging unit (10) is capable of changing a focus position,
In the first mode in which the focus position of the object (W) is set in advance, the image processing section (20) includes a reference area serving as a reference for 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. Register your location and
In the second mode of executing the predetermined process, the image processing section (20) determines the focal position of the reference area (B1) in the image acquired by the imaging section (10) and the reference area (B1). and determining the focus position of the target area (A1) based on the registered focus position of each of the target area (A1);
An image processing system (1), wherein in the second mode, the imaging unit (10) images the target area (A1) at a determined focus position.

(構成2)
前記基準領域(B1)と前記対象領域(A1)とは、少なくとも一部が互いに重なり合うように各々定められる、構成1に記載の画像処理システム(1)。
(Configuration 2)
The image processing system (1) according to configuration 1, wherein the reference area (B1) and the target area (A1) are each defined to at least partially overlap each other.

(構成3)
前記第2のモードにおいて、前記画像処理部(20)は、前記撮像部(10)により撮像された前記画像内の前記基準領域(B1)の位置を、前記第1のモードにおいて登録された前記基準領域(B1)の位置と比較して、その比較の結果に基づいて、前記画像内の前記対象物(W)の位置を修正する、構成1に記載の画像処理システム(1)。
(Composition 3)
In the second mode, the image processing section (20) converts the position of the reference area (B1) in the image captured by the imaging section (10) to the position of the reference area (B1) registered in the first mode. An image processing system (1) according to configuration 1, wherein the position of the object (W) in the image is modified in comparison with the position of a reference area (B1) and based on the result of the comparison.

(構成4)
前記第2のモードにおいて、前記画像処理部(20)は、登録された前記基準領域(B1)の前記フォーカス位置と、前記第2のモードにおいて取得された前記基準領域(B1)の前記フォーカス位置との差を用いて、登録された前記対象領域(A1)の前記フォーカス位置を補正して、前記対象領域(A1)の前記フォーカス位置を決定する、構成1から構成3のいずれかに記載の画像処理システム(1)。
(Composition 4)
In the second mode, the image processing section (20) processes the registered focus position of the reference area (B1) and the focus position of the reference area (B1) acquired in the second mode. The focus position of the registered target area (A1) is corrected using the difference from the target area (A1) to determine the focus position of the target area (A1). An image processing system (1).

(構成5)
前記対象領域(A1)は無地の領域を含む、構成1から構成4のいずれかに記載の画像処理システム(1)。
(Composition 5)
An image processing system (1) according to any of arrangements 1 to 4, wherein said target area (A1) comprises a plain area.

(構成6)
前記第1のモードにおいて、前記画像処理部(20)は、前記対象領域(A1)に一時的に形成されたパターンを前記撮像部(10)が撮像することにより得られた前記画像に基づいて、前記対象領域(A1)の前記フォーカス位置を決定する、構成5に記載の画像処理システム(1)。
(Composition 6)
In the first mode, the image processing section (20), based on the image obtained by the imaging section (10) capturing the pattern temporarily formed in the target area (A1), 6. An image processing system (1) according to configuration 5, wherein said focus position of said target area (A1) is determined.

(構成7)
前記第1のモードにおいて、前記画像処理部(20)は、前記対象物(W)の三次元形状の情報から前記基準領域(B1)と前記対象領域(A1)との間の高さの差分を取得して、前記高さの差分と、前記基準領域(B1)の前記フォーカス位置とを用いて、前記対象領域(A1)の前記フォーカス位置を決定する、構成5に記載の画像処理システム(1)。
(Composition 7)
In the first mode, the image processing unit (20) calculates the height difference between the reference area (B1) and the target area (A1) from the three-dimensional shape information of the target object (W). and determining the focus position of the target area (A1) using the height difference and the focus position of the reference area (B1). The image processing system according to configuration 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)の前記画像を用いて前記所定の処理を実行するステップとを備える、画像処理方法。
(Composition 8)
an imaging unit (10) for imaging an object (W) and generating an image including the object (W); obtaining an image of the object (W) from the imaging unit (10); An image processing method by an image processing system (1) comprising an image processing unit (20) for executing predetermined processing on an image,
The imaging unit (10) is capable of changing a focus position,
The image processing method includes
In a first mode for presetting the focus position of the object (W), the image processing unit (20) includes a reference area serving as a reference for 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. registering a location;
In the second mode for executing the predetermined process, the image processing section (20) determines the focus position of the reference area (B1) in the image acquired by the imaging section (10) and the reference area (B1). and determining the focus position of the target area (A1) based on the registered focus position of each of the target area (A1);
in the second mode, the imaging unit (10) imaging the target area (A1) at the determined focus position;
An image processing method, comprising: performing the predetermined processing by using the image of the object (W) imaged at the determined focus position by the image processing unit (20).

(構成9)
撮像装置(10)によって対象物(W)を撮像することにより得られた画像を用いて所定の処理を実行するためのプログラムであって、
前記撮像装置(10)は、フォーカス位置を変化させることが可能であり、
前記プログラムは、コンピュータ(20)に、
前記対象物(W)の前記フォーカス位置を予め設定する第1のモードにおいて、前記対象物(W)の前記画像の中に前記フォーカス位置の基準となる基準領域(B1)と、前記所定の処理の対象となる対象領域(A1)とを設定して、前記基準領域(B1)および前記対象領域(A1)の各々の前記フォーカス位置を登録するステップと、
前記所定の処理を実行する第2のモードにおいて、前記撮像装置(10)が取得した画像における前記基準領域(B1)のフォーカス位置、および前記基準領域(B1)および前記対象領域(A1)の各々の登録されたフォーカス位置に基づいて、前記対象領域(A1)の前記フォーカス位置を決定するステップと、
前記決定されたフォーカス位置で撮像された前記対象物(W)の前記画像を用いて前記所定の処理を実行するステップとを実行させる、プログラム。
(Composition 9)
A program for executing a predetermined process using an image obtained by imaging an object (W) with an imaging device (10),
The imaging device (10) is capable of changing a focus position,
The program, in a computer (20),
In a first mode for presetting the focus position of the object (W), the image of the object (W) includes a reference area (B1) serving as a reference for the focus position and the predetermined process. A step of setting a target area (A1) to be the target of and registering the focus position of each of the reference area (B1) and the target area (A1);
In the second mode of executing the predetermined process, 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
and executing the predetermined process using the image of the object (W) captured at the determined focus position.

本発明の実施の形態について説明したが、今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。 Although the embodiments of the present invention have been described, the embodiments disclosed this time should be considered as illustrative in all respects and not restrictive. The scope of the present invention is indicated by the scope of claims, and is intended to include all modifications within the meaning and scope of equivalence to the scope of claims.

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 フォーカス位置。 Reference Signs List 1 image processing system, 10 imaging device, 11 illumination section, 12 lens module, 12a, 12c lenses, 12b lens group, 12d movable section, 12e1, 12e2 voltage source, 12e focus adjustment section, 13 imaging device, 13a imaging surface, 14 Imaging element control unit 15, 17 register 16 lens control unit 18 communication I/F unit 20 image processing device 21 determination unit 22 output unit 23 storage unit 24 command generation unit 60 display device 70 transparency 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 focus, O principal point, S11 to S15, S21 to S28 steps, W workpiece, W1, W2 areas, f0 to f3 focus position.

Claims (9)

対象物を撮像して、前記対象物を含む画像を生成する撮像部と、
前記撮像部から前記対象物の画像を取得して、前記画像に対して所定の処理を実行する画像処理部とを備え、
前記撮像部は、フォーカス位置を変化させることが可能であり、
前記対象物の前記フォーカス位置を予め設定する第1のモードにおいて、前記画像処理部は、前記対象物の前記画像の中に前記フォーカス位置の基準となる基準領域と、前記画像処理部による前記所定の処理の対象となる対象領域とを設定して、前記基準領域および前記対象領域の各々の前記フォーカス位置を登録し、
前記所定の処理を実行する第2のモードにおいて、前記画像処理部は、前記撮像部が取得した画像における前記基準領域のフォーカス位置、および前記基準領域および前記対象領域の各々の登録されたフォーカス位置に基づいて、前記対象領域の前記フォーカス位置を決定し、
前記第2のモードにおいて、前記撮像部は、決定されたフォーカス位置で前記対象領域を撮像する、画像処理システム。
an imaging unit that captures an image of an object and generates an image that includes the object;
an image processing unit that acquires an image of the object from the imaging unit and performs predetermined processing on the image;
The imaging unit is capable of changing a focus position,
In a first mode in which the focus position of the object is set in advance, the image processing unit includes a reference area serving as a reference for the focus position in the image of the object, and the predetermined focus position by the image processing unit. setting a target area to be processed in and registering the focus position of each of the reference area and the target area;
In the second mode of executing the predetermined process, the image processing unit controls the focus position of the reference area in the image acquired by the imaging unit, and the registered focus positions of each of the reference area and the target area. determining the focus position of the region of interest based on
The image processing system, wherein in the second mode, the imaging unit images the target area at a determined focus position.
前記基準領域と前記対象領域とは、少なくとも一部が互いに重なり合うように各々定められる、請求項1に記載の画像処理システム。 2. The image processing system according to claim 1, wherein said reference area and said target area are each defined so as to at least partially overlap each other. 前記第2のモードにおいて、前記画像処理部は、前記撮像部により撮像された前記画像内の前記基準領域の位置を、前記第1のモードにおいて登録された前記基準領域の位置と比較して、その比較の結果に基づいて、前記画像内の前記対象物の位置を修正する、請求項1に記載の画像処理システム。 In the second mode, the image processing unit compares the position of the reference area in the image captured by the imaging unit with the position of the reference area registered in the first mode, 2. The image processing system of claim 1, wherein the position of the object within the image is modified based on the result of the comparison. 前記第2のモードにおいて、前記画像処理部は、登録された前記基準領域の前記フォーカス位置と、前記第2のモードにおいて取得された前記基準領域の前記フォーカス位置との差を用いて、登録された前記対象領域の前記フォーカス位置を補正して、前記対象領域の前記フォーカス位置を決定する、請求項1から請求項3のいずれか1項に記載の画像処理システム。 In the second mode, the image processing unit uses a difference between the registered focus position of the reference area and the focus position of the reference area acquired in the second mode to perform registration. 4. The image processing system according to any one of claims 1 to 3, wherein the focus position of the target area is determined by correcting the focus position of the target area. 前記対象領域は無地の領域を含む、請求項1から請求項4のいずれか1項に記載の画像処理システム。 5. An image processing system as claimed in any one of claims 1 to 4, wherein the region of interest comprises a solid color region. 前記第1のモードにおいて、前記画像処理部は、前記対象領域に一時的に形成されたパターンを前記撮像部が撮像することにより得られた前記画像に基づいて、前記対象領域の前記フォーカス位置を決定する、請求項5に記載の画像処理システム。 In the first mode, the image processing section adjusts the focus position of the target area based on the image obtained by the imaging section capturing an image of a pattern temporarily formed in the target area. 6. The image processing system of claim 5, wherein determining. 前記第1のモードにおいて、前記画像処理部は、前記対象物の三次元形状の情報から前記基準領域と前記対象領域との間の高さの差分を取得して、前記高さの差分と、前記基準領域の前記フォーカス位置とを用いて、前記対象領域の前記フォーカス位置を決定する、請求項5に記載の画像処理システム。 In the first mode, the image processing unit obtains a difference in height between the reference region and the target region from information on the three-dimensional shape of the target, and obtains the difference in height; 6. The image processing system of claim 5, wherein the focus position of the target region is determined using the focus position of the reference region. 対象物を撮像して、前記対象物を含む画像を生成する撮像部と、前記撮像部から前記対象物の画像を取得して、前記画像に対して所定の処理を実行する画像処理部とを備えた画像処理システムによる画像処理方法であって、
前記撮像部は、フォーカス位置を変化させることが可能であり、
前記画像処理方法は、
前記対象物の前記フォーカス位置を予め設定する第1のモードにおいて、前記画像処理部が、前記対象物の前記画像の中に前記フォーカス位置の基準となる基準領域と、前記画像処理部による前記所定の処理の対象となる対象領域とを設定して、前記基準領域および前記対象領域の各々の前記フォーカス位置を登録するステップと、
前記所定の処理を実行する第2のモードにおいて、前記画像処理部が、前記撮像部が取得した画像における前記基準領域のフォーカス位置、および前記基準領域および前記対象領域の各々の登録されたフォーカス位置に基づいて、前記対象領域の前記フォーカス位置を決定するステップと、
前記第2のモードにおいて、前記撮像部が、決定されたフォーカス位置で前記対象領域を撮像するステップと、
前記画像処理部が、前記決定されたフォーカス位置で撮像された前記対象物の前記画像を用いて前記所定の処理を実行するステップとを備える、画像処理方法。
an imaging unit that captures an image of an object and generates an image including the object; and an image processing unit that acquires the image of the object from the imaging unit and performs predetermined processing on the image. An image processing method by an image processing system comprising
The imaging unit is capable of changing a focus position,
The image processing method includes
In a first mode in which the focus position of the object is set in advance, the image processing unit includes a reference area serving as a reference for the focus position in the image of the object, and the predetermined focus position by the image processing unit. a step of setting a target region to be processed in and registering the focus position of each of the reference region and the target region;
In the second mode of executing the predetermined process, the image processing unit performs the focus position of the reference area in the image acquired by the imaging unit, and the registered focus positions of each of the reference area and the target area. determining the focus position of the region of interest based on
In the second mode, the imaging unit imaging the target area at the determined focus position;
An image processing method, wherein the image processing unit performs the predetermined processing using the image of the object imaged at the determined focus position.
撮像装置によって対象物を撮像することにより得られた画像を用いて所定の処理を実行するためのプログラムであって、
前記撮像装置は、フォーカス位置を変化させることが可能であり、
前記プログラムは、コンピュータに、
前記対象物の前記フォーカス位置を予め設定する第1のモードにおいて、前記対象物の前記画像の中に前記フォーカス位置の基準となる基準領域と、前記所定の処理の対象となる対象領域とを設定して、前記基準領域および前記対象領域の各々の前記フォーカス位置を登録するステップと、
前記所定の処理を実行する第2のモードにおいて、前記撮像装置が取得した画像における前記基準領域のフォーカス位置、および前記基準領域および前記対象領域の各々の登録されたフォーカス位置に基づいて、前記対象領域の前記フォーカス位置を決定するステップと、
前記決定されたフォーカス位置で撮像された前記対象物の前記画像を用いて前記所定の処理を実行するステップとを実行させる、プログラム。
A program for executing a predetermined process using an image obtained by imaging an object with an imaging device,
The imaging device is capable of changing the focus position,
The program, in a computer,
In a first mode in which the focus position of the object is preset, a reference area serving as a reference for the focus position and a target area to be subjected to the predetermined processing are set in the image of the object. and registering the focus position of each of the reference area and the target area;
In the second mode of executing the predetermined process, based on the focus position of the reference area in the image acquired by the imaging device and the registered focus positions of each of the reference area and the target area, determining the focus position of a region of interest;
and executing the predetermined process using the image of the object captured at the determined focus position.
JP2018156215A 2018-08-23 2018-08-23 Image processing system, image processing method and program Active JP7135586B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2018156215A JP7135586B2 (en) 2018-08-23 2018-08-23 Image processing system, image processing method and program
PCT/JP2019/031040 WO2020039920A1 (en) 2018-08-23 2019-08-07 Image processing system, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018156215A JP7135586B2 (en) 2018-08-23 2018-08-23 Image processing system, image processing method and program

Publications (2)

Publication Number Publication Date
JP2020030338A JP2020030338A (en) 2020-02-27
JP7135586B2 true JP7135586B2 (en) 2022-09-13

Family

ID=69593021

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018156215A Active JP7135586B2 (en) 2018-08-23 2018-08-23 Image processing system, image processing method and program

Country Status (2)

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

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001296478A (en) 2000-04-12 2001-10-26 Matsushita Electric Ind Co Ltd Device and method for observing biochemical substance
JP2013109271A (en) 2011-11-24 2013-06-06 Keyence Corp Image processor, focus adjustment method, and computer program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001296478A (en) 2000-04-12 2001-10-26 Matsushita Electric Ind Co Ltd Device and method for observing biochemical substance
JP2013109271A (en) 2011-11-24 2013-06-06 Keyence Corp Image processor, focus adjustment method, and computer program

Also Published As

Publication number Publication date
JP2020030338A (en) 2020-02-27
WO2020039920A1 (en) 2020-02-27

Similar Documents

Publication Publication Date Title
JP6299111B2 (en) Laser processing equipment
US8614415B2 (en) Defect inspection method of fine structure object and defect inspection apparatus
US10120163B2 (en) Auto-focus method for a coordinate-measuring apparatus
WO2020110712A1 (en) Inspection system, inspection method, and program
JP2016170122A (en) Measurement device
CN110261385B (en) Appearance inspection system, image processing apparatus, imaging apparatus, and inspection method
KR20180015139A (en) Optical device for detecting internal defects of transparent substrate and method therefor
JP2016071010A (en) Autofocus device, autofocus method, and program
JP2012002676A (en) Mask defect checking device and mask defect checking method
KR101863752B1 (en) method of enhancing resolution for optical apparatus for inspecting pattern image of semiconductor wafer and method of acquiring TSOM image using the same
US20120050518A1 (en) Inspecting apparatus and inspection method
US10827114B2 (en) Imaging system and setting device
KR101826127B1 (en) optical apparatus for inspecting pattern image of semiconductor wafer
JP7135586B2 (en) Image processing system, image processing method and program
JP7047725B2 (en) Inspection system, inspection method and program
JP5544894B2 (en) Wafer inspection apparatus and wafer inspection method
JP6961846B1 (en) EUV mask inspection device, EUV mask inspection method, EUV mask inspection program and EUV mask inspection system
JP7287533B2 (en) Inspection system, inspection method and program
JP2016070683A (en) Image processing device, image measurement device, image processing method, image processing program, and method for manufacturing structure
JP2022161475A (en) Defect detection device, defect detection method, image processing device and image processing program
JP7087823B2 (en) Image processing system, image processing method and program
JP7079569B2 (en) Inspection methods
JP2009229221A (en) Optical device defect inspection method and optical device defect inspecting apparatus
JP7198731B2 (en) Imaging device and focus adjustment method
JP7087984B2 (en) Imaging system and setting device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20201214

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220111

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220308

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20220802

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220815

R150 Certificate of patent or registration of utility model

Ref document number: 7135586

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150