JP2007249555A - Image processor and approximate straight line calculation apparatus - Google Patents
Image processor and approximate straight line calculation apparatus Download PDFInfo
- Publication number
- JP2007249555A JP2007249555A JP2006071567A JP2006071567A JP2007249555A JP 2007249555 A JP2007249555 A JP 2007249555A JP 2006071567 A JP2006071567 A JP 2006071567A JP 2006071567 A JP2006071567 A JP 2006071567A JP 2007249555 A JP2007249555 A JP 2007249555A
- Authority
- JP
- Japan
- Prior art keywords
- coordinates
- evaluation value
- coordinate
- straight line
- coordinate group
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Images
Landscapes
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
Description
この発明は複数の座標を含む座標群から近似直線を算出する画像処理装置および近似直線算出装置に関し、特に誤差発生要因となる外れ値を効率的に取除いて、近似直線を高精度に算出する技術に関するものである。 The present invention relates to an image processing device and an approximate line calculation device that calculate an approximate line from a group of coordinates including a plurality of coordinates, and in particular, efficiently removes an outlier that causes an error and calculates the approximate line with high accuracy. It is about technology.
製造現場においては、省力化および高効率化の観点から、オートメーション化が推進されている。このようなオートメーション化を実現するためには、数多くのセンサ類が用いられている。特に、製品や半製品などを撮影し、その撮影した画像を処理することで、当該製品の寸法計測検査や位置決めなどを行なうことのできる画像処理装置が有効である。 In the manufacturing field, automation is promoted from the viewpoint of labor saving and high efficiency. In order to realize such automation, many sensors are used. In particular, an image processing apparatus that can photograph a product, a semi-finished product, and the like and process the photographed image to perform dimension measurement inspection and positioning of the product is effective.
このような画像処理装置においては、撮影した画像内の情報(明度、輝度、色差など)により、対象物(製品や半製品など)のエッジ(輪郭)検出が行なわれる。特に、対象物の直線形状部位に対してエッジ検出が行なわれることが多い。これは、対象物の多くは直線形状部位を含むことと、直線形状部位を基準にすることにより、精度の高い寸法計測や位置決めを容易に実現できることによる。 In such an image processing apparatus, an edge (contour) of an object (product, semi-finished product, etc.) is detected based on information (lightness, brightness, color difference, etc.) in the captured image. In particular, edge detection is often performed on a linear portion of an object. This is because most of the objects include a linear portion, and by using the linear portion as a reference, highly accurate dimensional measurement and positioning can be easily realized.
しかしながら、対象物の背景における汚れや、対象物の欠陥(成型バリや欠け)などにより、誤ったエッジ位置が検出される場合も多い。そこで、所定の領域内で検出された複数のエッジ位置に基づいて、対象物の直線形状部位を示す近似直線を算出することが一般的に行なわれる。たとえば、特許第2850608号公報(特許文献1)には、複数のエッジ点の座標を計測し、直線近似することが開示されている。 However, an erroneous edge position is often detected due to dirt in the background of the object or a defect (molding burr or chipping) of the object. In view of this, it is common practice to calculate an approximate straight line indicating a linear shape portion of an object based on a plurality of edge positions detected within a predetermined region. For example, Japanese Patent No. 2850608 (Patent Document 1) discloses that the coordinates of a plurality of edge points are measured and linear approximation is performed.
さらに、直線近似の精度をより高めるために、たとえば非特許文献1に開示されるようなLTS推定法(Least Trimmed Squares Estimate Method)が提案されている。LTS推定法によれば、最小二乗法により複数のエッジ位置から暫定近似直線が算出し、複数のエッジ位置のうち、各エッジ位置から暫定近似直線までの距離(残差)が小さいものを抽出する。そして、抽出されたエッジ位置から、再度、最小二乗法により近似直線が算出される。このLTS推定法によれば、本来の値から大きく外れた外れ値(outlier)の影響を低減できる。
しかしながら、上述のようなLTS推定法を用いたとしても、検出された複数のエッジ位置に数多くの外れ値が含まれている場合には、暫定近似直線自体が大きな誤差影響を受けてしまう。そのため、本来正常なエッジ位置であっても、暫定近似直線からの距離が大きくなる場合があり、このような場合には、本来正常なエッジ位置が取除かれてしまい、外れ値に基づいて誤差の大きな近似直線が算出されてしまう場合があった。 However, even if the above-described LTS estimation method is used, if a large number of outliers are included in a plurality of detected edge positions, the provisional approximate line itself is greatly affected by errors. For this reason, even if the edge position is normally normal, the distance from the provisional approximate straight line may be large. In such a case, the normal normal edge position is removed, and an error is caused based on the outlier. In some cases, a large approximate straight line is calculated.
そこで、この発明は、かかる問題を解決するためになされたものであり、その目的は、座標群に含まれる座標から外れ値を効率的に取除いて、精度の高い近似直線を算出できる画像処理装置および近似直線算出装置を提供することである。 Accordingly, the present invention has been made to solve such a problem, and an object of the present invention is to perform image processing capable of calculating an approximate straight line with high accuracy by efficiently removing outliers from coordinates included in a coordinate group. An apparatus and an approximate line calculation device are provided.
第1の発明によれば、画像の特定の位置を示す座標を4個以上含む座標群を取得する座標群取得手段と、所定規則に従って、座標群から3個以上の座標を選択する座標選択手段と、座標選択手段により選択された3個以上の座標について、同一直線上に配置される度合を示す評価値を算出する評価値算出手段と、当該3個以上の座標の各々と対応付けて、評価値算出手段により算出される評価値を累積加算する評価値加算手段と、座標群の各座標が互いに同一回数だけ選択されるように、座標選択手段、評価値算出手段および評価値加算手段における処理を繰返し実行させる繰返手段と、評価値加算手段により累積加算された評価値に基づいて、座標群から同一直線上に配置される度合が相対的に高い複数の座標を抽出する抽出手段と、抽出手段により抽出された複数の座標に基づいて近似直線を算出する近似直線算出手段とを備える画像処理装置である。 According to the first invention, a coordinate group acquisition unit that acquires a coordinate group including four or more coordinates indicating a specific position of an image, and a coordinate selection unit that selects three or more coordinates from the coordinate group according to a predetermined rule And, with respect to three or more coordinates selected by the coordinate selection means, an evaluation value calculation means for calculating an evaluation value indicating the degree of arrangement on the same straight line, and each of the three or more coordinates, In the coordinate value selecting means, the evaluation value calculating means, and the evaluation value adding means, the evaluation value adding means for accumulating the evaluation values calculated by the evaluation value calculating means and the coordinates of the coordinate group are selected the same number of times. Repetitive means for repeatedly executing the processing, and extraction means for extracting a plurality of coordinates having a relatively high degree of arrangement on the same straight line from the coordinate group based on the evaluation values accumulated and added by the evaluation value addition means , Extraction An image processing apparatus and a approximate line calculating means for calculating an approximate line based on a plurality of coordinates extracted by stage.
第1の発明によれば、座標群から選択された3個以上の座標の組合せ毎に、同一直線上に配置される度合を示す評価値が算出される。このように、評価値は、座標群全体から算出される暫定近似直線に基づいて算出されるのではなく、選択された3個以上の座標の間でミクロ的に算出される。外れ値である座標は、いずれの組合せにおいても、同一直線上に配置される度合が低い一方、正常な座標は、正常な座標同士の組合せにおいて、同一直線上に配置される度合が高くなる。その結果、座標の各々と対応付けて評価値が累積されることで、正常な座標と外れ値の座標との差が顕著に表れるため、外れ値を効率的に取除くことができる。 According to the first invention, an evaluation value indicating the degree of arrangement on the same straight line is calculated for each combination of three or more coordinates selected from the coordinate group. As described above, the evaluation value is not calculated based on the provisional approximate straight line calculated from the entire coordinate group, but is calculated microscopically between three or more selected coordinates. Coordinates that are outliers are less likely to be placed on the same straight line in any combination, while normal coordinates are more likely to be placed on the same straight line in a combination of normal coordinates. As a result, since the evaluation values are accumulated in association with each of the coordinates, the difference between the normal coordinates and the coordinates of the outlier appears significantly, so that the outlier can be efficiently removed.
好ましくは、座標群取得手段は、画像を取得する画像取得部と、画像取得部により取得された画像中において、色情報に変化を生じるエッジ位置を検出して座標群を取得するエッジ検出部とを含む。 Preferably, the coordinate group acquisition unit includes an image acquisition unit that acquires an image, an edge detection unit that acquires a coordinate group by detecting an edge position that causes a change in color information in the image acquired by the image acquisition unit, and including.
好ましくは、画像取得部は、直線形状部位を有する対象物を撮影して得られた画像を取得する。 Preferably, the image acquisition unit acquires an image obtained by photographing an object having a linear part.
好ましくは、評価値算出手段は、3個以上の座標のうち2個の座標を含む直線を規定し、残余の座標の各々と当該規定された直線との距離に基づいて評価値を算出する。 Preferably, the evaluation value calculation means defines a straight line including two coordinates among the three or more coordinates, and calculates an evaluation value based on a distance between each of the remaining coordinates and the defined straight line.
好ましくは、評価値算出手段は、3個以上の座標についての相関係数に基づいて、評価値を算出する。 Preferably, the evaluation value calculation means calculates an evaluation value based on a correlation coefficient for three or more coordinates.
好ましくは、繰返手段は、座標選択手段により座標群から3個以上の座標を選ぶ組合せのすべてが選択されるまで、座標選択手段、評価値算出手段および評価値加算手段における処理を繰返し実行させる。 Preferably, the repeating unit repeatedly executes the processes in the coordinate selecting unit, the evaluation value calculating unit, and the evaluation value adding unit until all the combinations for selecting three or more coordinates from the coordinate group are selected by the coordinate selecting unit. .
好ましくは、座標群は、2次元または3次元の座標からなる。
第2の発明によれば、4個以上の座標を含む座標群を取得する座標群取得手段と、所定規則に従って、座標群から3個以上の座標を選択する座標選択手段と、座標選択手段により選択された3個以上の座標について、同一直線上に配置される度合を示す評価値を算出する評価値算出手段と、当該3個以上の座標の各々と対応付けて、評価値算出手段により算出される評価値を累積加算する評価値加算手段と、座標群の各座標が互いに同一回数だけ選択されるように、座標選択手段、評価値算出手段および評価値加算手段における処理を繰返し実行させる繰返手段と、評価値加算手段により累積加算された評価値に基づいて、座標群から同一直線上に配置される度合が相対的に高い複数の座標を抽出する抽出手段と、抽出手段により抽出された複数の座標に基づいて近似直線を算出する近似直線算出手段とを備える近似直線算出装置である。
Preferably, the coordinate group includes two-dimensional or three-dimensional coordinates.
According to the second invention, the coordinate group acquisition means for acquiring a coordinate group including four or more coordinates, the coordinate selection means for selecting three or more coordinates from the coordinate group according to a predetermined rule, and the coordinate selection means For the three or more selected coordinates, the evaluation value calculating means for calculating the evaluation value indicating the degree of arrangement on the same straight line and the evaluation value calculating means in association with each of the three or more coordinates. An evaluation value adding means for accumulating the evaluation values to be accumulated, and a process for repeatedly executing the processes in the coordinate selecting means, the evaluation value calculating means and the evaluation value adding means so that each coordinate of the coordinate group is selected the same number of times. Based on the evaluation value cumulatively added by the evaluation value addition means, an extraction means for extracting a plurality of coordinates arranged on the same straight line from the coordinate group and having a relatively high degree, and extracted by the extraction means The An approximate straight line calculation device and a approximate line calculating means for calculating an approximate line based on the number of coordinates.
第2の発明によれば、座標群から選択された3個以上の座標の組合せ毎に、同一直線上に配置される度合を示す評価値が算出される。このように、評価値は、座標群全体から算出される暫定近似直線に基づいて算出されるのではなく、選択された3個以上の座標の間でミクロ的に算出される。外れ値である座標は、いずれの組合せにおいても、同一直線上に配置される度合が低い一方、正常な座標は、正常な座標同士の組合せにおいて、同一直線上に配置される度合が高くなる。その結果、座標の各々と対応付けて評価値が累積されることで、正常な座標と外れ値の座標との差が顕著に表れるため、外れ値を効率的に取除くことができる。 According to the second invention, for each combination of three or more coordinates selected from the coordinate group, an evaluation value indicating the degree of arrangement on the same straight line is calculated. As described above, the evaluation value is not calculated based on the provisional approximate straight line calculated from the entire coordinate group, but is calculated microscopically between three or more selected coordinates. Coordinates that are outliers are less likely to be placed on the same straight line in any combination, while normal coordinates are more likely to be placed on the same straight line in a combination of normal coordinates. As a result, since the evaluation values are accumulated in association with each of the coordinates, the difference between the normal coordinates and the coordinates of the outlier appears significantly, so that the outlier can be efficiently removed.
この発明によれば、座標群に含まれる座標から外れ値を効率的に取除いて、精度の高い近似直線を算出できる画像処理装置および近似直線算出装置を実現できる。 According to the present invention, it is possible to realize an image processing device and an approximate line calculation device that can efficiently remove outliers from coordinates included in a coordinate group and calculate an approximate line with high accuracy.
この発明の実施の形態について、図面を参照しながら詳細に説明する。なお、図中の同一または相当部分については、同一符号を付してその説明は繰返さない。 Embodiments of the present invention will be described in detail with reference to the drawings. Note that the same or corresponding parts in the drawings are denoted by the same reference numerals and description thereof will not be repeated.
[実施の形態1]
図1は、この発明の実施の形態1に従う近似直線算出装置を備える画像処理装置100の概略構成図である。
[Embodiment 1]
FIG. 1 is a schematic configuration diagram of an
図1を参照して、画像処理装置100は、カメラ2により撮影された画像を取得して、近似直線を算出した後、その算出結果を表示装置4や外部機器6へ出力する。
With reference to FIG. 1, the
カメラ2は、一例として、CCD(Coupled Charged Device)やCMOS(Complementary Metal Oxide Semiconductor)センサなどの撮像素子およびレンズからなり、製造ライン上などを連続的に搬送される製品や半製品といった対象物を撮影し、その撮影した画像を画像処理装置100へ出力する。なお、カメラ2が撮影する画像は、濃淡画像(白黒画像)およびカラー画像のいずれでもよく、さらに静止画像および動画像のいずれでもよい。この発明の実施の形態1においては、カラー画像を用いる場合について説明を行なう。
As an example, the
表示装置4は、画像処理装置100において算出された近似直線や検出されたエッジ位置などを、カメラ2により撮影された画像とともに表示する。一例として、表示装置4は、液晶ディスプレイ(LCD:Liquid Crystal Display)、プラズマディスプレイ(Plasma Display)、有機ELディスプレイ(Electro Luminescence display)などからなる。
The
外部機器6は、一例として、製造ラインなどを監視制御するプログラマブルコントローラなどからなり、画像処理装置100において算出された近似直線に応じて、各種の制御や計測を実行する。
The
画像処理装置100は、CPU10と、ROM(Read Only Memory)12と、RAM(Random Access Memory)14と、HDD(Hard Disk Drive:ハードディスクドライブ)16と、入出力部18と、画像入力部20と、フィルタ22と、画像メモリ24と、エッジ検出部26と、画像出力部28とからなる。そして、画像入力部20を除く各部は、バス30を介して互いに接続される。画像処理装置100は、一例としてパーソナルコンピュータなどで実現される。
The
画像入力部20は、カメラ2と電気的に接続され、カメラ2で撮影された映像信号を受け、所定の信号変換処理を行ない各画素の色情報を取得した後、その取得した色情報をフィルタ22へ出力する。具体的には、画像入力部20は、カメラ2から受けた映像信号に対してフレーム同期を行ない、時間軸上に展開されて伝送される各画素の色情報を復調し、各画素についての色情報を取得する。
The
フィルタ22は、画像入力部20から順次出力される画像を受けて、当該画像の各画素に対して色情報変換などのフィルタ処理を行なう。そして、フィルタ22は、フィルタ処理後の画像を画像メモリ24およびエッジ検出部26へ出力する。一例として、フィルタ22は、CPU10により設定された所定の規則(テーブル)に従って処理を行なう、LUT(Look-Up Table)型のフィルタである。そのため、フィルタ22は、対象物や撮影条件などに応じて、フィルタ処理の内容を変更することが可能に構成される。
The
画像メモリ24は、所定周期毎またはCPU10から指令を受けたタイミングで、フィルタ22から出力される画像を一次的に格納する。また、画像メモリ24は、エッジ検出部26から受けたエッジ位置についても一次的に格納する。そして、画像メモリ24は、格納している画像を画像出力部28やCPU10などへ出力する。
The
エッジ検出部26は、CPU10からの指令を受けて、フィルタ22から出力される画像を構成する各画素の色情報に基づいて、画像中において色情報に変化を生じるエッジ位置(輪郭)を検出する。そして、エッジ検出部26は、検出した複数のエッジ位置を座標群としてCPU10および画像メモリ24へ出力する。さらに、エッジ検出部26は、入出力部18などを介して与えられるマスク領域に応じて、フィルタ22から出力される画像の特定領域に対するエッジ位置の検出が可能に構成される。なお、濃淡画像(白黒画像)が入力される場合には、色情報は濃淡値であり、カラー画像が入力される場合には、色情報はRGB値(赤色、緑色、青色の各濃淡値)、CMY値(シアン、マゼンダ、黄色の各濃淡値)もしくは色変数(色相(Hue)、明度(Value)、彩度(Chroma))などである。
The
画像出力部28は、画像メモリ24からの画像、およびCPU10などからの各種表示情報を受け、映像信号を生成して表示装置4へ出力する。一例として、画像出力部28は、表示装置4に対応してアナログ信号(コンポジット信号やコンポーネント信号)またはデジタル信号を出力する。
The
ROM12は、CPU10の起動時などに実行されるプログラムや各種設定を格納する。
The
RAM14は、CPU10で実行されるプログラムや後述する近似直線算出に係るワークデータなどを格納する。そして、RAM14は、一例として、DRAM(Dynamic Random Access Memory)やSRAM(Static Random Access Memory)などの半導体記憶素子からなる。
The
HDD16は、CPU10で実行されるプログラムやCPU10における算出結果などを格納し、CPU10からの要求により読出しおよび書込みを行なう。なお、HDD16に代えて、半導体メモリ(フラッシュメモリカード、SDメモリカード、ICメモリカードなど)や、光ディスク(CD(Compact Disk)、DVD(Digital Versatile Disc)−ROM/RAM/R/RW、MO(Magnetic Optical Disc)、MD(Mini Disc))などの不揮発的にデータを担持可能な装置を用いてもよい。
The
入出力部18は、CPU10における算出結果などを外部機器6へ出力する。一例として、入出力部18は、フォトダイオード、トランジスタまたはリレーなどから構成される接点出力(DO)や、フィールドバス、USB(Universal Serial Bus)、RS−232C(Recommended Standard 232 version C)、IEEE(Institute of Electrical and Electronic Engineers)1394、SCSI(Small Computer System Interface)およびイーサネット(登録商標)などに従う通信手段などからなる。
The input /
CPU10は、カメラ2により撮影された画像に対してエッジ検出部26により検出された複数のエッジ位置(2次元座標)を示す座標群を取得する。特に、この発明の実施の形態1においては、CPU10は、4個以上のエッジ位置からなる座標群を取得する。そして、CPU10は、取得した座標群から所定規則に従って3個以上の座標を選択し、選択した3個以上の座標について、同一直線上に配置される度合を示す評価値を算出する。さらに、CPU10は、当該選択した3個以上の評価値の各々と対応付けて、算出した評価値を累積加算する。
The
以下同様にして、CPU10は、座標群の各座標が互いに同一回数だけ選択されるように、3個以上の座標を順次選択して上述の処理を繰返し実行する。
Similarly, the
そして、CPU10は、累積加算された評価値に基づいて、座標群から同一直線上に配置される度合が相対的に高い複数の座標を抽出し、抽出した座標に基づいて近似直線を算出する。
Then, the
さらに、CPU10は、それぞれ画像出力部28および入出力部18を介して、算出した近似直線を表示装置4および外部機器6などへ出力する。
Further, the
この発明の実施の形態1においては、画像入力部20が「画像取得部」に相当し、画像入力部20およびエッジ検出部26が「座標群取得手段」を実現する。また、CPU10が「座標選択手段」、「評価値算出手段」、「評価値加算手段」、「繰返手段」、「抽出手段」および「近似直線算出手段」を実現する。
In the first embodiment of the present invention, the
(エッジ位置の検出処理)
図2は、エッジ検出部26におけるエッジ位置の検出処理の概要を説明するための図である。
(Edge position detection process)
FIG. 2 is a diagram for explaining the outline of the edge position detection processing in the
図2を参照して、一例として、エッジ検出部26は、カメラ2により撮影された画像IMGに対してx方向に走査を行ない、エッジ位置を順次検出する。
With reference to FIG. 2, as an example, the
具体的には、エッジ検出部26は、画像IMG中の予め定められたx方向の走査位置40.1を中心として、所定幅をもつ領域42.1を定義する。そして、エッジ検出部26は、定義された領域42.1に含まれる画素の色情報を、y方向の値と対応付けて、x方向に累積加算した色情報ヒストグラム46.1を算出する。なお、図2の場合には、1次元の色情報から色情報ヒストグラム46.1を算出するので、カラー画像の場合には、色情報として1次元の明度(赤色、青色および緑色の各濃淡値の合計)などを用いることができる。そして、エッジ検出部26は、この算出された色情報ヒストグラム46.1において、急激な変化を生じるy方向の変化位置48.1を検出する。
Specifically, the
このような手順によって、エッジ検出部26は、x方向の走査位置40.1と、y方向の変化位置48.1との交差点であるエッジ位置44.1を検出し、このエッジ位置44.1の座標(x1,y1)を取得する。
By such a procedure, the
続いて、エッジ検出部26は、x方向の次の走査位置40.2を中心として、所定幅をもつ領域42.2を定義する。そして、エッジ検出部26は、上述したのと同様に、色情報ヒストグラム46.2を算出する。さらに、エッジ検出部26は、この算出された色情報ヒストグラム46.2において、急激な変化を生じるy方向の変化位置48.2を検出する。エッジ検出部26は、このx方向の走査位置40.2およびy方向の変化位置48.2から、エッジ位置44.2を検出し、その座標(x2,y2)を取得する。
Subsequently, the
以下同様にして、エッジ検出部26は、x方向に順次走査を行なって、複数のエッジ位置からなるエッジ位置群44を検出し、各エッジ位置を示す座標からなる座標群を取得する。
Similarly, the
なお、エッジ検出部26は、入出力部18(図1)を介して与えられるマスク領域(図示しない)に従い、画像IMGの全領域ではなく、特定の領域のみに対してエッジ位置の検出を行なうことも可能である。
The
このようにしてエッジ検出部26により取得された座標群は、CPU10へ出力される。
The coordinate group acquired by the
(近似直線の算出処理)
図3は、CPU10における近似直線の算出処理の概要を説明するための図である。なお、図3は、画像メモリ24(図1)に格納される画像IMGを模式的に記載したものである。
(Approximate line calculation process)
FIG. 3 is a diagram for explaining the outline of the approximate straight line calculation process in the
図3を参照して、画像IMGは、直線形状部位を有する対象物OBJを撮影したものである。一例として、エッジ検出部26は、予め設定されたマスク領域50内においてエッジ検出を実行し、エッジ位置a〜eにそれぞれ対応する座標a〜eを取得しているものとする。このとき、エッジ検出部26は、対象物OBJの直線状の輪郭線EDG上にエッジ位置a〜dを検出する一方、対象物OBJの背景にある汚れなどのノイズ領域52をエッジ位置eであると誤検出しているとする。CPU10は、このエッジ位置a〜eにそれぞれ対応する座標a〜eに基づいて、最小二乗法に従って近似直線を算出し、算出した近似直線を対象物OBJの輪郭線EDGとみなす。
Referring to FIG. 3, an image IMG is an image of an object OBJ having a linear shape part. As an example, it is assumed that the
しかしながら、このエッジ位置eは、輪郭線EDGから大きくずれた「外れ値」であり、このような座標を含んで算出した近似直線は、本質的に大きな誤差を含む。そこで、CPU10は、このような外れ値を効率的に取除いた上で、近似直線を算出する。
However, the edge position e is an “outlier” greatly deviating from the contour line EDG, and the approximate straight line calculated including such coordinates essentially includes a large error. Therefore, the
図4は、CPU10における近似直線算出に係る制御構造を示すフローチャートである。
FIG. 4 is a flowchart showing a control structure related to approximate straight line calculation in the
図4を参照して、CPU10は、まず、エッジ検出部26により検出されたエッジ位置を示す座標からなる座標群を取得する(ステップS2)。そして、CPU10は、所定の規則に従って座標群から3個以上の座標を選択する(ステップS4)。続いて、CPU10は、選択した座標について、同一直線上に配置される度合を示す評価値を算出する(ステップS6)。すなわち、CPU10は、選択した座標についての評価値を後述する方法に従って算出する。そして、CPU10は、当該選択した座標の各々と対応付けて、算出した評価値を累積加算する(ステップS8)。
With reference to FIG. 4, the
さらに、CPU10は、座標群を構成する各座標が互いに同一回数だけ選択されたか否かを判断する(ステップS10)。座標群を構成する各座標が互いに同一回数だけ選択されていない場合(ステップS10においてNOの場合)には、CPU10は、上述したステップS4〜S10を繰返し実行する。
Further, the
座標群を構成する各座標が互いに同一回数だけ選択されていた場合(ステップS10においてYESの場合)には、CPU10は、累積加算された各座標の評価値(累積値)に基づいて、座標群から同一直線上に配置される度合が相対的に高い複数の座標を抽出する(ステップS12)。そして、CPU10は、抽出した複数の座標に基づいて、最小二乗法に従って近似直線を算出する(ステップS14)。なお、最小二乗法に従う近似直線の算出は周知の方法であるので、詳細な説明は省略する。さらに、CPU10は、その算出した近似直線を表示装置4や外部機器6へ出力し(ステップS16)、処理を終了する。
When the coordinates constituting the coordinate group have been selected the same number of times (YES in step S10), the
上述したように、本発明によれば、各座標と対応付けて評価値を累積加算するので、各座標は互いに同一回数だけ選択されなければならない。そこで、CPU10は、所定規則に従って、座標群から3個以上の座標の組合せを順次選択する。
As described above, according to the present invention, since the evaluation values are cumulatively added in association with each coordinate, each coordinate must be selected the same number of times. Therefore, the
一般的には、n個の座標を含む座標群から異なるr個の座標を選ぶ組合せは、nCr=n!/{r!×(n−r)!}通り存在する。このすべての組合せについて見ると、各座標は、いずれもnCr×r/n回選択されることになる。したがって、座標群を構成する各座標が互いに同一回数だけ選択される一例として、CPU10は、座標群から3個以上の座標を選ぶすべての組合せに対して、上述のステップS6およびS8を実行する。
In general, the combination of selecting different r coordinates from a group of coordinates including n coordinates is nCr = n! / {R! × (n−r)! } There are streets. Looking at all the combinations, each coordinate is selected nCr × r / n times. Therefore, as an example in which the coordinates constituting the coordinate group are selected the same number of times, the
以下では、理解を容易にするために、評価値を算出するために選択される座標の数が3個である場合について例示する。 In the following, in order to facilitate understanding, a case where the number of coordinates selected for calculating the evaluation value is three will be exemplified.
(評価値の算出処理および累積加算処理)
CPU10は、選択する3個の座標に対して、同一直線上に配置される度合を示す評価値を算出する。
(Evaluation value calculation processing and cumulative addition processing)
CPU10 calculates the evaluation value which shows the degree arrange | positioned on the same straight line with respect to three coordinates to select.
図5は、評価値の算出に係る処理の一例を説明するための図である。
図5(a)は、図3に示す座標a、座標cおよび座標eに対して評価値を算出する場合である。
FIG. 5 is a diagram for explaining an example of processing related to calculation of an evaluation value.
FIG. 5A shows a case where evaluation values are calculated for the coordinates a, coordinates c, and coordinates e shown in FIG.
図5(b)は、図3に示す座標a、座標cおよび座標dに対して評価値を算出する場合である。 FIG. 5B shows a case where evaluation values are calculated for the coordinates a, coordinates c, and coordinates d shown in FIG.
図5(a)および図5(b)を参照して、CPU10は、選択した3個の座標のうち、2個の座標を含む直線を規定する。そして、CPU10は、残余の座標と当該直線との距離に基づいて評価値を算出する。すなわち、残余の座標と当該直線との距離が小さいほど、選択された3個の座標は、同一直線上に配置される度合が高いと言える。
With reference to FIG. 5A and FIG. 5B, the
図5(a)を参照して、外れ値である座標eを含む場合には、座標aおよび座標eを含む直線60aeと残余の座標である座標cとの距離Lは、比較的大きな値となる。 Referring to FIG. 5A, when a coordinate e that is an outlier is included, the distance L between the straight line 60ae including the coordinate a and the coordinate e and the coordinate c that is the remaining coordinate is a relatively large value. Become.
一方、図5(b)を参照して、いずれも対象物OBJの輪郭線EDGに沿って検出された座標a、座標cおよび座標dからなる場合には、座標aおよび座標dを含む直線60adと残余の座標である座標cとの距離は、略ゼロとなる。 On the other hand, referring to FIG. 5B, in the case where each of the coordinates consists of coordinates a, coordinates c and coordinates d detected along the contour line EDG of the object OBJ, a straight line 60ad including the coordinates a and coordinates d. And the coordinate c which is the remaining coordinates are substantially zero.
そこで、この発明の実施の形態1においては、同一直線上に配置される度合が大きいほど、高い値をとる評価値を採用する。具体的には、選択される3個の座標を、座標i(xi,yi)、座標j(xj,yj)、座標k(xk,yk)とすると、座標iおよび座標kを含む直線と座標jとの距離Lijkについて座標iから座標kまでの距離で規格化して、(1)式に示す評価値Vijkを採用する。
Therefore, in
この評価値Vijkは、座標i、座標j、座標kが同一直線上に配置される場合において、最大値である「1」をとる。なお、座標i、座標j、座標kの配置順はいずれでもよく、たとえば座標上において、座標jが座標iと座標kとの間に配置されていなくともよい。 This evaluation value V ijk takes a maximum value of “1” when the coordinates i, j, and k are arranged on the same straight line. Note that the arrangement order of the coordinates i, the coordinates j, and the coordinates k may be any. For example, the coordinates j do not have to be arranged between the coordinates i and k.
そして、CPU10は、選択された座標i、座標j、座標kとそれぞれ対応付けて評価値Vijkをそれぞれ累積値P(i)、P(j)、P(k)に累積加算する。すべての組合せに対する評価値Vijkの算出、および評価値の加算が終了すると、CPU10は、座標群の中から累積値が相対的に高い座標を抽出する。一例として、座標群に含まれる座標のうち累積値が上位から所定数にある座標を抽出してもよい。
Then, the
図6は、図4に示すステップS4〜S10における処理をより具体的に実現するためのフローチャートである。なお、座標群には、座標1,座標2,・・・,座標nまでのn個の座標が含まれるとし、各座標は、(xi,yi;但し、1≦i≦n)で表されるとする。 FIG. 6 is a flowchart for more specifically realizing the processing in steps S4 to S10 shown in FIG. It is assumed that the coordinate group includes n coordinates from coordinate 1, coordinate 2,..., Coordinate n, and each coordinate is (x i , y i ; 1 ≦ i ≦ n) Let it be represented.
図6を参照して、CPU10は、累積値P(i)(但し、1≦i≦n)にゼロを代入して累積値を初期化する(ステップS100)。続いて、CPU10は、ループカウンタiに1を代入して初期化し(ステップS102)、ループカウンタjにループカウンタiの値に1を加算した値を代入し(ステップS104)、ループカウンタkにループカウンタjの値に1を加算した値を代入する(ステップS106)。
Referring to FIG. 6,
CPU10は、エッジ検出部26により検出された座標群から、座標(xi,yi),(xj,yj),(xk,yk)を取得し、評価値Vijkを算出する(ステップS108)。さらに、CPU10は、算出した評価値Vijkをそれぞれ累積値P(i),P(j),P(k)に累積加算する(ステップS110)。
The
そして、CPU10は、ループカウンタkに1を加算し(ステップS112)、ループカウンタkが座標数nを超過していないか否かを判断する(ステップS114)。ループカウンタkが座標数nを超過していない場合(ステップS114においてNOの場合)には、CPU10は、ステップS108〜S114を繰返し実行する。
Then, the
一方、ループカウンタkが座標数nを超過している場合(ステップS114においてYESの場合)には、CPU10は、ループカウンタjに1を加算し(ステップS116)、ループカウンタjが(座標数n−1)を超過していないか否かを判断する(ステップS118)。ループカウンタjが(座標数n−1)を超過していない場合(ステップS118においてNOの場合)には、CPU10は、ステップS106〜S118を繰返し実行する。
On the other hand, when the loop counter k exceeds the coordinate number n (YES in step S114), the
一方、ループカウンタjが(座標数n−1)を超過している場合(ステップS118においてYESの場合)には、CPU10は、ループカウンタiに1を加算し(ステップS120)、ループカウンタiが(座標数n−2)を超過していないか否かを判断する(ステップS122)。ループカウンタiが(座標数n−2)を超過していない場合(ステップS122においてNOの場合)には、CPU10は、ステップS104〜S122を繰返し実行する。
On the other hand, when the loop counter j exceeds (the number of coordinates n−1) (YES in step S118), the
一方、ループカウンタiが(座標数n−2)を超過している場合(ステップS122においてYESの場合)には、CPU10は、図4に示すステップS12以降の処理を実行する。
On the other hand, when the loop counter i exceeds (the number of coordinates n−2) (YES in step S122), the
上述した処理の内容をより理解できるように、一例として図3に示すエッジ位置a〜eに対して、本発明を適用した場合の処理結果を表1に示す。なお、エッジ位置a〜eの座標は、一例として、それぞれ(xa,ya)=(1,0),(xb,yb)=(2,0),(xc,yc)=(3,0),(xd,yd)=(4,0),(xe,ye)=(5,−1)とした。 Table 1 shows the processing results when the present invention is applied to the edge positions a to e shown in FIG. The coordinates of the edge positions a to e are, for example, (x a , y a ) = (1, 0), (x b , y b ) = (2, 0), (x c , y c ), respectively. = (3, 0), (x d , y d ) = (4, 0), (x e , y e ) = (5, −1).
表1を参照して、5個のエッジ位置から3個を選ぶ組合せは、5C3=10通りとなる。そして、CPU10は、各組合せに対して評価値Vを算出する。なお、表中において「○」印は、対応する座標が評価値Vの算出に用いられたことを示し、その右側の値は、そのときの評価値Vを示す。
Referring to Table 1, there are 5 C 3 = 10 combinations for selecting three from the five edge positions. Then, the
各座標a〜eは、それぞれ6回ずつ選択され、各選択時において算出された評価値Vの累積値Pは、表1の最下欄に示された値となる。特に、外れ値である座標eについては、いずれの組合せにおいても相対的に低い評価値Vが算出される一方、それ以外の座標a〜dのみからなる組合せでは、高い評価値Vが算出されている。 Each of the coordinates a to e is selected six times, and the accumulated value P of the evaluation values V calculated at the time of each selection is the value shown in the bottom column of Table 1. In particular, for the coordinate e which is an outlier, a relatively low evaluation value V is calculated in any combination, while in a combination consisting only of the other coordinates a to d, a high evaluation value V is calculated. Yes.
そのため、座標eにおける累積値Pは、座標a〜dのいずれにおける累積値Pに対しても、大幅に低い値となっている。そして、座標a〜eのうち、たとえば累積値Pの上位3個までを抽出する場合には、座標a〜cが抽出されることになる。この結果、外れ値である座標eが取除かれ、高い精度の近似直線が算出されることがわかる。 For this reason, the cumulative value P at the coordinate e is significantly lower than the cumulative value P at any of the coordinates a to d. Then, when extracting, for example, the top three of the accumulated values P among the coordinates a to e, the coordinates a to c are extracted. As a result, it is understood that the coordinate e which is an outlier is removed and an approximate straight line with high accuracy is calculated.
(比較例)
図7は、本発明の効果を従来のLTS推定法における効果と比較する比較例である。
(Comparative example)
FIG. 7 is a comparative example comparing the effect of the present invention with the effect of the conventional LTS estimation method.
図7(a)は、従来のLTS推定法による近似直線算出を示す。
図7(b)は、本発明による近似直線算出を示す。
FIG. 7A shows approximate line calculation by a conventional LTS estimation method.
FIG. 7B shows approximate straight line calculation according to the present invention.
なお、図7(a)および図7(b)においては、同一の画像に対して直線算出処理が行なわれており、マスク領域50内において検出された32個のエッジ位置(+マーク)は、互いに同一である。そして、従来のLTS推定法(図7(a))においては、各エッジ位置から暫定近似直線までの距離(残差)が小さい順に全体の50%(16個)を抽出して近似直線を算出した。一方、本発明の場合(図7(b))においては、累積値が大きい順に全体の50%(16個)を抽出して近似直線を算出した。なお、図7(a)および図7(b)においては、近似直線の算出に使用されたエッジ位置は、その+マークの中心に○印をさらに付加している。
7A and 7B, straight line calculation processing is performed on the same image, and the 32 edge positions (+ marks) detected in the
図7(a)を参照して、マスク領域50の紙面右上において、対象物OBJの輪郭線以外の位置が集中的にエッジ位置として誤検出されている。このように対象物OBJの輪郭線以外で検出されたエッジ位置は、本来的に外れ値であるが、その数が多いため、結果的に外れ値が優勢となっている。そのため、対象物OBJの輪郭線を正常に検出しているエッジ位置が取除かれて、誤った近似直線60aが算出されていることがわかる。
With reference to FIG. 7A, in the upper right of the
一方、図7(b)を参照して、本発明を適用した場合には、マスク領域50の紙面右上において集中的に誤検出されている外れ値のエッジ位置がすべて取除かれていることがわかる。この結果、算出される近似直線60bは、対象物OBJの輪郭線と略一致した、正確なものとなる。
On the other hand, referring to FIG. 7B, when the present invention is applied, all the outlier edge positions that have been erroneously detected in the upper right of the
この発明の実施の形態1によれば、座標群から選択された3個の座標の組合せ毎に、同一直線上に配置される度合を示す評価値が算出される。このように、評価値は、座標群全体から算出される暫定近似直線に基づいて算出されるのではなく、選択された3個の座標の間でミクロ的に算出される。外れ値である座標は、いずれの組合せにおいても、同一直線上に配置される度合が低い一方、正常な座標は、正常な座標同士の組合せにおいて、同一直線上に配置される度合が高くなる。その結果、座標の各々と対応付けて評価値が累積されることで、正常な座標と外れ値の座標との差が顕著に表れるため、外れ値を効率的に取除くことができる。よって、座標群に含まれる座標から外れ値を効率的に取除いて、精度の高い近似直線を算出できる画像処理装置を実現できる。
According to
(変形例1)
上述したこの発明の実施の形態1においては、座標群から異なる3個の座標を選んで評価値を算出する場合について説明したが、4個以上の座標を選んで評価値を算出してもよい。この場合には、選ばれた4個以上の座標のうち、2個の座標を含む直線を規定し、当該直線に対する残余の各座標との距離の積算値に基づいて評価値を算出する。
(Modification 1)
In the first embodiment of the present invention described above, the case has been described in which the evaluation value is calculated by selecting three different coordinates from the coordinate group, but the evaluation value may be calculated by selecting four or more coordinates. . In this case, a straight line including two coordinates among the four or more selected coordinates is defined, and an evaluation value is calculated based on an integrated value of distances from the remaining coordinates with respect to the straight line.
すなわち、選択されるr(r≧4)個の座標を、座標i(xi,yi)、座標l(xl,yl)、・・・、座標m(xm,ym)、座標k(xk,yk)とすると、上述した(1)式を拡張して、(2)式のような評価値Vi〜kが算出できる。 That is, r (r ≧ 4) selected coordinates are represented by coordinates i (x i , y i ), coordinates l (x l , y l ),..., Coordinates m (x m , y m ), If the coordinates are k (x k , y k ), the evaluation values V i to k like the equation (2) can be calculated by extending the above equation (1).
この評価値Vi〜kについても、同一直線上に配置される度合が大きいほど高い値をとる。評価値Vi〜kの算出方法を除いては、上述したこの発明の実施の形態1と同様であるので、詳細な説明は繰返さない。 The evaluation values V i to k also take higher values as the degree of arrangement on the same straight line increases. Except for the method of calculating evaluation values V i to k , it is the same as that of the first embodiment of the present invention described above, and therefore detailed description will not be repeated.
この発明の実施の形態1の変形例1によれば、評価値を算出するために座標群から選ぶ座標の数を4個以上に拡張できる。そのため、その選ばれる座標の個数を適切に選択することで、座標群から異なる3個の座標を選ぶ場合に比較して、組合せ数をより少なくできる。これにより、上述したこの発明の実施の形態1における効果に加えて、その評価値を算出するための処理回数を低減できるので、多数の座標からなる座標群に対して本発明を適用する場合においても、その処理速度を維持できる。 According to the first modification of the first embodiment of the present invention, the number of coordinates selected from the coordinate group for calculating the evaluation value can be expanded to four or more. Therefore, by appropriately selecting the number of selected coordinates, the number of combinations can be reduced as compared with the case of selecting three different coordinates from the coordinate group. As a result, in addition to the effects of the first embodiment of the present invention described above, the number of processing for calculating the evaluation value can be reduced. Therefore, when the present invention is applied to a coordinate group consisting of a large number of coordinates However, the processing speed can be maintained.
(変形例2)
上述したこの発明の実施の形態1およびその変形例1においては、選択された座標のうち2個の座標を含む直線を規定し、残余の座標の各々と当該規定された直線との距離に基づいて評価値を算出する構成について説明した。一方、この発明の実施の形態1の変形例2においては、選択された座標についての相関係数に基づいて評価値を算出する構成について説明する。
(Modification 2)
In
評価値を算出するために選択されるr(r≧3)個以上の座標の組合せを、座標i(xi,yi;1≦i≦r)とすると、座標i(1≦i≦r)についての相関係数と一致する評価値Vを算出することができる。 If a combination of r (r ≧ 3) or more coordinates selected for calculating the evaluation value is a coordinate i (x i , y i ; 1 ≦ i ≦ r), the coordinate i (1 ≦ i ≦ r) The evaluation value V coinciding with the correlation coefficient can be calculated.
この評価値Vは、座標iについての相関係数と一致するので、座標の同一直線上に配置される度合に応じて、−1≦V≦1の範囲で変化し、いずれの座標も同一直線上に配置される場合には、最大値の「1」をとる。したがって、上述したこの発明の実施の形態1およびその変形例1と同様に、累積値の大きい順に所定の数の座標を抽出することで、近似直線を算出できる。
Since this evaluation value V coincides with the correlation coefficient for the coordinate i, it changes in the range of −1 ≦ V ≦ 1 depending on the degree of arrangement on the same straight line of coordinates, and all the coordinates are identical. When arranged on a line, the maximum value “1” is taken. Therefore, similar to
この評価値の算出方法以外は、上述したこの発明の実施の形態1と同様であるので、詳細な説明は繰返さない。 Since the method other than the method of calculating the evaluation value is the same as that of the first embodiment of the present invention described above, detailed description will not be repeated.
この発明の実施の形態1の変形例2によれば、評価値を算出するために座標群から選ばれる座標の数にかかわらず同一の演算式を用いることができる。これにより、上述したこの発明の実施の形態1における効果に加えて、評価値の算出に係る処理を比較的自由に変更できるため、対象物の大きさや画像の品質(サイズや解像度)などに応じて、処理を最適化できる。 According to the second modification of the first embodiment of the present invention, the same arithmetic expression can be used regardless of the number of coordinates selected from the coordinate group in order to calculate the evaluation value. As a result, in addition to the effects of the first embodiment of the present invention described above, the processing related to the calculation of the evaluation value can be changed relatively freely. Process optimization.
[実施の形態2]
上述のこの発明の実施の形態1およびその変形例においては、2次元画像を対象として近似直線を算出する構成について説明した。一方、この発明の実施の形態2においては、3次元画像を対象として近似直線を算出する構成について説明する。3次元画像には、一例として、いわゆるステレオ画像などが含まれ、3次元の値で各座標が定義される。
[Embodiment 2]
In the above-described first embodiment of the present invention and its modifications, the configuration for calculating an approximate line for a two-dimensional image has been described. On the other hand, in
図8は、この発明の実施の形態2に従う近似直線算出装置を備える画像処理装置100#の概略構成図である。
FIG. 8 is a schematic configuration diagram of an
図8を参照して、画像処理装置100#は、2つのカメラ2.1,2.2により撮影された2次元画像をそれぞれ取得して3次元画像を生成すると同時に、3次元画像上のエッジ位置に基づいて近似直線を算出する。そして、画像処理装置100#は、図1に示すこの発明の実施の形態1に従う画像処理装置100において、画像入力部20、フィルタ22、画像メモリ24に代えて、それぞれ画像入力部20.1,20.2、フィルタ22.1,22.2、画像メモリ24.1,24.2を配置し、エッジ検出部26および画像出力部28に代えて、それぞれエッジ検出部26および画像出力部28を配置したものである。
Referring to FIG. 8,
カメラ2.1および2.2は、互いに異なる方向から同一の対象物を撮影するように配置される。その他の点については、カメラ2と同様であるので、詳細な説明は繰返さない。フィルタ22.1,22.2および画像メモリ24.1,24.2は、それぞれフィルタ22および画像メモリ24と同様であるので、詳細な説明は繰返さない。
The cameras 2.1 and 2.2 are arranged so as to photograph the same object from different directions. Since the other points are the same as those of
画像出力部28#は、カメラ2.1,2.2により撮影された2つの画像を対比し、3次元空間中に対象物が描画された3次元画像を生成する。具体的には、画像出力部28#は、一方の画像の各画素について、他方のいずれの画素に対応するのかを算出し、この画素のずれを画素情報とする視差画像を生成し、この生成した視差画像に基づいて、3次元画像を生成する。
The
エッジ検出部26#は、カメラ2.1および2.2により撮影された画像のそれぞれにおいてエッジ位置を検出するとともに、上述した画像出力部28#と同様に、2つの画像の対比に基づいて画素のずれを算出し、検出したエッジ位置の3次元空間中における座標を算出する。そして、エッジ検出部26#は、検出した複数のエッジ位置を座標群としてCPU10および画像メモリ24.1,24.2へ出力する。
The
その他については、この発明の実施の形態1に従う画像処理装置100と同様であるので、詳細な説明は繰返さない。
Others are similar to those of
このような3次元画像に対して本発明を適用する場合には、評価値の算出に係る数式を以下のように変更する点を除いて、上述したこの発明の実施の形態1に従う画像処理装置100における処理と同一であるので、詳細な説明は繰返さない。 When the present invention is applied to such a three-dimensional image, the image processing apparatus according to the first embodiment of the present invention described above, except that the mathematical formula for calculating the evaluation value is changed as follows. Since it is the same as the process in 100, detailed description will not be repeated.
(評価値の算出処理)
上述したこの発明の実施の形態1と同様に、座標群から選択された3個以上の座標のうち、2個の座標を含む直線を規定するとともに、残余の座標と当該規定された直線との距離に基づいて評価値を算出する。
(Evaluation value calculation process)
As in the first embodiment of the present invention described above, a straight line including two coordinates among the three or more coordinates selected from the coordinate group is defined, and the remaining coordinates and the defined straight line are defined. An evaluation value is calculated based on the distance.
まず、座標群から3個の座標が選択される場合には、選択される座標を座標i(xi,yi,zi)、座標j(xj,yj,zj)、座標k(xk,yk,zk)とすると、(1)式を拡張して(4)式のような3次元座標についての評価値Vijkを算出できる。 First, when three coordinates are selected from the coordinate group, the selected coordinates are coordinate i (x i , y i , z i ), coordinate j (x j , y j , z j ), coordinate k. Assuming that (x k , y k , z k ), it is possible to calculate the evaluation value V ijk for the three-dimensional coordinates like the equation (4) by expanding the equation (1).
さらに、座標群から4個以上の座標が選択される場合には、選択されるr(r≧4)個の座標を、座標i(xi,yi,zi)、座標l(xl,yl,zl)、・・・、座標m(xm,ym,zm)、座標k(xk,yk,zk)とすると、上述した(4)式を拡張して、(5)式のように評価値Vi〜kを算出できる。 Further, when four or more coordinates are selected from the coordinate group, the selected r (r ≧ 4) coordinates are represented by coordinates i (x i , y i , z i ) and coordinates l (x l , Y l , z l ),..., Coordinates m (x m , y m , z m ), coordinates k (x k , y k , z k ), the above equation (4) is expanded. Evaluation values V i to k can be calculated as shown in Equation (5).
この評価値Vijkおよび評価値Vi〜kについても、同一直線上に配置される度合が大きいほど高い値をとる。CPU10は、このように算出される3次元座標についての評価値を用いて、上述の処理と同様に、近似直線を算出する。
The evaluation value V ijk and the evaluation values V i to k take higher values as the degree of arrangement on the same straight line is larger. The
この発明の実施の形態2においては、この発明の実施の形態1における効果に加えて、今後ますます適用範囲の拡大が予想される3次元画像についても、精度の高い近似直線を算出できる。 In the second embodiment of the present invention, in addition to the effects of the first embodiment of the present invention, an approximate straight line with high accuracy can be calculated for a three-dimensional image that is expected to expand in the future.
(変形例)
さらに、上述したこの発明の実施の形態1の変形例2と同様に、選択された座標についての相関係数に基づいて評価値を算出することもできる。
(Modification)
Furthermore, as in the second modification of the first embodiment of the present invention described above, the evaluation value can be calculated based on the correlation coefficient for the selected coordinates.
具体的には、評価値を算出するために選択されるr(r≧3)個以上の座標を、座標i(xi,yi,zi;1≦i≦r)とすると、2つの成分間(xy成分、yz成分、zx成分)における相関係数(Vxy,Vyz,Vzx)に基づいて、(6)式または(7)式にように、評価値Vを算出できる。 Specifically, when r (r ≧ 3) or more coordinates selected for calculating the evaluation value are coordinates i (x i , y i , z i ; 1 ≦ i ≦ r), Based on the correlation coefficients (V xy , V yz , V zx ) between the components (xy component, yz component, zx component), the evaluation value V can be calculated as in equation (6) or equation (7).
これらの式からわかるように、3つの成分についての相関係数を算出することはできないので、3次元の座標値のうち、いずれか2つの成分についての相関係数をそれぞれ算出した後、各相関係数から評価値Vを算出する。 As can be seen from these equations, since the correlation coefficients for the three components cannot be calculated, after calculating the correlation coefficients for any two of the three-dimensional coordinate values, An evaluation value V is calculated from the number of relations.
(6)式に示す評価値Vにおいては、座標の同一直線上に配置される度合に応じて、−3≦V≦3の範囲で変化し、いずれの座標も同一直線上に配置される場合には、最大値の「3」をとる。 In the evaluation value V shown in the expression (6), when the coordinates are arranged in the range of −3 ≦ V ≦ 3 according to the degree of arrangement on the same straight line of coordinates, any coordinate is arranged on the same straight line. Takes the maximum value of “3”.
一方、(7)式に示す評価値Vにおいては、座標の同一直線上に配置される度合に応じて、−1≦V≦1の範囲で変化し、いずれの座標も同一直線上に配置される場合には、最大値の「1」をとる。 On the other hand, the evaluation value V shown in the equation (7) changes in the range of −1 ≦ V ≦ 1 depending on the degree of arrangement on the same straight line of coordinates, and all the coordinates are arranged on the same straight line. In this case, the maximum value “1” is taken.
したがって、上述したこの発明の実施の形態2と同様に、累積加算後の累積値が大きい順に、所定の数の座標を抽出することで、近似直線を算出できる。この評価値の算出方法以外は、上述したこの発明の実施の形態2と同様であるので、詳細な説明は繰返さない。 Therefore, as in the second embodiment of the present invention described above, an approximate straight line can be calculated by extracting a predetermined number of coordinates in descending order of the cumulative value after cumulative addition. Except for the method of calculating the evaluation value, the method is the same as that of the second embodiment of the present invention described above, and the detailed description will not be repeated.
[その他の実施の形態]
上述した実施の形態の説明においては、エッジ検出部を備える画像処理装置を一例として示したが、エッジ検出部が必ずしも画像処理装置に含まれている必要はない。たとえば、外部装置により検出されたエッジ位置の座標を受けて、当該座標に基づいて近似直線を算出する近似直線算出装置を構成してもよい。
[Other embodiments]
In the description of the above-described embodiment, an image processing apparatus including an edge detection unit is shown as an example. However, the edge detection unit is not necessarily included in the image processing apparatus. For example, an approximate straight line calculation device that receives the coordinates of the edge position detected by the external device and calculates an approximate straight line based on the coordinates may be configured.
上述した実施の形態の説明においては、エッジ検出部が画像中の所定幅をもつ領域に対して色情報を累積してエッジ位置を検出する構成について説明したが、エッジ位置の検出方法は、これに限られず、周知のエッジ位置検出手段を適用することができる。さらに、エッジ位置を検出するための走査方向も対象物の直線形状部位の位置や方向などに応じて、たとえば画像の斜め方向に走査してもよい。 In the above description of the embodiment, the configuration has been described in which the edge detection unit accumulates color information for an area having a predetermined width in an image to detect the edge position. However, it is not limited to this, and a well-known edge position detecting means can be applied. Furthermore, the scanning direction for detecting the edge position may also be scanned, for example, in an oblique direction of the image in accordance with the position or direction of the linear shape portion of the object.
上述した実施の形態の説明においては、エッジ検出部により検出された座標群から選ばれる3個以上の座標の組合せのすべてに対して評価値を算出する構成について説明したが、必ずしもすべての組合せに対して評価値を算出する必要はない。 In the description of the above-described embodiment, the configuration in which the evaluation value is calculated for all the combinations of three or more coordinates selected from the coordinate group detected by the edge detection unit has been described. There is no need to calculate an evaluation value.
たとえば、画像上における距離が所定値(所定画素)以下となるように3個以上の座標を選択してもよい。このように選択された画素は互いに近接するため、より適切にその同一直線上に配置される度合を評価できる。 For example, three or more coordinates may be selected so that the distance on the image is a predetermined value (predetermined pixel) or less. Since the pixels selected in this manner are close to each other, it is possible to evaluate the degree of arrangement on the same straight line more appropriately.
また、各座標に対応するエッジ位置における色情報の変化度に応じて、評価値を算出するための座標の組合せを決定してもよい。具体的には、エッジ位置周辺における画素の「色距離」を評価し、色距離の小さい(色情報の変化が小さい)エッジ位置に対応する座標を、色距離の大きいエッジ位置に対応する座標と組合せるようにしてもよい。この「色距離」とは、互いに直交するように配置された赤軸,緑軸,青軸からなる3次元の色空間において、2つの画素の距離として規定される。このような組合せを採用することで、色距離が小さく信頼性の低い(誤検出された可能性の高い)座標と、色距離が小さく信頼性の高い座標との評価値の差がより顕著となるため、信頼性の低い座標が取除かれる割合が高まる。このため、より正確な近似直線を算出できる。 Further, a combination of coordinates for calculating an evaluation value may be determined according to the degree of change in color information at the edge position corresponding to each coordinate. Specifically, the “color distance” of the pixels around the edge position is evaluated, and the coordinates corresponding to the edge position having a small color distance (color information change is small) are defined as coordinates corresponding to the edge position having a large color distance. You may make it combine. The “color distance” is defined as a distance between two pixels in a three-dimensional color space composed of a red axis, a green axis, and a blue axis arranged so as to be orthogonal to each other. By adopting such a combination, the difference in evaluation value between coordinates with a small color distance and low reliability (highly likely to be erroneously detected) and coordinates with a small color distance and high reliability is more pronounced. Therefore, the rate at which coordinates with low reliability are removed increases. For this reason, a more accurate approximate straight line can be calculated.
今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は、上記した説明ではなく、特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。 The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.
2,2.1,2.2 カメラ、4 表示装置、6 外部機器、18 入出力部、20,20.1,20.2 画像入力部、22,22.1,22.2 フィルタ、24,24.1,24.2 画像メモリ、26,26# エッジ検出部、28,28# 画像出力部、30 バス、40.1,40.2 走査位置、42.1,42.2 領域、44 エッジ位置群、44.1,44.2 エッジ位置、46.1,46.2 色情報ヒストグラム、48.1,48.2 変化位置、50 マスク領域、52 ノイズ領域、60a,60b 近似直線、100 画像処理装置、EDG 輪郭線、IMG 画像、OBJ 対象物、P 累積値、V 評価値。 2, 2.1, 2.2 Camera, 4 Display device, 6 External device, 18 Input / output unit, 20, 20.1, 20.2 Image input unit, 22, 22.1, 22.2 Filter, 24, 24.1, 24.2 Image memory, 26, 26 # edge detection unit, 28, 28 # Image output unit, 30 bus, 40.1, 40.2 Scan position, 42.1, 42.2 area, 44 edge Position group, 44.1, 44.2 Edge position, 46.1, 46.2 Color information histogram, 48.1, 48.2 Change position, 50 Mask area, 52 Noise area, 60a, 60b Approximate line, 100 images Processing device, EDG contour, IMG image, OBJ object, P cumulative value, V evaluation value.
Claims (8)
所定規則に従って、前記座標群から3個以上の座標を選択する座標選択手段と、
前記座標選択手段により選択された前記3個以上の座標について、同一直線上に配置される度合を示す評価値を算出する評価値算出手段と、
当該3個以上の座標の各々と対応付けて、前記評価値算出手段により算出される前記評価値を累積加算する評価値加算手段と、
前記座標群の各座標が互いに同一回数だけ選択されるように、前記座標選択手段、前記評価値算出手段および前記評価値加算手段における処理を繰返し実行させる繰返手段と、
前記評価値加算手段により累積加算された前記評価値に基づいて、前記座標群から同一直線上に配置される度合が相対的に高い複数の座標を抽出する抽出手段と、
前記抽出手段により抽出された複数の座標に基づいて近似直線を算出する近似直線算出手段とを備える、画像処理装置。 Coordinate group acquisition means for acquiring a coordinate group including four or more coordinates indicating a specific position of the image;
Coordinate selecting means for selecting three or more coordinates from the coordinate group according to a predetermined rule;
Evaluation value calculation means for calculating an evaluation value indicating the degree of arrangement on the same straight line for the three or more coordinates selected by the coordinate selection means;
An evaluation value adding means for accumulating the evaluation values calculated by the evaluation value calculating means in association with each of the three or more coordinates;
Repeating means for repeatedly executing the processes in the coordinate selecting means, the evaluation value calculating means, and the evaluation value adding means so that the coordinates of the coordinate group are selected the same number of times.
Extraction means for extracting a plurality of coordinates having a relatively high degree of arrangement on the same straight line from the coordinate group based on the evaluation values cumulatively added by the evaluation value addition means;
An image processing apparatus comprising: an approximate line calculation unit that calculates an approximate line based on a plurality of coordinates extracted by the extraction unit.
画像を取得する画像取得部と、
前記画像取得部により取得された画像中において、色情報に変化を生じるエッジ位置を検出して前記座標群を取得するエッジ検出部とを含む、請求項1に記載の画像処理装置。 The coordinate group acquisition means includes
An image acquisition unit for acquiring images;
The image processing apparatus according to claim 1, further comprising: an edge detection unit that detects an edge position that causes a change in color information in the image acquired by the image acquisition unit and acquires the coordinate group.
所定規則に従って、前記座標群から3個以上の座標を選択する座標選択手段と、
前記座標選択手段により選択された前記3個以上の座標について、同一直線上に配置される度合を示す評価値を算出する評価値算出手段と、
当該3個以上の座標の各々と対応付けて、前記評価値算出手段により算出される前記評価値を累積加算する評価値加算手段と、
前記座標群の各座標が互いに同一回数だけ選択されるように、前記座標選択手段、前記評価値算出手段および前記評価値加算手段における処理を繰返し実行させる繰返手段と、
前記評価値加算手段により累積加算された前記評価値に基づいて、前記座標群から同一直線上に配置される度合が相対的に高い複数の座標を抽出する抽出手段と、
前記抽出手段により抽出された複数の座標に基づいて近似直線を算出する近似直線算出手段とを備える、近似直線算出装置。 Coordinate group acquisition means for acquiring a coordinate group including four or more coordinates;
Coordinate selecting means for selecting three or more coordinates from the coordinate group according to a predetermined rule;
Evaluation value calculation means for calculating an evaluation value indicating the degree of arrangement on the same straight line for the three or more coordinates selected by the coordinate selection means;
An evaluation value adding means for accumulating the evaluation values calculated by the evaluation value calculating means in association with each of the three or more coordinates;
Repeating means for repeatedly executing the processes in the coordinate selecting means, the evaluation value calculating means, and the evaluation value adding means so that the coordinates of the coordinate group are selected the same number of times.
Extraction means for extracting a plurality of coordinates having a relatively high degree of arrangement on the same straight line from the coordinate group based on the evaluation values cumulatively added by the evaluation value addition means;
An approximate line calculation device comprising: an approximate line calculation means for calculating an approximate line based on a plurality of coordinates extracted by the extraction means.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006071567A JP2007249555A (en) | 2006-03-15 | 2006-03-15 | Image processor and approximate straight line calculation apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006071567A JP2007249555A (en) | 2006-03-15 | 2006-03-15 | Image processor and approximate straight line calculation apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2007249555A true JP2007249555A (en) | 2007-09-27 |
Family
ID=38593787
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006071567A Withdrawn JP2007249555A (en) | 2006-03-15 | 2006-03-15 | Image processor and approximate straight line calculation apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2007249555A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2884426A1 (en) | 2013-12-12 | 2015-06-17 | Omron Corporation | Image processing device, image processing method, and image processing program |
KR102694907B1 (en) * | 2019-05-07 | 2024-08-14 | 광주과학기술원 | A photo realistic image generation apparatus |
-
2006
- 2006-03-15 JP JP2006071567A patent/JP2007249555A/en not_active Withdrawn
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2884426A1 (en) | 2013-12-12 | 2015-06-17 | Omron Corporation | Image processing device, image processing method, and image processing program |
JP2015114876A (en) * | 2013-12-12 | 2015-06-22 | オムロン株式会社 | Image processor, image processing method and image processing program |
US9582733B2 (en) | 2013-12-12 | 2017-02-28 | Omron Corporation | Image processing device, image processing method, and image processing program |
KR102694907B1 (en) * | 2019-05-07 | 2024-08-14 | 광주과학기술원 | A photo realistic image generation apparatus |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI389553B (en) | Methods and devices for image signal processing | |
JP4378746B2 (en) | Digital image sensor and method capable of detecting defective pixels | |
JP6701118B2 (en) | Image processing apparatus and image processing method | |
US7684617B2 (en) | Apparatus and methods for processing images | |
US7801357B2 (en) | Image processing device, image processing method, program for the same, and computer readable recording medium recorded with program | |
JP6021665B2 (en) | Image processing apparatus, image processing method, and computer program | |
JP4275149B2 (en) | Boundary position determination apparatus, method for determining boundary position, program for causing computer to function as the apparatus, and recording medium | |
JP5155110B2 (en) | Monitoring device | |
JP2007078663A (en) | Method and device for inspecting defect | |
CN107958202B (en) | Human body detection apparatus, control method of human body detection apparatus, and storage medium | |
JP5466099B2 (en) | Appearance inspection device | |
JP2009260671A (en) | Image processing apparatus and imaging device | |
JP2007249555A (en) | Image processor and approximate straight line calculation apparatus | |
JP2013546084A (en) | How to identify anomalies in images | |
JP2010198476A (en) | Defect detecting apparatus, defect detecting method and defect detecting program | |
JP5754931B2 (en) | Image analysis apparatus, image analysis method, and program | |
EP2775422A2 (en) | Object detection apparatus, program, and integrated circuit | |
JP2008028475A (en) | Image processor, image processing program, recording medium recording image processing program, image processing method | |
JP2009009206A (en) | Extraction method of outline inside image and image processor therefor | |
US10885348B2 (en) | Information processing device, information processing method, and storage medium | |
JP7034781B2 (en) | Image processing equipment, image processing methods, and programs | |
JP2016057068A (en) | Pattern fault checkup apparatus, and pattern fault checkup method | |
JP2007249526A (en) | Imaging device, and face area extraction method | |
JP5130257B2 (en) | Image processing device | |
JP2003302354A (en) | Appearance inspection method and appearance inspection device for electronic circuit parts, and method for manufacturing electronic circuit parts |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20090602 |