JP2011128878A - Image processor, image processing method, computer program for the same, and recording medium with program recorded thereon - Google Patents
Image processor, image processing method, computer program for the same, and recording medium with program recorded thereon Download PDFInfo
- Publication number
- JP2011128878A JP2011128878A JP2009286599A JP2009286599A JP2011128878A JP 2011128878 A JP2011128878 A JP 2011128878A JP 2009286599 A JP2009286599 A JP 2009286599A JP 2009286599 A JP2009286599 A JP 2009286599A JP 2011128878 A JP2011128878 A JP 2011128878A
- Authority
- JP
- Japan
- Prior art keywords
- inspection
- line
- area
- target
- point
- 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.)
- Withdrawn
Links
Images
Landscapes
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
【課題】高速に検査対象を含んだ検査領域を求めることが可能な画像処理装置を提供すること。
【解決手段】検査対象判定部33は、間引き量に応じて画像データに測定点を設定し、それぞれの測定点のRGBの輝度値に応じて検査対象の候補点であるか否かを判定する。検査ライン設定部34は、検査対象判定部33によって候補点と判定された測定点が存在するラインを検査ラインに設定する。検査領域拡大部35は、検査ライン設定部34によって設定された検査ラインに応じて検査領域を拡大する。そして、検査領域判別部36は、検査領域拡大部35によって拡大された検査領域が検査対象を含む検査領域であるか否かを特徴量に応じて判別する。したがって、高速に検査対象を含んだ検査領域を求めることが可能となる。
【選択図】図3An image processing apparatus capable of obtaining an inspection area including an inspection object at high speed is provided.
An inspection object determination unit 33 sets a measurement point in image data according to a thinning amount, and determines whether or not it is a candidate point to be inspected according to an RGB luminance value of each measurement point. . The inspection line setting unit 34 sets a line in which a measurement point determined as a candidate point by the inspection target determination unit 33 exists as an inspection line. The inspection area enlargement unit 35 enlarges the inspection area according to the inspection line set by the inspection line setting unit 34. Then, the inspection area determination unit 36 determines whether or not the inspection area enlarged by the inspection area enlargement unit 35 is an inspection area including an inspection object according to the feature amount. Therefore, it is possible to obtain an inspection area including an inspection object at high speed.
[Selection] Figure 3
Description
本発明は、位置検出などに利用される画像処理技術に関し、特に、高速に検査対象を含む領域を決定する画像処理装置、画像処理方法、そのコンピュータ・プログラムおよびプログラムを記録した記録媒体に関する。 The present invention relates to an image processing technique used for position detection and the like, and more particularly, to an image processing apparatus, an image processing method, a computer program thereof, and a recording medium on which a program is recorded.
近年、電子部品の実装、検査など、様々な分野で画像処理技術が利用されている。たとえば、カメラやビデオで撮像した映像をデータ化し、その画像データから所望のパターン画像を探し出し、位置決めなどの用途に利用されている。 In recent years, image processing techniques have been used in various fields such as mounting and inspection of electronic components. For example, video captured by a camera or video is converted into data, a desired pattern image is searched from the image data, and used for positioning and the like.
このような技術の1つに、パターンマッチングを用いた方法がある。通常、画像データの対象処理領域を全て走査して、パターンマッチングが行なわれることが多い。パターンマッチング処理、たとえば正規化相関処理においては、1回あたりのマッチング処理における計算量が多いため、マッチング回数が増えると処理時間も増える傾向にある。CCD(Charge Coupled Device)カメラが高画素化している現在、処理時間の増加がさらに深刻な問題となる。 One of such techniques is a method using pattern matching. In general, pattern matching is often performed by scanning the entire target processing area of image data. In pattern matching processing, for example, normalized correlation processing, since the amount of calculation in one matching processing is large, the processing time tends to increase as the number of matching increases. Now that CCD (Charge Coupled Device) cameras have increased in pixel count, an increase in processing time becomes a more serious problem.
特許文献1は、パターンマッチング処理において処理対象外の領域を適切に設定することを目的とする。パターンマッチングにおける処理領域設定方法は、パターン領域を移動させる段階でパターン領域が対象領域とマスク領域にまたがるとき、パターン領域とマスク領域との重なりの程度に基づいて処理条件を設定する。移動したパターン領域がマスク領域と重なりを有する位置にあるとき、その位置における重なりの面積比を計算して、この値が所定の比よりも大きいとき処理の対象外とする。あるいはパターン領域が対象領域からいくらはみ出たかを座標で表し、所定の値までを処理対象とする。このようにして決定された処理対象となる領域をテンプレート領域として、フラグを設定する。
上述の特許文献1は、画像データから必要な領域のみを抽出してマッチング処理を行なうことによりマッチングの回数を減らして、計算量を減らすものである。しかしながら、パターン領域がマスク領域とスキャン領域との2箇所にまたがったときの判定をマッチング毎に処理しているため、計算量が多くなる。
In the above-mentioned
また、画像内で検査対象の位置や姿勢がばらついた場合、マスク領域にパターン領域が設定量以上重なってしまい、上述の判定方法ではマッチングしない領域と判定されてしまうことがあり、検査対象を正確に抽出することができないといった問題点があった。 In addition, if the position and orientation of the inspection target vary in the image, the pattern area may overlap the mask area by a set amount or more, and the above determination method may determine that the area is not matched. There was a problem that it could not be extracted.
本発明は、上記問題点を解決するためになされたものであり、その目的は、高速に検査対象を含んだ検査領域を求めることが可能な画像処理装置、画像処理方法、そのコンピュータ・プログラムおよびプログラムを記録した記録媒体を提供することである。 The present invention has been made to solve the above-described problems, and an object of the present invention is to provide an image processing apparatus, an image processing method, a computer program thereof, and an image processing apparatus capable of obtaining an inspection area including an inspection object at high speed. It is to provide a recording medium on which a program is recorded.
本発明のある局面に従えば、画像データから検査対象を含んだ検査領域を検出する画像処理装置であって、間引き量に応じて画像データに測定点を設定し、それぞれの測定点のRGB値に応じて検査対象の候補点であるか否かを判定する検査対象判定手段と、検査対象判定手段によって候補点と判定された測定点が存在するラインを検査ラインに設定する検査ライン設定手段と、検査ライン設定手段によって設定された検査ラインに応じて検査領域を拡大する検査領域拡大手段と、検査領域拡大手段によって拡大された検査領域が検査対象を含む検査領域であるか否かを判別する検査領域判別手段とを含む。 According to one aspect of the present invention, there is provided an image processing apparatus for detecting an inspection region including an inspection object from image data, wherein measurement points are set in the image data according to a thinning amount, and RGB values of the respective measurement points are set. An inspection target determining means for determining whether or not a candidate point is an inspection target, and an inspection line setting means for setting a line in which a measurement point determined as a candidate point by the inspection target determining means exists as an inspection line Determining whether the inspection area is enlarged according to the inspection line set by the inspection line setting means, and whether the inspection area enlarged by the inspection area enlargement means is an inspection area including an inspection object. Inspection area discrimination means.
好ましくは、検査対象判定手段は、測定点のRGBの輝度値に応じて検査対象の候補点であるか否かを判定する。 Preferably, the inspection object determination unit determines whether or not the inspection object candidate point is in accordance with the RGB luminance values of the measurement points.
好ましくは、検査対象判定手段は、測定点の色相値に応じて検査対象の候補点であるか否かを判定する。 Preferably, the inspection object determination unit determines whether or not the inspection object candidate point is in accordance with the hue value of the measurement point.
好ましくは、検査ライン設定手段は、検査対象外の測定点から検査対象の候補点に変化するときの当該検査対象外の測定点を立ち上がり点とし、検査対象の候補点から検査対象外の測定点に変化するときの当該検査対象外の点を立ち下がり点とし、立ち上がり点から立ち下がり点までを検査ラインとする。 Preferably, the inspection line setting means uses the measurement point outside the inspection target when the measurement point changes from the non-inspection measurement point to the inspection target candidate point, and sets the measurement point outside the inspection target from the inspection target candidate point. The point that is not subject to the inspection when the point changes to the falling point is set as the falling point, and the point from the rising point to the falling point is set as the inspection line.
さらに好ましくは、検査ライン設定手段は、対象の検査ラインの範囲内において、1ピッチ上の検査ラインの始点または終点が存在する場合には、1ピッチ上の検査ラインと同じ属性を対象の検査ラインに与え、1ピッチ上の検査ラインの始点または終点が存在しない場合には、1ピッチ上の検査ラインと異なる属性を対象の検査ラインに与えて異なる検査対象とする。 More preferably, the inspection line setting means sets the same attribute as the inspection line on the one pitch when the start point or the end point of the inspection line on the one pitch exists within the range of the target inspection line. When there is no start point or end point of the inspection line on one pitch, an attribute different from that on the inspection line on one pitch is given to the target inspection line to be a different inspection target.
好ましくは、検査領域拡大手段は、対象の検査ラインが最上行のラインであれば、対象の検査ラインの範囲を検査領域の横方向とし、対象の検査ラインの検査領域を1画素上から、1ピッチ−2画素分だけ上に拡大し、対象の検査ラインが最上行のラインでなければ、対象の検査ラインの範囲と1ピッチ上の検査ラインの範囲とを比較し、広い範囲の分だけ検査領域を横方向に拡大し、対象の検査ラインの検査領域を1画素上から、1ピッチ−2画素分だけ上に拡大し、対象の検査ラインが最下行のラインであれば、対象の検査ラインの範囲を検査領域の横方向とし、対象の検査ラインの検査領域を1画素下から、1ピッチ−2画素分だけ下に拡大し、拡大された検査領域をすべて含む最小矩形領域を最終的な検査領域とする。 Preferably, if the target inspection line is the uppermost line, the inspection area enlarging means sets the range of the target inspection line as the horizontal direction of the inspection area, and sets the inspection area of the target inspection line from 1 pixel to 1 If the target inspection line is not the top line, the target inspection line is compared with the inspection line one pitch up, and the inspection is performed over a wide range. The area is expanded in the horizontal direction, the inspection area of the target inspection line is expanded from one pixel up by one pitch-2 pixels, and if the target inspection line is the bottom line, the target inspection line The inspection area of the target inspection line is enlarged from one pixel below by one pitch-2 pixels below, and the smallest rectangular area including all the enlarged inspection areas is finally obtained. The inspection area.
好ましくは、間引き量は、横方向と縦方向とで別々の値が設定される。
好ましくは、検査領域判別手段は、検査対象の面積値を特徴量として、検査領域拡大手段によって拡大された検査領域が検査対象を含む検査領域であるか否かを判別する。
Preferably, different values are set for the thinning-out amount in the horizontal direction and the vertical direction.
Preferably, the inspection region determination unit determines whether the inspection region enlarged by the inspection region enlargement unit is an inspection region including the inspection target, using the area value of the inspection target as a feature amount.
好ましくは、検査領域判別手段は、検査対象の縦横比を特徴量として、検査領域拡大手段によって拡大された検査領域が検査対象を含む検査領域であるか否かを判別する。 Preferably, the inspection area determination unit determines whether the inspection area enlarged by the inspection area enlargement unit is an inspection area including the inspection object, using the aspect ratio of the inspection object as a feature amount.
好ましくは、検査領域判別手段は、検査対象の対角線長さを特徴量として、検査領域拡大手段によって拡大された検査領域が検査対象を含む検査領域であるか否かを判別する。 Preferably, the inspection area determination unit determines whether or not the inspection area enlarged by the inspection area enlargement unit is an inspection area including the inspection object, using the diagonal length of the inspection object as a feature amount.
好ましくは、検査対象内に複数の色が存在する場合には、所定の色に応じて検査領域を求めた後、検査領域拡大手段は、検査対象の大きさまたは形状に応じて、検査領域をさらに拡大する。 Preferably, when there are a plurality of colors in the inspection object, after obtaining the inspection area according to the predetermined color, the inspection area enlarging means sets the inspection area according to the size or shape of the inspection object. Expand further.
本発明の別の局面に従えば、画像データから検査対象を含んだ検査領域をコンピュータに検出させる画像処理方法であって、コンピュータに、間引き量に応じて画像データに測定点を設定させ、それぞれの測定点のRGB値に応じて検査対象の候補点であるか否かを判定させるステップと、候補点と判定された測定点が存在するラインを検査ラインに設定させるステップと、設定された検査ラインに応じて検査領域を拡大させるステップと、拡大された検査領域が検査対象を含む検査領域であるか否かを判別させるステップとを含む。 According to another aspect of the present invention, there is provided an image processing method for causing a computer to detect an inspection region including an inspection object from image data, and causing a computer to set measurement points in image data according to a thinning amount, A step of determining whether or not a candidate point to be inspected according to an RGB value of the measurement point, a step of setting a line in which the measurement point determined to be a candidate point exists as an inspection line, and a set inspection The method includes a step of enlarging the inspection region according to the line and a step of determining whether or not the enlarged inspection region is an inspection region including an inspection object.
本発明のさらに別の局面に従えば、画像データから検査対象を含んだ検査領域をコンピュータに検出させるためのコンピュータ・プログラムであって、コンピュータに、間引き量に応じて画像データに測定点を設定させ、それぞれの測定点のRGB値に応じて検査対象の候補点であるか否かを判定させるステップと、候補点と判定された測定点が存在するラインを検査ラインに設定させるステップと、設定された検査ラインに応じて検査領域を拡大させるステップと、拡大された検査領域が検査対象を含む検査領域であるか否かを判別させるステップとを含む。 According to still another aspect of the present invention, there is provided a computer program for causing a computer to detect an inspection area including an inspection object from image data, and setting a measurement point in the image data according to a thinning amount in the computer A step of determining whether or not a candidate point to be inspected according to the RGB value of each measurement point, a step of setting a line in which a measurement point determined to be a candidate point exists as an inspection line, and setting A step of enlarging the inspection region in accordance with the inspection line that has been made, and a step of determining whether or not the enlarged inspection region is an inspection region including an inspection object.
本発明のさらに別の局面に従えば、画像データから検査対象を含んだ検査領域をコンピュータに検出させるためのコンピュータ・プログラムを記録した記録媒体であって、コンピュータに、間引き量に応じて画像データに測定点を設定させ、それぞれの測定点のRGB値に応じて検査対象の候補点であるか否かを判定させるステップと、候補点と判定された測定点が存在するラインを検査ラインに設定させるステップと、設定された検査ラインに応じて検査領域を拡大させるステップと、拡大された検査領域が検査対象を含む検査領域であるか否かを判別させるステップとを含む。 According to still another aspect of the present invention, there is provided a recording medium on which a computer program for causing a computer to detect an inspection area including an inspection object from image data is recorded. To set measurement points, and to determine whether or not a candidate point to be inspected according to the RGB value of each measurement point, and to set a line in which the measurement point determined to be a candidate point exists as an inspection line A step of enlarging the inspection region according to the set inspection line, and a step of determining whether or not the enlarged inspection region is an inspection region including an inspection object.
本発明のある局面によれば、検査対象判定手段が、間引き量に応じて画像データに測定点を設定し、それぞれの測定点のRGB値に応じて検査対象の候補点であるか否かを判定するので、高速に検査領域を求めることが可能となる。 According to an aspect of the present invention, the inspection object determination unit sets a measurement point in the image data according to the thinning amount, and determines whether or not the inspection object candidate point is according to the RGB value of each measurement point. Since the determination is made, the inspection area can be obtained at high speed.
また、検査対象判定手段が、測定点のRGBの輝度値に応じて検査対象の候補点であるか否かを判定するので、明るさの変化に応じて検査領域を判定することが可能となる。 In addition, since the inspection target determination unit determines whether or not the inspection target candidate point is based on the RGB luminance values of the measurement points, it is possible to determine the inspection region according to the change in brightness. .
また、検査対象判定手段が、測定点の色相値に応じて検査対象の候補点であるか否かを判定するので、明るさの変化に応じて検査領域を判定することが可能となる。 In addition, since the inspection target determination unit determines whether or not the inspection target candidate point is based on the hue value of the measurement point, it is possible to determine the inspection region according to the change in brightness.
また、検査ライン設定手段が、検査対象外の測定点から検査対象の候補点に変化するときの当該検査対象外の測定点を立ち上がり点とし、検査対象の候補点から検査対象外の測定点に変化するときの当該検査対象外の点を立ち下がり点とし、立ち上がり点から立ち下がり点までを検査ラインとするので、検査領域の検出を容易に行なうことが可能となる。 In addition, when the inspection line setting means changes from a measurement point that is not the inspection target to a candidate point that is the inspection target, the measurement point that is not the inspection target is set as the rising point, and the measurement point that is not the inspection target is changed to the measurement point that is not the inspection target. Since the point that is not subject to inspection at the time of the change is set as the falling point and the point from the rising point to the falling point is set as the inspection line, the inspection area can be easily detected.
また、検査ライン設定手段が、対象の検査ラインの範囲内において、1ピッチ上の検査ラインの始点または終点が存在する場合には、1ピッチ上の検査ラインと同じ属性を対象の検査ラインに与え、1ピッチ上の検査ラインの始点または終点が存在しない場合には、1ピッチ上の検査ラインと異なる属性を対象の検査ラインに与えて異なる検査対象とするので、画像データに複数の検査対象が含まれる場合でも、それぞれの検査対象を含んだ検査領域を検出することが可能となる。 Further, when the inspection line setting means has the start point or the end point of the inspection line on one pitch within the range of the target inspection line, the inspection line setting means gives the same inspection line as the inspection line on the one pitch to the target inspection line. When the start point or end point of the inspection line on one pitch does not exist, an attribute different from that on the inspection line on one pitch is given to the target inspection line to make it a different inspection target. Even if included, it is possible to detect an inspection region including each inspection object.
また、検査領域拡大手段が、拡大された検査領域をすべて含む最小矩形領域を最終的な検査領域とするので、検査領域を正確に特定することが可能となる。 Further, since the inspection area enlarging means sets the minimum rectangular area including all the enlarged inspection areas as the final inspection area, the inspection area can be accurately specified.
また、間引き量が、横方向と縦方向とで別々の値が設定されるので、様々な形状の検査対象を容易に検出することが可能となる。 In addition, since different values are set for the thinning amount in the horizontal direction and the vertical direction, it is possible to easily detect inspection objects having various shapes.
また、検査領域判別手段が、検査対象の面積値を特徴量として、検査領域拡大手段によって拡大された検査領域が検査対象を含む検査領域であるか否かを判別するので、検査対象を含んだ検査領域であるか否かを容易に判別することが可能となる。 In addition, since the inspection area determination means determines whether the inspection area enlarged by the inspection area enlargement means is an inspection area including the inspection object by using the area value of the inspection object as a feature amount, the inspection area is included. It is possible to easily determine whether or not it is an inspection area.
また、検査領域判別手段が、検査対象の縦横比を特徴量として、検査領域拡大手段によって拡大された検査領域が検査対象を含む検査領域であるか否かを判別するので、検査対象を含んだ検査領域であるか否かを容易に判別することが可能となる。 In addition, since the inspection area determination means determines whether the inspection area enlarged by the inspection area enlargement means is an inspection area including the inspection object by using the aspect ratio of the inspection object as a feature amount, the inspection area is included. It is possible to easily determine whether or not it is an inspection area.
また、検査領域判別手段が、検査対象の対角線長さを特徴量として、検査領域拡大手段によって拡大された検査領域が検査対象を含む検査領域であるか否かを判別するので、検査対象を含んだ検査領域であるか否かを容易に判別することが可能となる。 Further, since the inspection area determination means determines whether the inspection area enlarged by the inspection area enlargement means is an inspection area including the inspection object by using the diagonal length of the inspection object as a feature amount, the inspection area is included. It is possible to easily determine whether or not the inspection area.
また、検査対象内に複数の色が存在する場合には、所定の色に応じて検査領域を求めた後、検査領域拡大手段が、検査対象の大きさまたは形状に応じて、検査領域をさらに拡大するので、検査対象内に複数の色が存在する場合でも、検査対象を含んだ検査領域を容易に検出することが可能となる。 In addition, when there are a plurality of colors in the inspection object, after obtaining the inspection area according to the predetermined color, the inspection area enlarging means further adds the inspection area according to the size or shape of the inspection object. Since the image is enlarged, even when there are a plurality of colors in the inspection target, it is possible to easily detect the inspection region including the inspection target.
図1は、本発明の実施の形態における画像処理装置を用いた検査システムの構成例を示す図である。この検査システムは、画像処理装置1と、カメラ2と、カメラ2に固定された光学系3と、被検査対象である製品4が搭載される搭載ステージ5とを含む。
FIG. 1 is a diagram illustrating a configuration example of an inspection system using an image processing apparatus according to an embodiment of the present invention. This inspection system includes an
搭載ステージ5の上に搭載された製品4の真上に、光学系3が製品4の方向を向くようにカメラ2が固定されている。光学系3には、図示しないレンズおよび照明装置が装備されている。
The
画像処理装置1はカメラ2に接続されており、カメラ2によって撮像された画像を取り込み、その画像データを処理する。
The
図2は、本発明の実施の形態における画像処理装置1のハードウェア構成の一例を示すブロック図である。この画像処理装置1は、一般的なコンピュータによって実現され、コンピュータ本体11と、ディスプレイ装置12と、FD(Flexible Disk)14が装着されるFDドライブ13と、キーボード15と、マウス16と、CD−ROM(Compact Disc-Read Only Memory)18が装着されるCD−ROM装置17と、ネットワーク通信装置19とを含む。
FIG. 2 is a block diagram illustrating an example of a hardware configuration of the
画像処理プログラムは、FD14またはCD―ROM18等の記録媒体によって供給される。画像処理プログラムはコンピュータ本体11によって実行され、画像処理が行なわれる。また、画像処理プログラムは他のコンピュータより通信回線を経由し、コンピュータ本体11に供給されてもよい。
The image processing program is supplied by a recording medium such as the
なお、記録媒体はFD14、CD−ROM18に限定されるものではなく、磁気テープ、MO(Magnetic Optical disk)、MD(Mini Disc)、DVD(Digital Versatile Disc)、IC(Integrated Circuit)カードなどであってもよい。
The recording medium is not limited to the
また、コンピュータ本体11は、CPU20、ROM(Read Only Memory)21、RAM(Random Access Memory)22およびハードディスク23を含む。CPU20は、ディスプレイ装置12、FDドライブ13、キーボード15、マウス16、CD−ROM装置17、ネットワーク通信装置19、ROM21、RAM22またはハードディスク23との間でデータを入出力しながら処理を行なう。FD14またはCD−ROM18に記録された画像処理プログラムは、CPU20によりFDドライブ13またはCD−ROM装置17を介してハードディスク23に格納される。CPU20は、ハードディスク23から適宜画像処理プログラムをRAM22にロードして実行することによって画像処理を行なう。
The computer
図3は、本発明の実施の形態における画像処理装置1を機能的構成によって示したブロック図である。この画像処理装置1は、閾値設定部31と、サーチ間隔設定部32と、検査対象判定部33と、検査ライン設定部34と、検査領域拡大部35と、検査領域判別部36とを含む。
FIG. 3 is a block diagram showing a functional configuration of the
閾値設定部31は、検査対象の一部であるか否かを判定する際に用いられるRGBの輝度値の範囲、および検査対象であるか否かを判定する際に用いられる特徴量の範囲を閾値として設定する。なお、本実施の形態においては、特徴量として検査対象の面積値を用いるものとする。
The threshold
サーチ間隔設定部32は、画像データをサーチするときの間引き量を設定する。この間引き量は、検査対象の大きさまたは形状に応じて設定され、必ず検査対象の一部に測定点が当たるように設定される。ここで、測定点とは、画像データの中で検査対象の一部であるか否かが判定される画素のことであり、X軸方向およびY軸方向に、間引き量ごとに設定される。
The search
検査対象判定部33は、画像データに測定点を設定し、それぞれの測定点が検査対象の候補点であるか否かを判定する。検査ライン設定部34は、検査対象判定部33によって検査対象の候補点であると判定された点に基づいて検査ラインを設定する。
The inspection
検査領域拡大部35は、検査ライン設定部34によって設定された検査ラインを含むように検査領域を拡大する。検査領域判別部36は、検査領域拡大部35によって拡大された検査領域の面積値が、閾値設定部31によって設定された面積値の範囲内であるか否かによって、その検査領域が検査範囲であるか否かを判定する。
The inspection
図4は、本発明の実施の形態における画像処理装置の処理手順を説明するためのフローチャートである。まず、閾値設定部31は、判定用閾値(RGBの輝度値の範囲)、および面積値(特徴量)の範囲を閾値として設定する(S1)。そして、サーチ間隔設定部32は、画像データをサーチするときの間引き量(ピッチ量)Lx,Lyを設定する(S2)。
FIG. 4 is a flowchart for explaining the processing procedure of the image processing apparatus according to the embodiment of the present invention. First, the threshold
図5は、検査対象およびピッチ量Lx,Lyを説明するための図である。図5(a)は、画像データ41内に存在する検査対象42を示している。検査対象42の大きさ、形状などは予め判っているものとする。
FIG. 5 is a diagram for explaining the inspection target and the pitch amounts Lx and Ly. FIG. 5A shows the
図5(b)は、サーチ間隔設定部32によって設定されるピッチ量Lx,Lyを示している。図5(b)に示すように、測定点43が黒点で表されており、X軸方向にLxの間隔で、Y軸方向にLyの間隔で設定される。このピッチ量Lx,Lyは、検査対象42の大きさまたは形状に応じて設定され、検査対象の一部に必ず測定点43が当たるように設定される。
FIG. 5B shows the pitch amounts Lx and Ly set by the search
次に、検査対象判定部33は、測定点43のそれぞれのRGBの輝度値が閾値の範囲内であるか否かによって、測定点43のそれぞれが検査対象42の候補点であるか否かを判定する(S3)。
Next, the inspection
測定点43のRGBの輝度値が閾値の範囲内であれば(S3,Yes)、その測定点43を検査対象42の候補点とする(S4)。また、測定点43のRGBの輝度値が閾値の範囲内になければ(S3,No)、その測定点43を対象候補外とする(S5)。
If the RGB luminance value of the
次に、検査ライン設定部34は、検査対象判定部33によって検査対象42の候補点と判定された点に基づき、1行毎の立ち上がり点から立ち下がり点までを検査ラインとし、その両端の点のX座標とその範囲Ziとを記憶する(S6)。このとき、検査ラインに対してナンバリングを行なう。
Next, the inspection
図6は、検査ライン設定部34によって設定された検査ラインを説明するための図である。図6において、点44aが立ち上がり点であり、検査対象外の点から候補点に変化するときの、当該検査対象外の点を立ち上がり点44aとする。また、点44bが立ち下がり点であり、候補点から検査対象外の点に変化するときの、当該検査対象外の点を立ち下がり点44bとする。したがって、点44aから点44bまでの斜線を施したライン45が検査ラインとなる。
FIG. 6 is a diagram for explaining the inspection line set by the inspection
次に、検査ライン設定部34は、ナンバリングされた検査ラインの全てに対して、その検査ラインの範囲Zi内において、1ピッチだけ上の検査ラインの始点または終点が存在するか否かによって同じ属性を割り当てるか否かを判定する(S7)。
Next, the inspection
検査ラインの範囲Zi内において、1ピッチだけ上の検査ラインの始点または終点が存在する場合には(S7,Yes)、その検査ラインに対して1ピッチ上の検査ラインと同じ属性(前属性)L1を割り当てる(S8)。また、1ピッチだけ上の検査ラインの始点および終点のいずれも存在しない場合には(S7,No)、新規属性L2を割り当てる(S9)。なお、同じ属性L1を有する検査ラインは同じ検査対象42に含まれるものとし、新規属性L2を有する検査ラインは異なる検査対象42に含まれるものと判定する。
If there is a start point or end point of an inspection line that is one pitch higher in the inspection line range Zi (Yes in S7), the same attribute (previous attribute) as the inspection line one pitch higher than that inspection line L1 is assigned (S8). If neither the start point nor the end point of the inspection line that is one pitch higher is present (S7, No), the new attribute L2 is assigned (S9). It is determined that inspection lines having the same attribute L1 are included in the
図7は、属性を設定した検査ラインを示す図である。図7に示すように、ステップS7〜S9の処理によって、左側の2つの検査ラインが同じ検査対象の検査ラインであると判定されて属性L1が付され、右側の1つの検査ラインが異なる検査対象の検査ラインであると判定されて属性L2が付されている。 FIG. 7 is a diagram illustrating an inspection line in which attributes are set. As shown in FIG. 7, by the processing of steps S7 to S9, it is determined that the two left inspection lines are the same inspection target inspection lines, the attribute L1 is attached, and the right one inspection line is different inspection target. And the attribute L2 is attached.
次に、検査領域拡大部35は、検査ライン設定部34によって同じ属性がラベリングされた検査ライン群の中で、現在の検査ラインが最も上の行であるか否かを判定する(S10)。現在の検査ラインが最上行であれば(S10,Yes)、現在の検査ラインの範囲Ziを検査範囲の横方向とし、現在の検査ラインの1画素上から(1ピッチ−2画素)分だけ検査領域を上に広げる(S11)。
Next, the inspection
また、現在の検査ラインが最上行でなければ(S10,No)、現在の検査ラインの両端のX座標と、1ピッチ上の検査ラインの両端のX座標とを比較し、2つの検査ラインの広い方の範囲Zj分だけ検査領域を横に広げ、現在の検査ラインの1画素上から(1ピッチ−2画素)分だけ検査領域を上に広げる(S12)。 If the current inspection line is not the top line (S10, No), the X coordinates of both ends of the current inspection line are compared with the X coordinates of both ends of the inspection line on one pitch, and the two inspection lines are compared. The inspection area is expanded laterally by the wider range Zj, and the inspection area is expanded upward by one pixel (1 pitch-2 pixels) from the current inspection line (S12).
そして、検査領域拡大部35は、現在の検査ラインが最も下の行であるか否かを判定する(S13)。現在の検査ラインが最下行でなければ(S13,No)、ステップS8に戻って以降の処理を繰り返す。
Then, the inspection
また、現在の検査ラインが最下行であれば(S13,Yes)、現在の検査ラインの範囲Ziを検査範囲の横方向とし、現在の検査ラインの1画素下から(1ピッチ−2画素)分だけ検査領域を下に広げる(S14)。 If the current inspection line is the bottom line (S13, Yes), the current inspection line range Zi is set to the horizontal direction of the inspection range, and one pixel below (1 pitch-2 pixels) from the current inspection line. Only the inspection area is expanded downward (S14).
次に、属性を有する検査ライン全てについて検査範囲を設定したか否かを判定する(S15)。検査範囲を設定していない検査ラインがあれば(S15,No)、ステップS7に戻って以降の処理を繰り返す。また、検査ライン全てについて検査範囲を設定していれば(S15,Yes)、同じ属性を有する検査領域全てを含む最小矩形領域を最終的な検査領域とする(S16)。この処理は、属性毎に行なわれる。 Next, it is determined whether or not inspection ranges have been set for all inspection lines having attributes (S15). If there is an inspection line for which no inspection range is set (S15, No), the process returns to step S7 and the subsequent processing is repeated. If the inspection range is set for all the inspection lines (S15, Yes), the smallest rectangular area including all the inspection areas having the same attribute is set as the final inspection area (S16). This process is performed for each attribute.
図8は、検査領域が設定された画像データの一例を示す図である。領域A1は、同じ属性L1が付された最上行の検査ラインに設定された検査領域を示している。領域A2は、同じ属性L1が付された下の検査ラインに設定された検査領域を示している。また、この検査ラインは最下行の検査ラインでもあるため、その下に検査領域Bが設定される。 FIG. 8 is a diagram illustrating an example of image data in which an inspection area is set. An area A1 indicates an inspection area set in the uppermost inspection line with the same attribute L1. An area A2 indicates an inspection area set in the lower inspection line having the same attribute L1. Further, since this inspection line is also the lowermost inspection line, an inspection region B is set below the inspection line.
領域C1は、検査領域A1,A2およびBを含む最小矩形領域を示しており、この領域C1が最終的な検査領域とされる。なお、異なる属性L2を有する検査ラインには異なる検査領域C2が設定される。 A region C1 indicates a minimum rectangular region including the inspection regions A1, A2, and B, and this region C1 is a final inspection region. Note that different inspection areas C2 are set for inspection lines having different attributes L2.
次に、検査領域判別部36は、属性毎の検査領域の面積値(特徴量)が設定範囲内にあるか否かを判定する(S17)。検査領域の面積値が閾値設定部31によって設定された閾値の範囲内でなければ(S17,No)、その検査領域を検査範囲外の領域とする(S19)。
Next, the inspection
また、検査領域の面積値が閾値の範囲内であれば(S17,Yes)、その検査領域を検査範囲とする(S18)。そして、判定していない検査領域があれば(S20,No)、ステップS17に戻って以降の処理を繰り返す。また、すべての検査領域の判定が終了していれば(S20,Yes)、処理を終了する。 If the area value of the inspection region is within the threshold range (S17, Yes), the inspection region is set as the inspection range (S18). If there is an inspection area that has not been determined (S20, No), the process returns to step S17 and the subsequent processing is repeated. If all the inspection areas have been determined (S20, Yes), the process ends.
以上の処理によって、画像データ41において検査対象42の位置や姿勢がばらついたとしても、検査領域(検査範囲)C1を高速に自動で決定することができる。
With the above processing, even if the position and orientation of the
以上の説明においては、RGBの輝度値を判定基準としたが、色相値を判定基準として用いるようにすれば、画像データ41の明るさの変化に影響を受けずに検査範囲を決定できるようになる。この場合、RGB値から色相値を求めるための計算が必要になるが、予めRGB値に対応する色相値を求めてLUT(ルックアップテーブル)に格納しておくことで、計算を行なわずに高速に色相値を求めることができる。
In the above description, the RGB luminance value is used as the determination criterion. However, if the hue value is used as the determination criterion, the inspection range can be determined without being affected by the change in the brightness of the
また、間引き量Lx,Lyは、検査対象42の大きさや形状に応じて、同じ値を用いたり、異なる値を用いたりすることができる。
Further, the thinning amounts Lx and Ly can use the same value or different values depending on the size and shape of the
また、検査対象42と色は似ているが、大きさや形状が異なるものが画像データ41内に存在する場合であっても、検査対象42であるか否かを判定できるように検査対象42の面積値を用いて判定するようにしたが、検査対象の画像の縦横比や対角線長さ、またはこれらの組み合わせを用いるようにしてもよい。
In addition, even if there is something in the
また、検査対象42の中に複数の色が存在する場合も考えられる。図9は、検査対象42に複数の色が存在する場合の検査領域を求める方法を説明するための図である。図9(a)に示すように、検査対象42に2色の画像が存在する場合を考える。
Further, there may be a case where a plurality of colors exist in the
まず、画像データ41内において色の頻度が少ない、または他に存在しない色を1つ選択する。図9(a)においては、黒で示す画像の色が選択されたとする。そして、選択された色をRGBの特徴量として検査領域をサーチすると、図9(b)に示すような検査領域Ciが求められる。そして、図9(c)に示すように、検査対象42の大きさや形状に応じて、検査領域Ciをさらに広げるようにすればよい。
First, one color having a low color frequency or no other color in the
以上説明したように、本実施の形態における画像処理装置によれば、画像データをサーチするときの間引き量Lx,Lyを設定し、画像データ41の一部の測定点43のみのデータを用いて検査領域Ciを求めるようにしたので、高速に検査領域Ciを求めることが可能となった。
As described above, according to the image processing apparatus of the present embodiment, the thinning-out amounts Lx and Ly when searching for image data are set, and data of only some measurement points 43 of the
また、測定点43の間引き量を、検査対象42の大きさや形状に応じて横方向と縦方向とで別々の値(Lx,Ly)を設定できるようにしたので、画像データ41内における検査対象42の位置や姿勢がばらついていたとしても、検査対象42を容易に検出することが可能となった。
Further, since the thinning amount of the
また、検査対象42と色が似ている他の領域が存在した場合でも、検査領域の特徴量と検査対象42の特徴量とを比較することによって、検査対象42のみを含む検査範囲を特定することが可能となった。
Further, even when another region similar in color to the
今回開示された実施の形態は、すべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。 The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.
1 画像処理装置、2 カメラ、3 光学系、4 製品、5 搭載ステージ、11 コンピュータ本体、12 ディスプレイ装置、13 FDドライブ、14 FD、15 キーボード、16 マウス、17 CD−ROM装置、18 CD−ROM、19 ネットワーク通信装置、20 CPU、21 ROM、22 RAM、23 ハードディスク、31 閾値設定部、32 サーチ間隔設定部、33 検査対象判定部、34 検査ライン設定部、35 検査領域拡大部、36 検査領域判別部、41 画像データ、42 検査対象、43 測定点、44a 立ち上がり点、44b 立ち下がり点、45 検査ライン、C1,C2 検査範囲。
DESCRIPTION OF
Claims (14)
間引き量に応じて前記画像データに測定点を設定し、それぞれの測定点のRGB値に応じて前記検査対象の候補点であるか否かを判定する検査対象判定手段と、
前記検査対象判定手段によって候補点と判定された測定点が存在するラインを検査ラインに設定する検査ライン設定手段と、
前記検査ライン設定手段によって設定された検査ラインに応じて検査領域を拡大する検査領域拡大手段と、
前記検査領域拡大手段によって拡大された検査領域が前記検査対象を含む検査領域であるか否かを判別する検査領域判別手段とを含む、画像処理装置。 An image processing apparatus for detecting an inspection area including an inspection object from image data,
Inspection point determination means for setting a measurement point in the image data according to the thinning amount, and determining whether or not the inspection point candidate point according to the RGB value of each measurement point;
An inspection line setting unit that sets a line in which a measurement point determined as a candidate point by the inspection target determination unit exists as an inspection line;
Inspection area enlarging means for enlarging the inspection area according to the inspection line set by the inspection line setting means;
An image processing apparatus comprising: an inspection area determination unit that determines whether or not the inspection area enlarged by the inspection area enlargement unit is an inspection area including the inspection object.
1ピッチ上の検査ラインの始点または終点が存在しない場合には、1ピッチ上の検査ラインと異なる属性を対象の検査ラインに与えて異なる検査対象とする、請求項4記載の画像処理装置。 The inspection line setting means, when the start point or the end point of the inspection line on one pitch exists within the range of the target inspection line, gives the same attribute as the inspection line on one pitch to the target inspection line,
The image processing apparatus according to claim 4, wherein when there is no start point or end point of the inspection line on one pitch, an attribute different from that on the inspection line on one pitch is given to the target inspection line to make a different inspection target.
対象の検査ラインが最上行のラインでなければ、対象の検査ラインの範囲と1ピッチ上の検査ラインの範囲とを比較し、広い範囲の分だけ検査領域を横方向に拡大し、対象の検査ラインの検査領域を1画素上から、1ピッチ−2画素分だけ上に拡大し、
対象の検査ラインが最下行のラインであれば、対象の検査ラインの範囲を検査領域の横方向とし、対象の検査ラインの検査領域を1画素下から、1ピッチ−2画素分だけ下に拡大し、
拡大された検査領域をすべて含む最小矩形領域を最終的な検査領域とする、請求項1記載の画像処理装置。 If the target inspection line is the uppermost line, the inspection area enlarging means sets the range of the target inspection line as the horizontal direction of the inspection area, and sets the inspection area of the target inspection line from one pixel to one pitch- Magnify up by 2 pixels,
If the target inspection line is not the top line, the target inspection line range is compared with the inspection line range one pitch above, and the inspection area is expanded in the horizontal direction by a wide range to inspect the target. Enlarging the inspection area of the line from 1 pixel up by 1 pitch-2 pixels,
If the target inspection line is the bottom line, the range of the target inspection line is set to the horizontal direction of the inspection area, and the inspection area of the target inspection line is expanded from one pixel below by one pitch-2 pixels. And
The image processing apparatus according to claim 1, wherein a minimum rectangular area including all of the enlarged inspection area is set as a final inspection area.
前記コンピュータに、間引き量に応じて前記画像データに測定点を設定させ、それぞれの測定点のRGB値に応じて前記検査対象の候補点であるか否かを判定させるステップと、
前記候補点と判定された測定点が存在するラインを検査ラインに設定させるステップと、
前記設定された検査ラインに応じて検査領域を拡大させるステップと、
前記拡大された検査領域が前記検査対象を含む検査領域であるか否かを判別させるステップとを含む、画像処理方法。 An image processing method for causing a computer to detect an inspection area including an inspection object from image data,
Causing the computer to set measurement points in the image data according to the thinning amount, and determining whether or not it is a candidate point to be inspected according to the RGB value of each measurement point;
Setting a line in which a measurement point determined as the candidate point is present as an inspection line;
Expanding the inspection area according to the set inspection line;
And determining whether or not the enlarged inspection area is an inspection area including the inspection object.
前記コンピュータに、間引き量に応じて前記画像データに測定点を設定させ、それぞれの測定点のRGB値に応じて前記検査対象の候補点であるか否かを判定させるステップと、
前記候補点と判定された測定点が存在するラインを検査ラインに設定させるステップと、
前記設定された検査ラインに応じて検査領域を拡大させるステップと、
前記拡大された検査領域が前記検査対象を含む検査領域であるか否かを判別させるステップとを含む、コンピュータ・プログラム。 A computer program for causing a computer to detect an inspection area including an inspection object from image data,
Causing the computer to set measurement points in the image data according to the thinning amount, and determining whether or not it is a candidate point to be inspected according to the RGB value of each measurement point;
Setting a line in which a measurement point determined as the candidate point is present as an inspection line;
Expanding the inspection area according to the set inspection line;
And determining whether or not the enlarged inspection area is an inspection area including the inspection object.
前記コンピュータに、間引き量に応じて前記画像データに測定点を設定させ、それぞれの測定点のRGB値に応じて前記検査対象の候補点であるか否かを判定させるステップと、
前記候補点と判定された測定点が存在するラインを検査ラインに設定させるステップと、
前記設定された検査ラインに応じて検査領域を拡大させるステップと、
前記拡大された検査領域が前記検査対象を含む検査領域であるか否かを判別させるステップとを含む、記録媒体。 A recording medium recording a computer program for causing a computer to detect an inspection area including an inspection object from image data,
Causing the computer to set measurement points in the image data according to the thinning amount, and determining whether or not it is a candidate point to be inspected according to the RGB value of each measurement point;
Setting a line in which a measurement point determined as the candidate point is present as an inspection line;
Expanding the inspection area according to the set inspection line;
Discriminating whether or not the enlarged inspection region is an inspection region including the inspection object.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2009286599A JP2011128878A (en) | 2009-12-17 | 2009-12-17 | Image processor, image processing method, computer program for the same, and recording medium with program recorded thereon |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2009286599A JP2011128878A (en) | 2009-12-17 | 2009-12-17 | Image processor, image processing method, computer program for the same, and recording medium with program recorded thereon |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2011128878A true JP2011128878A (en) | 2011-06-30 |
Family
ID=44291413
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2009286599A Withdrawn JP2011128878A (en) | 2009-12-17 | 2009-12-17 | Image processor, image processing method, computer program for the same, and recording medium with program recorded thereon |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2011128878A (en) |
-
2009
- 2009-12-17 JP JP2009286599A patent/JP2011128878A/en not_active Withdrawn
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP5152231B2 (en) | Image processing method and image processing apparatus | |
| JP5364528B2 (en) | Pattern matching method, pattern matching program, electronic computer, electronic device inspection device | |
| US20100158409A1 (en) | Method to Generate Object Focused Thumbnails for Digital Images | |
| JP2005309746A (en) | Moving object tracking method, moving object tracking program and recording medium thereof, and moving object tracking apparatus | |
| JP2004038885A (en) | Image feature learning type defect detection method, defect detection device and defect detection program | |
| JP2005172559A (en) | Line defect detection method and apparatus for panel | |
| JP2007141222A (en) | Image processor and image processing method | |
| JP5849206B2 (en) | Image processing apparatus, image processing method, and image processing program | |
| JP5264457B2 (en) | Object detection device | |
| CN105208263B (en) | Image processing apparatus and its control method | |
| JP2005345290A (en) | Streak defect detection method and apparatus | |
| JP2005165387A (en) | Screen streak defect detection method and apparatus, and display device | |
| JP2016157155A (en) | Character region extraction device and program | |
| CN116883371B (en) | A method for detecting appearance defects of flexible printed circuit boards | |
| JP5993100B2 (en) | Image processing apparatus and specific figure detection method | |
| JP6643301B2 (en) | Defect inspection device and defect inspection method | |
| JP4550768B2 (en) | Image detection method and image detection apparatus | |
| JP2006222899A (en) | Image processing apparatus and image processing method | |
| CN114723767B (en) | Stain detection method, device, electronic device and sweeping robot system | |
| JP2011128878A (en) | Image processor, image processing method, computer program for the same, and recording medium with program recorded thereon | |
| JP4428112B2 (en) | Appearance inspection method and appearance inspection apparatus | |
| CN101996402A (en) | Image processing device and image processing method | |
| JP2006302115A (en) | Object detection method and object detection apparatus | |
| JP2004334461A (en) | Character recognition device and character recognition program | |
| JP5185072B2 (en) | Frame detection method, frame detection apparatus, and frame detection program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20130305 |