JP2022108176A - Image processing apparatus - Google Patents

Image processing apparatus Download PDF

Info

Publication number
JP2022108176A
JP2022108176A JP2021003066A JP2021003066A JP2022108176A JP 2022108176 A JP2022108176 A JP 2022108176A JP 2021003066 A JP2021003066 A JP 2021003066A JP 2021003066 A JP2021003066 A JP 2021003066A JP 2022108176 A JP2022108176 A JP 2022108176A
Authority
JP
Japan
Prior art keywords
image data
imaging
unit
inspected
inspection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2021003066A
Other languages
Japanese (ja)
Inventor
剛 丸山
Takeshi Maruyama
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.)
Saki Corp
Original Assignee
Saki 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 Saki Corp filed Critical Saki Corp
Priority to JP2021003066A priority Critical patent/JP2022108176A/en
Publication of JP2022108176A publication Critical patent/JP2022108176A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

To provide an image processing apparatus using an image data composition method that can compose a plurality of pieces of image data acquired by an imaging unit at different positions in an imaging direction accurately in a short time.SOLUTION: An inspection device 10 being an image processing apparatus has a camera unit 21 and a control unit 30. The control unit 30 changes relative positions in an imaging direction of the camera unit 21 and an inspected object 12 to acquire at least two pieces of image data picked up by the camera unit 21 at different positions in the imaging direction, and executes composite image update processing of determining if pixels of the image data satisfy a predetermined condition and selecting values of the pixels determined to satisfy the predetermined condition as values of corresponding pixels of composite image data.SELECTED DRAWING: Figure 1

Description

本発明は、画像データの合成方法を用いた画像処理装置に関する。 The present invention relates to an image processing apparatus using a method for synthesizing image data.

近年では、様々な機器に電子回路基板が実装されるようになってきているが、この種の電子回路基板が実装される機器においては、小型化、薄型化等が常に課題になっており、この点から、電子回路基板の実装の高密度化を図ることが要求されている。このような電子回路基板のハンダの塗布状態、電子部品の実装状態等を検査する検査装置においては、周期が異なる複数の光パターンを利用して計測レンジの拡大を図るとともに、計測時間の短縮化を図る位相シフト法を基にした三次元計測装置が提案されている(例えば、特許文献1参照)。 In recent years, electronic circuit boards have come to be mounted on various devices. From this point of view, it is required to increase the mounting density of the electronic circuit board. In such an inspection device for inspecting the state of solder applied to electronic circuit boards and the state of mounting of electronic components, a plurality of light patterns with different periods are used to expand the measurement range and shorten the measurement time. A three-dimensional measuring apparatus based on a phase shift method has been proposed (see, for example, Patent Document 1).

特開2017-003513号公報JP 2017-003513 A

上記手法では、撮像部の被写界深度のため、計測レンジの拡大に限界がある。一方、複数の撮像位置から計測し、その位置関係に従い座標変換を行うことで、複数の計測データを貼り合わせることができることが知られている。しかし、複数の撮像位置から算出された計測結果を単純に合成しただけでは、特に合成の継ぎ目付近で誤計測が多く含まれることになるという課題があった。 In the above method, there is a limit to expansion of the measurement range due to the depth of field of the imaging unit. On the other hand, it is known that a plurality of pieces of measurement data can be pasted together by measuring from a plurality of imaging positions and performing coordinate conversion according to the positional relationship. However, there is a problem that simply synthesizing the measurement results calculated from a plurality of imaging positions causes many measurement errors especially near the joints of the synthesis.

本発明はこのような課題に鑑みてなされたものであり、撮像方向(Z方向)の異なる位置にある撮像部により取得された複数の画像データを、精度良く、かつ、短い時間で合成することができる画像データの合成方法を用いた画像処理装置を提供することを目的とする。 SUMMARY OF THE INVENTION The present invention has been made in view of such problems. It is an object of the present invention to provide an image processing apparatus using an image data synthesizing method capable of

前記課題を解決するために、本発明に係る画像処理装置は、被検査体との撮像方向の相対位置を変化可能な撮像部と、制御部と、を有し、前記制御部は、前記撮像部と前記被検査体との撮像方向の相対位置を変化させて、撮像方向の異なる位置にある前記撮像部により撮像された少なくとも2枚の画像データを取得し、前記画像データの画素が所定の条件を満足しているかを判断し、所定の条件を満足していると判断した画素の値を合成画像データの該当する画素の値として選択する合成画像更新処理を実行する。なお、撮像部の焦点距離は固定とする。 In order to solve the above-described problems, an image processing apparatus according to the present invention includes an imaging unit capable of changing a relative position in an imaging direction with respect to an object to be inspected, and a control unit, wherein the control unit controls the imaging at least two pieces of image data captured by the imaging unit located at different positions in the imaging direction by changing the relative position of the imaging unit and the object to be inspected, and the pixels of the image data are predetermined It is determined whether a condition is satisfied, and a composite image update process is executed to select the value of the pixel determined to satisfy the predetermined condition as the value of the corresponding pixel in the composite image data. Note that the focal length of the imaging unit is fixed.

また、本発明に係る画像処理装置において、前記制御部は、前記被検査体に対する前記撮像部の位置が遠い方から前記撮像部により撮像して画像データを取得することが好ましい。 Further, in the image processing apparatus according to the present invention, it is preferable that the control section acquires image data by imaging with the imaging section from a position of the imaging section farther from the object to be inspected.

また、本発明に係る画像処理装置において、前記制御部は、前記撮像部が前記被検査体の基準面に合焦しているときの画像データを取得し、その後、前記被検査体に対する前記撮像部の位置が遠い方から画像データを取得することが好ましい。 Also, in the image processing apparatus according to the present invention, the control unit acquires image data when the imaging unit is focused on a reference plane of the object to be inspected, and then acquires image data of the object to be inspected. It is preferable to acquire the image data from the farther part.

また、このような本発明に係る画像処理装置において、前記制御部は、前記撮像部が前記被検査体の基準面に合焦しているときの画像データに基づいて、他の位置で撮像された画像データが所定の条件を満足しているかを判断することが好ましい。 Further, in the image processing apparatus according to the present invention, the control unit performs imaging at a different position based on image data when the imaging unit is focused on the reference plane of the object to be inspected. It is preferable to determine whether the obtained image data satisfies a predetermined condition.

また、本発明に係る画像処理装置において、前記制御部は、前記被検査体に対する前記撮像部の位置が遠い方から画像データの取得を行い、最後に前記撮像部が前記被検査体の基準面に合焦しているときの画像データを取得することが好ましい。 Further, in the image processing apparatus according to the present invention, the control unit acquires image data from the side where the imaging unit is farther from the object to be inspected. It is preferable to acquire the image data when in focus.

また、本発明に係る画像処理装置において、前記制御部は、前記合成画像更新処理において、前記被検査体に対する前記撮像部の位置が遠い画像データから順に、当該前記画像データの画素が所定の条件を満足しているかを判断することが好ましい。 Further, in the image processing apparatus according to the present invention, in the synthetic image update process, the control unit sequentially controls the image data in which the position of the imaging unit relative to the object to be inspected is the farthest, and the pixels of the image data meet a predetermined condition. It is preferable to determine whether the

また、本発明に係る画像処理装置において、前記制御部は、前記画像データを取得する毎に、前記合成画像更新処理を実行することが好ましい。 Moreover, in the image processing apparatus according to the present invention, it is preferable that the control section executes the composite image update process each time the image data is acquired.

本発明によれば、撮像方向(Z方向)の異なる位置にある撮像部により取得された複数の画像データを、精度良く、かつ、短い時間で合成することができる画像データの合成方法を用いた画像処理装置を提供することができる。 According to the present invention, an image data synthesizing method capable of synthesizing a plurality of image data acquired by imaging units at different positions in the imaging direction (Z direction) with high accuracy and in a short time is used. An image processing device can be provided.

画像処理装置を含む検査装置の構成を説明するための説明図である。It is an explanatory view for explaining composition of an inspection device containing an image processing device. 基準平面の位相と測定した位相との関係を説明する説明図である。FIG. 4 is an explanatory diagram for explaining the relationship between the phase of the reference plane and the measured phase; カメラユニットの撮像位置を説明するための説明図である。FIG. 4 is an explanatory diagram for explaining an imaging position of a camera unit; 画像データの合成方法の流れを示すフローチャートである。4 is a flow chart showing the flow of a method for synthesizing image data; 各撮像位置における条件(1)の範囲と合成画像データとの対応関係を説明するための説明図である。FIG. 10 is an explanatory diagram for explaining the correspondence relationship between the range of condition (1) at each imaging position and the synthesized image data;

以下、本発明の好ましい実施形態について図面を参照して説明する。まず、図1を用いて本実施形態に係る検査装置10の構成について説明する。この検査装置10は、被検査体12を撮像して得られる被検査体12の画像データ(2次元画像データ又はパターン画像データ)を使用して被検査体12を検査する装置である。したがって、この検査装置10は画像処理装置としての機能も有している。被検査体12は、例えば、部品が搭載され、ハンダが塗布されている電子回路基板である。 Preferred embodiments of the present invention are described below with reference to the drawings. First, the configuration of an inspection apparatus 10 according to this embodiment will be described using FIG. This inspection apparatus 10 is an apparatus for inspecting an object 12 to be inspected using image data (two-dimensional image data or pattern image data) of the object 12 to be inspected obtained by imaging the object 12 to be inspected. Therefore, this inspection apparatus 10 also has a function as an image processing apparatus. The device under test 12 is, for example, an electronic circuit board on which components are mounted and solder is applied.

検査装置10は、被検査体12を保持するための検査テーブル14と、被検査体12を照明し撮像する撮像ユニット20と、検査テーブル14に対し撮像ユニット20を相対移動させるXYステージ16と、撮像ユニット20及びXYステージ16の作動を制御し、被検査体12の検査を実行するための制御ユニット30と、を含んで構成される。なお説明の便宜上、図1に示すように、検査テーブル14の被検査体配置面をXY平面とし、その配置面に垂直な方向(すなわち撮像ユニット20を構成するカメラユニット21による撮像方向(カメラユニット21の光学系の光軸方向))をZ方向とする。 The inspection apparatus 10 includes an inspection table 14 for holding an object 12 to be inspected, an imaging unit 20 for illuminating and imaging the object 12 to be inspected, an XY stage 16 for relatively moving the imaging unit 20 with respect to the inspection table 14, and a control unit 30 for controlling the operations of the imaging unit 20 and the XY stage 16 and executing the inspection of the inspection object 12 . For convenience of explanation, as shown in FIG. 1, the inspection object arrangement surface of the inspection table 14 is assumed to be the XY plane, and the direction perpendicular to the arrangement surface (that is, the imaging direction by the camera unit 21 constituting the imaging unit 20 (camera unit The optical axis direction)) of the optical system 21 is defined as the Z direction.

撮像ユニット20は、XYステージ16の移動テーブル(図示せず)に取り付けられており、XYステージ16によりX方向及びY方向のそれぞれに移動可能である。XYステージ16は例えばいわゆるH型のXYステージである。よってXYステージ16は、Y方向に延びるY方向ガイドに沿って移動テーブルをY方向に移動させるY駆動部と、Y方向ガイドをその両端で支持しかつ移動テーブルとY方向ガイドとをX方向に移動可能に構成されている2本のX方向ガイド及びX駆動部と、を備える。なおXYステージ16は、撮像ユニット20をZ方向に移動させるZ移動機構をさらに備えている。また、撮像ユニット20を回転させる回転機構をさらに備えてもよい。検査装置10は、検査テーブル14を移動可能とするXYステージをさらに備えてもよく、この場合、撮像ユニット20を移動させるXYステージ16は省略されてもよい。また、X駆動部及びY駆動部には、リニアモータやボールねじを用いることができる。また、撮像ユニット20をZ方向に移動させる代わりに、XYステージ16をZ方向に移動させるように構成してもよい。 The imaging unit 20 is attached to a moving table (not shown) of the XY stage 16 and is movable in the X and Y directions by the XY stage 16 . The XY stage 16 is, for example, a so-called H-type XY stage. Therefore, the XY stage 16 includes a Y drive unit that moves the moving table in the Y direction along a Y direction guide extending in the Y direction, and supports the Y direction guide at both ends thereof so that the moving table and the Y direction guide move in the X direction. two X-direction guides and an X-drive configured to be movable. The XY stage 16 further includes a Z movement mechanism that moves the imaging unit 20 in the Z direction. Further, a rotation mechanism for rotating the imaging unit 20 may be further provided. The inspection apparatus 10 may further include an XY stage that allows the inspection table 14 to move. In this case, the XY stage 16 that moves the imaging unit 20 may be omitted. A linear motor or a ball screw can be used for the X driving section and the Y driving section. Also, instead of moving the imaging unit 20 in the Z direction, the XY stage 16 may be moved in the Z direction.

撮像ユニット20は、被検査体12の検査面(基板面)に対して垂直方向(Z方向)から撮像するカメラユニット21と、照明ユニット22と、投射ユニット23と、を含んで構成される。本実施形態に係る検査装置10においては、カメラユニット21、照明ユニット22、及び投射ユニット23は一体の撮像ユニット20として構成されていてもよい。この一体の撮像ユニット20において、カメラユニット21、照明ユニット22、及び投射ユニット23の相対位置は固定されていてもよいし、各ユニットが相対移動可能に構成されていてもよい。また、カメラユニット21、照明ユニット22、及び投射ユニット23は別体とされ、別々に移動可能に構成されていてもよい。 The imaging unit 20 includes a camera unit 21 that captures an image from the direction (Z direction) perpendicular to the inspection surface (substrate surface) of the object to be inspected 12 , an illumination unit 22 , and a projection unit 23 . In the inspection apparatus 10 according to this embodiment, the camera unit 21, the illumination unit 22, and the projection unit 23 may be configured as an integrated imaging unit 20. FIG. In this integrated imaging unit 20, the relative positions of the camera unit 21, the illumination unit 22, and the projection unit 23 may be fixed, or each unit may be configured to be relatively movable. Moreover, the camera unit 21, the illumination unit 22, and the projection unit 23 may be separated and configured to be separately movable.

カメラユニット21は、対象物の2次元画像を生成する撮像素子と、その撮像素子に画像を結像させるための光学系(例えばレンズ)とを含む。このカメラユニット21は例えばCCDカメラである。カメラユニット21の最大視野は、検査テーブル14の被検査体載置区域よりも小さくてもよい。この場合、カメラユニット21は、複数の部分画像に分割して被検査体12の全体を撮像する。制御ユニット30は、カメラユニット21が部分画像を撮像するたびに次の撮像位置へとカメラユニット21が移動されるようXYステージ16を制御する。制御ユニット30は、部分画像を合成して被検査体12の全体画像を生成する。 The camera unit 21 includes an imaging device that generates a two-dimensional image of an object, and an optical system (for example, a lens) for forming an image on the imaging device. This camera unit 21 is, for example, a CCD camera. The maximum field of view of the camera unit 21 may be smaller than the inspection object placement area of the inspection table 14 . In this case, the camera unit 21 captures the entire inspection object 12 by dividing it into a plurality of partial images. The control unit 30 controls the XY stage 16 so that the camera unit 21 is moved to the next imaging position each time the camera unit 21 captures a partial image. The control unit 30 synthesizes the partial images to generate an overall image of the inspected object 12 .

なお、カメラユニット21は、2次元の撮像素子に代えて、1次元画像を生成する撮像素子を備えてもよい。この場合、カメラユニット21により被検査体12を走査することにより、被検査体12の全体画像を取得することができる。 Note that the camera unit 21 may include an imaging device that generates a one-dimensional image instead of the two-dimensional imaging device. In this case, by scanning the object 12 to be inspected by the camera unit 21, the entire image of the object 12 to be inspected can be obtained.

照明ユニット22は、カメラユニット21による撮像のための照明光を被検査体12の表面に投射するよう構成されている。照明ユニット22は、カメラユニット21の撮像素子により検出可能である波長域から選択された波長または波長域の光を発する1つまたは複数の光源を備える。照明光は可視光には限られず、紫外光やX線等を用いてもよい。光源が複数設けられている場合には、各光源は異なる波長の光(例えば、赤色、青色、及び緑色)を異なる投光角度で被検査体12の表面に投光するよう構成される。 The illumination unit 22 is configured to project illumination light for imaging by the camera unit 21 onto the surface of the inspection object 12 . The illumination unit 22 comprises one or more light sources that emit light of a wavelength or wavelength range selected from the wavelength range detectable by the imaging element of the camera unit 21 . The illumination light is not limited to visible light, and ultraviolet light, X-rays, or the like may be used. When multiple light sources are provided, each light source is configured to project light of different wavelengths (eg, red, blue, and green) onto the surface of the inspected object 12 at different projection angles.

照明ユニット22により照明された被検査体12は、カメラユニット21により撮像される。検査装置10は、照明ユニット22により照明されて撮像された被検査体12の画像データ(この画像データを「2次元画像データ」と呼ぶ)と、後述する高さマップとに基づいて、被検査体12における基板上の欠陥の有無(例えば、部品の有無や配置が適切か、また、ハンダの塗布状態の良否)を判定する。 The inspection object 12 illuminated by the illumination unit 22 is imaged by the camera unit 21 . The inspection apparatus 10 performs the inspection based on the image data (this image data is referred to as "two-dimensional image data") of the object 12 illuminated and imaged by the illumination unit 22 and a height map to be described later. The presence or absence of defects on the substrate of the body 12 (for example, the presence or absence of parts and whether the arrangement is appropriate, or whether the solder coating state is good or bad) is determined.

本実施形態に係る検査装置10において、照明ユニット22は、被検査体12の検査面に対し斜め方向から照明光を投射する側方照明源であって、本実施形態では、上位光源22a、中位光源22b及び下位光源22cを備えている。なお、本実施形態に係る検査装置10においては、側方照明源22a、22b、22cはそれぞれリング照明源であり、カメラユニット21の光軸を包囲し、被検査体12の検査面に対し斜めに照明光を投射するように構成されている。これらの側方照明源22a,22b,22cの各々は、複数の光源が円環状に配置されて構成されていてもよい。また、側方照明源である上位光源22a、中位光源22b及び下位光源22cは、それぞれ、検査面に対して異なる角度で照明光を投射するように構成されている。 In the inspection apparatus 10 according to this embodiment, the illumination unit 22 is a side illumination source that projects illumination light obliquely onto the inspection surface of the object 12 to be inspected. It has a lower light source 22b and a lower light source 22c. In addition, in the inspection apparatus 10 according to the present embodiment, the side illumination sources 22a, 22b, and 22c are ring illumination sources, respectively, which surround the optical axis of the camera unit 21 and are oblique to the inspection surface of the object 12 to be inspected. is configured to project the illumination light onto the Each of these side illumination sources 22a, 22b, 22c may be configured by a plurality of light sources arranged in an annular shape. Also, the upper light source 22a, the intermediate light source 22b, and the lower light source 22c, which are side illumination sources, are configured to project illumination light at different angles to the inspection surface.

投射ユニット23は、被検査体12の検査面にパターンを投射する。パターンが投射された被検査体12は、カメラユニット21により撮像される。検査装置10は、撮像された被検査体12の画像データ(この画像データを「パターン画像データ」と呼ぶ)に基づいて被検査体の検査面の高さマップを作成する。ここで、高さマップとは、パターン画像データの画素毎に、被検査体の高さ情報を有するデータである。制御ユニット30は、投射パターンに対するパターン画像データの局所的な不一致を検出し、その局所的な不一致に基づいてその部位の高さ情報を取得する。つまり、投射パターンに対する撮像パターンの変化が、検査面上の高さの変化に対応する。 The projection unit 23 projects a pattern onto the inspection surface of the object 12 to be inspected. The object 12 onto which the pattern is projected is imaged by the camera unit 21 . The inspection apparatus 10 creates a height map of the inspection surface of the object to be inspected based on the captured image data of the object to be inspected 12 (this image data is called “pattern image data”). Here, the height map is data having height information of an object to be inspected for each pixel of pattern image data. The control unit 30 detects local discrepancies in the pattern image data with respect to the projection pattern, and acquires height information of the site based on the local discrepancies. In other words, the change in the captured pattern with respect to the projected pattern corresponds to the change in height on the inspection surface.

投射パターンは、明線と暗線とが交互に周期的に繰り返される1次元の縞パターンであることが好ましい。投射ユニット23は、被検査体12の検査面に対し斜め方向から縞パターンを投射するよう配置されている。被検査体12の検査面における高さの非連続は、縞パターン画像においてパターンのずれとして表れる。よって、パターンのずれ量から高さ差を求めることができる。例えば、サインカーブに従って明るさが変化する縞パターンを用いるPMP(Phase Measurement Profilometry)法により制御ユニット30は高さマップを作成する。PMP法においては縞パターンのずれ量がサインカーブの位相差に相当する。 The projected pattern is preferably a one-dimensional striped pattern in which bright lines and dark lines are alternately and periodically repeated. The projection unit 23 is arranged to project a stripe pattern onto the inspection surface of the object 12 to be inspected from an oblique direction. A height discontinuity on the inspection surface of the inspection object 12 appears as a pattern shift in the stripe pattern image. Therefore, the height difference can be obtained from the amount of pattern deviation. For example, the control unit 30 creates a height map by a PMP (Phase Measurement Profilometry) method using a fringe pattern whose brightness changes according to a sine curve. In the PMP method, the shift amount of the fringe pattern corresponds to the phase difference of the sine curve.

投射ユニット23は、パターン形成装置と、パターン形成装置を照明するための光源装置と、パターンを被検査体12の検査面に投射するための光学系と、を含んで構成される。パターン形成装置は例えば、液晶ディスプレイ等のように所望のパターンを動的に生成しうる可変パターニング装置であってもよいし、ガラスプレート等の基板上にパターンが固定的に形成されている固定パターニング装置であってもよい。パターン形成装置が固定パターニング装置である場合には、固定パターニング装置を移動させる移動機構を設けるか、あるいはパターン投射用の光学系に調整機構を設けることにより、パターンの投射位置を可変とすることが好ましい。また、投射ユニット23は、異なるパターンをもつ複数の固定パターニング装置を切替可能に構成されていてもよい。 The projection unit 23 includes a pattern forming device, a light source device for illuminating the pattern forming device, and an optical system for projecting the pattern onto the inspection surface of the inspection object 12 . The pattern forming device may be, for example, a variable patterning device that can dynamically generate a desired pattern, such as a liquid crystal display, or a fixed patterning device in which a pattern is fixedly formed on a substrate such as a glass plate. It may be a device. When the pattern forming device is a stationary patterning device, the pattern projection position can be made variable by providing a moving mechanism for moving the stationary patterning device or by providing an adjusting mechanism in the optical system for pattern projection. preferable. Also, the projection unit 23 may be configured to be switchable between a plurality of fixed patterning devices having different patterns.

投射ユニット23は、カメラユニット21の周囲に複数設けられていてもよい。複数の投射ユニット23は、それぞれ異なる投射方向から被検査体12にパターンを投射するよう配置されている。このようにすれば、検査面における高さ差によって影となりパターンが投射されない領域を小さくすることができる。 A plurality of projection units 23 may be provided around the camera unit 21 . The plurality of projection units 23 are arranged to project patterns onto the inspection object 12 from different projection directions. By doing so, it is possible to reduce the area where the pattern is not projected due to the shadow due to the height difference on the inspection surface.

図1に示す制御ユニット30は、本装置全体を統括的に制御するもので、ハードウエアとしては、任意のコンピュータのCPU、メモリ、その他のLSIで実現され、ソフトウエアとしてはメモリにロードされたプログラムなどによって実現されるが、ここではそれらの連携によって実現される機能ブロックを描いている。したがって、これらの機能ブロックがハードウエアのみ、ソフトウエアのみ、またはそれらの組合せによっていろいろな形で実現できることは、当業者には理解されるところである。 The control unit 30 shown in FIG. 1 controls the entire apparatus, and is realized by the CPU, memory, and other LSIs of any computer as hardware, and is loaded into the memory as software. Although it is realized by programs, etc., functional blocks realized by their cooperation are drawn here. Therefore, those skilled in the art will understand that these functional blocks can be realized in various forms by hardware only, software only, or a combination thereof.

図1には、制御ユニット30の構成の一例が示されている。制御ユニット30は、検査制御部31と記憶部であるメモリ35とを含んで構成される。検査制御部31は、画像処理部32と検査データ処理部33と検査部34とを含んで構成される。更に、画像処理部32は、撮像処理部32aと高さ測定部32bと画像合成部32cとを含んで構成される。また、検査装置10は、ユーザまたは他の装置からの入力を受け付けるための入力部36と、検査に関連する情報を出力するための出力部37とを備えており、入力部36及び出力部37はそれぞれ制御ユニット30に接続されている。入力部36は例えば、ユーザからの入力を受け付けるためのマウスやキーボード等の入力手段や、他の装置との通信をするための通信手段を含む。出力部37は、ディスプレイやプリンタ等の公知の出力手段を含む。 FIG. 1 shows an example of the configuration of the control unit 30. As shown in FIG. The control unit 30 includes an inspection control section 31 and a memory 35 that is a storage section. The inspection control section 31 includes an image processing section 32 , an inspection data processing section 33 and an inspection section 34 . Further, the image processing section 32 includes an imaging processing section 32a, a height measuring section 32b, and an image synthesizing section 32c. The inspection apparatus 10 also includes an input unit 36 for receiving input from a user or another device, and an output unit 37 for outputting inspection-related information. are each connected to the control unit 30 . The input unit 36 includes, for example, input means such as a mouse and keyboard for receiving input from the user, and communication means for communicating with other devices. The output unit 37 includes known output means such as a display and a printer.

検査制御部31は、入力部36からの入力及びメモリ35に記憶されている検査関連情報に基づいて、検査のための各種制御処理を実行するよう構成されている。検査関連情報には、被検査体12の2次元画像データ、被検査体12の高さマップ(パターン画像データから算出される)、及び基板検査データが含まれる。検査に先立って、検査データ処理部33は、すべての検査項目に合格することが保証されている被検査体12の2次元画像データ及び高さマップを使用して基板検査データを作成する。検査部34は、作成済みの基板検査データと、検査されるべき被検査体12の2次元画像データ及び高さマップとに基づいて検査を実行する。 The inspection control unit 31 is configured to execute various control processes for inspection based on input from the input unit 36 and inspection-related information stored in the memory 35 . The inspection-related information includes two-dimensional image data of the object to be inspected 12, a height map of the object to be inspected 12 (calculated from pattern image data), and substrate inspection data. Prior to the inspection, the inspection data processing unit 33 creates substrate inspection data using the two-dimensional image data and height map of the object to be inspected 12 guaranteed to pass all inspection items. The inspection unit 34 performs an inspection based on the created substrate inspection data and the two-dimensional image data and height map of the inspection object 12 to be inspected.

基板検査データは基板の品種ごとに作成される検査データである。基板検査データは、基板に配置された部品やその位置、また、その基板に塗布されたハンダごとの検査データの集合体である。各部品やハンダの検査データは、その部品やハンダに必要な検査項目、各検査項目についての画像上の検査区域である検査ウインドウ、及び各検査項目について配置や良否判定の基準となる検査基準を含む。検査ウインドウは各検査項目について1つまたは複数設定される。例えばハンダの塗布状態の良否を判定する検査項目においては通常、その部品のハンダ塗布領域の数と同数の検査ウインドウがハンダ塗布領域の配置に対応する配置で設定される。また、被検査体画像に所定の画像処理をした画像を使用する検査項目については、その画像処理の内容も検査データに含まれる。 Board inspection data is inspection data created for each type of board. The board inspection data is a collection of inspection data for each component arranged on the board, its position, and solder applied to the board. The inspection data for each component and solder includes the inspection items required for that component and solder, the inspection window that is the inspection area on the image for each inspection item, and the inspection criteria that serve as the criteria for placement and pass/fail judgment for each inspection item. include. One or more inspection windows are set for each inspection item. For example, in an inspection item for judging the quality of the solder coating state, usually, the same number of inspection windows as the number of solder coating regions of the component are set in a layout corresponding to the layout of the solder coating regions. In addition, for an inspection item that uses an image of an object to be inspected that has been subjected to predetermined image processing, the inspection data also includes the details of the image processing.

検査データ処理部33は、基板検査データ作成処理として、その基板に合わせて検査データの各項目を設定する。例えば検査データ処理部33は、その基板のハンダレイアウトに適合するように各検査ウインドウの位置及び大きさを各検査項目について自動的に設定する。検査データ処理部33は、検査データのうち一部の項目についてユーザの入力を受け付けるようにしてもよい。例えば、検査データ処理部33は、ユーザによる検査基準のチューニングを受け入れるようにしてもよい。検査基準は高さ情報を用いて設定されてもよい。 The inspection data processing unit 33 sets each item of the inspection data according to the board as the board inspection data creation process. For example, the inspection data processing unit 33 automatically sets the position and size of each inspection window for each inspection item so as to match the solder layout of the board. The inspection data processing unit 33 may accept user input for some items of the inspection data. For example, the inspection data processing unit 33 may accept tuning of inspection criteria by the user. Inspection criteria may be set using height information.

検査制御部31は、基板検査データ作成の前処理として、画像処理部32により被検査体12の撮像処理を実行する。この被検査体12はすべての検査項目に合格しているものが用いられる。撮像処理は上述のように、照明ユニット22により被検査体12を照明しつつ撮像ユニット20と検査テーブル14との相対移動を制御し、被検査体12の部分画像を順次撮像することにより行われる。被検査体12の全体がカバーされるように複数の部分画像が撮像される。検査制御部31は、これら複数の部分画像を合成し、被検査体12の検査面全体を含む基板全面画像データ(2次元画像データ)を生成する。検査制御部31は、メモリ35に基板全面画像データを記憶する。 The inspection control unit 31 performs imaging processing of the inspected object 12 by the image processing unit 32 as preprocessing for creating substrate inspection data. The object to be inspected 12 that has passed all inspection items is used. As described above, the imaging process is performed by sequentially capturing partial images of the inspection object 12 by controlling the relative movement between the imaging unit 20 and the inspection table 14 while illuminating the inspection object 12 with the illumination unit 22 . . A plurality of partial images are captured so that the entire inspection object 12 is covered. The inspection control unit 31 synthesizes the plurality of partial images to generate board full-surface image data (two-dimensional image data) including the entire inspection surface of the object 12 to be inspected. The inspection control unit 31 stores the board whole surface image data in the memory 35 .

また、検査制御部31は、高さマップ作成のための前処理として、画像処理部32の撮像処理部32aにより、投射ユニット23により被検査体12にパターンを投射しつつ撮像ユニット20と検査テーブル14との相対移動を制御し、被検査体12のパターン画像を分割して順次撮像する。投射されるパターンは、好ましくはPMP法に基づきサインカーブに従って明るさが変化する縞パターンである。検査制御部31は、撮像した分割画像を合成し、被検査体12の検査面全体のパターン画像データを生成する。検査制御部31は、メモリ35にパターン画像データを記憶する。なお、全体ではなく検査面の一部についてパターン画像データを生成するようにしてもよい。また、後述するように、撮像処理部32aで撮像された画像データは、高さ測定部32b及び画像合成部32cにより合成処理が実行される。 In addition, as preprocessing for creating a height map, the inspection control unit 31 causes the imaging processing unit 32a of the image processing unit 32 to project a pattern onto the object 12 to be inspected by the projection unit 23, and the imaging unit 20 and the inspection table. 14 is controlled, and the pattern image of the object to be inspected 12 is divided and sequentially picked up. The projected pattern is preferably a fringe pattern whose brightness changes according to a sine curve based on the PMP method. The inspection control unit 31 synthesizes the captured divided images to generate pattern image data of the entire inspection surface of the object 12 to be inspected. The inspection control unit 31 stores pattern image data in the memory 35 . Note that the pattern image data may be generated not for the entire inspection surface but for a portion of the inspection surface. Further, as will be described later, the image data captured by the imaging processing unit 32a is combined by the height measuring unit 32b and the image combining unit 32c.

高さ測定部32bは、パターン画像データにおけるパターンの像に基づいて被検査体12の検査面全体の高さマップを作成する。高さ測定部32bはまず、パターン画像データと基準パターン画像データとの局所的な位相差を画像データ全体について求めることにより、被検査体12の検査面の位相差マップを求める。ここで、「基準パターン画像データ」とは、投射ユニット23により基準平面にパターンが投射された画像データ(つまり投射ユニット23に内蔵されているパターン形成装置が生成したパターンが基準平面に投射された画像データ)である。高さ測定部32bは、高さ測定の基準となる基準平面と位相差マップとに基づいて被検査体12の高さマップを作成する。基準平面は例えば、検査される電子回路基板の基板表面である。基準平面は必ずしも平面ではなくてもよく、基板の反り等の変形が反映された曲面であってもよい。 The height measurement unit 32b creates a height map of the entire inspection surface of the inspection object 12 based on the pattern image in the pattern image data. The height measuring unit 32b first obtains a phase difference map of the inspection surface of the inspection object 12 by obtaining the local phase difference between the pattern image data and the reference pattern image data for the entire image data. Here, "reference pattern image data" means image data obtained by projecting a pattern on the reference plane by the projection unit 23 (that is, pattern generated by the pattern forming device incorporated in the projection unit 23 and projected on the reference plane). image data). The height measurement unit 32b creates a height map of the inspection object 12 based on the reference plane serving as a reference for height measurement and the phase difference map. The reference plane is, for example, the substrate surface of the electronic circuit board to be inspected. The reference plane may not necessarily be a flat surface, and may be a curved surface reflecting deformation such as warpage of the substrate.

高さ測定部32bは、具体的には、パターン画像データの各画素と、当該画素に対応する基準パターン画像データの画素とで縞パターンの位相差を求める。高さ測定部32bは、位相差を高さ情報に換算する。検査面上での位置により投射ユニット23からの距離が異なるために、基準パターンの縞幅が一定であっても、検査面のパターン投射領域の一端から他端へと縞幅が変化してしまうからである。高さ測定部32bは、換算された高さ情報と基準平面とに基づいて基準平面からの高さ情報を取得し、被検査体12の高さマップを作成する。 Specifically, the height measurement unit 32b obtains the phase difference of the stripe pattern between each pixel of the pattern image data and the pixel of the reference pattern image data corresponding to the pixel. The height measurement unit 32b converts the phase difference into height information. Since the distance from the projection unit 23 differs depending on the position on the inspection surface, even if the stripe width of the reference pattern is constant, the stripe width changes from one end to the other end of the pattern projection area on the inspection surface. It is from. The height measurement unit 32b acquires height information from the reference plane based on the converted height information and the reference plane, and creates a height map of the object 12 to be inspected.

検査制御部31の画像処理部32は、被検査体12の高さマップが有する高さ情報を被検査体12の2次元画像データの各画素に対応付けることにより、高さ分布を有する被検査体画像を作成してもよい。また、画像処理部32は、高さ分布付き被検査体画像データに基づいて被検査体12の3次元モデリング表示を行うようにしてもよい。また、画像処理部32は、2次元の被検査体画像データに高さ分布を重ね合わせて出力部37に表示してもよい。例えば、被検査体画像データを高さ分布により色分け表示するようにしてもよい。 The image processing unit 32 of the inspection control unit 31 associates the height information of the height map of the inspection object 12 with each pixel of the two-dimensional image data of the inspection object 12, thereby obtaining an inspection object having a height distribution. You can create an image. Further, the image processing unit 32 may perform three-dimensional modeling display of the inspection object 12 based on the inspection object image data with height distribution. The image processing unit 32 may superimpose the height distribution on the two-dimensional object image data and display it on the output unit 37 . For example, the image data of the object to be inspected may be displayed in different colors depending on the height distribution.

以下に、このような検査装置10において、投射ユニット23によりパターンを投射して高さ情報を取得する方法について説明する。 A method for acquiring height information by projecting a pattern using the projection unit 23 in such an inspection apparatus 10 will be described below.

まず、縞パターンを用いたPMP法による高さ情報の取得方法について説明する。縞パターン投射領域の1つの計測点(画素)に着目すると、空間的に位相をずらしながら縞パターンを投射したときに(言い換えれば、縞の反復する方向に縞パターンを走査したときに)、その計測点(画素)の明るさは周期的に変動する。色や反射率等の計測点(画素)の表面特性に応じて計測点(画素)毎に平均の明るさは異なるものの、どの計測点(画素)においても縞パターンに対応する周期的な明るさ変動が生じる。よって、周期的な明るさ変動から位相を算出し、初期位相からの位相差が高さ情報を与える。 First, a method of obtaining height information by the PMP method using a striped pattern will be described. Focusing on one measurement point (pixel) in the fringe pattern projection area, when the fringe pattern is projected while spatially shifting the phase (in other words, when the fringe pattern is scanned in the direction in which the fringes repeat), the The brightness of the measurement point (pixel) varies periodically. Although the average brightness differs for each measurement point (pixel) depending on the surface characteristics of the measurement point (pixel) such as color and reflectance, the periodic brightness corresponding to the stripe pattern at any measurement point (pixel) Fluctuations occur. Therefore, the phase is calculated from periodic brightness fluctuations, and the phase difference from the initial phase gives height information.

このような縞パターンによる特性を用いて、PMP法による高さ情報を取得する場合、原理的に縞パターンについて位相をシフトさせて少なくとも3回、典型的には4回の撮像が必要とされている。縞パターンが正弦波であることに対応して各計測点(画素)の明るさ変動も正弦波となる。縞のピッチは既知であるから、輝度(明るさ)の平均値、振幅、及び初期位相が明らかとなれば明るさ変動を表す正弦波が特定される。 When obtaining height information by the PMP method using such characteristics of the fringe pattern, in principle, it is necessary to shift the phase of the fringe pattern and take images at least three times, typically four times. there is Since the fringe pattern is a sine wave, the brightness variation at each measurement point (pixel) is also a sine wave. Since the pitch of the fringes is known, the sine wave representing the brightness variation can be identified if the mean luminance (brightness), amplitude, and initial phase are known.

縞パターンの位相の開始位置をずらして撮像された少なくとも3枚のパターン画像データから計測点(画素)の輝度(明るさ)の測定値を得ることにより、輝度(明るさ)の平均値、振幅、及び初期位相の3つの変数を決定することができる。ここで、1つの縞パターンを、位相の開始位置を90度(π/2ラジアン)ずつずらして4回撮像したときのある画素の輝度をそれぞれI0、I1、I2、I3とすると、縞パターンが正弦波の場合の輝度Inは、次式(a)で表される。なお、この式(a)において、Aは被検査体12の明るさに依存した振幅を示し、Bはカメラユニット21や環境輝度に依存した明るさのオフセットを示し、φは求めたい位相を示し、π/2は位相のシフト量(ずらし量)を示す。なお、n=0,1,2,3である。但し、一般的にはセンサノイズ等の要因で誤差が含まれるので、位相φ、振幅A及びオフセットBを算出する際には、最小二乗法が求められることが多い。また、最小二乗法で得られる誤差をEとする。 By obtaining the measured value of the luminance (brightness) of the measurement point (pixel) from at least three pattern image data captured by shifting the phase start position of the fringe pattern, the average value and amplitude of the luminance (brightness) , and the initial phase can be determined. Let I0, I1, I2, and I3 be the luminances of certain pixels when one stripe pattern is imaged four times with the phase start position shifted by 90 degrees (π/2 radian), respectively. The luminance In in the case of a sine wave is represented by the following formula (a). In this equation (a), A represents the amplitude dependent on the brightness of the object 12 to be inspected, B represents the brightness offset dependent on the camera unit 21 and the environmental brightness, and φ represents the desired phase. , π/2 indicate the amount of phase shift. Note that n=0, 1, 2, 3. However, since errors are generally included due to factors such as sensor noise, when calculating the phase φ, the amplitude A and the offset B, the method of least squares is often obtained. Let E be the error obtained by the method of least squares.

In = A×sin(φ+n×π/2)+B (a) In = A x sin(φ + n x π/2) + B (a)

高さ情報の算出は、パターン画像データから、各画素(ピクセル)の位相φ、振幅A及びオフセットBを求めることである。例えば、1つの縞パターンを、位相の開始位置を90度(π/2ラジアン)ずつずらして4回撮像したときの、各画素にあたる計測点の位相φは次式(b)として表されることが知られている。 Calculation of height information is to obtain the phase φ, amplitude A and offset B of each pixel from the pattern image data. For example, when one fringe pattern is imaged four times with the phase start position shifted by 90 degrees (π/2 radians), the phase φ of the measurement point corresponding to each pixel is expressed as the following equation (b). It has been known.

tan(φ) = (I3-I1)/(I2-I0) (b) tan(φ) = (I3-I1)/(I2-I0) (b)

縞パターンのピッチ(1周期の長さ)をPとし、初期位相を0とすると縞パターンのずれ量はP×(φ/2π)で求められる。パターンの投射角度を用いてパターンずれ量からその位置の高さ情報を取得することができる。 Assuming that the pitch of the fringe pattern (the length of one cycle) is P and the initial phase is 0, the shift amount of the fringe pattern is obtained by P×(φ/2π). Height information of the position can be acquired from the amount of pattern deviation using the projection angle of the pattern.

図2において、(a)に示すように、基準平面Sに対して投射ユニット23により縞パターンを投射してカメラユニット21で撮像したパターン画像データから得られる位相を(c)に示し、(b)に示すように、この基準平面S上に物体Oを載置した状態で同じ縞パターンを投射して撮像したパターン画像データから得られる位相を(d)に示すと、物体Oの高さ情報はこれらの位相のずれ量(位相差=測定した位相-基準平面の位相)から算出することができる。この位相差はカメラユニット21で撮像した画像の画素ごとに算出することができ、画素ごとに求められた位相差に係数を乗算することで、その画素に対応した位置の高さ情報が算出される。この係数は、例えば、簡易的にはtan(投射角度)×縞ピッチ/2πで求められる。 In FIG. 2, as shown in (a), the phase obtained from the pattern image data projected by the projection unit 23 onto the reference plane S and captured by the camera unit 21 is shown in (c), and (b) ), the phase obtained from the pattern image data captured by projecting the same fringe pattern with the object O placed on the reference plane S is shown in (d) as height information of the object O can be calculated from these phase shift amounts (phase difference=measured phase−phase of reference plane). This phase difference can be calculated for each pixel of the image captured by the camera unit 21, and by multiplying the phase difference obtained for each pixel by a coefficient, the height information of the position corresponding to that pixel is calculated. be. This coefficient is simply obtained by, for example, tan (projection angle)×fringe pitch/2π.

ここで、縞パターンは、その明るさが正弦波状であって、且つ、単調に変化する(単調増加又は単調減少する)パターンが繰り返し形成されている。なお、1つの周期(ピッチ)において、位相が0から2π(ラジアン)まで変化するときに、輝度が最も暗い状態(例えば輝度I=0)から最も明るい状態(例えば輝度I=255)に単調増加する場合を示している(パターンにおける位相と輝度の関係は逆、すなわち単調減少でもよい)。 Here, the fringe pattern has a sinusoidal brightness, and a pattern that monotonically changes (monotonically increases or monotonously decreases) is repeatedly formed. In one cycle (pitch), when the phase changes from 0 to 2π (radian), the luminance monotonously increases from the darkest state (for example, luminance I = 0) to the brightest state (for example, luminance I = 255). (The relationship between phase and luminance in the pattern may be reversed, ie monotonically decreasing).

図2を用いて説明したように、縞パターンを用いて基準平面Sを撮像し、また、縞パターンを用いてその基準平面Sに載置された物体O(被検査体12に相当)を撮像した場合、式(b)に基づいて得られた基準平面Sの位相φ0と物体Oを載置した状態で取得された位相φとの位相差Δφは、次式(c)で求められる。 As described with reference to FIG. 2, the reference plane S is imaged using the stripe pattern, and the object O (corresponding to the inspected object 12) placed on the reference plane S is imaged using the stripe pattern. In this case, the phase difference Δφ between the phase φ0 of the reference plane S obtained based on the formula (b) and the phase φ obtained with the object O placed is obtained by the following formula (c).

Δφ = φ - φ0 (c) Δφ = φ - φ0 (c)

