JPH11110551A - Color-discriminating device - Google Patents

Color-discriminating device

Info

Publication number
JPH11110551A
JPH11110551A JP9267447A JP26744797A JPH11110551A JP H11110551 A JPH11110551 A JP H11110551A JP 9267447 A JP9267447 A JP 9267447A JP 26744797 A JP26744797 A JP 26744797A JP H11110551 A JPH11110551 A JP H11110551A
Authority
JP
Japan
Prior art keywords
color
data
black
image
area
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.)
Granted
Application number
JP9267447A
Other languages
Japanese (ja)
Other versions
JP3724148B2 (en
Inventor
Daisaku Horie
大作 保理江
Noriyuki Nobuyuki
宣之 沖須
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.)
Minolta Co Ltd
Original Assignee
Minolta Co 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 Minolta Co Ltd filed Critical Minolta Co Ltd
Priority to JP26744797A priority Critical patent/JP3724148B2/en
Priority to US09/163,266 priority patent/US6480624B1/en
Publication of JPH11110551A publication Critical patent/JPH11110551A/en
Application granted granted Critical
Publication of JP3724148B2 publication Critical patent/JP3724148B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To optimally remove a noise (false color) in a black area caused by mis-discrimination of colors. SOLUTION: Colors of respective pixel positions of a colored image fetched by dividing into color components R, G, B by a CCD 23 are discriminated in a color discriminating part 255 and the noise due to in the black area is removed in a black area correcting part 256. Color-discriminating data is extracted by the specified number of pixels in the black area correction part 256, and the number of pixels with the same color is counted in a circuit 256a to count the number of pixels with the same color. Furthermore, a distribution degree for indicating the degree of distribution of the colors is calculated by using a counting result in a distribution degree calculating part 256b, and an extracted area is discriminated whether it is black or not by using the distribution degree in a black discriminating circuit 256c. Then when the extracted area is not black, the noise is corrected by replacing the color discrimination data of the pixel at the center of the extracted area into black data. The noise is removed properly by discriminating presence/absence of the noise by checking the distribution of the colors by a specified number of pixels.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、赤、緑、青等の色
成分の画像データに分離して取り込まれている画像の色
を当該色成分の画像データを用いて判別する色判別装置
に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a color discriminating apparatus for discriminating a color of an image which has been separated into image data of color components such as red, green, blue and the like using the image data of the color components. Things.

【0002】[0002]

【従来の技術】従来、電気信号からなる画像の色を判別
する方法が種々、提案されている。例えば特開平5−1
37011号公報には、R,G,Bの各色成分の画像デ
ータXr,Xg,Xbの最大値と最小値との差を演算し、
その演算結果が予め設定された所定の閾値より小さい場
合は、無彩色と判別し、所定の閾値以上の場合は、R,
G,Bの各色成分の画像データXr,Xg,Xbの大小の
組合わせによって有彩色の色を判別する方法が示されて
いる。そして、無彩色と判別された場合は、更に輝度デ
ータで白と黒との判別が行われている。また、一度、色
判別した判別結果に対しては周辺画素の色判別結果との
関係を調べ、多数決により各画素位置の誤判別が修正さ
れるようになっている。
2. Description of the Related Art Hitherto, various methods for discriminating the color of an image formed of an electric signal have been proposed. For example, Japanese Patent Laid-Open No. 5-1
JP-A-37011 discloses a method of calculating the difference between the maximum value and the minimum value of the image data Xr, Xg, and Xb of each of the R, G, and B color components.
If the calculation result is smaller than a predetermined threshold value, it is determined that the color is achromatic.
A method of discriminating a chromatic color based on a combination of magnitudes of image data Xr, Xg, and Xb of respective color components of G and B is shown. If it is determined that the color is achromatic, the luminance data is further used to determine white and black. In addition, the relationship between the color discrimination result once and the color discrimination result of the surrounding pixels is checked, and erroneous discrimination of each pixel position is corrected by majority decision.

【0003】[0003]

【発明が解決しようとする課題】画像データからカラー
画像の色判別を行う場合、色再現性を考量して有彩色部
分の色判別を重視した判別基準が設定されると、黒色と
有彩色とを判別する判別基準が緩くなり、黒色の画素位
置が有彩色と誤判別され易くなる。例えばデジタルカメ
ラでホワイトボードに描かれた文字、図形等を記録資料
として撮影した場合、ボードーの照明条件、ペンの汚れ
具合、カメラの性能などによって黒領域の画素にR,
G,Bの色成分の画像データに偏差を生じ、その画素が
有彩色と誤判別されることがある。この結果、撮影画像
の黒領域に有彩色がノイズとして混在するという不具合
が生じる。
In the case of performing color discrimination of a color image from image data, if a discrimination criterion is set with emphasis on color discrimination of a chromatic portion in consideration of color reproducibility, black and chromatic colors are determined. , And the black pixel position is likely to be erroneously determined to be a chromatic color. For example, when a character or figure drawn on a whiteboard is photographed as a recording material by a digital camera, R, R, and R are added to pixels in a black area depending on the lighting conditions of the Bodo, the degree of dirt on the pen, and the performance of the camera.
A deviation may occur in the image data of the G and B color components, and the pixel may be erroneously determined as a chromatic color. As a result, a problem occurs in which chromatic colors are mixed as noise in the black region of the captured image.

【0004】撮影画像の黒領域に有彩色が混在すると、
文字等が見辛くなり、画質が著しく低下するので、でき
る限り、色判別処理において黒領域に有彩色がノイズと
して混在しないようにすることが望ましい。しかし、黒
色と有彩色との判別基準を厳しくすれば、逆に、有彩色
に無彩色がノイズとして混在するようになるので、色判
別処理のみで黒領域のノイズ発生を防止することは困難
である。
[0004] If chromatic colors are mixed in the black area of the photographed image,
Since characters and the like are difficult to see and the image quality is significantly reduced, it is desirable to avoid mixing chromatic colors as noise in the black area in the color discrimination processing as much as possible. However, if the criterion for discriminating black and chromatic colors is strict, conversely, achromatic colors will be mixed with noise as chromatic colors, so it is difficult to prevent the occurrence of noise in the black region only by color discrimination processing. is there.

【0005】従って、有彩色部分の色判別を重視した色
判別処理を行う場合は、色判別結果に対して黒領域内に
含まれている有彩色を除去する処理(以下、ノイズ除去
処理という。)が必要となる。
[0005] Therefore, when performing color discrimination processing with emphasis on color discrimination of chromatic color portions, a process of removing chromatic colors contained in a black region from the color discrimination result (hereinafter, referred to as noise removal process). )Is required.

【0006】上記従来の色判別方法におけるノイズ除去
処理は、周辺画素の色判別結果との多数決によりノイズ
除去を行うようにしているので、黒領域内のノイズが点
在している場合には有効であるが、黒領域の色判別結果
が斑模様のように多数のノイズで占められている場合
は、正しく黒と判別された画素が有彩色と誤判別された
周辺画素の影響で有彩色に誤修正される可能性が高く、
黒領域を黒色に修正することは困難となる。特に、上述
のデジタルカメラでホワイトボートを撮影した画像で
は、照明やペンの汚れ等の条件が影響して黒領域が斑模
様に誤判別され易い画像となるので、このような画像に
対して従来のノイズ除去方法を適用しても十分な効果を
得ることは困難である。
The noise removal processing in the above-described conventional color discrimination method performs noise removal by majority decision with the result of color discrimination of peripheral pixels. Therefore, it is effective when noise is scattered in a black area. However, when the color discrimination result of the black area is occupied by a large number of noises such as spots, pixels that are correctly determined to be black are converted to chromatic colors due to the influence of peripheral pixels that are erroneously determined to be chromatic. It is highly likely that it will be incorrectly corrected,
It is difficult to correct the black area to black. In particular, in an image obtained by photographing a white boat with the digital camera described above, the black area is likely to be erroneously determined to be a spotted pattern due to the influence of lighting, stains on a pen, and the like. However, it is difficult to obtain a sufficient effect even if the noise removal method is applied.

【0007】本発明は、上記課題に鑑みてなされたもの
であり、色判別によって黒領域に生じたノイズを有効に
除去することのできる色判別装置を提供するものであ
る。
The present invention has been made in view of the above problems, and provides a color discriminating apparatus capable of effectively removing noise generated in a black area by color discrimination.

【0008】[0008]

【課題を解決するための手段】本発明は、複数の色成分
の画像データからなるカラー画像の色を判別する色判別
装置であって、各画素位置毎に、上記画像データを用い
て色の判別を行う色判別手段と、予め設定された画素数
単位で、上記色判別手段で判別された色のデータを抽出
し、その抽出された領域に含まれる色の分散の度合いを
示す分散度を演算する演算手段と、上記演算手段で算出
された分散度を予め設定された所定の閾値と比較して色
の分散が大きいか否かを判別する判別手段と、上記判別
手段で色の分散が大きいと判別されたとき、上記抽出領
域の中心の画素位置の色のデータを黒色のデータに置換
する色データ置換手段とを備えたものである(請求項
1)。
SUMMARY OF THE INVENTION The present invention is a color discriminating apparatus for discriminating the color of a color image composed of image data of a plurality of color components. A color discriminating means for discriminating, and extracting data of the color discriminated by the color discriminating means in units of a predetermined number of pixels, and calculating a degree of dispersion indicating a degree of dispersion of the color included in the extracted area. Calculating means for calculating, a determining means for comparing the degree of dispersion calculated by the calculating means with a predetermined threshold value to determine whether or not the color variance is large; Color data replacement means for replacing the color data at the pixel position at the center of the extraction area with black data when it is determined to be large (claim 1).

【0009】上記構成によれば、カラー画像は、その画
像を構成する色成分の画像データを用いて各画素位置の
色判別が行われる。更に、色判別結果に対して、予め設
定された画素数単位で、カラー画像の一部の領域の色の
データが抽出され、その抽出領域に含まれる色の分散度
が演算され、その分散度を予め設定された所定の閾値と
比較して色の分散が大きいか否かが判別される。そし
て、色の分散が大きいと判別されたときは、抽出領域の
中心の画素位置の色のデータが黒色のデータに置換され
る。
[0009] According to the above configuration, in a color image, the color of each pixel position is determined using the image data of the color components constituting the image. Further, color data of a partial area of the color image is extracted from the color determination result in units of a predetermined number of pixels, and the degree of dispersion of the color included in the extracted area is calculated. Is compared with a predetermined threshold value set in advance to determine whether or not the color variance is large. When it is determined that the color variance is large, the color data at the pixel position at the center of the extraction area is replaced with black data.

【0010】上記データの置換処理は、カラー画像内の
抽出領域を変化させて各画素について順次、行われ、こ
れにより黒領域内にノイズとして生じている有彩色が黒
色に修正される。
The above-described data replacement processing is sequentially performed for each pixel while changing the extraction area in the color image, whereby the chromatic color occurring as noise in the black area is corrected to black.

【0011】また、本発明は、上記色判別装置におい
て、上記色データ置換手段は、上記判別手段で色の分散
が大きいと判別されたとき、上記抽出領域の中心の画素
位置の色のデータに代えて抽出領域全体の色のデータを
黒色のデータに置換するものである(請求項2)。
Further, in the color discriminating apparatus according to the present invention, when the color data replacing means determines that the color variance is large by the discriminating means, the color data replacing means adds the color data at the pixel position at the center of the extraction area to the color data. Instead, the color data of the entire extraction area is replaced with black data.

【0012】上記構成によれば、色の分散が大きいと判
別されたときは、抽出領域に含まれる全ての色のデータ
が黒色のデータに置換される。これにより黒領域のノイ
ズの修正処理の高速化が可能になる。
According to the above configuration, when it is determined that the color variance is large, the data of all colors included in the extraction area is replaced with black data. This makes it possible to speed up the process of correcting the noise in the black area.

【0013】[0013]

【発明の実施の形態】本発明について、本発明に係る色
判別装置を備えたデジタルカメラを例に説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described by taking a digital camera provided with a color discriminating apparatus according to the present invention as an example.

【0014】図1は、本発明に係る色判別装置を備えた
デジタルカメラの一実施の形態の外観を示す斜視図、図
2は、同デジタルカメラの背面図である。
FIG. 1 is a perspective view showing an external appearance of an embodiment of a digital camera provided with a color discriminating apparatus according to the present invention, and FIG. 2 is a rear view of the digital camera.

【0015】同図において、デジタルカメラ1は、前面
の略中央にズームレンズからなる撮影レンズ2が配設さ
れ、その上部にアクティブ測距方式により被写体距離を
測定するための投光窓4と受光窓5とが配設され、両窓
の間に被写体の輝度を測定するための測光窓3が配設さ
れている。また、投光窓4の左側にファインダー対物窓
6が配設されている。
In FIG. 1, a digital camera 1 is provided with a photographing lens 2 comprising a zoom lens substantially at the center of the front surface, and a light projecting window 4 for measuring a subject distance by an active distance measuring method and a light receiving window above the photographing lens 2. A window 5 is provided, and a photometric window 3 for measuring the brightness of the subject is provided between the two windows. Further, a finder objective window 6 is provided on the left side of the light projecting window 4.

【0016】投光窓4は、被写体に対して赤外光を照射
する窓であり、受光窓5は、この赤外光の被写体からの
反射光を受光する窓である。なお、本実施の形態では測
距方式としてアクティブ測距方式を採用しているが、パ
ッシブ測距方式でもよい。
The light projecting window 4 is a window for irradiating the subject with infrared light, and the light receiving window 5 is a window for receiving the reflected light of the infrared light from the subject. In the present embodiment, the active distance measuring method is adopted as the distance measuring method, but a passive distance measuring method may be used.

【0017】デジタルカメラ1の側面にはハードディス
クカード10(以下、HDカード10と略称する。)が
装着脱されるカード挿入口7が設けられ、このカード挿
入口7の上部にHDカード10をイジェクトするための
カード取出ボタン8が設けられている。また、デジタル
カメラ1の上面左端部にシャッタボタン9が設けられて
いる。
On the side of the digital camera 1, there is provided a card insertion slot 7 into which a hard disk card 10 (hereinafter abbreviated as HD card 10) is inserted and ejected, and the HD card 10 is ejected above the card insertion slot 7. A card removal button 8 for performing the operation is provided. Further, a shutter button 9 is provided at the left end of the upper surface of the digital camera 1.

【0018】撮影結果をプリントアウトする場合、カー
ド取出ボタン8を押してHDカード10をデジタルカメ
ラ1から取り外し、HDカード10が装着可能なプリン
タにこのHDカード10を装着してプリントアウトする
ことができる。
When the photographing result is printed out, the card removal button 8 is pressed to remove the HD card 10 from the digital camera 1, and the HD card 10 can be mounted on a printer to which the HD card 10 can be mounted and printed out. .

【0019】なお、デジタルカメラ1にSCSIケーブ
ルのインターフェースを設け、デジタルカメラ1とプリ
ンタとをSCSIケーブルで接続し、デジタルカメラ1
からプリンタに画像データを転送して直接、撮影画像を
プリントアウトさせるようにしてもよい。
The digital camera 1 is provided with a SCSI cable interface, and the digital camera 1 and the printer are connected by a SCSI cable.
, The image data may be transferred to a printer and the photographed image may be printed out directly.

【0020】また、本実施の形態では画像データの記録
媒体としてPCMCIA準拠のハードディスクカードを
採用しているが、撮影結果を画像データとして記憶でき
るものであれば、メモリカードやミニディスク(MD)
等の他の記録媒体でもよい。
In this embodiment, a hard disk card conforming to PCMCIA is used as a recording medium for image data. However, if a photographing result can be stored as image data, a memory card or a mini disk (MD) can be used.
And other recording media.

【0021】デジタルカメラ1の背面には、図2に示す
ように、その上部の左端部に電源投入用のメインスイッ
チ11が設けられ、略中央にファインダー接眼窓12が
設けられている。また、メインスイッチ11の下部に
は、色補正スイッチ13、ノイズ修正スイッチ14及び
濃度設定スイッチ15が設けられている。
As shown in FIG. 2, on the rear surface of the digital camera 1, a main switch 11 for turning on the power is provided at the upper left end, and a finder eyepiece window 12 is provided substantially at the center. A color correction switch 13, a noise correction switch 14, and a density setting switch 15 are provided below the main switch 11.

【0022】更に、デジタルカメラ1の背面右端部に、
モード変更スイッチ16、色登録確認表示部17、色選
択ボタン18、セットボタン19及びデフォルトボタン
20が設けられている。
Further, at the right end of the back of the digital camera 1,
A mode change switch 16, a color registration confirmation display section 17, a color selection button 18, a set button 19, and a default button 20 are provided.

【0023】ホワイトボードに書かれた文字や図表など
を直接、撮影して記録資料とする場合、その撮影画像に
ついては通常の写真撮影のような描写性の高い画質より
も文字等が明瞭な情報性の高い画質が要求される。色補
正スイッチ13は、このような撮影画像に対して文字、
線図等の濃度を明瞭にするとともに、色分けを明確にす
る所定の画像処理を指示するためのスイッチである。
In the case where characters, diagrams, and the like written on a whiteboard are directly photographed as recording materials, the photographed image is information in which characters and the like are clearer than the image quality having high descriptiveness as in ordinary photographing. High quality image quality is required. The color correction switch 13 is used to output characters,
A switch for instructing predetermined image processing for clarifying the density of a diagram or the like and clarifying the color.

【0024】この画像処理では、ホワイトボードには通
常、赤、青、緑、橙、黒等の数種類のカラーペンで文
字、図表等が書かれること、また、この文字、図表等を
撮影した画像では色再現性よりも撮影画像の文字等の情
報性(見易さ、判り易さ等)が重視されることから、撮
影された画像内の文字等が赤、青、緑、橙、黒等のいず
れの色に着色されているかを判別し、その文字等に判別
結果に応じた予め設定された所定の色を割り付ける処理
(その文字等を構成する領域の画像データを予め設定さ
れた色の画像データで置換する処理)が行われる。
In this image processing, characters, diagrams, and the like are usually written on a whiteboard with several types of color pens, such as red, blue, green, orange, and black. Since the importance of the information (eg, legibility, legibility, etc.) of the characters in the captured image is more important than the color reproducibility, the characters, etc. in the captured image are red, blue, green, orange, black, etc. Of which color is colored, and assigning a predetermined color according to the determination result to the character or the like (the image data of the region constituting the character or the like is Image data).

【0025】色補正スイッチ13がオンであれば、撮影
画像に対する上記画像処理が行われ、オフであれば、撮
影画像に対する上記画像処理は行われず、通常の写真撮
影に対する画像処理が行われる。従って、通常の写真撮
影を行う撮影モードを「ノーマルモード」、ホワイトボ
ードに書かれた文字等の記録撮影を行う撮影モードを
「ドキュメントモード」とすると、色補正スイッチ13
はノーマルモードとドキュメントモードとを切換設定す
るスイッチとなっている。
When the color correction switch 13 is on, the above-described image processing is performed on the photographed image. When the color correction switch 13 is off, the above-described image processing is not performed on the photographed image, and image processing is performed on normal photographing. Therefore, if the shooting mode for performing normal photographing is “normal mode” and the shooting mode for recording and shooting characters and the like written on the whiteboard is “document mode”, the color correction switch 13
Is a switch for switching and setting between the normal mode and the document mode.

【0026】ノイズ修正スイッチ14は、ドキュメント
モードにおける上記画像処理において、撮影画像の文字
等にノイズとして発生した偽色を修正するためのスイッ
チである。ノイズ修正スイッチ14をオンにすると、後
述するように撮影画像の文字等に発生した偽色の修正処
理が行われ、オフにすると、その修正処理は行われな
い。ノイズ修正スイッチ14はドキュメントモードで機
能するため、色補正スイッチ13がオフになっていると
きにノイズ修正スイッチ14をオンにしても、偽色修正
処理の指示は無視される。
The noise correction switch 14 is a switch for correcting a false color generated as noise in characters or the like of a photographed image in the image processing in the document mode. When the noise correction switch 14 is turned on, a process of correcting a false color generated in a character or the like of a captured image is performed as described later, and when the noise correction switch 14 is turned off, the correction process is not performed. Since the noise correction switch 14 functions in the document mode, even if the noise correction switch 14 is turned on while the color correction switch 13 is turned off, the false color correction processing instruction is ignored.

【0027】濃度設定スイッチ15は、ドキュメントモ
ードの画像処理において、例えば線の細い文字や濃度の
淡い図形等が明瞭な画像となるようにするために、被写
体の濃度情報を設定するものである。濃度設定スイッチ
15で設定された濃度情報は、ドキュメントモードの画
像処理の色判別における判別閾値を被写体の濃度に応じ
て切り換える際に用いられる。本実施の形態では、濃度
設定スイッチ15により「濃」,「淡」、2種類の濃度
情報が切換設定される。濃度設定スイッチ15もドキュ
メントモードにおいて機能するため、色補正スイッチ1
3がオフになっているときに濃度設定スイッチ15をオ
ンにしても、文字等の濃度の修正処理の指示は無視され
る。なお、濃度設定は、連続的に設定できるようにして
いてもよい。
The density setting switch 15 is used to set the density information of the subject in the image processing in the document mode so that, for example, characters with thin lines, figures with low density, etc. can be formed into clear images. The density information set by the density setting switch 15 is used when a determination threshold in color determination in image processing in the document mode is switched according to the density of the subject. In the present embodiment, the density setting switch 15 switches between “dark” and “light” and sets two types of density information. Since the density setting switch 15 also functions in the document mode, the color correction switch 1
Even if the density setting switch 15 is turned on while the button 3 is off, the instruction to correct the density of characters and the like is ignored. Note that the density setting may be set continuously.

【0028】モード変更スイッチは、写真撮影を行う撮
影モードと色判別の際の判別色の登録を行う色登録モー
ドとを切換設定するものである。色登録モードは、色見
本(ホワイトボード上にカラーペンで作成されたカラー
パッチ等)を実際に撮影して上述の色判別処理及び色置
換処理で使用される色の画像データを設定、登録する処
理を行うためのモードである。なお、デジタルカメラ1
には予め色データのデフォルト値が設定されており、ユ
ーザーが色登録モードにおいて、色データを登録設定し
なかった場合は、このデフォルト値が色判別及び色デー
タ置換の処理に利用される。
The mode change switch switches between a photographing mode for photographing and a color registration mode for registering a discrimination color in color discrimination. In the color registration mode, a color sample (such as a color patch created on a whiteboard with a color pen) is actually photographed, and image data of colors used in the above-described color discrimination processing and color replacement processing is set and registered. This is a mode for performing processing. The digital camera 1
Is set in advance in the color registration mode. If the user does not register and set the color data in the color registration mode, the default value is used for color discrimination and color data replacement processing.

【0029】本実施の形態では、図3に示すように、
赤、青、橙、緑の4つの色について登録することができ
るようになっている。従って、モード変更スイッチ16
が「色登録」に設定されていると、赤、青、橙、緑の4
つの色について、色見本を撮影して所望の色データを登
録することができ、モード変更スイッチ16が「撮影」
に設定されていると、写真撮影が可能になる。
In the present embodiment, as shown in FIG.
It is possible to register four colors of red, blue, orange, and green. Therefore, the mode change switch 16
Is set to “Color Registration”, red, blue, orange, green
For each color, a color sample can be taken and the desired color data can be registered.
When set to, photography is possible.

【0030】色登録確認表示部17は、色登録の内容や
色データ置換処理における使用色を表示するものであ
る。色登録確認表示部17は、色登録モードにおいて
は、登録すべき色の選択を行うための表示部として、ま
た、撮影モードにおいては、色データ置換処理に使用す
る色の選択を行うための表示部としても機能する。図3
において、「赤」、「青」、「橙」及び「緑」の表示
は、登録可能な色の種類を示すものである。本実施例で
は、4種類の色を登録可能にしているが、4種類以上の
色を登録可能にしてもよく、また、上記4種類の色以外
の色(例えば黄、茶等の色)を登録可能にするようにし
てもよい。
The color registration confirmation display section 17 displays the contents of color registration and the colors used in the color data replacement processing. The color registration confirmation display section 17 serves as a display section for selecting a color to be registered in the color registration mode, and a display for selecting a color used for color data replacement processing in the shooting mode. Also functions as a unit. FIG.
, The indications of “red”, “blue”, “orange”, and “green” indicate the types of colors that can be registered. In the present embodiment, four types of colors can be registered. However, four or more types of colors can be registered, and colors other than the above four types of colors (for example, colors such as yellow and brown) can be used. You may make it possible to register.

【0031】上部にバー表示171が付されている色
は、色登録又は色使用の選択を行う際、その色が選択さ
れていることを示している。図3では、「青」が選択さ
れている。このバー表示171は、色選択ボタン18の
操作により左右に移動し、ユーザーは、色登録モードに
おいて色選択ボタン18を操作することにより所望の色
を選択することができるようになっている。なお、右側
の色選択ボタン18を押す毎に、バー表示171は「赤
→青→橙→緑→赤」と右方向に移動し、左側の色選択ボ
タン18を押す毎に、バー表示171は「緑←赤←青←
橙←緑」と左方向に移動する。
A color with a bar display 171 at the top indicates that the color is selected when color registration or color use is selected. In FIG. 3, “blue” is selected. The bar display 171 is moved left and right by operating the color selection button 18, and the user can select a desired color by operating the color selection button 18 in the color registration mode. Each time the right color selection button 18 is pressed, the bar display 171 moves rightward as “red → blue → orange → green → red”, and each time the left color selection button 18 is pressed, the bar display 171 is displayed. `` Green ← red ← blue ←
Move to the left as “orange ← green”.

【0032】また、色登録欄の○印表示171で囲まれ
ている色は、その色が登録されていることを示し、○印
表示171で囲まれていない色は、その色が登録されて
いないことを示している。色登録は、色登録モードを設
定し、バー表示171で所望の色、例えば「赤」を選択
した後、ホワイトボード上の適当な大きさの領域を赤ペ
ンで塗り潰す等して作成した色見本を撮影することによ
り行われる。この場合、ファインダー内には、図4に示
すように、中央部に色データ取込範囲を示す枠21が表
示され、この枠21内の一定の領域以上に色見本22が
含まれるようにフレームを調整して撮影すると、色デー
タの登録処理が行われる。色登録モードでの撮影では、
撮影画像内の枠21内に含まれる画像データを用いて、
その枠内の色(図4の例では赤)を構成するR,G,B
の色成分のデータとこれらのデータを用いて生成された
2次の正規化データ(後述する)とが登録される(メモ
リに記憶される)。
A color surrounded by a circle 171 in the color registration column indicates that the color has been registered, and a color not surrounded by a circle 171 indicates that the color has been registered. It is not shown. The color registration is performed by setting a color registration mode, selecting a desired color, for example, “red” on the bar display 171, and then filling an area of an appropriate size on the whiteboard with a red pen or the like. This is done by taking a sample. In this case, as shown in FIG. 4, a frame 21 indicating the color data capture range is displayed in the center of the viewfinder, and a frame is displayed so that the color sample 22 is included in a certain area or more in the frame 21. When the photographing is performed with the adjustment of, color data registration processing is performed. When shooting in color registration mode,
Using the image data included in the frame 21 in the captured image,
R, G, B constituting the color (red in the example of FIG. 4) in the frame
Is registered (stored in the memory) with the second-order normalized data (to be described later) generated by using these color components.

【0033】色使用欄は、色補正モードにおける色判別
及び色データ置換の処理において、登録色又はデフォル
ト色が使用されるか否かを示す表示である。○印表示1
73で「ON」が囲まれている色は、使用されることを
示し、「OFF」が囲まれている色は使用されないこと
を示す。図3の表示例では、橙を除く赤、青、緑の3色
が色データ置換処理に使用されることを示している。
The color use column is a display indicating whether a registered color or a default color is used in the process of color determination and color data replacement in the color correction mode. ○ mark display 1
The color surrounded by “ON” in 73 indicates that the color is used, and the color surrounded by “OFF” indicates that the color is not used. The display example of FIG. 3 shows that three colors of red, blue, and green except for orange are used for the color data replacement processing.

【0034】色使用欄のON/OFF設定は、色登録モ
ードにおいて、色選択ボタン18により色を選択した
後、セットボタン20を操作して行われる。色使用欄の
○印表示173の位置は、セットボタン20を押す毎に
ONとOFFとが交互に切り換わり、ユーザーは、○印
表示173の表示位置を見ながらセットボタン20を操
作することで色の使用/不使用を設定することができ
る。
The ON / OFF setting of the color use column is performed by operating the set button 20 after selecting a color with the color selection button 18 in the color registration mode. Each time the set button 20 is pressed, the position of the mark 173 in the color use column is switched between ON and OFF alternately. The user operates the set button 20 while watching the display position of the mark 173. Use / non-use of color can be set.

【0035】デフォルトボタン20は、色登録した色を
デフォルト色に戻すための操作ボタンである。色登録モ
ードにおいて、バー表示171で所望の色に設定した
後、デフォルトボタン20を押すと、○印表示172の
表示が消え、色登録が抹消される。
The default button 20 is an operation button for returning a registered color to the default color. In the color registration mode, when the desired color is set on the bar display 171 and the default button 20 is pressed, the display of the mark 172 disappears, and the color registration is deleted.

【0036】図5は、本発明に係るデジタルカメラのド
キュメントモードにおける撮影画像の画像処理に関する
ブロック構成図である。同図において、図1,図2に示
した部材と同一の部材には同一番号を付している。ま
た、撮像部23は、撮影レンズ2により撮像素子の撮像
面に結像された被写体光像を画像信号に変換して出力す
るものである。撮像部23には、例えばCCDカラーエ
リアセンサからなる撮像素子とこの撮像素子(以下、C
CDという。)の駆動を制御するCCD駆動制御回路と
CCDから出力される画像信号(アナログ信号)のノイ
ズ低減、レベル調整等の所定の信号処理を行うアナログ
信号処理回路が含まれている。
FIG. 5 is a block diagram showing the image processing of a photographed image in the document mode of the digital camera according to the present invention. In the figure, the same members as those shown in FIGS. 1 and 2 are denoted by the same reference numerals. The imaging unit 23 converts a subject light image formed on the imaging surface of the imaging device by the imaging lens 2 into an image signal and outputs the image signal. The image pickup unit 23 includes an image pickup device composed of, for example, a CCD color area sensor and this image pickup device (hereinafter, C
It is called CD. ), And an analog signal processing circuit that performs predetermined signal processing such as noise reduction and level adjustment of an image signal (analog signal) output from the CCD.

【0037】CCDカラーエリアセンサは、被写体光像
をR,G,Bの色成分の画像データに分離して出力する
ものであり、単板式エリアセンサ、3板式エリアセンサ
のいずれであってもよい。撮像部23は、カメラの撮影
動作を集中制御する制御部34から入力される露出制御
値(シャッタスピード)に基づきCCDの撮影動作(電
荷蓄積及び蓄積電荷の読出)が制御される。すなわち、
制御部34からの露光開始信号に基づきCCDの露光
(電荷蓄積)が開始され、所定時間経過後に露光が終了
すると、その蓄積電荷がR,G,Bの色成分毎にCCD
から読み出され、アナログ信号処理回路で所定の信号処
理が行われた後、A/D変換器24を介して画像処理部
26に読み出される。
The CCD color area sensor separates the subject light image into image data of R, G, and B color components and outputs the image data. The CCD color area sensor may be a single-plate area sensor or a three-plate area sensor. . The imaging unit 23 controls the CCD imaging operation (charge accumulation and readout of accumulated charges) based on the exposure control value (shutter speed) input from the control unit 34 that centrally controls the imaging operation of the camera. That is,
Exposure (charge accumulation) of the CCD is started based on an exposure start signal from the control unit 34, and when the exposure is completed after a lapse of a predetermined time, the accumulated charge is transferred to the CCD for each of the R, G, and B color components.
After being subjected to predetermined signal processing by an analog signal processing circuit, the signal is read out to an image processing unit 26 via an A / D converter 24.

【0038】A/D変換器24は撮像部23から読み出
されたアナログの画像信号を、例えば8ビットのデジタ
ルの画像信号(以下、画像データという。)に変換する
ものである。
The A / D converter 24 converts an analog image signal read from the imaging section 23 into, for example, an 8-bit digital image signal (hereinafter referred to as image data).

【0039】画像処理部25は、A/D変換器24から
入力された画像データに、ノーマルモードにおいてはホ
ワイトバランス、γ補正、シェーディング補正等の所定
の画像処理を施し、ドキュメントモードにおいては後述
する下地飛ばし、色補正、黒領域補正及色データ置換等
の所定の画像処理を施し、所定の圧縮処理をした後、H
Dカード10に出力するものである。
The image processing unit 25 performs predetermined image processing such as white balance, γ correction, shading correction and the like on the image data input from the A / D converter 24 in the normal mode, and will be described later in the document mode. After performing predetermined image processing such as background removal, color correction, black area correction, and color data replacement, and performing predetermined compression processing, H
The data is output to the D card 10.

【0040】HDカード10は、撮影画像を構成する画
像データを記録する記録媒体である。また、カード駆動
制御部26は、HDカードの駆動を制御するものであ
る。
The HD card 10 is a recording medium for recording image data constituting a captured image. The card drive control unit 26 controls the drive of the HD card.

【0041】RAM(Random Access Memory)27は、
制御部34が撮影や色登録その他の機能に関する処理を
行うためのメモリである。ROM(Read Only Memory)
28は、撮像駆動の制御に必要なデータや処理プログラ
ム、後述するドキュメンモードにおける下地飛ばし、色
判別、黒領域補正、偽色消去等の各種処理を行うための
必要なデータや処理プログラムが記憶されたメモリであ
る。
A RAM (Random Access Memory) 27
This is a memory for the control unit 34 to perform processing relating to shooting, color registration, and other functions. ROM (Read Only Memory)
Reference numeral 28 stores data and processing programs necessary for controlling the imaging drive, and data and processing programs necessary for performing various processes such as background removal, color discrimination, black area correction, and false color erasure in a document mode described later. Memory.

【0042】また、測距部29は、投光窓4及び受光窓
5の後方位置に設けられた被写体距離を検出するもので
ある。測光部30は、測光窓3の後方位置に設けられた
SPC等の受光素子を有し、被写体輝度を検出するもの
である。
The distance measuring section 29 detects a subject distance provided behind the light projecting window 4 and the light receiving window 5. The photometric unit 30 has a light receiving element such as an SPC provided at a position behind the photometric window 3 and detects a subject brightness.

【0043】設定色正規化演算部31は、色登録モード
において、取り込まれた色見本の画像データを用いて、
後述する正規化データを演算するものである。この正規
化データは、R,G,Bの各色成分の画像データのレベ
ルをXr,Xg,Xbとし、正規化データをxr,xg,xb
とすると、xr=Xr2/(Xr2+Xg2+Xb2),xg=X
g2/(Xr2+Xg2+Xb2),xb=Xb2/(Xr2+Xg2
+Xb2)で算出され、xb-xg平面における正規化デー
タの座標位置により色判別を行う際の色領域分割に利用
される。なお、正規化データの座標位置による色判別方
法の詳細は、後述する。
In the color registration mode, the set color normalization calculating section 31 uses the captured color sample image data to
This is for calculating normalized data described later. In the normalized data, the levels of the image data of the R, G, and B color components are Xr, Xg, Xb, and the normalized data is xr, xg, xb.
When, xr = Xr 2 / (Xr 2 + Xg 2 + Xb 2), xg = X
g 2 / (Xr 2 + Xg 2 + Xb 2), xb = Xb 2 / (Xr 2 + Xg 2
+ Xb 2 ), and is used for color region division when performing color discrimination based on the coordinate position of the normalized data on the xb-xg plane. The details of the color determination method based on the coordinate position of the normalized data will be described later.

【0044】設定色正規化演算部31は、色登録モード
において取り込まれた色見本の画像データの内、撮影画
面内の枠21に含まれる画像データを抽出し、更にその
抽出データから予め設定された所定レベル以下の画像デ
ータを抽出する。この抽出処理は、図4において、枠2
1内の赤の色見本に相当する画像データを抽出するもの
である。そして、設定色正規化演算部31は、抽出され
た色見本の画像データを用いて2次の正規化データを演
算する。この演算結果は、制御部34を介してRAM2
7に記憶される。
The set color normalization calculation unit 31 extracts image data included in the frame 21 in the photographing screen from the image data of the color sample taken in the color registration mode, and further sets a preset data from the extracted data. Image data of a predetermined level or less. This extraction process is shown in FIG.
1 extracts image data corresponding to a red color sample. Then, the set color normalization calculation unit 31 calculates secondary normalized data using the extracted color sample image data. This calculation result is stored in the RAM 2 via the control unit 34.
7 is stored.

【0045】色領域設定演算部32は、上述したxb-x
g平面における正規化データの座標位置により色判別を
行う際の色領域を分割するものである。すなわち、例え
ば有彩色を青,緑,橙,赤の4色に色判別する場合、x
b-xg平面における正規化データの座標位置による色判
別では、xb-xg平面を青,緑,橙,赤の4つの色領域
に分割し、正規化データの座標位置がいずれの色領域に
あるかで色判別が行われるが、色領域設定演算部32
は、xb-xg平面を青,緑,橙,赤の4つの色領域に分
割するための境界線を演算するものである。この境界線
の演算結果もRAM27に記憶される。なお、色領域の
設定についても後述する。
The color area setting calculation section 32 calculates the above-mentioned xb-x
This is to divide a color area when performing color discrimination based on the coordinate position of the normalized data on the g plane. That is, for example, when a chromatic color is distinguished into four colors of blue, green, orange, and red, x
In the color discrimination based on the coordinate position of the normalized data on the b-xg plane, the xb-xg plane is divided into four color regions of blue, green, orange, and red, and the coordinate position of the normalized data is in any color region. The color region setting calculation unit 32
Calculates a boundary line for dividing the xb-xg plane into four color regions of blue, green, orange, and red. The calculation result of this boundary line is also stored in the RAM 27. The setting of the color area will also be described later.

【0046】制御部34は、デジタルカメラ1の撮影動
作を集中制御するもので、マイクロコンピュータで構成
されている。制御部34は、撮像部23の駆動を制御し
て被写体光像を撮像し、画像処理部25の駆動を制御し
て撮像画像に所定の画像処理を施すとともに、カード駆
動制御部26の駆動を制御して画像処理後の撮像画像を
HDカードに記録する。
The control section 34 centrally controls the photographing operation of the digital camera 1 and is constituted by a microcomputer. The control unit 34 controls the driving of the imaging unit 23 to capture an optical image of the subject, controls the driving of the image processing unit 25 to perform predetermined image processing on the captured image, and controls the driving of the card driving control unit 26. Under control, the captured image after the image processing is recorded on the HD card.

【0047】図6は、画像処理部25のドキュメントモ
ードにおける画像処理(色補正処理)に関するブロック
構成図である。
FIG. 6 is a block diagram showing the image processing (color correction processing) of the image processing section 25 in the document mode.

【0048】画像処理部25には、ドキュメントモード
における色補正処理を行うための回路ブロックとして、
画像メモリ251、第1ノイズ消去部252、下地飛ば
し演算部253、γ特性設定部254、色判別部25
5、黒領域補正部256、第2ノイズ消去部257及び
色置換部258が含まれている。
The image processing unit 25 includes circuit blocks for performing color correction processing in the document mode.
Image memory 251, first noise elimination unit 252, background removal calculation unit 253, γ characteristic setting unit 254, color determination unit 25
5, a black area correction unit 256, a second noise elimination unit 257, and a color replacement unit 258.

【0049】ドキュメントモードにおいては、図7に示
すように、画像処理部25に入力にされた画像データ
は、まず、下地を白く飛ばす前処理が行われた後(処理
A)、各画素位置の画像データ(R,G,Bの画像デー
タ)の2次の冪乗値について正規化データが作成され
(処理B)、この正規化データを用いて色判別が行われ
る(処理C)。そして、文字等を構成する画像データの
うち、誤って色判別された画像データが修正されるとと
もに、黒色領域の画像データのうち、有彩色に着色され
た画像データが修正された後(処理D)、各画素位置の
画像データが色判別結果に基づく所定の色データに置換
されてHDカード10に出力される(処理E)。
In the document mode, as shown in FIG. 7, the image data input to the image processing section 25 is first subjected to a pre-processing for whitening the background (processing A), and then to the pixel data of each pixel position. Normalized data is created for the second power of the image data (R, G, and B image data) (Process B), and color discrimination is performed using the normalized data (Process C). Then, among the image data constituting the characters and the like, the image data whose color has been erroneously determined is corrected, and the image data colored in a chromatic color is corrected among the image data of the black region (process D). ), The image data at each pixel position is replaced with predetermined color data based on the color determination result and output to the HD card 10 (Process E).

【0050】画像メモリ251は、A/D変換器24か
ら入力されるR,G,Bの各色成分の画像データを一時
的に記憶するものである。第1ノイズ消去部252は、
例えば各画素位置の画像データを隣接する画素位置の8
個の画像データとの平均値に置換することによって画像
メモリ251に入力された画像データのノイズを低減す
るものである。
The image memory 251 temporarily stores the image data of each of the R, G, and B color components input from the A / D converter 24. The first noise elimination unit 252 includes:
For example, the image data at each pixel position is changed to 8 at the adjacent pixel position.
The noise of the image data input to the image memory 251 is reduced by substituting the average value with the image data.

【0051】下地飛ばし演算部253は、画像データの
下地部分と文字部分とを分離し、下地部分に相当する領
域を所定の白レベルデータに変換するものである。すな
わち、例えばホワイトボードに文字や図形が描かれた被
写体を撮影した画像(以下、ホワイトボード撮影画像と
いう。)の場合、図8に示すように、ホワイトボード3
5のボード部分351の画像を一律に白くし、文字部分
352の画像を見易くするものである。下地飛ばし演算
部253は、γ特性設定部254から入力されるγ特性
に従って各画素位置の画像データのγ補正を行うことに
より下地飛ばし処理を行う。
The background removal operation unit 253 separates the background portion and the character portion of the image data, and converts an area corresponding to the background portion into predetermined white level data. That is, for example, in the case of an image of a subject in which characters or figures are drawn on a whiteboard (hereinafter, referred to as a whiteboard photographed image), as shown in FIG.
5 makes the image of the board portion 351 white uniformly and makes the image of the character portion 352 easy to see. The background removal calculation unit 253 performs the background removal processing by performing γ correction of the image data at each pixel position according to the γ characteristic input from the γ characteristic setting unit 254.

【0052】γ特性設定部254は、下地飛ばし処理の
ためのγ特性を設定するものである。γ特性設定部25
4は、入力された画像データのヒストグラムを作成し、
このヒストグラムに基づいてγ特性を決定する。図9
は、ホワイトボード撮影画像の典型的なヒストグラムで
あるが、このような文字画像では、一般に大小2つの山
U1,U2が生じる。明領域に生じる大きい山U1は、
ボード部分351に相当し、暗領域に生じる小さい山U
2は、文字部分352の明瞭な文字や図形に相当してい
る。そして、大きい山U1と小さい山U2との谷の部分
Rは、ボード部分351の汚れや文字部分352の色の
薄い或いは線の細い文字や図形の部分である。
The γ characteristic setting section 254 sets the γ characteristic for the background removal processing. γ characteristic setting unit 25
4 creates a histogram of the input image data,
The γ characteristic is determined based on this histogram. FIG.
Is a typical histogram of a whiteboard photographed image. In such a character image, two large and small peaks U1 and U2 generally occur. The large mountain U1 that occurs in the light area
A small mountain U corresponding to the board portion 351 and generated in the dark area
2 corresponds to a clear character or figure in the character portion 352. The valley portion R between the large mountain U1 and the small mountain U2 is a portion of a dirt on the board portion 351 or a portion of a character or figure having a thin or thin line of the character portion 352.

【0053】γ特性設定部254は、例えば大きい山U
1のピークに対応する画像データのレベルwを算出し、
図10に示すように、このレベルwを白飽和レベルとす
るγ特性を決定する。なお、図10は、画像データが
8ビットデータの場合のγ特性で、レベル「255」
は、白レベルであり、レベル「0」は、黒レベルであ
る。同図に示すγ特性では、レベルw以上の画像デー
タは、すべて一律に白レベルに変換され、レベルwより
小さい画像データは、そのレベルに応じて所定の変換比
率(γ値)でリニアにレベル変換される。なお、文字部
分352の黒を強調するため、所定の低レベルbを黒飽
和レベルとするγ特性を用いるようにしてもよい。γ
特性では、レベルb以下の画像データは、すべて一律
に黒レベルに変換される。
The γ characteristic setting section 254 is, for example, a large mountain U
Calculate the level w of the image data corresponding to one peak,
As shown in FIG. 10, a γ characteristic in which the level w is set to the white saturation level is determined. FIG. 10 shows the γ characteristic when the image data is 8-bit data, and the level is “255”.
Is a white level, and level “0” is a black level. In the γ characteristic shown in FIG. 3, all image data at the level w or higher are uniformly converted to a white level, and image data lower than the level w are linearly converted at a predetermined conversion ratio (γ value) according to the level. Is converted. In order to emphasize black in the character portion 352, a γ characteristic in which a predetermined low level b is set to a black saturation level may be used. γ
In the characteristics, all the image data at the level b and below are uniformly converted to the black level.

【0054】従って、γ特性設定部254で設定された
γ特性(又は)を用いて下地飛ばし演算部253で
画像データのγ補正が行われると、図8に示すように、
ボード部分351の画像データが略均等に白データに変
換され、撮影画像の下地が白く飛ばされることになる。
Therefore, when the gamma correction of the image data is performed by the background removal calculating unit 253 using the gamma characteristic (or) set by the gamma characteristic setting unit 254, as shown in FIG.
The image data of the board portion 351 is almost uniformly converted into white data, and the background of the captured image is skipped white.

【0055】色判別部255は、各画素位置の色を判別
するものである。色判別部255は、色判別処理を行う
ための回路として正規化演算回路255a、輝度演算回
路255b、形状認識回路255c及び色判別回路25
5dを有している。
The color discriminating section 255 discriminates the color of each pixel position. The color determination unit 255 includes a normalization calculation circuit 255a, a luminance calculation circuit 255b, a shape recognition circuit 255c, and a color determination circuit 25 as circuits for performing a color determination process.
5d.

【0056】R,G,Bの色成分の画像データを用いた
色判別方法としては、特開平6−105091号公報に
示されるように、3個の色成分の内、2個の色成分を選
択し、選択された色成分の正規化データの座標平面にお
ける2個の色成分の正規化データの位置により色判別す
る方法が知られている。本実施の形態でも、2個の色成
分の正規化データの位置により色判別が行われるが、上
記公報が1次の正規化データ、すなわち、R,G,Bの
各色成分の画像データの混合比率を表す正規化データx
r=Xr/(Xr+Xg+Xb),xg=Xg/(Xr+Xg+
Xb),xb=Xb/(Xr+Xg+Xb)を用いて色判別を
行うのに対して、本実施の形態は、2次の冪乗値につい
ての正規化データxi=Xi2/(Xr2+Xg2+Xb2
(i=r,g,b)を用いる点で異なる。
As a color discrimination method using image data of R, G, and B color components, as shown in Japanese Patent Application Laid-Open No. Hei 6-105091, two color components out of three color components are used. There is known a method of selecting and performing color discrimination based on the positions of the normalized data of two color components on the coordinate plane of the normalized data of the selected color component. In this embodiment as well, the color discrimination is performed based on the positions of the normalized data of the two color components. However, the above publication discloses the primary normalized data, that is, the mixing of the image data of the R, G, and B color components. Normalized data x representing the ratio
r = Xr / (Xr + Xg + Xb), xg = Xg / (Xr + Xg +
Xb), whereas a color is classified by using xb = Xb / (Xr + Xg + Xb), the present embodiment, the secondary powers normalized for value data xi = Xi 2 / (Xr 2 + Xg 2 + Xb 2 )
(I = r, g, b).

【0057】本実施の形態で2次の正規化データを用い
るのは、ドキュメントモードでの撮影では、文字等を見
易くする観点から色分類性が重視され、以下に説明する
ように、2次の正規化データを用いた方が色判別処理に
有利だからである。
In the present embodiment, the use of the secondary normalized data emphasizes the color classification from the viewpoint of making the characters and the like easy to see in the photographing in the document mode. This is because the use of the normalized data is advantageous for the color discrimination processing.

【0058】図11は、一次の正規化データxb,xgを
用いて色判別する場合のxb-xg平面における青、緑、
橙、赤の各系統の色分布を示す図であり、図12は、2
次の正規化データxb,xgを用いて色判別する場合のx
b-xg平面における青、緑、橙、赤の各系統の色分布を
示す図である。
FIG. 11 shows blue, green, and blue colors in the xb-xg plane when the color is determined using the primary normalized data xb and xg.
FIG. 12 is a diagram showing the color distribution of each system of orange and red, and FIG.
X for color discrimination using the next normalized data xb, xg
It is a figure which shows the color distribution of each system of blue, green, orange, and red in a b-xg plane.

【0059】両図において、(xb,xg)=(1/3,
1/3)のQ点は、理想的なホワイトバランスを有する
カメラで撮影した場合の完全に無彩色と判別される位置
である。また、(xb,xg)=(1,0),(0,
1),(0,0)の各点は、それぞれ完全な青色、緑
色、赤色と判別される位置である。実際のカメラでは理
想的なホワイトバランスを有していないので、例えば青
色の純色を撮影してもその撮影画像の正規化データ(x
b,xg)は、(xb,xg)=(1,0)にはならず、一
般にQ点側に偏ったある領域内に位置する。
In both figures, (xb, xg) = (1/3,
The 1/3) Q point is a position where it is completely determined to be achromatic when photographed by a camera having an ideal white balance. Also, (xb, xg) = (1, 0), (0,
The points 1) and (0, 0) are positions that are determined to be complete blue, green, and red, respectively. Since an actual camera does not have an ideal white balance, even if a pure blue color is photographed, for example, normalized data (x
(b, xg) does not satisfy (xb, xg) = (1, 0), and is generally located in a certain area biased toward the Q point.

【0060】例えば標準的な青色、緑色、橙色、赤色の
4つカラーペンでホワイトボード上に作成された色見本
を撮影した場合の各色の正規化データ(xb,xg)は、
それぞれ楕円Sb,Sg,So,Srで示す領域内に分布す
る。また、白又は黒の無彩色についてもQ点の近傍のあ
る領域Sw内に分布する。
For example, when a color sample created on a whiteboard is photographed with four standard color pens of blue, green, orange and red, normalized data (xb, xg) of each color is as follows:
Each is distributed in the areas indicated by the ellipses Sb, Sg, So, and Sr. Further, a white or black achromatic color is also distributed in a certain region Sw near the point Q.

【0061】両図の楕円Sb,Sg,So,Srを比較すれ
ば明らかなように、2次の正規化データ(xb,xg)を
用いると、楕円Sb,Sg,So,Srがより偏平になり、
同一の有彩色の画像データから生成された正規化データ
(xb,xg)の位置は、理想的な無彩色点Qから遠くな
ることが分かる(図11,図12の青色領域内のプロッ
トされたP点,P′点を比較参照)。従って、2次の正
規化データを用いる方が1次の正規化データを用いるよ
りも容易かつ正確に色判別を行うことができる。
As is clear from comparison of the ellipses Sb, Sg, So, and Sr in both figures, the use of the second-order normalized data (xb, xg) makes the ellipses Sb, Sg, So, and Sr more flat. Become
It can be seen that the position of the normalized data (xb, xg) generated from the same chromatic image data is far from the ideal achromatic point Q (plotted in the blue region in FIGS. 11 and 12). Compare points P and P '). Therefore, color discrimination can be performed more easily and accurately using secondary normalized data than using primary normalized data.

【0062】正規化演算回路255aは、各画素位置の
R,G,Bの各色成分の画像データを2次の冪乗値によ
る正規化データxr=Xr2/(Xr2+Xg2+Xb2),xg
=Xg2/(Xr2+Xg2+Xb2),xb=Xb2/(Xr2
Xg2+Xb2)に変換するものである。
[0062] normalization arithmetic circuit 255a is, R of each pixel position, G, the image data secondary powers values normalized data xr = Xr 2 / by the respective color components B (Xr 2 + Xg 2 + Xb 2), xg
= Xg 2 / (Xr 2 + Xg 2 + Xb 2), xb = Xb 2 / (Xr 2 +
Xg 2 + Xb 2 ).

【0063】正規化演算回路255aは、図13のフロ
ーチャートに従って各画素位置の画像データXr,Xg,
Xbを2次の正規化データxr,xg,xbに変換する。
The normalization arithmetic circuit 255a calculates the image data Xr, Xg,
Xb is converted into secondary normalized data xr, xg, xb.

【0064】すなわち、各色成分の画像データXr,X
g,Xbをそれぞれ2乗し、その演算結果をそれぞれレジ
スタRr1,Rg1,Rb1に格納する(#2)。続い
て、レジスタRr1,Rg1,Rb1に格納された画像デ
ータXr,Xg,Xbの2乗値Xr2,Xg2,Xb2を加算
し、その結果をレジスタSUMに格納する(#4)。続
いて、レジスタRr1,Rg1,Rb1に格納された画像
データXr,Xg,Xbの2乗値Xr2,Xg2,Xb2をそれ
ぞれレジスタSUMに格納された加算値(Xr2+Xg2
Xb2)で除し、その結果をそれぞレジスタRr2,Rg
2,Rb2に格納して処理を終了する(#6)。
That is, the image data Xr, X
g and Xb are each squared, and the operation results are stored in registers Rr1, Rg1, and Rb1, respectively (# 2). Subsequently, the square values Xr 2 , Xg 2 , and Xb 2 of the image data Xr, Xg, and Xb stored in the registers Rr1, Rg1, and Rb1 are added, and the result is stored in the register SUM (# 4). Subsequently, the square values Xr 2 , Xg 2 , and Xb 2 of the image data Xr, Xg, and Xb stored in the registers Rr1, Rg1, and Rb1 are respectively added to the added value (Xr 2 + Xg 2 +) stored in the register SUM.
Xb 2 ) and divide the result into registers Rr2 and Rg, respectively.
2, stored in Rb2 and the process is terminated (# 6).

【0065】なお、2次より大きい次数の正規化データ
(xb,xg)を用いると、xb-xg平面における正規化
データ(xb,xg)の位置の無彩色点Qから遠くなる傾
向はより強くなり、その画像データの有する色味の特徴
(すなわち、青、緑、橙、赤のいずれに偏っているか)
がより明確となるので、正規化データとして、 xr=Xrk/(Xrk+Xgk+Xbk) xg=Xgk/(Xrk+Xgk+Xbk) xb=Xbk/(Xrk+Xgk+Xbk) の演算式により算出されるk次(k>2)の正規化デー
タを用いてもよい。
When the normalized data (xb, xg) of an order larger than the second order is used, the tendency of the position of the normalized data (xb, xg) on the xb-xg plane to be far from the achromatic point Q is stronger. And the color characteristics of the image data (ie blue, green, orange, or red)
Since but a clearer, as the normalized data, xr = Xr k / (Xr k + Xg k + Xb k) xg = Xg k / (Xr k + Xg k + Xb k) xb = Xb k / (Xr k + Xg k + Xb k ), K-th (k> 2) normalized data may be used.

【0066】また、本実施の形態では、R,G,Bの色
成分の画像データについて説明したが、他の色成分の画
像データの正規化データX(1),X(2),…X(n)を用い
る場合にも2次以上の冪乗値に対する正規化データx
(1)k=X(1)k/ΣX(i)k,x(2)k=X(2)k/ΣX(i)k
…x(n)k=X(n)k/ΣX(i)k(i=1,2,…n、k≧
2)を用いることできる。
In this embodiment, the image data of the R, G, and B color components has been described. However, normalized data X (1), X (2),. Even when (n) is used, normalized data x for a power value of second or higher order
(1) k = X (1) k / ΣX (i) k , x (2) k = X (2) k / ΣX (i) k ,
.. X (n) k = X (n) k / ΣX (i) k (i = 1, 2,... N, k ≧
2) can be used.

【0067】ところで、色判別では、有彩色の色の判別
とともに、有彩色と無彩色の白及び黒との判別を行う必
要がある。有彩色と無彩色の白及び黒との判別も、上述
のようにxg-xb平面内における正規化データの位置を
調べることにより行うことができる。
In the color discrimination, it is necessary to discriminate between chromatic colors and achromatic colors, such as white and black, as well as chromatic colors. The distinction between chromatic and achromatic white and black can also be made by examining the position of the normalized data in the xg-xb plane as described above.

【0068】しかし、R,G,Bの色成分の画像データ
から生成された正規化データは、画像内のR,G,Bの
色成分の偏差のみを抽象し、明暗の情報は捨象されてい
るので、正規化データのみを用いて色判別を行うと、低
輝度の黒色や高輝度の白色が赤や青等の有彩色と誤判別
される場合が生じる。すなわち、例えばR,G,Bの色
成分の画像データ(Xr,Xg,Xb)が(20,5,
5)の黒い画素位置に対する2次の正規化データ(x
b,xg)は(0.06,0.06)で、画像データ(X
r,Xg,Xb)=(200,50,50)の赤い画素位
置に対する2次の正規化データ(xb,xg)と同一とな
るので、黒色が赤色に誤判別される。
However, the normalized data generated from the image data of the R, G, and B color components abstracts only the deviation of the R, G, and B color components in the image, and the information of light and dark is discarded. Therefore, if color discrimination is performed using only normalized data, low-luminance black or high-luminance white may be erroneously determined as a chromatic color such as red or blue. That is, for example, if the image data (Xr, Xg, Xb) of the R, G, B color components is (20, 5,
5) Secondary normalized data (x
b, xg) is (0.06, 0.06), and the image data (X
Since it is the same as the second-order normalized data (xb, xg) for the red pixel position of (r, Xg, Xb) = (200, 50, 50), black is erroneously determined to be red.

【0069】そこで、このような誤判別を防止するた
め、本実施の形態では、各画素位置の輝度データと上述
の正規化データとを用いて色判別(無彩色の判別を含
む。)を行うようにしている。また、線幅の広狭の色判
別への影響を低減するため、後述するように、文字、図
形等の幾何学的形状を加味して色判別を行うようにして
いる。
Therefore, in order to prevent such erroneous determination, in this embodiment, color determination (including achromatic color determination) is performed using the luminance data at each pixel position and the above-described normalized data. Like that. Further, in order to reduce the influence of the line width on the color discrimination, as described later, the color discrimination is performed in consideration of a geometric shape such as a character or a figure.

【0070】輝度演算回路255bは、上述の色判別処
理に使用する各画素位置の輝度データを演算するもので
ある。輝度演算回路255bは、例えばR,G,Bの色
成分の画像データXr,Xg,Xbの平均値Y(=(Xr+
Xg+Xb)/3)を、各画素位置の色判別用の輝度デー
タとして算出する。
The brightness calculation circuit 255b calculates brightness data at each pixel position used in the above-described color discrimination processing. The luminance calculation circuit 255b calculates the average value Y (= (Xr +) of the image data Xr, Xg, Xb of the R, G, B color components, for example.
Xg + Xb) / 3) is calculated as luminance data for color determination at each pixel position.

【0071】また、形状認識回路255cは、文字、図
形等を構成する領域が線状であるか、面状であるかを認
識するものである。形状認識回路255cは、5×5画
素又は7×7画素のブロック毎に、そのブロック内の画
像データのレベルを最大値が「255」となるように補
正した後、「0」及び「255」のレベルの画像データ
或いは「0」〜「255」の数種類のレベルの画像デー
タを有するテンプレートとの2乗誤差計算等によるパタ
ーンマッチングにより、図14に示すように、細線部分
のパターンαと太線部分のパターンβとを検出する。こ
の検出結果は、色判別回路255dに入力される。な
お、パターンマッチングに代えて高周波成分検出処理に
より形状判別を行うようにしてもよい。
The shape recognizing circuit 255c recognizes whether an area constituting a character, a figure or the like is linear or planar. The shape recognition circuit 255c corrects the level of the image data in each block of 5 × 5 pixels or 7 × 7 pixels so that the maximum value becomes “255”, and then “0” and “255”. As shown in FIG. 14, a pattern α of a thin line portion and a pattern α of a thick line portion are obtained by performing a pattern matching by a square error calculation or the like with a template having image data of several levels or image data of several levels of “0” to “255”. Is detected. This detection result is input to the color determination circuit 255d. Note that the shape determination may be performed by high-frequency component detection processing instead of pattern matching.

【0072】色判別回路255dは、正規化演算回路2
55aで算出された正規化データ(xb,xg)、輝度演
算回路255bで算出された輝度データY及び形状認識
回路255cで認識されたパターン結果に基づき、図1
5〜図18に示す所定の閾値プロファイルを用いて各画
素位置の色判別(例えば白、黒、青、緑、橙、赤の色判
別)を行うものである。
The color discrimination circuit 255 d is
1 based on the normalized data (xb, xg) calculated in 55a, the brightness data Y calculated in the brightness calculation circuit 255b, and the pattern result recognized in the shape recognition circuit 255c.
The determination of the color of each pixel position (for example, the color determination of white, black, blue, green, orange, and red) is performed using a predetermined threshold profile shown in FIGS.

【0073】図15は、色判別用の輝度データにより有
彩色と無彩色との色判別を行うための閾値プロファイル
の第1の実施形態を示す図である。また、図16〜図1
8は、色判別用の輝度データにより有彩色と無彩色との
色判別を行うための閾値プロファイルの変形例で、それ
ぞれ第2〜第4の実施形態を示す図である。
FIG. 15 is a diagram showing a first embodiment of a threshold profile for performing color discrimination between a chromatic color and an achromatic color based on luminance data for color discrimination. 16 to FIG.
8 is a modified example of a threshold profile for performing color discrimination between a chromatic color and an achromatic color based on luminance data for color discrimination, and is a diagram illustrating second to fourth embodiments, respectively.

【0074】図15〜図18において、横軸は、xb-x
g平面における無彩色点Qからの距離情報を示し、縦軸
は、色判別用の輝度レベルを示している。
15 to 18, the horizontal axis represents xb-x
The distance information from the achromatic color point Q on the g plane is shown, and the vertical axis shows the luminance level for color discrimination.

【0075】なお、距離情報は、xb-xg平面での点Q
から正規化データ(xb,xg)の位置までの実際の距離
を示すものではなく、xr-xg-xb空間において無彩色
点(1/3,1/3,1/3)から等距離にある閉曲面をxb-xg
平面に射影して得られる等距離線(無彩色点Q(1/3,1
/3)を含む閉曲線)を特定するための距離の情報であ
る。
It should be noted that the distance information corresponds to the point Q on the xb-xg plane.
Does not indicate the actual distance from the position of the normalized data (xb, xg) to the achromatic point (1/3, 1/3, 1/3) in the xr-xg-xb space. Xb-xg for closed surface
Equidistant line (achromatic point Q (1/3, 1
/ 3) is the distance information for specifying the closed curve including).

【0076】ここで、距離情報について、簡単に説明す
ると、xb-xg平面における等距離線上の任意の正規化
データ(xb,xg)を同一距離にある一群のデータとし
て扱う場合、等距離線が無彩色点Q(1/3,1/3)を中心
とする円になるのであれば、距離情報としてxb-xg平
面における点Qから正規化データ(xb,xg)の位置ま
での実際の距離を採用することができる。
Here, the distance information will be briefly described. If arbitrary normalized data (xb, xg) on an equidistant line on the xb-xg plane is treated as a group of data at the same distance, the equidistant line is If it is a circle centered on the achromatic point Q (1/3, 1/3), the actual distance from the point Q on the xb-xg plane to the position of the normalized data (xb, xg) as distance information Can be adopted.

【0077】しかし、等距離線は、上述のようにxr-x
g-xb空間における無彩色点(1/3,1/3,1/3)から等距
離にある閉曲面をxb-xg平面に射影したもので、無彩
色点Q(1/3,1/3)を中心とする円でない同心状の閉曲
線となるから、点Qから正規化データ(xb,xg)の位
置までの実際の距離を距離情報とすることはできない。
However, the equidistant line is xr-x as described above.
A closed surface equidistant from the achromatic point (1/3, 1/3, 1/3) in the g-xb space is projected onto the xb-xg plane, and the achromatic point Q (1/3, 1 / Since the curve is a concentric closed curve that is not a circle centered on 3), the actual distance from the point Q to the position of the normalized data (xb, xg) cannot be used as distance information.

【0078】そこで、本実施の形態では、等距離線上に
ある正規化データ(xb,xg)について同一の距離情報
を与えるため、正規化データ(xb,xg)とそれが属す
る等距離線が一対一に対応することから、xb-xg平面
における等距離線の位置を定義する距離情報をその等距
離線上の正規化データ(xb,xg)の距離情報としてい
る。
Therefore, in the present embodiment, since the same distance information is given to the normalized data (xb, xg) on the equidistant line, the normalized data (xb, xg) and the equidistant line to which it belongs belong to a pair. Therefore, the distance information defining the position of the equidistant line on the xb-xg plane is set as the distance information of the normalized data (xb, xg) on the equidistant line.

【0079】正規化データ(xb,xg)が与えられた場
合、その正規化データ(xb,xg)に対する距離情報を
決定するには、その正規化データ(xb,xg)が属する
等距離線を決定する必要がある。しかし、必ずしもxr-
xg-xb空間における無彩色点(1/3,1/3,1/3)を中心
に同心状に形成される複数の等距離面をxb-xg平面に
射影してなる複数の等距離線の中の正規化データ(x
b,xg)が属する等距離線を決定する必要はない。なぜ
なら、正規化データ(xb,xg)の距離情報は、所定の
閾値との相対比較による色判別に使用するものであるか
ら、相対的な距離情報で無彩色点Q(1/3,1/3)からの
正規化データ(xb,xg)の位置が特定できればよいか
らである。
Given the normalized data (xb, xg), to determine the distance information for the normalized data (xb, xg), the equidistant line to which the normalized data (xb, xg) belongs is determined by You need to decide. However, xr-
A plurality of equidistant lines formed by projecting a plurality of equidistant surfaces formed concentrically around an achromatic point (1/3, 1/3, 1/3) in the xg-xb space onto the xb-xg plane In the normalized data (x
It is not necessary to determine the equidistant line to which (b, xg) belongs. Because the distance information of the normalized data (xb, xg) is used for color discrimination by relative comparison with a predetermined threshold value, the achromatic point Q (1/3, 1 / This is because the position of the normalized data (xb, xg) from 3) may be specified.

【0080】与えられた正規化データ(xb,xg)に対
して等距離線から相対的な距離情報を決定するとすれ
ば、等距離線としては、その正規化データ(xb,xg)
とこれ以外の等距離線上にある複数の正規化データ(x
b,xg)とにより決定される特定形状の閉曲線を採用す
ることができる。
If the relative distance information is determined from the equidistant line for the given normalized data (xb, xg), the normalized data (xb, xg)
And a plurality of normalized data (x
b, xg) can be used.

【0081】一方、xr-xb-xg空間において、成分を
相互に入れ換えた6個の正規化データ(xr,xb,x
g),(xb,xg,xr),…は、無彩色点(1/3,1/3,
1/3)から等距離にあり、これらの正規化データをxb-
xg平面に射影した点は、xb-xg平面において等距離線
を構成するから、等距離線として採用し得る形状は、少
なくとも与えられた正規化データ(xb,xg)とこの正
規化データの成分を相互に入れ換えて生成される他の5
個の正規化データ(xr,xb),(xr,xg),(x
b,xr),(xg,xr),(xg,xb)とにより構成さ
れるものでなければならない。
On the other hand, in the xr-xb-xg space, six normalized data (xr, xb, x
g), (xb, xg, xr), ... are achromatic points (1/3, 1/3,
1/3) equidistant from the
Since the points projected on the xg plane form equidistant lines on the xb-xg plane, the shape that can be adopted as the equidistant lines is at least the given normalized data (xb, xg) and the components of the normalized data. Other 5 generated by exchanging
Pieces of normalized data (xr, xb), (xr, xg), (x
b, xr), (xg, xr), (xg, xb).

【0082】従って、xb-xg平面上おいては、3個の
成分を相互に入れ換えて生成されるxb-xg平面上の6
個の正規化データ(xb,xg),(xr,xb),(x
r,xg),(xb,xr),(xg,xr),(xg,xb)
を通る任意の形状を等距離線の特定形状とすることがで
きる。
Accordingly, on the xb-xg plane, six components on the xb-xg plane generated by exchanging the three components with each other are shown.
Pieces of normalized data (xb, xg), (xr, xb), (x
r, xg), (xb, xr), (xg, xr), (xg, xb)
The arbitrary shape passing through can be a specific shape of the equidistant line.

【0083】図19は、成分を相互に入れ換えた6個の
正規化データのxb-xg平面上の位置関係の一例を示す
図である。
FIG. 19 is a diagram showing an example of the positional relationship on the xb-xg plane of six normalized data obtained by exchanging components.

【0084】同図に示すP1(1/2,1/3),P2(1/
2,1/6),P3(1/3,1/6),P1′(1/3,1/2),P
2′(1/6,1/2),P3′(1/6,1/3)の各点は、点P
1に対する正規化データxr(=1/6),xg(=1/2),
xb(=1/3)の成分を相互に入れ換えて生成される5個
の正規化データをxb-xg平面上にプロットしたもので
ある。同図から明らかなように、点P1′,P2′,P
3′は、それぞれ点P1,P2,P3の直線L(原点と
点Qとを結ぶ直線)に対する線対称点となっている。ま
た、点P3,P3′は、それぞれ点P1,P1′の直線
L′(点Qを通る直線Lに直交する直線)に対する線対
称点となっている。このような点P1〜P3,P1′〜
P3′の対称性は、xr+xb+xg=1の関係を有する
成分を相互に入れ換えて各点の正規化データが決定され
ていることに基づくものである。
P1 (1/2, 1/3) and P2 (1/1) shown in FIG.
2, 1/6), P3 (1/3, 1/6), P1 '(1/3, 1/2), P
Each point of 2 '(1/6, 1/2) and P3' (1/6, 1/3) is the point P
1, normalized data xr (= 1/6), xg (= 1/2),
The five normalized data generated by exchanging the components of xb (= 1/3) are plotted on the xb-xg plane. As is clear from the figure, the points P1 ', P2', P
3 'is a line symmetrical point with respect to a straight line L (a straight line connecting the origin and the point Q) of the points P1, P2 and P3. The points P3 and P3 'are symmetrical points with respect to the straight line L' of the points P1 and P1 '(a straight line orthogonal to the straight line L passing through the point Q). Such points P1 to P3, P1 '
The symmetry of P3 'is based on the fact that the components having the relationship of xr + xb + xg = 1 are exchanged with each other to determine the normalized data of each point.

【0085】従って、点P1の属する等距離線は、点P
1〜P3,P1′〜P3′を通り、かつ、直線L,L′
に対して対称性を有する形状でなければならないが、こ
のような形状としては、例えば図20に示す楕円C1、
図21に示す二等辺三角形C2、又は図22に示す六角
形C3などが考えられる。
Therefore, the equidistant line to which point P1 belongs is the point P
1 to P3, P1 'to P3', and straight lines L, L '
Must be symmetrical with respect to the shape, such as an ellipse C1 shown in FIG.
An isosceles triangle C2 shown in FIG. 21 or a hexagon C3 shown in FIG. 22 can be considered.

【0086】等距離線の形状が特定されると、その形状
の等距離線について無彩色点Q(1/3,1/3)からの距離
の算出方法を決定しておけば、正規化データ(xb,x
g)からその正規化データ(xb,xg)が属する特定形
状の等距離線を算出し、更にその等距離線について無彩
色点Q(1/3,1/3)からの距離を算出することにより、
与えられた正規化データ(xb,xg)に対する距離情報
を決定することができる。
When the shape of the equidistant line is specified, if the method of calculating the distance from the achromatic point Q (1/3, 1/3) is determined for the equidistant line, the normalized data (Xb, x
calculating the equidistant line of the specific shape to which the normalized data (xb, xg) belongs from g), and further calculating the distance from the achromatic point Q (1/3, 1/3) for the equidistant line By
Distance information for the given normalized data (xb, xg) can be determined.

【0087】図20〜図22の例では、各等距離線の無
彩色点Q(1/3,1/3)からの距離として、例えば直線L
と等距離線C1,C2,C3との交点P4と点Qとの距
離dを取ることができる。この距離dは、閉曲線として
楕円C1を採用した場合は、楕円C1の中心Qから最近
接点までの距離(短軸長の1/2)であり、閉曲線とし
て二等辺三角形C2を採用した場合は、点Qから斜辺の
中点までの距離である。
In the examples shown in FIGS. 20 to 22, the distance from the achromatic point Q (1/3, 1/3) of each equidistant line, for example, a straight line L
The distance d between the point P4 and the point Q at the point of intersection of the equidistant lines C1, C2 and C3 can be taken. This distance d is the distance from the center Q of the ellipse C1 to the closest point (1 / of the short axis length) when the ellipse C1 is adopted as the closed curve, and when the isosceles triangle C2 is adopted as the closed curve, This is the distance from the point Q to the midpoint of the hypotenuse.

【0088】なお、等距離線C2とC3とは形状は異な
るが、点P3,P3′を通る斜辺は同一であるから、点
Qからの距離dは同一となる。従って、距離情報を考え
る上では等距離線C2とC3とは実施的に同一である。
Although the equidistant lines C2 and C3 have different shapes, the oblique sides passing through the points P3 and P3 'are the same, so that the distance d from the point Q is the same. Therefore, when considering the distance information, the equidistant lines C2 and C3 are practically the same.

【0089】本実施の形態では、正規化データ(xb,
xg)から距離情報dを直接、算出する演算テーブルを
設け、正規化データ(xb,xg)が算出されると、この
演算テーブル用いて直接、距離情報dを算出するように
している。
In this embodiment, the normalized data (xb,
An operation table for directly calculating the distance information d from xg) is provided. When the normalized data (xb, xg) is calculated, the distance information d is directly calculated using this operation table.

【0090】図15に戻り、同図に示す閾値プロファイ
ルは、無彩色位置から距離情報d1内の近傍領域を無彩
色領域Swとし、この領域Sw内では白色と黒色との判
別閾値を固定値Y2とし、無彩色領域外では有彩色と黒
色との判別閾値を固定値Y1、有彩色と白色との判別閾
値を固定値Y3(Y1<Y2<Y3)としたものであ
る。
Returning to FIG. 15, the threshold profile shown in FIG. 15 is such that an area in the distance information d1 from the achromatic position is defined as an achromatic area Sw, and in this area Sw, the threshold value for determining white and black is a fixed value Y2. Outside the achromatic region, the threshold value for determining chromatic color and black is fixed at Y1, and the threshold value for determining chromatic color and white is fixed at Y3 (Y1 <Y2 <Y3).

【0091】この閾値プロファイルでは、正規化データ
(xb,xg)の位置が距離情報d1の等距離線の内部に
位置しているときは(d≦d1)、輝度レベルYと閾値
Y2とを比較し、Y≧Y2であれば、白色と判別され、
Y<Y2であれば、黒色と判別される。また、正規化デ
ータ(xb,xg)の位置が距離情報d1の等距離線より
外側に位置しているときは(d>d1)、輝度レベルY
と閾値Y1,Y3とを比較し、Y>Y3であれば、白色
と判別され、Y<Y1であれば、黒色と判別され、Y3
≧Y≧Y1であれば、有彩色と判別される。そして、有
彩色の場合は、更に上述した正規化データ(xb,xg)
の位置により、例えば青,緑,橙,赤の4色の色判別が
行われる。
In this threshold profile, when the position of the normalized data (xb, xg) is located inside the equidistant line of the distance information d1 (d ≦ d1), the luminance level Y is compared with the threshold Y2. If Y ≧ Y2, it is determined that the color is white,
If Y <Y2, it is determined to be black. When the position of the normalized data (xb, xg) is located outside the equidistant line of the distance information d1 (d> d1), the luminance level Y
Are compared with the threshold values Y1 and Y3. If Y> Y3, the color is determined to be white. If Y <Y1, the color is determined to be black.
If ≧ Y ≧ Y1, it is determined to be chromatic. In the case of a chromatic color, the above-described normalized data (xb, xg)
, Four colors, for example, blue, green, orange, and red are determined.

【0092】図16に示す閾値プロファイルは、図15
において、正規化データ(xb,xg)の位置が距離情報
d1の等距離線より外側にあるときの有彩色と白色又は
黒色との判別閾値をY1,Y3からY1,Y3,Y4,
Y5(Y3>Y4>Y1>Y5>Y2)にそれぞれ2段
階に増加させたものである。この閾値プロフィルでは、
正規化データ(xb,xg)の位置が距離情報d1の等距
離線と距離情報d2の等距離線との間にあるとき(d2
>d>d1)、Y>Y4であれば、白色と判別され、Y
<Y5であれば、黒色と判別され、Y4≧Y≧Y5であ
れば、有彩色と判別される。また、正規化データ(x
b,xg)の位置が距離情報d2の等距離線と距離情報d
3の等距離線との間にあるとき(d3>d>d2)、Y
>Y3であれば、白色と判別され、Y<Y5であれば、
黒色と判別され、Y3≧Y≧Y5であれば、有彩色と判
別される。更に、正規化データ(xb,xg)の位置が距
離情報d2の等距離線と距離情報d3の等距離線との間
にあるとき(d>d3)、Y>Y3であれば、白色と判
別され、Y<Y2であれば、黒色と判別され、Y3≧Y
≧Y2であれば、有彩色と判別される。
The threshold profile shown in FIG.
, The threshold value for determining the chromatic color and white or black when the position of the normalized data (xb, xg) is outside the equidistant line of the distance information d1 is Y1, Y3 to Y1, Y3, Y4.
Y5 (Y3>Y4>Y1>Y5> Y2) is increased in two steps. In this threshold profile,
When the position of the normalized data (xb, xg) is between the equidistant line of the distance information d1 and the equidistant line of the distance information d2 (d2
>D> d1) and if Y> Y4, it is determined to be white and Y
If <Y5, it is determined to be black, and if Y4 ≧ Y ≧ Y5, it is determined to be chromatic. Also, normalized data (x
b, xg) is the equidistant line of the distance information d2 and the distance information d
3 (d3>d> d2), Y
> Y3, it is determined to be white, and if Y <Y5,
The color is determined to be black, and if Y3 ≧ Y ≧ Y5, the color is determined to be chromatic. Further, when the position of the normalized data (xb, xg) is between the equidistant line of the distance information d2 and the equidistant line of the distance information d3 (d> d3), if Y> Y3, it is determined to be white. If Y <Y2, black is determined and Y3 ≧ Y
If ≧ Y2, it is determined to be a chromatic color.

【0093】図17に示す閾値プロファイルは、図16
において、正規化データ(xb,xg)の位置が距離情報
d1の等距離線と距離情報d2の等距離線との間にある
ときの有彩色と白色の判別閾値をY4からY3までリニ
アに変化させ、正規化データ(xb,xg)の位置が距離
情報d1の等距離線と距離情報d3の等距離線との間に
あるときの有彩色と黒色の判別閾値をY5からY2まで
リニアに変化させたものである。
The threshold profile shown in FIG.
In, when the position of the normalized data (xb, xg) is between the equidistant line of the distance information d1 and the equidistant line of the distance information d2, the threshold for determining the chromatic color and white linearly changes from Y4 to Y3. When the position of the normalized data (xb, xg) is between the equidistant line of the distance information d1 and the equidistant line of the distance information d3, the chromatic / black discrimination threshold is linearly changed from Y5 to Y2. It was made.

【0094】また、図18に示す閾値プロファイルは、
図16において、正規化データ(xb,xg)の位置が距
離情報d1の等距離線と距離情報d2の等距離線との間
にあるときの有彩色と白色の判別閾値をY4からY3ま
でノンリニア(単調増加)に変化させ、正規化データ
(xb,xg)の位置が距離情報d1の等距離線と距離情
報d3の等距離線との間にあるときの有彩色と黒色の判
別閾値をY5からY2までノンリニア(単調減少)に変
化させたものである。
The threshold profile shown in FIG.
In FIG. 16, when the position of the normalized data (xb, xg) is between the equidistant line of the distance information d1 and the equidistant line of the distance information d2, the chromatic and white discrimination thresholds are non-linear from Y4 to Y3. (Monotone increase), and the chromatic / black discrimination threshold when the position of the normalized data (xb, xg) is between the equidistant line of the distance information d1 and the equidistant line of the distance information d3 is Y5. To Y2 in a non-linear (monotonically decreasing) manner.

【0095】なお、図15〜図18は閾値プロファイル
の代表例を示したもので、これ以外の閾値プロファイル
を任意に採用することができるものである。
FIGS. 15 to 18 show typical examples of threshold profiles, and other threshold profiles can be arbitrarily adopted.

【0096】図15〜図18に示す閾値プロファイルに
おいて、xb-xg平面における正規化データ(xb,x
g)の位置から、青,緑,橙,赤の4色の色判別を行う
場合は、図23に示すように、楕円Sb,Sg,So,Sr
を基にして分割線m1,m2,m3,m4を設けて三角
形のxg-xb平面を4つの領域Ab,Ag,Ao,Arに分
割し、正規化データ(xb,xg)の位置が4つの領域A
b,Ag,Ao,Ar(領域Swを除く。)のいずれに入っ
ているかで、色判別が行われる。例えば正規化データの
座標(xb,xg)が領域Ab内に入っていれば、その画
素位置は青系統の色と判別され、領域Ag内に入ってい
れば、その画素位置は緑系統の色と判別される。
In the threshold profiles shown in FIGS. 15 to 18, normalized data (xb, xb) on the xb-xg plane
When the four colors of blue, green, orange, and red are determined from the position g), ellipses Sb, Sg, So, and Sr are used as shown in FIG.
And dividing the triangle xg-xb plane into four regions Ab, Ag, Ao, and Ar by providing dividing lines m1, m2, m3, and m4, and setting the position of the normalized data (xb, xg) to four Area A
Color discrimination is performed depending on which of b, Ag, Ao, and Ar (excluding the area Sw). For example, if the coordinates (xb, xg) of the normalized data are within the region Ab, the pixel position is determined to be a blue-based color, and if the coordinate is within the region Ag, the pixel position is determined to be a green-based color. Is determined.

【0097】分割線m1,m2,m3,m4は、色領域
設定演算部32で設定され、図23における点Pb,P
g,Po,Prを、それぞれ色登録された、或いは予め設
定された青,緑,橙,赤の画像データ(デフォルト値)
の正規データの座標位置とすると、例えば∠PbQPg,
∠PgQPo,∠PoQPr,∠PrQPbの二等分線や△P
bQPg,△PgQPo,△PoQPr,△PrQPbの点Qと
対辺の中点とを結ぶ中線として設定される。なお、上述
のように、本実施の形態に係るデジタルカメラ1では、
判別すべき色を青,緑,橙,赤の4色の範囲で任意に設
定できるようになっているので、例えば図3に示す例の
ように、色認識表示部17の色使用欄で橙色が「OF
F」に設定されている場合は、「ON」に設定されてい
る青,緑,赤の3色について分割線m1,m2,m3が
設定され、3色について色判別が行われる。この場合、
分割線m3は、∠PgQPrの二等分線や△PgQPrの点
Qと対辺の中点とを結ぶ中線として設定される。
The division lines m1, m2, m3, and m4 are set by the color area setting calculation unit 32, and the points Pb and Pb in FIG.
g, Po, and Pr are color-registered or preset blue, green, orange, and red image data (default values)
For example, assuming the coordinate position of the regular data of ∠PbQPg,
The bisector of ∠PgQPo, ∠PoQPr, ∠PrQPb or △ P
It is set as a middle line connecting the point Q of bQPg, △ PgQPo, △ PoQPr, △ PrQPb and the midpoint of the opposite side. As described above, in the digital camera 1 according to the present embodiment,
Since the color to be discriminated can be arbitrarily set in the range of four colors of blue, green, orange and red, for example, as shown in FIG. "OF
If "F" is set, division lines m1, m2, and m3 are set for the three colors of blue, green, and red set to "ON", and color discrimination is performed for the three colors. in this case,
The dividing line m3 is set as a bisector of ∠PgQPr or a middle line connecting the point Q of △ PgQPr and the midpoint of the opposite side.

【0098】色判別回路225dは、形状認識回路25
5cから入力されるパターン結果が一定であれば、予め
設定された閾値プロファイルを固定的に利用して色判別
を行うが、形状認識回路255cから入力されるパター
ン結果が変化する場合は、以下に説明するように、パタ
ーン結果の変化に応じて閾値プロファイルを全体的に、
或いは部分的に上下させるように補正した閾値プロファ
イルを用いて対応する領域の色判別を行う。これは、文
字等を構成する線幅の広狭に応じて閾値プロファイルを
全体的又は部分的に上下させることにより、線幅の変化
に関らず好適な線幅の画像が得られるようにするためで
ある。
The color discriminating circuit 225d includes the shape recognizing circuit 25.
If the pattern result input from the shape recognition circuit 255c changes, the color determination is performed using a preset threshold profile in a fixed manner. As explained, the threshold profile is changed as a whole according to the change of the pattern result.
Alternatively, the color of the corresponding region is determined using the threshold profile corrected so as to be partially moved up and down. This is because the threshold profile is entirely or partially raised or lowered according to the width of the line constituting a character or the like, so that an image having a preferable line width can be obtained regardless of a change in the line width. It is.

【0099】図24は、線幅の広狭の相違に基づく濃度
レベルの変化の一例を示す図である。
FIG. 24 is a diagram showing an example of a change in density level based on a difference in line width.

【0100】同図は、ホワイトボード撮影画像の四角形
で囲まれた数字の「1」の文字部分36の直線M上の画
像データの濃度レベルを示すものである。文字部分36
の上部に描かれたグラフは、濃度レベルを示している。
直線MのA,Cの部分は、四角形の線幅に相当する部分
(細線部分)であり、Bは、数字「1」の線幅に相当す
る部分(太線部分)である。A,Cは細線部分であり、
Bは太線部分であるから、A,Cの濃度レベルは、Bの
濃度レベルより高くなっている。すなわち、細線部分
は、太線部分より白っぽくなっている。
This figure shows the density level of the image data on the straight line M of the character portion 36 of the numeral "1" surrounded by the square of the whiteboard photographed image. Character part 36
The graph drawn on top of indicates the concentration level.
The portions A and C of the straight line M are portions corresponding to the square line width (thin line portion), and the portion B is the portion corresponding to the line width of the numeral “1” (thick line portion). A and C are thin line portions,
Since B is a thick line portion, the density levels of A and C are higher than the density level of B. That is, the thin line portion is whiter than the thick line portion.

【0101】図25は、図24の直線M上の画像データ
に対して閾値プロファイルを用いて白黒判別を行ったも
のである。
FIG. 25 shows black and white discrimination of image data on the straight line M in FIG. 24 using a threshold profile.

【0102】例えば図18に示す形の閾値プロファイル
を用いたとして、同図(a)は、図26の閾値レベルの
高い閾値プロフィルを用いて白黒判別を行ったもので
あり、同図(b)は、図26の閾値レベルの低い閾値プ
ロフィルを用いて白黒判別を行ったものである。ま
た、同図(c)は、線幅に応じて閾値プロフィル,
を使い分けて白黒判別を行ったものである。
For example, assuming that a threshold profile having the form shown in FIG. 18 is used, FIG. 26A shows a case where black and white discrimination is performed using the threshold profile having a high threshold level shown in FIG. 26, and FIG. In FIG. 26, black-and-white discrimination is performed by using a threshold profile having a low threshold level in FIG. FIG. 3C shows a threshold profile according to the line width.
Are used for black and white determination.

【0103】閾値レベルの高い閾値プロフィルを用い
た場合は、太線部分Bは好適な線幅となるが、細線部分
A,Cは閾値レベルY1より高くなるので、白色に誤判
別され、四角形の図形が飛んでしまうことになる。一
方、閾値レベルの低い閾値プロフィルを用いた場合
は、細線部分A,Cは好適な線幅となるが、太線部分B
は、輪郭部分の画像データも閾値レベルY1′より低く
なり、線幅が必要以上に太くなってしまうことになる。
このように、線幅の広狭がある場合、固定的な閾値プロ
フィルでは一方の線幅に対しては適切であっても他方の
線幅に対しては不適切となることが多く、線幅に関係な
く適切な白黒判別を行うことは困難となる。
When a threshold profile having a high threshold level is used, the thick line portion B has a suitable line width, but the thin line portions A and C are higher than the threshold level Y1, so that they are erroneously determined to be white and have a rectangular figure. Will fly away. On the other hand, when a threshold profile having a low threshold level is used, the thin line portions A and C have an appropriate line width, but the thick line portion B
Means that the image data of the outline portion also becomes lower than the threshold level Y1 ', and the line width becomes unnecessarily thick.
As described above, when the line width is large or small, a fixed threshold profile is often inappropriate for one line width but inappropriate for the other line width. Irrespective of this, it is difficult to perform appropriate black-and-white discrimination.

【0104】そこで、本実施の形態では、同図(c)に
示すように、線幅を判別し、その判別結果に応じて閾値
プロフィル,を切り換えることにより好適な線幅が
得られるようにしている。従って、色判別回路225d
は、形状認識回路255cから入力される判別結果がパ
ターンαのときは、閾値プロフィルを用いて白黒判別
を行い、判別結果がパターンβのときは、閾値プロフィ
ルを閾値プロフィルに切り換えて白黒判別を行う。
Therefore, in the present embodiment, as shown in FIG. 10C, the line width is determined, and the threshold profile is switched according to the result of the determination so that a suitable line width can be obtained. I have. Therefore, the color determination circuit 225d
When the determination result input from the shape recognition circuit 255c is the pattern α, black-and-white determination is performed using the threshold profile, and when the determination result is the pattern β, the threshold profile is switched to the threshold profile to perform black-white determination. .

【0105】なお、この白黒判別における閾値プロフィ
ルの補正は、上述のように、予め設定された複数の閾値
プロファイルを線幅の判別結果に応じて切換設定するよ
うにしてもよいが、標準の閾値プロフィルを線幅の判別
結果に応じた所定レベルだけ全体的に、或いは部分的に
上下にシフトさせて設定するようにしてもよい。
As described above, the correction of the threshold profile in the black-and-white determination may be performed by switching a plurality of preset threshold profiles in accordance with the determination result of the line width. The profile may be entirely or partially shifted up and down by a predetermined level according to the line width determination result.

【0106】図6に戻り、黒領域補正部256は、色の
誤判別により有彩色が含まれる黒領域を有彩色を含まな
い黒一色に補正するものである。
Returning to FIG. 6, the black area correction unit 256 corrects a black area containing a chromatic color to a single black color not containing a chromatic color by erroneously determining the color.

【0107】図15〜図18に示す閾値プロファイルを
用いて色判別を行う場合、無彩色と有彩色との判別閾値
である距離情報d1を高く設定すると、比較的色の濃い
有彩色(すなわち、輝度の低い有彩色)は黒色に、ま
た、比較的色の淡い有彩色(すなわち、輝度の高い有彩
色)は白色に誤判別され易くなる。このため、このよう
な誤判別を防止するため、距離情報d1は低めに設定す
るのが望ましい。
When performing color discrimination using the threshold profiles shown in FIGS. 15 to 18, if the distance information d1, which is the threshold for discriminating between achromatic colors and chromatic colors, is set high, chromatic colors with relatively dark colors (ie, A chromatic color with a low luminance is likely to be erroneously determined to be black, and a chromatic color with a relatively pale color (ie, a chromatic color having a high luminance) is likely to be erroneously determined to be white. Therefore, in order to prevent such erroneous determination, it is desirable to set the distance information d1 lower.

【0108】しかし、距離情報d1を低めに設定した閾
値プロファイルを用いた場合は、黒色が有彩色に誤判別
され、図27に示すように、黒一色の領域が有彩色の混
じった斑模様の領域となることがある。黒色領域が斑模
様の領域となり易くなる原因は、黒色の画像データはレ
ベルが低いため、正規化データxb,xgがxb/xg=
1となることは少なく、正規化データ(xb,xg)の
位置が無彩色領域Sw外になり易いということ、また、
ある程度大きな領域で画像データの平均では黒色となる
場合、その領域内に、例えば黒色を青色と誤判別した画
素位置の近傍には黒色を赤や緑や橙等と誤判別した画素
位置が存在する可能性が高いということに基づくもので
ある。
However, when a threshold profile in which the distance information d1 is set to a low value is used, black is erroneously determined to be chromatic, and as shown in FIG. May be an area. The reason that the black area tends to become a mottled area is that the level of the black image data is low, so that the normalized data xb and xg are xb / xg =
1 is rare, and the position of the normalized data (xb, xg) is likely to be outside the achromatic region Sw.
When the average of the image data is black in a certain large area, there is a pixel position in which black is erroneously determined as red, green, orange, or the like, for example, near a pixel position in which black is erroneously determined to be blue. It is based on the high possibility.

【0109】文字、図形等を構成する比較的広い黒領域
が斑模様の領域になると、著しく見辛い画像となる。黒
領域補正部256は、斑模様の領域を黒領域に変換し、
斑模様に起因する画質不良を低減するもので、同色画素
数計数回路256a、分散度演算回256b及び黒判別
回路256cを備えている。
When a relatively large black area constituting a character, a figure, or the like becomes a mottled area, the image becomes extremely hard to see. The black area correction unit 256 converts the mottled area into a black area,
It reduces the image quality defect caused by the spot pattern, and includes a same-color pixel number counting circuit 256a, a dispersion degree calculation circuit 256b, and a black discrimination circuit 256c.

【0110】同色画素数計数回路256aは、ブロック
内の同一色の画素数をカウントする回路である。ブロッ
クサイズを5×5画素とし、各画素位置の色分布が、例
えば図28に示すようになっている場合、同色画素数計
数回路256aは、赤,青,橙,緑,黒の各色について
ブロック内に存在する画素数をカウントする。赤,青,
橙,緑,黒の各色の画素数をNr,Nb,No,Ng,Nb
k、これらの合計をNtをとすると、同図(a)の例で
は、Nr=17,Nb=2,No=3,Ng=1,Nbk=
2,Nt=25がカウントされ、同図(b)の例では、
Nr=4,Nb=4,No=5,Ng=6,Nbk=4,Nt
=23がカウントされる。なお、(b)の例では、ブロ
ック内に白色の画素が2個含まれているが、これらの画
素は黒領域補正処理では無視される。
The same color pixel count circuit 256a is a circuit for counting the number of pixels of the same color in a block. When the block size is 5 × 5 pixels and the color distribution at each pixel position is as shown in FIG. 28, for example, the same-color pixel number counting circuit 256a performs block processing for each color of red, blue, orange, green, and black. Is counted. Red and blue,
The number of pixels of each color of orange, green, and black is represented by Nr, Nb, No, Ng, Nb.
Assuming that k and Nt are the sum of these, in the example of FIG. 9A, Nr = 17, Nb = 2, No = 3, Ng = 1, and Nbk =
2, Nt = 25 is counted, and in the example of FIG.
Nr = 4, Nb = 4, No = 5, Ng = 6, Nbk = 4, Nt
= 23 is counted. In the example of (b), two white pixels are included in the block, but these pixels are ignored in the black area correction processing.

【0111】分散度演算回路256bは、赤,青,橙,
緑,黒の各色の画素数Nr,Nb,No,Ng,Nbk及びこ
れらの合計Ntを用いて、各ブロックの色の分散度pを
演算するものである。分散度pは、p=(白以外の色の
画素数)/Σ(各色の画素数)2=Nt/(Nr2+Nb2
No2+Ng2+Nbk2)の演算式で算出される。なお、こ
の分散度pは、分散の演算式の逆数である。図28
(a)の例では、p=23/(42+42+52+62+4
2)=0.211が算出され、同図(b)の例では、p
=25/(172+22+32+12+22)=0.081
が算出される。
The dispersion degree calculation circuit 256b includes red, blue, orange,
The number of pixels Nr, Nb, No, Ng, Nbk of each color of green and black and the total Nt thereof are used to calculate the degree of dispersion p of the color of each block. The degree of dispersion p is p = (number of pixels of colors other than white) / Σ (number of pixels of each color) 2 = Nt / (Nr 2 + Nb 2 +
No 2 + Ng 2 + Nbk 2 ). The degree of dispersion p is the reciprocal of the variance operation formula. FIG.
In the example of (a), p = 23 / (4 2 +4 2 +5 2 +6 2 +4
2 ) = 0.111 is calculated, and in the example of FIG.
= 25 / (17 2 + 2 2 + 3 2 + 1 2 + 2 2) = 0.081
Is calculated.

【0112】黒判別回路256cは、分散度演算回路2
56bで算出された分散度pを用いて各ブロックの中心
位置の画素が黒色であるか否かを判別するものである。
すなわち、黒判別回路256cは、予め設定された閾値
K1と分散度pとを比較し、p>K1であれば、黒色と
判別し、p≦K1であれば、有彩色と判別する。例えば
K1=0.1とすると、図28(a)の例は、黒色と判
別され、同図(b)の例は、有彩色と判別される。な
お、図28(b)の例では、各色の画素数から圧倒的に
赤が多いので、中心位置の画素は「赤」と判別すること
ができる。
The black discrimination circuit 256 c is
It is determined whether or not the pixel at the center position of each block is black using the degree of dispersion p calculated in 56b.
That is, the black determination circuit 256c compares the preset threshold value K1 with the degree of dispersion p and determines that the color is black if p> K1, and determines that the color is chromatic if p ≦ K1. For example, if K1 = 0.1, the example of FIG. 28A is determined to be black, and the example of FIG. 28B is determined to be chromatic. In the example of FIG. 28B, since the number of pixels of each color is overwhelmingly red, the pixel at the center can be determined to be “red”.

【0113】図29は、黒領域補正部256の補正処理
の手順を示すフローチャートである。
FIG. 29 is a flowchart showing the procedure of the correction process of the black area correction unit 256.

【0114】色判別部255から出力される色判別結果
は、黒領域補正部256内の図略のメモリに格納され、
図29のフローチャートに従って黒領域の補正処理が行
われる。すなわち、まず、メモリから左上隅の1ブロッ
ク分(5×5画素分)の色判別データが読み出され(#
10)、そのブロック内に含まれる白色以外の各色の画
素数とその合計数がカウントされる(#12)。判別色
を赤,青,橙,緑,黒とすると、各色の画素数Nr,N
b,No,Ng,Nbkとこれらの合計数Ntがカウントされ
る。
The color discrimination result output from the color discrimination unit 255 is stored in a memory (not shown) in the black area correction unit 256.
The correction processing of the black area is performed according to the flowchart of FIG. That is, first, the color determination data for one block (5 × 5 pixels) at the upper left corner is read from the memory (#
10), the number of pixels of each color other than white included in the block and the total number thereof are counted (# 12). Assuming that the discrimination colors are red, blue, orange, green, and black, the number of pixels Nr, N
b, No, Ng, Nbk and their total number Nt are counted.

【0115】続いて、分散度p(=Nt/(Nr2+Nb2
+No2+Ng2+Nbk2))が演算され(#14)、この
分散度pと所定の閾値K1とを比較してそのブロックの
中心の画素が黒色である否かが判別される(#16)。
p>K1であれば(#16でYES)、ブロック中心の
画素位置(そのブロックの3行3列目の画素位置)の色
判別データを黒色のデータに変更することが記憶される
(#18)。一方、p≦K1であれば(#16でYE
S)、上述のデータ変更の指示は行われない。
Subsequently, the degree of dispersion p (= Nt / (Nr 2 + Nb 2)
+ No 2 + Ng 2 + Nbk 2 )) is calculated (# 14), and the variance p is compared with a predetermined threshold K1 to determine whether or not the pixel at the center of the block is black (# 16). .
If p> K1 (YES in # 16), it is stored that the color determination data at the pixel position at the center of the block (the pixel position in the third row and third column of the block) is changed to black data (# 18). ). On the other hand, if p ≦ K1 (YE in # 16)
S), the data change instruction is not issued.

【0116】続いて、色判別データ全体に対する上記処
理が終了したか否かが判別され(#20)、処理が終了
していなければ(#20でNO)、ブロックの読出位置
を1画素分だけ横方向にシフトして(#22)、ステッ
プ#10に戻り、上述の黒判別処理が行われる(#10
〜#20)。以下、ブロックの読出位置をラスタ方向に
1画素分ずつシフトしつつ、各画素位置の色判別データ
について黒判別処理が行われ(#10〜#22のルー
プ)、色判別データ全体に対する黒判別処理が終了する
と(#20でYES)、色判別データを黒色のデータに
変更するように指示された画素位置の色判別データが黒
色のデータに変更され(#24)、処理を終了する。
Subsequently, it is determined whether or not the above processing for the entire color determination data has been completed (# 20). If the processing has not been completed (NO in # 20), the read position of the block is set to one pixel. Shifting in the horizontal direction (# 22), the process returns to step # 10, and the above-described black determination processing is performed (# 10).
~ # 20). Hereinafter, while the readout position of the block is shifted by one pixel in the raster direction, black determination processing is performed on the color determination data at each pixel position (loop of # 10 to # 22), and black determination processing is performed on the entire color determination data. Is completed (YES in # 20), the color determination data at the pixel position instructed to change the color determination data to black data is changed to black data (# 24), and the process ends.

【0117】なお、本実施の形態では、黒領域補正処理
の1ブロックの大きさを5×5画素としたが、1ブロッ
クのサイズはこれに限定されるものではなく、処理精度
や処理速度を考慮して任意の適宜のサイズを設定するこ
とができる。また、色の分散具合を計るものとして分散
度pを定義したが、色のバラツキを表し得るものであれ
ば、他の演算式を定義してもよい。例えば標準偏差σ=
1/√(p)を用いてもよい。
In the present embodiment, the size of one block in the black area correction processing is set to 5 × 5 pixels. However, the size of one block is not limited to this, and processing accuracy and processing speed are reduced. Any appropriate size can be set in consideration of this. Further, although the degree of dispersion p is defined as a measure of the degree of dispersion of colors, other arithmetic expressions may be defined as long as they can represent color dispersion. For example, standard deviation σ =
1 / √ (p) may be used.

【0118】また、青,緑,橙,赤,黒の各色を、例え
ばそれぞれ(0,1,0,0)、(0,0,1,0)、
(0,0,0,1)、(1,0,0,0)、(1,1,
1,1)のようにベクトル表現した場合、ブロック内の
ベクトル平均のベクトル長の逆数を分散の度合いを示す
ものとしてもよい。なお、ベクトル表現は、各色独立で
も、「赤と橙は近似した色」というように情報を加味し
たものでもよい。また、4次元に限定されず、任意の次
元を考えることができる。
The colors of blue, green, orange, red, and black are represented by, for example, (0, 1, 0, 0), (0, 0, 1, 0),
(0,0,0,1), (1,0,0,0), (1,1,
When a vector is expressed as in (1, 1), the reciprocal of the vector length of the average of the vectors in the block may indicate the degree of dispersion. Note that the vector expression may be independent of each color or may be one in which information such as "red and orange are similar colors" is added. Further, the present invention is not limited to four dimensions, and any dimension can be considered.

【0119】また、簡単な方法として、ブロックの中心
位置に隣接する8個の画素位置に何個の色が存在する
か、その異なる色の数で斑の程度を判断するようにして
もよい。
As a simple method, the number of colors present at eight pixel positions adjacent to the center position of the block and the degree of the spot may be determined based on the number of different colors.

【0120】第2ノイズ消去部257は、色判別された
黒領域内に含まれる有彩色や白色(誤判別された色)を
黒色に補正するものである。すなわち、黒領域補正部2
56により斑模様の領域を黒領域に補正する処理を行っ
ても、なお、黒領域内に有彩色が島状に残る場合があ
り、第2ノイズ消去部257は、この偽色を黒色に変換
して消去するものである。
The second noise elimination section 257 corrects a chromatic color or a white color (misidentified color) included in the black area where the color is determined to black. That is, the black area correction unit 2
Even if the process of correcting the mottled pattern area into a black area by the step 56, the chromatic color may still remain in an island shape in the black area, the second noise canceling unit 257 converts this false color to black. And erase it.

【0121】図30は、文字等の黒領域内に有彩色が島
状に残っている状態の一例を示す図である。
FIG. 30 is a diagram showing an example of a state in which chromatic colors remain in an island shape in a black area such as a character.

【0122】同図は、数字「2」を構成する黒色領域に
有彩色の画素37,38が残っている場合を示すもので
あるが、第2ノイズ消去部257では、黒色領域内の画
素37が黒色に補正されて偽色が消去される。なお、数
字「2」を構成する黒領域の輪郭位置にある画素38に
ついては、黒色補正は行われない。黒領域内に島状に黒
以外の色が混じっている場合は、その色が目立って文字
が見辛くなるが、境界部分に黒以外の色が混じっている
場合は、その偽色による弊害は少ないので、黒領域の補
正処理による処理速度の遅延を考慮して、黒領域内部に
ついてのみ補正処理を行うものである。なお、黒領域の
輪郭位置の偽色に対しても黒補正を行うようにしてもよ
い。
FIG. 27 shows a case where chromatic pixels 37 and 38 remain in the black region forming the numeral “2”. Is corrected to black, and the false color is eliminated. Note that black correction is not performed on the pixel 38 located at the outline position of the black area forming the number “2”. When a color other than black is mixed in an island shape in the black area, the color is conspicuous and the character is hard to see, but when a color other than black is mixed at the border, the adverse effect of the false color is Since the number is small, the correction process is performed only inside the black region in consideration of the processing speed delay due to the correction process for the black region. It should be noted that black correction may also be performed on a false color at the outline position of the black area.

【0123】図31は、第2ノイズ消去部257の偽色
消去の処理手順を示すフローチャートである。
FIG. 31 is a flow chart showing the processing procedure of the false color erasure of the second noise erasing section 257.

【0124】同図に示すフローチャートは、図32に示
すように、中心位置GAとそれに隣接する8個の画素位
置の色を調べ、同一色が所定数K2を超えていれば、中
心の画素位置GAの色を所定数K2を超えている色に変
更するのものである。図32は、所定数K2を6個とし
たもので、中心と右下隅を除く7個の画素が黒となって
いるので、中心位置の画素GAの色が黒色に変更される
ことを示している。
In the flowchart shown in FIG. 32, as shown in FIG. 32, the colors of the center position G A and eight adjacent pixel positions are checked, and if the same color exceeds a predetermined number K2, the center pixel G A is determined. The color of the position G A is changed to a color exceeding the predetermined number K2. Figure 32 is a predetermined number K2 obtained by six, the seven pixels excluding the center and the lower right corner is in the black, show that the color of the pixel G A center position is changed to black ing.

【0125】黒領域補正部256から出力された色判別
データは、第2ノイズ消去部257内の図略のメモリに
格納され、図31のフローチャートに従って黒領域の補
正処理が行われる。すなわち、まず、メモリから左上済
の1ブロック分(3×3画素分)の色判別データが読み
出され(#30)、そのブロック内に含まれる各色の画
素数がカウントされる(#32)。
The color determination data output from the black area correction section 256 is stored in a memory (not shown) in the second noise elimination section 257, and the black area correction processing is performed according to the flowchart of FIG. That is, first, the color discrimination data of one block (3 × 3 pixels) for the upper left is read from the memory (# 30), and the number of pixels of each color included in the block is counted (# 32). .

【0126】続いて、最も多い画素数Nmaxと所定の閾
値K2とを比較し、Nmax>K2であるか否かが判別さ
れる(#34)。Nmax>K2であれば(#34でYE
S)、ブロック中心の画素位置(そのブロックの2行2
列目の画素位置)の色判別データを画素数Nmaxの色の
データに変更することが記憶される(#36)。一方、
Nmax≦K2であれば(#34でYES)、上述のデー
タ変更の指示は行われない。
Subsequently, the maximum number of pixels Nmax is compared with a predetermined threshold value K2, and it is determined whether or not Nmax> K2 (# 34). If Nmax> K2 (YE in # 34)
S), the pixel position at the center of the block (2 rows 2
The change of the color determination data of the pixel position in the column) to the data of the color of the number of pixels Nmax is stored (# 36). on the other hand,
If Nmax ≦ K2 (YES in # 34), the above-described data change instruction is not performed.

【0127】続いて、色判別データ全体に対する偽色修
正処理が終了したか否かが判別され(#38)、処理が
終了していなければ(#38でNO)、ブロックの読出
位置を1画素分だけ横方向にシフトして(#40)、ス
テップ#30に戻り、上述の偽色修正処理が行われる
(#30〜#38)。以下、ブロックの読出位置をラス
タ方向に1画素分ずつシフトしつつ、各画素位置の色判
別データについて偽色修正処理が行われ(#30〜#4
0のループ)、色判別データ全体に対する偽色修正処理
が終了すると(#38でYES)、色判別データを画素
数Nmaxの色のデータに変更するように指示された画素
位置の色判別データが指示された色のデータに変更され
(#42)、処理を終了する。
Subsequently, it is determined whether or not the false color correction processing for the entire color determination data has been completed (# 38). If the processing has not been completed (NO in # 38), the reading position of the block is set to one pixel. The image is shifted in the horizontal direction by an amount (# 40), and the process returns to step # 30, where the above-described false color correction processing is performed (# 30 to # 38). Hereinafter, a false color correction process is performed on the color determination data at each pixel position while shifting the block reading position by one pixel in the raster direction (# 30 to # 4).
When the false color correction processing for the entire color determination data is completed (YES in # 38), the color determination data at the pixel position instructed to change the color determination data to the data of the number of pixels Nmax is obtained. The data is changed to the designated color data (# 42), and the process ends.

【0128】図6に戻り、色置換部258は、各画素位
置の画像データを、色判別部255、黒領域補正部25
6及び第2ノイズ消去部257で設定された色のデータ
に基づいて予め設定された、或いは色登録で設定された
対応する色の画像データ(R,G,Bの色成分の画像デ
ータ)に置換するものである。そして、色置換部258
で置換された画像データは、HDカードに出力され、記
録される(図5参照)。
Returning to FIG. 6, the color replacing section 258 converts the image data at each pixel position into a color determining section 255 and a black area correcting section 25.
6 and corresponding color image data (image data of R, G, B color components) set in advance based on the color data set by the second noise canceling unit 257 or set by color registration. Replace it. Then, the color replacement unit 258
The image data replaced by is output to the HD card and recorded (see FIG. 5).

【0129】次に、図33〜図35のフローチャートに
従って、デジタルカメラ1の撮影動作について説明す
る。
Next, the photographing operation of the digital camera 1 will be described with reference to the flowcharts of FIGS.

【0130】図33は、ドキュメントモードに関する撮
影動作手順を示すフローチャートである。
FIG. 33 is a flowchart showing a photographing operation procedure in the document mode.

【0131】メインスイッチ11がオンになると(#5
0でYES)、デジタルカメラ1が起動し、撮影可能状
態となる。まず、モード変更スイッチ16が撮影モード
に設定されているか否かが判別され(#52)、撮影モ
ードが設定されていなければ、すなわち、色登録モード
が設定されていれば(#52でNO)、図34に示すフ
ローチャートに従って色登録処理が行われ(#54)、
撮影モードが設定されていれば(#52でYES)、ス
テップ#54に移行し、撮影処理が行われる。
When the main switch 11 is turned on (# 5)
0, YES), the digital camera 1 is activated, and is in a photographable state. First, it is determined whether or not the mode change switch 16 is set to the shooting mode (# 52). If the shooting mode is not set, that is, if the color registration mode is set (NO in # 52). The color registration process is performed according to the flowchart shown in FIG. 34 (# 54).
If the shooting mode has been set (YES in # 52), the flow shifts to step # 54, where shooting processing is performed.

【0132】色登録処理に移行すると、まず、色選択ボ
タン18により指定されている色が登録処理対象の色と
して設定される(#80)。この色設定処理では、バー
表示171の表示位置により登録対象の色が判別、設定
される。続いて、その設定された色が未登録であるか否
かが○印表示172の有無により判別され(#82)、
未登録であれば(#82でNO)、更にデフォルトボタ
ン20により登録色のデータ消去が指示されているか否
かが判別される(#84)。
When the process proceeds to the color registration process, first, the color designated by the color selection button 18 is set as a color to be registered (# 80). In this color setting process, the color to be registered is determined and set based on the display position of the bar display 171. Subsequently, whether or not the set color has not been registered is determined based on the presence or absence of the mark 172 (# 82).
If not registered (NO in # 82), it is further determined whether or not an instruction to delete registered color data is given by the default button 20 (# 84).

【0133】登録色のデータ消去が指示されていれば
(#84でYES)、RAM27に記憶されている登録
色の2次の正規化データが予め設定されているその色の
デフォルト値に書き換えられ(#84)、ステップ#8
2に戻る。一方、登録色のデータ消去が指示されていな
ければ(#84でNO)、ステップ#88に移行する。
If deletion of the registered color data is instructed (YES in # 84), the secondary normalized data of the registered color stored in the RAM 27 is rewritten to the preset default value of the color. (# 84), Step # 8
Return to 2. On the other hand, if the deletion of the registered color data has not been instructed (NO in # 84), the process proceeds to step # 88.

【0134】ステップ#82で、設定された色が未登録
であれば(#82でYES)、シャッタボタン9のレリ
ース操作により色見本(図4参照)の撮像が指示されて
いるか否かが判別され(#88)、撮像が指示されてい
れば(#88でYES)、測光部30により被写体輝度
が検出されるとともに(#90)、測距部29により被
写体距離が検出され(#92)、この被写体距離に基づ
いて焦点調節が行われる(#94)。また、検出された
被写体輝度を用いて露出制御値(絞り値とCCDの積分
時間)が設定される(#96)。
If it is determined in step # 82 that the set color has not been registered (YES in # 82), it is determined whether or not imaging of a color sample (see FIG. 4) has been instructed by the release operation of the shutter button 9. Then, if the imaging is instructed (# 88: YES), the photometric unit 30 detects the subject luminance (# 90), and the distance measuring unit 29 detects the subject distance (# 92). The focus is adjusted based on the subject distance (# 94). Further, an exposure control value (aperture value and CCD integration time) is set using the detected subject brightness (# 96).

【0135】続いて、設定された露出制御値に基づいて
色見本の撮像が行われる(#98)。撮像部23で取り
込まれた画像データは、設定色正規化演算部31で撮影
画面中央の枠21内の画像データが抽出され、更にこの
画像データの内、色見本部分のみの画像データが抽出さ
れる(#100)。そして、この色見本の画像データに
ついて2次の正規化データが算出され(#102)、そ
の算出結果がRAM27の所定の記憶領域に記憶される
(#104)。
Subsequently, an image of a color sample is taken based on the set exposure control value (# 98). From the image data captured by the imaging unit 23, the image data in the frame 21 at the center of the shooting screen is extracted by the set color normalization calculation unit 31, and the image data of only the color sample portion is extracted from the image data. (# 100). Then, secondary normalized data is calculated for the color sample image data (# 102), and the calculation result is stored in a predetermined storage area of the RAM 27 (# 104).

【0136】色見本の2次の正規化データのRAM27
への記憶(色登録)が終了すると、続いて、セットボタ
ン19の操作により色使用が指示されているか否かが判
別され(#106)、色使用が指示されていれば(#1
06でYES)、登録色の色判別における色使用が設定
され(#108)、リターンする。このとき、色登録確
認表示部17では色使用「on」の表示が行われる。ま
た、色使用が指示されていなければ(#106でN
O)、登録色の色判別における色使用が解除され(#1
10)、リターンする。このとき、色登録確認表示部1
7では色使用「off」の表示が行われる。
RAM 27 for secondary normalized data of color sample
When the storage (color registration) is completed, it is subsequently determined whether or not the use of the color is instructed by operating the set button 19 (# 106). If the use of the color is instructed (# 1)
(YES in 06), the color use in the color discrimination of the registered color is set (# 108), and the routine returns. At this time, the color registration confirmation display section 17 displays the color use “on”. If the use of color is not instructed (N in # 106)
O), the use of the color in the color discrimination of the registered color is released (# 1)
10) Return. At this time, the color registration confirmation display section 1
At 7, the display of color use "off" is performed.

【0137】一方、ステップ#88で、撮像が指示され
ていなければ(#88でNO)、ステップ#90〜#1
04をジャンプし、上述の色見本の2次の正規化データ
の登録処理を行うことなくステップ#106に移行す
る。
On the other hand, if imaging has not been instructed in step # 88 (NO in # 88), steps # 90 to # 1
The step jumps to step # 106 without performing the above-described process of registering the secondary normalized data of the color sample.

【0138】上述のように、色登録モードにおいては、
デフォルトボタン20が操作されると、設定された色に
対して、既に登録されている色見本の画像データ(R,
G,Bの色成分の画像データ)及び2次の正規化データ
が消去され、それに代えて予め設定された画像データ及
び2次の正規化データ(デフォルト値)が設定される。
また、セットボタン19が操作されると、設定された色
に対して、色使用の設定又は解除が行われる。また、未
登録又は登録済に関係なく、色見本の撮影が行われる
と、撮影された色見本の2次の正規化データが算出さ
れ、この算出値と取り込まれた画像データとが新規に又
は更新的に登録される。
As described above, in the color registration mode,
When the default button 20 is operated, the image data (R, R,
The image data of the G and B color components) and the secondary normalized data are deleted, and instead, preset image data and secondary normalized data (default values) are set.
In addition, when the set button 19 is operated, setting or cancellation of color use is performed for the set color. Further, when a color sample is photographed regardless of whether it is unregistered or registered, secondary normalized data of the photographed color sample is calculated, and the calculated value and the captured image data are newly or Registered renewally.

【0139】図33に戻り、ステップ52で、撮影モー
ドが設定されていると(#52でYES)、続いて、シ
ャッタボタン9のレリーズ操作により撮像が指示されて
いるか否かが判別され(#56)、撮像が指示されてい
なければ(#56でNO)、ステップ#52に戻り、撮
像が指示されていると(#56でYES)、更に色補正
補正スイッチ13がONに設定されているか(すなわ
ち、ドキュメントモードが設定されているか)否かが判
別される(#58)。
Returning to FIG. 33, if the photographing mode is set in step 52 (YES in # 52), subsequently, it is determined whether or not photographing is instructed by the release operation of the shutter button 9 (#). 56) If imaging is not instructed (NO in # 56), the process returns to step # 52, and if imaging is instructed (YES in # 56), is the color correction correction switch 13 further set to ON? It is determined whether or not the document mode is set (# 58).

【0140】ドキュメントモードが設定されていなけれ
ば、すなわち、ノーマルモードが設定されていれば(#
58でNO)、通常の写真撮影の処理が行われる。すな
わち、被写体輝度及び被写体距離が検出され、これらの
検出値に基づき焦点調節と露出制御値設定とが行われた
後、被写体の撮影が行われる。そして、撮像部23で取
り込まれた画像データは、画像処理部25で所定の画像
処理(描写性の高い画質が得られる画像処理)が行わ
れ、圧縮された後、HDカード10に記録される。
If the document mode is not set, that is, if the normal mode is set (#
(NO at 58), a normal photographing process is performed. That is, the subject brightness and the subject distance are detected, and after the focus adjustment and the exposure control value setting are performed based on these detected values, the subject is photographed. The image data captured by the imaging unit 23 is subjected to predetermined image processing (image processing for obtaining high image quality of depiction) by the image processing unit 25, compressed, and recorded on the HD card 10. .

【0141】一方、ドキュメントモードが設定されてい
れば(#58でYES)、まず、濃度設定スイッチ15
の設定位置により濃度データ(濃/淡のデータ)が取り
込まれる(#62)。続いて、画像処理部25がドキュ
メントモードの画像処理に設定されるとともに、濃度デ
ータが色判別部255に設定される(#64)。
On the other hand, if the document mode is set (YES in # 58), first, the density setting switch 15
The density data (dark / light data) is taken in according to the set position (# 62). Subsequently, the image processing unit 25 is set to image processing in the document mode, and the density data is set in the color determination unit 255 (# 64).

【0142】続いて、測光部30により被写体輝度が検
出されるとともに(#66)、測距部29により被写体
距離が検出され(#68)、この被写体距離に基づいて
焦点調節が行われる(#70)。また、検出された被写
体輝度を用いて露出制御値(絞り値とCCDの積分時
間)が設定される(#72)。
Subsequently, the luminance of the subject is detected by the photometric unit 30 (# 66), the subject distance is detected by the distance measuring unit 29 (# 68), and the focus is adjusted based on the subject distance (# 66). 70). Also, an exposure control value (aperture value and CCD integration time) is set using the detected subject brightness (# 72).

【0143】続いて、設定された露出制御値に基づき撮
像部23で被写体の撮像が行われ(#74)、その撮像
動作で取り込まれた画像データは、図35に示すフロー
チャートに従って画像処理部25で所定の色補正処理が
行われた後(#76)、HDカード10に記録される
(#78)。そして、これにより1枚の撮影が終了し、
次の撮影を行うべく、ステップ#52に戻る。
Subsequently, an image of a subject is taken by the image pickup section 23 based on the set exposure control value (# 74). The image data taken in the image pickup operation is transferred to the image processing section 25 in accordance with the flowchart shown in FIG. After the predetermined color correction processing is performed (# 76), it is recorded on the HD card 10 (# 78). And this ends one shot,
The flow returns to step # 52 to perform the next photographing.

【0144】色補正処理に移行すると、まず、γ特性設
定部254で画像メモリ251に格納された画像データ
を用いて下地飛ばし処理のためのγ特性が設定される
(#120)。続いて、画像メモリ251に格納された
画像データが第1ノイズ消去部252でノイズ低減処理
がなされた後、下地飛ばし演算部253で上記γ特性を
用いてγ補正を行うことにより下地飛ばしの処理(背景
の白地部分を一律に白色に変換する処理)が行われる
(#122)。
When the process proceeds to the color correction processing, first, the γ characteristic for the background removal processing is set by the γ characteristic setting section 254 using the image data stored in the image memory 251 (# 120). Subsequently, after the image data stored in the image memory 251 is subjected to noise reduction processing by the first noise elimination unit 252, the background removal processing unit 253 performs γ correction using the above γ characteristic, thereby performing background removal processing. (Process for uniformly converting a white background portion to white) is performed (# 122).

【0145】続いて、色判別部255の正規化演算回路
255aで画像メモリ251に格納された画像データを
用いて色判別処理のための2次の正規化データが演算さ
れる(#124)。また、色判別部255の輝度演算色
255bで画像メモリ251に格納された画像データを
用いて各画素位置毎に色判別用の輝度データが演算され
る(#126)。更に、色判別部255の形状認識回路
255cで画像メモリ251に格納された画像データを
用いて、所定ブロック単位で文字、図形等の形状認識処
理(パターンマッチングによるパターン認識処理)が行
われる(#128)。そして、色判別部255の色判別
回路255dで、2次の正規化データ、輝度データ及び
形状認識結果に基づき予め設定された閾値プロファイル
(図15〜図18参照)を用いて上述の色判別方法によ
り各画素位置の色判別が行われる(#128)。
Subsequently, secondary normalization data for color discrimination processing is calculated by the normalization calculation circuit 255a of the color discrimination unit 255 using the image data stored in the image memory 251 (# 124). Further, the luminance data for color determination is calculated for each pixel position using the image data stored in the image memory 251 with the brightness calculation color 255b of the color determination unit 255 (# 126). Further, the shape recognizing circuit 255c of the color discriminating unit 255 uses the image data stored in the image memory 251 to perform a shape recognizing process (pattern recognizing process by pattern matching) of characters, figures, and the like on a predetermined block basis (# 128). The color discrimination circuit 255d of the color discrimination unit 255 uses the above-described color discrimination method by using a preset threshold profile (see FIGS. 15 to 18) based on secondary normalized data, luminance data, and a shape recognition result. Thus, the color of each pixel position is determined (# 128).

【0146】続いて、黒領域補正部256で、色判別デ
ータに対して斑模様を修正する処理が行われるとともに
(#132)、第2ノイズ消去部257で、色判別デー
タに対して島状に発生している偽色を消去する処理が行
われた後(#257)、色置換部258で、色判別デー
タに基づき各画素位置の画像データ(撮影時の画像デー
タ)が所定の色データ(予め設定されたR,G,Bの色
成分の画像データ(デフォルト値)又は登録処理で登録
されたR,G,Bの色成分の画像データ)に置換され
(#136)、これにより色補正処理を終了し、リター
ンする。
Subsequently, the black area correction unit 256 performs a process of correcting a spot pattern on the color determination data (# 132), and the second noise elimination unit 257 performs an island-like process on the color determination data. After the process of erasing the false color that has occurred is performed (# 257), the color replacement unit 258 converts the image data at each pixel position (image data at the time of shooting) into predetermined color data based on the color determination data. (Image data of R, G, B color components set in advance (default value) or image data of R, G, B color components registered in the registration process) (# 136), thereby The correction processing ends, and the process returns.

【0147】なお、上記実施の形態では、デジタルカメ
ラを例に説明したが、本発明は、例えばコンピュータに
よる色判別処理等の他のカラー画像処理装置においても
適用することができる。
In the above embodiment, a digital camera has been described as an example. However, the present invention can be applied to other color image processing devices such as a color discriminating process by a computer.

【0148】[0148]

【発明の効果】以上説明したように、本発明によれば、
カラー画像を構成する色成分の画像データを用いて色判
別された各画素位置の色判別結果に対して、所定の画素
数単位で、色のデータを抽出するとともに、その抽出領
域の色の分散度を演算し、この分散度に基づき色の分散
が大きいと判別されたときは、抽出領域の中心の画素位
置の色のデータを黒色のデータに置換するようにしたの
で、色判別処理での誤判別により黒領域にノイズとして
生じた有彩色を好適に除去することができる。
As described above, according to the present invention,
Color data is extracted in units of a predetermined number of pixels from the color determination result of each pixel position determined using the color component image data of the color image, and the color distribution of the extracted area is When the color variance is determined to be large based on the degree of variance, the color data at the pixel position at the center of the extraction area is replaced with black data. The chromatic color generated as noise in the black area due to the erroneous determination can be suitably removed.

【0149】また、本発明によれば、分散度に基づき色
の分散が大きいと判別されたとき、抽出領域全体の色の
データを黒色のデータに置換するようにしたので、黒領
域のノイズ除去処理の高速化が可能になる。
Further, according to the present invention, when it is determined that the color variance is large based on the degree of variance, the color data of the entire extraction area is replaced with black data. Processing can be sped up.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明に係る色判別装置を備えたデジタルカメ
ラの一実施の形態の外観を示す斜視図である。
FIG. 1 is a perspective view showing an appearance of a digital camera provided with a color discriminating apparatus according to an embodiment of the present invention.

【図2】本発明に係る色判別装置を備えたデジタルカメ
ラの背面図である。
FIG. 2 is a rear view of a digital camera provided with the color determination device according to the present invention.

【図3】色登録確認表示部の表示の一例を示す図であ
る。
FIG. 3 is a diagram illustrating an example of a display of a color registration confirmation display unit.

【図4】色登録モードでファインダー内に色データ取込
範囲を示す枠が表示された状態を示す図である。
FIG. 4 is a diagram illustrating a state in which a frame indicating a color data capture range is displayed in a finder in a color registration mode.

【図5】本発明に係るデジタルカメラのドキュメントモ
ードにおける撮像画像の画像処理に関するブロック構成
図である。
FIG. 5 is a block diagram illustrating image processing of a captured image in a document mode of the digital camera according to the present invention.

【図6】画像処理部のドキュメントモードにおける画像
処理に関するブロック構成図である。
FIG. 6 is a block diagram illustrating image processing performed by an image processing unit in a document mode.

【図7】ドキュメントモードにおける画像処理手順の概
要を示す図である。
FIG. 7 is a diagram illustrating an outline of an image processing procedure in a document mode.

【図8】下地飛ばし処理の内容を示す図である。FIG. 8 is a diagram illustrating the details of a background removal process.

【図9】ホワイトボード撮影画像を構成する画像データ
のヒストグラムの典型例を示す図である。
FIG. 9 is a diagram showing a typical example of a histogram of image data constituting a whiteboard photographed image.

【図10】下地飛ばし用に設定されるγ特性の一例を示
す図である。
FIG. 10 is a diagram illustrating an example of a γ characteristic set for background removal.

【図11】1次の正規化データxb,xgを用いて色判別
する場合のxb-xg平面における青、緑、橙、赤の各系
統の色分布を示す図である。
FIG. 11 is a diagram showing the color distribution of each of the blue, green, orange, and red systems on the xb-xg plane when color discrimination is performed using primary normalized data xb, xg.

【図12】2次の正規化データxb,xgを用いて色判別
する場合のxb-xg平面における青、緑、橙、赤の各系
統の色分布を示す図である。
FIG. 12 is a diagram showing the color distribution of each of the blue, green, orange, and red systems on the xb-xg plane when performing color discrimination using the second-order normalized data xb, xg.

【図13】画像データXr,Xg,Xbを2次の正規化デ
ータxr,xg,xbに変換するフローチャートである。
FIG. 13 is a flowchart for converting image data Xr, Xg, and Xb into quadratic normalized data xr, xg, and xb.

【図14】パターンマッチングにより細線部分と太線部
分とを検出する方法を示す図である。
FIG. 14 is a diagram illustrating a method of detecting a thin line portion and a thick line portion by pattern matching.

【図15】色判別用の輝度データにより有彩色と無彩色
との色判別を行うための閾値プロファイルの第1の実施
形態を示す図である。
FIG. 15 is a diagram showing a first embodiment of a threshold profile for performing color discrimination between a chromatic color and an achromatic color based on luminance data for color discrimination.

【図16】色判別用の輝度データにより有彩色と無彩色
との色判別を行うための閾値プロファイルの第2の実施
形態を示す図である。
FIG. 16 is a diagram illustrating a second embodiment of a threshold profile for performing color discrimination between a chromatic color and an achromatic color based on luminance data for color discrimination.

【図17】色判別用の輝度データにより有彩色と無彩色
との色判別を行うための閾値プロファイルの第3の実施
形態を示す図である。
FIG. 17 is a diagram illustrating a third embodiment of a threshold profile for performing color discrimination between a chromatic color and an achromatic color based on luminance data for color discrimination.

【図18】色判別用の輝度データにより有彩色と無彩色
との色判別を行うための閾値プロファイルの第4の実施
形態を示す図である。
FIG. 18 is a diagram illustrating a fourth embodiment of a threshold profile for performing color discrimination between a chromatic color and an achromatic color based on luminance data for color discrimination.

【図19】成分を相互に入れ換えた6個の正規化データ
のxb-xg平面上の位置関係の一例を示す図である。
FIG. 19 is a diagram showing an example of a positional relationship on the xb-xg plane of six normalized data in which components are interchanged.

【図20】成分を相互に入れ換えた6個の正規化データ
により生成される等距離線の形状を楕円とした図であ
る。
FIG. 20 is a diagram in which the shape of an equidistant line generated by six normalized data in which components are exchanged is an ellipse.

【図21】成分を相互に入れ換えた6個の正規化データ
により生成される等距離線の形状を二等辺三角形とした
図である。
FIG. 21 is a diagram in which the shape of an equidistant line generated by six normalized data in which components are interchanged is an isosceles triangle.

【図22】成分を相互に入れ換えた6個の正規化データ
により生成される等距離線の形状を六角形とした図であ
る。
FIG. 22 is a diagram showing hexagonal shapes of equidistant lines generated by six normalized data in which components are interchanged.

【図23】xb-xg平面を青、緑、橙、赤の色領域に分
割した状態を示す図である。
FIG. 23 is a diagram showing a state where an xb-xg plane is divided into blue, green, orange, and red color regions.

【図24】文字等の線幅と輝度レベルとの関係を示す図
である。
FIG. 24 is a diagram showing a relationship between a line width of a character or the like and a luminance level.

【図25】文字等の線幅の異なる部分を閾値プロファイ
ルを用いて白黒判別を行ったときの判別結果を示すもの
で、(a)は閾値レベルの高い閾値プロフィルを用いて
場合、(b)は閾値レベルの低い閾値プロフィルを用い
た場合、(c)は線幅に応じて閾値レベルを変更した場
合、の判別結果である。
25A and 25B show the result of performing black and white discrimination on portions having different line widths such as characters using a threshold profile. FIG. 25A shows a case where a threshold profile with a high threshold level is used, and FIG. (C) shows a determination result when a threshold profile having a low threshold level is used, and (c) shows a determination result when the threshold level is changed according to the line width.

【図26】線幅に応じて補正される閾値プロファイルの
補正例を示す図である。
FIG. 26 is a diagram illustrating a correction example of a threshold profile corrected according to a line width.

【図27】色判別結果が斑模様となった場合の一例を示
す図である。
FIG. 27 is a diagram illustrating an example of a case where a color discrimination result is a mottled pattern.

【図28】分散度の演算例を示す図で、(a)は、斑模
様の領域の分散度を示す図、(b)は、赤領域の分散度
を示す図である。
28A and 28B are diagrams illustrating calculation examples of the degree of dispersion, wherein FIG. 28A is a diagram illustrating the degree of dispersion of a mottled region, and FIG. 28B is a diagram illustrating the degree of dispersion of a red region.

【図29】黒領域補正部の補正処理の手順を示すフロー
チャートである。
FIG. 29 is a flowchart illustrating a procedure of a correction process of a black area correction unit.

【図30】文字等の黒領域内に有彩色が島状に残ってい
る状態の一例を示す図である。
FIG. 30 is a diagram illustrating an example of a state in which chromatic colors remain in an island shape in a black region such as a character.

【図31】第2ノイズ消去部の偽色消去の処理手順を示
すフローチャートである。
FIG. 31 is a flowchart illustrating a processing procedure of false color erasure of a second noise erasing unit.

【図32】隣接する8個の画素位置の色判別結果を用い
て中心画素の色修正を行う方法を示す図である。
FIG. 32 is a diagram illustrating a method of correcting the color of the center pixel using the color determination results of eight adjacent pixel positions.

【図33】本発明に係るデジタルカメラのドキュメント
モードに関する撮影動作手順を示すフローチャートであ
る。
FIG. 33 is a flowchart showing a shooting operation procedure in a document mode of the digital camera according to the present invention.

【図34】色登録処理の処理手順を示すフローチャート
である。
FIG. 34 is a flowchart illustrating a procedure of a color registration process.

【図35】色補正処理の処理手順を示すフローチャート
である。
FIG. 35 is a flowchart illustrating a processing procedure of a color correction process.

【符号の説明】[Explanation of symbols]

1 デジタルカメラ 2 撮影レンズ 3 測光窓 4 投光窓 5 受光窓 6 ファインダー対物窓 7 カード挿入口 8 カード取出ボタン 9 シャッタボタン 10 HDカード 11 メインスイッチ 12 ファインダー接眼窓 13 色補正スイッチ 14 ノイズ修正スイッチ 15 濃度設定スイッチ 16 モード変更スイッチ 17 色登録確認表示部 18 色選択ボタン 19 セットボタン 20 デフォルトボタン 21 枠 22 色見本 23 撮像部 24 A/D変換器 25 画像処理部(色判別装置) 251 画像メモリ 252 第1ノイズ消去部 253 下地飛ばし演算部 254 γ特性設定部 255 色判別部(色判別手段) 255a 正規化演算回路 255b 輝度演算回路 255c 形状認識回路 255d 色判別回路 256 黒領域補正部 256a 同色画素数計数回路(演算手段) 256b 分散度演算回路(演算手段) 256c 黒判別回路(色データ置換手段) 257 第2ノイズ消去部 258 色置換部 26 カード駆動制御部 27 RAM 28 ROM 29 測距部 30 測光部 31 設定色正規化演算部 32 色領域設定演算部 34 制御部 35 ホワイトボード 36 文字部分 37,38 誤判別された画素 DESCRIPTION OF SYMBOLS 1 Digital camera 2 Photographing lens 3 Metering window 4 Light-emitting window 5 Light-receiving window 6 Viewfinder objective window 7 Card slot 8 Card eject button 9 Shutter button 10 HD card 11 Main switch 12 Viewfinder eyepiece window 13 Color correction switch 14 Noise correction switch 15 Density setting switch 16 Mode change switch 17 Color registration confirmation display section 18 Color selection button 19 Set button 20 Default button 21 Frame 22 Color sample 23 Imaging section 24 A / D converter 25 Image processing section (color discriminating device) 251 Image memory 252 1st noise elimination section 253 background removal calculation section 254 γ characteristic setting section 255 color discrimination section (color discrimination means) 255a normalization calculation circuit 255b luminance calculation circuit 255c shape recognition circuit 255d color discrimination circuit 256 black area correction section 256a the number of pixels of the same color Counting circuit (calculating means) 256b Dispersion degree calculating circuit (calculating means) 256c Black discriminating circuit (color data replacing means) 257 Second noise erasing section 258 Color replacing section 26 Card drive control section 27 RAM 28 ROM 29 Distance measuring section 30 Photometry Unit 31 Setting color normalization calculation unit 32 Color area setting calculation unit 34 Control unit 35 Whiteboard 36 Character part 37, 38 Misidentified pixel

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 複数の色成分の画像データからなるカラ
ー画像の色を判別する色判別装置であって、各画素位置
毎に、上記画像データを用いて色の判別を行う色判別手
段と、予め設定された画素数単位で、上記色判別手段で
判別された色のデータを抽出し、その抽出された領域に
含まれる色の分散の度合いを示す分散度を演算する演算
手段と、上記演算手段で算出された分散度を予め設定さ
れた所定の閾値と比較して色の分散が大きいか否かを判
別する判別手段と、上記判別手段で色の分散が大きいと
判別されたとき、上記抽出領域の中心の画素位置の色の
データを黒色のデータに置換する色データ置換手段とを
備えたことを特徴とする色判別装置。
1. A color discriminating device for discriminating a color of a color image composed of image data of a plurality of color components, comprising: a color discriminating means for discriminating a color using the image data for each pixel position; Calculating means for extracting data of the color determined by the color determining means in units of a predetermined number of pixels, and calculating a degree of dispersion indicating a degree of dispersion of colors included in the extracted area; A determination unit that determines whether the color variance is large by comparing the degree of dispersion calculated by the unit with a predetermined threshold value set in advance; and when the determination unit determines that the color variance is large, A color discriminating device comprising: color data replacement means for replacing color data at a pixel position at the center of an extraction region with black data.
【請求項2】 請求項1記載の色判別装置において、上
記色データ置換手段は、上記判別手段で色の分散が大き
いと判別されたとき、上記抽出領域の中心の画素位置の
色のデータに代えて抽出領域全体の色のデータを黒色の
データに置換するものであることを特徴とする色判別装
置。
2. The color discriminating apparatus according to claim 1, wherein said color data replacing means converts color data at a pixel position at the center of said extraction area when said discriminating means determines that the color variance is large. A color discriminating apparatus for replacing color data of the entire extraction area with black data instead.
JP26744797A 1997-09-30 1997-09-30 Color discrimination device Expired - Lifetime JP3724148B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP26744797A JP3724148B2 (en) 1997-09-30 1997-09-30 Color discrimination device
US09/163,266 US6480624B1 (en) 1997-09-30 1998-09-29 Color discrimination apparatus and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP26744797A JP3724148B2 (en) 1997-09-30 1997-09-30 Color discrimination device

Publications (2)

Publication Number Publication Date
JPH11110551A true JPH11110551A (en) 1999-04-23
JP3724148B2 JP3724148B2 (en) 2005-12-07

Family

ID=17444979

Family Applications (1)

Application Number Title Priority Date Filing Date
JP26744797A Expired - Lifetime JP3724148B2 (en) 1997-09-30 1997-09-30 Color discrimination device

Country Status (1)

Country Link
JP (1) JP3724148B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005002237A1 (en) * 2003-06-30 2005-01-06 Nikon Corporation Signal correcting method
US7034878B2 (en) 1999-12-01 2006-04-25 Ricoh Company, Ltd. Camera apparatus and method of taking pictures including simplified processing
JP2011250294A (en) * 2010-05-28 2011-12-08 Kyocera Mita Corp Image forming apparatus and image forming method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7034878B2 (en) 1999-12-01 2006-04-25 Ricoh Company, Ltd. Camera apparatus and method of taking pictures including simplified processing
WO2005002237A1 (en) * 2003-06-30 2005-01-06 Nikon Corporation Signal correcting method
US7684615B2 (en) 2003-06-30 2010-03-23 Nikon Corporation Signal correcting method
US7856139B2 (en) 2003-06-30 2010-12-21 Nikon Corporation Signal correcting method
JP2011250294A (en) * 2010-05-28 2011-12-08 Kyocera Mita Corp Image forming apparatus and image forming method

Also Published As

Publication number Publication date
JP3724148B2 (en) 2005-12-07

Similar Documents

Publication Publication Date Title
US6480624B1 (en) Color discrimination apparatus and method
US7564486B2 (en) Image sensing apparatus with feature extraction mechanism and its control method
JP4217698B2 (en) Imaging apparatus and image processing method
US6806903B1 (en) Image capturing apparatus having a γ-characteristic corrector and/or image geometric distortion correction
US8106961B2 (en) Image processing method, apparatus and computer program product, and imaging apparatus, method and computer program product
US7711190B2 (en) Imaging device, imaging method and imaging program
US20070040929A1 (en) Image combination device
JPH09171220A (en) Exposure deciding method
US20090002518A1 (en) Image processing apparatus, method, and computer program product
US20060289618A1 (en) Apparatus and method for deciding in-focus position of imaging lens
JP5087936B2 (en) camera
US5489997A (en) Color image processing apparatus
US20040012700A1 (en) Image processing device, image processing program, and digital camera
JP4726251B2 (en) Imaging apparatus and image processing method
JPH11110549A (en) Color-discriminating device
JPH11110551A (en) Color-discriminating device
JPH11110550A (en) Color-discriminating device
JP3726444B2 (en) Color discrimination device
US7046289B2 (en) Automatic focusing device, camera, and automatic focusing method
JP3643203B2 (en) Digital camera
JPH10210360A (en) Digital camera
JP3643201B2 (en) Digital camera
JP3631577B2 (en) Digital camera
JPH1023453A (en) Digital camera
JP3641537B2 (en) Digital camera

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050418

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050426

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20050613

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050627

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050912

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20090930

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100930

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100930

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110930

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120930

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20120930

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20130930

Year of fee payment: 8

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

EXPY Cancellation because of completion of term