JP2015038466A - Three-dimensional image processing apparatus, three-dimensional image processing method, three-dimensional image processing program, computer-readable recording medium, and device for storage - Google Patents

Three-dimensional image processing apparatus, three-dimensional image processing method, three-dimensional image processing program, computer-readable recording medium, and device for storage Download PDF

Info

Publication number
JP2015038466A
JP2015038466A JP2014075429A JP2014075429A JP2015038466A JP 2015038466 A JP2015038466 A JP 2015038466A JP 2014075429 A JP2014075429 A JP 2014075429A JP 2014075429 A JP2014075429 A JP 2014075429A JP 2015038466 A JP2015038466 A JP 2015038466A
Authority
JP
Japan
Prior art keywords
image
distance image
gradation
gradation conversion
distance
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.)
Granted
Application number
JP2014075429A
Other languages
Japanese (ja)
Other versions
JP6506914B2 (en
Inventor
真達 下平
Masatatsu Shimodaira
真達 下平
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.)
Keyence Corp
Original Assignee
Keyence 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 Keyence Corp filed Critical Keyence Corp
Priority to JP2014075429A priority Critical patent/JP6506914B2/en
Publication of JP2015038466A publication Critical patent/JP2015038466A/en
Priority to JP2019070254A priority patent/JP6913705B2/en
Application granted granted Critical
Publication of JP6506914B2 publication Critical patent/JP6506914B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Abstract

PROBLEM TO BE SOLVED: To suppress missing of height information to prevent reduction in accuracy, in replacing a distance image with a low-grayscale distance image.SOLUTION: A three-dimensional image processing apparatus includes: reference plane setting means which sets a reference plane, which is a reference for grayscale conversion, as a grayscale conversion parameter constituting a grayscale conversion condition, in grayscale-converting a distance image generated by distance image generation means into a distance image having a lower gray level than that of the above distance image; grayscale conversion means for grayscale-converting the distance image, based on a height of the reference plane set in the reference plane setting means, into a low-gray-level distance image formed by replacing the height information of the distance image with a grayscale value of the image, which is lower in gray level than the above distance image; and inspection execution means which executes predetermined inspection processing on the low-gray-level distance image converted by the grayscale conversion means. The reference plane setting means is configured to set a reference plane on the basis of an input image of an object input externally during operation.

Description

本発明は、三次元画像処理装置、三次元画像処理方法及び三次元画像処理プログラム、並びにコンピュータで読み取り可能な記録媒体及び記録した機器に関する。   The present invention relates to a three-dimensional image processing apparatus, a three-dimensional image processing method, a three-dimensional image processing program, a computer-readable recording medium, and a recorded device.

工場等数多くの生産現場では、人の目視に頼っていた検査を自動化・高速化する画像処理装置が導入されている。画像処理装置は、ベルトコンベア等の生産ラインを流れてくるワークをカメラによって撮像し、得られた画像データを用いて所定領域のエッジ検出や面積計算等の計測処理を実行する。そして、計測処理の処理結果に基づいて、ワークの欠け検出やアライメントマークの位置検出等の検査を行い、ワークの欠けや位置ずれの有無を判定する判定信号を出力する。このように、画像処理装置は、FAセンサの一つとして利用されることがある。   In many production sites such as factories, an image processing apparatus that automates and speeds up the inspection that relies on human visual inspection has been introduced. The image processing apparatus images a workpiece flowing on a production line such as a belt conveyor with a camera, and performs measurement processing such as edge detection and area calculation of a predetermined region using the obtained image data. Then, based on the processing result of the measurement process, inspection such as workpiece chipping detection or alignment mark position detection is performed, and a determination signal for determining the presence or absence of workpiece chipping or positional deviation is output. As described above, the image processing apparatus may be used as one of FA sensors.

FAセンサとして用いられる画像処理装置が計測処理の対象とする画像は、主に、高さ情報を含まない輝度画像である。そのため、上述したワークの欠け検出についていえば、欠けた部分の二次元形状を安定的に検出することは得意であるが、傷の凹み具合等、輝度画像としては現れ難い三次元形状を安定的に検出することは困難である。例えば、検査時にワークを照らす照明の種類や照明方向を工夫して、傷の凹みに起因する陰影を検出して、間接的に三次元形状を検出することも考えられるが、輝度画像の中で常に明瞭な陰影が検出されるとは限らない。不明瞭な陰影が検出されたときに不良品を良品と誤って判定する誤判定を防ぐために、例えば判定閾値を安全側に偏らせると、良品を大量に不良品として判定し、歩留まりの悪化を招く虞がある。   An image that is an object of measurement processing by an image processing apparatus used as an FA sensor is mainly a luminance image that does not include height information. For this reason, regarding the above-mentioned chipping detection of a workpiece, it is good at stably detecting the two-dimensional shape of the chipped portion, but the three-dimensional shape which is difficult to appear as a luminance image such as a dent of a scratch is stably displayed. It is difficult to detect. For example, it is conceivable to devise the type and direction of illumination that illuminates the workpiece during inspection, detect shadows due to dents on the scratch, and indirectly detect the three-dimensional shape, but in the luminance image Clear shadows are not always detected. In order to prevent misjudgment, for example, when the judgment threshold is biased to the safe side, it is judged that the non-defective product is judged as a defective product in large quantities and the yield deteriorates. There is a risk of inviting.

そこで、カメラの受光光量に応じた濃淡値を画素値とする輝度画像だけでなく、カメラとワークまでの距離に応じた濃淡値を画素値とすることで、高さを二次元的に表現した距離画像(例えば特許文献1参照)を用いた外観検査が考えられる。   Therefore, not only the luminance image with the pixel value as the gray value according to the amount of light received by the camera, but also the pixel value with the gray value according to the distance from the camera to the workpiece, the height is expressed two-dimensionally. An appearance inspection using a distance image (see, for example, Patent Document 1) can be considered.

三次元画像処理装置の一例を、図160の模式図に示す。この三次元画像処理装置は、受光素子等の撮像手段を備えたヘッド部と、ヘッド部と接続され、ヘッド部で撮像した画像データを送られて、取得した画像データから距離画像を生成するコントローラ部で構成される。   An example of a three-dimensional image processing apparatus is shown in the schematic diagram of FIG. The three-dimensional image processing apparatus includes a head unit including an imaging unit such as a light receiving element, and a controller that is connected to the head unit and that receives image data captured by the head unit and generates a distance image from the acquired image data. It consists of parts.

ここで三角測距の原理を、図160に基づいて説明する。ヘッド部は、投光部110から出射される入射光の光軸と、受光部120に入射する反射光の光軸(受光部120の光軸)との間の角度αが予め設定されている。ここでワーク上にワークが載置されない場合には、投光部110から出射される入射光は、ワークの載置面の点Oにより反射され、受光部120に入射される。一方、ワーク上にワークが載置される場合、投光部110から出射される入射光は、ワークの表面の点Aにより反射され、反射光となって受光部120に入射される。そして点Oと点Aとの間のX方向における距離dを測定し、この距離dに基づいてワークの表面の点Aの高さhを算出する。   Here, the principle of triangulation will be described with reference to FIG. In the head unit, an angle α between the optical axis of incident light emitted from the light projecting unit 110 and the optical axis of reflected light incident on the light receiving unit 120 (the optical axis of the light receiving unit 120) is set in advance. . Here, when the work is not placed on the work, the incident light emitted from the light projecting unit 110 is reflected by the point O on the work placing surface and is incident on the light receiving unit 120. On the other hand, when the work is placed on the work, the incident light emitted from the light projecting unit 110 is reflected by the point A on the surface of the work and is incident on the light receiving unit 120 as reflected light. Then, the distance d in the X direction between the point O and the point A is measured, and the height h of the point A on the surface of the workpiece is calculated based on the distance d.

上述した三角測距の計測原理を応用して、ワークの表面の全ての点の高さを算出することにより、ワークの三次元的な形状が測定される。パターン投影法はワークの表面の全ての点に入射光を照射するために、投光部110からは所定の構造化パターンに従って入射光が出射され、ワーク表面で反射した反射光を受光し、受光した複数のパターン画像に基づいてワークの三次元形状を効率よく測定する。   The three-dimensional shape of the workpiece is measured by calculating the heights of all points on the surface of the workpiece by applying the measurement principle of the triangulation described above. In the pattern projection method, incident light is emitted from the light projecting unit 110 according to a predetermined structured pattern in order to irradiate all points on the surface of the work, and the reflected light reflected from the work surface is received and received. The three-dimensional shape of the workpiece is efficiently measured based on the plurality of pattern images.

このようなパターン投影法には、位相シフト法や空間コード化法、マルチスリット法等が知られている。パターン投影法を用いた三次元計測処理によって、投影パターンを変化させて複数回の撮像をヘッド部で繰り返し、コントローラ部に送出する。コントローラ部では、ヘッド部から送られるパターン投影画像に基づいて演算を行い、ワークの高さ情報を有する距離画像を得ることができる。   As such a pattern projection method, a phase shift method, a spatial encoding method, a multi-slit method, and the like are known. By the three-dimensional measurement process using the pattern projection method, the projection pattern is changed, and a plurality of imaging operations are repeated at the head unit and sent to the controller unit. The controller unit can perform calculation based on the pattern projection image sent from the head unit, and obtain a distance image having workpiece height information.

一方、既存の画像処理装置では、主に輝度を画素値とした輝度画像が使用されている。例えば、ライン上を搬送されるワークに対して、モノクロのカメラでワークの外観を光学的な濃淡で表現した輝度画像を撮像して、画像処理によって検査を行うシステムが存在する。このような状況において、新たに三次元計測装置、及びそこから出力される三次元データ(ポイントクラウドデータ)を処理する処理装置を導入しようとすると、相当コストがかかる。   On the other hand, in an existing image processing apparatus, a luminance image mainly using luminance as a pixel value is used. For example, there is a system that inspects a workpiece conveyed on a line by taking a luminance image in which the appearance of the workpiece is expressed with optical density using a monochrome camera and performing image processing. In such a situation, if it is going to introduce a new three-dimensional measuring device and a processing device for processing three-dimensional data (point cloud data) output from the new three-dimensional measuring device, a considerable cost is required.

そこで、高さ情報を画像の濃淡として表現した距離画像として表現すれば、扱う画像データ自体は既存の輝度画像と同等となるため、既存の輝度画像を用いた画像処理装置の設備においても、距離画像を扱えることとなる。   Therefore, if the height information is expressed as a distance image expressed as the shading of the image, the image data itself is equivalent to the existing luminance image. Therefore, even in the equipment of the image processing apparatus using the existing luminance image, the distance You can handle images.

この場合において、従来の輝度画像においては、比較的低い階調数の画像が利用されていた。例えば一画素当たりの情報を8階調で表現した画像が多く利用されている。一方で、高さ情報を有する画像データについては、高さ情報を表現するため、多くの階調数(例えば16階調)を要する。このため、距離画像を既存の低階調の画像を扱う画像処理装置にて処理できるようにするには、多階調の距離画像を、比較的低階調の距離画像に変換する必要がある。(以下、多階調の距離画像を低階調の距離画像に変換した画像を「低階調距離画像」と呼び、従来の、輝度情報を有する輝度画像を「輝度画像」と呼ぶ。)   In this case, in the conventional luminance image, an image having a relatively low number of gradations has been used. For example, an image in which information per pixel is expressed in 8 gradations is often used. On the other hand, image data having height information requires a large number of gradations (for example, 16 gradations) in order to express the height information. For this reason, it is necessary to convert a multi-tone distance image into a relatively low-tone distance image so that the distance image can be processed by an existing image processing apparatus that handles low-tone images. . (Hereinafter, an image obtained by converting a multi-tone distance image into a low-tone distance image is referred to as a “low-tone distance image”, and a conventional luminance image having luminance information is referred to as a “luminance image”.)

このように、従来から利用されている輝度画像に加えて、階調変換された低階調距離画像を利用することで、ワークの正常・異常を判定する検査に際して、従来の形状の抽出といった画像処理のみならず、高さ情報を利用した高さの測定等の処理を、三次元画像処理装置において利用することが可能となる。   In this way, in addition to the conventionally used luminance image, an image such as conventional shape extraction is used at the time of inspection for determining normality / abnormality of a workpiece by using a gradation-converted low gradation distance image. In addition to processing, processing such as height measurement using height information can be used in a three-dimensional image processing apparatus.

この場合において、高階調(例えば16階調)の高さ情報を、既存の輝度画像と同じ階調数(例えば8階調)に変換する階調変換が必須になる。このとき、階調変換パラメータが適切に設定されないと、検査に必要な高さ情報が欠落してしまい、検査に適した画像を取得できない場合がある。   In this case, gradation conversion for converting high gradation (for example, 16 gradations) height information into the same number of gradations (for example, 8 gradations) as the existing luminance image is essential. At this time, if the gradation conversion parameter is not set appropriately, height information necessary for the inspection may be lost, and an image suitable for the inspection may not be acquired.

そこで、検査対象のワークの高さ情報を用いて、階調変換パラメータを適切に設定し、階調変換の基準高さを決定することが考えられる。   In view of this, it is conceivable to appropriately set the gradation conversion parameter and determine the reference height for gradation conversion using the height information of the workpiece to be inspected.

しかしながら、使用者の検査対象ワークに高さ方向のばらつきが存在する場合、当初指定した階調変換パラメータにより階調変換を行うだけでは、検査に適した画像を取得できないことがあった。   However, when there are variations in the height direction of the work to be inspected by the user, it may not be possible to obtain an image suitable for inspection simply by performing gradation conversion using the gradation conversion parameters specified at the beginning.

特許第4969478号公報Japanese Patent No. 4969478

本発明は、従来のこのような問題点を解決するためになされたものである。本発明の主な目的は、距離画像を低階調距離画像に変換する際に、高さ情報の欠落を抑制して精度の低下を抑えた三次元画像処理装置、三次元画像処理方法及び三次元画像処理プログラム並びにコンピュータで読み取り可能な記録媒体を提供することにある。   The present invention has been made to solve such conventional problems. A main object of the present invention is to provide a three-dimensional image processing apparatus, a three-dimensional image processing method, and a third order that suppress a drop in accuracy by suppressing a loss of height information when converting a distance image into a low gradation distance image. An original image processing program and a computer-readable recording medium are provided.

課題を解決するための手段及び発明の効果Means for Solving the Problems and Effects of the Invention

上記の目的を達成するために、本発明の第1の側面に係る三次元画像処理装置によれば、検査対象物の高さ情報を含む距離画像を取得すると共に、該距離画像に基づいて画像処理を行うことが可能な三次元画像処理装置であって、検査対象物の画像を撮像する撮像手段と、前記撮像手段で撮像された画像に基づいて、距離画像を生成可能な距離画像生成手段と、前記距離画像生成手段で生成された距離画像を、該距離画像の階調数よりも低い階調数の距離画像に階調変換する際の階調変換条件を構成する階調変換パラメータとして、該階調変換を行う基準となる基準面を設定するための基準面設定手段と、前記基準面設定手段で設定された基準面の高さを基準として、前記距離画像を、該距離画像の階調数よりも低い階調数の、該距離画像が有する高さ情報を画像の濃淡値に置き換えた低階調距離画像に階調変換するための階調変換手段と、前記階調変換手段で階調変換された低階調距離画像に対して、所定の検査処理を実行するための検査実行手段と、前記階調変換手段で階調変換された低階調距離画像を表示させるための表示手段とを備え、前記基準面設定手段が、運用時に外部から入力される検査対象物の入力画像に基づいて、基準面を設定するよう構成できる。上記構成により、単純に高階調の距離画像を低階調の距離画像に変換するのでなく、基準面を設定した上で、この基準面の高さを基準として階調変換を行うことで、基準面近傍の高さ情報が階調変換で損なわれる事態を回避して、精度の高い検査が実現できる。   In order to achieve the above object, according to the three-dimensional image processing apparatus according to the first aspect of the present invention, a distance image including height information of an inspection object is acquired, and an image is obtained based on the distance image. A three-dimensional image processing apparatus capable of performing processing, an imaging unit that captures an image of an inspection object, and a distance image generation unit that can generate a distance image based on an image captured by the imaging unit And a gradation conversion parameter that constitutes a gradation conversion condition when the distance image generated by the distance image generation means is converted into a distance image having a gradation number lower than the number of gradations of the distance image. A reference plane setting means for setting a reference plane to be used as a reference for the gradation conversion, and the distance image is converted into the distance image based on the height of the reference plane set by the reference plane setting means. The distance image having a gradation number lower than the gradation number is Gradation conversion means for converting the gradation information into a low gradation distance image in which the height information is replaced with the gray value of the image, and the low gradation distance image subjected to gradation conversion by the gradation conversion means, Inspection execution means for executing a predetermined inspection process; and display means for displaying a low gradation distance image subjected to gradation conversion by the gradation conversion means, wherein the reference plane setting means is in operation. The reference plane can be set based on the input image of the inspection object input from the outside. With the above configuration, instead of simply converting a distance image with a high gradation into a distance image with a low gradation, a reference plane is set, and gradation conversion is performed with reference to the height of the reference plane. By avoiding the situation where the height information in the vicinity of the surface is lost due to the gradation conversion, a highly accurate inspection can be realized.

また、第2の側面に係る三次元画像処理装置によれば、前記基準面設定手段が、前記表示手段上に表示された距離画像中の任意の点を指定することで、該指定された点の高さ情報を基準面として設定するよう構成できる。   Further, according to the 3D image processing apparatus according to the second aspect, the reference plane setting means designates an arbitrary point in the distance image displayed on the display means, thereby specifying the designated point. The height information can be set as the reference plane.

さらに、第3の側面に係る三次元画像処理装置によれば、前記基準面設定手段が、前記表示手段上に表示された距離画像中の任意の一点を指定することで、該指定された点の高さ情報を基準面として設定するよう構成できる。   Further, according to the three-dimensional image processing apparatus according to the third aspect, the reference plane setting unit specifies an arbitrary point in the distance image displayed on the display unit, so that the specified point The height information can be set as the reference plane.

さらにまた、第4の側面に係る三次元画像処理装置によれば、前記基準面設定手段が、前記表示手段上に表示された距離画像中の任意の面を指定することで、該指定された面の高さ情報を基準面として設定するよう構成できる。   Furthermore, according to the three-dimensional image processing apparatus according to the fourth aspect, the reference plane setting means designates an arbitrary plane in the distance image displayed on the display means, thereby specifying the designated plane. The height information of the surface can be set as the reference surface.

さらにまた、第5の側面に係る三次元画像処理装置によれば、前記基準面設定手段が、前記表示手段上に表示された距離画像中の任意の三点を指定することで、該指定された三点を含む面の高さ情報を基準面として設定するよう構成できる。   Furthermore, according to the three-dimensional image processing apparatus according to the fifth aspect, the reference plane setting means specifies the three specified points in the distance image displayed on the display means. The height information of the surface including the three points can be set as the reference surface.

さらにまた、第6の側面に係る三次元画像処理装置によれば、前記基準面設定手段が、前記表示手段上に表示された距離画像から、曲面を演算し、該演算された曲面を基準面として設定するよう構成できる。   Furthermore, according to the three-dimensional image processing apparatus according to the sixth aspect, the reference plane setting unit calculates a curved surface from the distance image displayed on the display unit, and the calculated curved surface is used as a reference plane. Can be configured as

さらにまた、第7の側面に係る三次元画像処理装置によれば、前記階調変換手段が階調変換を行う際に、入力画像の位置補正を行うよう構成できる。   Furthermore, the three-dimensional image processing apparatus according to the seventh aspect can be configured to correct the position of the input image when the gradation converting means performs gradation conversion.

さらにまた、第8の側面に係る三次元画像処理装置によれば、さらに撮像手段の光軸に対して斜め方向から入射光を所定の投影パターンの構造化照明として投光するための投光手段を備えており、前記撮像手段は、前記投光手段で投光され、検査対象物で反射された反射光を取得して複数のパターン投影画像を撮像し、前記距離画像生成手段は、前記撮像手段で撮像された複数のパターン投影画像に基づいて、距離画像を生成するよう構成できる。上記構成により、パターン投影を利用した距離画像を用いた高さ計測等の検査処理を実現できる。   Furthermore, according to the three-dimensional image processing apparatus according to the eighth aspect, the light projecting means for projecting incident light as structured illumination with a predetermined projection pattern from an oblique direction with respect to the optical axis of the imaging means. The imaging means obtains reflected light that is projected by the light projecting means and reflected by the inspection object, and images a plurality of pattern projection images, and the distance image generating means is configured to capture the imaging A distance image can be generated based on a plurality of pattern projection images captured by the means. With the above configuration, inspection processing such as height measurement using a distance image using pattern projection can be realized.

さらにまた、第9の側面に係る三次元画像処理装置によれば、さらに前記階調変換手段による階調変換に際して、局所的な形状変化を抽出する方向を指定するための抽出方向入力手段を備えることができる。上記構成により、抽出方向入力手段で指定された方向における検査対象物の変化を抽出でき、いいかると該指定された方向において変化しない形状、例えば長手方向に連続する溝などは無視して、正確な形状抽出が可能となる。   Furthermore, the three-dimensional image processing apparatus according to the ninth aspect further includes an extraction direction input means for designating a direction in which a local shape change is extracted when the gradation conversion is performed by the gradation conversion means. be able to. With the above configuration, it is possible to extract the change in the inspection object in the direction specified by the extraction direction input means. In other words, the shape that does not change in the specified direction, for example, a groove continuous in the longitudinal direction is ignored, and the change is accurate. Shape extraction is possible.

さらにまた、第10の側面に係る三次元画像処理装置によれば、前記抽出方向入力手段が、局所的な形状変化を抽出する方向として、距離画像のX方向、Y方向、又はXY方向   Furthermore, according to the three-dimensional image processing apparatus according to the tenth aspect, the extraction direction input means extracts the local shape change as the direction in which the local shape change is extracted, in the X direction, Y direction, or XY direction.

さらにまた、第11の側面に係る三次元画像処理装置によれば、前記階調変換手段が、階調変換に際して、距離画像を一旦縮小し、フィルタ処理を行った後拡大して自由曲面画像を作成し、該自由曲面画像と距離画像との差分を取ることで、距離画像の形状変化を抽出するものであり、該距離画像の縮小に際して、前記抽出方向入力手段で指定された方向に対してのみ縮小を行うこととできる。上記構成により、抽出方向入力手段で指定された方向以外に対しては縮小を行わず、指定された方向に対してのみ距離画像を縮小することで、自由曲面画像に指定された方向における一様に連続する高さ情報を残し、これとの差分を取ることで該方向における一様に連続する緩やかな形状変化を排除して、必要な形状のみを抽出することが可能となる。   Furthermore, according to the three-dimensional image processing apparatus according to the eleventh aspect, the gradation converting means temporarily reduces the distance image upon performing the gradation conversion, performs the filtering process, and then expands the free curved surface image. The difference between the free-form surface image and the distance image is created and the shape change of the distance image is extracted, and when the distance image is reduced, the direction specified by the extraction direction input means is extracted. Only reduction can be done. With the above configuration, the distance image is reduced only in the specified direction without reducing the direction other than the direction specified by the extraction direction input unit, so that the uniform in the direction specified in the free-form surface image is obtained. Thus, it is possible to extract only a necessary shape by removing the difference between the height information and the continuous height information, and eliminating a uniform continuous gentle shape change in the direction.

さらにまた、第12の側面に係る三次元画像処理装置によれば、さらに検査対象物に対して光切断法で投光するための投光手段を備えており、前記撮像手段は、前記投光手段で投光された画像を撮像し、前記距離画像生成手段は光切断法で得られたプロファイルを合成して距離画像を生成するよう構成できる。   Furthermore, the three-dimensional image processing apparatus according to the twelfth aspect further includes a light projecting unit for projecting light onto the inspection object by a light cutting method, and the image capturing unit includes the light projecting device. The distance image generation means can be configured to generate a distance image by synthesizing the profile obtained by the light cutting method.

さらにまた、第13の側面に係る三次元画像処理方法によれば、検査対象物の高さ情報を含む距離画像を取得すると共に、該距離画像に基づいて画像処理を行う三次元画像処理方法であって、撮像手段の光軸に対して斜め方向から入射光を所定の投影パターンの構造化照明として投光手段で投光する工程と、前記投光手段で投光され、検査対象物で反射された反射光を取得して複数のパターン投影画像を撮像手段で撮像する工程と、前記撮像手段で撮像された複数のパターン投影画像に基づいて、距離画像を距離画像生成手段で生成する工程と、前記距離画像生成手段で生成された距離画像を、該距離画像の階調数よりも低い階調数の距離画像に階調変換する際の階調変換条件を構成する階調変換パラメータとして、該階調変換を行う基準となる基準面を設定する工程と、前記設定された基準面の高さを基準として、前記距離画像を、該距離画像の階調数よりも低い階調数の、該距離画像が有する高さ情報を画像の濃淡値に置き換えた低階調距離画像に階調変換する工程と、前記階調変換された低階調距離画像に対して、所定の検査処理を実行する工程とを含むことができる。これにより、単純に高階調の距離画像を低階調の距離画像に変換するのでなく、基準面を設定した上で、この基準面の高さを基準として階調変換を行うことで、基準面近傍の高さ情報が階調変換で損なわれる事態を回避して、精度の高い検査が実現できる。   Furthermore, according to the three-dimensional image processing method according to the thirteenth aspect, the three-dimensional image processing method acquires a distance image including height information of the inspection object and performs image processing based on the distance image. A step of projecting incident light from the oblique direction with respect to the optical axis of the imaging unit as a structured illumination of a predetermined projection pattern by the light projecting unit, and the light projected by the light projecting unit and reflected by the inspection object Acquiring the reflected light and capturing a plurality of pattern projection images with an imaging unit; generating a distance image with a distance image generation unit based on the plurality of pattern projection images captured with the imaging unit; As a gradation conversion parameter that constitutes a gradation conversion condition when the distance image generated by the distance image generation means is converted into a distance image having a gradation number lower than the number of gradations of the distance image, A standard for the gradation conversion and And a height information of the distance image having a lower number of gradations than the number of gradations of the distance image on the basis of the height of the set reference surface. Gradation conversion into a low gradation distance image in which the gray value of the image is replaced, and a predetermined inspection process is performed on the gradation converted low gradation distance image. . In this way, instead of simply converting a high-tone distance image to a low-tone distance image, a reference plane is set, and gradation conversion is performed with reference to the height of the reference plane. By avoiding the situation where the height information in the vicinity is lost due to the gradation conversion, a highly accurate inspection can be realized.

さらにまた、第14の側面に係る三次元画像処理方法によれば、前記基準面の設定に際して、局所的な形状変化を抽出する方向を指定するよう促す工程を含んでおり、前記階調変換に際して、距離画像から曲面を演算し、該演算された曲面を基準面として低階調距離画像に階調変換することで、該指定された方向における形状変化を抽出することができる。これにより、抽出方向入力手段で指定された方向における検査対象物の変化を抽出でき、いいかると該指定された方向において変化しない形状、例えば長手方向に連続する溝などは無視して、正確な形状抽出が可能となる。   Furthermore, according to the four-dimensional image processing method according to the fourteenth aspect, the setting of the reference plane includes a step of prompting the user to specify a direction in which a local shape change is extracted. By calculating a curved surface from the distance image and converting the gradation to a low gradation distance image using the calculated curved surface as a reference plane, it is possible to extract a shape change in the designated direction. As a result, the change in the inspection object in the direction specified by the extraction direction input means can be extracted. Shape extraction is possible.

さらにまた、第15の側面に係る三次元画像処理方法によれば、前記基準面の設定に際して、局所的な形状変化を抽出する方向として、距離画像のX方向、Y方向、又はXY方向のいずれかを指定するよう促す工程を含むことができる。   Furthermore, according to the three-dimensional image processing method according to the fifteenth aspect, any one of the X direction, the Y direction, and the XY direction of the distance image can be used as a direction for extracting a local shape change when setting the reference plane. A step of prompting the user to specify the order can be included.

さらにまた、第16の側面に係る三次元画像処理方法によれば、前記階調変換に際して、距離画像を一旦縮小し、フィルタ処理を行い、拡大して自由曲面画像を作成し、該自由曲面画像と距離画像との差分を取ることで、距離画像の形状変化を抽出するものであり、該距離画像の縮小に際して、前記抽出方向入力手段で指定された方向に対してのみ縮小を行うこととできる。これにより、抽出方向入力手段で指定された方向に対しては縮小を行わず、指定された方向以外で距離画像を縮小することで、自由曲面画像に指定された方向における高さ情報を残し、これとの差分を取ることで該方向における緩やかな形状変化を排除して、必要な形状のみを抽出することが可能となる。   Furthermore, according to the three-dimensional image processing method according to the sixteenth aspect, at the time of the gradation conversion, the distance image is once reduced, filtered, and enlarged to create a free-form surface image. The distance image is extracted by extracting the difference between the distance image and the distance image, and the distance image can be reduced only in the direction specified by the extraction direction input means. . Thereby, without reducing the direction specified by the extraction direction input means, by reducing the distance image in a direction other than the specified direction, the height information in the specified direction is left in the free-form surface image, By taking a difference from this, it is possible to eliminate a gradual shape change in the direction and extract only a necessary shape.

さらにまた、第17の側面に係る三次元画像処理プログラムによれば、検査対象物の高さ情報を含む距離画像を取得すると共に、該距離画像に基づいて画像処理を行うことが可能な三次元画像処理プログラムであって、コンピュータに、撮像手段の光軸に対して斜め方向から入射光を所定の投影パターンの構造化照明として投光し、検査対象物で反射された反射光を取得して撮像された複数のパターン投影画像に基づいて、距離画像を生成可能な距離画像生成機能と、前記距離画像生成機能で生成された距離画像を、該距離画像の階調数よりも低い階調数の距離画像に階調変換する際の階調変換条件を構成する階調変換パラメータとして、該階調変換を行う基準となる基準面を設定するための基準面設定機能と、前記基準面設定機能で設定された基準面の高さを基準として、前記距離画像を、該距離画像の階調数よりも低い階調数の、該距離画像が有する高さ情報を画像の濃淡値に置き換えた低階調距離画像に階調変換するための画像階調変換機能と、前記階調変換機能で階調変換された低階調距離画像に対して、所定の検査処理を実行するための検査実行機能とを実現させることができる。上記構成により、単純に高階調の距離画像を低階調の距離画像に変換するのでなく、基準面を設定した上で、この基準面の高さを基準として階調変換を行うことで、基準面近傍の高さ情報が階調変換で損なわれる事態を回避して、精度の高い検査が実現できる。   Furthermore, according to the three-dimensional image processing program according to the seventeenth aspect, a three-dimensional image capable of acquiring a distance image including the height information of the inspection object and performing image processing based on the distance image. An image processing program for projecting incident light as a structured illumination of a predetermined projection pattern on a computer from an oblique direction with respect to an optical axis of an imaging unit, and acquiring reflected light reflected by an inspection object A distance image generation function capable of generating a distance image based on a plurality of captured pattern projection images, and a distance image generated by the distance image generation function, the number of gradations lower than the number of gradations of the distance image A reference plane setting function for setting a reference plane serving as a reference for performing gradation conversion as a gradation conversion parameter that constitutes a gradation conversion condition for gradation conversion to a distance image of the distance image, and the reference plane setting function Set in Based on the height of the reference plane, the distance image is a low gradation distance obtained by replacing the height information of the distance image with the gradation number lower than the number of gradations of the distance image with the gray value of the image. An image gradation conversion function for gradation conversion into an image and an inspection execution function for executing a predetermined inspection process on a low gradation distance image subjected to gradation conversion by the gradation conversion function are realized. Can be made. With the above configuration, instead of simply converting a distance image with a high gradation into a distance image with a low gradation, a reference plane is set, and gradation conversion is performed with reference to the height of the reference plane. By avoiding the situation where the height information in the vicinity of the surface is lost due to the gradation conversion, a highly accurate inspection can be realized.

さらにまた、第18の側面に係るコンピュータで読み取り可能な記録媒体又は記憶した機器は、上記三次元画像処理プログラムを格納するものである。記録媒体には、CD−ROM、CD−R、CD−RWやフレキシブルディスク、磁気テープ、MO、DVD−ROM、DVD−RAM、DVD−R、DVD+R、DVD−RW、DVD+RW、Blu−ray(登録商標)、HD DVD(AOD)等の磁気ディスク、光ディスク、光磁気ディスク、半導体メモリその他のプログラムを格納可能な媒体が含まれる。またプログラムには、上記記録媒体に格納されて配布されるものの他、インターネット等のネットワーク回線を通じてダウンロードによって配布される形態のものも含まれる。さらに記憶した機器には、上記プログラムがソフトウェアやファームウェア等の形態で実行可能な状態に実装された汎用もしくは専用機器を含む。さらにまたプログラムに含まれる各処理や機能は、コンピュータで実行可能なプログラムソフトウエアにより実行してもよいし、各部の処理を所定のゲートアレイ(FPGA、ASIC)等のハードウエア、又はプログラムソフトウエアとハードウェアの一部の要素を実現する部分的ハードウエアモジュールとが混在する形式で実現してもよい。   Furthermore, a computer-readable recording medium or a stored device according to the eighteenth aspect stores the above three-dimensional image processing program. CD-ROM, CD-R, CD-RW, flexible disk, magnetic tape, MO, DVD-ROM, DVD-RAM, DVD-R, DVD + R, DVD-RW, DVD + RW, Blu-ray (registered) Trademark), HD DVD (AOD), and other magnetic disks, optical disks, magneto-optical disks, semiconductor memories, and other media that can store programs. The program includes a program distributed in a download manner through a network line such as the Internet, in addition to a program stored and distributed in the recording medium. Furthermore, the stored devices include general-purpose or dedicated devices in which the program is implemented in a state where it can be executed in the form of software, firmware, or the like. Furthermore, each process and function included in the program may be executed by computer-executable program software, or each part of the process or hardware may be executed by hardware such as a predetermined gate array (FPGA, ASIC), or program software. And a partial hardware module that realizes a part of hardware elements may be mixed.

本発明の実施の形態に係る画像処理装置を含む三次元画像処理システムのシステム構成例を示す図である。1 is a diagram illustrating a system configuration example of a three-dimensional image processing system including an image processing apparatus according to an embodiment of the present invention. 本発明の変形例に係る三次元画像処理システムのシステム構成例を示す図である。It is a figure which shows the system configuration example of the three-dimensional image processing system which concerns on the modification of this invention. 本発明の実施の形態2に係る三次元画像処理装置のハードウェア構成を示す模式図である。It is a schematic diagram which shows the hardware constitutions of the three-dimensional image processing apparatus which concerns on Embodiment 2 of this invention. 図4Aは本発明の実施の形態3に係る三次元画像処理装置のヘッド部、図4Bは実施の形態4に係る三次元画像処理装置のヘッド部をそれぞれ示す模式図である。FIG. 4A is a schematic diagram showing a head part of a 3D image processing apparatus according to Embodiment 3 of the present invention, and FIG. 4B is a schematic diagram showing a head part of the 3D image processing apparatus according to Embodiment 4. 本発明の実施の形態3に係る三次元画像処理装置を示すブロック図である。It is a block diagram which shows the three-dimensional image processing apparatus which concerns on Embodiment 3 of this invention. 図5のコントローラ部を示すブロック図である。It is a block diagram which shows the controller part of FIG. 本実施形態に係る画像処理装置の処理動作を示すフローチャートである。5 is a flowchart illustrating a processing operation of the image processing apparatus according to the present embodiment. 設定時における静的変換の手順を示すフローチャートである。It is a flowchart which shows the procedure of the static conversion at the time of a setting. 三次元画像処理プログラムで「撮像」を追加した初期画面を示すイメージ図である。It is an image figure which shows the initial screen which added "imaging" with the three-dimensional image processing program. 撮像設定メニューで画像登録を選択した状態を示すイメージ図である。It is an image figure which shows the state which selected image registration by the imaging setting menu. 画像登録画面の画面例を示すイメージ図である。It is an image figure which shows the example of a screen of an image registration screen. 距離画像を登録中の画面例を示すイメージ図である。It is an image figure which shows the example of a screen during registration of a distance image. 輝度画像を登録中の画面例を示すイメージ図である。It is an image figure which shows the example of a screen during registration of a luminance image. 撮像設定画面を示すイメージ図である。It is an image figure which shows an imaging setting screen. 撮像有効設定画面を示すイメージ図である。It is an image figure which shows an imaging effective setting screen. 三次元計測設定画面を示すイメージ図である。It is an image figure which shows a three-dimensional measurement setting screen. 選択可能な前処理の種類を示すイメージ図である。It is an image figure which shows the kind of selectable pre-processing. 計測不能基準設定欄で設定可能な選択肢を示すイメージ図である。It is an image figure which shows the choice which can be set in a measurement impossible reference | standard setting column. 計測不能基準設定欄で「なし」を選択した例を示すイメージ図である。It is an image figure which shows the example which selected "None" in the measurement impossible standard setting column. 計測不能基準設定欄で「低」を選択した例を示すイメージ図である。It is an image figure which shows the example which selected "low" in the measurement impossible reference | standard setting column. 計測不能基準設定欄で「中」を選択した例を示すイメージ図である。It is an image figure which shows the example which selected "medium" in the measurement impossible reference | standard setting column. 計測不能基準設定欄で「高」を選択した例を示すイメージ図である。It is an image figure which shows the example which selected "high" in the measurement impossible reference | standard setting column. 均等間隔処理設定欄で設定可能な選択肢を示すイメージ図である。It is an image figure which shows the choice which can be set in the equal interval process setting column. 均等間隔処理をON、「表示画像」選択欄を「高さ画像」とした例を示すイメージ図である。It is an image figure which shows the example which set the equal interval process to ON, and set the "display image" selection column to "height image". 均等間隔処理をON、「表示画像」選択欄を「濃淡画像」とした例を示すイメージ図である。It is an image figure which shows the example which set the equal space | interval process to ON and set the "display image" selection column to "grayscale image". 均等間隔処理をOFF、距離画像を表示した例を示すイメージ図である。It is an image figure which shows the example which turned off the equal space | interval process and displayed the distance image. 均等間隔処理をOFF、輝度画像を表示した例を示すイメージ図であIt is an image figure which shows the example which turned off the equal interval processing and displayed the luminance image. 空間コード設定欄で設定可能な選択肢を示すイメージ図である。It is an image figure which shows the choice which can be set in a space code setting column. 「表示画像」選択欄で「高さ画像」を選択し第二画像表示領域に距離画像を表示させた状態を示すイメージ図である。It is an image figure which shows the state which selected the "height image" in the "display image" selection column, and displayed the distance image in the 2nd image display area. 「表示画像」選択欄で「濃淡画像」を選択し第二画像表示領域に輝度画像を表示させた状態を示すイメージ図である。It is an image figure which shows the state which selected the "grayscale image" in the "display image" selection column, and displayed the luminance image on the 2nd image display area. 空間コード設定欄でOFFを選択した例を示すイメージ図である。It is an image figure which shows the example which selected OFF in the space code setting column. 「表示画像」選択欄で「濃淡画像」を表示させた状態を示している。The “display image” selection field indicates a state in which “grayscale image” is displayed. プロジェクタ選択設定欄で設定可能な選択肢を示すイメージ図である。It is an image figure which shows the choice which can be set in a projector selection setting column. プロジェクタ選択設定欄で「1」を選択した例を示すイメージ図である。It is an image figure which shows the example which selected "1" in the projector selection setting column. プロジェクタ選択設定欄で「2」を選択した例を示すイメージ図である。It is an image figure which shows the example which selected "2" in the projector selection setting column. プロジェクタ選択設定欄で「1+2」を選択した例を示すイメージ図である。It is an image figure which shows the example which selected "1 + 2" in the projector selection setting column. 「表示画像」選択欄で設定可能な選択肢を示すイメージ図である。It is an image figure which shows the choice which can be set in the "display image" selection column. 「表示画像」選択欄で「縞投光−プロジェクタ1」を選択して、第二画像表示領域に第一プロジェクタのパターン投影画像を表示させた例を示すイメージ図である。It is an image figure which shows the example which selected the "stripe light projection-projector 1" in the "display image" selection column, and displayed the pattern projection image of the 1st projector on the 2nd image display area. 「表示画像」選択欄で「縞投光−プロジェクタ2」を選択して、第二画像表示領域に第二プロジェクタのパターン投影画像を表示させた例を示すイメージ図である。It is an image figure which shows the example which selected "stripe light projection-projector 2" in the "display image" selection column, and displayed the pattern projection image of the 2nd projector on the 2nd image display area. シャッタースピード設定欄を「1/15」に設定した三次元計測設定画面を示すイメージ図である。It is an image figure which shows the three-dimensional measurement setting screen which set the shutter speed setting column to "1/15". シャッタースピード設定欄を「1/30」に設定した三次元計測設定画面を示すイメージ図である。It is an image figure which shows the three-dimensional measurement setting screen which set the shutter speed setting column to "1/30". 濃淡レンジ設定欄を「普通(0)」に設定した三次元計測設定画面を示すイメージ図である。It is an image figure which shows the three-dimensional measurement setting screen which set the light / dark range setting column to "normal (0)". 濃淡レンジ設定欄を「高い(1)」に設定した三次元計測設定画面を示すイメージ図である。It is an image figure which shows the three-dimensional measurement setting screen which set the light / dark range setting column to "high (1)". 図9の状態から「高さ計測」処理ユニットを追加する様子を示すイメージImage showing how to add a “height measurement” processing unit from the state of FIG. 図44を経て「高さ計測」処理ユニットが追加された初期画面を示すイメージ図である。It is an image figure which shows the initial screen to which the "height measurement" processing unit was added through FIG. 高さ計測設定画面を示すイメージ図である。It is an image figure which shows a height measurement setting screen. 検査対象領域設定画面を示すイメージ図である。It is an image figure which shows an inspection object area | region setting screen. 図47の「計測領域」設定欄のドロップダウンメニューを表示させた状態を示すイメージ図である。It is an image figure which shows the state which displayed the drop-down menu of the "measurement area" setting column of FIG. 「計測領域」設定欄において「回転矩形」を選択した状態を示すイメージ図である。It is an image figure which shows the state which selected the "rotation rectangle" in the "measurement area" setting column. 計測領域編集画面を示すイメージ図である。It is an image figure which shows a measurement area edit screen. 計測領域編集画面の「計測領域」設定欄で「円周」を選択した状態を示すイメージ図である。It is an image figure which shows the state which selected "circle" in the "measurement area" setting column of the measurement area edit screen. 第二「高さ計測」処理ユニットを追加した初期画面を示すイメージ図である。It is an image figure which shows the initial screen which added the 2nd "height measurement" processing unit. 計測領域として「回転矩形」を設定した状態を示すイメージ図である。It is an image figure which shows the state which set "rotation rectangle" as a measurement area | region. 計測領域として「回転矩形」を設定する状態を示すイメージ図である。It is an image figure which shows the state which sets "rotation rectangle" as a measurement area | region. 計測領域として「回転矩形」が設定された状態を示すイメージ図である。It is an image figure which shows the state in which "rotation rectangle" was set as a measurement area | region. 「数値演算」処理ユニットを追加しようとする状態を示すイメージ図である。It is an image figure which shows the state which is going to add a "numerical calculation" processing unit. 「数値演算」処理ユニットが追加された初期画面を示すイメージ図である。It is an image figure which shows the initial screen to which the "numerical calculation" processing unit was added. 数値演算編集画面を表示させた状態を示すイメージ図である。It is an image figure which shows the state which displayed the numerical calculation edit screen. 図58の数値演算編集画面に演算式を入力した状態を示すイメージ図である。FIG. 59 is an image diagram showing a state in which an arithmetic expression is input to the numerical operation editing screen of FIG. 58. 「数値演算」処理ユニットが設定された初期画面を示すイメージ図である。It is an image figure which shows the initial screen in which the "numerical calculation" processing unit was set. 「エリア」処理ユニットを追加した初期画面を示すイメージ図である。It is an image figure which shows the initial screen which added the "area" processing unit. エリア設定画面を示すイメージ図である。It is an image figure which shows an area setting screen. 回転矩形の詳細を設定する領域設定画面を示すイメージ図である。It is an image figure which shows the area | region setting screen which sets the detail of a rotation rectangle. 回転矩形が設定された領域設定画面を示すイメージ図である。It is an image figure which shows the area | region setting screen in which the rotation rectangle was set. 高さ抽出選択画面を示すイメージ図である。It is an image figure which shows a height extraction selection screen. 一点指定画面のGUIを示すイメージ図である。It is an image figure which shows GUI of a one-point designation | designated screen. 一点指定画面のGUIを示すイメージ図である。It is an image figure which shows GUI of a one-point designation | designated screen. 一点指定画面のGUIを示すイメージ図である。It is an image figure which shows GUI of a one-point designation | designated screen. 図69Aは、入力画像のプロファイルを示すイメージ図、図69Bは図69Aの入力画像を階調変換した低階調距離画像のプロファイルを示すイメージ図である。69A is an image diagram showing a profile of an input image, and FIG. 69B is an image diagram showing a profile of a low gradation distance image obtained by gradation conversion of the input image of FIG. 69A. 図68の状態からゲインを増加させた状態を示すイメージ図である。FIG. 69 is an image diagram showing a state where gain is increased from the state of FIG. 68; 図70の状態からゲインを低下させた状態を示すイメージ図である。It is an image figure which shows the state which reduced the gain from the state of FIG. 図71で詳細設定を選択した状態を示すイメージ図である。FIG. 72 is an image diagram showing a state in which a detailed setting is selected in FIG. 71. 一点指定用の強調方法詳細設定画面のGUIを示すイメージ図である。It is an image figure which shows GUI of the emphasis method detailed setting screen for one point designation | designated. 図73の状態から「抽出高さ」設定欄のドロップダウンリストを表示させた状態を示すイメージ図である。It is an image figure which shows the state which displayed the drop-down list | wrist of the "extraction height" setting column from the state of FIG. 図75Aは、入力画像のプロファイルを示すイメージ図、図75Bは図75Aの入力画像を基準面を基準で示したイメージ図、図75Cは図75Bを階調変換した低階調距離画像のプロファイルを示すイメージ図である。75A is an image diagram showing a profile of an input image, FIG. 75B is an image diagram showing the input image of FIG. 75A on the basis of a reference plane, and FIG. 75C is an image diagram showing a profile of a low gradation distance image obtained by gradation conversion of FIG. It is. 図76Aは輝度画像、図76Bは高階調の距離画像、図76Cは図76Bを階調変換した低階調距離画像、図76Dは図76Cよりもゲインを上げた低階調距離画像、図76Eは図76Dよりもノイズ除去を上げた低階調距離画像、図76Fは図76Eで「抽出高さ」を高い側に設定した低階調距離画像を、それぞれ示すイメージ図である。76A is a luminance image, FIG. 76B is a high gradation distance image, FIG. 76C is a low gradation distance image obtained by gradation conversion of FIG. 76B, FIG. 76D is a low gradation distance image with a higher gain than FIG. 76C, and FIG. FIG. 76D is an image diagram showing a low gradation distance image in which noise removal is improved as compared with FIG. 76D, and FIG. 76F is an image diagram showing a low gradation distance image in which “extraction height” is set to a higher side in FIG. 76E. 図77Aは、入力画像のプロファイルを示すイメージ図、図77Bは図77Aの入力画像を「抽出高さ」を高い側に設定して階調変換した低階調距離画像のプロファイルを示すイメージ図である。77A is an image diagram showing a profile of an input image, and FIG. 77B is an image diagram showing a profile of a low gradation distance image obtained by gradation conversion of the input image of FIG. 77A with the “extraction height” set to a high side. 階調変換画像を表示させた状態を示すイメージ図である。It is an image figure which shows the state which displayed the gradation conversion image. 図79Aは一点指定で基準面を設定する方法が有効なワークの例を示す斜視図、図79Bは図79Aで撮像した距離画像を階調変換した低階調距離画像のイメージ図である。FIG. 79A is a perspective view showing an example of a work in which the method of setting a reference plane by specifying one point is effective, and FIG. 79B is an image diagram of a low gradation distance image obtained by gradation conversion of the distance image captured in FIG. 79A. 高さ抽出選択画面のGUIを示すイメージ図である。It is an image figure which shows GUI of a height extraction selection screen. 三点指定画面のGUIを示すイメージ図である。It is an image figure which shows GUI of a three-point designation | designated screen. 図81の状態から高さ抽出手段で一点目を指定する状態を示すイメージ図である。It is an image figure which shows the state which designates the 1st point with a height extraction means from the state of FIG. 図82の状態からさらに二点目を指定する状態を示すイメージ図である。It is an image figure which shows the state which designates the 2nd point further from the state of FIG. 図83の状態からさらに三点目を指定する状態を示すイメージ図である。It is an image figure which shows the state which designates the 3rd point further from the state of FIG. 三点指定用の詳細設定画面のGUIを示すイメージ図である。It is an image figure which shows GUI of the detailed setting screen for three-point designation | designated. 図86Aは三点指定で基準面を設定する方法が有効なワークの例を示す斜視図、図86Bは図86Aで撮像した距離画像を階調変換した低階調距離画像のイメージ図、図86Cは図86Bを二値化した画像のイメージ図、図86Dは図86Aのワークに傾きがある場合に一点指定で得られた二値化画像のイメージ図である。86A is a perspective view showing an example of a work in which the method of setting a reference plane by specifying three points is effective, FIG. 86B is an image diagram of a low gradation distance image obtained by gradation conversion of the distance image captured in FIG. 86A, and FIG. 86B is an image diagram of a binarized image, and FIG. 86D is an image diagram of a binarized image obtained by specifying one point when the work of FIG. 86A has an inclination. 図87Aは三点指定で基準面を設定する方法が有効な他のワークの例を示す斜視図、図87Bは図87Aで撮像した距離画像を階調変換した低階調距離画像のイメージ図、図87Cは図87Bを二値化した画像のイメージ図、図87Dは図87Aのワークに傾きがある場合に一点指定で得られた二値化画像のイメージ図である。87A is a perspective view showing an example of another work in which the method of setting a reference plane by specifying three points is effective. FIG. 87B is an image diagram of a low gradation distance image obtained by gradation conversion of the distance image captured in FIG. 87A. 87C is an image diagram of an image obtained by binarizing FIG. 87B, and FIG. 87D is an image diagram of a binarized image obtained by specifying one point when the work of FIG. 87A has an inclination. 高さ動的抽出設定画面のGUIを示すイメージ図である。It is an image figure which shows GUI of a height dynamic extraction setting screen. 「計算方法」選択欄のドロップダウンボックスを示すイメージ図である。It is an image figure which shows the drop-down box of the "calculation method" selection column. 平均高さ基準設定画面を示すイメージ図である。It is an image figure which shows an average height reference | standard setting screen. マスク領域設定画面を示すイメージ図である。It is an image figure which shows a mask area | region setting screen. 平面基準詳細設定画面を示すイメージ図である。It is an image figure which shows a plane reference | standard detailed setting screen. 図93Aは平均高さ基準で基準面を設定する方法が有効なワークの例を示す斜視図、図93Bは図93Aで撮像した距離画像を階調変換した低階調距離画像のイメージ図である。FIG. 93A is a perspective view showing an example of a work in which the method of setting the reference plane based on the average height is effective, and FIG. 93B is an image diagram of a low gradation distance image obtained by gradation conversion of the distance image captured in FIG. 93A. 平面基準詳細設定画面を示すイメージ図である。It is an image figure which shows a plane reference | standard detailed setting screen. 図94の画面で無効画素指定欄の詳細を示すイメージ図である。FIG. 95 is an image diagram showing details of an invalid pixel designation field on the screen of FIG. 94. 自由曲面基準設定画面を示すイメージ図である。It is an image figure which shows a free-form surface reference | standard setting screen. 図96で「抽出サイズ」指定欄の数値を大きくした状態を示すイメージ図である。FIG. 96 is a conceptual diagram showing a state where the numerical value in the “extraction size” designation field is increased in FIG. 図98Aは自由曲面基準で基準面を設定する方法が有効なワークの例を示す斜視図、図98Bは図98Aで撮像した距離画像を階調変換した低階調距離画像のイメージ図である。FIG. 98A is a perspective view showing an example of a work in which the method of setting a reference surface based on a free-form surface is effective, and FIG. 98B is an image diagram of a low gradation distance image obtained by gradation conversion of the distance image captured in FIG. 98A. 図90の状態から抽出領域設定ダイヤログを表示させた状態を示すイメージ図である。FIG. 91 is an image diagram showing a state where an extraction area setting dialog is displayed from the state of FIG. 90. 図99の抽出領域選択欄で「矩形」を選択した状態を示すイメージ図である。FIG. 99 is an image diagram showing a state where “rectangle” is selected in the extraction area selection field of FIG. 99. 図100の状態から抽出領域編集ダイヤログを表示させた状態を示すイメージ図である。It is an image figure which shows the state which displayed the extraction area edit dialog from the state of FIG. 図99のマスク領域選択欄で「円形」を選択した状態を示すイメージ図である。FIG. 99 is an image diagram showing a state where “circular” is selected in the mask area selection field of FIG. 99. 図102の状態からマスク領域編集ダイヤログを表示させた状態を示すイメージ図である。FIG. 110 is an image diagram showing a state in which a mask area editing dialog is displayed from the state of FIG. 102. 「エリア」処理ユニットで高さ抽出を設定した状態を示すイメージ図である。It is an image figure which shows the state which set height extraction by the "area" processing unit. フィルタ処理設定画面を示すイメージ図である。It is an image figure which shows a filter process setting screen. 二値化レベル設定画面を示すイメージ図である。It is an image figure which shows a binarization level setting screen. フィルタ処理設定した状態を示すイメージ図である。It is an image figure which shows the state which set the filter process. 判定条件設定画面を示すイメージ図である。It is an image figure which shows the determination condition setting screen. 判定条件が設定された状態を示すイメージ図である。It is an image figure which shows the state in which the determination conditions were set. 「ブロブ」処理ユニットを追加した初期画面を示すイメージ図である。It is an image figure which shows the initial screen which added the "blob" processing unit. 「ブロブ」処理ユニットにおいてフィルタ処理を設定する様子を示すイメージ図である。It is an image figure which shows a mode that a filter process is set in a "blob" processing unit. 「ブロブ」処理ユニットにおいて検出条件を設定する様子を示すイメージ図である。It is an image figure which shows a mode that a detection condition is set in a "blob" processing unit. 「ブロブ」処理ユニットにおいて判定条件を設定する様子を示すイメージ図である。It is an image figure which shows a mode that a determination condition is set in a "blob" processing unit. 初期画面に「色検査」処理ユニットを追加しようとする状態を示すイメージ図である。It is an image figure which shows the state which is going to add a "color inspection" processing unit to an initial screen. 「色検査」処理ユニットに円の領域を設定する様子を示すイメージ図である。It is an image figure which shows a mode that the area | region of a circle is set to a "color inspection" processing unit. 「色検査」処理ユニットに円の領域設定を行った状態を示すイメージ図である。It is an image figure which shows the state which performed the area | region setting of the circle to the "color inspection" processing unit. 「色検査」処理ユニットに濃度平均を設定した状態を示すイメージ図である。It is an image figure which shows the state which set the density | concentration average to the "color test | inspection" processing unit. 「色検査」処理ユニットを設定した初期画面を示すイメージ図である。It is an image figure which shows the initial screen which set the "color inspection" processing unit. 実施の形態3に係る三次元画像処理装置のヘッド部での運用時の処理の流れを示すフローチャートである。12 is a flowchart showing a flow of processing during operation of the head unit of the 3D image processing apparatus according to the third embodiment. 実施の形態4に係る三次元画像処理装置のヘッド部での運用時の処理の流れを示すフローチャートである。10 is a flowchart showing a flow of processing during operation of the head unit of the 3D image processing apparatus according to the fourth embodiment. 実施の形態1に係る階調変換方法を示すフローチャートである。4 is a flowchart illustrating a gradation conversion method according to the first embodiment. 実施の形態3に係る三次元画像処理装置のコントローラ部での運用時の処理の流れを示すフローチャートである。10 is a flowchart illustrating a processing flow during operation in the controller unit of the 3D image processing apparatus according to the third embodiment. 三次元画像処理プログラムの初期画面を示すイメージ図である。It is an image figure which shows the initial screen of a three-dimensional image processing program. 輝度画像上でサーチ対象領域を設定した状態を示すイメージ図である。It is an image figure which shows the state which set the search object area | region on the brightness | luminance image. 距離画像上で検査対象領域を複数設定した状態を示すイメージ図である。It is an image figure which shows the state which set the some test object area | region on the distance image. 図125の距離画像を拡大した状態を示すイメージ図である。It is an image figure which shows the state which expanded the distance image of FIG. 三次元画像処理プログラムで高さ計測を実行する状態を示すイメージ図である。It is an image figure which shows the state which performs height measurement with a three-dimensional image processing program. 位相シフト法と空間コード化法を組み合わせて距離画像を生成するためのデータフロー図である。FIG. 6 is a data flow diagram for generating a distance image by combining a phase shift method and a spatial encoding method. 空間コード化法を使用しないで位相シフト法のみで距離画像を生成するためのデータフロー図である。It is a data flow figure for producing | generating a distance image only by a phase shift method, without using a spatial encoding method. XY等ピッチ化をOFFしてZ画像を得る手順を示すデータフロー図である。It is a data flow figure which shows the procedure which turns off XY equal pitching and obtains a Z image. ポイントクラウドデータを出力する例を示す図である。It is a figure which shows the example which outputs point cloud data. 運用時における静的変換の手順を示すフローチャートである。It is a flowchart which shows the procedure of the static conversion at the time of operation. 運用時における動的変換の手順を示すフローチャートである。It is a flowchart which shows the procedure of the dynamic conversion at the time of operation. 検査対象のワークを示す斜視図である。It is a perspective view which shows the workpiece | work of a test object. 予め複数の階調変換パラメータセットを準備しておく方法を示す模式図である。It is a schematic diagram which shows the method of preparing a some gradation conversion parameter set previously. 図135の方法の手順を示すフローチャートである。FIG. 136 is a flowchart showing a procedure of the method of FIG. 135. FIG. 高さの変動が殆どないワークの例を示す斜視図である。It is a perspective view which shows the example of the workpiece | work with almost no fluctuation | variation of height. 図138Aは高さの変動を検知したいワークの例を示す斜視図、図138Bは図138Aで撮像した距離画像を階調変換した低階調距離画像のイメージ図である。FIG. 138A is a perspective view showing an example of a workpiece whose height variation is to be detected, and FIG. 138B is an image diagram of a low gradation distance image obtained by gradation conversion of the distance image captured in FIG. 138A. 動的変換(平均高さ基準)による基準面の指定が有効なワークの例を示す斜視図である。It is a perspective view which shows the example of the workpiece | work in which designation | designated of the reference plane by dynamic conversion (average height reference | standard) is effective. 動的変換(平面基準)による基準面の指定が有効なワークの例を示す斜視図である。It is a perspective view which shows the example of the workpiece | work in which designation | designated of the reference plane by dynamic conversion (plane reference | standard) is effective. 動的変換(自由曲面基準)による基準面の指定が有効なワークの例を示す斜視図である。It is a perspective view which shows the example of the workpiece | work in which designation | designated of the reference surface by dynamic conversion (free-form surface reference | standard) is effective. 適切な画像が得られるまで階調変換パラメータの調整を繰り返す手順を示すフローチャートである。It is a flowchart which shows the procedure which repeats adjustment of a gradation conversion parameter until a suitable image is obtained. 図142において画像が適切かどうかの判定を省略した手順を示すフローチャートである。It is a flowchart which shows the procedure which abbreviate | omitted determination of whether an image is appropriate in FIG. 階調変換パラメータ調整の具体的手順を示すフローチャートである。It is a flowchart which shows the specific procedure of gradation conversion parameter adjustment. 図145Aはワークの外観、図145Bは図145Aのワークから得られた距離画像のイメージ、図145Cは図145Bの距離画像に対し高さ検査処理のために検査対象領域を設定した状態を示すイメージ、図145Dは図145Bの距離画像に対し画像検査処理のために検査対象領域を設定した状態を示すイメージ、図145Eは図145Dの距離画像に対して階調変換を行った低階調距離画像のイメージを、それぞれ示す図である。FIG. 145A is an external view of the workpiece, FIG. 145B is an image of a distance image obtained from the workpiece of FIG. 145A, and FIG. 145D is an image showing a state in which an inspection target region is set for image inspection processing on the distance image of FIG. 145B, and FIG. 145E is a low gradation distance image obtained by performing gradation conversion on the distance image of FIG. 145D. FIG. 設定時の手順を示すフローチャートである。It is a flowchart which shows the procedure at the time of a setting. 図145Aのワークに対して「エリア」処理ユニットの設定を行う画面を示すイメージ図である。FIG. 145B is a conceptual diagram showing a screen for setting an “area” processing unit for the workpiece of FIG. 145A. 図147で高さ抽出の条件を設定する画面を示すイメージ図である。It is an image figure which shows the screen which sets the conditions of height extraction in FIG. 運転時の手順を示すフローチャートである。It is a flowchart which shows the procedure at the time of a driving | operation. 図149の検査処理で階調変換を行う場合の手順を示すフローチャートである。It is a flowchart which shows the procedure in the case of performing gradation conversion by the test | inspection process of FIG. 図149の検査処理で階調変換を行わない場合の手順を示すフローチャートである。It is a flowchart which shows the procedure in the case of not performing gradation conversion by the test | inspection process of FIG. 検査処理条件を設定する手順を示すフローチャートである。It is a flowchart which shows the procedure which sets an inspection process condition. 画像設定画面を示すイメージ図である。It is an image figure which shows an image setting screen. 輝度画像又は距離画像を選択可能な画像変数選択画面を呼び出した状態を示すイメージ図である。It is an image figure which shows the state which called the image variable selection screen which can select a brightness | luminance image or a distance image. 距離画像のみ選択可能な画像変数選択画面を呼び出した状態を示すイメージ図である。It is an image figure which shows the state which called the image variable selection screen which can select only a distance image. 画像を選択させた上で検査処理を選択して検査処理条件を設定する手順を示すフローチャートである。It is a flowchart which shows the procedure of selecting an inspection process and setting an inspection process condition after selecting an image. 輝度画像と距離画像を取得した状態を示す模式図である。It is a schematic diagram which shows the state which acquired the brightness | luminance image and the distance image. 図157で輝度画像を選択した場合に設定可能な検査処理ツールを示す模式図である。FIG. 157 is a schematic diagram showing an inspection processing tool that can be set when a luminance image is selected in FIG. 157; 図157で距離画像を選択した場合に設定可能な検査処理ツールを示す模式図である。FIG. 157 is a schematic diagram showing inspection processing tools that can be set when a distance image is selected in FIG. 157; 三角測距方式で距離画像を撮像する様子を示す模式図である。It is a schematic diagram which shows a mode that a distance image is imaged by a triangulation system. 自由曲面対象領域内に分布する高さ情報のフィッティングを行う手順を示すフローチャートである。It is a flowchart which shows the procedure which performs fitting of the height information distributed in a free-form surface object area | region. 縦方向に一様な形状の検査対象物の距離画像を示すイメージ図である。It is an image figure which shows the distance image of the test target object of a uniform shape in the vertical direction. 図162の距離画像からXY方向に抽出して階調変換した低階調距離画像を示すイメージ図である。FIG. 163 is an image diagram showing a low gradation distance image obtained by performing gradation conversion by extracting the distance image of FIG. 162 in the XY directions. 自由曲面基準設定画面の他の例を示すイメージ図である。It is an image figure which shows the other example of a free-form surface reference | standard setting screen. 図164の自由曲面基準設定画面の詳細設定画面を示すイメージ図である。FIG. 167 is an image diagram showing a detailed setting screen of the free-form surface reference setting screen of FIG. 164; 図162の距離画像からY方向に抽出して階調変換した低階調距離画像を示すイメージ図である。FIG. 163 is an image diagram showing a low gradation distance image obtained by extracting the gradation image from the distance image of FIG. 162 in the Y direction and converting the gradation. 縦方向に一様な形状の他の検査対象物の距離画像を示すイメージ図である。It is an image figure which shows the distance image of the other test target object of a uniform shape in the vertical direction. 図167の距離画像からXY方向に抽出して階調変換した低階調距離画像を示すイメージ図である。167 is an image diagram showing a low gradation distance image obtained by extracting the gradation image from the distance image in FIG. 167 in the XY direction and converting the gradation. 図167の距離画像からY方向に抽出して階調変換した低階調距離画像を示すイメージ図である。FIG. 167 is an image diagram showing a low gradation distance image obtained by performing gradation conversion by extracting the distance image of FIG. 167 in the Y direction.

以下、本発明の実施の形態を図面に基づいて説明する。ただし、以下に示す実施の形態は、本発明の技術思想を具体化するための三次元画像処理装置、三次元画像処理方法及び三次元画像処理プログラム並びにコンピュータで読み取り可能な記録媒体及び記録した機器を例示するものであって、本発明は三次元画像処理装置、三次元画像処理方法及び三次元画像処理プログラム並びにコンピュータで読み取り可能な記録媒体及び記録した機器を以下のものに特定しない。また、本明細書は特許請求の範囲に示される部材を、実施の形態の部材に特定するものでは決してない。特に実施の形態に記載されている構成部品の寸法、材質、形状、その相対的配置等は特に特定的な記載がない限りは、本発明の範囲をそれのみに限定する趣旨ではなく、単なる説明例にすぎない。なお、各図面が示す部材の大きさや位置関係等は、説明を明確にするため誇張していることがある。さらに以下の説明において、同一の名称、符号については同一もしくは同質の部材を示しており、詳細説明を適宜省略する。さらに、本発明を構成する各要素は、複数の要素を同一の部材で構成して一の部材で複数の要素を兼用する態様としてもよいし、逆に一の部材の機能を複数の部材で分担して実現することもできる。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. However, the embodiment described below is a three-dimensional image processing device, a three-dimensional image processing method, a three-dimensional image processing program, a computer-readable recording medium, and a recorded device for embodying the technical idea of the present invention. The present invention does not specify the following three-dimensional image processing apparatus, three-dimensional image processing method, three-dimensional image processing program, computer-readable recording medium, and recorded device. Further, the present specification by no means specifies the members shown in the claims to the members of the embodiments. In particular, the dimensions, materials, shapes, relative arrangements, and the like of the component parts described in the embodiments are not intended to limit the scope of the present invention unless otherwise specified, and are merely explanations. It's just an example. Note that the size, positional relationship, and the like of the members shown in each drawing may be exaggerated for clarity of explanation. Furthermore, in the following description, the same name and symbol indicate the same or the same members, and detailed description thereof will be omitted as appropriate. Furthermore, each element constituting the present invention may be configured such that a plurality of elements are constituted by the same member and the plurality of elements are shared by one member, and conversely, the function of one member is constituted by a plurality of members. It can also be realized by sharing.

また本明細書において「距離画像(高さ画像)」という場合には、高さ情報を含む画像の意味で使用し、例えば距離画像に光学的な輝度画像をテクスチャ情報として貼り付けた三次元の合成画像も、距離画像に含む意味で使用する。また、本明細書において距離画像の表示形態は二次元状に表示されるものに限られず、三次元状に表示されるものも含む。
(実施の形態1)
In this specification, the term “distance image (height image)” is used to mean an image including height information. For example, a three-dimensional image obtained by pasting an optical luminance image as texture information on a distance image. A composite image is also used in the sense of being included in a distance image. Further, in the present specification, the display form of the distance image is not limited to the one displayed in a two-dimensional form, but includes the one displayed in a three-dimensional form.
(Embodiment 1)

本発明の実施の形態1に係る三次元画像処理装置の構成を図1に示す。この三次元画像処理装置100は、ヘッド部1と、コントローラ部2とを備える。ヘッド部1は、検査対象物(ワーク)Wを照らす投光手段20と、ワークWの画像を撮像する撮像手段10と、コントローラ部2と接続するためのヘッド側通信手段36を備える。   FIG. 1 shows the configuration of the 3D image processing apparatus according to Embodiment 1 of the present invention. The three-dimensional image processing apparatus 100 includes a head unit 1 and a controller unit 2. The head unit 1 includes a light projecting unit 20 that illuminates an inspection target (work) W, an imaging unit 10 that captures an image of the workpiece W, and a head-side communication unit 36 that is connected to the controller unit 2.

一方コントローラ部2は、撮像された画像に基づいて、エッジ検出や面積計算等の計測処理を実行する。またコントローラ部2には、液晶パネル等の表示手段4、ユーザが表示手段4上で各種操作するためのコンソール等の入力手段3、PLC(Programmable Logic Controller)等を着脱自在に接続できる。   On the other hand, the controller unit 2 performs measurement processing such as edge detection and area calculation based on the captured image. The controller unit 2 can be detachably connected to a display unit 4 such as a liquid crystal panel, an input unit 3 such as a console for a user to perform various operations on the display unit 4, a PLC (Programmable Logic Controller), and the like.

以上の三次元画像処理装置100は、ヘッド部1の投光手段20でワークWに測定光を投光し、測定光がワークWに入射されて反射された反射光を、撮像手段10でパターン投影画像として撮像する。またパターン投影画像に基づいて距離画像を生成し、さらにこの距離画像を、各画素が有する高さ情報を輝度に置き換えた低階調距離画像に変換する。コントローラ部2は、変換された低階調距離画像に基づいて、エッジ検出や面積計算等の計測処理を実行する。   In the above three-dimensional image processing apparatus 100, the light projecting means 20 of the head unit 1 projects measurement light onto the work W, and the reflected light reflected by the measurement light incident on the work W is patterned by the image capturing means 10. Captured as a projected image. A distance image is generated based on the pattern projection image, and the distance image is converted into a low gradation distance image in which the height information of each pixel is replaced with luminance. The controller unit 2 executes measurement processing such as edge detection and area calculation based on the converted low gradation distance image.

なお検査対象物であるワークWは、例えばライン上を順次搬送される物品であり、移動又は静止している。また移動するワークは、コンベア等による平行移動の他、回転するものも含まれる。
(投光手段20)
In addition, the workpiece | work W which is a test subject is an article | item conveyed sequentially on a line, for example, and is moving or resting. Further, the moving workpiece includes a rotating workpiece as well as a parallel movement by a conveyor or the like.
(Light projection means 20)

投光手段20は、距離画像を生成するためにワークWを照らす照明として用いられる。したがって投光手段20は、距離画像を取得するための光切断法やパターン投影法に応じて、例えばワークに対してライン状のレーザ光を投光する光投影器、ワークに正弦波縞模様パターンを投影するためのパターン投影器等とすることができる。また投光手段以外に、明視野照明や暗視野照明を行うための一般的な照明装置を別途設けてもよい。あるいは投光手段20に、一般的な照明装置としての機能を持たせることも可能である。   The light projecting means 20 is used as illumination for illuminating the workpiece W in order to generate a distance image. Therefore, the light projecting means 20 is, for example, a light projector that projects a line-shaped laser beam onto the work, or a sinusoidal striped pattern on the work, according to the light cutting method or pattern projection method for obtaining the distance image. Can be used as a pattern projector or the like. In addition to the light projecting means, a general illumination device for performing bright field illumination or dark field illumination may be separately provided. Alternatively, the light projecting means 20 can have a function as a general lighting device.

コントローラ部2は、ヘッド部1から取得した距離画像データを用いて画像処理を実行し、外部接続されたPLC70等の制御機器に対し、ワークの良否等の判定結果を示す信号として判定信号を出力する。   The controller unit 2 executes image processing using the distance image data acquired from the head unit 1, and outputs a determination signal as a signal indicating a determination result of the quality of the workpiece to an externally connected control device such as the PLC 70. To do.

撮像手段10は、PLC70から入力される制御信号、例えば撮像手段10から画像データを取り込むタイミングを規定する撮像トリガ信号に基づいて、ワークの撮像を行う。   The imaging unit 10 performs imaging of a workpiece based on a control signal input from the PLC 70, for example, an imaging trigger signal that defines a timing for capturing image data from the imaging unit 10.

表示手段4は、ワークを撮像して得られた画像データや、その画像データを用いた計測処理の結果を表示するための表示装置である。一般に、ユーザは、表示手段4を視認することによって、コントローラ部2の動作状態を確認することができる。入力手段3は、表示手段4上でフォーカス位置を移動させたり、メニュー項目を選択したりするための入力装置である。なお、表示手段4にタッチパネルを使用する場合は、表示手段と入力手段を兼用できる。   The display means 4 is a display device for displaying image data obtained by imaging a workpiece and a result of measurement processing using the image data. In general, the user can confirm the operation state of the controller unit 2 by visually recognizing the display unit 4. The input means 3 is an input device for moving the focus position on the display means 4 and selecting menu items. In addition, when using a touch panel for the display means 4, a display means and an input means can be combined.

またコントローラ部2は、コントローラ部2の制御プログラムを生成するためのパーソナルコンピュータPCを接続することもできる。またパーソナルコンピュータPCには、三次元画像処理に関する設定を行う三次元画像処理プログラムをインストールして、コントローラ部2で行う処理の各種設定を行うこともできる。あるいは、このパーソナルコンピュータPC上で動作するソフトウェアによって、画像処理の処理順序を規定する処理順序プログラムを生成することができる。コントローラ部2では、その処理順序に沿って各画像処理が順次実行される。パーソナルコンピュータPCとコントローラ部2とは、通信ネットワークを介して接続されており、パーソナルコンピュータPC上で生成された処理順序プログラムは、例えば表示手段4の表示態様を規定するレイアウト情報等と共に、コントローラ部2に転送される。また逆に、コントローラ部2から処理順序プログラムやレイアウト情報等を取り込んで、パーソナルコンピュータPC上で編集することもできる。なお、この処理順序プログラムは、パーソナルコンピュータPCだけでなく、コントローラ部2においても生成できるようにしてもよい。
(変形例)
The controller unit 2 can also be connected to a personal computer PC for generating a control program for the controller unit 2. The personal computer PC can be installed with a three-dimensional image processing program for performing settings relating to three-dimensional image processing, and various settings for processing performed by the controller unit 2 can be performed. Alternatively, a processing order program that defines the processing order of image processing can be generated by software operating on the personal computer PC. In the controller unit 2, each image processing is sequentially executed in the processing order. The personal computer PC and the controller unit 2 are connected via a communication network, and the processing order program generated on the personal computer PC includes, for example, the layout information that defines the display mode of the display unit 4 and the controller unit. 2 is transferred. Conversely, a processing order program, layout information, and the like can be taken from the controller unit 2 and edited on the personal computer PC. The processing order program may be generated not only by the personal computer PC but also by the controller unit 2.
(Modification)

なお、以上の例ではコントローラ部2として専用のハードウェアを構築しているが、本発明はこの構成に限定されるものでない。例えば図2に示す変形例に係る三次元画像処理装置100’のように、汎用のパーソナルコンピュータやワークステーション等に専用の検査プログラムや三次元画像処理プログラムをインストールしたものをコントローラ部2’として機能させ、ヘッド部1に接続して利用することもできる。この三次元画像処理装置は、三次元画像処理プログラムで画像処理等、必要な設定を行った上で、ヘッド部1で撮像されたパターン投影画像に従って低階調距離画像を画像処理して、必要な検査を行う。
(ヘッド側通信手段36)
In the above example, dedicated hardware is constructed as the controller unit 2, but the present invention is not limited to this configuration. For example, as in the three-dimensional image processing apparatus 100 ′ according to the modification shown in FIG. 2, a special inspection program or a three-dimensional image processing program installed in a general-purpose personal computer or workstation functions as the controller unit 2 ′. It can also be connected to the head unit 1 for use. This three-dimensional image processing apparatus performs necessary settings such as image processing by a three-dimensional image processing program, and then performs image processing on a low gradation distance image according to a pattern projection image picked up by the head unit 1 and is necessary. Perform a proper inspection.
(Head side communication means 36)

また、これに応じてヘッド部1側に、ヘッド側通信手段36として、専用のコントローラ部2や、コントローラ部2として機能するパーソナルコンピュータのいずれにも接続できるようなインターフェースを設けることもできる。例えばヘッド部1に、ヘッド側通信手段36として、図1に示すようにコントローラ部2と接続するためのコントローラ接続用インターフェース36Aを設けたり、あるいは図2に示すように、パーソナルコンピュータと接続するためのPC接続用インターフェース36Bを設ける。またこのようなインターフェースをユニット式に交換可能とすることで、ヘッド部の他の構成をある程度共通化して、共通のヘッド部でコントローラ部やパーソナルコンピュータのいずれにも接続可能とできる。あるいは、専用のコントローラ部2と、コントローラ部2のいずれにも接続可能なインターフェースを備えた一のヘッド側通信手段を設けてもよい。またこのようなインターフェースは、既存の通信規格、例えばイーサーネット(商品名)やUSB、RS−232C等が利用できる。また、必ずしも規格化された、あるいは汎用の通信方式によらず、専用の通信方式としてもよい。
(PC接続モード)
Accordingly, an interface that can be connected to either the dedicated controller unit 2 or a personal computer that functions as the controller unit 2 can be provided on the head unit 1 side as the head-side communication means 36. For example, the head unit 1 is provided with a controller connection interface 36A for connection with the controller unit 2 as shown in FIG. 1 as the head side communication means 36, or for connection with a personal computer as shown in FIG. The PC connection interface 36B is provided. Further, by making such an interface interchangeable as a unit, other configurations of the head unit can be shared to some extent, and the common head unit can be connected to either the controller unit or the personal computer. Or you may provide the one side communication means provided with the interface which can be connected to any of the controller part 2 and the controller part 2 for exclusive use. Such an interface can use an existing communication standard such as Ethernet (trade name), USB, RS-232C, or the like. In addition, a dedicated communication method may be used instead of a standardized or general-purpose communication method.
(PC connection mode)

さらに三次元画像処理プログラムに、ヘッド部1に接続するコントローラ部2’としてパーソナルコンピュータを使用する場合の設定を行うPC接続モードを備えることもできる。すなわちコントローラ部が専用ハードウェアであるか、パーソナルコンピュータであるかに応じて、設定可能な項目や設定内容を変化させることで、いずれの場合にも三次元画像処理に関する設定を適切に行うことが可能となる。さらに、コントローラ部2’として機能するパーソナルコンピュータに、ヘッド部1の動作確認用途、及び簡易的な計測機能を持たせたビューワプログラムをインストールして、接続されたヘッド部の動作や機能を確認できるようにしてもよい。   Further, the three-dimensional image processing program can be provided with a PC connection mode for setting when a personal computer is used as the controller unit 2 ′ connected to the head unit 1. In other words, settings related to three-dimensional image processing can be appropriately performed in either case by changing settable items and setting contents depending on whether the controller unit is dedicated hardware or a personal computer. It becomes possible. In addition, it is possible to check the operation and function of the connected head unit by installing a viewer program having a purpose of confirming the operation of the head unit 1 and a simple measurement function in a personal computer functioning as the controller unit 2 ′. You may do it.

なお図1に示す撮像手段10と投光手段20を利用することで得られる「距離画像」とは、ワークWを撮像する撮像手段10から、ワークWまでの距離に応じて各画素の濃淡値が変化する画像をいう。換言すれば、撮像手段10からワークWまでの距離に基づいて濃淡値が決定される画像ともいえるし、ワークWまでの距離に応じた濃淡値を有する多値画像ともいえるし、或いはワークWの高さに応じた濃淡値を有する多値画像ともいえる。さらに、輝度画像の画素ごとに、撮像手段10からの距離を濃淡値に変換した多値画像ともいえる。   The “distance image” obtained by using the imaging unit 10 and the light projecting unit 20 shown in FIG. 1 is a gray value of each pixel according to the distance from the imaging unit 10 that images the workpiece W to the workpiece W. An image that changes. In other words, it can be said that the gray value is determined based on the distance from the imaging means 10 to the workpiece W, can be said to be a multi-valued image having a gray value corresponding to the distance to the workpiece W, or It can also be said to be a multi-valued image having a gray value corresponding to the height. Furthermore, it can be said that it is a multi-value image obtained by converting the distance from the imaging means 10 into a gray value for each pixel of the luminance image.

距離画像を生成する手法としては、大きく分けて2つの方式があり、一つは、通常の画像を得るための照明条件で撮像した画像を用いて距離画像を生成するパッシブ方式(受動計測方式)、もう一つは、高さ方向の計測をするための光を能動的に照射して距離画像を生成するアクティブ方式(能動計測方式)である。パッシブ方式の代表的な手法は、ステレオ計測法である。これは、撮像手段10を2台用意し、これら2台のカメラを所定の位置関係で配置するだけで距離画像を生成できることから、輝度画像を生成するための一般的な画像処理システムを利用して距離画像を生成でき、システム構築コストを抑制することができる。しかし、ステレオ計測法では、一方のカメラによって得られる画像中の一点が、他方のカメラによって得られる画像中のどの点に対応しているのかを決定しなければならず、いわゆる対応点の決定処理に時間が掛かるという問題がある。また、計測位置は対応点のみであり、全画素ではないことから、この点においても外観検査の高速化には向かない。   There are roughly two methods for generating distance images. One is a passive method (passive measurement method) that generates a distance image using an image captured under illumination conditions to obtain a normal image. The other is an active method (active measurement method) in which a distance image is generated by actively irradiating light for measurement in the height direction. A typical passive method is a stereo measurement method. This is because a distance image can be generated simply by preparing two imaging means 10 and arranging these two cameras in a predetermined positional relationship. Therefore, a general image processing system for generating a luminance image is used. Distance images can be generated, and system construction costs can be reduced. However, in the stereo measurement method, it is necessary to determine which point in the image obtained by one camera corresponds to the point in the image obtained by the other camera. There is a problem that it takes time. Further, since the measurement position is only the corresponding point and not all the pixels, this point is also not suitable for speeding up the appearance inspection.

一方で、アクティブ方式の代表的な手法は、光切断法とパターン投影法である。光切断法とは、表面の形状や粗さ等を光学的に測定する方法であり、検査対象物の面に対し、約45°の角度で細いスリット像を投影し、その像を正反射方向から観察する方法や、細いスリット状の光線束で検査対象物を切断するように照射し、表面に生じる切断線の形状を側方から観測する方法が知られている。また、光切断法では一ライン分のプロファイル(切断面)のみが得られるが、光切断を行う位置を連続的に変化させて、各位置で得られたプロファイルを合成することで、距離画像を構成することもできる。   On the other hand, typical methods of the active method are a light cutting method and a pattern projection method. The light cutting method is a method of optically measuring the shape and roughness of the surface, and projects a thin slit image at an angle of about 45 ° to the surface of the inspection object, and the image is reflected in the specular direction. There are known a method of observing from the side, and a method of irradiating the inspection object with a thin slit-shaped beam to observe the shape of the cutting line generated on the surface from the side. In addition, the optical cutting method can only obtain a profile (cut surface) for one line, but by continuously changing the optical cutting position and synthesizing the profiles obtained at each position, a distance image can be obtained. It can also be configured.

ここでの光切断法は、上述したステレオ計測法において、一方のカメラを光投影器に置き換えて、ワークに対してライン状のレーザ光を投光し、物体表面の形状に応じたライン光の像の歪み具合からワークの三次元形状を復元する。光切断法は、対応点の決定が不要であるので安定した計測が可能である。しかし、1回の計測で1ライン分しか計測できないため、全画素の計測値を得ようとすると、対象物又はカメラを走査しなければならない。これに対し、パターン投影法は、ワークに投影された所定パターンの形状や位相等をずらして複数枚の画像を撮像し、撮像した複数枚の画像を解析することでワークの三次元形状を復元するものである。パターン投影法には幾つか種類があり、正弦波縞模様パターンの位相をずらして複数枚(最低3枚以上)の画像を撮像し、複数枚の画像から画素ごとに正弦波の位相を求め、求めた位相を利用してワーク表面上の三次元座標を求める位相シフト法や、2つの規則的なパターンが合成されるときに生じる一種の空間周波数のうねり現象を利用して三次元形状を復元するモアレポトグラフィ法、ワークに投影するパターン自体を撮影毎に異ならせ、例えば白黒デューティ比50%で縞幅が画面半分、4分の1、8分の1、、、と細くなっていく縞パターンを順次投影し、それぞれのパターンにてパターン投影画像の撮影を行い、ワークの高さの絶対位相を求める空間コード化法、ワークに複数の細線状のパターン照明(マルチスリット)を投影し、スリット周期より狭いピッチでパターンを移動させ、複数回撮影を行うマルチスリット法等が代表的である。   Here, the light cutting method is the above-described stereo measurement method, in which one camera is replaced with an optical projector, a line-shaped laser beam is projected onto the workpiece, and the line light according to the shape of the object surface is projected. The three-dimensional shape of the workpiece is restored from the image distortion. Since the light cutting method does not require determination of corresponding points, stable measurement is possible. However, since only one line can be measured in one measurement, the object or camera must be scanned to obtain the measurement values of all pixels. On the other hand, the pattern projection method captures multiple images by shifting the shape and phase of the predetermined pattern projected on the workpiece, and restores the three-dimensional shape of the workpiece by analyzing the captured images. To do. There are several types of pattern projection methods, taking multiple images (at least 3 images) by shifting the phase of the sinusoidal fringe pattern, obtaining the phase of the sine wave for each pixel from the multiple images, Using the obtained phase to restore the 3D shape using the phase shift method to obtain 3D coordinates on the workpiece surface and the kind of spatial frequency undulation that occurs when two regular patterns are combined The moire topography method, the pattern projected onto the work itself is different for each shooting, for example, the stripe width becomes half-screen, 1/4, 1/8, etc., with a black and white duty ratio of 50%. A pattern is projected in sequence, a pattern projection image is taken with each pattern, and a spatial coding method to obtain the absolute phase of the workpiece height, and multiple thin line pattern illumination (multi slit) is projected onto the workpiece. Moving the pattern with a narrow pitch than the slit cycle, multi-slit method of performing a plurality of times imaging is typical.

本実施形態に係る三次元画像処理装置100では、上述した位相シフト法と空間コード化法を組み合わせて距離画像を生成する。これにより、ワーク又はヘッドを相対的に動かすことなく、距離画像を生成することができる。本発明は、位相シフト法及び空間コード化法によって距離画像を生成することに限られず、他の方法によって距離画像を生成しても構わない。また、上述した方法以外の方法、例えば光レーダ法(タイムオブフライト)、合焦点法、共焦点法、白色光干渉法等、距離画像を生成するために考え得る如何なる手法を採用しても構わない。   In the three-dimensional image processing apparatus 100 according to the present embodiment, a distance image is generated by combining the phase shift method and the spatial coding method described above. Thereby, a distance image can be generated without relatively moving the work or the head. The present invention is not limited to generating a distance image by a phase shift method and a spatial encoding method, and a distance image may be generated by another method. Further, any method other than the above-described method, such as an optical radar method (time of flight), a focusing method, a confocal method, a white light interferometry method, and the like that can be considered may be adopted. Absent.

なお図1に示す撮像手段10と投光手段20の配置レイアウトは、ワークWに対して斜め方向から投光し、ワークWからの反射光をほぼ垂直な方向で受光できるよう、投光手段20を斜めに、撮像手段10を鉛直姿勢に保持するように配置している。このように投光方向と撮像方向とを一致させず、傾斜させることで、ワークWの表面形状の凹凸に起因する陰影を捉えたパターン投影画像を撮像できる。
(実施の形態2)
The arrangement layout of the imaging unit 10 and the light projecting unit 20 shown in FIG. 1 projects light from an oblique direction with respect to the workpiece W, and receives the reflected light from the workpiece W in a substantially vertical direction. Are arranged so as to hold the image pickup means 10 in a vertical posture. In this way, by projecting the light projecting direction and the image capturing direction without making them coincide with each other, it is possible to capture a pattern projection image that captures the shadow caused by the unevenness of the surface shape of the workpiece W.
(Embodiment 2)

ただ本発明は、この配置例に限定されるものでなく、例えば図3に示す実施の形態2に係る三次元画像処理装置200のように、撮像手段10側をワークWに対して傾斜姿勢に、投光手段20側を鉛直姿勢に保持する配置例としてもよい。このような配置のヘッド部1Bによっても、同様に投光方向と撮像方向とを傾斜させて、ワークWの陰影を捉えたパターン投影画像を撮像できる。
(実施の形態3)
However, the present invention is not limited to this arrangement example. For example, as in the 3D image processing apparatus 200 according to Embodiment 2 shown in FIG. The arrangement may be such that the light projecting means 20 side is held in a vertical posture. The head unit 1B having such an arrangement can similarly capture the pattern projection image capturing the shadow of the workpiece W by inclining the light projection direction and the imaging direction.
(Embodiment 3)

さらに、投光手段や撮像手段の一方又は両方を複数配置することもできる。例えば、実施の形態3として図4Aに示す三次元画像処理装置300のように、撮像手段10をワークWに対して鉛直姿勢に保持する一方、撮像手段10を中心に2つの投光手段20を両側に配置して、左右からそれぞれ投光するヘッド部1Cとして構成することもできる。このように投光の方向が異なるパターン投影画像をそれぞれ撮像することで、一方向からの投光ではワークW自体で陰影パターンが隠れてしまう等、パターン投影画像を部分的に撮像できない状態が生じて高さ計測が不正確又は不可能となる事態を低減できる。特に、ワークに対して相対する方向(例えば左右や前後)から投光するように投光手段20を配置すれば、ワーク自体で遮られて撮像できない可能性を大幅に低減できる。
(実施の形態4)
Furthermore, a plurality of one or both of the light projecting means and the imaging means can be arranged. For example, like the three-dimensional image processing apparatus 300 shown in FIG. 4A as the third embodiment, the imaging unit 10 is held in a vertical posture with respect to the workpiece W, while the two light projecting units 20 are arranged around the imaging unit 10. It can also be configured as a head portion 1C that is arranged on both sides and projects light from the left and right respectively. In this way, by capturing each pattern projection image with a different direction of light projection, a pattern projection image cannot be partially captured, for example, a shadow pattern is hidden by the work W itself when light is projected from one direction. Therefore, the situation where height measurement is inaccurate or impossible can be reduced. In particular, if the light projecting means 20 is arranged so as to project light from a direction opposite to the work (for example, left and right or front and rear), the possibility that the image cannot be captured due to being blocked by the work itself can be greatly reduced.
(Embodiment 4)

また、以上の例では撮像手段を一台、投光手段を二台とする構成について説明したが、逆に撮像手段を二台、投光手段を一台とする構成とすることもできる。このような例を実施の形態4に係る三次元画像処理装置400として図4Bに示す。この例に示すヘッド部1Dでは、投光手段20をワークWに対して鉛直姿勢に保持し、図においてその左右に撮像手段10をそれぞれ、ワークWに対して傾斜姿勢に配置させている。この構成でも、ワークWを異なる傾斜角度から撮像できるので、実施の形態3と同様にパターン投影画像が部分的に撮像困難となる事態を抑制できる。またこの方法であれば、一回の投光で2枚のパターン投影画像を同時に撮像できるため、処理時間を短縮化できる利点も得られる。   In the above example, a configuration in which one imaging unit is provided and two light projecting units are described, but conversely, a configuration in which two imaging units are provided and one light projecting unit is also possible. Such an example is shown in FIG. 4B as a three-dimensional image processing apparatus 400 according to Embodiment 4. In the head unit 1D shown in this example, the light projecting unit 20 is held in a vertical posture with respect to the workpiece W, and the imaging units 10 are arranged in an inclined posture with respect to the workpiece W on the left and right sides in the drawing. Even with this configuration, since the workpiece W can be imaged from different inclination angles, it is possible to suppress a situation in which it is difficult to partially capture the pattern projection image as in the third embodiment. Also, with this method, since two pattern projection images can be taken simultaneously with a single light projection, there is an advantage that the processing time can be shortened.

その反面、2つの撮像手段で異なる角度から同じワークを撮像しても、撮像している部位や視野等が異なるため、各画素の位置を一致させる作業が必要となり、誤差も発生する可能性がある。これに対し、上述した実施の形態3によれば、撮像手段を共通化したことで、いずれの投光手段から測定光を投光しても、同一の視野の画像を撮像できるため、このような統合作業を不要とでき、また統合作業に伴う誤差の発生も回避して、処理を簡素化できる利点が得られる。   On the other hand, even if the same work is imaged from two different angles with the two imaging means, the part being picked up and the field of view are different, so the work of matching the positions of each pixel is necessary, and errors may also occur. is there. On the other hand, according to the above-described third embodiment, since the image pickup unit is used in common, an image with the same field of view can be picked up even if measurement light is projected from any of the light projection units. Therefore, an advantage of simplifying the processing can be obtained by eliminating the need for a simple integration operation and avoiding the occurrence of errors associated with the integration operation.

なお以上の例では、各ヘッド部において撮像手段10と投光手段20とを一体的に構成した例を説明したが、本発明はこの構成に限られない。例えば、撮像手段10と投光手段20とを別個の部材で構成したヘッド部とすること可能である。また、撮像手段や投光手段を3以上設けることも可能である。
(ブロック図)
In the above example, the example in which the imaging unit 10 and the light projecting unit 20 are integrally configured in each head unit has been described. However, the present invention is not limited to this configuration. For example, the imaging unit 10 and the light projecting unit 20 can be a head unit configured by separate members. It is also possible to provide three or more imaging means and light projecting means.
(Block Diagram)

次に、本発明の実施の形態3に係る三次元画像処理装置300の構成を示すブロック図を図5に示す。三次元画像処理装置300は、図5に示すように、ヘッド部1と、コントローラ部2とを備える。
(ヘッド部1)
Next, FIG. 5 shows a block diagram showing a configuration of a 3D image processing apparatus 300 according to Embodiment 3 of the present invention. As illustrated in FIG. 5, the three-dimensional image processing apparatus 300 includes a head unit 1 and a controller unit 2.
(Head 1)

このヘッド部1は、投光手段20と、撮像手段10と、ヘッド側制御部30と、ヘッド側演算部31と、記憶手段38と、ヘッド側通信手段36等を備えている。投光手段20は、測定光源21、パターン生成部22及び複数のレンズ23、24、25を含む。撮像手段10は、図示しないがカメラ及び複数のレンズを含む。
(投光手段20)
The head unit 1 includes a light projecting unit 20, an imaging unit 10, a head side control unit 30, a head side calculation unit 31, a storage unit 38, a head side communication unit 36, and the like. The light projecting unit 20 includes a measurement light source 21, a pattern generation unit 22, and a plurality of lenses 23, 24, and 25. Although not shown, the imaging means 10 includes a camera and a plurality of lenses.
(Light projection means 20)

投光手段20は、撮像手段の光軸に対して斜め方向から入射光を所定の投影パターンの構造化照明として投光するための部材である。この投光手段20には、プロジェクタが利用でき、光学部材であるレンズやパターン生成部22等が含まれる。投光手段20は、静止若しくは移動するワークの位置の斜め上方に配置される。なおヘッド部1は、複数の投光手段20を含むこともできる。図5の例においては、ヘッド部1は2つの投光手段20を含む。ここでは、第一の方向からワークに対して測定用照明光を照射可能な第一プロジェクタ20A(図5において右側)と、第一の方向とは異なる第二の方向からワークに対して測定用照明光を照射可能な第二プロジェクタ20B(図5において左側)を、それぞれ配置している。第一プロジェクタ20A、第二プロジェクタ20Bは撮像手段10の光軸を挟んで対称に配置される。第一プロジェクタ20A、第二プロジェクタ20Bからワークに対し、交互に測定光を投光して、それぞれの反射光のパターンを撮像手段10で撮像する。   The light projecting unit 20 is a member for projecting incident light as structured illumination with a predetermined projection pattern from an oblique direction with respect to the optical axis of the imaging unit. The light projecting means 20 can be a projector and includes a lens that is an optical member, a pattern generation unit 22, and the like. The light projecting means 20 is disposed obliquely above the position of the stationary or moving workpiece. The head unit 1 can also include a plurality of light projecting means 20. In the example of FIG. 5, the head unit 1 includes two light projecting means 20. Here, the first projector 20A (right side in FIG. 5) that can irradiate the workpiece with measurement illumination light from the first direction, and the workpiece from the second direction different from the first direction. Second projectors 20B (left side in FIG. 5) capable of irradiating illumination light are respectively arranged. The first projector 20A and the second projector 20B are arranged symmetrically across the optical axis of the imaging means 10. Measurement light is alternately projected onto the workpiece from the first projector 20A and the second projector 20B, and the pattern of each reflected light is imaged by the imaging means 10.

各第一プロジェクタ20A、第二プロジェクタ20Bの測定光源21は、例えば白色光を出射するハロゲンランプや白色光を出射する白色LED(発光ダイオード)等が利用できる。測定光源21から出射された測定光は、レンズにより適切に集光された後、パターン生成部22に入射する。   As the measurement light source 21 of each of the first projector 20A and the second projector 20B, for example, a halogen lamp that emits white light, a white LED (light emitting diode) that emits white light, or the like can be used. The measurement light emitted from the measurement light source 21 is appropriately condensed by the lens and then enters the pattern generation unit 22.

さらに、距離画像を生成するためのパターン投影画像を取得する測定光を出射するための投光手段に加え、通常の光学画像(輝度画像)を撮像するための観察用照明光源を設けることもできる。観察用照明光源には、LEDの他、半導体レーザ(LD)やハロゲンライト、HID等を利用できる。特に撮像素子としてカラーで撮像可能な素子を用いた場合は、観察用照明光源に白色光源を利用できる。   Furthermore, in addition to the light projecting means for emitting the measurement light for obtaining the pattern projection image for generating the distance image, an observation illumination light source for capturing a normal optical image (luminance image) can be provided. . As the illumination light source for observation, a semiconductor laser (LD), a halogen light, HID, or the like can be used in addition to the LED. In particular, when an element capable of imaging in color is used as the imaging element, a white light source can be used as the observation illumination light source.

測定光源21から出射された測定光は、レンズ113により適切に集光された後、パターン生成部112に入射する。パターン生成部22は、任意のパターンの照明を実現できる。例えば、白字に黒字、黒字に白字等、ワークや背景の色に応じてパターンを反転させ、見易い、あるいは測定し易い適切なパターンを表現できる。このようなパターン生成部22は、例えばDMD(デジタルマイクロミラーデバイス)が利用できる。DMDは、画素毎に微小なミラーをON/OFFさせて任意のパターンを表現できる。これにより、白と黒を反転させたパターンを容易に照射できる。パターン生成部22にDMDを用いることで、任意のパターンを容易に生成でき、機械的なパターンマスクの準備やその入れ替え作業を不要とできるので、装置の小型化と迅速な計測ができる利点がある。また、DMDを用いたパターン生成部112は、すべての画素をONとする全照明パターンの照射によって、通常の照明と同様に利用できるので、輝度画像の撮像にも利用できる。またパターン生成部22は、LCD(液晶ディスプレイ)、LCOS(Liquid Crystal on Silicon:反射型液晶素子)又はマスクとすることもできる。パターン生成部22に入射した測定光は、予め設定されたパターン及び予め設定された強度(明るさ)に変換されて出射される。パターン生成部22により出射された測定光は、複数のレンズにより撮像手段10の観察・測定可能な視野よりも大きい径を有する光に変換された後、ワークに照射される。
(撮像手段10)
The measurement light emitted from the measurement light source 21 is appropriately condensed by the lens 113 and then enters the pattern generation unit 112. The pattern generation part 22 can implement | achieve illumination of arbitrary patterns. For example, an appropriate pattern that is easy to see or measure can be expressed by inverting the pattern according to the color of the work or the background, such as black in white and white in black. For example, a DMD (digital micromirror device) can be used as the pattern generation unit 22. The DMD can express an arbitrary pattern by turning on and off a minute mirror for each pixel. Thereby, the pattern which reversed black and white can be irradiated easily. By using DMD for the pattern generation unit 22, an arbitrary pattern can be easily generated, and mechanical pattern mask preparation and replacement work can be eliminated. . Further, the pattern generation unit 112 using DMD can be used in the same manner as normal illumination by irradiating all illumination patterns in which all pixels are turned on, and can also be used for capturing a luminance image. The pattern generation unit 22 may be an LCD (Liquid Crystal Display), LCOS (Liquid Crystal on Silicon), or a mask. The measurement light incident on the pattern generation unit 22 is converted into a preset pattern and a preset intensity (brightness) and emitted. The measurement light emitted from the pattern generation unit 22 is converted into light having a diameter larger than the visual field that can be observed and measured by the imaging unit 10 by a plurality of lenses, and then irradiated onto the workpiece.
(Imaging means 10)

撮像手段10は、投光手段20で投光され、ワークWKで反射された反射光を取得して複数のパターン投影画像を撮像するためのカメラを備える。このようなカメラには、CCDやCMOS等が利用できる。この例では高解像度の得られるモノクロCCDカメラを利用している。なお、カラーで撮像可能なカメラを使用することも可能であることはいうまでも無い。また撮像手段は、パターン投影画像以外に、通常の輝度画像を撮像することも可能である。   The imaging means 10 includes a camera for acquiring reflected light that is projected by the light projecting means 20 and reflected by the work WK and that captures a plurality of pattern projection images. A CCD, CMOS, or the like can be used for such a camera. In this example, a monochrome CCD camera capable of obtaining a high resolution is used. Needless to say, it is also possible to use a camera capable of imaging in color. In addition to the pattern projection image, the imaging unit can also capture a normal luminance image.

ヘッド側制御部30は、撮像手段10及び投光手段20である第一プロジェクタ20A、第二プロジェクタ20Bを制御するための部材である。例えば、投光手段20がワークに対して測定光を投光してパターン投影画像を得るための投光パターンの作成を、ヘッド部側制御部30で行う。これによって撮像手段10で、投光手段20から位相シフト用の投影パターンを投影させて位相シフト画像を撮像させ、また投光手段20から空間コード化用の投影パターンを投影させて空間コード画像を撮像させる。このようにヘッド側制御部30は、撮像手段10で位相シフト画像と空間コード画像を撮像するよう、投光手段を制御するための投光制御手段として機能する。   The head-side control unit 30 is a member for controlling the first projector 20A and the second projector 20B that are the imaging unit 10 and the light projecting unit 20. For example, the head unit side control unit 30 creates a projection pattern for the projection unit 20 to project the measurement light onto the workpiece and obtain a pattern projection image. As a result, the imaging means 10 causes the light projection means 20 to project a phase shift projection pattern to image a phase shift image, and the light projection means 20 projects a spatial coding projection pattern to produce a spatial code image. Let's take an image. As described above, the head-side control unit 30 functions as a light projection control unit for controlling the light projection unit so that the imaging unit 10 captures the phase shift image and the spatial code image.

ヘッド側演算部31は、フィルタ処理部34と距離画像生成手段32を含む。距離画像生成手段32は、撮像手段10で撮像された複数のパターン投影画像に基づいて、距離画像を生成する。   The head side calculation unit 31 includes a filter processing unit 34 and a distance image generation unit 32. The distance image generation unit 32 generates a distance image based on the plurality of pattern projection images captured by the imaging unit 10.

ヘッド側記憶手段38は、各種設定や画像等を保持するための部材であり、半導体メモリやハードディスク等の記憶素子が利用できる。例えば、撮像手段10で撮像されたパターン投影画像を保持するための輝度画像記憶部38b、及び距離画像生成手段32で生成された距離画像を保持するための距離画像記憶部38aを含む。   The head-side storage unit 38 is a member for holding various settings, images, and the like, and a storage element such as a semiconductor memory or a hard disk can be used. For example, a luminance image storage unit 38b for holding the pattern projection image captured by the imaging unit 10 and a distance image storage unit 38a for holding the distance image generated by the distance image generation unit 32 are included.

ヘッド側通信手段36は、コントローラ部2と通信を行うための部材である。ここではコントローラ部2のコントローラ側通信手段42と接続されて、データ通信を行う。例えば、距離画像生成手段32で生成された距離画像を、コントローラ部2に対して送出する。
(距離画像生成手段32)
The head side communication means 36 is a member for communicating with the controller unit 2. Here, the controller side communication means 42 of the controller unit 2 is connected to perform data communication. For example, the distance image generated by the distance image generation unit 32 is sent to the controller unit 2.
(Distance image generating means 32)

距離画像生成手段32は、ワークWKを撮像する撮像手段10からワークWKまでの距離に応じて各画素の濃淡値が変化する距離画像を生成する手段である。例えば、位相シフト法で距離画像を生成する場合は、ワークに対して正弦波縞模様パターンを位相ずらして投影するように、ヘッド側制御部30が投光手段20を制御し、それに応じて正弦波縞模様パターンの位相がずれた画像を複数枚撮像するように、ヘッド側制御部30が撮像手段10を制御する。そしてヘッド側制御部30は、複数枚の画像から画素毎に正弦波の位相を求め、求めた位相を利用して距離画像を生成する。   The distance image generation unit 32 is a unit that generates a distance image in which the gray value of each pixel changes according to the distance from the imaging unit 10 that captures the workpiece WK to the workpiece WK. For example, when a distance image is generated by the phase shift method, the head-side control unit 30 controls the light projecting unit 20 so as to project a sinusoidal fringe pattern on the workpiece with a phase shift, and the sine is accordingly generated. The head-side control unit 30 controls the imaging unit 10 so as to capture a plurality of images in which the phase of the wavy pattern is shifted. The head-side control unit 30 obtains a sine wave phase for each pixel from a plurality of images, and generates a distance image using the obtained phase.

また空間コード化法を用いて距離画像を生成する場合は、光が照射される空間を、多数の断面略扇状の小空間に分け、この小空間には一連の空間コード番号を付す。このため、ワークの高さが高くても、言い換えると高低差が大きくても、光が照射される空間内にあれば、空間コード番号から高さが演算できる。したがって、高さの高いワークについても全体にわたって形状を計測できる。   When a distance image is generated by using the space encoding method, the space irradiated with light is divided into a number of small spaces having a substantially fan-shaped cross section, and a series of space code numbers are assigned to the small spaces. For this reason, even if the height of the workpiece is high, in other words, even if the height difference is large, the height can be calculated from the space code number as long as it is within the space irradiated with light. Therefore, it is possible to measure the shape of a workpiece having a high height throughout.

このようにしてヘッド部側で距離画像を生成し、コントローラ部側に送出することで、ヘッド部からコントローラ部側に送出すべきデータ量を低減でき、大量のデータ転送によって生じ得る処理の遅れを回避できる。   By generating a distance image on the head unit side and sending it to the controller side in this way, the amount of data to be sent from the head unit to the controller unit side can be reduced, and processing delays that can occur due to a large amount of data transfer can be reduced. Can be avoided.

なお、本実施形態ではヘッド部1側で距離画像の生成処理を行うようにしているが、例えばコントローラ部2側で距離画像の生成処理を担うこともできる。また、距離画像から低階調距離画像への階調変換は、コントローラ部で行う他、ヘッド部側で行わせることもできる。この場合は、ヘッド側演算部31が階調変換手段の機能を実現する。
(コントローラ部2)
In the present embodiment, the distance image generation process is performed on the head unit 1 side. However, for example, the distance image generation process can be performed on the controller unit 2 side. In addition, the gradation conversion from the distance image to the low gradation distance image can be performed on the head unit side in addition to the controller unit. In this case, the head side calculation unit 31 realizes the function of the gradation conversion means.
(Controller part 2)

またコントローラ部2は、コントローラ側通信手段42と、コントローラ側制御部と、コントローラ側演算部と、コントローラ側記憶手段と、検査実行手段50と、コントローラ側設定手段41とを備えている。コントローラ側通信手段42は、ヘッド部1のヘッド側通信手段36と接続されてデータ通信を行う。コントローラ側制御部は、各部材の制御を行うための部材である。コントローラ側演算部は、画像処理部60の機能を実現する。画像処理部60は、画像サーチ手段64や階調変換手段46等の機能を実現する。
(階調変換手段)
The controller unit 2 includes a controller-side communication unit 42, a controller-side control unit, a controller-side arithmetic unit, a controller-side storage unit, an inspection execution unit 50, and a controller-side setting unit 41. The controller side communication means 42 is connected to the head side communication means 36 of the head unit 1 to perform data communication. The controller-side control unit is a member for controlling each member. The controller-side arithmetic unit realizes the function of the image processing unit 60. The image processing unit 60 implements functions such as an image search unit 64 and a gradation conversion unit 46.
(Tone conversion means)

階調変換手段46は、距離画像に基づいて、高階調の距離画像を、低階調の低階調距離画像に階調変換する(詳細な手順については後述する)。これによって、ヘッド部で生成された高さ情報を有する距離画像を、既存の設備でも扱える二次元の濃淡画像として表現することで、計測処理や検査処理に資することができる。また、距離画像の生成処理と、階調変換処理とを、ヘッド部とコントローラ部とで分担して、負荷を分散できる利点も得られる。なお、ヘッド部側で距離画像の生成に加え、低階調距離画像の生成も行わせてもよい。このような処理はヘッド側演算部で行うことができる。これによって、コントローラ部側の負荷を一層軽減して、効率のよい運用が可能となる。   The gradation converting means 46 performs gradation conversion from a high gradation distance image to a low gradation low gradation distance image based on the distance image (the detailed procedure will be described later). Accordingly, the distance image having the height information generated by the head unit is expressed as a two-dimensional grayscale image that can be handled by existing equipment, thereby contributing to measurement processing and inspection processing. In addition, there is an advantage that the load can be distributed by sharing the distance image generation process and the gradation conversion process between the head unit and the controller unit. In addition to the generation of the distance image on the head unit side, a low gradation distance image may be generated. Such processing can be performed by the head side calculation unit. As a result, the load on the controller unit side can be further reduced and efficient operation becomes possible.

さらに階調変換手段は、距離画像のすべてを階調変換するのでなく、好ましくは、必要な部分のみを選択して、階調変換する。具体的には、予め検査対象領域設定手段(詳細は後述)で設定された検査対象領域と対応する部分のみを階調変換する。このようにすることで、多階調の距離画像を低階調の距離画像に変換する処理を、検査対象領域のみに限ることで階調変換に要する負荷を軽減できる。またこのことは処理時間の短縮化にも寄与する。すなわち、処理時間の短縮化を図ることで、FA用途の検査のような処理時間の限られた用途においても好適に利用でき、リアルタイム処理が実現される。   Further, the gradation converting means does not perform gradation conversion on all the distance images, but preferably selects only necessary portions and performs gradation conversion. Specifically, gradation conversion is performed only on the portion corresponding to the inspection target area set in advance by the inspection target area setting means (details will be described later). By doing so, it is possible to reduce the load required for gradation conversion by limiting the process of converting a multi-tone distance image to a low-tone distance image only to the inspection target region. This also contributes to shortening the processing time. That is, by shortening the processing time, it can be suitably used in applications where the processing time is limited, such as inspection for FA applications, and real-time processing is realized.

コントローラ側記憶手段は、各種設定や画像を保持するための部材であり、半導体記憶素子やハードディスク等が利用できる。   The controller-side storage means is a member for holding various settings and images, and a semiconductor storage element, a hard disk, or the like can be used.

コントローラ側設定手段41は、コントローラ部に対する各種設定を行うための部材であり、コントローラ部に接続されたコンソール等の入力手段3を介してユーザからの操作を受け付け、必要な条件等をコントローラ側に指示する。例えば、階調変換条件設定手段43や基準面設定手段44、空間コード化切替手段45、間隔均等化処理設定手段47、投光切替手段48、シャッタースピード設定手段49等の機能を実現する。   The controller-side setting means 41 is a member for making various settings for the controller unit, accepts an operation from the user via the input unit 3 such as a console connected to the controller unit, and sends necessary conditions to the controller side. Instruct. For example, the functions of the gradation conversion condition setting unit 43, the reference plane setting unit 44, the spatial coding switching unit 45, the interval equalization processing setting unit 47, the light projection switching unit 48, the shutter speed setting unit 49, and the like are realized.

基準面設定手段44は、コントローラ側通信手段42で受信された距離画像を、二次元の低階調距離画像に変換する階調変換を行う際の階調変換条件を構成する階調変換パラメータとして、この階調変換を行う基準面を、該距離画像に基づいて設定する。階調変換手段46は、基準面設定手段44で設定された基準面を基準として、距離画像を、この距離画像の階調数よりも低い階調数の、高さ情報を画像の濃淡値に置き換えた低階調距離画像に階調変換する。   The reference plane setting unit 44 serves as a gradation conversion parameter that constitutes a gradation conversion condition when performing gradation conversion for converting the distance image received by the controller-side communication unit 42 into a two-dimensional low gradation distance image. A reference plane for performing the gradation conversion is set based on the distance image. The gradation converting unit 46 uses the reference plane set by the reference plane setting unit 44 as a reference, and converts the distance information into the gray value of the image with the number of gradations lower than the number of gradations of the distance image. Tone conversion is performed on the replaced low tone distance image.

検査実行手段50は、階調変換手段46で階調変換された低階調距離画像に対して、所定の検査処理を実行する。
(ハードウェア構成)
The inspection execution unit 50 executes a predetermined inspection process on the low gradation distance image subjected to gradation conversion by the gradation conversion unit 46.
(Hardware configuration)

次にコントローラ部2のハードウェア構成例を、図6のブロック図に示す。この図に示すコントローラ部2は、各種プログラムに基づき数値計算や情報処理を行うと共に、ハードウェア各部の制御を行う主制御部51を有している。主制御部51は、例えば、中央演算処理装置としてのCPUと、主制御部51が各種プログラムを実行する際のワークエリアとして機能するRAM等のワークメモリと、起動プログラムや初期化プログラム等が格納されたROM,フラッシュROM,又はEEPROM等のプログラムメモリとを有している。   Next, a hardware configuration example of the controller unit 2 is shown in a block diagram of FIG. The controller unit 2 shown in this figure has a main control unit 51 that performs numerical calculation and information processing based on various programs and controls each part of the hardware. The main control unit 51 stores, for example, a CPU as a central processing unit, a work memory such as a RAM that functions as a work area when the main control unit 51 executes various programs, a startup program, an initialization program, and the like. And a program memory such as a ROM, a flash ROM, or an EEPROM.

またコントローラ部2は、撮像手段10や投光手段20等を含むヘッド部1と接続して、ワークに対して正弦波縞模様パターンを、位相をずらして投影するよう投光手段20を制御し、撮像手段10での撮像により得られた画像データを取り込むためのコントローラ側接続部52と、入力手段3からの操作信号が入力される操作入力部53と、液晶パネル等の表示手段4に対して画像を表示させる表示用DSP等から構成される表示制御部54と、外部のPLC70やパーソナルコンピュータPC等と通信可能に接続される通信部55と、一時的なデータを保持するRAM56と、設定内容を保存するコントローラ側記憶手段57と、パーソナルコンピュータPCにインストールされた三次元画像処理プログラムで設定されたデータを保持するための補助記憶手段58と、エッジ検出や面積計算等の計測処理を実行する演算用DSP等から構成される画像処理部60と、画像処理部60での処理結果等に基づいて所定の検査を行った結果を出力するための出力部59等を備えている。これらの各ハードウェアは、バス等の電気的な通信路(配線)を介し、通信可能に接続されている。   The controller unit 2 is connected to the head unit 1 including the imaging unit 10 and the light projecting unit 20, and controls the light projecting unit 20 to project a sinusoidal fringe pattern on the workpiece with a phase shift. For the controller side connection unit 52 for taking in image data obtained by the imaging by the imaging unit 10, the operation input unit 53 to which the operation signal from the input unit 3 is input, and the display unit 4 such as a liquid crystal panel A display control unit 54 including a display DSP for displaying an image, a communication unit 55 communicably connected to an external PLC 70, a personal computer PC, etc., a RAM 56 for holding temporary data, and a setting The controller-side storage means 57 for storing the contents and the data set by the 3D image processing program installed in the personal computer PC are held. Image processing unit 60 composed of auxiliary storage means 58 for processing, an arithmetic DSP for executing measurement processing such as edge detection and area calculation, and a predetermined inspection based on the processing result in the image processing unit 60, etc. An output unit 59 and the like for outputting the results are provided. These pieces of hardware are communicably connected via an electrical communication path (wiring) such as a bus.

主制御部51内のプログラムメモリには、コントローラ側接続部52、操作入力部53、表示制御部54、通信部55、及び画像処理部60の各部を、CPUのコマンド等により制御するための制御プログラムが格納されている。また、上述した処理順序プログラム、すなわちパーソナルコンピュータPCにおいて生成され、パーソナルコンピュータPCから転送された処理順序プログラムは、プログラムメモリに格納される。   The program memory in the main control unit 51 has a control for controlling each of the controller side connection unit 52, the operation input unit 53, the display control unit 54, the communication unit 55, and the image processing unit 60 by a CPU command or the like. The program is stored. The processing order program described above, that is, the processing order program generated in the personal computer PC and transferred from the personal computer PC is stored in the program memory.

通信部55は、外部のPLC70に接続されたセンサ(光電センサ等)でトリガ入力があったときに、PLC70から撮像トリガ信号を受信するインターフェース(I/F)として機能する。また、パーソナルコンピュータPCから転送されてくる三次元画像処理プログラムや表示手段4の表示態様を規定するレイアウト情報等を受信するインターフェース(I/F)としても機能する。   The communication unit 55 functions as an interface (I / F) that receives an imaging trigger signal from the PLC 70 when a trigger is input from a sensor (photoelectric sensor or the like) connected to the external PLC 70. It also functions as an interface (I / F) that receives a 3D image processing program transferred from the personal computer PC, layout information that defines the display mode of the display means 4, and the like.

主制御部51のCPUは、通信部55を介してPLC70から撮像トリガ信号を受信すると、コントローラ側接続部52に対して撮像指令(コマンド)を送る。また、処理順序プログラムに基づいて、画像処理部60に対して、実行すべき画像処理を指示するコマンドを送信する。なお、撮像トリガ信号を生成する装置として、PLC70ではなく、光電センサ等のトリガ入力用のセンサを、通信部55に直接接続するように構成してもよい。   When receiving the imaging trigger signal from the PLC 70 via the communication unit 55, the CPU of the main control unit 51 sends an imaging command (command) to the controller side connection unit 52. Also, a command for instructing image processing to be executed is transmitted to the image processing unit 60 based on the processing order program. In addition, as a device that generates an imaging trigger signal, a trigger input sensor such as a photoelectric sensor may be directly connected to the communication unit 55 instead of the PLC 70.

操作入力部53は、ユーザの操作に基づき入力手段3からの操作信号を受信するインターフェース(I/F)として機能する。表示手段4には、入力手段3を用いたユーザの操作内容が表示される。例えば入力手段3にコンソールを用いる場合は、表示手段4上に表示されるカーソルを上下左右に移動させる十字キー、決定ボタン、又はキャンセルボタン等の各部品を配置できる。これらの各部品を操作することによって、ユーザは表示手段4上で、画像処理の処理順序を規定するフローチャートを作成したり、各画像処理のパラメータ値を編集したり、基準領域の設定をしたり、基準登録画像を編集したりすることができる。   The operation input unit 53 functions as an interface (I / F) that receives an operation signal from the input unit 3 based on a user operation. The display unit 4 displays the user's operation contents using the input unit 3. For example, when a console is used as the input means 3, various components such as a cross key, a determination button, or a cancel button for moving the cursor displayed on the display means 4 up, down, left and right can be arranged. By operating these components, the user creates a flowchart for defining the processing order of the image processing on the display means 4, edits the parameter value of each image processing, and sets the reference area. The reference registration image can be edited.

コントローラ側接続部52は、画像データの取り込みを行う。具体的には、例えばCPUから撮像手段10の撮像指令を受信すると、撮像手段10に対して画像データ取り込み信号を送信する。そして、撮像手段10で撮像が行われた後、撮像して得られた画像データを取り込む。取り込んだ画像データは、一旦バッファリング(キャッシュ)され、予め用意しておいた画像変数に代入される。なお、「画像変数」とは、数値を扱う通常の変数と異なり、対応する画像処理ユニットの入力画像として割り付けることで、計測処理や画像表示の参照先となる変数をいう。   The controller side connection unit 52 captures image data. Specifically, for example, when an imaging command of the imaging unit 10 is received from the CPU, an image data capturing signal is transmitted to the imaging unit 10. And after image pick-up by image pick-up means 10, image data obtained by image pick-up is taken in. The captured image data is temporarily buffered (cached) and substituted for an image variable prepared in advance. The “image variable” is a variable that is a reference destination for measurement processing and image display by being assigned as an input image of a corresponding image processing unit, unlike a normal variable that handles numerical values.

画像処理部60は、画像データに対する計測処理を実行する。具体的には、まずコントローラ側接続部52が上述した画像変数を参照しつつ、フレームバッファから画像データを読み出して、画像処理部60内のメモリへ内部転送を行う。そして、画像処理部60は、そのメモリに記憶された画像データを読み出して、計測処理を実行する。また画像処理部60には、階調変換手段46、異常点ハイライト手段62、画像サーチ手段64等が含まれる。   The image processing unit 60 performs a measurement process on the image data. Specifically, first, the controller side connection unit 52 reads image data from the frame buffer while referring to the image variables described above, and performs internal transfer to the memory in the image processing unit 60. Then, the image processing unit 60 reads the image data stored in the memory and executes measurement processing. The image processing unit 60 includes a gradation conversion unit 46, an abnormal point highlight unit 62, an image search unit 64, and the like.

表示制御部54は、CPUから送られてきた表示指令(表示コマンド)に基づいて、表示手段4に対して所定画像(映像)を表示させるための制御信号を送信する。例えば、計測処理前又は計測処理後の画像データを表示するために、表示手段4に対して制御信号を送信する。また、表示制御部54は、入力手段3を用いたユーザの操作内容を表示手段4に表示させるための制御信号も送信する。   The display control unit 54 transmits a control signal for displaying a predetermined image (video) to the display unit 4 based on a display command (display command) sent from the CPU. For example, a control signal is transmitted to the display unit 4 in order to display image data before or after the measurement process. The display control unit 54 also transmits a control signal for causing the display unit 4 to display the user's operation contents using the input unit 3.

以上のようなハードウェアで構成されたヘッド部1やコントローラ部2は、各種プログラム等によって、図5の各手段や機能をソフトウェア的に実現可能な構成としている。この例では、図1のコンピュータに、三次元画像処理プログラムをインストールして、三次元画像処理に必要な設定を行う態様を採用している。
(階調変換)
The head unit 1 and the controller unit 2 configured by the hardware as described above are configured such that the respective means and functions in FIG. 5 can be realized in software by various programs. In this example, a mode is adopted in which a three-dimensional image processing program is installed in the computer of FIG. 1 and settings necessary for three-dimensional image processing are performed.
(Gradation conversion)

以上の三次元画像処理装置は、ワークの距離画像を取得し、この距離画像に対して画像処理を行い、この結果に対して検査を行う。本実施の形態における三次元画像処理装置は、距離画像の画素値である高さ情報をそのまま用いて演算を行う高さ検査処理に加えて、既存のハードウェアを用いて面積やエッジ等の情報を用いた演算を行う画像検査処理の、2種類の検査を実施することができる。ここで、高さ検査処理の精度を維持するためには、多階調な距離画像を生成する必要がある。一方、既存のハードウェアではこのような多階調な距離画像に画像検査処理を実施することはできない。そのため、既存のハードウェアを用いて画像検査処理を行うために、多階調な距離画像に階調変換を施し、低階調距離画像を生成する。   The above three-dimensional image processing apparatus acquires a distance image of a workpiece, performs image processing on the distance image, and inspects the result. The three-dimensional image processing apparatus according to the present embodiment uses information such as an area and an edge using existing hardware in addition to the height inspection process in which the height information that is the pixel value of the distance image is used as it is. Two types of inspections can be performed, that is, an image inspection process that performs an operation using the. Here, in order to maintain the accuracy of the height inspection process, it is necessary to generate a multi-tone distance image. On the other hand, with existing hardware, image inspection processing cannot be performed on such multi-tone distance images. Therefore, in order to perform image inspection processing using existing hardware, gradation conversion is performed on a multi-gradation distance image to generate a low gradation distance image.

しかしながら、多階調の距離画像の高さ情報を、そのまま低階調の距離画像に変換したのでは、高さ情報の精度が損なわれるという問題がある。FA用途等で利用される一般的な画像は、モノクロで各画素の濃淡値を8階調で表現した画像が多い。これに対して距離画像は、16階調画像のような高階調の画像が用いられている。このため、多階調の距離画像を低階調距離画像に階調変換する際に、高さ情報が相当量損なわれることとなり、検査の精度に影響を与える。かといって、精度を高めるために既存の画像処理で扱う画像の階調数を上げるには導入コストが高騰するとともに、処理負荷が高くなり、利用に対するハードルが高くなる。   However, if the height information of the multi-tone distance image is converted into the low-tone distance image as it is, there is a problem that the accuracy of the height information is impaired. There are many common images used for FA applications, etc., which are monochrome and express the gray value of each pixel with 8 gradations. On the other hand, as the distance image, a high gradation image such as a 16 gradation image is used. For this reason, when gradation conversion is performed on a multi-tone distance image to a low-tone distance image, a considerable amount of height information is lost, affecting the accuracy of inspection. However, in order to increase the number of gradations of the image handled in the existing image processing in order to increase the accuracy, the introduction cost increases, the processing load increases, and the hurdle for use increases.

そこで、このような階調変換に際して、必要な高さ情報が維持されるような階調変換の条件を設定することが必要となる。以下、その方法及び手順について詳述する。
(高さ検査又は画像検査)
Therefore, in such gradation conversion, it is necessary to set conditions for gradation conversion so that necessary height information is maintained. Hereinafter, the method and procedure will be described in detail.
(Height inspection or image inspection)

まず、三次元画像処理装置を用いて高さ検査処理を行う処理動作を、図7のフローチャートに基づいて説明する。この三次元画像処理装置は、計算処理を行うためのツールとして、距離画像に対して高さ検査を行う高さ検査処理ツールと、既存の輝度画像に対して画像検査を行う各種の画像検査処理ツールとを備えている。ここでは、高さ検査処理について説明する。   First, the processing operation for performing the height inspection process using the three-dimensional image processing apparatus will be described based on the flowchart of FIG. This three-dimensional image processing apparatus includes a height inspection processing tool for performing a height inspection on a distance image, and various image inspection processes for performing an image inspection on an existing luminance image as tools for performing calculation processing. With tools. Here, the height inspection process will be described.

最初に、距離画像を生成する(ステップS71)。具体的には、距離画像生成手段32が、撮像手段10と投光手段20とを用いて距離画像を生成する。次いで、所望の計算処理を選択する(ステップS72)。ここでは、計算処理に必要なツールを選択する。   First, a distance image is generated (step S71). Specifically, the distance image generating unit 32 generates a distance image using the imaging unit 10 and the light projecting unit 20. Next, a desired calculation process is selected (step S72). Here, a tool necessary for the calculation process is selected.

画像検査処理ツールを選択する場合は、ステップS73に進み、上記ステップS71で得られた高階調の距離画像に対して、階調変換処理を行い、低階調の距離画像に変換する。これによって、既存の画像処理装置が備えている検査処理ツールでも、低階調距離画像を扱えるようになる。なお、階調変換処理は、高階調の距離画像の全域に対して行うのでなく、好ましくは画像検査処理のために設定された検査対象領域内でのみ行う。   When the image inspection processing tool is selected, the process proceeds to step S73, where the gradation conversion process is performed on the high gradation distance image obtained in step S71 to convert it into a low gradation distance image. Accordingly, an inspection processing tool provided in an existing image processing apparatus can handle a low gradation distance image. The gradation conversion process is not performed on the entire range of the high gradation distance image, but is preferably performed only in the inspection target area set for the image inspection process.

一方、高さ検索ツールを選択する場合は、多階調距離画像が有する高さ情報をそのまま利用するため、階調変換を行うことなく、ステップS74に進む。   On the other hand, when the height search tool is selected, since the height information of the multi-tone distance image is used as it is, the process proceeds to step S74 without performing tone conversion.

さらに、検査実行手段50が、各種計算処理を行い(ステップS74)、次いでこの計算結果に基づいて、ワークが良品であるか否かを判定する(ステップS75)。判定信号出力手段160は、検査実行手段50によってワークが良品であると判定された場合には(ステップS75:YES)、判定信号としてOK信号をPLC70に出力し(ステップS76)、検査実行手段50によってワークが良品でない、すなわち不良品であると判定された場合には(ステップS75:NO)、判定信号としてNG信号をPLC70に出力する(ステップS77)。
(設定モード)
Further, the inspection execution means 50 performs various calculation processes (step S74), and then determines whether or not the workpiece is a non-defective product based on the calculation result (step S75). When the inspection execution unit 50 determines that the workpiece is a non-defective product (step S75: YES), the determination signal output unit 160 outputs an OK signal to the PLC 70 as a determination signal (step S76). When it is determined that the workpiece is not a non-defective product, that is, a defective product (step S75: NO), an NG signal is output to the PLC 70 as a determination signal (step S77).
(Setting mode)

次に、このような高さ検査や画像検査の処理実行に先立ち、三次元画像処理装置に対して各種の設定を行う設定モードにおける手順の一例を、図8のフローチャートに基づいて説明する。最初にステップS81において、設定用の画像(設定用画像)を選択する。ここでは、予め検査処理の対象となる画像を入力して、登録画像として保存したものを呼び出したり、あるいは新たな入力画像を取得して、これに対して設定を行うこともできる。ここでは、運用時に逐次入力される入力画像を代替的に示すものとして、ワークを撮像して得られる入力画像を、登録画像として登録している。また、予め登録しておいた登録画像を呼び出してもよい。次にステップS82において、階調変換方法を選択させる。ここでは、静的変換又は動的変換のいずれかの選択をユーザに促す。次にステップS83において、階調変換パラメータを調整する。ここでは、ステップS82で静的変換を選択した場合は、ステップS81で取得された画像に対して階調変換パラメータを調整する。階調変換パラメータの調整方法については、後述する。なお、以上説明した手順は一例であり、異なる順序とすることもできる。例えば画像の取得は、階調変換方法の選択後に行わせてもよい。
(設定手順の詳細)
Next, an example of a procedure in a setting mode for performing various settings for the three-dimensional image processing apparatus prior to execution of such height inspection and image inspection processing will be described with reference to the flowchart of FIG. First, in step S81, a setting image (setting image) is selected. Here, it is also possible to input an image to be inspected in advance and call an image stored as a registered image, or obtain a new input image and set it. Here, an input image obtained by capturing a workpiece is registered as a registered image, as an alternative showing an input image that is sequentially input during operation. Alternatively, a registered image registered in advance may be called up. Next, in step S82, a gradation conversion method is selected. Here, the user is prompted to select either static conversion or dynamic conversion. Next, in step S83, the tone conversion parameter is adjusted. Here, when static conversion is selected in step S82, the tone conversion parameters are adjusted for the image acquired in step S81. A method for adjusting the gradation conversion parameter will be described later. In addition, the procedure demonstrated above is an example and can also be made into a different order. For example, the image may be acquired after selecting the gradation conversion method.
(Details of setting procedure)

次に、設定時の手順の詳細について説明する。三次元画像処理装置においては、運用モードに先立ち、設定モードにおいて予め必要な設定を行う。このような設定を行うための各種設定手段は、例えばコントローラ部2側に設けることができる。例えば図1の例では、コントローラ部2に接続された入力手段3の一形態であるコンソールが利用できる。また、これに代えて、又はこれに加えて、上述の通りコントローラ部2に接続されたパーソナルコンピュータにインストールした三次元画像処理プログラムに、このような設定手段の機能を実現させることもできる。以下、ここでは図1に示すパーソナルコンピュータにインストールした三次元画像処理プログラムを用いて、各設定を行う手順の詳細を、図9〜図113に示す三次元画像処理プログラムのユーザインターフェース(GUI)画面に基づいて説明する。なお、これらのGUIの例では、距離画像を「高さ画像」、輝度画像を「濃淡画像」と、それぞれ表示している。
(距離画像、輝度画像の登録工程)
Next, the details of the setting procedure will be described. In the three-dimensional image processing apparatus, necessary settings are made in advance in the setting mode prior to the operation mode. Various setting means for performing such settings can be provided on the controller unit 2 side, for example. For example, in the example of FIG. 1, a console that is one form of the input unit 3 connected to the controller unit 2 can be used. Instead of this, or in addition to this, the function of such setting means can be realized in a three-dimensional image processing program installed in a personal computer connected to the controller unit 2 as described above. Hereinafter, the details of the procedure for performing each setting using the 3D image processing program installed in the personal computer shown in FIG. 1 will be described below. The user interface (GUI) screen of the 3D image processing program shown in FIGS. Based on In these GUI examples, a distance image is displayed as a “height image”, and a luminance image is displayed as a “grayscale image”.
(Distance image and brightness image registration process)

まず、距離画像と輝度画像の登録を行う。ここでは、図9に示す三次元画像処理プログラムの初期画面260から、「撮像」処理ユニット263の設定を行う。具体的には「撮像」処理ユニットのボタン263のボタンを押下する。これにより、図10の撮像設定メニュー269に切り替わる。
(三次元画像処理プログラム)
First, a distance image and a luminance image are registered. Here, the “imaging” processing unit 263 is set from the initial screen 260 of the 3D image processing program shown in FIG. Specifically, the button of the button 263 of the “imaging” processing unit is pressed. This switches to the imaging setting menu 269 of FIG.
(3D image processing program)

図10のGUI画面例では、画面の右側に画像を表示させる第一画像表示領域111を設け、左側には複数の設定項目を表すボタンを複数配置した設定項目ボタン領域112が設けられる。設定項目ボタン領域112には、「画像登録」ボタン113、「撮像設定」ボタン284、「カメラ設定」ボタン、「トリガ設定」ボタン、「フラッシュ設定」ボタン、「照明ボリューム」ボタン、「照明拡張ユニット」ボタン、「保存」ボタン等が設けられている。ユーザは設定項目ボタン領域112中から、所望の設定項目ボタンを選択して、必要な設定項目の設定ができる。   In the GUI screen example of FIG. 10, a first image display area 111 for displaying an image is provided on the right side of the screen, and a setting item button area 112 in which a plurality of buttons representing a plurality of setting items are arranged is provided on the left side. The setting item button area 112 includes an “image registration” button 113, an “imaging setting” button 284, a “camera setting” button, a “trigger setting” button, a “flash setting” button, an “illumination volume” button, and an “illumination expansion unit”. ”Button,“ Save ”button, and the like. The user can set a necessary setting item by selecting a desired setting item button from the setting item button area 112.

図10の撮像設定メニュー269において、設定項目ボタン領域112に設けられた「画像登録」ボタン113を押下すると、図11の画像登録画面270に切り替わる。この画面から登録対象、カメラ選択、登録先等、各種の設定を行うことができる。ここでは、操作領域に設けられた各種のボタン等によって所望の画像に調整した上で、登録すなわち画像データの保存を行う。ここでは、第二画像表示領域121に距離画像が表示されており、さらにこの画像に割り当てられた画像変数が操作領域122に表示される。図11の例では、撮像手段を選択する「カメラ選択」欄271で「カメラ1」が選択されており、この「カメラ1」で撮像された距離画像として、画像変数「&Cam1Img」が「カメラ選択」欄271の下方に表示される。   When the “image registration” button 113 provided in the setting item button area 112 is pressed in the imaging setting menu 269 in FIG. 10, the screen is switched to the image registration screen 270 in FIG. 11. Various settings such as a registration target, camera selection, and registration destination can be performed from this screen. Here, the image is adjusted to a desired image using various buttons or the like provided in the operation area, and then registered, that is, the image data is stored. Here, a distance image is displayed in the second image display area 121, and an image variable assigned to this image is displayed in the operation area 122. In the example of FIG. 11, “Camera 1” is selected in the “Camera selection” column 271 for selecting an imaging means, and the image variable “& Cam1Img” is “Camera selection” as a distance image captured by this “Camera 1”. 'Is displayed below the column 271.

設定終了後に操作領域の下段に設けられた「登録」ボタン272を押下すると、図12に示すように現在第二画像表示領域121で表示中の距離画像の登録が開始され、進捗状況がグラフィカルに表示される。また、図13に示すように輝度画像の登録も併せて行われる。この例では、先に距離画像が距離画像記憶部38aに保存され、次に輝度画像が輝度画像記憶部38bに保存される。また、距離画像の画像変数「&Cam1Img」及び輝度画像の画像変数「&Cam1GrayImg」も、それぞれ記録される。これらの画像変数は、各画像に対して固有の変数が各々付与されているので、登録画像を呼び出す際の指標として利用できる。ただ、この例は一例であり、各画像の登録順序を逆にしたり、同時に登録してもよい。このように、登録画像として距離画像と輝度画像とを同時に保存することで、ユーザは各画像の登録の手間を省力化できる。ただ、距離画像と輝度画像とを登録画像として個別に登録する構成とすることも可能である。
(位相シフト法)
When the “Register” button 272 provided in the lower part of the operation area is pressed after the setting is completed, the registration of the distance image currently displayed in the second image display area 121 is started as shown in FIG. Is displayed. In addition, as shown in FIG. 13, the registration of the luminance image is also performed. In this example, the distance image is first stored in the distance image storage unit 38a, and then the luminance image is stored in the luminance image storage unit 38b. Also, the image variable “& Cam1Img” of the distance image and the image variable “& Cam1GrayImg” of the luminance image are recorded respectively. These image variables can be used as indices when calling up registered images because unique variables are assigned to the respective images. However, this example is merely an example, and the registration order of each image may be reversed or registered simultaneously. Thus, by saving the distance image and the luminance image simultaneously as registered images, the user can save labor for registering each image. However, it is also possible to adopt a configuration in which the distance image and the luminance image are individually registered as registered images.
(Phase shift method)

ここでワークの変位及び三次元形状を非接触で計測する手法の一として、位相シフト法について説明する。位相シフト法は格子パターン投影法、縞走査法等とも呼ばれる。この方法では、照度分布を正弦波状に変動させた格子パターンをもつ光線をワークに投影する。しかも、正弦波の位相の異なる3つ以上の格子パターンで投影し、高さ計測点の各明度値を光線の投影方向とは別の角度から各パターン毎に撮像し、各明度値より格子パターンの位相値を計算する。計測点の高さに応じて、計測点に投影され、格子パターンの位相が変化し、基準となる位置で反射された光線により観察される位相とは異なった位相の光線が観察される。そこで、計測点における光線の位相を計算し、三角測量の原理を利用して、光学装置の幾何関係式に代入することにより計測点(従って物体)の高さを計測し、三次元形状を求める方法である。位相シフト法によれば、ワークの高さを格子パターン周期を小さくすることにより高分解能で計測することができるが、測定できる高さの範囲が、位相のずれ量で2π以内となる低い高さのもの(高低差の小さいもの)しか計測できない。
(空間コード化法)
Here, the phase shift method will be described as one method for measuring the displacement and three-dimensional shape of the workpiece in a non-contact manner. The phase shift method is also called a grating pattern projection method, a fringe scanning method, or the like. In this method, a light beam having a lattice pattern in which the illuminance distribution is changed in a sine wave shape is projected onto a workpiece. Moreover, projection is performed with three or more lattice patterns having different sine wave phases, and each brightness value at the height measurement point is imaged for each pattern from an angle different from the projection direction of the light beam. Calculate the phase value of. Depending on the height of the measurement point, the phase of the grating pattern is projected onto the measurement point, and a light beam having a phase different from the phase observed by the light beam reflected at the reference position is observed. Therefore, the phase of the light ray at the measurement point is calculated, and the height of the measurement point (and hence the object) is measured by substituting it into the geometric relational expression of the optical device using the principle of triangulation to obtain the three-dimensional shape. Is the method. According to the phase shift method, the workpiece height can be measured with a high resolution by reducing the grating pattern period, but the measurable height range is a low height that is within 2π in terms of the phase shift amount. Can only be measured (those with a small height difference).
(Spatial coding method)

そこで、空間コード化法を兼用する。空間コード化法によれば、光が照射される空間を、多数の断面略扇状の小空間に分け、この小空間に一連の空間コード番号を付す。このため、ワークの高さが高くても、すなわち高低差が大きくても、光が照射される空間内にあれば、空間コード番号から高さが演算できる。したがって、高さの高いワークについても全体にわたって形状を計測できる。このように空間コード化法によれば、許容高さのレンジ(ダイナミックレンジ)が広く、高さの高いワークについても全体にわたって形状を計測できる。   Therefore, the space coding method is also used. According to the space encoding method, a space irradiated with light is divided into a number of small spaces having a substantially fan-shaped cross section, and a series of space code numbers are assigned to the small spaces. For this reason, even if the height of the workpiece is high, that is, when the height difference is large, the height can be calculated from the space code number if it is within the space irradiated with light. Therefore, it is possible to measure the shape of a workpiece having a high height throughout. Thus, according to the spatial coding method, the allowable height range (dynamic range) is wide, and the shape of a workpiece having a high height can be measured as a whole.

次に、撮像手段で距離画像を撮像する設定例を、図14〜図42に基づいて説明する。上述した画像の登録に先立ち、図10の撮像設定メニュー269から、「撮像設定」ボタン284を押下すると、図14の撮像設定画面280となる。撮像設定画面280では。撮像に関する基本的な設定を行える。例えば「撮像有効設定」ボタンを押下すると図15の撮像有効設定画面が表示され、三次元画像処理装置に接続されている撮像手段すなわちカメラを選択できる。例えば撮像手段として、通常の輝度画像を撮像するモノクロCCDカメラやカラーCCDカメラに代えて、あるいはこれに加えて、高さ情報を取得可能なカメラを接続することで、距離画像を三次元画像処理装置に取り込むことが可能となる。また、複数の撮像手段を三次元画像処理装置に接続している際に、いずれの撮像手段を使用するか、一以上を選択できる。   Next, a setting example in which a distance image is captured by the imaging unit will be described with reference to FIGS. Prior to the image registration described above, when the “imaging setting” button 284 is pressed from the imaging setting menu 269 in FIG. 10, the imaging setting screen 280 in FIG. 14 is displayed. On the imaging setting screen 280. Basic settings related to imaging can be performed. For example, when an “imaging effective setting” button is pressed, an imaging effective setting screen shown in FIG. 15 is displayed, and an imaging means, that is, a camera connected to the 3D image processing apparatus can be selected. For example, instead of or in addition to a monochrome CCD camera or color CCD camera that captures a normal luminance image as an imaging means, a camera capable of acquiring height information is connected to perform three-dimensional image processing of distance images. It can be taken into the device. In addition, when a plurality of imaging means are connected to the 3D image processing apparatus, one or more of the imaging means to be used can be selected.

また、図14の撮像設定画面280から、操作領域に設けられた「詳細設定」ボタン282を押下すると、図16に示す三次元計測設定画面290となる。なお図16では説明の都合上、異なるワークを表示させている。図16の三次元計測設定画面290は、リアルタイム更新手段にあたる「連続更新で表示する」欄292、シャッタースピード設定手段49にあたるシャッタースピード設定欄294、濃淡レンジ設定欄296、前処理設定欄310、計測不能基準設定欄312、均等間隔処理設定欄314、空間コード設定欄316、プロジェクタ選択設定欄318、「表示画像」選択欄322等を備えている。
(リアルタイム更新手段)
Further, when the “detailed setting” button 282 provided in the operation area is pressed from the imaging setting screen 280 of FIG. 14, a three-dimensional measurement setting screen 290 shown in FIG. 16 is displayed. In FIG. 16, for the convenience of explanation, different works are displayed. The three-dimensional measurement setting screen 290 in FIG. 16 includes a “display with continuous update” field 292 corresponding to the real-time update means, a shutter speed setting field 294 corresponding to the shutter speed setting means 49, a light / dark range setting field 296, a preprocessing setting field 310, a measurement. An impossible standard setting field 312, an equal interval processing setting field 314, a space code setting field 316, a projector selection setting field 318, a “display image” selection field 322, and the like are provided.
(Real-time update means)

ここでは、操作領域において設定が変更された場合、第二画像表示領域121上で表示中の画像に対して変更後の設定に更新するリアルタイム更新手段を備えている。リアルタイム更新手段はON/OFFを切り替えることができる。図16の画面例において、リアルタイム更新手段の一形態として操作領域の上段に設けられた「連続更新で表示する」欄292をONとすることで、リアルタイム更新機能を動作させることができる。   Here, when the setting is changed in the operation area, a real-time updating unit is provided for updating the image being displayed on the second image display area 121 to the changed setting. The real-time updating means can be switched ON / OFF. In the screen example of FIG. 16, the real-time update function can be operated by turning on the “display with continuous update” column 292 provided in the upper part of the operation area as one form of the real-time update means.

図16の例では、操作領域において設定可能な項目として、シャッタースピード、濃淡レンジ、前処理、計測不能基準、均等間隔処理、空間コード、プロジェクタ選択、表示画像等が挙げられる。以下、順次説明する。
(シャッタースピード設定手段49)
In the example of FIG. 16, items that can be set in the operation area include shutter speed, density range, preprocessing, non-measurable reference, uniform interval processing, space code, projector selection, display image, and the like. Hereinafter, description will be made sequentially.
(Shutter speed setting means 49)

撮像手段による撮像時のシャッタースピードを調整するためのシャッタースピード設定手段49の一態様として、図16の例では、シャッタースピード設定欄294を設けている。シャッタースピード設定欄294から、シャッタースピードをユーザが指定できる。ここでは、ドロップダウンボックスから、予め設定されたシャッタースピード、例えば1/15、1/30、1/60、1/120、1/240、1/500、1/1000、、、、1/20000を選択する。選択された数値に応じた秒数が、右側の数値表示欄295に表示される。また、任意のシャッタースピードを数値で直接指定することもできる。例えばドロップダウンボックスの選択肢として「数値入力」を選択すると、数値表示欄295のグレーアウトが解除され、直接数値を入力可能となる。このようにしてシャッタースピード設定欄294で指定された数値に基づき、撮像手段であるカメラ(撮像素子)の露光時間が調整される。なおシャッタースピードの調整に際しては、距離画像よりも輝度画像の濃淡画像を第二画像表示領域121に表示させた方が、確認作業が容易となる。さらに、上記リアルタイム更新機能によって、シャッタースピード設定欄294でシャッタースピードを変更した画像が、速やかに第二画像表示領域121に反映されることで、ユーザは現在の設定が妥当かどうかを視覚的に確認でき、調整作業を容易に行うことが可能となる。
(濃淡レンジ設定欄296)
As an example of the shutter speed setting unit 49 for adjusting the shutter speed during imaging by the imaging unit, a shutter speed setting field 294 is provided in the example of FIG. From the shutter speed setting field 294, the user can specify the shutter speed. Here, a preset shutter speed, for example, 1/15, 1/30, 1/60, 1/120, 1/240, 1/500, 1/1000,... Select. The number of seconds corresponding to the selected numerical value is displayed in the numerical value display column 295 on the right side. It is also possible to directly specify an arbitrary shutter speed numerically. For example, when “numerical value input” is selected as a drop-down box option, the gray-out of the numerical value display column 295 is canceled, and a numerical value can be directly input. In this way, the exposure time of the camera (imaging device) that is the imaging means is adjusted based on the numerical value specified in the shutter speed setting field 294. When adjusting the shutter speed, it is easier to perform the confirmation work if the grayscale image of the luminance image is displayed in the second image display area 121 than the distance image. Furthermore, by the real-time update function, an image whose shutter speed has been changed in the shutter speed setting field 294 is immediately reflected in the second image display area 121, so that the user can visually determine whether the current setting is appropriate. It can be confirmed and adjustment work can be easily performed.
(Tint range setting field 296)

濃淡レンジ設定欄296においては、濃淡画像である輝度画像のダイナミックレンジを調整する。ここではドロップダウンボックスから、「低い(−1)」、「普通(0)」、「高い(1)」のいずれかを選択することで、ダイナミックレンジが増減される。
(前処理設定欄310)
In the density range setting field 296, the dynamic range of the luminance image that is the density image is adjusted. Here, the dynamic range is increased or decreased by selecting one of “low (−1)”, “normal (0)”, and “high (1)” from the drop-down box.
(Pre-processing setting field 310)

前処理設定欄310においては、ヘッド部で距離画像を生成する前に行う共通のフィルタ処理を規定する。共通フィルタ処理としては、例えば、平均化フィルタ、メディアンフィルタ、ガウシアンフィルタのフィルタ等が考えられる。ここではパターン投影画像に対するフィルタ処理として、図17の例では、ドロップダウンボックスにより、「なし」、「メディアン」、「ガウシアン」、「平均」のいずれかを選択する。なおフィルタ処理は、距離画像を生成する前に行う前処理の他、ヘッド部1側で得られた距離画像に対しても行うことができる。
(計測不能基準設定欄312)
In the pre-processing setting field 310, common filter processing to be performed before the distance image is generated by the head unit is defined. Examples of common filter processing include an averaging filter, a median filter, and a Gaussian filter. Here, as the filter processing for the pattern projection image, one of “none”, “median”, “Gaussian”, and “average” is selected from the drop-down box in the example of FIG. The filter process can be performed on the distance image obtained on the head unit 1 side as well as the pre-processing performed before the distance image is generated.
(Measurement impossible standard setting field 312)

計測不能基準設定欄312では、ノイズ成分をカットするレベルを設定する。すなわち計測不能基準設定欄312で設定された量だけ、高さ計測を行わない。パターン投影画像を用いた三次元の高さ情報の計測においては、ある程度の光量がないと、正確な高さ情報を計測できない。その一方で、多重反射が生じている場合等は、明るすぎるため光量を落とす必要がある。このように、撮像されたパターン投影画像に応じてノイズ成分カット量を選択する。具体的には、各画素の高さ情報を演算するためデータに対して、ノイズによる無効データと見なす閾値を決定する。   In the measurement impossible reference setting field 312, a level for cutting the noise component is set. That is, the height measurement is not performed by the amount set in the non-measurable reference setting field 312. In the measurement of three-dimensional height information using a pattern projection image, accurate height information cannot be measured without a certain amount of light. On the other hand, when multiple reflection occurs, it is necessary to reduce the amount of light because it is too bright. Thus, the noise component cut amount is selected according to the captured pattern projection image. Specifically, a threshold value for determining invalid data due to noise is determined for data for calculating height information of each pixel.

ここでは図18に示すように、ドロップダウンボックスから、「高」、「中」、「低」、「なし」のいずれかを選択する。なお「なし」を選択すると、ノイズ成分カットを行わず、すべての画素について高さ計測を行う。例えば図19に示す例では、計測不能基準設定欄312で「なし」を選択しており、ノイズデータを含めたあらゆる点で高さデータを算出している。この画面からは判別し難いが、ワークの角の部分等で、ノイズデータによって不正な高さが計測されている。   Here, as shown in FIG. 18, one of “high”, “medium”, “low”, and “none” is selected from the drop-down box. If “None” is selected, noise components are not cut and height measurement is performed for all pixels. For example, in the example shown in FIG. 19, “None” is selected in the non-measurable reference setting field 312, and height data is calculated at all points including noise data. Although it is difficult to discriminate from this screen, an illegal height is measured by noise data at a corner portion of the workpiece.

一方、図20に示す例では、計測不能基準設定欄312で「低」を選択しており、ノイズデータに基づく高さ情報が不正な点が減少している。さらに図21に示す例では、計測不能基準設定欄312で「中」を選択しており、さらに高さ情報が不正な点が減少している。   On the other hand, in the example shown in FIG. 20, “low” is selected in the non-measurable reference setting field 312 and the points where the height information based on the noise data is incorrect are reduced. Further, in the example shown in FIG. 21, “medium” is selected in the non-measurable reference setting field 312 and the points where the height information is incorrect are reduced.

その一方で、測定不能であることを示す黒点が特にワークの左下の領域で増大し、ノイズと見なされて高さ計測ができない位置が増えていることも、図21から確認できる。さらに、図22に示す例では、計測不能基準設定欄312で「高」を選択した状態を示しており、ノイズ成分の除去が効き過ぎている結果、本来残しておきたいデータまで失われていることが確認できる。このように、ノイズ除去の閾値を示す測定不能基準の設定が低すぎる場合は、ノイズを元に高さを計算することとなる。逆に高すぎると、本来残しておきたい箇所も無効と見なされてしまうことになる。このためユーザは、上記リアルタイム更新機能を利用することで、測定不能基準の設定を調整すると共に、調整後の画像を第二画像表示領域で確認し、設定の結果を直接画像で参照しながら、適切な値に調整することができる。
(均等間隔処理設定欄314)
On the other hand, it can also be confirmed from FIG. 21 that the black dots indicating that measurement is impossible increase especially in the lower left area of the workpiece, and the positions where height measurement cannot be performed due to noise are increased. Furthermore, the example shown in FIG. 22 shows a state in which “high” is selected in the non-measurable reference setting field 312, and as a result of the removal of the noise component being too effective, data that is originally desired to be lost is lost. I can confirm that. As described above, when the measurement impossible reference indicating the noise removal threshold is too low, the height is calculated based on the noise. On the other hand, if it is too high, the part that is originally desired to be left is regarded as invalid. For this reason, the user uses the real-time update function to adjust the measurement impossible standard setting, confirm the adjusted image in the second image display area, and refer to the setting result directly in the image. It can be adjusted to an appropriate value.
(Equal interval processing setting field 314)

均等間隔処理設定欄314では、画角による誤差の補正を行う。均等間隔処理設定欄314は、間隔均等化処理設定手段47として機能する。均等間隔処理設定欄314では、図23に示すようにONとOFFを選択できる。均等間隔処理をONとすることで、xy方向に等ピッチに並んだ距離画像を取得する。ここではXY方向の位置が高さ(Z座標)によらず等間隔な等ピッチ画像を、第二画像表示領域121に表示させる。例えば、XY平面における寸法の検査を行うような用途では、均等間隔処理をONとする必要がある。なお、補正されてデータが無くなった部分は無効として扱う。図24、図25は、均等間隔処理をONとした状態を示している。図24の例では、「表示画像」選択欄322を「高さ画像」すなわち距離画像として第二画像表示領域121に表示させた例を、図25は「濃淡画像」を選択して輝度画像を表示させた例を、それぞれ示している。   In the uniform interval processing setting field 314, an error due to the angle of view is corrected. The equal interval processing setting field 314 functions as the interval equalization processing setting means 47. In the uniform interval processing setting field 314, ON and OFF can be selected as shown in FIG. By turning on the equal interval processing, distance images arranged at equal pitches in the xy direction are acquired. Here, an equal pitch image whose positions in the XY directions are equally spaced regardless of the height (Z coordinate) is displayed in the second image display area 121. For example, in an application for inspecting dimensions in the XY plane, it is necessary to turn on the uniform interval processing. In addition, the portion where data is lost after correction is treated as invalid. 24 and 25 show a state in which the equal interval processing is turned on. In the example of FIG. 24, the “display image” selection field 322 is displayed in the second image display area 121 as a “height image”, that is, a distance image. FIG. Each displayed example is shown.

一方、均等間隔処理をOFFとすると、図26で示すように目で見たままの画像(Z画像)となり、画面の端部に進むに従ってXY方向に歪みが生じる。ただ、均等間隔処理を行わない分、画像の表示までに要する時間が短くて済む。なお図27は、表示画像欄で「濃淡画像」を選択して、第二画像表示領域121で輝度画像を表示させた例を示している。
(空間コード設定欄316)
On the other hand, when the uniform interval processing is turned off, an image as it is seen (Z image) is obtained as shown in FIG. However, since the equal interval processing is not performed, the time required to display the image can be shortened. FIG. 27 shows an example in which “grayscale image” is selected in the display image column and a luminance image is displayed in the second image display area 121.
(Space code setting field 316)

空間コード設定欄316では、空間コード化法の使用の有無を選択する。すなわち空間コード設定欄316は、空間コード化切替手段45として機能する。この三次元画像処理装置では、距離画像の生成に位相シフト法を必須としており、位相シフト法に加えて、空間コード化法の適用の有無を空間コード設定欄316で選択できる。空間コード設定欄316では、図28に示すようにONとOFFを選択できる。空間コード設定欄316をONとすると、空間コード化法と位相シフト法の組み合わせで高さ計測を行う。この例を図29、図30に示す。これらの図において、図29は第二画像表示領域121に表示させる画像として距離画像を選択した状態を示している。具体的には、「表示画像」選択欄322で「高さ画像」を選択している。一方図30は第二画像表示領域121に輝度画像を表示させた状態を示しており、「表示画像」選択欄322で「濃淡画像」を選択している。位相シフト法に加えて、空間コード化法を用いることで、適切な距離画像を取得することができる。具体的には、空間コード化法によって、位相シフト法による位相ジャンプの補正(位相アンラップ)ができるので、高さのダイナミックレンジを広く確保しつつ、高分解能で計測できる。ただし、撮像時間はOFFの場合と比較して約2倍となる。   In the space code setting field 316, whether or not the space coding method is used is selected. That is, the space code setting field 316 functions as the space coding switching means 45. In this three-dimensional image processing apparatus, the phase shift method is indispensable for the generation of the distance image, and in addition to the phase shift method, whether or not the spatial encoding method is applied can be selected in the spatial code setting field 316. In the space code setting field 316, ON and OFF can be selected as shown in FIG. When the space code setting field 316 is set to ON, height measurement is performed by a combination of the space coding method and the phase shift method. This example is shown in FIGS. In these drawings, FIG. 29 shows a state in which a distance image is selected as an image to be displayed in the second image display area 121. Specifically, “height image” is selected in the “display image” selection field 322. On the other hand, FIG. 30 shows a state in which a luminance image is displayed in the second image display area 121, and “grayscale image” is selected in the “display image” selection field 322. By using the spatial encoding method in addition to the phase shift method, an appropriate distance image can be acquired. Specifically, phase jump correction (phase unwrapping) by the phase shift method can be performed by the spatial encoding method, so that measurement can be performed with high resolution while ensuring a wide dynamic range. However, the imaging time is about twice as long as when the imaging time is OFF.

一方、図31、図32に示すように、空間コード設定欄316でOFFを選択すると、位相シフト法のみで高さ計測を行う。この場合は、高さの計測ダイナミックレンジが狭くなるので、高さの相違が大きいワークの場合は、位相が1周期以上ずれてしまうと、正しく高さの計測ができない。逆に、高さの変化が少ないワークの場合は、空間コード化法による縞画像の撮像や合成を行わないので、その分だけ処理を高速化でき、撮像時間を約半分にできるメリットがある。例えば、高さ方向の差異が少ないワークを計測する際には、ダイナミックレンジを大きく取る必要がないため、位相シフト法のみでも高精度な高さ計測性能を維持しつつ、処理時間を短くすることができる。この場合は、高さの計測ダイナミックレンジが狭くなるので、高さの相違が大きいワークの場合は、位相が1周期以上ずれてしまうと、正しく高さの計測ができない。逆に、高さの変化が少ないワークの場合は、空間コードをOFFとすることで、撮像時間を半分にできるという利点が得られる。   On the other hand, as shown in FIGS. 31 and 32, when OFF is selected in the space code setting field 316, the height is measured only by the phase shift method. In this case, since the height measurement dynamic range is narrowed, in the case of a workpiece having a large difference in height, if the phase is shifted by one cycle or more, the height cannot be measured correctly. On the contrary, in the case of a work whose change in height is small, since the striped image is not captured or synthesized by the spatial coding method, the processing can be speeded up by that amount, and there is an advantage that the imaging time can be reduced to about half. For example, when measuring workpieces with small differences in height direction, it is not necessary to increase the dynamic range, so the processing time can be shortened while maintaining high-precision height measurement performance using only the phase shift method. Can do. In this case, since the height measurement dynamic range is narrowed, in the case of a workpiece having a large difference in height, if the phase is shifted by one cycle or more, the height cannot be measured correctly. On the other hand, in the case of a work with little change in height, the advantage that the imaging time can be halved by turning the space code OFF can be obtained.

図31の例では、「表示画像」選択欄322で「高さ画像」すなわち距離画像を表示させた状態を示しており、一方図32の例では、「表示画像」選択欄322で「濃淡画像」を表示させた状態を示している。   In the example of FIG. 31, the “display image” selection field 322 shows a state in which the “height image”, that is, the distance image is displayed, while in the example of FIG. 32, the “display image” selection field 322 displays the “grayscale image”. "Is displayed.

なお、この例では位相シフト法を必須としているが、位相シフト法のON/OFFを選択可能としてもよい。
(プロジェクタ選択設定欄318)
In this example, the phase shift method is essential, but ON / OFF of the phase shift method may be selectable.
(Projector selection setting field 318)

プロジェクタ選択設定欄318は、第一プロジェクタと第二プロジェクタのON/OFFを切り替える投光切替手段48として機能する。ここでは、プロジェクタ選択設定欄318では、2つの投光手段である第一プロジェクタ、第二プロジェクタの内から、使用する投光手段(プロジェクタ)を選択する。このプロジェクタ選択設定欄318の例では、図33に示すように、ドロップダウンボックスから、「1」(第一プロジェクタ)、「2」(第二プロジェクタ)、「1+2」(第一プロジェクタと第二プロジェクタ)のいずれかを選択する。   The projector selection setting field 318 functions as a light projection switching unit 48 that switches ON / OFF of the first projector and the second projector. Here, in the projector selection setting field 318, the light projection means (projector) to be used is selected from the first projector and the second projector which are two light projection means. In the example of the projector selection setting field 318, as shown in FIG. 33, “1” (first projector), “2” (second projector), “1 + 2” (first projector and second projector) are selected from the drop-down box. Select one of the projectors.

プロジェクタ選択設定欄318で「1」又は「2」を選択した場合、すなわち第一プロジェクタ又は第二プロジェクタのいずれか一方からの投光である片投光の場合は、投光で陰になる部分の高さ計測は行われない。図34の例では、プロジェクタ選択設定欄318で「1」を選択した例、図35の例では「2」を選択した例を、それぞれ示している。各画面において、影になる部分のデータが黒色で表示されており、ワーク上で高さの計測ができない領域が存在することが、それぞれの画面から確認できる。また、これらの図から明らかな通り、計測不能となる領域は、投光手段によって異なることが判る。いいかえると、一方の投光手段では測定不能領域となっても、他方の投光手段では投光が可能となり、よって高さ計測も可能な領域が多く存在する。そこで、これらを組み合わせることで、測定不能領域を低減できる。特に、第一プロジェクタと第二プロジェクタで、ワークを両側から挟み込むように配置することで、第一プロジェクタからの第一投光と第二プロジェクタからの第二投光とが相対する方向となってワークに照射されるため、いずれか一方の投光では影となる領域であっても、真逆の方向となる他方からの投光によって影となるリスクを低減できる。   When “1” or “2” is selected in the projector selection setting field 318, that is, in the case of one-side projection that is projection from either the first projector or the second projector, the portion that is shaded by projection No height measurement is performed. The example in FIG. 34 shows an example in which “1” is selected in the projector selection setting field 318, and the example in which “2” is selected in the example in FIG. In each screen, the shadow data is displayed in black, and it can be confirmed from each screen that there is an area where the height cannot be measured on the workpiece. Further, as is clear from these figures, it can be seen that the area where measurement is impossible depends on the light projecting means. In other words, even if one of the light projecting means becomes an unmeasurable area, the other light projecting means can project light, and thus there are many areas where height measurement is possible. Therefore, by combining these, the non-measurable area can be reduced. In particular, the first projector and the second projector are arranged so that the workpiece is sandwiched from both sides, so that the first projection from the first projector and the second projection from the second projector are opposed to each other. Since the work is irradiated, even if it is an area that is shaded by any one of the projections, the risk of being shaded by the projection from the other in the opposite direction can be reduced.

具体的には、図36に示すように、プロジェクタ選択設定欄318で「1+2」を選択すると、第一プロジェクタ及び第二プロジェクタの両方から投光させる両投光に切り替えられる。この状態で、いずれか一方のプロジェクタからの投光では陰になる部分であっても、他方のプロジェクタで投光可能であれば、これを補間することができる。ただしこの場合は、片投光に比べて約2倍の撮像時間を要する。ユーザは、検査対象のワークの凹凸の加減や、許容される撮像時間等に応じて、いずれの投光を用いるかを選択する。
(「表示画像」選択欄322)
Specifically, as shown in FIG. 36, when “1 + 2” is selected in the projector selection setting field 318, the projector is switched to both projections in which light is projected from both the first projector and the second projector. In this state, even a portion that is shaded by light projection from one of the projectors can be interpolated if it can be projected by the other projector. However, in this case, an imaging time that is about twice as long as that of single projection is required. The user selects which projection is to be used according to the unevenness of the workpiece to be inspected and the allowable imaging time.
("Display image" selection field 322)

「表示画像」選択欄322では、第二画像表示領域121に表示される画像を選択する。例えば、検査の用途に応じて表示対象を選択することで、各設定の妥当性を実際に表示された画像から視覚的に確認することができる。特に、上述したリアルタイム更新手段をONとすることで、設定の変更を逐次更新して変化の前後で対比できるので、用途に即して意図した画像となるよう、イメージに基づいて設定を調整できる。また各設定パラメータの意味に習熟していない初心者であっても、画像を見ながら設定できる利点も得られる。この例では、図37に示すように「表示画像」選択欄322から、「高さ画像」、「濃淡画像」、「白とび・黒つぶれ画像」、「縞投光−プロジェクタ1」、「縞投光−プロジェクタ2」のいずれかを選択する。「高さ画像」は距離画像であり、高さ毎に等高線状に色分けして着色した画像を表示する。「濃淡画像」は輝度画像である。この例では、位相シフト法に基づいて撮像した複数のパターン投影画像を合成した画像を、輝度画像として利用している。ただ、ワークに照明を照射して撮像手段で光学的な画像を撮像し、輝度画像として利用することもできる。
(異常点ハイライト手段62)
In the “display image” selection field 322, an image displayed in the second image display area 121 is selected. For example, the validity of each setting can be visually confirmed from the actually displayed image by selecting the display target according to the purpose of the inspection. In particular, by turning on the real-time updating means described above, it is possible to sequentially update changes in settings and compare them before and after the changes, so that the settings can be adjusted based on the image so that the intended image is adapted to the application. . In addition, even a beginner who is not familiar with the meaning of each setting parameter can obtain the advantage of setting while viewing the image. In this example, as shown in FIG. 37, from the “display image” selection field 322, “height image”, “grayscale image”, “whiteout / blackout image”, “stripe projection-projector 1”, “striping”. One of “projection-projector 2” is selected. The “height image” is a distance image, and displays an image colored in a contour line for each height. A “grayscale image” is a luminance image. In this example, an image obtained by combining a plurality of pattern projection images captured based on the phase shift method is used as a luminance image. However, it is also possible to illuminate the work and take an optical image with the imaging means and use it as a luminance image.
(Abnormal point highlighting means 62)

さらに三次元画像処理装置は、図5に示すように異常点ハイライト手段62を備えている。例えば上述した「表示画像」選択欄322で選択可能な「白とび・黒つぶれ画像」は、輝度画像に対して、飽和して白とびした画素や光量が不足した黒つぶれ画素等を部分的に着色した画像である。このように、画像中で正確な値が得られていない、測定精度の信頼性が低いと思われる部位を、着色処理によってハイライトさせることで、ユーザに対して測定精度の低い部分を視覚的に告知し、所望の検査用途に応じた画像が得られているかどうかを確認しやすくしている。この例では、白とび画素を黄色、黒つぶれ画素を青色に、それぞれ着色している。これによりユーザは、色を手掛かりにして白つぶれした領域が画像中でどのように分布しているかを目視により確認できる。また第二画像表示領域121の下部には、白とび画素及び黒つぶれ画素の画素数をカウントして表示させている。これを参照しながら、これらの画素数が0に近づくよう、ユーザは各設定項目を調整する。   Further, the three-dimensional image processing apparatus includes abnormal point highlighting means 62 as shown in FIG. For example, the “whiteout / blackout image” that can be selected in the “display image” selection field 322 described above partially includes pixels that are saturated and overexposed, blackout pixels that are insufficient in light quantity, and the like with respect to the luminance image. It is a colored image. In this way, by highlighting the parts that are not accurate in the image and are considered to have low measurement accuracy, the part with low measurement accuracy is visually displayed to the user. To make it easier to confirm whether an image corresponding to the desired inspection application is obtained. In this example, the whiteout pixels are colored yellow and the blackout pixels are colored blue. As a result, the user can visually confirm how the whitened areas are distributed in the image with the color as a clue. In the lower part of the second image display area 121, the number of overexposed pixels and underexposed pixels is counted and displayed. With reference to this, the user adjusts each setting item so that the number of pixels approaches zero.

なお着色される色や態様はこれに限られず、他の色で表示させたり、点滅表示させる等、既知の様々な態様を適宜利用できる。また、白とび画素と黒つぶれ画素で着色する色を変更することで、測定の信頼性が低くなっている理由をユーザに対して告知でき、よって対応策も講じやすくなる。ただ、白とび画素と黒つぶれ画素に対して同様の色やハイライトを施してもよい。   In addition, the color and aspect to be colored are not limited to this, and various known aspects such as displaying with other colors or blinking can be used as appropriate. In addition, by changing the color to be colored by the overexposed pixels and the underexposed pixels, it is possible to notify the user of the reason why the measurement reliability is low, and it is easy to take countermeasures. However, the same color or highlight may be applied to the whiteout pixel and the blackout pixel.

「縞投光−プロジェクタ1」は、第一プロジェクタのみでパターン投影して得られる濃淡で表現されたパターン投影画像である。また「縞投光−プロジェクタ2」は、第二プロジェクタのみで得られるパターン投影画像である。図38に、「表示画像」選択欄322で「縞投光−プロジェクタ1」を選択して、第二画像表示領域121に第一プロジェクタのパターン投影画像を表示させた例、図39に、「縞投光−プロジェクタ2」を選択して、第二画像表示領域121に第二プロジェクタのパターン投影画像を表示させた例を、それぞれ示す。この画面から縞画像を確認することにより、ワークの高さが計測できない場合の原因の特定、例えばワークの材質が半透明であるため、投光した光が潜り込んでいる等、パターン投影を得ることが困難なワークであることが、距離画像を生成する前の元のパターン投影画像から確認できる。   “Flying light projection—projector 1” is a pattern projection image expressed by shading obtained by pattern projection only by the first projector. “Flying light projection—projector 2” is a pattern projection image obtained only by the second projector. FIG. 38 shows an example in which “striped light projection—projector 1” is selected in the “display image” selection field 322, and the pattern projection image of the first projector is displayed in the second image display area 121. FIG. An example in which the pattern projection image of the second projector is displayed in the second image display area 121 by selecting the “stripe projection-projector 2” is shown. By checking the fringe image from this screen, it is possible to identify the cause when the workpiece height cannot be measured, for example, because the workpiece material is translucent, the projected light is embedded, etc. It can be confirmed from the original pattern projection image before the distance image is generated that the work is difficult.

ユーザは、第二画像表示領域121に表示される画像を参照しながら、シャッタスピードと濃淡レンジが適切かをどうかを確認し、適切な値に調整する。具体的には、第二画像表示領域121に白とび・黒つぶれ画像を表示させた状態で、白とび画素や黒つぶれ画素が少なくなるように確認しながら調整する。例えば、シャッタースピード設定欄294でシャッタースピードを調整することによって、黒つぶれ画素、すなわち光量が足りず暗すぎる部位がなくなるようにする。また濃淡レンジを調整することで、白とび画素、すなわち明るすぎる部位がなくなるようにする。図16の例では、白とび・黒つぶれ画像中に、暗すぎるので黒つぶれ画素が多い。このため、シャッタースピードの調整を行う。   The user confirms whether the shutter speed and the light / dark range are appropriate while referring to the image displayed in the second image display area 121, and adjusts it to an appropriate value. Specifically, the adjustment is performed while confirming that the overexposed and underexposed pixels are reduced in the state where the overexposed and underexposed images are displayed in the second image display area 121. For example, by adjusting the shutter speed in the shutter speed setting field 294, blackout pixels, that is, portions that are too dark due to insufficient light quantity are eliminated. Further, by adjusting the density range, there are no overexposed pixels, that is, parts that are too bright. In the example of FIG. 16, there are many blacked out pixels in the overexposed / blackout image because it is too dark. Therefore, the shutter speed is adjusted.

例えばシャッタースピード設定欄294を「1/120」に設定した図16の状態から、図40に示すように「1/15」に切り替えると、輝度画像が多少明るくなり、黒つぶれ画素数が0になったことが判る。ただし、白とび画素数は逆に増えてしまっている。そこで図41に示すようにシャッタースピードを「1/30」に切り替えると、黒つぶれ画素数が0のまま、白とび画素数も減少していることが判る。   For example, when the shutter speed setting field 294 is set to “1/120” and switched to “1/15” as shown in FIG. 40, the luminance image becomes slightly brighter and the number of blackout pixels becomes 0. It turns out that it became. However, the number of overexposed pixels has increased. Thus, as shown in FIG. 41, when the shutter speed is switched to “1/30”, it can be seen that the number of blackout pixels remains 0 and the number of overexposed pixels decreases.

さらに濃淡レンジ設定欄296を「低い(−1)」に設定した図41の状態から、図42に示すように「普通(0)」に切り替えて一段階上げると、白とび画素が減少したことが判る。さらに図43に示すように「高い(1)」に切り替えると、白とび画素が0になったことが判る。これによって白とび画素数、黒つぶれ画素数が共に0となって、シャッタースピードと濃淡レンジの調整作業を終了する。   Furthermore, when the density range setting field 296 is set to “low (−1)” and switched to “normal (0)” by one step as shown in FIG. 42, the overexposed pixels are reduced. I understand. Further, as shown in FIG. 43, when switching to “high (1)”, it is understood that the overexposed pixel has become zero. As a result, both the number of overexposed pixels and the number of underexposed pixels become 0, and the adjustment operation of the shutter speed and the light / dark range is completed.

以上のようにして、所望の撮像条件に設定した後、上述した図12〜図13に示すように、距離画像と輝度画像の登録を行い、画像登録作業を終了する。
(高さ計測設定手順)
After setting the desired imaging conditions as described above, the distance image and the luminance image are registered as shown in FIGS. 12 to 13 described above, and the image registration operation is completed.
(Height measurement setting procedure)

次に、運用時に逐次入力される検査対象のワークの入力画像に対して、高さ計測を行う領域を設定する手順について、図44〜図55に基づいて説明する。ここでは、入力される複数のワークを代表する典型的なワークを、上述した手順によって予め登録画像として登録しておき、この登録画像に対して、高さ計測を行う領域を指定する。   Next, a procedure for setting an area for height measurement for an input image of a workpiece to be inspected that is sequentially input during operation will be described with reference to FIGS. 44 to 55. Here, a typical workpiece representing a plurality of workpieces to be input is registered in advance as a registered image by the above-described procedure, and an area for height measurement is designated for the registered image.

具体的には、図9の初期画面260から、図44〜図45に示すように「高さ計測」処理ユニット266の追加を行う。図44の例では、フロー表示領域261において「撮像」処理ユニット263の下部に、右クリック等で表示される第一サブメニュー370から「追加」を選択し、第二サブメニュー372中の「計測」を選択して表示される「計測」メニュー373でリストされる検査処理の内、「高さ計測」を行う「高さ計測」処理ユニット266を追加する。これによって、図45に示すように、フロー表示領域261において「撮像」処理ユニット263の下部に、新たに「高さ計測」処理ユニット266が追加される。このように、「計測」メニュー373は検査実行手段で実行される検査処理を選択するための検査処理選択手段として機能する。
(検査対象領域設定画面120)
Specifically, the “height measurement” processing unit 266 is added from the initial screen 260 of FIG. 9 as shown in FIGS. 44 to 45. In the example of FIG. 44, “Add” is selected from the first submenu 370 displayed by right-clicking or the like at the bottom of the “imaging” processing unit 263 in the flow display area 261, and “Measurement” in the second submenu 372 is selected. The “height measurement” processing unit 266 for performing “height measurement” is added from the inspection processes listed in the “measurement” menu 373 displayed by selecting “”. As a result, a “height measurement” processing unit 266 is newly added below the “imaging” processing unit 263 in the flow display area 261 as shown in FIG. In this way, the “measurement” menu 373 functions as an inspection process selection unit for selecting an inspection process to be executed by the inspection execution unit.
(Inspection area setting screen 120)

次に、「高さ計測」処理ユニット266で行うべき設定として、領域を設定する手順について、図46〜図49に基づいて説明する。まず図45の画面から、「高さ計測」処理ユニットの編集画面を呼び出すと、図46に示す高さ計測設定画面460に移行する。図46のGUI画面例でも、図10と同様、画面の右側に画像を表示させる第一画像表示領域111を設け、左側には設定項目ボタンを複数配置した設定項目ボタン領域112が設けられる。設定項目ボタン領域112には、「画像登録」ボタン113、「画像設定」ボタン114、「領域設定」ボタン115、「前処理」ボタン117、「検出条件」ボタン118、「詳細設定」ボタン119、「判定条件」ボタン、「表示設定」ボタン、「保存」ボタン等が設けられている。この画面から、ユーザは検査対象領域設定手段に相当する「領域設定」ボタン115を押下すると、図47に示す検査対象領域設定画面120に遷移する。検査対象領域設定画面120においては、検査を行う領域を指定することができる。図47の例では、画面の左に第二画像表示領域121を設け、画面の右側に各種の操作を行う操作領域122を配置している。操作領域122の上段には、第二画像表示領域121で表示される画像を選択するための「表示画像」選択欄124が設けられる。図47の例では、「表示画像」選択欄124で登録画像が選択されている。さらにその下方には、検査を実行する領域を指定する検査対象領域設定手段として、「計測領域」設定欄126が設けられている。   Next, a procedure for setting an area as a setting to be performed by the “height measurement” processing unit 266 will be described with reference to FIGS. 46 to 49. First, when the edit screen of the “height measurement” processing unit is called from the screen of FIG. 45, the screen shifts to the height measurement setting screen 460 shown in FIG. Also in the GUI screen example of FIG. 46, as in FIG. 10, a first image display area 111 for displaying an image is provided on the right side of the screen, and a setting item button area 112 in which a plurality of setting item buttons are arranged is provided on the left side. The setting item button area 112 includes an “image registration” button 113, an “image setting” button 114, an “area setting” button 115, a “preprocessing” button 117, a “detection condition” button 118, a “detailed setting” button 119, A “judgment condition” button, a “display setting” button, a “save” button, and the like are provided. From this screen, when the user presses an “area setting” button 115 corresponding to the inspection area setting means, the screen changes to an inspection area setting screen 120 shown in FIG. On the inspection target area setting screen 120, an area to be inspected can be designated. In the example of FIG. 47, the second image display area 121 is provided on the left side of the screen, and the operation area 122 for performing various operations is arranged on the right side of the screen. In the upper part of the operation area 122, a “display image” selection column 124 for selecting an image displayed in the second image display area 121 is provided. In the example of FIG. 47, the registered image is selected in the “display image” selection field 124. Further below that, a “measurement area” setting field 126 is provided as an inspection object area setting means for designating an area to be inspected.

「計測領域」設定欄126では、予め規定された領域を選択できる。ここでは、「計測領域」設定欄126を選択すると、図48に示すようにドロップダウンボックスが表示され、所望の計測領域の形状を選択できる。この例では、選択可能な計測領域の形状の候補として、「なし」、「矩形」、「回転矩形」、「円」、「楕円」、「円周」、「円弧」、「多角形」、「複合領域」等が表示される。なお「なし」を選択すると、第二画像表示領域121に表示される画像の全体を検査対象領域として利用する。   In the “measurement area” setting field 126, a predetermined area can be selected. Here, when the “measurement area” setting field 126 is selected, a drop-down box is displayed as shown in FIG. 48, and a desired measurement area shape can be selected. In this example, “None”, “Rectangle”, “Rotating Rectangle”, “Circle”, “Oval”, “Circle”, “Arc”, “Polygon”, “Composite area” or the like is displayed. If “None” is selected, the entire image displayed in the second image display area 121 is used as the inspection target area.

さらに、「計測領域」設定欄126において選択された形状に応じて、詳細な寸法等の設定が可能となる。図48の例では、ワークに消しゴムを用いており、また「計測領域」設定欄126においては、図49に示すように「回転矩形」を選択した例を示している。この状態で「編集」ボタン128を押下すると、図50に示す計測領域編集画面130が表示される。図50の例では、第二画像表示領域121において、回転矩形がワーク上に重ねて表示される。ここでは消しゴムのケースの部分に、矩形状の計測領域が描かれて、距離画像上に重ねて表示される。また回転矩形の基本ベクトルが回転矩形の枠状内に矢印で表示されると共に、計測領域編集画面130の画面で、回転矩形の幅、高さと、中心のXY座標、基本ベクトルの傾斜角度等が表示される。ユーザは計測領域編集画面130上から数値を直接入力するか、あるいは回転矩形に表示されたハンドルをマウス等で操作して、回転矩形の形状や位置等を任意に調整できる。   Furthermore, detailed dimensions and the like can be set according to the shape selected in the “measurement area” setting field 126. In the example of FIG. 48, an eraser is used for the workpiece, and the “measurement area” setting field 126 shows an example in which “rotation rectangle” is selected as shown in FIG. When the “edit” button 128 is pressed in this state, a measurement area edit screen 130 shown in FIG. 50 is displayed. In the example of FIG. 50, in the second image display area 121, the rotation rectangle is displayed so as to overlap the work. Here, a rectangular measurement region is drawn on the eraser case, and is displayed overlaid on the distance image. In addition, the basic vector of the rotation rectangle is displayed as an arrow in the frame shape of the rotation rectangle, and the width and height of the rotation rectangle, the XY coordinates of the center, the inclination angle of the basic vector, etc. are displayed on the measurement area editing screen 130. Is displayed. The user can directly adjust the shape, position, etc. of the rotation rectangle by directly inputting a numerical value from the measurement area editing screen 130 or operating the handle displayed on the rotation rectangle with a mouse or the like.

なお計測領域編集画面130において設定可能な項目は、「計測領域」設定欄126において選択された形状に応じて変化する。例えば、「円周」を選択した場合は、図51に示すように、円周の外径や内径の寸法の指定等、円周に関するパラメータの設定が可能となる。さらに、図47の画面から、マスク領域を指定することも可能である。マスク領域としては、円形やドーナツ状、矩形状その他の多角形状、自由曲線等が指定できる。このようにして、検査対象のワークの形状に応じて、適切に検査対象領域を設定し、穴あき部分や背景等、検査に無用な領域を排除して、処理の効率化を図ることができる。
(第二計測表示領域)
Items that can be set on the measurement area editing screen 130 change according to the shape selected in the “measurement area” setting field 126. For example, when “circumference” is selected, parameters relating to the circumference, such as designation of the outer diameter and inner diameter of the circumference, can be set as shown in FIG. Furthermore, it is possible to designate a mask area from the screen of FIG. As the mask region, a circular shape, a donut shape, a rectangular shape, other polygonal shapes, a free curve, or the like can be designated. In this way, it is possible to appropriately set the inspection target area according to the shape of the workpiece to be inspected, and to eliminate the areas unnecessary for inspection such as the perforated portion and the background, thereby improving the processing efficiency. .
(Second measurement display area)

このようにして計測領域が設定されると、図49に示すようにワーク上に設定済みの計測領域が重ねて表示される。続いて、他の計測領域を指定する場合は、同様の作業を繰り返す。すなわち、図52に示すように、フロー表示領域261において「高さ計測」処理ユニット266の下部に、さらに別の第二「高さ計測」処理ユニット266Bを追加する。そして図53、図54に示すように、新たな計測領域として回転矩形を、ここではワークである消しゴムの、ケースで覆われていない領域上に設定している。この結果、図55に示すように、新たに設定された第二計測領域がワーク上に重ねて表示される。   When the measurement area is set in this way, the set measurement area is displayed over the workpiece as shown in FIG. Subsequently, the same operation is repeated when another measurement region is designated. That is, as shown in FIG. 52, another second “height measurement” processing unit 266B is added below the “height measurement” processing unit 266 in the flow display area 261. As shown in FIGS. 53 and 54, a rotation rectangle is set as a new measurement area on an area of the eraser which is a work, which is not covered with a case. As a result, as shown in FIG. 55, the newly set second measurement area is displayed over the workpiece.

なお、上記の例では、一の「高さ計測」処理ユニットで一の高さ計測処理が行われる。すなわち、複数の高さ計測処理を行うには、複数の「高さ計測」処理ユニットをそれぞれ追加する必要がある。ただ、一の「高さ計測」処理ユニットにおいて複数の高さ計測処理が行われるように構成することも可能であることはいうまでもない。
(計測処理)
In the above example, one “height measurement” processing unit performs one height measurement process. That is, in order to perform a plurality of height measurement processes, it is necessary to add a plurality of “height measurement” processing units. However, it is needless to say that a plurality of height measurement processes can be performed in one “height measurement” processing unit.
(Measurement process)

このようにして計測領域の設定が終了すると、次に実際に計測を行う処理を追加する。ここでは、図56に示すように、フロー表示領域261において第二「高さ計測」処理ユニット266Bの下部に、「演算」を行う「数値演算」処理ユニットを追加する。「数値演算」処理ユニットで実行される演算の内容として、数値演算や画像演算、キャリブレーション、画像連結等が選択できる。ここでは、図57に示すように数値演算を選択した「数値演算」処理ユニットを追加している。
(「数値演算」処理ユニット)
When the setting of the measurement area is completed in this way, a process for actually performing measurement is added next. Here, as shown in FIG. 56, a “numerical calculation” processing unit for performing “calculation” is added below the second “height measurement” processing unit 266B in the flow display area 261. As the contents of the calculation executed by the “numerical calculation” processing unit, numerical calculation, image calculation, calibration, image connection, and the like can be selected. Here, as shown in FIG. 57, a “numerical calculation” processing unit in which numerical calculation is selected is added.
("Numerical operation" processing unit)

「数値演算」処理ユニットにおいては、具体的な演算式を入力することができる。例えば図58に示すように、数式を直接入力可能な数値演算編集画面を表示させ、ユーザが演算式を規定する。ここでは、電卓状の入力パッドを用意し、またコピーや切り取り、貼り付け等の編集ボタンも用意して、演算式の作成を容易にしている。ユーザはこの画面から、所望の演算式を入力する。入力された演算式の例を、図59に示す。   In the “numerical operation” processing unit, a specific arithmetic expression can be input. For example, as shown in FIG. 58, a numerical calculation editing screen in which a mathematical expression can be directly input is displayed, and the user defines the mathematical expression. Here, a calculator-like input pad is prepared, and editing buttons such as copy, cut, and paste are also prepared to make it easy to create an arithmetic expression. The user inputs a desired arithmetic expression from this screen. An example of the input arithmetic expression is shown in FIG.

このようにして数値演算処理の内容が規定されると、図60に示すように初期画面260において、第三画像表示領域262上に演算式が表示される。
(「エリア」処理ユニット)
When the contents of the numerical calculation processing are defined in this way, an arithmetic expression is displayed on the third image display area 262 on the initial screen 260 as shown in FIG.
("Area" processing unit)

さらにまた、図61の例では「数値演算」処理ユニットの下に、「エリア」処理ユニットを追加している。「エリア」処理ユニットでは、実際に合否判定等を行う条件を規定する。具体的には、登録画像や入力画像に応じて、距離画像を低階調距離画像に階調変換するための階調変換条件を適切に変化させるべく、階調変換パラメータ(詳細は後述)の基準となる情報を取得するための領域や、この領域から高さを抽出する条件、あるいは距離画像を生成する際に、フィルタ処理を行う条件等を設定する。すなわち、「エリア」処理ユニットでは、領域設定、高さ抽出、前処理、判定等を設定する。まず、領域設定を行う手順については、上述した登録画像と同様である。すなわち、図62に示すようなエリア設定画面620から、設定項目ボタン領域112に配置された「領域設定」ボタン115を押下すると、図63に示す領域設定画面となり、対象となる領域を指定する。ここでも回転矩形を選択し、さらに詳細な座標等を必要に応じて指定する。このようにして、「エリア」処理ユニットにおける領域が決定され、図64に示すように第二画像表示領域において回転矩形がワーク上に重ねて表示される。
(高さ抽出設定画面)
Furthermore, in the example of FIG. 61, an “area” processing unit is added below the “numerical calculation” processing unit. In the “area” processing unit, conditions for actually performing pass / fail determinations and the like are defined. Specifically, in accordance with a registered image or an input image, a gradation conversion parameter (details will be described later) is used to appropriately change the gradation conversion condition for converting the distance image into a low gradation distance image. A region for acquiring reference information, a condition for extracting height from this region, a condition for performing filter processing when generating a distance image, and the like are set. That is, in the “area” processing unit, region setting, height extraction, preprocessing, determination, and the like are set. First, the region setting procedure is the same as that of the registered image described above. That is, when the “area setting” button 115 arranged in the setting item button area 112 is pressed from the area setting screen 620 as shown in FIG. 62, the area setting screen shown in FIG. 63 is displayed, and the target area is designated. Again, the rotation rectangle is selected, and more detailed coordinates and the like are designated as necessary. In this manner, the area in the “area” processing unit is determined, and the rotation rectangle is displayed on the work in the second image display area as shown in FIG.
(Height extraction setting screen)

次に高さ抽出の設定を行う。高さ抽出の設定とは、階調変換を行う際の階調変換パラメータを設定することである。すなわち図62の設定項目ボタン領域112中から、「高さ抽出」ボタン116を押下すると、図65に示す高さ抽出選択画面140に移行し、表示画像や抽出方法等が選択可能となる。高さ抽出選択画面140でも、図47等と同様、画面の左に第二画像表示領域121を設け、画面の右側に各種の操作を行う操作領域122を配置している。操作領域122の上段には、第二画像表示領域121で表示される画像を選択するための「表示画像」選択欄124が設けられる。図65の例では、「表示画像」選択欄124で登録画像が選択されている。さらにその下方には、高さ抽出機能の抽出方法を選択する抽出方法選択手段142が設けられる。   Next, set the height extraction. The setting of height extraction is to set a gradation conversion parameter when performing gradation conversion. That is, when the “height extraction” button 116 is pressed from the setting item button area 112 in FIG. 62, the screen moves to a height extraction selection screen 140 shown in FIG. 65, and a display image, an extraction method, and the like can be selected. In the height extraction selection screen 140, as in FIG. 47 and the like, a second image display area 121 is provided on the left side of the screen, and an operation area 122 for performing various operations is arranged on the right side of the screen. In the upper part of the operation area 122, a “display image” selection column 124 for selecting an image displayed in the second image display area 121 is provided. In the example of FIG. 65, the registered image is selected in the “display image” selection field 124. Further below, an extraction method selection means 142 for selecting an extraction method of the height extraction function is provided.

ここで「高さ抽出」ボタン116は、階調変換手段により距離画像の階調変換を行うための階調変換パラメータを設定する階調変換条件設定手段43として機能する。特に階調変換条件設定手段43は、画像の高さ情報を必要としない処理を、検査処理選択手段で選択した場合に表示される。逆に、画像の高さ情報を必要とする処理を検査処理選択手段で選択した場合は、この階調変換条件設定手段を表示させない。具体的には、検査処理ツールとして「高さ計測」処理ユニット266を選択した場合は、フロー表示領域261に「高さ抽出」ボタンが表示されない。これ以外の検査処理ツール、例えば「エリア」処理ユニットや「ブロブ」処理ユニット267、「色検査」処理ユニット267B、「Shapetrax2」処理ユニット264、「位置補正」処理ユニット265等に関しては、「高さ抽出」ボタン116が表示され、階調変換条件を設定可能としている。このようにすることで、階調変換が必要な場合には階調変換条件設定手段43を表示させて、ユーザに必要な設定を促す一方、階調変換が不要な場合は、階調変換の条件を設定する手段そのものを非表示として、ユーザが不要な設定で混乱することを回避し、使い勝手のよい環境が実現される。
(抽出方法選択手段142)
Here, the “height extraction” button 116 functions as a gradation conversion condition setting unit 43 that sets gradation conversion parameters for performing gradation conversion of the distance image by the gradation conversion unit. In particular, the gradation conversion condition setting unit 43 is displayed when a process that does not require image height information is selected by the inspection process selection unit. On the other hand, when a process that requires image height information is selected by the inspection process selection unit, the gradation conversion condition setting unit is not displayed. Specifically, when the “height measurement” processing unit 266 is selected as the inspection processing tool, the “height extraction” button is not displayed in the flow display area 261. For other inspection processing tools such as the “area” processing unit, the “blob” processing unit 267, the “color inspection” processing unit 267B, the “Shapetrax2” processing unit 264, the “position correction” processing unit 265, etc. An “Extract” button 116 is displayed, and gradation conversion conditions can be set. In this way, when gradation conversion is necessary, the gradation conversion condition setting means 43 is displayed to prompt the user to make necessary settings. By not displaying the condition setting unit itself, the user is prevented from being confused by unnecessary settings, and an easy-to-use environment is realized.
(Extraction method selection means 142)

抽出方法選択手段142では、階調変換方法を指定する。例えば静的変換又は動的変換のいずれかをユーザに選択させる。図65の例では、予め選択肢として、静的変換に該当する「一点指定」又は「三点指定(平面)」、動的変換に該当する「リアルタイム抽出」のいずれかを、ドロップダウンボックスから選択させる。
(一点指定画面150)
The extraction method selection unit 142 designates a gradation conversion method. For example, the user selects either static conversion or dynamic conversion. In the example of FIG. 65, as a choice, either “single point designation” or “three point designation (plane)” corresponding to static conversion or “real time extraction” corresponding to dynamic conversion is selected from a drop-down box. Let
(One point designation screen 150)

図65の画面で、抽出方法選択手段142から「一点指定」を選択すると、図66の一点指定画面150に移行する。なお、図66〜図96においては、説明のためワークとして50円玉を用いた例を示している。図66の一点指定画面150では、第二画像表示領域121上で指定した部位の高さを基準の高さ(基準高さ)として設定する。図66の例では、画面右の操作領域122中に設けられた「抽出」ボタン144を選択すると、図67に示す画面となり、画面左の第二画像表示領域121上の任意の位置を指定できるようになる。ここでは、高さ抽出手段を用いて、第二画像表示領域121に表示されたワーク中で、高さの中心となる位置を指定する。図67の例では、高さ抽出手段は、スポイト状のアイコンSIを表示した「抽出」ボタン144で構成されており、この「抽出」ボタン144を押下すると、第二画像表示領域121上に点状のポインタ146が表示される。このポインタ146で指定された位置が、距離レンジの中間の高さとして登録される。   When “single point designation” is selected from the extraction method selection means 142 on the screen of FIG. 65, the screen shifts to the single point designation screen 150 of FIG. 66 to 96 show an example in which a 50-yen coin is used as a work for explanation. 66, the height of the part designated on the second image display area 121 is set as the reference height (reference height). In the example of FIG. 66, when the “extract” button 144 provided in the operation area 122 on the right side of the screen is selected, the screen shown in FIG. 67 is displayed, and an arbitrary position on the second image display area 121 on the left side of the screen can be designated. It becomes like this. Here, the position which becomes the center of the height in the work displayed in the second image display area 121 is designated by using the height extracting means. In the example of FIG. 67, the height extracting means is configured by an “extract” button 144 displaying a dropper-shaped icon SI. When the “extract” button 144 is pressed, a dot is displayed on the second image display area 121. A pointer 146 is displayed. The position designated by the pointer 146 is registered as the intermediate height of the distance range.

またポインタ146で指定された点の周辺の高さを求める範囲を、「抽出領域」指定欄145で指定できる。「抽出領域」指定欄145では、平均高さを求める領域の一辺を画素数で指定する。図67の例では「抽出領域」指定欄145で「16」を指定しており、ポインタ146で指定された点を中心とする16画素×16画素の領域内の、平均高さを抽出して、ポインタ146で抽出された高さとする。なお、第二画像表示領域121上においてポインタ146で指定される領域の大きさを、「抽出領域」指定欄145で指定される数値に連動させて変化させることもできる。   A range for obtaining the height around the point designated by the pointer 146 can be designated in the “extraction area” designation field 145. In the “extraction area” designation field 145, one side of the area for which the average height is calculated is designated by the number of pixels. In the example of FIG. 67, “16” is designated in the “extraction area” designation field 145, and the average height in the 16 pixel × 16 pixel area centered on the point designated by the pointer 146 is extracted. , The height extracted by the pointer 146. The size of the area designated by the pointer 146 on the second image display area 121 can be changed in conjunction with the numerical value designated by the “extraction area” designation field 145.

また「Z高さ」表示欄152には、指定された部位の高さ情報が数値として表示される(図68の例では「Z高さ」表示欄152に1.253と表示される)。例えば、距離レンジを28=256階調(0〜255)で表現する場合、高さ抽出手段で指定された高さを、その中心値としてゲイン(濃度値/mm;詳細は後述)が128となるように設定される。この構成により、ユーザは検査したい高さを直接画面上で指定することで、指定された高さを中心とする範囲で、低階調な距離画像に階調変換されるため、必要な高さ情報が損なわれる事態を回避できる。
(簡易表示機能)
In the “Z height” display field 152, the height information of the designated part is displayed as a numerical value (in the example of FIG. 68, 1.253 is displayed in the “Z height” display field 152). For example, when the distance range is expressed by 2 8 = 256 gradations (0 to 255), the height (density value / mm; details will be described later) is 128 with the height specified by the height extraction means as the center value. Is set to be With this configuration, the user can specify the height to be inspected directly on the screen, and the tone is converted into a low-tone range image in the range centered on the specified height. The situation where information is damaged can be avoided.
(Simple display function)

以上のようにして階調変換に必要な階調変換パラメータとして、距離レンジとスパンが決定されると、高階調な距離画像を低階調距離画像に階調変換することが可能となる。また第二画像表示領域121上には、図68に示すように、現在操作領域122で設定されている階調変換条件で階調変換された低階調距離画像が、簡易的に表示される。また、操作領域122で階調変換条件を変更すると、これに応じて第二画像表示領域121上の階調変換後の低階調距離画像の簡易表示も、変更後の階調変換条件に応じて更新される。これにより、ユーザは階調変換条件の調整後の変化を視覚的に速やかに確認でき、試行錯誤による調整作業を容易に行うことが可能となる。このように第二画像表示領域121で表示される画像は、階調変換前の距離画像を表示させるモード、階調変換後の低階調距離画像を表示させるモード、及び通常の輝度画像を表示させるモードを切り替えることで、変更できる。
(ゲイン調整手段)
As described above, when the distance range and span are determined as the gradation conversion parameters necessary for gradation conversion, it is possible to perform gradation conversion from a high gradation distance image to a low gradation distance image. In addition, on the second image display area 121, as shown in FIG. 68, a low gradation distance image subjected to gradation conversion under the gradation conversion conditions currently set in the operation area 122 is simply displayed. . Further, when the gradation conversion condition is changed in the operation area 122, the simple display of the low gradation distance image after gradation conversion on the second image display area 121 according to this is also performed according to the changed gradation conversion condition. Updated. As a result, the user can quickly and visually confirm the change after adjustment of the gradation conversion condition, and can easily perform adjustment work by trial and error. In this way, the image displayed in the second image display area 121 displays a mode for displaying a distance image before gradation conversion, a mode for displaying a low gradation distance image after gradation conversion, and a normal luminance image. It can be changed by switching the mode.
(Gain adjustment means)

さらにユーザは、ゲイン調整手段を用いて、階調変換パラメータの一であるゲイン調整を行うことができる。図68の例では、操作領域122の中段に強調方法設定欄154が設けられており、ここにゲイン調整手段としてゲイン調整欄156が配置される。ゲイン調整欄156には、現在のゲインが数値で表示されている。ここでゲイン[階調/mm]とは、階調変換を行う際のスパンに該当するパラメータである。例えば16階調の距離画像を8階調に階調変換する際は、1mm当たりを8階調中の何階調として変換するかを設定する。ゲイン値を大きくすれば、コントラストがはっきりした階調変換となる。例えばゲイン値を100[階調/mm]に設定すると、1階調当たり0.010mmとなるような階調変換に設定される。また変換前の距離画像の高さ情報が、1階調当たり0.00025mmの分解能であったとすると、求めた基準面と入力高さデータとの差が、変換前にN階調であった場合、変換後はN[階調]×0.00025[mm/階調]×100[階調/mm]=N×0.025階調として算出できる。   Further, the user can perform gain adjustment, which is one of the gradation conversion parameters, using the gain adjusting means. In the example of FIG. 68, an emphasis method setting field 154 is provided in the middle of the operation area 122, and a gain adjustment field 156 is arranged here as a gain adjusting means. The gain adjustment field 156 displays the current gain as a numerical value. Here, the gain [gradation / mm] is a parameter corresponding to a span when gradation conversion is performed. For example, when converting a gradation image of 16 gradations to 8 gradations, it is set how many gradations in 8 gradations are converted per mm. If the gain value is increased, gradation conversion with clear contrast is obtained. For example, when the gain value is set to 100 [gradation / mm], gradation conversion is set to 0.010 mm per gradation. If the height information of the distance image before conversion has a resolution of 0.00025 mm per gradation, the difference between the obtained reference plane and the input height data is N gradations before conversion. After conversion, it can be calculated as N [gradation] × 0.00025 [mm / gradation] × 100 [gradation / mm] = N × 0.025 gradation.

ここで基準面とは、一点指定や後述する平均高さ基準、三点指定、平面基準、自由曲面基準等の方法で求めた面であり、階調変換時の基準となる面である。例えば、図69Aに示すように、16階調の変換前の距離画像(入力画像)の断面プロファイルが実線で示すような形状である場合、その基準面を波線で示す。このような入力画像を、16階調から8階調に階調変換した低階調距離画像のプロファイルは、図69Bに示すようになり、基準面からの差分に対してそのままゲイン(変換係数)がかかるような状態となる。   Here, the reference plane is a plane obtained by a method such as single point designation, average height standard, three-point designation, plane standard, or free-form surface standard, which will be described later, and is a standard plane for gradation conversion. For example, as shown in FIG. 69A, when the cross-sectional profile of a distance image (input image) before conversion of 16 gradations has a shape shown by a solid line, the reference plane is shown by a wavy line. The profile of the low gradation distance image obtained by converting the gradation of such an input image from 16 gradations to 8 gradations is as shown in FIG. 69B, and the gain (conversion coefficient) is directly applied to the difference from the reference plane. It will be in such a state.

また、上述したゲイン値に応じて1階調当たりの高さ(ゲイン値の逆数)も自動的に演算されて、併せて表示させることもできる。図68の例では、ゲイン値として250[階調/mm]、1階調あたりの高さとして0.0040mmが表示されている。ユーザはゲイン値を変更することで、ゲイン値の調整が可能となる。例えばゲイン値を増加させると、図68の画面から図70の画面に示すように、濃度差を強調して高さ情報を細かく検査できる反面、検査可能な高さ範囲が狭くなる。逆にゲイン値を低下させると、図71に示すように広い高さ範囲まで検査できる反面、細かな変化が損なわれる。このように、ゲイン調整手段でゲインを調整させると、その階調変換条件で得られる階調変換画像を第二画像表示領域121で確認できる。これによりユーザは、リアルタイムに更新される階調変換画像を確認しながら、検査目的等に応じて、適切なゲイン値に調整できる。
(抽出高さの設定)
Further, the height per gradation (the reciprocal of the gain value) is automatically calculated according to the gain value described above, and can be displayed together. In the example of FIG. 68, the gain value is 250 [gradation / mm], and the height per gradation is 0.0040 mm. The user can adjust the gain value by changing the gain value. For example, when the gain value is increased, as shown in the screen of FIG. 68 to the screen of FIG. 70, height information can be inspected finely while enhancing the density difference, but the inspectable height range is narrowed. Conversely, when the gain value is lowered, as shown in FIG. 71, inspection can be performed up to a wide height range, but fine changes are lost. As described above, when the gain is adjusted by the gain adjusting means, the gradation conversion image obtained under the gradation conversion condition can be confirmed in the second image display area 121. Accordingly, the user can adjust the gain value to an appropriate value according to the inspection purpose or the like while checking the gradation conversion image updated in real time.
(Extraction height setting)

さらに、強調方法の設定項目は、ゲイン値の他、抽出高さの設定も含めることができる。例えば図72の画面において、操作領域122の右下に設けられた「詳細設定」ボタン158を押下すると、図73の強調方法詳細設定画面160に切り替わり、強調方法設定欄154に上述したゲイン調整欄156に加えて、「抽出高さ」設定欄162が表示される。「抽出高さ」設定欄162では、高さ抽出手段で抽出すべき高さ情報として、領域内に含まれる高い高さ情報、低い高さ情報、高いものと低いものの両方の高さ情報のいずれかを選択できる。ここでは、図74に示すように、「抽出高さ」設定欄162に設けられたドロップダウンリストによって「高い側」、「低い側」、「高低両方」のいずれかを選択できる。例えば、「高い側」を選択すると、ポインタ146で指定された位置の高さが、距離レンジの下限となるように階調変換される。この結果、指定された高さよりも高い側のみが抽出された低階調距離画像が生成される。同様に「低い側」を選択すると、ポインタ146で指定された位置の高さが距離レンジの上限となるように階調変換される。この結果、指定された高さよりも低い側のみが抽出された低階調距離画像が生成される。さらに「高低両方」の場合は、ポインタ146で指定された位置の高さが上述した距離レンジの中間となるように階調変換される。なお、階調変換後に範囲外となった画素は、低い側が黒(8階調の場合、画素値0)に、高い側が白(画素値255)にクリッピングされる。   Further, the setting item of the enhancement method can include the setting of the extraction height in addition to the gain value. For example, when the “detailed setting” button 158 provided at the lower right of the operation area 122 is pressed on the screen of FIG. 72, the screen is switched to the emphasis method detail setting screen 160 of FIG. In addition to 156, an “extraction height” setting field 162 is displayed. In the “extracted height” setting field 162, as height information to be extracted by the height extracting means, any one of high height information, low height information, and high and low height information included in the region is selected. Can be selected. Here, as shown in FIG. 74, one of “high side”, “low side”, and “both high and low” can be selected from the drop-down list provided in the “extraction height” setting field 162. For example, when “higher side” is selected, gradation conversion is performed so that the height of the position designated by the pointer 146 becomes the lower limit of the distance range. As a result, a low gradation distance image in which only the side higher than the designated height is extracted is generated. Similarly, when “low side” is selected, gradation conversion is performed so that the height of the position designated by the pointer 146 becomes the upper limit of the distance range. As a result, a low gradation distance image in which only the side lower than the specified height is extracted is generated. Further, in the case of “both high and low”, gradation conversion is performed so that the height of the position designated by the pointer 146 is in the middle of the above-described distance range. Note that pixels that are out of range after gradation conversion are clipped to black (pixel value 0 in the case of 8 gradations) on the lower side and white (pixel value 255) on the higher side.

さらに、図73の強調方法詳細設定画面160においては、ノイズを除去するためのノイズ除去設定欄164や、無効画素に与える値を指定するための無効画素指定欄166も設けられている。
(ノイズ除去設定欄164)
Further, in the emphasis method detailed setting screen 160 of FIG. 73, a noise removal setting field 164 for removing noise and an invalid pixel designation field 166 for designating a value to be given to invalid pixels are also provided.
(Noise removal setting field 164)

ノイズ除去設定欄164では、階調変換パラメータの一として、基準面から何mm分の差分をノイズとして除去するかを指定する。例えば、ノイズ除去パラメータを0.080mmと設定すると、基準面から0.080mm分の差分は除去される。ここで変換前の高さ情報が1階調あたり0.00025mmの分解能であるとすると、0.080[mm]÷0.00025[mm]=320[階調]の差分は、無視される動作となる。この様子を、図75A〜図75Cに基づいて説明する。これらの図において図75Aは、図69Aと同様、16階調の変換前の距離画像の断面プロファイルを実線で、その基準面を波線で示すと共に、さらにノイズ除去される範囲を一点鎖線で示している。このような入力画像に対し、基準面を基準にノイズ除去を行った結果、図75Bに示すプロファイルとなる。さらに図75Bの距離画像に対して、16階調から8階調に階調変換した低階調距離画像のプロファイルは、図75Cに示すようになり、残った成分に対してゲイン(変換係数)をかけた状態となる。   In the noise removal setting column 164, as one of the gradation conversion parameters, it is specified how many mm of the difference from the reference plane is removed as noise. For example, if the noise removal parameter is set to 0.080 mm, the difference of 0.080 mm from the reference plane is removed. Here, assuming that the height information before conversion has a resolution of 0.00025 mm per gradation, the difference of 0.080 [mm] ÷ 0.00025 [mm] = 320 [gradation] is ignored. It becomes. This state will be described with reference to FIGS. 75A to 75C. In these drawings, FIG. 75A shows a cross-sectional profile of a distance image before conversion of 16 gradations by a solid line, a reference plane thereof by a wavy line, and a range from which noise is removed by an alternate long and short dash line, as in FIG. 69A. Yes. As a result of performing noise removal on such an input image with reference to the reference plane, the profile shown in FIG. 75B is obtained. Furthermore, the profile of the low gradation distance image obtained by gradation conversion from 16 gradations to 8 gradations with respect to the distance image of FIG. 75B is as shown in FIG. 75C, and gain (conversion coefficient) is obtained for the remaining components. Will be applied.

さらに、ゲイン調整とノイズ除去の効果を、図76A〜図76Fに基づいて説明する。まず図76Aに示すような輝度画像と、図76Bに示すような高階調(16階調)の距離画像を得たとする。ここで、図76Bの距離画像を、初期設定(ここでは、ゲインが100[階調/mm]、ノイズ除去が0.000[mm]とする。)のまま、低階調(8階調)に階調変換した低階調距離画像を、図76Cに示す。この低階調距離画像は、コントラストが比較的低い。そこで、この状態からゲインを上げると、図76Dに示すように、コントラストが高くなった低階調距離画像が新たに図76Bから階調変換されて、表示される。ただ、この画像ではノイズ成分も大きくなっている。図76Dの例では、ゲインが1000[階調/mm]、ノイズ除去が0.000[mm]に設定されている。そこで、図76Dからノイズ除去量を大きくした低階調距離画像を、図76Eに示す。ここでは、ゲインが1000[階調/mm]、ノイズ除去が0.080[mm]に設定されている。これによってノイズ成分は低減されたが、一方で左上の「E」の右上に、基準面よりも低い高さのノイズが存在することが確認できる。そこで、図74等に示す「抽出高さ」設定欄182において「高い側」に設定すると、基準面が最低値(画素値0)となるように変換されるため、基準面よりも低い部分は無視され、基準面よりも高い側のみが抽出される結果、図76Fに示すような低階調距離画像が得られる。例えば図77Aに示すようなプロファイルの距離画像(16階調)に対して、「抽出高さ」を「高い側」に設定すると、基準面からの高い側のみが抽出されるような結果となり、図77Bに示すような低階調距離画像(8階調)が得られる。このようにして、図76C等に比べてコントラストが高く、かつノイズ成分も少ない低階調距離画像を得ることができる。この例では、最終的な階調変換パラメータとして、ゲインを1000[階調/mm]、ノイズ除去を0.080[mm]、「抽出高さ」を「高い側」にそれぞれ設定して、図76Bの距離画像から図76Fの低階調距離画像に階調変換している。   Further, the effects of gain adjustment and noise removal will be described based on FIGS. 76A to 76F. First, assume that a luminance image as shown in FIG. 76A and a high gradation (16 gradations) distance image as shown in FIG. 76B are obtained. Here, the distance image in FIG. 76B remains at the initial settings (here, the gain is 100 [gradation / mm] and the noise removal is 0.000 [mm]), and the low gradation (8 gradations). FIG. 76C shows the low gradation distance image obtained by gradation conversion to. This low gradation distance image has a relatively low contrast. Therefore, when the gain is increased from this state, as shown in FIG. 76D, a low gradation distance image with high contrast is newly subjected to gradation conversion from FIG. 76B and displayed. However, the noise component is also large in this image. In the example of FIG. 76D, the gain is set to 1000 [gradation / mm] and the noise removal is set to 0.000 [mm]. Therefore, FIG. 76E shows a low gradation distance image in which the noise removal amount is increased from FIG. 76D. Here, the gain is set to 1000 [gradation / mm] and the noise removal is set to 0.080 [mm]. As a result, the noise component is reduced. On the other hand, it can be confirmed that noise having a height lower than that of the reference plane exists in the upper right of the upper left “E”. Therefore, when “higher side” is set in the “extraction height” setting field 182 shown in FIG. 74 and the like, the reference plane is converted so as to have the lowest value (pixel value 0). As a result of being ignored and extracting only the side higher than the reference plane, a low gradation distance image as shown in FIG. 76F is obtained. For example, when the “extraction height” is set to “high side” for the distance image (16 gradations) of the profile as shown in FIG. 77A, only the high side from the reference plane is extracted. A low gradation distance image (8 gradations) as shown in FIG. 77B is obtained. In this way, it is possible to obtain a low gradation distance image having a higher contrast and less noise components than those in FIG. 76C and the like. In this example, as final gradation conversion parameters, the gain is set to 1000 [gradation / mm], the noise removal is set to 0.080 [mm], and the “extraction height” is set to the “higher side”. The gradation conversion is performed from the distance image of 76B to the low gradation distance image of FIG. 76F.

このようにして、一点指定の実行に必要な条件が設定されると、指定された階調変換条件、すなわち基準高さ等に従って、入力画像が高階調な距離画像から低階調距離画像に階調変換され、図78に示すように、第一画像表示領域111に表示される。   In this way, when the conditions necessary for executing the single point specification are set, the input image is scaled from the high gradation distance image to the low gradation distance image according to the designated gradation conversion condition, that is, the reference height. The tone is converted and displayed in the first image display area 111 as shown in FIG.

ここで、基準面を一点指定で指定する方法が有効なワークの例を、図79A〜図79Bに基づいて説明する。図79Aは、ワークの計測面において平面的な傾斜がない、又は多少の傾斜があっても検査処理に影響しないワークWK7を示している。ここでは、鋳物の表面に数字や文字列が立体的に形成されたワークWK7に対して、文字列が適切かどうかをOCRによって読み取る検査処理を行う。このような用途において、図67等に示した「抽出」ボタン144を押下することで、第二画像表示領域121上にスポイト状のアイコンSIを表示させる。そしてポインタ146で、図79Aに示すようにワークWK7上面の、文字列の形成されていない平面(背景面)の一点を指定する。これにより、ポインタ146で指定された抽出領域(図67の例では16画素)の高さを基準面として、階調変換が行われ、図79Bに示す低階調距離画像に変換される。この低階調距離画像では、ワークWK7の平面を背景として、ここから突出した文字列部分が綺麗に抽出されるので、正確なOCRを実行し易くできる。このように一点指定は、ワークに多少傾きがあっても検査処理には影響のないケースに有効に利用できる。また一点指定は低負荷で高速に処理できる利点も挙げられる。
(三点指定)
Here, an example of a work in which the method of designating the reference plane by specifying one point will be described based on FIGS. 79A to 79B. FIG. 79A shows a workpiece WK7 that does not have a planar inclination on the measurement surface of the workpiece or does not affect the inspection process even if there is a slight inclination. Here, an inspection process for reading whether or not the character string is appropriate is performed on the workpiece WK7 in which numbers and character strings are three-dimensionally formed on the surface of the casting. In such an application, by pressing an “extract” button 144 shown in FIG. 67 or the like, a dropper-shaped icon SI is displayed on the second image display area 121. Then, with the pointer 146, as shown in FIG. 79A, a point on the plane (background surface) on which the character string is not formed on the upper surface of the work WK7 is designated. Thereby, gradation conversion is performed using the height of the extraction area (16 pixels in the example of FIG. 67) designated by the pointer 146 as a reference plane, and the image is converted into a low gradation distance image shown in FIG. 79B. In this low gradation distance image, the character string portion protruding from the plane of the work WK7 is clearly extracted, so that accurate OCR can be easily performed. As described above, the one-point designation can be effectively used in a case where there is no influence on the inspection process even if the workpiece is slightly inclined. One-point designation also has the advantage of being able to process at high speed with low load.
(Specify three points)

以上は、一点指定による階調変換条件の設定方法について説明した。次に三点指定による階調変換条件の設定方法について、図80〜図85のGUI画面に基づいて説明する。三点指定とは、ユーザが指定した三点から求められる平面を基準面として、距離画像を低階調距離画像に階調変換する方法である。基準面も、上述した一点指定の基準高さと同様、例えば距離画像の高さ情報の内、低階調距離画像に階調変換される高さ範囲(距離レンジ)の中間の高さとする。あるいは、距離レンジの上限(階調変換される最も高い位置)や下限(階調変換される最も低い位置)とすることもできる。   The method for setting the gradation conversion condition by specifying one point has been described above. Next, a method for setting gradation conversion conditions by specifying three points will be described based on the GUI screens shown in FIGS. The three-point designation is a method for gradation-converting a distance image into a low gradation distance image using a plane obtained from the three points designated by the user as a reference plane. The reference plane is also set to a height in the middle of the height range (distance range) to be converted to a low gradation distance image, for example, among the height information of the distance image, similarly to the reference height designated by one point described above. Alternatively, the upper limit (the highest position where gradation conversion is performed) and the lower limit (the lowest position where gradation conversion is performed) of the distance range can be set.

図62の三次元画像処理プログラムのGUI画面で「高さ抽出」ボタン116を押下し、図80に示す高さ抽出選択画面140に移行した状態で、抽出方法選択手段142で階調変換方法として、「三点指定(平面)」を選択する。これにより、図81に示す高さ抽出設定を行う三点指定画面170が表示される。
(三点指定画面170)
62. When the “height extraction” button 116 is pressed on the GUI screen of the 3D image processing program in FIG. 62 and the screen is shifted to the height extraction selection screen 140 shown in FIG. , “Specify three points (plane)” is selected. Thereby, a three-point designation screen 170 for performing height extraction setting shown in FIG. 81 is displayed.
(Three point designation screen 170)

三点指定画面170では、階調変換の基準となる基準面を、第二画像表示領域121上で3点指定して設定する。このため図81の三点指定画面170では、高さ抽出手段が設けられる。具体的には、画面右の操作領域122中に設けられた「抽出」ボタン144を選択することで、図82に示す画面となり、画面左の第二画像表示領域121上で任意の位置を三点指定できるようになる。ここでは、高さ抽出手段として図67と同様に点状のポインタ146が表示されており、ユーザは所望の位置をマウスやトラックボール、あるいはタッチパネル等のポインティングデバイスで順次指定していく。まず一点目を第二画像表示領域121上で指定すると、指定された位置で図83のように矩形状が十字状に変化して、指定済みの位置を示すと共に、次の二点目を、同じくポインタ146でもって指定できるようになる。この時点で、図82に表示されているカラーの距離画像は、指定された一点目の高さを含む水平面を基準として階調変換を行い、階調変換後の低階調距離画像を濃淡画像として第二画像表示領域に表示する。さらに二点目を指定すると、図84に示すように二点目の位置が矩形状から十字状に変化すると共に、三点目が指定可能となる。この時点で、指定された2点の高さを含む傾斜面を基準として再度階調変換を行い、低階調距離画像を更新する。そして三点目を指定すると、これら指定済みの三点を含む平面でもって基準面が設定される。また、高さ抽出手段で各点を指定する際に、高さ抽出画面表示領域上で現在指定されている点の高さを、「Z高さ」表示欄152に表示させてもよい。   On the three-point designation screen 170, three reference points on the second image display area 121 are designated and set as a reference plane for gradation conversion. For this reason, a height extraction means is provided on the three-point designation screen 170 of FIG. More specifically, by selecting an “extract” button 144 provided in the operation area 122 on the right side of the screen, the screen shown in FIG. 82 is obtained, and an arbitrary position is set on the second image display area 121 on the left side of the screen. Point can be specified. Here, a point-like pointer 146 is displayed as the height extracting means as in FIG. 67, and the user sequentially designates a desired position with a pointing device such as a mouse, a trackball, or a touch panel. First, when the first point is designated on the second image display area 121, the rectangular shape changes to a cross shape at the designated position as shown in FIG. 83 to indicate the designated position, and the next second point is Similarly, the pointer 146 can be used for designation. At this time, the color distance image displayed in FIG. 82 is subjected to gradation conversion with reference to the horizontal plane including the designated height of the first point, and the low gradation distance image after gradation conversion is converted to a grayscale image. Is displayed in the second image display area. Further, when the second point is designated, the position of the second point changes from a rectangular shape to a cross shape as shown in FIG. 84, and the third point can be designated. At this time, gradation conversion is performed again with reference to the inclined plane including the two specified heights, and the low gradation distance image is updated. When the third point is designated, a reference plane is set by a plane including these designated three points. Further, when each point is designated by the height extraction means, the height of the point currently designated on the height extraction screen display area may be displayed in the “Z height” display column 152.

さらに、基準面の情報として、傾斜角を表示させることもできる。図84の例では、操作領域122に設けられた高さ抽出表示欄172において、基準面のX方向傾き、Y方向傾き、及び三点目のZ方向高さが表示されている。   Furthermore, an inclination angle can also be displayed as the reference plane information. In the example of FIG. 84, the height extraction display column 172 provided in the operation area 122 displays the X direction inclination, the Y direction inclination, and the third Z direction height of the reference plane.

また、一点指定と同様、必要に応じて強調方法を指定することもできる。例えば、ゲイン調整手段を用いて、ゲイン調整を行ったり、三点指定「詳細設定」ボタン174を押下して図85に示すような三点指定詳細設定画面180を呼び出し、強調方法設定欄154にゲイン調整欄156に加えて「抽出高さ」設定欄182を表示させ、高さ抽出手段で抽出すべき高さ情報として、ドロップダウンリストから「高い側」、「低い側」、「高低両方」のいずれかを選択できる。   Further, as in the case of single point designation, it is possible to designate an emphasis method as necessary. For example, the gain adjustment means is used to perform gain adjustment, or the three-point designation “detailed setting” button 174 is pressed to call a three-point designation detailed setting screen 180 as shown in FIG. In addition to the gain adjustment field 156, an “extraction height” setting field 182 is displayed. As height information to be extracted by the height extraction means, “high side”, “low side”, “both high and low” are selected from the drop-down list. You can select either of these.

このようにして、指定された三点で規定される任意の平面を基準面として、距離画像の階調変換を行うことが可能となる。この結果、上述した一点指定のような水平な平面を基準とする階調変換のみならず、傾斜させた平面を基準面とした階調変換も可能となる。例えば、ワーク表面の傾斜面の傷や異物を検査する用途において、傾斜面のままでは距離レンジが狭くなるところ、傾斜面に沿って基準面を設定することで、傾斜面をキャンセルでき、効率よく傷や異物を検出できる。このようにして、ワークや検査目的に応じて高さ情報を活用した、柔軟な階調変換を実現できる。   In this way, it is possible to perform tone conversion of a distance image using an arbitrary plane defined by the designated three points as a reference plane. As a result, not only the gradation conversion based on the horizontal plane as described above, but also the gradation conversion using the inclined plane as the reference plane is possible. For example, in the inspection of scratches and foreign objects on the inclined surface of the workpiece surface, the distance range becomes narrow if the inclined surface is left as it is, but the inclined surface can be canceled efficiently by setting the reference surface along the inclined surface. Scratches and foreign objects can be detected. In this way, flexible gradation conversion using height information according to the workpiece and inspection purpose can be realized.

ここで、基準面を三点指定で指定する方法が有効なワークの例を、図86A〜図86Dに基づいて説明する。図86Aは、ワークの計測面において平面的な傾斜が生じていたり、微小な平面傾斜が存在すると、検査処理の結果に影響するようなワークWK8を示している。ここでは、基板上に形成されたボールグリッドアレイ(BGA)を検出する検査処理を行う。このような用途において、図84等に示した「抽出」ボタン144を押下することで、第二画像表示領域121上にスポイト状のアイコンSIを表示させる。そしてポインタ146で、図86Aに示すように、ワークWK8上面の内、BGAが形成されていない点を三点指定する。これにより、指定された三点を含む平面が基準面として抽出されて、階調変換が行われ、図86Bに示す低階調距離画像に変換される。この低階調距離画像では、ワークWK8の平面を背景として、ここから突出したBGAが綺麗に抽出されるので、例えばこれを図86Cに示すように二値化してBGAの形状を確認できる。この方法であれば、ワークWK8の平面に傾きがあっても正確に検出できる利点が得られる。仮に図86Aに示すワークWK8に傾きがあると、例えば一点指定では二値化された画像が図86Dに示すようになって、正しく検出できない。これに対して、三点指定では上述の通り傾きを補正して正確な検出結果が得られる。このように三点指定は、平面の傾きが検査処理結果に影響するケースで有効である。   Here, an example of a work in which the method of designating the reference plane by three-point designation will be described based on FIGS. 86A to 86D. FIG. 86A shows a workpiece WK8 that has an influence on the result of the inspection process when a plane inclination occurs on the measurement surface of the workpiece or a minute plane inclination exists. Here, an inspection process for detecting a ball grid array (BGA) formed on the substrate is performed. In such an application, by pressing an “extract” button 144 shown in FIG. 84 or the like, a dropper-shaped icon SI is displayed on the second image display area 121. Then, with the pointer 146, as shown in FIG. 86A, three points on the upper surface of the work WK8 where no BGA is formed are designated. As a result, a plane including the designated three points is extracted as a reference plane, gradation conversion is performed, and the low gradation distance image shown in FIG. 86B is converted. In this low gradation distance image, the BGA protruding from here is clearly extracted with the plane of the work WK8 as the background. For example, this can be binarized as shown in FIG. 86C to confirm the shape of the BGA. With this method, there is an advantage that it can be accurately detected even if the plane of the workpiece WK8 is inclined. If the workpiece WK8 shown in FIG. 86A has an inclination, for example, if one point is specified, a binarized image becomes as shown in FIG. 86D and cannot be detected correctly. On the other hand, in the three-point designation, an accurate detection result can be obtained by correcting the inclination as described above. As described above, the three-point designation is effective in the case where the inclination of the plane affects the inspection processing result.

さらに、図87Aに示すような平面状のワークWK9の上面に緩やかな窪みを有する場合に、この窪みを検出する検査処理を考える。ここでは図87Aに示すように計測領域ROIを、窪みを含む領域に設定する。これにより、窪みを含んだ計測領域ROI内全体の高さデータから求めた平面を基準面として階調変換され、図87Bに示すような低階調距離画像が得られる。この例では最小二乗法で基準面を推定している。さらに得られた低階調距離画像を二値化して、図87Cに示す二値化画像を得る。これによって傾きを補正して、安定的に窪みの部分だけを抽出できる。仮に傾きがある状態で一点指定によって二値化画像を求めると、図87Dに示すような結果となって、傾斜面によって窪みの検出が困難となることが判る。このように、精度の高い基準面の推定に、三点指定が有効である。なお処理時間の面では、一点指定よりも処理時間がかかるものの、比較的高速に処理可能である。   Furthermore, when there is a gentle depression on the upper surface of the planar workpiece WK9 as shown in FIG. 87A, an inspection process for detecting this depression will be considered. Here, as shown to FIG. 87A, measurement area | region ROI is set to the area | region containing a hollow. Thereby, gradation conversion is performed using the plane obtained from the height data of the entire measurement region ROI including the depression as a reference plane, and a low gradation distance image as shown in FIG. 87B is obtained. In this example, the reference plane is estimated by the least square method. Further, the obtained low gradation distance image is binarized to obtain a binarized image shown in FIG. 87C. In this way, the inclination can be corrected and only the recessed portion can be stably extracted. If a binarized image is obtained by specifying one point in a state where there is an inclination, the result as shown in FIG. 87D is obtained, and it can be seen that it is difficult to detect the depression due to the inclined surface. Thus, the three-point designation is effective for estimating the reference plane with high accuracy. In terms of processing time, although processing time is longer than single point designation, processing can be performed at a relatively high speed.

以上は、設定段階で予め階調変換条件を指定して、運用時には指定された条件で階調変換を行う静的変換について説明した。いいかえると、静的変換では、階調変換パラメータは入力画像によらず一定値である。次に、検査対象の入力画像に応じて階調変換条件を調整する動的変換の具体例について、説明する。まず動的変換には、距離画像を低階調距離画像に階調変換する際に、残すべき高さ情報の基準を補正するため具体的な方法として、
(B1)入力画像に対して指定された平均抽出領域内の平均高さ(平均距離)を平均基準高さとして階調変換する平均高さ基準、
(B2)入力画像の指定領域内の推定平面を生成し、これを基準面として階調変換する平面基準、
(B3)入力画像から高周波成分を除いた自由曲面を生成し、これを基準面として階調変換する自由曲面基準
が含まれる。以下、各方法について順次説明する。
(B1:平均高さ基準)
In the above, static conversion in which gradation conversion conditions are specified in advance at the setting stage and gradation conversion is performed under the specified conditions during operation has been described. In other words, in the static conversion, the gradation conversion parameter is a constant value regardless of the input image. Next, a specific example of the dynamic conversion that adjusts the gradation conversion condition according to the input image to be inspected will be described. First, in dynamic conversion, as a specific method for correcting the reference of height information to be left when gradation conversion from a distance image to a low gradation distance image,
(B1) An average height reference for gradation conversion using an average height (average distance) in an average extraction area designated for the input image as an average reference height;
(B2) a plane reference for generating an estimated plane in the designated area of the input image and performing gradation conversion using this as a reference plane
(B3) A free-form surface reference that generates a free-form surface from which high-frequency components are removed from an input image and performs gradation conversion using this as a reference surface is included. Hereinafter, each method will be sequentially described.
(B1: Average height reference)

平均高さ基準は、入力画像毎に、指定された平均抽出領域内の平均高さを演算し、これを平均基準高さとして階調変換する方法である。平均基準高さを規定するための平均抽出領域は、運用に先立って予め設定される(上述した図8のステップS83)。以下、図8のステップS83において、平均抽出領域を指定する手順の一例について、図62、図65、図88〜図92のGUIに基づいて説明する。まず、図62のGUI画面で「高さ抽出」ボタン116を選択して、図65の高さ抽出選択画面140に進み、抽出方法選択手段142で動的変換に該当する「リアルタイム抽出」を選択すると、図88の高さ動的抽出設定画面190となる。この例では、再びワークに消しゴムを用いた例を示している。次に抽出方法選択手段142の下方に設けられた「計算方法」選択欄192において、動的変換の基準を指定する。ここでは図89に示すようにドロップダウンボックスで、「平均高さ基準」、「平面基準」、「自由曲面基準」のいずれかを選択する。ここでは、「平均高さ基準」を選択する。これにより図90の平均高さ基準設定画面210に移行する。なお、図90、図91では説明の都合上、ワークに50円玉を用いた例を示している。   The average height reference is a method of calculating the average height in a specified average extraction area for each input image and performing gradation conversion using this as the average reference height. The average extraction area for defining the average reference height is set in advance prior to operation (step S83 in FIG. 8 described above). Hereinafter, an example of a procedure for designating the average extraction region in step S83 in FIG. 8 will be described based on the GUIs in FIGS. 62, 65, and 88 to 92. First, the “height extraction” button 116 is selected on the GUI screen shown in FIG. 62, the process proceeds to the height extraction selection screen 140 shown in FIG. 65, and the “real-time extraction” corresponding to the dynamic conversion is selected by the extraction method selection means 142. Then, the height dynamic extraction setting screen 190 of FIG. 88 is displayed. In this example, an eraser is used again for the workpiece. Next, in the “calculation method” selection column 192 provided below the extraction method selection means 142, a dynamic conversion criterion is designated. Here, as shown in FIG. 89, one of “average height standard”, “plane standard”, and “free curved surface standard” is selected from the drop-down box. Here, “average height reference” is selected. Thereby, the screen shifts to the average height reference setting screen 210 of FIG. 90 and 91 show an example in which a 50-yen coin is used for the work for convenience of explanation.

なお、動的変換に関する設定時には、実際の運用時に入力される距離画像とは異なる画像に対して、平均基準高さ等を設定する必要がある。このため、運用時のワークと対応する画像を事前に撮像し、これを登録画像として保存しておき、動的変換の設定に際しては登録画像を読み込んで、これを運用時のワーク画像に代用する形で各種の設定を行う。このため、図65等の画面において、「表示画像」選択欄124にて、該当する「登録画像」を指定する。   When setting the dynamic conversion, it is necessary to set an average reference height or the like for an image different from the distance image input during actual operation. For this reason, an image corresponding to the work at the time of operation is captured in advance and saved as a registered image. When setting dynamic conversion, the registered image is read and used as a work image at the time of operation. Various settings are made in the form. For this reason, the corresponding “registered image” is designated in the “display image” selection field 124 on the screen of FIG.

平均高さ基準設定画面210では、別途設定された検査対象領域をそのまま用いるか、必要に応じて任意の平均抽出領域を指定する。平均抽出領域の指定は、矩形状、あるいは四隅の指定、中心と半径の指定による円形、自由曲線等、任意の方式が利用できる。また、ワークの一点のみを指定したり、逆にワークの全体、あるいは第二画像表示領域121で表示される画像の全体を、平均抽出領域とすることもできる。あるいは、上述の通り別途指定された検査対象領域を、平均抽出領域として利用することもできる。これらの場合は、高さ抽出手段による平均抽出領域の指定作業を省略してもよい。
(マスク領域)
On the average height reference setting screen 210, a separately set inspection target area is used as it is, or an arbitrary average extraction area is designated as necessary. The average extraction area can be specified by any method such as a rectangular shape, four corners, a circle by specifying the center and radius, or a free curve. Further, only one point of the workpiece can be designated, or conversely, the entire workpiece or the entire image displayed in the second image display area 121 can be set as the average extraction area. Alternatively, the inspection target area separately designated as described above can be used as the average extraction area. In these cases, the designation operation of the average extraction area by the height extraction means may be omitted.
(Mask area)

また、平均抽出領域に対して、平均高さを抽出しないマスク領域を指定することもできる。例えば図90の画面から、操作領域122に設けられた「抽出領域」ボタン194を押下すると、図91に示すマスク領域設定画面220に移行する。このマスク領域設定画面220上から、平均高さの抽出に不要なマスク領域を一以上指定できる。マスク領域の指定にも、上述の通り第二画像表示領域121上から、矩形状や円形状等、任意の領域を指定することで行える。   In addition, a mask area from which the average height is not extracted can be designated for the average extraction area. For example, when the “extraction area” button 194 provided in the operation area 122 is pressed from the screen of FIG. 90, the screen shifts to the mask area setting screen 220 shown in FIG. On the mask area setting screen 220, one or more mask areas that are unnecessary for extracting the average height can be designated. The mask area can also be designated by designating an arbitrary area such as a rectangular shape or a circular shape from the second image display area 121 as described above.

さらに、必要に応じてゲイン調整等を行うこともできる。例えば図90の画面から、操作領域122の右下に設けた「詳細設定」ボタン196を押下すると、図92に示す平均高さ基準詳細設定画面230に移行し、強調方法設定欄154にゲイン調整に加えて、抽出高さの指定やノイズ除去等の詳細な設定項目が表示される。   Furthermore, gain adjustment or the like can be performed as necessary. For example, when the “detailed setting” button 196 provided in the lower right of the operation area 122 is pressed from the screen of FIG. 90, the screen shifts to the average height reference detailed setting screen 230 shown in FIG. In addition, detailed setting items such as extraction height designation and noise removal are displayed.

このようにして平均抽出領域が規定されると、設定画面を終了する。階調変換の際には、この平均抽出領域に含まれる高さ情報の平均値(平均基準高さ)を、基準高さとして、階調変換を行う。例えば、平均基準高さが、距離レンジの中心値(28=256階調の場合は0〜255の距離レンジの中心値である128)となるようにして階調変換する。また、平均抽出領域に含まれるすべての点の高さ情報を必ずしもすべて利用する必要はなく、適宜間引く、あるいは平均化する等、処理を簡略化することもできる。 When the average extraction area is defined in this way, the setting screen is terminated. In the gradation conversion, gradation conversion is performed using the average value (average reference height) of the height information included in the average extraction area as the reference height. For example, the gradation conversion is performed so that the average reference height becomes the center value of the distance range (in the case of 2 8 = 256 gradations, the center value of the distance range of 0 to 255 is 128). Further, it is not always necessary to use all the height information of all the points included in the average extraction region, and the processing can be simplified such as thinning out or averaging appropriately.

そして運用時において、後述する図133に示す手順で動的変換が行われる。例えばライン上を搬送されるワークを撮像して距離画像を生成し(ステップS13301)、上記で設定された平均抽出領域の平均高さを演算し(ステップS13302)、これに基づいて階調変換を実行して低階調距離画像を生成し(ステップS13303)、得られた低階調距離画像に対して検査を行う(ステップS13304)。この方法であれば、ワークの高さ方向にばらつきがある場合でも、ワーク毎に階調変換の基準面を毎回再設定できるため、ワークの高さ方向のばらつきによらず、正確な検査が実現できる。   During operation, dynamic conversion is performed according to the procedure shown in FIG. For example, a distance image is generated by imaging a workpiece conveyed on the line (step S 13301), the average height of the average extraction area set above is calculated (step S 13302), and gradation conversion is performed based on this. This is executed to generate a low gradation distance image (step S13303), and the obtained low gradation distance image is inspected (step S13304). With this method, even if there are variations in the height direction of the workpiece, the reference plane for gradation conversion can be reset for each workpiece every time, so accurate inspection is achieved regardless of variations in the workpiece height direction. it can.

ここで、基準面を平均高さ基準で指定する方法が有効なワークの例を、図93A〜図93Bに基づいて説明する。図93Aは、上述した図79Aと同様、ワークの計測面において平面的な傾斜がないか、多少の傾斜があっても検査処理に影響しないワークWK7であり、鋳物の表面に数字や文字列が立体的に形成されたワークWK7に対して、文字列が適切かどうかをOCRによって読み取る検査処理を行う。このような用途において、図92等に示した抽出領域設定画面で、第二画像表示領域121上に矩形状に平均高さ基準を決定する計測領域ROIを設定する。ここでは図93Aに示すように、ワークWK7上面で文字列を囲む平面を計測領域ROIとして指定する。これにより、計測領域ROIの高さを基準面として、階調変換が行われ、図93Bに示す低階調距離画像に変換される。この低階調距離画像でも、図79Bと同様、ワークWK7の平面を背景として、ここから突出した文字列部分が綺麗に抽出されるので、正確なOCRを実行し易くできる。また、上述した図79AではワークWK7上の一点のみを指定することから、選択した点がノイズの影響を受ける可能性があるのに対し、図93Aでは平面で指定することから、このようなのノイズの影響を低減できる利点が得られる。
(平面基準)
Here, an example of a work in which the method of designating the reference surface based on the average height is effective will be described with reference to FIGS. 93A to 93B. FIG. 93A is a workpiece WK7 that does not affect the inspection process even if there is no planar inclination or some inclination on the workpiece measurement surface, as in FIG. 79A described above. Numbers and character strings are present on the surface of the casting. An inspection process is performed on the three-dimensionally formed workpiece WK7 to read whether the character string is appropriate by OCR. In such an application, a measurement region ROI for determining an average height reference in a rectangular shape is set on the second image display region 121 on the extraction region setting screen shown in FIG. 92 and the like. Here, as shown in FIG. 93A, the plane surrounding the character string on the upper surface of the work WK7 is designated as the measurement region ROI. Thereby, gradation conversion is performed using the height of the measurement region ROI as a reference plane, and the image is converted into a low gradation distance image shown in FIG. 93B. Even in this low gradation distance image, as in FIG. 79B, since the character string portion protruding from the plane of the work WK7 is clearly extracted, accurate OCR can be easily performed. Further, in FIG. 79A described above, only one point on the work WK7 is designated, so that the selected point may be affected by noise, whereas in FIG. 93A, such a noise is designated because it is designated by a plane. The advantage that can reduce the influence of is obtained.
(Plane basis)

以上は、平均高さ基準でもって動的変換を行う例について説明した。次に、別の動的変換として、入力画像に対して予め指定された基準面推定領域内に含まれる平面を推定し、この推定面を基準面として階調変換する平面基準について説明する。この方法では、例えばワークの表面が傾斜している場合等に、傾斜成分をキャンセルして階調変換を行えるため、上述した静的変換の三点指定と同様に活用できる利点が得られる。以下、平面基準の具体的な設定方法を説明する。平面基準においても、上述した平均高さ基準と同様、基準面を決定するための基準面推定領域は、運用に先立って予め設定される(上述した図8のステップS83)。以下、図8のステップS83において、基準面推定領域を指定する手順の一例について、図62、図88、図92〜図95のGUIに基づいて説明する。まず、図62のGUI画面で「高さ抽出」ボタン116を選択して、図80の高さ抽出選択画面140に進み、抽出方法選択手段142で動的変換に該当する「リアルタイム抽出」を選択すると、図88の高さ動的抽出設定画面190となる。次に「計算方法」選択欄192において、図89に示すように動的変換の基準として、「平面基準」を選択すると、図92の平面基準設定画面に移行する。   In the above, the example which performs dynamic conversion on the basis of average height was demonstrated. Next, as another dynamic conversion, a plane reference that estimates a plane included in a reference plane estimation area designated in advance for an input image and performs gradation conversion using the estimated plane as a reference plane will be described. In this method, for example, when the surface of the workpiece is inclined, gradation conversion can be performed by canceling the inclination component. Therefore, there is an advantage that it can be used similarly to the above-described three-point designation of static conversion. Hereinafter, a specific method for setting the plane reference will be described. Also in the plane reference, the reference plane estimation region for determining the reference plane is set in advance prior to the operation (step S83 in FIG. 8 described above) as in the above-described average height reference. Hereinafter, an example of a procedure for designating the reference plane estimation region in step S83 in FIG. 8 will be described based on the GUIs in FIGS. 62, 88, and 92 to 95. First, the “height extraction” button 116 is selected on the GUI screen shown in FIG. 62, and the process proceeds to the height extraction selection screen 140 shown in FIG. 80. The extraction method selection means 142 selects “real time extraction” corresponding to the dynamic conversion. Then, the height dynamic extraction setting screen 190 of FIG. 88 is displayed. Next, in the “calculation method” selection field 192, when “plane reference” is selected as the dynamic conversion reference as shown in FIG. 89, the screen shifts to the plane reference setting screen of FIG.

平面基準設定画面では、上述した図80の高さ抽出選択画面140における高さ抽出手段と同様、別途設定された検査対象領域をそのまま用いるか、必要に応じて任意の基準面推定領域を指定する。基準面推定領域の指定は、矩形状、あるいは四隅の指定、中心と半径の指定による円形、自由曲線等、任意の方式が利用できる。また、ワークの一点のみを指定したり、逆にワークの全体、あるいは第二画像表示領域121で表示される画像の全体を、基準面推定領域とすることもできる。   In the plane reference setting screen, similarly to the height extraction unit in the height extraction selection screen 140 of FIG. 80 described above, the inspection target area set separately is used as it is, or an arbitrary reference plane estimation area is designated as necessary. . The reference plane estimation area can be specified by any method such as a rectangular shape, four corners, a circle by specifying the center and radius, a free curve, or the like. Further, only one point of the workpiece can be designated, or conversely, the entire workpiece or the entire image displayed in the second image display area 121 can be set as the reference plane estimation area.

また、基準面推定領域に対して、推定面を推定しないマスク領域を指定することもできることは、上述した図90等と同様である。さらに、必要に応じてゲイン調整や抽出高さの指定、ノイズ除去等を行うこともできるのも、上記と同様である。例えば、図92の画面において、操作領域122に設けられた「詳細設定」ボタン222を押下すると、図94の平面基準詳細設定画面240となり、強調方法設定欄154にはゲイン調整欄156に加え、抽出高さを指定する「抽出高さ」設定欄162やノイズ除去のためのノイズ除去設定欄164、無効画素を指定するための無効画素指定欄166が表示され、これらの詳細な設定が可能となる。また無効画素指定欄166においては、図95に示すように、距離を求められなかった無効な画素を指定された規定値の他、背景の画素値やユーザが指定する任意の値で埋めることができる。   In addition, as in the above-described FIG. 90 and the like, it is possible to designate a mask area where the estimation plane is not estimated with respect to the reference plane estimation area. Further, as described above, gain adjustment, extraction height designation, noise removal, and the like can be performed as necessary. For example, when the “detailed setting” button 222 provided in the operation area 122 is pressed on the screen of FIG. 92, the plane reference detailed setting screen 240 of FIG. 94 is displayed, and in the enhancement method setting field 154, in addition to the gain adjustment field 156, An “extraction height” setting field 162 for designating the extraction height, a noise removal setting field 164 for noise removal, and an invalid pixel designating field 166 for designating invalid pixels are displayed, and these detailed settings can be made. Become. In addition, in the invalid pixel designation field 166, as shown in FIG. 95, invalid pixels whose distance cannot be obtained can be filled with a designated pixel value, a background pixel value, or an arbitrary value designated by the user. it can.

このようにして基準面推定領域が規定されると、設定画面を終了する。階調変換の際には、この基準面推定領域に含まれる高さ情報から、平面状の推定面を演算する。基準面推定領域内に分布する高さ情報のフィッティングには、最小二乗法等、既知の方法が適宜利用できる。なお、基準面推定領域に含まれるすべての点の高さ情報を推定面の演算に利用する必要は必ずしもなく、適宜間引く、あるいは平均化する等、処理を簡略化することもできることは上述の通りである。   When the reference plane estimation area is defined in this way, the setting screen is terminated. At the time of gradation conversion, a planar estimated surface is calculated from the height information included in this reference surface estimated region. For fitting the height information distributed in the reference plane estimation region, a known method such as a least square method can be used as appropriate. Note that it is not always necessary to use the height information of all points included in the reference plane estimation region for the calculation of the estimation plane, and it is possible to simplify processing such as thinning out or averaging as appropriate as described above. It is.

このようにして推定面が決定されると、この推定面を基準として、階調変換を行う。例えば、推定面が距離レンジの中心値となるようにして階調変換する。また、演算された推定面の情報を表示させることもできる。例えば図92に示す例では、操作領域122に設けられた推定面表示欄において、推定面のX方向傾き、Y方向傾き、及び推定面のZ方向高さが表示されている。なお、この例では推定面を一枚の平面としたが、複数枚の平面を組み合わせた推定面とすることもできる。また、この例では推定面を平面としたが、推定面を球面等の単純な曲面として演算することも可能である。   When the estimated surface is determined in this way, gradation conversion is performed using this estimated surface as a reference. For example, gradation conversion is performed so that the estimated surface becomes the center value of the distance range. Moreover, the information of the calculated estimated surface can also be displayed. For example, in the example shown in FIG. 92, in the estimated surface display column provided in the operation area 122, the X direction inclination, the Y direction inclination, and the Z direction height of the estimated surface are displayed. In this example, the estimation plane is a single plane, but an estimation plane combining a plurality of planes may be used. In this example, the estimation surface is a plane, but the estimation surface can be calculated as a simple curved surface such as a spherical surface.

また基準面を平面基準で指定する方法が有効なワークの例として、上述した図86Aや図87Aが挙げられる。このようなワークに対して平面基準を設定することで、仮にワークの上面に傾斜があっても傾斜分を補正して基準面が検出されるため、上述した三点指定と同様、正確なBGAパターンの検出が実現される。
(B3:自由曲面基準)
Moreover, as an example of a work in which the method of designating the reference plane based on the plane reference is effective, the above-described FIG. 86A and FIG. 87A can be cited. By setting the plane reference for such a workpiece, even if the upper surface of the workpiece is inclined, the inclination is corrected and the reference plane is detected. Pattern detection is realized.
(B3: Free curved surface standard)

最後に、入力画像の所定の領域(自由曲面対象領域)から高周波成分を除いた自由曲面を生成し、これを基準面として階調変換する自由曲面基準について説明する。例えばワークが曲面を有する等、単純な平面では近似が困難な場合は、検査したい領域の高さ情報を精度よく抽出することが難しい。そこで、入力画像から高周波成分を除いて単純化した画像を生成して、この画像の表面形状(自由曲面)を基準面として利用することで、大まかな形状やなだらかな変化を無視し、急激な変化を生じている部分、すなわち細かな形状のみを残した検査を可能とできる。   Finally, a free-form surface reference that generates a free-form surface from which a high-frequency component is removed from a predetermined region (free-form surface target region) of the input image and performs gradation conversion using the free-form surface as a reference surface will be described. For example, when approximation is difficult with a simple plane such as a workpiece having a curved surface, it is difficult to accurately extract height information of an area to be inspected. Therefore, by generating a simplified image by removing high-frequency components from the input image and using the surface shape (free-form surface) of this image as a reference surface, the rough shape and gentle changes are ignored, and abrupt changes are made. It is possible to inspect only the part where the change has occurred, that is, the fine shape.

以下、自由曲面基準の具体的な設定方法を、図62〜図96のGUIに基づいて説明する。自由曲面基準においても、上述した平均高さ基準等と同様、基準面を決定するための必要な条件は運用に先立って予め設定される(上述した図8のステップS83)。まず、図62のGUI画面で「高さ抽出」ボタン116を選択して、図80の高さ抽出選択画面140に進み、抽出方法選択手段142で動的変換に該当する「リアルタイム抽出」を選択すると、図88の高さ動的抽出設定画面190となる。次に「計算方法」選択欄192において、図89に示すように動的変換の基準として、「自由曲面基準」を選択する。これにより図96の自由曲面基準設定画面250に移行する。   Hereinafter, a specific method for setting the free-form surface reference will be described based on the GUI shown in FIGS. Also in the free-form surface reference, the necessary conditions for determining the reference surface are set in advance prior to the operation (step S83 in FIG. 8 described above), as in the above-described average height reference. First, the “height extraction” button 116 is selected on the GUI screen shown in FIG. 62, and the process proceeds to the height extraction selection screen 140 shown in FIG. 80. The extraction method selection means 142 selects “real time extraction” corresponding to the dynamic conversion. Then, the height dynamic extraction setting screen 190 of FIG. 88 is displayed. Next, in the “calculation method” selection column 192, “free-form surface criterion” is selected as the dynamic conversion criterion as shown in FIG. This shifts to the free curved surface reference setting screen 250 of FIG.

自由曲面基準設定画面250でも、任意の領域を自由曲面対象領域として指定することも可能であるが、好ましくは、第二画像表示領域121で表示される画像の全体、又は別途指定された検査対象領域を、そのまま自由曲面対象領域として利用する。自由曲面対象領域として指定された領域から、高調波成分を除去して自由曲面を生成する。そして第二画像表示領域121上で表示される自由曲面対象領域に、自由曲面を基準面として階調変換を行った階調変換画像を重ねて表示させる。また、階調変換に際して、必要に応じてゲイン調整や抽出高さの指定、ノイズ除去等を行うこともできるのも、上述した図90等と同様である。
(抽出サイズ調整手段)
Although it is possible to specify an arbitrary area as the free curved surface target area on the free curved surface reference setting screen 250, preferably, the entire image displayed in the second image display area 121 or an inspection target specified separately. The area is used as a free curved surface target area as it is. A free-form surface is generated by removing harmonic components from the area designated as the free-form surface target area. Then, a gradation-converted image that has been subjected to gradation conversion using the free-form surface as a reference plane is superimposed and displayed on the free-form surface target area displayed on the second image display area 121. Also, in the tone conversion, gain adjustment, extraction height designation, noise removal, and the like can be performed as necessary, as in FIG. 90 described above.
(Extraction size adjustment means)

さらに、自由曲面基準で抽出される抽出面の細かさ(抽出サイズ)を調整する抽出サイズ調整機能も備えている。具体的には、図96において、操作欄の「抽出面の詳細設定」欄に、抽出サイズ調整手段として「抽出サイズ」指定欄252を設けている。「抽出サイズ」指定欄252の数値を増減させると、これに応じて自由曲面の曲率が変化し、抽出可能な欠陥のサイズが変動する。ここでは、設定されたサイズ以下の凹凸が抽出されるように、自由曲面画像が生成され、第二画像表示領域121に表示される。抽出サイズを大きくすると滑らかな自由曲面が生成され、設定された抽出サイズに応じた大きさの欠陥が抽出できる。一方、抽出サイズを小さくすると、ワークの表面形状に沿った自由曲面が生成されるようになり、設定された抽出サイズに応じた小さな欠陥のみが抽出される。例えば、抽出サイズを大きくすると図97に示すように自由曲面がワークの表面形状に対して滑らかとなるので、平滑化された基準面でもって抽出される凹凸が明瞭になる。逆に数値を小さくすると、図90に示すように自由曲面がワークの表面形状の凹凸に沿った詳細な形状に近づくため、結果としてこのような複雑な基準面でもって抽出される凹凸は不鮮明となる。また、「抽出サイズ」指定欄252の数値を増減させると、これにつれて第二画像表示領域121において表示されている自由曲面対象領域内の階調変換画像も、基準面として内部的に生成される自由曲面の状態が変化し、基準面からの差分として抽出・表示される対象物の大きさがリアルタイムに変化する。ユーザは、第二画像表示領域121を参照しながら、「抽出サイズ」指定欄252の数値を最適に調整できる。   Furthermore, an extraction size adjustment function for adjusting the fineness (extraction size) of the extraction surface extracted based on the free-form surface is also provided. Specifically, in FIG. 96, an “extraction size” designation field 252 is provided as an extraction size adjustment means in the “detailed extraction surface setting” field of the operation field. When the numerical value in the “extraction size” designation field 252 is increased or decreased, the curvature of the free-form surface changes accordingly, and the size of the defect that can be extracted changes. Here, a free-form surface image is generated and displayed in the second image display area 121 so that unevenness having a size smaller than the set size is extracted. When the extraction size is increased, a smooth free-form surface is generated, and a defect having a size corresponding to the set extraction size can be extracted. On the other hand, if the extraction size is reduced, a free-form surface along the surface shape of the workpiece is generated, and only small defects corresponding to the set extraction size are extracted. For example, when the extraction size is increased, the free-form surface becomes smooth with respect to the surface shape of the workpiece as shown in FIG. 97, and the unevenness extracted by the smoothed reference surface becomes clear. On the contrary, if the numerical value is reduced, the free-form surface approaches the detailed shape along the unevenness of the surface shape of the workpiece as shown in FIG. 90. As a result, the unevenness extracted with such a complicated reference surface is unclear. Become. Further, when the numerical value in the “extraction size” designation field 252 is increased or decreased, the gradation conversion image in the free curved surface target area displayed in the second image display area 121 is generated internally as the reference plane accordingly. The state of the free-form surface changes, and the size of the object extracted and displayed as the difference from the reference surface changes in real time. The user can optimally adjust the numerical value in the “extraction size” designation field 252 while referring to the second image display area 121.

このようにして自由曲面対象領域が規定されると、設定画面を終了する。階調変換の際には、この自由曲面対象領域に含まれる画像の高さ情報から、自由曲面を演算する。自由曲面対象領域内に分布する高さ情報のフィッティングには、図161のフローチャートに示すように、設定された抽出サイズに応じた画像縮小処理(ステップS1611)とフィルタ処理(ステップS1612)と画像拡大処理(ステップS1613)を行って、自由曲面画像を生成する方法が利用できる。フィルタ処理には、例えばメディアンフィルタが利用できる。このようにして自由曲面が決定されると、元の画像から差分を取ることで(ステップS1614)、抽出される凹凸などを明確にできる。あるいは、上述の通り最小二乗法等、既知の方法が適宜利用できる。なお、自由曲面対象領域に含まれるすべての点の高さ情報を推定面の演算に利用する必要は必ずしもなく、適宜間引く、あるいは平均化する等、処理を簡略化できることは上述の通りである。このようにして自由曲面が決定されると、この自由曲面を基準として、階調変換を行う。例えば、自由曲面が距離レンジの中心値となるように階調変換する。   When the free-form surface target area is defined in this way, the setting screen is terminated. At the time of gradation conversion, a free curved surface is calculated from the height information of the image included in the free curved surface target area. For fitting height information distributed in a free-form surface target area, as shown in the flowchart of FIG. 161, image reduction processing (step S1611), filter processing (step S1612), and image enlargement according to the set extraction size. A method of generating a free-form surface image by performing the process (step S1613) can be used. For the filter process, for example, a median filter can be used. When the free-form surface is determined in this way, the extracted irregularities and the like can be clarified by taking the difference from the original image (step S1614). Alternatively, as described above, a known method such as a least square method can be used as appropriate. Note that it is not always necessary to use the height information of all points included in the free-form surface target area for the calculation of the estimation surface, and as described above, the processing can be simplified such as thinning out or averaging appropriately. When the free-form surface is determined in this way, gradation conversion is performed using the free-form surface as a reference. For example, gradation conversion is performed so that the free-form surface becomes the center value of the distance range.

ここで、基準面を自由曲面で指定する方法が有効なワークの例を、図98A〜図98Bに基づいて説明する。図98Aは、ワークの曲面状の面に含まれる突起物や窪み等の欠陥を検出する検査処理を示している。ここで計測領域ROIとして曲面から欠陥を含む領域を指定する。そして、指定された計測領域ROI内に含まれる高さ情報から自由曲面を求めて、得られた自由曲面を基準面として階調変換を行う。得られた低階調距離画像を図98Bに示す。この図に示すように、自由曲面を基準として、この面より高い部分を突起物(図98Bにおいて白点で表示される)、低い部分を窪み(図98Bにおいて黒点で表示される)として、それぞれ検出できる。このように、自由曲面による基準面の指定は、曲面形状のワークに対して有効に利用できる。なお、自由曲面の検出の処理負荷は、上述した一点指定や三点指定に比べて高い。
(欠陥抽出処理)
Here, an example of a work in which the method of designating the reference surface as a free-form surface is effective will be described with reference to FIGS. 98A to 98B. FIG. 98A shows an inspection process for detecting defects such as protrusions and depressions included in the curved surface of the workpiece. Here, a region including a defect is designated from the curved surface as the measurement region ROI. Then, a free curved surface is obtained from height information included in the designated measurement region ROI, and gradation conversion is performed using the obtained free curved surface as a reference plane. The obtained low gradation distance image is shown in FIG. 98B. As shown in this figure, on the basis of a free-form surface, a portion higher than this surface is a projection (displayed as a white dot in FIG. 98B), and a lower portion is a depression (displayed as a black dot in FIG. 98B), respectively. It can be detected. As described above, the specification of the reference surface by the free-form surface can be effectively used for the workpiece having the curved surface shape. The processing load for detecting a free-form surface is higher than the one-point designation or the three-point designation described above.
(Defect extraction process)

上述した自由曲面基準において、図161のステップS1611で示す画像縮小処理に際して、距離画像の縦横、すなわちXY方向に対して圧縮を行うと、検査対象物の曲面の状態によっては曲面と欠陥とを分離しきれず、思うように傷を抽出できない場合がある。例えば、図162に示すようなチューブ状の検査対象物を撮像した距離画像において、抽出対象1と抽出対象2を抽出しようとする例を考える。このような距離画像に対して、自由曲面基準を選択してXY方向に画像の圧縮を行うと、図163に示すように、チューブ状の長さ方向に沿って存在する山谷も抽出されてしまい、その一方で本来抽出したい抽出対象2は綺麗に抽出されていない状態となる。
(抽出方向指定手段)
In the above-described free-form surface criterion, in the image reduction process shown in step S1611 of FIG. In some cases, the wound cannot be extracted as expected. For example, consider an example in which extraction object 1 and extraction object 2 are to be extracted from a distance image obtained by imaging a tube-shaped inspection object as shown in FIG. When a free-form surface criterion is selected for such a distance image and the image is compressed in the XY directions, as shown in FIG. 163, peaks and valleys existing along the tube-like length direction are also extracted. On the other hand, the extraction object 2 that is originally desired to be extracted is not neatly extracted.
(Extraction direction designation means)

そこで、このような場合でも正確な欠陥検出が実現できるように、検査対象面において特定の方向に連続して存在する形状を除外して、欠陥すなわち局所的な凹凸を抽出する抽出方向指定機能を設けることもできる。例えば、検査条件の指定時に抽出方向を指定可能な抽出方向指定手段を設ける。具体的には図89等に示すGUIの「計算方法」選択欄192において「自由曲面基準」を選択すると、上述した図96等に代えて、図164の自由曲面基準設定画面630のGUIを表示させる。図164の自由曲面基準設定画面630においては、「抽出サイズ」指定欄252の下方に、抽出方向指定手段の一形態として「抽出方向」指定欄632を追加する。「抽出方向」指定欄632においては、抽出すべき欠陥等の局所的な形状変化を抽出する方向を指定する。この例では予め設定された選択肢として、「X」,「Y」,「XY」のいずれかをドロップダウンリスト等により選択できる。また図164の画面において「詳細設定」ボタン222を押下すると、同様に図165に示す詳細設定画面640に切り替わり、強調方法設定欄154にはゲイン調整欄156、「抽出高さ」設定欄162、ノイズ除去設定欄164、無効画素指定欄166等が表示され、これらの詳細な設定が可能となる。   Therefore, in order to realize accurate defect detection even in such a case, an extraction direction designating function for extracting defects, that is, local irregularities, by excluding shapes continuously existing in a specific direction on the inspection target surface. It can also be provided. For example, an extraction direction designating unit that can designate an extraction direction when designating inspection conditions is provided. Specifically, when “free-form surface reference” is selected in the “calculation method” selection field 192 of the GUI shown in FIG. 89, the GUI of the free-form surface reference setting screen 630 in FIG. 164 is displayed instead of the above-described FIG. Let In the free-form surface reference setting screen 630 of FIG. 164, an “extraction direction” designation field 632 is added below the “extraction size” designation field 252 as one form of extraction direction designation means. In the “extraction direction” designation column 632, a direction in which a local shape change such as a defect to be extracted is extracted is designated. In this example, any one of “X”, “Y”, and “XY” can be selected from a drop-down list as a preset option. When the “detailed setting” button 222 is pressed on the screen of FIG. 164, the screen is similarly switched to the detailed setting screen 640 shown in FIG. 165. A noise removal setting field 164, an invalid pixel designation field 166, and the like are displayed, and these detailed settings can be made.

例えば図164や図165の画面で「抽出方向」指定欄632において「Y」を選択すると、画像のY方向(図162において縦方向)における局所的な形状変化を抽出する。言い換えると、Y方向において変化しない形状、例えば縦方向に延びる溝等は無視されて、図166に示すような検出結果が得られる。同様にXを選択すると、画像のX方向(図162において横方向)における形状変化が抽出される。またXYを選択すると、図163に示したような、XY方向における局所的な形状変化が抽出される。これにより、検査対象物の形状に応じて抽出方向を指定することで、不要な形状をキャンセルして所望の形状を適切に抽出できる。例えば図167に示すような検査対象物において、文字列1、文字列2を抽出したい場合、XY方向に抽出しようとすると図168に示すように長手方向に存在する凹凸も検出されてしまうが、抽出方向としてY方向を指定することで、図169に示すようにY方向に一様な形状を除去して、所望の文字列を正確に抽出できる。   For example, when “Y” is selected in the “extraction direction” designation field 632 on the screens of FIGS. 164 and 165, a local shape change in the Y direction (vertical direction in FIG. 162) of the image is extracted. In other words, a shape that does not change in the Y direction, such as a groove extending in the vertical direction, is ignored, and a detection result as shown in FIG. 166 is obtained. Similarly, when X is selected, a shape change in the X direction (lateral direction in FIG. 162) of the image is extracted. When XY is selected, a local shape change in the XY direction as shown in FIG. 163 is extracted. Thereby, by designating the extraction direction according to the shape of the inspection object, an unnecessary shape can be canceled and a desired shape can be appropriately extracted. For example, in the inspection object as shown in FIG. 167, when it is desired to extract the character string 1 and the character string 2, the unevenness existing in the longitudinal direction as shown in FIG. By designating the Y direction as the extraction direction, a desired character string can be accurately extracted by removing a uniform shape in the Y direction as shown in FIG.

ここで具体的な欠陥抽出処理等の形状抽出方法として、図166、図169に示したY方向の抽出処理を例として説明する。上述した画像縮小処理(図161のステップS1611)において、画像のY方向にのみ縮小を行う。この結果、フィルタ処理(ステップS1612)と画像拡大処理(ステップS1613)を得て得られた基準となる自由曲面画像は、Y方向の細かい凹凸が除去され、Y方向にのみ平滑化された自由曲面画像が生成されることとなる。いいかえると、Y方向に一様なキャンセル対象の形状のみが残された画像を得られる。このため、対象となる元画像に対して、この自由曲面画像との差分を取ると(ステップS1614)、Y方向に一様なキャンセル対象の形状が除去されることとなり、結果としてY方向に細かく凹凸した形状変化のみが残されることとなる。これにより、所望の方向における形状変化のみを抽出することが実現される。   Here, as a specific shape extraction method such as defect extraction processing, the extraction processing in the Y direction shown in FIGS. 166 and 169 will be described as an example. In the above-described image reduction process (step S1611 in FIG. 161), the image is reduced only in the Y direction. As a result, the reference free-form surface image obtained by obtaining the filter process (step S1612) and the image enlargement process (step S1613) has a free-form surface that is smoothed only in the Y direction by removing fine irregularities in the Y direction. An image will be generated. In other words, it is possible to obtain an image in which only the shape to be canceled that is uniform in the Y direction remains. For this reason, if the difference between the target original image and this free-form curved surface image is taken (step S1614), the shape of the cancellation target that is uniform in the Y direction is removed. Only uneven shape changes are left. Thereby, it is realized to extract only the shape change in a desired direction.

このような処理は、特に一方向に長い検査対象物の検査に有効である。検査対象物の長手方向に沿って抽出方向を指定することで、長手方向に沿って連続した一様形状をキャンセルでき、正確な欠陥抽出が実現できる。   Such processing is particularly effective for inspection of an inspection object that is long in one direction. By designating the extraction direction along the longitudinal direction of the inspection object, a uniform shape continuous along the longitudinal direction can be canceled, and accurate defect extraction can be realized.

また、このような一方向に連続した検査対象物(例えばタイヤのような、一方向に一様な形状を持つ製品)の高さ情報を取得するには、構造化照明以外に、上述した光切断法を用いた検査が好適に適用できる。特に光切断法は、ライン状の切断面の形状(プロファイル)を取得する方法であるため、一方向に長い検査対象物に対して、切断位置を変化させながら連続的にプロファイルを取得し、得られたプロファイルを合成することで距離画像を取得できる。この方法であれば、検査対象物が移動する場合でも、いいかえると検査対象物を静止させなくとも検査できるため、例えば工場のライン上を搬送される製品の検査のような用途において、搬送される製品を停止させることなく不良品の検出を行うことが可能となる。   In addition to structured illumination, the above-described light is used to obtain height information of such an inspection object that is continuous in one direction (for example, a product having a uniform shape in one direction, such as a tire). Inspection using a cutting method can be suitably applied. In particular, the optical cutting method is a method for acquiring the shape (profile) of a line-shaped cut surface, and therefore, for a test object that is long in one direction, the profile is continuously acquired while changing the cutting position. A distance image can be acquired by combining the obtained profiles. With this method, even if the inspection object moves, in other words, the inspection object can be inspected without being stationary, so that the inspection object is conveyed in applications such as inspection of products conveyed on the factory line. Defective products can be detected without stopping the product.

なお以上の例では、欠陥抽出処理を自由曲面基準に適用する例を説明したが、本発明は自由曲面基準に限らず、他の基準面に対しても適用できる。例えば、基準面として平均高さ基準を選択した際に、上述した欠陥抽出処理を適用することで、指定された方向に、ライン毎の平均高さを求めて、その平均高さからの差分を取ることができる。この方法によれば処理が単純なため、高速な処理が可能となる利点が得られる。
(抽出領域設定ダイヤログ148)
In the above example, the example in which the defect extraction processing is applied to the free-form surface reference has been described. However, the present invention is not limited to the free-form surface reference and can be applied to other reference surfaces. For example, when the average height reference is selected as the reference plane, the above-described defect extraction process is applied to obtain the average height for each line in the specified direction, and the difference from the average height is calculated. Can be taken. According to this method, since processing is simple, there is an advantage that high-speed processing is possible.
(Extraction area setting dialog 148)

さらに、高さ抽出を行うに際して、入力画像から基準平面を算出するための対象領域(抽出領域)は、検査処理を行う検査対象領域(計測領域)と同じ領域とする他、計測領域とは別個に設定することもできる。一例として、図90において、「抽出領域」ボタン147を押下すると、図99に示すように抽出領域を設定可能な抽出領域設定ダイヤログ148が表示される。この抽出領域設定ダイヤログ148には抽出領域選択欄149が設けられ、抽出領域選択欄149からユーザは「計測領域と同じ」、「矩形」、「円形」、「回転矩形」等を選択できる。「計測領域と同じ」を選択すると、上述の通り抽出領域が計測領域と同じとなる。一方、「計測領域と同じ」以外を選択することで、計測領域とは異なる領域を抽出領域として設定できる。例えば図100に示すように抽出領域選択欄149で「矩形」を選択すると、第二画像表示領域121において矩形状の枠が表示され、ユーザは所望の領域をマウスのドラッグ等によって指定できる。また図100の抽出領域選択欄149の右に設けられた「編集」ボタン324を押下すると、図101に示すように抽出領域編集ダイヤログ326が表示され、矩形状の抽出領域をxy座標で数値により指定できる。抽出領域編集ダイヤログ326で抽出領域が調整されると、その変更が第二画像表示領域121において反映される。
(マスク領域設定欄330)
Further, when performing height extraction, the target area (extraction area) for calculating the reference plane from the input image is the same area as the inspection target area (measurement area) for performing the inspection process, and is separate from the measurement area. Can also be set. As an example, when an “extraction area” button 147 is pressed in FIG. 90, an extraction area setting dialog 148 capable of setting the extraction area is displayed as shown in FIG. The extraction area setting dialog 148 is provided with an extraction area selection field 149 from which the user can select “same as measurement area”, “rectangle”, “circular”, “rotation rectangle”, and the like. When “same as measurement region” is selected, the extraction region becomes the same as the measurement region as described above. On the other hand, by selecting other than “same as measurement area”, an area different from the measurement area can be set as the extraction area. For example, as shown in FIG. 100, when “rectangle” is selected in the extraction area selection field 149, a rectangular frame is displayed in the second image display area 121, and the user can specify a desired area by dragging the mouse or the like. When the “edit” button 324 provided on the right side of the extraction area selection field 149 in FIG. 100 is pressed, an extraction area editing dialog 326 is displayed as shown in FIG. 101, and the rectangular extraction area is numerically expressed in xy coordinates. Can be specified. When the extraction area is adjusted in the extraction area editing dialog 326, the change is reflected in the second image display area 121.
(Mask area setting field 330)

さらに抽出領域設定ダイヤログ148から、抽出領域としない領域を指定するためのマスク領域も設定できる。図99の例では、抽出領域選択欄149の下部にマスク領域設定欄330が設けられている。マスク領域設定欄330では、複数のマスク領域を設定できる。ここでは0〜3の最大4つのマスク領域が指定でき、各マスク領域は独立して設定できる。例えば図102に示すようにマスク領域0として「円形」を選択すると、第二画像表示領域121上に円形のマスク領域0が表示される。さらにこの状態から「編集」ボタン332を押下すると、図103に示すように円形のマスク領域0の詳細を規定するためのマスク領域編集ダイヤログ334が表示される。ユーザは、円形のマスク領域0を、中心のxy座標と半径とで規定できる。マスク領域は、第二画像表示領域121において抽出領域とは異なる色の枠線で表示され、ユーザが抽出領域とマスク領域とを視覚的に区別し易くしている。図103の例では、抽出領域を緑色、マスク領域を黄色で表示している。ただ、この例に限らず、異なる色で区別したり、線の太さや線種(実線、破線等)、ハイライト(点滅や強調)等で区別することも可能であることはいうまでもない。   Further, from the extraction area setting dialog 148, a mask area for designating an area not to be an extraction area can be set. In the example of FIG. 99, a mask area setting field 330 is provided below the extraction area selection field 149. In the mask area setting column 330, a plurality of mask areas can be set. Here, a maximum of four mask areas from 0 to 3 can be designated, and each mask area can be set independently. For example, as shown in FIG. 102, when “circular” is selected as the mask area 0, the circular mask area 0 is displayed on the second image display area 121. When the “edit” button 332 is further pressed from this state, a mask area edit dialog 334 for defining details of the circular mask area 0 is displayed as shown in FIG. The user can define the circular mask region 0 by the center xy coordinate and the radius. The mask area is displayed in the second image display area 121 with a frame line having a color different from that of the extraction area, so that the user can easily visually distinguish the extraction area and the mask area. In the example of FIG. 103, the extraction area is displayed in green and the mask area is displayed in yellow. However, the present invention is not limited to this example, and it is needless to say that it can be distinguished by different colors, line thickness, line type (solid line, broken line, etc.), highlight (flashing or emphasis), etc. .

このようにして、抽出領域を計測領域とは独立して設定することも可能となる。また、抽出領域の設定内容は、文字情報で表示させることもできる。例えば図90の例では、「抽出領域」ボタン147の下部にテキストで「計測領域と同じ」と表示しており、平面基準を算出する抽出領域が計測領域と同じであることを示している。またその下部には「マスク領域:無効」と表示し、抽出領域にマスク領域が設定されていないことを示している。これによってユーザは、「抽出領域」の概略をテキスト情報としても確認できる。
(前処理設定)
In this way, the extraction area can be set independently of the measurement area. The setting contents of the extraction area can be displayed as character information. For example, in the example of FIG. 90, the text “Same as Measurement Area” is displayed below the “Extraction Area” button 147, indicating that the extraction area for calculating the plane reference is the same as the measurement area. In addition, “mask area: invalid” is displayed at the lower part thereof, indicating that no mask area is set in the extraction area. As a result, the user can check the outline of the “extraction area” as text information.
(Pre-processing setting)

以上のようにして、「エリア」処理ユニットで、高さ抽出の設定を終えると、図104に示すように第三画像表示領域において、「エリア」処理ユニットで設定された領域の矩形内では、抽出された高さに基づいて階調変換された低階調距離画像が重ねて表示される。次に、前処理の設定を行う。前処理とは、上述の通り距離画像を生成する前に行う共通のフィルタ処理であり、ここでは各種のフィルタを選択できる。具体的には、図104の画面から、設定項目ボタン領域112に設けられた「前処理」ボタンを選択すると、図105のフィルタ処理設定画面340となり、適用するフィルタを選択できる。ここで選択可能なフィルタとしては、平均化フィルタ、メディアンフィルタ、ガウシアンフィルタ等が挙げられる。さらに、このようなフィルタ以外にも、例えば二値化レベルの設定も可能である。例えば図106の二値化レベル設定画面350では、二値化を行う上限値や下限値、回数を設定できる。また二値化された画素の分布を示すヒストグラムを表示させたり、入力画像に連動してヒストグラムを更新する機能を持たせてもよい。このようにしてフィルタ処理設定が終了すると、図107に示すように第三画像表示領域において、設定された領域内でフィルタ処理を経て二値化された低階調距離画像が重ねて表示される。
(判定設定)
As described above, when the setting of height extraction is completed in the “area” processing unit, in the third image display area in the rectangle of the area set by the “area” processing unit as shown in FIG. A low gradation distance image obtained by gradation conversion based on the extracted height is superimposed and displayed. Next, pre-processing is set. The preprocessing is common filter processing performed before generating a distance image as described above, and various filters can be selected here. More specifically, when a “pre-process” button provided in the setting item button area 112 is selected from the screen of FIG. 104, a filter processing setting screen 340 of FIG. 105 is displayed, and an applied filter can be selected. Examples of filters that can be selected include an averaging filter, a median filter, and a Gaussian filter. Further, in addition to such a filter, for example, a binarization level can be set. For example, on the binarization level setting screen 350 in FIG. 106, an upper limit value, a lower limit value, and the number of times for binarization can be set. Further, a histogram indicating the binarized pixel distribution may be displayed, or a function of updating the histogram in conjunction with the input image may be provided. When the filter processing setting is completed in this way, as shown in FIG. 107, in the third image display region, the low gradation distance image binarized through the filter processing within the set region is displayed in an overlapping manner. .
(Judgment setting)

さらに「エリア」処理ユニットでは、設定された領域、高さ抽出、前処理等の条件にしたがって、入力画像を低階調距離画像に階調変換した後、この低階調距離画像に対して高さ検査や画像検査等の判定を行う条件についても規定する。例えば図107の画面から、設定項目ボタン領域112に設けられた「判定条件」ボタンを押下すると、図108の判定条件設定画面360となり、判定条件を設定する。この例では、二値化された低階調距離画像の画素をカウントして、その数値が所定の範囲内にあるときをOK、ないときをNGに設定している。図108の例では、判定条件が0〜30であり、現在値が166であるため、NGと判定され、図109に示すように、第三画像表示領域において「判定結果:NG」と赤文字で表示される。このように、判定結果がNGの場合は、文字を赤文字とする等、目立つ態様とすることで、運用時にユーザが認識し易くできる。
(「ブロブ」処理ユニット267)
Furthermore, the “area” processing unit converts the input image into a low gradation distance image according to the set region, height extraction, preprocessing, and other conditions, and then converts the low gradation distance image to a high gradation distance image. The conditions for performing determinations such as height inspection and image inspection are also specified. For example, when the “determination condition” button provided in the setting item button area 112 is pressed from the screen of FIG. 107, the determination condition setting screen 360 of FIG. 108 is displayed, and the determination condition is set. In this example, the pixels of the binarized low gradation distance image are counted, and when the numerical value is within a predetermined range, OK is set and when it is not set, NG is set. In the example of FIG. 108, since the determination condition is 0 to 30 and the current value is 166, it is determined as NG, and “determination result: NG” and red characters are displayed in the third image display area as shown in FIG. Is displayed. As described above, when the determination result is NG, a user can easily recognize the character at the time of operation by adopting a conspicuous aspect such as a red character.
("Blob" processing unit 267)

また、以上は高さ情報を用いた高さ検査に基づく判定について説明したが、本発明はこれに限らず、従来の輝度画像に対する画像検査に基づいた判定処理を加えることも可能である。このような画像検査をブロブと呼ぶ。例えば図110に示すように、フロー表示領域261において「エリア」処理ユニットの下部に、ブロブ(画像検査)を行う「ブロブ」処理ユニット267を追加する。「ブロブ」処理ユニット267においても、上記と同様に、対象領域を設定し前処理を設定したり(図111)、検出条件を設定したりして(図112)、判定条件を設定して判定結果を出力させることができる(図113)。
(「色検査」処理ユニット267B)
Further, the determination based on the height inspection using the height information has been described above. However, the present invention is not limited to this, and a determination process based on the image inspection on the conventional luminance image can be added. Such an image inspection is called a blob. For example, as shown in FIG. 110, a “blob” processing unit 267 for performing a blob (image inspection) is added below the “area” processing unit in the flow display area 261. Also in the “blob” processing unit 267, in the same manner as described above, the target region is set and the preprocessing is set (FIG. 111), the detection condition is set (FIG. 112), and the determination condition is set and the determination is made. The result can be output (FIG. 113).
("Color inspection" processing unit 267B)

さらに、撮像手段としてカラーCCDカメラを接続している場合等、カラーの光学画像を入力できる場合は、色検査を組み合わせることも可能である。例えば図114に示すように、フロー表示領域261において「ブロブ」処理ユニット267の下部に、計測処理として色検査を行う「色検査」処理ユニット267Bを追加する。「色検査」処理ユニット267Bにおいても、上記と同様に、対象領域を設定したり(図115、図116)、濃度平均等の詳細設定を行ったりして(図117)、判定条件を設定して判定結果を出力させることができる(図118)。   Furthermore, when a color optical image can be input, such as when a color CCD camera is connected as an imaging means, it is possible to combine color inspection. For example, as shown in FIG. 114, a “color inspection” processing unit 267B that performs color inspection as a measurement process is added below the “blob” processing unit 267 in the flow display area 261. Also in the “color inspection” processing unit 267B, in the same manner as described above, the target region is set (FIGS. 115 and 116), detailed settings such as density averaging are performed (FIG. 117), and determination conditions are set. The determination result can be output (FIG. 118).

以上のようにして、設定モードにて各種の設定を行った後、運用モードにおいて実際にワークを撮像して入力画像を取得し、高さ検査や画像検査の結果に基づいて判定処理を行う。なお、上記の例では、設定モードにおいても判定結果を出力可能な構成とすることで、判定結果をイメージを設定段階でユーザに認識し易くしている。ただ、判定結果は運用モードにおいてのみ出力可能とすることも可能であることはいうまでもない。
(運用モード)
As described above, after various settings are made in the setting mode, the workpiece is actually imaged in the operation mode to obtain an input image, and determination processing is performed based on the results of the height inspection and the image inspection. In the above example, the configuration is such that the determination result can be output even in the setting mode, so that the user can easily recognize the determination result in the setting stage. However, it goes without saying that the determination result can be output only in the operation mode.
(Operation mode)

次に、図4A、図4Bに示す三次元画像処理装置におけるヘッド部、コントローラ部内部での、運用時の処理について、図119、図120のフローチャートに基づいて説明する。まず、図4A、図5に示す実施の形態3に係る三次元画像処理装置のヘッド部での運用時の処理の流れを、図119のフローチャートに基づいて説明する。
(実施の形態3に係る処理の流れ)
Next, processing during operation in the head unit and controller unit in the 3D image processing apparatus shown in FIGS. 4A and 4B will be described based on the flowcharts in FIGS. 119 and 120. First, the flow of processing during operation of the head unit of the 3D image processing apparatus according to Embodiment 3 shown in FIGS. 4A and 5 will be described based on the flowchart of FIG.
(Processing flow according to Embodiment 3)

まず、外部からトリガが入力されると(ステップS11901)、第一プロジェクタ20Aから一の投光パターンがワークに投光され(ステップS11902)、撮像手段で撮像する(ステップS11903)。次に、すべての投光パターンについて撮像が終了したかどうかを判定し(ステップS11904)、未だの場合は投光パターンを切り替えて(ステップS11905)、ステップS11902に戻って処理を繰り返す。ここでは、位相シフト法を用いた投光パターンでパターン投影画像を8枚、さらに空間コード化法を用いた投光パターンでパターン投影画像を8枚の、計16枚のパターン投影画像を撮像する。   First, when a trigger is input from the outside (step S11901), one projection pattern is projected from the first projector 20A onto the work (step S11902), and an image is picked up by the imaging means (step S11903). Next, it is determined whether imaging has been completed for all the light projection patterns (step S11904). If not yet, the light projection patterns are switched (step S11905), and the process returns to step S11902 to repeat the process. Here, a total of 16 pattern projection images are captured, including eight pattern projection images with a projection pattern using the phase shift method and eight pattern projection images with a projection pattern using the spatial encoding method. .

一方、ステップS11904においてすべての投光パターンを撮像し終えた場合は、ステップS11906とステップS11907に分岐する。まずステップS11906において三次元計測演算を実行し、距離画像Aを生成する。   On the other hand, if all the light projection patterns have been imaged in step S11904, the process branches to step S11906 and step S11907. First, in step S11906, a three-dimensional measurement calculation is executed to generate a distance image A.

その一方でステップS11907において、位相シフト法で撮像した複数のパターン投影画像(パターン投影画像群)から、これを平均した平均画像A’を演算する。   On the other hand, in step S11907, an average image A ′ obtained by averaging the plurality of pattern projection images (pattern projection image group) captured by the phase shift method is calculated.

以上のステップS11902〜S11906は、第一プロジェクタ20Aからのパターン投光による三次元計測である。次に第二プロジェクタ20Bからのパターン投光による三次元計測を行う。ここでは、ステップS11906に続いてステップS11908において、ステップS11902〜S11905と同様に、第二プロジェクタ20Bから投光パターンがワークに投光され(ステップS11908)、撮像手段で撮像し、(ステップS11909)、すべての投光パターンについて撮像が終了したかどうかを判定する(ステップS11910)。未だの場合は投光パターンを切り替えて(ステップS11911)ステップS11902に戻り処理を繰り返し、一方すべての投光パターンを撮像し終えた場合は、ステップS11912とステップS11912に分岐する。ステップS11912においては三次元計測演算を実行し、距離画像Bを生成する。一方ステップS11913においては、位相シフト法で撮像したパターン投影画像群の平均画像B’を演算する。このようにして三次元距離画像A、Bが生成されると、ステップS11914において、三次元距離画像A、Bを合成して、距離画像を生成する。またステップS11915において、平均画像A’、B’を用いて、これらを合成した輝度画像(平均二次元濃淡画像)を生成する。このようにして、図5の三次元画像処理装置において、ワークの高さ情報を有する距離画像が取得される。なお輝度画像が不要の場合は、ステップS11907、S11913、S11915を省略できる。
(実施の形態4の処理の流れ)
Steps S11902 to S11906 described above are three-dimensional measurement by pattern projection from the first projector 20A. Next, three-dimensional measurement is performed by pattern projection from the second projector 20B. Here, following step S11906, in step S11908, similarly to steps S11902 to S11905, the projection pattern is projected from the second projector 20B onto the workpiece (step S11908), and is imaged by the imaging means (step S11909). It is determined whether or not imaging has been completed for all the light projection patterns (step S11910). If not, the projection pattern is switched (step S11911) and the process returns to step S11902 to repeat the process. On the other hand, if all the projection patterns have been imaged, the process branches to step S11912 and step S11912. In step S11912, a three-dimensional measurement calculation is performed to generate a distance image B. On the other hand, in step S11913, an average image B ′ of the pattern projection image group captured by the phase shift method is calculated. When the three-dimensional distance images A and B are generated in this way, in step S11914, the three-dimensional distance images A and B are combined to generate a distance image. In step S11915, the average images A ′ and B ′ are used to generate a luminance image (average two-dimensional grayscale image) obtained by combining these images. In this manner, the distance image having the workpiece height information is acquired in the three-dimensional image processing apparatus of FIG. If a luminance image is not necessary, steps S11907, S11913, and S11915 can be omitted.
(Processing flow of Embodiment 4)

以上は、図4Aに示す実施の形態3に係る三次元画像処理装置のヘッド部の処理の流れについて説明した。次に図4Bに示す実施の形態4に係る三次元画像処理装置のヘッド部の処理の流れについて、図120のフローチャートに基づいて説明する。説明する。まず、外部からトリガが入力されると(ステップS12001)、投光手段20から一の投光パターンがワークに投光され(ステップS12002)、第一撮像手段10Aで撮像し、(ステップS12003)、同時に第二撮像手段10Bでも撮像する(ステップS12004)。そしてすべての投光パターンについて撮像が終了したかどうかを判定する(ステップS12005)。未だの場合は投光パターンを切り替えて(ステップS12006)ステップS12002に戻り処理を繰り返し、一方すべての投光パターンを撮像し終えた場合は、ステップS12007〜ステップS12010に分岐する。ステップS12007においては三次元計測演算を実行し、距離画像Aを生成する。ステップS12008においては三次元計測演算を実行し、距離画像Bを生成する。一方、ステップS12009において、位相シフト法で撮像したパターン投影画像群の平均画像A’を演算し、またステップS12010において、位相シフト法で撮像したパターン投影画像群の平均画像B’を演算する。そしてステップS12011において、ステップS12007、S12008で得られた三次元距離画像A、Bを合成して、距離画像を生成する。またステップS12009、10で得られた平均画像A’、B’を合成した輝度画像を生成する。この方法によれば、同時に2枚の画像を撮像できるので、撮像時間の短縮化を図ることができる。
(検査対象領域設定手段)
The processing flow of the head unit of the 3D image processing apparatus according to Embodiment 3 illustrated in FIG. 4A has been described above. Next, the processing flow of the head unit of the 3D image processing apparatus according to Embodiment 4 shown in FIG. 4B will be described based on the flowchart of FIG. explain. First, when a trigger is input from the outside (step S12001), one light projection pattern is projected onto the work from the light projecting unit 20 (step S12002), and the first imaging unit 10A captures an image (step S12003). At the same time, the second image pickup means 10B picks up an image (step S12004). Then, it is determined whether imaging has been completed for all the light projection patterns (step S12005). If not, the projection pattern is switched (step S12006) and the process returns to step S12002 to repeat the process. On the other hand, if all the projection patterns have been imaged, the process branches to steps S12007 to S12010. In step S12007, a three-dimensional measurement calculation is executed to generate a distance image A. In step S12008, a three-dimensional measurement calculation is executed to generate a distance image B. On the other hand, in step S12009, an average image A ′ of the pattern projection image group imaged by the phase shift method is calculated, and in step S12010, an average image B ′ of the pattern projection image group imaged by the phase shift method is calculated. In step S12011, the three-dimensional distance images A and B obtained in steps S12007 and S12008 are combined to generate a distance image. Also, a luminance image is generated by combining the average images A ′ and B ′ obtained in steps S12009 and S10. According to this method, since two images can be taken simultaneously, the imaging time can be shortened.
(Inspection area setting means)

実際の運用時の検査に際して、ワークに対して検査実行手段50で検査を実行する対象となる領域(検査対象領域)を、予め指定しておく必要がある。このような検査対象領域の設定は、設定段階において検査対象領域設定手段により行われる。検査対象領域設定手段は、上述の通りコントローラ部2側に設けたり、あるいは三次元画像処理プログラムにて実現させることもできる。具体的には、上述の通り図62に示す三次元画像処理プログラムの検査対象領域設定手段に相当する「領域設定」ボタン115を押下すると、図47に示す検査対象領域設定画面120に遷移し、この検査対象領域設定画面120において、検査を行う領域を指定することができる。   At the time of actual operation inspection, it is necessary to designate in advance an area (inspection target area) to be inspected by the inspection execution means 50 for the workpiece. Such setting of the inspection target area is performed by the inspection target area setting means in the setting stage. The inspection target area setting means can be provided on the controller unit 2 side as described above, or can be realized by a three-dimensional image processing program. Specifically, as described above, when the “area setting” button 115 corresponding to the inspection area setting means of the 3D image processing program shown in FIG. 62 is pressed, a transition is made to the inspection area setting screen 120 shown in FIG. On the inspection area setting screen 120, an area to be inspected can be designated.

このようにして検査対象領域を指定すると、この検査対象領域に対して三次元画像処理装置が画像処理を行い、さらに検査を実行する。すなわち図121のフローチャートに示すように、距離画像に対して検査対象領域を割り当て(ステップS12101)、この距離画像に基づいて階調変換パラメータを設定し(ステップS12102)、この階調変換パラメータに従って階調変換を行い(ステップS12103)、さらに階調変換画像に対して画像処理を行い、所定検査を行う(ステップS12104)。   When the inspection target area is designated in this way, the three-dimensional image processing apparatus performs image processing on the inspection target area, and further executes the inspection. That is, as shown in the flowchart of FIG. 121, an inspection target area is assigned to the distance image (step S12101), and a gradation conversion parameter is set based on the distance image (step S12102). Tone conversion is performed (step S12103), image processing is further performed on the gradation-converted image, and a predetermined inspection is performed (step S12104).

なお階調変換処理は、上述した検査対象領域設定手段で設定された検査対象領域に対して行われる。すなわちこの例では、検査対象領域設定手段を、階調変換対象領域を指定する階調変換対象領域指定手段と共通としている。ただ、階調変換処理のパラメータを決めるのに用いる領域を、検査対象領域とは独立して設定してもよい。例えば検査対象領域設定手段、あるいはこれとは別個に用意した階調変換パラメータ作成用領域指定手段を用いて、階調変換パラメータ作成用領域を指定する。
(運用時のコントローラ部の動作フロー)
Note that the gradation conversion process is performed on the inspection target area set by the inspection target area setting means described above. That is, in this example, the inspection target area setting means is common to the gradation conversion target area specifying means for specifying the gradation conversion target area. However, the area used for determining the parameters of the gradation conversion process may be set independently of the inspection target area. For example, the gradation conversion parameter creation region is designated using the inspection target region setting means or the gradation conversion parameter creation region designating means prepared separately.
(Operation flow of the controller during operation)

次に、ヘッド部側で得られた距離画像を、運用時にコントローラ部側で処理する手順を、図122のフローチャート、及び図123〜図127のGUIに基づいて説明する。ここで図123〜図126は三次元画像処理プログラムのGUIを示している。図123に示す三次元画像処理プログラムのGUIは初期画面260を示しており、画面の左側にフロー表示領域261を、右側に第三画像表示領域262を、それぞれ設けている。フロー表示領域261においては、三次元画像処理装置で行う各処理の内容を処理ユニット状に繋いだフロー図が表示される。ここでは処理ユニットとして、「撮像」処理ユニット263、「Shapetrax2」処理ユニット264、「位置補正」処理ユニット265、「高さ計測」処理ユニット266がフロー表示領域261に表示されている。また運用前の設定の段階では、各処理ユニットを選択して詳細な設定を行える。また第三画像表示領域262には、処理内容に応じて輝度画像や距離画像、あるいは検査結果等が表示される。図123の例では、ワーク(この例ではIC)を撮像した輝度画像が表示されており、後述するサーチ対象領域SAが緑色の枠状に表示されている。
(撮像ステップ)
Next, a procedure for processing the distance image obtained on the head unit side on the controller unit side during operation will be described based on the flowchart in FIG. 122 and the GUI in FIGS. 123 to 127. 123 to 126 show the GUI of the three-dimensional image processing program. The GUI of the three-dimensional image processing program shown in FIG. 123 shows an initial screen 260, and a flow display area 261 is provided on the left side of the screen, and a third image display area 262 is provided on the right side. In the flow display area 261, a flow diagram in which the contents of each process performed by the 3D image processing apparatus are connected in a processing unit shape is displayed. Here, an “imaging” processing unit 263, a “Shapetrax2” processing unit 264, a “position correction” processing unit 265, and a “height measurement” processing unit 266 are displayed in the flow display area 261 as processing units. Further, at the stage of setting before operation, detailed setting can be performed by selecting each processing unit. The third image display area 262 displays a luminance image, a distance image, an inspection result, or the like according to the processing content. In the example of FIG. 123, a luminance image obtained by imaging a workpiece (IC in this example) is displayed, and a search target area SA described later is displayed in a green frame shape.
(Imaging step)

まず図122のステップS12201において、距離画像と輝度画像をヘッド部1から取得する。ここでは、ヘッド部側でパターン投影画像を撮像し、距離画像と輝度画像を生成する。図123のGUIの例では、フロー表示領域261に表示される「撮像」処理ユニット263が該当する。   First, in step S 12201 in FIG. 122, a distance image and a luminance image are acquired from the head unit 1. Here, a pattern projection image is captured on the head unit side, and a distance image and a luminance image are generated. In the example of the GUI in FIG. 123, the “imaging” processing unit 263 displayed in the flow display area 261 corresponds.

画像データは、先に距離画像をヘッド部からコントローラ部に送信し、次いで輝度画像もコントローラ部に送信する。なお、逆に輝度画像を先に転送した上で距離画像を転送したり、これらの転送を同時に行ってもよい。
(サーチステップ)
For the image data, the distance image is first transmitted from the head unit to the controller unit, and then the luminance image is also transmitted to the controller unit. Conversely, the distance image may be transferred after the luminance image is transferred first, or these transfers may be performed simultaneously.
(Search step)

さらにステップS12202において、運用時に入力される入力画像に対し、コントローラ部でパターンサーチを行う。すなわち、撮像された輝度画像に含まれるワークの動きに追従するように、検査したい部位を特定する。図123の例では、フロー表示領域261に表示される「Shapetrax2」処理ユニット264がパターンサーチに該当する。ここではワークを撮像した輝度画像(入力画像)に対して、図5の画像サーチ手段64がパターンサーチを行い、位置決めを行う。具体的には、予め設定された検査対象領域が、入力された輝度画像中のどこに含まれるか、位置を特定する。パターンサーチを行うサーチ対象領域SAは、予め設定される。例えば図124の例では、第三画像表示領域に表示される輝度画像上で、サーチ対象領域SAが矩形状に指定されている。
(位置補正ステップ)
In step S 12202, the controller unit performs a pattern search on the input image input during operation. That is, a part to be inspected is specified so as to follow the movement of the work included in the captured luminance image. In the example of FIG. 123, the “Shapetrax2” processing unit 264 displayed in the flow display area 261 corresponds to the pattern search. Here, the image search means 64 in FIG. 5 performs a pattern search on the luminance image (input image) obtained by imaging the workpiece to perform positioning. Specifically, the position where the preset inspection target region is included in the input luminance image is specified. The search target area SA for performing the pattern search is set in advance. For example, in the example of FIG. 124, the search target area SA is designated as a rectangle on the luminance image displayed in the third image display area.
(Position correction step)

次にステップS12203において、パターンサーチの結果を用いて検査対象領域を位置補正する。図123の例では、フロー表示領域261に表示される「位置補正」処理ユニット265が該当する。検査対象領域は、検査対象領域設定画面において予め設定される。図125の例では、第三画像表示領域に表示された距離画像上で、検査対象領域が複数、設定されている。詳細には、図126に示すようにワークであるICの各ピンに対して矩形状の領域が設定されている。位置補正は、例えば正規化相関サーチにより位置ずれ量を算出する方法やパターンサーチの結果に基づく方法等によって行われる。このようにして位置補正により、次段で実行される検査処理の検査対象領域の位置が補正される。
(検査処理ステップ)
In step S12203, the position of the inspection target area is corrected using the pattern search result. In the example of FIG. 123, the “position correction” processing unit 265 displayed in the flow display area 261 corresponds. The inspection target area is set in advance on the inspection target area setting screen. In the example of FIG. 125, a plurality of inspection target areas are set on the distance image displayed in the third image display area. Specifically, as shown in FIG. 126, a rectangular area is set for each pin of the IC as a work. The position correction is performed by, for example, a method for calculating a positional deviation amount by a normalized correlation search, a method based on the result of a pattern search, or the like. In this way, the position correction corrects the position of the inspection target area in the inspection process executed in the next stage.
(Inspection processing step)

最後にステップS12204において、補正された位置にて距離画像を用いて検査を実行する。図123の例では、フロー表示領域261に表示される「高さ計測」処理ユニット266が該当する。また図127の例では、高さ計測を実行している。すなわち、補正された位置の検査対象領域でそれぞれ高さが計測され検査される。例えば平面高さが所定の基準値以内かどうかを判定して、判定結果を出力する。   Finally, in step S12204, an inspection is executed using the distance image at the corrected position. In the example of FIG. 123, the “height measurement” processing unit 266 displayed in the flow display area 261 corresponds. In the example of FIG. 127, height measurement is performed. That is, the height is measured and inspected in each of the inspection target areas at the corrected positions. For example, it is determined whether the plane height is within a predetermined reference value, and the determination result is output.

なお以上の手順では、輝度画像を用いて位置補正を行った上で、距離画像に基づいて検査を行う例を説明した。ただ、本発明はこれに限らず、位置補正を行う画像、検査処理を行う画像を任意に設定できる。例えば上記と逆に、距離画像を用いて位置補正を行った上で、輝度画像を用いて検査処理を実行することもできる。一例として、白地の背景に白色のワークが置かれた場合のように、輝度画像では正確なパターンサーチが困難な例においては、距離画像を使用して高さ情報に基づいたパターンサーチが有効となる。また、検査処理についても、高さ情報に基づく判定処理のみならず、例えばワークに印字された文字列をOCRによって読み取る等、輝度画像を用いた画像処理結果によって判定することもできる。
(高さ情報の出力形式)
In the above procedure, the example in which the position is corrected using the luminance image and the inspection is performed based on the distance image has been described. However, the present invention is not limited to this, and an image for position correction and an image for inspection processing can be arbitrarily set. For example, contrary to the above, after performing position correction using the distance image, the inspection process can also be executed using the luminance image. As an example, in an example where it is difficult to perform an accurate pattern search with a luminance image, such as when a white workpiece is placed on a white background, a pattern search based on height information using a distance image is effective. Become. Further, the inspection process can be determined not only based on the height information, but also based on the result of image processing using a luminance image such as reading a character string printed on a work by OCR.
(Height information output format)

計測した三次元の高さ情報はそれぞれX,Y,Zの値を持った三次元ポイントクラウドデータとして求められる。また実際に求められた値を、どのように出力するかについて、三次元ポイントクラウドデータ以外に、例えばZ画像、XY等ピッチZ画像に変換することもできる。
(1:Z画像)
The measured three-dimensional height information is obtained as three-dimensional point cloud data having X, Y, and Z values, respectively. In addition to the three-dimensional point cloud data, it is also possible to convert, for example, how to output the actually obtained values into, for example, a Z image or an XY pitch Z image.
(1: Z image)

Z画像とは、Z座標のみの高さ画像データである。例えば撮像手段で撮像されたワークの位置の凹凸が重要で、X,Y座標は正確でなくても良いような場合は、X,Y座標は不要なので、Z座標のみのデータであるZ画像を出力すれば足りる。この場合は伝送するデータ量が少なくなり、伝送時間を短縮することができる。また通常の二次元の撮像手段と同じく、画像としてデータを扱えるので、既存の二次元画像用の画像処理装置を用いて画像処理を行うこともできる。
(2:XY等ピッチZ画像)
A Z image is height image data of only the Z coordinate. For example, when the unevenness of the position of the workpiece imaged by the imaging means is important and the X and Y coordinates do not need to be accurate, the X and Y coordinates are unnecessary. Output is enough. In this case, the amount of data to be transmitted is reduced, and the transmission time can be shortened. Further, since data can be handled as an image as in a normal two-dimensional imaging means, image processing can be performed using an existing image processing apparatus for two-dimensional images.
(2: XY-equal pitch Z image)

XY等ピッチZ画像とは、XY座標を高さによらず等ピッチとした高さ画像データである。具体的には、XY座標を等ピッチとした場合の位置におけるZ座標を、周辺のポイントクラウドデータから補間演算してXY等ピッチZ画像を求める。   The XY equal pitch Z image is height image data in which the XY coordinates are equal pitches regardless of the height. Specifically, an XY equi-pitch Z image is obtained by interpolating the Z-coordinate at a position where the XY coordinates are equal pitches from surrounding point cloud data.

一般に撮像手段のレンズが対物テレセントリックレンズではない場合は、撮像されたワークの高さ位置(Z座標)により、撮像手段で撮像される位置(X,Y座標)が異なる。このため、撮像素子上で同じ位置に写った物であっても、高さによって実際のXY座標位置は異なることになる。例えば体積のような、立体的な差異を検査したい場合は、カメラに対して近くにワークがあると値が大きくなり、遠くにあると値が小さくなってしまうので不都合となる。そこで、ポイントクラウドデータから、XY均等ピッチのZデータを求めることによって、高さに左右されないXY位置を持ったZ画像を得ることができる。
(3:XYZ(ポイントクラウドデータ))
In general, when the lens of the imaging means is not an objective telecentric lens, the position (X, Y coordinates) imaged by the imaging means differs depending on the height position (Z coordinate) of the imaged work. For this reason, the actual XY coordinate position differs depending on the height even if the object appears at the same position on the image sensor. For example, when it is desired to inspect a three-dimensional difference such as a volume, the value becomes large if there is a workpiece close to the camera, and the value becomes small if it is far away. Therefore, by obtaining Z data having an XY uniform pitch from the point cloud data, a Z image having an XY position that is not affected by the height can be obtained.
(3: XYZ (point cloud data))

あるいは、ポイントクラウドデータを三次元情報としてそのまま出力することもできる。例えば、計測した三次元データをそのまま扱いたい場合に用いる。この場合はZ座標のみの場合に比べてデータ量は3倍になるが、生データであるため、三次元CADデータとの立体的な差分を求める等の用途に利用できる。
(等ピッチ画像の生成)
Alternatively, the point cloud data can be output as it is as three-dimensional information. For example, it is used when the measured three-dimensional data is to be handled as it is. In this case, the data amount is three times that of the case of only the Z coordinate, but since it is raw data, it can be used for purposes such as obtaining a three-dimensional difference from the three-dimensional CAD data.
(Generation of equal pitch images)

次に、距離画像と輝度画像に加え、画角を補正した等ピッチ画像を作成するデータフロー図を図128に示す。この図に示すように、まずヘッド部で撮像する空間コード化用パターン投光ワーク画像群から、空間コード化法に従い空間コード画像を生成する。一方、位相シフト用パターン投光ワーク画像群から、位相計算に従い位相画像を生成する。そしてこれら空間コード画像、位相画像から、位相拡張計算を行って、拡張位相画像を生成する。また、これら空間コード化用パターン投光ワーク画像群や位相シフト用パターン投光ワーク画像群に対して、フィルタをかける等、共通フィルタ処理を適用することもできる。共通フィルタ処理には、メディアンフィルタ、ガウシアンフィルタ、平均化フィルタ等の二次元フィルタの適用が挙げられる。その一方で、位相シフト用パターン投光ワーク画像群を平均化することで、輝度画像(平均濃淡画像)を生成する。
(均等間隔処理)
Next, FIG. 128 shows a data flow diagram for creating an equal pitch image in which the angle of view is corrected in addition to the distance image and the luminance image. As shown in this figure, a spatial code image is first generated from a spatial encoding pattern projecting work image group imaged by the head unit according to a spatial encoding method. On the other hand, a phase image is generated from the phase shift pattern projecting work image group according to the phase calculation. Then, phase expansion calculation is performed from these spatial code image and phase image to generate an extended phase image. Further, a common filter process such as filtering may be applied to the spatial encoding pattern projecting work image group and the phase shift pattern projecting work image group. Common filter processing includes application of a two-dimensional filter such as a median filter, a Gaussian filter, or an averaging filter. On the other hand, a luminance image (average gray image) is generated by averaging the phase shift pattern projecting work image group.
(Equal interval processing)

以上のようにして、ヘッド部で三次元データと輝度画像を生成した後、さらにZ画像、又は等ピッチZ画像等の距離画像を作成する。まず、距離画像をヘッド部1からコントローラ部2に転送して、位相情報を高さ情報に変換する階調変換を行う。ここでは、位相情報からX画像、Y画像、Z画像をそれぞれ求めた上で、これらXYを均等化してXY平面におけるXY等ピッチZ画像、XY等ピッチZ平均画像を取得する。このような均等間隔処理は、間隔均等化処理設定手段47にて行う。   As described above, after the three-dimensional data and the luminance image are generated by the head unit, a distance image such as a Z image or an equal pitch Z image is further created. First, the distance image is transferred from the head unit 1 to the controller unit 2 to perform gradation conversion for converting phase information into height information. Here, after obtaining the X image, Y image, and Z image from the phase information, the XY is equalized to obtain an XY equal pitch Z image and an XY equal pitch Z average image on the XY plane. Such an equal interval process is performed by the interval equalization process setting means 47.

なお、図128の例では距離画像の生成において位相シフト法と空間コード化法を組み合わせた例を説明したが、空間コード化法を使用しないで位相シフト法のみで距離画像を生成することもできる。空間コード化処理は、図5に示す空間コード化切替手段45によってON/OFFを切り替えることができる。このような例を図129のデータフロー図に示す。この図に示すように、空間コード化法を使用しない分、撮像枚数を削減でき、高速にて距離画像を生成できる。   In the example of FIG. 128, the example in which the phase shift method and the spatial encoding method are combined in the generation of the distance image has been described. However, the distance image can be generated only by the phase shift method without using the spatial encoding method. . Spatial encoding processing can be switched ON / OFF by the spatial encoding switching means 45 shown in FIG. Such an example is shown in the data flow diagram of FIG. As shown in this figure, the number of images can be reduced by not using the spatial coding method, and a distance image can be generated at high speed.

一方で、XY等ピッチ化機能をOFFして、Z画像を得る際のデータフロー図を図130に示す。この例であれば、階調変換に際してX画像やY画像に分解する必要がないので、その分処理を簡素化できる。   On the other hand, FIG. 130 shows a data flow diagram when obtaining the Z image by turning off the pitching function such as XY. In this example, there is no need to decompose the image into an X image or a Y image at the time of gradation conversion, so that the processing can be simplified accordingly.

さらに、XYZの座標情報をそのまま出力するポイントクラウドデータを出力する例を、図131に示す。この例では、位相→高さ変換後のX画像、Y画像、Z画像をそのまま出力できるので、軽負荷で出力できる利点が得られる。
(階調変換方法)
Further, FIG. 131 shows an example of outputting point cloud data that outputs XYZ coordinate information as it is. In this example, since the X image, Y image, and Z image after phase-to-height conversion can be output as they are, the advantage that they can be output with a light load can be obtained.
(Tone conversion method)

次に、三次元画像処理装置の階調変換手段46が、距離画像に基づいて、高階調の距離画像を、低階調の低階調距離画像に自動的に階調変換する手順を説明する。ここでは、複数のワークが搬送されるライン上に設置される検査装置において、逐次入力される距離画像(入力画像)に対して、リアルタイムで低階調距離画像に階調変換する用途といった、複数の入力画像に対して階調変換を行う手順について説明する。この場合の階調変換処理は、大別して、(A)事前に階調変換パラメータを決定しておく方法(静的変換)と、(B)入力画像に応じて階調変換パラメータを決定する方法(動的方法)の2通りが挙げられる。以下、これらについて説明する。
(A:静的変換)
Next, a procedure in which the gradation converting means 46 of the three-dimensional image processing apparatus automatically performs gradation conversion from a high gradation distance image to a low gradation low gradation distance image based on the distance image. . Here, in an inspection apparatus installed on a line on which a plurality of workpieces are conveyed, a range image (input image) that is sequentially input, such as an application that performs tone conversion to a low tone distance image in real time, is used. A procedure for performing gradation conversion on the input image will be described. The gradation conversion processing in this case is roughly divided into (A) a method for determining gradation conversion parameters in advance (static conversion), and (B) a method for determining gradation conversion parameters according to the input image. There are two methods (dynamic method). Hereinafter, these will be described.
(A: Static conversion)

まず、予め階調変換パラメータを決定しておく静的変換について説明する。ここでは、設定時において入力画像や予め登録しておいた登録画像に対して、階調変換を行うための階調変換パラメータを調整する。そして運用時においては、設定時に設定された階調変換パラメータでもって、距離画像の階調変換を行い、階調変換後の低階調距離画像に対して検査を実行する。なお設定時における手順は、上述の図8のフローチャートに基づいて説明した通りである。
(運用時の手順)
First, static conversion in which gradation conversion parameters are determined in advance will be described. Here, the gradation conversion parameters for performing gradation conversion are adjusted for the input image and the registered image registered in advance at the time of setting. During operation, the distance image is subjected to gradation conversion using the gradation conversion parameter set at the time of setting, and the low gradation distance image after gradation conversion is inspected. The procedure at the time of setting is as described based on the flowchart of FIG.
(Procedure for operation)

階調変換パラメータが調整されると、この階調変換パラメータでもって運用時に入力される入力画像に対して、階調変換が行われる。ここで、運用時における静的変換の手順を、図132のフローチャートに基づいて説明する。まずステップS13201において、距離画像を取得する。ここでは、距離画像生成手段32が生成した距離画像を、コントローラ部2が取り込む。次にステップS13202において、入力された距離画像の階調変換処理を行う。ここでは、設定時に調整された階調変換パラメータに従って階調変換処理が実行され、距離画像の階調数すなわちダイナミックレンジを削減した低階調距離画像を生成する。最後に、ステップS13203において検査実行手段50により検査処理を実行する。この方法によれば、予め階調変換パラメータを設定しておくことにより、運用時は階調変換パラメータを演算する必要がなく、処理を軽負荷とできる。
(B:動的変換)
When the tone conversion parameter is adjusted, tone conversion is performed on an input image input during operation with the tone conversion parameter. Here, the procedure of static conversion during operation will be described based on the flowchart of FIG. First, in step S13201, a distance image is acquired. Here, the controller unit 2 captures the distance image generated by the distance image generation means 32. In step S 13202, the input distance image is subjected to gradation conversion processing. Here, gradation conversion processing is executed according to the gradation conversion parameter adjusted at the time of setting, and a low gradation distance image in which the number of gradations of the distance image, that is, the dynamic range is reduced, is generated. Finally, inspection processing is executed by the inspection execution means 50 in step S13203. According to this method, by setting gradation conversion parameters in advance, it is not necessary to calculate gradation conversion parameters during operation, and the processing can be lightly loaded.
(B: Dynamic conversion)

次に、階調変換時の階調変換パラメータを、入力画像に基づいて算出する動的変換について説明する。まず設定時の手順については、上述の通り図8のフローチャートに従って、行われる。具体的には、ステップS81において、入力画像又は登録画像を取得し、次にステップS82において、階調変換方法を選択させる。ここでは、ユーザが動的変換を選択したものとする。そしてステップS83において、階調変換パラメータを調整する。ここでは、運用時において入力される入力画像に対して、どのような条件で階調変換パラメータを演算、あるいは調整するかを、ステップS81で取得された画像に基づいて設定する。   Next, dynamic conversion for calculating gradation conversion parameters at the time of gradation conversion based on an input image will be described. First, the setting procedure is performed according to the flowchart of FIG. 8 as described above. Specifically, an input image or a registered image is acquired in step S81, and then a gradation conversion method is selected in step S82. Here, it is assumed that the user has selected dynamic conversion. In step S83, the tone conversion parameter is adjusted. Here, the conditions under which the gradation conversion parameter is calculated or adjusted for the input image input during operation are set based on the image acquired in step S81.

このようにして階調変換パラメータの演算条件が設定されると、運用時においては、設定された階調変換パラメータ演算条件に従って、入力画像に応じた階調変換パラメータが個別に演算される。次に、動的変換によって距離画像を低階調距離画像に階調変換する運用時の手順を、図133のフローチャートに基づいて説明する。まずステップS13301において、距離画像を取得する。ここでも上述したステップS13201と同様、距離画像生成手段32が生成した距離画像を、コントローラ部2が取り込む。次にステップS13302において、入力画像である距離画像に基づいて、階調変換パラメータを決定する。階調変換パラメータの調整方法については、上述した方法が利用できる。さらにステップS13303において、階調変換を実行する。最後に、ステップS13304において検査処理を実行する。この方法によれば、入力画像に従って階調変換パラメータを変更できるので、異なるワークに対しても柔軟に階調変換を行って正確な検査が可能となる。例えば、高さにばらつきのあるワーク表面の検査も、精度を低下させることなく行うことができる。   When the gradation conversion parameter calculation conditions are set in this manner, the gradation conversion parameters corresponding to the input image are individually calculated according to the set gradation conversion parameter calculation conditions during operation. Next, a procedure at the time of operation for converting a distance image into a low gradation distance image by dynamic conversion will be described based on a flowchart of FIG. First, in step S13301, a distance image is acquired. Here again, as in step S 13201 described above, the controller unit 2 captures the distance image generated by the distance image generation means 32. In step S 13302, tone conversion parameters are determined based on the distance image that is the input image. As a method for adjusting the gradation conversion parameter, the method described above can be used. In step S13303, gradation conversion is executed. Finally, inspection processing is executed in step S13304. According to this method, since the gradation conversion parameter can be changed according to the input image, it is possible to perform an accurate inspection by flexibly performing gradation conversion even for different workpieces. For example, the inspection of the workpiece surface with variations in height can be performed without reducing accuracy.

ここで、動的変換の一例として、階調変換パラメータの調整によって、階調変換後の低階調距離画像を最適に作成する方法について、図134に基づいて説明する。ここでは、一の階調変換パラメータセットを動的に設定する方法と、予め複数の階調変換パラメータセットを準備しておき、動的に階調変換パラメータセットを選択する方法の二通りがある。
(1A一の階調変換パラメータセットを設定する方法)
Here, as an example of dynamic conversion, a method of optimally creating a low gradation distance image after gradation conversion by adjusting gradation conversion parameters will be described with reference to FIG. Here, there are two methods: a method of dynamically setting one gradation conversion parameter set and a method of preparing a plurality of gradation conversion parameter sets in advance and dynamically selecting the gradation conversion parameter set. .
(Method for setting one gradation conversion parameter set for 1A)

まず、一の階調変換パラメータセットを動的に設定する方法について説明する。この方法では、入力画像である複数の距離画像の、予め定められた領域の画像情報に基づいて、階調変換に使用する階調変換パラメータの値を調整し、この調整された階調変換パラメータを用いて、階調変換手段46が距離画像の階調変換処理を実行する。ここでは、16階調の距離画像(階調変換前画像)を、8階調の低階調距離画像(階調変換後画像)に階調変換する例について説明する。また、検査対象のワークは、図134の斜視図に示すように、ワーク毎の計測面全体が上下にずれるものであり、その範囲は5mmである。また計測面全体の厚さや歪みを含めた高さ方向のレンジは0.5mmとする。このように表面高さが異なる各ワークに対して、それぞれの表面に傷を有していないかどうかを、画像処理によって検査する例を考える。距離画像を利用すると共に、距離画像を二次元の濃淡画像(低階調距離画像)に階調変換することで、既存の二次元画像用の画像処理装置でもって検査可能とできる。   First, a method for dynamically setting one gradation conversion parameter set will be described. In this method, the value of the gradation conversion parameter used for gradation conversion is adjusted based on image information of a predetermined area of a plurality of distance images that are input images, and the adjusted gradation conversion parameter is adjusted. The gradation conversion means 46 executes the distance image gradation conversion process. Here, an example in which gradation conversion is performed on a 16-gradation distance image (image before gradation conversion) to an 8-gradation low gradation distance image (image after gradation conversion) will be described. Further, as shown in the perspective view of FIG. 134, the workpiece to be inspected is such that the entire measurement surface for each workpiece is shifted up and down, and the range is 5 mm. The range in the height direction including the thickness and distortion of the entire measurement surface is 0.5 mm. Consider an example in which each workpiece having different surface heights is inspected by image processing to determine whether or not the surface has a flaw. By using the distance image and converting the gradation of the distance image into a two-dimensional grayscale image (low gradation distance image), it is possible to inspect with an existing image processing apparatus for a two-dimensional image.

まず、予めワーク上の検査したい領域を、検査対象領域設定手段で検査対象領域として指定しておく。なお、検査対象領域を、入力画像である距離画像の一部を指定する他、距離画像の全体とすることもできる。この場合は、検査対象領域を指定する作業を省略してもよい。   First, an area to be inspected on the workpiece is designated in advance as an inspection target area by the inspection target area setting means. In addition to specifying a part of the distance image that is the input image, the inspection target region may be the entire distance image. In this case, the work of specifying the inspection target area may be omitted.

最初に、検査対象領域の平均距離を求める。次に、検査対象領域の最大距離と最小距離の差(距離レンジ)を求める。さらに、距離レンジを1.2倍した数値を変換後画像の距離レンジとする。例えば、図134のワークの分布では、距離レンジが0.5mmであるとすると、これを1.2倍した0.6mmが階調変換後画像の距離レンジとして設定される。よって、平均距離を中心に±0.3mmの範囲が計測レンジとなる。   First, the average distance of the inspection target area is obtained. Next, a difference (distance range) between the maximum distance and the minimum distance of the inspection target area is obtained. Further, a numerical value obtained by multiplying the distance range by 1.2 is set as the distance range of the converted image. For example, in the work distribution of FIG. 134, assuming that the distance range is 0.5 mm, 0.6 mm obtained by multiplying the distance range by 1.2 is set as the distance range of the image after gradation conversion. Therefore, the range of ± 0.3 mm around the average distance is the measurement range.

さらにまた、階調変換後画像の距離レンジである0.6mm(平均距離を中心に±0.3mm)の範囲が、256階調となるように、入力画像である距離画像に対するスパンを求める。なお、スパンは予め決めた定数とすることもできる。また、距離画像に対して、平均距離が−0.3mm以下のものは0とし、一方平均距離が+0.3mm以上のものは255とすることもできる。   Furthermore, the span for the distance image that is the input image is obtained so that the range of 0.6 mm (± 0.3 mm centered on the average distance) that is the distance range of the image after gradation conversion is 256 gradations. The span can be a predetermined constant. For the distance image, an average distance of −0.3 mm or less may be 0, while an average distance of +0.3 mm or more may be 255.

このようにして、入力される複数の距離画像から、検査に必要な範囲を定めて、この範囲の高さ情報が階調変換後の低階調距離画像においても維持されるように、適切に階調変換パラメータを設定できる。この結果、高さ方向に分散する各ワークの傷の有無や位置等を、既存の画像処理装置を用いて適切に検査することが可能となる。
(1B 予め複数の階調変換パラメータセットを準備しておく方法)
In this way, a range necessary for inspection is determined from a plurality of distance images that are input, and the height information of this range is appropriately maintained in the low gradation distance image after gradation conversion. Tone conversion parameters can be set. As a result, it is possible to appropriately inspect the presence / absence and position of each workpiece distributed in the height direction using an existing image processing apparatus.
(1B Method of preparing a plurality of tone conversion parameter sets in advance)

上記の実施例では、取得した距離画像の高さ情報を利用して、傷の検出に必要な高さ情報を損失しないように適切に階調変換パラメータセットを求める方法について説明した。一方で、予め複数の階調変換パラメータセットを準備しておく方法についても、以下説明する。この方法では、入力画像である複数の距離画像に対して、予め設定された複数の階調変換パラメータで階調変換された階調変換後画像をそれぞれ作成し、距離画像の予め指定された検査対象領域の画像情報に基づいて、検査に使用する階調変換後画像を選択する。   In the above-described embodiment, a method has been described in which the tone conversion parameter set is appropriately obtained by using the acquired height information of the distance image so as not to lose the height information necessary for detection of scratches. On the other hand, a method for preparing a plurality of tone conversion parameter sets in advance will also be described below. In this method, a gradation-converted image obtained by gradation conversion using a plurality of preset gradation conversion parameters is created for a plurality of distance images that are input images, and a predetermined inspection of the distance image is performed. Based on the image information of the target area, an image after gradation conversion to be used for inspection is selected.

このような具体例を図135の模式図、及び図136のフローチャートに基づいて説明する。この例でも、上述した図134と同様に、ワーク毎の計測面全体が5mmの範囲で上下にずれる場合を考える。このようなワークに対して、変換中心を0.5mm毎に変化させて階調変換した階調変換後画像を、9枚作成する。そして得られた各階調変換後画像を表示手段上に、好ましくは並べて表示させ、入力画像である距離画像の平均値に一番近い変換中心による変換画像を、ユーザに選択させる。そして、ユーザにより選択された画像に適用された階調変換パラメータセットを設定する。具体的な手順は、図136に示す通り、まずワークの距離画像を生成した上で(ステップS13601)、上述の通り階調変換パラメータを変化させながら階調変換処理を複数回行う(ステップS13602)。そして得られた階調変換画像である簡易的な低階調距離画像中から、ユーザに所望の画像を選択させ(ステップS13603)、必要に応じて階調変換パラメータを調整し、得られた低階調距離画像に対して検査を行う(ステップS13604)。
(静的変換、動的変換の詳細)
Such a specific example will be described with reference to the schematic diagram of FIG. 135 and the flowchart of FIG. In this example as well, as in FIG. 134 described above, a case is considered where the entire measurement surface for each workpiece is shifted up and down within a range of 5 mm. For such a workpiece, nine gradation-converted images are created by converting the gradation by changing the conversion center every 0.5 mm. Then, the obtained gradation-converted images are preferably displayed side by side on the display means, and the user is allowed to select a converted image having a conversion center closest to the average value of the distance images as the input image. Then, a gradation conversion parameter set applied to the image selected by the user is set. As shown in FIG. 136, a specific procedure is as follows. First, a distance image of a workpiece is generated (step S13601), and gradation conversion processing is performed a plurality of times while changing the gradation conversion parameter as described above (step S13602). . Then, the user selects a desired image from the simple low gradation distance image that is the obtained gradation conversion image (step S13603), adjusts the gradation conversion parameter as necessary, and obtains the low An inspection is performed on the gradation distance image (step S13604).
(Details of static conversion and dynamic conversion)

次に、これら静的変換、動的変換の詳細について説明する。まず、静的変換について説明する。静的変換には、距離画像を低階調距離画像に階調変換する際に、残すべき高さ情報の基準を補正するため具体的な方法として、
(A1)指定した高さ(距離)で補正する一点指定と、
(A2)平面で補正する三点指定が利用できる。
(A1:一点指定)
Next, details of these static conversion and dynamic conversion will be described. First, static conversion will be described. As a specific method for static conversion, in order to correct the reference of height information to be left when converting a distance image to a low gradation distance image,
(A1) One point specification to be corrected at the specified height (distance);
(A2) Three-point designation for correction on a plane can be used.
(A1: One point designation)

一点指定は、ユーザが指定した点又は領域の高さ(距離)を基準として、距離画像を低階調距離画像に階調変換する方法である。基準高さは、例えば距離画像の高さ情報の内、低階調距離画像に階調変換される高さ範囲(距離レンジ)の中間の高さとする。あるいは、距離レンジの上限(階調変換される最も高い位置)や下限(階調変換される最も低い位置)とすることもできる。一点指定の具体的な手順は、上記図66〜図78に基づいて説明した通りである。
(A2:三点指定)
The one-point designation is a method for converting the gradation of a distance image into a low gradation distance image based on the height (distance) of a point or region designated by the user. The reference height is, for example, the intermediate height of the height range (distance range) to be converted into the low gradation distance image in the height information of the distance image. Alternatively, the upper limit (the highest position where gradation conversion is performed) and the lower limit (the lowest position where gradation conversion is performed) of the distance range can be set. The specific procedure for specifying one point is as described with reference to FIGS.
(A2: Three point designation)

三点指定とは、ユーザが指定した三点から求められる平面を基準面として、距離画像を低階調距離画像に階調変換する方法である。基準面も、上述した一点指定の基準高さと同様、例えば距離画像の高さ情報の内、低階調距離画像に階調変換される高さ範囲(距離レンジ)の中間の高さとする。あるいは、距離レンジの上限(階調変換される最も高い位置)や下限(階調変換される最も低い位置)とすることもできる。三点指定の具体例は、上記図81〜図85のGUI画面に基づいて説明した通りである。   The three-point designation is a method for gradation-converting a distance image into a low gradation distance image using a plane obtained from the three points designated by the user as a reference plane. The reference plane is also set to a height in the middle of the height range (distance range) to be converted to a low gradation distance image, for example, among the height information of the distance image, similarly to the reference height designated by one point described above. Alternatively, the upper limit (the highest position where gradation conversion is performed) and the lower limit (the lowest position where gradation conversion is performed) of the distance range can be set. A specific example of the three-point designation is as described based on the GUI screens of FIGS.

ここで、静的変換による基準面の指定が有効な例を、図137に基づいて説明する。この例では、同じ高さのワークWK7が、ベルトコンベアBCによって同一面上を搬送されている。この場合は、ワークWK7の高さの変動が殆どないため、ワークに応じて基準面を変化させる動的変換は不要であり、静的変換で対応できる。特に静的変換は動的変換よりも処理が高速であり、静的変換の利点を享受できる。   Here, an example in which designation of the reference plane by static conversion is effective will be described based on FIG. In this example, the workpiece WK7 having the same height is conveyed on the same surface by the belt conveyor BC. In this case, since there is almost no variation in the height of the workpiece WK7, dynamic conversion for changing the reference plane according to the workpiece is unnecessary, and can be handled by static conversion. In particular, static conversion is faster than dynamic conversion, and can enjoy the advantages of static conversion.

また図138Aは、高さの変動自体を抑制したいワークの例である。この例では、ベルトコンベアBCによって搬送されるワークWK10であるボトルのキャップに、「浮き」がある場合を異常として検出する検査処理を対象としている。この場合において、静的変換を採用することで、図138Bに示す低階調距離画像のように高さの変動分を検知できる。逆に動的変換を採用すると、変動分が補正されてしまう結果、異常の検出ができなくなる。よってこのような用途において、静的変換が好適に利用できる
(B:動的変換の具体例)
FIG. 138A is an example of a workpiece for which the height fluctuation itself is to be suppressed. In this example, an inspection process for detecting a case where the bottle cap, which is the work WK10 conveyed by the belt conveyor BC, has “floating” as an abnormality is targeted. In this case, by adopting static conversion, it is possible to detect a variation in height as in the low gradation distance image shown in FIG. 138B. On the other hand, when dynamic conversion is adopted, the fluctuation is corrected, so that the abnormality cannot be detected. Therefore, static conversion can be preferably used in such applications (B: specific example of dynamic conversion).

以上は、設定段階で予め階調変換条件を指定して、運用時には指定された条件で階調変換を行う静的変換について説明した。次に、検査対象の入力画像に応じて階調変換条件を調整する動的変換の具体例について、説明する。まず動的変換には、距離画像を低階調距離画像に階調変換する際に、残すべき高さ情報の基準を補正するため具体的な方法として、
(B1)入力画像に対して指定された平均抽出領域内の平均高さ(平均距離)を平均基準高さとして階調変換する平均高さ基準、
(B2)入力画像の指定領域内の推定平面を生成し、これを基準面として階調変換する平面基準、
(B3)入力画像から高周波成分を除いた自由曲面を生成し、これを基準面として階調変換する自由曲面基準
が含まれる。
In the above, static conversion in which gradation conversion conditions are specified in advance at the setting stage and gradation conversion is performed under the specified conditions during operation has been described. Next, a specific example of the dynamic conversion that adjusts the gradation conversion condition according to the input image to be inspected will be described. First, in dynamic conversion, as a specific method for correcting the reference of height information to be left when gradation conversion from a distance image to a low gradation distance image,
(B1) An average height reference for gradation conversion using an average height (average distance) in an average extraction area designated for the input image as an average reference height;
(B2) a plane reference for generating an estimated plane in the designated area of the input image and performing gradation conversion using this as a reference plane
(B3) A free-form surface reference that generates a free-form surface from which high-frequency components are removed from an input image and performs gradation conversion using this as a reference surface is included.

平均基準高さを規定するための平均抽出領域は、運用に先立って予め設定される(上述した図8のステップS83)。図8のステップS83において、平均抽出領域を指定する手順の一例については、上記図88〜図92のGUIに基づいて説明した通りである。一方、運用時においては、図133で説明した手順で動的変換が行われる。例えばライン上を搬送されるワークを撮像して距離画像を生成し(ステップS13301)、上記で設定された平均抽出領域の平均高さを演算し(ステップS13302)、これに基づいて階調変換を実行して低階調距離画像を生成し(ステップS13303)、得られた低階調距離画像に対して検査を行う(ステップS13304)。この方法であれば、ワークの高さ方向にばらつきがある場合でも、ワーク毎に階調変換の基準面を毎回再設定できるため、ワークの高さ方向のばらつきによらず、正確な検査が実現できる。   The average extraction area for defining the average reference height is set in advance prior to operation (step S83 in FIG. 8 described above). An example of the procedure for designating the average extraction region in step S83 in FIG. 8 is as described based on the GUI in FIGS. 88 to 92. On the other hand, during operation, dynamic conversion is performed according to the procedure described with reference to FIG. For example, a distance image is generated by imaging a workpiece conveyed on the line (step S 13301), the average height of the average extraction area set above is calculated (step S 13302), and gradation conversion is performed based on this. This is executed to generate a low gradation distance image (step S13303), and the obtained low gradation distance image is inspected (step S13304). With this method, even if there are variations in the height direction of the workpiece, the reference plane for gradation conversion can be reset for each workpiece every time, so accurate inspection is achieved regardless of variations in the workpiece height direction. it can.

次に、平面基準においても、上述した平均高さ基準と同様、基準面を決定するための基準面推定領域は、運用に先立って予め設定される(上述した図8のステップS83)。図8のステップS83において、基準面推定領域を指定する手順の一例については、上記図88、図92〜図95のGUIに基づいて説明した通りである。運用時においては、図133で説明した手順で動的変換が行われる。例えばライン上を搬送されるワークを撮像して距離画像を生成し(ステップS13301)、上記で設定された基準面推定領域を抽出して、推定面を演算し(ステップS13302)、得られた推定面を基準として階調変換を実行して低階調距離画像を生成し(ステップS13303)、得られた低階調距離画像に対して検査を行う(ステップS13304)。この方法であれば、ワークの表面に傾き等がある場合でも、これをキャンセルしてワークの傾きによらず、正確な検査が実現できる。   Next, also in the plane reference, the reference plane estimation region for determining the reference plane is set in advance prior to the operation (step S83 in FIG. 8 described above) in the same manner as the above-described average height reference. An example of the procedure for designating the reference plane estimation region in step S83 in FIG. 8 is as described based on the GUI in FIGS. 88 and 92 to 95. During operation, dynamic conversion is performed according to the procedure described with reference to FIG. For example, the workpiece conveyed on the line is imaged to generate a distance image (step S13301), the reference plane estimation area set as described above is extracted, the estimation plane is calculated (step S13302), and the obtained estimation is obtained. Gradation conversion is performed with reference to the plane to generate a low gradation distance image (step S13303), and the obtained low gradation distance image is inspected (step S13304). With this method, even if the workpiece surface has an inclination or the like, the inspection can be canceled and an accurate inspection can be realized regardless of the inclination of the workpiece.

最後に、自由曲面基準の具体的な設定方法については、図126〜図32のGUIに基づいて説明した通りである。自由曲面基準においても、上述した平均高さ基準等と同様、基準面を決定するための必要な条件は運用に先立って予め設定される(上述した図8のステップS83)。また運用時においては、図133で説明した手順で動的変換が行われる。例えばライン上を搬送されるワークを撮像して距離画像を生成し(ステップS13301)、上記で設定された自由曲面対象領域に対して、自由曲面を演算し(ステップS13302)、得られた自由曲面を基準として階調変換を実行して低階調距離画像を生成し(ステップS13303)、得られた低階調距離画像に対して検査を行う(ステップS13304)。この方法であれば、曲面状のワークの表面検査等、従来の方法では正確な検査が困難であった作業も、高精度に行える利点が得られる。   Finally, the specific method for setting the free-form surface reference is as described based on the GUIs in FIGS. 126 to 32. Also in the free-form surface reference, the necessary conditions for determining the reference surface are set in advance prior to the operation (step S83 in FIG. 8 described above), as in the above-described average height reference. In operation, dynamic conversion is performed according to the procedure described in FIG. For example, the workpiece conveyed on the line is imaged to generate a distance image (step S 13301), a free curved surface is calculated for the free curved surface target area set above (step S 13302), and the obtained free curved surface Is used as a reference to generate gradation conversion to generate a low gradation distance image (step S13303), and the obtained low gradation distance image is inspected (step S13304). With this method, there is an advantage that an operation that is difficult to perform an accurate inspection by a conventional method such as a surface inspection of a curved workpiece can be performed with high accuracy.

ここで、動的変換による基準面の指定が有効な例を、図139に基づいて説明する。この例では、高さの異なるワークWK11が、ベルトコンベアBCによって同一面上を搬送されている。この場合は、ワークWK11の高さが個々に異なるため、平均高さ基準等を利用し、個体毎の高さに応じて基準面を変更し階調変換することで、ワークの高さに変動があっても最適な階調変換が可能となる。   Here, an example in which the specification of the reference plane by dynamic conversion is effective will be described based on FIG. In this example, workpieces WK11 having different heights are conveyed on the same surface by the belt conveyor BC. In this case, since the height of the workpiece WK11 differs individually, the average height reference or the like is used, the reference plane is changed according to the height of each individual, and the gradation conversion is performed to change the workpiece WK11. Even if there is, there is an optimum gradation conversion.

また図140は、平面に微小な傾斜面と打痕のあるワークWK12の例を示している。この例では、打痕DEに起因してワークWK12の表面に微小な傾斜面が存在しているため、傾きによって打痕の検出精度に影響がでる虞がある。そこで、平面基準等を利用し、ワーク個体毎に平面を動的に求めて基準面として階調変換することで、僅かな窪みや打痕の検出といった高精度な検査が可能となる。   FIG. 140 shows an example of the work WK12 having a minute inclined surface and a dent on a plane. In this example, since there is a minute inclined surface on the surface of the workpiece WK12 due to the dent DE, the inclination may affect the detection accuracy of the dent. Therefore, by using a plane reference or the like and dynamically obtaining a plane for each workpiece and converting the gradation as a reference plane, a highly accurate inspection such as detection of a slight depression or dent is possible.

さらに図141は、半径の異なる曲面状のワークWK13の例を示している。この例でも、自由曲面基準等を利用し、ワーク毎に曲面を求め、これを基準面として階調変換を行うことで、個体毎の形状のばらつきの影響を軽減した検査が可能となる。
(階調変換パラメータの自動調整)
Further, FIG. 141 shows an example of a curved workpiece WK13 having different radii. Also in this example, by using a free curved surface reference or the like, a curved surface is obtained for each workpiece, and gradation conversion is performed using the curved surface as a reference surface, thereby enabling an inspection with reduced influence of shape variation for each individual.
(Automatic adjustment of gradation conversion parameters)

以上、階調変換パラメータを、階調変換後の画像イメージに基づいて手動で設定する手順について説明した。一方、階調変換パラメータを手動で設定する場合に、最初に設定した階調変換パラメータで階調変換した場合、ワークや環境の変化等によって、検査に適した画像が得られない場合がある。このような場合には、ユーザが画像を参照して微調整することなく、階調変換後のデータを用いて階調変換パラメータを補正し、再度変換を行うことにより検査に適した画像変換を行うこともできる。この方法では、階調変換の初期設定を行った上で、任意の階調変換パラメータを初期値としてまず階調変換を行い、その後、階調変換パラメータの調整を行う。   The procedure for manually setting the gradation conversion parameter based on the image image after gradation conversion has been described above. On the other hand, when the tone conversion parameter is set manually, if tone conversion is performed using the initially set tone conversion parameter, an image suitable for inspection may not be obtained due to changes in the work or environment. In such a case, the image conversion suitable for the inspection can be performed by correcting the gradation conversion parameter using the data after the gradation conversion without performing fine adjustment with reference to the image and performing the conversion again. It can also be done. In this method, after initial setting of gradation conversion, gradation conversion is first performed using an arbitrary gradation conversion parameter as an initial value, and then the gradation conversion parameter is adjusted.

例えば階調変換条件自動設定手段を、階調変換条件自動設定手段と、階調変換条件手動設定手段として機能させることができる。すなわち、階調変換条件自動設定手段で、階調変換手段が距離画像を低階調距離画像に階調変換する際の簡易的な階調変換条件を設定する。また、階調変換条件自動設定手段で設定された簡易階調変換条件に基づき、階調変換された簡易低階調距離画像を表示手段に表示させた状態で、階調変換条件手動設定手段が、階調変換条件の手動調整を受け付ける。これにより、ユーザに対していきなり階調変換条件の設定を促すのでなく、暫定的な簡易階調変換条件を自動的に設定して階調変換を行った上で、得られた一以上の簡易低階調距離画像を参照しながら、所望の階調変換条件に設定できるため、ユーザが階調変換パラメータの意味を習熟していない場合や設定に不慣れな場合でも、ある程度自動化してこのような設定作業を行い易くすることができる。   For example, the gradation conversion condition automatic setting means can function as a gradation conversion condition automatic setting means and a gradation conversion condition manual setting means. That is, the gradation conversion condition automatic setting means sets a simple gradation conversion condition when the gradation conversion means converts the distance image into a low gradation distance image. Further, the gradation conversion condition manual setting means is configured to display the simple low gradation distance image subjected to gradation conversion on the display means based on the simple gradation conversion condition set by the gradation conversion condition automatic setting means. The manual adjustment of the gradation conversion condition is accepted. As a result, instead of prompting the user to set the gradation conversion condition suddenly, the provisional simple gradation conversion condition is automatically set and the gradation conversion is performed, and then the obtained one or more simple conversions are performed. Since it is possible to set the desired gradation conversion conditions while referring to the low gradation distance image, even if the user is not familiar with the meaning of the gradation conversion parameter or is unfamiliar with the setting, it is automated to some extent. It is possible to facilitate the setting work.

具体的な手順を、図142のフローチャートに基づいて説明する。まずステップS14201において、距離画像の作成処理を実行する。次にステップS14202において、階調変換パラメータの初期値を用いて、初期の階調変換処理を行う。さらにステップS14203において、得られた階調変換画像が適切かどうかを判定し、適切でない場合はステップS14204において再度、階調変換パラメータの調整を行った後、ステップS14202に戻って処理を繰り返す。一方、ステップS14203において適切な階調変換画像が得られていると判定された場合は、ステップS14205に進み、所定の検査を実行する。   A specific procedure will be described based on the flowchart of FIG. First, in step S14201, a distance image creation process is executed. Next, in step S14202, initial gradation conversion processing is performed using the initial value of the gradation conversion parameter. Further, in step S14203, it is determined whether or not the obtained gradation conversion image is appropriate. If not, the gradation conversion parameter is adjusted again in step S14204, and then the process returns to step S14202 to repeat the process. On the other hand, if it is determined in step S14203 that an appropriate gradation-converted image has been obtained, the process advances to step S14205 to execute a predetermined inspection.

なお、以上の方法ではステップS14203において階調変換パラメータが適切かどうかの判定を行っているが、この手順を省略してもよい、この場合の手順を、図143に示す。各手順は上述した図142の例とほぼ同じであり、ステップS14301において、距離画像の作成処理を実行し、次にステップS14302において、初期の階調変換処理を行う。そしてステップS14303において階調変換パラメータの調整を行った後、ステップS14304において所定の検査を行う。   In the above method, whether or not the gradation conversion parameter is appropriate is determined in step S14203, but this procedure may be omitted. FIG. 143 shows a procedure in this case. Each procedure is almost the same as the example of FIG. 142 described above. In step S14301, a distance image creation process is executed, and then in step S14302, an initial gradation conversion process is executed. Then, after adjusting the gradation conversion parameter in step S14303, a predetermined inspection is performed in step S14304.

初期の階調変換方法としては、例えば入力画像に変換関数f(x,y,z)にかける方法、入力画像にシフト,スパンをかけ、その結果をn階調に圧縮する方法、又は任意の平面を基準平面として、入力画像と基準平面との差分をとり、シフト,スパンをかけ、その結果をn階調に圧縮する方法、あるいは入力画像と基準画像との差分をとり、シフト,スパンをかけ、その結果をn階調に圧縮する方法等が挙げられる。   As an initial gradation conversion method, for example, a method of applying an input image to a conversion function f (x, y, z), a method of applying shift and span to an input image, and compressing the result to n gradations, or an arbitrary method Using the plane as the reference plane, the difference between the input image and the reference plane is taken, shifted and spanned, and the result is compressed to n gradations, or the difference between the input image and the reference image is taken and shifted and spanned. And a method of compressing the result to n gradations.

次に、階調変換後の階調変換パラメータを自動調整する具体例について説明する。階調変換パラメータの自動調整方法には、(C1)変換後の距離画像データのヒストグラムの中央値を用いる方法、(C2)ヒストグラムの最大値、最小値を用いる方法、(C3)C1とC2の組み合わせ、等が考えられる。
(C1:ヒストグラムの中央値を用いる方法)
Next, a specific example of automatically adjusting the tone conversion parameters after tone conversion will be described. As the automatic adjustment method of the gradation conversion parameter, (C1) a method using the median of the histogram of the distance image data after conversion, (C2) a method using the maximum value and minimum value of the histogram, and (C3) C1 and C2 Combinations are possible.
(C1: Method using the median value of the histogram)

まず、ヒストグラムの中央値を用いる方法について、図144のフローチャートに基づいて説明する。最初に、ステップS14401において変換後の距離画像データのヒストグラムを計算する。次にステップS14402において、ヒストグラムの中央値を求める。そしてステップS14403において、中央値が予め定めた値になるよう、階調変換パラメータを変更する。ここで変更された階調変換パラメータを用いて、再度、階調変換処理を実行する。なお、中央の前後のn個を含めた2n+1の平均値を中央値としても良い。また、最大値,最小値はそれぞれ大きい方からn個,小さい方からm個をそれぞれ取り除いた後の中央値としてもよい。
(C2:ヒストグラムの最大値、最小値を用いる方法)
First, a method using the median value of the histogram will be described based on the flowchart of FIG. First, in step S14401, a histogram of the converted distance image data is calculated. Next, in step S14402, the median value of the histogram is obtained. In step S14403, the tone conversion parameter is changed so that the median value becomes a predetermined value. The tone conversion process is executed again using the changed tone conversion parameter. Note that an average value of 2n + 1 including n before and after the center may be used as the median. The maximum value and the minimum value may be the median values after removing n from the larger one and m from the smaller one, respectively.
(C2: Method using maximum and minimum values of histogram)

まず、変換後の距離画像データのヒストグラムを計算する。次にヒストグラムの最大値,最小値を求め、最大値−最小値の幅が予め定めた値になるよう、階調変換パラメータを変更する。そして変更した階調変換パラメータで再度、階調変換処理を実行する。ここで、最大値,最小値は、それぞれ大きい方からn個,小さい方からm個のそれぞれ平均値としてもよい。または最大値,最小値は、それぞれ大きい方からn個,小さい方からm個のそれぞれ取り除いた後の最大値、最小値とすることもできる。
(C3:C1とC2の組み合わせ)
First, a histogram of distance image data after conversion is calculated. Next, the maximum value and the minimum value of the histogram are obtained, and the gradation conversion parameter is changed so that the maximum value-minimum value width becomes a predetermined value. Then, the gradation conversion process is executed again with the changed gradation conversion parameter. Here, the maximum value and the minimum value may be average values of n from the larger one and m from the smaller, respectively. Alternatively, the maximum value and the minimum value may be the maximum value and the minimum value after removing n from the larger one and m from the smaller one, respectively.
(C3: Combination of C1 and C2)

上記のC1とC2を組み合わせてもよい。すなわち、ヒストグラムの計算後、その中央値と最大値−最小値の幅に基づいて、階調変換パラメータを変更して、再度階調変換する。   You may combine said C1 and C2. That is, after the histogram is calculated, the gradation conversion parameter is changed based on the median value and the width between the maximum value and the minimum value, and the gradation conversion is performed again.

以上の方法では、ヒストグラムに予めローパスフィルタを適用することもできる。また、変換後の距離画像に予めローパスフィルタを適用した上で、ヒストグラムを求めても良い。   In the above method, a low-pass filter can be applied to the histogram in advance. Alternatively, a histogram may be obtained after applying a low-pass filter to the converted distance image in advance.

このような階調変換によって、高さ情報を含む階調数の高い距離画像を、低階調の低階調距離画像に変換できる。この低階調距離画像は二次元の画像として処理できるので、既存の二次元画像に対応した画像処理装置でも、低階調距離画像を扱うことが可能となる。例えば傷の有無を検査するためワークを撮像した距離画像に含まれる各画素の高さ情報を、濃淡値として16進数の2進数で表現する。ここで、距離画像と基準距離画像の差分を算出すると、ワークの表面に現れる浅くて小さな傷の欠陥情報は、下位8階調に集約される。このため、階調変換手段により、例えば上位8階調を削減することで、検出精度の低下を防ぎつつ、差分画像の情報量を大きく圧縮することができる。このように、階調変換手段が、差分画像の各画素の濃淡値を階調表現したときの階調のうち上位半分の階調を減らすことにより、検出精度の低下を防ぎつつ、差分画像の情報量を大きく圧縮することができる。
(階調変換処理の部分実行)
By such gradation conversion, a distance image having a high gradation number including height information can be converted into a low gradation distance image having a low gradation. Since this low gradation distance image can be processed as a two-dimensional image, the image processing apparatus corresponding to the existing two-dimensional image can also handle the low gradation distance image. For example, height information of each pixel included in a distance image obtained by imaging a workpiece for inspecting the presence or absence of a flaw is expressed as a binary value in hexadecimal notation as a gray value. Here, when the difference between the distance image and the reference distance image is calculated, the defect information of the shallow and small scratch appearing on the surface of the work is collected in the lower eight gradations. For this reason, the information amount of the difference image can be greatly compressed while preventing a decrease in detection accuracy by reducing the upper eight gradations, for example, by the gradation conversion means. In this way, the gradation conversion means reduces the upper half of the gradation when the gradation value of each pixel of the difference image is expressed as a gradation, thereby preventing a reduction in detection accuracy and reducing the difference in the detection accuracy. The amount of information can be greatly compressed.
(Partial execution of gradation conversion processing)

さらに階調変換処理は、距離画像のすべてに対して行うのでなく、一部においてのみ行うことができる。具体的には、階調変換手段は、距離画像の内で、指定された検査対象領域に対してのみ、階調変換処理を実行する。これにより、階調変換処理を軽減して、処理の負荷軽減、高速化が図られる。一例として、図145Aに示すような、径の異なる円柱が三重に重なった形状のワークWK14を用いて、高さ検査処理(第一検査処理)と画像検査処理(第二検査処理)を組み合わせた複数の検査処理を行う場合を考える。ここでは、高さ検査処理として、このワークWK14の円柱状の各面の高さを測定し、また画像検査処理として、ワークWK14の上から二段までの円柱状の部分で欠けや割れの検出を行う外観検査を行う。検査処理の選択は、検査処理選択手段で行う。さらに検査処理選択手段で選択された検査処理に対する具体的な設定は、検査処理設定手段で行う。
(検査処理選択手段)
Further, the gradation conversion process can be performed only on a part of the distance image, not on all of the distance images. Specifically, the gradation conversion means executes the gradation conversion process only for the designated inspection target area in the distance image. Thereby, the gradation conversion processing is reduced, and the processing load is reduced and the processing speed is increased. As an example, a height inspection process (first inspection process) and an image inspection process (second inspection process) are combined using a workpiece WK14 having a shape in which cylinders with different diameters are overlapped in a triple manner as shown in FIG. 145A. Consider a case where a plurality of inspection processes are performed. Here, as the height inspection process, the height of each cylindrical surface of the workpiece WK14 is measured, and as the image inspection process, chipping or cracking is detected in the cylindrical portion from the top to the second stage of the workpiece WK14. Perform an appearance inspection. The inspection process is selected by an inspection process selection unit. Further, specific setting for the inspection process selected by the inspection process selection means is performed by the inspection process setting means.
(Inspection processing selection means)

検査処理選択手段は、距離画像に対して、検査実行手段で実行される検査処理を、複数の選択するための手段である。ここでは、図44、図56等に示すように、初期画面260から、処理ユニットの追加を行う際に、検査処理を選択する。具体的には、処理ユニットの「追加」のサブメニューから「計測」処理を選択して表示される、検査処理の一覧中から、所望の検査処理を選択する。この例では、「エリア」、「パターンサーチ」、「Shapetrax2」、「エッジ位置」、「エッジ幅」、「エッジピッチ」、「エッジ角度」、「ペアエッジ」、「傷」、「ブロブ」、「濃淡ブロブ」、「トレンドエッジ位置」、「トレンドエッジ幅」、「トレンドエッジ欠陥」、「濃淡検査」、「色検査」、「OCR」、「2Dコードリーダ」、「1Dコードリーダ」、「高さ計測」の中から、所望の検査処理を選択する。
(検査処理設定手段)
The inspection process selection means is a means for selecting a plurality of inspection processes executed by the inspection execution means for the distance image. Here, as shown in FIG. 44, FIG. 56, etc., an inspection process is selected from the initial screen 260 when a processing unit is added. Specifically, a desired inspection process is selected from a list of inspection processes displayed by selecting a “measurement” process from the “add” submenu of the processing unit. In this example, “area”, “pattern search”, “Shapetrax 2”, “edge position”, “edge width”, “edge pitch”, “edge angle”, “pair edge”, “scratch”, “blob”, “ “Tint Blob”, “Trend Edge Position”, “Trend Edge Width”, “Trend Edge Defect”, “Tint Inspection”, “Color Inspection”, “OCR”, “2D Code Reader”, “1D Code Reader”, “High The desired inspection process is selected from “Measurement”.
(Inspection processing setting means)

一方、検査処理設定手段は、検査処理選択手段で選択された各検査処理について、その詳細を設定する。ここでは、図46、図63、図78等に示すように、設定項目ボタン領域112に配置された各ボタンから、各設定項目を個別に設定するよう構成している。この例では、具体的な設定項目が設定項目ボタンとして並べられており、例えば「画像登録」ボタン113、「画像設定」ボタン114、「領域設定」ボタン115、「高さ抽出」ボタン116、「前処理」ボタン117、「検出条件」ボタン118、「詳細設定」ボタン119、「判定条件」ボタン、「表示設定」ボタン、「保存」ボタン等が含まれる。このように設定項目ボタン領域112は、検査処理設定手段として機能する。
(高さ検査処理)
On the other hand, the inspection process setting means sets details of each inspection process selected by the inspection process selection means. Here, as shown in FIGS. 46, 63, 78, etc., each setting item is individually set from each button arranged in the setting item button area 112. In this example, specific setting items are arranged as setting item buttons. For example, an “image registration” button 113, an “image setting” button 114, an “area setting” button 115, a “height extraction” button 116, “ A “preprocessing” button 117, a “detection condition” button 118, a “detailed setting” button 119, a “judgment condition” button, a “display setting” button, a “save” button, and the like are included. Thus, the setting item button area 112 functions as an inspection processing setting unit.
(Height inspection process)

図145Aのようなワーク対し、得られた距離画像の例を図145Bに示す。この距離画像は、階調変換前の16階調で表現している。このような距離画像に対し、高さ計測(高さ検査処理)を行う場合は、階調変換を行うことなく、16階調の高い精度のままの高さ情報を利用することで、高精度な検査が実現できる。具体的には、図145Cに示すように、ワークの各面の高さを計測するために、検査対象領域をワークの3つの面上にそれぞれ設定し、各検査対象領域の高さを16階調のまま計測する。
(画像検査処理)
FIG. 145B shows an example of the obtained distance image for the workpiece as shown in FIG. 145A. This distance image is expressed in 16 gradations before gradation conversion. When height measurement (height inspection processing) is performed on such a distance image, high accuracy is obtained by using height information with high accuracy of 16 gradations without performing gradation conversion. Can be realized. Specifically, as shown in FIG. 145C, in order to measure the height of each surface of the workpiece, the inspection target regions are set on three surfaces of the workpiece, and the height of each inspection target region is set to the 16th floor. Measure as it is.
(Image inspection processing)

一方、検査処理の内で高さ情報を用いない計測(画像検査処理)を行う場合は、高階調の情報は不要で、より低階調の距離画像で処理を行う方が、負荷が少ない。このため、高階調の距離画像に階調変換を行って、低階調の距離画像を得た上で処理を行う。ここで、距離画像の全体を低階調距離画像に変換する必要はなく、あくまで画像検査処理を行う対象のみに限って階調変換を行えば足りる。すなわち、階調変換を行う領域とは、一以上設定された検査対象領域の内で、高さ情報を用いない画像検査処理用に設定された検査対象領域を対象とする。図145Dに示す例では、図145Bと同様、階調変換前の高階調距離画像に対して、画像検査処理用の検査対象領域を設定する。この例では、ワークの上から二段までで欠け等を検出するために、二段目の円柱状を囲むように検査対象領域を設定する。いいかえると、三段目の円柱状は外観検査対象外なので、この部分を検査対象領域から除外するように設定する。そして、この画像処理検査用対象領域に対して、階調変換を行う。この結果得られた低階調距離画像を、図145Eに示す。この図に示す階調変換後の低階調距離画像は、8階調で表現されており、高階調距離画像に比べ高さ情報は幾分失われているものの、欠けの有無等を検出する外観検査用途には十分な精度が維持されているので、画像検査処理に支障はない。一方で、階調変換が必要な領域は、図145B等に比べて大幅に削減されているので、処理の簡素化、高速化に寄与する。   On the other hand, when measurement without using height information (image inspection processing) is performed in the inspection processing, high gradation information is unnecessary, and the load is less when processing is performed with a distance image having a lower gradation. For this reason, tone conversion is performed on a high-tone distance image to obtain a low-tone distance image, and processing is performed. Here, it is not necessary to convert the entire distance image into a low gradation distance image, and it is sufficient to perform gradation conversion only for an object on which image inspection processing is performed. That is, the area to be subjected to gradation conversion is an inspection target area set for image inspection processing that does not use height information, among one or more set inspection target areas. In the example shown in FIG. 145D, as in FIG. 145B, an inspection target area for image inspection processing is set for the high gradation distance image before gradation conversion. In this example, in order to detect chipping and the like on the second stage from the top of the workpiece, the inspection target area is set so as to surround the second stage columnar shape. In other words, since the third column is not subject to appearance inspection, this portion is set to be excluded from the inspection target region. Then, gradation conversion is performed on the image processing inspection target area. The low gradation distance image obtained as a result is shown in FIG. 145E. The low gradation distance image after gradation conversion shown in this figure is expressed in eight gradations, and the height information is somewhat lost compared to the high gradation distance image, but the presence or absence of missing parts is detected. Since sufficient accuracy is maintained for visual inspection applications, there is no problem in image inspection processing. On the other hand, the area that requires gradation conversion is greatly reduced as compared to FIG. 145B and the like, which contributes to simplification and speeding up of processing.

このようにして、検査処理に応じて階調変換の有無が選択される。例えば図110のフロー表示領域261に表示される検査処理の内、「高さ計測」処理ユニット及び第二「高さ計測」処理ユニットにおいては、階調変換を行うことなく距離画像が有する16階調の高さ情報を利用し、高精度な高さ計測が実現される。一方で、それ以外の検査処理、例えば「数値演算」処理ユニットや「エリア」処理ユニット、「ブロブ」処理ユニット267においては、階調変換した8階調の低階調濃淡画像が使用される。なお、図示しないが輝度画像に対して検査処理(例えば、カラーの輝度画像に対する色検査)を行う場合は、高さ情報がそもそも不要であるため、当然階調変換も不要である。
(階調変換条件設定手段43の表示)
In this way, the presence or absence of gradation conversion is selected according to the inspection process. For example, among the inspection processes displayed in the flow display area 261 in FIG. 110, the “height measurement” processing unit and the second “height measurement” processing unit have the 16th floor that the distance image has without gradation conversion. High-precision height measurement is realized using the key height information. On the other hand, in the other inspection processes, for example, the “numerical calculation” processing unit, the “area” processing unit, and the “blob” processing unit 267, the gradation-converted 8-tone low gradation image is used. Although not shown, when the inspection process is performed on the luminance image (for example, the color inspection on the color luminance image), the height information is not necessary in the first place, and therefore, gradation conversion is naturally not necessary.
(Display of gradation conversion condition setting means 43)

また、このような階調変換処理が必要な画像検査処理に関しては、適切な階調変換を行うための階調変換条件を、階調変換条件設定手段43から設定する。この際、階調変換条件設定手段43は、階調変換処理が必要な場合にのみ設定可能とし、逆に階調変換処理が不要な検査処理、例えば高さ検査処理においては、階調変換条件を設定不能とすることで、ユーザは余計な設定作業に惑わされることなく、必要な項目のみをスムーズに設定することが可能となる。そこで、本実施の形態においては、高さ検査処理以外の、画像の高さ情報を必要としない検査処理の設定に際しては、距離画像の階調変換を行うための階調変換パラメータを設定する階調変換条件設定手段43を表示させる一方で、高さ検査処理を設定する際には、階調変換条件設定手段43を表示させないようにしている。   In addition, for image inspection processing that requires such tone conversion processing, tone conversion conditions for performing appropriate tone conversion are set from the tone conversion condition setting means 43. At this time, the gradation conversion condition setting means 43 can be set only when the gradation conversion process is necessary, and conversely, in the inspection process that does not require the gradation conversion process, for example, in the height inspection process, the gradation conversion condition By making the setting impossible, the user can smoothly set only necessary items without being confused by unnecessary setting work. Therefore, in the present embodiment, when setting an inspection process that does not require image height information other than the height inspection process, a gradation conversion parameter for performing gradation conversion of a distance image is set. While the tone conversion condition setting unit 43 is displayed, the tone conversion condition setting unit 43 is not displayed when the height inspection process is set.

具体的な設定時の手順を、図146のフローチャートに基づいて説明する。まずステップS14601において、検査処理を選択する。ここでは検査処理選択手段である「計測」メニューで、検査実行手段で実行される検査処理を選択する。次にステップS14602においては、ステップS14601で選択した検査処理が、階調変換を要するものか否かを判定し、階調変換を要する検査処理である場合はステップS14603に進み、階調変換を有効にすると共に、設定項目に階調変換設定手段を表示させる。   A specific setting procedure will be described based on the flowchart of FIG. First, in step S14601, an inspection process is selected. Here, an inspection process to be executed by the inspection execution means is selected in the “measurement” menu which is the inspection process selection means. Next, in step S14602, it is determined whether the inspection process selected in step S14601 requires gradation conversion. If the inspection process requires gradation conversion, the process proceeds to step S14603, and gradation conversion is enabled. In addition, the gradation conversion setting means is displayed in the setting item.

例えば図145Aのワークに対して「エリア」処理ユニットで画像検査処理を行う際には、図147に示すように、検査処理設定手段である設定項目ボタン領域112に、階調変換条件設定手段43である「高さ抽出」ボタン116を表示させている。「高さ抽出」ボタン116を押下すると、図148に示すように、高さ抽出設定画面が表示される。ユーザはこの画面から、階調変換処理に必要な条件を各々設定できる。   For example, when image inspection processing is performed on the work in FIG. 145A by the “area” processing unit, as shown in FIG. 147, the gradation conversion condition setting means 43 is set in the setting item button area 112 as inspection processing setting means. The “height extraction” button 116 is displayed. When the “height extraction” button 116 is pressed, a height extraction setting screen is displayed as shown in FIG. 148. From this screen, the user can set conditions necessary for gradation conversion processing.

なお図148の例においては、右側の操作領域で設定された階調変換条件に従い、階調変換された低階調距離画像が、画像表示領域上で表示されている。これによってユーザは、現在の階調変換条件で所望の検査結果が得られるかどうかを視覚的に確認でき、階調変換条件の調整作業を容易に行える利点が得られる。特に図148の例では、検査対象領域を円形に設定して、ワークの2番目の円柱状を囲むように配置している。また検出方法を動的変換(リアルタイム抽出)とし、計算方法として平面基準を設定することにより、ワークの中央の天面と、その外周面の2面が検出されて、これらを基準平面として、ワークの表面にある傷や窪みを検出している。また、階調変換条件に従い検出された基準平面のパラメータ表示は、コンソール操作による切り換えて表示させることも可能である。   In the example of FIG. 148, a low gradation distance image subjected to gradation conversion in accordance with the gradation conversion condition set in the right operation area is displayed on the image display area. As a result, the user can visually confirm whether or not a desired inspection result can be obtained under the current gradation conversion condition, and an advantage that the adjustment operation of the gradation conversion condition can be easily performed is obtained. In particular, in the example of FIG. 148, the inspection target area is set to be circular and is arranged so as to surround the second cylindrical shape of the workpiece. Also, by setting the detection method to dynamic conversion (real-time extraction) and setting the plane reference as the calculation method, the top surface at the center of the workpiece and the outer peripheral surface of the workpiece are detected. Detects scratches and dents on the surface of the. Further, the parameter display of the reference plane detected according to the gradation conversion condition can be switched and displayed by console operation.

さらに図148の例では、画像表示領域上に表示されるワークの全体を階調変換した低階調距離画像を表示させるのでなく、設定された検査対象領域の領域内でのみ、階調変換された低階調距離画像のイメージを表示させている。言い換えると、検査対象領域以外の画像は、元の距離画像をそのまま表示させている。これにより、階調変換が入力画像の全体で行われているのでなく、その一部である検査対象領域内でのみ実行されていることを、ユーザに対して視覚的に示すことができる。このようにして階調変換条件の設定が終了すると、ステップS14604に進む。   Further, in the example of FIG. 148, gradation conversion is performed only within the set region of the inspection target area, instead of displaying a low gradation distance image obtained by gradation conversion of the entire work displayed on the image display area. A low gradation distance image is displayed. In other words, the original distance image is displayed as it is for images other than the inspection target region. Accordingly, it is possible to visually indicate to the user that the gradation conversion is not performed on the entire input image, but is performed only within the inspection target region that is a part of the input image. When the gradation conversion condition setting is thus completed, the process advances to step S14604.

一方、階調変換を要しない検査処理の場合は、ステップS14603を経ることなくステップS14604にジャンプする。この場合は、検査処理の設定画面において階調変換条件設定手段は表示されない。例えば、「高さ計測」処理ユニットで高さ検査処理を行う場合は、図46等に示すように、検査処理設定手段である設定項目ボタン領域112には、階調変換条件設定手段43である「高さ抽出」ボタンが表示されない。これによってユーザは、高さ検査処理に不要な階調変換に関する条件設定を行う必要がないことを認識できる。あるいは、この検査処理に関しては階調変換条件の設定を行うことができないようにすることで、無用な設定に起因する混乱を回避することができる。   On the other hand, in the case of inspection processing that does not require gradation conversion, the process jumps to step S14604 without passing through step S14603. In this case, the gradation conversion condition setting means is not displayed on the setting screen for inspection processing. For example, when the height inspection process is performed by the “height measurement” processing unit, as shown in FIG. 46 and the like, the setting item button area 112 which is the inspection process setting unit is the gradation conversion condition setting unit 43. "Height extraction" button is not displayed. As a result, the user can recognize that there is no need to set conditions regarding gradation conversion that are not necessary for the height inspection process. Alternatively, it is possible to avoid confusion caused by unnecessary setting by making it impossible to set the gradation conversion condition for this inspection process.

そしてステップS14604において、検査処理の設定を行う。最後にステップS14605において、すべての検査処理の設定が終了したか否かを判定し、未だの場合はステップS14601に戻って検査処理の選択から繰り返し、終了した場合は、処理を完了する。   In step S14604, inspection processing is set. Finally, in step S14605, it is determined whether or not all the inspection processes have been set. If not, the process returns to step S14601 to repeat the selection of the inspection process, and if completed, the process is completed.

一方、運転時の手順を、図149のフローチャートに基づいて説明する。まずステップS14901において、入力画像として距離画像を入力する。次にステップS14902において、初期化を行う。ここではnに1を設定する。さらにステップS14903において、n番目の検査処理を実行する。さらにステップS14904において、n<N(Nは設定された検査処理の数)か否かを判定し、YESの場合はステップS14905においてnを1インクリメントした上で、ステップS14903に戻り、次の検査処理を実行する処理を繰り返す。一方、n<Nでない場合は、すべての検査処理を終了したとして、処理を完了する。このようにして、すべての検査処理を順次実行していく。   On the other hand, the procedure at the time of driving | operation is demonstrated based on the flowchart of FIG. First, in step S14901, a distance image is input as an input image. Next, in step S14902, initialization is performed. Here, 1 is set to n. In step S14903, the nth inspection process is executed. In step S14904, it is determined whether or not n <N (N is the number of set inspection processes). If YES, n is incremented by 1 in step S14905, and the process returns to step S14903 to execute the next inspection process. Repeat the process to execute. On the other hand, if n <N, it is determined that all the inspection processes have been completed, and the process is completed. In this way, all the inspection processes are sequentially executed.

ここでステップS14903の検査処理の実行について詳述すると、まず検査処理で階調変換を要する場合は、図150のフローチャートに示すように、先にステップS15001において、距離画像の内、検査対象領域に対して、階調変換する。その上で、ステップS15002にて、階調変換後の低階調距離画像に対して、検査処理を実行する。一方、階調変換を行わない検査処理の場合は、図151のフローチャートに示すように、階調変換を経ることなく、高階調の距離画像のまま、検査対象領域内の検査処理を実行する(ステップS15101)。
(画像選択の非表示機能)
Here, the execution of the inspection process in step S14903 will be described in detail. First, in the case where gradation conversion is required in the inspection process, as shown in the flowchart of FIG. On the other hand, tone conversion is performed. Then, in step S15002, inspection processing is executed on the low gradation distance image after gradation conversion. On the other hand, in the case of inspection processing that does not perform tone conversion, as shown in the flowchart of FIG. 151, the inspection processing in the inspection target region is executed without changing the tone, with the high-tone distance image being maintained ( Step S15101).
(Image selection hiding function)

また、設定時においては、検査処理の種別に応じて、検査処理の設定を行う対象となる画像の選択に制限をかけることもできる。すなわち、検査処理選択手段で選択された検査処理が、距離画像又は輝度画像のいずれに対しても実行可能な場合は、これら距離画像又は輝度画像を登録画像として呼び出すことが可能である。その一方で、検査処理が距離画像に対しては実行可能であるものの、輝度画像に対して実行不可能なものがある。例えば高さ計測処理は、高精度な高さ情報を有する距離画像に対して実行されるものである。高さ情報を有しない通常の輝度画像に対しては、行うことができない。そこで、高さ計測処理のような、高さ情報を有する画像、すなわち距離画像に対してのみ実行可能な検査処理は、設定時に登録画像を呼び出す時点において、距離画像のみを選択可能とし、逆に輝度画像については選択できないようにする。これによって、誤って輝度画像に対して高さ計測処理に関する設定を行うような、本来不可能な設定作業を禁止又は排除し、設定の無駄を省き、ユーザの操作性を向上させることができる。   Further, at the time of setting, it is possible to limit the selection of an image to be subjected to setting of inspection processing according to the type of inspection processing. That is, when the inspection process selected by the inspection process selection unit can be executed on either the distance image or the luminance image, the distance image or the luminance image can be called as a registered image. On the other hand, some inspection processes can be performed on distance images, but not on luminance images. For example, the height measurement process is executed for a distance image having highly accurate height information. It cannot be performed on a normal luminance image having no height information. Therefore, an inspection process that can be performed only on an image having height information, that is, a distance image, such as a height measurement process, allows only a distance image to be selected at the time of calling a registered image at the time of setting. The brightness image cannot be selected. As a result, it is possible to prohibit or eliminate a setting operation that cannot be originally performed, such as erroneously performing settings relating to the height measurement process on the luminance image, to eliminate setting waste, and to improve user operability.

以下、検査処理条件を設定する手順を、図152のフローチャートに基づいて説明する。まず、ステップS15201において、検査処理を選択する。次にステップS15202において、ステップS15201で選択した検査処理が、距離画像と輝度画像のいずれかを指定可能な検査処理か、あるいは距離画像のみを指定可能な検査処理かを判定する。ここで距離画像と輝度画像のいずれかを指定可能な検査処理の場合は、ステップS15203に進み、距離画像又は輝度画像のいずれかを選択する。   Hereinafter, the procedure for setting the inspection processing condition will be described with reference to the flowchart of FIG. First, in step S15201, an inspection process is selected. In step S 15202, it is determined whether the inspection process selected in step S 15201 is an inspection process that can specify either a distance image or a luminance image, or an inspection process that can specify only a distance image. Here, in the case of the inspection processing in which either the distance image or the luminance image can be specified, the process proceeds to step S15203, and either the distance image or the luminance image is selected.

例えば、図61に示すように、検査処理として「エリア」処理ユニットを選択した場合を考える。この場合は、距離画像、輝度画像のいずれでも指定可能である。そこで、「エリア」処理ユニットでの検査処理設定項目として、例えば図62において「画像設定」ボタン114を押下して、図153に示す画像設定画面380を表示させる場合は、操作欄122から画像を選択できる。ここでは、画像選択欄382に設けられた「表示画像」選択欄124で、第二画像表示領域121に表示される画像を選択できる。また画像設定欄384では、入力画像と登録画像を選択できる。この画像設定欄384から、入力画像を画像変数で指定できる。ここでは、「入力画像」選択欄386を選択すると、図154の画像変数選択画面390が表示され、選択可能な画像の一覧が表示される。画像変数選択画面390では、三次元画像処理装置に接続されている複数の撮像手段(カメラ)で撮像された画像のいずれかを選択できる。ここでは、撮像手段毎に異なる画像変数が付与されており、撮像手段と画像変数とが関連付けられている。例えばカメラ1で撮像した距離画像には画像変数「&Cam1Img」が、カメラ2の距離画像には画像変数「&Cam2Img」が、カメラ3の距離画像には画像変数「&Cam3Img」が、カメラ4の距離画像には画像変数「&Cam4Img」が、それぞれ付与されている。さらにカメラ1で撮像した輝度画像には画像変数「&Cam1GrayImg」が付与されている。ユーザは画像変数選択画面390中から、所望の画像を選択する。このように、「エリア」処理ユニットでは距離画像と輝度画像のいずれでも指定可能であるため、距離画像のみならず輝度画像も、選択肢の候補に含めて表示させている。   For example, as shown in FIG. 61, consider a case where an “area” processing unit is selected as the inspection processing. In this case, either a distance image or a luminance image can be specified. Therefore, as an inspection processing setting item in the “area” processing unit, for example, when the “image setting” button 114 in FIG. 62 is pressed to display the image setting screen 380 shown in FIG. You can choose. Here, an image to be displayed in the second image display area 121 can be selected in the “display image” selection field 124 provided in the image selection field 382. In the image setting field 384, an input image and a registered image can be selected. From this image setting field 384, an input image can be designated by an image variable. Here, when the “input image” selection field 386 is selected, an image variable selection screen 390 of FIG. 154 is displayed, and a list of selectable images is displayed. On the image variable selection screen 390, any of images captured by a plurality of imaging means (cameras) connected to the 3D image processing apparatus can be selected. Here, different image variables are assigned to each imaging unit, and the imaging unit and the image variable are associated with each other. For example, the image variable “& Cam1Img” is used for the distance image captured by the camera 1, the image variable “& Cam2Img” is used for the distance image of the camera 2, the image variable “& Cam3Img” is used for the distance image of the camera 3, and the distance image of the camera 4 is used. The image variable “& Cam4Img” is assigned to each. Furthermore, an image variable “& Cam1GrayImg” is assigned to the luminance image captured by the camera 1. The user selects a desired image from the image variable selection screen 390. As described above, in the “area” processing unit, either a distance image or a luminance image can be designated, and therefore, not only the distance image but also the luminance image is displayed as an option candidate.

さらに必要に応じて、画像変数選択画面390で一覧表示される画像変数を、ソートして表示することもでき、ユーザが所望の画像を選択し易いようにしている。   Furthermore, if necessary, the image variables displayed in a list on the image variable selection screen 390 can be sorted and displayed so that the user can easily select a desired image.

一方、検査処理が距離画像のみを指定可能な処理の場合は、ステップS15204に進み、距離画像を選択する。すなわち、輝度画像の選択ができないようにする。例えば、図45に示すように、検査処理として「高さ計測」処理ユニット266を選択した場合は、距離画像のみを選択できる。よって、図46に示すように、「高さ計測」処理ユニットにおける検査処理設定項目として、「画像設定」ボタン114を選択すると、同様に画像設定画面380が表示され、画像を選択できるようになる。ここで、同様に「入力画像」選択欄386を選択すると、図155の画像変数選択画面390が表示され、選択可能な画像の一覧が表示される。この画像変数選択画面390では、図154と異なり、輝度画像が選択肢に表示されず、距離画像のみが選択肢として表示される。この構成によって、ユーザは高さ計測に際して、誤って高さ情報を有さない輝度画像を選択する事態を回避でき、混乱の少ない操作環境が提供される。   On the other hand, if the inspection process is a process that can specify only a distance image, the process advances to step S15204 to select a distance image. That is, the luminance image cannot be selected. For example, as shown in FIG. 45, when the “height measurement” processing unit 266 is selected as the inspection process, only the distance image can be selected. Therefore, as shown in FIG. 46, when an “image setting” button 114 is selected as an inspection processing setting item in the “height measurement” processing unit, an image setting screen 380 is displayed in the same manner, and an image can be selected. . If the “input image” selection field 386 is selected in the same manner, the image variable selection screen 390 shown in FIG. 155 is displayed, and a list of selectable images is displayed. In this image variable selection screen 390, unlike FIG. 154, the luminance image is not displayed as an option, and only the distance image is displayed as an option. With this configuration, when the height is measured, the user can avoid the situation of erroneously selecting a luminance image that does not have height information, and an operation environment with less confusion is provided.

このようにして、画像が選択されると、ステップS15205に進み、選択された画像に対して、検査処理条件を設定する。このように検査処理毎に、距離画像と輝度画像のいずれかを指定可能な検査処理か、あるいは距離画像のみを指定可能な検査処理かが決まっていることを利用して、検査処理毎に、選択可能な画像の種別を規定することで、設定ミスを回避し、ユーザの利便性に資する。
(検査処理の非表示機能)
When an image is selected in this way, the process proceeds to step S15205, and inspection processing conditions are set for the selected image. As described above, for each inspection process, it is determined whether an inspection process that can specify either a distance image or a luminance image or an inspection process that can specify only a distance image is used. By defining the types of images that can be selected, setting mistakes are avoided, which contributes to user convenience.
(Inspection processing hidden function)

以上は、先に検査処理をユーザに選択させた上で、選択された検査処理の種別に応じて、検査処理の設定を行う対象となる画像の選択に際して、選択可能な画像に制限をかける例について説明した。逆に、先に画像を選択させた上で、この画像に対して実行可能な検査処理の種別に制限をかけることもできる。すなわち、まず画像選択手段で距離画像又は輝度画像を選択させ、次に検査処理選択手段でもって、検査実行手段で実行した検査処理を一以上選択する際に、選択された画像が距離画像か輝度画像かに応じて、各画像に対して実行可能な検査処理のみを選択可能とする。この構成であれば、選択された画像に対して、誤って設定不可能な検査処理を選択したり、この検査処理に関する検査処理条件を設定してしまう事態を回避できる。   The above is an example in which the user is allowed to select the inspection process first, and the selectable image is limited when selecting the image to be subjected to the setting of the inspection process according to the type of the selected inspection process. Explained. Conversely, after selecting an image first, the types of inspection processing that can be performed on this image can be limited. That is, when a distance image or a luminance image is first selected by the image selection means, and then one or more inspection processes executed by the inspection execution means are selected by the inspection processing selection means, the selected image is a distance image or luminance. Only the inspection process that can be executed for each image can be selected depending on the image. With this configuration, it is possible to avoid a situation in which an inspection process that cannot be set by mistake is selected for the selected image or an inspection process condition related to this inspection process is set.

以下、この方法で検査処理条件を設定する手順を、図156のフローチャートに基づいて説明する。まず、ステップS15601において、画像を選択する。ここでは、距離画像か輝度画像かを選択する。次にステップS15602において、ステップS15601で選択した画像が、距離画像と輝度画像のいずれかであるかを判定する。距離画像の場合はステップS15603に進み、距離画像に対して実行可能な検査処理を、検査処理選択手段でもってユーザに選択させる。一方輝度画像の場合はステップS15604に進み、輝度画像に対して実行可能な検査処理を、検査処理選択手段でもってユーザに選択させる。このようにして検査処理が選択されると、ステップS15605に進み、選択された検査処理に対する検査処理条件を検査処理条件設定手段から設定する。   Hereinafter, the procedure for setting the inspection processing conditions by this method will be described based on the flowchart of FIG. First, in step S15601, an image is selected. Here, a distance image or a luminance image is selected. In step S15602, it is determined whether the image selected in step S15601 is a distance image or a luminance image. In the case of a distance image, the process advances to step S15603 to allow the user to select an inspection process that can be performed on the distance image by the inspection process selection unit. On the other hand, in the case of the luminance image, the process proceeds to step S15604, and the inspection process executable on the luminance image is selected by the user using the inspection process selection unit. When the inspection process is selected in this way, the process proceeds to step S15605, and the inspection process condition for the selected inspection process is set from the inspection process condition setting means.

例えば、図157に示すように、ワークに対して輝度画像と距離画像を取得する場合を考える。上述の通り、画像登録を行うと輝度画像と距離画像とが同時に登録される。ユーザは、この内いずれかの画像を選択して、次に選択した画像に対する検査処理を選択し、さらにその検査処理条件の設定を行う。例えば輝度画像を選択した場合は、図158に示すように、輝度画像に対して行う検査処理に対応するツールを追加する。ここでは、上述した図44、図56等と同様に、画像を選択して表示されるサブメニューから追加を選択すると、輝度画像に対して実行可能な検査処理の一覧が表示される。例えば「計測」処理として、「エリア」処理ユニットや「傷」処理ユニット、「ブロブ」処理ユニット267が選択肢として表示される。この段階で、輝度画像に対して実行できない検査処理、例えば「高さ計測」処理ユニットは表示されない。これによって、ユーザが誤って輝度画像に設定できない検査処理を選択してしまう事態を回避できる。なお、すべての計測処理を一覧表示させつつ、グレーアウトさせる等して選択不能とすることもできる。検査処理が選択されると、処理ユニットが確定され、次にこの検査処理に対して必要な検査処理条件の設定を検査処理条件設定手段から行う。   For example, as shown in FIG. 157, consider a case where a luminance image and a distance image are acquired for a work. As described above, when an image is registered, a luminance image and a distance image are registered simultaneously. The user selects one of these images, selects the inspection process for the next selected image, and sets the inspection process condition. For example, when a luminance image is selected, as shown in FIG. 158, a tool corresponding to the inspection process performed on the luminance image is added. Here, as in FIG. 44, FIG. 56, and the like described above, when an addition is selected from the submenu displayed by selecting an image, a list of inspection processes that can be performed on the luminance image is displayed. For example, as the “measurement” process, an “area” processing unit, a “scratch” processing unit, and a “blob” processing unit 267 are displayed as options. At this stage, inspection processing that cannot be performed on the luminance image, for example, a “height measurement” processing unit is not displayed. As a result, it is possible to avoid a situation in which the user erroneously selects an inspection process that cannot be set in the luminance image. It is also possible to make the selection impossible by displaying all measurement processes in a list and graying them out. When the inspection processing is selected, the processing unit is determined, and then the inspection processing condition necessary for this inspection processing is set from the inspection processing condition setting means.

また、距離画像を選択した場合は、図159に示すように距離画像に対して実行可能な検査処理に対応するツールを追加する。ここでも、距離画像を選択して表示されるサブメニューから追加を選択すると、輝度画像に対して実行可能な検査処理の一覧が表示される。例えば「計測」処理として、「エリア」処理ユニットや「傷」処理ユニット、「ブロブ」処理ユニット267に加えて、「高さ計測」処理ユニットも選択肢として表示される。ユーザは所望の検査処理を選択すると、処理ユニットが確定されて、この検査処理に対して必要な検査処理条件の設定を検査処理条件設定手段から行う。   When a distance image is selected, a tool corresponding to an inspection process that can be performed on the distance image is added as shown in FIG. In this case as well, when an add is selected from the submenu displayed by selecting a distance image, a list of inspection processes that can be performed on the luminance image is displayed. For example, in addition to the “area” processing unit, the “scratch” processing unit, and the “blob” processing unit 267, the “height measurement” processing unit is displayed as an option as the “measurement” processing. When the user selects a desired inspection process, the processing unit is determined, and the inspection process condition setting means necessary for the inspection process is set from the inspection process condition setting means.

このように、画像に対して検査処理ツールを紐付けることで、選択不可能な画像と検査処理との組み合わせを物理的に排除し、ユーザによる設定ミスを容易に回避できる。   As described above, by associating the inspection processing tool with the image, the combination of the image that cannot be selected and the inspection processing is physically excluded, and a setting error by the user can be easily avoided.

本発明の三次元画像処理装置、三次元画像処理方法及び三次元画像処理プログラム並びにコンピュータで読み取り可能な記録媒体及び記録した機器は、三角測距の原理を利用した検査装置等に利用できる。   The three-dimensional image processing apparatus, the three-dimensional image processing method, the three-dimensional image processing program, the computer-readable recording medium, and the recorded apparatus according to the present invention can be used in an inspection apparatus using the principle of triangulation.

100、100’、200、300、400…三次元画像処理装置
1、1B、1C、1D…ヘッド部
2、2’…コントローラ部
3…入力手段
4…表示手段
10、10A、10B…撮像手段
20…投光手段;20A…第一プロジェクタ;20B…第二プロジェクタ
21…測定光源
22…パターン生成部
23、24、25…レンズ
30…ヘッド側制御部
31…ヘッド側演算部
32…距離画像生成手段
34…フィルタ処理部
36…ヘッド側通信手段;36A…コントローラ接続用インターフェース;36B…PC接続用インターフェース
38…記憶手段;38a…距離画像記憶部;38b…輝度画像記憶部
41…コントローラ側設定手段
42…コントローラ側通信手段
43…階調変換条件設定手段
44…基準面設定手段
45…空間コード化切替手段
46…階調変換手段
47…間隔均等化処理設定手段
48…投光切替手段
49…シャッタースピード設定手段
50…検査実行手段
51…主制御部
52…コントローラ側接続部
53…操作入力部
54…表示制御部
55…通信部
56…RAM
57…コントローラ側記憶手段
58…補助記憶手段
59…出力部
60…画像処理部
62…異常点ハイライト手段
64…画像サーチ手段
66…リアルタイム更新手段
70…PLC
110…三次元画像処理プログラムGUI画面
111…第一画像表示領域
112…設定項目ボタン領域
113…「画像登録」ボタン
114…「画像設定」ボタン
115…「領域設定」ボタン
116…「高さ抽出」ボタン
117…「前処理」ボタン
118…「検出条件」ボタン
119…「詳細設定」ボタン
120…検査対象領域設定画面
121…第二画像表示領域
122…操作領域
124…「表示画像」選択欄
126…「計測領域」設定欄
128…「編集」ボタン
130…計測領域編集画面
140…高さ抽出選択画面
142…抽出方法選択手段
144…「抽出」ボタン
145…「抽出領域」指定欄
146…点状ポインタ
147…「抽出領域」ボタン
148…抽出領域設定ダイヤログ
149…抽出領域選択欄
150…一点指定画面
152…「Z高さ」表示欄
154…強調方法設定欄
156…ゲイン調整欄
158…「詳細設定」ボタン
160…強調方法詳細設定画面
162…「抽出高さ」設定欄
164…ノイズ除去設定欄
166…無効画素指定欄
170…三点指定画面
172…高さ抽出表示欄
174…三点指定「詳細設定」ボタン
180…三点指定詳細設定画面
182…「抽出高さ」設定欄
190…高さ動的抽出設定画面
192…「計算方法」選択欄
194…「マスク領域」ボタン
196…「詳細設定」ボタン
210…平均高さ基準設定画面
220…マスク領域設定画面
222…「詳細設定」ボタン
230…平均高さ基準詳細設定画面
240…平面基準詳細設定画面
250…自由曲面基準設定画面
252…「抽出サイズ」指定欄
260…初期画面
261…フロー表示領域
262…第三画像表示領域
263…「撮像」処理ユニット
264…「Shapetrax2」処理ユニット
265…「位置補正」処理ユニット
266…「高さ計測」処理ユニット;266B…第二「高さ計測」処理ユニット
267…「ブロブ」処理ユニット;267B…「色検査」処理ユニット
268…「編集」ボタン
269…撮像設定メニュー
270…画像登録画面
271…「カメラ選択」欄
272…「登録」ボタン
280…撮像設定画面
282…「詳細設定」ボタン
284…「撮像設定」ボタン
290…三次元計測設定画面
292…「連続更新で表示する」欄
294…シャッタースピード設定欄
295…数値表示欄
296…濃淡レンジ設定欄
310…前処理設定欄
312…計測不能基準設定欄
314…均等間隔処理設定欄
316…空間コード設定欄
318…プロジェクタ選択設定欄
322…「表示画像」選択欄
324…「編集」ボタン
326…抽出領域編集ダイヤログ
330…マスク領域設定欄
332…「編集」ボタン
334…マスク領域編集ダイヤログ
340…フィルタ処理設定画面
350…二値化レベル設定画面
360…判定条件設定画面
370…第一サブメニュー
372…第二サブメニュー
373…「計測」メニュー
380…画像設定画面
382…画像選択欄
384…画像設定欄
386…「入力画像」選択欄
390…画像変数選択画面
460…高さ計測設定画面
620…エリア設定画面
630…自由曲面基準設定画面
632…「抽出方向」指定欄
640…詳細設定画面
WK、WK7、WK8、WK9、WK10、WK11、WK12、WK13、WK14…ワーク
PC…パーソナルコンピュータ
SA…サーチ対象領域
SI…スポイト状アイコン
ROI…計測領域
BC…ベルトコンベア
DE…打痕
100, 100 ', 200, 300, 400 ... 3D image processing apparatus 1, 1B, 1C, 1D ... head unit 2, 2' ... controller unit 3 ... input means 4 ... display means 10, 10A, 10B ... imaging means 20 ... Projection means; 20A ... First projector; 20B ... Second projector 21 ... Measurement light source 22 ... Pattern generation unit 23, 24, 25 ... Lens 30 ... Head side control unit 31 ... Head side calculation unit 32 ... Distance image generation means 34 ... Filter processing section 36 ... Head side communication means; 36A ... Controller connection interface; 36B ... PC connection interface 38 ... Storage means; 38a ... Distance image storage section; 38b ... Luminance image storage section 41 ... Controller side setting means 42 ... Controller side communication means 43 ... Gradation conversion condition setting means 44 ... Reference plane setting means 45 ... Spatial coding switching means 4 ... gradation conversion means 47 ... interval equalization processing setting means 48 ... projection switching means 49 ... shutter speed setting means 50 ... inspection execution means 51 ... main control section 52 ... controller side connection section 53 ... operation input section 54 ... display control Unit 55 ... Communication unit 56 ... RAM
57 ... Controller-side storage means 58 ... Auxiliary storage means 59 ... Output section 60 ... Image processing section 62 ... Abnormal point highlight means 64 ... Image search means 66 ... Real-time update means 70 ... PLC
110 ... 3D image processing program GUI screen 111 ... First image display area 112 ... Setting item button area 113 ... "Image registration" button 114 ... "Image setting" button 115 ... "Area setting" button 116 ... "Height extraction" Button 117 ... "Pre-processing" button 118 ... "Detection condition" button 119 ... "Detailed setting" button 120 ... Inspection object area setting screen 121 ... Second image display area 122 ... Operation area 124 ... "Display image" selection field 126 ... "Measurement area" setting field 128 ... "Edit" button 130 ... Measurement area edit screen 140 ... Height extraction selection screen 142 ... Extraction method selection means 144 ... "Extraction" button 145 ... "Extraction area" designation field 146 ... Point pointer 147 ... "Extraction area" button 148 ... Extraction area setting dialog 149 ... Extraction area selection field 150 ... Single point designation screen 152 ... "Z height "Display field 154 ... Enhancement method setting field 156 ... Gain adjustment field 158 ..." Detailed setting "button 160 ... Enhancement method detailed setting screen 162 ..." Extraction height "setting field 164 ... Noise removal setting field 166 ... Invalid pixel designation field 170 ... three-point designation screen 172 ... height extraction display field 174 ... three-point designation "detailed setting" button 180 ... three-point designation detailed setting screen 182 ... "extraction height" setting field 190 ... height dynamic extraction setting screen 192 ... "Calculation method" selection field 194 ... "Mask area" button 196 ... "Detailed setting" button 210 ... Average height reference setting screen 220 ... Mask area setting screen 222 ... "Detail setting" button 230 ... Average height reference detailed setting screen 240 ... plane reference detailed setting screen 250 ... free-form surface reference setting screen 252 ... "extraction size" designation field 260 ... initial screen 261 ... flow display area 262 ... third image Display area 263 ... "imaging" processing unit 264 ... "Shapetrax2" processing unit 265 ... "position correction" processing unit 266 ... "height measurement" processing unit; 266B ... second "height measurement" processing unit 267 ... "blob" Processing unit: 267B ... "Color inspection" processing unit 268 ... "Edit" button 269 ... Imaging setting menu 270 ... Image registration screen 271 ... "Camera selection" column 272 ... "Register" button 280 ... Imaging setting screen 282 ... "Detailed settings""Button 284 ..." imaging setting "button 290 ... 3D measurement setting screen 292 ..." display with continuous update "field 294 ... shutter speed setting field 295 ... numerical value display field 296 ... shade range setting field 310 ... pre-processing setting field 312 ... non-measurable reference setting field 314 ... uniform interval processing setting field 316 ... spatial code setting field 318 ... Projector selection setting field 322 ... "Display image" selection field 324 ... "Edit" button 326 ... Extraction area editing dialog 330 ... Mask area setting field 332 ... "Edit" button 334 ... Mask area editing dialog 340 ... Filter processing setting screen 350 ... Binarization level setting screen 360 ... Judgment condition setting screen 370 ... First submenu 372 ... Second submenu 373 ... "Measurement" menu 380 ... Image setting screen 382 ... Image selection field 384 ... Image setting field 386 ... " Input image "selection column 390 ... image variable selection screen 460 ... height measurement setting screen 620 ... area setting screen 630 ... free-form surface reference setting screen 632 ..." extraction direction "designation column 640 ... detailed setting screen WK, WK7, WK8, WK9 , WK10, WK11, WK12, WK13, WK14 ... Work PC ... Personal computer Data SA ... searched area SI ... eyedropper tool icon ROI ... measured region BC ... belt conveyor DE ... dents

Claims (18)

検査対象物の高さ情報を含む距離画像を取得すると共に、該距離画像に基づいて画像処理を行うことが可能な三次元画像処理装置であって、
検査対象物の画像を撮像する撮像手段と、
前記撮像手段で撮像された画像に基づいて、距離画像を生成可能な距離画像生成手段と、
前記距離画像生成手段で生成された距離画像を、該距離画像の階調数よりも低い階調数の距離画像に階調変換する際の階調変換条件を構成する階調変換パラメータとして、該階調変換を行う基準となる基準面を設定するための基準面設定手段と、
前記基準面設定手段で設定された基準面の高さを基準として、前記距離画像を、該距離画像の階調数よりも低い階調数の、該距離画像が有する高さ情報を画像の濃淡値に置き換えた低階調距離画像に階調変換するための階調変換手段と、
前記階調変換手段で階調変換された低階調距離画像に対して、所定の検査処理を実行するための検査実行手段と、
前記階調変換手段で階調変換された低階調距離画像を表示させるための表示手段と
を備え、
前記基準面設定手段が、運用時に外部から入力される検査対象物の入力画像に基づいて、基準面を設定するよう構成してなることを特徴とする三次元画像処理装置。
A three-dimensional image processing apparatus capable of acquiring a distance image including height information of an inspection object and performing image processing based on the distance image,
An imaging means for capturing an image of the inspection object;
A distance image generating means capable of generating a distance image based on an image captured by the imaging means;
As a gradation conversion parameter that constitutes a gradation conversion condition when converting the distance image generated by the distance image generation means into a distance image having a gradation number lower than the number of gradations of the distance image, A reference plane setting means for setting a reference plane as a reference for performing gradation conversion;
Using the height of the reference plane set by the reference plane setting means as a reference, the distance image has height information of the distance image having a lower number of gradations than the number of gradations of the distance image. Gradation conversion means for converting gradation into a low gradation distance image replaced with a value;
Inspection execution means for executing predetermined inspection processing on the low gradation distance image subjected to gradation conversion by the gradation conversion means;
Display means for displaying a low gradation distance image gradation-converted by the gradation conversion means,
3. A three-dimensional image processing apparatus, wherein the reference plane setting means is configured to set a reference plane based on an input image of an inspection object input from the outside during operation.
請求項1に記載の三次元画像処理装置であって、
前記基準面設定手段が、前記表示手段上に表示された距離画像中の任意の点を指定することで、該指定された点の高さ情報を基準面として設定するよう構成してなることを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to claim 1,
The reference plane setting means is configured to set the height information of the designated point as a reference plane by designating an arbitrary point in the distance image displayed on the display means. A featured three-dimensional image processing apparatus.
請求項1に記載の三次元画像処理装置であって、
前記基準面設定手段が、前記表示手段上に表示された距離画像中の任意の一点を指定することで、該指定された点の高さ情報を基準面として設定するよう構成してなることを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to claim 1,
The reference plane setting means is configured to set the height information of the designated point as a reference plane by designating an arbitrary point in the distance image displayed on the display means. A featured three-dimensional image processing apparatus.
請求項1に記載の三次元画像処理装置であって、
前記基準面設定手段が、前記表示手段上に表示された距離画像中の任意の面を指定することで、該指定された面の高さ情報を基準面として設定するよう構成してなることを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to claim 1,
The reference plane setting unit is configured to set the height information of the specified plane as a reference plane by specifying an arbitrary plane in the distance image displayed on the display unit. A featured three-dimensional image processing apparatus.
請求項1に記載の三次元画像処理装置であって、
前記基準面設定手段が、前記表示手段上に表示された距離画像中の任意の三点を指定することで、該指定された三点を含む面の高さ情報を基準面として設定するよう構成してなることを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to claim 1,
The reference plane setting means is configured to set height information of a plane including the designated three points as a reference plane by designating any three points in the distance image displayed on the display means. A three-dimensional image processing apparatus characterized by comprising:
請求項1に記載の三次元画像処理装置であって、
前記基準面設定手段が、前記表示手段上に表示された距離画像から、曲面を演算し、該演算された曲面を基準面として設定するよう構成してなることを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to claim 1,
A three-dimensional image processing apparatus, wherein the reference plane setting means is configured to calculate a curved surface from a distance image displayed on the display means and set the calculated curved surface as a reference plane. .
請求項1〜6のいずれか一に記載の三次元画像処理装置であって、
前記階調変換手段が階調変換を行う際に、入力画像の位置補正を行うよう構成してなることを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to any one of claims 1 to 6,
A three-dimensional image processing apparatus configured to perform position correction of an input image when the gradation conversion means performs gradation conversion.
請求項1〜7のいずれか一に記載の三次元画像処理装置であって、さらに
撮像手段の光軸に対して斜め方向から入射光を所定の投影パターンの構造化照明として投光するための投光手段を備えており、
前記撮像手段は、前記投光手段で投光され、検査対象物で反射された反射光を取得して複数のパターン投影画像を撮像し、
前記距離画像生成手段は、前記撮像手段で撮像された複数のパターン投影画像に基づいて、距離画像を生成するよう構成してなることを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to any one of claims 1 to 7, further for projecting incident light as structured illumination of a predetermined projection pattern from an oblique direction with respect to the optical axis of the imaging means. Equipped with floodlights,
The imaging means obtains reflected light that is projected by the light projecting means and reflected by the inspection object, and takes a plurality of pattern projection images,
The three-dimensional image processing apparatus, wherein the distance image generation unit is configured to generate a distance image based on a plurality of pattern projection images imaged by the imaging unit.
請求項6に記載の三次元画像処理装置であって、さらに
前記階調変換手段による階調変換に際して、局所的な形状変化を抽出する方向を指定するための抽出方向入力手段を備えることを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to claim 6, further comprising an extraction direction input unit for designating a direction in which a local shape change is extracted at the time of gradation conversion by the gradation conversion unit. A three-dimensional image processing apparatus.
請求項9に記載の三次元画像処理装置であって、
前記抽出方向入力手段が、局所的な形状変化を抽出する方向として、距離画像のX方向、Y方向、又はXY方向のいずれかを指定可能としてなることを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to claim 9,
The three-dimensional image processing apparatus characterized in that the extraction direction input means can designate any one of an X direction, a Y direction, or an XY direction of a distance image as a direction for extracting a local shape change.
請求項9又は10に記載の三次元画像処理装置であって、
前記階調変換手段が、階調変換に際して、距離画像を一旦縮小し、フィルタ処理を行った後拡大して自由曲面画像を作成し、該自由曲面画像と距離画像との差分を取ることで、距離画像の形状変化を抽出するものであり、
該距離画像の縮小に際して、前記抽出方向入力手段で指定された方向に対してのみ縮小を行うことを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to claim 9 or 10,
In the gradation conversion, the gradation conversion means temporarily reduces the distance image, performs a filtering process and then expands to create a free curved surface image, and obtains a difference between the free curved surface image and the distance image, Extract the shape change of the distance image,
A three-dimensional image processing apparatus, wherein the distance image is reduced only in a direction specified by the extraction direction input means.
請求項6、9〜11のいずれか一に記載の三次元画像処理装置であって、さらに
検査対象物に対して光切断法で投光するための投光手段を備えており、
前記撮像手段は、前記投光手段で投光された画像を撮像し、前記距離画像生成手段は光切断法で得られたプロファイルを合成して距離画像を生成するよう構成してなることを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to any one of claims 6 and 9 to 11, further comprising a light projecting unit for projecting light on the inspection object by a light cutting method,
The imaging means is configured to take an image projected by the light projecting means, and the distance image generating means is configured to generate a distance image by synthesizing a profile obtained by a light cutting method. A three-dimensional image processing apparatus.
検査対象物の高さ情報を含む距離画像を取得すると共に、該距離画像に基づいて画像処理を行う三次元画像処理方法であって、
撮像手段の光軸に対して斜め方向から入射光を所定の投影パターンの構造化照明として投光手段で投光する工程と、
前記投光手段で投光され、検査対象物で反射された反射光を取得して複数のパターン投影画像を撮像手段で撮像する工程と、
前記撮像手段で撮像された複数のパターン投影画像に基づいて、距離画像を距離画像生成手段で生成する工程と、
前記距離画像生成手段で生成された距離画像を、該距離画像の階調数よりも低い階調数の距離画像に階調変換する際の階調変換条件を構成する階調変換パラメータとして、該階調変換を行う基準となる基準面を設定する工程と、
前記設定された基準面の高さを基準として、前記距離画像を、該距離画像の階調数よりも低い階調数の、該距離画像が有する高さ情報を画像の濃淡値に置き換えた低階調距離画像に階調変換する工程と、
前記階調変換された低階調距離画像に対して、所定の検査処理を実行する工程と
を含むことを特徴とする三次元画像処理方法。
A three-dimensional image processing method for obtaining a distance image including height information of an inspection object and performing image processing based on the distance image,
Projecting incident light from the oblique direction with respect to the optical axis of the imaging means by the light projecting means as structured illumination of a predetermined projection pattern;
Obtaining reflected light projected by the light projecting means and reflected by the inspection object, and imaging a plurality of pattern projection images by the imaging means;
A step of generating a distance image by a distance image generation unit based on a plurality of pattern projection images imaged by the imaging unit;
As a gradation conversion parameter that constitutes a gradation conversion condition when converting the distance image generated by the distance image generation means into a distance image having a gradation number lower than the number of gradations of the distance image, A step of setting a reference plane as a reference for gradation conversion;
Based on the height of the set reference plane, the distance image is a low value obtained by replacing the height information of the distance image with a gradation number lower than the number of gradations of the distance image with the gray value of the image. A step of gradation conversion into a gradation distance image;
A three-dimensional image processing method comprising: performing a predetermined inspection process on the gradation-converted low gradation distance image.
請求項13に記載の三次元画像処理方法であって、
前記基準面の設定に際して、局所的な形状変化を抽出する方向を指定するよう促す工程を含んでおり、
前記階調変換に際して、距離画像から曲面を演算し、該演算された曲面を基準面として低階調距離画像に階調変換することで、該指定された方向における形状変化を抽出することを特徴とする三次元画像処理方法。
The three-dimensional image processing method according to claim 13,
The setting of the reference plane includes a step of prompting to specify a direction in which a local shape change is extracted;
At the time of the gradation conversion, a curved surface is calculated from the distance image, and a shape change in the designated direction is extracted by gradation conversion to a low gradation distance image using the calculated curved surface as a reference plane. A three-dimensional image processing method.
請求項14に記載の三次元画像処理方法であって、
前記基準面の設定に際して、局所的な形状変化を抽出する方向として、距離画像のX方向、Y方向、又はXY方向のいずれかを指定するよう促す工程を含むことを特徴とする三次元画像処理方法。
The three-dimensional image processing method according to claim 14,
3D image processing characterized by including a step of prompting to designate one of an X direction, a Y direction, or an XY direction of a distance image as a direction of extracting a local shape change when setting the reference plane Method.
請求項14又は15に記載の三次元画像処理方法であって、
前記階調変換に際して、距離画像を一旦縮小し、フィルタ処理を行い、拡大して自由曲面画像を作成し、該自由曲面画像と距離画像との差分を取ることで、距離画像の形状変化を抽出しするものであり、
該距離画像の縮小に際して、前記抽出方向入力手段で指定された方向に対してのみ縮小を行うことを特徴とする三次元画像処理方法。
The three-dimensional image processing method according to claim 14 or 15,
At the time of gradation conversion, the distance image is temporarily reduced, filtered, and enlarged to create a free-form surface image, and the difference between the free-form surface image and the distance image is taken to extract the shape change of the distance image And
3. A three-dimensional image processing method, wherein the distance image is reduced only in a direction specified by the extraction direction input means.
検査対象物の高さ情報を含む距離画像を取得すると共に、該距離画像に基づいて画像処理を行うことが可能な三次元画像処理プログラムであって、コンピュータに、
撮像手段の光軸に対して斜め方向から入射光を所定の投影パターンの構造化照明として投光し、検査対象物で反射された反射光を取得して撮像された複数のパターン投影画像に基づいて、距離画像を生成可能な距離画像生成機能と、
前記距離画像生成機能で生成された距離画像を、該距離画像の階調数よりも低い階調数の距離画像に階調変換する際の階調変換条件を構成する階調変換パラメータとして、該階調変換を行う基準となる基準面を設定するための基準面設定機能と、
前記基準面設定機能で設定された基準面の高さを基準として、前記距離画像を、該距離画像の階調数よりも低い階調数の、該距離画像が有する高さ情報を画像の濃淡値に置き換えた低階調距離画像に階調変換するための画像階調変換機能と、
前記階調変換機能で階調変換された低階調距離画像に対して、所定の検査処理を実行するための検査実行機能と
を実現させることを特徴とする三次元画像処理プログラム。
A three-dimensional image processing program capable of acquiring a distance image including height information of an inspection object and performing image processing based on the distance image,
Based on a plurality of pattern projection images obtained by projecting incident light as a structured illumination of a predetermined projection pattern from an oblique direction with respect to the optical axis of the imaging means, obtaining reflected light reflected by the inspection object A distance image generation function capable of generating a distance image,
As a gradation conversion parameter that constitutes a gradation conversion condition for converting the distance image generated by the distance image generation function into a distance image having a gradation number lower than the number of gradations of the distance image, A reference plane setting function for setting a reference plane as a reference for gradation conversion;
Using the height of the reference plane set by the reference plane setting function as a reference, the distance image has height information of the distance image having a gradation number lower than the number of gradations of the distance image. An image gradation conversion function for gradation conversion to a low gradation distance image replaced with a value;
A three-dimensional image processing program for realizing an inspection execution function for executing a predetermined inspection process on a low gradation distance image subjected to gradation conversion by the gradation conversion function.
請求項17に記載される三次元画像処理プログラムを記録したコンピュータ読み取り可能な記録媒体又は記録した機器。   A computer-readable recording medium or a recorded device on which the three-dimensional image processing program according to claim 17 is recorded.
JP2014075429A 2013-07-16 2014-04-01 Three-dimensional image processing apparatus, three-dimensional image processing method, three-dimensional image processing program, computer readable recording medium, and recorded apparatus Active JP6506914B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2014075429A JP6506914B2 (en) 2013-07-16 2014-04-01 Three-dimensional image processing apparatus, three-dimensional image processing method, three-dimensional image processing program, computer readable recording medium, and recorded apparatus
JP2019070254A JP6913705B2 (en) 2013-07-16 2019-04-01 3D image processing equipment, 3D image processing methods and 3D image processing programs, computer-readable recording media and recording equipment

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2013148063 2013-07-16
JP2013148063 2013-07-16
JP2014075429A JP6506914B2 (en) 2013-07-16 2014-04-01 Three-dimensional image processing apparatus, three-dimensional image processing method, three-dimensional image processing program, computer readable recording medium, and recorded apparatus

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2019070254A Division JP6913705B2 (en) 2013-07-16 2019-04-01 3D image processing equipment, 3D image processing methods and 3D image processing programs, computer-readable recording media and recording equipment

Publications (2)

Publication Number Publication Date
JP2015038466A true JP2015038466A (en) 2015-02-26
JP6506914B2 JP6506914B2 (en) 2019-04-24

Family

ID=52631615

Family Applications (3)

Application Number Title Priority Date Filing Date
JP2014075429A Active JP6506914B2 (en) 2013-07-16 2014-04-01 Three-dimensional image processing apparatus, three-dimensional image processing method, three-dimensional image processing program, computer readable recording medium, and recorded apparatus
JP2019070254A Active JP6913705B2 (en) 2013-07-16 2019-04-01 3D image processing equipment, 3D image processing methods and 3D image processing programs, computer-readable recording media and recording equipment
JP2021115017A Active JP7150105B2 (en) 2013-07-16 2021-07-12 3D image processing device and 3D image processing method

Family Applications After (2)

Application Number Title Priority Date Filing Date
JP2019070254A Active JP6913705B2 (en) 2013-07-16 2019-04-01 3D image processing equipment, 3D image processing methods and 3D image processing programs, computer-readable recording media and recording equipment
JP2021115017A Active JP7150105B2 (en) 2013-07-16 2021-07-12 3D image processing device and 3D image processing method

Country Status (1)

Country Link
JP (3) JP6506914B2 (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017103569A (en) * 2015-11-30 2017-06-08 キヤノン株式会社 Image processing device and image processing method
JP2017161232A (en) * 2016-03-07 2017-09-14 オムロン株式会社 Image measurement system and controller
CN107607548A (en) * 2017-09-29 2018-01-19 青海黄河上游水电开发有限责任公司光伏产业技术分公司 The hidden method for splitting defect of photovoltaic module is detected by 3-D view
JP2018040649A (en) * 2016-09-06 2018-03-15 株式会社キーエンス Image inspection device, image inspection method, image inspection program, computer-readable recording medium and recording apparatus
JP2018136218A (en) * 2017-02-22 2018-08-30 オムロン株式会社 Optical displacement sensor and system having the same
JP2018205004A (en) * 2017-05-31 2018-12-27 株式会社キーエンス Image inspection device
JP2019514012A (en) * 2016-04-20 2019-05-30 コー・ヤング・テクノロジー・インコーポレーテッド Item appearance inspection apparatus and item inspection method using the same
CN110871444A (en) * 2018-08-31 2020-03-10 发那科株式会社 Information processing apparatus and information processing method
JP2020062636A (en) * 2018-10-15 2020-04-23 立普思股▲ふん▼有限公司LIPS Corporation Processing method using depth image detection
JP2020123042A (en) * 2019-01-29 2020-08-13 キヤノン株式会社 Information processor and information processing method and system
CN112837327A (en) * 2021-01-28 2021-05-25 北京淳中科技股份有限公司 Image processing method and device, electronic equipment and storage medium
JPWO2021177236A1 (en) * 2020-03-05 2021-09-10
JP2022061546A (en) * 2020-10-07 2022-04-19 Ckd株式会社 Solder print inspection device
JP7402745B2 (en) 2020-05-22 2023-12-21 株式会社キーエンス Imaging device and image inspection system

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102650432B1 (en) * 2021-05-13 2024-03-25 (주)피아이이 3-Dimension image defect measurement system and method
WO2023100734A1 (en) * 2021-11-30 2023-06-08 コニカミノルタ株式会社 Image forming system, image forming method, and program

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000333210A (en) * 1999-05-21 2000-11-30 Asahi Optical Co Ltd Three-dimensional image input device and recording medium
JP2000341720A (en) * 1999-05-31 2000-12-08 Asahi Optical Co Ltd Three-dimensional image input device and recording medium
JP2007172393A (en) * 2005-12-22 2007-07-05 Keyence Corp Three-dimensional image display device, operation method of three-dimensional image display device, three-dimensional image display program, computer readable recording medium and storage device
US20090148038A1 (en) * 2007-12-10 2009-06-11 Youichi Sawachi Distance image processing apparatus and method
JP2009163716A (en) * 2007-12-10 2009-07-23 Fujifilm Corp Distance image processing apparatus and method, distance image reproducing apparatus and method, and program
JP2009163717A (en) * 2007-12-10 2009-07-23 Fujifilm Corp Distance image processing apparatus and method, distance image reproducing apparatus and method, and program
JP2009162747A (en) * 2007-12-10 2009-07-23 Fujifilm Corp Distance image processing device and method, distance image regenerating device and method, and program
JP2010216838A (en) * 2009-03-13 2010-09-30 Omron Corp Image processing apparatus and method
JP2012021909A (en) * 2010-07-15 2012-02-02 Keyence Corp Image processing device and visual inspection method
JP2012185160A (en) * 2011-03-04 2012-09-27 General Electric Co <Ge> Method and device for displaying three-dimensional view of surface of viewed object

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007206797A (en) 2006-01-31 2007-08-16 Omron Corp Image processing method and image processor
CN102713580B (en) 2009-12-11 2014-11-12 第一实业视检系统股份有限公司 Appearance inspection device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000333210A (en) * 1999-05-21 2000-11-30 Asahi Optical Co Ltd Three-dimensional image input device and recording medium
JP2000341720A (en) * 1999-05-31 2000-12-08 Asahi Optical Co Ltd Three-dimensional image input device and recording medium
JP2007172393A (en) * 2005-12-22 2007-07-05 Keyence Corp Three-dimensional image display device, operation method of three-dimensional image display device, three-dimensional image display program, computer readable recording medium and storage device
US20090148038A1 (en) * 2007-12-10 2009-06-11 Youichi Sawachi Distance image processing apparatus and method
JP2009163716A (en) * 2007-12-10 2009-07-23 Fujifilm Corp Distance image processing apparatus and method, distance image reproducing apparatus and method, and program
JP2009163717A (en) * 2007-12-10 2009-07-23 Fujifilm Corp Distance image processing apparatus and method, distance image reproducing apparatus and method, and program
JP2009162747A (en) * 2007-12-10 2009-07-23 Fujifilm Corp Distance image processing device and method, distance image regenerating device and method, and program
JP2010216838A (en) * 2009-03-13 2010-09-30 Omron Corp Image processing apparatus and method
JP2012021909A (en) * 2010-07-15 2012-02-02 Keyence Corp Image processing device and visual inspection method
JP2012185160A (en) * 2011-03-04 2012-09-27 General Electric Co <Ge> Method and device for displaying three-dimensional view of surface of viewed object

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017103569A (en) * 2015-11-30 2017-06-08 キヤノン株式会社 Image processing device and image processing method
JP2017161232A (en) * 2016-03-07 2017-09-14 オムロン株式会社 Image measurement system and controller
US10313569B2 (en) 2016-03-07 2019-06-04 Omron Corporation Image measurement system and controller
US11100629B2 (en) 2016-04-20 2021-08-24 Koh Young Technology Inc. Appearance inspecting apparatus for article and appearance inspecting method for article using the same
JP2019514012A (en) * 2016-04-20 2019-05-30 コー・ヤング・テクノロジー・インコーポレーテッド Item appearance inspection apparatus and item inspection method using the same
JP2018040649A (en) * 2016-09-06 2018-03-15 株式会社キーエンス Image inspection device, image inspection method, image inspection program, computer-readable recording medium and recording apparatus
JP2018136218A (en) * 2017-02-22 2018-08-30 オムロン株式会社 Optical displacement sensor and system having the same
JP2018205004A (en) * 2017-05-31 2018-12-27 株式会社キーエンス Image inspection device
CN107607548A (en) * 2017-09-29 2018-01-19 青海黄河上游水电开发有限责任公司光伏产业技术分公司 The hidden method for splitting defect of photovoltaic module is detected by 3-D view
CN110871444A (en) * 2018-08-31 2020-03-10 发那科株式会社 Information processing apparatus and information processing method
CN110871444B (en) * 2018-08-31 2023-05-12 发那科株式会社 Information processing apparatus and information processing method
JP2020062636A (en) * 2018-10-15 2020-04-23 立普思股▲ふん▼有限公司LIPS Corporation Processing method using depth image detection
JP2020123042A (en) * 2019-01-29 2020-08-13 キヤノン株式会社 Information processor and information processing method and system
JP7378934B2 (en) 2019-01-29 2023-11-14 キヤノン株式会社 Information processing device, information processing method and system
JPWO2021177236A1 (en) * 2020-03-05 2021-09-10
WO2021177236A1 (en) * 2020-03-05 2021-09-10 ファナック株式会社 Three-dimensional measuring device, and three-dimensional measuring method
JP7401648B2 (en) 2020-03-05 2023-12-19 ファナック株式会社 3D measurement device and 3D measurement method
JP7402745B2 (en) 2020-05-22 2023-12-21 株式会社キーエンス Imaging device and image inspection system
JP2022061546A (en) * 2020-10-07 2022-04-19 Ckd株式会社 Solder print inspection device
JP7157112B2 (en) 2020-10-07 2022-10-19 Ckd株式会社 Solder print inspection device
CN112837327B (en) * 2021-01-28 2023-04-28 北京淳中科技股份有限公司 Image processing method and device, electronic equipment and storage medium
CN112837327A (en) * 2021-01-28 2021-05-25 北京淳中科技股份有限公司 Image processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
JP2019105657A (en) 2019-06-27
JP2021177186A (en) 2021-11-11
JP6506914B2 (en) 2019-04-24
JP6913705B2 (en) 2021-08-04
JP7150105B2 (en) 2022-10-07

Similar Documents

Publication Publication Date Title
JP6270361B2 (en) 3D image processing apparatus, 3D image processing method, 3D image processing program, computer-readable recording medium, and recorded apparatus
JP6913705B2 (en) 3D image processing equipment, 3D image processing methods and 3D image processing programs, computer-readable recording media and recording equipment
JP6242098B2 (en) 3D image processing apparatus, 3D image processing method, 3D image processing program, computer-readable recording medium, and recorded apparatus
JP6184289B2 (en) 3D image processing apparatus, 3D image processing method, 3D image processing program, computer-readable recording medium, and recorded apparatus
JP5564349B2 (en) Image processing apparatus and appearance inspection method
JP6745173B2 (en) Image inspection apparatus, image inspection method, image inspection program, computer-readable recording medium, and recorded device
JP6246513B2 (en) 3D image processing apparatus, 3D image processing method, 3D image processing program, computer-readable recording medium, and recorded apparatus
JP2015021759A (en) Three-dimensional image processor, head unit for the three-dimensional image processor, and three-dimensional image processing method
JP6571831B2 (en) Appearance inspection device
CN108323179B (en) Inspection system and inspection method
JP6256249B2 (en) Measuring device, substrate inspection device, and control method thereof
JP2015021763A (en) Three-dimensional image processor, three-dimensional image processing method, three-dimensional image processing program, and computer-readable recording medium
CN110231352B (en) Image inspection apparatus, image inspection method, and image inspection recording medium
JP6571830B2 (en) Appearance inspection device
JP6334861B2 (en) Appearance inspection apparatus, appearance inspection method, appearance inspection program, and computer-readable recording medium
JP6207270B2 (en) 3D image processing apparatus, 3D image processing method, 3D image processing program, computer-readable recording medium, and recorded apparatus
JP6557319B2 (en) 3D image processing apparatus, 3D image processing apparatus head unit, 3D image processing method, 3D image processing program, computer-readable recording medium, and recorded apparatus
JP6266244B2 (en) 3D image processing apparatus, 3D image processing method, 3D image processing program, computer-readable recording medium, and recorded apparatus
JP6266243B2 (en) 3D image processing apparatus, 3D image processing method, 3D image processing program, computer-readable recording medium, and recorded apparatus
JP2017194380A (en) Inspection device, recording medium and program
JP4563184B2 (en) Method and apparatus for inspecting mura defect
JP5033077B2 (en) Method and apparatus for inspecting appearance of molded product
JP2010032332A (en) Method and device for visual inspection

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170301

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20171227

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180123

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180307

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180821

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20181022

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20190305

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190401

R150 Certificate of patent or registration of utility model

Ref document number: 6506914

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250