以上より、基準平面及びこの基準平面に物体O(被検査体12)を載置して縞パターンを位相の開始位置をずらして投射して撮像された少なくとも3枚のパターン画像データから得られた位相φ0,φ(90°ずつずらして4枚撮像したときは式(b)により算出される)から、式(c)により算出された位相差Δφに基づいて、高さ情報Hを、次式(d)で求めることができる。 From the above, it was obtained from the reference plane and at least three pattern image data captured by placing the object O (inspection object 12) on this reference plane and projecting the fringe pattern with the phase starting position shifted. Based on the phase difference Δφ calculated by the formula (c) from the phases φ0 and φ (calculated by the formula (b) when four images are taken with a shift of 90° each), the height information H is obtained by the following formula: (d).

H = P×(Δφ/2π) (d) H = P x (Δφ/2π) (d)

上述したように、本実施形態に係る検査装置10は、2次元画像データ及びパターン画像データから算出される高さマップを使用して被検査体12を検査するように構成されているが、カメラユニット21のカメラには、所定の被写界深度(焦点深度)があるため、例えば、カメラユニット21が被検査体12である基板の表面付近に合焦している場合、背の高い部品の上面は焦点の合っていない画像データが撮像される可能性がある。そのため、このような画像データを用いて検査すると、2次元画像データにおいて、背の高い部品(例えばコンデンサなど)の上面に記載された文字を読み取ることができない場合が発生し、また、パターン画像データにおいて、背の高い部品の上面の縞パターンの画像がぼけてしまい、正確な高さ情報を算出することができない場合が発生する。 As described above, the inspection apparatus 10 according to this embodiment is configured to inspect the object 12 using the height map calculated from the two-dimensional image data and the pattern image data. Since the camera of the unit 21 has a predetermined depth of field (depth of focus), for example, when the camera unit 21 is focused near the surface of the board, which is the inspection object 12, tall parts The top surface may capture out-of-focus image data. Therefore, when inspecting using such image data, in the two-dimensional image data, there may be cases where characters written on the upper surface of a tall component (such as a capacitor) cannot be read. , the image of the striped pattern on the upper surface of the tall component is blurred, and accurate height information cannot be calculated.

そこで、本実施形態に係る検査装置10においては、Z方向(撮像方向)の異なる位置でカメラユニット21により撮像された少なくとも2枚の画像データを取得し、それぞれの画像データから相対的に合焦している画素を抽出して合成することにより、異なる高さの部品が配置されていたとしても、視野全体で合焦している画像データを得るように構成されている。ここでは、カメラユニット21が基準平面(上述したように、高さ情報を算出する際の基準となる面)に合焦しているときに取得された画像データと、カメラユニット21をZ方向に移動させて、Z方向の異なる位置にあるカメラユニット21により取得された画像データとを用いて合成を行う場合について説明する。以下、本実施形態に係る画像処理装置である検査装置10における画像データの合成方法について説明する。なお、ここではカメラユニット21の位置をZ方向に移動させる場合について説明するが、カメラユニット21と被検査体12とのZ方向の相対位置が変化すればよく、被検査体12の方をZ方向に移動させてもよい。なお、図3(a)に示すように、被検査体12の所定の面(例えば、電子回路基板の場合は、基板の上面)を「基準面」とする。ここで、図3(a)は、被検査体12の基準面と基準平面とが一致している場合を示している。 Therefore, in the inspection apparatus 10 according to the present embodiment, at least two pieces of image data captured by the camera unit 21 at different positions in the Z direction (imaging direction) are acquired, and relative focus is obtained from each image data. By extracting and synthesizing pixels that are in focus, it is possible to obtain image data that is in focus over the entire field of view even if components with different heights are arranged. Here, the image data acquired when the camera unit 21 is focused on the reference plane (the plane serving as the reference for calculating the height information as described above) and the camera unit 21 in the Z direction. A case will be described in which image data obtained by moving the camera unit 21 at different positions in the Z direction is used for synthesis. A method of synthesizing image data in the inspection apparatus 10, which is an image processing apparatus according to the present embodiment, will be described below. Here, the case of moving the position of the camera unit 21 in the Z direction will be described. You can move it in any direction. As shown in FIG. 3A, a predetermined surface of the device under test 12 (for example, the upper surface of the substrate in the case of an electronic circuit board) is defined as a "reference surface". Here, FIG. 3A shows a case where the reference plane of the object to be inspected 12 and the reference plane match.

また、以降の説明において、カメラユニット21のZ方向の位置は、図3(a)に示すように、基準平面に合焦しているときのカメラユニット21の位置を、Z=0を基準とする座標系で表す。具体的には、カメラユニット21のZ方向の位置を示すP(i)は、カメラユニット21が基準面に合焦しているときをi=0とし、カメラユニット21が基準平面から遠ざかる順でi=1,2,3・・・として表す。以降の説明においては、Z方向の異なる位置で4枚の画像データを取得する場合を例とする。例えば、カメラユニット21の被写界深度を4mmと想定し、基準面に合焦しているときのカメラユニット21の位置「P(0)=0」で画像データを取得し、さらに、P(0)=0の位置から4mmずつ上方(Z方向)にずれた位置で3枚の画像データを取得する場合について説明する。それぞれの位置を、「P(1)=4」、「P(2)=8]、「P(3)=12」として表す(単位のmmは省略する)。また、カメラユニット21が基準平面に合焦しているとき、すなわち、Z=0にカメラユニット21があるときのこのカメラユニット21の先端から基準平面までの距離を合焦距離とする。さらに、カメラユニット21の先端から被検査体12の方向に合焦距離離れた位置を最合焦位置FPとする。 In the following description, as shown in FIG. 3A, the position of the camera unit 21 in the Z direction is the position of the camera unit 21 when the camera unit 21 is focused on the reference plane, with Z=0 as the reference. expressed in a coordinate system that Specifically, P(i), which indicates the position of the camera unit 21 in the Z direction, is set to i=0 when the camera unit 21 is in focus on the reference plane, and in the order in which the camera unit 21 moves away from the reference plane. It is expressed as i=1, 2, 3, . . . In the following description, it is assumed that four pieces of image data are acquired at different positions in the Z direction. For example, assuming that the depth of field of the camera unit 21 is 4 mm, image data is acquired at the position "P(0)=0" of the camera unit 21 when the reference plane is in focus, and P( 0)=0, a case where three pieces of image data are acquired at positions shifted upward (in the Z direction) by 4 mm from the position of 0 will be described. The respective positions are expressed as "P(1)=4", "P(2)=8", and "P(3)=12" (the unit mm is omitted). Also, when the camera unit 21 is focused on the reference plane, that is, when the camera unit 21 is at Z=0, the distance from the tip of the camera unit 21 to the reference plane is defined as the focusing distance. Further, a position distant from the tip of the camera unit 21 by a focal distance in the direction of the inspected object 12 is defined as the most focused position FP.

なお、カメラユニット21の位置がZ方向にずれた画像データは4枚に限定されることはなく、2枚以上であればよい。また、カメラユニット21をZ方向にずらす幅は4mmに限定されることはなく、例えば、被検査体12に搭載されている部品の高さやカメラユニット21の被写界深度等を考慮して、任意の値に設定することができる。さらに、カメラユニット21のZ方向の位置を等間隔で変化させるだけでなく、それぞれの画像データを取得する間隔を任意に選択してもよい。 Note that the number of image data in which the position of the camera unit 21 is shifted in the Z direction is not limited to four, and may be two or more. Further, the width by which the camera unit 21 is shifted in the Z direction is not limited to 4 mm. Can be set to any value. Furthermore, instead of changing the position of the camera unit 21 in the Z direction at equal intervals, the intervals at which the respective image data are acquired may be arbitrarily selected.

また、Z方向のどの位置でカメラユニット21が画像データを取得するかについては、予め入力部36等から制御ユニット30に設定されているものとする。例えば、基準面の位置や検査対象の高さ(基板上に搭載された部品の高さ)を入力しておき、画像データを取得するZ方向の位置や間隔を設定しておく。また、カメラユニット21は、焦点距離が固定されているものとする。 Further, it is assumed that the position in the Z direction at which the camera unit 21 acquires image data is set in the control unit 30 in advance from the input unit 36 or the like. For example, the position of the reference plane and the height of the object to be inspected (the height of the component mounted on the board) are input, and the positions and intervals in the Z direction for acquiring image data are set. It is also assumed that the camera unit 21 has a fixed focal length.

図4を用いて、本実施形態に係る画像処理装置である検査装置10における画像データの合成方法について説明する。この画像データの合成方法においては、Z方向の異なる位置で取得された画像データのうち、被検査体12(基準面)から最も遠い位置で取得された画像データから合成処理を行うように構成されている。 A method of synthesizing image data in the inspection apparatus 10, which is the image processing apparatus according to the present embodiment, will be described with reference to FIG. In this method of synthesizing image data, among the image data acquired at different positions in the Z direction, the image data acquired at the farthest position from the object to be inspected 12 (reference plane) is subjected to synthesis processing. ing.

図4(a)に示すように、制御ユニット30は、被検査体12の画像データを取得する処理が開始されたと判断すると、撮像処理部32aによりカメラユニット21を被検査体12の上方の所定の位置(XY方向の位置)に移動させ、さらに、カメラユニット21をi=0の位置、すなわち、カメラユニット21がP(0)に位置するように、カメラユニット21のZ方向の位置を調整し、被検査体12の画像データを取得する(ステップS100)。カメラユニット21をP(0)の位置に移動させると、カメラユニット21は、被検査体12の基準面付近に合焦することとなる。なお、このステップS100においては、上述したように、被検査体12の高さマップを取得するために、投射ユニット23により被検査体12に縞パターンを投射してカメラユニット21でパターン画像データを取得するが、このとき、縞パターンの位相をずらして少なくとも3枚(できれば4枚)のパターン画像データを取得する。また、投射ユニット23を複数有している場合には、それぞれの投射ユニット23から上述したように位相をずらしながら縞パターンを被検査体12に投射してパターン画像データを取得する。さらに、2次元画像データを取得するときは、照明ユニット22の側方照明源22a,22b,22cを順次点灯して被検査体12を照明し、カメラユニット21で撮像を行う。 As shown in FIG. 4A, when the control unit 30 determines that the process of acquiring the image data of the object 12 to be inspected has started, the imaging processing section 32a moves the camera unit 21 to a predetermined position above the object 12 to be inspected. position (position in the XY direction), and further adjust the position in the Z direction of the camera unit 21 so that the camera unit 21 is positioned at i=0, that is, the camera unit 21 is positioned at P(0). Then, image data of the object to be inspected 12 is acquired (step S100). When the camera unit 21 is moved to the position P(0), the camera unit 21 is focused near the reference plane of the object 12 to be inspected. In step S100, the projection unit 23 projects the striped pattern onto the inspection object 12, and the camera unit 21 captures the pattern image data in order to obtain the height map of the inspection object 12, as described above. At this time, at least three (four if possible) pattern image data are acquired by shifting the phase of the fringe pattern. When a plurality of projection units 23 are provided, the pattern image data is acquired by projecting the fringe pattern onto the inspection object 12 while shifting the phase from each projection unit 23 as described above. Furthermore, when obtaining two-dimensional image data, the side illumination sources 22a, 22b, and 22c of the illumination unit 22 are sequentially turned on to illuminate the inspection object 12, and the camera unit 21 takes an image.

