JP5015097B2 - Image processing apparatus, image processing program, computer-readable recording medium, electronic apparatus, and image processing method - Google Patents
Image processing apparatus, image processing program, computer-readable recording medium, electronic apparatus, and image processing method Download PDFInfo
- Publication number
- JP5015097B2 JP5015097B2 JP2008222874A JP2008222874A JP5015097B2 JP 5015097 B2 JP5015097 B2 JP 5015097B2 JP 2008222874 A JP2008222874 A JP 2008222874A JP 2008222874 A JP2008222874 A JP 2008222874A JP 5015097 B2 JP5015097 B2 JP 5015097B2
- Authority
- JP
- Japan
- Prior art keywords
- matching
- pattern
- region
- pixel
- degree
- 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.)
- Expired - Fee Related
Links
Images
Description
本発明は、撮像された撮像画像の画像データを用いて、撮像対象による前記撮像画像上の指示位置を特定する機能を備えた画像処理装置に関する。 The present invention relates to an image processing apparatus having a function of specifying an instruction position on a captured image by an imaging target using image data of a captured image.
携帯電話やPDA(Personal Digital Assistants)等の各種機器に、画像表示部として液晶ディスプレイを備えた画像表示装置(以下、「液晶表示装置」と呼ぶ。)が幅広く利用されていることは周知の通りである。特に、PDAでは、古くからタッチセンサーを備えることにより、直接指等を液晶ディスプレイに接触させることによって情報を入力するタッチ入力が可能となっている。また、携帯電話やその他の機器においても、タッチセンサーを備える液晶表示装置の普及が期待されている。 As is well known, image display devices (hereinafter referred to as “liquid crystal display devices”) having a liquid crystal display as an image display unit are widely used in various devices such as mobile phones and PDAs (Personal Digital Assistants). It is. In particular, PDAs have been equipped with a touch sensor for a long time, enabling touch input to input information by directly bringing a finger or the like into contact with a liquid crystal display. In addition, liquid crystal display devices including a touch sensor are expected to spread in mobile phones and other devices.
このタッチセンサーは画面表示を邪魔せずに、指等がディスプレイ上のどこをタッチしたかを検出するセンサーであり、いろいろな方式が考案され、実用化されている。従来、押されると上の導電性基板と下の導電性基板とが接触することによって入力位置を検知する抵抗膜方式、触った場所の容量変化を検知することによって入力位置を検知する静電容量式等が主流であった。 This touch sensor is a sensor that detects where a finger or the like touches on the display without disturbing the screen display, and various methods have been devised and put into practical use. Conventionally, a resistive film system that detects the input position by touching the upper conductive substrate and the lower conductive substrate when pressed, and a capacitance that detects the input position by detecting the change in capacitance at the touched location The formula was mainstream.
近年、フォトダイオード、フォトトランジスタ等の光センサ素子が画像表示領域内の画素毎に配置された液晶表示装置の開発が進んでいる。このように、画素ごとに光センサ素子を内蔵することで、タッチパネル機能を通常の液晶表示装置で実現することが可能となる。 In recent years, development of a liquid crystal display device in which photosensor elements such as photodiodes and phototransistors are arranged for each pixel in an image display region has been progressing. Thus, by incorporating a photosensor element for each pixel, the touch panel function can be realized with a normal liquid crystal display device.
このようなタッチパネル一体型の表示装置では、画像表示領域内に配置された複数個の光センサ素子を用いてタッチする指等の画像を撮影し、その画像解析結果からタッチの有無及びタッチ位置を判断している。 In such a touch panel integrated display device, an image of a finger or the like to be touched is captured using a plurality of optical sensor elements arranged in the image display area, and the presence / absence of touch and the touch position are determined from the image analysis result. Deciding.
タッチする指等の画像を解析する際、タッチする指等の画像を認識することが必要となる。従来、このような画像認識に好適な手法として、パターンマッチングによる画像認識を挙げることができる。このパターンマッチングによる画像認識では、撮影される画像より小さいモデルパターンをあらかじめ用意し、撮影画像上のあらゆる位置においてこのモデルパターンの画像とのマッチングを行ない、撮影画像上においてモデルパターンに一致する画像や、モデルパターンに最も近い画像の存在を検出している。 When analyzing an image of a finger or the like to be touched, it is necessary to recognize the image of the finger or the like to be touched. Conventionally, image recognition by pattern matching can be cited as a method suitable for such image recognition. In image recognition based on this pattern matching, a model pattern smaller than the image to be captured is prepared in advance, matching is performed with the image of this model pattern at any position on the captured image, and an image that matches the model pattern on the captured image The presence of an image closest to the model pattern is detected.
ところで、このパターンマッチングによる画像認識では、モデルパターンの大きさが大きくなった場合、認識対象パターンとのマッチングに多くの時間が必要となり、マッチング処理に要する計算量も大幅に増加してしまう。 By the way, in the image recognition based on this pattern matching, when the size of the model pattern is increased, much time is required for matching with the recognition target pattern, and the amount of calculation required for the matching process is greatly increased.
また、予想される認識対象パターンごとにモデルパターンを用意しなければならない。例えば、ディスプレイ上での指によるタッチを認識するためには、通常、円形及び楕円形のモデルパターンが必要とされている。特に、楕円形のモデルパターンを用いてマッチングを行なう場合、楕円形のモデルパターンの回転を考慮したマッチングが必要であり、上記と同様、マッチング処理に要する計算量が増加する傾向にある。 In addition, a model pattern must be prepared for each expected recognition target pattern. For example, in order to recognize a finger touch on the display, a model pattern of a circle and an ellipse is usually required. In particular, when matching is performed using an elliptical model pattern, matching in consideration of the rotation of the elliptical model pattern is necessary, and as described above, the amount of calculation required for the matching process tends to increase.
さらに、撮影画像にノイズが多く含まれてしまうと、撮影画像上における認識対象パターンが背景画像から分離しにくくなったり、そのパターンの一部が隠蔽されて形状が変化して見えたりしたりする。このため、撮影画像上の認識対象パターンとモデルパターン間のマッチングの精度が大きく低下してしまい、撮影画像上においてモデルパターンに一致するパターンの存在を正確に検出することが困難となってしまう。 Furthermore, if the captured image contains a lot of noise, the recognition target pattern on the captured image may be difficult to separate from the background image, or a part of the pattern may be hidden and the shape may change. . For this reason, the accuracy of matching between the recognition target pattern on the captured image and the model pattern is greatly reduced, and it becomes difficult to accurately detect the presence of a pattern that matches the model pattern on the captured image.
このような状況を考慮して、あらかじめ用意するモデルパターンを特徴的な部分である局所パターンとそうでない部分である連結パターンとに分け、認識対象パターンを含む撮影画像から局所パターンに似た部分を検出することにより、上述したような認識対象パターンの変形を推定する方法が提案されている(例えば、特許文献1を参照)。 Considering such a situation, the model pattern prepared in advance is divided into a local pattern that is a characteristic part and a connected pattern that is not a characteristic part, and a part similar to the local pattern is taken from the captured image including the recognition target pattern. There has been proposed a method of estimating the deformation of the recognition target pattern as described above by detecting (see, for example, Patent Document 1).
この特定パターン認識方法では、認識対象パターンの変形の推定結果に基づいてモデルパターンを変形させ、その変形させたモデルパターンと認識対象パターンとの間でマッチングを行なうことにより、認識対象パターンの変形に対応するようにしていた。
しかしながら、従来の特定パターン認識方法では、あらかじめ用意される複数の局所パターン各々には方向情報が付与されており、これら各局所パターンの方向情報を用いて認識対象パターンの変形に対応しているため、依然として、各局所パターンの回転を考慮したマッチングは必要となっており、その結果、マッチング処理に要する計算量を低減することはできないという課題があった。 However, in the conventional specific pattern recognition method, direction information is given to each of a plurality of local patterns prepared in advance, and the direction information of each local pattern is used to cope with the deformation of the recognition target pattern. Still, matching considering the rotation of each local pattern is necessary, and as a result, there is a problem that the amount of calculation required for the matching process cannot be reduced.
上記課題に鑑み、本発明は、マッチング処理に要する計算量を増大させることなく、認識対象パターンの変形や、モデルパターンとは異なるパターンの認識に対応することができる画像処理装置、画像処理プログラム、コンピュータ読み取り可能な記録媒体、電子機器及び画像処理方法を提供することを目的とする。 In view of the above-described problems, the present invention provides an image processing apparatus, an image processing program, and an image processing apparatus that can cope with deformation of a recognition target pattern and recognition of a pattern different from a model pattern without increasing the amount of calculation required for matching processing. It is an object to provide a computer-readable recording medium, an electronic device, and an image processing method.
上記目的を達成するために、本発明における画像処理装置は、撮像された撮像画像の画像データを用いて、撮像対象による前記撮像画像上の指示位置を特定する機能を備えた画像処理装置であって、前記画像データ上の画素ごとに、あらかじめ定められたモデルパターンと照合するための特徴量を算出する特徴量算出手段と、前記特徴量算出手段による特徴量算出結果に基づいて、前記画像データ上の一部の領域に含まれる照合領域と、前記モデルパターンとを照合し、前記照合領域と前記モデルパターンとのマッチングの度合いを示す合致度を算出する合致度算出手段と、前記合致度算出手段により算出された合致度が前記画像データ上の部分領域内で最大となる複数の照合領域が存在する場合において、前記モデルパターンとのマッチングの度合いが前記照合領域と前記モデルパターンの一部とがマッチングする部分的なマッチングであることを示す合致度を持つ複数の照合領域が、単一領域として複数の照合領域が互いに結合すべきとしてあらかじめ定められた結合条件を満足する場合には、当該結合条件を満足する複数の照合領域を単一領域として互いに結合する領域結合手段と、前記合致度算出手段により算出された合致度が前記画像データ上の部分領域内で最大となる照合領域の位置を特定する位置特定手段とを備えている。 In order to achieve the above object, an image processing apparatus according to the present invention is an image processing apparatus having a function of specifying an instruction position on a captured image by an imaging target using image data of a captured image. A feature amount calculating unit that calculates a feature amount for matching with a predetermined model pattern for each pixel on the image data, and the image data based on a feature amount calculation result by the feature amount calculating unit. A matching degree calculating means for matching a matching area included in a part of the upper area with the model pattern and calculating a matching degree indicating a degree of matching between the matching area and the model pattern; and the matching degree calculation When there is a plurality of matching areas in which the degree of matching calculated by the means is the largest in the partial area on the image data, the matching with the model pattern A plurality of matching areas having a matching degree indicating that the degree of matching is a partial matching in which the matching area and a part of the model pattern match, and a plurality of matching areas should be combined with each other as a single area When a predetermined combination condition is satisfied, a region combination unit that combines a plurality of matching regions that satisfy the combination condition as a single region, and a match degree calculated by the match degree calculation unit is the image. Position specifying means for specifying the position of the maximum collation area in the partial area on the data.
上記の画像処理装置では、画像データ上の画素ごとに、あらかじめ定められたモデルパターンと照合するための特徴量を算出し、その特徴量算出結果に基づいて画像データ上の一部の領域に含まれる照合領域とあらかじめ定められたモデルパターンとを照合し、照合領域とモデルパターンとのマッチングの度合いを示す合致度を算出する。 In the above image processing device, for each pixel on the image data, a feature amount for matching with a predetermined model pattern is calculated, and included in a partial region on the image data based on the feature amount calculation result A matching area indicating a matching degree between the matching area and the model pattern is calculated by matching the matching area with a predetermined model pattern.
画像データ上の部分領域内で合致度が最大となる複数の照合領域が存在し、それら照合領域がモデルパターンの一部とがマッチングする部分的なマッチングであることを示す合致度を持つ場合に、それら領域があらかじめ定められた結合条件を満足する場合には単一領域として互いに結合する。 When there are multiple matching areas that have the highest degree of matching in the partial area on the image data, and these matching areas have a matching level indicating that they are a partial match that matches a part of the model pattern When these regions satisfy a predetermined coupling condition, they are coupled to each other as a single region.
そして、画像データ上の部分領域内で算出された合致度が最大となる照合領域の位置を特定する。 And the position of the collation area | region where the matching degree calculated in the partial area | region on image data becomes the maximum is pinpointed.
すなわち、上記の画像処理装置では、モデルパターンの一部とマッチングする照合領域が存在し、それら照合領域が結合条件を満足する場合には、それら照合領域を単一の領域に結合するので、あらかじめ定められたモデルパターンとは異なるパターンも認識することが可能となる。このため、モデルパターンを多数準備することなく、認識できるパターンを増加させることができるので、マッチング処理に要する計算量を増大させることなく、認識対象パターンの変形や、モデルパターンとは異なるパターンの認識に対応することができる。 That is, in the above image processing apparatus, if there are matching areas that match a part of the model pattern and these matching areas satisfy the combining conditions, the matching areas are combined into a single area. It is also possible to recognize a pattern different from the defined model pattern. As a result, the number of patterns that can be recognized can be increased without preparing a large number of model patterns, so that the pattern to be recognized can be deformed or a pattern different from the model pattern can be recognized without increasing the amount of calculation required for the matching process. It can correspond to.
前記領域結合手段は、前記結合条件を満足する複数の照合領域を単一領域として互いに結合する場合には、当該結合される複数の照合領域の位置を用いて前記複数の照合領域が結合された単一領域の位置を算出することが好ましい。 When the plurality of matching areas satisfying the joining condition are combined as a single area, the region combining means combines the plurality of matching areas using the positions of the plurality of matching areas to be combined. It is preferable to calculate the position of a single region.
この場合、単一領域として結合された領域の位置を新たに算出することが不要となるので、マッチング処理に要する計算量を低減することができる。 In this case, since it is not necessary to newly calculate the position of the region combined as a single region, the amount of calculation required for the matching process can be reduced.
前記モデルパターンとの部分的なマッチングにより前記結合される照合領域の各々に生じる開放方向は、前記照合領域が部分的にマッチングするモデルパターンの一部の位置に応じてあらかじめ定められており、前記結合条件は、前記結合される複数の照合領域間における位置関係に応じて前記各照合領域に生じるべき開放方向を規定していることが好ましい。 The opening direction generated in each of the matching regions to be combined by partial matching with the model pattern is determined in advance according to the position of a part of the model pattern with which the matching region is partially matched, It is preferable that the joining condition defines an opening direction that should occur in each of the collation areas according to the positional relationship between the plurality of collation areas to be joined.
この場合、照合領域が部分的にマッチングするモデルパターンの一部の位置を特定するだけで、結合条件を満足するか否かを判断することができるので、その判断処理を効率よく行なうことができる。 In this case, since it is possible to determine whether or not the combination condition is satisfied only by specifying the position of a part of the model pattern that the matching region partially matches, the determination process can be performed efficiently. .
前記モデルパターンの形状は、略円形状であり、前記結合される照合領域の形状は、略半円形状であり、前記複数の照合領域が結合される単一領域の形状は、略楕円形状であり、前記結合条件は、前記結合される照合領域の各々に生じる開放方向が互いに対向すること、及び、前記結合される照合領域の各々の位置を通って開放方向に沿って伸びる直線が略同一直線に一致すること、を規定していることが好ましく、前記結合条件はさらに、前記結合される照合領域間の距離が所定の範囲内にあることを規定していることが好ましい。 The shape of the model pattern is a substantially circular shape, the shape of the matching region to be combined is a substantially semicircular shape, and the shape of the single region to which the plurality of matching regions are combined is a substantially elliptical shape. And the joining condition is that the opening directions generated in each of the matching regions to be joined are opposed to each other, and straight lines extending along the opening direction through the respective positions of the matching regions to be joined are substantially the same. It is preferable that the lines coincide with each other, and the combining condition further specifies that the distance between the matching areas to be combined is within a predetermined range.
この場合、モデルパターンの形状が略円形状、結合される照合領域の形状が略半円形状、複数の照合領域が結合される単一領域の形状が略楕円形状である場合であれば、結合条件を簡単に規定することができる。 In this case, if the shape of the model pattern is a substantially circular shape, the shape of the matching region to be joined is a substantially semicircular shape, and the shape of a single region to which a plurality of matching regions are joined is a substantially elliptical shape, Conditions can be defined easily.
前記特徴量は、大きさと方向を持つベクトル量であることが好ましい。 The feature amount is preferably a vector amount having a size and a direction.
この場合、スカラー量でパターンマッチングする場合に比べ、情報量が多く、より正確にパターンマッチングを行なうことができる。 In this case, the amount of information is larger than in the case of pattern matching with a scalar amount, and pattern matching can be performed more accurately.
前記特徴量は、画素の輝度の勾配量であることが好ましい。 The feature amount is preferably a gradient amount of pixel luminance.
この場合、画素の輝度の勾配量に基づいてパターンマッチングを行なうことによって、位置検出の精度を向上できる。 In this case, the accuracy of position detection can be improved by performing pattern matching based on the gradient amount of the luminance of the pixel.
本発明における電子機器は、上記の画像処理装置を備えている。 An electronic apparatus according to the present invention includes the above-described image processing apparatus.
上記の電子機器では、上記の画像処理装置を備えている電子機器が実現される。 In the above electronic device, an electronic device including the above image processing apparatus is realized.
本発明における画像処理方法は、撮像された撮像画像の画像データを用いて、撮像対象による前記撮像画像上の指示位置を特定する画像処理方法であって、前記画像データ上の画素ごとに、あらかじめ定められたモデルパターンと照合するための特徴量を算出する特徴量算出工程と、前記特徴量算出工程における特徴量算出結果に基づいて、前記画像データ上の一部の領域に含まれる照合領域と、前記モデルパターンとを照合し、前記照合領域と前記モデルパターンとのマッチングの度合いを示す合致度を算出する合致度算出工程と、前記合致度算出工程において算出された合致度が前記画像データ上の部分領域内で最大となる複数の照合領域が存在する場合において、前記モデルパターンとのマッチングの度合いが前記照合領域と前記モデルパターンの一部とがマッチングする部分的なマッチングであることを示す合致度を持つ複数の照合領域が、単一領域として複数の照合領域が互いに結合すべきとしてあらかじめ定められた結合条件を満足する場合には、当該結合条件を満足する複数の照合領域を単一領域として互いに結合する領域結合工程と、前記合致度算出工程において算出された合致度が前記画像データ上の部分領域内で最大となる照合領域の位置を特定する位置特定工程とを備えている。 An image processing method according to the present invention is an image processing method for specifying an instruction position on a captured image by an imaging target using image data of a captured image, and for each pixel on the image data in advance A feature amount calculating step for calculating a feature amount for matching with a determined model pattern, and a matching region included in a partial region on the image data based on a feature amount calculation result in the feature amount calculating step; A matching degree calculation step of matching the model pattern and calculating a matching degree indicating a degree of matching between the matching region and the model pattern, and the matching degree calculated in the matching degree calculation step In the case where there are a plurality of matching areas that are maximum in the partial area, the degree of matching with the model pattern depends on the matching area and the model. A plurality of matching areas having a matching degree indicating partial matching that matches a part of the pattern satisfies a predetermined combination condition that a plurality of matching areas should be combined with each other as a single area. In this case, a region combining step of combining a plurality of matching regions satisfying the combining condition as a single region, and the matching degree calculated in the matching degree calculating step is the largest in the partial area on the image data. And a position specifying step for specifying the position of the matching region.
上記の画像処理方法では、画像データ上の画素ごとに、あらかじめ定められたモデルパターンと照合するための特徴量を算出し、その特徴量算出結果に基づいて画像データ上の一部の領域に含まれる照合領域とあらかじめ定められたモデルパターンとを照合し、照合領域とモデルパターンとのマッチングの度合いを示す合致度を算出する。 In the above image processing method, for each pixel on the image data, a feature amount for matching with a predetermined model pattern is calculated, and included in a partial region on the image data based on the feature amount calculation result A matching area indicating a matching degree between the matching area and the model pattern is calculated by matching the matching area with a predetermined model pattern.
画像データ上の部分領域内で合致度が最大となる複数の照合領域が存在し、それら照合領域がモデルパターンの一部とがマッチングする部分的なマッチングであることを示す合致度を持つ場合に、それら領域があらかじめ定められた結合条件を満足する場合には単一領域として互いに結合する。 When there are multiple matching areas that have the highest degree of matching in the partial area on the image data, and these matching areas have a matching level indicating that they are a partial match that matches a part of the model pattern When these regions satisfy a predetermined coupling condition, they are coupled to each other as a single region.
そして、画像データ上の部分領域内で算出された合致度が最大となる照合領域の位置を特定する。 And the position of the collation area | region where the matching degree calculated in the partial area | region on image data becomes the maximum is pinpointed.
すなわち、上記の画像処理方法では、モデルパターンの一部とマッチングする照合領域が存在し、それら照合領域が結合条件を満足する場合には、それら照合領域を単一の領域に結合するので、あらかじめ定められたモデルパターンとは異なるパターンも認識することが可能となる。このため、モデルパターンを多数準備することなく、認識できるパターンを増加させることができるので、マッチング処理に要する計算量を増大させることなく、認識対象パターンの変形や、モデルパターンとは異なるパターンの認識に対応することができる。 That is, in the image processing method described above, when there are matching areas that match a part of the model pattern, and these matching areas satisfy the combining condition, the matching areas are combined into a single area. It is also possible to recognize a pattern different from the defined model pattern. As a result, the number of patterns that can be recognized can be increased without preparing a large number of model patterns, so that the pattern to be recognized can be deformed or a pattern different from the model pattern can be recognized without increasing the amount of calculation required for the matching process. It can correspond to.
なお、上記の画像処理装置は、コンピュータによって実現してもよく、この場合には、コンピュータを上記各手段として動作させることにより上記の画像処理装置をコンピュータにて実現させる画像処理プログラム、およびそれを記録したコンピュータ読み取り可能な記録媒体も、本発明の範疇に入る。 The image processing apparatus may be realized by a computer. In this case, an image processing program for causing the image processing apparatus to be realized by a computer by causing the computer to operate as the above-described means, and A recorded computer-readable recording medium also falls within the scope of the present invention.
本発明の画像処理装置は、以上のように、前記合致度算出手段により算出された合致度が前記画像データ上の部分領域内で最大となる複数の照合領域が存在する場合において、前記モデルパターンとのマッチングの度合いが前記照合領域と前記モデルパターンの一部とがマッチングする部分的なマッチングであることを示す合致度を持つ複数の照合領域が、単一領域として複数の照合領域が互いに結合すべきとしてあらかじめ定められた結合条件を満足する場合には、当該結合条件を満足する複数の照合領域を単一領域として互いに結合する領域結合手段を備えている。 As described above, in the image processing apparatus of the present invention, when there are a plurality of matching areas where the degree of matching calculated by the degree of matching calculating unit is the largest in the partial area on the image data, the model pattern A plurality of matching regions having a matching degree indicating that the matching level is a partial matching in which the matching region and a part of the model pattern are matched, and a plurality of matching regions are combined as a single region When a predetermined joining condition is to be satisfied, a plurality of matching areas that satisfy the joining condition are combined as a single area.
それゆえ、マッチング処理に要する計算量を増大させることなく、認識対象パターンの変形や、モデルパターンとは異なるパターンの認識に対応することができるという効果を奏する。 Therefore, there is an effect that the recognition target pattern can be deformed or a pattern different from the model pattern can be recognized without increasing the amount of calculation required for the matching process.
以下、本発明の実施の形態について、図面を参照しながら説明する。なお、同一部分には同一符号を付し、図面で同一の符号が付いたものは、説明を省略する場合もある。なお、本実施の形態では、画像表示部の例として液晶ディスプレイを採用した場合について説明するが、液晶ディスプレイ以外の画像表示部を採用する場合も本発明の適用範囲に含まれる。 Hereinafter, embodiments of the present invention will be described with reference to the drawings. In addition, the same code | symbol is attached | subjected to the same part, and what attached the same code | symbol in drawing may abbreviate | omit description. In the present embodiment, a case where a liquid crystal display is employed as an example of the image display unit will be described. However, a case where an image display unit other than the liquid crystal display is employed is also included in the scope of the present invention.
(1.画像処理装置の構成)
図1は、本発明の実施の形態における画像処理装置1の構成を示すブロック図である。まず、本発明の実施の形態における画像処理装置1の構成及びその撮像画像の例について説明する。以下では、便宜上、画像処理装置1について説明するが、図1に示すように、本発明の実施の形態における画像処理装置1の機能を必要とする電子機器20であれば、一般の電子機器に対して適用可能である。
(1. Configuration of image processing apparatus)
FIG. 1 is a block diagram showing a configuration of an
最初に、画像処理装置1の構成の概要及び画像処理装置1の撮像原理について説明する。画像処理装置1は、表示機能を有しており、複数の画素から構成される液晶ディスプレイ(ディスプレイ)及び該液晶ディスプレイに光を照射するバックライトを備えている点は、通常の液晶ディスプレイと同様である。
First, the outline of the configuration of the
そして、画像処理装置1における液晶ディスプレイは、各画素内に光センサー(撮像センサー)が内蔵され、該光センサーによって液晶ディスプレイの表示画面に近接してきた外部の物体等(撮像対象)を撮像し、画像データ(撮像センサーによって撮像された画像データ)として取り込むことが可能となっている点が、通常の液晶ディスプレイと異なっている。
The liquid crystal display in the
なお、液晶ディスプレイは、複数の画素のうち、所定数の画素ごとに光センサーが内蔵されているものであっても良いが、光センサーによる撮像画像の解像度の観点から、光センサーは全画素に内蔵されていることが好ましい。 Note that the liquid crystal display may have a built-in photosensor for each of a predetermined number of pixels, but from the viewpoint of the resolution of an image captured by the photosensor, the photosensor is provided for all pixels. It is preferably built in.
また、画像処理装置1の液晶ディスプレイは、通常の液晶ディスプレイと同様に、複数の走査線と複数の信号線とが交差するように配線され、この各交差部に画素が配置され、薄膜トランジスタ、及び各種容量を有する画素を備えた表示部と、走査線を駆動する駆動回路と、信号線を駆動する駆動回路とを備えているものである。
The liquid crystal display of the
さらに、画像処理装置1の液晶ディスプレイは、例えば各画素内に光センサーとしてフォトダイオードを内蔵する構成となっている。このフォトダイオードには、キャパシタが接続され、表示画面から入射された光のフォトダイオードでの受光量の変化に応じてキャパシタの電荷量を変化させる構成となっている。そして、このキャパシタの両端の電圧を検出することにより画像データを生成し、画像の撮像(取り込み)を行なうようになっている。これが画像処理装置1の液晶ディスプレイによる撮像原理である。
Furthermore, the liquid crystal display of the
なお、光センサーとしては、フォトダイオードに限られず、光電効果を動作原理とし、液晶ディスプレイ等の各画素に内蔵できるものであれば良い。 Note that the optical sensor is not limited to a photodiode, and any optical sensor may be used as long as it can be built in each pixel such as a liquid crystal display using the photoelectric effect as an operating principle.
以上の構成により、画像処理装置1は、液晶ディスプレイ本来の画像を表示する表示機能に加え、表示画面に近接してきた外部の物体の画像(撮像対象)を撮像する撮像機能を備える構成となっている。それゆえ、ディスプレイの表示画面でのタッチ入力が可能な構成とすることができる。
With the above configuration, the
ここで、図2(a)〜(h)に基づき、画像処理装置1の液晶ディスプレイの各画素に内蔵されたフォトダイオードによって撮像される撮像対象について説明する。ここでは、「指の腹(以下、「指腹」と呼ぶ場合もある。)」及び「ペン先」の例を挙げ、それぞれの撮像画像(又は画像データ)の特徴の概要について説明する。
Here, based on FIGS. 2A to 2H, an imaging target to be imaged by a photodiode built in each pixel of the liquid crystal display of the
図2(a)は、周囲が暗い場合における指腹の撮像画像の様子を示す概要図であり、図2(b)は、周囲が暗い場合における指腹の撮像画像の特徴を示す概要図である。図2(a)に示すように、ユーザが、暗い部屋で液晶ディスプレイの表示画面65に、人差し指の腹を接触させた場合について考える。
FIG. 2A is a schematic diagram illustrating a captured image of the finger pad when the surrounding is dark, and FIG. 2B is a schematic diagram illustrating the characteristics of the captured image of the finger pad when the surrounding is dark. is there. As shown in FIG. 2A, a case is considered where the user touches the
この場合、図2(b)の撮像画像61は、バックライトが撮像対象(指腹)に反射して得られる画像であり、白い円形状がぼやけたような画像となる。なお、各画素における勾配方向は、おおよそ、撮像画像におけるエッジ部分からエッジ部分に囲まれた領域の中心付近に向かう傾向を示している(ここでは、勾配方向は暗い部分から明るい部分に向かう向きを正としている。)。
In this case, the captured
次に、図2(c)は、周囲が明るい場合における指腹の撮像画像の様子を示す概要図であり、図2(d)は、周囲が明るい場合における指腹の撮像画像の特徴を示す概要図である。図2(c)に示すように、ユーザが、明るい部屋で液晶ディスプレイの表示画面65に、人差し指の腹を接触させた場合について考える。
Next, FIG. 2C is a schematic diagram illustrating a captured image of the finger pad when the surrounding is bright, and FIG. 2D illustrates the characteristics of the captured image of the finger pad when the surrounding is bright. FIG. As shown in FIG. 2C, consider a case where the user touches the
この場合、図2(d)の撮像画像62は、外光66が液晶ディスプレイの表示画面65に入射することによって得られる画像(接触した場合は、バックライトによる反射光も混じる。)であり、人差し指で外光が遮られることによって生じた指の影と、液晶ディスプレイの表示画面に接触した指の腹にバックライトの光が反射してできた白い円形状がぼやけた部分とからなる。これらのうち白い円形状の部分における勾配方向は、上述した暗い部屋で指の腹を接触させた場合と同様の傾向を示すが、その周囲を囲む影は暗く、周囲が外光66で明るいので、各画素における勾配方向は、白い円形状の部分における勾配方向と逆向きの傾向を示している。
In this case, the captured
図2(e)は、周囲が暗い場合におけるペン先の撮像画像の様子を示す概要図であり、図2(f)は、周囲が暗い場合におけるペン先の撮像画像の特徴を示す概要図である。図2(e)に示すように、ユーザが、暗い部屋で液晶ディスプレイの表示画面65に、ペン先を接触させた場合について考える。
FIG. 2E is a schematic diagram illustrating a captured image of the pen tip when the surrounding is dark, and FIG. 2F is a schematic diagram illustrating characteristics of the captured image of the pen tip when the periphery is dark. is there. As shown in FIG. 2E, consider a case where the user touches the
この場合、図2(f)の撮像画像63は、バックライトが撮像対象(ペン先)に反射して得られる画像であり、小さな白い円形状がぼやけたような画像となる。なお、各画素における勾配方向は、おおよそ、撮像画像におけるエッジ部分からエッジ部分に囲まれた領域の中心付近に向かう傾向を示している。
In this case, the captured
次に、図2(g)は、周囲が明るい場合におけるペン先の撮像画像の様子を示す概要図であり、図2(h)は、周囲が明るい場合におけるペン先の撮像画像の特徴を示す概要図である。図2(g)に示すように、ユーザが、明るい部屋で液晶ディスプレイの表示画面65に、ペン先を接触させた場合について考える。
Next, FIG. 2G is a schematic diagram showing a state of a picked-up image of the pen tip when the surrounding is bright, and FIG. 2H shows the characteristics of the picked-up image of the pen tip when the surrounding is bright. FIG. As shown in FIG. 2G, consider a case where the user touches the
この場合、図2(h)の撮像画像64は、外光66が液晶ディスプレイの表示画面65に入射することによって得られる画像(接触した場合は、バックライトによる反射光も混じる。)であり、ペンで外光が遮られることによって生じたペンの影と、液晶ディスプレイの表示画面65に接触したペン先にバックライトの光が反射してできた小さな白い円形状がぼやけた部分とからなる。これらのうち小さな白い円形状の部分における勾配方向は、上述した暗い部屋でペン先を接触させた場合と同様の傾向を示すが、その周囲を囲む影は暗く、周囲が外光で明るいので、各画素における勾配方向は、小さな白い円形状の部分における勾配方向と逆向きの傾向を示している。
In this case, the captured
以上のような、各勾配方向の分布は、例えば、指のように表面が柔らかく、面に接触することにより接触面が円形になる場合、または先が丸いペンのように表面が固くても接触面が円形になるような場合には、撮像画像におけるエッジ部分からエッジ部分に囲まれた領域の中心付近に向かうか、或いは、該中心付近から放射状にエッジ部分に向かうかのいずれかの傾向を示す。 The distribution in each gradient direction as described above is, for example, when the surface is soft like a finger and the contact surface becomes circular by touching the surface, or even when the surface is hard like a pen with a round tip When the surface is circular, the tendency is either from the edge part in the captured image to the vicinity of the center of the region surrounded by the edge part, or from the vicinity of the center to the edge part radially. Show.
また、接触面がその他の形状であっても、撮像画像におけるエッジ部分からエッジ部分に囲まれた領域の中に向かうか、或いは、エッジ部分に囲まれた領域の中からその領域の外側に向かうかのいずれかの傾向を示す。さらに、これらの傾向は、撮像対象の状況等に応じて、大きく変わることは無い。したがって、勾配方向は、パターンマッチングに適した量である。 Moreover, even if the contact surface has other shapes, it goes from the edge part in the captured image to the area surrounded by the edge part, or from the area surrounded by the edge part to the outside of the area. One of the trends. Further, these tendencies do not change greatly depending on the situation of the imaging target. Therefore, the gradient direction is an amount suitable for pattern matching.
次に、図1を用いて、本実施の形態における画像処理装置1の構成の詳細について説明する。
Next, details of the configuration of the
画像処理装置1は、図1に示すように、撮像された撮像画像の画像データを用いて、撮像対象による撮像画像上の指示位置を特定する機能を備えたものであり、低解像度化部2と、縦勾配量算出部(特徴量算出手段)3aと、横勾配量算出部(特徴量算出手段)3bと、エッジ抽出部(特徴量算出手段)4と、方向特定部(特徴量算出手段)5と、効率化部6と、一致画素数算出部7と、モデルパターン・比較用一致パターン格納部8と、パターン合致度算出部(合致度算出手段)9と、スコア算出部(合致度算出手段)10と、位置特定部(位置特定手段)11と、パターン結合部(領域結合手段)15と、パターン情報格納部16と、結合条件格納部17と、を備えている。
As shown in FIG. 1, the
低解像度化部2は、液晶ディスプレイに内蔵されている光センサーを用いて撮像された撮像画像の画像データを低解像度化する。
The
縦勾配量算出部3a及び横勾配量算出部3bは、画像データ上の画素ごとに、注目画素の画素値と複数の隣接画素の画素値とから注目画素の画素値の縦方向勾配量及び横方向勾配量を算出する。具体的には、Sobel(ソベル)オペレータ、Prewitt(プリウイット)オペレータ等の公知のエッジ抽出オペレータを用いれば良い。
The vertical gradient
例えば、Sobelオペレータについて説明すると、各画素の画素位置x(i,j)における局所的な縦方向勾配Sy及び横方向勾配Sxは、次式(1)のように求められる。 For example, the Sobel operator will be described. The local vertical gradient Sy and the horizontal gradient Sx at the pixel position x (i, j) of each pixel are obtained by the following equation (1).
Sx=xi+1j−1−xi―1j−1+2xi+1j−2xi―1j+xi+1j+1−xi―1j+1
Sy=xi−1j+1−xi−1j−1+2xij+1−2xij−1+xi+1j+1−xi+1j−1
・・・(1)
ここで、xijは画素位置x(i,j)における画素値を表し、iは水平方向に沿った画素の位置を、jは垂直方向に沿った画素の位置をそれぞれ表す。ここに、i及びjは正の整数である。
S x = x i + 1j−1 −x i−1j−1 + 2x i + 1j −2x i−1j + x i + 1j + 1 −x i−1j + 1
S y = x i−1j + 1 −x i−1j−1 + 2x ij + 1 −2x ij−1 + x i + 1j + 1 −x i + 1j−1
... (1)
Here, x ij represents the pixel value at the pixel position x (i, j), i represents the position of the pixel along the horizontal direction, and j represents the position of the pixel along the vertical direction. Here, i and j are positive integers.
ここで、式(1)は、次式(2)及び(3)の3×3のSobelオペレータ(行列演算子Sx及びSy)を、画素位置x(i,j)を注目画素とする3×3画素に適用することと等価である。
Here, the expression (1) is a 3 × 3 Sobel operator (matrix operators Sx and Sy) of the following expressions (2) and (3), and the pixel position x (i, j) is the pixel of
ここで、画素位置x(i,j)における勾配の大きさABS(S)及び勾配方向ANG(S)は、縦方向勾配Sy及び横方向勾配Sxに基づいて、次のように与えられる。なお、以下では、演算子としての縦方向勾配Sy及び横方向勾配Sxを各画素に適用することによって得られた縦方向勾配量及び横方向勾配量のそれぞれを、便宜上、縦方向勾配量Sy及び横方向勾配量Sxと記載する場合がある。 Here, the gradient magnitude ABS (S) and gradient direction ANG (S) at the pixel position x (i, j) are given as follows based on the vertical gradient Sy and the horizontal gradient Sx. In the following description, for the sake of convenience, the vertical gradient amount Sy and the horizontal gradient amount obtained by applying the vertical gradient Sy and the horizontal gradient Sx as the operators to the respective pixels will be referred to as the vertical gradient amount Sy and the horizontal gradient amount, respectively. It may be described as a lateral gradient amount Sx.
ABS(S)=(Sx2+Sy2)1/2 ・・・(4)
ANG(S)=tan-1(Sy/Sx) ・・・(5)
エッジ抽出部4は、縦勾配量算出部3a及び横勾配量算出部3bが算出した各画素の縦方向勾配量Sy及び横方向勾配量Sxの算出結果から、撮像画像のエッジ部分の画素であるエッジ画素を抽出(特定)する。
ABS (S) = (Sx 2 + Sy 2 ) 1/2 (4)
ANG (S) = tan −1 (Sy / Sx) (5)
The
ここで、エッジ画素とは、画像データを構成する各画素のうち、明るさが急激に変化する部分(エッジ)における画素である。具体的には、縦方向勾配量Sy及び横方向勾配量Sxのそれぞれ、又は、勾配の大きさABS(S)が所定のエッジ閾値以上である画素のことである。 Here, the edge pixel is a pixel in a portion (edge) where the brightness changes abruptly among the pixels constituting the image data. Specifically, it is a pixel in which each of the vertical gradient amount Sy and the horizontal gradient amount Sx, or the gradient magnitude ABS (S) is equal to or greater than a predetermined edge threshold.
なお、このエッジ画素を抽出する目的は、方向特定部5が、抽出された複数のエッジ画素については勾配方向を特定し、エッジ画素以外の画素については一律無方向と看做して特定するようにする点にある。
The purpose of extracting the edge pixels is to specify the
パターンマッチングにおいて重要な情報は、エッジ部分のエッジ画素における勾配方向である。 The important information in pattern matching is the gradient direction in the edge pixel of the edge portion.
したがって、あまり重要でない画素における勾配方向を一律無方向と看做すことで、パターンマッチングの効率化をさらに向上させることができる。また、以下で説明する撮像対象による撮像画像上の指示位置を検出する際のメモリ容量を少量化し、処理時間を短縮化することを可能とし、指示位置の検出処理のコストをさらに削減することができる。 Therefore, the efficiency of pattern matching can be further improved by regarding the gradient direction in the less important pixels as a uniform direction. In addition, it is possible to reduce the memory capacity when detecting the indicated position on the captured image by the imaging target described below, shorten the processing time, and further reduce the cost of the indicated position detection process. it can.
方向特定部5は、上述したように、縦勾配量算出部3a及び横勾配量算出部3bが算出した縦方向勾配量Sy及び横方向勾配量Sxから、画素ごとの勾配方向ANG(S)と、縦方向勾配量Sy及び横方向勾配量Sxのそれぞれ、又は、勾配の大きさABS(S)がエッジ閾値未満である無方向とのいずれかを特定するものである。
As described above, the
ここでは、無方向をエッジ閾値未満であると定義しているが、エッジ閾値以下と定義しても良い。 Here, the non-direction is defined to be less than the edge threshold, but may be defined to be equal to or less than the edge threshold.
あらかじめ無方向を設定しておくことで、ノイズ等により不要な多数の勾配方向が発生することを抑制することができる。また、エッジ近傍の勾配方向に照合対象を絞りこむことが可能となり、照合の効率化を図ることができる。 By setting the non-direction in advance, it is possible to suppress the occurrence of many unnecessary gradient directions due to noise or the like. In addition, it is possible to narrow down the object to be collated in the gradient direction in the vicinity of the edge, and the efficiency of collation can be improved.
なお、方向特定部5は、エッジ抽出部4によって特定された複数のエッジ画素の勾配方向を特定し、エッジ画素以外の画素を無方向と看做して特定することが好ましい。パターンマッチングにおいて重要な情報は、エッジ部分のエッジ画素における勾配方向であると言える。
The
したがって、パターンマッチングにおいてあまり重要でない画素における勾配方向を一律無方向と看做すことで、パターンマッチングの効率化をさらに向上させることができる。 Therefore, the efficiency of pattern matching can be further improved by regarding the gradient direction in pixels that are not so important in pattern matching as uniform directions.
ここで、勾配方向ANG(S)は、0rad〜2πradの範囲で変化する連続量であるから、本実施の形態においては、これを例えば8方向に量子化したものを勾配方向としてパターンマッチングに使用する特徴的な量(以下、「特徴量」と呼ぶことがある。)とする。 Here, since the gradient direction ANG (S) is a continuous amount that changes in the range of 0 rad to 2π rad, in the present embodiment, for example, the quantized direction is used in pattern matching as a gradient direction. Characteristic amount (hereinafter, also referred to as “feature amount”).
なお、より精度の高いパターンマッチングを行なうために、16方位等に量子化しても良い。具体的な方向の量子化の詳細な手順については後述する。また、方向の量子化とは、勾配方向ANG(S)が所定の範囲内にある方向を一律にある特定の方向の勾配方向であると看做して取り扱うことを言う。 In order to perform pattern matching with higher accuracy, it may be quantized into 16 directions. A detailed procedure of quantization in a specific direction will be described later. In addition, direction quantization means that a direction in which the gradient direction ANG (S) is within a predetermined range is treated as a uniform gradient direction in a specific direction.
効率化部6は、注目画素の周囲で所定の画素数を含む領域である照合領域と、あらかじめ定められたモデルパターンとの照合(以下、「パターンマッチング」と呼ぶこともある。)を行なう場合に、照合領域とモデルパターンとの照合の効率化を行なう。
The
一致画素数算出部7は、例えば、照合領域と、モデルパターンとの照合を行って、照合領域に含まれる勾配方向と、モデルパターンに含まれる勾配方向とが一致する画素数(以下、「一致画素数」と呼ぶ。)を算出する。
For example, the matching pixel
モデルパターン・比較用一致パターン格納部8は、モデルパターンと、比較用一致パターンとを格納する。比較用一致パターンは、照合領域に含まれる画素ごとの勾配方向とモデルパターンに含まれる画素ごとの勾配方向との一致パターンを分析することによってあらかじめ定めたパターンである。
The model pattern / comparison match
具体的には、この比較用一致パターンは、照合領域に含まれる画素ごとの勾配方向と、モデルパターンに含まれる画素ごとの勾配方向との、合致方向の種類数である。そして、この比較用一致パターンは、照合領域の形状がモデルパターン形状に近づくほど照合領域とモデルパターンとの間における一致パターンとの類似度が高くなる比較用完全一致パターンと、照合領域の形状がモデルパターン形状の一部の形状に近づくほど照合領域とモデルパターンとの間における一致パターンとの類似度が高くなる比較用部分的一致パターンと、を含んでいる。 Specifically, the comparison matching pattern is the number of types of matching directions between the gradient direction for each pixel included in the collation region and the gradient direction for each pixel included in the model pattern. The comparison matching pattern includes a comparison complete matching pattern in which the similarity between the matching region and the model pattern increases as the matching region shape approaches the model pattern shape, and the matching region shape The comparison partial matching pattern in which the similarity between the matching area and the model pattern increases as the part of the model pattern shape approaches is included.
この比較用完全一致パターンと比較用部分的一致パターンとは、照合領域に含まれる画素ごとの勾配方向と、モデルパターンに含まれる画素ごとの勾配方向との、合致方向の種類数に応じて定められている。すなわち、本実施の形態のように、8方向に量子化したものを勾配方向とした場合であれば、この8方向のうちいずれの方向が照合領域とモデルパターンとの間において合致しているかによって、これら2つの比較用一致パターンが定められている。例えば、比較用完全一致パターンを8方向のうち6方向以上合致するパターンと定め、比較用部分的一致パターンを8方向のうち4〜5方向合致するパターンと定めるが如くである。 The complete matching pattern for comparison and the partial matching pattern for comparison are determined according to the number of types of matching directions of the gradient direction for each pixel included in the matching region and the gradient direction for each pixel included in the model pattern. It has been. That is, as in this embodiment, if the direction quantized in 8 directions is used as the gradient direction, depending on which of the 8 directions matches between the matching region and the model pattern. These two comparison matching patterns are defined. For example, the complete matching pattern for comparison is defined as a pattern that matches 6 or more of the 8 directions, and the partial matching pattern for comparison is defined as a pattern that matches 4 to 5 of the 8 directions.
また、モデルパターン・比較用一致パターン格納部8は、例えば、磁気テープやカセットテープ等のテープ系、フロッピー(登録商標)ディスク/ハードディスク等の磁気ディスクやコンパクトディスク−ROM/MO/MD/デジタルビデオデイスク/コンパクトディスク−R等の光ディスクを含むディスク系、ICカード(メモリカードを含む)/光カード等のカード系、あるいはマスクROM/EPROM/EEPROM/フラッシュROM等の半導体メモリ系等を用いることができる。
The model pattern / comparison
パターン合致度算出部9は、照合領域に含まれる画素ごとの勾配方向とモデルパターンに含まれる画素ごとの勾配方向との一致パターンと、あらかじめ定められた比較用一致パターンとが類似する度合いを示すパターン合致度を算出する。
The pattern matching
そして、パターン合致度算出部9は、照合領域の形状がモデルパターン形状と一致するときには照合領域とモデルパターンとの間における一致パターンと比較用完全一致パターンとが類似する度合いを示す完全パターン合致度を最大とする。また、パターン合致度算出部9は、照合領域の形状がモデルパターン形状の一部の形状に一致するときには照合領域とモデルパターンとの間における一致パターンと比較用部分的一致パターンとが類似する度合いを示す部分的パターン合致度を最大とする。
Then, the pattern matching
なお、照合領域と、あらかじめ定められたモデルパターンとの照合(パターンマッチング)に使用される量としては、画素値(濃度値)等のスカラー量も用いることができる。 Note that a scalar quantity such as a pixel value (density value) can also be used as the quantity used for matching (pattern matching) between the matching area and a predetermined model pattern.
一方、画素値の勾配はベクトル量であり、大きさ(勾配の大きさABS(S))と向き(勾配方向ANG(S))とを持つものである。ここで、特に、勾配方向(向き)は、例えば8方向に量子化したりすることによって、1つの画素がとり得る状態を8(無方向を含めると9)という極めて少ない状態に離散化することでき、さらにそれぞれの状態には、方向が異なるという識別が容易な特徴を持たせる事ができる。 On the other hand, the gradient of the pixel value is a vector quantity, and has a magnitude (gradient magnitude ABS (S)) and a direction (gradient direction ANG (S)). Here, in particular, with respect to the gradient direction (direction), for example, by quantizing in 8 directions, the state that can be taken by one pixel can be discretized into 8 (9 including non-directional directions). In addition, each state can have a feature that allows easy identification of different directions.
また、勾配方向は、上述したような傾向がある。また、これらの傾向は、撮像対象の状況等に応じて、大きく変わることは無い。したがって、勾配方向は、パターンマッチングに適した量である。 The gradient direction tends to be as described above. Also, these tendencies do not change greatly depending on the situation of the imaging target. Therefore, the gradient direction is an amount suitable for pattern matching.
スコア算出部10は、一致画素数算出部7が算出した一致画素数、及びパターン合致度算出部9が算出したパターン合致度から、照合領域とモデルパターンとのマッチングの度合いを示す合致度を算出する。
The
具体的には、スコア算出部10は、パターン合致度算出部9が算出したパターン合致度が完全パターン合致度であれば、その完全パターン合致度を用いて、照合領域の形状とモデルパターン形状とのマッチングの度合いを示す完全合致度を算出する。また、スコア算出部10は、パターン合致度算出部9が算出したパターン合致度が部分的パターン合致度であれば、その部分的パターン合致度を用いて、照合領域の形状とモデルパターン形状の一部の形状とのマッチングの度合いを示す部分的合致度を算出する。
Specifically, if the pattern matching degree calculated by the pattern matching
位置特定部11は、スコア算出部10が算出した合致度が最大となる画素(以下、「ピーク画素」と呼ぶ。)の位置から、撮像対象による撮像画像上の指示位置を特定する。
The
すなわち、位置特定部11は、スコア算出部10が完全合致度を算出した場合であれば、その完全合致度が最大となるピーク画素の位置から、撮像対象による撮像画像上の指示位置を特定する。また、位置特定部11は、スコア算出部10が部分的合致度を算出した場合であれば、その部分的合致度が最大となるピーク画素の位置から、撮像対象の一部による撮像画像上の指示位置を特定する。
In other words, if the
また、位置特定部11は、ピーク探索部12と、座標算出判定部13と、座標算出部14と、を有している。
The
ピーク探索部12は、注目画素の周囲で所定の画素数を含む探索領域(以下、「第1領域」と呼ぶ場合がある。)内で、スコア算出部10が算出した合致度が最大値をとる画素であるピーク画素を探索する。
The
座標算出判定部13は、探索領域の画素数よりも少ない所定の画素数を有すると共に、探索領域内に完全に包含される小領域(以下、「第2領域」と呼ぶ場合がある。)内に、ピーク探索部12が発見したピーク画素が存在することを判定した場合に、座標算出部14に撮像対象による撮像画像上の指示位置を算出させる。
The coordinate
座標算出部14は、ピーク探索部12が発見したピーク画素を中心とする所定の画素数を含む領域であるピーク画素領域内の、画素ごとの合致度を用いて、撮像対象による撮像画像上の指示位置を算出するものである。
The coordinate
なお、ピーク探索部12、座標算出判定部13及び座標算出部14が行なう上記の動作は、スコア算出部10が部分的合致度を算出した場合でも同様である。
Note that the operations performed by the
パターン結合部15は、スコア算出部10が部分的合致度を算出する度に、位置特定部11が算出した、撮像対象の一部による撮像画像上の指示位置を取得する。そして、パターン結合部15は、パターン情報格納部16に格納されているパターン情報と、結合条件格納部17にあらかじめ格納されている結合条件と、上記のように取得した撮像対象の一部による撮像画像上の指示位置と、を用いて、モデルパターン形状の一部の形状に一致する形状を持つ照合領域のうち、単一領域として互いに結合すべきものがあるか否かを判断し、その結合すべきとの判断に基づいて、それら照合領域を結合する。
The
そして、パターン結合部15は、それら結合する照合領域の各々の指示位置を用いて、単一領域として結合された後の領域の指示位置を算出する。
Then, the
パターン情報格納部16は、パターン合致度算出部9が算出した部分的パターン合致度と、スコア算出部10が算出した部分的合致度と、を順次格納される。また、パターン情報格納部16は、パターン合致度算出部9が部分的パターン合致度を算出する際に利用する、照合領域に含まれる画素ごとの勾配方向と、モデルパターンに含まれる画素ごとの勾配方向との、合致方向の種類数も、順次格納する。パターン情報格納部16は、これら部分的パターン合致度、部分的合致度、合致方向の種類数を、パターン情報として格納する。
The pattern
結合条件格納部17は、パターン結合部15がモデルパターン形状の一部の形状に一致する形状を持つ照合領域のうち、単一領域として互いに結合すべきものがあるか否かを判断する際、その判断基準となる結合条件をあらかじめ格納している。
When the combination
また、パターン情報格納部16及び結合条件格納部17は、例えば、磁気テープやカセットテープ等のテープ系、フロッピー(登録商標)ディスク/ハードディスク等の磁気ディスクやコンパクトディスク−ROM/MO/MD/デジタルビデオデイスク/コンパクトディスク−R等の光ディスクを含むディスク系、ICカード(メモリカードを含む)/光カード等のカード系、あるいはマスクROM/EPROM/EEPROM/フラッシュROM等の半導体メモリ系等を用いることができる。
The pattern
(2.画像処理装置の動作の概要)
次に、画像処理装置1の動作の概要について説明する。
(2. Outline of operation of image processing apparatus)
Next, an outline of the operation of the
図3は画像処理装置1の全体的な動作の概要を示すフローチャートである。ステップS101では、図1の低解像度化部2が画像データを低解像度化し、S102に進む。例えば、320×240画素の画像データであれば、160×120画素(低解像度化率1/2)、又は80×60画素(低解像度化率1/4)等のようにバイリニア縮小させる。ここで、バイリニア縮小とは、例えば2×2の各画素が持つ画素値の平均値をとり、2×2画素のデータを、該平均値を持った1×1画素のデータに置き換えることにより、全体として1/4の情報圧縮を行なうことを言う。
FIG. 3 is a flowchart showing an outline of the overall operation of the
なお、高速処理の観点からは、できるだけ低解像度化することが好ましいが、必要なエッジ情報等を得るためには、例えば320×240画素(150dpi)の画像データの場合であれば、80×60画素(低解像度化率1/4)を低解像度化の限度とすることが好ましい。また、高精度処理の観点からは、低解像度化を全く行なわないか、低解像度化するとしても、160×120画素(低解像度化率1/2)に留めることが好ましい。
From the viewpoint of high-speed processing, it is preferable to reduce the resolution as much as possible. However, in order to obtain necessary edge information and the like, for example, in the case of image data of 320 × 240 pixels (150 dpi), 80 × 60. It is preferable to set the pixel (
以上の画像データの低解像度化により、パターンマッチングの処理コストやメモリ容量の少量化、及び処理時間の短縮化を図ることがきる。 By reducing the resolution of the image data as described above, it is possible to reduce the pattern matching processing cost, the memory capacity, and the processing time.
S102では、縦勾配量算出部3a及び横勾配量算出部3bが、画像データ上の画素ごとに、縦方向勾配量Sy及び横方向勾配量Sxを算出してから、方向特定部5が、画素ごとの勾配方向と無方向とのいずれかを特定するまでの過程(勾配方向・無方向特定過程)を経た上で、S103に進む。
In S102, the vertical gradient
S103では、効率化部6で、照合領域と、モデルパターンとの照合を行なう場合に、照合領域とモデルパターンとの照合の効率化を図るか否か、つまり、照合効率化の要否を選択する。照合効率化を行なう場合(Yes)には、S104に進み、効率化部6で照合効率化を行った上でS105に進み、照合効率化を行なわない場合(No)にはS108に進み、効率化部6は何もせず、そのままの情報(画像データ、但し、低解像度化部2で、低解像度化している場合には、低解像度化後の画像データ)でS105に進む。
In S103, when the collation area and the model pattern are collated by the
S105では、一致画素数算出部7が、照合領域とモデルパターンとの照合を行って、一致画素数を算出し、パターン合致度算出部9が、パターン合致度を算出してから、スコア算出部10が、一致画素数算出部7が算出した一致画素数、及び、パターン合致度算出部9が算出したパターン合致度から、合致度を算出するまでの過程(パターンマッチング過程)を経た上で、S106に進む。
In S105, the matching pixel
S106では、位置特定部11が、スコア算出部10が算出した合致度が最大となる画素(以下、「ピーク画素」と呼ぶ。)の位置から、撮像対象による撮像画像上の指示位置を特定する過程(ポインティング位置特定過程)を経た上で、S107に進む。
In S <b> 106, the
S107では、パターン結合部15が、モデルパターン形状の一部の形状に一致する形状を持つ照合領域のうち、単一領域として互いに結合すべきものがあるか否かを判断し、その結合すべきとの判断に基づいて、それら照合領域を結合して「エンド」となる(結合過程)。
In S107, the
以上が、画像処理装置1の全体の動作概要である。以下では、勾配方向・無方向特定過程、照合効率化、パターンマッチング過程、ポインティング位置特定過程及び結合過程における画像処理装置1の各動作について説明する。
The above is the overall operation overview of the
(3.勾配方向・無方向特定過程)
まず、図1、図4、図5(a)及び図5(b)に基づいて、勾配方向・無方向特定過程における画像処理装置1の動作について説明する。
(3. Gradient direction / non-directional identification process)
First, the operation of the
図4は、画像処理装置1の動作のうち、勾配方向・無方向特定過程の動作を示すフローチャートである。図5(a)は、勾配方向・無方向特定過程において参照されるテーブルの一例であり、図5(b)は、勾配方向・無方向特定過程において参照されるテーブルの他の例である。
FIG. 4 is a flowchart showing the operation of the gradient direction / non-direction specifying process among the operations of the
図4のフローチャートでは、まず、縦勾配量算出部3a及び横勾配量算出部3bがそれぞれ、縦方向勾配量Sy及び横方向勾配量Sxを算出してからスタートする。
In the flowchart of FIG. 4, the process starts after the vertical gradient
S201では、エッジ抽出部4が、各画素における勾配の大きさABS(S)がエッジ閾値以上か否かを判定し、ABS(S)≧エッジ閾値ならば(Yes)、S202に進み、ABS(S)<エッジ閾値ならば(No)、S210に進む。なお、本実施の形態では、ABS(S)=Sx×Sx+Sy×Syとして計算しているが、この量は、上式(4)における厳密な意味で勾配の大きさと異なる。しかし、実装上はこのように勾配の大きさを定義しても問題は無い。
In S201, the
S210に進んだ場合には、方向特定部5は、対象となっている画素、つまり、エッジ画素以外の画素を無方向と設定(特定)し、次の画素へ進んで、S201に戻る。なお、S202に進んだ場合には、対象となっている画素は、無論、エッジ画素である。
When the process proceeds to S210, the
S202では、方向特定部5が、横方向勾配量Sxが0であるか否かを判定し、Sx≠0ならば、S203(Yes)に進み、Sx=0ならば、S206(No)に進む。
In S202, the
S203では、方向特定部5は、横方向勾配量Sxが正の値をとるか否かを判定し、Sx>0ならば、S204(Yes)に進み、方向特定部5は、図5(a)のテーブルにしたがって、該当画素について、勾配方向ANG(S)に応じて量子化された勾配方向を設定する。
In S203, the
一方、Sx<0ならば、S205に進み、方向特定部5は、図5(b)のテーブルにしたがって、該当画素について、勾配方向ANG(S)に応じて量子化された勾配方向を設定する。
On the other hand, if Sx <0, the process proceeds to S205, and the
次に、S206では、方向特定部5は、縦方向勾配量Syが0か否かを判定し、Sy≠0ならば、S207(Yes)に進み、Sy=0ならば、S210(No)に進み、該当画素を無方向と設定し、次の画素へ進んでS201に戻る。
Next, in S206, the
S207では、方向特定部5は、縦方向勾配量Syが正の値をとるか否かを判定し、Sy>0ならば、S208(Yes)に進み、該当画素の勾配方向を上向きに設定して、S201に戻る。
In S207, the
一方、Sy<0ならば、S209(No)に進み、該当画素の勾配方向を下向きに設定して、次の画素へ進んでS201に戻る。 On the other hand, if Sy <0, the process proceeds to S209 (No), the gradient direction of the corresponding pixel is set downward, the process proceeds to the next pixel, and the process returns to S201.
以上の工程は、すべての画素の勾配方向・無方向の設定が終わるまで繰り返される。 The above process is repeated until the setting of the gradient direction / non-direction of all pixels is completed.
パターンマッチングにおいて重要な情報は、エッジ部分の画素であるエッジ画素における勾配方向である。 The important information in pattern matching is the gradient direction in the edge pixel that is the pixel of the edge portion.
したがって、上記の動作により、あまり重要でないエッジ画素以外の画素における勾配方向を一律無方向と看做すことで、パターンマッチングの効率化をさらに向上させることができる。また、撮像対象による撮像画像上の指示位置の検出を可能としてメモリ容量を少量化すること及び処理時間を短縮化することを可能とし、指示位置の検出処理のコストをさらに削減させることができる。 Therefore, with the above-described operation, it is possible to further improve the efficiency of pattern matching by regarding the gradient direction in pixels other than the less important edge pixels as uniform directions. In addition, it is possible to detect the designated position on the picked-up image by the imaging target, to reduce the memory capacity and the processing time, and to further reduce the cost of the designated position detection process.
(4.照合効率化)
次に、画像処理装置1における照合効率化について説明する。
(4. Verification efficiency improvement)
Next, collation efficiency improvement in the
図1に示す効率化部6は、照合領域を、複数の同一画素数の分割領域に分割すると共に、分割領域ごとに、分割領域に含まれる画素ごとの勾配方向及び無方向の情報を、分割領域に含まれる勾配方向及び前記無方向の情報に置き換えることで、照合領域とモデルパターンとの照合の効率化を図る。
The
また、スコア算出部10は、効率化部6によって照合の効率化が行なわれた照合領域とモデルパターンとの照合を行なって、照合領域内のそれぞれの分割領域に含まれる勾配方向と、モデルパターンにおける勾配方向との一致数を、前記合致度として算出する。
In addition, the
上述のように、勾配方向は、おおよその傾向がある。また、これらの傾向は、撮像対象の状況等に応じて、大きく変わることは無い。したがって、分割領域の画素数をあまり大きくしなければ、該分割領域内における勾配方向の画素の位置は、勾配方向を用いたパターンマッチングにおいてあまり重要な情報ではない。 As described above, the gradient direction tends to be approximate. Also, these tendencies do not change greatly depending on the situation of the imaging target. Therefore, unless the number of pixels in the divided region is increased too much, the position of the pixel in the gradient direction in the divided region is not very important information in pattern matching using the gradient direction.
そこで、分割領域ごとに、分割領域に含まれる画素ごとの勾配方向及び無方向の情報を、分割領域に含まれる勾配方向及び無方向の情報に置き換えることにより、パターンマッチングの照合精度を維持しつつ、照合効率化が可能となる。また、この効率化に伴い、撮像対象による前記撮像画像上の指示位置の検出処理に要するコストを削減することもできる。 Therefore, for each divided region, by replacing the gradient direction and non-directional information for each pixel included in the divided region with the gradient direction and non-directional information included in the divided region, while maintaining the matching accuracy of pattern matching Thus, collation efficiency can be improved. Further, with this efficiency improvement, it is possible to reduce the cost required for the detection processing of the designated position on the captured image by the imaging target.
以上より、パターンマッチングの照合精度を維持しつつ、照合効率化を可能とし、撮像対象による撮像画像上の指示位置の検出処理に要するコストを削減することができる画像処理装置1を提供することができる。
As described above, it is possible to provide the
ここで、図6(a)及び図6(b)に基づき、画像処理装置1における照合効率化の具体例について説明する。
Here, based on FIG. 6A and FIG. 6B, a specific example of collation efficiency improvement in the
まず、図6(a)に示すように、周囲が暗い場合における画像データの各画素における勾配方向の分布の特徴は、中央にほぼ円形状である、無方向の画素の領域があり、その回りをとり囲むようにして該無方向の領域に向かう向きの勾配方向を持つ画素が多数分布している。 First, as shown in FIG. 6A, the characteristic of the distribution in the gradient direction of each pixel of the image data in the case where the surrounding is dark is a non-directional pixel region having a substantially circular shape at the center. A large number of pixels having a gradient direction directed toward the non-directional region are distributed.
次に、図6(b)は、図6(a)の画像データについて照合効率化を行った後の様子を示す概要図である。 Next, FIG. 6B is a schematic diagram showing a state after the collation efficiency is improved for the image data of FIG.
図6(a)に示すように、14×14画素の領域(照合領域)を、複数の2×2画素の領域(分割領域)に分割すると共に、2×2画素の領域ごとに、2×2画素の領域に含まれる画素ごとの勾配方向及び無方向の情報を、2×2画素の領域に含まれる勾配方向及び無方向の情報に置き換えることで、14×14画素の領域とモデルパターン(モデルパターンの例については後に詳しく説明する。)との照合の効率化が行われる。 As shown in FIG. 6A, a 14 × 14 pixel region (collation region) is divided into a plurality of 2 × 2 pixel regions (divided regions) and 2 × 2 pixel regions are divided into 2 × 2 pixels. By replacing the gradient direction and non-direction information for each pixel included in the 2-pixel area with the gradient direction and non-direction information included in the 2 × 2-pixel area, the 14 × 14-pixel area and the model pattern ( An example of the model pattern will be described in detail later).
たとえば、図6(a)に示す14×14画素の領域を分割した複数の2×2画素領域のうち、上から2つめ、左から1つめの2×2画素の領域には、左上の画素が「無方向」、右上の画素が「右下向き(勾配方向)」、左下の画素が「右向き(勾配方向)」、及び右下の画素が「右下向き(勾配方向)」となっている。この2×2画素の領域について各勾配方向の存在位置に関する情報を省略したものが、図6(b)の上から2つめ、左から1つめのブロック(以下、便宜上「画素」と呼ぶ場合がある。)である。他のブロックも同様にして生成することができる。結果として、図6(a)に示す14×14画素領域は、合計7×7=49個の2×2画素領域に分割される。 For example, among the plurality of 2 × 2 pixel regions obtained by dividing the 14 × 14 pixel region shown in FIG. 6A, the upper left pixel is the second 2 × 2 pixel region from the top and the first 2 × 2 pixel region from the left. Is “no direction”, the upper right pixel is “right downward (gradient direction)”, the lower left pixel is “rightward (gradient direction)”, and the lower right pixel is “right downward (gradient direction)”. In this 2 × 2 pixel region, information regarding the existence position in each gradient direction is omitted. The second block from the top in FIG. 6B and the first block from the left (hereinafter, referred to as “pixel” for convenience). Yes.) Other blocks can be generated in the same manner. As a result, the 14 × 14 pixel region shown in FIG. 6A is divided into a total of 7 × 7 = 49 2 × 2 pixel regions.
次に、図7(a)〜図9(b)に基づき、照合領域と照合されるモデルパターンの具体例について説明する。 Next, a specific example of a model pattern to be collated with the collation area will be described with reference to FIGS. 7 (a) to 9 (b).
図7(a)は、周囲が暗い場合における照合効率化前の画像データと照合されるモデルパターンの一例を示す概要図である。また、図7(a)のモデルパターンは、図6(a)に示す14×14画素の領域とパターンマッチングを行なう場合を想定したものである。また、撮像対象としては、指腹を想定している。 FIG. 7A is a schematic diagram showing an example of a model pattern that is collated with image data before collation efficiency improvement when the surroundings are dark. In addition, the model pattern in FIG. 7A is assumed to perform pattern matching with the 14 × 14 pixel region shown in FIG. In addition, a finger pad is assumed as an imaging target.
ところで、図7(a)のモデルパターンは、13×13画素のモデルパターンとなっている。この場合、図6(a)に示す14×14画素の領域と全画素数が異なっているが、この例のように照合領域とモデルパターンとの画素数は必ずしも一致しなくても良い。 By the way, the model pattern of FIG. 7A is a 13 × 13 pixel model pattern. In this case, although the total number of pixels is different from the 14 × 14 pixel area shown in FIG. 6A, the number of pixels in the collation area and the model pattern does not necessarily match as in this example.
また、奇数×奇数(13×13)としているのは、中心の画素が1つとなるようにするためである。この中心の画素を画像データ上の着目画素にあわせて1画素づつ、ずらせてパターンマッチングを行なう。 The reason why the odd number × odd number (13 × 13) is set is that the center pixel is one. Pattern matching is performed by shifting the center pixel by one pixel in accordance with the pixel of interest on the image data.
この場合の一致画素数は、1画素ごとに照合されて算出されるので、13×13=169画素の照合が必要となる。 Since the number of matching pixels in this case is collated and calculated for each pixel, it is necessary to collate 13 × 13 = 169 pixels.
一方、図7(b)は、周囲が明るい場合における照合効率化前の画像データと照合されるモデルパターンの一例を示す概要図である。図7(a)のモデルパターンと比較すると各画素の勾配方向が逆向きになっている。図7(a)は、バックライトの光の反射光を基礎として撮像された画像データを想定したものであり、中央に向かうほど明るくなっている様子を示している。一方、図7(b)は、外光を基礎として撮像された画像データを想定したものであり、画像のエッジ部分に向けて明るくなっている様子を示している。 On the other hand, FIG. 7B is a schematic diagram illustrating an example of a model pattern that is collated with image data before collation efficiency improvement when the surroundings are bright. Compared with the model pattern of FIG. 7A, the gradient direction of each pixel is reversed. FIG. 7A assumes image data picked up based on the reflected light of the backlight, and shows a state of becoming brighter toward the center. On the other hand, FIG. 7B assumes image data captured on the basis of external light, and shows a state in which the image data becomes brighter toward the edge portion of the image.
次に、図8(a)は、周囲が暗い場合における照合効率化後の画像データと照合されるモデルパターンの一例を示す概要図である。図8(a)のモデルパターンは、図6(b)の照合効率化後の照合領域とのパターンマッチングを想定したものである。この例のように、照合領域とモデルパターンとデータ形式は必ずしも同一でなくても良い。この例では、2×2画素の領域を1画素(与えられる勾配方向は1つ)と看做してモデルパターンを簡略化することにより、さらなる照合の効率化を図っている。 Next, FIG. 8A is a schematic diagram illustrating an example of a model pattern that is collated with image data after collation efficiency in the case where the surrounding is dark. The model pattern in FIG. 8A assumes pattern matching with the collation area after the collation efficiency in FIG. 6B. As in this example, the collation area, the model pattern, and the data format are not necessarily the same. In this example, a 2 × 2 pixel region is regarded as one pixel (one gradient direction is given), and the model pattern is simplified to further improve the efficiency of matching.
図8(b)は、周囲が明るい場合における照合効率化後の画像データと照合されるモデルパターンの一例を示す概要図である。図8(a)は、バックライトの光の反射光を基礎として撮像された画像データを想定したものであり、中央に向かうほど明るくなっている様子を示している。一方、図8(b)は、外光を基礎として撮像された画像データを想定したものであり、画像のエッジ部分に向けて明るくなっている様子を示している。 FIG. 8B is a schematic diagram illustrating an example of a model pattern that is collated with the image data after the collation efficiency is improved when the surroundings are bright. FIG. 8A assumes image data picked up based on the reflected light of the backlight, and shows a state of becoming brighter toward the center. On the other hand, FIG. 8B assumes image data captured on the basis of external light, and shows a state in which the image is brightened toward the edge portion of the image.
図9(a)は、周囲が暗い場合における照合効率化後の画像データと照合されるモデルパターンの他の例を示す概要図である。図8(a)のモデルパターンとの違いは、2×2画素分が1つの領域に纏められているが、該1つの領域ごとに、2つの勾配方向(又は無方向)の自由度が与えられている点である。このようなモデルパターンを工夫することにより、照合の効率化を図りつつ、照合精度を高めることができる。 FIG. 9A is a schematic diagram illustrating another example of a model pattern that is collated with image data after collation efficiency improvement when the surrounding is dark. The difference from the model pattern in FIG. 8A is that 2 × 2 pixels are grouped in one area, but each one area gives two degrees of freedom in the gradient direction (or no direction). This is the point. By devising such a model pattern, it is possible to improve collation accuracy while improving collation efficiency.
図9(b)は、周囲が明るい場合における照合効率化後の画像データと照合されるモデルパターンの他の例を示す概要図である。図9(a)は、バックライトの光の反射光を基礎として撮像された画像データを想定したものであり、中央に向かうほど明るくなっている様子を示している。一方、図9(b)は、外光を基礎として撮像された画像データを想定したものであり、画像のエッジ部分に向けて明るくなっている様子を示している。 FIG. 9B is a schematic diagram showing another example of a model pattern that is collated with the image data after the collation efficiency is improved when the surroundings are bright. FIG. 9A assumes image data picked up based on the reflected light of the backlight, and shows a state where the image data becomes brighter toward the center. On the other hand, FIG. 9B assumes image data picked up based on outside light, and shows a state in which the image data becomes brighter toward the edge portion of the image.
(5.パターンマッチング過程)
次に、画像処理装置1におけるパターンマッチングの過程について説明する。
(5. Pattern matching process)
Next, a pattern matching process in the
図10は、図1に示す画像処理装置1の動作のうち、パターンマッチング過程の動作を示すフローチャートである。
FIG. 10 is a flowchart showing the operation of the pattern matching process among the operations of the
S301では、一致画素数算出部7が、照合領域とモデルパターンとの照合を行って、照合領域に含まれる勾配方向と、モデルパターンに含まれる勾配方向とが一致する画素数(一致画素数)を算出してS302に進む。
In S301, the matching pixel
S302では、パターン合致度算出部9が、方向特定部5又は効率化部6からパターン合致度の算出を決定した旨の通知を受けて、パターン合致度を算出し、S303に進む。
In S302, the pattern matching
S303では、パターン合致度算出部9が、一致画素数算出部7が算出した一致画素数及びパターン合致度算出部9が算出したパターン合致度を、合算した量を照合領域とモデルパターンとのマッチングの度合いを示す合致度として算出する。
In S303, the pattern matching
次に、パターンマッチング過程におけるスコア算出部10の具体的なスコア(合致度)算出方法について説明する。
Next, a specific score (matching degree) calculation method of the
まず、スコア算出部10が照合領域の形状とモデルパターン形状とのマッチングの度合いを示す完全合致度を算出する場合について説明する。
First, the case where the
図11(a)は、照合効率化前の周囲が暗い場合における照合領域と、モデルパターンとのパターンマッチングを説明するための概要図であり、図11(b)は、その合致度算出方法の一例を示す図である。 FIG. 11A is a schematic diagram for explaining pattern matching between a matching region and a model pattern in the case where the surroundings before darkening efficiency is dark, and FIG. It is a figure which shows an example.
図11(a)は、図6(a)の照合領域と、図7(a)のモデルパターンとのパターンマッチングを行ったものを示している。ここで、図の中央の7行7列(以下では、横方向に並ぶ画素を「列」、縦方向に並ぶ画素を「行」と呼ぶ。また、上から行、左から列を数える。)にある1×1画素はスコアが付与される注目画素の位置である。網掛けされた部分は、照合領域とモデルパターンとで、勾配方向が一致している画素を示している。 FIG. 11A shows the result of pattern matching between the collation region of FIG. 6A and the model pattern of FIG. 7A. Here, 7 rows and 7 columns in the center of the figure (hereinafter, pixels arranged in the horizontal direction are called “columns”, and pixels arranged in the vertical direction are called “rows”. Further, the rows are counted from the top and the columns from the left). 1 × 1 pixel is the position of the target pixel to which a score is assigned. The shaded portion indicates pixels in which the gradient directions match in the matching region and the model pattern.
図11(b)に示す、一致パターンは、一致した方向の種類数を見る場合のテーブルを示している。本例では、8方向のすべてについて一致した画素が存在していることを示している。 The matching pattern shown in FIG. 11B shows a table when the number of types in the matching direction is viewed. In this example, it is shown that there is a matching pixel in all eight directions.
次に、図11(b)に示す、一致画素数の計算は、上記網掛けの部分を左上の1行1列の画素から、右下の13行13列の画素までの一致画素数を算出する方法の一例を示すものである。ここでは、勾配方向が与えられている画素で、モデルパターンの勾配方向と一致した画素を「1」とし、無方向及びモデルパターンの勾配方向と一致していない画素は「0」として計算している。なお、無方向と判定された画素は、最初から計算に含めない構成としても良い。ここでは、網掛けで示された一致画素数は「85」であるとの算出結果を得ている。なお、この一致画素数をスコア(合致度)として用いても良いが、以下で説明するような正規化一致画素数(合致度)を用いても良い。
Next, the number of matching pixels shown in FIG. 11B is calculated by calculating the number of matching pixels from the pixel in the
次に、図11(b)に示す、正規化一致画素数について説明する。この正規化一致画素数は、例えば、照合精度を高めるためモデルパターンを複数種類用意してパターンマッチングを行なう場合(例えば、21×21、13×13、及び7×7画素の3種類のモデルパターン)に、モデルパターンのサイズに依存しない量として一致画素数を正規化するものである。 Next, the number of normalized matching pixels shown in FIG. The number of normalized matching pixels is, for example, when pattern matching is performed by preparing a plurality of model patterns in order to improve matching accuracy (for example, three types of model patterns of 21 × 21, 13 × 13, and 7 × 7 pixels). ) Normalizes the number of matched pixels as an amount independent of the size of the model pattern.
ここでは、正規化一致画素数を、次式(6)で定義する。 Here, the number of normalized matching pixels is defined by the following equation (6).
正規化一致画素数=適当な定数×(一致画素数/モデル中の方向成分が存在する要素数) ・・・・(6)
なお、「適当な定数」は、計算の便宜等を考慮して適宜定めれば良い。ここでは、正規化一致画素数が0〜10の範囲となるように、適当な定数=10と設定している。なお、以下で説明するパターンマッチングの例においても正規化一致画素数を使用しているが、説明は省略する。
Number of normalized matching pixels = appropriate constant × (number of matching pixels / number of elements having a direction component in the model) (6)
The “appropriate constant” may be appropriately determined in consideration of the convenience of calculation. Here, an appropriate constant = 10 is set so that the number of normalized matching pixels is in the range of 0-10. Note that, in the example of pattern matching described below, the normalized matching pixel number is used, but the description is omitted.
(6)式から、図11(a)の場合の正規化一致画素数を求めると以下のようになる。 From the equation (6), the normalized coincidence pixel number in the case of FIG. 11A is obtained as follows.
正規化一致画素数=10×(85/136)=6.25≒6
次に、図12(a)は、照合効率化後の周囲が暗い場合における照合領域と、モデルパターンとのパターンマッチングを説明するための概要図であり、図12(b)は、その合致度算出方法の一例を示す図である。
Number of normalized matching pixels = 10 × (85/136) = 6.25≈6
Next, FIG. 12A is a schematic diagram for explaining pattern matching between a matching area and a model pattern in the case where the surroundings after darkening the matching efficiency are dark, and FIG. It is a figure which shows an example of the calculation method.
図12(a)は、図6(b)の照合効率化後の照合領域と、図8(a)のモデルパターンとのパターンマッチングを行ったものを示している。ここで、図の中央の4行4列にある1×1画素(2×2画素に相当するものであるが、便宜上「画素」と言う。)は、スコアが付与される注目画素の位置である。網掛けされた部分は、照合領域とモデルパターンとで、勾配方向が一致している場合がある画素を示している。 FIG. 12A shows a result of pattern matching between the collation area after collation efficiency in FIG. 6B and the model pattern in FIG. 8A. Here, 1 × 1 pixel (corresponding to 2 × 2 pixels, but referred to as “pixel” for convenience) in 4 rows and 4 columns in the center of the figure is the position of the target pixel to which a score is assigned. is there. The shaded portion indicates pixels that may have the same gradient direction in the matching region and the model pattern.
図12(b)に示す、一致パターンは、一致した方向の種類数を見る場合のテーブルを示している。本例では、8方向のすべてについて一致した画素が存在していることを示している。 The matching pattern shown in FIG. 12B shows a table when the number of types in the matching direction is viewed. In this example, it is shown that there is a matching pixel in all eight directions.
次に、図12(b)に示す、一致画素数の計算は、上記網掛けの部分を左上の1行1列の画素から、右下の7行7列の画素までの一致画素数を算出する方法の一例を示すものである。ここでは、例えば、1行2列では、照合領域では、勾配方向が「右下」の画素が「3つ」存在しており、一方、モデルパターンの勾配方向は、1つであるが、「右下」である。従って、この場合の一致画素数は、「3」と計算する。
Next, the number of matching pixels shown in FIG. 12B is calculated by calculating the number of matching pixels from the pixel in the
他の例では、2行1列では、照合領域では、勾配方向が「右下」の画素が「2つ」と、「右」が「1つ」存在しており、一方、モデルパターンの勾配方向は、1つであるが、「右下」である。勾配方向は、「右下」が「2つ」一致しているが、「右」は一致していない。従って、この場合の一致画素数は、「2」と計算する。なお、ここでは、無方向と判定された画素は、最初から計算に含めない構成としている。 In another example, in 2 rows and 1 column, in the matching region, there are “two” pixels having a gradient direction “lower right” and “one” “right”, while the gradient of the model pattern is There is one direction, but “bottom right”. As for the gradient direction, “bottom right” matches “two”, but “right” does not match. Therefore, the number of matching pixels in this case is calculated as “2”. Here, the pixel determined to be non-directional is not included in the calculation from the beginning.
以上の計算をすべての画素について行なえば、網掛けで示された部分の一致画素数は「91」であるとの算出結果を得ている。なお、この一致画素数をスコア(合致度)として用いても良いが、以下で説明するような正規化一致画素数を用いても良い。 If the above calculation is performed for all the pixels, a calculation result is obtained that the number of matching pixels in the shaded portion is “91”. The number of matching pixels may be used as a score (matching degree), but a normalized matching pixel number as described below may be used.
ここでは、正規化一致画素数を、次式(7)で定義する。 Here, the number of normalized matching pixels is defined by the following equation (7).
正規化一致画素数=適当な定数×(一致画素数/モデル中の方向成分が存在する要素数を4倍した値) ・・・・(7)
適当な定数=10と設定している。
Number of normalized matching pixels = appropriate constant × (number of matching pixels / value obtained by multiplying the number of elements having a direction component in the model by four) (7)
Appropriate constant = 10 is set.
(7)式から、図11(a)の場合の正規化一致画素数を求めると以下のようになる。 From the equation (7), the number of normalized matching pixels in the case of FIG. 11A is obtained as follows.
正規化一致画素数=10×(91/176)=5.17≒5
次に、図13(a)は、照合効率化後の周囲が暗い場合における照合領域と、モデルパターンとのパターンマッチングを説明するための概要図であり、図13(b)は、その合致度算出方法の一例を示す図である。
Number of normalized matching pixels = 10 × (91/176) = 5.17≈5
Next, FIG. 13A is a schematic diagram for explaining pattern matching between a matching region and a model pattern in the case where the surroundings after darkening is dark, and FIG. 13B shows the degree of matching. It is a figure which shows an example of the calculation method.
図13(a)は、図6(b)の照合効率化後の照合領域と、図9(a)のモデルパターンとのパターンマッチングを行ったものを示している。ここで、図の中央の4行4列にある1×1画素(2×2画素に相当するものであるが、便宜上「画素」と言う。)は、スコアが付与される注目画素の位置である。網掛けされた部分は、照合領域とモデルパターンとで、勾配方向が一致している場合がある画素を示している。 FIG. 13A shows the result of pattern matching between the collation area after collation efficiency in FIG. 6B and the model pattern in FIG. 9A. Here, 1 × 1 pixel (corresponding to 2 × 2 pixels, but referred to as “pixel” for convenience) in 4 rows and 4 columns in the center of the figure is the position of the target pixel to which a score is assigned. is there. The shaded portion indicates pixels that may have the same gradient direction in the matching region and the model pattern.
図13(b)に示す、一致パターンは、一致した方向の種類数を見る場合のテーブルを示している。本例では、8方向のすべてについて一致した画素が存在していることを示している。 The matching pattern shown in FIG. 13B is a table when the number of types in the matching direction is viewed. In this example, it is shown that there is a matching pixel in all eight directions.
次に、図13(b)に示す、一致画素数の計算は、上記網掛けの部分を左上の1行1列の画素から、右下の7行7列の画素までの一致画素数を算出方法の一例を示すものである。ここでは、例えば、1行2列では、照合領域では、勾配方向が「右下」の画素が「3つ」存在しており、一方、モデルパターンの勾配方向は、2つであり、「右下」が「1つ」に「下」が「1つ」である。従って、「右下」が一致しているので、この場合の一致画素数は、「3」と計算する。
Next, the number of matching pixels shown in FIG. 13B is calculated by calculating the number of matching pixels from the pixel in the
他の例では、2行1列では、照合領域では、勾配方向が「右下」の画素が「2つ」と、「右」が「1つ」存在しており、一方、モデルパターンの勾配方向は、2つであるが、「右」が「1つ」と「右下」が「1つ」である。勾配方向は、「右」が「1つ」と「右下」が「2つ」一致している。従って、この場合の一致画素数は、「3」と計算する。なお、ここでは、無方向と判定された画素は、最初から計算に含めない構成としている。 In another example, in 2 rows and 1 column, in the matching region, there are “two” pixels having a gradient direction “lower right” and “one” “right”, while the gradient of the model pattern is There are two directions, but “right” is “one” and “lower right” is “one”. Regarding the gradient direction, “one” for “right” and “two” for “lower right” coincide. Therefore, the number of matching pixels in this case is calculated as “3”. Here, the pixel determined to be non-directional is not included in the calculation from the beginning.
ここで、下線を引いた数字と、引いてない数字とが記載されているが、下線を引いた数字は、図12(a)の場合と比較して、一致画素数が増加しているものを示している。 Here, numbers underlined and numbers not underlined are described, but the numbers underlined are those in which the number of matching pixels is increased compared to the case of FIG. Is shown.
この結果は、図8(a)のモデルパターンよりも図9(a)のモデルパターンを使用した場合の方が、より変形に強い(円形からの歪に対するロバスト性の高い)パターンマッチングが行なえることを示している。 As a result, pattern matching that is more resistant to deformation (higher robustness against distortion from a circle) can be performed when the model pattern of FIG. 9A is used than the model pattern of FIG. 8A. It is shown that.
以上の計算をすべての画素について行なえば、網掛けで示された部分の一致画素数は「119」であるとの算出結果を得ている。なお、この一致画素数をスコア(合致度)として用いても良いが、以下で説明するような正規化一致画素数を用いても良い。 If the above calculation is performed for all the pixels, a calculation result is obtained that the number of matching pixels in the shaded portion is “119”. The number of matching pixels may be used as a score (matching degree), but a normalized matching pixel number as described below may be used.
(7)式から、図13(a)の場合の正規化一致画素数を求めると以下のようになる。 From the equation (7), the number of normalized coincidence pixels in the case of FIG. 13A is obtained as follows.
正規化一致画素数=10×(119/176)=6.76≒7
次に、図14〜図17(b)に基づき、図1のスコア算出部10が、一致画素数と合致パターンとを併用して、スコア(合致度)を算出する場合について説明する。
Number of normalized matching pixels = 10 × (119/176) = 6.76≈7
Next, a case where the
図14は、画像処理装置1におけるパターンマッチングにおいて一致画素数とパターン合致度とを併用する場合について説明するためのフローチャートである。
FIG. 14 is a flowchart for explaining a case where the number of matching pixels and the degree of pattern matching are used together in pattern matching in the
図14のS401では、一致画素数算出部7が、一致画素数を初期化して、S402に進む。S402では、パターン合致度算出部9が一致パターンの初期化を行ってS403に進む。ここでは、勾配方向の種類数を初期化している様子を示している。すべての勾配方向が「無」と表示されているのは、このことを示している。
In S401 of FIG. 14, the coincidence pixel
S403では、一致画素数算出部7とパターン合致度算出部9とが1画素ごとに(照合効率化後の画素も含む)勾配方向の照合等を行って、S404に進む。
In S403, the coincidence pixel
S404では、方向が一致すれば(Yes)S405に進み、一致画素数算出部7が一致画素数に一致した方向の要素数(効率化処理なしの場合は「1」)を加えてS406に進み、一方、方向が一致する画素が全くなければ、(No)S401に戻る。
In S404, if the directions match (Yes), the process proceeds to S405, and the matching pixel
S406では、パターン合致度算出部9が一致した勾配方向を「有」と更新して、S407に進む。
In S406, the pattern coincidence
S407では、一致画素数算出部7及びパターン合致度算出部9がモデルパターンの全要素(画素)について照合が終了した場合には、(Yes)S408に進み、照合が終了していない場合には、(No)S403に戻る。
In S407, when the matching pixel
S408では、パターン合致度算出部9が一致パターンのチェックを行ない、S409に進む。この一致パターンのチェックの詳細については、後に説明する。
In S408, the pattern matching
S409では、パターン合致度算出部9が、モデルパターン・比較用一致パターン格納部8を参照して、「許可パターン」に該当するか否かを判定し、許可パターンに該当する場合は、(Yes)S410に進む。一方、許可パターンに該当しない場合は、(No)S404に戻る。
In S409, the pattern matching
なお、パターン合致度算出部9は、「許可パターン」に該当する場合にはパターン合致度を「1」とし、「許可パターン」に該当しない場合にはパターン合致度を「0」とし、スコア算出部10は、一致画素数算出部7が算出した一致画素数にこれらの数値を掛ける構成が考えられる。
Note that the pattern matching
S410では、スコア算出部10が、一致画素数算出部7が算出した一致画素数から正規化一致画素数を算出してパターンマッチングのスコア(合致度)とする。
In S410, the
次に、図15に基づき、上記パターンマッチングにおける一致パターンのチェックの一例について説明する。図15は、パターン合致度算出過程の一例を示すフローチャートである。なお、ここでは、勾配方向の種類は8方向あり、勾配方向種類数の閾値(DN)を6に設定した場合について説明する。 Next, an example of matching pattern check in the pattern matching will be described with reference to FIG. FIG. 15 is a flowchart illustrating an example of a pattern matching degree calculation process. Here, there are eight types of gradient directions, and a case where the threshold value (DN) of the gradient direction types is set to 6 will be described.
図15に示すように、S501では、パターン合致度算出部9が、一致パターンの「有」の数が6以上の場合には、S502に進み、一致パターンの許可を行なう。
As shown in FIG. 15, in S501, when the number of “existing” matching patterns is 6 or more, the pattern matching
一方、パターン合致度算出部9は、一致パターンの「有」の数(勾配方向種類数)が5以下の場合には、S503に進み、一致パターンの不許可を行なう。
On the other hand, if the number of matching patterns “exist” (number of types in the gradient direction) is 5 or less, the pattern matching
次に、図16(a)〜図16(c)に基づき、一致パターンのチェックにおける第1の例を説明する。 Next, based on FIG. 16A to FIG. 16C, a first example in the matching pattern check will be described.
図16(a)は、パターン合致度算出過程の一例を示す概要図であり、図16(b)は、パターン合致度算出過程の他の例を示す概要図であり、図16(c)は、パターン合致度算出過程のさらに他の例を示す概要図である。 FIG. 16A is a schematic diagram showing an example of the pattern matching degree calculation process, FIG. 16B is a schematic diagram showing another example of the pattern matching degree calculation process, and FIG. FIG. 10 is a schematic diagram showing still another example of a pattern matching degree calculation process.
図16(a)では、一致画素数は「24」と算出している。また、勾配方向の一致パターンは、「8」方向がすべて存在しているので、閾値の6以上であり、図15のフローでは、「許可パターン」と判定される。したがって、図16(a)の場合には、パターン合致度算出部9は、パターン合致度として「1」を算出し、スコア算出部10は、一致画素数算出部7が算出した、一致画素数「24」と「1」とを掛け算したのち、正規化一致画素数を算出してスコアとする。
In FIG. 16A, the number of matching pixels is calculated as “24”. Further, since all the “8” directions are present in the matching pattern in the gradient direction, the threshold value is 6 or more, and is determined as the “permitted pattern” in the flow of FIG. Accordingly, in the case of FIG. 16A, the pattern matching
図16(b)では、一致画素数は「24」と算出している。また、勾配方向の一致パターンは、「6」方向が存在しているので、閾値の6以上であり、図15のフローでは、「許可パターン」と判定される。したがって、図16(b)の場合には、パターン合致度算出部9は、パターン合致度として「1」を算出し、スコア算出部10は、一致画素数算出部7が算出した、一致画素数「24」と「1」とを掛け算したのち、正規化一致画素数を算出してスコアとする。
In FIG. 16B, the number of matching pixels is calculated as “24”. The matching pattern in the gradient direction has a threshold value of 6 or more because the “6” direction exists, and is determined as a “permitted pattern” in the flow of FIG. Therefore, in the case of FIG. 16B, the pattern matching
図16(c)では、一致画素数は「24」と算出している。また、勾配方向の一致パターンは、「6」方向が存在しているので、閾値の6以上であり、図15のフローでは、「許可パターン」と判定される。 In FIG. 16C, the number of matching pixels is calculated as “24”. The matching pattern in the gradient direction has a threshold value of 6 or more because the “6” direction exists, and is determined as a “permitted pattern” in the flow of FIG.
以上の結果、図16(c)の場合には、パターン合致度算出部9は、パターン合致度として「1」を算出し、スコア算出部10は、一致画素数算出部7が算出した、一致画素数「24」と「1」とを掛け算したのち、正規化一致画素数を算出してスコアとする。
As a result of the above, in the case of FIG. 16C, the pattern matching
次に、図17(a)〜図17(c)に基づき、一致パターンのチェックにおける第2の例を説明する。 Next, a second example in the matching pattern check will be described with reference to FIGS.
図17(a)は、パターン合致度算出過程のさらに他の例を示す概要図であり、図17(b)は、パターン合致度算出過程のさらに他の例を示す概要図であり、図17(c)は、パターン合致度算出過程のさらに他の例を示す概要図である。 17A is a schematic diagram showing still another example of the pattern matching degree calculation process, and FIG. 17B is a schematic diagram showing still another example of the pattern matching degree calculation process. (C) is a schematic diagram showing still another example of the pattern matching degree calculation process.
図17(a)では、一致画素数は「24」と算出している。また、勾配方向の一致パターンは、「6」方向が存在しているので、閾値の6以上であり、図15のフローでは、「許可パターン」と判定される。したがって、図17(a)の場合には、パターン合致度算出部9は、パターン合致度として「1」を算出し、スコア算出部10は、一致画素数算出部7が算出した、一致画素数「24」と「1」とを掛け算したのち、正規化一致画素数を算出してスコアとする。
In FIG. 17A, the number of matching pixels is calculated as “24”. The matching pattern in the gradient direction has a threshold value of 6 or more because the “6” direction exists, and is determined as a “permitted pattern” in the flow of FIG. Therefore, in the case of FIG. 17A, the pattern matching
図17(b)では、一致画素数は「22」と算出している。また、勾配方向の一致パターンは、「4」方向が存在しているので、閾値の6未満であり、図15のフローでは、「不許可パターン」と判定される。したがって、図17(b)の場合には、パターン合致度算出部9は、パターン合致度として「0」を算出し、スコア算出部10は、一致画素数算出部7が算出した、一致画素数「22」と「0」とを掛け算して「0」をスコアとする。
In FIG. 17B, the number of matching pixels is calculated as “22”. Further, the matching pattern in the gradient direction is less than the threshold value of 6 because the “4” direction exists, and is determined as a “non-permitted pattern” in the flow of FIG. Accordingly, in the case of FIG. 17B, the pattern matching
図17(c)では、一致画素数は「22」と算出している。また、勾配方向の一致パターンは、「4」方向が存在しているので、閾値の6未満であり、図15のフローでは、「不許可パターン」と判定される。 In FIG. 17C, the number of matching pixels is calculated as “22”. Further, the matching pattern in the gradient direction is less than the threshold value of 6 because the “4” direction exists, and is determined as a “non-permitted pattern” in the flow of FIG.
以上の結果、図17(c)の場合には、パターン合致度算出部9は、パターン合致度として「0」を算出し、スコア算出部10は、一致画素数算出部7が算出した、一致画素数「22」と「0」とを掛け算して「0」をスコアとする。
As a result of the above, in the case of FIG. 17C, the pattern matching
以上のように、スコア算出部10は、照合領域と、モデルパターンとの照合を行って、照合領域に含まれる勾配方向と、モデルパターンに含まれる勾配方向とが一致する画素数(一致画素数)、及び、照合領域に含まれる画素ごとの勾配方向とモデルパターンに含まれる画素ごとの勾配方向との一致パターンと、あらかじめ定められた比較用一致パターンとが類似する度合いを示すパターン合致度から、スコア(合致度)を算出する。
As described above, the
次に、スコア算出部10が照合領域の形状とモデルパターン形状の一部の形状とのマッチングの度合いを示す部分的合致度を算出する場合について説明する。ここでは、スコア算出部10が、一致画素数と合致パターンとを併用して、部分的合致度を算出する場合について説明する。なお、ここでは、スコア算出部10が完全合致度を算出する場合と異なる点について説明するものとし、同じ点については説明を繰り返さない。
Next, a case will be described in which the
上述したように、図17(b)及び(c)の場合、照合領域は「不許可パターン」と判定されており、この場合にはスコア算出部10が完全合致度を算出することはない。
As described above, in the case of FIGS. 17B and 17C, the collation area is determined as a “non-permitted pattern”, and in this case, the
このような場合、パターン合致度算出部9は、図14に示したフローに従って、今度は、モデルパターン・比較用一致パターン格納部8に格納されている比較用部分的一致パターンを用いてパターン照合を実行する。
In such a case, according to the flow shown in FIG. 14, the pattern matching
すなわち、図14のS408において、パターン合致度算出部9がモデルパターン・比較用一致パターン格納部8を参照して、比較用部分一致パターンに対応する「許可パターン」を用いて、チェックを行なうことになる。
That is, in S408 of FIG. 14, the pattern matching
具体的には、図15のS501において、パターン合致度算出部9が、一致パターンの「有」の数に基づいて、一致パターンの許可/不許可を行なう。勾配方向の種類が8方向あり、勾配方向種類数の閾値(DN)が4である場合、比較用部分一致パターンの「有」の数が4であれば、S502に進み、一致パターンの許可を行なう。一方、パターン合致度算出部9は、一致パターンの「有」の数が4未満の場合には、S503に進み、一致パターンの不許可を行なう。
Specifically, in S501 of FIG. 15, the pattern matching
図21は、部分的パターン合致度算出過程の一例を示す概要図である。図21では、一致画素数は「20」と算出している。また、勾配方向の一致パターンは、「4」方向が存在しているので、閾値の4以上であり、図15のフローでは、「許可パターン」と判定される。したがって、図21の場合には、パターン合致度算出部9は、パターン合致度として「1」を算出し、スコア算出部10は、一致画素数算出部7が算出した、一致画素数「20」と「1」とを掛け算したのち、正規化一致画素数を算出してスコアとする。
FIG. 21 is a schematic diagram illustrating an example of a partial pattern matching degree calculation process. In FIG. 21, the number of matching pixels is calculated as “20”. The matching pattern in the gradient direction has a threshold value of 4 or more because the “4” direction exists, and is determined as a “permitted pattern” in the flow of FIG. Accordingly, in the case of FIG. 21, the pattern matching
(6.ポインティング位置特定過程)
次に、画像処理装置1におけるポインティング位置特定過程について説明する。
(6. Pointing position identification process)
Next, a pointing position specifying process in the
図18は、画像処理装置1の動作のうち、ポインティング位置座標算出過程の動作を示すフローチャートである。
FIG. 18 is a flowchart showing the operation of the pointing position coordinate calculation process among the operations of the
S601では、ピーク探索部12が、注目画素の周囲で所定の画素数を含む第1領域(探索領域)内で、スコア算出部10が算出した合致度が最大値をとる画素であるピーク画素を探索して、ピーク画素を発見したらS602に進む。なお、図示していないが、ピーク探索部12が、ピーク画素を発見できない場合には、注目画素を所定数(例えば、第1領域の注目画素から端の画素までの最短コース(第2領域の一辺のサイズ))ずらしてS601に戻る。
In S <b> 601, the
S602では、座標算出判定部13が、第1領域と共通の注目画素をもち、第1領域の画素数よりも少ない所定の画素数を有すると共に、第1領域に完全に包含される第2領域(小領域)内に、ピーク探索部12が発見したピーク画素が存在することを判定した場合には、S603に進み、座標算出判定部13は、「ピーク画素あり」と判定し、S604に進む。一方、座標算出判定部13が、第2領域(小領域)内に、ピーク探索部12が発見したピーク画素が存在しなかった場合には、S605に進み、座標算出判定部13は、「ピーク画素なし」と判定し、注目画素を所定数(例えば、第1領域の注目画素から端の画素までの最短コース(第2領域の一辺のサイズ))ずらしてS601に戻る。
In S602, the coordinate
以上の手順は、座標算出部14がポインティング(補間)位置を算出するまで繰り返される。
The above procedure is repeated until the coordinate
S604では、座標算出部14が、ピーク探索部12が発見したピーク画素を中心とする所定の画素数を含む領域であるピーク画素領域内の、画素ごとのスコアを用いて、撮像対象による撮像画像上の指示位置を算出して「END」となる。
In S604, the coordinate
なお、上述の説明では、座標算出部14がポインティング(補間)位置を算出するまで処理を繰り返す場合について説明したが、複数のポインティング(補間)位置を算出可能な構成としてもよく、この場合、画像全体に対して処理を終了するまで、第1・第2領域を移動して、図18に示すフローチャートの処理を実行すればよい。
In the above description, the case where the processing is repeated until the coordinate
次に、図19(a)及び図19(b)を用いて、ピーク画素の有無の判定について説明する。 Next, determination of the presence / absence of a peak pixel will be described with reference to FIGS. 19 (a) and 19 (b).
図19(a)は、画像処理装置1における座標算出判定部13が、ピーク画素が無いと判定する場合を説明するための概要図であり、(b)は、座標算出判定部13が、ピーク画素が有ると判定する場合を説明するための概要図である。
FIG. 19A is a schematic diagram for explaining a case where the coordinate
図19(a)に示す実線が第1領域であり、破線が第2領域である。第1領域の画素数は、9×9画素であり、第2領域の画素数は、5×5画素である。それぞれ、奇数×奇数としているのは、中央の注目画素が1画素となるようにするためである。 The solid line shown in FIG. 19A is the first area, and the broken line is the second area. The number of pixels in the first region is 9 × 9 pixels, and the number of pixels in the second region is 5 × 5 pixels. The reason why each of them is odd number × odd number is to make the center pixel of interest one pixel.
図19(a)の例では、第1領域内にピーク画素である「9」が存在しているが、該ピーク画素は、第2領域内には存在していない。したがって、この場合は、座標算出判定部13は、「ピーク画素なし」と判定する。
In the example of FIG. 19A, the peak pixel “9” exists in the first region, but the peak pixel does not exist in the second region. Therefore, in this case, the coordinate
一方、図19(b)の例では、第1領域内にピーク画素である「9」が存在しており、かつ、第2領域内にも存在している。したがって、この場合は、座標算出判定部13は、「ピーク画素あり」と判定する。
On the other hand, in the example of FIG. 19B, the peak pixel “9” exists in the first region, and also exists in the second region. Therefore, in this case, the coordinate
なお、上述の例では、第1領域にピーク画素が存在している場合において、第2領域内にピーク画素が無い場合には、第1領域の注目画素から端の画素までの最短コース(第2領域の一辺のサイズ)である「5画素」だけ、第1領域及び第2領域を動かせば、必ず、ピーク画素が第2領域内に入ってくるように、第1領域と第2領域との画素数との差が設定されている。 In the above example, when there is a peak pixel in the first region, and there is no peak pixel in the second region, the shortest course (the first course) from the target pixel to the end pixel in the first region. If the first region and the second region are moved by “5 pixels” which is the size of one side of the two regions), the first region, the second region, The difference from the number of pixels is set.
次に、図20(a)及び図20(b)に基づき、座標算出部14のポインティング(補間)座標(撮像対象による撮像画像上の指示位置)算出方法について説明する。
Next, a method of calculating the pointing (interpolation) coordinates (indicated position on the captured image by the imaging target) of the coordinate
図20(a)は、画像処理装置1における撮像対象による撮像画像上における指示位置の算出のために使用されるピーク画素領域について説明するための概要図であり、図20(b)は、画像処理装置1におけるポインティング(補間)座標の座標算出方法を説明するための概要図である。
FIG. 20A is a schematic diagram for explaining a peak pixel region used for calculation of an indicated position on a captured image by an imaging target in the
図20(a)は、座標算出判定部13が「ピーク座標あり」と判定した場合であり、図19(b)の場合と同じである。
FIG. 20A illustrates a case where the coordinate
なお、図20(a)は第1領域及び第2領域とも破線の領域で示されている。一方、実線で示した5×5画素の領域が、ピーク画素を中心とする所定の画素数を含む領域であるピーク画素領域である。 In FIG. 20A, both the first area and the second area are indicated by dashed areas. On the other hand, a 5 × 5 pixel region indicated by a solid line is a peak pixel region that is a region including a predetermined number of pixels centered on the peak pixel.
図20(a)に示す例では、このピーク画素領域も第2領域と同様に、第1領域に完全に包含されている。この場合は、ピーク画素領域内のスコアをあらためて調べる必要が無い。このように、第2領域の端にピーク画素が存在する場合でも、ピーク画素領域が第1領域内に包含されるように構成することが好ましい。 In the example shown in FIG. 20A, this peak pixel region is also completely included in the first region, like the second region. In this case, there is no need to examine the score in the peak pixel region again. As described above, it is preferable that the peak pixel region is included in the first region even when the peak pixel exists at the end of the second region.
次に、図20(b)に基づき、座標算出部14のポインティング座標算出方法について説明する。
Next, a pointing coordinate calculation method of the coordinate
本例では、画像データの画素数が、320×240画素である場合に、図1の低解像度化部2が、バイリニア縮小を2回行ない、さらに、効率化部6が、2×2画素について照合効率化を行ない、スコア画像(スコアのデータを画素ごとに付与したもの)のサイズが40×30画素になっている場合を想定している。
In this example, when the number of pixels of the image data is 320 × 240 pixels, the
したがって、スコア画像の全領域を8倍に拡大したものが、画像データの全領域に相当する。したがって、補間量(スケール拡大量)=8となっている。 Accordingly, the entire area of the score image enlarged by 8 times corresponds to the entire area of the image data. Therefore, the interpolation amount (scale enlargement amount) = 8.
具体的な計算方法は、以下のとおりである。まず、ピーク画素領域における行ごとのスコアの和を計算する(図20(b)の19、28、33、24、及び11)。 The specific calculation method is as follows. First, the sum of scores for each row in the peak pixel region is calculated (19, 28, 33, 24, and 11 in FIG. 20B).
次に、ピーク画素領域における列ごとのスコアの和を計算する(図20(b)の16、24、28、26、及び21)。また、ピーク画素領域内(5×5画素)のスコアの総和を求める(図20(b)の115)。 Next, the sum of scores for each column in the peak pixel region is calculated (16, 24, 28, 26, and 21 in FIG. 20B). Further, the sum of the scores in the peak pixel region (5 × 5 pixels) is obtained (115 in FIG. 20B).
次に、ピーク画素領域内のスコアの値が質量分布に相当するものとして、スコア画像の全領域における重心座標を求め、スケールを8倍に拡大すると、次式(8)及び(9)の座標を得る。 Next, assuming that the score value in the peak pixel region corresponds to the mass distribution, the center-of-gravity coordinates in the entire region of the score image are obtained, and when the scale is expanded eight times, the coordinates of the following equations (8) and (9) are obtained. Get.
次に、画素のサイズを考慮して目盛り位置の調整を行なうと、ポインティング座標(X,Y)は、次式(10)となる。 Next, when the scale position is adjusted in consideration of the pixel size, the pointing coordinates (X, Y) are expressed by the following equation (10).
以上によれば、ピーク探索部12は、第1領域(探索領域)内で探索するので、全画素数を含む画像データ領域において、ピーク画素を探索するよりも処理コストを低減、及びメモリ容量を少量化させることができる。
According to the above, since the
例えば、第1領域の画素数が小さいということは、データ画像(スコア画像)全体(=全画素)のスコアをバッファに保存しておく必要がなく、ピーク探索を実行する第1領域に必要なメモリ容量(例えば9×9画素の第1領域の場合、9ライン分のラインバッファ)があればよい、ということになる。 For example, the fact that the number of pixels in the first region is small means that it is not necessary to store the score of the entire data image (score image) (= all pixels) in the buffer, and it is necessary for the first region to execute the peak search. This means that it is sufficient to have a memory capacity (for example, in the case of the first area of 9 × 9 pixels, a line buffer for 9 lines).
このように、ラインバッファで実装することにより、メモリ容量を少量化できる効果は、ピーク探索に限らず、縦横の各勾配量の一時保存や、勾配方向の一時保存等、後段処理に受け渡す際にバッファメモリが介在するような実装を行なう場合には、全て共通して言えることである。 In this way, the effect of reducing the memory capacity by implementing with a line buffer is not limited to peak search, but when transferring to subsequent processing such as temporary storage of vertical and horizontal gradient amounts, temporary storage of gradient directions, etc. This is the same in all cases where the implementation includes a buffer memory.
さらに、座標算出部14は、ピーク探索部12が発見したピーク画素を中心とする所定の画素数を含む領域であるピーク画素領域内の、画素ごとのスコアを用いて、ポインティング位置を算出する。例えば、エッジ画像を用いてその重心位置からポインティング位置を求める場合、撮像画像が歪な形に変形するほど算出が困難になると考えられる。
Furthermore, the coordinate
しかし、画像処理装置1では、ピーク画素領域内の、画素ごとのパターンマッチングによるスコアを用いて、ポインティング位置を算出する。このパターンマッチングにおけるスコアの最大値近傍は、撮像画像が歪な形に変形したとしても、該最大値近傍を中心として、放射状に合致度が減少していくという、ほぼ変形前と同様の分布傾向を示すものと考えられる。
However, the
したがって、撮像画像が歪な形に変形するか否かに関係なく、所定の手順(例えば、ピーク画素領域内でスコアの重心を算出する等)で、ポインティング位置を算出することができる。それゆえ、座標位置の検出精度の維持との両立を図りつつ、ポインティング位置を算出するための画像処理量の軽減、処理コストの低減、及びメモリ容量の少量化が可能となる。 Therefore, regardless of whether or not the captured image is deformed into a distorted shape, the pointing position can be calculated by a predetermined procedure (for example, calculating the center of gravity of the score in the peak pixel region). Therefore, it is possible to reduce the image processing amount for calculating the pointing position, to reduce the processing cost, and to reduce the memory capacity while achieving both the maintenance of the coordinate position detection accuracy.
以上より、撮像対象の撮像画像へのタッチ・非タッチの検出に関係なく、1フレームの画像データのみを用いたパターンマッチングを行なうことで、ポインティング位置の検出を可能としてメモリ容量を少量化し、及び処理時間を短縮化しつつ、ポインティング位置の算出において、画像処理量の軽減とポインティング位置の検出精度の維持との両立、及びメモリ容量の少量化を実現することができる画像処理装置1を提供することができる。
As described above, by performing pattern matching using only one frame of image data regardless of detection of touch / non-touch on the captured image of the imaging target, the pointing position can be detected, the memory capacity can be reduced, and To provide an
また、座標算出判定部13は、第1領域と共通の注目画素をもち、第1領域の画素数よりも少ない所定の画素数を有すると共に、第1領域内に完全に包含される第2領域(小領域)内に、ピーク探索部12が発見したピーク画素が存在することを判定した場合に、座標算出部14にポインティング位置を算出させることが好ましい。
In addition, the coordinate
ピーク画素領域は、第2領域内に存在するピーク画素を注目画素としてその周囲に広がる領域であるので、第1領域と共通する画素が多数存在することになる。また、ピーク画素領域と第1領域との共通の画素のスコアは既に算出されているので、非共通の画素のスコアを調べれば、座標算出部14にポインティング位置を算出させることができる。
Since the peak pixel area is an area spreading around the peak pixel existing in the second area as a target pixel, there are many pixels in common with the first area. Further, since the score of the common pixel between the peak pixel region and the first region has already been calculated, the pointing position can be calculated by the coordinate
また、ピーク画素領域と第1領域とのそれぞれの画素数を調整すれば、ピーク画素領域を第1領域に包含させることも可能である。この場合、ピーク画素領域の各画素のスコアは既に判明しているので、ポインティング位置算出のためにあらためて判明していない各画素のスコアを調べる必要が無い。 Further, the peak pixel region can be included in the first region by adjusting the number of pixels of the peak pixel region and the first region. In this case, since the score of each pixel in the peak pixel region is already known, there is no need to examine the score of each pixel that is not yet known for the calculation of the pointing position.
以上より、ポインティング位置の算出において、さらに画像処理量の軽減及びメモリ容量の少量化を実現することができる。また、ピーク座標判定時に第1領域の外側に向けてスコアの上昇が連接している場合への対応と、ハードウェア実装等において各処理モジュールをパイプライン処理する際等に、参照すべきスコアの保持バッファ容量を少量化(例えば画像全体ではなく9ラインのみ)できる。 As described above, in the calculation of the pointing position, it is possible to further reduce the image processing amount and the memory capacity. In addition, when the peak coordinates are determined, the score to be referred to when pipeline processing is performed for each processing module in response to a case where the increase in score is contiguous toward the outside of the first region, and hardware implementation, etc. The holding buffer capacity can be reduced (for example, only 9 lines, not the entire image).
(7.結合過程)
次に、画像処理装置1における結合過程について説明する。
(7. Joining process)
Next, a combining process in the
上述したように、図1に示すパターン合致度算出部9は、照合領域とモデルパターンとの間における画素ごとの勾配方向の一致パターンと比較用一致パターンとが類似する度合いを示すパターン合致度を算出している。このパターン合致度のうち、比較用部分的一致パターンとの類似の度合いを示す部分的パターン合致度は、パターン合致度算出部9からパターン情報格納部16に出力されており、パターン情報格納部16は、部分的パターン合致度の算出ごとに、それらを順次格納している。
As described above, the pattern matching
また、この部分的パターン合致度がパターン情報格納部16に格納される際、その照合領域とモデルパターンとの間における勾配方向の一致パターンの「有」の数(勾配方向種類数)も、同時にパターン情報格納部16に格納されている。
In addition, when this partial pattern matching degree is stored in the pattern
そして、パターン結合部15が、このようにしてパターン情報格納部16に格納された一致パターンの「有」の種類を用いて、モデルパターン形状の一部の形状に一致する形状を持つ照合領域においてモデルパターン形状と一致しない部分(以下、「開放部分」と呼ぶ。)における照合領域内部から外部へ向かう方向(以下、「開放方向」と呼ぶ。)を特定する。
Then, the
図22に、照合領域とモデルパターンとの間における勾配方向の一致パターンの「有」の種類と開放方向との対応関係の一例を示す。図22においては、4つの例が示されており、例えば第1番目の例では、開放方向が図上、下方向に向いている。無論、開放方向は8方向に限られるものではなく、例えば16方向等、より細かく設定してもよい。 FIG. 22 shows an example of the correspondence relationship between the type of “present” of the matching pattern in the gradient direction and the opening direction between the matching region and the model pattern. In FIG. 22, four examples are shown. For example, in the first example, the opening direction is downward in the figure. Of course, the opening direction is not limited to eight directions, and may be set more finely, for example, 16 directions.
また、図22に示した例は、一例に過ぎず、例えば図23に示すように、図22の第1番目の例における一致パターンの「有」の方向を45度ずつ回転させていったものも含まれる。図23には、8つの例が示されており、例えば第2番目の例では、図22の第1番目の例に対して、45度左回転したものとなっており、第3番目の例では、図22の第1番目の例に対して、90度左回転したものとなっている。同様に、図22の第2〜4番目の各例における一致パターンの「有」の方向を45度ずつ回転させていったものも含まれる。 Further, the example shown in FIG. 22 is merely an example. For example, as shown in FIG. 23, the “existing” direction of the matching pattern in the first example of FIG. 22 is rotated by 45 degrees. Is also included. FIG. 23 shows eight examples. For example, in the second example, the first example of FIG. 22 is rotated 45 degrees to the left, and the third example Then, it is rotated 90 degrees counterclockwise with respect to the first example of FIG. Similarly, the case where the “present” direction of the matching pattern in each of the second to fourth examples in FIG. 22 is rotated by 45 degrees is also included.
なお、本実施の形態においては、上述したように、勾配方向の一致パターンの「有」の種類を用いて開放方向を特定しているが、本発明はこれに限られるものではない。要は、照合領域がモデルパターンと一致する部分の位置に基づいて照合領域の開放方向を特定すればよい。すなわち、照合領域内部から、照合領域がモデルパターンと一致しない部分に向かう方向を開放方向とすればよい。 In the present embodiment, as described above, the opening direction is specified using the “present” type of the matching pattern in the gradient direction, but the present invention is not limited to this. In short, the opening direction of the collation area may be specified based on the position of the part where the collation area matches the model pattern. That is, the direction from the inside of the matching area toward the portion where the matching area does not match the model pattern may be set as the open direction.
このようなパターン情報を用いて、パターン結合部15は、モデルパターン形状の一部の形状に一致する形状を持つ照合領域の各々の開放方向を特定する。
Using such pattern information, the
次に、図24〜図27を用いて、結合条件格納部17にあらかじめ格納されている結合条件について説明する。
Next, the coupling conditions stored in advance in the coupling
上述したように、パターン結合部15は、結合条件格納部17にあらかじめ格納されている結合条件を用いて、モデルパターン形状の一部の形状に一致する形状を持つ照合領域のうち、単一領域として互いに結合すべきものがあるか否かを判断し、その結合すべきとの判断に基づいて、それら照合領域を結合する。なお、ここでは、モデルパターン形状が円形状、モデルパターン形状の一部の形状に一致する形状を持つ照合領域の形状が半円形状、単一領域として結合されるべき領域の形状が楕円形状である場合を例として説明する。
As described above, the
このような場合においては、パターン結合部15は、以下の結合条件を用いることになる。もちろん、以下の述べる条件は単なる一例に過ぎず、モデルパターン形状等によって異なるものである。無論、本発明はこのような例に限定されるものではない。モデルパターンの形状及びその結合条件を適切に設定することにより、あらかじめ用意されたモデルパターンとは異なるパターンの認識を実現することができる。
In such a case, the
(a)距離条件
(b)開放方向条件
まず、(a)距離条件について説明する。図24及び図25は、この距離条件を説明するための図である。第1に、図24に示すように、2つの照合領域同士の距離をd、モデルパターンの半径をrとした場合、dがr/2以上であることが必要である。
(A) Distance condition (b) Opening direction condition First, (a) distance condition is demonstrated. 24 and 25 are diagrams for explaining this distance condition. First, as shown in FIG. 24, when the distance between the two matching regions is d and the radius of the model pattern is r, it is necessary that d is r / 2 or more.
第2に、図25に示すように、dが所定の距離(ここでは、3cm)以下であることが必要である。なお、この所定の距離は、例えば、撮像対象が利用者の指腹である場合、表示画面上における指腹の広がり具合から定められたものである。利用者の指腹の大きさとしてはこの程度を見れば十分と思われるからである。また、所定の距離を用いるのに代えて、表示画面上においてこの所定の距離に相当する画素数を用いて結合条件を設定してもよい。例えば、3.5インチのHVGA(320×480画素)の場合、1cmが約65ピクセルであり、3cmであれば約195ピクセルに相当する。したがって、この場合であれば、dが195ピクセル以下であることを結合条件とすることができる。 Secondly, as shown in FIG. 25, it is necessary that d is not more than a predetermined distance (here, 3 cm). Note that this predetermined distance is determined based on how the finger pad spreads on the display screen when the imaging target is the finger pad of the user, for example. This is because it is considered sufficient to see this degree as the size of the user's finger pad. Further, instead of using the predetermined distance, the combination condition may be set using the number of pixels corresponding to the predetermined distance on the display screen. For example, in the case of 3.5 inch HVGA (320 × 480 pixels), 1 cm corresponds to about 65 pixels, and 3 cm corresponds to about 195 pixels. Therefore, in this case, it can be set as a coupling condition that d is 195 pixels or less.
次に、(b)開放方向条件について説明する。図26及び図27は、この開放方向条件を説明するための図である。第1に、図26に示すように、2つの照合領域の開放方向が互いに向かい合っていることが必要である。この向かい合っているか否かの判定は、例えば、一方の開放方向を180度回転させて、2つの開放方向が一致するか否かによって行なえばよい。2つの開放方向が互いに向かい合っていれば、2つの開放方向が一致する筈だからである。 Next, (b) the opening direction condition will be described. 26 and 27 are diagrams for explaining the opening direction condition. First, as shown in FIG. 26, it is necessary that the opening directions of the two verification regions face each other. The determination as to whether or not they face each other may be made, for example, by rotating one opening direction by 180 degrees and determining whether or not the two opening directions match. This is because if the two opening directions face each other, the two opening directions should match.
第2に、図27に示すように、2つの照合領域の開放方向が同一の直線上に載ることが必要である。この同一直線上に載るか否かの判定は、例えば、2つの照合領域の各々中心座標同士を結ぶ直線の方向を求めて、この方向が図26を用いて説明した2つの開放方向が一致した方向に一致するか否かによって行なえばよい。なお、2つの照合領域の各々中心座標同士を結ぶ直線を180度回転させたものに対して、図26の2つの開放方向が一致した方向と一致するか否かを判定しても無論構わない。 Secondly, as shown in FIG. 27, it is necessary that the opening directions of the two collation regions be on the same straight line. For example, the determination of whether or not to place on the same straight line is obtained by obtaining the direction of the straight line connecting the center coordinates of the two collation areas, and this direction coincides with the two opening directions described with reference to FIG. This may be done depending on whether or not the directions match. Of course, it is possible to determine whether or not the two open directions in FIG. 26 coincide with the direction in which the straight line connecting the center coordinates of the two collation regions is rotated by 180 degrees. .
パターン結合部15は、このような結合条件が満たされているか否かを判定し、結合条件を満たしているとの判定結果に基づいて、半円形状である2つの照合領域を結合させ、楕円形状の領域とする。
The
また、パターン結合部15は、このような結合を行なった場合、2つの照合領域の位置から結合された領域の位置を算出し、撮像対象による撮像画像上の指示位置を特定する。
Further, when performing such a combination, the
なお、以上では、単一領域として結合されるべき領域の形状が楕円形状である場合を例として説明したが、本発明はこれに限られるものではない。例えば、後述する「黒色背景画像内に存在する白色L字型形状」、「黒色背景画像内に存在する星型形状」である場合であっても、本発明は適用可能である。なお、上記のいずれの場合でも、モデルパターン形状は円形状とする。 In the above, the case where the shape of the region to be combined as a single region is an elliptical shape has been described as an example, but the present invention is not limited to this. For example, the present invention can be applied even to the case of “white L-shaped shape existing in a black background image” and “star shape existing in a black background image” described later. In any of the above cases, the model pattern shape is circular.
まず、「黒色背景画像内に存在する白色L字型形状」の場合について説明する。例えば、図28及び図29に示すような、モデルパターン形状の一部の形状に一致する形状を持つ照合領域が存在したとする。具体的には、図28は、モデルパターン形状の端部形状を持つ照合領域を表わしており、図29は、略L字型形状を持つ照合領域を表わしている。なお、モデルパターンの白黒反転を行なうことによって、図29の形状の白黒をちょうど反転させた形状を持つ照合領域も無論存在する。 First, the case of “white L-shaped shape present in a black background image” will be described. For example, it is assumed that there is a collation region having a shape that matches a part of the model pattern shape as shown in FIGS. Specifically, FIG. 28 represents a matching area having an end shape of a model pattern shape, and FIG. 29 represents a matching area having a substantially L-shaped shape. It should be noted that there is of course a matching area having a shape obtained by inverting the black and white of the shape shown in FIG.
このような場合においては、パターン結合部15は、以下の結合条件を用いることになる。
In such a case, the
図30に示すように、(a)距離条件としては、各照合領域a〜dが互いに所定の距離だけ離れていることが必要とされる。この所定の距離は、複数の照合領域が結合されるL字型形状の領域の大きさに基づいてあらかじめ定められている。 As shown in FIG. 30, (a) as a distance condition, it is required that each collation area | region ad is mutually separated by predetermined distance. This predetermined distance is determined in advance based on the size of an L-shaped region to which a plurality of verification regions are combined.
また、(b)開放方向条件としては、照合領域aの開放方向に照合領域b、dが存在し、照合領域cの開放方向に照合領域b、dが存在し、照合領域bの開放方向に照合領域dが存在することが必要となる。 Further, (b) as an opening direction condition, the matching areas b and d exist in the opening direction of the matching area a, the matching areas b and d exist in the opening direction of the matching area c, and the opening direction of the matching area b. It is necessary that the collation area d exists.
次に、「黒色背景画像内に存在する星型形状」である場合について説明する。この場合においては、パターン結合部15は、以下の結合条件を用いることになる。
Next, the case of “a star shape existing in a black background image” will be described. In this case, the
すなわち、図31に示すように、(a)距離条件としては、各照合領域a〜dが互いに所定の距離だけ離れていることが必要とされる。この所定の距離は、複数の照合領域が結合される星型形状の領域の大きさに基づいてあらかじめ定められている。 That is, as shown in FIG. 31, (a) as a distance condition, it is necessary that the respective collation areas a to d be separated from each other by a predetermined distance. This predetermined distance is determined in advance based on the size of a star-shaped region to which a plurality of verification regions are combined.
また、(b)開放方向条件としては、照合領域aと照合領域d間の距離と照合領域aと照合領域e間の距離とが略同一であり、照合領域bの開放方向に照合領域cが存在し、照合領域bと照合領域cとを結ぶ直線が照合領域dと照合領域eとを結ぶ直線と略並行であり、照合領域bと照合領域cとを結ぶ直線が照合領域aと照合領域dとを結ぶ直線及び照合領域aと照合領域eとを結ぶ直線と交差することが必要となる。 Further, (b) as the opening direction condition, the distance between the matching area a and the matching area d and the distance between the matching area a and the matching area e are substantially the same, and the matching area c is in the opening direction of the matching area b. The straight line connecting the matching area b and the matching area e is substantially parallel to the straight line connecting the matching area d and the matching area e, and the straight line connecting the matching area b and the matching area c is the matching area a and the matching area. It is necessary to intersect with a straight line connecting d and a straight line connecting collation area a and collation area e.
なお、画像処理装置1の各ブロック、特に低解像度化部2、縦勾配量算出部3a、横勾配量算出部3b、エッジ抽出部4、方向特定部5、効率化部6、一致画素数算出部7、パターン合致度算出部9、スコア算出部10、位置特定部11、及び、パターン結合部15は、ハードウェアロジックによって構成してもよいし、次のようにCPUを用いてソフトウェアによって実現してもよい。
It should be noted that each block of the
すなわち、画像処理装置1は、各機能を実現する制御プログラムの命令を実行するCPU(central processing unit)、上記プログラムを格納したROM(read only memory)、上記プログラムを展開するRAM(random access memory)、上記プログラムおよび各種データを格納するメモリ等の記憶装置(記録媒体)等を備えている。そして、本発明の目的は、上述した機能を実現するソフトウェアである画像処理装置1の制御プログラムのプログラムコード(実行形式プログラム、中間コードプログラム、ソースプログラム)をコンピュータで読み取り可能に記録した記録媒体を、上記画像処理装置1に供給し、そのコンピュータ(またはCPUやMPU)が記録媒体に記録されているプログラムコードを読み出し実行することによっても、達成可能である。
That is, the
上記記録媒体としては、例えば、磁気テープやカセットテープ等のテープ系、フロッピー(登録商標)ディスク/ハードディスク等の磁気ディスクやコンパクトディスク−ROM/MO/MD/デジタルビデオデイスク/コンパクトディスク−R等の光ディスクを含むディスク系、ICカード(メモリカードを含む)/光カード等のカード系、あるいはマスクROM/EPROM/EEPROM/フラッシュROM等の半導体メモリ系等を用いることができる。 Examples of the recording medium include a tape system such as a magnetic tape and a cassette tape, a magnetic disk such as a floppy (registered trademark) disk / hard disk, and a compact disk-ROM / MO / MD / digital video disk / compact disk-R. A disk system including an optical disk, a card system such as an IC card (including a memory card) / optical card, or a semiconductor memory system such as a mask ROM / EPROM / EEPROM / flash ROM can be used.
また、画像処理装置1を通信ネットワークと接続可能に構成し、その通信ネットワークを介して上記プログラムコードを画像処理装置1に供給してもよい。この通信ネットワークとしては、特に限定されず、例えば、インターネット、イントラネット、エキストラネット、LAN、ISDN、VAN、CATV通信網、仮想専用網(virtual private network)、電話回線網、移動体通信網、衛星通信網等が利用可能である。また、通信ネットワークを構成する伝送媒体としては、特に限定されず、例えば、IEEE1394、USB、電力線搬送、ケーブルTV回線、電話線、ADSL回線等の有線でも、IrDAやリモコンのような赤外線、Bluetooth(登録商標)、802.11無線、HDR、携帯電話網、衛星回線、地上波デジタル網等の無線でも利用可能である。なお、本発明は、上記プログラムコードが電子的な伝送で具現化された、搬送波に埋め込まれたコンピュータデータ信号の形態でも実現され得る。
The
本発明は上述した実施形態に限定されるものではなく、請求項に示した範囲で種々の変更が可能である。すなわち、請求項に示した範囲で適宜変更した技術的手段を組み合わせて得られる実施形態についても本発明の技術的範囲に含まれる。 The present invention is not limited to the above-described embodiments, and various modifications can be made within the scope shown in the claims. That is, embodiments obtained by combining technical means appropriately modified within the scope of the claims are also included in the technical scope of the present invention.
本発明の画像処理装置は、例えば携帯電話やPDA等のように、液晶等の表示装置のディスプレイにタッチすることにより、操作や指示を行なうような装置に適用することができる。具体的には、表示装置として、例えば、アクティブマトリクス型の液晶表示装置に用いることができると共に、電気泳動型ディスプレイ、ツイストボール型ディスプレイ、微細なプリズムフィルムを用いた反射型ディスプレイ、デジタルミラーデバイス等の光変調素子を用いたディスプレイの他、発光素子として、有機EL発光素子、無機EL発光素子、LED(Light Emitting Diode)等の発光輝度が可変の素子を用いたディスプレイ、フィールドエミッションディスプレイ(FED)、プラズマディスプレイにも利用することができる。 The image processing apparatus of the present invention can be applied to an apparatus that performs operations and instructions by touching a display of a display device such as a liquid crystal display, such as a mobile phone or a PDA. Specifically, as a display device, for example, it can be used for an active matrix liquid crystal display device, and an electrophoretic display, a twist ball display, a reflective display using a fine prism film, a digital mirror device, etc. In addition to displays using light modulation elements, organic EL light-emitting elements, inorganic EL light-emitting elements, displays using variable-light-emitting elements such as LEDs (Light Emitting Diodes), and field emission displays (FED) It can also be used for plasma displays.
1 画像処理装置
2 低解像度化部
3a 縦勾配量算出部(特徴量算出手段)
3b 横勾配量算出部(特徴量算出手段)
4 エッジ抽出部(特徴量算出手段)
5 方向特定部(特徴量算出手段)
6 効率化部
7 一致画素数算出部
8 モデルパターン・比較用一致パターン格納部
9 パターン合致度算出部(合致度算出手段)
10 スコア算出部(合致度算出手段)
11 位置特定部(位置特定手段)
12 ピーク探索部
13 座標算出判定部
14 座標算出部
15 パターン結合部(領域結合手段)
16 パターン情報格納部
17 結合条件格納部
20 電子機器
61、62、63、64 撮像画像
65 表示画面
66 外光
DESCRIPTION OF
3b Lateral gradient amount calculation unit (feature amount calculation means)
4 Edge extraction unit (feature amount calculation means)
5 direction identification part (feature amount calculation means)
6
10 Score calculator (matching degree calculation means)
11 position specifying part (position specifying means)
12
16 Pattern
Claims (10)
前記画像データ上の画素ごとに、あらかじめ定められたモデルパターンと照合するための特徴量を算出する特徴量算出手段と、
前記特徴量算出手段による特徴量算出結果に基づいて、前記画像データ上の一部の領域に含まれる照合領域と、前記モデルパターンとを照合し、前記照合領域と前記モデルパターンとのマッチングの度合いを示す合致度を算出する合致度算出手段と、
前記合致度算出手段により算出された合致度が前記画像データ上の部分領域内で最大となる複数の照合領域が存在する場合において、前記モデルパターンとのマッチングの度合いが前記照合領域と前記モデルパターンの一部とがマッチングする部分的なマッチングであることを示す合致度を持つ複数の照合領域が、単一領域として複数の照合領域が互いに結合すべきとしてあらかじめ定められた結合条件を満足する場合には、当該結合条件を満足する複数の照合領域を単一領域として互いに結合する領域結合手段と、
前記合致度算出手段により算出された合致度が前記画像データ上の部分領域内で最大となる照合領域の位置を特定する位置特定手段と
を備えており、
前記領域結合手段は、前記結合条件を満足する複数の照合領域を単一領域として互いに結合する場合には、当該結合される複数の照合領域の位置を用いて前記複数の照合領域が結合された単一領域の位置を算出することを特徴とする画像処理装置。 An image processing apparatus having a function of specifying an instruction position on the captured image by an imaging target using image data of a captured image,
Feature amount calculating means for calculating a feature amount for matching with a predetermined model pattern for each pixel on the image data;
Based on the feature amount calculation result by the feature amount calculation means, the matching region included in a partial region on the image data is compared with the model pattern, and the degree of matching between the matching region and the model pattern A degree-of-match calculation means for calculating a degree of match indicating
In the case where there are a plurality of collation areas where the degree of coincidence calculated by the degree of coincidence calculation means is the largest in the partial area on the image data, the degree of matching with the model pattern is determined based on the collation area and the model pattern. When multiple matching areas with a degree of match indicating partial matching that matches a part of the image satisfy a predetermined join condition that multiple matching areas should be combined as a single area A region combining means for combining a plurality of matching regions satisfying the combining condition as a single region;
A position specifying means for specifying a position of a matching area where the degree of matching calculated by the degree of matching calculating means is maximum in a partial area on the image data ,
When the plurality of matching areas satisfying the joining condition are combined as a single area, the region combining means combines the plurality of matching areas using the positions of the plurality of matching areas to be combined. the image processing apparatus according to claim that you calculate the position of a single region.
前記結合条件は、前記結合される複数の照合領域間における位置関係に応じて前記各照合領域に生じるべき開放方向を規定していることを特徴とする請求項1に記載の画像処理装置。 The opening direction generated in each of the matching regions to be combined by partial matching with the model pattern is determined in advance according to the position of a part of the model pattern with which the matching region is partially matched,
The image processing apparatus according to claim 1, wherein the combination condition defines an opening direction that should occur in each of the collation areas according to a positional relationship between the plurality of collation areas to be combined.
前記結合される照合領域の形状は、略半円形状であり、
前記複数の照合領域が結合される単一領域の形状は、略楕円形状であり、
前記結合条件は、前記結合される照合領域の各々に生じる開放方向が互いに対向すること、及び、前記結合される照合領域の各々の位置を通って開放方向に沿って伸びる直線が略同一直線に一致すること、を規定していることを特徴とする請求項2に記載の画像処理装置。 The shape of the model pattern is a substantially circular shape,
The shape of the combined matching region is a substantially semicircular shape,
The shape of the single region to which the plurality of matching regions are combined is a substantially elliptical shape,
The joining condition is that the opening directions generated in each of the matching regions to be joined face each other, and the straight lines extending along the opening direction through the positions of the matching regions to be joined are substantially the same straight line. The image processing apparatus according to claim 2 , wherein matching is defined.
のいずれか1項に記載の画像処理装置。 The feature amount claim 1-4, characterized in that a vector quantity having a magnitude and direction
The image processing apparatus according to any one of the above.
前記画像データ上の画素ごとに、あらかじめ定められたモデルパターンと照合するための特徴量を算出する特徴量算出工程と、
前記特徴量算出工程における特徴量算出結果に基づいて、前記画像データ上の一部の領域に含まれる照合領域と、前記モデルパターンとを照合し、前記照合領域と前記モデルパターンとのマッチングの度合いを示す合致度を算出する合致度算出工程と、
前記合致度算出工程において算出された合致度が前記画像データ上の部分領域内で最大となる複数の照合領域が存在する場合において、前記モデルパターンとのマッチングの度合いが前記照合領域と前記モデルパターンの一部とがマッチングする部分的なマッチングであることを示す合致度を持つ複数の照合領域が、単一領域として複数の照合領域が互いに結合すべきとしてあらかじめ定められた結合条件を満足する場合には、当該結合条件を満足する複数の照合領域を単一領域として互いに結合する領域結合工程と、
前記合致度算出工程において算出された合致度が前記画像データ上の部分領域内で最大となる照合領域の位置を特定する位置特定工程と
を備えており、
前記領域結合工程において、前記結合条件を満足する複数の照合領域を単一領域として互いに結合する場合には、当該結合される複数の照合領域の位置を用いて前記複数の照合領域が結合された単一領域の位置を算出することを特徴とする画像処理装置。 An image processing method for specifying an instruction position on the captured image by an imaging target using image data of a captured image,
A feature amount calculating step for calculating a feature amount for matching with a predetermined model pattern for each pixel on the image data;
Based on the feature quantity calculation result in the feature quantity calculation step, the matching area included in a part of the area on the image data is matched with the model pattern, and the degree of matching between the matching area and the model pattern A degree-of-match calculation step for calculating a degree of match indicating
In the case where there are a plurality of matching areas in which the degree of matching calculated in the matching degree calculation step is maximum in the partial area on the image data, the degree of matching with the model pattern is determined based on the matching area and the model pattern. When multiple matching areas with a degree of match indicating partial matching that matches a part of the image satisfy a predetermined join condition that multiple matching areas should be combined as a single area A region combining step of combining a plurality of matching regions satisfying the combining condition as a single region; and
A position specifying step for specifying the position of the matching region in which the degree of match calculated in the match level calculating step is maximum in the partial region on the image data ,
In the region combining step, when combining a plurality of matching regions that satisfy the combining condition as a single region, the plurality of matching regions are combined using the positions of the plurality of matching regions to be combined. the image processing apparatus according to claim that you calculate the position of a single region.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008222874A JP5015097B2 (en) | 2008-08-29 | 2008-08-29 | Image processing apparatus, image processing program, computer-readable recording medium, electronic apparatus, and image processing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008222874A JP5015097B2 (en) | 2008-08-29 | 2008-08-29 | Image processing apparatus, image processing program, computer-readable recording medium, electronic apparatus, and image processing method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2010055576A JP2010055576A (en) | 2010-03-11 |
JP5015097B2 true JP5015097B2 (en) | 2012-08-29 |
Family
ID=42071378
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008222874A Expired - Fee Related JP5015097B2 (en) | 2008-08-29 | 2008-08-29 | Image processing apparatus, image processing program, computer-readable recording medium, electronic apparatus, and image processing method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5015097B2 (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8725443B2 (en) | 2011-01-24 | 2014-05-13 | Microsoft Corporation | Latency measurement |
US8982061B2 (en) * | 2011-02-12 | 2015-03-17 | Microsoft Technology Licensing, Llc | Angular contact geometry |
DE102011076795A1 (en) * | 2011-05-31 | 2012-09-20 | Robert Bosch Gmbh | Method for determining a pitching movement of a camera installed in a vehicle and method for controlling a light emission of at least one headlight of a vehicle |
US9785281B2 (en) | 2011-11-09 | 2017-10-10 | Microsoft Technology Licensing, Llc. | Acoustic touch sensitive testing |
JP6490441B2 (en) | 2015-02-12 | 2019-03-27 | 株式会社東芝 | Image evaluation apparatus, image evaluation method, and program |
CN111079724B (en) * | 2020-03-25 | 2020-06-30 | 速度时空信息科技股份有限公司 | Unmanned aerial vehicle-based sea floating garbage identification method |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07261932A (en) * | 1994-03-18 | 1995-10-13 | Hitachi Ltd | Sensor built-in type liquid crystal display device and information processing system using the display device |
JP4003465B2 (en) * | 2002-01-28 | 2007-11-07 | 松下電工株式会社 | Specific pattern recognition method, specific pattern recognition program, specific pattern recognition program recording medium, and specific pattern recognition apparatus |
JPWO2009139214A1 (en) * | 2008-05-12 | 2011-09-15 | シャープ株式会社 | Display device and control method |
JP4964850B2 (en) * | 2008-08-29 | 2012-07-04 | シャープ株式会社 | Image analysis apparatus, image analysis method, imaging apparatus, image analysis program, and recording medium |
-
2008
- 2008-08-29 JP JP2008222874A patent/JP5015097B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2010055576A (en) | 2010-03-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4727614B2 (en) | Image processing apparatus, control program, computer-readable recording medium, electronic apparatus, and control method for image processing apparatus | |
JP4790653B2 (en) | Image processing apparatus, control program, computer-readable recording medium, electronic apparatus, and control method for image processing apparatus | |
JP4727615B2 (en) | Image processing apparatus, control program, computer-readable recording medium, electronic apparatus, and control method for image processing apparatus | |
JP2008250949A5 (en) | ||
JP2008250950A5 (en) | ||
US9055384B2 (en) | Adaptive thresholding for image recognition | |
JP2008250951A5 (en) | ||
US8269842B2 (en) | Camera gestures for user interface control | |
CN107818290B (en) | Heuristic finger detection method based on depth map | |
JP5015097B2 (en) | Image processing apparatus, image processing program, computer-readable recording medium, electronic apparatus, and image processing method | |
WO2016206279A1 (en) | Touch control display device and touch control method therefor | |
JP5229050B2 (en) | Document area extraction apparatus, method, and program from image | |
US9129150B2 (en) | Electronic apparatus and display control method | |
KR102656237B1 (en) | Moving fingerprint recognition method and apparatus using display | |
JP2011118466A (en) | Difference noise replacement device, difference noise replacement method, difference noise replacement program, computer readable recording medium, and electronic equipment with difference noise replacement device | |
CN112199981A (en) | Method for registering fingerprint, method for performing fingerprint identification, and electronic device | |
US8355599B2 (en) | Methods and devices for detecting changes in background of images using multiple binary images thereof and hough transformation | |
US10002291B2 (en) | Method and system of identifying fillable fields of an electronic form | |
US20170085784A1 (en) | Method for image capturing and an electronic device using the method | |
JP5128524B2 (en) | Image processing apparatus, control method therefor, image processing program, and computer-readable recording medium | |
JP4964849B2 (en) | Image processing apparatus, image processing program, computer-readable recording medium, electronic apparatus, and image processing method | |
JP2010211326A (en) | Image processing device, control method for image processing device, image processing program, and computer-readable recording medium | |
TWI674536B (en) | Fingerprint navigation method and electronic device | |
JP4721238B2 (en) | Image processing apparatus, image processing method, image processing program, and computer-readable recording medium | |
US20150153904A1 (en) | Processing method of object image for optical touch system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20100826 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20111213 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20120207 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20120406 |
|
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: 20120508 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20120606 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20150615 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |