JP6913705B2 - 3D image processing equipment, 3D image processing methods and 3D image processing programs, computer-readable recording media and recording equipment - Google Patents

3D image processing equipment, 3D image processing methods and 3D image processing programs, computer-readable recording media and recording equipment Download PDF

Info

Publication number
JP6913705B2
JP6913705B2 JP2019070254A JP2019070254A JP6913705B2 JP 6913705 B2 JP6913705 B2 JP 6913705B2 JP 2019070254 A JP2019070254 A JP 2019070254A JP 2019070254 A JP2019070254 A JP 2019070254A JP 6913705 B2 JP6913705 B2 JP 6913705B2
Authority
JP
Japan
Prior art keywords
image
distance image
gradation
distance
gradation conversion
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2019070254A
Other languages
Japanese (ja)
Other versions
JP2019105657A (en
Inventor
真達 下平
真達 下平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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
Publication of JP2019105657A publication Critical patent/JP2019105657A/en
Priority to JP2021115017A priority Critical patent/JP7150105B2/en
Application granted granted Critical
Publication of JP6913705B2 publication Critical patent/JP6913705B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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]

Description

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

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

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

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

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

ここで三角測距の原理を、図160に基づいて説明する。ヘッド部は、投光部110から出射される入射光の光軸と、受光部120に入射する反射光の光軸(受光部120の光軸)との間の角度αが予め設定されている。ここでワーク上にワークが載置されない場合には、投光部110から出射される入射光は、ワークの載置面の点Oにより反射され、受光部120に入射される。一方、ワーク上にワークが載置される場合、投光部110から出射される入射光は、ワークの表面の点Aにより反射され、反射光となって受光部120に入射される。そして点Oと点Aとの間のX方向における距離dを測定し、この距離dに基づいてワークの表面の点Aの高さhを算出する。 Here, the principle of triangular ranging will be described with reference to FIG. 160. The head unit has a preset angle α between the optical axis of the incident light emitted from the light projecting unit 110 and the optical axis of the reflected light incident on the light receiving unit 120 (the optical axis of the light receiving unit 120). .. 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 mounting surface of the work 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, becomes reflected light, and is incident on the light receiving unit 120. Then, the distance d between the point O and the point A in the X direction is measured, and the height h of the point A on the surface of the work is calculated based on this distance d.

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

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

一方、既存の画像処理装置では、主に輝度を画素値とした輝度画像が使用されている。例えば、ライン上を搬送されるワークに対して、モノクロのカメラでワークの外観を光学的な濃淡で表現した輝度画像を撮像して、画像処理によって検査を行うシステムが存在する。このような状況において、新たに三次元計測装置、及びそこから出力される三次元データ(ポイントクラウドデータ)を処理する処理装置を導入しようとすると、相当コストがかかる。 On the other hand, in the existing image processing apparatus, a luminance image in which the luminance is mainly used as a pixel value is used. For example, there is a system in which a monochrome camera captures a luminance image expressing the appearance of the work in optical shades on the work transported on the line, and inspects the work by image processing. In such a situation, if it is attempted to newly introduce a three-dimensional measuring device and a processing device that processes three-dimensional data (point cloud data) output from the 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 to be handled is the same as the existing luminance image. Therefore, even in the equipment of the image processing device using the existing luminance image, the distance You will be able to handle images.

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

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

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

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

しかしながら、使用者の検査対象ワークに高さ方向のばらつきが存在する場合、当初指定した階調変換パラメータにより階調変換を行うだけでは、検査に適した画像を取得できないことがあった。 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 only by performing gradation conversion using the initially specified gradation conversion parameter.

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

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

課題を解決するための手段及び発明の効果Means for Solving Problems and Effects of 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 based on the distance image is acquired. A three-dimensional image processing device capable of performing processing, an imaging means for capturing an image of an object to be inspected, and a distance image generating means capable of generating a distance image based on the image captured by the imaging means. As a gradation conversion parameter that constitutes a gradation conversion condition when the distance image generated by the distance image generation means is gradation-converted to a distance image having a gradation number lower than the gradation number of the distance image. A reference plane setting means for setting a reference plane as a reference for performing the gradation conversion, and the distance image of the distance image based on the height of the reference plane set by the reference plane setting means. A gradation conversion means for converting a gradation into a low gradation distance image in which the height information of the distance image having a gradation number lower than the number of gradations is replaced with a grayscale value of the image, and the gradation conversion means. An inspection execution means for executing a predetermined inspection process and a low gradation distance image to be gradation-converted by the gradation conversion means for displaying the gradation-converted low-gradation distance image in during operation of a display unit, before SL performs 3D image processing by the 3D image processing apparatus, the distance of said distance image generating means, the inspection object based on the input image of the inspection object which is sequentially input from the outside image sequentially generate said reference plane setting means, based on the sequential height information of the generated range image, by resetting the reference plane, to change the reference surface in accordance with the height of the test object The gradation conversion means converts each distance image into the low gradation distance image with reference to the height of the reference plane reset for each distance image generated by the distance image generation means. It is configured to perform conversion, and when the gradation conversion means performs gradation conversion, it can be configured to perform position correction using the distance image.

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

さらに、第3の側面に係る三次元画像処理装置によれば、上記いずれかの構成に加えて、前記基準面設定手段が、前記三次元画像処理装置で三次元画像処理を行う運用時に外部から入力される検査対象物の入力画像に基づいて、基準面を設定するよう構成されており、前記基準面設定手段が、前記表示手段上に表示された距離画像から、曲面を演算し、該演算された曲面を基準面として設定するよう構成できる。上記構成により、抽出方向入力手段で指定された方向における検査対象物の変化を抽出でき、いいかると該指定された方向において変化しない形状、例えば長手方向に連続する溝などは無視して、正確な形状抽出が可能となる。
Further, according to the three-dimensional image processing apparatus according to the third aspect, in addition to any of the above configurations, the reference plane setting means is externally used during the operation of performing the three-dimensional image processing by the three-dimensional image processing apparatus. The reference plane is set based on the input image of the inspection object to be input, and the reference plane setting means calculates a curved surface from the distance image displayed on the display means, and the calculation is performed. It can be configured to set the curved surface as a reference plane. With the above configuration, changes in the inspection object in the direction specified by the extraction direction input means can be extracted, and the shape that does not change in the specified direction, for example, a groove continuous in the longitudinal direction, is ignored and accurate. Shape extraction is possible.

さらにまた、第4の側面に係る三次元画像処理装置によれば、前記抽出方向入力手段が、局所的な形状変化を抽出する方向として、距離画像のX方向、Y方向、又はXY方向のいずれかを指定可能とすることができる。 Furthermore, according to the three-dimensional image processing apparatus according to the fourth aspect, the extraction direction input means can extract a local shape change in any of the X direction, the Y direction, and the XY direction of the distance image. Can be specified.

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

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

さらにまた、第7の側面に係る三次元画像処理装置によれば、上記いずれかの構成に加えて、前記基準面設定手段が、前記三次元画像処理装置で三次元画像処理を行う運用時において、新たに入力された距離画像に対して、該距離画像上で指定された抽出領域内の高さ情報に基づいて選択された計算方法で、階調変換を行う基準となる基準面を設定し、設定された基準面の高さに基づいて前記階調変換手段による階調変換を実行するよう構成できる。
Furthermore, according to the three-dimensional image processing apparatus according to the seventh aspect, in addition to any of the above configurations, when the reference plane setting means is in operation to perform three-dimensional image processing with the three-dimensional image processing apparatus. , For the newly input distance image, set the reference plane as the reference for gradation conversion by the calculation method selected based on the height information in the extraction area specified on the distance image. , It can be configured to execute the gradation conversion by the gradation conversion means based on the height of the set reference plane.

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

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

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

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

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

さらにまた、第13の側面に係る三次元画像処理方法によれば、検査対象物の高さ情報を含む距離画像を取得すると共に、該距離画像に基づいて画像処理を行う三次元画像処理方法であって、撮像手段の光軸に対して斜め方向から入射光を所定の投影パターンの構造化照明として投光手段で投光する工程と、前記投光手段で投光され、検査対象物で反射された反射光を取得して複数のパターン投影画像を撮像手段で撮像する工程と、前記撮像手段で撮像された複数のパターン投影画像に基づいて、距離画像を距離画像生成手段で生成する工程と、前記距離画像生成手段で生成された距離画像を、該距離画像の階調数よりも低い階調数の距離画像に階調変換する際の階調変換条件を構成する階調変換パラメータとして、該階調変換を行う基準となる基準面を設定する工程と、前記設定された基準面の高さを基準として、前記距離画像を、該距離画像の階調数よりも低い階調数の、該距離画像が有する高さ情報を画像の濃淡値に置き換えた低階調距離画像に階調変換する工程と、前記階調変換された低階調距離画像に対して、所定の検査処理を実行する工程とを含み、さらに前記基準面の設定に際して、局所的な形状変化を抽出する方向を指定するよう促す工程を含んでおり、前記階調変換に際して、距離画像から曲面を演算し、該演算された曲面を基準面として低階調距離画像に階調変換することで、該指定された方向における形状変化を抽出し、前記距離画像生成手段が、外部から逐次入力される検査対象物の入力画像に基づいて検査対象物の距離画像を逐次生成し、該逐次生成された距離画像の高さ情報に基づいて、基準面を再設定することにより、検査対象物の高さに応じて基準面を変更し、前記距離画像生成手段が生成した距離画像毎に再設定された基準面の高さを基準として、各距離画像を前記低階調距離画像に変換し、前記階調変換を行う際に、前記距離画像を用いた位置補正を行うことができる。これにより、単純に高階調の距離画像を低階調の距離画像に変換するのでなく、基準面を設定した上で、この基準面の高さを基準として階調変換を行うことで、基準面近傍の高さ情報が階調変換で損なわれる事態を回避して、精度の高い検査が実現できる。また、抽出方向入力手段で指定された方向における検査対象物の変化を抽出でき、いいかると該指定された方向において変化しない形状、例えば長手方向に連続する溝などは無視して、正確な形状抽出が可能となる。
Furthermore , according to the three-dimensional image processing method according to the thirteenth aspect, a three-dimensional image processing method that acquires a distance image including height information of an inspection object and performs image processing based on the distance image. Therefore, there is a step of projecting incident light from an oblique direction with respect to the optical axis of the image pickup means by the light projecting means as structured illumination of a predetermined projection pattern, and a step of projecting the light by the light projecting means and reflecting it by the inspection object. A step of acquiring the reflected light and capturing a plurality of pattern projection images by the imaging means, and a step of generating a distance image by the distance image generation means based on the plurality of pattern projection images captured by the imaging means. As a gradation conversion parameter that constitutes a gradation conversion condition when the distance image generated by the distance image generation means is gradation-converted to a distance image having a gradation number lower than the gradation number of the distance image. Based on the step of setting a reference plane as a reference for performing the gradation conversion and the height of the set reference plane, the distance image is divided into a number of gradations lower than the number of gradations of the distance image. A step of gradation-converting the height information of the distance image into a low-gradation distance image in which the grayscale value of the image is replaced, and a predetermined inspection process are executed on the gradation-converted low-gradation distance image. In addition to the step of prompting to specify the direction for extracting the local shape change when setting the reference plane, the curved surface is calculated from the distance image at the time of the gradation conversion, and the calculation is performed. By gradation-converting the formed curved surface into a low-gradation distance image as a reference plane, a shape change in the specified direction is extracted, and the distance image generation means inputs an inspection object that is sequentially input from the outside. By sequentially generating a distance image of the inspection object based on the image and resetting the reference plane based on the height information of the sequentially generated distance image, the reference plane is set according to the height of the inspection target. Is changed, and each distance image is converted into the low gradation distance image based on the height of the reference plane reset for each distance image generated by the distance image generation means, and the gradation conversion is performed. In addition, position correction using the distance image can be performed. As a result, instead of simply converting a high-gradation distance image into a low-gradation distance image, a reference plane is set and gradation conversion is performed using the height of the reference plane as a reference. Highly accurate inspection can be realized by avoiding the situation where the height information in the vicinity is impaired by the gradation conversion. In addition, changes in the inspection object in the direction specified by the extraction direction input means can be extracted, and in other words, a shape that does not change in the specified direction, such as a groove continuous in the longitudinal direction, is ignored and an accurate shape is obtained. Extraction is possible.

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

さらにまた、第15の側面に係る三次元画像処理方法によれば、前記階調変換に際して、距離画像を一旦縮小し、フィルタ処理を行い、拡大して自由曲面画像を作成し、該自由曲面画像と距離画像との差分を取ることで、距離画像の形状変化を抽出するものであり、該距離画像の縮小に際して、前記階調変換において局所的な形状変化を抽出する方向を指定するための抽出方向入力手段で指定された方向に対してのみ縮小を行うこととできる。これにより、抽出方向入力手段で指定された方向に対しては縮小を行わず、指定された方向以外で距離画像を縮小することで、自由曲面画像に指定された方向における高さ情報を残し、これとの差分を取ることで該方向における緩やかな形状変化を排除して、必要な形状のみを抽出することが可能となる。
さらにまた、第16の側面に係る三次元画像処理方法によれば、上記いずれかに加えて、前記基準面を設定する工程において、三次元画像処理装置で三次元画像処理を行う運用時に外部から入力される検査対象物の入力画像に基づいて、前記基準面を設定しており、前記階調変換する工程において、入力画像の位置補正を行うことができる。
Furthermore , according to the three-dimensional image processing method according to the fifteenth aspect, at the time of the gradation conversion, the distance image is temporarily reduced, filtered, and enlarged to create a free curved image. By taking the difference between the distance image and the distance image, the shape change of the distance image is extracted, and when the distance image is reduced, the extraction for specifying the direction for extracting the local shape change in the gradation conversion is performed. The reduction can be performed only in the direction specified by the direction input means. As a result, the height information in the direction specified in the free-form surface image is left by reducing the distance image in a direction other than the specified direction without reducing the direction specified by the extraction direction input means. By taking the difference from this, it is possible to eliminate the gradual shape change in the direction and extract only the necessary shape.
Furthermore, according to the three-dimensional image processing method according to the sixteenth aspect, in addition to any of the above, in the step of setting the reference plane, from the outside during the operation of performing the three-dimensional image processing with the three-dimensional image processing apparatus. The reference plane is set based on the input image of the input inspection object, and the position of the input image can be corrected in the step of gradation conversion.

さらにまた、第17の側面に係る三次元画像処理プログラムによれば、検査対象物の高さ情報を含む距離画像を取得すると共に、該距離画像に基づいて画像処理を行うことが可能な三次元画像処理プログラムであって、コンピュータに、撮像手段の光軸に対して斜め方向から入射光を所定の投影パターンの構造化照明として投光し、検査対象物で反射された反射光を取得して撮像された複数のパターン投影画像に基づいて、距離画像を生成可能な距離画像生成機能と、前記距離画像生成機能で生成された距離画像を表示させる機能と、必要な設定を行うための設定モードにおいて、ユーザからの操作を受け付け、各種の設定を行う設定機能として、前記距離画像生成機能で生成された距離画像を階調変換する際の階調変換条件を構成する階調変換パラメータとして、該階調変換を行う基準となる基準面を設定するための基準面設定機能と、前記設定モードの後に三次元画像処理を行う運用モードにおいて、前記距離画像を、該距離画像の階調数よりも低い階調数の、該距離画像が有する高さ情報を画像の濃淡値に置き換えた低階調距離画像に階調変換するための画像階調変換機能と、前記低階調距離画像に対して、所定の検査処理を実行するための検査実行機能とを実現させ、前記運用モード時に、前記基準面設定機能は、三次元画像処理装置で三次元画像処理を行う運用時に外部から入力される検査対象物の入力画像に基づいて、前記基準面を設定するよう構成しており、前記階調変換機能は、前記入力画像の位置補正を行うよう構成しており、前記距離画像生成機能が、外部から逐次入力される検査対象物の入力画像に基づいて検査対象物の距離画像を逐次生成し、該逐次生成された距離画像の高さ情報に基づいて、基準面を再設定することにより、検査対象物の高さに応じて基準面を変更し、前記距離画像生成機能が生成した距離画像毎に再設定された基準面の高さを基準として、各距離画像を前記低階調距離画像に変換し、前記階調変換を行う際に、前記距離画像を用いた位置補正を行うよう構成することができる。 Furthermore, according to the three-dimensional image processing program according to the seventeenth aspect, it is possible to acquire a distance image including height information of the inspection object and perform image processing based on the distance image. An image processing program that projects incident light onto a computer from an oblique direction with respect to the optical axis of the imaging means as structured illumination of a predetermined projection pattern, and acquires the reflected light reflected by the inspection object. A distance image generation function that can generate a distance image based on a plurality of captured pattern projection images, a function that displays a distance image generated by the distance image generation function, and a setting mode for making necessary settings. As a setting function for accepting operations from the user and making various settings, as a gradation conversion parameter constituting a gradation conversion condition when gradation conversion is performed on a distance image generated by the distance image generation function. In the reference plane setting function for setting a reference plane as a reference for gradation conversion and the operation mode in which three-dimensional image processing is performed after the setting mode, the distance image is set to be larger than the number of gradations of the distance image. An image gradation conversion function for converting a low gradation image into a low gradation distance image in which the height information of the distance image is replaced with a grayscale value of the image, and the low gradation distance image. , An inspection execution function for executing a predetermined inspection process is realized, and in the operation mode, the reference plane setting function is an inspection input from the outside during the operation of performing the three-dimensional image processing in the three-dimensional image processing device. The reference plane is set based on the input image of the object, the gradation conversion function is configured to correct the position of the input image, and the distance image generation function is external. By sequentially generating a distance image of the inspection object based on the input image of the inspection object sequentially input from, and resetting the reference plane based on the height information of the sequentially generated distance image, the inspection is performed. The reference plane is changed according to the height of the object, and each distance image is converted into the low gradation distance image based on the height of the reference plane reset for each distance image generated by the distance image generation function. When the conversion is performed and the gradation conversion is performed, the position correction using the distance image can be performed.

さらにまた、第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, the computer-readable recording medium or storage device according to the eighteenth aspect stores the above-mentioned three-dimensional image processing program. Recording media include CD-ROM, CD-R, CD-RW, flexible disc, magnetic tape, MO, DVD-ROM, DVD-RAM, DVD-R, DVD + R, DVD-RW, DVD + RW, and Blu-ray (registered). Includes magnetic discs such as trademark), HD DVD (AOD), optical discs, opto-magnetic discs, semiconductor memory and other media capable of storing programs. Further, the program includes a program stored in the above-mentioned recording medium and distributed, and a program distributed by download through a network line such as the Internet. Further, the stored device includes a general-purpose or dedicated device in which the above program is implemented in a state in which 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 program software that can be executed by a computer, and each part of the process may be executed by hardware such as a predetermined gate array (FPGA, ASIC), or program software. It may be realized in a form in which and a partial hardware module that realizes a part of the hardware are mixed.

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

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

また本明細書において「距離画像(高さ画像)」という場合には、高さ情報を含む画像の意味で使用し、例えば距離画像に光学的な輝度画像をテクスチャ情報として貼り付けた三次元の合成画像も、距離画像に含む意味で使用する。また、本明細書において距離画像の表示形態は二次元状に表示されるものに限られず、三次元状に表示されるものも含む。
(実施の形態1)
Further, in the present specification, the term "distance image (height image)" is used to mean an image including height information, for example, a three-dimensional image in which an optical brightness image is pasted as texture information on a distance image. The composite image is also used in the sense that it is included in the 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 shape, but also includes the one displayed in a three-dimensional shape.
(Embodiment 1)

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

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

以上の三次元画像処理装置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 the measurement light onto the work W, and the image pickup means 10 patterns the reflected light reflected by the measurement light incident on the work W. Image as a projected image. Further, a distance image is generated based on the pattern projection image, and the distance image is further converted into a low gradation distance image in which the height information of each pixel is replaced with the brightness. The controller unit 2 executes measurement processing such as edge detection and area calculation based on the converted low gradation distance image.

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

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

撮像手段10は、PLC70から入力される制御信号、例えば撮像手段10から画像データを取り込むタイミングを規定する撮像トリガ信号に基づいて、ワークの撮像を行う。 The imaging means 10 images the work 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 means 10.

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

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

なお、以上の例ではコントローラ部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, like the three-dimensional image processing device 100'related to the modification shown in FIG. 2, a device in which a dedicated inspection program or a three-dimensional image processing program is installed on a general-purpose personal computer, workstation, or the like functions as a controller unit 2'. It can also be used by connecting to the head unit 1. This three-dimensional image processing device is required by performing necessary settings such as image processing with a three-dimensional image processing program and then performing image processing on a low gradation distance image according to the pattern projection image captured by the head unit 1. Perform a thorough inspection.
(Head side communication means 36)

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

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

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

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

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

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

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

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

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

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

また、以上の例では撮像手段を一台、投光手段を二台とする構成について説明したが、逆に撮像手段を二台、投光手段を一台とする構成とすることもできる。このような例を実施の形態4に係る三次元画像処理装置400として図4Bに示す。この例に示すヘッド部1Dでは、投光手段20をワークWに対して鉛直姿勢に保持し、図においてその左右に撮像手段10をそれぞれ、ワークWに対して傾斜姿勢に配置させている。この構成でも、ワークWを異なる傾斜角度から撮像できるので、実施の形態3と同様にパターン投影画像が部分的に撮像困難となる事態を抑制できる。またこの方法であれば、一回の投光で2枚のパターン投影画像を同時に撮像できるため、処理時間を短縮化できる利点も得られる。 Further, in the above example, the configuration in which the imaging means is one and the light projecting means is two has been described, but conversely, the configuration in which the imaging means is two and the light projecting means is one can be used. An example of this is shown in FIG. 4B as the three-dimensional image processing apparatus 400 according to the fourth embodiment. In the head portion 1D shown in this example, the light projecting means 20 is held in a vertical posture with respect to the work W, and the imaging means 10 are arranged on the left and right sides of the light projecting means 10 in an inclined posture with respect to the work W, respectively. Even with this configuration, since the work W can be imaged from different inclination angles, it is possible to suppress a situation in which the pattern projection image is partially difficult to image as in the third embodiment. Further, with this method, since two pattern projection images can be captured at the same time with one 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 different angles by the two imaging means, the imaged part and the field of view are different, so it is necessary to match the positions of each pixel, and an error may occur. be. On the other hand, according to the third embodiment described above, by sharing the imaging means, it is possible to capture an image of the same field of view regardless of which light projecting means emits the measurement light. There is an advantage that the processing can be simplified by eliminating the need for various integration work and avoiding the occurrence of errors due to the integration work.

なお以上の例では、各ヘッド部において撮像手段10と投光手段20とを一体的に構成した例を説明したが、本発明はこの構成に限られない。例えば、撮像手段10と投光手段20とを別個の部材で構成したヘッド部とすること可能である。また、撮像手段や投光手段を3以上設けることも可能である。
(ブロック図)
In the above examples, an example in which the imaging means 10 and the light projecting means 20 are integrally configured in each head portion has been described, but the present invention is not limited to this configuration. For example, the imaging means 10 and the light projecting means 20 can be a head portion composed of 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 the configuration of the three-dimensional image processing apparatus 300 according to the third embodiment of the present invention. As shown in FIG. 5, the three-dimensional image processing device 300 includes a head unit 1 and a controller unit 2.
(Head part 1)

このヘッド部1は、投光手段20と、撮像手段10と、ヘッド側制御部30と、ヘッド側演算部31と、記憶手段38と、ヘッド側通信手段36等を備えている。投光手段20は、測定光源21、パターン生成部22及び複数のレンズ23、24、25を含む。撮像手段10は、図示しないがカメラ及び複数のレンズを含む。
(投光手段20)
The head unit 1 includes a light projecting means 20, an imaging means 10, a head side control unit 30, a head side calculation unit 31, a storage means 38, a head side communication means 36, and the like. The light projecting means 20 includes a measurement light source 21, a pattern generation unit 22, and a plurality of lenses 23, 24, and 25. The imaging means 10 includes a camera and a plurality of lenses (not shown).
(Light projecting 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 means 20 is a member for projecting incident light from an oblique direction with respect to the optical axis of the imaging means as structured illumination of a predetermined projection pattern. A projector can be used in the light projecting means 20, and a lens, a pattern generation unit 22, and the like, which are optical members, are included. The light projecting means 20 is arranged obliquely above the position of the stationary or moving work. The head portion 1 may also include a plurality of light projecting means 20. In the example of FIG. 5, the head portion 1 includes two light projecting means 20. Here, the first projector 20A (on the right side in FIG. 5) capable of irradiating the work with the illumination light for measurement from the first direction and the work for measurement from a second direction different from the first direction. A second projector 20B (on the left side in FIG. 5) capable of irradiating illumination light is arranged respectively. The first projector 20A and the second projector 20B are arranged symmetrically with respect to the optical axis of the imaging means 10. Measurement light is alternately projected from the first projector 20A and the second projector 20B onto the work, 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 focused by the lens and then incident on the pattern generation unit 22.

さらに、距離画像を生成するためのパターン投影画像を取得する測定光を出射するための投光手段に加え、通常の光学画像(輝度画像)を撮像するための観察用照明光源を設けることもできる。観察用照明光源には、LEDの他、半導体レーザ(LD)やハロゲンライト、HID等を利用できる。特に撮像素子としてカラーで撮像可能な素子を用いた場合は、観察用照明光源に白色光源を利用できる。 Further, in addition to the light projecting means for emitting the measurement light for acquiring the pattern projection image for generating the distance image, an observation illumination light source for capturing a normal optical image (luminance image) can also be provided. .. In addition to LEDs, semiconductor lasers (LDs), halogen lights, HIDs, and the like can be used as the illumination light source for observation. In particular, when a color image sensor is used as the image sensor, 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 focused by the lens 113 and then incident on the pattern generation unit 112. The pattern generation unit 22 can realize illumination of an arbitrary pattern. For example, it is possible to invert the pattern according to the color of the work or background, such as white letters for black letters and black letters for white letters, to express an appropriate pattern that is easy to see or measure. For such a pattern generation unit 22, for example, a DMD (Digital Micromirror Device) can be used. The DMD can express an arbitrary pattern by turning on / off a minute mirror for each pixel. As a result, it is possible to easily irradiate a pattern in which white and black are inverted. By using DMD for the pattern generation unit 22, an arbitrary pattern can be easily generated, and it is not necessary to prepare a mechanical pattern mask or replace it, so that there is an advantage that the device can be miniaturized and quick measurement can be performed. .. Further, since the pattern generation unit 112 using the DMD can be used in the same manner as normal illumination by irradiating all illumination patterns with all pixels turned on, it can also be used for capturing a luminance image. Further, the pattern generation unit 22 may be an LCD (liquid crystal display), LCOS (Liquid Crystal on Silicon: reflective liquid crystal element), 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 by the pattern generation unit 22 is converted into light having a diameter larger than the field of view that can be observed and measured by the imaging means 10 by a plurality of lenses, and then irradiated to the work.
(Imaging means 10)

撮像手段10は、投光手段20で投光され、ワークWKで反射された反射光を取得して複数のパターン投影画像を撮像するためのカメラを備える。このようなカメラには、CCDやCMOS等が利用できる。この例では高解像度の得られるモノクロCCDカメラを利用している。なお、カラーで撮像可能なカメラを使用することも可能であることはいうまでも無い。また撮像手段は、パターン投影画像以外に、通常の輝度画像を撮像することも可能である。 The image pickup means 10 includes a camera for acquiring the reflected light projected by the light projecting means 20 and reflected by the work WK and capturing 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 that can obtain high resolution is used. Needless to say, it is also possible to use a camera capable of capturing images in color. The imaging means can also capture a normal luminance image in addition to the pattern projection 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, which are the imaging means 10 and the light projecting means 20. For example, the head unit side control unit 30 creates a projection pattern for the projection means 20 to project the measurement light onto the work to obtain a pattern projection image. As a result, the imaging means 10 projects a projection pattern for phase shift from the projection means 20 to capture a phase shift image, and a projection pattern for spatial coding is projected from the projection means 20 to obtain a spatial code image. Have an image taken. In this way, the head-side control unit 30 functions as a light projection control means for controlling the light projection means so that the image pickup means 10 captures the phase shift image and the space code image.

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

ヘッド側記憶手段38は、各種設定や画像等を保持するための部材であり、半導体メモリやハードディスク等の記憶素子が利用できる。例えば、撮像手段10で撮像されたパターン投影画像を保持するための輝度画像記憶部38b、及び距離画像生成手段32で生成された距離画像を保持するための距離画像記憶部38aを含む。 The head-side storage means 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, it includes a luminance image storage unit 38b for holding a pattern projection image captured by the imaging means 10, and a distance image storage unit 38a for holding a distance image generated by the distance image generation means 32.

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

距離画像生成手段32は、ワークWKを撮像する撮像手段10からワークWKまでの距離に応じて各画素の濃淡値が変化する距離画像を生成する手段である。例えば、位相シフト法で距離画像を生成する場合は、ワークに対して正弦波縞模様パターンを位相ずらして投影するように、ヘッド側制御部30が投光手段20を制御し、それに応じて正弦波縞模様パターンの位相がずれた画像を複数枚撮像するように、ヘッド側制御部30が撮像手段10を制御する。そしてヘッド側制御部30は、複数枚の画像から画素毎に正弦波の位相を求め、求めた位相を利用して距離画像を生成する。 The distance image generation means 32 is a means for generating a distance image in which the shading value of each pixel changes according to the distance from the image pickup means 10 that images the work WK to the work WK. For example, when a distance image is generated by the phase shift method, the head side control unit 30 controls the light projecting means 20 so as to project the sinusoidal fringe pattern on the work in a phase-shifted manner, and the sinusoidal pattern is projected accordingly. The head-side control unit 30 controls the imaging means 10 so as to capture a plurality of images in which the phase of the wavy pattern pattern is out of phase. Then, the head side control unit 30 obtains the phase of the sine wave 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 coding method, the space irradiated with light is divided into a large number of small spaces having a substantially fan-shaped cross section, and a series of space code numbers are assigned to these small spaces. Therefore, even if the height of the work 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 in the space irradiated with light. Therefore, the shape of a high work piece can be measured as a whole.

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

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

またコントローラ部2は、コントローラ側通信手段42と、コントローラ側制御部と、コントローラ側演算部と、コントローラ側記憶手段と、検査実行手段50と、コントローラ側設定手段41とを備えている。コントローラ側通信手段42は、ヘッド部1のヘッド側通信手段36と接続されてデータ通信を行う。コントローラ側制御部は、各部材の制御を行うための部材である。コントローラ側演算部は、画像処理部60の機能を実現する。画像処理部60は、画像サーチ手段64や階調変換手段46等の機能を実現する。
(階調変換手段)
Further, the controller unit 2 includes a controller-side communication means 42, a controller-side control unit, a controller-side calculation unit, a controller-side storage means, an inspection execution means 50, and a controller-side setting means 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 realizes functions such as an image search means 64 and a gradation conversion means 46.
(Gradation conversion means)

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

さらに階調変換手段は、距離画像のすべてを階調変換するのでなく、好ましくは、必要な部分のみを選択して、階調変換する。具体的には、予め検査対象領域設定手段(詳細は後述)で設定された検査対象領域と対応する部分のみを階調変換する。このようにすることで、多階調の距離画像を低階調の距離画像に変換する処理を、検査対象領域のみに限ることで階調変換に要する負荷を軽減できる。またこのことは処理時間の短縮化にも寄与する。すなわち、処理時間の短縮化を図ることで、FA用途の検査のような処理時間の限られた用途においても好適に利用でき、リアルタイム処理が実現される。 Further, the gradation conversion means does not perform gradation conversion on all of the distance image, but preferably selects only a necessary portion and performs gradation conversion. Specifically, only the portion corresponding to the inspection target area set in advance by the inspection target area setting means (details will be described later) is gradation-converted. By doing so, the load required for gradation conversion can be reduced by limiting the process of converting a multi-gradation distance image to a low-gradation distance image only in the inspection target area. This also contributes to shortening the processing time. That is, by shortening the processing time, it can be suitably used even in applications with limited processing time 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, receives an operation from the user via an input means 3 such as a console connected to the controller unit, and provides necessary conditions and the like to the controller side. Instruct. For example, the functions of the gradation conversion condition setting means 43, the reference plane setting means 44, the spatial coding switching means 45, the interval equalization processing setting means 47, the light projection switching means 48, the shutter speed setting means 49, and the like are realized.

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

検査実行手段50は、階調変換手段46で階調変換された低階調距離画像に対して、所定の検査処理を実行する。
(ハードウェア構成)
The inspection execution means 50 executes a predetermined inspection process on the low gradation distance image that has been gradation-converted by the gradation conversion means 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 the 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 hardware unit. 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. It has 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等を備えている。これらの各ハードウェアは、バス等の電気的な通信路(配線)を介し、通信可能に接続されている。 Further, the controller unit 2 is connected to the head unit 1 including the image pickup means 10, the light projecting means 20, and the like, and controls the light projecting means 20 so as to project the sinusoidal striped pattern on the work in a shifted phase. To the controller-side connection unit 52 for capturing image data obtained by imaging with the image pickup means 10, the operation input unit 53 into which the operation signal from the input means 3 is input, and the display means 4 such as a liquid crystal panel. A display control unit 54 composed of a display DSP or the like for displaying an image, a communication unit 55 connected so as to be able to communicate with an external PLC 70, a personal computer PC, or the like, and a RAM 56 for holding temporary data. The controller-side storage means 57 for storing the contents, the auxiliary storage means 58 for holding the data set by the three-dimensional image processing program installed in the personal computer PC, and the measurement processing such as edge detection and area calculation are executed. It is provided with an image processing unit 60 composed of a DSP for calculation and the like, and an output unit 59 and the like for outputting the result of performing a predetermined inspection based on the processing result of the image processing unit 60 and the like. Each of these hardware is communicably connected via an electrical communication path (wiring) such as a bus.

主制御部51内のプログラムメモリには、コントローラ側接続部52、操作入力部53、表示制御部54、通信部55、及び画像処理部60の各部を、CPUのコマンド等により制御するための制御プログラムが格納されている。また、上述した処理順序プログラム、すなわちパーソナルコンピュータPCにおいて生成され、パーソナルコンピュータPCから転送された処理順序プログラムは、プログラムメモリに格納される。 In the program memory in the main control unit 51, control for controlling each unit 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. Further, the above-mentioned processing sequence program, that is, the processing sequence 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) for receiving an image pickup trigger signal from the PLC 70 when a trigger input is received from a sensor (photoelectric sensor or the like) connected to the external PLC 70. It also functions as an interface (I / F) for receiving a three-dimensional image processing program transferred from a personal computer PC, layout information defining a display mode of the display means 4, and the like.

主制御部51のCPUは、通信部55を介してPLC70から撮像トリガ信号を受信すると、コントローラ側接続部52に対して撮像指令(コマンド)を送る。また、処理順序プログラムに基づいて、画像処理部60に対して、実行すべき画像処理を指示するコマンドを送信する。なお、撮像トリガ信号を生成する装置として、PLC70ではなく、光電センサ等のトリガ入力用のセンサを、通信部55に直接接続するように構成してもよい。 When the CPU of the main control unit 51 receives the image pickup trigger signal from the PLC 70 via the communication unit 55, the CPU sends an image pickup command (command) to the controller side connection unit 52. Further, based on the processing order program, a command for instructing the image processing to be executed is transmitted to the image processing unit 60. As a device for generating an imaging trigger signal, a sensor for trigger input such as a photoelectric sensor may be configured to 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) for receiving an operation signal from the input means 3 based on the user's operation. The display means 4 displays the operation contents of the user using the input means 3. For example, when a console is used as the input means 3, each component such as a cross key for moving the cursor displayed on the display means 4 up / down / left / right, a decision button, or a cancel button can be arranged. By operating each of these parts, the user can create a flowchart that defines the processing order of image processing on the display means 4, edit the parameter value of each image processing, and set the reference area. , You can edit the reference registration image.

コントローラ側接続部52は、画像データの取り込みを行う。具体的には、例えばCPUから撮像手段10の撮像指令を受信すると、撮像手段10に対して画像データ取り込み信号を送信する。そして、撮像手段10で撮像が行われた後、撮像して得られた画像データを取り込む。取り込んだ画像データは、一旦バッファリング(キャッシュ)され、予め用意しておいた画像変数に代入される。なお、「画像変数」とは、数値を扱う通常の変数と異なり、対応する画像処理ユニットの入力画像として割り付けることで、計測処理や画像表示の参照先となる変数をいう。 The controller side connection unit 52 captures image data. Specifically, for example, when an image pickup command of the image pickup means 10 is received from the CPU, an image data acquisition signal is transmitted to the image pickup means 10. Then, after the image is taken by the image pickup means 10, the image data obtained by the image is taken in. The captured image data is once buffered (cached) and assigned to an image variable prepared in advance. The "image variable" refers to a variable that can be used as a reference for measurement processing or image display by allocating it 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 executes measurement processing on the image data. Specifically, first, the controller-side connection unit 52 reads the image data from the frame buffer while referring to the above-mentioned image variables, and internally transfers the image data to the memory in the image processing unit 60. Then, the image processing unit 60 reads out the image data stored in the memory and executes the measurement process. Further, the image processing unit 60 includes a gradation conversion means 46, an abnormal point highlighting means 62, an image search means 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 means 4 based on the display command (display command) sent from the CPU. For example, a control signal is transmitted to the display means 4 in order to display the image data before or after the measurement process. The display control unit 54 also transmits a control signal for displaying the operation content of the user using the input means 3 on the display means 4.

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

以上の三次元画像処理装置は、ワークの距離画像を取得し、この距離画像に対して画像処理を行い、この結果に対して検査を行う。本実施の形態における三次元画像処理装置は、距離画像の画素値である高さ情報をそのまま用いて演算を行う高さ検査処理に加えて、既存のハードウェアを用いて面積やエッジ等の情報を用いた演算を行う画像検査処理の、2種類の検査を実施することができる。ここで、高さ検査処理の精度を維持するためには、多階調な距離画像を生成する必要がある。一方、既存のハードウェアではこのような多階調な距離画像に画像検査処理を実施することはできない。そのため、既存のハードウェアを用いて画像検査処理を行うために、多階調な距離画像に階調変換を施し、低階調距離画像を生成する。 The above three-dimensional image processing apparatus acquires a distance image of the work, performs image processing on the distance image, and inspects the result. The three-dimensional image processing apparatus according to the present embodiment uses existing hardware to provide information such as area and edge, in addition to height inspection processing in which height information which is a pixel value of a distance image is used as it is for calculation. It is possible to carry out two types of inspections, that is, an image inspection process that performs an operation using. Here, in order to maintain the accuracy of the height inspection process, it is necessary to generate a multi-gradation distance image. On the other hand, with existing hardware, it is not possible to perform image inspection processing on such a multi-gradation distance image. 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-gradation distance image is directly converted into the low-gradation distance image, there is a problem that the accuracy of the height information is impaired. Most of the general images used for FA applications are monochrome images in which the shading value of each pixel is expressed in 8 gradations. On the other hand, as the distance image, a high-gradation image such as a 16-gradation image is used. Therefore, when the multi-gradation distance image is gradation-converted to the low-gradation distance image, the height information is considerably impaired, which affects the accuracy of the inspection. However, in order to increase the number of gradations of the image handled by the existing image processing in order to improve 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 the gradation conversion conditions so that the required height information is maintained. The method and procedure will be described in detail below.
(Height inspection or image inspection)

まず、三次元画像処理装置を用いて高さ検査処理を行う処理動作を、図7のフローチャートに基づいて説明する。この三次元画像処理装置は、計算処理を行うためのツールとして、距離画像に対して高さ検査を行う高さ検査処理ツールと、既存の輝度画像に対して画像検査を行う各種の画像検査処理ツールとを備えている。ここでは、高さ検査処理について説明する。 First, the processing operation of performing the height inspection process using the three-dimensional image processing device will be described with reference to the flowchart of FIG. 7. This three-dimensional image processing device is a height inspection processing tool that performs height inspection on a distance image and various image inspection processes that perform image inspection on an existing luminance image as tools for performing calculation processing. It has 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 generation means 32 generates a distance image by using the image pickup means 10 and the light projecting means 20. Then, the desired calculation process is selected (step S72). Here, select the tools required for the calculation process.

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

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

さらに、検査実行手段50が、各種計算処理を行い(ステップS74)、次いでこの計算結果に基づいて、ワークが良品であるか否かを判定する(ステップS75)。判定信号出力手段160は、検査実行手段50によってワークが良品であると判定された場合には(ステップS75:YES)、判定信号としてOK信号をPLC70に出力し(ステップS76)、検査実行手段50によってワークが良品でない、すなわち不良品であると判定された場合には(ステップS75:NO)、判定信号としてNG信号をPLC70に出力する(ステップS77)。
(設定モード)
Further, the inspection executing means 50 performs various calculation processes (step S74), and then determines whether or not the work is a non-defective product based on the calculation results (step S75). When the inspection execution means 50 determines that the work is a non-defective product (step S75: YES), the determination signal output means 160 outputs an OK signal to the PLC 70 as a determination signal (step S76), and the inspection execution means 50. When it is determined that the work 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 the procedure in the setting mode in which various settings are made to the three-dimensional image processing apparatus prior to the 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 recall the image saved as a registered image, or to acquire a new input image and make settings for it. Here, the input image obtained by imaging the work is registered as a registered image as an alternative to the input image that is sequentially input during operation. Further, the registered image registered in advance may be called. Next, in step S82, the gradation conversion method is selected. Here, the user is prompted to select either static conversion or dynamic conversion. Next, in step S83, the gradation conversion parameter is adjusted. Here, when static conversion is selected in step S82, the gradation conversion parameter is adjusted for the image acquired in step S81. The method of adjusting the gradation conversion parameter will be described later. The procedure described above is an example, and may be in a different order. For example, the image may be acquired after the gradation conversion method is selected.
(Details of setting procedure)

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

まず、距離画像と輝度画像の登録を行う。ここでは、図9に示す三次元画像処理プログラムの初期画面260から、「撮像」処理ユニット263の設定を行う。具体的には「撮像」処理ユニットのボタン263のボタンを押下する。これにより、図10の撮像設定メニュー269に切り替わる。
(三次元画像処理プログラム)
First, the distance image and the luminance image are registered. Here, the "imaging" processing unit 263 is set from the initial screen 260 of the three-dimensional image processing program shown in FIG. Specifically, the button 263 of the "imaging" processing unit is pressed. As a result, the image switching to the imaging setting menu 269 of FIG. 10 is switched.
(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. In the setting item button area 112, the "image registration" button 113, the "imaging setting" button 284, the "camera setting" button, the "trigger setting" button, the "flash setting" button, the "lighting volume" button, and the "lighting expansion unit" Button, "Save" button, etc. are provided. The user can select a desired setting item button from the setting item button area 112 and set necessary setting items.

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

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

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

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

次に、撮像手段で距離画像を撮像する設定例を、図14〜図42に基づいて説明する。上述した画像の登録に先立ち、図10の撮像設定メニュー269から、「撮像設定」ボタン284を押下すると、図14の撮像設定画面280となる。撮像設定画面280では。撮像に関する基本的な設定を行える。例えば「撮像有効設定」ボタンを押下すると図15の撮像有効設定画面が表示され、三次元画像処理装置に接続されている撮像手段すなわちカメラを選択できる。例えば撮像手段として、通常の輝度画像を撮像するモノクロCCDカメラやカラーCCDカメラに代えて、あるいはこれに加えて、高さ情報を取得可能なカメラを接続することで、距離画像を三次元画像処理装置に取り込むことが可能となる。また、複数の撮像手段を三次元画像処理装置に接続している際に、いずれの撮像手段を使用するか、一以上を選択できる。 Next, a setting example for capturing a distance image with the imaging means will be described with reference to FIGS. 14 to 42. Prior to the registration of the above-mentioned image, when the "imaging setting" button 284 is pressed from the imaging setting menu 269 of FIG. 10, the imaging setting screen 280 of FIG. 14 is displayed. On the imaging setting screen 280. You can make basic settings related to imaging. For example, when the "imaging valid setting" button is pressed, the imaging valid setting screen of FIG. 15 is displayed, and the imaging means connected to the three-dimensional image processing device, that is, the camera can be selected. For example, as an imaging means, a distance image is processed in three dimensions by replacing or in addition to a monochrome CCD camera or a color CCD camera that captures a normal luminance image, or by connecting a camera capable of acquiring height information. It can be taken into the device. Further, when a plurality of image pickup means are connected to the three-dimensional image processing device, one or more image pickup 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, the three-dimensional measurement setting screen 290 shown in FIG. 16 is obtained. Note that in FIG. 16, different workpieces are displayed for convenience of explanation. The three-dimensional measurement setting screen 290 of FIG. 16 has a “display by continuous update” column 292, which corresponds to a real-time update means, a shutter speed setting column 294, which corresponds to a shutter speed setting means 49, a shade range setting column 296, a preprocessing setting column 310, and measurement. It includes an impossible reference setting field 312, an even 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.
(Real-time update means)

ここでは、操作領域において設定が変更された場合、第二画像表示領域121上で表示中の画像に対して変更後の設定に更新するリアルタイム更新手段を備えている。リアルタイム更新手段はON/OFFを切り替えることができる。図16の画面例において、リアルタイム更新手段の一形態として操作領域の上段に設けられた「連続更新で表示する」欄292をONとすることで、リアルタイム更新機能を動作させることができる。 Here, when the setting is changed in the operation area, a real-time update means for updating the image displayed on the second image display area 121 to the changed setting is provided. The real-time update 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 by 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, shading range, preprocessing, unmeasurable reference, even interval processing, spatial code, projector selection, display image, and the like. Hereinafter, the description will be given 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)
In the example of FIG. 16, a shutter speed setting column 294 is provided as one aspect of the shutter speed setting means 49 for adjusting the shutter speed at the time of imaging by the imaging means. The user can specify the shutter speed from the shutter speed setting field 294. Here, from the drop-down box, preset shutter speeds such as 1/15, 1/30, 1/60, 1/120, 1/240, 1/500, 1/1000 ,,, 1/20000 Select. The number of seconds corresponding to the selected numerical value is displayed in the numerical display field 295 on the right side. It is also possible to directly specify an arbitrary shutter speed numerically. For example, if "Numeric value input" is selected as a drop-down box option, the grayout of the numerical value display field 295 is canceled and the numerical value can be directly input. In this way, the exposure time of the camera (imaging element), which is an 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 confirm by displaying the shade image of the luminance image in the second image display area 121 rather than the distance image. Further, by the above real-time update function, the image whose shutter speed is changed in the shutter speed setting field 294 is promptly reflected in the second image display area 121, so that the user can visually check whether the current setting is appropriate or not. It can be confirmed and the adjustment work can be easily performed.
(Shadow range setting field 296)

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

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

計測不能基準設定欄312では、ノイズ成分をカットするレベルを設定する。すなわち計測不能基準設定欄312で設定された量だけ、高さ計測を行わない。パターン投影画像を用いた三次元の高さ情報の計測においては、ある程度の光量がないと、正確な高さ情報を計測できない。その一方で、多重反射が生じている場合等は、明るすぎるため光量を落とす必要がある。このように、撮像されたパターン投影画像に応じてノイズ成分カット量を選択する。具体的には、各画素の高さ情報を演算するためデータに対して、ノイズによる無効データと見なす閾値を決定する。 In the non-measurable reference setting field 312, the level at which the noise component is cut is set. That is, the height is not measured by the amount set in the unmeasurable 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 reflections occur, it is too bright and it is necessary to reduce the amount of light. In this way, the noise component cut amount is selected according to the captured pattern projection image. Specifically, in order to calculate the height information of each pixel, the threshold value to be regarded as invalid data due to noise is determined for the data.

ここでは図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, the height is measured for all pixels without cutting the noise component. 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 distinguish from this screen, an incorrect height is measured by noise data at the corners of the work.

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

その一方で、測定不能であることを示す黒点が特にワークの左下の領域で増大し、ノイズと見なされて高さ計測ができない位置が増えていることも、図21から確認できる。さらに、図22に示す例では、計測不能基準設定欄312で「高」を選択した状態を示しており、ノイズ成分の除去が効き過ぎている結果、本来残しておきたいデータまで失われていることが確認できる。このように、ノイズ除去の閾値を示す測定不能基準の設定が低すぎる場合は、ノイズを元に高さを計算することとなる。逆に高すぎると、本来残しておきたい箇所も無効と見なされてしまうことになる。このためユーザは、上記リアルタイム更新機能を利用することで、測定不能基準の設定を調整すると共に、調整後の画像を第二画像表示領域で確認し、設定の結果を直接画像で参照しながら、適切な値に調整することができる。
(均等間隔処理設定欄314)
On the other hand, it can also be confirmed from FIG. 21 that the black spot indicating that the measurement is impossible increases especially in the lower left region of the work, and the position where the height cannot be measured because it is regarded as noise is increasing. Further, in the example shown in FIG. 22, a state in which “high” is selected in the unmeasurable reference setting field 312 is shown, and as a result of excessive removal of the noise component, even the data originally desired to be retained is lost. Can be confirmed. As described above, when the setting of the non-measurable reference indicating the noise removal threshold value is too low, the height is calculated based on the noise. On the other hand, if it is too high, the part that you originally wanted to keep will be considered invalid. Therefore, by using the above real-time update function, the user adjusts the setting of the non-measurable standard, confirms the adjusted image in the second image display area, and directly refers to the setting result with 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, the error due to the angle of view is corrected. The even 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. 23. By turning on the uniform interval processing, distance images arranged at equal pitches in the xy direction are acquired. Here, an even-pitch image whose position in the XY direction is evenly spaced regardless of the height (Z coordinate) is displayed in the second image display area 121. For example, in an application for inspecting dimensions on the XY plane, it is necessary to turn on the uniform interval processing. The part that has been corrected and the data is lost is treated as invalid. 24 and 25 show a state in which the uniform 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, and in FIG. 25, a “shade image” is selected to display a luminance image. The displayed examples are shown respectively.

一方、均等間隔処理をOFFとすると、図26で示すように目で見たままの画像(Z画像)となり、画面の端部に進むに従ってXY方向に歪みが生じる。ただ、均等間隔処理を行わない分、画像の表示までに要する時間が短くて済む。なお図27は、表示画像欄で「濃淡画像」を選択して、第二画像表示領域121で輝度画像を表示させた例を示している。
(空間コード設定欄316)
On the other hand, when the uniform interval processing is turned off, an image (Z image) as seen visually is obtained as shown in FIG. 26, and distortion occurs in the XY direction toward the edge of the screen. However, since the even interval processing is not performed, the time required to display the image can be shortened. Note that FIG. 27 shows an example in which a “shade image” is selected in the display image field 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 to use the space coding method is selected. That is, the space code setting field 316 functions as the space code conversion switching means 45. In this three-dimensional image processing apparatus, the phase shift method is indispensable for generating a distance image, and in addition to the phase shift method, whether or not the spatial coding 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. 28. When the space code setting field 316 is turned ON, the height is measured by the combination of the space coding method and the phase shift method. An example of this is shown in FIGS. 29 and 30. In these figures, 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, the "height image" is selected in the "display image" selection field 322. On the other hand, FIG. 30 shows a state in which the luminance image is displayed in the second image display area 121, and the “shade image” is selected in the “display image” selection field 322. By using the spatial coding method in addition to the phase shift method, an appropriate distance image can be obtained. Specifically, since the phase jump can be corrected (phase unwrapped) by the phase shift method by the spatial coding method, it is possible to measure with high resolution while ensuring a wide dynamic range of the height. However, the imaging time is about twice as long as that in the case of 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 shifts by one cycle or more, the height cannot be measured correctly. On the contrary, in the case of a work whose height does not change much, since the striped image is not imaged or combined by the spatial coding method, the processing can be speeded up by that amount, and the imaging time can be halved. For example, when measuring a workpiece with a small difference in the height direction, it is not necessary to take a large dynamic range, so the processing time should be shortened while maintaining highly accurate height measurement performance even with the phase shift method alone. Can be done. 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 shifts by one cycle or more, the height cannot be measured correctly. On the contrary, in the case of a work whose height does not change much, the advantage that the imaging time can be halved can be obtained by turning off the spatial code.

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

なお、この例では位相シフト法を必須としているが、位相シフト法のON/OFFを選択可能としてもよい。
(プロジェクタ選択設定欄318)
Although the phase shift method is indispensable in this example, 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 floodlight switching means 48 for switching ON / OFF of the first projector and the second projector. Here, in the projector selection setting field 318, the light projecting means (projector) to be used is selected from the first projector and the second projector, which are the two light projecting 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) 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-sided projection which is the projection from either the first projector or the second projector, the portion shaded by the projection. Height is not measured. In the example of FIG. 34, an example in which "1" is selected in the projector selection setting field 318 is shown, and in the example of FIG. 35, an example in which "2" is selected is shown. On each screen, the data of the shadowed part is displayed in black, and it can be confirmed from each screen that there is an area on the work where the height cannot be measured. Further, as is clear from these figures, it can be seen that the unmeasurable region differs depending on the light projecting means. In other words, even if one of the light projecting means cannot measure the area, the other light projecting means can project the light, and therefore there are many areas where the height can be measured. Therefore, by combining these, the unmeasurable region can be reduced. In particular, by arranging the workpieces so as to be sandwiched between the first projector and the second projector from both sides, the first projection from the first projector and the second projection from the second projector are in opposite directions. Since the work is irradiated, it is possible to reduce the risk of shadowing due to the projection of light from the other, which is in the opposite direction, even if the region is shadowed by the projection of either one.

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

「表示画像」選択欄322では、第二画像表示領域121に表示される画像を選択する。例えば、検査の用途に応じて表示対象を選択することで、各設定の妥当性を実際に表示された画像から視覚的に確認することができる。特に、上述したリアルタイム更新手段をONとすることで、設定の変更を逐次更新して変化の前後で対比できるので、用途に即して意図した画像となるよう、イメージに基づいて設定を調整できる。また各設定パラメータの意味に習熟していない初心者であっても、画像を見ながら設定できる利点も得られる。この例では、図37に示すように「表示画像」選択欄322から、「高さ画像」、「濃淡画像」、「白とび・黒つぶれ画像」、「縞投光−プロジェクタ1」、「縞投光−プロジェクタ2」のいずれかを選択する。「高さ画像」は距離画像であり、高さ毎に等高線状に色分けして着色した画像を表示する。「濃淡画像」は輝度画像である。この例では、位相シフト法に基づいて撮像した複数のパターン投影画像を合成した画像を、輝度画像として利用している。ただ、ワークに照明を照射して撮像手段で光学的な画像を撮像し、輝度画像として利用することもできる。
(異常点ハイライト手段62)
In the "display image" selection field 322, an image to be displayed in the second image display area 121 is selected. For example, by selecting the display target according to the purpose of inspection, the validity of each setting can be visually confirmed from the actually displayed image. In particular, by turning on the above-mentioned real-time update means, it is possible to sequentially update the setting changes and compare them before and after the change, so that the settings can be adjusted based on the image so that the image is intended according to the application. .. In addition, even a beginner who is not familiar with the meaning of each setting parameter can obtain the advantage of being able to set while looking at the image. In this example, as shown in FIG. 37, from the “display image” selection field 322, “height image”, “shade image”, “overexposure / blackout image”, “striped projection-projector 1”, “stripes”. Select one of "flooding-projector 2". The "height image" is a distance image, and displays a colored image that is color-coded into contour lines for each height. A "shade image" is a luminance image. In this example, an image obtained by synthesizing 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 irradiate the work with illumination, capture 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 the abnormal point highlighting means 62 as shown in FIG. For example, the "overexposed / underexposed image" that can be selected in the "display image" selection field 322 described above partially includes saturated overexposed pixels, underexposed pixels with insufficient light intensity, and the like with respect to the luminance image. It is a colored image. In this way, by highlighting the part of the image where the accurate value is not obtained and the measurement accuracy is considered to be unreliable by the coloring process, the part with low measurement accuracy is visually displayed to the user. It makes it easier to confirm whether or not an image suitable for the desired inspection application is obtained. In this example, the overexposed pixels are colored yellow and the underexposed pixels are colored blue. This allows the user to visually confirm how the whitened areas are distributed in the image using the color as a clue. Further, 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 these pixels approaches zero.

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

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

ユーザは、第二画像表示領域121に表示される画像を参照しながら、シャッタスピードと濃淡レンジが適切かをどうかを確認し、適切な値に調整する。具体的には、第二画像表示領域121に白とび・黒つぶれ画像を表示させた状態で、白とび画素や黒つぶれ画素が少なくなるように確認しながら調整する。例えば、シャッタースピード設定欄294でシャッタースピードを調整することによって、黒つぶれ画素、すなわち光量が足りず暗すぎる部位がなくなるようにする。また濃淡レンジを調整することで、白とび画素、すなわち明るすぎる部位がなくなるようにする。図16の例では、白とび・黒つぶれ画像中に、暗すぎるので黒つぶれ画素が多い。このため、シャッタースピードの調整を行う。 The user confirms whether the shutter speed and the shading range are appropriate while referring to the image displayed in the second image display area 121, and adjusts them to appropriate values. Specifically, in a state where the overexposed / underexposed image is displayed in the second image display area 121, the adjustment is made while confirming that the overexposed pixels and the underexposed pixels are reduced. For example, by adjusting the shutter speed in the shutter speed setting field 294, blackout pixels, that is, a portion where the amount of light is insufficient and too dark is eliminated. In addition, by adjusting the shading range, overexposed pixels, that is, areas that are too bright are eliminated. In the example of FIG. 16, there are many blackout pixels because it is too dark in the whiteout / blackout image. 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" in FIG. 16 and switched to "1/15" as shown in FIG. 40, the luminance image becomes slightly brighter and the number of blackout pixels becomes 0. You can see that it has become. However, the number of overexposed pixels has increased on the contrary. Therefore, when the shutter speed is switched to "1/30" as shown in FIG. 41, it can be seen that the number of overexposed pixels remains 0 and the number of overexposed pixels also decreases.

さらに濃淡レンジ設定欄296を「低い(−1)」に設定した図41の状態から、図42に示すように「普通(0)」に切り替えて一段階上げると、白とび画素が減少したことが判る。さらに図43に示すように「高い(1)」に切り替えると、白とび画素が0になったことが判る。これによって白とび画素数、黒つぶれ画素数が共に0となって、シャッタースピードと濃淡レンジの調整作業を終了する。 Further, when the shading range setting field 296 was set to "low (-1)" in FIG. 41 and switched to "normal (0)" as shown in FIG. 42 and raised by one step, the overexposed pixels decreased. I understand. Further, as shown in FIG. 43, when switching to “high (1)”, it can be seen that the overexposed pixels became 0. As a result, both the number of overexposed pixels and the number of underexposed pixels become 0, and the adjustment work of the shutter speed and the shading 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 work is completed.
(Height measurement setting procedure)