制御ユニット30は、被検査体12の撮像が終了すると、カメラユニット21がi=0の位置にあるとき、すなわちP(0)の位置にあるときに撮像したパターン画像データ(「P(0)のパターン画像データ」と呼ぶ)に基づいて算出される高さ情報から誤計測値を取り除くためのパラメータを設定する(ステップS102)。後述するように、カメラユニット21がi=0の位置にあるとき(P(0)のとき)の画像データの合成処理は最後に実行される。この最後の合成処理において、P(0)のときの画像データの画素は可能な限り合成画像データの画素として選択されるようにするため、上記パラメータは計測点数が最大化されるような値とされる。そして、このパラメータを用いて高さ基本処理S200が実行される(ステップS104)。 When the control unit 30 finishes imaging the object 12 to be inspected, the pattern image data ("P(0) parameters for removing erroneous measurement values from the height information calculated based on the pattern image data" (step S102). As will be described later, when the camera unit 21 is at the position of i=0 (when P(0)), the image data synthesizing process is executed last. In order to select pixels of the image data at P(0) as pixels of the synthesized image data as much as possible in this final synthesizing process, the above parameters are set to values that maximize the number of measurement points. be done. Then, the height basic processing S200 is executed using this parameter (step S104).

制御ユニット30は、図4(b)に示す高さ基本処理S200を開始すると、高さ測定部32bにより、縞パターンの位相をずらして撮像した3枚又は4枚のパターン画像データから、上述した式(a)~(d)に基づいて、パターン画像データ内の(視野内の)画素毎に位相計算処理を行う(ステップ202)。なお、複数の投射ユニット23を有している場合は、投射ユニット23毎に(投射別に)位相計算処理が実行される。次に、制御ユニット30は、複数の投射ユニット23を有している場合は、ぞれぞれの位相計算結果を合成する投射合成処理を実行し、画素毎の高さ情報を算出する(ステップS204)。最後に、画素毎の高さ情報に対して、メディアンフィルタ等によるノイズフィルタ処理を実行し(ステップS206)、P(0)のパターン画像に対する高さ基本処理S200の実行を終了する。 When the control unit 30 starts the height basic processing S200 shown in FIG. Based on the formulas (a) to (d), phase calculation processing is performed for each pixel (within the field of view) in the pattern image data (step 202). Note that when a plurality of projection units 23 are provided, phase calculation processing is executed for each projection unit 23 (for each projection). Next, if the control unit 30 has a plurality of projection units 23, the control unit 30 executes projection synthesis processing for synthesizing the respective phase calculation results, and calculates height information for each pixel (step S204). Finally, noise filter processing using a median filter or the like is performed on the height information for each pixel (step S206), and the execution of the height basic processing S200 for the pattern image of P(0) ends.

このように、最初にカメラユニット21がP(0)の位置にあるときに(基準面付近にカメラユニット21が合焦しているときに)画像データを取得してパターン画像データから高さ情報を算出する理由は、以降で説明するように、合成処理の判断に用いる条件(2)で、P(0)のときの振幅や高さ情報などを利用するためである。 In this way, when the camera unit 21 is at the position P(0) first (when the camera unit 21 is focused near the reference plane), the image data is obtained, and the height information is obtained from the pattern image data. is calculated because the amplitude, height information, etc. at P(0) are used in condition (2) used to determine the combining process, as will be described later.

図4(a)に戻り、ステップS104において、高さ基本処理S200の実行が終了すると、制御ユニット30は、撮像処理部32aにより、カメラユニット21のZ方向の位置を、次の撮像位置として、設定されている撮像位置のうち被検査体12から最も遠い位置に移動させる(ステップS106)。ここでは、i=3のときのP(3)=12の位置にカメラユニット21を移動させる。 Returning to FIG. 4A, in step S104, when the height basic processing S200 is completed, the control unit 30 causes the imaging processing section 32a to set the position of the camera unit 21 in the Z direction as the next imaging position. It is moved to the farthest position from the object to be inspected 12 among the set imaging positions (step S106). Here, the camera unit 21 is moved to the position of P(3)=12 when i=3.

制御ユニット30は、カメラユニット21をZ方向の次の撮像位置に移動させると、P(0)のときと同様に、撮像処理部32aにより、その撮像位置でパターン画像データ及び2次元画像データを取得し、さらに、パターン画像データから算出される高さ情報から誤計測値を取り除くためのパラメータを設定する(ステップS108)。さらに制御ユニット30は、高さ測定部32bにより、ステップS108で撮像されたパターン画像データに対して高さ基本処理S200を実行する(ステップS110)。ここでは、カメラユニット21がi=0以外の位置(中空)にあるため、高さ情報から誤計測値を取り除くためのパラメータは、計測誤差の疑いの高い点を除外する(中空での誤計測点を除外する)ように設定される。 When the control unit 30 moves the camera unit 21 to the next imaging position in the Z direction, the pattern image data and the two-dimensional image data are captured at that imaging position by the imaging processing unit 32a, as in the case of P(0). Further, parameters are set for removing erroneous measurement values from the height information calculated from the pattern image data (step S108). Further, the control unit 30 causes the height measurement section 32b to perform the height basic processing S200 on the pattern image data captured in step S108 (step S110). Here, since the camera unit 21 is at a position other than i=0 (hollow), the parameter for removing erroneous measurement values from the height information excludes points that are highly suspected to be measurement errors (erroneous measurement in hollow excluding points).

現在の撮像位置(ここでは、P(3)の位置)で撮像されたパターン画像データによる高さ情報が算出されると、制御ユニット30は、画像合成部32cにより、現在の撮像位置の画像データを用いた合成画像更新処理を実行する(ステップS112)。ここでは、現在の撮像位置の画像データの画素のうち、合焦している画像(合焦画素)を選択して合成画像データの画素の値とする。具体的には、画素毎に、以下に示す2つの式による条件(条件(1)及び(2))により、その画素の現在の撮像位置での高さ情報に基づいて、現在の撮像位置の画像データの画素を合成画像データとして選択するか否かを決定する。 When the height information is calculated from the pattern image data captured at the current imaging position (here, the position of P(3)), the control unit 30 causes the image synthesizing section 32c to generate the image data of the current imaging position. is executed (step S112). Here, among the pixels of the image data at the current imaging position, a focused image (focused pixel) is selected and used as the pixel value of the combined image data. Specifically, for each pixel, based on the height information at the current imaging position of the pixel under the following two equations (conditions (1) and (2)), A determination is made as to whether pixels of the image data are to be selected as composite image data.

P(i)-DL≦H(X,Y,i)+P(i)≦P(i+1)―DH (1)
A(X,Y,i) ≧ A(X,Y,0)×WA (2)
但し、
P(i):現在の撮像位置
P(i+1):現在の撮像位置よりも基準面から離れる隣の撮像位置
H(X,Y,i):判定対象の画素の位置が(X,Y)のときの現在の撮像位置での算出距離
DL、DH:定数
A(X,Y,i):判定対象の画素の位置が(X,Y)のときの現在の撮像位置での振幅
A(X,Y,0):判定対象の画素の位置が(X,Y)のときの撮像位置がi=0での振幅
WA:重み計数
P(i)-DL≤H(X,Y,i)+P(i)≤P(i+1)-DH (1)
A(X, Y, i) ≧ A(X, Y, 0)×WA (2)
however,
P(i): Current imaging position P(i+1): Next imaging position farther from the reference plane than the current imaging position H(X, Y, i): Position of pixel to be determined is (X, Y) DL, DH: Constant A(X, Y, i): Amplitude at the current imaging position when the position of the pixel to be determined is (X, Y) A(X, Y, 0): Amplitude at imaging position i=0 when the position of the pixel to be determined is (X, Y) WA: Weighting factor

条件(1)は、判定対象の画素に対応する被検査体12の位置(算出距離)が、現在の撮像位置におけるカメラユニット21の合焦付近にあるか否かを判断するものである。ここで、算出距離H(X,Y,i)は、判定対象の画素における、P(i)での最合焦位置FPから被検査体12までのZ方向の距離であり、基本高さ処理S200により得られる、位置(X,Y)の画素の高さ情報であって、上述したカメラユニット21の座標系で表される。例えば、P(0)=0の場合、判定対象の画素に対応する被検査体12が基準平面上にあるときはH(X,Y,i)=0となる。なお、図3(a)に示すように、カメラユニット21がZ方向に移動すると、最合焦位置FPもZ方向に移動する。また、図3(b)に示すように、DL、DHは、カメラユニット21の現在の撮像位置P(i)と、現在の撮像位置よりも基準面から離れる隣の撮像位置P(i+1)とにより、カメラユニット21により合焦した画像データが得られる範囲を決定するための定数であり、例えば、カメラユニット21の位置を4mm間隔で設定した場合は、DL=1.5mm、DH=1.0mmとすることができる。もちろん、この定数DL,DHは、カメラユニット21の仕様(被写界深度等)や、カメラユニット21をZ方向にずらす間隔により決定することができる。なお、一般にはDL>DHであることが望ましい。また、被検査体12(基準面)から最も遠い撮像位置(ここでは、P(3)=12)のときは、P(i+1)(ここではP(4))の値を予め設定しておき、この値を使って条件(1)を判断する(例えば、P(4)=16としておく)。以上より、条件(1)を満足する画素は、その位置(P(i))にあるカメラユニット21で焦点が合った画像データ(鮮明な画像データ)が得られる範囲に被検査体12があることを意味している。 Condition (1) is to determine whether or not the position (calculated distance) of the inspection object 12 corresponding to the determination target pixel is near the focus of the camera unit 21 at the current imaging position. Here, the calculated distance H(X, Y, i) is the distance in the Z direction from the most focused position FP at P(i) to the inspection object 12 in the determination target pixel. The height information of the pixel at the position (X, Y) obtained in S200 is represented by the coordinate system of the camera unit 21 described above. For example, when P(0)=0, H(X, Y, i)=0 when the inspection object 12 corresponding to the determination target pixel is on the reference plane. As shown in FIG. 3A, when the camera unit 21 moves in the Z direction, the most focused position FP also moves in the Z direction. Also, as shown in FIG. 3B, DL and DH are the current imaging position P(i) of the camera unit 21 and the adjacent imaging position P(i+1) further away from the reference plane than the current imaging position. are constants for determining the range in which focused image data can be obtained by the camera unit 21. For example, when the camera unit 21 is positioned at intervals of 4 mm, DL=1.5 mm and DH=1.5 mm. It can be 0 mm. Of course, the constants DL and DH can be determined according to the specifications of the camera unit 21 (depth of field, etc.) and the interval by which the camera unit 21 is shifted in the Z direction. In general, it is desirable that DL>DH. When the imaging position (here, P(3)=12) farthest from the object 12 (reference plane), the value of P(i+1) (here, P(4)) is set in advance. , this value is used to determine condition (1) (for example, let P(4)=16). From the above, the pixel satisfying the condition (1) is located in the inspection object 12 within the range where the camera unit 21 at the position (P(i)) can obtain focused image data (clear image data). means that

ここで、条件(1)のDL,DHを定数にする代わりに、下記に示すような変数とすることもできる。なお、FUNCは所定の関数を示し、DL(i)は、撮像位置P(i)における変数であって、次の撮像位置P(i-1)と現在の撮像位置P(i)とをパラメータする関数FUNCにより決定され、また、DH(i)は、撮像位置iにおける変数であって、現在の撮像位置P(i)と前の撮像位置P(i+1)とをパラメータとする関数FUNCによって決定される。 Here, instead of using constants for DL and DH in condition (1), variables as shown below may be used. Note that FUNC indicates a predetermined function, DL(i) is a variable at the imaging position P(i), and the next imaging position P(i−1) and the current imaging position P(i) are parameters. DH(i) is a variable at the imaging position i and is determined by the function FUNC having the current imaging position P(i) and the previous imaging position P(i+1) as parameters. be done.

DL(i)=FUNC(P(i-1),P(i))
DH(i)=FUNC(P(i),P(i+1))
DL(i)=FUNC(P(i-1), P(i))
DH(i)=FUNC(P(i), P(i+1))

また、条件(2)は、パターン画像データを用いて位相計算するときに、上述した式(a)で得られる振幅A(X,Y,i)、A(X,Y,0)により合焦度が大きい画素か否かを判定するものである。この条件(2)は、合焦度を比較してより合焦度が大きい画素を抽出し、当該画素の評価値が閾値以上であるときに合焦と判断するものである。具体的には、振幅の値が大きい方が合焦度が大きいため、P(0)のとき(i=0のとき)の振幅を基準として閾値を決定し、判定対象の画素(位置(X,Y)の画素)において、i=0のときの振幅A(X,Y,0)に比べて、現在の撮像位置における振幅A(X,Y,i)が十分大きいときに、判定対象の画素が合焦画素であると判断することができる。なお、重みWAの値は、カメラユニット21の被写界深度に基づいて決定することが望ましい。 Further, condition (2) is based on the amplitudes A(X, Y, i) and A(X, Y, 0) obtained by the above equation (a) when performing phase calculation using pattern image data. It is determined whether or not the pixel has a large degree. This condition (2) compares the degree of focus, extracts a pixel with a higher degree of focus, and determines that the pixel is in focus when the evaluation value of the pixel is equal to or greater than a threshold. Specifically, the larger the value of the amplitude, the greater the degree of focus. , Y)), when the amplitude A (X, Y, i) at the current imaging position is sufficiently larger than the amplitude A (X, Y, 0) at i=0, the determination target A pixel can be determined to be an in-focus pixel. It should be noted that the value of the weight WA is desirably determined based on the depth of field of the camera unit 21 .

以上より、撮像位置P(i)において、画素毎に条件(1)及び条件(2)を判断し、条件(1)及び条件(2)を同時に満足している画素については、現在の撮像位置における画素の値を合成画像の画素として選択する。具体的には、位置(X,Y)の画素が条件(1)及び条件(2)を満足しているときは、当該画素のP(i)のパターン画像データから算出された高さ情報(H(X,Y,i)+P(i))を高さマップの合成画像データの同じ位置の画素の値として設定し、P(i)の位置で撮像された2次元画像データの当該画素の値(輝度等)を2次元画像データの合成画像データの同じ位置の画素の値として設定する。このような条件(1)及び条件(2)を用いて判断することにより、特に合成の継ぎ目付近での誤計測を防止することができる。 From the above, the condition (1) and the condition (2) are determined for each pixel at the imaging position P(i), and the pixel satisfying the condition (1) and the condition (2) at the same time is determined at the current imaging position P(i). is selected as the pixel of the composite image. Specifically, when the pixel at the position (X, Y) satisfies the conditions (1) and (2), the height information ( H(X, Y, i)+P(i)) is set as the value of the pixel at the same position in the synthesized image data of the height map, and the value of the pixel in the two-dimensional image data captured at the position of P(i) is A value (luminance, etc.) is set as the value of the pixel at the same position in the synthesized image data of the two-dimensional image data. By making determinations using these conditions (1) and (2), it is possible to prevent erroneous measurements, particularly near the joints of the composite.

制御ユニット30は、撮像処理部32aにより、全ての画素について上記合成処理を行った場合は、予め決められたZ方向の撮像位置の全てで撮像処理が終了したか否かを判断する(ステップS114)。全ての撮像位置での撮像処理が終了していないと判断した場合(ステップS114:No)、制御ユニット30は、撮像処理部32aにより、基準面に近づく次の撮像位置にカメラユニット21の位置を設定し(ステップS116)、その撮像位置において、上述したステップS108~S114の処理を繰り返す。例えば、現在の撮像位置がP(3)=12の場合は、次の撮像位置であるP(2)=8にカメラユニット21を設定し、現在の撮像位置がP(2)=8の場合は、次の撮像位置であるP(1)=4にカメラユニット21を設定する。 When the imaging processing section 32a has performed the above synthesis processing for all pixels, the control unit 30 determines whether or not the imaging processing has been completed at all predetermined imaging positions in the Z direction (step S114). ). If it is determined that the imaging process at all imaging positions has not been completed (step S114: No), the control unit 30 causes the imaging processing section 32a to position the camera unit 21 at the next imaging position approaching the reference plane. is set (step S116), and the above-described processing of steps S108 to S114 is repeated at that imaging position. For example, if the current imaging position is P(3)=12, the camera unit 21 is set to the next imaging position P(2)=8, and if the current imaging position is P(2)=8 sets the camera unit 21 to P(1)=4, which is the next imaging position.

一方、全ての撮像位置での撮像処理が終了していると判断した場合(ステップS114:Yes)、制御ユニット30は、画像合成部32cにより、ステップS100で取得した、基準面付近にカメラユニット21が合焦しているときの画像データ(P(0)=0の画像データ)の合成画像更新処理を行う(ステップS118)。ここで、P(0)の画像データにおいては、条件(2)は常に満足するので、条件(1)を満足しているか否かで判断を行う。すなわち、ステップS118において、未だ合成画像データの値が選択されていない画素であって、条件(1)を満足する画素は、P(0)の撮像位置の画像データの画素の値(高さマップにおける高さ情報及び2次元画像データの画素の値)を合成画像データの画素の値として選択する。 On the other hand, if it is determined that the imaging process at all imaging positions has been completed (step S114: Yes), the control unit 30 causes the image synthesizing section 32c to move the camera unit 21 near the reference plane acquired in step S100. Synthetic image update processing of image data (image data of P(0)=0) when is in focus is performed (step S118). Here, since the condition (2) is always satisfied for the image data of P(0), it is determined whether or not the condition (1) is satisfied. That is, in step S118, the pixels for which the value of the composite image data has not yet been selected and which satisfy the condition (1) are the pixel values of the image data at the imaging position of P(0) (height map and the pixel value of the two-dimensional image data) is selected as the pixel value of the combined image data.

なお、ステップS108~S114の繰り返しの処理において、ある画素が条件(1)及び条件(2)を満足していたとしても、既にその撮像位置より被検査体12から遠い撮像位置において条件(1)及び条件(2)を満足していて当該画素の値が合成画像データの値として選択されている場合は、既に選択されている値を優先する。すなわち、Z方向の複数の撮像位置で条件(1)及び条件(2)を満足する画素については、それらの撮像位置のうち、被検査体12から最も遠い撮像位置の画素の値を選択する。投射ユニット23により照射された光は、被検査体12に反射した後に撮像される。カメラユニット21が基板面から遠くなるにつれ、被検査体12からの反射光量は減少する。これにより、特に合焦していない画素での不要光によるノイズが減少することにつながり、その結果、高さ情報に含まれる誤計測値が削減される。そのため、Z方向の複数の撮像位置で条件(1)及び条件(2)を満足する画素については、それらの撮像位置のうち、被検査体12から最も遠い撮像位置の画素の値を選択する。 In the repeated processing of steps S108 to S114, even if a certain pixel satisfies the conditions (1) and (2), condition (1) is already satisfied at an imaging position farther from the subject 12 than the imaging position. And if the condition (2) is satisfied and the value of the pixel is selected as the value of the composite image data, the value that has already been selected is given priority. That is, for pixels that satisfy the conditions (1) and (2) at a plurality of imaging positions in the Z direction, the value of the pixel at the imaging position farthest from the inspection object 12 is selected. The light emitted by the projection unit 23 is imaged after being reflected by the inspected object 12 . As the camera unit 21 becomes farther from the substrate surface, the amount of reflected light from the inspected object 12 decreases. This leads to a reduction in noise due to unnecessary light, especially in pixels that are not in focus, and as a result, erroneous measurement values included in height information are reduced. Therefore, for pixels that satisfy the conditions (1) and (2) at a plurality of imaging positions in the Z direction, the value of the pixel at the imaging position farthest from the object 12 to be inspected is selected.

図5は、ある視野において、被検査体12が、基板12dの上に、部品12a,12b,12cが搭載されている部分であるときの、カメラユニット21の最合焦位置FP及びその位置で撮像される画像データと、合成画像データとの関係を示している。具体的には、図5(a)~(d)の上段は、カメラユニット21の最合焦位置FPと部品12a~12dとの関係を示し、下段は、合成画像データとして選択される可能性のある部分(画素)を網掛けで示している。図5(a)は、カメラユニット21がP(3)=12にあるときを示しており、部品12aの上面が条件(1)を満足するため、同時に条件(2)を満足してれば、図5(e)に示すように、P(3)における画像データの部品12aの上面が合成画像データとして選択される。一方、部品12bの上面は、図5(b)に示すように、カメラユニット21がP(2)=8にあるときも、図5(c)に示すように、カメラユニット21がP(1)=4にあるときも、条件(1)を満足している(条件(2)も満足しているとする)。この場合、図5(e)に示すように、被検査体12から遠い方のP(2)の画像データにおける部品12bの上面が合成画像データとして選択される。また、部品12cの上面は、図5(c)に示すように、カメラユニット21がP(1)=4にあるときに、条件(1)を満足しているため、同時に条件(2)を満足していれば、図5(e)に示すように、P(1)の画像データにおける部品12cの上面が合成画像データとして選択される。同様に、基板12dの上面(基準面)は、図5(d)に示すように、カメラユニット21がP(0)=0にあるときに、条件(1)を満足しているため、同時に条件(2)を満足していれば、図5(e)に示すように、P(0)の画像データにおける基板12dの上面が合成画像データとして選択される(図5(e)参照)。 FIG. 5 shows the most focused position FP of the camera unit 21 and its position when the object 12 to be inspected is a portion where the components 12a, 12b, and 12c are mounted on the substrate 12d in a certain field of view. It shows the relationship between the captured image data and the synthesized image data. Specifically, the upper part of FIGS. 5A to 5D shows the relationship between the most focused position FP of the camera unit 21 and the components 12a to 12d, and the lower part shows the possibility of being selected as composite image data. A certain portion (pixel) of is indicated by shading. FIG. 5(a) shows when the camera unit 21 is at P(3)=12, and since the upper surface of the component 12a satisfies the condition (1), if the condition (2) is also satisfied, , and as shown in FIG. 5(e), the upper surface of the part 12a of the image data at P(3) is selected as the composite image data. On the other hand, when the camera unit 21 is at P(2)=8 as shown in FIG. )=4, the condition (1) is also satisfied (assuming that the condition (2) is also satisfied). In this case, as shown in FIG. 5E, the upper surface of the component 12b in the image data of P(2) farther from the object 12 is selected as the composite image data. Also, as shown in FIG. 5(c), the upper surface of the component 12c satisfies the condition (1) when the camera unit 21 is at P(1)=4, so the condition (2) is satisfied at the same time. If satisfied, the upper surface of the component 12c in the image data of P(1) is selected as composite image data, as shown in FIG. 5(e). Similarly, the upper surface (reference surface) of the substrate 12d satisfies the condition (1) when the camera unit 21 is at P(0)=0, as shown in FIG. 5(d). If the condition (2) is satisfied, as shown in FIG. 5(e), the upper surface of the substrate 12d in the image data of P(0) is selected as composite image data (see FIG. 5(e)).

図4に戻り、最後に、制御ユニット30は、高さ測定部32bにより、高さ後処理S300を実行する(ステップS120)。制御ユニット30の高さ測定部32bは、図4(c)に示す高さ後処理S300を開始すると、合成画像データにおいて、上述した合成画像更新処理で値が選択されなかった画素等の不計測画素を補間する処理を実行し(ステップS302)、さらに、合成画像データの歪みを補正する処理を行い(ステップS304)、高さ後処理S300を終了し、さらに、合成処理を終了する。合成前の画像データ(各撮像位置で取得されたパターン画像データから算出される高さマップ)に高さ後処理を実行してしまうと、補間された値や補正された画素まで合成画像データの画素の値として選択されてしまう可能性があり、画像データの精度が悪くなる可能性がある。したがって、不計測画素補間処理や歪み補正処理等の高さ後処理は、全ての撮像位置の画像データの合成処理が終了した後に、合成画像データに対して実行されることが望ましい。 Returning to FIG. 4, finally, the control unit 30 executes the height post-processing S300 by the height measuring section 32b (step S120). When the height post-processing S300 shown in FIG. 4C is started, the height measurement unit 32b of the control unit 30 detects unmeasured pixels such as pixels whose values were not selected in the above-described composite image update process in the composite image data. A process of interpolating pixels is executed (step S302), a process of correcting distortion of the synthesized image data is further performed (step S304), the height post-processing S300 is finished, and the synthesis process is finished. If height post-processing is performed on the image data before synthesis (the height map calculated from the pattern image data acquired at each imaging position), the interpolated values and corrected pixels will be lost in the synthesized image data. There is a possibility that it will be selected as a pixel value, and the accuracy of the image data may deteriorate. Therefore, post-height processing such as non-measurement pixel interpolation processing and distortion correction processing is desirably performed on combined image data after combining processing of image data at all imaging positions is completed.

図4に示すように、本実施形態に係る画像データの合成方法では、カメラユニット21が基準面付近に合焦しているときに(i=0の位置P(0)で)撮像された画像データを除いて、カメラユニット21のZ方向の位置を移動させて画像データを取得する毎に、高さ基本処理及び合成画像更新処理を実行している。このとき、図4では、撮像処理と、その撮像処理で取得された画像データの合成処理(高さ基本処理及び合成画像更新処理)とを一連の流れとして説明しているが、次の撮像位置での撮像処理を実行しているときに、並行して前の撮像位置で取得された画像データに対する高さ基本処理及び合成画像更新処理を実行することができる。上述したように、撮像処理においては、縞パターンの位相をずらした複数のパターン画像データの取得を複数の投射ユニット23毎に実行し、さらに、照明ユニット22の側方照明源22a,22b,22cを順次点灯して複数の2次元画像データを取得しなければならないため、次の撮像位置でこれらの撮像処理をしている間に、前の撮像位置の高さ基本処理及び合成画像更新処理を並行して実行することにより、全体の処理時間を短くし、結果として検査時間を短くすることができる。このとき、図4では、P(0)の位置で撮像処理及び高さ基本処理を実行した後は、カメラユニット21を被検査体12から最も遠いP(3)に移動させ、この撮像位置から被検査体12に近づく方向にカメラユニット21を移動させて撮像処理並びに高さ基本処理及び合成画像更新処理を実行し、最後にP(0)の画像データの合成画像更新処理を実行している。この順で撮像処理並びに高さ基本処理及び合成画像更新処理を実行することにより、現在高さ基本処理及び合成画像更新処理を実行している撮像位置よりも前の撮像位置での高さ基本処理及び合成画像更新処理において、既に合成画像データの画素の値が選択されているときは、現在高さ基本処理及び合成画像更新処理を行っている撮像位置の画像データが条件(1)及び条件(2)を満足してもその画素の値は合成画像データの対応する画素の値として選択しないという処理をすることにより、上述した「2以上の撮像位置の画像データにおける同一の位置の画素が条件(1)及び条件(2)を満足しているときは、これらの画像データのうち、被検査体12から最も遠い撮像位置の画像データの画素の値を合成画像データの画素の値として選択する」という判断基準に適合させることができる。 As shown in FIG. 4, in the method of synthesizing image data according to the present embodiment, an image captured when the camera unit 21 is focused near the reference plane (at a position P(0) where i=0) is Except for the data, height basic processing and composite image update processing are executed each time the position of the camera unit 21 is moved in the Z direction and image data is acquired. At this time, in FIG. 4, imaging processing and synthesizing processing of image data acquired in the imaging processing (basic height processing and synthetic image update processing) are described as a series of flows. , the height basic processing and the composite image update processing can be executed in parallel with the image data acquired at the previous imaging position. As described above, in the imaging process, a plurality of pattern image data obtained by shifting the phase of the fringe pattern is acquired for each of the plurality of projection units 23. must be sequentially turned on to acquire a plurality of two-dimensional image data. Therefore, while these imaging processes are being performed at the next imaging position, the height basic processing and composite image update processing of the previous imaging position are performed. By executing in parallel, the overall processing time can be shortened, and as a result, the inspection time can be shortened. At this time, in FIG. 4, after the imaging processing and the basic height processing are executed at the position P(0), the camera unit 21 is moved to P(3), which is the furthest from the object to be inspected 12, and from this imaging position The camera unit 21 is moved in a direction approaching the object 12 to be inspected, and the imaging process, the height basic process, and the composite image update process are executed, and finally the composite image update process of the image data of P(0) is executed. . By executing the imaging process, the basic height process and the composite image update process in this order, the basic height process at the imaging position before the current imaging position where the basic height process and the composite image update process are being executed. And in the composite image update process, when the pixel value of the composite image data has already been selected, the image data of the image pickup position currently undergoing the height basic processing and the composite image update process satisfy the condition (1) and the condition ( 2) is satisfied, the value of the pixel is not selected as the value of the corresponding pixel in the composite image data. When (1) and condition (2) are satisfied, the pixel value of the image data at the imaging position farthest from the object to be inspected 12 is selected as the pixel value of the combined image data. ” can be adapted to the criterion.

なお、上述した処理は、1つの視野に対して実行されるものであり、被検査体12を複数の視野に分割して撮像する(検査する)場合には、カメラユニット21をXY方向に移動させて、それぞれの視野において上記処理が実行されることになる。 Note that the above-described processing is performed for one field of view. When imaging (inspecting) the object 12 to be inspected by dividing it into a plurality of fields of view, the camera unit 21 is moved in the XY directions. Then, the above processing is executed in each field of view.

本実施形態に係る検査装置10は、制御ユニット30の検査制御部31が有する画像処理部32で取得された合成画像データ(高さマップ及び2次元画像データ)に基づいて、上述したような検査を実行する。 The inspection apparatus 10 according to the present embodiment performs the inspection as described above based on the synthesized image data (the height map and the two-dimensional image data) acquired by the image processing section 32 of the inspection control section 31 of the control unit 30. to run.

(画素を選択するための条件の第1の変形例)
上述した合成画像更新処理では、条件(2)において、対象画素の振幅に基づいて判断しているが、この条件(2)に代えて、以下に示す条件(3)で判断してもよい。すなわち、上述した条件(1)及び条件(3)により、その画素の現在の撮像位置での高さ情報に基づいて、現在の撮像位置の画像データの画素を合成画像データとして選択するか否かを決定するように構成してもよい。なお、コントラストCは、上述した式(a)から求められる振幅A及びオフセットBを用いてC=A/Bで算出される。
(First Modification of Conditions for Selecting Pixels)
In the composite image updating process described above, the condition (2) is based on the amplitude of the target pixel, but the condition (3) below may be used instead of the condition (2). That is, whether or not to select the pixel of the image data at the current imaging position as the synthesized image data based on the height information of the pixel at the current imaging position according to the conditions (1) and (3) described above. may be configured to determine The contrast C is calculated by C=A/B using the amplitude A and the offset B obtained from the above equation (a).

C(X,Y,i) ≧ C(X,Y,0)×WC (3)
但し、
C(X,Y,i):判定対象の画素の位置が(X,Y)のときの現在の撮像位置でのコントラスト
C(X,Y,0):判定対象の画素の位置が(X,Y)のときのi=0でのコントラスト
WC:重み計数
C(X,Y,i)≧C(X,Y,0)×WC (3)
however,
C(X, Y, i): Contrast at the current imaging position when the position of the pixel to be determined is (X, Y) C(X, Y, 0): The position of the pixel to be determined is (X, Y) contrast at i=0 WC: weighting factor

条件(3)は、パターン画像データを用いて位相計算するときに、上述した式(a)に基づいて得られるコントラストC(X,Y,i)、C(X,Y,0)により合焦度が大きい画素か否かを判定するものである。この条件(3)は、合焦度を比較してより合焦度が大きい画素を抽出し、当該画素の評価値が閾値以上であるときに合焦と判断するものである。具体的には、コントラストの値が大きい方が合焦度が大きいため、判定対象の画素(位置(X,Y)の画素)において、i=0のときのコントラストC(X,Y,0)に比べて、現在の撮像位置におけるコントラストC(X,Y,i)が十分大きいときに、判定対象の画素が合焦画素であると判断することができる。なお、重みWCの値は、カメラユニット21の被写界深度に基づいて決定することが望ましい。 Condition (3) is for focusing with contrast C(X, Y, i) and C(X, Y, 0) obtained based on the above equation (a) when phase calculation is performed using pattern image data. It is determined whether or not the pixel has a large degree. This condition (3) compares the degree of focus, extracts a pixel with a higher degree of focus, and determines that the pixel is in focus when the evaluation value of the pixel is equal to or greater than a threshold. Specifically, since the greater the contrast value, the greater the degree of focus, the contrast C(X, Y, 0) when i=0 in the determination target pixel (pixel at position (X, Y)) When the contrast C(X, Y, i) at the current imaging position is sufficiently large compared to , it can be determined that the determination target pixel is the in-focus pixel. Note that the value of the weight WC is desirably determined based on the depth of field of the camera unit 21 .

(高さ測定方法の変形例)
上述した説明では、投射ユニット23から、1つの縞パターンを、位相を変えて投射することにより得られた3枚または4枚のパターン画像データから高さ情報を算出する場合について説明したが、高さ情報の精度を向上させるために、周期の異なる少なくとも2種の縞パターンを使用して高さ情報を取得するように構成することもできる。例えば、上述したステップS100及びS108の撮像処理において、投射ユニット23により長周期の第1パターンを、位相を変えながら投射して3枚または4枚のパターン画像データを取得し、また、短周期の第2パターンを、位相を変えながら投射して3枚または4枚のパターン画像データを取得する。投射ユニット23が複数ある場合は、それぞれの投射ユニット23により第1パターン及び第2パターンの位相を変えたパターン画像データを取得する。そして、長周期(つまり太い縞)の第1パターンにより大まかな高さ情報(ラフ高さ)を取得し、短周期(細い縞)の第2パターンで精密な高さ情報を取得する。上述したようにPMP法は位相に基づき高さ情報を取得するので、高さギャップ(高さ差)が大きく縞が1周期以上ずれてしまうと高さ情報を一意に特定することができない。第1パターンを併用して高さ情報を取得しておくことにより、第2パターンを投射したときに縞が1周期以上ずれている場合にも高さ情報を一意に特定することが可能となる。
(Modified example of height measurement method)
In the above description, a case has been described in which height information is calculated from three or four pattern image data obtained by projecting one fringe pattern from the projection unit 23 with different phases. In order to improve the accuracy of height information, it is also possible to obtain height information using at least two types of fringe patterns with different periods. For example, in the imaging process of steps S100 and S108 described above, the projection unit 23 projects the long-period first pattern while changing the phase to acquire three or four pattern image data, and also acquires three or four pattern image data. Three or four pieces of pattern image data are acquired by projecting the second pattern while changing the phase. When there are a plurality of projection units 23, each projection unit 23 acquires pattern image data in which the phases of the first pattern and the second pattern are changed. Rough height information (rough height) is obtained from the first pattern with a long period (thick stripes), and precise height information is obtained with a second pattern with a short period (thin stripes). As described above, the PMP method acquires height information based on the phase, so if the height gap (height difference) is large and the fringes are shifted by one period or more, the height information cannot be uniquely specified. By acquiring height information in combination with the first pattern, it is possible to uniquely specify the height information even when the fringes are shifted by one period or more when the second pattern is projected. .

投射ユニット23により第1パターンの位相を変えて投射することにより得られた3枚または4枚のパターン画像データから得られる輝度Inも、第2パターンの位相を変えて投射することにより得られた3枚または4枚のパターン画像データから得られる輝度Inも、上述した式(a)の関係を有している。また、これらの輝度Inと位相φとの関係は上述した式(b)の関係を有している。 The brightness In obtained from the three or four pattern image data obtained by projecting the first pattern with the phase changed by the projection unit 23 was also obtained by projecting the second pattern with the phase changed. The luminance In obtained from the pattern image data of three or four sheets also has the relationship of the formula (a) described above. Also, the relationship between the luminance In and the phase φ has the relationship of the above-described formula (b).

ここで、長周期の第1パターンによる位相をφwとし、基準平面の位相をφw0としたときの位相差Δφwは、上述した式(c)より、次式(c1)の関係を有している。 Here, the phase difference Δφw when the phase of the long-period first pattern is φw and the phase of the reference plane is φw0 has the relationship of the following expression (c1) from the above expression (c). .

Δφw = φw - φw0 (c1) Δφw = φw - φw0 (c1)

また同様に、短周期の第2パターンによる位相をφfとし、基準平面の位相をφf0としたときの位相差Δφfは、上述した式(c)より、次式(c2)の関係を有している。 Similarly, the phase difference Δφf when the phase of the short-period second pattern is φf and the phase of the reference plane is φf0 has the relationship of the following expression (c2) from the above expression (c). there is

Δφf = φf - φf0 (c2) Δφf = φf - φf0 (c2)

これらの位相差Δφw、Δφfより、詳細な高さ情報Hは、次式(d′)で求めることができる。ここで、Mは、長周期の第1パターンの1周期に対する短周期の第2パターンの周期数であり、また、Round()は、小数点以下を四捨五入する関数である。 From these phase differences Δφw and Δφf, detailed height information H can be obtained by the following equation (d'). Here, M is the number of cycles of the second short-cycle pattern with respect to one cycle of the first long-cycle pattern, and Round( ) is a function for rounding to the nearest whole number.

H = Round((M×Δφw-Δφf)/2π)×2π+Δφf (d′) H=Round((M×Δφw−Δφf)/2π)×2π+Δφf(d′)

なお、長周期と短周期の2つの縞パターンを用いて高さ情報を算出する構成の場合、上述した条件(2)に示す振幅による判断に代えて、以下の条件(2′)に示すように振幅比による判断を行うことが望ましい。すなわち、上述した条件(1)及び条件(2′)により、現在の撮像位置の画像データの画素を合成画像データとして選択するか否かを決定することが望ましい。 In the case of a configuration in which height information is calculated using two fringe patterns of a long period and a short period, instead of the determination based on the amplitude shown in the condition (2) described above, as shown in the following condition (2'). It is desirable to make a judgment based on the amplitude ratio. That is, it is desirable to determine whether or not to select the pixels of the image data at the current imaging position as the composite image data based on the conditions (1) and (2') described above.

AR(X,Y,i) ≦ AR(X,Y,0)×WAR (2′)
但し、
AR(X,Y,i):判定対象の画素の位置が(X,Y)のときの現在の撮像位置での振幅比
AR(X,Y,0):判定対象の画素の位置が(X,Y)のときのi=0での振幅比
WAR:重み計数
AR (X, Y, i) ≤ AR (X, Y, 0) x WAR (2')
however,
AR (X, Y, i): Amplitude ratio at the current imaging position when the position of the pixel to be determined is (X, Y) AR (X, Y, 0): The position of the pixel to be determined is (X , Y) at i=0 WAR: weighting factor

なお、撮像位置P(i)において位置(X,Y)にある画素のコントラスト比AR(パラメータの(X,Y,i)は省略する)は、以下に示す式(e)に基づいて算出される。ここで、Awは、長周期の第1パターンを投射して得られた3枚または4枚のパターン画像データから式(a)により得られた振幅であり、Afは、短周期の第2パターンを投射して得られた3枚または4枚のパターン画像から式(a)により得られた振幅である。 Note that the contrast ratio AR (parameters (X, Y, i) are omitted) of a pixel at the position (X, Y) in the imaging position P(i) is calculated based on the following equation (e). be. Here, Aw is the amplitude obtained by the formula (a) from three or four pattern image data obtained by projecting the long-period first pattern, and Af is the short-period second pattern. is the amplitude obtained by the formula (a) from three or four pattern images obtained by projecting .

AR =(Aw-Af)/Af (e) AR = (Aw-Af)/Af (e)

条件(2)のときと同様に、この条件(2′)は、合焦度を比較してより合焦度が大きい画素を抽出し、当該画素の評価値が閾値以下であるときに合焦と判断するものである。具体的には、振幅比の値が小さい方が合焦度が大きいため、判定対象の画素(位置(X,Y)の画素)において、基準面付近にカメラユニット21が合焦しているとき(i=0のとき)の振幅比AR(X,Y,0)に比べて、現在の撮像位置における振幅比AR(X,Y,i)が十分小さいときに、判定対象の画素が合焦画素であると判断することができる。なお、重みWARの値は、カメラユニット21の被写界深度に基づいて決定することが望ましい。 Similar to condition (2), condition (2′) compares the degree of focus and extracts a pixel with a higher degree of focus. It is determined that Specifically, when the camera unit 21 is focused near the reference plane at the determination target pixel (pixel at position (X, Y)) because the smaller the value of the amplitude ratio, the greater the degree of focus. When the amplitude ratio AR (X, Y, i) at the current imaging position is sufficiently smaller than the amplitude ratio AR (X, Y, 0) (when i=0), the pixel to be determined is in focus. It can be determined to be a pixel. It should be noted that the value of the weight WAR is desirably determined based on the depth of field of the camera unit 21 .

あるいは、条件(2′)に代えて、以下に示す条件(3′)で判断してもよい。すなわち、上述した条件(1)及び条件(3′)により、現在の撮像位置の画像データの画素を合成画像データとして選択するか否かを決定してもよい。 Alternatively, instead of condition (2'), condition (3') shown below may be used for determination. In other words, it may be determined whether or not to select the pixels of the image data at the current imaging position as the composite image data based on the conditions (1) and (3') described above.

CR(X,Y,i) ≦ CR(X,Y,0)×WCR (3′)
但し、
CR(X,Y,i):判定対象の画素の位置が(X,Y)のときの現在の撮像位置でのコントラスト比
CR(X,Y,0):判定対象の画素の位置が(X,Y)のときのi=0でのコントラスト比
WCR:重み計数
CR (X, Y, i) ≤ CR (X, Y, 0) x WCR (3')
however,
CR(X, Y, i): Contrast ratio at the current imaging position when the position of the pixel to be determined is (X, Y) CR(X, Y, 0): The position of the pixel to be determined is (X , Y) at i=0 WCR: weighting factor

条件(3′)は、パターン画像データを用いて位相計算するときに、上述した式(a)に基づいて得られるコントラスト比により合焦している画素か否かを判定するものである。この条件(3′)は、合焦度を比較してより合焦度が大きい画素を抽出し、当該画素の評価値が閾値以下であるときに合焦と判断するものである。具体的には、コントラスト比の値が小さい方が合焦度が大きいため、判定対象の画素において、基準面付近にカメラユニット21が合焦しているとき(i=0のとき)のコントラスト比CR(X,Y,0)に比べて、現在の撮像位置におけるコントラスト比CR(X,Y,i)が十分小さいときに、判定対象の画素において焦点が合っていると判断することができる。 Condition (3') determines whether or not the pixel is in focus based on the contrast ratio obtained based on the above equation (a) when the phase is calculated using the pattern image data. This condition (3') compares the degree of focus, extracts a pixel with a higher degree of focus, and determines that the pixel is in focus when the evaluation value of the pixel is equal to or less than a threshold value. Specifically, the smaller the value of the contrast ratio, the greater the degree of focus. When the contrast ratio CR(X, Y, i) at the current imaging position is sufficiently smaller than CR(X, Y, 0), it can be determined that the determination target pixel is in focus.

なお、コントラスト比CR(パラメータの(X,Y,i)は省略する)は、長周期の第1パターンを投射して得られた3枚または4枚のパターン画像データから得られたコントラストCwと、短周期の第2パターンを投射して得られた3枚または4枚のパターン画像から得られたコントラストCfとから次式(f)により得られる。なお、Awは、第1パターンにより得られる振幅、Afは、第2パターンにより得られる振幅、Bwは、第1パターンにより得られるオフセット、Bfは、第2パターンにより得られるオフセットであって、これらの値は上述した式(a)から求められる。 Note that the contrast ratio CR (parameters (X, Y, i) are omitted) is the contrast Cw obtained from three or four pattern image data obtained by projecting the long-period first pattern. , the contrast Cf obtained from three or four pattern images obtained by projecting the short-period second pattern, and the following equation (f). Aw is the amplitude obtained by the first pattern, Af is the amplitude obtained by the second pattern, Bw is the offset obtained by the first pattern, and Bf is the offset obtained by the second pattern. The value of is obtained from the above equation (a).

CR = (Cw-Cf)/Cf (f)
但し、
Cw = Aw/Bw (g)
Cf = Af/Bf (h)
CR = (Cw-Cf)/Cf (f)
however,
Cw = Aw/Bw (g)
Cf = Af/Bf (h)

このように、上述した合成画像更新処理S112においては、条件(1)及び条件(3′)を同時に満足する画素を選択しても、焦点の合った画素を合成画像データの画素の値とすることができる。 As described above, in the above-described composite image update processing S112, even if pixels that satisfy the conditions (1) and (3′) are selected, the focused pixel is set as the pixel value of the composite image data. be able to.

(画素を選択するための条件の第2の変形例)
上述した画像データの合成方法において、合成画像更新処理S112では、高さ情報を取得するための縞パターンが1種類の場合は、現在の撮像位置で撮像された画像データの画素を合成画像データの画素として選択するか否かの判断として、条件(1)及び条件(2)、又は条件(1)及び条件(3)を同時に満足する画素を選択するように構成し、縞パターンが長周期と短周期の2種類の場合は、条件(1)及び条件(2′)又は条件(1)及び条件(3′)を同時に満足するように構成したが、条件(2)、条件(2′)又は条件(3)、条件(3′)は判断せず、現在の撮像位置で撮像された画像データにおいて、条件(1)を満足するときに合成画像データの画素として選択するように構成してもよい。条件(1)だけでも、現在の撮像位置の画像データの画素が、合焦画素であるか否かを判断できるからであり、処理時間を更に短くすることができる。なお、このように構成した場合は、基準面付近に合焦しているときの撮像位置P(0)での撮像処理は最後に行ってもよい(言い換えると、被検査体12から遠い撮像位置から撮像処理、高さ基本処理及び合成画像更新処理を実行するように構成してもよい)。
(Second Modification of Conditions for Selecting Pixels)
In the method of synthesizing the image data described above, in the synthetic image update processing S112, if there is only one stripe pattern for obtaining height information, the pixels of the image data captured at the current imaging position are replaced with the pixels of the synthetic image data. In determining whether or not to select a pixel, a pixel that satisfies the conditions (1) and (2) or the condition (1) and the condition (3) at the same time is selected. In the case of two types of short cycles, the configuration was made so as to satisfy the conditions (1) and (2') or the conditions (1) and (3') at the same time, but the conditions (2) and (2') Alternatively, the condition (3) or condition (3') is not determined, and the image data captured at the current imaging position is configured to be selected as the pixel of the composite image data when the condition (1) is satisfied. good too. This is because it is possible to determine whether or not the pixel of the image data at the current imaging position is the in-focus pixel only with condition (1), and the processing time can be further shortened. In the case of such a configuration, the imaging process at the imaging position P(0) when the focus is near the reference plane may be performed last (in other words, the imaging position far from the object 12 to be inspected). may be configured to execute the imaging process, the height basic process, and the composite image update process from (1).

また、被検査体12から遠い撮像位置から撮像処理、高さ基本処理及び合成画像更新処理を実行する場合、基準面付近にカメラユニット21が合焦しているとき(P(0))の画像データは最後に取得されるため、上述した条件(2)に代えて、以下に示す条件(2a)で判断してもよい。 Further, when the imaging process, the height basic process, and the composite image update process are executed from an imaging position far from the object 12 to be inspected, the image when the camera unit 21 is focused near the reference plane (P(0)) Since the data is acquired last, the condition (2a) shown below may be used instead of the condition (2) described above.

A(X,Y,i) ≧ TH (2a)
但し、
TH:振幅Aから予め決定された閾値
A(X, Y, i) ≧ TH (2a)
however,
TH: threshold predetermined from amplitude A

また、上述した条件(2′)を用いて判定する場合には、この条件(2′)に代えて、以下に示す条件(2a′)で判断してもよい。 Further, when the above condition (2') is used for determination, the following condition (2a') may be used instead of this condition (2').

AR(X,Y,i) ≦ TH (2a′)
但し、
TH:振幅比ARから予め決定された閾値
AR (X, Y, i) ≤ TH (2a')
however,
TH: threshold value predetermined from amplitude ratio AR

また、上述した条件(3)を用いて判定する場合には、この条件(3)に代えて、以下に示す条件(3a)で判断してもよい。 Further, when the condition (3) described above is used for determination, the condition (3a) shown below may be used instead of the condition (3).

C(X,Y,i) ≧ TH (3a)
但し、
TH:コントラストCから予め決定された閾値
C(X, Y, i) ≧ TH (3a)
however,
TH: threshold predetermined from contrast C

また、上述した条件(3′)を用いて判定する場合には、この条件(3′)に代えて、以下に示す条件(3a′)で判断してもよい。 Further, when the above condition (3') is used for determination, the following condition (3a') may be used instead of this condition (3').

CR(X,Y,i) ≦ TH (3a′)
但し、
TH:コントラスト比CRから予め決定された閾値
CR(X,Y,i)≤TH(3a')
however,
TH: threshold value predetermined from contrast ratio CR

条件(2)、(2′)又は条件(3)、(3′)に代えて、条件(2a)、(2a′)、(3a)、(3a′)を用いて判断しても、条件(1)を満足している画素において、より合焦度が大きい画素を抽出することができる。 Even if conditions (2a), (2a'), (3a), and (3a') are used instead of conditions (2), (2') or conditions (3), (3'), the condition Among the pixels that satisfy (1), it is possible to extract pixels with a higher degree of focus.

(主な特徴と効果)
本実施形態における画像データの合成方法の主な特徴及びその効果を以下にまとめる。
(main features and effects)
The main features and effects of the image data synthesizing method according to this embodiment are summarized below.

第1に、本実施形態に係る画像データの合成方法では、一つの視野に対して、カメラユニット21をZ方向(撮像方向)の異なる位置に移動させて撮像した複数の画像データを合成した合成画像データを取得するが、カメラユニット21の撮像位置が被検査体12から(基準面から)遠い画像データから合成処理を実行するように構成されている。このように構成すると、カメラユニット21が被検査体12から遠くなるにつれ、被検査体12からの反射光量が減少し、特に合焦していない画素での不要光などによるノイズが減少するため、高さ情報に含まれる誤計測値が削減される。 First, in the image data synthesizing method according to the present embodiment, a plurality of image data captured by moving the camera unit 21 to different positions in the Z direction (imaging direction) with respect to one field of view are synthesized. Image data is acquired, and the composition processing is performed from the image data in which the imaging position of the camera unit 21 is far from the object to be inspected 12 (from the reference plane). With this configuration, as the camera unit 21 becomes farther from the object 12 to be inspected, the amount of light reflected from the object 12 to be inspected decreases. Erroneous measurement values included in height information are reduced.

第2に、本実施形態に係る画像データの合成方法では、それぞれの撮像位置の画像データにおいて、合焦している画素を選択して合成画像データの画素の値としている。合焦している画素の判断基準としては、PMP法により測定された各画素の高さ情報や、PMP法における振幅やオフセットを用いており、上述した条件(1)及び条件(2)を同時に満足する画素、又は、条件(1)及び条件(3)を同時に満足する画素を選択する方法、条件(1)のみを満足する画素を選択する方法、条件(1)及び条件(2′)又は条件(1)及び条件(3′)を同時に満足する画素を選択する方法、また、条件(1)と条件(2a)、(2a′)、(3a)、(3a′)の何れかとを同時に満足する画素を選択する方法がある。このように構成すると、簡単な演算処理で精度良く合焦している画素を選択することができる。なお、異なる撮像位置の画像データにおいて合焦している条件を満足する画素においては、第1の特徴で述べたように、被検査体12から(基準面から)最も遠い撮像位置の値が選択される。 Secondly, in the method of synthesizing image data according to the present embodiment, in the image data of each imaging position, a focused pixel is selected and used as the pixel value of the synthesized image data. Height information of each pixel measured by the PMP method and amplitude and offset in the PMP method are used as criteria for determining which pixels are in focus. a method of selecting pixels satisfying conditions (1) and conditions (3) at the same time, a method of selecting pixels satisfying only condition (1), conditions (1) and conditions (2′), or A method of selecting pixels that simultaneously satisfy conditions (1) and (3'), and a method of simultaneously satisfying condition (1) and any of conditions (2a), (2a'), (3a), and (3a') There are ways to select satisfying pixels. With this configuration, it is possible to select a pixel that is in focus with high accuracy through simple arithmetic processing. For pixels that satisfy the in-focus condition in the image data of different imaging positions, as described in the first feature, the value of the imaging position farthest from the object 12 (from the reference plane) is selected. be done.

第3に、本実施形態に係る画像データの合成方法では、PMP法によりパターン画像データから高さ情報を取得するときは、パターン画像データに対して上述した合成処理を実行し、合成された画像データに対して不計測画素の補間処理や歪みの補正処理(高さ後処理)を実行するように構成されている。各撮像位置で撮像されたパターン画像データから算出される高さマップに対して補間処理や補正処理を行うと、補間や補正された画素の値(信頼できないデータ)まで合成画像データの画素の値として選択されてしまい、画像データの精度が悪くなる可能性があるが、合成された画像データ(高さマップ)に対して補間処理及び補正処理をすることにより、焦点の合った画像データに対して補間や補正が行われるので、精度の高い高さ情報を取得することができる。 Third, in the method of synthesizing image data according to the present embodiment, when height information is obtained from pattern image data by the PMP method, the above-described synthesizing process is performed on the pattern image data, and the synthesized image is It is configured to perform interpolation processing of non-measurement pixels and correction processing of distortion (height post-processing) on the data. When interpolation processing and correction processing are performed on the height map calculated from the pattern image data captured at each imaging position, the values of the pixels in the composite image data are not the same as the interpolated and corrected pixel values (unreliable data). However, by performing interpolation processing and correction processing on the synthesized image data (height map), the in-focus image data can be Since interpolation and correction are performed using the height information, highly accurate height information can be acquired.

第4に、本実施形態に係る画像データの合成方法では、誤計測値を取り除くためのパラメータは、基準面付近にカメラユニット21が合焦しているとき(P(0)のとき)は、基準面(基板面)での計測点数を最大化する値に設定され、基準面付近にカメラユニット21が合焦していないとき(P(1)~P(3)のとき)は、計測誤差の疑いの高い点は除去する値に設定される。このように構成すると、焦点の合った合成画像データを取得することができ、高さ情報の精度を向上させることができる。 Fourth, in the method of synthesizing image data according to the present embodiment, when the camera unit 21 is focused near the reference plane (when P(0)), the parameters for removing erroneous measurement values are: When the value is set to maximize the number of measurement points on the reference plane (substrate plane) and the camera unit 21 is not focused near the reference plane (P(1) to P(3)), the measurement error points of high suspicion are set to the value to remove. With this configuration, it is possible to obtain in-focus composite image data and improve the accuracy of height information.

第5に、本実施形態に係る画像データの合成方法では、カメラユニット21のZ方向の位置が被検査体12から遠い順で画像データの撮像処理を行い、撮像毎に高さ基本処理及び合成画像更新処理を実行するように構成されている。このように構成すると、次の撮像位置で撮像処理を実行しているときに、並行して前の撮像位置で撮像した画像データを用いて高さ基本処理及び合成画像更新処理を実行することができ、処理時間を短くすることができる。 Fifth, in the method of synthesizing image data according to the present embodiment, image data imaging processing is performed in the order in which the position of the camera unit 21 in the Z direction is farthest from the object 12 to be inspected, and basic height processing and synthesis are performed for each imaging. configured to perform an image update process; With such a configuration, when the imaging process is being performed at the next imaging position, the height basic processing and the composite image updating process can be performed in parallel using the image data captured at the previous imaging position. can shorten the processing time.

以上のような構成によると、基板上に高さのある部品が搭載された被検査体12であっても、焦点のあった画像データを取得することができるので、パターン画像データから算出される高さマップの高さ情報の精度が向上し、また、鮮明な2次元画像データが得られる。 According to the above configuration, it is possible to acquire focused image data even for the inspected object 12 on which a tall component is mounted on the substrate. The accuracy of the height information of the height map is improved, and clear two-dimensional image data can be obtained.

なお、以上の実施の形態は、特許請求の範囲に記載された発明を限定するものではなく、実施の形態の中で説明されている特徴的事項の組み合わせの全てが解決手段の必須事項であるとは限らないことは言うまでもない。 In addition, the above embodiments do not limit the invention described in the claims, and all combinations of characteristic items described in the embodiments are essential items of the solution. It goes without saying that this is not always the case.

10 検査装置(画像処理装置)
12 被検査体
21 カメラユニット(撮像部)
22 照明ユニット(照明部)
23 投射ユニット(投射部)
30 制御ユニット(制御部)
10 inspection device (image processing device)
12 object to be inspected 21 camera unit (imaging unit)
22 Lighting unit (lighting part)
23 projection unit (projection part)
30 control unit (control unit)

Claims (7)

被検査体との撮像方向の相対位置を変化可能な撮像部と、
制御部と、を有し、
前記制御部は、
前記撮像部と前記被検査体との撮像方向の相対位置を変化させて、撮像方向の異なる位置にある前記撮像部により撮像された少なくとも2枚の画像データを取得し、
前記画像データの画素が所定の条件を満足しているかを判断し、所定の条件を満足していると判断した画素の値を合成画像データの該当する画素の値として選択する合成画像更新処理を実行する
画像処理装置。
an imaging unit capable of changing a relative position in an imaging direction with respect to an object to be inspected;
a control unit;
The control unit
Acquiring at least two pieces of image data captured by the imaging unit at different positions in the imaging direction by changing the relative positions in the imaging direction of the imaging unit and the object to be inspected;
a synthetic image update process for judging whether the pixels of the image data satisfy a predetermined condition and selecting the value of the pixel judged to satisfy the prescribed condition as the value of the corresponding pixel of the synthetic image data; Image processing device to execute.
前記制御部は、
前記被検査体に対する前記撮像部の位置が遠い方から前記撮像部により撮像して画像データを取得する
請求項1に記載の画像処理装置。
The control unit
The image processing apparatus according to claim 1, wherein the image data is acquired by imaging with the imaging unit from a position of the imaging unit far from the object to be inspected.
前記制御部は、前記撮像部が前記被検査体の基準面に合焦しているときの画像データを取得し、その後、前記被検査体に対する前記撮像部の位置が遠い方から画像データを取得する
請求項1に記載の画像処理装置。
The control unit acquires image data when the imaging unit is focused on a reference plane of the object to be inspected, and then acquires image data from the farther position of the imaging unit with respect to the object to be inspected. The image processing device according to claim 1.
前記制御部は、前記撮像部が前記被検査体の基準面に合焦しているときの画像データに基づいて、他の位置で撮像された画像データが所定の条件を満足しているかを判断する
請求項3に記載の画像処理装置。
The control unit determines whether image data captured at another position satisfies a predetermined condition based on the image data when the imaging unit is focused on the reference plane of the object to be inspected. The image processing device according to claim 3.
前記制御部は、前記被検査体に対する前記撮像部の位置が遠い方から画像データの取得を行い、最後に前記撮像部が前記被検査体の基準面に合焦しているときの画像データを取得する
請求項1に記載の画像処理装置。
The control unit acquires image data from the position of the imaging unit farther from the object to be inspected, and finally acquires image data when the imaging unit is focused on a reference plane of the object to be inspected. The image processing apparatus according to claim 1, wherein the image is acquired.
前記制御部は、
前記合成画像更新処理において、前記被検査体に対する前記撮像部の位置が遠い画像データから順に、当該前記画像データの画素が所定の条件を満足しているかを判断する
請求項1~5のいずれか一項に記載の画像処理装置。
The control unit
6. The composite image updating process determines whether pixels of the image data satisfy a predetermined condition in order from the image data in which the position of the imaging unit is far from the object to be inspected. 1. The image processing device according to item 1.
前記制御部は、
前記画像データを取得する毎に、前記合成画像更新処理を実行する
請求項1~6のいずれか一項に記載の画像処理装置。
The control unit
The image processing apparatus according to any one of claims 1 to 6, wherein the composite image update process is executed each time the image data is acquired.
JP2021003066A 2021-01-12 2021-01-12 Image processing apparatus Pending JP2022108176A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2021003066A JP2022108176A (en) 2021-01-12 2021-01-12 Image processing apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2021003066A JP2022108176A (en) 2021-01-12 2021-01-12 Image processing apparatus

Publications (1)

Publication Number Publication Date
JP2022108176A true JP2022108176A (en) 2022-07-25

Family

ID=82556181

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021003066A Pending JP2022108176A (en) 2021-01-12 2021-01-12 Image processing apparatus

Country Status (1)

Country Link
JP (1) JP2022108176A (en)

Similar Documents

Publication Publication Date Title
JP5443303B2 (en) Appearance inspection apparatus and appearance inspection method
KR101257188B1 (en) Three-dimensional shape measuring device, three-dimensional shape measuring method, and computer readable recording medium for three-dimessional shape measuring program
JP5612969B2 (en) Appearance inspection apparatus and appearance inspection method
JP4924042B2 (en) Three-dimensional shape measuring apparatus, calibration method thereof, program, and computer-readable recording medium
JP5016520B2 (en) Three-dimensional shape measuring method and apparatus
JP6791631B2 (en) Image generation method and inspection equipment
JP2009036589A (en) Target for calibration and device, method and program for supporting calibration
JP2009115612A (en) Three-dimensional shape measuring device and three-dimensional shape measurement method
JP5385703B2 (en) Inspection device, inspection method, and inspection program
JP5682419B2 (en) Inspection method and inspection apparatus
JP5566707B2 (en) Appearance inspection apparatus and appearance inspection method
JP6894280B2 (en) Inspection method and inspection equipment
JP2019158351A (en) Object recognition method, height measurement method, and three-dimensional measurement method
US8615128B2 (en) Method for 3D, measurement of the surface of an object, in particular for dental purposes
KR101757240B1 (en) Method for generating reference pattern of 3D shape measuring device
JP5683002B2 (en) Three-dimensional measuring apparatus, three-dimensional measuring method and program
KR101227110B1 (en) Method of checking and setting inspection apparatus
JP2011021970A (en) Three-dimensional shape measuring device and three-dimensional shape measuring method
JP2022108176A (en) Image processing apparatus
JP2022108177A (en) Image processing apparatus
JP2006084286A (en) Three-dimensional measuring method and its measuring device
JP7156794B2 (en) Inspection device height information acquisition method and inspection device
JP6894348B2 (en) How to obtain height information of inspection equipment and inspection equipment
JP2016008837A (en) Shape measuring method, shape measuring device, structure manufacturing system, structure manufacturing method, and shape measuring program
JP6880396B2 (en) Shape measuring device and shape measuring method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20231030