JP2003092687A - Image processing apparatus, image processing method and medium for recording image processing program - Google Patents

Image processing apparatus, image processing method and medium for recording image processing program

Info

Publication number
JP2003092687A
JP2003092687A JP2002189637A JP2002189637A JP2003092687A JP 2003092687 A JP2003092687 A JP 2003092687A JP 2002189637 A JP2002189637 A JP 2002189637A JP 2002189637 A JP2002189637 A JP 2002189637A JP 2003092687 A JP2003092687 A JP 2003092687A
Authority
JP
Japan
Prior art keywords
color
image processing
distribution
image
processing apparatus
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
JP2002189637A
Other languages
Japanese (ja)
Other versions
JP3664394B2 (en
JP2003092687A5 (en
Inventor
Naoki Kuwata
直樹 鍬田
Yoshihiro Nakami
至宏 中見
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2002189637A priority Critical patent/JP3664394B2/en
Publication of JP2003092687A publication Critical patent/JP2003092687A/en
Publication of JP2003092687A5 publication Critical patent/JP2003092687A5/ja
Application granted granted Critical
Publication of JP3664394B2 publication Critical patent/JP3664394B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide an image processing apparatus, an image processing method and a medium for recording an image processing program capable of automatically correcting color reproducibility such as a so-called color slippage and totally correcting color balance. SOLUTION: At a step S102, a sample-count distribution of image data is found for each color component by applying a thinning technique on samples. At a step S116, a judgment as to whether or not analogy exists among the sample-count distribution of the color components is formed. A low degree of analogy is regarded as an indicator which suggests that characteristics recognized from the sample-count distributions shall naturally be made uniform among the color components. In this case, the characteristics are compensated for a color slippage included therein by correcting an offset, putting an emphasis on the contrast and correcting the brightness at steps S204 to S216 in order to produce a well pitched and good image from the image data with poor color reproducibility. In addition, since the compensation and correction work is automated, even an untrained user is capable of correcting the balance of color with ease. Furthermore, at a step S205, an offset quantity reflecting a degree of analogy is calculated for use in the compensation of the characteristics for a color slippage.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、画像処理装置及び
画像処理方法並びに画像処理プログラムを記録した媒体
に関し、特に、カラーバランスを修正する画像処理装置
および画像処理方法並びに画像処理プログラムを記録し
た媒体に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image processing apparatus, an image processing method and a medium recording an image processing program, and more particularly to an image processing apparatus and an image processing method for correcting color balance and a medium recording an image processing program. Regarding

【0002】[0002]

【従来の技術】従来、カラーバランスを修正するという
と、いわゆる色かぶりなどを修正することを指している
ことが多い。すなわち、画像入力装置などにおける色ず
れに対する修正処理である。
2. Description of the Related Art Heretofore, correcting the color balance often refers to correcting so-called color cast. That is, it is a correction process for a color shift in an image input device or the like.

【0003】例えば、デジタルスチルカメラなどにおい
ては、画像データをRGB(赤緑青)の階調表色データ
として出力している。この場合、レンズやCCD素子の
特性により、特定の色、例えば、赤色が実物の色よりも
強調されたいわゆる色ずれのあるものも見受けられる。
For example, in a digital still camera or the like, image data is output as RGB (red green blue) gradation color data. In this case, depending on the characteristics of the lens and the CCD element, there is also seen a so-called color shift in which a specific color, for example, red is emphasized more than the actual color.

【0004】従来、このような色ずれのある画像データ
に対して、何らかの修正を行いたい場合には、画像処理
ソフトなどに読み込み、作業者が所定の操作を経て試行
錯誤により強調色の成分値を弱くしている。
Conventionally, when it is desired to make some correction to image data having such a color shift, it is read into image processing software or the like, and an operator performs a predetermined operation to perform trial-and-error and the component value of the emphasized color. Is weakening.

【0005】[0005]

【発明が解決しようとする課題】上述した従来の修正手
法においては、次のような課題があった。
The conventional correction method described above has the following problems.

【0006】作業者が試行錯誤で修正を行うものである
ため、正確さに乏しいし、非熟練者には困難である場合
がある。
Since the operator makes corrections by trial and error, the accuracy is poor and it may be difficult for an unskilled person.

【0007】また、一律に所定の成分値を増減するもの
であるため、全階調にわたって正しく修正されていると
もいえない場合がある。
Further, since the predetermined component value is uniformly increased / decreased, it may not be said that all gradations are corrected correctly.

【0008】さらには、単なる色ずれ以外の要素を含ん
でいる場合に、効率の良い修正が可能であるとは言えな
かった。
Furthermore, it cannot be said that efficient correction is possible in the case where an element other than simple color misregistration is included.

【0009】また、各画素の色を表す各成分毎の階調表
色データが正しいものであるか否かという判断は根本的
には標準色などとの対比を行わなければ不可能である
し、場合によっては外的要因によってある成分が強調さ
れることの方が当然のこともありえることを考慮すれ
ば、色ずれがあるか否かを自動的に判断することは極め
て困難であるといわざるを得ない。
Further, it is basically impossible to judge whether or not the gradation color data for each component representing the color of each pixel is correct unless it is compared with a standard color. Considering that it may be natural that a certain component is emphasized by an external factor in some cases, it is extremely difficult to automatically determine whether or not there is a color shift. I have no choice.

【0010】本発明は、上記課題にかんがみてなされた
もので、いわゆる色ずれなどの色再現性の修正を自動化
するとともに総合的にカラーバランスを修正することが
可能な画像処理装置および画像処理方法並びに画像処理
プログラムを記録した媒体の提供を目的とする。
The present invention has been made in view of the above problems, and an image processing apparatus and an image processing method capable of automating correction of color reproducibility such as so-called color misregistration and comprehensively correcting color balance. Another object of the present invention is to provide a medium recording an image processing program.

【0011】[0011]

【課題を解決するための手段】上記目的を達成するた
め、請求項1にかかる発明は、概略対等な色成分からな
る階調表色データによって画像をドットマトリクス状の
画素の集合として表した画像データについて、同画像デ
ータの各成分値を入力して所定の変換処理を施して出力
することにより、入力と出力との関係でカラーバランス
を修正する変換が行われるようにした画像処理装置であ
って、各色成分毎に階調表色データの分布を求めるとと
もに各色成分の間でのずれを求め、求められたずれに基
づいて各色成分間の特性の均一化を図る特性均一化手段
を具備する構成としてある。
In order to achieve the above object, the invention according to claim 1 is an image in which an image is represented as a set of pixels in a dot matrix by gradation gradation color data composed of substantially equal color components. This is an image processing device that performs conversion for correcting the color balance according to the relationship between input and output by inputting each component value of the same image data, performing a predetermined conversion process and outputting the data. And a characteristic equalizing means for determining the distribution of the gradation color data for each color component, determining the deviation between the color components, and equalizing the characteristics between the color components based on the determined deviation. It is as a configuration.

【0012】上記のように構成した請求項1にかかる発
明においては、概略対等な色成分からなる階調表色デー
タによって画像をドットマトリクス状の各画素の集合と
して表した画像データがある場合に、同画像データの各
成分値を入力して所定の変換処理を施して出力すること
により、入力と出力との関係でカラーバランスを修正す
る変換を行うが、この際に、上記特性均一化手段は、各
色成分毎に階調表色データの分布を求めるとともに各色
成分の間でのずれを求め、求められたずれに基づいて各
色成分間の特性の均一化を図っている。
In the invention according to claim 1 configured as described above, when there is image data in which an image is represented as a set of each pixel in a dot matrix by gradation color data consisting of substantially equal color components. By inputting each component value of the same image data, performing a predetermined conversion process and outputting the same, the color balance is corrected by the relationship between the input and the output. At this time, the characteristic equalizing means is used. Seeks the distribution of gradation color data for each color component, finds the deviation between the color components, and equalizes the characteristics between the color components based on the found deviation.

【0013】デジタルスチルカメラを例に取れば、従
来、カラーバランスを修正するということは、各画素毎
における色成分の変換特性が一致しているか否かを、各
色毎に成分値が強調気味であるか否か判断して調整して
いた。これに対し、本発明では、各色成分毎に階調表色
データの分布を求め、各色成分毎に分離した状況で特性
を見出し、そのような特性の均一化を図っている。すな
わち、画像の内容を問わず、各色成分ごとに階調表色デ
ータの分布の特性が一致するようなときに画像としては
色ずれのないメリハリのある画像が得られることが分か
り、かかる特性の均一化を分布に基づいて求めている。
なお、ここにいう均一化とは厳密な意味での均一化を意
味しているのではなく、少なくとも傾向を均一化させる
程度で構わない。
Taking a digital still camera as an example, conventionally, to correct the color balance means to emphasize whether or not the conversion characteristics of the color components in each pixel match, and to emphasize the component value for each color. I adjusted it by judging whether there was any. On the other hand, in the present invention, the distribution of the gradation color data is obtained for each color component, the characteristics are found in the separated state for each color component, and such characteristics are made uniform. That is, regardless of the content of the image, when the characteristics of the distribution of the gradation color data for each color component are the same, it can be seen that a sharp image with no color shift is obtained as an image. Uniformity is sought based on the distribution.
In addition, the homogenization here does not mean the homogenization in a strict sense, but may be at least a degree of homogenizing the tendency.

【0014】この意味で、分布は画像データにおける各
成分ごとの分布状況を見出せるようなものであればよ
く、度数分布を含めて各種の統計的手法も採用可能であ
る。例えば、度数分布から導き出される標準偏差である
とかメジアンであるとか最頻値といった二次加工的デー
タを利用することも可能である。この場合、度数分布は
処理が容易で簡易化させることができるメリットを有し
ている。
In this sense, the distribution need only be such that the distribution status of each component in the image data can be found, and various statistical methods including frequency distribution can be adopted. For example, it is also possible to use secondary processing data such as a standard deviation or median derived from a frequency distribution, or a mode value. In this case, the frequency distribution has an advantage that the processing is easy and can be simplified.

【0015】ところで、分布の特性が一致しないことが
当然である場合もある。例えば、夕方の景色であれば、
赤系統の色彩だけとなっても不自然さはない。このよう
な場合には、各色成分毎の分布から判断される特性を均
一化することの方が不自然でもある。このため、請求項
2にかかる発明においては、上記請求項1に記載の画像
処理装置において、上記特性均一化手段は、上記分布に
基づいて各色成分間の類似具合を判断し、類似具合が小
さい場合には上記修正を図らないようにする修正制御手
段を具備する構成としてある。
In some cases, the characteristics of the distributions do not match. For example, in the evening,
There is no unnaturalness even if it is only reddish colors. In such a case, it is unnatural to make the characteristics determined from the distribution of each color component uniform. Therefore, in the invention according to claim 2, in the image processing apparatus according to claim 1, the characteristic equalizing means determines the similarity between the color components based on the distribution, and the similarity is small. In this case, a modification control means is provided to prevent the above modification.

【0016】上記のように構成した請求項2にかかる発
明は、特性均一化手段の修正制御手段にてまず各色成分
間の類似具合を判断する。赤(R)緑(G)青(B)の
色成分からなるときに夕方の景色であれば、赤の成分だ
けに分布する偏った分布が得られることになり、青や緑
の成分についての分布は極端に減少する。このようなと
きに分布の特性が均一化しないのは当然であり、各色成
分間の類似具合は極めて小さく、特性の均一化を図らな
い。一方、各色成分が平均的に現れたような場合には分
布の類似具合は大きいと判断され、このような場合にこ
そ相互の特性を均一化させることにより、画像入力装置
などに固有の偏りを低減させることも可能となる。
In the invention according to claim 2 configured as described above, the correction control means of the characteristic equalizing means first determines the degree of similarity between the color components. If it is an evening scene when it consists of red (R) green (G) blue (B) color components, a biased distribution that is distributed only to the red component will be obtained. The distribution is extremely reduced. In such a case, it is natural that the characteristics of the distribution do not become uniform, the degree of similarity between the color components is extremely small, and the characteristics cannot be made uniform. On the other hand, if each color component appears on average, it is determined that the degree of similarity in distribution is large, and in such a case, the mutual characteristics are made uniform, and thus the bias unique to the image input device is eliminated. It can also be reduced.

【0017】分布の類似具合を判断するにあたり、必ず
しも全ての階調での度数分布を用いて個別に比較する必
要はなく、そのような場合に好適な一例として、請求項
3にかかる発明は、上記請求項2に記載の画像処理装置
において、上記修正制御手段は、上記階調表色データの
取りうる階調範囲を複数の領域に分け、各領域ごとの分
布の比較で各色成分間の類似具合を判断する構成として
ある。
In determining the degree of similarity of distributions, it is not always necessary to use frequency distributions at all gradations for individual comparison, and as a suitable example in such a case, the invention according to claim 3 is The image processing apparatus according to claim 2, wherein the correction control unit divides a gradation range that the gradation color data can have into a plurality of areas, and compares the distributions of the respective areas with each other to determine similarity between color components. It is configured to judge the condition.

【0018】上記のように構成した請求項3にかかる発
明は、分布の類似具合を判断するにあたり、階調表色デ
ータの取りうる階調範囲を複数の領域に分け、それぞれ
の領域毎の分布を各色成分間で比較する。これにより、
各階調ごとにみた分布を比較する労力が低減する。
In the invention according to claim 3 configured as described above, in determining the similarity of the distribution, the gradation range that the gradation color data can take is divided into a plurality of areas, and the distribution for each area is divided. Is compared between each color component. This allows
The effort of comparing the distributions for each gradation is reduced.

【0019】一方、分布の類似具合の判断は、各種の手
法が採用可能であるが、その一例として、請求項4にか
かる発明は、上記請求項2または請求項3のいずれかに
記載の画像処理装置において、上記修正制御手段は、各
色成分の分布を要素とするベクトルの内積に基づいて類
似具合を判断する構成としてある。
On the other hand, various methods can be adopted for determining the similarity of distributions. As an example, the invention according to claim 4 is the image according to claim 2 or claim 3. In the processing device, the correction control means is configured to determine the degree of similarity based on the inner product of vectors having the distribution of each color component as an element.

【0020】ベクトルの内積は互いの相関関係を見る上
で簡易に行える。従って、その手法を採用すべく、分布
自体をベクトル要素と同様に考え、各色相互間で内積を
求める。最も類似具合が大きい場合には「1」となる
し、類似具合が小さければ「0」に近づく。分布をベク
トル要素と考えるにあたり、必ずしも全階調数分の要素
とする必要はなく、請求項3に記載した発明の場合には
全階調範囲をいくつかに分類した領域での分布をベクト
ルの要素とすればよい。
The dot product of the vectors can be easily performed in view of the mutual correlation. Therefore, in order to adopt the method, the distribution itself is considered in the same manner as the vector element, and the inner product is obtained between the respective colors. It becomes "1" when the degree of similarity is the largest, and approaches "0" when the degree of similarity is small. In considering the distribution as a vector element, it is not always necessary to make it the number of elements corresponding to the total number of gradations. In the case of the invention described in claim 3, the distribution in the area in which the entire gradation range is classified into some It should be an element.

【0021】類似具合が小さい場合には特性の均一化を
図らないようにする手法として、類似具合と所定のしき
い値とを比較し、比較結果に基づいて判断を分岐させる
ことが可能である。一方、同様に類似具合が大きい場合
に特性の均一化を図り、類似具合が小さい場合に特性の
均一化を図らないようにする手法として、実効値を制御
する手法も採用可能である。そのような一例として、請
求項5にかかる発明は、請求項2〜請求項4のいずれか
に記載の画像処理装置において、上記特性均一化手段
は、特性の均一化を図るための実効値を利用するととも
に、上記修正制御手段は、この実効値を変化させること
によって実質的に修正を有効化させたり無効化させると
ともに、同実効値を連続的に変化させる構成としてあ
る。
When the degree of similarity is small, it is possible to compare the degree of similarity with a predetermined threshold value and branch the judgment based on the result of the comparison, as a technique for preventing the characteristics from being made uniform. . On the other hand, similarly, a method of controlling the effective value can be adopted as a method of making the characteristics uniform when the degree of similarity is large and not making the characteristics uniform when the degree of similarity is small. As such an example, in the invention according to claim 5, in the image processing device according to any one of claims 2 to 4, the characteristic equalizing means sets an effective value for equalizing the characteristics. In addition to being utilized, the correction control means is configured to substantially enable or disable the correction by changing the effective value and continuously change the effective value.

【0022】上記のように構成した請求項5にかかる発
明は、特性の均一化を図るための実効値を求めており、
この実効値を変化させることによって実質的に修正を有
効化させたり無効化させる。このような制御には窓関数
などが有効であり、より具体的には、有効化させたいと
きに「1」をとるとともに無効化させたいときに「0」
となる窓関数を実効値に積算すればよい。
In the invention according to claim 5 configured as described above, the effective value for uniforming the characteristics is obtained,
Changing this effective value effectively enables or disables the modification. A window function or the like is effective for such control, and more specifically, it takes "1" to enable it and "0" to disable it.
The window function that becomes

【0023】一方、この例で言えば「1」から「0」
へ、あるいは「0」から「1」へ変化する領域において
不連続に変化すると、諧調表色データの取り込み方によ
っては類似具合の判断が微妙に変化してしまうことがあ
る。すると、同じ画像でありながら判断結果が正反対と
なってしまうということも生じる。従って、このような
場合の対策として実効値が連続的に変化するようにして
いる。むろん、窓関数は各種の変形例が可能であるし、
要因によっては例外的な扱いをするべく、類似具合の小
さな領域で実効値を有効とさせたり、その逆の扱いをす
ることも可能である。むろん、ここでいう実効値は、修
正量であるとか補正量であるとかオフセット量であるな
ど、広く修正に関与する値を指すものであるし、上述し
た窓関数についてもこの実効値を演算する過程において
利用される一変数であっても構わない。
On the other hand, in this example, "1" to "0"
If there is a discontinuous change in the area changing from “0” to “1” or “1”, the determination of the degree of similarity may change subtly depending on how the gradation color data is captured. Then, even if the images are the same, the determination result may be the opposite. Therefore, as a countermeasure against such a case, the effective value is continuously changed. Of course, the window function can be modified in various ways,
Depending on the factor, it is possible to make the effective value valid in a small area having a similar condition and to treat it in the opposite way in order to treat it exceptionally. Of course, the effective value here refers to a value that is widely involved in the correction, such as a correction amount, a correction amount, or an offset amount, and this window value is also calculated for the window function described above. It may be one variable used in the process.

【0024】また、一般的には類似具合が小さいことは
機器に起因する色ずれではない。しかしながら、特殊な
照明によって類似具合が極端に変化する場合もある。従
って、類似具合が小さい場合であってもその原因によっ
ては特性の均一化を図ることが有効である場合もある。
従って、一般的には類似具合が小さいときに特性の均一
化を図らないようにしつつも、原因に応じて類似具合が
小さい場合でも特性の均一化を図るようにしてもよい。
例えば、類似具合が極端に小さくなった場合には特性の
均一化を図ることとし、これを実現するために類似度に
対応した窓関数を利用することも可能である。
In general, the degree of similarity is not a color shift due to the device. However, there are cases in which the degree of similarity changes extremely due to special lighting. Therefore, even if the degree of similarity is small, it may be effective to make the characteristics uniform depending on the cause.
Therefore, in general, the characteristics may not be made uniform when the degree of similarity is small, but the characteristics may be made uniform depending on the cause even if the degree of similarity is small.
For example, when the degree of similarity becomes extremely small, it is possible to make the characteristics uniform, and it is also possible to use a window function corresponding to the degree of similarity in order to realize this.

【0025】なお、このように各色成分間の類似具合に
基づいて特性の統一化を図るという思想については、必
ずしも特性統一化の手法が限定されるものではない。従
って、本思想に対応する好適な一例として、請求項18
にかかる発明は、概略対等な色成分からなる階調表色デ
ータによって画像をドットマトリクス状の画素の集合と
して表した画像データについて、同画像データの各成分
値を入力して所定の変換処理を施して出力することによ
り、入力と出力との関係でカラーバランスを修正する変
換が行われるようにした画像処理装置であって、各色成
分ごとに階調表色データの分布の類似程度を求め、この
類似程度が小さい場合にカラーバランスを修正しないよ
うにする構成としてある。
Note that the method of unifying the characteristics is not necessarily limited to the idea of unifying the characteristics based on the degree of similarity between the color components. Therefore, as a preferred example corresponding to the present idea, claim 18
According to the invention, the image data in which the image is represented as a set of pixels in a dot matrix by the gradation color data consisting of substantially equal color components is input with each component value of the image data and a predetermined conversion process is performed. An image processing apparatus that performs conversion to correct the color balance depending on the relationship between input and output by applying and outputting, and obtains the degree of similarity of the distribution of gradation color data for each color component, When the degree of similarity is small, the color balance is not corrected.

【0026】また、請求項19に記載の画像処理方法の
発明においては、概略対等な色成分からなる階調表色デ
ータによって画像をドットマトリクス状の画素の集合と
して表した画像データについて、同画像データの各成分
値を入力して所定の変換処理を施して出力することによ
り、入力と出力との関係でカラーバランスを修正する変
換を行なうにあたり、各色成分ごとに階調表色データの
分布の類似程度を求め、この類似程度が小さい場合にカ
ラーバランスを修正しないようにする構成としてあり、
請求項20に記載のコンピュータによって画像処理する
プログラムを記録した媒体の発明においては、概略対等
な色成分からなる階調表色データによって画像をドット
マトリクス状の画素の集合として表した画像データにつ
いて、同画像データの各成分値を入力して所定の変換処
理を施して出力することにより、入力と出力との関係で
カラーバランスを修正する変換を行うにあたり、各色成
分ごとに階調表色データの分布の類似程度を求め、この
類似程度が小さい場合にカラーバランスを修正しないよ
うにする構成としてある。
Further, in the image processing method of the present invention, the image data represented by a set of pixels in a dot matrix by the gradation color data having substantially equal color components is the same image data. By inputting each component value of the data, applying a predetermined conversion process and outputting it, when performing the conversion to correct the color balance in the relationship between the input and the output, the distribution of the gradation color data for each color component There is a configuration that finds the degree of similarity and does not correct the color balance when the degree of similarity is small,
In the invention of the medium in which the program for performing image processing by the computer according to claim 20 is recorded, the image data in which the image is represented as a set of pixels in a dot matrix by the gradation color specification data composed of substantially equal color components, By inputting each component value of the same image data, performing a predetermined conversion process and outputting it, when performing conversion for correcting the color balance in relation to the input and output, the gradation color data of each color component is The degree of similarity of distribution is obtained, and when the degree of similarity is small, the color balance is not corrected.

【0027】このように構成した請求項18〜請求項2
0にかかる発明においても、各色成分ごとに階調表色デ
ータの分布の類似程度を求め、この類似程度が小さい場
合にカラーバランスを修正しないようにさせる。
Claims 18 to 2 configured as described above
Also in the invention according to 0, the similarity of the distribution of the gradation color data is obtained for each color component, and when the similarity is small, the color balance is not corrected.

【0028】一方、上述したような分布を求める際に、
必ずしも全画素を同等に扱わなければならないわけでは
ない。そして、その一例として、請求項6にかかる発明
は、上記請求項1〜請求項5のいずれかに記載の画像処
理装置において、上記特性均一化手段は、各色成分の階
調表色データが近似している画素を上記分布の対象とす
る構成としてある。
On the other hand, when obtaining the distribution as described above,
Not all pixels have to be treated equally. As an example thereof, the invention according to claim 6 is the image processing apparatus according to any one of claims 1 to 5, wherein the characteristic equalizing means approximates the gradation color data of each color component. It is configured such that the pixels that are subject to the above distribution are targeted.

【0029】本来、人が画像を見て色ずれを判断できる
のは、無彩色であろうものに色が付いているような場合
である。すなわち、赤いものだけを見ている場合には本
来の色を知らない限り色ずれか否かは判断できない。従
って、無彩色の画素だけについて特性のばらつきを見る
のも各色間のバランスを検討するには有効といえる。こ
のため、特性均一化手段は各画素毎に、各色成分の階調
表色データが互いに近似しているか否かを判断し、近似
している場合にのみ分布の対象として計数し、このよう
にして得られた分布に基づいて特性の均一化を図るよう
にしている。
Originally, a person can judge a color misregistration by looking at an image when an achromatic color appears. That is, when only looking at a red object, it is impossible to judge whether or not there is a color shift unless the original color is known. Therefore, it can be said that it is effective to examine the characteristic variation only for the achromatic pixels in order to examine the balance between the colors. For this reason, the characteristic equalizing means determines, for each pixel, whether or not the gradation color data of each color component are close to each other, and if they are close to each other, counts them as an object of distribution, and The characteristics are made uniform based on the obtained distribution.

【0030】各画素における色成分の階調表色データが
近似しているか否かは、最大値と最小値とを求めてその
差で判断すればよい。また、極値のデータは飽和してい
る可能性も大きいので扱わないとすることも可能であ
る。
Whether or not the gradation color data of the color components in each pixel are similar to each other can be determined by obtaining the maximum value and the minimum value and judging from the difference. It is also possible that the extreme value data is not handled because it is highly possible that it is saturated.

【0031】ところで、特性の均一化を図る一例とし
て、請求項7にかかる発明は、上記請求項1〜請求項6
に記載の画像処理装置において、上記特性均一化手段
は、上記分布における所定位置から特性を判断し、当該
特性が均一化するように各成分間のずれに対応するオフ
セット量を求めて各成分値を修正する構成としてある。
By the way, as an example for achieving uniform characteristics, the invention according to claim 7 is the above-mentioned claim 1 to claim 6.
In the image processing device described in (1), the characteristic equalizing means determines the characteristic from a predetermined position in the distribution, obtains an offset amount corresponding to the deviation between the components so that the characteristic becomes uniform, and calculates each component value. Is to be modified.

【0032】上記のように構成した請求項7にかかる発
明においては、各色成分毎に分布を求める過程を含め
て、上端や下端、平均値やメジアンや最頻値といったい
くつかの位置が求められることになるが、これらから各
成分毎の特性を見出すことが可能となる。そして、これ
らの各成分間でのずれが具体的な色ずれの一要因となり
うる特性であると考えられるので、同ずれに対応するオ
フセット量を求めて各成分値を修正する。
In the invention according to claim 7 configured as described above, some positions such as an upper end and a lower end, an average value, a median and a mode value are obtained, including a process of obtaining a distribution for each color component. However, it is possible to find out the characteristics of each component from these. Then, it is considered that the shift between these respective components is a characteristic that can be a factor of a specific color shift, so that the offset amount corresponding to the same shift is obtained and each component value is corrected.

【0033】具体的な位置の一例として、請求項8にか
かる発明は、上記請求項7に記載の画像処理装置におい
て、上記特性均一化手段は、上記分布の範囲の端部位置
を当該分布の特性と判断する構成としてある。
As an example of a specific position, the invention according to claim 8 is the image processing apparatus according to claim 7, wherein the characteristic equalizing means sets the end position of the range of the distribution to the distribution position. It is configured to be judged as a characteristic.

【0034】上記のように構成した請求項8にかかる発
明においては、分布の範囲の端部位置である上端や下端
位置を当該分布の特性とみなして各成分間のずれを求め
る。
In the invention according to claim 8 configured as described above, the shift between the respective components is obtained by regarding the upper and lower end positions, which are the end positions of the distribution range, as the characteristics of the distribution.

【0035】個々の分布を見れば極めて多様な分布も上
端位置であるとか下端位置であれば画一的に定まりやす
く、特性の取得が容易となる。
Looking at the individual distributions, extremely diverse distributions are easily determined uniformly at the upper end position or the lower end position, and the characteristics can be easily obtained.

【0036】また、他の一例として、請求項9にかかる
発明は、上記請求項7または請求項8のいずれかに記載
の画像処理装置において、上記特性均一化手段は、上記
分布の略中央位置を当該分布の特性と判断する構成とし
てある。
As another example, the invention according to claim 9 is the image processing apparatus according to claim 7 or 8, wherein the characteristic equalizing means is provided at a substantially central position of the distribution. Is determined as the characteristic of the distribution.

【0037】上記のように構成した請求項9にかかる発
明においては、分布の略中央位置である平均値やメジア
ンや最頻値といった位置を当該分布の特性とみなして各
成分間のずれを求める。
In the invention according to claim 9 configured as described above, the deviation between the respective components is obtained by regarding the positions such as the average value, the median and the mode which are the substantially central positions of the distribution as the characteristics of the distribution. .

【0038】同様に極めて多様な分布も略中央位置であ
る平均値やメジアンや最頻値といった位置であれば画一
的に定まりやすく、特性の取得が容易となる。
Similarly, extremely diverse distributions are easily determined uniformly at positions such as an average value, a median, and a mode value, which are substantially central positions, and characteristics can be easily acquired.

【0039】一般の画像においては、各成分毎に成分の
絶対値に差はあるものの分布の広がりというものについ
てはさほど変化がないことが多い。従って、かかる広が
り量については各成分において均一化している方が自然
であるといえる。このため、請求項10にかかる発明
は、上記請求項1〜請求項9のいずれかに記載の画像処
理装置において、上記特性均一化手段は、各色成分ごと
の上記分布の広がりを略均一化させる構成としてある。
In a general image, although there are differences in the absolute value of each component, the spread of the distribution does not change much in many cases. Therefore, it can be said that it is more natural for each component to have a uniform spread amount. Therefore, the invention according to claim 10 is the image processing apparatus according to any one of claims 1 to 9, wherein the characteristic equalizing means substantially equalizes the spread of the distribution for each color component. It is as a configuration.

【0040】上記のように構成した請求項10にかかる
発明においては、各成分値ごとの上記分布の広がりを求
め、略均一化させるように変換処理を行う。
In the invention according to claim 10 configured as described above, the spread of the distribution is obtained for each component value, and the conversion processing is performed so as to make the distribution substantially uniform.

【0041】分布の広がりの観念は各種の把握が可能で
あり、特定のものに限定される必要はなく、その一例と
して、請求項11にかかる発明は、上記請求項10に記
載の画像処理装置において、上記特性均一化手段は、上
記分布の広がりの両端を有効な階調範囲内で拡大させる
構成としてある。
The idea of the spread of the distribution can be grasped in various ways and is not limited to a particular one. As an example, the invention according to claim 11 is the image processing apparatus according to claim 10. In the above, the characteristic equalizing means is configured to expand both ends of the spread of the distribution within an effective gradation range.

【0042】上記のように構成した請求項11にかかる
発明においては、分布が山形をなすものとしてその裾野
の両端で分布の幅が分かるため、この幅を有効な階調範
囲内で拡大させるように変換する。例えば、分布の幅が
有効な階調の幅の一部にしかすぎないようであれば、コ
ントラストの弱い画像といえるが、このような場合に有
効な階調範囲の全幅にわたって分布が広がるように拡大
させる。各色成分毎に有効な階調範囲の全幅にわたって
分布が広がるように拡大すれば、分布の幅という特性に
おいて均一化する。なお、この場合の分布の幅は、現実
の分布の幅のみならず、両端部分を所定量だけカットし
てしまうなどして誤差範囲などを省略させるようなもの
でも構わない。
In the invention according to claim 11 configured as described above, since the width of the distribution is known at both ends of the skirt assuming that the distribution has a mountain shape, this width is expanded within the effective gradation range. Convert to. For example, if the width of the distribution is only a part of the width of the effective gradation, it can be said that the image has low contrast. In such a case, the distribution should be spread over the entire width of the effective gradation range. Expand. If the distribution is expanded so as to spread over the entire width of the effective gradation range for each color component, the characteristic of the distribution width is made uniform. The width of the distribution in this case is not limited to the width of the actual distribution, and may be such that the error range is omitted by cutting both end portions by a predetermined amount.

【0043】また、他の一例として、請求項12にかか
る発明は、上記請求項10に記載の画像処理装置におい
て、上記特性均一化手段は、同分布の広がり量に基づい
て分布密度の大きい範囲に多くの階調数を与えつつ分布
密度の小さい範囲に少ない階調数を割り当てる構成とし
てある。
As another example, in the invention according to claim 12, in the image processing apparatus according to claim 10, the characteristic equalizing means has a range in which the distribution density is large based on the spread amount of the same distribution. While a large number of gradations are given to the above, a small number of gradations is assigned to a range having a small distribution density.

【0044】上記のように構成した請求項12にかかる
発明においては、特性均一化手段が各成分毎の分布の広
がり量を求め、求めた分布に基づいて各成分毎に分布密
度の大きい範囲に多くの階調数を与えつつ分布密度の小
さい範囲に少ない階調数を割り当てる。この広がり量の
概念は分布の幅と同様に分布の散らばり方に対応するも
のであり、数学的表現であれば標準偏差であったり分散
であったりあるいは尖度などといったものが該当しう
る。このような広がり量としての特性が各成分毎に一致
するように近づけるにあたり、分布密度の大きな部分が
許容可能な範囲内で広がるように変換すると、各成分毎
にずれていた広がり量の一致を見ることが可能となると
ともに、分布が一部範囲に集中してしまうことなく有効
な範囲をできる限り利用して分布することになるので、
全体的にコントラストが強調されることになる。むろ
ん、広がり量は標準偏差、分散あるいは尖度以外のもの
でもよいし、また、これらにおいても厳密な意味での計
算を要するものではなく、演算の簡略化などを図ること
もできる。
According to the twelfth aspect of the invention configured as described above, the characteristic homogenizing means obtains the spread amount of the distribution of each component, and based on the obtained distribution, the distribution density of each component is set to a large range. While giving a large number of gradations, a small number of gradations is assigned to a range having a small distribution density. The concept of the spread amount corresponds to the distribution of the distribution as well as the width of the distribution, and may be a standard deviation, a variance, or a kurtosis in mathematical expression. When the characteristics such as the spread amount are approached so as to match each component, when the portion with a large distribution density is converted to spread within the allowable range, the spread amount that has been shifted for each component is matched. It will be possible to see, and the distribution will be distributed using the effective range as much as possible without being concentrated in a part of the range.
The overall contrast will be emphasized. Of course, the spread amount may be other than the standard deviation, the variance, or the kurtosis, and these do not require calculation in the strict sense, and the calculation can be simplified.

【0045】さらに、請求項13にかかる発明は、上記
請求項1〜請求項12のいずれかに記載の画像処理装置
において、上記特性均一化手段は、各成分毎の分布に基
づく明るさを均一化させる構成としてある。
Further, the invention according to claim 13 is the image processing apparatus according to any one of claims 1 to 12, wherein the characteristic equalizing means uniformizes the brightness based on the distribution of each component. It is configured to be converted.

【0046】上記のように構成した請求項13にかかる
発明においては、各成分毎の分布において明るさが不均
一であるが故に色ずれのように見えることがありうるた
め、特性均一化手段は各成分毎の分布に基づく明るさを
均一化させる。ここにおける明るさは分布の全体的な位
置を表し、例えば、分布が全体的に明るい側に位置すれ
ば明るいと見なすし、全体的に暗い側に位置すれば暗い
と見なす。
According to the thirteenth aspect of the present invention configured as described above, since the brightness of the distribution of each component is non-uniform, it may look like a color shift. The brightness based on the distribution of each component is made uniform. The brightness here represents the overall position of the distribution. For example, if the distribution is located on the overall bright side, it is considered bright, and if it is located on the overall dark side, it is considered dark.

【0047】むろん、全体の明るさの判断の手法は適宜
変更可能であるし、また、明るくするか暗くするかの修
正手法も適宜各種の手法を採用可能であるが、その一例
として、請求項14にかかる発明は、上記請求項13に
記載の画像処理装置において、上記特性均一化手段は、
上記分布の略中央位置と所定階調との比較において画像
の明暗を判断する構成としてある。
Of course, the method for judging the overall brightness can be changed as appropriate, and various correction methods for brightening or darkening can also be adopted as appropriate. According to a fourteenth aspect of the present invention, in the image processing apparatus according to the thirteenth aspect, the characteristic equalizing means is
The lightness and darkness of the image is determined by comparing the approximate center position of the distribution with a predetermined gradation.

【0048】上記のように構成した請求項14にかかる
発明においては、分布の略中央位置を有効な階調範囲の
所定階調と比較し、比較結果に基づいて画像の明暗を判
断する。
According to the fourteenth aspect of the invention configured as described above, the substantially central position of the distribution is compared with a predetermined gradation in the effective gradation range, and the lightness or darkness of the image is judged based on the comparison result.

【0049】例えば、分布を求める際に得られるメジア
ンは当該分布の中央位置としての条件を備えるが、かか
るメジアンが全階調数内の中央値よりも大きいか小さい
かで、全体としての明るさが明るいか暗いかを判断する
ことが可能である。
For example, the median obtained when obtaining the distribution has a condition as the center position of the distribution, but the overall brightness depends on whether the median is larger or smaller than the median value in all the gradation numbers. It is possible to determine whether is bright or dark.

【0050】また、請求項15にかかる発明は、上記請
求項13または請求項14に記載の画像処理装置におい
て、上記特性均一化手段は、画像の明暗の判断結果に基
づいて各成分毎にγ補正で画像の明暗を均一化させる構
成としてある。
According to a fifteenth aspect of the present invention, in the image processing apparatus according to the thirteenth or the fourteenth aspect, the characteristic equalizing means sets γ for each component based on the determination result of the brightness of the image. It is configured to make the lightness and darkness of the image uniform by correction.

【0051】上記のように構成した請求項15にかかる
発明においては、各種の手法にて画像の明暗を判断した
後、同判断結果に基づいて各成分毎にγ補正で画像の明
暗を均一化させる。例えば、画像が暗いようであればγ
<1としたγ補正によって全体的に明るく修正すること
になり、同メジアンは全階調数の中央値に近づくし、明
るいようであればγ>1としたγ補正によって全体的に
暗く修正することになり、同メジアンは全階調数の中央
値に近づくことになる。
According to the fifteenth aspect of the invention configured as described above, after determining the lightness / darkness of the image by various methods, the lightness / darkness of the image is made uniform by γ correction for each component based on the determination result. Let For example, if the image looks dark γ
When the γ correction is set to <1, it is corrected to be bright as a whole, and the same median approaches the median value of all gradations. If it is bright, the γ correction is set to γ> 1 to be corrected to be dark as a whole. That is, the same median comes close to the median of all the gradation numbers.

【0052】このようにカラーバランスのずれを各色成
分毎の分布の比較に基づいて判断する手法は必ずしも実
体のある装置に限られるものではなく、その一例とし
て、請求項16にかかる発明は、概略対等な色成分から
なる階調表色データによって画像をドットマトリクス状
の画素の集合として表した画像データについて、同画像
データの各成分値を入力して所定の変換処理を施して出
力することにより、入力と出力との関係でカラーバラン
スを修正する変換を行うにあたり、各色成分毎に階調表
色データの分布を求めるとともに各色成分の間でのずれ
を求め、求められたずれに基づいて各色成分間の特性の
均一化を図る構成としてある。
As described above, the method of judging the deviation of the color balance based on the comparison of the distributions of the respective color components is not necessarily limited to the actual apparatus. As an example, the invention according to claim 16 By inputting each component value of the image data representing the image as a set of pixels in a dot matrix with gradation color data consisting of equal color components, applying a predetermined conversion process and outputting , When performing conversion to correct the color balance based on the relationship between input and output, find the distribution of the gradation color data for each color component, find the deviation between each color component, and calculate each color based on the found deviation. It is configured to make the characteristics of the components uniform.

【0053】すなわち、必ずしも実体のある装置に限ら
ず、その方法としても有効であることに相違はない。
That is, there is no difference in that the method is not limited to a substantial device and is effective as a method.

【0054】ところで、このような画像処理装置は単独
で存在する場合もあるし、ある機器に組み込まれた状態
で利用されることもあるなど、発明の思想としては、各
種の態様を含むものである。また、ソフトウェアであっ
たりハードウェアであったりするなど、適宜、変更可能
である。
By the way, such an image processing device may exist as a single device or may be used in a state of being incorporated in a certain device. The idea of the invention includes various modes. Further, it can be changed as appropriate such as software or hardware.

【0055】その一例として、概略対等な色成分につい
ての階調表色データからなるドットマトリクス状の画像
データに基づいて印刷インクに対応した画像データに変
換し、所定のカラープリンタに印刷せしめるプリンタド
ライバにおいても、各色成分毎に階調表色データの分布
を求め、同分布から各成分間の特性を均一化させ、その
ように均一化させた画像データに基づいて印刷を図る構
成とすることができる。
As an example thereof, a printer driver for converting image data corresponding to printing ink based on dot matrix image data composed of gradation color data for color components which are substantially equal to each other and printing the image data on a predetermined color printer. Also in this case, it is possible to obtain a distribution of gradation color data for each color component, make the characteristics of each component uniform from the distribution, and perform printing based on the image data thus made uniform. it can.

【0056】このようにした場合には、プリンタドライ
バは入力された画像データを印刷インクに対応して変換
するが、このときに画像データにおける各色成分毎に分
布を求め、その分布から見出される特性が各色成分間で
均一となるように変換して印刷する。すなわち、各色成
分毎に得られる分布を比較してかかる分布が一致するよ
うな修正を行うことにより、全体としてのカラーバラン
スが調整されるとともに各画素の個々の色においても良
好な発色となる。
In this case, the printer driver converts the input image data in correspondence with the printing ink. At this time, the distribution is obtained for each color component in the image data, and the characteristics found from the distribution are obtained. Is printed so that each color component becomes uniform. That is, by comparing the distributions obtained for the respective color components and making a correction so that the distributions match, the color balance as a whole is adjusted and good color development is achieved even for the individual colors of each pixel.

【0057】発明の思想の具現化例として画像処理装置
のソフトウェアとなる場合には、かかるソフトウェアを
記録した記録媒体上においても当然に存在し、利用され
るといわざるをえない。
When it comes to software of an image processing apparatus as an example of embodying the idea of the invention, it must be said that it naturally exists on a recording medium recording such software and is used.

【0058】その一例として、請求項17にかかる発明
は、コンピュータによって画像処理するプログラムを記
録した媒体であって、概略対等な色成分からなる階調表
色データによって画像をドットマトリクス状の画素の集
合として表した画像データについて、同画像データの各
成分値を入力して所定の変換処理を施して出力すること
により、入力と出力との関係でカラーバランスを修正す
る変換を行うにあたり、各色成分毎に階調表色データの
分布を求めるとともに各色成分の間でのずれを求め、求
められたずれに基づいて各色成分間の特性の均一化を図
る構成としてある。
As an example thereof, the invention according to claim 17 is a medium in which a program for image processing by a computer is recorded, wherein an image is formed of pixels in a dot matrix by gradation gradation color data consisting of substantially equal color components. For the image data represented as a set, each component value of the same image data is input, subjected to a predetermined conversion process and output, so that the color balance is corrected in the relation between the input and the output. The distribution of the gradation color data is calculated for each color, the deviation between the color components is calculated, and the characteristics of the color components are made uniform based on the calculated deviation.

【0059】むろん、その記録媒体は、磁気記録媒体で
あってもよいし光磁気記録媒体であってもよいし、今後
開発されるいかなる記録媒体においても全く同様に考え
ることができる。また、一次複製品、二次複製品などの
複製段階については全く問う余地無く同等である。その
他、供給方法として通信回線を利用して行なう場合でも
本発明が利用されていることには変わりない。この場
合、通信回線を利用してソフトウェアを提供する側はソ
フトウェア提供装置として機能するものであり、同様に
本発明を利用していることに相違ない。
Of course, the recording medium may be a magnetic recording medium or a magneto-optical recording medium, and any recording medium developed in the future can be considered in exactly the same manner. In addition, the duplication stage of the primary duplication product, the secondary duplication product, and the like is absolutely the same. In addition, the present invention is still used even when a communication line is used as a supply method. In this case, the side that provides the software using the communication line functions as a software providing device, and it must be the same as the present invention.

【0060】さらに、一部がソフトウェアであって、一
部がハードウェアで実現されている場合においても発明
の思想において全く異なるものはなく、一部を記録媒体
上に記憶しておいて必要に応じて適宜読み込まれるよう
な形態のものとしてあってもよい。さらには、カラーフ
ァクシミリ機、カラーコピー機、カラースキャナ、デジ
タルスチルカメラ、デジタルビデオカメラなどの画像処
理装置においても適用可能であることはいうまでもな
い。
Further, even if a part is software and a part is realized by hardware, there is no difference in the idea of the invention, and it is necessary to store a part on a recording medium. It may be in such a form that it is read as appropriate. Further, it goes without saying that the present invention can also be applied to image processing apparatuses such as color facsimile machines, color copiers, color scanners, digital still cameras, digital video cameras and the like.

【0061】[0061]

【発明の効果】以上説明したように本発明は、各成分毎
の分布の均一化という概念により、根本的に判断が困難
な色ずれの判断を自動化でき、より容易にカラーバラン
スを調整することが可能な画像処理装置を提供すること
ができる。
As described above, according to the present invention, it is possible to automate the judgment of color shift, which is basically difficult to judge, by the concept of uniform distribution of each component, and to adjust the color balance more easily. It is possible to provide an image processing device capable of performing the above.

【0062】また、請求項2にかかる発明によれば、分
布の類似具合が小さいときにはあえて特性の均一化を図
らないため、カラーバランスがずれているのが当然の場
合に特性の均一化を図って不自然な画像となってしまう
ことを防止することができるし、請求項3にかかる発明
によれば、階調範囲を複数の領域に分けて分布を求める
ので比較が容易となり、請求項4にかかる発明によれ
ば、各色成分毎の分布を要素とするベクトル同士の内積
に基づいて類似具合を判断するため、判断が容易とな
り、さらに、請求項5にかかる発明によれば、特性の均
一化を図るための実効値を連続的に変化させることによ
り、画像処理結果に不連続性を発生させにくくすること
ができる。
Further, according to the second aspect of the invention, when the degree of similarity of distribution is small, the characteristics are not made uniform, so that the characteristics are made uniform when the color balance is naturally deviated. It is possible to prevent an unnatural image from being generated, and according to the invention of claim 3, the gradation range is divided into a plurality of areas to obtain the distribution, so that comparison is facilitated. According to the invention described above, the degree of similarity is determined based on the inner product of the vectors having the distribution of each color component as an element, which facilitates the determination. Further, according to the invention of claim 5, the characteristics are uniform. By continuously changing the effective value for achieving the conversion, it is possible to prevent discontinuity in the image processing result.

【0063】さらに、請求項6にかかる発明によれば、
本来的に階調表色データが近似している画素をピックア
ップして特性の判断に利用するため、特性のバラツキを
求めるのに有効となる。
Further, according to the invention of claim 6,
Pixels that are originally similar in gradation color data are picked up and used to determine the characteristics, which is effective in obtaining the variations in the characteristics.

【0064】さらに、請求項7にかかる発明によれば、
分布の位置のずれを利用するため、比較的容易に各成分
間のオフセット量を判断できる。
Further, according to the invention of claim 7,
Since the shift of the distribution position is used, the offset amount between each component can be determined relatively easily.

【0065】さらに、請求項8にかかる発明によれば、
分布の端部は画一的に判断しやすく、判断が容易とな
る。
Further, according to the invention of claim 8,
The end of the distribution is easy to determine uniformly, and the determination is easy.

【0066】さらに、請求項9にかかる発明によれば、
分布密度の多い位置でのずれを利用するため、全体のず
れの修正における誤差が少ない。
Further, according to the invention of claim 9,
Since the shift at the position where the distribution density is high is used, the error in correcting the total shift is small.

【0067】さらに、請求項10にかかる発明によれ
ば、分布の広がりを均一化させるため、各色成分毎に有
効な階調数を有効に利用していないような場合に効率よ
く発色させることができ、メリハリを利かせることがで
きる。
Further, according to the tenth aspect of the invention, since the spread of the distribution is made uniform, it is possible to efficiently develop the color when the effective number of gradations for each color component is not effectively utilized. You can do it, and you can make the difference.

【0068】さらに、請求項11にかかる発明によれ
ば、判断の容易な分布の広がりの両端を用いて分布を拡
大させるため、判断する構成が容易となる。
Further, according to the eleventh aspect of the present invention, the distribution is expanded by using both ends of the spread of the distribution that can be easily judged, so that the structure for making the judgment becomes easy.

【0069】さらに、請求項12にかかる発明によれ
ば、数学的な手法などによる広がり量を利用するため、
より正確な判断が可能となる。
According to the twelfth aspect of the invention, since the spread amount by a mathematical method is used,
More accurate judgment is possible.

【0070】さらに、請求項13にかかる発明によれ
ば、各成分毎の明るさの均一化により、いずれかの成分
だけが突出して生じるような色ずれを解消することがで
きる。
Further, according to the thirteenth aspect of the present invention, by making the brightness of each component uniform, it is possible to eliminate a color shift in which only one component is projected.

【0071】さらに、請求項14にかかる発明によれ
ば、分布の概略中央値をもってして明るさの判断とする
ので容易となる。
Further, according to the fourteenth aspect of the present invention, the brightness is judged by using the approximate median value of the distribution, which is easy.

【0072】さらに、請求項15にかかる発明によれ
ば、γ補正で明暗を変化させて明るさの均一化を図って
おり、γ補正は広く利用されているので構成が容易とな
る。
Further, according to the fifteenth aspect of the present invention, the brightness is made uniform by changing the lightness and darkness by the γ correction, and the γ correction is widely used, so that the configuration is easy.

【0073】さらに、請求項16にかかる発明によれ
ば、各成分毎の分布の均一化という概念により、根本的
に判断が困難な色ずれの判断を自動化でき、より容易に
カラーバランスを調整することが可能な画像処理方法を
提供することができる。
Further, according to the sixteenth aspect of the invention, the concept of uniform distribution of each component makes it possible to automate the determination of the color shift, which is basically difficult to determine, and adjust the color balance more easily. It is possible to provide a possible image processing method.

【0074】さらに、請求項17にかかる発明によれ
ば、このような画像処理を行なうプログラムを記録した
媒体を提供することができる。
Further, according to the seventeenth aspect of the present invention, it is possible to provide a medium in which a program for performing such image processing is recorded.

【0075】そして、請求項18〜請求項20にかかる
発明おいては、特性の均一化の手法に関わらず、分布の
類似具合が小さいときにはあえて特性の均一化を図らな
いようにして、カラーバランスがずれているのが当然の
場合に特性の均一化を図って不自然な画像となってしま
うことを防止することができる。
In the eighteenth to twentieth aspects of the present invention, regardless of the method of uniformizing the characteristics, when the degree of similarity in distribution is small, the characteristics are not made uniform, and the color balance is set. It is possible to prevent the occurrence of an unnatural image by homogenizing the characteristics when the deviation is natural.

【0076】[0076]

【発明の実施の形態】以下、図面にもとづいて本発明の
実施形態を説明する。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be described below with reference to the drawings.

【0077】図1は、本発明の一実施形態にかかる画像
処理システムをブロック図により示しており、図2は具
体的ハードウェア構成例をブロック図により示してい
る。
FIG. 1 is a block diagram showing an image processing system according to an embodiment of the present invention, and FIG. 2 is a block diagram showing a concrete hardware configuration example.

【0078】同図において、画像入力装置10は画像を
撮像するなどして画像データを画像処理装置20へ出力
し、同画像処理装置20は特性を均一化するなどの画像
処理を行なって画像出力装置30に出力し、同画像出力
装置30はコントラストを強調された画像を表示する。
In the figure, the image input device 10 outputs image data to the image processing device 20 by picking up an image, etc., and the image processing device 20 performs image processing such as equalizing the characteristics and outputs the image. The image is output to the device 30, and the image output device 30 displays the image in which the contrast is enhanced.

【0079】ここにおいて、画像入力装置10の具体例
はスキャナ11やデジタルスチルカメラ12あるいはビ
デオカメラ14などが該当し、画像処理装置20の具体
例はコンピュータ21とハードディスク22などからな
るコンピュータシステムが該当し、画像出力装置30の
具体例はプリンタ31やディスプレイ32等が該当す
る。むろん、これら以外にもカラーコピー機やカラーフ
ァクシミリ機などにも適用可能である。
Here, a specific example of the image input device 10 corresponds to the scanner 11, the digital still camera 12 or the video camera 14, and a specific example of the image processing device 20 corresponds to a computer system including a computer 21 and a hard disk 22. However, a specific example of the image output device 30 corresponds to the printer 31, the display 32, or the like. Of course, in addition to these, it can be applied to a color copying machine, a color facsimile machine, and the like.

【0080】本画像処理システムにおいては、色ずれに
代表されるような色再現性の悪い画像を修正しようとし
ているものであるから、画像入力装置10としてのスキ
ャナ11で写真を撮像した画像データであるとか、デジ
タルスチルカメラ12で撮影した画像データであると
か、ビデオカメラ14で撮影した動画画像などが処理の
対象となり、画像処理装置20としてのコンピュータシ
ステムに入力される。なお、ビデオカメラ14の入力画
像については、演算速度が間に合わないこともあり得
る。そのような場合には演算時間を要する最初の条件設
定を撮影のシーンごとに行っておき、撮影中は同じ条件
設定のもとで各フレームの画像変換だけを行なうという
ことによって対処可能である。
Since this image processing system is intended to correct an image having poor color reproducibility represented by color shift, image data obtained by taking a photograph with the scanner 11 as the image input device 10 is used. For example, image data captured by the digital still camera 12, moving image captured by the video camera 14, or the like is subjected to processing, and is input to the computer system as the image processing apparatus 20. The calculation speed of the input image of the video camera 14 may not be in time. In such a case, it can be dealt with by performing the first condition setting requiring a calculation time for each shooting scene and only performing image conversion of each frame under the same condition setting during shooting.

【0081】本画像処理装置20は、少なくとも、各色
成分毎の度数分布を求める度数分布検出手段と、この検
出された各色成分毎の度数分布の類似具合を判断する類
似具合判断手段と、度数分布から各色成分のずれを判定
して均一化する修正を行なうオフセット量修正手段と、
度数分布から各色成分毎のコントラストの強弱のずれを
判定して均一化する修正を行うコントラスト修正手段
と、度数分布から各色成分毎の明るさのずれを判定して
均一化する修正を行う明るさ修正手段とを構成する。む
ろん、本画像処理装置20は、この他にも機種毎による
色の違いを補正する色変換手段であったり、機種毎に対
応した解像度を変換する解像度変換手段などを構成して
いても構わない。この例では、コンピュータ21はRA
Mなどを使用しながら、内部のROMやハードディスク
22に保存されている各画像処理のプログラムを実行し
ていく。また、これらのプログラムを記録するにあたっ
ては、図29に示すように、フレキシブルディスク41
や、CD−ROM42のような可搬性のある媒体はもち
ろんのこと、ハードディスク43にインストールされた
状態であるとか、ROM44やRAM45を有するIC
カードであるとか、あるいは、モデム46b等を介して
通信回線46aを媒体とすることも可能である。この場
合、通信回線46aの先にはファイルサーバ46cが接
続され、当該ファイルサーバ46cが所定のソフトウェ
アを提供する。
The image processing apparatus 20 includes at least a frequency distribution detecting means for obtaining a frequency distribution for each color component, a similarity degree determining means for determining a similarity degree of the detected frequency distribution for each color component, and a frequency distribution. From the offset amount correction means for determining the deviation of each color component from the
Contrast correction means that corrects the deviation of the contrast of each color component from the frequency distribution to make it uniform, and brightness that makes the correction to make uniform by judging the deviation of the brightness of each color component from the frequency distribution. And a correction means. Of course, the image processing apparatus 20 may also be configured as a color conversion unit that corrects a color difference depending on the model or a resolution conversion unit that converts a resolution corresponding to each model. . In this example, computer 21 is RA
While using M or the like, each image processing program stored in the internal ROM or hard disk 22 is executed. Further, in recording these programs, as shown in FIG.
In addition to a portable medium such as a CD-ROM 42, it is installed in the hard disk 43, or an IC having a ROM 44 and a RAM 45.
It may be a card, or the communication line 46a may be used as a medium via a modem 46b or the like. In this case, the file server 46c is connected to the end of the communication line 46a, and the file server 46c provides the predetermined software.

【0082】この画像処理のプログラムの実行結果は後
述するように色再現性を修正したメリハリのある画像デ
ータとして得られ、得られた画像データに基づいて画像
出力装置30であるプリンタ31で印刷したり、同じ画
像出力装置30であるディスプレイ32に表示する。な
お、この画像データは、より具体的にはRGB(緑、
青、赤)それぞれについて「256」階調の階調データ
となっており、また、画像は縦方向(height)と
横方向(width)に格子状に並ぶドットマトリクス
データとして構成されている。
The execution result of this image processing program is obtained as sharp image data whose color reproducibility is corrected as described later, and is printed by the printer 31 which is the image output device 30 based on the obtained image data. Alternatively, it is displayed on the display 32 which is the same image output device 30. Note that this image data is more specifically RGB (green,
The gradation data of "256" gradation is set for each of blue and red, and the image is configured as dot matrix data arranged in a grid in the vertical direction (height) and the horizontal direction (width).

【0083】本実施形態においては、画像の入出力装置
の間にコンピュータシステムを組み込んで画像処理を行
うようにしているが、必ずしもかかるコンピュータシス
テムを必要とする訳ではなく、図3に示すようにデジタ
ルスチルカメラ12a内に色再現性などを修正する意味
での画像処理装置を組み込み、変換した画像データを用
いてディスプレイ32aに表示させたりプリンタ31a
に印字させるようなシステムであっても良い。また、図
4に示すように、コンピュータシステムを介することな
く画像データを入力して印刷するプリンタ31bにおい
ては、スキャナ11bやデジタルスチルカメラ12bあ
るいはモデム13b等を介して入力される画像データに
ついて自動的に色再現性を修正するように構成すること
も可能である。
In this embodiment, a computer system is incorporated between image input / output devices to perform image processing. However, such a computer system is not necessarily required, and as shown in FIG. An image processing device for correcting color reproducibility and the like is incorporated into the digital still camera 12a, and the converted image data is used for displaying on the display 32a or the printer 31a.
It may be a system for printing on. Further, as shown in FIG. 4, in the printer 31b that inputs and prints image data without passing through a computer system, image data input through the scanner 11b, the digital still camera 12b, the modem 13b, or the like is automatically detected. It is also possible to modify the color reproducibility.

【0084】コンピュータ21にて実行する画像処理の
内、度数分布検出手段と類似具合判断手段とに相当する
処理を図5に示しており、各色成分毎の類似度が小さく
ない場合に実行されるオフセット量修正手段とコントラ
スト修正手段と明るさ修正手段とに相当する処理を図6
に示している。なお、類似具合判断手段は広義の意味に
おいて類似具合に基づいて後段の処理の実効を制御する
制御手段も構成しているといえる。
Of the image processing executed by the computer 21, the processing corresponding to the frequency distribution detecting means and the similarity determining means is shown in FIG. 5, which is executed when the similarity for each color component is not small. The processing corresponding to the offset amount correction means, the contrast correction means, and the brightness correction means is shown in FIG.
Is shown in. It can be said that the similarity determination unit also constitutes a control unit that controls the effectiveness of the subsequent processing based on the similarity in a broad sense.

【0085】図5は主に各色成分毎の度数分布を検出す
る処理に該当しており、まず、分布対象となる画素につ
いて説明する。
FIG. 5 mainly corresponds to the process of detecting the frequency distribution of each color component. First, the pixels to be distributed will be described.

【0086】全画素について度数分布を求めてもよい
が、特性の傾向を判断することが目的であるため、必ず
しも全画素についての度数分布を求める必要もない。従
って、ある誤差の範囲内となる程度に間引きを行うこと
が可能である。本実施形態においては、図5のステップ
S102で示すように対象となる画素を間引く間引き処
理を実行する。統計的誤差によれば、サンプル数Nに対
する誤差は概ね1/(N**(1/2))と表せる。ただ
し、**は累乗を表している。従って、1%程度の誤差で
処理を行うためにはN=10000となる。
The frequency distribution may be obtained for all pixels, but since the purpose is to determine the tendency of characteristics, it is not always necessary to obtain the frequency distribution for all pixels. Therefore, it is possible to perform thinning to the extent that it falls within a certain error range. In the present embodiment, the thinning-out process for thinning out the target pixel is executed as shown in step S102 of FIG. According to the statistical error, the error with respect to the sample number N can be expressed as approximately 1 / (N ** (1/2)). However, ** represents the power. Therefore, in order to perform processing with an error of about 1%, N = 10000.

【0087】図7に示すように、ビットマップの画像で
あれば、縦方向に所定ドットと横方向に所定ドットから
なる二次元のドットマトリクスとして成り立っており、
このビットマップ画面は(width)×(heigh
t)の画素数となるので、サンプリング周期ratio
は、 ratio=min(width,height)/A+1 …(1) とする。このmin(width,height)はw
idthとheightのいずれか小さい方であり、A
は定数とする。また、ここでいうサンプリング周期ra
tioは何画素ごとにサンプリングするかを表してお
り、図8の○印の画素はサンプリング周期ratio=
2の場合を示している。すなわち、縦方向及び横方向に
二画素ごとに一画素のサンプリングであり、一画素おき
にサンプリングしている。A=200としたときの1ラ
イン中のサンプリング画素数は図9に示すようになる。
As shown in FIG. 7, a bitmap image is formed as a two-dimensional dot matrix consisting of predetermined dots in the vertical direction and predetermined dots in the horizontal direction.
This bitmap screen is (width) x (height
Since the number of pixels is t), the sampling period ratio
Is ratio = min (width, height) / A + 1 (1). This min (width, height) is w
whichever is smaller of idth and height, A
Is a constant. In addition, the sampling cycle ra here
tio represents the number of pixels to be sampled, and the pixels marked with a circle in FIG. 8 are sampling cycles ratio =
The case of 2 is shown. That is, one pixel is sampled every two pixels in the vertical direction and the horizontal direction, and sampling is performed every other pixel. The number of sampling pixels in one line when A = 200 is as shown in FIG.

【0088】同図から明らかなように、サンプリングし
ないことになるサンプリング周期ratio=1の場合
を除いて、200画素以上の幅があるときには最低でも
サンプル数は100画素以上となることが分かる。従っ
て、縦方向と横方向について200画素以上の場合には
(100画素)×(100画素)=(10000画素)
が確保され、誤差を1%以下にできる。
As can be seen from the figure, when the width is 200 pixels or more, the number of samples is 100 pixels or more at least, except for the case where the sampling period ratio = 1 which is not sampled. Therefore, when the number of pixels is 200 or more in the vertical and horizontal directions, (100 pixels) × (100 pixels) = (10000 pixels)
Is ensured and the error can be reduced to 1% or less.

【0089】ここにおいてmin(width,hei
ght)を基準としているのは次のような理由による。
例えば、図10(a)に示すビットマップ画像のよう
に、width>>heightであるとすると、長い
方のwidthでサンプリング周期ratioを決めて
しまった場合には、同図(b)に示すように、縦方向に
は上端と下端の2ラインしか画素を抽出されないといっ
たことが起こりかねない。しかしながら、min(wi
dth,height)として、小さい方に基づいてサ
ンプリング周期ratioを決めるようにすれば同図
(c)に示すように少ない方の縦方向においても中間部
を含むような間引きを行うことができるようになる。
Here, min (width, hei
ght) is used as a reference for the following reason.
For example, assuming that width >> height, as in the bitmap image shown in FIG. 10A, when the sampling period ratio is determined by the longer width, as shown in FIG. In addition, it may happen that pixels are extracted only in the upper and lower lines in the vertical direction. However, min (wi
If the sampling period ratio is determined based on the smaller one as dth, height), it is possible to perform thinning including the intermediate portion in the smaller vertical direction as shown in FIG. Become.

【0090】むろん、このようにしてサンプリングした
画素については、図11に示すようにRGBのそれぞれ
の全階調に対応して用意されている配列変数(CNT_
R,CNT_G,CNT_B)にてその成分値ごとにカ
ウントし、度数分布を求める。
Of course, as for the pixels sampled in this way, as shown in FIG. 11, array variables (CNT_) prepared corresponding to all gradations of RGB are provided.
R, CNT_G, CNT_B) are counted for each component value to obtain the frequency distribution.

【0091】なお、この例では、縦方向と横方向の画素
について正確なサンプリング周期で間引いて度数分布を
求めるようにしている。これは、逐次入力される画素に
ついて間引きしながら処理する場合に好適である。しか
し、全画素が入力されている場合には縦方向や横方向に
ついてランダムに座標を指定して画素を選択するように
しても良い。このようにすれば、10000画素という
ような必要最低限の画素数が決まっている場合に100
00画素となるまでランダムに抽出する処理を繰り返
し、10000画素となった時点で抽出を止めればよく
なる。
In this example, the frequency distribution is obtained by thinning out pixels in the vertical and horizontal directions at accurate sampling periods. This is suitable for processing while sequentially thinning out pixels that are input. However, when all the pixels are input, the coordinates may be randomly specified in the vertical direction and the horizontal direction to select the pixels. In this way, if the minimum required number of pixels, such as 10,000 pixels, is determined, 100
The process of random extraction is repeated until the number of pixels becomes 00, and the extraction may be stopped when the number of pixels becomes 10,000.

【0092】また、このような対象画素を特定すること
なく間引きを行なう単純間引き処理に対し、対象画素を
特定した間引きを行うことも可能である。すなわち、各
画素のRGBの各成分の差が小さいものであればグレー
に近く、グレーの画素だけを抽出して度数分布を比較し
た場合には入力装置の色特性を判断しやすいともいえる
からである。図12は、このようなグレー画素を抽出し
て間引く処理を示している。ステップS302では対象
画素における各成分のうち、最大の成分を特定し、ステ
ップS304では最小の成分を特定する。そして、ステ
ップS306にて最大値と最小値との差である最大成分
差を演算し、ステップS308にてこの最大成分差が所
定のしきい値よりも小さい範囲内に入っているか否かを
判断する。一例として、グレーに近い画素である以上、
最大成分差は「52」階調以内であるとしておく。そし
て、そのような階調以内の画素についてステップS31
0にて度数分布を計数する。一方、そのような階調を超
えていればグレーではないとして計数に利用しない。こ
の後、ステップS312にて対象画素を次の画素へと移
動させ、ステップS314にて最終画素と判断されるま
で上述した処理を繰り返す。
Further, it is also possible to perform the thinning-out in which the target pixel is specified in the simple thinning-out process in which the thinning-out is performed without specifying the target pixel. That is, it can be said that if the difference between the RGB components of each pixel is small, it is close to gray, and if only the gray pixels are extracted and the frequency distributions are compared, it is easy to determine the color characteristics of the input device. is there. FIG. 12 shows a process of extracting and thinning out such gray pixels. In step S302, the maximum component is specified among the components in the target pixel, and in step S304, the minimum component is specified. Then, in step S306, the maximum component difference, which is the difference between the maximum value and the minimum value, is calculated, and in step S308, it is determined whether or not the maximum component difference is within a range smaller than a predetermined threshold value. To do. As an example, as long as the pixel is close to gray,
It is assumed that the maximum component difference is within “52” gradation. Then, for pixels within such gradation, step S31
Count the frequency distribution at 0. On the other hand, if it exceeds such a gradation, it is not gray and is not used for counting. After that, the target pixel is moved to the next pixel in step S312, and the above-described processing is repeated until it is determined to be the final pixel in step S314.

【0093】このように間引いて選択した画素について
度数分布を求めたものの、必ずしもこの度数分布を用い
て画像修正をすることが適切でない場合もあり得るた
め、以下に、三つの事項をチェックする。
Although the frequency distribution is obtained for the pixels selected by thinning out in this way, it may not always be appropriate to correct the image using this frequency distribution. Therefore, the following three points are checked.

【0094】その一つ目は画像が白黒画像のような二値
画像である場合である。白黒画像を含めて二値画像であ
れば色再現性の修正という概念は不適切である。図13
に示すような白黒画像があったとすると、この画像に対
する各色成分毎の度数分布は図14に示すように階調数
の割り当て範囲内の両端に集中する。それも、基本的に
は階調「0」と階調「255」に集中する。
The first is when the image is a binary image such as a monochrome image. For binary images including black and white images, the concept of correction of color reproducibility is inappropriate. FIG.
If there is a black-and-white image as shown in Fig. 14, the frequency distribution for each color component for this image is concentrated at both ends within the range of gradation number allocation as shown in Fig. 14. Basically, it also concentrates on the gradation “0” and the gradation “255”.

【0095】従って、ステップS104で白黒チェック
を行う場合には、各色成分毎に階調「0」と階調「25
5」の画素数の和が、間引いて選択した画素数と一致す
るか否かで判断できる。そして、白黒画像の場合であれ
ば以下の処理を実行することなく処理を中断するために
ステップS106にて非処理を実行する。本実施形態に
おいては度数分布を求める前段の処理と、画像データを
修正することになる後段の処理とに大きく分けているの
で、この非処理では後段の輝度変換処理も実行しないよ
うなフラグを立てて当該分布抽出処理を終了している。
Therefore, when the black and white check is performed in step S104, the gradation "0" and the gradation "25" are set for each color component.
It can be determined whether or not the sum of the number of pixels of "5" matches the number of pixels selected by thinning out. Then, in the case of a monochrome image, a non-process is executed in step S106 to interrupt the process without executing the following process. In the present embodiment, the process is roughly divided into the first stage process for obtaining the frequency distribution and the second stage process for correcting the image data. Therefore, in this non-process, a flag is set so that the second stage luminance conversion process is not executed. Then, the distribution extraction process is completed.

【0096】二値データは白黒だけに限らず、色の付い
た二値データもあり得る。このような場合も同様に色再
現性の修正を図る処理は不要であり、分布状態を調べて
二色となるような分布となっていれば二値データとして
処理の中断を図ればよい。例えば、ある中間色と黒とい
う二色であれば、各色成分毎の度数分布においても分布
は二つの階調に集中している。一方、青と黒という二色
であれば、青成分の度数分布においてのみ二階調に分布
が集中し、赤成分と緑成分においては階調「0」にだけ
分布が集中している。すなわち、二値データであれば分
布の集中は二階調以下になっているので、配列変数をス
キャンして度数が「0」以外の階調がいくつあるかをカ
ウントすることによって二値画像であるか否かを判定で
きる。
The binary data is not limited to black and white, but may be colored binary data. In such a case as well, the process for correcting the color reproducibility is not necessary, and if the distribution state is checked and the distribution has two colors, the process may be interrupted as binary data. For example, in the case of two colors of a certain intermediate color and black, the distribution is concentrated on two gradations even in the frequency distribution for each color component. On the other hand, in the case of two colors of blue and black, the distribution is concentrated on two gradations only in the frequency distribution of the blue component, and the distribution is concentrated only on gradation “0” in the red component and the green component. That is, since the concentration of the distribution is less than or equal to two gradations in the case of binary data, a binary image is obtained by scanning the array variable and counting how many gradations other than “0” exist. It can be determined whether or not.

【0097】二つ目は画像がビジネスグラフのようなも
のか写真のような自然画であるか否かを考慮する。自然
画においては色再現性の修正が必要なことはいうまでも
ないが、ビジネスグラフであるとか絵画のようなもので
はもともと使用している色の偏りがあるのが自然であ
り、そのような画像についての度数分布から各色成分の
特性の均一化を図る処理を行うのは無理がある。従っ
て、ステップS108では自然画か否かのチェックを行
う。
The second is to consider whether the image is a business graph or a natural image such as a photograph. Needless to say, it is necessary to correct the color reproducibility in natural images, but it is natural that there is a bias in the colors that are originally used in business graphs and paintings. It is unreasonable to perform the process for equalizing the characteristics of each color component from the frequency distribution of the image. Therefore, in step S108, it is checked whether the image is a natural image.

【0098】自然画では陰影を含めて色数が極めて多い
がビジネスグラフやドロー系などのある種の絵画では色
数が限られていることが多い。従って、色数が少なけれ
ば自然画ではないと判断することが可能である。RGB
の各成分が256階調であるときには1670万色を表
すことができ、色数を正確に判断しようとすればこの1
670万色のうちの何色を使用しているかを判別するた
めに色数だけの配列変数を用意する必要があり、現実的
ではない。一方、すでに度数分布というものを求めてい
るので、各色成分毎に何階調が有効に利用されているか
否かを判断すれば、自然画の色数か否かは判断できる。
Natural images have an extremely large number of colors, including shadows, but some paintings such as business graphs and draw-types often have a limited number of colors. Therefore, if the number of colors is small, it can be determined that the image is not a natural image. RGB
When each of the components has 256 gradations, 16.7 million colors can be represented.
In order to determine how many of the 6.7 million colors are used, array variables corresponding to the number of colors need to be prepared, which is not realistic. On the other hand, since the frequency distribution has already been obtained, it can be determined whether or not the number of colors is that of the natural image by determining how many gradations are effectively used for each color component.

【0099】図15(a)〜(c)はビジネスグラフの
場合の度数分布の一例を示しており、同図(d)〜
(f)は自然画の場合の度数分布の一例を示している。
この例からも明らかなように、非自然画では度数分布が
線スペクトル状となる。コンピュータ21内の処理で
は、各色成分毎に全階調にわたって度数が「0」でない
階調の数をカウントし、足し合わせてみる。自然画であ
れば、全階調にわたって概ね一様に分散していると考え
られ、カウント値は「768(=256×3)」となる
ことが多いし、ビジネスグラフであれば、各色成分毎に
「20」階調を利用したとしてもカウント値は「60
(=20×3)」程度としかならない。従って、自然画
か否かのしきい値として「200」を設定したとすれ
ば、「200」以下であれば非自然画と判断すればよ
い。そして、非自然画であると判断したならばステップ
S106にて非処理を実行する。むろん、このしきい値
「200」については適宜変更可能である。
FIGS. 15A to 15C show an example of the frequency distribution in the case of a business graph, and FIGS.
(F) shows an example of the frequency distribution in the case of a natural image.
As is clear from this example, the non-natural image has a linear frequency distribution. In the processing in the computer 21, the number of gradations whose frequency is not "0" is counted over all the gradations for each color component, and they are added together. If it is a natural image, it is considered that it is distributed almost uniformly over all gradations, and the count value is often “768 (= 256 × 3)”. Even if the gradation of "20" is used, the count value is "60".
(= 20 × 3) ”. Therefore, if "200" is set as the threshold value for determining whether or not the image is a natural image, if it is "200" or less, it may be determined as a non-natural image. If it is determined that the image is a non-natural image, non-processing is executed in step S106. Of course, the threshold value "200" can be changed as appropriate.

【0100】また、度数分布が線スペクトル状か否かは
度数が「0」でない階調値の隣接割合で判断することも
可能である。すなわち、度数が「0」でない階調値であ
って隣接する階調値に分布があるか否かを判断する。隣
接する二つの階調値のうち少なくとも一方で隣接してい
れば何もせず、両方で隣接していない場合にカウントを
行い、その結果、「0」でない階調値の数とカウント値
との割合で判断すればよい。例えば、「0」でない階調
値の数が「64」であって、隣接しないものの数が「6
4」であれば線スペクトル状に分布していることが分か
る。
It is also possible to judge whether or not the frequency distribution is a linear spectrum by the adjacency ratio of the gradation values whose frequency is not "0". That is, it is determined whether or not the gradation value whose frequency is not “0” and adjacent gradation values have a distribution. If at least one of the two adjacent gradation values is adjacent, nothing is done, and if both are not adjacent, counting is performed, and as a result, the number of gradation values that are not "0" and the count value You can make a judgment based on a percentage. For example, the number of gradation values that are not “0” is “64” and the number of non-adjacent gradation values is “6”.
If it is "4", it is understood that it is distributed in a linear spectrum.

【0101】さらに、オペレーティングシステムを介し
て画像処理プログラムが実行されているような場合に
は、画像ファイルの拡張子で判断することも可能であ
る。ビットマップファイルのうち、特に写真画像などで
はファイル圧縮がなされ、その圧縮方法を表すために暗
示の拡張子が利用されることが多い。例えば、「JP
G」という拡張子であれば、JPEGフォーマットで圧
縮されていることが分かる。オペレーティングシステム
がファイル名を管理していることから、プリンタドライ
バなどの側からオペレーティングシステムに問い合わせ
を出せば、同ファイルの拡張子が回答されることになる
ため、その拡張子に基づいて自然画であれば以下の処理
を実行すればよい。また、「XLS」というようなビジ
ネスグラフに特有の拡張子であれば非自然画であると判
断でき、上述したように非処理を選択すればよい。
Further, when the image processing program is being executed via the operating system, it is possible to judge by the extension of the image file. Of the bitmap files, in particular, a photographic image or the like is subjected to file compression, and an implicit extension is often used to indicate the compression method. For example, "JP
If the extension is "G", it is understood that the file is compressed in the JPEG format. Since the operating system manages the file name, if you send an inquiry to the operating system from the printer driver side, etc., the extension of the file will be answered. If so, the following processing may be executed. Further, if it is an extension such as “XLS” that is peculiar to the business graph, it can be determined that it is a non-natural image, and it is sufficient to select non-processing as described above.

【0102】三つ目に考慮することは、図16に示すよ
うに画像の周りに枠部があるか否かである。このような
枠部が白色または黒色であれば、その度数分布は図17
に示すように、階調数の割り当て範囲内における両端に
線スペクトル状に表れるとともに、内部の自然画に対応
して両端以外の内側に滑らかな度数分布としても表れ
る。
The third consideration is whether or not there is a frame portion around the image as shown in FIG. If such a frame is white or black, its frequency distribution is shown in FIG.
As shown in, the linear spectrum appears at both ends in the gradation number allocation range, and also appears as a smooth frequency distribution inside other than the ends corresponding to the natural image inside.

【0103】むろん、枠部を度数分布に入れない方が適
切であるため、ステップS108の枠部のチェックでは
階調「0」と階調「255」の画素数の和が十分に大き
く、かつ、間引いて選択した画素数とは一致しないかを
判断し、肯定的ならば枠部があると判定してステップS
112にて枠部処理を実施する。この枠部処理では、枠
部を無視するために度数分布のうち階調「0」と階調
「255」の画素数を「0」にセットする。これによ
り、以下の処理では枠部がないものと同様に扱うことが
できる。
Of course, it is more appropriate not to include the frame part in the frequency distribution. Therefore, in the check of the frame part in step S108, the sum of the pixel numbers of the gradation "0" and the gradation "255" is sufficiently large, and , It is determined whether the number of pixels does not match the number of pixels selected by thinning out, and if affirmative, it is determined that there is a frame portion and step S
At 112, frame processing is performed. In this frame processing, the number of pixels of gradation “0” and gradation “255” in the frequency distribution is set to “0” in order to ignore the frame. As a result, in the following processing, it can be handled in the same manner as that without a frame.

【0104】この例では白色または黒色の枠部を対象と
しているが、特定の色の枠がある場合も考えられる。こ
のような場合、度数分布が描く本来の滑らかなカーブの
中で突出する線スペクトル状のものが表れる。従って、
隣接する輝度値の間で大きく差が生じている線スペクト
ル状のものについては枠部として考えて度数分布の対象
としないようにすればよい。この場合、枠部以外でその
色を使用していることがあり得るので、両隣の階調値の
度数について平均を算出して割り当てるようにすれば良
い。
In this example, a white or black frame portion is targeted, but there may be a case where there is a frame of a specific color. In such a case, a protruding linear spectrum-like thing appears in the originally smooth curve drawn by the frequency distribution. Therefore,
A line spectrum having a large difference between the adjacent luminance values may be considered as a frame and may not be the target of the frequency distribution. In this case, the color may be used outside the frame portion, and therefore the average of the frequencies of the tone values on both sides may be calculated and assigned.

【0105】以上のような考慮を経た上で、非処理でな
い場合にはステップS114で度数分布の両端を求め
る。自然画における度数分布は図18に示すように概ね
山形に表れることが多い。むろん、その位置、形状につ
いてはさまざまである。このような度数分布の裾野は、
統計的に見れば限りなく「0」に近づきながら推移して
いく。従って、ある度数分布を特定しようとする場合に
はその山の両端を特定することが重要となってくるにも
かかわらず、現実に度数が「0」となるという条件を課
すとどの分布特性も一致してしまいかねない。
After taking the above-mentioned consideration into consideration, both ends of the frequency distribution are obtained in step S114 when not being processed. The frequency distribution in a natural image often appears in a mountain shape as shown in FIG. Of course, there are various positions and shapes. The base of such a frequency distribution is
From a statistical point of view, it will continue to approach "0" without limit. Therefore, in order to specify a certain frequency distribution, it is important to specify both ends of the mountain, but if the condition that the frequency is "0" is actually imposed, any distribution characteristic It could be the same.

【0106】このため、分布範囲において最も輝度の大
きい側と小さい側からある分布割合だけ内側に入った部
分を分布の両端とする。本実施形態においては、図18
に示すように、この分布割合を0.5%に設定してい
る。むろん、この割合については、適宜、変更すること
が可能である。このように、ある分布割合だけ上端と下
端をカットすることにより、ノイズなどに起因して生じ
ている白点や黒点を無視することもできる。逆に、この
ような処理をしなければ一点でも白点や黒点があればそ
れが度数分布の両端となってしまうので、多くの場合に
おいて最下端は階調「0」であるし、最上端は階調「2
55」となってしまう。しかしながら、両端部分から
0.5%の画素数だけ内側に入った部分を端部とするこ
とにより、このようなことが無くなる。
For this reason, the portions that are inside by a certain distribution ratio from the side with the highest brightness and the side with the lowest brightness in the distribution range are the both ends of the distribution. In the present embodiment, FIG.
As shown in, the distribution ratio is set to 0.5%. Of course, this ratio can be changed appropriately. In this way, by cutting the upper and lower ends by a certain distribution ratio, it is possible to ignore white points and black points caused by noise and the like. On the contrary, if such a process is not performed, even if there is a white point or a black point, it becomes the both ends of the frequency distribution, so in most cases, the lowermost end is the gradation "0" and the uppermost end. Is the gradation "2
55 ”. However, such a situation is eliminated by defining the end portions as portions that are inward by 0.5% of the number of pixels from both end portions.

【0107】実際の処理では処理対象となる画素数(間
引き処理において選択した画素の総数、あるいは枠部に
対応する画素数を削除した総数)に対する0.5%を演
算し、度数分布における上端側と下端側とから順番に内
側に向かいながらそれぞれの度数を累積し、0.5%の
値となった階調値を求める。RGBの各色成分毎に上端
側をRmax,Gmax,Bmaxと呼び、下端側をR
min,Gmin,Bminと呼ぶ。
In the actual process, 0.5% of the number of pixels to be processed (the total number of pixels selected in the thinning process or the total number obtained by deleting the number of pixels corresponding to the frame portion) is calculated, and the upper end side in the frequency distribution is calculated. Then, the respective frequencies are accumulated in order from the lower end side toward the inner side, and a gradation value having a value of 0.5% is obtained. The upper end side is called Rmax, Gmax, Bmax for each color component of RGB, and the lower end side is R
Called min, Gmin, Bmin.

【0108】上述したように、各色成分の度数分布が不
均一となることの方が自然な状況もあり得る。そして、
そのような場合においては色再現性の修正もすべきでは
ない。これは結果から追ってみると、各色成分の度数分
布がある程度似ている状況では逆に度数分布が均一とな
っているべきであろうし、度数分布が似ていなければ均
一にすべきでないだろうと判断できる。
As described above, it may be more natural for the frequency distribution of each color component to be non-uniform. And
In such a case, the color reproducibility should not be modified. Looking at this from the results, it is judged that the frequency distribution should be uniform on the contrary when the frequency distribution of each color component is similar to some extent, and it should not be uniform if the frequency distribution is not similar. it can.

【0109】従って、本実施形態においては、ステップ
S116にて各色成分毎の度数分布の類似度をチェック
する。いま、各色成分毎の度数分布が図19に示すよう
に表れているとすると、全階調範囲を四つの領域([0
〜63],[64〜127],[128〜192],
[193〜255])に分割し、各領域に属する度数を
要素とする特徴ベクトルを考える。赤成分を例に取れ
ば、各領域での度数をr64,r128,r192,r
255で表し、全有効画素数をr_pixelとしたと
すると、赤成分の特徴ベクトルは、数1式のように表せ
る。
Therefore, in the present embodiment, the similarity of the frequency distribution for each color component is checked in step S116. Now, assuming that the frequency distribution for each color component is as shown in FIG. 19, the entire gradation range is divided into four areas ([0
~ 63], [64-127], [128-192],
[193 to 255]) and consider a feature vector whose elements are frequencies belonging to each region. Taking the red component as an example, the frequencies in each region are r64, r128, r192, r
255, and assuming that the total number of effective pixels is r_pixel, the feature vector of the red component can be expressed by Equation 1.

【0110】[0110]

【数1】 [Equation 1]

【0111】これと同じ処理を緑成分と青成分について
実行し、次に、各色成分間での特徴ベクトルの内積を求
める。すなわち、赤成分と緑成分との間の特徴ベクトル
の内積corr_rgは数2式に表すように求められ、
緑成分と青成分との間の特徴ベクトルの内積corr_
gbは数3式に表すように求められ、青成分と赤成分と
の間の特徴ベクトルの内積corr_brは数4式に表
すように求められる。
The same processing is executed for the green component and the blue component, and then the inner product of the feature vectors between the color components is obtained. That is, the inner product corr_rg of the feature vector between the red component and the green component is obtained as shown in Equation 2.
Inner product corr_ of feature vectors between green and blue components
gb is obtained as shown in Equation 3, and the inner product corr_br of the feature vectors between the blue component and the red component is obtained as shown in Equation 4.

【0112】[0112]

【数2】 [Equation 2]

【0113】[0113]

【数3】 [Equation 3]

【0114】[0114]

【数4】 [Equation 4]

【0115】ベクトルの内積は、両ベクトルの類似度を
表すといえ、その値は「0」〜「1」となる。従って、
しきい値CORRとして「0.7」を定めたとして、そ
れぞれの内積corr_rg,corr_gb,cor
r_brのうちいずれか一つでもこのしきい値CORR
以下のものがあれば類似具合が低いものと判断してステ
ップS106の非処理を実行することにする。
It can be said that the inner product of the vectors represents the degree of similarity between the two vectors, and the value thereof is "0" to "1". Therefore,
Assuming that the threshold value CORR is "0.7", the inner products corr_rg, corr_gb, cor
Any one of r_br has this threshold value CORR.
If there is the following, it is determined that the degree of similarity is low, and the non-processing of step S106 is executed.

【0116】本実施形態においては、この特徴ベクトル
の内積に基づく処理が類似具合判断手段を構成してお
り、特徴ベクトルに基づく内積の演算であれば手法が確
立しており判断も容易である。しかしながら、むろんこ
の例に限るものではない。例えば、全階調範囲を四つの
領域に分割しているが、これら以上とすることは自由で
あるし、度数分布の両端位置や、標準偏差、尖度などの
統計的手法を用いてその近似度を求めることも可能であ
る。
In the present embodiment, the processing based on the inner product of the feature vectors constitutes the similarity determining means, and if the inner product is calculated based on the feature vector, the method is established and the determination is easy. However, it is not limited to this example. For example, the entire gradation range is divided into four areas, but it is possible to set more than these areas, and the approximation can be made using statistical methods such as the positions of both ends of the frequency distribution, standard deviation, and kurtosis. It is also possible to find the degree.

【0117】ここで、このような統計的手法を用いて近
似度を求める具体的手法について説明する。統計的手法
の一例には、分布の代表値を利用するものがあげられ
る。いま、変数として平均値、中央値、標準偏差(分
散)の差の絶対値を赤成分と緑成分、緑成分と青成分、
青成分と赤成分との間で求めておく。そして、平均値と
標準偏差について赤成分と緑成分の差の絶対値をAve
_rg,Std_rgとしたとき、赤成分と緑成分の間
の評価関数として h(rg)=(1−Ave_rg/255)×(1−S
td_rg/255) と設定する。また、同様に緑成分と青成分の間の評価関
数として、 h(gb)=(1−Ave_gb/255)×(1−S
td_gb/255) と設定するとともに、青成分と赤成分との間の評価関数
として、 h(br)=(1−Ave_br/255)×(1−S
td_br/255) と設定する。分布が似ている場合には平均値、中央値、
標準偏差(分散)は殆ど同じになり、各変数の差も殆ど
「0」になるから、評価関数hの値は「1」に近くな
る。分布が異なる場合は差も大きくなり、評価関数hの
値も小さくなる。従って、評価関数と実験で求められた
しきい値とを比較することにより補正を行うか否かを決
定することができるようになる。むろん、この場合に平
均値の代わりに中央値を利用することも可能であるし、
評価関数の具体例はこれに限られるものでもない。
Here, a specific method for obtaining the degree of approximation using such a statistical method will be described. An example of a statistical method is one that uses a representative value of distribution. Now, as the variables, the absolute value of the difference between the average value, the median value, and the standard deviation (variance) is the red component and the green component, the green component and the blue component,
It is calculated between the blue component and the red component. Then, regarding the average value and the standard deviation, the absolute value of the difference between the red component and the green component is Ave.
_Rg and Std_rg, the evaluation function between the red component and the green component is h (rg) = (1-Ave_rg / 255) * (1-S
td_rg / 255). Similarly, as an evaluation function between the green component and the blue component, h (gb) = (1-Ave_gb / 255) * (1-S
td_gb / 255), and as an evaluation function between the blue component and the red component, h (br) = (1-Ave_br / 255) × (1-S
td_br / 255). If the distributions are similar, the mean, median,
The standard deviations (variances) are almost the same, and the differences between the variables are almost "0", so that the value of the evaluation function h is close to "1". When the distributions are different, the difference is large and the value of the evaluation function h is small. Therefore, it becomes possible to determine whether or not to perform the correction by comparing the evaluation function with the threshold value obtained by the experiment. Of course, in this case it is possible to use the median instead of the average,
The specific example of the evaluation function is not limited to this.

【0118】以上のような処理により各色成分毎に求め
た度数分布についてある程度の類似具合が見つけられた
ら各度数分布から成分毎の特性を見出せるものと判断で
き、かかる特性に基づいて各成分間の均一化を図る。な
お、上述した各種の判断の結果、ステップS106にて
非処理を実行してフラグをセットしている場合もある。
このような場合には、ステップS202にて同フラグを
参照しているので、以下の均一化の処理をすることなく
本処理を終了する。
If a certain degree of similarity is found in the frequency distribution obtained for each color component by the above processing, it can be determined that the characteristic of each component can be found from each frequency distribution. Aim for uniformity. In addition, as a result of the above-described various determinations, non-processing may be executed and the flag may be set in step S106.
In such a case, since the same flag is referred to in step S202, this processing ends without performing the following equalization processing.

【0119】特性の均一化の処理では、最初にオフセッ
トの算出と修正を行う。いわゆる狭義の意味での色ずれ
の修正に該当し、特性の均一化を図るオフセットが本実
施形態で実効値を構成する。本来であれば、図20に示
すように被写体の色成分とRGBの各成分との間には正
比例の関係がなければならないが、撮像素子の特性など
によって各成分毎に変換特性がずれていることがある。
従来は、このようなずれを通常の画像から判断すること
はできなかった。しかしながら、各色成分毎の度数分布
を取ったときに概ね類似しているとすれば、これは本来
的に一致すべきと判断できるので、各成分毎のずれであ
るオフセット量を検出できることになる。
In the process of equalizing the characteristics, the offset is calculated and corrected first. The offset, which corresponds to the correction of color misregistration in a so-called narrow sense, and which aims to make the characteristics uniform, constitutes an effective value in the present embodiment. Originally, as shown in FIG. 20, there must be a direct proportional relationship between the color component of the subject and each of the RGB components, but the conversion characteristics are different for each component due to the characteristics of the image sensor and the like. Sometimes.
Conventionally, such a shift could not be determined from a normal image. However, if the frequency distributions of the respective color components are approximately similar to each other, it can be determined that they should be the same, so that the offset amount, which is the deviation between the respective components, can be detected.

【0120】本実施形態においては、ステップS204
にてこのオフセット量を求め、ステップS206ではか
かるオフセット量を考慮して色ずれを修正するために利
用するテーブルを作成している。
In this embodiment, step S204.
In step S206, a table used to correct the color misregistration is created in consideration of the offset amount.

【0121】RGBの階調データ(Rp,Gp,Bp )を利
用している場合、テレビジョンなどでは全体の輝度yp
を yp=0.30Rp+0.59Gp+0.11Bp …(2) として求めている。すなわち、緑成分が最も輝度に影響
を及ぼしており、その意味で緑成分に対する他の色成分
のずれを修正するのが全体の画像イメージを変化させな
いというメリットがある。
When the RGB gradation data (Rp, Gp, Bp) is used, the overall luminance yp is used in a television or the like.
Is calculated as yp = 0.30Rp + 0.59Gp + 0.11Bp (2). That is, the green component has the greatest effect on the brightness, and in that sense, correcting the deviation of other color components from the green component has the advantage of not changing the overall image.

【0122】一方、各色成分毎の度数分布のずれを求め
るには、この度数分布の特徴部分を考慮することが望ま
しい。このため、本実施形態においては、上述した端部
処理を施した度数分布の上端(Rmax,Gmax,B
max)と度数分布上におけるメジアン(Rmed,G
med,Bmed)とを利用している。両端位置は分布
を判断する意味で有効である。ただし、下端位置につい
ては元々ずれの影響が分かりにくい範囲であるため、敢
えて省略している。これにより、ずれの影響が大きい範
囲で得られるずれだけを重視した修正が可能となる。分
布の中央となるメジアンは極端な画素があったとしても
度数分布の山の位置を示すことができる。この場合、か
かる山の部分は画像のイメージに大きく影響を与える部
分でもあるので特性を把握する意味で効果的である。
On the other hand, in order to obtain the deviation of the frequency distribution for each color component, it is desirable to consider the characteristic part of this frequency distribution. Therefore, in the present embodiment, the upper end (Rmax, Gmax, B of the frequency distribution subjected to the above-described end processing is applied.
max) and the median on the frequency distribution (Rmed, G
med, Bmed). The positions at both ends are effective in determining the distribution. However, the lower end position is intentionally omitted because it is difficult to understand the influence of the deviation. As a result, it becomes possible to make a correction by emphasizing only the deviation obtained in a range where the influence of the deviation is large. The median at the center of the distribution can indicate the position of the peak in the frequency distribution even if there are extreme pixels. In this case, such a mountain portion is also a portion that greatly affects the image of the image, and is effective in understanding the characteristics.

【0123】このようにして得られた、青緑赤について
の上端(Rmax,Gmax,Bmax)とメジアン
(Rmed,Gmed,Bmed)から緑成分に対する
他の色成分のずれdRmax,dBmax,dRme
d,dBmedを次式に基づいて求める。
Deviations of the other color components from the upper end (Rmax, Gmax, Bmax) and the median (Rmed, Gmed, Bmed) of the green, green, and red obtained in this way with respect to the green component are dRmax, dBmax, dRme.
d and dBmed are calculated based on the following equation.

【0124】 dRmax=Gmax−Rmax …(3) dBmax=Gmax−Bmax …(4) dRmed=Gmed−Rmed …(5) dBmed=Gmed−Bmed …(6) そして、これらを参考として赤成分用オフセットdRと
青成分用オフセットdBとを次式のようにして求める。
DRmax = Gmax-Rmax (3) dBmax = Gmax-Bmax (4) dRmed = Gmed-Rmed (5) dBmed = Gmed-Bmed (6) Then, with reference to these, the offset dR for the red component And the blue component offset dB are obtained by the following equation.

【0125】 dR=(dRmax+dRmed)/2 …(7) dB=(dBmax+dBmed)/4 …(8) ただし、−12<dR,dB<12とする。このように
制限するのは度数分布だけで完全な色再現性を修正でき
る訳ではない場合に、この一例だけで大きく度数分布を
修正してしまわないようにするためである。むろん、こ
の範囲については実験的な経験より適当な値を定めれば
よい。また、分母の相違は(2)色に基づく影響の相違
に対応しており、実験等に基づいて適宜変更可能であ
る。
DR = (dRmax + dRmed) / 2 (7) dB = (dBmax + dBmed) / 4 (8) However, -12 <dR, dB <12. The reason for limiting in this way is to prevent the frequency distribution from being largely corrected by this example only when the color distribution cannot correct the complete color reproducibility. Of course, an appropriate value may be set for this range based on experimental experience. Further, the difference in the denominator corresponds to (2) the difference in influence based on color, and can be appropriately changed based on experiments and the like.

【0126】これらはオフセット量に過ぎないから、実
際の統計値を次式に基づいて修正して新たな上端Rma
x2,Bmax2とメジアンRmed2,Bmed2と
下端Rmin2,Bmin2とをする。
Since these are nothing but offset amounts, the actual statistical values are modified based on the following equation to obtain a new upper limit Rma.
x2, Bmax2, median Rmed2, Bmed2 and lower ends Rmin2, Bmin2.

【0127】 Rmax2=Rmax+dR …(9) Rmed2=Rmed+dR …(10) Rmin2=Rmin+dR …(11) Bmax2=Bmax+dB …(12) Bmed2=Bmed+dB …(13) Bmin2=Bmin+dB …(14) なお、この対応関係は緑成分に対する赤成分と青成分の
オフセット量に過ぎないことは明らかであり、階調値に
よって変化しているわけではない。従って、現実の各画
素における画像データについては一律に当該オフセット
量を加算すれば足りる。
Rmax2 = Rmax + dR (9) Rmed2 = Rmed + dR (10) Rmin2 = Rmin + dR (11) Bmax2 = Bmax + dB (12) Bmed2 = Bmed + dB (13) Bmin2 = Bmin + dB (14) Note that this correspondence relationship is obtained. It is clear that is only the offset amount of the red component and the blue component with respect to the green component, and does not change depending on the gradation value. Therefore, it is sufficient to uniformly add the offset amount to the actual image data in each pixel.

【0128】ただし、後述するように本実施形態におい
ては他の要因に基づく画像データの修正も行なってお
り、個別に修正することは演算時間を要して不利であ
る。従って、演算の効率化を図るべく、本実施形態にお
いてはステップS206にて変換前のRGBの階調デー
タ(R1,G1,B1)に対する変換後のRGBの階調デー
タ(R2,G2,B2)という対応関係を表すテーブルを形
成し、現実に画像データを修正するのは最後に一回だけ
となるようにしている。
However, as will be described later, in the present embodiment, the image data is also corrected on the basis of other factors, and it is disadvantageous to individually correct it because it requires a calculation time. Therefore, in order to improve the efficiency of calculation, in the present embodiment, the RGB gradation data (R2, G2, B2) after conversion with respect to the RGB gradation data (R1, G1, B1) before conversion in step S206. The table representing the correspondence relation is formed, and the image data is actually corrected only once at the end.

【0129】一方、上述した実施例では、ベクトルの内
積に基づいて類似度を求めるとともに同類似度をしきい
値CORR(「0.7」)と比較して特性の均一化を行
うか否かを決めている。従って、ベクトルの内積としき
い値とがほぼ一致するような場合には、同じ画像でも周
囲に付加されるビットの影響を受けて異なる判断結果が
なされることになりかねない。
On the other hand, in the above-described embodiment, whether or not the similarity is obtained based on the inner product of the vectors and the similarity is compared with the threshold value CORR (“0.7”) to make the characteristics uniform or not. Have decided. Therefore, when the inner product of the vector and the threshold value are substantially equal to each other, different judgment results may be made due to the influence of the bits added to the surroundings even in the same image.

【0130】むろん、特性の均一化を行うと判断される
と上述したようなオフセット量が加算され、特性の均一
化を行なわないと判断されると上述したようなオフセッ
ト量が加算されないことになるので、しきい値を挟んで
大きな差が生じる。
Of course, if it is determined that the characteristics are made uniform, the offset amount as described above is added, and if it is determined that the characteristics are not made uniform, the offset amount as described above is not added. Therefore, a large difference occurs across the threshold value.

【0131】このようにして結果が大きく変わってしま
うのを防止する手法として連続的に変化する窓関数を利
用することが効果的である。
It is effective to use a window function that continuously changes as a method of preventing the result from being greatly changed in this way.

【0132】x=min(corr_rg,corr_
gb,corr_br) …(141)とおくとともに
窓関数f(x)は、 x<0.5 のとき f(x)=0 0.5≦x≦0.7 のとき f(x)=5・x−2.5 0.7<x のとき f(x)=1 とし、上記しきい値CORRを「0.5」とする。窓関
数f(x)の変化状況を図30に示しており、x<0.
5において一定の「0」となり、0.5≦x≦0.7に
おいて「0」から「1.0」へと直線的に増加し、0.
7<xにおいて一定の「1.0」となる。そして、
(7)式と(8)式において赤成分用オフセットdRと
青成分用オフセットdBとを求めていたのをこのf
(x)との積に改める。すなわち、 dR=f(x)・(dRmax+dRmed)/2 …(7)’ dB=f(x)・(dBmax+dBmed)/4 …(8)’ とする。図5および図6に示すフローチャートにおいて
は類似度がしきい値を越えていなければ非処理としてし
まうが、このようにオフセットに対して窓関数を乗算す
る場合は、図31に示すフローチャートを実行する。す
なわち、類似度に基づいて非処理とすることはやめ、ス
テップS205で窓関数を利用したオフセット量の算出
を実行し、この算出したオフセット量を利用する。むろ
ん、上述したようにx<0.7において窓関数f(x)
が急激に「0」へ近づくため、しきい値付近であった画
像が処理によって大きく変化するということはなくなる
し、類似度が低いものについてはオフセットも殆ど
「0」となって悪影響は与えない。また、このようにし
て算出したオフセット量dR,dBに基づいて(9)式
〜(14)式も算出される。
X = min (corr_rg, corr_
gb, corr_br) (141), and the window function f (x) is as follows: when x <0.5 f (x) = 0 When 0.5 ≦ x ≦ 0.7 f (x) = 5 · When x−2.5 0.7 <x, f (x) = 1 and the threshold value CORR is set to “0.5”. FIG. 30 shows the change situation of the window function f (x), where x <0.
5 becomes a constant “0”, and when 0.5 ≦ x ≦ 0.7, it linearly increases from “0” to “1.0”, and becomes 0.
When 7 <x, it becomes a constant “1.0”. And
The red component offset dR and the blue component offset dB are found in the equations (7) and (8).
Change to the product of (x). That is, dR = f (x) · (dRmax + dRmed) / 2 (7) ′ dB = f (x) · (dBmax + dBmed) / 4 (8) ′. In the flowcharts shown in FIGS. 5 and 6, if the similarity does not exceed the threshold value, the processing is not performed. However, when the offset is multiplied by the window function, the flowchart shown in FIG. 31 is executed. . That is, the processing is not performed based on the similarity, the offset amount is calculated using the window function in step S205, and the calculated offset amount is used. Of course, as described above, when x <0.7, the window function f (x)
Rapidly approaches "0", the image near the threshold value does not change significantly due to the processing, and the offset is almost "0" for the one having a low degree of similarity, which has no adverse effect. . Further, equations (9) to (14) are also calculated based on the offset amounts dR and dB calculated in this way.

【0133】窓関数f(x)は上述した関数に限られる
ものでないことは明らかである。上述した例では、相関
係数の最小値に基づいて窓関数の値を変化させている
が、最小値に限られる必要はない。例えば、 f(corr_rg,corr_gb,corr_b
r) …(142) としてもよい。また、さらに一般的にして、 f(統計量) としても良い。この場合、統計量には最小値、最大値、
メジアン、標準偏差などが該当する。
Obviously, the window function f (x) is not limited to the above-mentioned function. In the above-mentioned example, the value of the window function is changed based on the minimum value of the correlation coefficient, but it is not limited to the minimum value. For example, f (corr_rg, corr_gb, corr_b
r) (142) Further, more generally, it may be f (statistical amount). In this case, the statistic has minimum, maximum,
Median, standard deviation, etc. are applicable.

【0134】一方、窓関数は窓を開け閉めするごとくあ
る領域において演算値を有効化させるとともに別の領域
において演算値を無効化させるように機能する。今、色
かぶりをその原因別に分類すると、上述した画像入力装
置10のハードウェア性能などによる場合と、夕焼けな
どによる意図的な色かぶりと、タングステンランプなど
を利用した特殊な照明による色かぶりとに分類できる。
そして、夕焼けなどによる意図的な色かぶりについては
特性の統一化を図る必要がないことは上述したとおりで
あるが、タングステンランプなどを利用した特殊な照明
による色かぶりの場合は特性の統一化を図ることも有意
義である。
On the other hand, the window function functions so as to validate the calculated value in one area and invalidate the calculated value in another area as the window is opened and closed. Now, when classifying color casts according to their causes, there are two cases, one is due to the hardware performance of the image input device 10 described above, the other is intentional color casts such as sunset, and color casts due to special illumination using a tungsten lamp or the like. Can be classified.
As described above, it is not necessary to unify the characteristics for intentional color cast due to the sunset, but in the case of color cast due to special lighting using a tungsten lamp, etc., the characteristics should be unified. It is also meaningful to plan.

【0135】夕焼けなどによる意図的な色かぶりとタン
グステンランプなどを利用した特殊な照明による色かぶ
りは、上述した相関係数から判断できる。すなわち、相
関係数が極端に低い写真はこのような特殊な照明に起因
するものであることが多く、窓関数を図32に示すよう
に変形した。
The intentional color cast due to a sunset or the like and the color cast due to special illumination using a tungsten lamp or the like can be judged from the above-mentioned correlation coefficient. That is, a photograph having an extremely low correlation coefficient is often caused by such special illumination, and the window function is transformed as shown in FIG.

【0136】すなわち、x<0.5の領域を変形させ、 x<0.1 のとき f(x)=1.0 0.1≦x<0.3 のとき f(x)=−5・x+1.5 0.3≦x0.5 のとき f(x)=0 とした。これにより、xが「0.3」以下となると窓関
数f’(x)は再び直線的に上昇し、xが「0.1」以
下の領域で同窓関数f’(x)は一定の「1.0」とな
る。むろん、窓関数が「1.0」となったときには各成
分の分布状況に基づいて演算された大きなオフセット量
がそのまま適用され、照明の影響を打ち消して特性の均
一化が図られる。
That is, the region of x <0.5 is deformed, and when x <0.1 f (x) = 1.0 When 0.1 ≦ x <0.3 f (x) = − 5. When x + 1.5 0.3 ≦ x0.5, f (x) = 0 was set. As a result, the window function f ′ (x) rises linearly again when x becomes “0.3” or less, and the window function f ′ (x) stays constant in the region where x is “0.1” or less. 1.0 ". Of course, when the window function becomes “1.0”, the large offset amount calculated based on the distribution state of each component is applied as it is, and the influence of illumination is canceled to make the characteristics uniform.

【0137】なお、窓関数は遷移領域で直線的に変化す
る必要はなく、単調増加もしくは単調減少するような曲
線的なものであっても構わない。
The window function does not need to change linearly in the transition region, and may be a curve that monotonically increases or decreases.

【0138】また、図5に示すようにステップS116
にて類似度をチェックし、類似度が低い場合にステップ
S106にて非処理を実行してフラグをセットしたり、
あるいは、図31に示すようにステップS116を実行
することなくステップS205にて窓関数を利用してオ
フセット量を算出することにより、実質的には類似度が
低いときに特性の均一化を図らないようにしているの
で、これらのソフトウェア処理及びこれを実現するハー
ドウェアなどによって修正制御手段を構成していると言
える。
Further, as shown in FIG. 5, step S116.
In step S106, if the degree of similarity is low, the flag is set by executing non-processing.
Alternatively, as shown in FIG. 31, the window function is used to calculate the offset amount in step S205 without executing step S116, so that the characteristics are not substantially equalized when the similarity is substantially low. Therefore, it can be said that the correction control means is configured by the software processing and the hardware for realizing the software processing.

【0139】一方、度数分布の広がり方に差がある場合
にはこれを均一化させることが有効である。本実施形態
においては、この度数分布の広がり方を均一化させつ
つ、度数分布を可能な範囲で拡大させて各成分毎にコン
トラストを強調させている。
On the other hand, if there is a difference in the spread of the frequency distribution, it is effective to make it uniform. In the present embodiment, the frequency distribution is made uniform and the frequency distribution is expanded within a possible range to emphasize the contrast for each component.

【0140】コントラストの強調は、階調範囲が「0」
〜「255」としたときに、変換前の各色成分(R1 ,
G1 ,B1 )と各成分の最大値Rmax2,Gmax,
Bmax2と最小値Rmin2,Gmin,Bmin2
から変換先の各色成分(R2,G2 ,B2 )を次式に基
づいて求める。
To emphasize the contrast, the gradation range is "0".
~ "255", each color component before conversion (R1,
G1 and B1) and the maximum values Rmax2 and Gmax of each component,
Bmax2 and minimum values Rmin2, Gmin, Bmin2
The color components (R2, G2, B2) of the conversion destination are obtained from the following equations.

【0141】 R2=far×R1+fbr …(15) G2=fag×G1+fbg …(16) B2=fab×B1+fbb …(17) ただし far=255/(Rmax2−Rmin2) …(18) fag=255/(Gmax −Gmin ) …(19) fav=255/(Bmax2−Bmin2) …(20) fbr=−far×Rmin2あるいは255−far×Rmax2 …(21) fbg=−fag×Gmin あるいは255−fag×Gmax2 …(22) fbb=−fab×Bmin2あるいは255−fab×Bmax2 …(23) また、上記変換式にてR2,G2,B2 <0ならばR2,G2,
B2 =0とし、R2,G2,B2 >255ならばR2,G2,B
2 =255とする。ここにおける、far,fag,fabは傾き
であり、fbr,fbg,fbb はオフセットといえる。この変換
式によれば、図22に示すように、あるせまい幅を持っ
た輝度分布を再現可能な範囲まで広げることができる。
なお、基本的に輝度の分布範囲の拡大においては、画素
数が変化するわけではないので、ヒストグラムの面積は
一致する。ただし、このように再現可能な範囲を最大限
に利用して輝度分布の拡大を図った場合、ハイライト部
分が白く抜けてしまったり、ハイシャドウ部分が黒くつ
ぶれてしまうことが起こる。これを防止するため本実施
形態においては、拡大する階調範囲を制限している。す
なわち、全階調範囲の上端と下端に拡大しない範囲とし
て階調値で「5」だけ残している。この結果、変換式の
パラメータは次式のようになる。
R2 = far × R1 + fbr (15) G2 = fag × G1 + fbg (16) B2 = fab × B1 + fbb (17) However, far = 255 / (Rmax2-Rmin2) (18) fag = 255 / (Gmax) -Gmin) (19) fav = 255 / (Bmax2-Bmin2) (20) fbr = -far * Rmin2 or 255-far * Rmax2 (21) fbg = -fag * Gmin or 255-fag * Gmax2 ((21) 22) fbb = -fab * Bmin2 or 255-fab * Bmax2 (23) Further, if R2, G2, B2 <0 in the above conversion formula, R2, G2,
If B2 = 0 and R2, G2, B2> 255, then R2, G2, B
2 = 255. It can be said that far, fag, and fab are slopes and fbr, fbg, and fbb are offsets. According to this conversion formula, as shown in FIG. 22, a luminance distribution having a certain narrow width can be expanded to a reproducible range.
Note that, basically, when the distribution range of luminance is expanded, the number of pixels does not change, so the areas of the histograms match. However, when the reproducible range is used to the maximum extent in this way to expand the luminance distribution, the highlight portion may be white or the high shadow portion may be blackened. In order to prevent this, the gradation range to be expanded is limited in the present embodiment. That is, “5” is left as the gradation value as a range that does not expand to the upper and lower ends of the entire gradation range. As a result, the parameters of the conversion formula are as follows.

【0142】 far=245/(Rmax2−Rmin2) …(24) fag=245/(Gmax −Gmin ) …(25) fav=245/(Bmax2−Bmin2) …(26) fbr=5−far×Rmin2あるいは250−far×Rmax2 …(27 ) fbg=5−fag×Gmin あるいは250−fag×Gmax2 …(28 ) fbb=5−fab×Bmin2あるいは250−fab×Bmax2 …(29 ) そして、この場合には階調「5」未満と、階調「25
0」以上については変換を行わないようにする。
Far = 245 / (Rmax2-Rmin2) (24) fag = 245 / (Gmax-Gmin) (25) fav = 245 / (Bmax2-Bmin2) (26) fbr = 5-far × Rmin2 or 250-far × Rmax2 (27) fbg = 5-fag × Gmin or 250-fag × Gmax2 (28) fbb = 5-fab × Bmin2 or 250-fab × Bmax2 (29) And in this case, the floor Less than key "5" and tone "25"
No conversion is performed for 0 or more.

【0143】なお、本実施形態においては、ハイライト
部分とハイシャドウ部分とを保持するために一律に階調
範囲の端部から階調値にして「5」の範囲を非拡大領域
としているが、ハイライト部分やハイシャドウ部分を比
較的再現しやすいような画像出力装置であればその範囲
を狭くしても良いし、再現力がさらに弱い場合にはより
範囲を大きくするようにしても良い。また、一律に拡大
しないのではなく、ボーダー領域で徐々に拡大率を制限
するようにしていっても良い。
In the present embodiment, in order to hold the highlight portion and the high shadow portion, the range of the gradation value from the end of the gradation range is set to "5" as the non-enlarged area. The range may be narrowed if the image output device is capable of relatively easily reproducing the highlight part and the high shadow part, or may be made larger when the reproducibility is weaker. . Further, instead of not uniformly expanding, the expansion rate may be gradually limited in the border area.

【0144】また、図23(a)には画像の輝度分布が
狭い場合を示しているが、これまで述べたようにして輝
度分布の拡大率(far,fag,fabに対応)を適用してしま
うと、再現可能な範囲に合わせて非常に大きな拡大率が
得られる場合も生じてくる。すると、夕方のような薄暮
の状態では最も明るい部分から暗い部分までのコントラ
ストの幅が狭くて当然であるのに、この画像についてコ
ントラストを大きく拡大しようとする結果、昼間の画像
のように変換されてしまいかねない。このような変換は
希望されないので、拡大率には制限を設けていおき、fa
r,fag,fabが1.5(〜2)以上とはならないように制
限する。これにより、薄暮は薄暮なりに表現されるよう
になる。
Further, FIG. 23A shows the case where the luminance distribution of the image is narrow. However, as described above, the enlargement ratio of the luminance distribution (corresponding to far, fag, fab) is applied. In that case, a very large enlargement ratio may be obtained in accordance with the reproducible range. Then, it is natural that the contrast width from the brightest part to the darkest part is narrow in a dusk condition such as evening, but as a result of trying to greatly expand the contrast of this image, it is converted like a daytime image. It can happen. Since such a conversion is not desired, limit the enlargement ratio and set fa
Limit r, fag, fab so that it does not exceed 1.5 (~ 2). As a result, twilight will be expressed like twilight.

【0145】拡大率に制限を設けない場合を図23
(a)の一点鎖線に示しており、変換後には再現可能な
範囲で余分な部分は残っていない。しかしながら、拡大
範囲を制限する場合には、同図(b)の二点鎖線で示す
ように、変換後の分布をどこに持ってくるかの自由度が
生じてしまい、場合によっては全体的に明るくなりすぎ
たり、暗くなり過ぎたりしかねない。従って、このよう
な場合には、変換前における階調範囲内において上端側
と下端側に残っている残余の領域の割合(m1:m2)
が、変換後において上端側と下端側に残っている残余の
領域の割合(n1:n2)と一致するように変換すれば
よい。
FIG. 23 shows a case where no restriction is placed on the enlargement ratio.
It is shown by the one-dot chain line in (a), and no extra portion remains in the reproducible range after conversion. However, in the case of limiting the expansion range, as shown by the chain double-dashed line in the same figure (b), there is a degree of freedom in where to bring the distribution after conversion, and in some cases it becomes bright as a whole. It can be too dark or too dark. Therefore, in such a case, the ratio of the residual areas remaining on the upper end side and the lower end side in the gradation range before conversion (m1: m2)
May be converted so as to match the ratio (n1: n2) of the remaining areas remaining on the upper end side and the lower end side after conversion.

【0146】以上のようにしてパラメータfar,fag,fab,
fbr,fbg,fbbを得る処理をステップS208にて実行
し、続くステップS210ではステップS206と同様
に変換テーブルを作成する。このときの変換テーブルは
図21に示す変換後の成分値(R1,G1,B1)を入力
として対応関係を演算し、変換テーブルにおける変換後
の成分値(R1,G1,B1)と入れ換える。これによ
り、同変換テーブルを参照すればステップS204にて
求めたオフセット量の加算とステップS208にて求め
たコントラストの強調処理という二つの処理を同時に実
施することになる。
As described above, the parameters far, fag, fab,
The process of obtaining fbr, fbg, and fbb is executed in step S208, and in the following step S210, a conversion table is created as in step S206. The conversion table at this time is calculated by using the converted component values (R1, G1, B1) shown in FIG. 21 as input, and replacing the converted component values (R1, G1, B1) in the conversion table. As a result, by referring to the conversion table, two processes, that is, the addition of the offset amount obtained in step S204 and the contrast enhancement process obtained in step S208, are simultaneously executed.

【0147】一方、度数分布の各色成分間のずれとし
て、もう一つ、全体的な明るさという要素が残る。従っ
て、ステップS214にてこの明るさのずれを均一化さ
せるγ補正をかけるため、ステップS212にてγを算
出する。例えば、図24にて実線で示す赤成分の度数分
布の山が全体的に暗い側に寄っていたり、同図にて一点
鎖線で示す青成分の度数分布の山が全体的に明るい側に
寄っていたりした場合に、同図鎖線で示す緑成分の度数
分布の山のように全体的に中央に寄るように修正移動さ
せると良い。
On the other hand, as the deviation between the color components of the frequency distribution, another factor called the overall brightness remains. Therefore, in step S214, γ correction is performed to make this brightness shift uniform, and thus γ is calculated in step S212. For example, the peak of the frequency distribution of the red component shown by the solid line in FIG. 24 is generally closer to the dark side, and the peak of the frequency distribution of the blue component shown by the alternate long and short dash line is generally closer to the bright side. If it does, it is advisable to correct and move it so that it is closer to the center as a whole like the peak of the frequency distribution of the green component shown by the chain line in the figure.

【0148】各種の実験を行った結果、本実施形態にお
いては、度数分布におけるメジアンを基準に判断し、同
メジアンが「85」未満である場合に暗い画像と判断し
て以下のγ値に対応するγ補正で明るくする。
As a result of various experiments, in the present embodiment, the judgment is made based on the median in the frequency distribution, and when the median is less than “85”, it is judged as a dark image and the following γ value is satisfied. Brighten with γ correction.

【0149】 γr=Rmed2/85 …(30) γg=Gmed/85 …(31) γb=Bmed2/85 …(32) あるいは、 γr=(Rmed2/85)**(1/2) …(33) γg=(Gmed/85)**(1/2) …(34) γb=(Bmed2/85)**(1/2) …(35) とする。[0149]   γr = Rmed2 / 85 (30)   γg = Gmed / 85 (31)   γb = Bmed2 / 85 (32) Alternatively,   γr = (Rmed2 / 85) ** (1/2) (33)   γg = (Gmed / 85) ** (1/2) (34)   γb = (Bmed2 / 85) ** (1/2) (35) And

【0150】この場合、γr,γg,γb<0.7となっ
ても、γr,γg,γb=0.7とする。このような限界
を設けておかないと夜の画像が昼間のようになってしま
うからである。なお、明るくしすぎると全体的に白っぽ
い画像になってコントラストが弱い画像になりやすいた
め、彩度を合わせて強調するなどの処理が好適である。
In this case, even if γr, γg, γb <0.7, γr, γg, γb = 0.7. This is because, if such a limit is not set, the night image becomes like the daytime image. Note that if the image is too bright, the image tends to be whitish as a whole, and the image tends to have a low contrast. Therefore, it is preferable to perform processing such as enhancing the saturation.

【0151】一方、メジアンが「128」より大きい場
合に明るい画像と判断して以下のγ値に対応するγ補正
で暗くする。
On the other hand, when the median is larger than "128", it is determined that the image is bright and the image is made dark by the γ correction corresponding to the following γ value.

【0152】 γr=Rmed2/128 …(36) γg=Gmed/128 …(37) γb=Bmed2/128 …(38) あるいは、 γr=(Rmed2/128)**(1/2) …(39) γg=(Gmed/128)**(1/2) …(40) γb=(Bmed2/128)**(1/2) …(41) とする。この場合、γr,γg,γb>1.3となって
も、γr,γg,γb=1.3として暗くなり過ぎないよ
うに限界を設けておく。なお、暗くしすぎると色が乗り
すぎて濃い画像になるので、合わせて彩度強調を弱くす
るなどの処理が好適である。ただし、明るい背景の中の
被写体に対してはこのような暗くする処理はかえって悪
影響を及ぼす場合もある。例えば、空が画像の半分をし
めるような風景画像や晴れた日の記念写真などでは、た
だでさえ逆光で顔が暗くつぶれ気味であることが多いか
らである。これらの画像の場合は暗い部分と明るい部分
とが混じっているので各色成分の標準偏差を求めると比
較的高い値となっていることが多い。従って、そのよう
な標準偏差が「70」よりも大きいような場合には暗く
するためのγ補正を行わないようにすることも可能であ
る。γ補正をした場合における対応関係を図25に示し
ており、γr,γg,γb<1であれば上方に膨らむカー
ブとなり、γr,γg,γb>1であれば下方に膨らむカ
ーブとなる。なお、明るさの修正に関しては必ずしも度
数分布に基づく必要はなく、他の要素から明るさを判断
して修正するようにしても良い。
Γr = Rmed2 / 128 (36) γg = Gmed / 128 (37) γb = Bmed2 / 128 (38) Alternatively, γr = (Rmed2 / 128) ** (1/2) (39) γg = (Gmed / 128) ** (1/2) (40) γb = (Bmed2 / 128) ** (1/2) (41) In this case, even if γr, γg, γb> 1.3, γr, γg, γb = 1.3, and a limit is set so as not to be too dark. It should be noted that if the image is too dark, the color will be overloaded and a dark image will result, so processing such as weakening the saturation emphasis is also suitable. However, such a darkening process may adversely affect a subject in a bright background. This is because, for example, in a landscape image in which the sky occupies half of the image or in a commemorative photo on a sunny day, the face is often dark and crushed by the backlight. In these images, the dark part and the bright part are mixed, and therefore the standard deviation of each color component is often a relatively high value. Therefore, when such a standard deviation is larger than “70”, it is possible not to perform γ correction for darkening. FIG. 25 shows the correspondence relationship when γ correction is performed. If γr, γg, γb <1, the curve expands upward, and if γr, γg, γb> 1, the curve expands downward. Note that the correction of the brightness does not necessarily have to be based on the frequency distribution, and the brightness may be determined from other factors and corrected.

【0153】以上のようにして決定したγr,γg,γb
に対してγ補正するには次式のようにする。変換前の階
調値r0,g0,b0に対して変換後の階調値R1,G1,B1
は、 R1=255*(r0/255)**γr …(42) G1=255*(g0/255)**γg …(43) B1=255*(b0/255)**γb …(44) なお、このγ補正も図21に示す変換テーブルに対して
実行する。すなわち、コントラスト強調の場合と同様に
図21に示す変換後の成分値(R1,G1,B1)を入力
として対応関係を演算し、変換テーブルにおける変換後
の成分値(R1,G1,B1)と入れ換える。これによ
り、同変換テーブルを参照すればオフセット量の加算と
コントラストの強調処理に加えて明度の修正の処理を同
時に実施することになる。
Γr, γg, γb determined as described above
For γ correction with respect to, the following equation is used. Grayscale values r1, G1, B1 after conversion with respect to grayscale values r0, g0, b0 before conversion
Is R1 = 255 * (r0 / 255) ** γr ... (42) G1 = 255 * (g0 / 255) ** γg ... (43) B1 = 255 * (b0 / 255) ** γb ... (44) Note that this γ correction is also executed on the conversion table shown in FIG. That is, as in the case of the contrast enhancement, the correspondence is calculated by inputting the converted component values (R1, G1, B1) shown in FIG. 21 and the converted component values (R1, G1, B1) in the conversion table are obtained. Replace. As a result, by referring to the conversion table, in addition to the offset amount addition and the contrast enhancement process, the brightness correction process is performed at the same time.

【0154】そして、最後に、ステップS216にて画
像データの変換を行い、全画素の画像データ(rm,g
m,bm)について図21に示す変換テーブルを参照
し、変換後の画像データ(Rm,Gm,Bm)を得ると
いう処理を繰り返すことになる。
Finally, in step S216, the image data is converted, and the image data (rm, g
For m, bm), the process of referring to the conversion table shown in FIG. 21 and obtaining the converted image data (Rm, Gm, Bm) is repeated.

【0155】本実施形態においては、オフセット量によ
る修正と、コントラストの強調と、明るさの修正とをこ
の順番に実施しているが、必ずしもこの全てを実施しな
ければならないわけではないし、また、個々の修正手法
も適宜変更して実施することもできる。
In this embodiment, the correction by the offset amount, the contrast enhancement, and the brightness correction are performed in this order, but it is not always necessary to perform all of them, and It is also possible to implement by appropriately changing each correction method.

【0156】例えば、上述した実施形態においては、コ
ントラストの強調処理においては、変換前の成分値に対
して直線的な対応関係をなす変換式で修正を行うように
しているが、より滑らかな変換となるように、図26に
示すようないわゆるS字カーブの変換を行うようにして
も良い。また、この場合、度数分布の広がりを両端位置
で判断するのではなく、分布の散らばり具合を表す標準
偏差の概念を利用することも可能である。以下、標準偏
差を利用したS字カーブの対応関係でコントラストを強
調する例を示す。なお、各成分毎の度数分布に基づいて
変換は行うものの、演算手法は全てにおいて共通するた
め、輝度の表現で表し、変換前の輝度yより変換後の輝
度Yを得る手順を示しておく。
For example, in the above-described embodiment, in the contrast enhancement processing, the correction is performed by the conversion equation having a linear correspondence relationship with the component value before conversion, but smoother conversion is performed. Therefore, the so-called S-curve conversion as shown in FIG. 26 may be performed. Further, in this case, it is also possible to use the concept of the standard deviation, which represents the degree of dispersion of the distribution, instead of determining the spread of the frequency distribution at both end positions. Hereinafter, an example in which the contrast is emphasized by the S-curve correspondence using the standard deviation will be described. Although the conversion is performed based on the frequency distribution of each component, the calculation method is common to all of the components, and therefore, the procedure for obtaining the brightness Y after conversion from the brightness y before conversion is shown because the calculation method is common.

【0157】標準偏差については二つの考え方があるが
本実施形態においては、次式に基づいて演算する。
There are two ways of thinking about the standard deviation, but in the present embodiment, calculation is performed based on the following equation.

【0158】[0158]

【数5】 [Equation 5]

【0159】yp:各画素の変換前の輝度 ym:各画素の変換前の輝度の平均値 標準偏差は輝度分布の広がり量に対応するものである
が、広がり量を表す意味では分散を利用してもよい。ま
た、本実施形態のように全体としての階調数が256階
調となっているので、分布の尖度kから広がり量を求め
ることも可能である。
Yp: brightness of each pixel before conversion ym: average value of brightness of each pixel before conversion The standard deviation corresponds to the spread amount of the brightness distribution, but dispersion is used in the sense of the spread amount. May be. Further, since the total number of gradations is 256 as in the present embodiment, it is possible to obtain the spread amount from the kurtosis k of the distribution.

【0160】[0160]

【数6】 [Equation 6]

【0161】なお、ここにいうk=3の尖度が正規分布
の広がり量に相当する。
The kurtosis of k = 3 here corresponds to the spread amount of the normal distribution.

【0162】このようにして求めた輝度分布の広がり量
である標準偏差σに基づいて、コントラストの強調は分
布密度の大きい範囲に多くの階調数を与えつつ分布密度
の小さい範囲に少ない階調数を割り当てることでもあ
り、図26に示すように入出力の対応関係がいわゆるS
字カーブとなると変換前に割り当てられている階調範囲
rng0に対して変換後に割り当てられる階調範囲RNG1は大
きくなり、割り当てられた階調数が多くなったことにな
る。一方、入力における低輝度側と高輝度側における階
調範囲rng0を外れた範囲についていえば、変換後に割り
当てられる階調範囲は少なくなったことになる。
On the basis of the standard deviation σ which is the spread amount of the brightness distribution thus obtained, the contrast enhancement gives a large number of gradations in the range where the distribution density is large, and a small number of gradations in the range where the distribution density is small. The number is also assigned, and as shown in FIG.
When it becomes a curved curve, the gradation range assigned before conversion
The gradation range RNG1 assigned after conversion with respect to rng0 is increased, and the number of assigned gradations is increased. On the other hand, regarding the range outside the gradation range rng0 on the low luminance side and the high luminance side in the input, the gradation range assigned after the conversion is reduced.

【0163】本実施形態においては、階調範囲の中心位
置ymidを「128」として、この中心位置ymid以下で
はγ1を与えるとともに、中心位置ymid より大きい範
囲ではγ2を与えたγ補正を行うものとし、このγ1,
γ2を標準偏差σに基づいて定める。すなわち、y≦1
28では、 γ1=(σstd_limit/σ)**fc …(47) y>128では、 γ2=(σ/σstd_limit)**fc …(48) とし、ステップS204にてこれらのパラメータ演算を
実行する。ここにおいて、σstd_limitとfcは変換結果
を考慮して実験的に求めて与えたパラメータであり、本
実施形態においてはσstd_limitを「128」とすると
ともにfcを「0.1」としている。標準偏差σは概して
「128」よりも小さな値となるからこれらの関係式で
は標準偏差σが大きいと、γ2とγ1はそれぞれ「1」
に近づくことになり、S字カーブの傾斜は緩やかにな
る。これは、広がり量が大きいときに中心位置ymidを
中心とする階調範囲rng0に対して変換先の階調範囲RNG0
はさほど広くならないことを意味しており、より具体的
には画像データの輝度が広く分布しているときには輝度
範囲を拡大するような変換を行わないことを意味する。
これに対して、標準偏差σが小さいと、γ2とγ1はそ
れぞれ「1」から離れることになり、S字カーブの傾斜
は急になる。これは、広がり量が小さいときに中心位置
ymidを中心とする階調範囲rng0に対して変換先の階調
範囲RNG1が広く拡大されることを意味しており、より具
体的には画像データの輝度が狭い範囲にしか分布してい
ないときには輝度範囲を拡大させる変換を行なうことを
意味する。
In the present embodiment, the central position ymid of the gradation range is set to "128", and γ1 is given below the central position ymid, and γ2 is given in the range larger than the central position ymid to perform γ correction. , This γ1,
γ2 is determined based on the standard deviation σ. That is, y ≦ 1
At 28, γ1 = (σstd_limit / σ) ** fc ... (47) At y> 128, γ2 = (σ / σstd_limit) ** fc ... (48), and these parameter calculations are executed in step S204. Here, σstd_limit and fc are parameters that are experimentally obtained and given in consideration of the conversion result, and in the present embodiment, σstd_limit is set to “128” and fc is set to “0.1”. Since the standard deviation σ is generally a value smaller than “128”, in these relational expressions, when the standard deviation σ is large, γ2 and γ1 are respectively “1”.
And the slope of the S-shaped curve becomes gentle. This is because when the spread amount is large, the gradation range RNG0 of the conversion destination is compared with the gradation range rng0 centered on the center position ymid.
Means that the brightness does not become so wide, and more specifically, it means that the conversion for expanding the brightness range is not performed when the brightness of the image data is widely distributed.
On the other hand, when the standard deviation σ is small, γ2 and γ1 are separated from “1”, and the slope of the S-shaped curve becomes steep. This means that the gradation range RNG1 of the conversion destination is expanded widely with respect to the gradation range rng0 centered on the center position ymid when the spread amount is small. When the brightness is distributed only in a narrow range, it means to perform conversion for expanding the brightness range.

【0164】本実施形態においては、S字カーブの対応
関係をγ補正によって成立させているが、図27には、
階調「0」、下方側四分点yq1、中心位置ymid、上方
側四分点yq3、階調「255」という五点を基準点とし
つつ、階調「0」と中心位置ymidと階調「255」に
対してはY=yとしつつ、下方側四分点yq1と上方側四
分点yq3における変換点を標準偏差に基づいて決定す
る。そして、これらの五点を結ぶ対応関係をスプライン
補間演算やニュートン補間で求める。むろん、中心位置
ymidから下方側の三点や上方側の三点をそれぞれスプ
ライン補間演算やニュートン補間で求めるようにしても
よい。
In the present embodiment, the S-curve correspondence is established by γ correction.
Gradation "0", lower quadrant yq1, center position ymid, upper quadrant yq3, gradation "255" are used as reference points, and gradation "0", center position ymid, and gradation For "255", Y = y is set, and the conversion points at the lower quadrant yq1 and the upper quadrant yq3 are determined based on the standard deviation. Then, the correspondence relationship connecting these five points is obtained by spline interpolation calculation or Newton interpolation. Of course, the three points on the lower side and the three points on the upper side from the center position ymid may be obtained by spline interpolation calculation or Newton's interpolation, respectively.

【0165】すなわち、図28に示すように、ステップ
S230にて各成分毎に標準偏差σr,σg,σb を求
め、ステップS232にて各色成分毎のγ1,γ2を求
め、ステップS234にてγ1,γ2を利用した対応関
係に基づいて変換テーブルを作成する。これらのステッ
プS230〜S234を図6に示すフローチャートにお
けるステップS208〜S214の処理に代えて実行す
る。
That is, as shown in FIG. 28, the standard deviations σr, σg and σb are obtained for each component in step S230, γ1 and γ2 are obtained for each color component in step S232, and γ1, γ1 is obtained in step S234. A conversion table is created based on the correspondence using γ2. These steps S230 to S234 are executed instead of the processing of steps S208 to S214 in the flowchart shown in FIG.

【0166】次に、上記構成からなる本実施形態の動作
を順を追って説明する。
Next, the operation of this embodiment having the above configuration will be described step by step.

【0167】スキャナ11などで写真を撮像したとする
と、同写真をRGBの階調データで表した画像データが
コンピュータ21に取り込まれ、CPUは図5及び図6
に示す画像処理のプログラムを実行して画像データの色
再現性を修正する処理を実行する。
If a picture is taken by the scanner 11 or the like, image data representing the picture as RGB gradation data is taken into the computer 21, and the CPU is processed by the CPU shown in FIGS.
The image processing program shown in is executed to execute processing for correcting the color reproducibility of image data.

【0168】まず、ステップS102では画像データを
所定の誤差内となる範囲で間引き、選択した画素につい
て各色成分毎に度数分布を求める。このままの度数分布
を使用することはできず、まず、画像が白黒のような二
値画像でないかステップS104にて判断するととも
に、ステップS108では自然画か否かを判断する。二
値画像である場合や自然画でない場合などを除き、ステ
ップS110では画像データに枠部がないか判断し、枠
部があれば除いた後、ステップS114にて度数分布の
両端の不明瞭領域を取り除く。この状態で各色成分毎の
度数分布について特徴ベクトルを求め、特徴ベクトル同
士の内積から度数分布の類似度をチェックする。各色成
分毎の度数分布があまり似ていないときには、元の画像
データにおいて意図的にカラーバランスがずれているこ
との裏付けとなり、特性を均一化させる処理は行わな
い。しかしながら、所定のしきい値との比較においてあ
る程度の類似性が見られる場合にはカラーバランスがず
れてしまっているものと判断して、以下のような特性の
均一化を図る。
First, in step S102, image data is thinned out within a predetermined error range, and a frequency distribution is obtained for each color component of the selected pixel. The frequency distribution as it is cannot be used. First, it is determined in step S104 whether the image is a binary image such as black and white, and in step S108 it is determined whether the image is a natural image. Except when it is a binary image or when it is not a natural image, in step S110 it is determined whether or not there is a frame portion in the image data, and if there is a frame portion, it is removed, and then in step S114, unclear areas at both ends of the frequency distribution. Get rid of. In this state, the feature vector is obtained for the frequency distribution of each color component, and the similarity of the frequency distribution is checked from the inner product of the feature vectors. When the frequency distributions of the respective color components are not very similar, this proves that the original image data is intentionally out of color balance, and the processing for equalizing the characteristics is not performed. However, if there is some similarity in comparison with a predetermined threshold value, it is determined that the color balance is out of order, and the following characteristics are made uniform.

【0169】すなわち、ステップS204では度数分布
の上端とメジアンを利用して緑成分に対する赤成分オフ
セットdRと青成分用オフセットdBとを求め、ステッ
プS206では最後の画像データ変換のための変換テー
ブルを形成する。続いて、ステップS208では各色成
分毎にコントラストの均一化を図りつつ同コントラスト
を強調するためのパラメータを演算し、ステップS21
0では同パラメータに基づいてコントラスト強調させつ
つ各色成分毎のコントラストのバランスを一致させるた
めの変換テーブルを作成する。そして、ステップS21
2では各色成分毎の明るさを均一化させるためのγ補正
のパラメータを演算し、かかるγ補正を施すことになる
変換テーブルを作成する。
That is, in step S204, the red component offset dR and the blue component offset dB with respect to the green component are obtained using the upper end of the frequency distribution and the median, and in step S206, the conversion table for the final image data conversion is formed. To do. Succeedingly, in a step S208, a parameter for enhancing the contrast while uniformizing the contrast is calculated for each color component, and a step S21 is performed.
At 0, a conversion table is created to match the balance of contrast for each color component while enhancing the contrast based on the same parameter. Then, step S21
In step 2, a γ correction parameter for equalizing the brightness of each color component is calculated, and a conversion table for performing such γ correction is created.

【0170】最後に、ステップS216にて上述したよ
うにして作成されている変換テーブルを参照して全画素
についての画像データを変換する。
Finally, in step S216, the image data for all pixels is converted with reference to the conversion table created as described above.

【0171】この場合は類似性があるか否かに応じてス
テップS202で処理を分けているが、図31に示すフ
ローチャートを実行する場合には類似具合に応じてオフ
セット量という実効値を変化させ、実質的に特性の均一
化を図ったり図らなかったりする。
In this case, the processing is divided in step S202 depending on whether or not there is similarity, but when executing the flowchart shown in FIG. 31, the effective value of the offset amount is changed according to the degree of similarity. , The characteristics may or may not be substantially uniformed.

【0172】むろん、上述したように二値画像や自然画
でない場合などにおいてはかかる画像処理は行われない
が、本発明の画像処理が行われた場合には、写真の状態
では色ずれなどの入力機器に起因するような色再現性の
悪かった画像データであるにもかかわらず、各色成分毎
に色ずれとコントラストと明るさとが均一化するととも
にコントラストを強調されてメリハリのある良好な画像
が極めて容易に得られるようになる。
Of course, as described above, such image processing is not performed when the image is not a binary image or a natural image. However, when the image processing of the present invention is performed, color misregistration or the like occurs in a photograph. Despite the image data having poor color reproducibility due to the input device, the color shift, contrast, and brightness are made uniform for each color component, and the contrast is emphasized to produce a good image with sharpness. It will be extremely easy to obtain.

【0173】なお、上述した実施形態においては、いく
つかのパラメータを一定としているが、コンピュータ2
1上では所定のGUIを介してユーザーが選択できるよ
うにしても良い。
In the above-described embodiment, some parameters are fixed, but the computer 2
On the first screen, the user may be allowed to select via a predetermined GUI.

【0174】このように、ステップS102で間引きす
るなどしながら画像データについて各色成分毎の度数分
布を求め、ステップ116にて度数分布間に類似性があ
るか否かを判断し、類似性が低くなければ本来的に度数
分布から見出される特性は一致するものと判断して、ス
テップS204〜S216にてオフセット修正やコント
ラスト強調や明るさ修正によってずれを修正することに
より、色再現性の悪い画像データであってもメリハリの
ある良好な画像としつつ、かかる作業を自動化し、非熟
練者でも容易にカラーバランスの修正を行うことができ
るようになる。
As described above, the frequency distribution for each color component of the image data is obtained by thinning out the image data in step S102, and it is determined in step 116 whether or not there is a similarity between the frequency distributions, and the similarity is low. If not, it is determined that the characteristics originally found from the frequency distribution are the same, and in steps S204 to S216, the shift is corrected by the offset correction, the contrast enhancement, and the brightness correction, so that the image data having poor color reproducibility is obtained. Even if the image is clear and good, the work can be automated and the color balance can be easily corrected by an unskilled person.

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

【図1】本発明の一実施形態にかかる画像処理装置が適
用される画像処理システムのブロック図である。
FIG. 1 is a block diagram of an image processing system to which an image processing apparatus according to an embodiment of the present invention is applied.

【図2】同画像処理装置の具体的ハードウェア構成例を
示すブロック図である。
FIG. 2 is a block diagram showing a specific hardware configuration example of the image processing apparatus.

【図3】本発明の画像処理装置の他の適用例を示す概略
ブロック図である。
FIG. 3 is a schematic block diagram showing another application example of the image processing apparatus of the present invention.

【図4】本発明の画像処理装置の他の適用例を示す概略
ブロック図である。
FIG. 4 is a schematic block diagram showing another application example of the image processing apparatus of the present invention.

【図5】本発明の画像処理装置における度数分布検出手
段と類似具合判断手段とに相当するフローチャートであ
る。
FIG. 5 is a flowchart corresponding to frequency distribution detection means and similarity determination means in the image processing apparatus of the present invention.

【図6】本発明の画像処理装置におけるオフセット量修
正手段とコントラスト修正手段と明るさ修正手段とに相
当するフローチャートである。
FIG. 6 is a flowchart corresponding to offset amount correction means, contrast correction means, and brightness correction means in the image processing apparatus of the present invention.

【図7】変換元の画像における座標を示す図である。FIG. 7 is a diagram showing coordinates in a conversion source image.

【図8】サンプリング周期を示す図である。FIG. 8 is a diagram showing a sampling cycle.

【図9】サンプリング画素数を示す図である。FIG. 9 is a diagram showing the number of sampling pixels.

【図10】変換元の画像とサンプリングされる画素の関
係を示す図である。
FIG. 10 is a diagram showing a relationship between a conversion source image and sampled pixels.

【図11】度数分布を検出するための配列変数を示す図
である。
FIG. 11 is a diagram showing array variables for detecting a frequency distribution.

【図12】グレー画像抽出間引き処理のフローチャート
である。
FIG. 12 is a flowchart of a gray image extraction thinning process.

【図13】白黒の画像を示す図である。FIG. 13 is a diagram showing a monochrome image.

【図14】白黒の画像の輝度分布を示す図である。FIG. 14 is a diagram showing a luminance distribution of a monochrome image.

【図15】非自然画と自然画の場合の各色成分毎の度数
分布の状態を示す図である。
FIG. 15 is a diagram showing a state of frequency distribution for each color component in the case of a non-natural image and a natural image.

【図16】枠部のある画像を示す図である。FIG. 16 is a diagram showing an image with a frame portion.

【図17】枠部のある画像の度数分布を示す図である。FIG. 17 is a diagram showing a frequency distribution of an image having a frame portion.

【図18】度数分布の端部処理と端部処理にて得られる
端部を示す図である。
FIG. 18 is a diagram showing edge processing of frequency distribution and edges obtained by the edge processing.

【図19】各色成分毎の特徴ベクトルとするための要素
の抽出方法を示す図である。
FIG. 19 is a diagram showing a method of extracting elements for forming a feature vector for each color component.

【図20】色再現性の修正の必要のないリニアな関係を
示す図である。
FIG. 20 is a diagram showing a linear relationship that does not require correction of color reproducibility.

【図21】度数分布に基づいて画像データを変換する際
の変換テーブルを示す図である。
FIG. 21 is a diagram showing a conversion table when converting image data based on a frequency distribution.

【図22】度数分布の拡大と全階調の範囲を示す図であ
る。
FIG. 22 is a diagram showing the expansion of the frequency distribution and the range of all gradations.

【図23】コントラストの拡大率に制限を与える場合を
示す図である。
[Fig. 23] Fig. 23 is a diagram illustrating a case where a contrast enlargement ratio is limited.

【図24】明るさの均一化を図る必要のある度数分布を
示す図である。
FIG. 24 is a diagram showing a frequency distribution that requires uniform brightness.

【図25】γ補正で変更される変換関係を示す図であ
る。
FIG. 25 is a diagram showing a conversion relationship changed by γ correction.

【図26】S字カーブの対応関係でコントラストを強調
させる変換関係を示す図である。
FIG. 26 is a diagram showing a conversion relationship for emphasizing contrast by the correspondence relationship of S-shaped curves.

【図27】特定した変換点を補間法で接続する場合の変
換関係を示す図である。
FIG. 27 is a diagram showing a conversion relationship when the specified conversion points are connected by an interpolation method.

【図28】S字カーブでコントラストと明るさを修正す
る場合の部分フローチャートである。
FIG. 28 is a partial flowchart in the case of correcting contrast and brightness with an S-shaped curve.

【図29】画像処理プログラムを記録する媒体から同プ
ログラムをハードディスクに転送する状態を示す図であ
る。
FIG. 29 is a diagram showing a state in which the program is transferred from the medium recording the image processing program to the hard disk.

【図30】利用する窓関数の変化状況を示すグラフであ
る。
FIG. 30 is a graph showing a change situation of a window function to be used.

【図31】窓関数を利用してオフセット量を調整する場
合における画像処理プログラムのフローチャートであ
る。
FIG. 31 is a flowchart of an image processing program in the case of adjusting an offset amount using a window function.

【図32】利用する他の窓関数の変化状況を示すグラフ
である。
FIG. 32 is a graph showing a change situation of another window function to be used.

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

10…画像入力装置 11…スキャナ 11b…スキャナ 12…デジタルスチルカメラ 12a…デジタルスチルカメラ 12b…デジタルスチルカメラ 13b…モデム 20…画像処理装置 21…コンピュータ 22…ハードディスク 30…画像出力装置 31…プリンタ 31a…プリンタ 31b…プリンタ 32…ディスプレイ 32a…ディスプレイ 41…フレキシブルディスク 42…CD−ROM 43…ハードディスク 44…ROM 45…RAM 46a…通信回線 46b…モデム 46c…ファイルサーバ 10 ... Image input device 11 ... Scanner 11b ... Scanner 12 ... Digital still camera 12a ... Digital still camera 12b ... Digital still camera 13b ... Modem 20 ... Image processing device 21 ... Computer 22 ... Hard disk 30 ... Image output device 31 ... Printer 31a ... Printer 31b ... printer 32 ... Display 32a ... display 41 ... Flexible disk 42 ... CD-ROM 43 ... Hard disk 44 ... ROM 45 ... RAM 46a ... communication line 46b ... Modem 46c ... File server

───────────────────────────────────────────────────── フロントページの続き Fターム(参考) 5B057 CA01 CA08 CB01 CB08 CE17 CH01 CH07 CH11 DB06 DB09 DC23 DC25 5C055 AA05 AA07 AA08 AA14 BA06 BA07 BA08 EA02 EA03 HA37 5C066 AA01 AA03 AA13 BA13 CA08 EA13 EC05 HA03 5C077 MP08 PP12 PP15 PP32 PP37 PP39 PQ12 PQ19 PQ22 PQ23 RR06 TT06 TT09 5C079 HB01 LA02 LA12 LA23 LA24 LB01 MA01 MA04 MA11 NA18 NA29 PA01 PA02    ─────────────────────────────────────────────────── ─── Continued front page    F term (reference) 5B057 CA01 CA08 CB01 CB08 CE17                       CH01 CH07 CH11 DB06 DB09                       DC23 DC25                 5C055 AA05 AA07 AA08 AA14 BA06                       BA07 BA08 EA02 EA03 HA37                 5C066 AA01 AA03 AA13 BA13 CA08                       EA13 EC05 HA03                 5C077 MP08 PP12 PP15 PP32 PP37                       PP39 PQ12 PQ19 PQ22 PQ23                       RR06 TT06 TT09                 5C079 HB01 LA02 LA12 LA23 LA24                       LB01 MA01 MA04 MA11 NA18                       NA29 PA01 PA02

Claims (20)

【特許請求の範囲】[Claims] 【請求項1】 概略対等な色成分からなる階調表色デー
タによって画像をドットマトリクス状の画素の集合とし
て表した画像データについて、同画像データの各成分値
を入力して所定の変換処理を施して出力することによ
り、入力と出力との関係でカラーバランスを修正する変
換が行われるようにした画像処理装置であって、各色成
分毎に階調表色データの分布を求めるとともに各色成分
の間でのずれを求め、求められたずれに基づいて各色成
分間の特性の均一化を図る特性均一化手段を具備するこ
とを特徴とする画像処理装置。
1. For image data in which an image is represented as a set of pixels in a dot matrix by gradation color data consisting of substantially equal color components, each component value of the image data is input to perform a predetermined conversion process. An image processing device that performs conversion to correct the color balance according to the relationship between the input and the output by applying and outputting, and calculates the distribution of gradation color data for each color component and An image processing apparatus comprising: a characteristic equalizing unit that obtains a shift between the color components and that makes the characteristics of the respective color components uniform based on the obtained shift.
【請求項2】 上記請求項1に記載の画像処理装置にお
いて、上記特性均一化手段は、上記分布に基づいて各色
成分間の類似具合を判断し、類似具合が小さい場合には
上記修正を図らないようにする修正制御手段を具備する
ことを特徴とする画像処理装置。
2. The image processing apparatus according to claim 1, wherein the characteristic equalizing means determines a degree of similarity between the color components based on the distribution, and if the degree of similarity is small, the correction is performed. An image processing apparatus, comprising: a correction control unit for eliminating the problem.
【請求項3】 上記請求項2に記載の画像処理装置にお
いて、上記修正制御手段は、上記階調表色データの取り
うる階調範囲を複数の領域に分け、各領域ごとの分布の
比較で各色成分間の類似具合を判断することを特徴とす
る画像処理装置。
3. The image processing apparatus according to claim 2, wherein the correction control unit divides a gradation range that the gradation color data can take into a plurality of areas and compares distributions of the respective areas. An image processing apparatus characterized by determining a degree of similarity between respective color components.
【請求項4】 上記請求項2または請求項3のいずれか
に記載の画像処理装置において、上記修正制御手段は、
各色成分の分布を要素とするベクトルの内積に基づいて
類似具合を判断することを特徴とする画像処理装置。
4. The image processing apparatus according to claim 2 or 3, wherein the correction control means comprises:
An image processing apparatus, characterized in that a degree of similarity is judged based on an inner product of vectors having distributions of respective color components as elements.
【請求項5】 上記請求項2〜請求項4のいずれかに記
載の画像処理装置において、上記特性均一化手段は、特
性の均一化を図るための実効値を利用するとともに、上
記修正制御手段は、この実効値を変化させることによっ
て実質的に修正を有効化させたり無効化させるととも
に、同実効値を連続的に変化させることを特徴とする画
像処理装置。
5. The image processing apparatus according to any one of claims 2 to 4, wherein the characteristic equalizing means uses an effective value for equalizing the characteristics, and the correction control means. The image processing apparatus is characterized in that the effective value is effectively changed or invalidated by changing the effective value, and the effective value is continuously changed.
【請求項6】 上記請求項1〜請求項5のいずれかに記
載の画像処理装置において、上記特性均一化手段は、各
色成分の階調表色データが近似している画素を上記分布
の対象とすることを特徴とする画像処理装置。
6. The image processing apparatus according to any one of claims 1 to 5, wherein the characteristic equalizing means targets the pixels whose gradation color data of each color component are similar to each other in the distribution target. An image processing device characterized by the following.
【請求項7】 上記請求項1〜請求項6のいずれかに記
載の画像処理装置において、上記特性均一化手段は、上
記分布における所定位置から特性を判断し、当該特性が
均一化するように各成分間のずれに対応するオフセット
量を求めて各成分値を修正することを特徴とする画像処
理装置。
7. The image processing apparatus according to claim 1, wherein the characteristic equalizing means determines the characteristic from a predetermined position in the distribution and makes the characteristic uniform. An image processing apparatus, characterized in that an offset amount corresponding to a shift between respective components is obtained and each component value is corrected.
【請求項8】 上記請求項7に記載の画像処理装置にお
いて、上記特性均一化手段は、上記分布の範囲の端部位
置を当該分布の特性と判断することを特徴とする画像処
理装置。
8. The image processing apparatus according to claim 7, wherein the characteristic equalizing means determines an end position of the range of the distribution as a characteristic of the distribution.
【請求項9】 上記請求項7または請求項8のいずれか
に記載の画像処理装置において、上記特性均一化手段
は、上記分布の略中央位置を当該分布の特性と判断する
ことを特徴とする画像処理装置。
9. The image processing apparatus according to claim 7 or 8, wherein the characteristic equalizing means determines that a substantially central position of the distribution is a characteristic of the distribution. Image processing device.
【請求項10】 上記請求項1〜請求項9のいずれかに
記載の画像処理装置において、上記特性均一化手段は、
各色成分毎の上記分布の広がりを略均一化させることを
特徴とする画像処理装置。
10. The image processing apparatus according to claim 1, wherein the characteristic equalizing means is
An image processing apparatus, characterized in that the spread of the distribution for each color component is made substantially uniform.
【請求項11】 上記請求項10に記載の画像処理装置
において、上記特性均一化手段は、上記分布の広がりの
両端を有効な階調範囲内で拡大させることを特徴とする
画像処理装置。
11. The image processing apparatus according to claim 10, wherein the characteristic equalizing means expands both ends of the spread of the distribution within an effective gradation range.
【請求項12】 上記請求項10に記載の画像処理装置
において、上記特性均一化手段は、同分布の広がり量に
基づいて分布密度の大きい範囲に多くの階調数を与えつ
つ分布密度の小さい範囲に少ない階調数を割り当てるこ
とを特徴とする画像処理装置。
12. The image processing apparatus according to claim 10, wherein the characteristic equalizing means gives a large number of gradations to a range having a large distribution density and a small distribution density based on the spread amount of the same distribution. An image processing apparatus characterized by assigning a small number of gradations to a range.
【請求項13】 上記請求項1〜請求項12のいずれか
に記載の画像処理装置において、上記特性均一化手段
は、各成分毎の分布に基づく明るさを均一化させること
を特徴とする画像処理装置。
13. The image processing apparatus according to claim 1, wherein the characteristic equalizing means uniformizes the brightness based on the distribution of each component. Processing equipment.
【請求項14】 上記請求項13に記載の画像処理装置
において、上記特性均一化手段は、上記分布の略中央位
置と所定階調との比較において画像の明暗を判断するこ
とを特徴とする画像処理装置。
14. The image processing apparatus according to claim 13, wherein the characteristic equalizing means determines whether the image is bright or dark by comparing a substantially central position of the distribution with a predetermined gradation. Processing equipment.
【請求項15】 上記請求項13または請求項14のい
ずれかに記載の画像処理装置において、上記特性均一化
手段は、画像の明暗の判断結果に基づいて各成分毎にγ
補正で画像の明暗を均一化させることを特徴とする画像
処理装置。
15. The image processing apparatus according to claim 13 or 14, wherein the characteristic equalizing means sets γ for each component based on a determination result of brightness of an image.
An image processing apparatus characterized in that the lightness and darkness of an image are made uniform by correction.
【請求項16】 概略対等な色成分からなる階調表色デ
ータによって画像をドットマトリクス状の画素の集合と
して表した画像データについて、同画像データの各成分
値を入力して所定の変換処理を施して出力することによ
り、入力と出力との関係でカラーバランスを修正する変
換を行うにあたり、各色成分毎に階調表色データの分布
を求めるとともに各色成分の間でのずれを求め、求めら
れたずれに基づいて各色成分間の特性の均一化を図るこ
とを特徴とする画像処理方法。
16. For image data in which an image is represented as a set of pixels in a dot matrix by gradation color data consisting of substantially equal color components, each component value of the image data is input to perform a predetermined conversion process. When performing conversion to correct the color balance based on the relationship between input and output by applying and outputting, the distribution of gradation color data is calculated for each color component, and the shift between each color component is also calculated. An image processing method characterized in that characteristics of respective color components are made uniform based on deviation.
【請求項17】 コンピュータによって画像処理するプ
ログラムを記録した媒体であって、概略対等な色成分か
らなる階調表色データによって画像をドットマトリクス
状の画素の集合として表した画像データについて、同画
像データの各成分値を入力して所定の変換処理を施して
出力することにより、入力と出力との関係でカラーバラ
ンスを修正する変換を行うにあたり、各色成分毎に階調
表色データの分布を求めるとともに各色成分の間でのず
れを求め、求められたずれに基づいて各色成分間の特性
の均一化を図ることを特徴とする画像処理プログラムを
記録した媒体。
17. A medium in which a program for image processing by a computer is recorded, wherein the image data is represented as a set of pixels in a dot matrix form by gradation color data consisting of substantially equal color components. By inputting each component value of the data, performing a predetermined conversion process and outputting it, when performing conversion to correct the color balance in the relationship between input and output, the distribution of gradation color data for each color component is calculated. A medium on which an image processing program is recorded, which is characterized in that a shift between each color component is obtained and a characteristic between the color components is made uniform based on the obtained shift.
【請求項18】 概略対等な色成分からなる階調表色デ
ータによって画像をドットマトリクス状の画素の集合と
して表した画像データについて、同画像データの各成分
値を入力して所定の変換処理を施して出力することによ
り、入力と出力との関係でカラーバランスを修正する変
換が行われるようにした画像処理装置であって、各色成
分ごとに階調表色データの分布の類似程度を求め、この
類似程度が小さい場合にカラーバランスを修正しないよ
うにすることを特徴とする画像処理装置。
18. For image data in which an image is represented as a set of pixels in a dot matrix by gradation color data consisting of substantially equal color components, each component value of the image data is input to perform a predetermined conversion process. An image processing apparatus that performs conversion to correct the color balance depending on the relationship between input and output by applying and outputting, and obtains the degree of similarity of the distribution of gradation color data for each color component, An image processing apparatus characterized in that the color balance is not corrected when the degree of similarity is small.
【請求項19】 概略対等な色成分からなる階調表色デ
ータによって画像をドットマトリクス状の画素の集合と
して表した画像データについて、同画像データの各成分
値を入力して所定の変換処理を施して出力することによ
り、入力と出力との関係でカラーバランスを修正する変
換を行なうにあたり、各色成分ごとに階調表色データの
分布の類似程度を求め、この類似程度が小さい場合にカ
ラーバランスを修正しないようにすることを特徴とする
画像処理方法。
19. For image data in which an image is represented as a set of pixels in a dot matrix by gradation color data consisting of substantially equal color components, each component value of the image data is input to perform a predetermined conversion process. When performing conversion to correct the color balance according to the relationship between input and output by applying and outputting, calculate the degree of similarity of gradation color data distribution for each color component, and if this degree of similarity is small, color balance is calculated. An image processing method characterized by not modifying.
【請求項20】 コンピュータによって画像処理するプ
ログラムを記録した媒体であって、概略対等な色成分か
らなる階調表色データによって画像をドットマトリクス
状の画素の集合として表した画像データについて、同画
像データの各成分値を入力して所定の変換処理を施して
出力することにより、入力と出力との関係でカラーバラ
ンスを修正する変換を行うにあたり、各色成分ごとに階
調表色データの分布の類似程度を求め、この類似程度が
小さい場合にカラーバランスを修正しないようにするこ
とを特徴とする画像処理プログラムを記録した媒体。
20. A medium on which a program for image processing by a computer is recorded, wherein the image data is represented by a set of pixels in a dot matrix with gradation color data consisting of substantially equal color components. By inputting each component value of the data, performing a predetermined conversion process and outputting it, when performing the conversion that corrects the color balance in the relationship between the input and the output, the distribution of the gradation color data for each color component A medium on which an image processing program is recorded, wherein a degree of similarity is obtained, and when the degree of similarity is small, the color balance is not corrected.
JP2002189637A 1997-01-24 2002-06-28 Image processing apparatus, image processing method, and medium on which image processing program is recorded Expired - Fee Related JP3664394B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002189637A JP3664394B2 (en) 1997-01-24 2002-06-28 Image processing apparatus, image processing method, and medium on which image processing program is recorded

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP1172997 1997-01-24
JP9-11729 1997-01-24
JP2002189637A JP3664394B2 (en) 1997-01-24 2002-06-28 Image processing apparatus, image processing method, and medium on which image processing program is recorded

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP25655297A Division JP3693086B2 (en) 1996-11-19 1997-09-22 Image processing apparatus, image processing method, and medium on which image processing program is recorded

Publications (3)

Publication Number Publication Date
JP2003092687A true JP2003092687A (en) 2003-03-28
JP2003092687A5 JP2003092687A5 (en) 2004-12-02
JP3664394B2 JP3664394B2 (en) 2005-06-22

Family

ID=26347237

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002189637A Expired - Fee Related JP3664394B2 (en) 1997-01-24 2002-06-28 Image processing apparatus, image processing method, and medium on which image processing program is recorded

Country Status (1)

Country Link
JP (1) JP3664394B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005333628A (en) * 2004-04-23 2005-12-02 Toa Corp Camera control apparatus, and monitoring camera system using same

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005333628A (en) * 2004-04-23 2005-12-02 Toa Corp Camera control apparatus, and monitoring camera system using same

Also Published As

Publication number Publication date
JP3664394B2 (en) 2005-06-22

Similar Documents

Publication Publication Date Title
US6535301B1 (en) Image processing apparatus, image processing method, image processing program recording medium, color adjustment method, color adjustment device, and color adjustment control program recording medium
US6608926B1 (en) Image processing method, image processing apparatus and recording medium
JPH10198802A (en) Image processor, image processing method, and medium recording image processing program
JP3693086B2 (en) Image processing apparatus, image processing method, and medium on which image processing program is recorded
JP4993028B2 (en) Image processing apparatus, image processing method, and medium on which image processing program is recorded
JPH118768A (en) Image processor, image processing method and medium recording image processing control program
JP2003125213A (en) Image processor, image processing method, and medium for storing image-processing control program
JP2003092687A (en) Image processing apparatus, image processing method and medium for recording image processing program
JP3698205B2 (en) Image processing apparatus, image processing method, and medium on which image processing program is recorded
JP2003125213A5 (en)
JP2003092687A5 (en)
JP3558073B2 (en) Image processing apparatus, image processing method, medium recording image processing control program
JP3682872B2 (en) Image processing apparatus, image processing method, and medium on which image processing program is recorded
JP3985147B2 (en) Image processing apparatus, image processing method, and medium on which image processing program is recorded
JP4123385B2 (en) Image processing apparatus, image processing method, and medium on which image processing program is recorded
JP3570416B2 (en) Image processing apparatus, image processing method, and medium recording image processing control program
JP4182365B2 (en) Image processing apparatus, image processing method, and medium on which image processing program is recorded
JP4228243B2 (en) Image processing apparatus, image processing method, and computer-readable recording medium recording program
JP2003069827A (en) Image processor, image processing method and medium having image processing program recorded thereon
JP2005108258A (en) Image processing apparatus and method and media for recording image processing program

Legal Events

Date Code Title Description
A975 Report on accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A971005

Effective date: 20040107

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040219

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040419

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040507

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050324

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

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20090408

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090408

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100408

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110408

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110408

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120408

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20130408

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20130408

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20140408

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees