JP2004234133A - Image processor - Google Patents

Image processor Download PDF

Info

Publication number
JP2004234133A
JP2004234133A JP2003019473A JP2003019473A JP2004234133A JP 2004234133 A JP2004234133 A JP 2004234133A JP 2003019473 A JP2003019473 A JP 2003019473A JP 2003019473 A JP2003019473 A JP 2003019473A JP 2004234133 A JP2004234133 A JP 2004234133A
Authority
JP
Japan
Prior art keywords
color
image
value
difference
color difference
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
Application number
JP2003019473A
Other languages
Japanese (ja)
Inventor
Masatoshi Fujiwara
正年 藤原
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.)
Panasonic Electric Works Co Ltd
Original Assignee
Matsushita Electric Works 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 Matsushita Electric Works Ltd filed Critical Matsushita Electric Works Ltd
Priority to JP2003019473A priority Critical patent/JP2004234133A/en
Publication of JP2004234133A publication Critical patent/JP2004234133A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image processor for generating a contrast image whose characteristic extraction or appearance inspection is simplified even when a color difference between two colors to be discriminated is small. <P>SOLUTION: Color images imaged by an image pickup device 1 are stored in image fetching memories 3R, 3G and 3B. The color images stored in the image fetching memories 3R, 3G and 3B are displayed on a display device 8. The desired two colors are designated by an input device 7 out of the color images displayed on the display device 8. A CPU 5 calculates the color difference of the two designated colors by using a lookup table 4 and a memory 6 for an arithmetic operation, and assigns a contrast value to each of the pixels of the color images so that the color difference can be set as a specified contract difference. A contrast image where the color of each of those pixels is converted into the contrast value is generated by using the contrast value, and the contrast image is displayed through a circuit 9 for display on the display device 8. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、カラー画像内での色の差を濃淡値に対応付けた濃淡画像を生成する画像処理装置に関するものである。
【0002】
【従来の技術】
近年、製品の製造ラインなどでは製品の画像を撮像した画像に画像処理を施すことによって、製品の特徴を抽出したり製品の外観を検査する技術が採用されている。ここで、画像処理の対象として画素値の情報が濃淡値のみである濃淡画像を用いると、対象物である製品において輝度差の少ない部位では濃淡値がほぼ等しくなる。したがって、金色、銀色、銅色のように金属光沢を有する色の部位では、人の目では色の違いによって異なることを認識できるものの濃淡値のみを持つ濃淡画像では濃淡値がほぼ等しくなる可能性がある。このような対象物では、各部位の境界を求めようとしても濃淡値の情報からでは境界を求めることができない場合がある。
【0003】
これに対して、この種の画像処理の対象となる画像として濃淡画像よりも情報量の多いカラー画像を用いることが提案されている。しかしながら、カラー画像に対してそのまま画像処理を施すと情報量が多い分だけ処理量が多くなり、製品の特徴抽出や外観検査のように実時間での処理が要求される場合には、高速な処理が可能な高価な装置が必要になる。
【0004】
そこで、カラー画像における色の情報を残しながらも情報量を低減するために、カラー画像の各画素の色と基準色との色差を求め、色差を濃淡値に対応付けた濃淡画像を生成する技術が提案されている。たとえば、カラー画像を撮像する撮像装置から取り込んだR,G,Bの3色の映像信号をL表色系のデジタル値に変換した後に、L表色系で表した基準色との色差を計算し、得られた色差を濃淡値に対応付けた濃淡画像をディスプレイ装置に表示するものがある(たとえば、特許文献1参照)。
【0005】
【特許文献1】
特開平7−203476号公報(第0010−0011段落、図6)
【0006】
【発明が解決しようとする課題】
上述した特許文献1に記載の技術は、カラー画像の各部位の色と基準色との色差を濃淡値に対応付けた濃淡画像を生成しているものであるから、カラー画像に含まれる色情報が濃淡画像に許容される階調の範囲内で濃淡値に置換された濃淡画像が得られることになる。つまり、色差の比較的小さい2つの部位が隣接しているような場合には、隣接した部位の濃淡値の差が小さく、色情報を用いながらも境界を明確に示すことができない場合が生じる。要するに、色差と濃淡値とを単純に対応付けるだけでは、特徴抽出や外観検査が容易になるような濃淡画像を得られない場合がある。
【0007】
本発明は上記事由に鑑みて為されたものであり、その目的は、カラー画像において区別しようとする2つの部位の色の差にかかわらず、両部位の色の差を強調可能とした濃淡画像を生成することにより、特徴抽出や外観検査が容易になるような濃淡画像が得られるようにした画像処理装置を提供することにある。
【0008】
【課題を解決するための手段】
請求項1の発明は、カラー画像を撮像する撮像装置と、カラー画像を表示可能なディスプレイ装置と、撮像装置により撮像されディスプレイ装置に表示されたカラー画像内から所望の2色を指定する色指定手段と、色指定手段により指定された色の差が規定した濃淡差になるようにカラー画像の各画素の色と前記2色の一方の色との色の差に応じて濃淡値を割り付けた濃淡画像を生成してディスプレイ装置に表示させる濃淡画像生成手段とを備えることを特徴とする。この構成によれば、区別しようとする2つの部位の色の差を規定の濃度差とした濃淡画像を生成することにより、2つの部位の色の差にかかわらず両部位の色の差を強調した濃淡画像を生成することが可能になる。その結果、特徴抽出や外観検査における検出精度を高めることが可能になる。
【0009】
請求項2の発明では、請求項1の発明において、前記濃淡画像生成手段は、前記カラー画像の各画素のうち前記一方の色との色の差が他方の色との色の差よりも大きい色を有する画素に対して、前記一方の色との濃淡差が他方の色との濃淡差よりも大きくかつ他方の色と区別可能である一定の濃淡値を割り付けることを特徴とする。この構成によれば、強調しようとする2色よりも色の差が大きい色については、無関係な色として濃淡画像から除去することができるから、強調しようとする2色を濃淡画像内で浮き出させることが可能になる。
【0010】
請求項3の発明では、請求項1または請求項2の発明において、前記濃淡画像生成手段は前記色の差に関して複数種類の評価値を選択可能であって、いずれかの評価値を択一的に選択可能とする評価方法選択手段が付加されたことを特徴とする。この構成によれば、色の差の評価値を選択することによって、選択する2色の色の差を強調しやすい評価値を選択することが可能になり、濃淡画像において2色の区別が一層容易になる。
【0011】
【発明の実施の形態】
(第1実施形態)
本実施形態では、図1に示す画像処理装置を用いる。この画像処理装置は、カラーTVカメラからなる撮像装置1により対象物を含む空間領域を撮像し、撮像装置1により得られたカラー画像内から、指定した色の画素を抽出する。色の指定にはキーボードやマウスなどからなる入力装置7を用いる。撮像装置1により得られたカラー画像は入力回路2によりデジタル信号に変換され、RGB表色系による三刺激値R,G,Bに対応した各色別の信号値(以下では、それぞれ「R値」、「G値」、「B値」と呼ぶ)が各画素毎に画像取込メモリ3R,3G,3Bに格納される。
【0012】
本実施形態の画像処理装置には、CRTのようなディスプレイ装置8が設けられ、ディスプレイ装置8には画像取込メモリ3R,3G,3Bに格納された画像がルックアップテーブル4および表示用回路9を通して表示される。画像取込メモリ3R,3G,3Bには各色別の各画素値がそれぞれたとえば10ビットで格納される。ルックアップテーブル4はディスプレイ装置8に表示する際の各画素値のビット数を8ビットに変換する場合などに用いられる。つまり、ルックアップテーブル4において10ビットの画素値と8ビットの画素値とを対応付けておき、10ビットの画素値を与えて8ビットの画素値を読み出すことにより、ビット数の変換を瞬時に行うことが可能になる。このような動作により撮像装置1から取り込まれた画像はディスプレイ装置8に表示される。
【0013】
入力装置7ではディスプレイ装置8に表示された画像内において特定の2つの部位の色を指定する機能を備える。画像内において色を指定する部位を選択するには、図2に示すように、画面内に表示された矢印状のポインタXを所望の2つの色の位置に移動させるとともに当該位置を選択する操作を行う(たとえば、マウスを用いる場合にはポインタXが所望位置に達した状態でクリックする)。
【0014】
図2はカラー画像の例を示しており、ここでは、画像内に色の異なる3つの領域D1〜D3が存在する場合を示している。また、図示例では領域D1,D2の2色を選択した状態を示している。図2においてはポインタXを2個示しているが、ポインタXが同時に2個表示されることを意味するのではなく、ポインタXで指定した2色を示すために2箇所にポインタXを表記している。なお、ポインタXの画像情報は図示しないオーバーレイメモリに保持されており、この画像情報がルックアップテーブル4および表示用回路9を通してディスプレイ装置8に表示される。
【0015】
ところで、カラー画像内では色にむらがあるから、ほぼ同色である領域D1,D2内においてポインタXで指定した1画素が、隣接する画素の色とは異なる場合もある。したがって、ポインタXで指定した画素を含む領域D1,D2に含まれる画素の平均値を領域D1,D2の色として用いることが望ましい。ただし、領域D1,D2の範囲は色情報を用いて自動的に判断するものとする。このように、入力装置7とディスプレイ装置8とにより色指定手段が構成される。
【0016】
上述のようにして所望の2色が指定されると、指定された2色は演算用メモリ6に格納され、CPU(ここでは、マイクロプロセッサを適宜のプログラムで動作させる「マイクロコンピュータ」を意味する)5では演算用メモリ6に格納された2色のデータを用いて、指定された2色のR値,G値,B値に対してRGB表色系からL表色系に変換するための数1に示す色変換式を適用する。以下では、L表色系における各信号値を、それぞれ「L値」、「a値」、「b値」と呼ぶ。数1においてはR値,G値,B値を(X,Y,Z)の組に変換した後に、(X、Y,Z)の各値を用いてL値,a値,b値を求める演算方法を採用している。
【0017】
【数1】

Figure 2004234133
【0018】
RGB表色系からL表色系に変換しているのは、L表色系によって求める色差が人の感覚尺度に近いからである。CPU5では演算用メモリ6を用いてL値,a値,b値に数2を適用する演算を行って、上述のようにポインタXで指定した2色について色の差を評価するために色差を求める。ただし、数2は1976年に国際照明委員会で制定された色差式であり、色差値ΔEに「76」の添字を付加して制定年を示してある。
【0019】
【数2】
Figure 2004234133
【0020】
ところで、本発明はカラー画像において指定された2色の色の差をあらかじめ設定した濃淡差の濃淡値に対応付けた濃淡画像に変換することが特徴であって、本実施形態における色の差の評価値である色差と濃淡値との対応付けは以下のように行う。すなわち、上述のようにして求めた色差が規定した濃淡差になるように、2色の各色に濃淡値を対応付ける。たとえば、濃淡画像が0〜255の濃淡値により256階調で表現されるものとして、数2により求めた2色の色差を、たとえば濃淡差の値として200に対応付ける。つまり、画像取込メモリ3R,3G,3Bに格納された画像内において、各領域D1,D2のうちの一方の色に濃淡値の0を対応付け、他方の色に濃淡値の200を対応付ける。
【0021】
さらに、CPU5では、画像取込メモリ3R,3G,3Bに記憶されているカラー画像の全画素について、画素毎のR値,G値,B値をルックアップテーブル4に照合してRGB表色系からL表色系に変換するとともに、各画素について濃淡値の0を対応付けた色との色差を計算し、各画素の色を色差に応じた濃淡値に変換する。ここにおいて、ポインタXにより選択された2色の色差よりも色差が小さい色については、0と200との間の濃淡値を割り当てるが、0を対応付けた色に対して色差が200を超える色の画素は一定の濃淡値である255を割り当てる。255という濃淡値は、0を対応付けた色に対して色差が200を超える色に対して、色差が200である画素とは明瞭に区別可能となるような値として設定される。なお、濃淡値に0を割り当てる色との色差が、ポインタXにより選択された2色の色差よりも小さい色に対する濃淡値の割り当て方を、線形(色差と濃淡値とが比例関係)とするか非線形(色差と濃淡値とが比例しない関係)とするかは問わない。また、色差に対応付ける濃淡差の値,各色に対応付ける濃淡値は、それぞれ一例であって適宜に設定することが可能である。
【0022】
上述のようにして画像取込メモリ3R,3G,3Bに記憶されているカラー画像の全画素に割り当てた濃淡値によって、ディスプレイ装置8に濃淡画像が表示される。この濃淡画像においては、ポインタXにより指定した2色が規定の濃淡差をもって表示されるから、当該2色の色差が小さいような場合でも濃淡値の差が大きくなり、たとえば当該2色の領域が隣接している場合でも両領域の境界を明確に表示することが可能になる。このように、ルックアップテーブル4とCPU5と演算用メモリ6と表示用回路9とにより濃淡画像生成手段が実現される。
【0023】
上述した処理手順を図3にまとめて示す。まず、撮像装置1により撮像されたカラー画像のR値,G値,B値に対して入力回路2によりアナログ−デジタル変換を施し、画像取込メモリ3R,3G,3Bに格納する。また、画像取込メモリ3R,3G,3Bにそれぞれ格納されたR値,G値,B値は表示用回路9でデジタル−アナログ変換が施されディスプレイ装置8に表示される。ディスプレイ装置8に表示されたカラー画像内において、分離しようとする2つの色を含む領域を入力装置7により指定すると(S2)、CPU5において以下の処理が行われる。
【0024】
CPU5は、まず指定された領域(図2の領域D1,D2のそれぞれに相当する)内のR値,G値,B値を画像取込メモリ3R,3G,3Bから読み出して演算用メモリ6に格納する。次に、CPU5は、指定された領域内の各画素のR値,G値,B値の組を演算用メモリ6から1画素分ずつ順に読み出し、ルックアップテーブル4を用いて他の表色系(上述の例では、L表色系)に変換する。表色系の変換により得られたL値,a値,b値は演算用メモリ6に格納される。CPU5では、指定された領域内の全ての画素について表色系の変換を行い、領域内における各画素のL値,a値,b値の平均値を演算用メモリ6に格納する(S3)。また、指定された2つの領域のうちの一方について表色系の変換を行った後には、他方についても表色系の変換を行って変換結果を演算用メモリ6に格納するとともに、領域内における各画素のL値,a値,b値の平均値を求めて演算用メモリ6に格納する(S4)。
【0025】
次に、演算用メモリ6に格納した各領域内における各画素のL値,a値,b値の平均値に対して、数2に示した色差の式を適用し、両領域の色差を演算する(S5)。また、カラー画像の全画素について、一方の領域の各画素のL値,a値,b値の平均値に対する色差を計算する(S6)。ここにおいて、カラー画像の全画素については、あらかじめR値,G値,B値の組を演算用メモリ6から1画素分ずつ順に読み出し、ルックアップテーブル4を用いてL表色系に変換しておくのが望ましい(S1)。
【0026】
ステップS6において求めた色差ΔC2は、ポインタXにより指定した2領域の色差ΔC1との大小が比較され(S7)、ΔC2≦ΔC1であれば、着目している画素の色は、ステップS6において基準に用いた一方の領域に対する色差が他方の領域に対する色差よりも小さいのであるから、着目している画素に対して色差に応じた濃淡値が付与される(S8)。また、ΔC2>ΔC1であれば、着目している画素の濃淡値として一定値(上述の例では、255)が割り当てられる(S9)。
【0027】
上述したステップS6〜S9の処理を繰り返すことによって、カラー画像の全画素に対して濃淡値が割り当てられると(S10)、割り当てられた濃淡値を用いて濃淡画像がディスプレイ装置8に表示される(S11)。
【0028】
なお、上述の例ではL表色系を用いて色差を求めているが、表色系についてはとくに限定する趣旨ではなく、他の表色系も使用可能である。たとえば、カラー画像において用いているRGB表色系のR値,G値,B値を用いることも可能である。また、色の差の評価値として、色差式によって求めた色差を用いているが、色差に代えて、明度、色相、彩度のうちのいずれかの差を色の差の評価値に用いてもよい。あるいはまた、L値,a値,b値のうちのいずれかの差を用いることも可能である。
【0029】
(第2実施形態)
第1実施形態では、色の差の評価値が固定的に設定されているものであったが、本実施形態は色の差の評価値を複数種類から選択可能としたものである。すなわち、図3に示した処理手順では、ディスプレイ装置8にカラー画像が表示された状態において所望の2色の領域をポインタXによって指定しているが、本実施形態では、この段階においてディスプレイ装置8の画面上に図4のように、色の差の評価値を選択する選択肢SeLを表示する点で相違する。色の差の評価値は、第1実施形態において説明したように、L表色系で求める色差のほかに、明度、色相、彩度、L値,a値,b値などの差を用いることが可能である。本実施形態では、L表色系で求める色差のほか、数3のようにして求められる明度V、色相H、彩度Sの差も選択可能としている。選択肢の選択方法としてはポインタXを選択肢の上に重ねることによって選択肢を反転表示させ(図示例では「明度の差」が反転表示になっている)、この状態において選択操作(キーボードの改行キーの押下、あるいはマウスのクリック)を行うと、当該選択肢が選択されることになる。以後は第1実施形態と同様であって、選択肢の選択後には所望の2色の領域をポインタXにより指定し(図2のステップS2)、ステップS3以降の処理を行う。他の構成および動作は第1実施形態と同様である。要するに、本実施形態では入力装置7とディスプレイ装置8とを用いて評価方法選択手段を構成している。
【0030】
【数3】
Figure 2004234133
【0031】
なお、本実施形態における選択肢は一例であって、他の選択肢を設けるようにしてもよいのはもちろんのことである。また、本実施形態では、色の差の評価値について選択肢を選択してから色の差を識別する領域を選択する構成を採用しているが、領域を指定した後に評価値を選択するようにすれば、指定した領域について、色の差の評価値を種々変更したときの濃淡画像を確認して適正な評価値を選択するような使用方法が可能になる。他の構成および動作は第1実施形態と同様である。
【0032】
【発明の効果】
請求項1の発明は、カラー画像を撮像する撮像装置と、カラー画像を表示可能なディスプレイ装置と、撮像装置により撮像されディスプレイ装置に表示されたカラー画像内から所望の2色を指定する色指定手段と、色指定手段により指定された色の差が規定した濃淡差になるようにカラー画像の各画素の色と前記2色の一方の色との色の差に応じて濃淡値を割り付けた濃淡画像を生成してディスプレイ装置に表示させる濃淡画像生成手段とを備えるものであり、区別しようとする2つの部位の色の差を規定の濃度差とした濃淡画像を生成することにより、2つの部位の色の差にかかわらず両部位の色の差を強調した濃淡画像を生成することが可能になる。その結果、特徴抽出や外観検査における検出精度を高めることが可能になる。
【0033】
請求項2の発明では、請求項1の発明において、濃淡画像生成手段は、カラー画像の各画素のうち前記一方の色との色の差が他方との色の差よりも大きい色を有する画素に対して、前記一方の色との濃淡差が他方の色との濃淡差よりも大きくかつ他方の色と区別可能である一定の濃淡値を割り付けるものであり、強調しようとする2色よりも色の差が大きい色については、無関係な色として濃淡画像から除去することができるから、強調しようとする2色を濃淡画像内で浮き出させることが可能になる。
【0034】
請求項3の発明では、請求項1または請求項2の発明において、濃淡画像生成手段は前記色の差に関して複数種類の評価値を選択可能であって、いずれかの評価値を択一的に選択可能とする評価方法選択手段が付加されたものであり、色の差の評価値を選択することによって、選択する2色の色の差を強調しやすい評価値を選択することが可能になり、濃淡画像において2色の区別が一層容易になる。
【図面の簡単な説明】
【図1】本発明の実施形態を示すブロック図である。
【図2】同上における色の指定方法を示す動作説明図である。
【図3】同上の処理手順を示す流れ図である。
【図4】本発明の第2実施形態において評価値の選択方法を示す動作説明図である。
【符号の説明】
1 撮像装置
2 入力回路
3R,3G,3B 画像取込メモリ
4 ルックアップテーブル
5 CPU
6 演算用メモリ
7 入力装置
8 ディスプレイ装置
9 表示用回路[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an image processing apparatus that generates a grayscale image in which a color difference in a color image is associated with a grayscale value.
[0002]
[Prior art]
2. Description of the Related Art In recent years, a technology for extracting features of a product or inspecting the appearance of a product by performing image processing on an image obtained by capturing an image of the product has been adopted in a product manufacturing line or the like. Here, when a grayscale image whose pixel value information is only grayscale values is used as an object of image processing, grayscale values are almost equal in a portion of a product that is an object with a small difference in luminance. Therefore, in areas of colors with metallic luster such as gold, silver, and copper, the human eyes can recognize that they differ depending on the color difference, but the grayscale values with only grayscale values may be almost equal. There is. In such an object, there is a case where the boundary cannot be obtained from the information of the gray level even if the boundary of each part is obtained.
[0003]
On the other hand, it has been proposed to use a color image having a larger amount of information than a gray image as an image to be subjected to this type of image processing. However, if image processing is directly performed on a color image, the amount of information increases as the amount of information increases, and when real-time processing is required, such as in feature extraction of a product or visual inspection, high-speed processing is required. An expensive device capable of processing is required.
[0004]
Therefore, in order to reduce the amount of information while retaining the color information in the color image, a technique for obtaining a color difference between the color of each pixel of the color image and the reference color and generating a grayscale image in which the color difference is associated with a grayscale value. Has been proposed. For example, R captured from the imaging device for capturing a color image, G, three color image signals of the B after converting L * a * b * to a digital value of the color system, L * a * b * color system There is a method in which a color difference from a reference color represented by is calculated, and a grayscale image in which the obtained color difference is associated with a grayscale value is displayed on a display device (for example, see Patent Document 1).
[0005]
[Patent Document 1]
JP-A-7-203476 (Paragraph 0010-0011, FIG. 6)
[0006]
[Problems to be solved by the invention]
Since the technique described in Patent Document 1 described above generates a grayscale image in which the color difference between the color of each part of the color image and the reference color is associated with a grayscale value, the color information included in the color image is generated. Is obtained within the range of gradations permitted for the grayscale image. In other words, when two parts having relatively small color differences are adjacent to each other, the difference in the gray value of the adjacent parts is small, and the boundary may not be clearly shown even using the color information. In short, simply associating the color difference with the gray value may not be able to obtain a gray image that facilitates feature extraction and visual inspection.
[0007]
The present invention has been made in view of the above circumstances, and an object of the present invention is to provide a gray-scale image capable of enhancing a color difference between two parts irrespective of a color difference between two parts to be distinguished in a color image. It is an object of the present invention to provide an image processing apparatus capable of obtaining a grayscale image that facilitates feature extraction and appearance inspection by generating the image data.
[0008]
[Means for Solving the Problems]
According to the first aspect of the present invention, there is provided an imaging device for capturing a color image, a display device capable of displaying a color image, and a color specification for designating two desired colors from a color image captured by the imaging device and displayed on the display device. Means and a shade value are assigned according to the color difference between the color of each pixel of the color image and one of the two colors so that the color difference designated by the color designating means becomes the prescribed shade difference. A grayscale image generating means for generating a grayscale image and displaying the grayscale image on a display device. According to this configuration, the difference in color between the two parts is emphasized regardless of the difference in color between the two parts by generating a grayscale image in which the difference in color between the two parts to be distinguished is defined as a specified density difference. It is possible to generate a shaded image. As a result, detection accuracy in feature extraction and appearance inspection can be improved.
[0009]
According to a second aspect of the present invention, in the first aspect of the present invention, the grayscale image generating means is configured such that a color difference between the one color and each color of the pixels of the color image is larger than a color difference from the other color. The method is characterized in that a fixed gray value is assigned to a pixel having a color such that the gray level difference from the one color is larger than the gray level difference from the other color and the gray level difference can be distinguished from the other color. According to this configuration, since a color having a larger color difference than the two colors to be emphasized can be removed from the grayscale image as an unrelated color, the two colors to be emphasized are raised in the grayscale image. It becomes possible.
[0010]
According to a third aspect of the present invention, in the first or second aspect of the present invention, the grayscale image generating means can select a plurality of types of evaluation values for the color difference, and select one of the evaluation values. The method is characterized in that evaluation method selecting means for enabling selection is added. According to this configuration, by selecting the evaluation value of the color difference, it is possible to select an evaluation value that can easily emphasize the color difference between the two colors to be selected, and the two colors can be further distinguished in the grayscale image. It will be easier.
[0011]
BEST MODE FOR CARRYING OUT THE INVENTION
(1st Embodiment)
In this embodiment, the image processing apparatus shown in FIG. 1 is used. The image processing apparatus captures an image of a spatial region including a target object by an imaging device 1 including a color TV camera, and extracts a pixel of a designated color from a color image obtained by the imaging device 1. An input device 7 including a keyboard, a mouse, and the like is used to specify a color. The color image obtained by the imaging device 1 is converted into a digital signal by the input circuit 2, and the signal value for each color corresponding to the tristimulus values R, G, and B according to the RGB color system (hereinafter, “R value”, respectively) , “G value”, and “B value”) are stored in the image capturing memories 3R, 3G, and 3B for each pixel.
[0012]
The image processing apparatus of the present embodiment is provided with a display device 8 such as a CRT. The display device 8 stores the images stored in the image capturing memories 3R, 3G, and 3B in the look-up table 4 and the display circuit 9. Is displayed through. Each pixel value for each color is stored in the image capture memories 3R, 3G, and 3B in, for example, 10 bits. The look-up table 4 is used, for example, when converting the number of bits of each pixel value to 8 bits when displaying on the display device 8. That is, the 10-bit pixel value is associated with the 8-bit pixel value in the look-up table 4, and the 10-bit pixel value is given to read the 8-bit pixel value, so that the conversion of the number of bits can be instantaneously performed. It is possible to do. The image captured from the imaging device 1 by such an operation is displayed on the display device 8.
[0013]
The input device 7 has a function of designating the colors of two specific parts in the image displayed on the display device 8. As shown in FIG. 2, in order to select a part for specifying a color in the image, an operation of moving an arrow-shaped pointer X displayed on the screen to a position of two desired colors and selecting the position is performed. (For example, when a mouse is used, the pointer X is clicked in a state where it reaches a desired position).
[0014]
FIG. 2 shows an example of a color image. Here, a case where three regions D1 to D3 having different colors exist in the image is shown. Further, the illustrated example shows a state in which two colors of the areas D1 and D2 are selected. Although two pointers X are shown in FIG. 2, this does not mean that two pointers X are displayed at the same time, but two pointers X are shown at two places to indicate the two colors designated by the pointer X. ing. The image information of the pointer X is stored in an overlay memory (not shown), and the image information is displayed on the display device 8 through the look-up table 4 and the display circuit 9.
[0015]
By the way, since there is uneven color in a color image, one pixel designated by the pointer X in the regions D1 and D2 which are almost the same color may be different from the color of an adjacent pixel. Therefore, it is desirable to use the average value of the pixels included in the regions D1 and D2 including the pixel specified by the pointer X as the color of the regions D1 and D2. However, the ranges of the regions D1 and D2 are determined automatically using the color information. Thus, the input device 7 and the display device 8 constitute a color designation unit.
[0016]
When the desired two colors are designated as described above, the designated two colors are stored in the operation memory 6, and the CPU (here, a "microcomputer" that operates a microprocessor with an appropriate program). In 5), using the two-color data stored in the arithmetic memory 6, the R, G, and B values of the specified two colors are changed from the RGB color system to the L * a * b * color system. The color conversion formula shown in Equation 1 for converting the color into the color is applied. Hereinafter, each signal value in the L * a * b * color system will be referred to as “L * value”, “a * value”, and “b * value”, respectively. In Equation 1, after converting the R value, G value, and B value into a set of (X, Y, Z), the L * value, a * value, and b * are calculated using the values of (X, Y, Z) . The calculation method for obtaining the value is adopted.
[0017]
(Equation 1)
Figure 2004234133
[0018]
The conversion from the RGB color system to the L * a * b * color system is because the color difference determined by the L * a * b * color system is close to a human sense scale. The CPU 5 uses the operation memory 6 to perform an operation of applying Equation 2 to the L * value, the a * value, and the b * value to evaluate the color difference between the two colors specified by the pointer X as described above. To find the color difference. However, Equation 2 is a color difference formula established by the International Commission on Illumination in 1976, and the suffix “76” is added to the color difference value ΔE to indicate the established year.
[0019]
(Equation 2)
Figure 2004234133
[0020]
By the way, the present invention is characterized in that a color difference between two colors specified in a color image is converted into a grayscale image associated with a grayscale value of a predetermined grayscale difference, and the color difference in the present embodiment is converted. The correspondence between the color difference, which is the evaluation value, and the gray value is performed as follows. That is, the grayscale value is associated with each of the two colors so that the color difference obtained as described above becomes the specified grayscale difference. For example, assuming that a grayscale image is represented by 256 grayscales using grayscale values of 0 to 255, the color difference between the two colors obtained by Expression 2 is associated with, for example, 200 as a grayscale value. That is, in the images stored in the image capturing memories 3R, 3G, and 3B, one of the colors in each of the regions D1 and D2 is associated with a gray value of 0, and the other color is associated with a gray value of 200.
[0021]
Further, the CPU 5 compares the R value, the G value, and the B value of each pixel of the color image stored in the image capturing memories 3R, 3G, and 3B with the look-up table 4 to check the RGB color system. To the L * a * b * color system, calculate the color difference of each pixel from the color corresponding to the gray value of 0, and convert the color of each pixel to a gray value corresponding to the color difference. Here, for a color having a color difference smaller than the color difference between the two colors selected by the pointer X, a shade value between 0 and 200 is assigned. Are assigned a constant gray value of 255. The gray value of 255 is set as a value that allows a color having a color difference of more than 200 to be clearly distinguishable from a pixel having a color difference of 200 with respect to a color associated with 0. It should be noted that the method of assigning a gray value to a color whose color difference from a color to which a gray value is assigned to 0 is smaller than the color difference of the two colors selected by the pointer X is linear (color difference and gray value are proportional). It does not matter whether or not it is non-linear (the relationship between the color difference and the gray value is not proportional). Further, the value of the shading difference corresponding to the color difference and the shading value corresponding to each color are merely examples, and can be appropriately set.
[0022]
The grayscale image is displayed on the display device 8 by the grayscale values assigned to all the pixels of the color image stored in the image capture memories 3R, 3G, 3B as described above. In this grayscale image, the two colors specified by the pointer X are displayed with a specified grayscale difference. Therefore, even when the color difference between the two colors is small, the grayscale value difference becomes large. Even when they are adjacent to each other, the boundary between both areas can be clearly displayed. As described above, the look-up table 4, the CPU 5, the operation memory 6, and the display circuit 9 realize a grayscale image generation unit.
[0023]
The above-described processing procedure is shown in FIG. First, the input circuit 2 performs an analog-to-digital conversion on the R, G, and B values of a color image captured by the image capturing apparatus 1 and stores the converted values in the image capturing memories 3R, 3G, and 3B. The R, G, and B values stored in the image capturing memories 3R, 3G, and 3B are subjected to digital-analog conversion by the display circuit 9 and displayed on the display device 8. When a region including two colors to be separated is designated by the input device 7 in the color image displayed on the display device 8 (S2), the CPU 5 performs the following processing.
[0024]
The CPU 5 first reads the R value, G value, and B value in the designated area (corresponding to each of the areas D1 and D2 in FIG. 2) from the image capturing memories 3R, 3G, and 3B and stores them in the arithmetic memory 6. Store. Next, the CPU 5 sequentially reads a set of the R value, the G value, and the B value of each pixel in the designated area from the calculation memory 6 for each pixel, and uses the lookup table 4 to execute another color system. (In the above example, L * a * b * color system). The L * value, a * value, and b * value obtained by the conversion of the color system are stored in the operation memory 6. The CPU 5 converts the color system for all the pixels in the designated area, and stores the average value of the L * value, a * value, and b * value of each pixel in the area in the arithmetic memory 6 ( S3). Further, after the color system conversion is performed for one of the two designated regions, the color system conversion is performed for the other region, and the conversion result is stored in the operation memory 6. The average of the L * value, a * value, and b * value of each pixel is obtained and stored in the calculation memory 6 (S4).
[0025]
Next, the color difference equation shown in Equation 2 is applied to the average of the L * value, a * value, and b * value of each pixel in each area stored in the calculation memory 6, and The color difference is calculated (S5). Further, for all the pixels of the color image, the color difference with respect to the average of the L * value, a * value, and b * value of each pixel in one area is calculated (S6). Here, for all the pixels of the color image, a set of R value, G value, and B value is read in advance from the operation memory 6 for each pixel in order, and the L * a * b * color specification is performed using the lookup table 4. It is desirable to convert to a system (S1).
[0026]
The color difference ΔC2 obtained in step S6 is compared with the color difference ΔC1 of the two areas designated by the pointer X (S7), and if ΔC2 ≦ ΔC1, the color of the pixel of interest is set to the reference in step S6. Since the used color difference for one area is smaller than the color difference for the other area, a gray value corresponding to the color difference is given to the pixel of interest (S8). If ΔC2> ΔC1, a constant value (255 in the above example) is assigned as the gray value of the pixel of interest (S9).
[0027]
When the gray value is assigned to all the pixels of the color image by repeating the processing of steps S6 to S9 described above (S10), the gray image is displayed on the display device 8 using the assigned gray value (S10). S11).
[0028]
In the above example, the color difference is obtained using the L * a * b * color system, but the color system is not particularly limited, and other color systems can be used. For example, it is possible to use the R, G, and B values of the RGB color system used in the color image. In addition, as the evaluation value of the color difference, the color difference obtained by the color difference equation is used. Instead of the color difference, any one of brightness, hue, and saturation is used as the evaluation value of the color difference. Is also good. Alternatively, any one of the L * value, the a * value, and the b * value can be used.
[0029]
(2nd Embodiment)
In the first embodiment, the evaluation value of the color difference is fixedly set, but in the present embodiment, the evaluation value of the color difference can be selected from a plurality of types. That is, in the processing procedure shown in FIG. 3, a desired two-color area is designated by the pointer X in a state where the color image is displayed on the display device 8, but in the present embodiment, at this stage, the display device 8 4 in that an option SeL for selecting an evaluation value of a color difference is displayed on the screen of FIG. As described in the first embodiment, the evaluation value of the color difference is, in addition to the color difference obtained by the L * a * b * color system, lightness, hue, saturation, L * value, a * value, b * Differences such as values can be used. In the present embodiment, in addition to the color difference obtained in the L * a * b * color system, the difference in lightness V, hue H, and saturation S obtained as shown in Expression 3 can be selected. As a method of selecting the option, the option is highlighted by superimposing the pointer X on the option (in the illustrated example, “brightness difference” is highlighted), and in this state, the selection operation (the line feed key of the keyboard) is performed. Pressing or clicking the mouse) selects the option. Subsequent steps are the same as those in the first embodiment. After selecting an option, a desired two-color area is designated by the pointer X (step S2 in FIG. 2), and the processing after step S3 is performed. Other configurations and operations are the same as those of the first embodiment. In short, in the present embodiment, the evaluation method selecting unit is configured by using the input device 7 and the display device 8.
[0030]
[Equation 3]
Figure 2004234133
[0031]
Note that the options in the present embodiment are merely examples, and it goes without saying that other options may be provided. Further, in the present embodiment, a configuration is adopted in which an option for the color difference evaluation value is selected, and then an area for identifying the color difference is selected. However, the evaluation value is selected after specifying the area. Then, for a specified area, a usage method in which a grayscale image obtained when the evaluation value of the color difference is variously changed is confirmed and an appropriate evaluation value is selected becomes possible. Other configurations and operations are the same as those of the first embodiment.
[0032]
【The invention's effect】
According to the first aspect of the present invention, there is provided an imaging device for capturing a color image, a display device capable of displaying a color image, and a color specification for designating two desired colors from a color image captured by the imaging device and displayed on the display device. Means and a shade value are assigned according to the color difference between the color of each pixel of the color image and one of the two colors so that the color difference designated by the color designating means becomes the prescribed shade difference. A gray-scale image generating means for generating a gray-scale image and displaying the gray-scale image on a display device. It is possible to generate a grayscale image in which the color difference between the two parts is emphasized regardless of the color difference between the parts. As a result, detection accuracy in feature extraction and appearance inspection can be improved.
[0033]
According to a second aspect of the present invention, in the first aspect of the present invention, the grayscale image generating means includes, for each pixel of the color image, a pixel having a color whose color difference with the one color is larger than the color difference with the other color. On the other hand, a certain shade value in which the shade difference between the one color and the other color is larger than the shade difference from the other color and is distinguishable from the other color is assigned. Since a color having a large color difference can be removed from the grayscale image as an irrelevant color, the two colors to be emphasized can be raised in the grayscale image.
[0034]
According to a third aspect of the present invention, in the first or second aspect of the present invention, the grayscale image generating means can select a plurality of types of evaluation values for the color difference, and select one of the evaluation values. An evaluation method selecting means for enabling selection is added, and by selecting an evaluation value of a color difference, it becomes possible to select an evaluation value that can easily emphasize the color difference between two colors to be selected. Also, it becomes easier to distinguish two colors in a grayscale image.
[Brief description of the drawings]
FIG. 1 is a block diagram showing an embodiment of the present invention.
FIG. 2 is an operation explanatory diagram showing a color designation method in the above embodiment.
FIG. 3 is a flowchart showing a processing procedure of the above.
FIG. 4 is an operation explanatory diagram showing a method of selecting an evaluation value in a second embodiment of the present invention.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 1 Imaging device 2 Input circuit 3R, 3G, 3B Image capture memory 4 Look-up table 5 CPU
6 arithmetic memory 7 input device 8 display device 9 display circuit

Claims (3)

カラー画像を撮像する撮像装置と、カラー画像を表示可能なディスプレイ装置と、撮像装置により撮像されディスプレイ装置に表示されたカラー画像内から所望の2色を指定する色指定手段と、色指定手段により指定された色の差が規定した濃淡差になるようにカラー画像の各画素の色と前記2色の一方の色との色の差に応じて濃淡値を割り付けた濃淡画像を生成してディスプレイ装置に表示させる濃淡画像生成手段とを備えることを特徴とする画像処理装置。An imaging device that captures a color image, a display device capable of displaying a color image, a color designation unit that designates two desired colors from a color image that is captured by the imaging device and displayed on the display device, and a color designation unit. A grayscale image is generated by assigning a grayscale value in accordance with the color difference between each pixel of the color image and one of the two colors so that the specified color difference becomes a specified grayscale difference. An image processing apparatus comprising: a grayscale image generation unit for displaying the image on a device. 前記濃淡画像生成手段は、前記カラー画像の各画素のうち前記一方の色との色の差が他方の色との色の差よりも大きい色を有する画素に対して、前記一方の色との濃淡差が他方の色との濃淡差よりも大きくかつ他方の色と区別可能である一定の濃淡値を割り付けることを特徴とする請求項1記載の画像処理装置。The grayscale image generating means may include, for each pixel of the color image, a pixel having a color difference between the one color and the color larger than the color difference between the other color and the one color. 2. The image processing apparatus according to claim 1, wherein a fixed gray value is assigned such that the gray level difference is larger than the gray level difference with the other color and is distinguishable from the other color. 前記濃淡画像生成手段は前記色の差に関して複数種類の評価値を選択可能であって、いずれかの評価値を択一的に選択可能とする評価方法選択手段が付加されたことを特徴とする請求項1または請求項2記載の画像処理装置。The grayscale image generating means can select a plurality of types of evaluation values for the color difference, and an evaluation method selecting means for selectively selecting any one of the evaluation values is added. The image processing apparatus according to claim 1.
JP2003019473A 2003-01-28 2003-01-28 Image processor Withdrawn JP2004234133A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003019473A JP2004234133A (en) 2003-01-28 2003-01-28 Image processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003019473A JP2004234133A (en) 2003-01-28 2003-01-28 Image processor

Publications (1)

Publication Number Publication Date
JP2004234133A true JP2004234133A (en) 2004-08-19

Family

ID=32949319

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003019473A Withdrawn JP2004234133A (en) 2003-01-28 2003-01-28 Image processor

Country Status (1)

Country Link
JP (1) JP2004234133A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008212777A (en) * 2007-02-28 2008-09-18 Taiheiyo Cement Corp Aggregate sorting apparatus
JP2010068138A (en) * 2008-09-09 2010-03-25 Fujitsu Ltd Color-difference discriminating device and color-difference discriminating program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008212777A (en) * 2007-02-28 2008-09-18 Taiheiyo Cement Corp Aggregate sorting apparatus
JP2010068138A (en) * 2008-09-09 2010-03-25 Fujitsu Ltd Color-difference discriminating device and color-difference discriminating program

Similar Documents

Publication Publication Date Title
JP4831067B2 (en) Image processing apparatus, image processing method, image processing program product, and imaging apparatus
US20070047832A1 (en) Image signal processor and image signal processing method
JPWO2008044732A1 (en) Image processing apparatus, image processing method, and image processing program
JP2010239610A (en) Image processing device and image processing method
JP4985660B2 (en) Pseudo gray image generating apparatus and program
JP2001202508A (en) Method and device for converting color image and recording medium
JP4386959B1 (en) Image processing device
KR20050015711A (en) Apparatus and method for edge enhancement in image processing
JP3673092B2 (en) Image quality adjusting apparatus, image quality adjusting method, and recording medium recording image adjusting program
JP4227238B2 (en) Image display method, image processing apparatus, and recording medium
JP2005043174A (en) Color irregularity inspection apparatus
JP4359662B2 (en) Color image exposure compensation method
JP5218634B2 (en) Pseudo gray image generating apparatus and program
JP2004234133A (en) Image processor
JP2016046701A (en) Image processing apparatus, image processing method and program
JP2001045303A (en) Image thresholding method
JP7329964B2 (en) Image processing device, image processing method and program
JP4662430B2 (en) Image conversion method and apparatus
JP3783881B2 (en) Vehicle detection method and vehicle detection apparatus using the same
JP2020088709A (en) Image processing apparatus, image processing method and program
JP7106318B2 (en) Image processing device, image processing method and program
JP3943678B2 (en) Image color extraction method and image processing apparatus using the method
JP2003296703A (en) Image processor and image processing method
JP4419726B2 (en) Image processing apparatus and extraction color setting method suitable for the same
JP7366689B2 (en) Image processing device, image processing method and program

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20060404