次に、運用時に逐次入力される検査対象のワークの入力画像に対して、高さ計測を行う領域を設定する手順について、図44〜図55に基づいて説明する。ここでは、入力される複数のワークを代表する典型的なワークを、上述した手順によって予め登録画像として登録しておき、この登録画像に対して、高さ計測を行う領域を指定する。 Next, a procedure for setting an area for height measurement with respect to the input image of the work to be inspected, which is sequentially input during operation, will be described with reference to FIGS. 44 to 55. Here, a typical work representing a plurality of input works is registered in advance as a registered image by the above procedure, and an area for height measurement is specified 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 lower part of the “imaging” processing unit 263 in the flow display area 261, and “Measurement” in the second submenu 372 is selected. Among the inspection processes listed in the "Measurement" menu 373 displayed by selecting "", the "Height measurement" processing unit 266 that performs "Height measurement" is added. As a result, as shown in FIG. 45, a new “height measurement” processing unit 266 is added to the lower part of the “imaging” processing unit 263 in the flow display area 261. As described above, the "measurement" menu 373 functions as an inspection process selection means for selecting the inspection process executed by the inspection execution means.
(Inspection target 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. 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. In the setting item button area 112, the "image registration" button 113, the "image setting" button 114, the "area setting" button 115, the "preprocessing" button 117, the "detection condition" button 118, the "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 the "area setting" button 115 corresponding to the inspection target area setting means, the screen transitions to the inspection target area setting screen 120 shown in FIG. 47. On the inspection target area setting screen 120, an area to be inspected can be specified. 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 field 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, a "measurement area" setting field 126 is provided as an inspection target area setting means for designating an area for executing inspection.

「計測領域」設定欄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 the shape of the desired measurement area can be selected. In this example, "None", "Rectangle", "Rotating Rectangle", "Circle", "Ellipse", "Circumference", "Arc", "Polygon", etc. "Composite area" and the like are displayed. When "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上から数値を直接入力するか、あるいは回転矩形に表示されたハンドルをマウス等で操作して、回転矩形の形状や位置等を任意に調整できる。 Further, 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 work, and in the “measurement area” setting field 126, an example in which the “rotating rectangle” is selected as shown in FIG. 49 is shown. When the "edit" button 128 is pressed in this state, the measurement area edit screen 130 shown in FIG. 50 is displayed. In the example of FIG. 50, the rotation rectangle is superimposed and displayed on the work in the second image display area 121. Here, a rectangular measurement area is drawn on the eraser case and displayed on the distance image. In addition, the basic vector of the rotating rectangle is displayed as an arrow in the frame shape of the rotating rectangle, and the width and height of the rotating rectangle, the XY coordinates of the center, the tilt angle of the basic vector, etc. are displayed on the measurement area editing screen 130. Is displayed. The user can arbitrarily adjust the shape, position, etc. of the rotating rectangle by directly inputting a numerical value from the measurement area editing screen 130 or by operating the handle displayed on the rotating rectangle with a mouse or the like.

なお計測領域編集画面130において設定可能な項目は、「計測領域」設定欄126において選択された形状に応じて変化する。例えば、「円周」を選択した場合は、図51に示すように、円周の外径や内径の寸法の指定等、円周に関するパラメータの設定が可能となる。さらに、図47の画面から、マスク領域を指定することも可能である。マスク領域としては、円形やドーナツ状、矩形状その他の多角形状、自由曲線等が指定できる。このようにして、検査対象のワークの形状に応じて、適切に検査対象領域を設定し、穴あき部分や背景等、検査に無用な領域を排除して、処理の効率化を図ることができる。
(第二計測表示領域)
The items that can be set on the measurement area edit screen 130 change according to the shape selected in the "measurement area" setting field 126. For example, when "circumference" is selected, as shown in FIG. 51, it is possible to set parameters related to the circumference, such as specifying the dimensions of the outer diameter and the inner diameter of the circumference. Further, it is also possible to specify the mask area from the screen of FIG. 47. As the mask area, a circular shape, a donut shape, a rectangular shape or other polygonal shape, a free curve, or the like can be specified. In this way, it is possible to appropriately set the inspection target area according to the shape of the work to be inspected, eliminate unnecessary areas for inspection such as a perforated portion and the background, and improve 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 superimposed and displayed on the work as shown in FIG. 49. Subsequently, when designating another measurement area, the same operation is repeated. 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. Then, as shown in FIGS. 53 and 54, a rotating rectangle is set as a new measurement area on the area of the eraser, which is a work, which is not covered with the case. As a result, as shown in FIG. 55, the newly set second measurement area is superimposed and displayed on the work.

なお、上記の例では、一の「高さ計測」処理ユニットで一の高さ計測処理が行われる。すなわち、複数の高さ計測処理を行うには、複数の「高さ計測」処理ユニットをそれぞれ追加する必要がある。ただ、一の「高さ計測」処理ユニットにおいて複数の高さ計測処理が行われるように構成することも可能であることはいうまでもない。
(計測処理)
In the above example, one height measurement process is performed by one "height measurement" processing unit. 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 goes without saying that it is possible to configure one "height measurement" processing unit so that a plurality of height measurement processes are performed.
(Measurement processing)

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

「数値演算」処理ユニットにおいては、具体的な演算式を入力することができる。例えば図58に示すように、数式を直接入力可能な数値演算編集画面を表示させ、ユーザが演算式を規定する。ここでは、電卓状の入力パッドを用意し、またコピーや切り取り、貼り付け等の編集ボタンも用意して、演算式の作成を容易にしている。ユーザはこの画面から、所望の演算式を入力する。入力された演算式の例を、図59に示す。 In the "numerical calculation" processing unit, a specific calculation formula can be input. For example, as shown in FIG. 58, a numerical calculation edit screen on which a mathematical expression can be directly input is displayed, and the user defines the mathematical expression. Here, a calculator-shaped input pad is prepared, and edit buttons for copying, cutting, pasting, etc. are also prepared to facilitate the creation of arithmetic expressions. 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 content of the numerical calculation process is defined in this way, the calculation formula 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 under the "numerical calculation" processing unit. The "area" processing unit defines the conditions for actually making a pass / fail judgment. Specifically, in order to appropriately change the gradation conversion conditions for converting the distance image to the low gradation distance image according to the registered image and the input image, the gradation conversion parameter (details will be described later). Set the area for acquiring the reference information, the condition for extracting the height from this area, the condition for performing the filtering process when generating the distance image, and the like. That is, in the "area" processing unit, area setting, height extraction, preprocessing, determination, and the like are set. First, the procedure for setting the area 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 specified. Again, select the rotating rectangle and specify more detailed coordinates as needed. In this way, the area in the "area" processing unit is determined, and as shown in FIG. 64, the rotating rectangle is superimposed and displayed on the work in the second image display area.
(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 height extraction setting is to set the gradation conversion parameter when performing the gradation conversion. That is, when the "height extraction" button 116 is pressed from the setting item button area 112 of FIG. 62, the screen shifts to the height extraction selection screen 140 shown in FIG. 65, and the display image, the extraction method, and the like can be selected. In the height extraction selection screen 140, as in FIG. 47, 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 field 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 for 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 the gradation conversion condition setting means 43 for setting the gradation conversion parameter for performing the gradation conversion of the distance image by the gradation conversion means. In particular, the gradation conversion condition setting means 43 is displayed when a process that does not require image height information is selected by the inspection process selection means. On the contrary, when the processing that requires the height information of the image is selected by the inspection processing selection means, the gradation conversion condition setting means 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 "area" processing unit, "blob" processing unit 267, "color inspection" processing unit 267B, "Shapetrax2" processing unit 264, "position correction" processing unit 265, etc., "height" The “Extract” button 116 is displayed, and the gradation conversion condition can be set. By doing so, when gradation conversion is required, the gradation conversion condition setting means 43 is displayed to prompt the user for the necessary settings, while when gradation conversion is not required, gradation conversion is performed. By hiding the means for setting conditions, users can avoid 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 means 142 specifies a gradation conversion method. For example, let the user select either static conversion or dynamic conversion. In the example of FIG. 65, as options in advance, either "one-point designation" or "three-point designation (plane)" corresponding to static conversion, or "real-time extraction" corresponding to dynamic conversion is selected from the drop-down box. Let me.
(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 "one-point designation" is selected from the extraction method selection means 142 on the screen of FIG. 65, the screen shifts to the one-point designation screen 150 of FIG. Note that FIGS. 66 to 96 show an example in which a 50-yen coin is used as a work for explanation. In the one-point designation screen 150 of FIG. 66, the height of the portion 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 specified. Will be. Here, the height extraction means is used to specify a position that is the center of the height in the work displayed in the second image display area 121. In the example of FIG. 67, the height extraction means is composed of the “extract” button 144 displaying the dropper-shaped icon SI, and when the “extract” button 144 is pressed, a point is formed on the second image display area 121. A pointer 146 is displayed. The position specified by the pointer 146 is registered as the height in the middle of the distance range.

またポインタ146で指定された点の周辺の高さを求める範囲を、「抽出領域」指定欄145で指定できる。「抽出領域」指定欄145では、平均高さを求める領域の一辺を画素数で指定する。図67の例では「抽出領域」指定欄145で「16」を指定しており、ポインタ146で指定された点を中心とする16画素×16画素の領域内の、平均高さを抽出して、ポインタ146で抽出された高さとする。なお、第二画像表示領域121上においてポインタ146で指定される領域の大きさを、「抽出領域」指定欄145で指定される数値に連動させて変化させることもできる。 Further, the range for obtaining the height around the point designated by the pointer 146 can be specified 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 to be obtained is designated by the number of pixels. In the example of FIG. 67, “16” is specified in the “extraction area” designation field 145, and the average height in the area of 16 pixels × 16 pixels centered on the point specified 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 specified in the "extraction area" designation field 145.

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

以上のようにして階調変換に必要な階調変換パラメータとして、距離レンジとスパンが決定されると、高階調な距離画像を低階調距離画像に階調変換することが可能となる。また第二画像表示領域121上には、図68に示すように、現在操作領域122で設定されている階調変換条件で階調変換された低階調距離画像が、簡易的に表示される。また、操作領域122で階調変換条件を変更すると、これに応じて第二画像表示領域121上の階調変換後の低階調距離画像の簡易表示も、変更後の階調変換条件に応じて更新される。これにより、ユーザは階調変換条件の調整後の変化を視覚的に速やかに確認でき、試行錯誤による調整作業を容易に行うことが可能となる。このように第二画像表示領域121で表示される画像は、階調変換前の距離画像を表示させるモード、階調変換後の低階調距離画像を表示させるモード、及び通常の輝度画像を表示させるモードを切り替えることで、変更できる。
(ゲイン調整手段)
When the distance range and span are determined as the gradation conversion parameters required for gradation conversion as described above, it is possible to perform gradation conversion from a high gradation distance image to a low gradation distance image. Further, as shown in FIG. 68, a low gradation distance image that has been gradation-converted under the gradation conversion conditions currently set in the operation area 122 is simply displayed on the second image display area 121. .. Further, when the gradation conversion condition is changed in the operation area 122, the simple display of the low gradation distance image after the gradation conversion on the second image display area 121 also corresponds to the changed gradation conversion condition. Will be updated. As a result, the user can visually and quickly confirm the change after the adjustment of the gradation conversion condition, and can easily perform the 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 to make it.
(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, by using the gain adjusting means. In the example of FIG. 68, the emphasis method setting field 154 is provided in the middle of the operation area 122, and the gain adjustment field 156 is arranged here as the gain adjustment means. The current gain is numerically displayed in the gain adjustment column 156. Here, the gain [gradation / mm] is a parameter corresponding to the span when performing gradation conversion. For example, when converting a distance image of 16 gradations to 8 gradations, it is set how many gradations per 1 mm are converted among the 8 gradations. Increasing the gain value results in gradation conversion with clear contrast. For example, when the gain value is set to 100 [gradation / mm], the 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 gradation 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 one-point designation, average height reference, three-point designation, plane reference, free-form surface reference, etc., which will be described later, and is a reference surface at the time of gradation conversion. For example, as shown in FIG. 69A, when the cross-sectional profile of the distance image (input image) before conversion of 16 gradations has a shape as 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 such an input image from 16 gradations to 8 gradations is as shown in FIG. 69B, and gain (conversion coefficient) as it is with respect to the difference from the reference plane. It will be in a state where it takes.

また、上述したゲイン値に応じて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 at the same time. In the example of FIG. 68, 250 [gradation / mm] is displayed as the gain value, and 0.0040 mm is displayed as the height per gradation. 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, the height information can be inspected in detail by emphasizing the density difference, but the inspectable height range becomes narrower. On the contrary, when the gain value is lowered, as shown in FIG. 71, it is possible to inspect a wide height range, but fine changes are impaired. When the gain is adjusted by the gain adjusting means in this way, the gradation conversion image obtained under the gradation conversion conditions can be confirmed in the second image display area 121. As a result, the user can adjust the gain value to an appropriate value according to the inspection purpose and 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 emphasis method can include the setting of the extraction height in addition to the gain value. For example, on the screen of FIG. 72, when the “detailed setting” button 158 provided at the lower right of the operation area 122 is pressed, the screen is switched to the highlighting method detailed setting screen 160 of FIG. 73, and the gain adjustment column described above is displayed in the highlighting method setting field 154. In addition to 156, the "extraction height" setting field 162 is displayed. In the "extraction height" setting field 162, as the height information to be extracted by the height extraction means, any of the high height information, the low height information, and the height information of both the high and low ones included in the area. Can be selected. Here, as shown in FIG. 74, one of “high side”, “low side”, and “both high and low” can be selected by the drop-down list provided in the “extraction height” setting field 162. For example, when "higher side" is selected, the gradation is converted so that the height of the position specified by the pointer 146 becomes the lower limit of the distance range. As a result, a low gradation distance image is generated in which only the side higher than the specified height is extracted. Similarly, when the "lower side" is selected, the gradation is converted so that the height of the position specified by the pointer 146 becomes the upper limit of the distance range. As a result, a low gradation distance image is generated in which only the side lower than the specified height is extracted. Further, in the case of "both high and low", the gradation is converted so that the height of the position specified by the pointer 146 is in the middle of the above-mentioned distance range. Pixels that are out of range after gradation conversion are clipped to black on the low side (pixel value 0 in the case of 8 gradations) and to white on the high side (pixel value 255).

さらに、図73の強調方法詳細設定画面160においては、ノイズを除去するためのノイズ除去設定欄164や、無効画素に与える値を指定するための無効画素指定欄166も設けられている。
(ノイズ除去設定欄164)
Further, in the highlighting 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 given to the invalid pixel 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 field 164, as one of the gradation conversion parameters, it is specified how many mm of difference from the reference plane is to be 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 situation will be described with reference to FIGS. 75A to 75C. In these figures, as in FIG. 69A, FIG. 75A shows the cross-sectional profile of the distance image before conversion of 16 gradations with a solid line, the reference plane thereof with a wavy line, and the noise-removed range with a dashed-dotted line. There is. 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. Further, 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 the gain (conversion coefficient) is obtained for the remaining components. It will be in the state of being 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 with reference to FIGS. 76A to 76F. First, it is assumed that a luminance image as shown in FIG. 76A and a distance image with high gradation (16 gradations) as shown in FIG. 76B are obtained. Here, the distance image of FIG. 76B has low gradation (8 gradations) with the initial settings (here, the gain is 100 [gradation / mm] and the noise removal is 0.000 [mm]). A low gradation distance image that has been gradation-converted to is shown in FIG. 76C. This low gradation distance image has a relatively low contrast. Therefore, when the gain is increased from this state, as shown in FIG. 76D, the low gradation distance image having high contrast is newly gradation-converted 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, a low gradation distance image in which the amount of noise removed is increased from FIG. 76D is shown in FIG. 76E. 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 was reduced, but on the other hand, it can be confirmed that noise having a height lower than the reference plane exists in the upper right of the "E" in the upper left. Therefore, when the "extraction height" setting field 182 shown in FIG. 74 or the like is set to the "higher side", the reference plane is converted to the lowest value (pixel value 0), so that the portion lower than the reference plane is 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 the "high side" for the distance image (16 gradations) of the profile as shown in FIG. 77A, the result is that only the high side from the reference plane is extracted. A low gradation distance image (8 gradations) as shown in FIG. 77B can be obtained. In this way, it is possible to obtain a low gradation distance image having higher contrast and less noise component than that of FIG. 76C and the like. In this example, as the 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 "high side". Gradation conversion is performed from the distance image of 76B to the low gradation distance image of FIG. 76F.

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

ここで、基準面を一点指定で指定する方法が有効なワークの例を、図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 designating one point is effective will be described with reference to FIGS. 79A to 79B. FIG. 79A shows the work WK7 which has no flat inclination on the measurement surface of the work or does not affect the inspection process even if there is a slight inclination. Here, for the work WK7 in which numbers and character strings are three-dimensionally formed on the surface of the casting, an inspection process is performed in which whether or not the character strings are appropriate is read by OCR. In such an application, by pressing the "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, the pointer 146 specifies one point on the upper surface of the work WK7, which is a plane (background surface) on which no character string is formed, as shown in FIG. 79A. As a result, gradation conversion is performed using the height of the extraction region (16 pixels in the example of FIG. 67) designated by the pointer 146 as a reference plane, and the image is converted to the 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 executed. In this way, the one-point designation can be effectively used in cases where the inspection process is not affected even if the work is slightly tilted. In addition, the one-point designation has the advantage of being able to process at high speed with a low load.
(Specify three points)

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

図62の三次元画像処理プログラムのGUI画面で「高さ抽出」ボタン116を押下し、図80に示す高さ抽出選択画面140に移行した状態で、抽出方法選択手段142で階調変換方法として、「三点指定(平面)」を選択する。これにより、図81に示す高さ抽出設定を行う三点指定画面170が表示される。
(三点指定画面170)
In the state where the "height extraction" button 116 is pressed on the GUI screen of the three-dimensional image processing program of FIG. 62 to shift to the height extraction selection screen 140 shown in FIG. 80, the extraction method selection means 142 is used as a gradation conversion method. , Select "Specify three points (plane)". As a result, the three-point designation screen 170 for setting the height extraction 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 planes that serve as a reference for gradation conversion are designated and set on the second image display area 121. Therefore, the height extraction means is provided on the three-point designation screen 170 of FIG. 81. Specifically, by selecting the "extract" button 144 provided in the operation area 122 on the right side of the screen, the screen shown in FIG. 82 is displayed, and three arbitrary positions are set on the second image display area 121 on the left side of the screen. You will be able to specify points. Here, a point-shaped pointer 146 is displayed as the height extraction means as in FIG. 67, and the user sequentially specifies a desired position with a pointing device such as a mouse, a trackball, or a touch panel. When the first point is specified on the second image display area 121, the rectangular shape changes to a cross shape at the specified position as shown in FIG. 83 to indicate the specified position, and the next second point is displayed. Similarly, it can be specified with the pointer 146. At this point, the color distance image displayed in FIG. 82 is gradation-converted with reference to the horizontal plane including the height of the specified first point, and the low-gradation distance image after gradation conversion is a shade image. Is displayed in the second image display area. Further, when the second point is specified, 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 specified. At this point, the gradation conversion is performed again with reference to the inclined surface including the heights of the two designated points, and the low gradation distance image is updated. Then, when the third point is specified, the reference plane is set by the plane including these three designated 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 field 152.

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

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

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

ここで、基準面を三点指定で指定する方法が有効なワークの例を、図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 designating three points is effective will be described with reference to FIGS. 86A to 86D. FIG. 86A shows the work WK8 in which a flat inclination occurs on the measurement surface of the work or the presence of a minute planar inclination affects the result of the inspection process. Here, an inspection process is performed to detect the ball grid array (BGA) formed on the substrate. In such an application, by pressing the "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 the BGA is not 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 plane is converted into the low gradation distance image shown in FIG. 86B. In this low gradation distance image, the BGA protruding from the plane of the work WK8 is clearly extracted, so that the shape of the BGA can be confirmed by binarizing it as shown in FIG. 86C, for example. With this method, there is an advantage that even if the plane of the work WK8 is inclined, it can be accurately detected. If the work WK8 shown in FIG. 86A is inclined, for example, if one point is specified, the binarized image will be shown in FIG. 86D, and it cannot be detected correctly. On the other hand, in the three-point designation, the inclination is corrected as described above, and an accurate detection result can be obtained. 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に示すような結果となって、傾斜面によって窪みの検出が困難となることが判る。このように、精度の高い基準面の推定に、三点指定が有効である。なお処理時間の面では、一点指定よりも処理時間がかかるものの、比較的高速に処理可能である。 Further, when the upper surface of the flat work WK9 as shown in FIG. 87A has a gentle dent, an inspection process for detecting the dent is considered. Here, as shown in FIG. 87A, the measurement area ROI is set to the area including the recess. As a result, gradation conversion is performed using a 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 method of least squares. Further, the obtained low gradation distance image is binarized to obtain the binarized image shown in FIG. 87C. As a result, the inclination can be corrected and only the dented portion can be stably extracted. If a binarized image is obtained by designating one point in a state where there is an inclination, the result shown in FIG. 87D is obtained, and it can be seen that it is difficult to detect the dent due to the inclined surface. In this way, the three-point designation is effective for estimating the reference plane with high accuracy. In terms of processing time, although it takes more processing time than specifying one point, it can be processed at a relatively high speed.

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

平均高さ基準は、入力画像毎に、指定された平均抽出領域内の平均高さを演算し、これを平均基準高さとして階調変換する方法である。平均基準高さを規定するための平均抽出領域は、運用に先立って予め設定される(上述した図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 the designated average extraction area for each input image and converting the gradation 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 the procedure for designating the average extraction area in step S83 of FIG. 8 will be described based on the GUI of FIGS. 62, 65, 88 to 92. First, select the "height extraction" button 116 on the GUI screen of FIG. 62, proceed to the height extraction selection screen 140 of FIG. 65, and select "real-time extraction" corresponding to the dynamic conversion by the extraction method selection means 142. Then, the height dynamic extraction setting screen 190 of FIG. 88 is displayed. In this example, an example in which an eraser is used for the work again is shown. Next, in the "calculation method" selection field 192 provided below the extraction method selection means 142, a reference for dynamic conversion is specified. Here, as shown in FIG. 89, one of "average height reference", "plane reference", and "free curved surface reference" is selected in the drop-down box. Here, "average height standard" is selected. As a result, the screen shifts to the average height reference setting screen 210 of FIG. 90. Note that FIGS. 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 the average reference height and the like for an image different from the distance image input in the actual operation. For this reason, an image corresponding to the work during operation is captured in advance and saved as a registered image, and when setting dynamic conversion, the registered image is read and used as a substitute for the work image during operation. Make various settings in the form. Therefore, on the screen shown in FIG. 65 or the like, the corresponding "registered image" is specified in the "display image" selection field 124.

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

また、平均抽出領域に対して、平均高さを抽出しないマスク領域を指定することもできる。例えば図90の画面から、操作領域122に設けられた「抽出領域」ボタン194を押下すると、図91に示すマスク領域設定画面220に移行する。このマスク領域設定画面220上から、平均高さの抽出に不要なマスク領域を一以上指定できる。マスク領域の指定にも、上述の通り第二画像表示領域121上から、矩形状や円形状等、任意の領域を指定することで行える。 It is also possible to specify a mask area in which the average height is not extracted with respect to 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. From the mask area setting screen 220, one or more mask areas unnecessary for extracting the average height can be specified. The mask area can also be specified 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にゲイン調整に加えて、抽出高さの指定やノイズ除去等の詳細な設定項目が表示される。 Further, the gain can be adjusted as needed. For example, when the "detailed setting" button 196 provided at 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. 92, and the gain is adjusted in the emphasis method setting field 154. In addition, detailed setting items such as specification of extraction height and noise removal are displayed.

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

そして運用時において、後述する図133に示す手順で動的変換が行われる。例えばライン上を搬送されるワークを撮像して距離画像を生成し(ステップS13301)、上記で設定された平均抽出領域の平均高さを演算し(ステップS13302)、これに基づいて階調変換を実行して低階調距離画像を生成し(ステップS13303)、得られた低階調距離画像に対して検査を行う(ステップS13304)。この方法であれば、ワークの高さ方向にばらつきがある場合でも、ワーク毎に階調変換の基準面を毎回再設定できるため、ワークの高さ方向のばらつきによらず、正確な検査が実現できる。 Then, during operation, dynamic conversion is performed by the procedure shown in FIG. 133, which will be described later. For example, a work transported on the line is imaged to generate a distance image (step S13301), the average height of the average extraction region set above is calculated (step S13302), 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 each time for each workpiece, so accurate inspection can be achieved regardless of the variations in the height direction of the workpiece. 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 plane based on the average height reference is effective will be described with reference to FIGS. 93A to 93B. FIG. 93A is a work WK7 which does not affect the inspection process even if there is no flat inclination on the measurement surface of the work or there is a slight inclination on the measurement surface of the work, as in FIG. 79A described above, and numbers and character strings are displayed on the surface of the casting. An inspection process is performed on the three-dimensionally formed work WK7 to read whether or not the character string is appropriate by OCR. In such an application, on the extraction area setting screen shown in FIG. 92 or the like, a measurement area ROI that determines the average height reference in a rectangular shape is set on the second image display area 121. 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 area ROI. As a result, gradation conversion is performed using the height of the measurement area ROI as a reference plane, and the image is converted into the low gradation distance image shown in FIG. 93B. Even in this low gradation distance image, as in FIG. 79B, the character string portion protruding from the plane of the work WK7 is clearly extracted against the background, so that accurate OCR can be easily executed. Further, in FIG. 79A described above, since only one point on the work WK7 is specified, the selected point may be affected by noise, whereas in FIG. 93A, since it is specified as a plane, such noise. The advantage of being able to reduce the influence of
(Plane reference)

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

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

また、基準面推定領域に対して、推定面を推定しないマスク領域を指定することもできることは、上述した図90等と同様である。さらに、必要に応じてゲイン調整や抽出高さの指定、ノイズ除去等を行うこともできるのも、上記と同様である。例えば、図92の画面において、操作領域122に設けられた「詳細設定」ボタン222を押下すると、図94の平面基準詳細設定画面240となり、強調方法設定欄154にはゲイン調整欄156に加え、抽出高さを指定する「抽出高さ」設定欄162やノイズ除去のためのノイズ除去設定欄164、無効画素を指定するための無効画素指定欄166が表示され、これらの詳細な設定が可能となる。また無効画素指定欄166においては、図95に示すように、距離を求められなかった無効な画素を指定された規定値の他、背景の画素値やユーザが指定する任意の値で埋めることができる。 Further, it is also possible to specify a mask area for which the estimated surface is not estimated for the reference surface estimation area, which is the same as in FIG. 90 and the like described above. Further, it is the same as the above that the gain can be adjusted, the extraction height can be specified, noise can be removed, and the like, if necessary. For example, on the screen of FIG. 92, when the "detailed setting" button 222 provided in the operation area 122 is pressed, the plane reference detailed setting screen 240 of FIG. 94 is displayed, and the emphasis method setting field 154 is added to the gain adjustment field 156. The "extraction height" setting field 162 for specifying the extraction height, the noise removal setting field 164 for noise removal, and the invalid pixel specification field 166 for specifying invalid pixels are displayed, and these detailed settings are possible. Become. Further, in the invalid pixel designation field 166, as shown in FIG. 95, the invalid pixel for which the distance could not be obtained can be filled with the specified specified value, the background pixel value, or an arbitrary value specified by the user. 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 estimation area. For fitting the height information distributed in the reference plane estimation region, a known method such as the least squares method can be appropriately used. As described above, it is not always necessary to use the height information of all the points included in the reference plane estimation region for the calculation of the estimation plane, and the processing can be simplified by appropriately thinning out or averaging the height information. Is.

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

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

最後に、入力画像の所定の領域(自由曲面対象領域)から高周波成分を除いた自由曲面を生成し、これを基準面として階調変換する自由曲面基準について説明する。例えばワークが曲面を有する等、単純な平面では近似が困難な場合は、検査したい領域の高さ情報を精度よく抽出することが難しい。そこで、入力画像から高周波成分を除いて単純化した画像を生成して、この画像の表面形状(自由曲面)を基準面として利用することで、大まかな形状やなだらかな変化を無視し、急激な変化を生じている部分、すなわち細かな形状のみを残した検査を可能とできる。 Finally, a free curved surface reference that generates a free curved surface excluding high frequency components from a predetermined region (free curved surface target region) of an input image and performs gradation conversion using this as a reference plane will be described. For example, when the workpiece has a curved surface and it is difficult to approximate with a simple plane, it is difficult to accurately extract the height information of the 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 curved surface) of this image as the reference surface, the rough shape and gentle changes are ignored, and a sudden change is made. It is possible to inspect only the part where the change is occurring, 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 setting method of the free curved surface reference will be described based on the GUI of FIGS. 62 to 96. In the free-form surface reference as well, as in the above-mentioned average height reference and the like, the necessary conditions for determining the reference plane are set in advance prior to the operation (step S83 in FIG. 8 described above). First, select the "height extraction" button 116 on the GUI screen of FIG. 62, proceed to the height extraction selection screen 140 of FIG. 80, and select the "real-time extraction" corresponding to the dynamic conversion by the extraction method selection means 142. Then, the height dynamic extraction setting screen 190 of FIG. 88 is displayed. Next, in the "calculation method" selection field 192, "free curved surface reference" is selected as the reference for dynamic conversion as shown in FIG. 89. As a result, the screen shifts to the free curved surface reference setting screen 250 of FIG. 96.

自由曲面基準設定画面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, it is preferable that the entire image displayed in the second image display area 121 or a separately designated inspection target is specified. The area is used as it is as a free-form surface target area. Free-form surface A free-form surface is generated by removing harmonic components from the area designated as the target area. Then, a gradation conversion image that has undergone gradation conversion with the free curved surface as a reference plane is superimposed and displayed on the free curved surface target area displayed on the second image display area 121. Further, in the gradation conversion, gain adjustment, extraction height designation, noise removal, and the like can be performed as necessary, as in FIG. 90 and the like described above.
(Extraction size adjustment means)

さらに、自由曲面基準で抽出される抽出面の細かさ(抽出サイズ)を調整する抽出サイズ調整機能も備えている。具体的には、図96において、操作欄の「抽出面の詳細設定」欄に、抽出サイズ調整手段として「抽出サイズ」指定欄252を設けている。「抽出サイズ」指定欄252の数値を増減させると、これに応じて自由曲面の曲率が変化し、抽出可能な欠陥のサイズが変動する。ここでは、設定されたサイズ以下の凹凸が抽出されるように、自由曲面画像が生成され、第二画像表示領域121に表示される。抽出サイズを大きくすると滑らかな自由曲面が生成され、設定された抽出サイズに応じた大きさの欠陥が抽出できる。一方、抽出サイズを小さくすると、ワークの表面形状に沿った自由曲面が生成されるようになり、設定された抽出サイズに応じた小さな欠陥のみが抽出される。例えば、抽出サイズを大きくすると図97に示すように自由曲面がワークの表面形状に対して滑らかとなるので、平滑化された基準面でもって抽出される凹凸が明瞭になる。逆に数値を小さくすると、図90に示すように自由曲面がワークの表面形状の凹凸に沿った詳細な形状に近づくため、結果としてこのような複雑な基準面でもって抽出される凹凸は不鮮明となる。また、「抽出サイズ」指定欄252の数値を増減させると、これにつれて第二画像表示領域121において表示されている自由曲面対象領域内の階調変換画像も、基準面として内部的に生成される自由曲面の状態が変化し、基準面からの差分として抽出・表示される対象物の大きさがリアルタイムに変化する。ユーザは、第二画像表示領域121を参照しながら、「抽出サイズ」指定欄252の数値を最適に調整できる。 Furthermore, it also has an extraction size adjustment function that adjusts the fineness (extraction size) of the extraction surface extracted based on the free curved surface. Specifically, in FIG. 96, an “extraction size” designation column 252 is provided as an extraction size adjusting means in the “detailed setting of extraction surface” column of the operation column. 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, the free-form surface image is generated and displayed in the second image display area 121 so that the unevenness of the set size or less is extracted. When the extraction size is increased, a smooth free-form surface is generated, and defects of a size corresponding to the set extraction size can be extracted. On the other hand, when the extraction size is reduced, a free curved surface along the surface shape of the work is generated, and only small defects corresponding to the set extraction size are extracted. For example, when the extraction size is increased, the free curved surface becomes smoother with respect to the surface shape of the work as shown in FIG. 97, so that the unevenness extracted by the smoothed reference surface becomes clear. On the contrary, when the numerical value is reduced, the free curved surface approaches the detailed shape along the unevenness of the surface shape of the work as shown in FIG. 90, and as a result, the unevenness extracted by such a complicated reference surface becomes 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 also internally generated as a reference plane. The state of the free-form surface changes, and the size of the object extracted and displayed as the difference from the reference plane 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 curved surface target area is defined in this way, the setting screen ends. At the time of gradation conversion, the free curved surface is calculated from the height information of the image included in the free curved surface target area. For fitting the height information distributed in the 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 are performed. A method of performing the process (step S1613) to generate a free-form surface image can be used. For the filtering process, for example, a median filter can be used. When the free curved surface is determined in this way, the unevenness to be extracted can be clarified by taking a difference from the original image (step S1614). Alternatively, as described above, a known method such as the least squares method can be appropriately used. As described above, it is not always necessary to use the height information of all the points included in the free curved surface target area for the calculation of the estimated surface, and the processing can be simplified by appropriately thinning or averaging. When the free curved surface is determined in this way, gradation conversion is performed with reference to this free curved surface. For example, gradation conversion is performed so that the free curved 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 plane as a free curved 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 dents contained in the curved surface of the work. Here, a region including a defect is specified from the curved surface as the measurement region ROI. Then, a free curved surface is obtained from the height information included in the designated measurement area 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, based on the free curved surface, the part higher than this surface is regarded as a protrusion (displayed as a white dot in FIG. 98B), and the portion lower than this surface is regarded as a depression (displayed as a black dot in FIG. 98B). Can be detected. In this way, the designation of the reference plane by the free curved surface can be effectively used for the workpiece having a curved surface shape. The processing load for detecting a free-form surface is higher than that of the one-point designation and the three-point designation described above.
(Defect extraction process)

上述した自由曲面基準において、図161のステップS1611で示す画像縮小処理に際して、距離画像の縦横、すなわちXY方向に対して圧縮を行うと、検査対象物の曲面の状態によっては曲面と欠陥とを分離しきれず、思うように傷を抽出できない場合がある。例えば、図162に示すようなチューブ状の検査対象物を撮像した距離画像において、抽出対象1と抽出対象2を抽出しようとする例を考える。このような距離画像に対して、自由曲面基準を選択してXY方向に画像の圧縮を行うと、図163に示すように、チューブ状の長さ方向に沿って存在する山谷も抽出されてしまい、その一方で本来抽出したい抽出対象2は綺麗に抽出されていない状態となる。
(抽出方向指定手段)
In the above-mentioned free-form surface reference, when compression is performed in the vertical and horizontal directions of the distance image, that is, in the XY directions during the image reduction process shown in step S1611 of FIG. 161, the curved surface and the defect are separated depending on the state of the curved surface of the inspection object. It may not be possible to extract the scratches as desired. For example, consider an example in which an extraction target 1 and an extraction target 2 are to be extracted in a distance image obtained by capturing a tubular inspection object as shown in FIG. 162. When the free curved surface reference is selected and the image is compressed in the XY direction for such a distance image, as shown in FIG. 163, the peaks and valleys existing along the tubular length direction are also extracted. On the other hand, the extraction target 2 that is originally desired to be extracted is in a state of not being extracted neatly.
(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 specification function for extracting defects, that is, local irregularities, is provided by excluding shapes that continuously exist in a specific direction on the inspection target surface. It can also be provided. For example, an extraction direction specifying means capable of specifying an extraction direction when specifying inspection conditions is provided. Specifically, when "free curved surface reference" is selected in the "calculation method" selection field 192 of the GUI shown in FIG. 89 or the like, the GUI of the free curved surface reference setting screen 630 of FIG. 164 is displayed instead of the above-mentioned FIG. 96 or the like. Let me. In the free-form surface reference setting screen 630 of FIG. 164, an “extraction direction” designation field 632 is added as a form of the extraction direction designation means below the “extraction size” designation field 252. In the "extraction direction" designation field 632, a direction for extracting a local shape change such as a defect to be extracted is specified. In this example, as a preset option, any one of "X", "Y", and "XY" can be selected by a drop-down list or the like. Further, 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. The noise removal setting field 164, the 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, local shape changes in the Y direction of the image (vertical direction in FIG. 162) are extracted. In other words, a shape that does not change in the Y direction, for example, 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, the shape change of the image in the X direction (horizontal direction in FIG. 162) is extracted. When XY is selected, a local shape change in the XY direction is extracted as shown in FIG. 163. As a result, by designating the extraction direction according to the shape of the inspection object, unnecessary shapes can be canceled and the desired shape can be appropriately extracted. For example, when it is desired to extract the character string 1 and the character string 2 in the inspection object as shown in FIG. 167, if the extraction is performed in the XY direction, the unevenness existing in the longitudinal direction is also detected as shown in FIG. 168. By designating the Y direction as the extraction direction, as shown in FIG. 169, a uniform shape in the Y direction can be removed, and a desired character string can be accurately extracted.

ここで具体的な欠陥抽出処理等の形状抽出方法として、図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 image reduction process described above (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 performing the filter processing (step S1612) and the image enlargement processing (step S1613) has fine irregularities in the Y direction removed and is smoothed only 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 is left. Therefore, when the difference between the target original image and the free-form surface image is taken (step S1614), the shape of the cancellation target that is uniform in the Y direction is removed, and as a result, the shape is finely divided in the Y direction. Only the uneven shape change will be left. As a result, it is possible to extract only the shape change in the desired direction.

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

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

なお以上の例では、欠陥抽出処理を自由曲面基準に適用する例を説明したが、本発明は自由曲面基準に限らず、他の基準面に対しても適用できる。例えば、基準面として平均高さ基準を選択した際に、上述した欠陥抽出処理を適用することで、指定された方向に、ライン毎の平均高さを求めて、その平均高さからの差分を取ることができる。この方法によれば処理が単純なため、高速な処理が可能となる利点が得られる。
(抽出領域設定ダイヤログ148)
In the above example, the example of applying the defect extraction process to the free curved surface reference has been described, but the present invention is not limited to the free curved surface reference, and can be applied to other reference planes. For example, when the average height standard is selected as the reference plane, the above-mentioned 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. Since the processing is simple according to this method, 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. It can also be set to. As an example, in FIG. 90, when the “extraction area” button 147 is pressed, an extraction area setting dialog 148 in which the extraction area can be set is displayed as shown in FIG. 99. The extraction area setting dialog 148 is provided with an extraction area selection field 149, and the user can select "same as the measurement area", "rectangle", "circle", "rotation rectangle", etc. from the extraction area selection field 149. When "Same as measurement area" is selected, the extraction area becomes the same as the measurement area as described above. On the other hand, by selecting a region other than "same as the measurement region", an region different from the measurement region can be set as the extraction region. 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. Further, when the "edit" button 324 provided to the right of the extraction area selection field 149 of FIG. 100 is pressed, the extraction area edit dialog 326 is displayed as shown in FIG. 101, and the rectangular extraction area is numerically expressed in xy coordinates. Can be specified by. 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 extracted can be set. In the example of FIG. 99, the mask area setting field 330 is provided below the extraction area selection field 149. In the mask area setting field 330, a plurality of mask areas can be set. Here, a maximum of four mask areas 0 to 3 can be specified, and each mask area can be set independently. For example, when "circular" is selected as the mask area 0 as shown in FIG. 102, the circular mask area 0 is displayed on the second image display area 121. Further, when the "edit" button 332 is pressed from this state, the mask area editing dialog 334 for defining the details of the circular mask area 0 is displayed as shown in FIG. 103. The user can define the circular mask area 0 with the xy coordinates of the center and the radius. The mask area is displayed in the second image display area 121 with a border having a color different from that of the extraction area, which makes it easy for the user to 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, not limited to this example, it goes without saying that it is possible to distinguish by different colors, line thickness, line type (solid line, broken line, etc.), highlight (blinking or emphasis), etc. ..

このようにして、抽出領域を計測領域とは独立して設定することも可能となる。また、抽出領域の設定内容は、文字情報で表示させることもできる。例えば図90の例では、「抽出領域」ボタン147の下部にテキストで「計測領域と同じ」と表示しており、平面基準を算出する抽出領域が計測領域と同じであることを示している。またその下部には「マスク領域:無効」と表示し、抽出領域にマスク領域が設定されていないことを示している。これによってユーザは、「抽出領域」の概略をテキスト情報としても確認できる。
(前処理設定)
In this way, the extraction area can be set independently of the measurement area. In addition, the setting contents of the extraction area can be displayed as character information. For example, in the example of FIG. 90, "same as the measurement area" is displayed in text at the bottom of 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 bottom, indicating that the mask area is not set in the extraction area. As a result, the user can confirm 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 height extraction setting is completed in the "area" processing unit, as shown in FIG. 104, in the third image display area, within the rectangle of the area set in the "area" processing unit, The low gradation distance image that has been gradation-converted based on the extracted height is displayed in an overlapping manner. Next, the preprocessing is set. The preprocessing is a common filter processing performed before generating the distance image as described above, and various filters can be selected here. Specifically, when the "preprocessing" button provided in the setting item button area 112 is selected from the screen of FIG. 104, the filter processing setting screen 340 of FIG. 105 is displayed, and the filter to be applied can be selected. Examples of the filter that can be selected here 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 of FIG. 106, the upper limit value, the lower limit value, and the number of times of binarization can be set. Further, a histogram showing the distribution of binarized pixels 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 area, the low gradation distance image binarized through the filtering process is displayed in an overlapping manner within the set area. ..
(Judgment setting)

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

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

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

以上のようにして、設定モードにて各種の設定を行った後、運用モードにおいて実際にワークを撮像して入力画像を取得し、高さ検査や画像検査の結果に基づいて判定処理を行う。なお、上記の例では、設定モードにおいても判定結果を出力可能な構成とすることで、判定結果をイメージを設定段階でユーザに認識し易くしている。ただ、判定結果は運用モードにおいてのみ出力可能とすることも可能であることはいうまでもない。
(運用モード)
After making various settings in the setting mode as described above, the workpiece is actually imaged in the operation mode to acquire an input image, and the determination process is performed based on the results of the height inspection and the image inspection. In the above example, the determination result can be output even in the setting mode, so that the user can easily recognize the determination result as an image at 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 inside the head unit and the controller unit in the three-dimensional image processing apparatus shown in FIGS. 4A and 4B will be described with reference to the flowcharts of FIGS. 119 and 120. First, the flow of processing during operation at the head portion of the three-dimensional image processing apparatus according to the third embodiment shown in FIGS. 4A and 5 will be described with reference to the flowchart of FIG. 119.
(Flow of processing according to the third embodiment)

まず、外部からトリガが入力されると(ステップ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 onto the work from the first projector 20A (step S11902), and an image is taken by the imaging means (step S11903). Next, it is determined whether or not imaging has been completed for all the light projection patterns (step S11904), and if not, 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 coding method. ..

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

その一方でステップS11907において、位相シフト法で撮像した複数のパターン投影画像(パターン投影画像群)から、これを平均した平均画像A’を演算する。 On the other hand, in step S11907, an average image A'that is averaged from a 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の処理の流れ)
The above steps S11902 to S11906 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, in step S11908 following step S11906, a light projection pattern is projected onto the work from the second projector 20B (step S11908), and an image is taken by the imaging means (step S11909), as in steps S11902 to S11905. It is determined whether or not the imaging is completed for all the projection patterns (step S11910). If it is not yet, the light projection pattern is switched (step S11911), the process returns to step S11902, and the process is repeated. On the other hand, when all the light projection patterns have been imaged, the process branches to step S11912 and step S11912. In step S11912, a three-dimensional measurement operation is executed to generate a distance image B. On the other hand, in step S11913, the 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. Further, in step S11915, the average images A'and B'are used to generate a luminance image (average two-dimensional shading image) obtained by synthesizing them. In this way, in the three-dimensional image processing apparatus of FIG. 5, a distance image having the height information of the work is acquired. If the luminance image is not required, steps S11907, S11913, and S11915 can be omitted.
(Flow of processing according to the fourth embodiment)

以上は、図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 flow of processing of the head portion of the three-dimensional image processing apparatus according to the third embodiment shown in FIG. 4A has been described above. Next, the processing flow of the head portion of the three-dimensional image processing apparatus according to the fourth embodiment shown in FIG. 4B will be described with reference to the flowchart of FIG. 120. explain. First, when a trigger is input from the outside (step S12001), one light projection pattern from the light projecting means 20 is projected onto the work (step S12002), and the first imaging means 10A takes an image (step S12003). At the same time, the second imaging means 10B also performs imaging (step S12004). Then, it is determined whether or not the imaging is completed for all the light projection patterns (step S1205). If it has not been done yet, the light projection pattern is switched (step S12006), the process returns to step S12002, and the process is repeated. On the other hand, when all the light 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 operation is executed to generate a distance image B. On the other hand, in step S12009, the average image A'of the pattern projection image group captured by the phase shift method is calculated, and in step S12010, the average image B'of the pattern projection image group captured by the phase shift method is calculated. Then, in step S12011, the three-dimensional distance images A and B obtained in steps S12007 and S12008 are combined to generate a distance image. Further, a luminance image obtained by synthesizing the average images A'and B'obtained in steps S12009 and 10 is generated. According to this method, two images can be captured at the same time, so that the imaging time can be shortened.
(Inspection target area setting means)

実際の運用時の検査に際して、ワークに対して検査実行手段50で検査を実行する対象となる領域(検査対象領域)を、予め指定しておく必要がある。このような検査対象領域の設定は、設定段階において検査対象領域設定手段により行われる。検査対象領域設定手段は、上述の通りコントローラ部2側に設けたり、あるいは三次元画像処理プログラムにて実現させることもできる。具体的には、上述の通り図62に示す三次元画像処理プログラムの検査対象領域設定手段に相当する「領域設定」ボタン115を押下すると、図47に示す検査対象領域設定画面120に遷移し、この検査対象領域設定画面120において、検査を行う領域を指定することができる。 At the time of inspection during actual operation, it is necessary to specify in advance an area (inspection target area) to be inspected by the inspection execution means 50 for the work. Such setting of the inspection target area is performed by the inspection target area setting means at 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 target area setting means of the three-dimensional image processing program shown in FIG. 62 is pressed, the screen transitions to the inspection target area setting screen 120 shown in FIG. 47. On the inspection target area setting screen 120, an area to be inspected can be specified.

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

なお階調変換処理は、上述した検査対象領域設定手段で設定された検査対象領域に対して行われる。すなわちこの例では、検査対象領域設定手段を、階調変換対象領域を指定する階調変換対象領域指定手段と共通としている。ただ、階調変換処理のパラメータを決めるのに用いる領域を、検査対象領域とは独立して設定してもよい。例えば検査対象領域設定手段、あるいはこれとは別個に用意した階調変換パラメータ作成用領域指定手段を用いて、階調変換パラメータ作成用領域を指定する。
(運用時のコントローラ部の動作フロー)
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 shared with the gradation conversion target area designating means for designating the gradation conversion target area. However, the area used to determine the parameters of the gradation conversion process may be set independently of the inspection target area. For example, the gradation conversion parameter creation area is designated by using the inspection target area setting means or the gradation conversion parameter creation area designation means prepared separately from the inspection target area setting means.
(Operation flow of controller part 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 portion side on the controller portion side during operation will be described with reference to the flowchart of FIG. 122 and the GUI of FIGS. 123 to 127. Here, FIGS. 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 three-dimensional image processing device are connected in a processing unit shape is displayed. Here, as the processing units, the "imaging" processing unit 263, the "Shapetrax2" processing unit 264, the "position correction" processing unit 265, and the "height measurement" processing unit 266 are displayed in the flow display area 261. In addition, at the setting stage before operation, each processing unit can be selected and detailed settings can be made. Further, in the third image display area 262, a luminance image, a distance image, an inspection result, or the like is displayed according to the processing content. In the example of FIG. 123, a luminance image obtained by capturing an image of a work (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 S12201 of FIG. 122, a distance image and a luminance image are acquired from the head unit 1. Here, the pattern projection image is captured on the head portion side to generate a distance image and a luminance image. In the GUI example of FIG. 123, the “imaging” processing unit 263 displayed in the flow display area 261 corresponds to this.

画像データは、先に距離画像をヘッド部からコントローラ部に送信し、次いで輝度画像もコントローラ部に送信する。なお、逆に輝度画像を先に転送した上で距離画像を転送したり、これらの転送を同時に行ってもよい。
(サーチステップ)
As 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. On the contrary, the luminance image may be transferred first and then the distance image may be transferred, or these transfers may be performed at the same time.
(Search step)

さらにステップS12202において、運用時に入力される入力画像に対し、コントローラ部でパターンサーチを行う。すなわち、撮像された輝度画像に含まれるワークの動きに追従するように、検査したい部位を特定する。図123の例では、フロー表示領域261に表示される「Shapetrax2」処理ユニット264がパターンサーチに該当する。ここではワークを撮像した輝度画像(入力画像)に対して、図5の画像サーチ手段64がパターンサーチを行い、位置決めを行う。具体的には、予め設定された検査対象領域が、入力された輝度画像中のどこに含まれるか、位置を特定する。パターンサーチを行うサーチ対象領域SAは、予め設定される。例えば図124の例では、第三画像表示領域に表示される輝度画像上で、サーチ対象領域SAが矩形状に指定されている。
(位置補正ステップ)
Further, in step S12202, the controller unit performs a pattern search on the input image input during operation. That is, the 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 “Shapetrax 2” processing unit 264 displayed in the flow display area 261 corresponds to the pattern search. Here, the image search means 64 of FIG. 5 performs a pattern search on the luminance image (input image) obtained by capturing the workpiece, and performs positioning. Specifically, the position of the preset inspection target area 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 rectangular shape on the luminance image displayed in the third image display area.
(Position correction step)

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

最後にステップS12204において、補正された位置にて距離画像を用いて検査を実行する。図123の例では、フロー表示領域261に表示される「高さ計測」処理ユニット266が該当する。また図127の例では、高さ計測を実行している。すなわち、補正された位置の検査対象領域でそれぞれ高さが計測され検査される。例えば平面高さが所定の基準値以内かどうかを判定して、判定結果を出力する。 Finally, in step S12204, the inspection is performed 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 to this. Further, 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 position. 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, an example of performing an inspection based on a distance image after performing position correction using a luminance image has been described. However, the present invention is not limited to this, and an image for which position correction is performed and an image for which inspection processing is performed can be arbitrarily set. For example, contrary to the above, it is also possible to perform the inspection process using the luminance image after performing the position correction using the distance image. As an example, in an example where an accurate pattern search is difficult with a luminance image, such as when a white work 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 by the determination process based on the height information but also by the image processing result using the luminance image such as reading the character string printed on the 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 values of X, Y, and Z, respectively. In addition to the three-dimensional point cloud data, it is also possible to convert the actually obtained value into, for example, a Z image or a pitch Z image such as XY.
(1: Z image)

Z画像とは、Z座標のみの高さ画像データである。例えば撮像手段で撮像されたワークの位置の凹凸が重要で、X,Y座標は正確でなくても良いような場合は、X,Y座標は不要なので、Z座標のみのデータであるZ画像を出力すれば足りる。この場合は伝送するデータ量が少なくなり、伝送時間を短縮することができる。また通常の二次元の撮像手段と同じく、画像としてデータを扱えるので、既存の二次元画像用の画像処理装置を用いて画像処理を行うこともできる。
(2:XY等ピッチZ画像)
The Z image is height image data having only Z coordinates. For example, if the unevenness of the position of the work imaged by the imaging means is important and the X and Y coordinates do not have to be accurate, the X and Y coordinates are unnecessary, so the Z image, which is the data of only the Z coordinate, is displayed. It is enough to output. In this case, the amount of data to be transmitted is reduced, and the transmission time can be shortened. Further, since the data can be handled as an image like a normal two-dimensional image pickup means, image processing can be performed using an existing image processing device for a two-dimensional image.
(2: XY 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 pitch regardless of the height. Specifically, the Z coordinate at the position where the XY coordinates are set to the same pitch is interpolated from the surrounding point cloud data to obtain the XY equal pitch Z image.

一般に撮像手段のレンズが対物テレセントリックレンズではない場合は、撮像されたワークの高さ位置(Z座標)により、撮像手段で撮像される位置(X,Y座標)が異なる。このため、撮像素子上で同じ位置に写った物であっても、高さによって実際のXY座標位置は異なることになる。例えば体積のような、立体的な差異を検査したい場合は、カメラに対して近くにワークがあると値が大きくなり、遠くにあると値が小さくなってしまうので不都合となる。そこで、ポイントクラウドデータから、XY均等ピッチのZデータを求めることによって、高さに左右されないXY位置を持ったZ画像を得ることができる。
(3:XYZ(ポイントクラウドデータ))
Generally, 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. Therefore, even if the objects are captured at the same position on the image sensor, the actual XY coordinate positions will differ depending on the height. For example, when it is desired to inspect a three-dimensional difference such as volume, it is inconvenient because the value becomes large when the work is close to the camera and the value becomes small when the work is far away. Therefore, by obtaining the Z data having an XY uniform pitch from the point cloud data, it is possible to obtain a Z image having an XY position that is not affected by the height.
(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 you want to handle the measured three-dimensional data as it is. In this case, the amount of data is tripled as compared with the case of only the Z coordinate, but since it is raw data, it can be used for applications such as obtaining a three-dimensional difference from three-dimensional CAD data.
(Generation of equi-pitch image)

次に、距離画像と輝度画像に加え、画角を補正した等ピッチ画像を作成するデータフロー図を図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, first, a spatial code image is generated from the spatial coding pattern floodlight work image group imaged by the head portion according to the spatial coding method. On the other hand, a phase image is generated from the phase shift pattern floodlight work image group according to the phase calculation. Then, a phase expansion calculation is performed from these spatial code images and phase images to generate an extended phase image. It is also possible to apply common filter processing such as filtering the spatial coding pattern projection work image group and the phase shift pattern projection work image group. Examples of common filtering include the application of two-dimensional filters such as a median filter, a Gaussian filter, and an averaging filter. On the other hand, a luminance image (average shading image) is generated by averaging the phase shift pattern projection 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 head portion generates the three-dimensional data and the luminance image, 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, and gradation conversion is performed to convert the phase information into height information. Here, after obtaining the X image, the Y image, and the Z image from the phase information, the XY are equalized to obtain the XY equal pitch Z image and the XY equal pitch Z average image on the XY plane. Such uniform interval processing is performed by the interval equalization processing setting means 47.

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

一方で、XY等ピッチ化機能をOFFして、Z画像を得る際のデータフロー図を図130に示す。この例であれば、階調変換に際してX画像やY画像に分解する必要がないので、その分処理を簡素化できる。 On the other hand, FIG. 130 shows a data flow diagram when a Z image is obtained by turning off the pitching function such as XY. In this example, it is not necessary to decompose 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, the X image, the Y image, and the Z image after the phase-to-height conversion can be output as they are, so that there is an advantage that the X image, the Y image, and the Z image can be output with a light load.
(Gradation conversion method)

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

まず、予め階調変換パラメータを決定しておく静的変換について説明する。ここでは、設定時において入力画像や予め登録しておいた登録画像に対して、階調変換を行うための階調変換パラメータを調整する。そして運用時においては、設定時に設定された階調変換パラメータでもって、距離画像の階調変換を行い、階調変換後の低階調距離画像に対して検査を実行する。なお設定時における手順は、上述の図8のフローチャートに基づいて説明した通りである。
(運用時の手順)
First, a 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. Then, at the time of operation, the gradation conversion of the distance image is performed with the gradation conversion parameter set at the time of setting, and the inspection is executed on the low gradation distance image after the gradation conversion. The procedure at the time of setting is as described based on the flowchart of FIG. 8 described above.
(Procedure during operation)

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

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

このようにして階調変換パラメータの演算条件が設定されると、運用時においては、設定された階調変換パラメータ演算条件に従って、入力画像に応じた階調変換パラメータが個別に演算される。次に、動的変換によって距離画像を低階調距離画像に階調変換する運用時の手順を、図133のフローチャートに基づいて説明する。まずステップS13301において、距離画像を取得する。ここでも上述したステップS13201と同様、距離画像生成手段32が生成した距離画像を、コントローラ部2が取り込む。次にステップS13302において、入力画像である距離画像に基づいて、階調変換パラメータを決定する。階調変換パラメータの調整方法については、上述した方法が利用できる。さらにステップS13303において、階調変換を実行する。最後に、ステップS13304において検査処理を実行する。この方法によれば、入力画像に従って階調変換パラメータを変更できるので、異なるワークに対しても柔軟に階調変換を行って正確な検査が可能となる。例えば、高さにばらつきのあるワーク表面の検査も、精度を低下させることなく行うことができる。 When the calculation conditions of the gradation conversion parameters are set in this way, the gradation conversion parameters corresponding to the input image are individually calculated according to the set gradation conversion parameter calculation conditions during operation. Next, an operation procedure for gradation-converting a distance image into a low-gradation distance image by dynamic conversion will be described with reference to the flowchart of FIG. 133. First, in step S13301, a distance image is acquired. Here, as in step S13201 described above, the controller unit 2 captures the distance image generated by the distance image generation means 32. Next, in step S13302, the gradation conversion parameter is determined based on the distance image which is the input image. As a method for adjusting the gradation conversion parameter, the above-mentioned method can be used. Further, in step S13303, gradation conversion is executed. Finally, the inspection process 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 flexibly perform gradation conversion even for different workpieces and perform an accurate inspection. For example, the inspection of the work surface having variations in height can be performed without deteriorating the 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. 134. Here, there are two methods, one is to dynamically set one gradation conversion parameter set, and the other is to prepare a plurality of gradation conversion parameter sets in advance and dynamically select the gradation conversion parameter set. ..
(How to set 1A gradation conversion parameter set)

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

まず、予めワーク上の検査したい領域を、検査対象領域設定手段で検査対象領域として指定しておく。なお、検査対象領域を、入力画像である距離画像の一部を指定する他、距離画像の全体とすることもできる。この場合は、検査対象領域を指定する作業を省略してもよい。 First, the area to be inspected on the work is designated in advance as the inspection target area by the inspection target area setting means. In addition to designating a part of the distance image which is the input image, the inspection target area can 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 calculated. Next, the 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 used 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 this by 1.2 is set as the distance range of the image after gradation conversion. Therefore, the measurement range is within ± 0.3 mm with respect to the average distance.

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

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

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

このような具体例を図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. 136. In this example as well, as in FIG. 134 described above, consider a case where the entire measurement surface for each work is vertically displaced within a range of 5 mm. For such a work, nine images after gradation conversion, in which the conversion center is changed every 0.5 mm and gradation conversion is performed, are created. Then, the obtained images after gradation conversion are preferably displayed side by side on the display means, and the user is made to select the converted image by the conversion center closest to the average value of the distance image which is the input image. Then, the gradation conversion parameter set applied to the image selected by the user is set. As a specific procedure, as shown in FIG. 136, first, a distance image of the work is generated (step S13601), and then the gradation conversion process is performed a plurality of times while changing the gradation conversion parameters as described above (step S13602). .. Then, the user is made to select a desired image from the obtained gradation conversion image, which is a simple low gradation distance image (step S13603), and the gradation conversion parameter is adjusted as necessary, and the obtained low gradation is obtained. An inspection is performed on the gradation distance image (step S13604).
(Details of static conversion and dynamic conversion)

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

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

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

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

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

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

平均基準高さを規定するための平均抽出領域は、運用に先立って予め設定される(上述した図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 area in step S83 of FIG. 8 is as described based on the GUI of FIGS. 88 to 92. On the other hand, during operation, dynamic conversion is performed according to the procedure described with reference to FIG. 133. For example, a work transported on the line is imaged to generate a distance image (step S13301), the average height of the average extraction region set above is calculated (step S13302), 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 each time for each workpiece, so accurate inspection can be achieved regardless of the variations in the height direction of the workpiece. can.

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

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

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

また図140は、平面に微小な傾斜面と打痕のあるワークWK12の例を示している。この例では、打痕DEに起因してワークWK12の表面に微小な傾斜面が存在しているため、傾きによって打痕の検出精度に影響がでる虞がある。そこで、平面基準等を利用し、ワーク個体毎に平面を動的に求めて基準面として階調変換することで、僅かな窪みや打痕の検出といった高精度な検査が可能となる。 Further, FIG. 140 shows an example of the work WK12 having a minute inclined surface and a dent on the plane. In this example, since a minute inclined surface exists on the surface of the work 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 to dynamically obtain a plane for each workpiece and perform gradation conversion as a reference plane, highly accurate inspection such as detection of slight dents and dents becomes possible.

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

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

例えば階調変換条件自動設定手段を、階調変換条件自動設定手段と、階調変換条件手動設定手段として機能させることができる。すなわち、階調変換条件自動設定手段で、階調変換手段が距離画像を低階調距離画像に階調変換する際の簡易的な階調変換条件を設定する。また、階調変換条件自動設定手段で設定された簡易階調変換条件に基づき、階調変換された簡易低階調距離画像を表示手段に表示させた状態で、階調変換条件手動設定手段が、階調変換条件の手動調整を受け付ける。これにより、ユーザに対していきなり階調変換条件の設定を促すのでなく、暫定的な簡易階調変換条件を自動的に設定して階調変換を行った上で、得られた一以上の簡易低階調距離画像を参照しながら、所望の階調変換条件に設定できるため、ユーザが階調変換パラメータの意味を習熟していない場合や設定に不慣れな場合でも、ある程度自動化してこのような設定作業を行い易くすることができる。 For example, the gradation conversion condition automatic setting means can be made to 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 simple gradation conversion conditions when the gradation conversion means converts a distance image into a low gradation distance image. Further, based on the simple gradation conversion condition set by the gradation conversion condition automatic setting means, the gradation conversion condition manual setting means can be used while the gradation-converted simple low-gradation distance image is displayed on the display means. , Accepts manual adjustment of gradation conversion conditions. As a result, instead of prompting the user to set the gradation conversion condition suddenly, one or more simple gradations obtained after performing the gradation conversion by automatically setting the provisional simple gradation conversion condition are performed. Since the desired gradation conversion condition can be set 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 and such. It is possible to facilitate the setting work.

具体的な手順を、図142のフローチャートに基づいて説明する。まずステップS14201において、距離画像の作成処理を実行する。次にステップS14202において、階調変換パラメータの初期値を用いて、初期の階調変換処理を行う。さらにステップS14203において、得られた階調変換画像が適切かどうかを判定し、適切でない場合はステップS14204において再度、階調変換パラメータの調整を行った後、ステップS14202に戻って処理を繰り返す。一方、ステップS14203において適切な階調変換画像が得られていると判定された場合は、ステップS14205に進み、所定の検査を実行する。 A specific procedure will be described with reference to the flowchart of FIG. 142. First, in step S14201, the process of creating a distance image is executed. Next, in step S14202, the initial gradation conversion process is performed using the initial values of the gradation conversion parameters. Further, in step S14203, it is determined whether or not the obtained gradation conversion image is appropriate, and if it is not appropriate, the gradation conversion parameters are 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 conversion image is obtained, the process proceeds to step S14205 to execute a predetermined inspection.

なお、以上の方法ではステップS14203において階調変換パラメータが適切かどうかの判定を行っているが、この手順を省略してもよい、この場合の手順を、図143に示す。各手順は上述した図142の例とほぼ同じであり、ステップS14301において、距離画像の作成処理を実行し、次にステップS14302において、初期の階調変換処理を行う。そしてステップS14303において階調変換パラメータの調整を行った後、ステップS14304において所定の検査を行う。 In the above method, it is determined in step S14203 whether or not the gradation conversion parameter is appropriate, but this procedure may be omitted. The procedure in this case is shown in FIG. 143. Each procedure is substantially the same as the example of FIG. 142 described above. In step S14301, the distance image creation process is executed, and then in step S14320, the initial gradation conversion process is performed. 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 a conversion function f (x, y, z) to an input image, a method of shifting or spanning an input image and compressing the result to n gradations, or an arbitrary method. Using the plane as the reference plane, take the difference between the input image and the reference plane, apply shift and span, and compress the result to n gradations, or take the difference between the input image and the reference image and shift and span. Examples thereof include a method of multiplying and compressing the result to n gradations.

次に、階調変換後の階調変換パラメータを自動調整する具体例について説明する。階調変換パラメータの自動調整方法には、(C1)変換後の距離画像データのヒストグラムの中央値を用いる方法、(C2)ヒストグラムの最大値、最小値を用いる方法、(C3)C1とC2の組み合わせ、等が考えられる。
(C1:ヒストグラムの中央値を用いる方法)
Next, a specific example of automatically adjusting the gradation conversion parameter after gradation conversion will be described. The automatic adjustment method of the gradation conversion parameter includes (C1) a method of using the median value of the histogram of the distance image data after conversion, (C2) a method of using the maximum and minimum values of the histogram, and (C3) a method of using C1 and C2. Combinations, etc. are possible.
(C1: Method using the median 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. 144. 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. Then, in step S14403, the gradation conversion parameter is changed so that the median value becomes a predetermined value. The gradation conversion process is executed again using the gradation conversion parameter changed here. The median value may be the average value of 2n + 1 including n pieces before and after the center. Further, 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 the maximum and minimum values of the histogram)

まず、変換後の距離画像データのヒストグラムを計算する。次にヒストグラムの最大値,最小値を求め、最大値−最小値の幅が予め定めた値になるよう、階調変換パラメータを変更する。そして変更した階調変換パラメータで再度、階調変換処理を実行する。ここで、最大値,最小値は、それぞれ大きい方からn個,小さい方からm個のそれぞれ平均値としてもよい。または最大値,最小値は、それぞれ大きい方からn個,小さい方からm個のそれぞれ取り除いた後の最大値、最小値とすることもできる。
(C3:C1とC2の組み合わせ)
First, the histogram of the converted distance image data is calculated. Next, the maximum and minimum values of the histogram are obtained, and the gradation conversion parameters are changed so that the width between the maximum value and the minimum value becomes a predetermined value. Then, the gradation conversion process is executed again with the changed gradation conversion parameters. Here, the maximum value and the minimum value may be average values of n from the larger one and m from the smaller one, respectively. Alternatively, the maximum value and the minimum value can 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を組み合わせてもよい。すなわち、ヒストグラムの計算後、その中央値と最大値−最小値の幅に基づいて、階調変換パラメータを変更して、再度階調変換する。 The above C1 and C2 may be combined. That is, after the calculation of the histogram, the gradation conversion parameter is changed based on the width of the median value and the maximum value-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. Further, the 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 number of gradations including height information can be converted into a low gradation distance image with low gradation. Since this low-gradation distance image can be processed as a two-dimensional image, it is possible to handle the low-gradation distance image even with an image processing device compatible with the existing two-dimensional image. For example, the height information of each pixel included in the distance image obtained by photographing the work in order to inspect the presence or absence of scratches is expressed as a hexadecimal binary number as a shading value. Here, when the difference between the distance image and the reference distance image is calculated, the defect information of shallow and small scratches appearing on the surface of the work is aggregated in the lower eight gradations. Therefore, for example, by reducing the upper eight gradations by the gradation conversion means, it is possible to greatly reduce the amount of information of the difference image while preventing the detection accuracy from being lowered. In this way, the gradation conversion means reduces the gradation of the upper half of the gradation when the gradation value of each pixel of the difference image is expressed in gradation, thereby preventing the detection accuracy from being lowered and the difference image. The amount of information can be greatly compressed.
(Partial execution of gradation conversion processing)

さらに階調変換処理は、距離画像のすべてに対して行うのでなく、一部においてのみ行うことができる。具体的には、階調変換手段は、距離画像の内で、指定された検査対象領域に対してのみ、階調変換処理を実行する。これにより、階調変換処理を軽減して、処理の負荷軽減、高速化が図られる。一例として、図145Aに示すような、径の異なる円柱が三重に重なった形状のワークWK14を用いて、高さ検査処理(第一検査処理)と画像検査処理(第二検査処理)を組み合わせた複数の検査処理を行う場合を考える。ここでは、高さ検査処理として、このワークWK14の円柱状の各面の高さを測定し、また画像検査処理として、ワークWK14の上から二段までの円柱状の部分で欠けや割れの検出を行う外観検査を行う。検査処理の選択は、検査処理選択手段で行う。さらに検査処理選択手段で選択された検査処理に対する具体的な設定は、検査処理設定手段で行う。
(検査処理選択手段)
Further, the gradation conversion process is not performed on all the distance images, but can be performed only on a part of the distance image. Specifically, the gradation conversion means executes the gradation conversion process only for the designated inspection target area in the distance image. As a result, the gradation conversion process is reduced, the processing load is reduced, and the 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 work WK14 having a shape in which cylinders having different diameters are triple-layered as shown in FIG. 145A. Consider the case where multiple inspection processes are performed. Here, as a height inspection process, the height of each surface of the columnar surface of the work WK14 is measured, and as an image inspection process, chipping or cracking is detected in the columnar portion from the top to the second stage of the work WK14. Perform a visual inspection. The inspection process is selected by the inspection process selection means. Further, specific settings for the inspection process selected by the inspection process selection means are performed by the inspection process setting means.
(Inspection process 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 FIGS. 44, 56, etc., the inspection process is selected when the processing unit is added from the initial screen 260. Specifically, the desired inspection process is selected from the list of inspection processes displayed by selecting the "measurement" process from the "addition" submenu of the processing unit. In this example, "Area", "Pattern Search", "Shapetrax2", "Edge Position", "Edge Width", "Edge Pitch", "Edge Angle", "Pair Edge", "Scratch", "Blob", ""Shadeblob","Trend edge position", "Trend edge width", "Trend edge defect", "Shade inspection", "Color inspection", "OCR", "2D code reader", "1D code reader", "High" Select the desired inspection process 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 the details of each inspection process selected by the inspection process selection means. Here, as shown in FIGS. 46, 63, 78, and the like, 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, "image registration" button 113, "image setting" button 114, "area setting" button 115, "height extraction" button 116, " Includes a "pre-processing" 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. In this way, the setting item button area 112 functions as an inspection process setting means.
(Height inspection process)

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

一方、検査処理の内で高さ情報を用いない計測(画像検査処理)を行う場合は、高階調の情報は不要で、より低階調の距離画像で処理を行う方が、負荷が少ない。このため、高階調の距離画像に階調変換を行って、低階調の距離画像を得た上で処理を行う。ここで、距離画像の全体を低階調距離画像に変換する必要はなく、あくまで画像検査処理を行う対象のみに限って階調変換を行えば足りる。すなわち、階調変換を行う領域とは、一以上設定された検査対象領域の内で、高さ情報を用いない画像検査処理用に設定された検査対象領域を対象とする。図145Dに示す例では、図145Bと同様、階調変換前の高階調距離画像に対して、画像検査処理用の検査対象領域を設定する。この例では、ワークの上から二段までで欠け等を検出するために、二段目の円柱状を囲むように検査対象領域を設定する。いいかえると、三段目の円柱状は外観検査対象外なので、この部分を検査対象領域から除外するように設定する。そして、この画像処理検査用対象領域に対して、階調変換を行う。この結果得られた低階調距離画像を、図145Eに示す。この図に示す階調変換後の低階調距離画像は、8階調で表現されており、高階調距離画像に比べ高さ情報は幾分失われているものの、欠けの有無等を検出する外観検査用途には十分な精度が維持されているので、画像検査処理に支障はない。一方で、階調変換が必要な領域は、図145B等に比べて大幅に削減されているので、処理の簡素化、高速化に寄与する。 On the other hand, when measurement (image inspection processing) that does not use height information is performed in the inspection processing, high-gradation information is unnecessary, and processing with a lower-gradation distance image is less burdensome. Therefore, gradation conversion is performed on a high-gradation distance image to obtain a low-gradation distance image, and then 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 the gradation conversion only on the target to be image-inspected. That is, the area for performing gradation conversion is an inspection target area set for image inspection processing that does not use height information, among the inspection target areas set for one or more. In the example shown in FIG. 145D, as in FIG. 145B, an inspection target area for image inspection processing is set for a high gradation distance image before gradation conversion. In this example, the inspection target area is set so as to surround the columnar column of the second stage in order to detect chipping or the like from the top of the work to the second stage. In other words, since the third column is not subject to visual inspection, this part is set to be excluded from the inspection target area. Then, gradation conversion is performed on the target area for image processing inspection. 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 represented by eight gradations, and although some height information is lost as compared with the high gradation distance image, the presence or absence of chipping 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 requiring gradation conversion is significantly reduced as compared with 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 of FIG. 110, in the "height measurement" processing unit and the second "height measurement" processing unit, the 16th floor of the distance image without gradation conversion. Highly accurate height measurement is realized by using the height information of the key. On the other hand, in other inspection processes, for example, a "numerical calculation" processing unit, an "area" processing unit, and a "blob" processing unit 267, a gradation-converted 8-gradation low-gradation grayscale image is used. Although not shown, when performing an inspection process on a luminance image (for example, a color inspection on a color luminance image), height information is not required in the first place, so naturally gradation conversion is also unnecessary.
(Display of gradation conversion condition setting means 43)

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

具体的な設定時の手順を、図146のフローチャートに基づいて説明する。まずステップS14601において、検査処理を選択する。ここでは検査処理選択手段である「計測」メニューで、検査実行手段で実行される検査処理を選択する。次にステップS14602においては、ステップS14601で選択した検査処理が、階調変換を要するものか否かを判定し、階調変換を要する検査処理である場合はステップS14603に進み、階調変換を有効にすると共に、設定項目に階調変換設定手段を表示させる。 A specific setting procedure will be described with reference to the flowchart of FIG. 146. First, in step S14601, the inspection process is selected. Here, the 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 or not the inspection process selected in step S14601 requires gradation conversion, and if the inspection process requires gradation conversion, the process proceeds to step S14603 to enable gradation conversion. At the same time, the gradation conversion setting means is displayed in the setting item.

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

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

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

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

そしてステップS14604において、検査処理の設定を行う。最後にステップS14605において、すべての検査処理の設定が終了したか否かを判定し、未だの場合はステップS14601に戻って検査処理の選択から繰り返し、終了した場合は、処理を完了する。 Then, in step S14604, the inspection process is set. Finally, in step S14605, it is determined whether or not all the inspection process settings have been completed. If not, the process returns to step S14601 and is repeated from the selection of the inspection process. If so, 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 during operation will be described with reference to the flowchart of FIG. 149. 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. Further, in step S14903, the nth inspection process is executed. Further, in step S14904, it is determined whether or not n <N (N is the number of set inspection processes), and if YES, n is incremented by 1 in step S14905, and the process returns to step S14903 to perform the next inspection process. Repeat the process of executing. On the other hand, if n <N, it is assumed that all the inspection processes have been completed, and the processes are completed. In this way, all 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, when gradation conversion is required in the inspection process, as shown in the flowchart of FIG. On the other hand, gradation conversion is performed. Then, in step S1502, the inspection process is executed on the low gradation distance image after the gradation conversion. On the other hand, in the case of the inspection process that does not perform the gradation conversion, as shown in the flowchart of FIG. 151, the inspection process in the inspection target area is executed with the high gradation distance image as it is without undergoing the gradation conversion (). Step S15101).
(Hide function of image selection)

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

以下、検査処理条件を設定する手順を、図152のフローチャートに基づいて説明する。まず、ステップS15201において、検査処理を選択する。次にステップS15202において、ステップS15201で選択した検査処理が、距離画像と輝度画像のいずれかを指定可能な検査処理か、あるいは距離画像のみを指定可能な検査処理かを判定する。ここで距離画像と輝度画像のいずれかを指定可能な検査処理の場合は、ステップS15203に進み、距離画像又は輝度画像のいずれかを選択する。 Hereinafter, the procedure for setting the inspection processing conditions will be described with reference to the flowchart of FIG. 152. First, in step S15201, the inspection process is selected. Next, in step S15202, it is determined whether the inspection process selected in step S15201 is an inspection process in which either a distance image or a luminance image can be specified, or an inspection process in which only the distance image can be specified. Here, in the case of the inspection process 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, consider the case where an "area" processing unit is selected as the inspection processing, as shown in FIG. 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 pressing the "image setting" button 114 in FIG. 62 to display the image setting screen 380 shown in FIG. 153, an image is displayed from the operation field 122. You can choose. Here, the 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. Further, in the image setting field 384, an input image and a registered image can be selected. From this image setting field 384, the input image can be specified by an image variable. Here, when the "input image" selection field 386 is selected, the 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 one of the images captured by a plurality of imaging means (cameras) connected to the three-dimensional image processing device can be selected. Here, different image variables are assigned to each imaging means, and the imaging means and the image variables are associated with each other. For example, the distance image captured by the camera 1 has an image variable "& Cam1Img", the distance image of the camera 2 has an image variable "& Cam2Img", and the distance image of the camera 3 has an image variable "& Cam3Img". The image variable "& Cam4Img" is assigned to each. Further, 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, since the "area" processing unit can specify either the distance image or the luminance image, not only the distance image but also the luminance image is included in the options and displayed.

さらに必要に応じて、画像変数選択画面390で一覧表示される画像変数を、ソートして表示することもでき、ユーザが所望の画像を選択し易いようにしている。 Further, if necessary, the image variables listed on the image variable selection screen 390 can be sorted and displayed, making it easy for the user to 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 in which only the distance image can be specified, the process proceeds to step S15204 and the distance image is selected. 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 the "image setting" button 114 is selected as the inspection processing setting item in the "height measurement" processing unit, the image setting screen 380 is displayed in the same manner, and the image can be selected. .. Here, similarly, when the "input image" selection field 386 is selected, the image variable selection screen 390 of 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, the user can avoid accidentally selecting a luminance image that does not have height information when measuring the height, and an operating environment with less confusion is provided.

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

以上は、先に検査処理をユーザに選択させた上で、選択された検査処理の種別に応じて、検査処理の設定を行う対象となる画像の選択に際して、選択可能な画像に制限をかける例について説明した。逆に、先に画像を選択させた上で、この画像に対して実行可能な検査処理の種別に制限をかけることもできる。すなわち、まず画像選択手段で距離画像又は輝度画像を選択させ、次に検査処理選択手段でもって、検査実行手段で実行した検査処理を一以上選択する際に、選択された画像が距離画像か輝度画像かに応じて、各画像に対して実行可能な検査処理のみを選択可能とする。この構成であれば、選択された画像に対して、誤って設定不可能な検査処理を選択したり、この検査処理に関する検査処理条件を設定してしまう事態を回避できる。 The above is an example in which the user is allowed to select the inspection process first, and then the selectable images are restricted when selecting the image to be set for the inspection process according to the selected inspection process type. Was explained. Conversely, it is possible to select an image first and then limit the types of inspection processing that can be performed on this image. That is, when a distance image or a brightness 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 process selection means, the selected image is the distance image or the brightness. Depending on the image, only the inspection processing that can be executed for each image can be selected. 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 with reference to the flowchart of FIG. 156. First, in step S15601, an image is selected. Here, a distance image or a luminance image is selected. Next, in step S15602, it is determined whether the image selected in step S15601 is either a distance image or a luminance image. In the case of a distance image, the process proceeds to step S15603, and the user is made to select an inspection process that can be executed on the distance image by the inspection process selection means. On the other hand, in the case of a luminance image, the process proceeds to step S15604, and the user is made to select an inspection process that can be executed on the luminance image by the inspection process selection means. When the inspection process is selected in this way, the process proceeds to step S15605, and the inspection process conditions for the selected inspection process are 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 the work. As described above, when the image is registered, the luminance image and the distance image are registered at the same time. The user selects one of the images, selects the inspection process for the next selected image, and sets the inspection process conditions. 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 FIGS. 44 and 56 described above, when an image is selected and Add is selected from the displayed submenu, a list of inspection processes that can be performed on the luminance image is displayed. For example, as "measurement" processing, "area" processing unit, "scratch" processing unit, and "blob" processing unit 267 are displayed as options. At this stage, inspection processes that cannot be performed on the luminance image, such as the "height measurement" processing unit, are not displayed. As a result, it is possible to prevent the user from accidentally selecting an inspection process that cannot be set for the luminance image. It is also possible to make it impossible to select by graying out while displaying a list of all measurement processes. When the inspection process is selected, the processing unit is determined, and then the inspection process conditions required for this inspection process are set from the inspection process condition setting means.

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

このように、画像に対して検査処理ツールを紐付けることで、選択不可能な画像と検査処理との組み合わせを物理的に排除し、ユーザによる設定ミスを容易に回避できる。 In this way, by associating the inspection processing tool with the image, it is possible to physically eliminate the combination of the unselectable image and the inspection processing, and easily avoid the setting error by the user.

本発明の三次元画像処理装置、三次元画像処理方法及び三次元画像処理プログラム並びにコンピュータで読み取り可能な記録媒体及び記録した機器は、三角測距の原理を利用した検査装置等に利用できる。 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 recording device of the present invention can be used for an inspection apparatus or the like utilizing the principle of triangular distance measurement.

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 ... Three-dimensional image processing device 1, 1B, 1C, 1D ... Head unit 2, 2'... Controller unit 3 ... Input means 4 ... Display means 10, 10A, 10B ... Imaging means 20 ... Light projecting means; 20A ... First projector; 20B ... Second projector 21 ... Measuring light source 22 ... Pattern generation unit 23, 24, 25 ... Lens 30 ... Head side controller 31 ... Head side calculation unit 32 ... Distance image generation means 34 ... Filter processing unit 36 ... Head side communication means; 36A ... Controller connection interface; 36B ... PC connection interface 38 ... Storage means; 38a ... Distance image storage unit; 38b ... Brightness image storage unit 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 46 ... 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 unit 52 ... Controller side connection unit 53 ... Operation input unit 54 ... Display control unit 55 ... Communication unit 56 ... RAM
57 ... Controller side storage means 58 ... Auxiliary storage means 59 ... Output unit 60 ... Image processing unit 62 ... Abnormal point highlighting 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 target 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 ... Dot pointer 147 ... "Extraction area" button 148 ... Extraction area setting dialog 149 ... Extraction area selection field 150 ... One point designation screen 152 ... "Z height" display field 154 ... Emphasis method setting field 156 ... Gain adjustment field 158 ... "Detailed setting" Button 160 ... Emphasis 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 "Details""Setting" button 180 ... Three-point specification 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 standard setting screen 220 ... Mask area setting screen 222 ... "Detailed setting" Button 230 ... Average height standard detailed setting screen 240 ... Plane standard detailed setting screen 250 ... Free curved surface standard setting screen 252 ... "Extraction size" Designation field 260 ... Initial screen 261 ... Flow display area 262 ... Third image display area 263 ... "Image capture" 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 ... Image setting menu 270 ... Image registration screen 271 ... "Camera selection" Column 272 ... "Register" button 280 ... Image setting screen 282 ... "Detailed setting" button 284 ... "Image setting" button 290 ... Three-dimensional measurement setting screen 292 ... "Display by continuous update" column 294 ... Shutter speed setting column 295 ... Numerical display field 296 ... Light and shade range setting field 310 ... Pre-processing setting field 312 ... Unmeasurable standard setting field 314 ... Equal 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 edit dialog 330 ... Mask area setting field 332 ... "Edit" button 334 ... Mask area edit 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 field 390 ... image variable selection screen 460 ... height measurement setting screen 620 ... area setting screen 630 ... free curved surface reference setting screen 632 ..." extraction direction "designation field 640 ... detailed setting screen WK, WK7, WK8, WK9 , WK10, WK11, WK12, WK13, WK14 ... Work PC ... Personal computer SA ... Search target area SI ... Spot-shaped icon ROI ... Measurement area BC ... Belt conveyor DE ... Dust

Claims (18)

検査対象物の高さ情報を含む距離画像を取得すると共に、該距離画像に基づいて画像処理を行うことが可能な三次元画像処理装置であって、
検査対象物の画像を撮像する撮像手段と、
前記撮像手段で撮像された画像に基づいて、距離画像を生成可能な距離画像生成手段と、
前記距離画像生成手段で生成された距離画像を、該距離画像の階調数よりも低い階調数の距離画像に階調変換する際の階調変換条件を構成する階調変換パラメータとして、該階調変換を行う基準となる基準面を設定するための基準面設定手段と、
前記基準面設定手段で設定された基準面の高さを基準として、前記距離画像を、該距離画像の階調数よりも低い階調数の、該距離画像が有する高さ情報を画像の濃淡値に置き換えた低階調距離画像に階調変換するための階調変換手段と、
前記階調変換手段で階調変換された低階調距離画像に対して、所定の検査処理を実行するための検査実行手段と、
前記階調変換手段で階調変換された低階調距離画像を表示させるための表示手段と
を備え、
前記三次元画像処理装置で三次元画像処理を行う運用時に、前記距離画像生成手段が、外部から逐次入力される検査対象物の入力画像に基づいて検査対象物の距離画像を逐次生成し、前記基準面設定手段が、逐次生成された距離画像の高さ情報に基づいて、基準面を再設定することにより、検査対象物の高さに応じて基準面を変更するように構成されており、
前記階調変換手段は、前記距離画像生成手段が生成した距離画像毎に再設定された基準面の高さを基準として、各距離画像を前記低階調距離画像に変換するよう構成されており、
前記階調変換手段が階調変換を行う際に、前記距離画像を用いた位置補正を行うよう構成してなることを特徴とする三次元画像処理装置。
A three-dimensional image processing device 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 an object to be inspected,
A distance image generating means capable of generating a distance image based on an image captured by the imaging means, and a distance image generating means.
As a gradation conversion parameter that constitutes a gradation conversion condition when the distance image generated by the distance image generation means is gradation-converted to a distance image having a gradation number lower than the gradation number of the distance image A reference plane setting means for setting a reference plane that serves as a reference for gradation conversion, and
With reference to the height of the reference plane set by the reference plane setting means, the distance image is based on the height information of the distance image having a gradation number lower than the gradation number of the distance image. Gradation conversion means for converting gradation to a low-gradation distance image replaced with a value,
An inspection execution means for executing a predetermined inspection process on a low gradation distance image whose gradation has been converted by the gradation conversion means, and
It is provided with a display means for displaying a low gradation distance image that has been gradation-converted by the gradation conversion means.
During the operation of performing the three-dimensional image processing with the three-dimensional image processing apparatus, the distance image generation means sequentially generates a distance image of the inspection object based on the input image of the inspection object sequentially input from the outside, and the distance image of the inspection object is sequentially generated. The reference plane setting means is configured to change the reference plane according to the height of the inspection object by resetting the reference plane based on the height information of the distance image generated sequentially.
The gradation conversion means is configured to convert each distance image into the low gradation distance image based on the height of the reference plane reset for each distance image generated by the distance image generation means. ,
A three-dimensional image processing apparatus characterized in that the gradation conversion means is configured to perform position correction using the distance image when performing gradation conversion.
請求項1に記載の三次元画像処理装置であって、さらに
撮像手段の光軸に対して斜め方向から入射光を所定の投影パターンの構造化照明として投光するための投光手段を備えており、
前記撮像手段は、前記投光手段で投光され、検査対象物で反射された反射光を取得して複数のパターン投影画像を撮像し、
前記距離画像生成手段は、前記撮像手段で撮像された複数のパターン投影画像に基づいて、距離画像を生成するよう構成してなることを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to claim 1, further comprising a light projecting means 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. Ori,
The image pickup means acquires the reflected light projected by the light projecting means and reflected by the inspection object to capture a plurality of pattern projection images.
The three-dimensional image processing apparatus is characterized in that the distance image generation means is configured to generate a distance image based on a plurality of pattern projection images captured by the image pickup means.
請求項1に記載の三次元画像処理装置であって、さらに
前記階調変換手段による階調変換に際して、局所的な形状変化を抽出する方向を指定するための抽出方向入力手段と、
を備え、
前記基準面設定手段が、前記三次元画像処理装置で三次元画像処理を行う運用時に外部から入力される検査対象物の入力画像に基づいて、基準面を設定するよう構成されており、
前記基準面設定手段が、前記表示手段上に表示された距離画像から、曲面を演算し、該演算された曲面を基準面として設定するよう構成されてなることを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to claim 1, further comprising an extraction direction input means for designating a direction for extracting a local shape change in gradation conversion by the gradation conversion means.
With
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 in which the three-dimensional image processing apparatus performs three-dimensional image processing.
The three-dimensional image processing apparatus is configured such that the reference surface setting means calculates a curved surface from a distance image displayed on the display means and sets the calculated curved surface as a reference surface. ..
請求項3に記載の三次元画像処理装置であって、
前記抽出方向入力手段が、局所的な形状変化を抽出する方向として、距離画像のX方向、Y方向、又はXY方向のいずれかを指定可能としてなることを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to claim 3.
A three-dimensional image processing apparatus, wherein the extraction direction input means can specify any one of the X direction, the Y direction, and the XY direction of a distance image as a direction for extracting a local shape change.
請求項3又は4に記載の三次元画像処理装置であって、
前記階調変換手段が、階調変換に際して、距離画像を一旦縮小し、フィルタ処理を行った後拡大して自由曲面画像を作成し、該自由曲面画像と距離画像との差分を取ることで、距離画像の形状変化を抽出するものであり、
該距離画像の縮小に際して、前記抽出方向入力手段で指定された方向に対してのみ縮小を行うことを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to claim 3 or 4.
At the time of gradation conversion, the gradation conversion means reduces the distance image once, performs filtering processing, and then enlarges it to create a free curved surface image, and obtains a difference between the free curved surface image and the distance image. It extracts the shape change of the distance image,
A three-dimensional image processing apparatus characterized in that when the distance image is reduced, the reduction is performed only in the direction specified by the extraction direction input means.
請求項3〜5のいずれか一項に記載の三次元画像処理装置であって、さらに
検査対象物に対して光切断法で投光するための投光手段を備えており、
前記撮像手段は、前記投光手段で投光された画像を撮像し、前記距離画像生成手段は光切断法で得られたプロファイルを合成して距離画像を生成するよう構成してなることを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to any one of claims 3 to 5, further comprising a light projecting means for projecting light on an inspection object by a light cutting method.
The imaging means is configured to capture an image projected by the light projecting means, and the distance image generating means is configured to synthesize a profile obtained by a light cutting method to generate a distance image. Three-dimensional image processing device.
請求項1〜6のいずれか一項に記載の三次元画像処理装置であって、
前記基準面設定手段が、前記三次元画像処理装置で三次元画像処理を行う運用時において、新たに入力された距離画像に対して、該距離画像上で指定された抽出領域内の高さ情報に基づいて選択された計算方法で、階調変換を行う基準となる基準面を設定し、設定された基準面の高さに基づいて前記階調変換手段による階調変換を実行するよう構成してなることを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to any one of claims 1 to 6.
When the reference plane setting means performs three-dimensional image processing with the three-dimensional image processing device, the height information in the extraction region designated on the distance image is obtained with respect to the newly input distance image. A reference plane as a reference for gradation conversion is set by the calculation method selected based on the above, and the gradation conversion by the gradation conversion means is executed based on the height of the set reference plane. A three-dimensional image processing device characterized by being
請求項7に記載の三次元画像処理装置であって、
前記基準面設定手段が、前記表示手段上に表示された距離画像中の任意の点を指定することで、該指定された点の高さ情報を基準面として設定するよう構成してなることを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to claim 7.
The reference plane setting means is configured to set the height information of the designated point as the reference plane by designating an arbitrary point in the distance image displayed on the display means. A featured three-dimensional image processing device.
請求項7に記載の三次元画像処理装置であって、
前記基準面設定手段が、前記表示手段上に表示された距離画像中の任意の一点を指定することで、該指定された点の高さ情報を基準面として設定するよう構成してなることを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to claim 7.
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 device.
請求項7に記載の三次元画像処理装置であって、
前記基準面設定手段が、前記表示手段上に表示された距離画像中の任意の面を指定することで、該指定された面の高さ情報を基準面として設定するよう構成してなることを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to claim 7.
The reference plane setting means is configured to set the height information of the designated plane as a reference plane by designating an arbitrary plane in the distance image displayed on the display means. A featured three-dimensional image processing device.
請求項7に記載の三次元画像処理装置であって、
前記基準面設定手段が、前記表示手段上に表示された距離画像中の任意の三点を指定することで、該指定された三点を含む面の高さ情報を基準面として設定するよう構成してなることを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to claim 7.
By designating any three points in the distance image displayed on the display means, the reference plane setting means sets the height information of the plane including the designated three points as the reference plane. A three-dimensional image processing device characterized by being made of.
請求項7に記載の三次元画像処理装置であって、
前記基準面設定手段が、前記表示手段上に表示された距離画像から、曲面を演算し、該演算された曲面を基準面として設定するよう構成してなることを特徴とする三次元画像処理装置。
The three-dimensional image processing apparatus according to claim 7.
The three-dimensional image processing apparatus is configured such that the reference surface setting means calculates a curved surface from a distance image displayed on the display means and sets the calculated curved surface as a reference surface. ..
検査対象物の高さ情報を含む距離画像を取得すると共に、該距離画像に基づいて画像処理を行う三次元画像処理方法であって、
撮像手段の光軸に対して斜め方向から入射光を所定の投影パターンの構造化照明として投光手段で投光する工程と、
前記投光手段で投光され、検査対象物で反射された反射光を取得して複数のパターン投影画像を撮像手段で撮像する工程と、
前記撮像手段で撮像された複数のパターン投影画像に基づいて、距離画像を距離画像生成手段で生成する工程と、
前記距離画像生成手段で生成された距離画像を、該距離画像の階調数よりも低い階調数の距離画像に階調変換する際の階調変換条件を構成する階調変換パラメータとして、該階調変換を行う基準となる基準面を設定する工程と、
前記設定された基準面の高さを基準として、前記距離画像を、該距離画像の階調数よりも低い階調数の、該距離画像が有する高さ情報を画像の濃淡値に置き換えた低階調距離画像に階調変換する工程と、
前記階調変換された低階調距離画像に対して、所定の検査処理を実行する工程と
を含み、さらに
前記基準面の設定に際して、局所的な形状変化を抽出する方向を指定するよう促す工程を含んでおり、
前記階調変換に際して、距離画像から曲面を演算し、該演算された曲面を基準面として低階調距離画像に階調変換することで、該指定された方向における形状変化を抽出し、
前記距離画像生成手段が、外部から逐次入力される検査対象物の入力画像に基づいて検査対象物の距離画像を逐次生成し、該逐次生成された距離画像の高さ情報に基づいて、基準面を再設定することにより、検査対象物の高さに応じて基準面を変更し、
前記距離画像生成手段が生成した距離画像毎に再設定された基準面の高さを基準として、各距離画像を前記低階調距離画像に変換し、
前記階調変換を行う際に、前記距離画像を用いた位置補正を行うことを特徴とする三次元画像処理方法。
It is a three-dimensional image processing method that acquires a distance image including height information of an inspection object and performs image processing based on the distance image.
A process of projecting incident light from an 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.
A step of acquiring the reflected light projected by the light projecting means and reflected by the inspection object and capturing a plurality of pattern projection images by the imaging means.
A step of generating a distance image by the distance image generation means based on a plurality of pattern projection images captured by the image pickup means, and
As a gradation conversion parameter that constitutes a gradation conversion condition when the distance image generated by the distance image generation means is gradation-converted to a distance image having a gradation number lower than the gradation number of the distance image The process of setting a reference plane that serves as a reference for gradation conversion, and
Based on the height of the set reference plane, the distance image has a gradation number lower than the gradation number of the distance image, and the height information of the distance image is replaced with a grayscale value of the image. Gradation distance The process of converting gradation to an image and
A step of executing a predetermined inspection process on the gradation-converted low-gradation distance image, and a step of prompting to specify a direction for extracting a local shape change when setting the reference plane. Includes
At the time of gradation conversion, a curved surface is calculated from the distance image, and the calculated curved surface is used as a reference plane for gradation conversion to a low gradation distance image to extract a shape change in the specified direction.
The distance image generation means sequentially generates a distance image of the inspection object based on the input image of the inspection object sequentially input from the outside, and based on the height information of the sequentially generated distance image, the reference plane. By resetting, the reference plane can be changed according to the height of the inspection object.
Each distance image is converted into the low gradation distance image based on the height of the reference plane reset for each distance image generated by the distance image generation means.
A three-dimensional image processing method characterized by performing position correction using the distance image when performing the gradation conversion.
請求項13に記載の三次元画像処理方法であって、
前記基準面の設定に際して、局所的な形状変化を抽出する方向として、距離画像のX方向、Y方向、又はXY方向のいずれかを指定するよう促す工程を含むことを特徴とする三次元画像処理方法。
The three-dimensional image processing method according to claim 13.
The three-dimensional image processing comprising a step of prompting to specify one of the X direction, the Y direction, and the XY direction of the distance image as the direction for extracting the local shape change when setting the reference plane. Method.
請求項13又は14に記載の三次元画像処理方法であって、
前記階調変換に際して、距離画像を一旦縮小し、フィルタ処理を行い、拡大して自由曲面画像を作成し、該自由曲面画像と距離画像との差分を取ることで、距離画像の形状変化を抽出しするものであり、
該距離画像の縮小に際して、前記階調変換において局所的な形状変化を抽出する方向を指定するための抽出方向入力手段で指定された方向に対してのみ縮小を行うことを特徴とする三次元画像処理方法。
The three-dimensional image processing method according to claim 13 or 14.
At the time of the gradation conversion, the distance image is once reduced, filtered, enlarged to create a free curved surface image, and the difference between the free curved surface image and the distance image is taken to extract the shape change of the distance image. It is something to do
When reducing the distance image, the three-dimensional image is characterized in that the reduction is performed only in the direction specified by the extraction direction input means for designating the direction for extracting the local shape change in the gradation conversion. Processing method.
請求項13〜15のいずれか一項に記載の三次元画像処理方法であって、
前記基準面を設定する工程において、三次元画像処理装置で三次元画像処理を行う運用時に外部から入力される検査対象物の入力画像に基づいて、前記基準面を設定しており、
前記階調変換する工程において、入力画像の位置補正を行うことを特徴とする三次元画像処理方法。
The three-dimensional image processing method according to any one of claims 13 to 15.
In the process of setting the reference plane, the reference plane is set based on the input image of the inspection object input from the outside during the operation of performing the three-dimensional image processing with the three-dimensional image processing device.
A three-dimensional image processing method characterized in that position correction of an input image is performed in the step of gradation conversion.
検査対象物の高さ情報を含む距離画像を取得すると共に、該距離画像に基づいて画像処理を行うことが可能な三次元画像処理プログラムであって、コンピュータに、
撮像手段の光軸に対して斜め方向から入射光を所定の投影パターンの構造化照明として投光し、検査対象物で反射された反射光を取得して撮像された複数のパターン投影画像に基づいて、距離画像を生成可能な距離画像生成機能と、
前記距離画像生成機能で生成された距離画像を表示させる機能と、
必要な設定を行うための設定モードにおいて、ユーザからの操作を受け付け、各種の設定を行う設定機能として、前記距離画像生成機能で生成された距離画像を階調変換する際の階調変換条件を構成する階調変換パラメータとして、該階調変換を行う基準となる基準面を設定するための基準面設定機能と、
前記設定モードの後に三次元画像処理を行う運用モードにおいて、前記距離画像を、該距離画像の階調数よりも低い階調数の、該距離画像が有する高さ情報を画像の濃淡値に置き換えた低階調距離画像に階調変換するための画像階調変換機能と、
前記低階調距離画像に対して、所定の検査処理を実行するための検査実行機能と
を実現させ、
前記運用モード時に、
前記基準面設定機能は、三次元画像処理装置で三次元画像処理を行う運用時に外部から入力される検査対象物の入力画像に基づいて、前記基準面を設定するよう構成しており、
前記階調変換機能は、前記入力画像の位置補正を行うよう構成しており、
前記距離画像生成機能が、外部から逐次入力される検査対象物の入力画像に基づいて検査対象物の距離画像を逐次生成し、該逐次生成された距離画像の高さ情報に基づいて、基準面を再設定することにより、検査対象物の高さに応じて基準面を変更し、
前記距離画像生成機能が生成した距離画像毎に再設定された基準面の高さを基準として、各距離画像を前記低階調距離画像に変換し、
前記階調変換を行う際に、前記距離画像を用いた位置補正を行うよう構成してなることを特徴とする三次元画像処理プログラム。
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, which is applied to a computer.
Based on a plurality of pattern projection images captured by projecting incident light from an oblique direction with respect to the optical axis of the imaging means as structured illumination of a predetermined projection pattern and acquiring the reflected light reflected by the inspection object. And a distance image generation function that can generate a distance image,
A function to display the distance image generated by the distance image generation function and
In the setting mode for making necessary settings, as a setting function for accepting operations from the user and making various settings, the gradation conversion condition for gradation conversion of the distance image generated by the distance image generation function is set. As the constituent gradation conversion parameters, a reference plane setting function for setting a reference plane as a reference for performing the gradation conversion, and a reference plane setting function.
In the operation mode in which the three-dimensional image processing is performed after the setting mode, the distance image is replaced with the height information of the distance image having a gradation number lower than the gradation number of the distance image with the shading value of the image. Image gradation conversion function for gradation conversion to low gradation distance images
An inspection execution function for executing a predetermined inspection process on the low gradation distance image is realized.
In the operation mode
The reference plane setting function is configured to set the reference plane based on an input image of an inspection object input from the outside at the time of operation in which the three-dimensional image processing device performs three-dimensional image processing.
The gradation conversion function is configured to correct the position of the input image.
The distance image generation function sequentially generates a distance image of the inspection object based on the input image of the inspection object sequentially input from the outside, and based on the height information of the sequentially generated distance image, the reference plane. By resetting, the reference plane can be changed according to the height of the inspection object.
Each distance image is converted into the low gradation distance image based on the height of the reference plane reset for each distance image generated by the distance image generation function.
A three-dimensional image processing program characterized in that it is configured to perform position correction using the distance image when performing the gradation conversion.
請求項17に記載される三次元画像処理プログラムを記録したコンピュータ読み取り可能な記録媒体又は記録した機器。 A computer-readable recording medium or device that records the three-dimensional image processing program according to claim 17.
JP2019070254A 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 Active JP6913705B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2021115017A JP7150105B2 (en) 2013-07-16 2021-07-12 3D image processing device and 3D image processing method

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 Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2014075429A Division 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
JP2021115017A Division JP7150105B2 (en) 2013-07-16 2021-07-12 3D image processing device and 3D image processing method

Publications (2)

Publication Number Publication Date
JP2019105657A JP2019105657A (en) 2019-06-27
JP6913705B2 true JP6913705B2 (en) 2021-08-04

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 Before (1)

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

Family Applications After (1)

Application Number Title Priority Date Filing Date
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)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6611576B2 (en) * 2015-11-30 2019-11-27 キヤノン株式会社 Image processing apparatus and image processing method
JP6540557B2 (en) * 2016-03-07 2019-07-10 オムロン株式会社 Image measurement system and controller
KR101802812B1 (en) * 2016-04-20 2017-11-29 주식회사 고영테크놀러지 Inspecting apparatus for product appearance and inspection method for product appearance using the same
JP6745173B2 (en) * 2016-09-06 2020-08-26 株式会社キーエンス Image inspection apparatus, image inspection method, image inspection program, computer-readable recording medium, and recorded device
JP6946659B2 (en) * 2017-02-22 2021-10-06 オムロン株式会社 Optical displacement sensor and system with it
JP6917780B2 (en) * 2017-05-31 2021-08-11 株式会社キーエンス Image inspection equipment
CN107607548A (en) * 2017-09-29 2018-01-19 青海黄河上游水电开发有限责任公司光伏产业技术分公司 The hidden method for splitting defect of photovoltaic module is detected by 3-D view
JP6802225B2 (en) * 2018-08-31 2020-12-16 ファナック株式会社 Information processing device and information processing method
TWI670467B (en) * 2018-10-15 2019-09-01 立普思股份有限公司 Processing method using depth image detection
JP7378934B2 (en) * 2019-01-29 2023-11-14 キヤノン株式会社 Information processing device, information processing method and system
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
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
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

Family Cites Families (12)

* 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
JP4753711B2 (en) * 2005-12-22 2011-08-24 株式会社キーエンス 3D image display device, 3D image display device operation method, 3D image display program, computer-readable recording medium, and recorded device
JP2007206797A (en) 2006-01-31 2007-08-16 Omron Corp Image processing method and image processor
JP2009163717A (en) * 2007-12-10 2009-07-23 Fujifilm Corp Distance image processing apparatus and method, distance image reproducing apparatus and method, and program
US20090148038A1 (en) * 2007-12-10 2009-06-11 Youichi Sawachi Distance image processing apparatus and method
JP5147650B2 (en) * 2007-12-10 2013-02-20 富士フイルム株式会社 Distance image processing apparatus and method, distance image reproduction apparatus and method, and program
JP4998956B2 (en) * 2007-12-10 2012-08-15 富士フイルム株式会社 Distance image processing apparatus and method, distance image reproduction apparatus and method, and program
JP5218177B2 (en) * 2009-03-13 2013-06-26 オムロン株式会社 Image processing apparatus and method
KR101762158B1 (en) 2009-12-11 2017-07-27 다이이치지쯔교 비스위루 가부시키가이샤 Appearance inspection device
JP5564348B2 (en) * 2010-07-15 2014-07-30 株式会社キーエンス Image processing apparatus and appearance inspection method
US9013469B2 (en) * 2011-03-04 2015-04-21 General Electric Company Method and device for displaying a three-dimensional view of the surface of a viewed object

Also Published As

Publication number Publication date
JP2021177186A (en) 2021-11-11
JP2019105657A (en) 2019-06-27
JP6506914B2 (en) 2019-04-24
JP2015038466A (en) 2015-02-26
JP7150105B2 (en) 2022-10-07

Similar Documents

Publication Publication Date Title
JP6913705B2 (en) 3D image processing equipment, 3D image processing methods and 3D image processing programs, computer-readable recording media and recording equipment
JP6270361B2 (en) 3D image processing apparatus, 3D image processing method, 3D image processing program, computer-readable recording medium, and recorded apparatus
JP6242098B2 (en) 3D image processing apparatus, 3D image processing method, 3D image processing program, computer-readable recording medium, and recorded apparatus
JP6745173B2 (en) Image inspection apparatus, image inspection method, image inspection program, computer-readable recording medium, and recorded device
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
JP6246513B2 (en) 3D image processing apparatus, 3D image processing method, 3D image processing program, computer-readable recording medium, and recorded apparatus
JP5564348B2 (en) Image processing apparatus and appearance inspection method
JP5758090B2 (en) Shape inspection apparatus and shape inspection method
JP6256249B2 (en) Measuring device, substrate inspection device, and control method thereof
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
JP2015021763A (en) Three-dimensional image processor, three-dimensional image processing method, three-dimensional image processing program, and computer-readable 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
JP4563184B2 (en) Method and apparatus for inspecting mura defect
JP2006086451A (en) Substrate-inspection device, and method and device for setting parameter
JP2018205001A (en) Image inspection device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190401

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190516

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200616

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200803

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20201201

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210118

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210712

R150 Certificate of patent or registration of utility model

Ref document number: 6913705

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150