JP4023330B2 - Image identification device - Google Patents

Image identification device Download PDF

Info

Publication number
JP4023330B2
JP4023330B2 JP2003037153A JP2003037153A JP4023330B2 JP 4023330 B2 JP4023330 B2 JP 4023330B2 JP 2003037153 A JP2003037153 A JP 2003037153A JP 2003037153 A JP2003037153 A JP 2003037153A JP 4023330 B2 JP4023330 B2 JP 4023330B2
Authority
JP
Japan
Prior art keywords
rgb
ratios
image
values
pixel
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
Application number
JP2003037153A
Other languages
Japanese (ja)
Other versions
JP2004246717A (en
Inventor
勝行 首藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Victor Company of Japan Ltd
Original Assignee
Victor Company of Japan Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Victor Company of Japan Ltd filed Critical Victor Company of Japan Ltd
Priority to JP2003037153A priority Critical patent/JP4023330B2/en
Publication of JP2004246717A publication Critical patent/JP2004246717A/en
Application granted granted Critical
Publication of JP4023330B2 publication Critical patent/JP4023330B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)
  • Image Processing (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、画像識別装置に関する。
【0002】
【従来の技術】
従来、例えば特開平4−369087号公報に記載されているような、色により物体を認識する画像識別装置が知られている。
【0003】
【特許文献1】
特開平4−369087号公報
【0004】
【発明が解決しようとする課題】
従来の画像識別装置は、識別精度が高くない問題点と、対象物が暗い場合に誤検出しやすい問題点があった。
【0005】
本発明は、このような従来の技術的課題を解決するためになされたもので、色識別精度が高く、また対象物が暗い場合にも正確に色識別できる画像識別装置を提供することを目的とする。
【0006】
【課題を解決するための手段】
請求項1の発明は、画像入力部と演算処理部とを備え、前記演算処理部は、前記画像入力部に入力された原画像から所望の対象画像を予め設定した設定色に基づいて識別する画像識別装置であって、前記演算処理部は、前記設定色のRGB値であるR0、G0、B0を予め記憶し、該RGB値から設定RGB比率C=R0/G0、D=G0/B0、E=B0/R0を求め、前記原画像の画素毎に、該画素のRGB値であるR1、G1、B1から原RGB比率H=R1/G1、I=G1/B1、J=B1/R1を求め、前記設定RGB比率と前記原RGB比率との比である比率K1=H/C、L1=I/D、M1=J/Eを求め、前記比率K1、L1、M1の各値が1以下の場合は、K2=K1、L2=L1、M2=M1とし、前記比率K1、L1、M1の各値が1を超える場合は、K2=1/K1、L2=1/L1、M2=1/M1とし、前記比率K2、L2、M2の積であるK2×L2×M2を求めてその値を評価値Nとし、前記評価値Nが所定のしきい値以上となるRGB値R1、G1、B1を有する前記画素を対象画素として抽出し、前記対象画素の分布に応じて前記対象画像を識別する識別手段を有することを特徴とするものである。
【0007】
請求項2の発明は、画像入力部と演算処理部とを備え、前記演算処理部は、前記画像入力部に入力された原画像から所望の対象画像を予め設定した設定色に基づいて識別する画像識別装置であって、前記演算処理部は、前記設定色のRGB値であるR0、G0、B0を予め記憶し、該RGB値から設定RGB比率C=R0/G0、D=G0/B0、E=B0/R0を求め、前記原画像の画素毎に、該画素のRGB値であるR1、G1、B1から原RGB比率H=R1/G1、I=G1/B1、J=B1/R1を求める一方、該画素の明るさ情報Tを求め、前記設定RGB比率と前記原RGB比率との比である比率K1=H/C、L1=I/D、M1=J/Eを求め、前記比率K1、L1、M1の各値が1以下の場合は、K2=K1、L2=L1、M2=M1とし、前記比率K1、L1、M1の各値が1を超える場合は、K2=1/K1、L2=1/L1、M2=1/M1とし、前記比率K2、L2、M2の積であるK2×L2×M2を求めてその値を積Sとし、前記積Sと前記明るさ情報Tとの積S×Tを評価値Uとし、評価値Uが所定のしきい値以上となるRGB値R1、G1、B1及び前記明るさ情報Tを有する前記画素を対象画素として抽出し、前記対象画素の分布に応じて前記対象画像を識別する識別手段を有することを特徴とするものである。
【0008】
ここで、前記明るさ情報Tには、前記画素のRGB値の和であるF=R1+G1+B1を利用することができる。
【0009】
【発明の実施の形態】
以下、本発明の実施の形態を図に基づいて詳説する。図1に本発明の第1の実施の形態の画像識別装置を組み込んだロボット1の概略図を示す。ロボット1の頭部2の鼻先にはビデオカメラ3が取り付けてある。ロボット1の目の部分は赤外線受光部4になっている。ロボット1の耳にはマイクロホン5が取り付けてあり、音や声を入力することが可能である。
【0010】
頭部2はロボット1の胴体6に取り付けてある。この頭部2は、2自由度のアクチュエータを介して取り付けてあり、左右・上下に動かすことが可能である。
【0011】
ロボット1の胴体6には4本の脚7が取り付けてある。この脚7もアクチュエータを介して取り付けてあり、歩行が可能であり、自身の姿勢も制御できる。図1において、8はスピーカ、9はしつけボタンである。なお、このロボット1の駆動機構は一般的なものであり、詳細については図示していない。
【0012】
ロボット1の鼻先のビデオカメラ3から出力された映像情報は、原画像として後述する内部のCPU11に送られ、このCPU11により画像認識処理など行い、これをもとに動作などに反映させる。例えば、好きな色のボールが転がっていればこれを識別して追いかけたり、嫌いなものがあればこれから退避したりする行動をとるように設定するのである。
【0013】
図2にロボット1の制御系のブロック図を示す。ロボット1の動作制御はCPU11により予め組み込んであるソフトウェアプログラムを実行することによって行うものであるが、ここではCPU11の演算処理を機能別に分けて説明する。
【0014】
ビデオカメラ3からCPU11の画像入力ポート12に映像信号Y(輝度)、U(色差)、V(色差)と同期信号Vs、Hsが出力される。CPU11では、ビデオカメラ3からの同期信号Vs、Hsに同期して画像入力ポート12よりデータを取り込み、画像データ処理部13において画像データ処理を行う。
【0015】
この画像データ処理部13では、入力したYUVデータをRGB値に変換する等の処理を行う。このYUVデータのRGB値への変換は、下記のとおりである。
【0016】
【数1】
R=Y+1.402V
G=Y−0.714V−0.344U
B=Y+1.772U
画像データ処理部13ではビデオカメラ3からの各画素のYUVデータに対して画素毎にRGB値を求める。
【0017】
次に、この画素毎のRGB値を基にして、この画素が識別対象物の色を有しているか否かを全体制御部14で判定する。
【0018】
そして、画像データ中に、識別対象物の色を有する画素を所定値以上の数検出した場合(この方法についての詳細は後述する)、識別対象物がビデオカメラ3の前に存在すると判断し、これに対応してロボット1の行動パターンを決定し、動作制御部15に指示する。動作制御部15は指示された行動パターンを実現するために各部駆動モータ21と発音部22を動作制御し、ロボット1を頭部2を動かしたり、脚7で歩かせたり、またほえる声をスピーカ8から出させる等の動作をさせる。
【0019】
全体制御部14による画像識別処理は、図3のフローチャートの手順による。予め、所望の多数の対象物それぞれについて、識別すべき色のRGB値とこのRGB値を組み合わせた比率とを求める。これらの値はCPU11に記憶させておく(ステップS1)。
【0020】
例1として、対象物が黄色のテニスボールの場合、R0=176、G0=189、B0=80とであり、各色の比率C、D、Eは、次の通りである。
【0021】
【数2】
C=R0/G0=176/189≒0.931
D=G0/B0=189/80≒2.36
E=B0/R0=80/176≒0.455
ある対象物の画像信号がビデオカメラ3からCPU11に入力されると、CPU11では、入力した各画素のRGBの組合せの比率を計算する。ここでは、RGB信号は、R1=130、G1=143、B1=61であったとする。すると、各色の比率H、I、Jは次の演算で得る(ステップS2)。
【0022】
【数3】
H=R1/G1=130/143≒0.909
I=G1/B1=143/61≒2.34
J=B1/R1=61/130≒0.469
そして各組合せに対応したC−H間、D−I間、E−J間の第1の比率K1=H/C、L1=I/D、M1=J/Eを求める。そして、この第1の比率K1、L1、M1が1を超えないように除数と被除数を設定して第2の比率K2、L2、M2を求める(ステップS3)。例えば、K1に関して、H>CであればK2=1/K1とし、H≦CであればK2=K1として第2の比率K2を求める。D−I間、E−J間の第2の比率L2、M2についても同様である。
【0023】
これにより、上記の例1(黄色のテニスボール)においては、次のようにしてC−H間、D−I間、E−J間の第2の比率K2、L2、M2を求める。
【0024】
【数4】
K2=K1=H/C=0.909/0.931≒0.976
L2=L1=I/D=2.34/2.36≒0.991
M2=1/M1=E/J=0.455/0.469≒0.970
次に、これらを乗算して評価値Nを求める(ステップS4)。
【0025】
【数5】
N=K2×L2×M2
=0.976×0.991×0,970≒0.938
次に、例2について示す。当例では、画素のRGB値がR1=70、G1=172、B1=125であり、この場合に、K2、L2、M2、Nの各値を求める方法を以下に説明する。
【0026】
まず、各色の比率H、I、Jは次のようになる。
【0027】
【数6】
H=R1/G1=70/172≒0.407
I=G1/B1=172/125≒1.38
J=B1/R1=125/70≒1.79
そして、各組合せに対応したC−H、D−I、E−Jの比率を求める。このときにも、比率は1を超えないように除数と被除数を決定する。
【0028】
【数7】
K2=K1=H/C=0.407/0.931≒0.437
L2=L1=I/D=1.38/2.36≒0.585
M2=1/M1=E/J=0.455/1.79≒0.254
これらを乗算して評価値Nを求める。
【0029】
【数8】
N=K2×L2×M2
=0.437×0.585×0.254≒0.0649
ここで、予めしきい値S1を0.7に設定していた場合、例1の画素はその評価値Nがしきい値よりも大きいので、その画素を所望の対象物の画像に含まれる画素として認識する(ステップS4,S6,S7)。この場合の判定を、「OK判定」と称する。
【0030】
一方、例2の画素はその評価値Nがしきい値よりも小さいので、その画素を所望の対象物の画像に含まれない画素として認識する(ステップS4,S6,S8)。この場合の判定を、「NG判定」と称する。
【0031】
以上説明した方法は、RGBの各比率をもとに計算しているので、輝度による影響を受けない。このため、画像が明るい場合でも暗い場合でも、良好な画像識別が可能である。また、各要素の比率を乗算して評価値Nを求めているので、色の差を大きな数値差として得られ、精度の良い識別が可能である。
【0032】
次に、本発明の第2の実施の形態について説明する。第2の実施の形態の画像識別装置の機能構成は第1の実施の形態と共通である。そして全体制御部14における処理機能において、第1の実施の形態における評価値Nを求めるステップまでの処理は共通であるので、それ以降の処理機能について以下に詳述する。
【0033】
当実施の形態における全体制御部14は、例えばペットロボットなど安価なカメラを画像入力手段として使用する場合のように、得られる画像信号のS/Nが良好でないときに、明るさ成分を含めて識別させることが可能になり、具体的には、評価値Nに明るさ情報Tを乗じた第2の評価値で評価する機能を備えている。
【0034】
この明るさ情報Tとしては、輝度信号Yを使用することができる。具体的には、入力した輝度信号Y値の正規化値を評価値Nに乗算する。つまり、輝度信号Yの最大値がYMAX=255である場合、Y/255を乗算して第2の評価値Pを、
【数9】
P=N×(Y/255)
として求め(ステップS5)、この値を予め設定したしきい値S2と比較する(ステップS6)。
【0035】
この場合、第2の評価値Pが1に近いほど識別したい色に近いことになる。つまり、明るく、かつS/N良く撮影された状態の信号でOK判定となったことになる(ステップS6,S7)。そして暗くて、色信号がノイズに埋もれた状態で得られた値は評価が下がることになり、曖昧な値はキャンセルされる(ステップS6,S8)。
【0036】
従って、良好なS/Nの色信号のみを対象にOK判定するので暗い画像であっても高精度の識別が可能となる。
【0037】
なお、この輝度信号Yは上述のように入力のY値を用いてもよいし、ビデオカメラ3からの入力がRGB信号の場合にはYを演算により求めてもよい。また、明るさ情報TとしてR1+G1+B1の値を使用してもよい。
【0038】
CPU11は、この方法で得られた識別結果をもとに全体の制御プログラムの流れを決め、動作制御を行う。
【0039】
まず、上述した処理で得られた画素毎の色識別結果から、原画像に所望の対象物が含まれているか否かを判定する。この判定処理の一例を説明する。
【0040】
所望の対象物の色であるとの判定(上述のOK判定)を縦横に隣接する4つの画素において得られた場合に、この所望の対象物がカメラ前方に存在すると判定する。
【0041】
また、所望の対象物の色であるとの判定を複数の画素領域でそれぞれ独立に得られた場合は、縦横に連続する画素数が多い方の領域を所望の対象物であると判定する。
【0042】
この判定処理は、本画像識別装置に搭載するCPU11の性能により、またカメラ3の受像素子の画素数により適宜に設定すべきものである。いずれの処理方法においても、OK判定により抽出した対象画素の画像上の分布に応じて対象物とする領域を識別するように設定すればよい。
【0043】
CPU11は、上述のように原画像中に所望の対象物を識別すると、予め記憶した、その対象物に応じた仕草を実行するようにロボットの動作を制御する。例えば、各関節のモータ21を制御することによってロボットを歩行させたり、首を回させたりする。また発音部22に指示を出し、スピーカ8から鳴き声を出させたりする。この制御により、ロボットに好みのものを追いかけさせたり、危険なものから退避させたりすることが可能となる。
【0044】
なお、本発明の技術的思想には次の画像識別処理方法、画像識別処理プログラムも含むものである。
【0045】
(1)コンピュータに原画像を入力し、入力された原画像から所望の対象画像を予め設定した設定色に基づいて識別する画像識別方法であって、前記設定色のRGB値であるR0、G0、B0を予め記憶するステップと、該RGB値から設定RGB比率C=R0/G0、D=G0/B0、E=B0/R0を求めるステップと、前記原画像の画素毎に、該画素のRGB値であるR1、G1、B1から原RGB比率H=R1/G1、I=G1/B1、J=B1/R1を求め、前記設定RGB比率と前記原RGB比率との比である比率K1=H/C、L1=I/D、M1=J/Eを求め、前記比率K1、L1、M1の各値が1以下の場合は、K2=K1、L2=L1、M2=M1とし、前記比率K1、L1、M1の各値が1を超える場合は、K2=1/K1、L2=1/L1、M2=1/M1とし、前記比率K2、L2、M2の積であるK2×L2×M2を求めてその値を評価値Nとするステップと、前記評価値Nが所定のしきい値以上となるRGB値R1、G1、B1を有する前記画素を対象画素として抽出するステップと、前記対象画素の分布に応じて前記対象画像を識別するステップとを有する画像識別方法。
【0046】
(2)コンピュータに原画像を入力し、入力された原画像から所望の対象画像を予め設定した設定色に基づいて識別する画像識別方法であって、前記設定色のRGB値であるR0、G0、B0を予め記憶するステップと、該RGB値から設定RGB比率C=R0/G0、D=G0/B0、E=B0/R0を求めるステップと、前記原画像の画素毎に、該画素のRGB値であるR1、G1、B1から原RGB比率H=R1/G1、I=G1/B1、J=B1/R1を求める一方、該画素の明るさ情報Tを求め、前記設定RGB比率と前記原RGB比率との比である比率K1=H/C、L1=I/D、M1=J/Eを求め、前記比率K1、L1、M1の各値が1以下の場合は、K2=K1、L2=L1、M2=M1とし、前記比率K1、L1、M1の各値が1を超える場合は、K2=1/K1、L2=1/L1、M2=1/M1とし、前記比率K2、L2、M2の積であるK2×L2×M2を求めてその値を積Sとし、前記積Sと前記明るさ情報Tとの積S×Tを評価値Uとするステップと、評価値Uが所定のしきい値以上となるRGB値R1、G1、B1及び前記明るさ情報Tを有する前記画素を対象画素として抽出するステップと、前記対象画素の分布に応じて前記対象画像として識別するステップとを有することを特徴とする画像識別方法。
【0047】
(3)設定色のRGB値であるR0、G0、B0を予め記憶装置に記憶するステップと、該RGB値から設定RGB比率C=R0/G0、D=G0/B0、E=B0/R0を求めるステップと、前記原画像の画素毎に、該画素のRGB値であるR1、G1、B1から原RGB比率H=R1/G1、I=G1/B1、J=B1/R1を求め、前記設定RGB比率と前記原RGB比率との比である比率K1=H/C、L1=I/D、M1=J/Eを求め、前記比率K1、L1、M1の各値が1以下の場合は、K2=K1、L2=L1、M2=M1とし、前記比率K1、L1、M1の各値が1を超える場合は、K2=1/K1、L2=1/L1、M2=1/M1とし、前記比率K2、L2、M2の積であるK2×L2×M2を求めてその値を評価値Nとするステップと、前記評価値Nが所定のしきい値以上となるRGB値R1、G1、B1を有する前記画素を対象画素として抽出するステップと、前記対象画素の分布に応じて前記対象画像を識別するステップとをコンピュータに実行させる画像識別プログラム。
【0048】
(4)設定色のRGB値であるR0、G0、B0を予め記憶装置に記憶するステップと、該RGB値から設定RGB比率C=R0/G0、D=G0/B0、E=B0/R0を求めるステップと、前記原画像の画素毎に、該画素のRGB値であるR1、G1、B1から原RGB比率H=R1/G1、I=G1/B1、J=B1/R1を求める一方、該画素の明るさ情報Tを求め、前記設定RGB比率と前記原RGB比率との比である比率K1=H/C、L1=I/D、M1=J/Eを求め、前記比率K1、L1、M1の各値が1以下の場合は、K2=K1、L2=L1、M2=M1とし、前記比率K1、L1、M1の各値が1を超える場合は、K2=1/K1、L2=1/L1、M2=1/M1とし、前記比率K2、L2、M2の積であるK2×L2×M2を求めてその値を積Sとし、前記積Sと前記明るさ情報Tとの積S×Tを評価値Uとするステップと、評価値Uが所定のしきい値以上となるRGB値R1、G1、B1及び前記明るさ情報Tを有する前記画素を対象画素として抽出するステップと、前記対象画素の分布に応じて前記対象画像として識別するステップとをコンピュータに実行させる画像識別プログラム。
【0049】
【発明の効果】
以上のように本発明によれば、識別のしきい値をRGB信号の各比率をもとに求めているので、輝度による影響を受けずに画像識別でき、この結果、明るい場合でも暗い場合でも画像識別を良好に行うことができる。また、各要素の比率を乗算しているので、色の差が大きな数値差として得られ、精度良い識別が可能である。
【0050】
また本発明によれば、画像中の暗い部分におけるS/Nが悪い曖昧な画像情報による評価をキャンセルすることができ、画像識別結果の信頼度を上げることができる。
【図面の簡単な説明】
【図1】本発明の1つの実施の形態の画像識別装置を搭載したロボットの斜視図。
【図2】上記実施の形態の画像識別装置の機能ブロック図。
【図3】上記実施の形態による画像識別処理のフローチャート。
【符号の説明】
1 ロボット
3 ビデオカメラ
11 CPU
12 画像入力ポート
13 画像データ処理部
14 全体制御部
15 動作制御部
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image identification device.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, there has been known an image identification device that recognizes an object by color as described in, for example, Japanese Patent Laid-Open No. 4-369087.
[0003]
[Patent Document 1]
Japanese Patent Laid-Open No. 4-369087
[Problems to be solved by the invention]
The conventional image identification device has a problem that the identification accuracy is not high and a problem that it is easy to erroneously detect when the object is dark.
[0005]
The present invention has been made to solve such a conventional technical problem, and an object of the present invention is to provide an image identification device that has high color identification accuracy and can accurately identify a color even when an object is dark. And
[0006]
[Means for Solving the Problems]
The invention according to claim 1 includes an image input unit and a calculation processing unit, and the calculation processing unit identifies a desired target image from the original image input to the image input unit based on a preset set color. In the image identification device, the arithmetic processing unit stores in advance R0, G0, and B0 that are RGB values of the set color, and sets RGB ratios C = R0 / G0, D = G0 / B0, from the RGB values. E = B0 / R0 is obtained, and for each pixel of the original image, the RGB values H1, R1, G1, I = G1 / B1, J = B1 / R1 are obtained from R1, G1, B1, which are RGB values of the pixel. The ratios K1 = H / C, L1 = I / D, and M1 = J / E, which are ratios between the set RGB ratio and the original RGB ratio, are obtained, and each value of the ratios K1, L1, and M1 is 1 or less. In this case, K2 = K1, L2 = L1, M2 = M1, and the ratio K1, If each value of 1 and M1 exceeds 1, K2 = 1 / K1, L2 = 1 / L1, M2 = 1 / M1, and K2 × L2 × M2, which is the product of the ratios K2, L2, and M2, is obtained. The value is set as an evaluation value N, and the pixels having RGB values R1, G1, and B1 at which the evaluation value N is equal to or greater than a predetermined threshold are extracted as target pixels, and the target is selected according to the distribution of the target pixels. It has the identification means which identifies an image, It is characterized by the above-mentioned.
[0007]
The invention of claim 2 includes an image input unit and a calculation processing unit, and the calculation processing unit identifies a desired target image based on a preset color set in advance from the original image input to the image input unit. In the image identification device, the arithmetic processing unit stores in advance R0, G0, and B0 that are RGB values of the set color, and sets RGB ratios C = R0 / G0, D = G0 / B0, from the RGB values. E = B0 / R0 is obtained, and for each pixel of the original image, the RGB values H1, R1, G1, I = G1 / B1, J = B1 / R1 are obtained from R1, G1, B1, which are RGB values of the pixel. Meanwhile, the brightness information T of the pixel is obtained, and ratios K1 = H / C, L1 = I / D, and M1 = J / E, which are ratios of the set RGB ratio and the original RGB ratio, are obtained, and the ratio When the values of K1, L1, and M1 are 1 or less, K2 = K1, L2 = L , M2 = M1, and if the values of the ratios K1, L1, M1 exceed 1, K2 = 1 / K1, L2 = 1 / L1, M2 = 1 / M1, and the ratios K2, L2, M2 The product K2 × L2 × M2 is obtained and the value is set as the product S, the product S × T of the product S and the brightness information T is set as the evaluation value U, and the evaluation value U is equal to or greater than a predetermined threshold value. The pixel having the RGB values R1, G1, B1 and the brightness information T to be extracted is extracted as a target pixel, and an identification unit for identifying the target image according to the distribution of the target pixel is provided. is there.
[0008]
Here, as the brightness information T, F = R1 + G1 + B1, which is the sum of the RGB values of the pixels, can be used.
[0009]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. FIG. 1 is a schematic view of a robot 1 incorporating the image identification device according to the first embodiment of the present invention. A video camera 3 is attached to the nose of the head 2 of the robot 1. The eye part of the robot 1 is an infrared light receiving unit 4. A microphone 5 is attached to the ear of the robot 1 so that sounds and voices can be input.
[0010]
The head 2 is attached to the body 6 of the robot 1. The head 2 is attached via an actuator with two degrees of freedom and can be moved left and right and up and down.
[0011]
Four legs 7 are attached to the body 6 of the robot 1. The leg 7 is also attached via an actuator, can walk, and can control its own posture. In FIG. 1, 8 is a speaker and 9 is a discipline button. The drive mechanism of the robot 1 is a general one, and details are not shown.
[0012]
Video information output from the video camera 3 at the tip of the nose of the robot 1 is sent as an original image to an internal CPU 11 (to be described later). The CPU 11 performs image recognition processing and the like, and reflects this in the operation and the like. For example, if a ball of a favorite color is rolling, it is set so that it can be identified and chased, or if there is something that you do not like, it will be evacuated.
[0013]
FIG. 2 shows a block diagram of the control system of the robot 1. The operation control of the robot 1 is performed by executing a software program pre-installed by the CPU 11, but here, the arithmetic processing of the CPU 11 will be described separately for each function.
[0014]
Video signals Y (luminance), U (color difference), V (color difference) and synchronization signals Vs, Hs are output from the video camera 3 to the image input port 12 of the CPU 11. The CPU 11 captures data from the image input port 12 in synchronization with the synchronization signals Vs and Hs from the video camera 3 and performs image data processing in the image data processing unit 13.
[0015]
The image data processing unit 13 performs processing such as converting input YUV data into RGB values. The conversion of this YUV data into RGB values is as follows.
[0016]
[Expression 1]
R = Y + 1.402V
G = Y−0.714V−0.344U
B = Y + 1.772U
The image data processing unit 13 obtains an RGB value for each pixel with respect to the YUV data of each pixel from the video camera 3.
[0017]
Next, based on the RGB values for each pixel, the overall control unit 14 determines whether this pixel has the color of the identification target.
[0018]
When the number of pixels having the color of the identification object is detected in the image data at a predetermined value or more (details of this method will be described later), it is determined that the identification object exists in front of the video camera 3, Correspondingly, the behavior pattern of the robot 1 is determined and the operation control unit 15 is instructed. In order to realize the instructed action pattern, the operation control unit 15 controls the operation of each unit drive motor 21 and the sound generation unit 22, moves the robot 1 with the head 2, walks with the legs 7, and makes a roaring voice a speaker. The operation such as taking out from 8 is performed.
[0019]
The image identification process by the overall control unit 14 follows the procedure of the flowchart of FIG. For each desired large number of objects, an RGB value of a color to be identified and a ratio obtained by combining the RGB values are obtained in advance. These values are stored in the CPU 11 (step S1).
[0020]
As an example 1, when the object is a yellow tennis ball, R0 = 176, G0 = 189, B0 = 80, and the ratios C, D, and E of the respective colors are as follows.
[0021]
[Expression 2]
C = R0 / G0 = 176 / 189≈0.931
D = G0 / B0 = 189 / 80≈2.36
E = B0 / R0 = 80 / 176≈0.455
When an image signal of a certain object is input from the video camera 3 to the CPU 11, the CPU 11 calculates a ratio of RGB combinations of the input pixels. Here, it is assumed that the RGB signals are R1 = 130, G1 = 143, and B1 = 61. Then, the ratios H, I, and J of each color are obtained by the following calculation (step S2).
[0022]
[Equation 3]
H = R1 / G1 = 130 / 143≈0.909
I = G1 / B1 = 143 / 61≈2.34
J = B1 / R1 = 61 / 130≈0.469
Then, first ratios K1 = H / C, L1 = I / D, and M1 = J / E between C-H, DI, and E-J corresponding to each combination are obtained. Then, the divisor and the dividend are set so that the first ratios K1, L1, and M1 do not exceed 1 and the second ratios K2, L2, and M2 are obtained (step S3). For example, with respect to K1, if H> C, K2 = 1 / K1, and if H ≦ C, the second ratio K2 is determined as K2 = K1. The same applies to the second ratios L2 and M2 between DI and EJ.
[0023]
Thus, in the above-described example 1 (yellow tennis ball), the second ratios K2, L2, and M2 between C-H, D-I, and E-J are obtained as follows.
[0024]
[Expression 4]
K2 = K1 = H / C = 0.909 / 0.931≈0.976
L2 = L1 = I / D = 2.34 / 2.36≈0.991
M2 = 1 / M1 = E / J = 0.455 / 0.469≈0.970
Next, these values are multiplied to obtain an evaluation value N (step S4).
[0025]
[Equation 5]
N = K2 × L2 × M2
= 0.976 × 0.991 × 0,970≈0.938
Next, Example 2 will be described. In this example, the RGB values of the pixels are R1 = 70, G1 = 172, and B1 = 125. In this case, a method for obtaining each value of K2, L2, M2, and N will be described below.
[0026]
First, the ratios H, I, and J of each color are as follows.
[0027]
[Formula 6]
H = R1 / G1 = 70 / 172≈0.407
I = G1 / B1 = 172 / 125≈1.38
J = B1 / R1 = 125 / 70≈1.79
Then, the ratio of C—H, D—I, and E—J corresponding to each combination is obtained. At this time, the divisor and the dividend are determined so that the ratio does not exceed 1.
[0028]
[Expression 7]
K2 = K1 = H / C = 0.407 / 0.931≈0.437
L2 = L1 = I / D = 1.38 / 2.36≈0.585
M2 = 1 / M1 = E / J = 0.455 / 1.79≈0.254
These values are multiplied to obtain an evaluation value N.
[0029]
[Equation 8]
N = K2 × L2 × M2
= 0.437 x 0.585 x 0.254 ≒ 0.0649
Here, when the threshold value S1 is set to 0.7 in advance, since the evaluation value N of the pixel of Example 1 is larger than the threshold value, the pixel is included in the image of the desired object. (Steps S4, S6, S7). The determination in this case is referred to as “OK determination”.
[0030]
On the other hand, since the evaluation value N of the pixel of Example 2 is smaller than the threshold value, the pixel is recognized as a pixel that is not included in the image of the desired object (steps S4, S6, and S8). The determination in this case is referred to as “NG determination”.
[0031]
Since the method described above is calculated based on each ratio of RGB, it is not affected by luminance. Therefore, good image identification is possible regardless of whether the image is bright or dark. In addition, since the evaluation value N is obtained by multiplying the ratio of each element, the color difference can be obtained as a large numerical difference, and identification with high accuracy is possible.
[0032]
Next, a second embodiment of the present invention will be described. The functional configuration of the image identification apparatus of the second embodiment is the same as that of the first embodiment. Since the processing up to the step of obtaining the evaluation value N in the first embodiment is common in the processing functions in the overall control unit 14, the subsequent processing functions will be described in detail below.
[0033]
The overall control unit 14 in the present embodiment includes the brightness component when the S / N of the obtained image signal is not good as in the case where an inexpensive camera such as a pet robot is used as the image input means. More specifically, it has a function of evaluating with a second evaluation value obtained by multiplying the evaluation value N by the brightness information T.
[0034]
As the brightness information T, a luminance signal Y can be used. Specifically, the evaluation value N is multiplied by the normalized value of the input luminance signal Y value. That is, when the maximum value of the luminance signal Y is YMAX = 255, the second evaluation value P is multiplied by Y / 255,
[Equation 9]
P = N × (Y / 255)
(Step S5), and this value is compared with a preset threshold value S2 (step S6).
[0035]
In this case, the closer the second evaluation value P is to 1, the closer the color is to be identified. That is, an OK determination is made with a signal that is bright and has been photographed with good S / N (steps S6 and S7). The value obtained when the color signal is dark and the color signal is buried in the noise is lowered, and the ambiguous value is canceled (steps S6 and S8).
[0036]
Therefore, since only the good S / N color signal is determined to be OK, it is possible to identify with high accuracy even for a dark image.
[0037]
As the luminance signal Y, the input Y value may be used as described above. When the input from the video camera 3 is an RGB signal, Y may be obtained by calculation. Further, the value of R1 + G1 + B1 may be used as the brightness information T.
[0038]
The CPU 11 determines the flow of the entire control program based on the identification result obtained by this method, and performs operation control.
[0039]
First, it is determined from the color identification result for each pixel obtained by the above-described processing whether or not a desired object is included in the original image. An example of this determination process will be described.
[0040]
When the determination that the color of the desired object is the color (the above-described OK determination) is obtained in four pixels adjacent vertically and horizontally, it is determined that the desired object exists in front of the camera.
[0041]
In addition, when the determination that the color of the desired object is the color is obtained independently in each of the plurality of pixel areas, the area having the larger number of continuous pixels in the vertical and horizontal directions is determined as the desired object.
[0042]
This determination process should be appropriately set according to the performance of the CPU 11 mounted in the image identification apparatus and the number of pixels of the image receiving element of the camera 3. In any of the processing methods, it is only necessary to set so as to identify a region as a target object according to the distribution of the target pixel extracted by the OK determination on the image.
[0043]
When the CPU 11 identifies a desired object in the original image as described above, the CPU 11 controls the operation of the robot so as to execute a pre-stored gesture corresponding to the object. For example, the robot is walked or the neck is rotated by controlling the motor 21 of each joint. Also, an instruction is given to the sound generator 22 to make a cry from the speaker 8. With this control, it is possible to cause the robot to follow a favorite object or to retreat from a dangerous object.
[0044]
The technical idea of the present invention includes the following image identification processing method and image identification processing program.
[0045]
(1) An image identification method for inputting an original image to a computer and identifying a desired target image from the input original image based on a preset set color, and R0, G0 which are RGB values of the set color , B0 in advance, a step of obtaining set RGB ratios C = R0 / G0, D = G0 / B0, E = B0 / R0 from the RGB values, and RGB of each pixel of the original image The original RGB ratios H = R1 / G1, I = G1 / B1, and J = B1 / R1 are obtained from the values R1, G1, and B1, and the ratio K1 = H, which is the ratio between the set RGB ratio and the original RGB ratio. / C, L1 = I / D, M1 = J / E, and when the values of the ratios K1, L1, and M1 are 1 or less, K2 = K1, L2 = L1, M2 = M1, and the ratio K1 , L1 and M1 exceed 1 when K2 = / K1, L2 = 1 / L1, and M2 = 1 / M1, and the product of the ratios K2, L2, and M2, K2 × L2 × M2, and setting the value as the evaluation value N; and the evaluation value N An image identification method comprising: extracting the pixels having RGB values R1, G1, and B1 that are equal to or greater than a predetermined threshold as target pixels; and identifying the target image according to a distribution of the target pixels .
[0046]
(2) An image identification method in which an original image is input to a computer and a desired target image is identified from the input original image based on a preset set color, and R0 and G0 which are RGB values of the set color , B0 in advance, a step of obtaining set RGB ratios C = R0 / G0, D = G0 / B0, E = B0 / R0 from the RGB values, and RGB of each pixel of the original image While obtaining the original RGB ratio H = R1 / G1, I = G1 / B1, J = B1 / R1 from the values R1, G1, and B1, the brightness information T of the pixel is obtained, and the set RGB ratio and the original RGB ratio are obtained. Ratios K1 = H / C, L1 = I / D, and M1 = J / E, which are ratios to the RGB ratio, are obtained. When the values of the ratios K1, L1, and M1 are 1 or less, K2 = K1, L2 = L1, M2 = M1, and the ratios K1, L1, M When each value of 1 exceeds 1, K2 = 1 / K1, L2 = 1 / L1, M2 = 1 / M1, and K2 × L2 × M2, which is the product of the ratios K2, L2, and M2, is obtained and the value is obtained. Is a product S, a product S × T of the product S and the brightness information T is set as an evaluation value U, and RGB values R1, G1, B1, and the evaluation value U are equal to or greater than a predetermined threshold An image identification method comprising: extracting the pixel having brightness information T as a target pixel; and identifying the pixel as the target image according to a distribution of the target pixel.
[0047]
(3) A step of storing the RGB values R0, G0, B0 of the set color in the storage device in advance, and setting RGB ratios C = R0 / G0, D = G0 / B0, E = B0 / R0 from the RGB values. Obtaining the original RGB ratio H = R1 / G1, I = G1 / B1, J = B1 / R1 from the R1, G1, and B1 RGB values of the pixel for each pixel of the original image When ratios K1 = H / C, L1 = I / D, and M1 = J / E, which are ratios of the RGB ratio and the original RGB ratio, are obtained, and when the values of the ratios K1, L1, and M1 are 1 or less, When K2 = K1, L2 = L1, M2 = M1, and each value of the ratios K1, L1, M1 exceeds 1, K2 = 1 / K1, L2 = 1 / L1, M2 = 1 / M1, K2 × L2 × M2, which is the product of the ratios K2, L2, and M2, is calculated and the value is evaluated N Extracting the pixels having RGB values R1, G1, and B1 with the evaluation value N equal to or greater than a predetermined threshold as target pixels, and extracting the target image according to the distribution of the target pixels. An image identification program for causing a computer to execute the identifying step.
[0048]
(4) R0, G0, B0, which are RGB values of the set color, are stored in the storage device in advance, and the set RGB ratios C = R0 / G0, D = G0 / B0, E = B0 / R0 from the RGB values. Determining the original RGB ratio H = R1 / G1, I = G1 / B1, J = B1 / R1 from R1, G1, and B1, which are RGB values of the pixel, for each pixel of the original image, Pixel brightness information T is obtained, and ratios K1 = H / C, L1 = I / D, and M1 = J / E, which are ratios of the set RGB ratio and the original RGB ratio, are obtained, and the ratios K1, L1, When each value of M1 is 1 or less, K2 = K1, L2 = L1, and M2 = M1, and when each value of the ratios K1, L1, and M1 exceeds 1, K2 = 1 / K1, L2 = 1 / L1, M2 = 1 / M1, and K2 is the product of the ratios K2, L2, and M2 L2 × M2 is obtained, the value is set as the product S, the product S × T of the product S and the brightness information T is set as the evaluation value U, and the evaluation value U is equal to or greater than a predetermined threshold value. An image identification program for causing a computer to execute a step of extracting the pixel having values R1, G1, B1 and the brightness information T as a target pixel and a step of identifying the pixel as the target image according to the distribution of the target pixel.
[0049]
【The invention's effect】
As described above, according to the present invention, since the threshold value for identification is obtained based on the ratio of each RGB signal, it is possible to identify an image without being affected by luminance, and as a result, whether it is bright or dark. Image identification can be performed satisfactorily. Further, since the ratio of each element is multiplied, a color difference is obtained as a large numerical difference, and identification with high accuracy is possible.
[0050]
Further, according to the present invention, it is possible to cancel evaluation based on ambiguous image information having a poor S / N in a dark part of an image, and to improve the reliability of an image identification result.
[Brief description of the drawings]
FIG. 1 is a perspective view of a robot equipped with an image identification device according to an embodiment of the present invention.
FIG. 2 is a functional block diagram of the image identification apparatus of the embodiment.
FIG. 3 is a flowchart of image identification processing according to the embodiment.
[Explanation of symbols]
1 Robot 3 Video Camera 11 CPU
12 Image input port 13 Image data processing unit 14 Overall control unit 15 Operation control unit

Claims (2)

画像入力部と演算処理部とを備え、
前記演算処理部は、前記画像入力部に入力された原画像から所望の対象画像を予め設定した設定色に基づいて識別する画像識別装置であって、
前記演算処理部は、
前記設定色のRGB値であるR0、G0、B0を予め記憶し、該RGB値から設定RGB比率C=R0/G0、D=G0/B0、E=B0/R0を求め、
前記原画像の画素毎に、該画素のRGB値であるR1、G1、B1から原RGB比率H=R1/G1、I=G1/B1、J=B1/R1を求め、
前記設定RGB比率と前記原RGB比率との比である比率K1=H/C、L1=I/D、M1=J/Eを求め、
前記比率K1、L1、M1の各値が1以下の場合は、K2=K1、L2=L1、M2=M1とし、
前記比率K1、L1、M1の各値が1を超える場合は、K2=1/K1、L2=1/L1、M2=1/M1とし、
前記比率K2、L2、M2の積であるK2×L2×M2を求めてその値を評価値Nとし、
前記評価値Nが所定のしきい値以上となるRGB値R1、G1、B1を有する前記画素を対象画素として抽出し、
前記対象画素の分布に応じて前記対象画像を識別する識別手段を有することを特徴とする画像識別装置。
An image input unit and an arithmetic processing unit;
The arithmetic processing unit is an image identification device that identifies a desired target image based on a preset color from an original image input to the image input unit,
The arithmetic processing unit includes:
R0, G0, B0 which are RGB values of the set color are stored in advance, and set RGB ratios C = R0 / G0, D = G0 / B0, E = B0 / R0 are obtained from the RGB values,
For each pixel of the original image, the original RGB ratio H = R1 / G1, I = G1 / B1, J = B1 / R1 is obtained from R1, G1, and B1 that are RGB values of the pixel,
A ratio K1 = H / C, L1 = I / D, and M1 = J / E, which are ratios of the set RGB ratio and the original RGB ratio,
When the values of the ratios K1, L1, and M1 are 1 or less, K2 = K1, L2 = L1, M2 = M1,
When the values of the ratios K1, L1, and M1 exceed 1, K2 = 1 / K1, L2 = 1 / L1, M2 = 1 / M1,
K2 × L2 × M2, which is the product of the ratios K2, L2, and M2, is calculated and the value is set as an evaluation value N;
Extracting the pixels having the RGB values R1, G1, and B1 at which the evaluation value N is equal to or greater than a predetermined threshold as target pixels;
An image identification apparatus comprising: identification means for identifying the target image according to the distribution of the target pixels.
画像入力部と演算処理部とを備え、
前記演算処理部は、前記画像入力部に入力された原画像から所望の対象画像を予め設定した設定色に基づいて識別する画像識別装置であって、
前記演算処理部は、
前記設定色のRGB値であるR0、G0、B0を予め記憶し、該RGB値から設定RGB比率C=R0/G0、D=G0/B0、E=B0/R0を求め、
前記原画像の画素毎に、該画素のRGB値であるR1、G1、B1から原RGB比率H=R1/G1、I=G1/B1、J=B1/R1を求める一方、該画素の明るさ情報Tを求め、
前記設定RGB比率と前記原RGB比率との比である比率K1=H/C、L1=I/D、M1=J/Eを求め、
前記比率K1、L1、M1の各値が1以下の場合は、K2=K1、L2=L1、M2=M1とし、
前記比率K1、L1、M1の各値が1を超える場合は、K2=1/K1、L2=1/L1、M2=1/M1とし、
前記比率K2、L2、M2の積であるK2×L2×M2を求めてその値を積Sとし、
前記積Sと前記明るさ情報Tとの積S×Tを評価値Uとし、
評価値Uが所定のしきい値以上となるRGB値R1、G1、B1及び前記明るさ情報Tを有する前記画素を対象画素として抽出し、
前記対象画素の分布に応じて前記対象画像を識別する識別手段を有することを特徴とする画像識別装置。
An image input unit and an arithmetic processing unit;
The arithmetic processing unit is an image identification device that identifies a desired target image based on a preset color from an original image input to the image input unit,
The arithmetic processing unit includes:
R0, G0, B0 which are RGB values of the set color are stored in advance, and set RGB ratios C = R0 / G0, D = G0 / B0, E = B0 / R0 are obtained from the RGB values,
For each pixel of the original image, the original RGB ratio H = R1 / G1, I = G1 / B1, J = B1 / R1 is obtained from the RGB values R1, G1, and B1 of the pixel, while the brightness of the pixel Seeking information T,
A ratio K1 = H / C, L1 = I / D, and M1 = J / E, which are ratios of the set RGB ratio and the original RGB ratio,
When the values of the ratios K1, L1, and M1 are 1 or less, K2 = K1, L2 = L1, M2 = M1,
When the values of the ratios K1, L1, and M1 exceed 1, K2 = 1 / K1, L2 = 1 / L1, M2 = 1 / M1,
K2 × L2 × M2, which is the product of the ratios K2, L2, and M2, is determined and the value is set as the product S;
The product S × T of the product S and the brightness information T is defined as an evaluation value U,
Extracting the pixels having the RGB values R1, G1, B1 and the brightness information T for which the evaluation value U is equal to or greater than a predetermined threshold as target pixels;
An image identification apparatus comprising: identification means for identifying the target image according to the distribution of the target pixels.
JP2003037153A 2003-02-14 2003-02-14 Image identification device Expired - Fee Related JP4023330B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003037153A JP4023330B2 (en) 2003-02-14 2003-02-14 Image identification device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003037153A JP4023330B2 (en) 2003-02-14 2003-02-14 Image identification device

Publications (2)

Publication Number Publication Date
JP2004246717A JP2004246717A (en) 2004-09-02
JP4023330B2 true JP4023330B2 (en) 2007-12-19

Family

ID=33022051

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003037153A Expired - Fee Related JP4023330B2 (en) 2003-02-14 2003-02-14 Image identification device

Country Status (1)

Country Link
JP (1) JP4023330B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102576415B (en) 2009-09-30 2015-11-25 株式会社希福特 Quick Response Code, reader for two-dimension code and program
JP4499825B1 (en) * 2009-09-30 2010-07-07 広行 遠藤 2D code, 2D code reader and program

Also Published As

Publication number Publication date
JP2004246717A (en) 2004-09-02

Similar Documents

Publication Publication Date Title
KR101861153B1 (en) Image processing apparatus and control method thereof
JP4537255B2 (en) Imaging apparatus and imaging method
US9547791B2 (en) Image processing system, image processing apparatus, image processing method, and program
KR101764372B1 (en) Apparatus and method for compositing image in a portable terminal
CN108924420B (en) Image shooting method, image shooting device, image shooting medium, electronic equipment and model training method
US8416987B2 (en) Subject tracking apparatus and control method therefor, image capturing apparatus, and display apparatus
EP3102907B1 (en) Environment-dependent active illumination for stereo matching
KR101679290B1 (en) Image processing method and apparatus
KR100977528B1 (en) Method for recognizing face expression and control method of robot for appreciating image contents using the same
US20150097812A1 (en) Interactive operation method of electronic apparatus
JPH0766446B2 (en) Method of extracting moving object image
JP2015088096A (en) Information processor and information processing method
CN109246351B (en) Composition method and terminal equipment
JP5793493B2 (en) Gesture recognition using chroma key
CN113194253A (en) Shooting method and device for removing image reflection and electronic equipment
JP6718253B2 (en) Image processing apparatus and image processing method
JP4023330B2 (en) Image identification device
JP6384205B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
KR101629553B1 (en) Display screen controlling apparatus in mobile terminal and method thereof
US9684828B2 (en) Electronic device and eye region detection method in electronic device
US20140035807A1 (en) Ambient light sensing device and method, and interactive device using same
JP2011071925A (en) Mobile tracking apparatus and method
JP2005025568A (en) Head image region extraction device
JP2023518284A (en) Method and system for hand-gesture-based control of devices
JP2004280277A (en) Image pickup device and face authenticating device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050330

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070924

R151 Written notification of patent or utility model registration

Ref document number: 4023330

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101012

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101012

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111012

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121012

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121012

Year of fee payment: 5

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121012

Year of fee payment: 5

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131012

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees