JP2010062920A - Image processor, image processing method, program, and recording medium - Google Patents

Image processor, image processing method, program, and recording medium Download PDF

Info

Publication number
JP2010062920A
JP2010062920A JP2008227086A JP2008227086A JP2010062920A JP 2010062920 A JP2010062920 A JP 2010062920A JP 2008227086 A JP2008227086 A JP 2008227086A JP 2008227086 A JP2008227086 A JP 2008227086A JP 2010062920 A JP2010062920 A JP 2010062920A
Authority
JP
Japan
Prior art keywords
correction amount
correction
image
upper limit
color
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
JP2008227086A
Other languages
Japanese (ja)
Other versions
JP5004305B2 (en
Inventor
Noriko Miyagi
徳子 宮城
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2008227086A priority Critical patent/JP5004305B2/en
Publication of JP2010062920A publication Critical patent/JP2010062920A/en
Application granted granted Critical
Publication of JP5004305B2 publication Critical patent/JP5004305B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To prevent excessive correction and effect optimum tone correction within a range that the impression of an image is not changed too much before and after tone correction. <P>SOLUTION: A first correcting amount producing unit 15 produces a correcting amount improvement of viewability in a dark space region, a second correcting amount producing unit 16 produces a correcting amount for suppression of tone crushing in a highlight region, a third correcting amount producing unit 17 produces a correcting amount for preventing the impression of the image from being changed too much before and after the correction, and a correcting amount determining unit 18 determines the final correcting amount Δ. A correcting tone curve producing unit 19 produces a correcting tone curve in accordance with the final correcting amount Δ while a tone correcting unit 20 applies tone correction to respective pixels of input image data based on the produced correction tone curve. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、デジタルカメラやフィルムスキャナ等で撮影された画像の明るさを自動補正する画像処理装置、画像処理方法、プログラムおよび記録媒体に関し、MFP、プリンタ、デジタルカメラの付属ソフトなどに好適な技術に関する。   The present invention relates to an image processing apparatus, an image processing method, a program, and a recording medium for automatically correcting the brightness of an image taken with a digital camera, a film scanner, or the like, and is suitable for an MFP, a printer, software attached to a digital camera, and the like. About.

デジタルカメラにより逆光状態で撮影された画像や夜間撮影された画像は、露出不足のため被写体が暗く写され、また物陰に該当する部分を含んでいる場合には、画像の一部分が暗く写されてしまう。そのような画像に対しては、自動で明るさを補正する技術が種々研究され、既に実用化されている。   Images taken backlit by a digital camera or images taken at night are darkly exposed due to underexposure, and if the subject includes a part that corresponds to a shadow, part of the image is darkened. End up. For such an image, various techniques for automatically correcting the brightness have been studied and put into practical use.

例えば、階調補正により画像を明るく補正する際には、階調つぶれや階調飛びの発生、ノイズの増幅等の副作用が目立たない範囲内で補正することが求められる。特許文献1は、階調つぶれや色相ずれを起こすことなく適切に階調を補正する技術であり、また、特許文献2は、階調とびと階調つぶれの度合いを考慮して補正量を決定する技術である。   For example, when correcting an image brightly by gradation correction, it is required to perform correction within a range in which side effects such as gradation collapse, gradation skip, and noise amplification are not noticeable. Patent Document 1 is a technique for appropriately correcting gradation without causing gradation collapse or hue shift, and Patent Document 2 determines a correction amount in consideration of the degree of gradation skip and gradation collapse. Technology.

特開2002−369004号公報JP 2002-369004 A 特開平10−126619号公報JP-A-10-126619

しかし、上記したような副作用が目立たない範囲内で階調を補正しても、過補正により補正の前後で画像の印象が大きく変化し、好ましくないケースがある。例えば、曇り空を背景にして緑の芝生を撮影した画像では、芝生部分をあたかも晴天の下で撮影されたかのような明るさまで補正してしまうことがあるが、このような補正について本発明者が実施した主観評価によると、殆どのユーザーが望まないことであり、適正な補正とは評価されなかった。別の例として、夕焼け空を背景に建物を(恐らく意図的に)逆光で撮影したような画像に対して、建物の細部が見えるまで明るく補正してしまうことも、ユーザーにとっては余計なことであり、これも適正な補正との評価は受けなかった。   However, even if the gradation is corrected within a range where the above-mentioned side effects are not noticeable, there are cases where the impression of the image greatly changes before and after the correction due to overcorrection, which is not preferable. For example, in an image obtained by photographing a green lawn against a cloudy sky, the lawn portion may be corrected to the brightness as if it was photographed under fine weather. According to the subjective evaluation, most users did not want it, and it was not evaluated as appropriate correction. As another example, it is unnecessary for the user to correct the image of the building against the background of the sunset sky (possibly intentionally) backlit until the details of the building are visible. Yes, this was not evaluated as an appropriate correction.

本発明は上記した課題に鑑みてなされたもので、
本発明の目的は、過補正を防止して、階調補正の前後で画像の印象が大きく変わり過ぎない範囲内で適切な階調補正を行う画像処理装置、画像処理方法、プログラムおよび記録媒体を提供することにある。
The present invention has been made in view of the above problems,
An object of the present invention is to provide an image processing apparatus, an image processing method, a program, and a recording medium that prevent overcorrection and perform appropriate gradation correction within a range in which an image impression does not change significantly before and after gradation correction. It is to provide.

本発明は、画像中の被写体領域を判定する被写体領域判定手段と、前記被写体領域における代表色を抽出する代表色抽出手段と、前記代表色における補正量上限を設定する補正量上限設定手段と、前記代表色における階調補正前と階調補正後の色差が、前記補正量上限を超えない範囲内で、階調補正量を決定する補正量決定手段と、前記階調補正量に応じて、前記画像の階調を補正する階調補正手段を備えることを最も主要な特徴とする。   The present invention includes a subject area determination unit that determines a subject area in an image, a representative color extraction unit that extracts a representative color in the subject area, a correction amount upper limit setting unit that sets a correction amount upper limit in the representative color, A correction amount determining means for determining a gradation correction amount within a range in which a color difference before and after gradation correction in the representative color does not exceed the upper limit of the correction amount, and according to the gradation correction amount, The main feature is that a gradation correction means for correcting the gradation of the image is provided.

請求項1、6〜8:画像中の被写体領域を判定し、被写体領域における代表色を抽出し、代表色における補正量上限を設定し、代表色における階調補正前と階調補正後の色差が、補正量上限を超えない範囲内で、階調補正量を決定して階調補正を行うため、過補正を防止して、階調補正の前後で印象が大きく変わり過ぎない範囲内で適切な階調補正を行うことができる。   Claims 1, 6 to 8: A subject region in an image is determined, a representative color in the subject region is extracted, a correction amount upper limit is set in the representative color, and a color difference between the representative color before gradation correction and after gradation correction However, since the tone correction amount is determined and the tone correction is performed within the range that does not exceed the upper limit of the correction amount, overcorrection is prevented, and it is appropriate within the range where the impression does not change significantly before and after the tone correction. Gradation correction can be performed.

請求項2〜5:画像中のハイライト領域を判定し、ハイライト領域の色分布を判定し、ハイライト領域の色分布に応じて、補正量上限設定手段で設定する補正量上限を変更して、代表色における階調補正前と階調補正後の色差が、補正量上限を超えない範囲内で、階調補正量を決定して階調補正を行うため、空の色や明るさに応じて特に印象を変えたくないシーンの画像でより効果的に過補正を防止して、階調補正の前後で印象が大きく変わり過ぎない範囲内で適切な階調補正を行うことができる。   Claims 2 to 5: Determine a highlight area in the image, determine a color distribution of the highlight area, and change a correction amount upper limit set by the correction amount upper limit setting unit according to the color distribution of the highlight area. Therefore, in order to perform gradation correction by determining the gradation correction amount within the range where the color difference before and after gradation correction in the representative color does not exceed the upper limit of the correction amount, Accordingly, it is possible to prevent overcorrection more effectively in an image of a scene where it is not particularly desired to change the impression, and to perform appropriate gradation correction within a range in which the impression does not change significantly before and after the gradation correction.

以下、発明の実施の形態について図面により詳細に説明する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

実施例1
図1は、本発明の実施例1の構成を示す。輝度変換部10は、ビットマップ形式の入力画像データの各画素のRGB値を、次式で輝度Yに変換する。
Y=0.30×R+0.59×G+0.11×B
ヒストグラム作成部11は、輝度Yのヒストグラムを作成する。RGBが0〜255の各8bitの値を持つ場合で説明すると、Yも0〜255の値を持つことになる。
Example 1
FIG. 1 shows the configuration of Embodiment 1 of the present invention. The luminance conversion unit 10 converts the RGB value of each pixel of the input image data in the bitmap format into luminance Y by the following equation.
Y = 0.30 × R + 0.59 × G + 0.11 × B
The histogram creation unit 11 creates a brightness Y histogram. In the case where RGB has a value of 8 bits each of 0 to 255, Y also has a value of 0 to 255.

領域抽出部12は、作成したヒストグラムに基づき、画像内における被写体領域、暗部領域、ハイライト領域を判定するための閾値th1,th2を求める。図2(a)は、領域抽出部12の構成を示す。ヒストグラム形状から適応的に背景と対象物を分離する二値化閾値を求める判別分析法を2回使って求める。判別分析法を簡単に説明すると、ヒストグラムの0〜二値化閾値までを一つのクラス、二値化閾値〜255までを一つのクラスとして、(クラス間分散/クラス内分散)が最大になる閾値を求めることで、背景と対象物がよく分離され(即ちクラス間分散が大きい)、かつ、背景内および対象物内がよくまとまっている(即ちクラス内分散が小さい)二値化閾値を求める方法である。   The area extraction unit 12 obtains thresholds th1 and th2 for determining a subject area, a dark area, and a highlight area in the image based on the created histogram. FIG. 2A shows the configuration of the region extraction unit 12. The discriminant analysis method for obtaining a binarization threshold value for adaptively separating the background and the object from the histogram shape is used twice. To briefly explain the discriminant analysis method, the threshold between 0 and the binarization threshold of the histogram is one class, and the binarization threshold to 255 is one class, and the threshold that maximizes (inter-class variance / intra-class variance). To obtain a binarization threshold in which the background and the object are well separated (ie, the variance between classes is large), and the background and the object are well organized (ie, the variance within the class is small) It is.

判別分析法による閾値算出部120では、ヒストグラム全体である、図2(b)の対象範囲1に対して判別分析法を適用して二値化閾値th1を求める。求めた閾値th1は、被写体領域とハイライト領域を分離する閾値に該当する。判別分析法による閾値算出部121では、ヒストグラムの被写体領域である、図2(b)の対象範囲2に対して判別分析法を適用して二値化閾値th2を求める。求めた閾値th2は、被写体領域を暗部領域とそれ以外に分離する閾値に該当する。ここで言う暗部とは、薄暗いレベルではなく、画像を標準的な光源やモニタ設定の条件下で目視観察して暗部に何が写っているかはっきり視認できないくらい暗いレベルの領域を意識したものである。   The threshold value calculation unit 120 based on the discriminant analysis method obtains the binarization threshold th1 by applying the discriminant analysis method to the target range 1 in FIG. The obtained threshold th1 corresponds to a threshold for separating the subject area and the highlight area. The threshold value calculation unit 121 based on the discriminant analysis method obtains the binarization threshold th2 by applying the discriminant analysis method to the target range 2 in FIG. 2B, which is the subject area of the histogram. The obtained threshold th2 corresponds to a threshold for separating the subject area into the dark part area and the other part. The dark part here is not a dim level, but an area that is so dark that it is not possible to see clearly what is in the dark part by visually observing the image under standard light source and monitor settings. .

補正トーンカーブ生成部19は、補正量決定部18が決定した最終的な補正量Δに応じて補正トーンカーブを生成する。入力画像データや抽出した色情報等に基づき、第一の補正量生成部15は、暗部領域の視認性向上に着目した補正量を生成し、第二の補正量生成部16は、ハイライト領域の階調つぶれ抑制に着目した補正量を生成し、第三の補正量生成部17は、補正前後で画像の印象を大きく変えないことに着目した補正量を生成し、補正量決定部18は、最終的な補正量Δを決定する。   The correction tone curve generation unit 19 generates a correction tone curve according to the final correction amount Δ determined by the correction amount determination unit 18. Based on the input image data, the extracted color information, and the like, the first correction amount generation unit 15 generates a correction amount focused on improving the visibility of the dark region, and the second correction amount generation unit 16 selects the highlight region. The third correction amount generation unit 17 generates a correction amount focusing on not changing the impression of the image largely before and after the correction, and the correction amount determination unit 18 The final correction amount Δ is determined.

図3は、最終的に作成するトーンカーブ形状を示したものである。補正トーンカーブは輝度Yの変換テーブルとする。制御点は、始点0と終点255以外では、入力Y=th1,th2,Yaの3点であり、各区間内では直線形状とする。制御点th1とth2は前述の領域抽出部12から出力される閾値であり、制御点Yaは後述の第一の補正量生成部15から出力される暗部領域内の制御点である。補正量Δは、制御点Yaにおける入力Yに対する出力Yの増加分を表したものである。暗部領域における0≦入力Y<Yaの傾きα1は、YaとΔにより決まる。制約条件として、暗部領域以外の被写体領域に該当するth2≦入力Y<th1で、傾きα3を1にして階調性を保存し、Ya≦入力Y<th2は区間境界で傾きが急激に変化することを防止するため傾きα2を傾きα1とα3の中間とする。これにより、3つの制御点と補正量Δが決まれば、補正トーンカーブ全体が決まる。また、3つの制御点が決まっていれば、もう一つの情報は補正量Δでなくα4であっても、あるいは補正トーンカーブが通るどこか一点の入力と出力のデータセットであっても、上記制約条件から補正トーンカーブ全体を決定することが可能である。   FIG. 3 shows a tone curve shape to be finally created. The correction tone curve is a luminance Y conversion table. The control points are input Y = th1, th2, and Ya except for the start point 0 and the end point 255, and have a linear shape in each section. The control points th1 and th2 are threshold values output from the region extraction unit 12 described above, and the control point Ya is a control point in a dark region that is output from a first correction amount generation unit 15 described later. The correction amount Δ represents an increase in the output Y with respect to the input Y at the control point Ya. The slope α1 of 0 ≦ input Y <Ya in the dark region is determined by Ya and Δ. As a constraint, th2 ≦ input Y <th1 corresponding to the subject area other than the dark area, and the gradient α3 is saved by setting the gradient α3 to 1. The gradient of Ya ≦ input Y <th2 changes abruptly at the section boundary. In order to prevent this, the inclination α2 is set between the inclinations α1 and α3. Thus, when the three control points and the correction amount Δ are determined, the entire correction tone curve is determined. If three control points are determined, the other information is α4 instead of the correction amount Δ, or the input and output data set at one point somewhere through the correction tone curve. It is possible to determine the entire corrected tone curve from the constraints.

階調補正部20は、生成した補正トーンカーブを基に、入力画像データの各画素に対して階調補正を施す。RGBから輝度変換により輝度Yを算出し、算出した輝度を入力Yとして補正トーンカーブを参照して出力Yを求め、RGBの各信号に対して(出力Y/入力Y)を乗算したものを階調補正後のRGBとする。   The gradation correction unit 20 performs gradation correction on each pixel of the input image data based on the generated correction tone curve. The luminance Y is calculated from the RGB by luminance conversion, the output Y is obtained by referring to the correction tone curve with the calculated luminance as the input Y, and each signal of RGB is multiplied by (output Y / input Y). RGB after tone correction.

領域面積率計算部13は、第一の補正量生成部15で使用する暗部面積率Pdと、第二の補正量生成部16で使用するハイライト面積率Phを求めておく。   The area area ratio calculation unit 13 obtains the dark area ratio Pd used by the first correction amount generation unit 15 and the highlight area ratio Ph used by the second correction amount generation unit 16.

図4は、領域面積率計算部13の構成を示す。図2(b)のヒストグラムと閾値th1から、ハイライト/被写体画素数計数部130は、被写体領域の画素数Naとハイライト領域の画素数Nbを計数する。被写体領域の画素数はヒストグラムにおける0≦Y<th1の画素数を全て足し合わせることで求められ、ハイライト領域の画素数はヒストグラムにおけるth1≦Y≦255の画素数を全て足し合わせることで求められる。同様に、ヒストグラムと閾値th2から、暗部画素数計数部132は、暗部領域の画素数Ncを計数する。暗部領域の画素数はヒストグラムにおける0≦Y<th2の画素数を全て足し合わせることにより求められる。   FIG. 4 shows the configuration of the area area ratio calculation unit 13. From the histogram and threshold value th1 in FIG. 2B, the highlight / subject pixel number counting unit 130 counts the pixel number Na of the subject region and the pixel number Nb of the highlight region. The number of pixels in the subject area is obtained by adding all the pixels of 0 ≦ Y <th1 in the histogram, and the number of pixels in the highlight area is obtained by adding all the pixels of th1 ≦ Y ≦ 255 in the histogram. . Similarly, the dark part pixel number counting unit 132 counts the number of pixels Nc in the dark part region from the histogram and the threshold value th2. The number of pixels in the dark area is obtained by adding all the numbers of pixels of 0 ≦ Y <th2 in the histogram.

ハイライト面積率計算部131では、画像内におけるハイライト領域の面積率Phを次式で求める。
Ph=Nb/(Na+Nb)
暗部面積率計算部133では、被写体領域における暗部領域の面積率Pdを次式で求める。
Pd=Nc/Na
画像サンプリング部30は、画像が所定サイズよりも大きい場合には、画像を平均値でサンプリングする。第一の補正量生成部15、第二の補正量生成部16および被写体代表色抽出部14では、使用する画像データの画素数が大きすぎると処理に時間がかかり、また性能面でも解像度が高すぎるとノイズの影響から正確に補正量が求められないことがあるので、画像が所定サイズよりも大きい場合には、画像を平均値でサンプリングする。例えば、長辺が640画素よりも大きい場合に、サンプリングを実施し、長辺の画素数が640の3倍の画像が入力された場合には、3×3画素毎に平均値を求めてサンプリング画像の画素値とする。
The highlight area ratio calculation unit 131 obtains the area ratio Ph of the highlight area in the image by the following equation.
Ph = Nb / (Na + Nb)
The dark area ratio calculation unit 133 obtains the area ratio Pd of the dark area in the subject area by the following equation.
Pd = Nc / Na
When the image is larger than a predetermined size, the image sampling unit 30 samples the image with an average value. In the first correction amount generation unit 15, the second correction amount generation unit 16, and the subject representative color extraction unit 14, if the number of pixels of the image data to be used is too large, the processing takes time and the resolution is high in terms of performance. If the image is too large, the correction amount may not be obtained accurately due to the influence of noise. If the image is larger than a predetermined size, the image is sampled with an average value. For example, when the long side is larger than 640 pixels, sampling is performed, and when an image whose number of long side pixels is three times 640 is input, an average value is obtained every 3 × 3 pixels and sampling is performed. The pixel value of the image.

図5は、第一の補正量生成部15の構成を示す。輝度変換部150は、サンプリング画像のRGB値を輝度値に変換し、暗部領域判定部151は、輝度値が閾値th2未満であれば暗部領域の画素であると判定する。色変換部152はサンプリング画像データをLabに変換し、クラスタリング部153は、暗部領域判定結果と、色変換152でLabに変換したサンプリング画像データを入力として、クラスタリングを行う。   FIG. 5 shows a configuration of the first correction amount generation unit 15. The luminance conversion unit 150 converts the RGB value of the sampling image into a luminance value, and the dark area determination unit 151 determines that the pixel is in the dark area if the luminance value is less than the threshold th2. The color conversion unit 152 converts the sampled image data to Lab, and the clustering unit 153 performs clustering using the dark region determination result and the sampled image data converted to Lab by the color conversion 152 as input.

図6は、クラスタリング部153の構成を示す。予備クラスタリング部156は、色差に応じて暗部領域判定結果を、1つ以上のクラスタに分割した後、クラスタ統合部157では、画素数の少ないクラスタを他のクラスタに統合する。   FIG. 6 shows the configuration of the clustering unit 153. The preliminary clustering unit 156 divides the dark region determination result into one or more clusters according to the color difference, and then the cluster integration unit 157 integrates the cluster with a small number of pixels into another cluster.

図7は、予備クラスタリング部156の処理フローチャートである。注目画素のLabを順次入力し(ステップ1561)、クラスタリングを行う。画像先端からスタートして初めて暗部領域の画素が入力された時点では、クラスタ数Nが初期化されてN=0にセットされた状態であるため(ステップ1560)、色差による条件分岐(ステップ1565)で“No”の方に進んでクラスタ1を新規クラスタとして追加し、クラスタ数をN=1に設定、クラスタ1の画素数をn(1)=0に設定、クラスタ1の平均Labに注目画素のLab値が設定される(ステップ1568,1569)。   FIG. 7 is a processing flowchart of the preliminary clustering unit 156. The Lab of the pixel of interest is sequentially input (step 1561), and clustering is performed. When the pixels in the dark area are input for the first time from the beginning of the image, since the number of clusters N is initialized and N = 0 is set (step 1560), conditional branching due to color difference (step 1565). To go to “No” and add cluster 1 as a new cluster, set the number of clusters to N = 1, set the number of pixels in cluster 1 to n (1) = 0, and focus on the average Lab of cluster 1 Lab values are set (steps 1568 and 1569).

その後は、順次入力される注目画素のLab値に対して、暗部領域の画素であれば(ステップ1570)、各クラスタの平均Labとの色差を求め(ステップ1563)、その中で色差最小のクラスタ番号jと色差dE_minの組を抽出する(ステップ1564)。色差による条件分岐(ステップ1565)で色差dE_minが予め設定された閾値dE_th以下であれば“Yes”の方に進んでクラスタjに注目画素を追加し、平均Labを再計算する(ステップ1566,1567)。クラスタjの画素数n(j)を+1して、L*a*b*の平均値を以下の式に従い再計算する。
(再計算後の平均L)=((再計算前の平均L)×(n(j)−1)+(注目画素のL))/n(j)
(再計算後の平均a)=((再計算前の平均a)×(n(j)−1)+(注目画素のa))/n(j)
(再計算後の平均b)=((再計算前の平均b)×(n(j)−1)+(注目画素のb))/n(j)
色差による条件分岐(ステップ1565)で色差dE_minが予め設定された閾値dE_thより大きければ“No”の方に進んで新規クラスタを追加し、クラスタ数Nをカウントアップして新規クラスタの画素数を0に設定し、平均Labに注目画素のLabを設定する(ステップ1568,1569)。新規クラスタを追加するか否かの境界色差を表しているのがdE_thであり、暗部の何が写っているかはっきり視認できない領域を対象としていることを考慮してdE_th=3くらいの小さい値に設定しておくのが適当である。
Thereafter, if the Lab value of the pixel of interest that is sequentially input is a pixel in the dark area (step 1570), the color difference from the average Lab of each cluster is obtained (step 1563), and the cluster having the smallest color difference among them is determined. A set of the number j and the color difference dE_min is extracted (step 1564). If the color difference dE_min is less than or equal to a preset threshold value dE_th in the conditional branch by color difference (step 1565), the process proceeds to “Yes” to add the pixel of interest to the cluster j and recalculate the average Lab (steps 1566 and 1567). ). The number of pixels n (j) in cluster j is incremented by 1, and the average value of L * a * b * is recalculated according to the following equation.
(Average L after recalculation) = ((Average L before recalculation) × (n (j) −1) + (L of target pixel)) / n (j)
(Average a after recalculation) = ((Average a before recalculation) × (n (j) −1) + (a of target pixel)) / n (j)
(Average b after recalculation) = ((Average b before recalculation) × (n (j) −1) + (b of target pixel)) / n (j)
If the color difference dE_min is larger than the preset threshold value dE_th in the conditional branch by color difference (step 1565), the process proceeds to “No”, a new cluster is added, the number of clusters N is counted up, and the number of pixels of the new cluster is reduced to 0. And the Lab of the pixel of interest is set to the average Lab (steps 1568 and 1569). DE_th represents the boundary color difference whether or not to add a new cluster, and is set to a small value such as dE_th = 3 in consideration of the fact that the area where the dark part is not clearly visible is targeted. It is appropriate to keep it.

画像後端まで到達して入力するLabデータが無くなった時点で、クラスタリング終了となる。   Clustering ends when the Lab data reaches the rear end of the image and there is no more Lab data to input.

予備クラスタリング部156で分割されたクラスタのうち、ある程度画素数が少ないクラスタはノイズ成分に反応して発生したクラスタであることが多く、いずれにしても被写体を有意な塊単位で抽出する上において不要または重要性が低いクラスタである。   Of the clusters divided by the preliminary clustering unit 156, a cluster having a small number of pixels is often a cluster generated in response to a noise component, and anyway, it is not necessary to extract a subject in significant chunks. Or it is a less important cluster.

図8は、クラスタ統合部157の処理フローチャートである。各クラスタを順次見ていき、クラスタの画素数が所定閾値n_thより小さいか否かを判定し(ステップ1575)、小さい場合は注目クラスタiの平均Labと他のクラスタの平均Labとの色差を求め(ステップ1576)、他のクラスタ全てに対して求めた色差のうち最小のものに該当するクラスタ番号jを抽出し(ステップ1577)、クラスタiをクラスタjに統合する(ステップ1578)。クラスタjの画素数にクラスタiの画素数を加算し、クラスタiの画素数を0に変更する。統合するクラスタの画素数境界である閾値n_thは、暗部領域の画素数に対して例えば15%(10%〜20%程度に設定するのが適当)の画素数に相当する値を画像毎に求めて、それを閾値とする。   FIG. 8 is a processing flowchart of the cluster integration unit 157. Each cluster is sequentially viewed, and it is determined whether or not the number of pixels in the cluster is smaller than a predetermined threshold n_th (step 1575). If smaller, the color difference between the average Lab of the cluster i of interest and the average Lab of other clusters is obtained. (Step 1576), the cluster number j corresponding to the smallest color difference obtained for all other clusters is extracted (Step 1577), and the cluster i is integrated into the cluster j (Step 1578). The number of pixels in cluster i is added to the number of pixels in cluster j, and the number of pixels in cluster i is changed to zero. The threshold value n_th, which is the boundary of the number of pixels of the cluster to be integrated, is obtained for each image, for example, a value corresponding to the number of pixels of 15% (suitably set to about 10% to 20%) with respect to the number of pixels in the dark area. That is the threshold value.

図5に戻り、判断部154では、クラスタ数に応じて階調補正を行うか否か判断する。クラスタ数が1であれば階調補正を行わないと判断し、クラスタ数が1以外であれば階調補正を行うと判断する。これにより、夜空を背景に花火を撮影した画像のように暗部に該当する夜空に何もオブジェクトが潜んでおらず、明るく補正する必要がない画像が入力された場合に、階調補正を行わないと判断して処理することができる。   Returning to FIG. 5, the determination unit 154 determines whether to perform gradation correction according to the number of clusters. If the number of clusters is 1, it is determined not to perform gradation correction, and if the number of clusters is other than 1, it is determined to perform gradation correction. As a result, tone correction is not performed when an image that does not need to be brightly corrected is input when there is no object in the night sky corresponding to the dark area, such as an image of fireworks shot against the night sky. Can be processed.

図9は、第一の補正量決定部155の構成を示す。図5の判断部154が階調補正を行わないと判断した場合は、選択部159はΔ1b=0を選択して、Δ1=Δ1aを補正量として出力することにより、実質的に階調補正を無効にする。判断部154が階調補正を行うと判断した場合は、補正量算出部158が算出した補正量Δ1bを選択して、Δ1=Δ1bを補正量として出力する。   FIG. 9 shows a configuration of the first correction amount determination unit 155. When the determination unit 154 in FIG. 5 determines not to perform gradation correction, the selection unit 159 selects Δ1b = 0 and outputs Δ1 = Δ1a as a correction amount, thereby substantially correcting gradation. To disable. When the determination unit 154 determines to perform gradation correction, the correction amount Δ1b calculated by the correction amount calculation unit 158 is selected and Δ1 = Δ1b is output as the correction amount.

図10は、補正量算出部158の構成を示す。第一のクラスタ抽出部1580は、各クラスタの画素数を比較して画素数が最も多いクラスタとその次に多いクラスタを抽出する。2つのクラスタのうち明度が高い方をクラスタA、明度が低い方をクラスタBと表記する。色差計算部1582では、クラスタAとクラスタBの補正前の平均Lab同士の色差dE1を計算しておく。補正量生成部1592は補正量Δ1bを設定して、仮補正トーンカーブ生成部1591は補正量に応じた仮補正トーンカーブを作成する。階調補正部1585は仮補正トーンカーブを用いた階調補正を、クラスタAの平均Labを色変換部1783でRGBに変換したRGB_aと、クラスタBの平均Labを同じくRGBに変換したRGB_bに対して行い、補正後の値を色変換部1586で再度Lab信号に変換する。色差計算部1587では、クラスタAとクラスタBの補正後の平均Lab同士の色差dE2を計算する。色差比計算部1588では、補正前の色差dE1と補正後の色差dE2の比率を計算して求める。   FIG. 10 shows the configuration of the correction amount calculation unit 158. The first cluster extraction unit 1580 compares the number of pixels of each cluster and extracts the cluster having the largest number of pixels and the cluster having the next largest number. Of the two clusters, the higher brightness is expressed as cluster A, and the lower brightness is expressed as cluster B. The color difference calculation unit 1582 calculates the color difference dE1 between the average Lab before correction of the cluster A and the cluster B. The correction amount generation unit 1592 sets the correction amount Δ1b, and the temporary correction tone curve generation unit 1591 generates a temporary correction tone curve corresponding to the correction amount. The tone correction unit 1585 performs tone correction using the temporary correction tone curve for RGB_a obtained by converting the average Lab of cluster A into RGB by the color conversion unit 1783 and RGB_b obtained by converting the average Lab of cluster B into RGB similarly. The color conversion unit 1586 converts the corrected value into a Lab signal again. The color difference calculation unit 1587 calculates the color difference dE2 between the average Lab after correction of the cluster A and the cluster B. The color difference ratio calculation unit 1588 calculates and obtains the ratio of the color difference dE1 before correction and the color difference dE2 after correction.

第二のクラスタ抽出部1581では、最も暗いクラスタを抽出する。最も暗いクラスタをクラスタCと表記する。ちなみに、画像によってはクラスタBとクラスタCが同じクラスタを指すこともあるが、それでも構わない。階調補正部1585では、仮補正トーンカーブを用いた階調補正を、クラスタCの平均Labを色変換部1584でRGBに変換したRGB_cに対して行い、補正後の値を色変換部1586で再度Lab信号に変換する。   The second cluster extraction unit 1581 extracts the darkest cluster. The darkest cluster is denoted as cluster C. Incidentally, although the cluster B and the cluster C may point to the same cluster depending on the image, it does not matter. In the gradation correction unit 1585, gradation correction using the temporary correction tone curve is performed on RGB_c obtained by converting the average Lab of the cluster C into RGB by the color conversion unit 1584, and the value after correction is performed by the color conversion unit 1586. It is converted again into a Lab signal.

暗部補正量判定部1589では、以下の終了条件1または終了条件2を満たせば、その時点での補正量Δ1bを出力して終了する。どちらの終了条件も満たさなければ、補正量生成部1592では、変更した補正量を発生させ、終了条件を満足するまで処理を繰り返す。
[終了条件1]クラスタAとクラスタBの補正前後の色差比が、色差比目標値設定部1583に設定された目標値Xd以上である。
[終了条件2]クラスタCの補正後の平均Lが、最暗クラスタの明度上限設定部1593に設定された上限値Lc_th以上である。
If the following end condition 1 or end condition 2 is satisfied, the dark portion correction amount determination unit 1589 outputs the correction amount Δ1b at that time and ends. If neither end condition is satisfied, the correction amount generation unit 1592 generates a changed correction amount and repeats the process until the end condition is satisfied.
[End Condition 1] The color difference ratios before and after the correction of cluster A and cluster B are equal to or greater than the target value Xd set in the color difference ratio target value setting unit 1583.
[End Condition 2] The average L after correction of the cluster C is equal to or greater than the upper limit value Lc_th set in the lightness upper limit setting unit 1593 of the darkest cluster.

画素数が最も大きいクラスタと次に大きいクラスタの色差が補正前のX倍になるように補正するということは、他の面積の狭いクラスタ同士の色差比に着目して補正するよりも視認性が向上したことが観察者に認識されやすく、非常に効果的である。また、最も暗いクラスタが明るく補正されすぎないように補正量を制限することは、暗部ノイズが目立つ副作用を防止するのに有効である。   The correction so that the color difference between the cluster having the largest number of pixels and the next largest cluster is X times before correction is more visible than the correction by paying attention to the color difference ratio between other clusters having a small area. The improvement is easily recognized by the observer and is very effective. Further, limiting the correction amount so that the darkest cluster is not corrected too brightly is effective in preventing a side effect in which dark part noise is conspicuous.

図11は、最暗クラスタの補正量制限を説明する図である。(a)は暗部を示し、(b)は暗部を拡大した図である。YcとYc_thは、最暗クラスタの補正量制限をわかりやすく表現したものであり、YcがクラスタCの補正後の輝度を表しており、Yc_thは上限値を輝度で表している。   FIG. 11 is a diagram for explaining the correction amount limitation of the darkest cluster. (A) shows a dark part, (b) is the figure which expanded the dark part. Yc and Yc_th express the correction amount limitation of the darkest cluster in an easy-to-understand manner, Yc represents the luminance after correction of the cluster C, and Yc_th represents the upper limit value by luminance.

図10の補正量生成部1592は、Δ1b=0を初期値として、補正量生成の要求がある度に、Δ1bに+1したものを次の補正量として発生させる。仮補正トーンカーブ生成部1591では、RGB_aを輝度変換部1590で輝度変換して求めた輝度Yaを制御点として、図11のような補正トーンカーブを作成する。制御点YaはクラスタA(面積が大きい2つのクラスタのうち明るい方)の輝度に該当する。制御点Yaにおける出力がYa+Δ1bになるように補正トーンカーブを作成し、暗部領域以外は第一の補正量生成部15で使用されず、どのように設定してもよいので、図11のように、Ya≦入力Y<255は直線で結んでおけば良い。   The correction amount generation unit 1592 in FIG. 10 sets Δ1b = 0 as an initial value, and generates a value obtained by adding 1 to Δ1b as the next correction amount every time a correction amount generation is requested. The temporary correction tone curve generation unit 1591 creates a correction tone curve as shown in FIG. 11 using the luminance Ya obtained by converting the luminance of RGB_a by the luminance conversion unit 1590 as a control point. The control point Ya corresponds to the luminance of cluster A (the brighter of the two clusters having a large area). A correction tone curve is created so that the output at the control point Ya becomes Ya + Δ1b, and the areas other than the dark area are not used by the first correction amount generation unit 15 and may be set in any way, as shown in FIG. , Ya ≦ input Y <255 may be connected by a straight line.

色差比目標値設定部1583では、暗部面積率Pdに応じて色差比の目標値Xd=3.5×Pdを算出する。算出式は数十枚のサンプル画像を用意してどのくらいに設定すれば、ほぼ全ての画像(少なくとも用意したサンプルの8割)で適正な明るさに補正されるかを主観評価結果から導出したものである。被写体における暗部領域の占める割合が大きいほど暗部の視認性向上を重視した方が高評価を得る傾向があり、暗部領域の占める割合が小さいほど暗部以外の被写体画質を重視した方が高評価が得られ、暗部の視認性向上に対する要求レベルが下がる傾向があった。   The color difference ratio target value setting unit 1583 calculates a color difference ratio target value Xd = 3.5 × Pd according to the dark area ratio Pd. The calculation formula is derived from the subjective evaluation result that prepares dozens of sample images and how much is set to correct the brightness to almost all images (at least 80% of the prepared samples). It is. The higher the proportion of the dark area in the subject, the higher the tendency to obtain higher evaluation when the dark area visibility is emphasized, and the lower the proportion of the dark area, the higher the evaluation is given to the subject image quality other than the dark portion. Therefore, there is a tendency that the required level for improving the visibility of dark parts is lowered.

最暗クラスタの明度上限設定部1593では、Lc_thが15くらいの値(10〜18の間)に設定されるのが適当である。これは予め決めておいた固定値でよい。   In the darkest cluster lightness upper limit setting unit 1593, it is appropriate that Lc_th is set to a value of about 15 (between 10 and 18). This may be a predetermined fixed value.

図12は、第二の補正量生成部16の構成を示す。第二の補正量生成部では、補正トーンカーブのハイライト領域における傾きα4’を補正量として求め、出力する。   FIG. 12 shows the configuration of the second correction amount generator 16. The second correction amount generation unit obtains and outputs the inclination α4 ′ in the highlight area of the correction tone curve as the correction amount.

輝度変換部1604は、サンプリング画像のRGB値を輝度値に変換し、ハイライト対象領域判定部1605は、輝度値Yがth1≦Y<255であればハイライト対象領域の画素であると判定する。ここではY=255の白画素をハイライト領域から除外した領域を対象領域とする。   The luminance conversion unit 1604 converts the RGB value of the sampling image into a luminance value, and the highlight target region determination unit 1605 determines that the pixel is in the highlight target region if the luminance value Y is th1 ≦ Y <255. . Here, an area obtained by excluding the white pixel of Y = 255 from the highlight area is set as a target area.

傾きα4’下限設定部1600は、ハイライト面積率Phに応じてα4’の下限値Z=1/(−1.4×Ph+2.4)を算出し、補正量生成部1601は、補正量の初期値としてZを出力する。この算出式も主観評価結果から導出したものであり、画像内におけるハイライト対象領域の占める割合が大きいほどハイライトの階調つぶれ(白に飛んでしまうことも含む)が評価を下げる要因となる傾向があり、ハイライト対象領域の占める割合が小さいほどハイライトの階調つぶれよりも被写体画質が優先される傾向があった。補正量生成部1601では、以降要求がある度にα4’に+0.03したものを次の補正量として発生させる。   The slope α4 ′ lower limit setting unit 1600 calculates the lower limit value Z = 1 / (− 1.4 × Ph + 2.4) of α4 ′ according to the highlight area ratio Ph, and the correction amount generation unit 1601 calculates the correction amount. Z is output as an initial value. This calculation formula is also derived from the subjective evaluation results. As the ratio of the highlight target area in the image increases, the gradation of the highlight (including the fact that it jumps to white) becomes a factor that lowers the evaluation. There is a tendency, and as the proportion of the highlight target area is smaller, the subject image quality tends to be prioritized over the highlight gradation loss. The correction amount generation unit 1601 generates a value obtained by adding +0.03 to α4 ′ as the next correction amount every time there is a subsequent request.

仮補正トーンカーブ生成部1602では、th1を制御点として、図13のような補正トーンカーブを作成する。ハイライト領域であるth1≦入力Y≦255で、傾きがα4’になるように補正トーンカーブを作成し、ハイライト領域以外は第二の補正量生成部16で使用されず、どのように設定してもよいので、図13のように0≦入力Y<th1を直線で結んでおけば良い。   The temporary correction tone curve generation unit 1602 creates a correction tone curve as shown in FIG. 13 using th1 as a control point. A correction tone curve is created so that the slope is α4 ′ when th1 ≦ input Y ≦ 255, which is the highlight region, and the setting other than the highlight region is not used by the second correction amount generation unit 16 and how it is set. Therefore, it is sufficient to connect 0 ≦ input Y <th1 with a straight line as shown in FIG.

階調補正部1603は、作成した仮補正トーンカーブに基づき階調補正を行い、飽和画素判定部1606は、上記した対象領域であり、かつ、階調補正によって飽和したと判断された場合に、飽和画素であると判定する。階調補正によって飽和したかどうかは補正前後のRGB値を参照して判断する。RGB3信号のうち補正後の値が(255−x1)以上に飽和した信号数が、補正前に255に飽和している信号数よりも多ければ、階調補正によって飽和した画素であると判断する。x1は飽和の判断を人の目視での判断に近づけるため、完全に255に飽和していないが飽和に近い画素も含めて飽和したと判定するためのパラメータであり、x1=20くらいの値に設定しておくのが適当である。   The gradation correction unit 1603 performs gradation correction based on the created temporary correction tone curve, and the saturated pixel determination unit 1606 is the above-described target region and is determined to be saturated by the gradation correction, It is determined that the pixel is a saturated pixel. Whether or not the image is saturated by the gradation correction is determined with reference to the RGB values before and after the correction. If the number of signals in which the corrected value is saturated to (255−x1) or more among the RGB3 signals is larger than the number of signals saturated in 255 before correction, it is determined that the pixel is saturated by gradation correction. . x1 is a parameter for determining that saturation is included in pixels that are not completely saturated to 255 but close to saturation in order to make the determination of saturation close to human visual judgment, and the value is about x1 = 20 It is appropriate to set it.

飽和画素数計数部1607は、飽和したと判断された画素数Ndを計数し、対象画素数計数部1608は、対象領域の画素数Neを計数する。飽和度算出部1609では、飽和度Pwとして対象領域に対する飽和画素の割合を次式で求める。
Pw=Nd/Ne
ハイライト補正量判定部1610では、飽和度が飽和度上限設定部1611に設定された上限値Xh以下になることを終了条件とし、終了条件を満たした時点でのα4’を補正量として出力して終了する。終了条件を満たさないうちは、補正量生成部1601は変更した補正量を発生させ、終了条件を満足するまで処理を繰り返す。
The saturated pixel number counting unit 1607 counts the number of pixels Nd determined to be saturated, and the target pixel number counting unit 1608 counts the pixel number Ne of the target region. The saturation calculation unit 1609 obtains the ratio of saturated pixels with respect to the target region as the saturation Pw by the following equation.
Pw = Nd / Ne
The highlight correction amount determination unit 1610 outputs a saturation amount that is equal to or lower than the upper limit value Xh set in the saturation upper limit setting unit 1611 as an end condition, and outputs α4 ′ when the end condition is satisfied as a correction amount. To finish. As long as the end condition is not satisfied, the correction amount generation unit 1601 generates the changed correction amount and repeats the process until the end condition is satisfied.

飽和度上限設定部1611では、Xhが0.15くらいの値(0.1〜0.2の間)に設定されるようにしておくのが適当である。予め決めておいた固定値でよい。   In the saturation upper limit setting unit 1611, it is appropriate that Xh is set to a value of about 0.15 (between 0.1 and 0.2). A predetermined fixed value may be used.

図1の被写体代表色抽出部14では、被写体領域における代表色を抽出する。その構成例を2つ示す。
・被写体代表色抽出部14の第1の構成例
図14(a)は、被写体代表色抽出部14の第1の構成例を示す。暗部/被写体領域判定部141は、サンプリング画像データの各画素値を輝度変換部140により求めた輝度値と閾値th1,th2を比較して、画像内の暗部領域および暗部領域以外の被写体領域を判定し、色変換部142によりLabに変換した画像データおよび領域判定部141の領域判定結果から、暗部領域クラスタリング部143は、暗部領域をクラスタリングし、暗部以外の被写体領域クラスタリング部144は、暗部以外の被写体領域をクラスタリングする。
The subject representative color extraction unit 14 in FIG. 1 extracts a representative color in the subject region. Two configuration examples are shown.
First Configuration Example of Subject Representative Color Extraction Unit FIG. 14A shows a first configuration example of the subject representative color extraction unit 14. The dark part / subject area determination unit 141 compares the luminance value obtained by the luminance conversion unit 140 with each pixel value of the sampled image data and the thresholds th1 and th2, and determines a subject area other than the dark part region and the dark part region in the image. Then, based on the image data converted into Lab by the color conversion unit 142 and the region determination result of the region determination unit 141, the dark region clustering unit 143 clusters the dark region, and the subject region clustering unit 144 other than the dark region does not include the dark region. Cluster the subject area.

暗部領域のクラスタリング143は、図5の第一の補正量生成部15におけるクラスタリング部153と同様であり、改めてクラスタリングしないでクラスタリング部153の結果を参照しても良い。暗部以外の被写体領域のクラスタリング部144は、そのクラスタリング方式は暗部の場合と同じものを用いて行うが、同じクラスタに属するか否かを判定する閾値であるdE_thを暗部の時よりも大きい値に設定してクラスタリングする。先に、暗部領域を対象としたクラスタリングではdE_th=3くらいの小さい値に設定するのが適当と述べたが、それに対して暗部領域以外の被写体領域を対象としたクラスタリングではdE_th=8くらいに設定するのが適当である。代表クラスタ抽出部145では、暗部領域および暗部領域以外の被写体領域、つまり被写体領域全体において、画素数が最も多いクラスタを一つ抽出し、そのクラスタの平均Labを被写体の代表色Lab_dとして出力する。
・被写体代表色抽出部14の第2の構成例
簡易的には、被写体領域における輝度の中央値をヒストグラムから求めて、中央値を元に代表色を抽出する方法もある。図14(b)は、被写体代表色抽出部14の第2の構成例を示す。被写体中央値抽出部146は、ヒストグラムから図15に示す被写体領域における中央値Ymを求める。Y=0から画素数を順に加算し、被写体領域の画素数の1/2以上になった時点での輝度値がYmである。次に、Ymに対応するLab値を求める。サンプリング画像データの中から輝度値がYmに等しいものを中央値判定部148が抽出し、RGB毎の加算演算部149では、輝度値がYmの画素の画素値をRGB毎に加算し、画像全体のRGB毎の加算が終了したら、RGB平均値算出部1400はRGB毎の加算値を中央値Ymの画素数で割って輝度値がYmの画素のRGB平均値を算出し、色変換部1401ではLabに変換したものを被写体の代表色Lab_dとして出力する。
The clustering 143 of the dark area is the same as the clustering unit 153 in the first correction amount generation unit 15 in FIG. 5, and the result of the clustering unit 153 may be referred to without performing clustering again. The clustering unit 144 for the subject area other than the dark part uses the same clustering method as that for the dark part, but sets dE_th, which is a threshold for determining whether or not it belongs to the same cluster, to a value larger than that for the dark part. Set and cluster. Previously, it was stated that it is appropriate to set a value as small as dE_th = 3 in clustering for dark areas, but in contrast, dE_th = 8 is set in clustering for object areas other than dark areas. It is appropriate to do. The representative cluster extraction unit 145 extracts one cluster having the largest number of pixels in the dark region and the subject region other than the dark region, that is, the entire subject region, and outputs the average Lab of the cluster as the representative color Lab_d of the subject.
Second Example Configuration of Subject Representative Color Extraction Unit In a simple method, there is a method in which a median luminance value in a subject area is obtained from a histogram and a representative color is extracted based on the median value. FIG. 14B shows a second configuration example of the subject representative color extraction unit 14. The subject median value extraction unit 146 obtains the median value Ym in the subject region shown in FIG. 15 from the histogram. The number of pixels is added in order from Y = 0, and the luminance value at the time when the number of pixels in the subject area becomes ½ or more is Ym. Next, the Lab value corresponding to Ym is obtained. The median value determination unit 148 extracts the sampled image data whose luminance value is equal to Ym, and the addition calculation unit 149 for each RGB adds the pixel values of the pixels having the luminance value Ym for each RGB, thereby obtaining the entire image. When the addition for each RGB is completed, the RGB average value calculation unit 1400 divides the addition value for each RGB by the number of pixels of the median Ym to calculate the RGB average value of the pixels having the luminance value Ym, and the color conversion unit 1401 The image converted into Lab is output as the representative color Lab_d of the subject.

図16(a)は、第三の補正量生成部17の構成を示す。第三の補正量生成部17では、図16(b)に示すように、被写体の代表色Lab_dに対応する輝度Ydにおける補正後の値をYd+βとして増加分βを補正量として求め、出力する。   FIG. 16A shows the configuration of the third correction amount generation unit 17. As shown in FIG. 16B, the third correction amount generation unit 17 calculates and outputs an increase β as a correction amount with the corrected value in the luminance Yd corresponding to the representative color Lab_d of the subject as Yd + β.

色変換部170は、代表色Lab_dをRGBに変換し、階調補正部173では、補正量生成部172で生成される補正量βに応じてRGB値を階調補正し、色変換部174は補正後の値をLabに変換する。色差計算部175では、代表色の補正前後の色差を計算する。   The color conversion unit 170 converts the representative color Lab_d into RGB, the gradation correction unit 173 performs gradation correction of the RGB value according to the correction amount β generated by the correction amount generation unit 172, and the color conversion unit 174 The corrected value is converted to Lab. The color difference calculation unit 175 calculates the color difference before and after correcting the representative color.

被写体代表色補正量判定部176では、代表色の補正前後の色差が代表色補正量上限設定部177に設定された上限値Xm以上になることを終了条件とし、終了条件を満たした時点でのβを補正量としてYdとセットで出力して終了する。終了条件を満たさないうちは、補正量生成部172は変更した補正量を発生させ、終了条件を満足するまで処理を繰り返す。   In the subject representative color correction amount determination unit 176, the end condition is that the color difference before and after the correction of the representative color is equal to or greater than the upper limit value Xm set in the representative color correction amount upper limit setting unit 177, and when the end condition is satisfied Output β as a correction amount together with Yd, and the process ends. As long as the end condition is not satisfied, the correction amount generation unit 172 generates the changed correction amount and repeats the process until the end condition is satisfied.

補正量生成部172は、β=0を初期値として、補正量生成の要求がある度に、βに+1したものを次の補正量として発生させる。   The correction amount generation unit 172 sets β = 0 as an initial value, and generates a value obtained by adding 1 to β as the next correction amount every time a correction amount generation is requested.

代表色補正量上限設定部177では、予め決めておいた固定値を用いる場合、Xmが15くらいの値に設定するが、この値は、画像の過補正を防止して、印象を大きく変えない上限値設定として適当である。   In the representative color correction amount upper limit setting unit 177, when a predetermined fixed value is used, Xm is set to a value of about 15 but this value prevents overcorrection of the image and does not greatly change the impression. Appropriate as an upper limit setting.

図17は、補正量決定部18の構成を示す。第一の補正量生成部15で生成された補正量Δ1と、第二の補正量生成部16で生成されたハイライトの傾きを表すα4’から算出された補正量Δ2と、第三の補正量生成部17で生成された被写体代表色の輝度と補正量を表すYdとβから算出された補正量Δ3を参照して、最小値選択部182では、最小のものを選択して出力する(Δ=min(Δ1,Δ2,Δ3))。   FIG. 17 shows the configuration of the correction amount determination unit 18. A correction amount Δ1 generated by the first correction amount generation unit 15, a correction amount Δ2 calculated from α4 ′ representing the slope of the highlight generated by the second correction amount generation unit 16, and a third correction With reference to the correction amount Δ3 calculated from the luminance of the subject representative color generated by the amount generation unit 17 and Yd and β indicating the correction amount, the minimum value selection unit 182 selects and outputs the minimum one ( Δ = min (Δ1, Δ2, Δ3)).

補正量Δ2およびΔ3は、図3に示した関係を使って、ハイライトの傾きα4=α4’に対応する制御点Yaにおける補正量Δ=Δ2を算出することが可能であるし、(Yd,Yd+β)を通る補正トーンカーブにおける補正量Δ=Δ3を算出することも可能である。これを補正量Δ2算出部180および補正量Δ3算出部181が行う。   As the correction amounts Δ2 and Δ3, it is possible to calculate the correction amount Δ = Δ2 at the control point Ya corresponding to the highlight inclination α4 = α4 ′ using the relationship shown in FIG. It is also possible to calculate the correction amount Δ = Δ3 in the correction tone curve passing through Yd + β). This is performed by the correction amount Δ2 calculation unit 180 and the correction amount Δ3 calculation unit 181.

以上、本実施例によれば、画像の暗部領域の視認性向上とノイズ防止、および、ハイライト領域における階調つぶれ抑制に加えて、被写体代表値の補正量上限を設定し、補正量上限を超えない範囲内で補正量を決定して補正量に応じた階調補正を行うため、過補正を防止して元画像の印象を大きく変えすぎない範囲内で適切な明るさに階調補正することができる。   As described above, according to the present embodiment, in addition to improving the visibility of the dark area of the image, preventing noise, and suppressing the gradation collapse in the highlight area, the correction amount upper limit of the subject representative value is set, and the correction amount upper limit is set. Since the correction amount is determined within the range that does not exceed and the tone correction is performed according to the correction amount, overcorrection is prevented and tone correction is made to an appropriate brightness within a range that does not change the impression of the original image too much. be able to.

実施例2
図18は、本発明の実施例2の構成を示す。撮影モードの一つとして、風景撮影に適した風景撮影モードを持っているデジタルカメラや、風景画像に適した画像補正を行うための風景優先処理モードをユーザーが選択できる画像処理装置がある。
Example 2
FIG. 18 shows a configuration of the second embodiment of the present invention. As one of the shooting modes, there is a digital camera having a landscape shooting mode suitable for landscape shooting, and an image processing apparatus in which a user can select a landscape priority processing mode for performing image correction suitable for a landscape image.

本実施例では、書誌情報等も参照して、撮影モードや画像処理モードの情報を取得し、風景シーンであることが想定される画像に対して、ハイライト色抽出部40は、ハイライト領域の色が属する色分布を判定し、色分布から分類した色分類に応じて被写体代表色の補正量上限設定値を切り替える。これにより、空の色相や明るさに応じて印象を変えたくないシーン(例えば夕焼け空をメインで撮影した画像)に対しては補正量を効果的に抑制し、より一層ユーザーが過補正と感じない範囲内で適切な補正を行う。   In the present embodiment, the highlight color extraction unit 40 obtains information on the shooting mode and the image processing mode with reference to the bibliographic information and the like, and the highlight color extraction unit 40 selects the highlight region for an image that is assumed to be a landscape scene. The color distribution to which the target color belongs is determined, and the correction amount upper limit setting value of the subject representative color is switched according to the color classification classified from the color distribution. This effectively reduces the amount of correction for scenes where you do not want to change the impression according to the hue or brightness of the sky (for example, an image of the sunset sky as the main image). Make appropriate corrections within the specified range.

実施例2では、実施例1にハイライト色抽出部40を追加して構成している。また、第三の補正量生成部17’の処理が実施例1とは異なる。   In the second embodiment, the highlight color extracting unit 40 is added to the first embodiment. Further, the processing of the third correction amount generation unit 17 ′ is different from that of the first embodiment.

図19は、ハイライト色抽出部40の構成を示す。無彩画素判定部401では、入力された画素値が無彩画素であるか否かを判定する。|Max(R,G,B)−Min(R,G,B)|<15であれば無彩画素と判定し、それ以外ならば無彩画素でない(すなわち有彩度画素である)と判定する。   FIG. 19 shows a configuration of the highlight color extraction unit 40. The achromatic pixel determination unit 401 determines whether or not the input pixel value is an achromatic pixel. | Max (R, G, B) −Min (R, G, B) | <15, it is determined as an achromatic pixel; otherwise, it is determined as not an achromatic pixel (that is, a chromatic pixel). To do.

赤色相画素判定部402では、入力された画素値が赤色相画素であるか否かを判定する。ここでは簡易的に、Max(R,G,B)=Rであれば赤色相画素と判定し、それ以外ならば赤色相画素でないと判定する。   The red phase pixel determination unit 402 determines whether or not the input pixel value is a red phase pixel. Here, simply, if Max (R, G, B) = R, the pixel is determined to be a red phase pixel, and otherwise, it is determined not to be a red phase pixel.

入力されたRGBの画素値を輝度変換部403で輝度Yに変換し、輝度判定部404では、輝度の大きさを判定する。無彩色画素に対する輝度の大小を判定するための閾値Ywt_thを使用して、Y≧Ywt_thであれば明るい無彩画素候補であると判定し、Y<Ywt_thであれば暗い無彩画素候補であると判定する。更に青色相画素に対する輝度の大小を判定するための閾値Ybl_thを使用して、Y≧Ybl_thであれば明るい青色相画素候補であると判定し、Y<Ybl_thであれば暗い青色相画素候補であると判定する。閾値Ywt_thとYbl_thは、Ywt_th>Ybl_thとなるようにYwt_th=220、Ybl_th=160くらいの値に設定しておくのが適当である。   The input RGB pixel value is converted into luminance Y by the luminance conversion unit 403, and the luminance determination unit 404 determines the magnitude of the luminance. Using a threshold value Ywt_th for determining the magnitude of luminance with respect to an achromatic color pixel, if Y ≧ Ywt_th, it is determined that the pixel is a bright achromatic pixel candidate, and if Y <Ywt_th, it is a dark achromatic pixel candidate. judge. Further, by using a threshold value Ybl_th for determining the luminance level of the blue phase pixel, if Y ≧ Ybl_th, it is determined that it is a bright blue phase pixel candidate, and if Y <Ybl_th, it is a dark blue phase pixel candidate. Is determined. The threshold values Ywt_th and Ybl_th are appropriately set to values of Ywt_th = 220 and Ybl_th = 160 so that Ywt_th> Ybl_th.

ハイライト領域判定部400では、画像の輝度値が閾値th1以上であればハイライト領域の画素であると判定し、画素の属する色領域判定部405では、ハイライト領域の画素であると判定された画素に対してどの色領域に属するかを判定する。
すなわち、
・無彩画素で、かつ、明るい無彩画素候補であれば、明るい無彩色領域に属する画素であると判定する。
・無彩画素で、かつ、暗い無彩画素候補であれば、暗い無彩色領域に属する画素であると判定する。
・無彩画素ではなく、かつ、赤色相画素であれば、赤色領域に属する画素であると判定する。
・無彩画素ではなく、かつ、赤色相画素でもなく、かつ、明るい青色相画素候補であれば、明るい青色領域に属する画素であると判定する。
・無彩画素ではなく、かつ、赤色相画素でもなく、かつ、暗い青色相画素候補であれば、暗い青色領域に属する画素であると判定する。
本実施例では、無彩画素ではなく、かつ、赤色相画素でもない画素は、青色相の画素であるとみなして判定している。
The highlight area determination unit 400 determines that the pixel is in the highlight area if the luminance value of the image is equal to or greater than the threshold th1, and the color area determination unit 405 to which the pixel belongs determines that the pixel is in the highlight area. It is determined which color region the selected pixel belongs to.
That is,
If it is an achromatic pixel and a bright achromatic pixel candidate, it is determined that the pixel belongs to a bright achromatic region.
If it is an achromatic pixel and a dark achromatic pixel candidate, it is determined that the pixel belongs to a dark achromatic region.
If it is not an achromatic pixel and a red phase pixel, it is determined that the pixel belongs to the red region.
If the pixel is not an achromatic pixel, is not a red phase pixel, and is a bright blue phase pixel candidate, it is determined that the pixel belongs to a bright blue region.
If the pixel is not an achromatic pixel, is not a red phase pixel, and is a dark blue phase pixel candidate, it is determined that the pixel belongs to a dark blue region.
In this embodiment, pixels that are not achromatic pixels and are not red phase pixels are determined to be blue phase pixels.

色領域毎の画素数計数部406では、上記5つの色領域毎に属する画素の数を計数する。ハイライト色分布判定部407では、ハイライト領域に対して各色領域の画素が占める面積率が何パーセントであるかを算出し、色分布を判定する。
すなわち、
・赤色領域に属する画素が20%以上あるならば、ハイライトに赤色が多く分布する画像であると判定する。
・上記色分布に該当せず、かつ、暗い無彩色領域に属する画素が20%以上あるならば、ハイライトに暗い無彩色が多く分布する画像であると判定する。
・上記色分布に該当せず、かつ、明るい無彩色領域に属する画素が70%以上あるならば、ハイライトに明るい無彩色が多く分布する画像であると判定する。
・上記色分布に該当せず、かつ、暗い青色領域に属する画素が50%以上存在するならば、ハイライトに暗い青色が多く分布する画像であると判定する。
・上記色分布に該当せず、かつ、明るい青色領域に属する画素が50%以上存在するならば、ハイライトに明るい青色が多く分布する画像であると判定する。
・上記いずれの色分布にも該当しない場合は、色分布が不明であると判定する。
A pixel number counting unit 406 for each color area counts the number of pixels belonging to each of the five color areas. The highlight color distribution determination unit 407 calculates the percentage of the area ratio occupied by the pixels of each color region with respect to the highlight region, and determines the color distribution.
That is,
If the number of pixels belonging to the red region is 20% or more, it is determined that the image has a large distribution of red in highlights.
If the pixel does not correspond to the above color distribution and there are 20% or more of pixels belonging to the dark achromatic region, it is determined that the image has many dark achromatic colors distributed in the highlight.
If there is 70% or more of pixels that do not correspond to the color distribution and belong to the bright achromatic region, it is determined that the image has many bright achromatic colors distributed in the highlight.
If the pixel does not correspond to the color distribution and there are 50% or more of pixels belonging to the dark blue region, it is determined that the image has a lot of dark blue in the highlight.
If there is 50% or more of pixels that do not correspond to the color distribution and belong to the bright blue region, it is determined that the image has a lot of bright blue in the highlight.
If it does not correspond to any of the above color distributions, it is determined that the color distribution is unknown.

なお、色分布判定で使用する面積率に対する各閾値は、上記では具体的な数値で示したが、これは一例であり、より人の感覚にあった色分布判定を行うためには画像を観察しながら閾値を調整した方が良い。   Each threshold value for the area ratio used in the color distribution determination is shown as a specific numerical value in the above. However, this is an example, and an image is observed in order to perform a color distribution determination more suited to human senses. However, it is better to adjust the threshold value.

ハイライト色分類部408では、色分布を想定される5つの空の色に対応させて、色分類を決める。
すなわち、
・赤色が多く分布する画像であると判定された画像は、夕焼け、朝焼け空に分類する。
・暗い無彩色が多く分布する画像であると判定された画像は、暗い曇り空に分類する。
・明るい無彩色が多く分布する画像であると判定された画像は、明るい曇り空に分類する。
・暗い青色が多く分布する画像であると判定された画像は、暗い青空に分類する。
・明るい青色が多く分布する画像であると判定された画像は、明るい青空に分類する。
・色分布が不明であると判定された画像は、その他に分類する。
The highlight color classification unit 408 determines the color classification corresponding to the five sky colors assumed to have a color distribution.
That is,
・ Images that are determined to have a large distribution of red are classified as sunset or sunrise sky.
An image determined to be an image in which many dark achromatic colors are distributed is classified as a dark cloudy sky.
An image determined to be an image in which many bright achromatic colors are distributed is classified as a bright cloudy sky.
An image determined to be an image in which many dark blue colors are distributed is classified as a dark blue sky.
An image that is determined to be an image in which a lot of bright blue is distributed is classified as a bright blue sky.
・ Images determined to have unknown color distribution are classified as other.

明るい曇り空と暗い曇り空を別々に分類しているのは、穏やかな白い空と雷雲のような暗い空とでは元の画像の印象が異なり、暗い曇り空の方が過補正で印象を壊してしまう危険性がより高いことを考慮したためである。明るい青空と暗い青空を別々に分類しているのは、暗い青空として朝方や夕方の日が昇りきっていない状態の空を想定しており、明るい青空よりも暗い青空の方が画像の印象を保持したい要求が高いことを考慮したためである。   The bright cloudy sky and the dark cloudy sky are classified separately because the impression of the original image differs between a gentle white sky and a dark sky like a thundercloud, and the danger of the dark cloudy sky destroying the impression with overcorrection This is because it is considered to be higher. The bright blue sky and the dark blue sky are classified separately, assuming that the morning and evening sky is not rising as a dark blue sky, and the dark blue sky gives a better impression of the image than the bright blue sky. This is because the demands to be held are considered high.

図20(a)は、実施例2における第三の補正量生成部17’の構成を示す。実施例1(図16(a))の第三の補正量生成部17と相違する点は、代表色補正量上限設定部178の処理内容である。代表色補正量上限設定部178では、シーン情報とハイライト色分類に応じた補正量上限を設定し、補正量上限に応じた被写体代表色補正量βを決定して出力する。補正量上限の設定は、シーン情報から風景を撮影した画像であるとみなされる場合に、ハイライト色分類に応じて図20(b)のように補正量上限Xmを設定する。
すなわち、
・明るい青空の補正量上限L1と明るい曇り空の補正量上限L2が、L2<L1の関係になるようにする。
・明るい青空の補正量上限L1と暗い青空の補正量上限S1が、S1<L1の関係になるようにする。
・明るい曇り空の補正量上限L2と暗い曇り空の補正量上限S2が、S2<L2の関係になるようにする。
・夕焼け、朝焼け空の補正量上限S3が、(実際は暗い青空や暗い曇り空の補正量上限と同レベル、あるいは、それよりも小さい値でも良いくらいであるが)少なくとも明るい青空の補正量上限L1に対してS3<L1の関係になるようにする。
・色分類がその他の場合は、デフォルト値として中間的な補正量上限を設定する。中間的な補正量上限とは、大まかに言えば、L1やL2より小さく、S1やS2より大きいくらいの値を指す。
FIG. 20A shows the configuration of the third correction amount generator 17 ′ in the second embodiment. The difference from the third correction amount generation unit 17 of the first embodiment (FIG. 16A) is the processing content of the representative color correction amount upper limit setting unit 178. The representative color correction amount upper limit setting unit 178 sets a correction amount upper limit according to the scene information and the highlight color classification, and determines and outputs a subject representative color correction amount β according to the correction amount upper limit. The correction amount upper limit is set as shown in FIG. 20B in accordance with the highlight color classification when the scene information is regarded as an image of a landscape.
That is,
The bright blue sky correction amount upper limit L1 and the bright cloudy sky correction amount upper limit L2 are set to satisfy the relationship of L2 <L1.
The correction amount upper limit L1 for the bright blue sky and the correction amount upper limit S1 for the dark blue sky are in a relationship of S1 <L1.
The correction amount upper limit L2 for the bright cloudy sky and the correction amount upper limit S2 for the dark cloudy sky have a relationship of S2 <L2.
The correction amount upper limit S3 for sunset and sunrise sky is at least the same as the correction amount upper limit for dark blue sky or dark cloudy sky, or a value smaller than that, but at least the correction amount upper limit L1 for bright blue sky On the other hand, a relationship of S3 <L1 is established.
・ If the color classification is other than that, an intermediate correction amount upper limit is set as the default value. The intermediate correction amount upper limit roughly indicates a value smaller than L1 and L2 and larger than S1 and S2.

以上、本実施例によれば、ハイライト領域における色分布を色相や輝度に関して判定し、色分布(に対応した色分類)に応じて輝度補正における補正量上限を変更するため、空の色や明るさに応じて特に印象を変えたくないシーンの画像で効果的に補正量を抑制することができる。   As described above, according to the present embodiment, the color distribution in the highlight region is determined with respect to hue and luminance, and the correction amount upper limit in luminance correction is changed according to the color distribution (corresponding to the color classification). It is possible to effectively suppress the correction amount in an image of a scene where it is not particularly desired to change the impression according to the brightness.

また、本発明は、前述した実施例の機能を実現するソフトウェアのプログラムコードを記録した記憶媒体を、システムあるいは装置に供給し、そのシステムあるいは装置のコンピュータ(CPUやMPU)が記憶媒体に格納されたプログラムコードを読出し実行することによっても達成される。この場合、記憶媒体から読出されたプログラムコード自体が前述した各実施例の機能を実現することになる。プログラムコードを供給するための記憶媒体としては、例えば、ハードディスク、光ディスク、光磁気ディスク、不揮発性のメモリカード、ROMなどを用いることができる。また、コンピュータが読出したプログラムコードを実行することにより、前述した実施例の機能が実現されるだけでなく、そのプログラムコードの指示に基づき、コンピュータ上で稼働しているOS(オペレーティングシステム)などが実際の処理の一部または全部を行い、その処理によって前述した各実施例の機能が実現される場合も含まれる。さらに、記憶媒体から読出されたプログラムコードが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書込まれた後、そのプログラムコードの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPUなどが実際の処理の一部または全部を行い、その処理によって前述した各実施例の機能が実現される場合も含まれる。また、本発明の実施例の機能等を実現するためのプログラムは、ネットワークを介した通信によってサーバから提供されるものでも良い。   In addition, the present invention supplies a storage medium storing software program codes for realizing the functions of the above-described embodiments to a system or apparatus, and the computer (CPU or MPU) of the system or apparatus is stored in the storage medium. It is also achieved by reading and executing the program code. In this case, the program code itself read from the storage medium realizes the functions of the above-described embodiments. As a storage medium for supplying the program code, for example, a hard disk, an optical disk, a magneto-optical disk, a nonvolatile memory card, a ROM, or the like can be used. Further, by executing the program code read by the computer, not only the functions of the above-described embodiments are realized, but also an OS (operating system) operating on the computer based on an instruction of the program code. A case where part or all of the actual processing is performed and the functions of the above-described embodiments are realized by the processing is also included. Further, after the program code read from the storage medium is written in a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer, the function expansion is performed based on the instruction of the program code. This includes the case where the CPU or the like provided in the board or function expansion unit performs part or all of the actual processing, and the functions of the above-described embodiments are realized by the processing. Further, the program for realizing the functions and the like of the embodiments of the present invention may be provided from a server by communication via a network.

本発明の実施例1の構成を示す。The structure of Example 1 of this invention is shown. 領域抽出部の構成を示す。The structure of an area | region extraction part is shown. 本発明の補正トーンカーブの形状を示す。The shape of the correction tone curve of the present invention is shown. 領域面積率計算部の構成を示す。The structure of an area area ratio calculation part is shown. 第一の補正量生成部の構成を示す。The structure of the 1st correction amount production | generation part is shown. クラスタリング部の構成を示す。The structure of a clustering part is shown. 予備クラスタリング部の処理フローチャートである。It is a process flowchart of a preliminary | backup clustering part. クラスタ統合部の処理フローチャートである。It is a process flowchart of a cluster integration part. 第一の補正量決定部の構成を示す。The structure of the 1st correction amount determination part is shown. 補正量算出部の構成を示す。The structure of a correction amount calculation unit is shown. 最暗クラスタの補正量制限を説明する図である。It is a figure explaining the correction amount restriction | limiting of the darkest cluster. 第二の補正量生成部の構成を示す。The structure of the 2nd correction amount production | generation part is shown. 仮補正トーンカーブ生成部により作成される補正トーンカーブを示す。The correction | amendment tone curve produced by the temporary correction tone curve production | generation part is shown. 被写体代表色抽出部の第1、第2の構成例を示す。The 1st, 2nd structural example of a to-be-photographed object representative color extraction part is shown. 被写体中央値抽出部の処理を説明する図である。It is a figure explaining the process of a to-be-photographed object median value extraction part. 第三の補正量生成部の構成を示す。The structure of the 3rd correction amount production | generation part is shown. 補正量決定部の構成を示す。The structure of the correction amount determination part is shown. 本発明の実施例2の構成を示す。The structure of Example 2 of this invention is shown. ハイライト色抽出部の構成を示す。The structure of a highlight color extraction part is shown. 実施例2における第三の補正量生成部の構成を示す。The structure of the 3rd correction amount production | generation part in Example 2 is shown.

符号の説明Explanation of symbols

10 輝度変換部
11 ヒストグラム作成部
12 領域抽出部
13 領域面積率計算部
14 被写体代表色抽出部
15 第一の補正量生成部
16 第二の補正量生成部
17 第三の補正量生成部
18 補正量決定部
19 補正トーンカーブ生成部
20 階調補正部
30 画像サンプリング部
DESCRIPTION OF SYMBOLS 10 Brightness conversion part 11 Histogram creation part 12 Area extraction part 13 Area area ratio calculation part 14 Subject representative color extraction part 15 First correction amount generation part 16 Second correction amount generation part 17 Third correction amount generation part 18 Correction Quantity determination unit 19 Correction tone curve generation unit 20 Gradation correction unit 30 Image sampling unit

Claims (8)

画像中の被写体領域を判定する被写体領域判定手段と、前記被写体領域における代表色を抽出する代表色抽出手段と、前記代表色における補正量上限を設定する補正量上限設定手段と、前記代表色における階調補正前と階調補正後の色差が、前記補正量上限を超えない範囲内で、階調補正量を決定する補正量決定手段と、前記階調補正量に応じて、前記画像の階調を補正する階調補正手段を備えることを特徴とする画像処理装置。   A subject area determining means for determining a subject area in the image; a representative color extracting means for extracting a representative color in the subject area; a correction amount upper limit setting means for setting a correction amount upper limit for the representative color; and Correction amount determining means for determining a gradation correction amount within a range in which a color difference before and after gradation correction does not exceed the upper limit of the correction amount; and a gradation level of the image according to the gradation correction amount. An image processing apparatus comprising gradation correction means for correcting a tone. 前記画像中のハイライト領域を判定するハイライト領域判定手段と、前記ハイライト領域の色分布を判定する色分布判定手段を有し、前記ハイライト領域の色分布に応じて、前記補正量上限設定手段で設定する補正量上限を変更することを特徴とする請求項1記載の画像処理装置。   A highlight area determination unit that determines a highlight area in the image; and a color distribution determination unit that determines a color distribution of the highlight area, and the upper limit of the correction amount according to the color distribution of the highlight area. The image processing apparatus according to claim 1, wherein the upper limit of the correction amount set by the setting unit is changed. 前記色分布判定手段は、無彩色の分布状態と青色の分布状態の判定を含み、前記ハイライト領域に無彩色が多く分布すると判定された場合は、青色が多く分布する場合と比較して、補正量上限を小さくすることを特徴とする請求項2記載の画像処理装置。   The color distribution determination means includes determination of an achromatic color distribution state and a blue color distribution state, and when it is determined that many achromatic colors are distributed in the highlight region, compared to a case where a large amount of blue is distributed, The image processing apparatus according to claim 2, wherein an upper limit of the correction amount is reduced. 前記色分布判定手段は、更に赤色の分布状態の判定を含み、前記ハイライト領域に赤色が多く分布すると判定された場合は、青色の画素が多く分布する場合と比較して、補正量上限を小さくすることを特徴とする請求項2記載の画像処理装置。   The color distribution determination means further includes determination of a red distribution state. When it is determined that a large amount of red is distributed in the highlight area, the correction amount upper limit is set as compared with a case where a large number of blue pixels are distributed. The image processing apparatus according to claim 2, wherein the image processing apparatus is made smaller. 前記色分布判定手段は、輝度の分布状態の判定を含み、前記ハイライト領域に低輝度が多く分布すると判定された場合は、高輝度が多く分布する場合と比較して、補正量上限を小さくすることを特徴とする請求項2記載の画像処理装置。   The color distribution determination means includes determination of a luminance distribution state, and when it is determined that a large amount of low luminance is distributed in the highlight area, the correction amount upper limit is reduced as compared with a case where a large amount of high luminance is distributed. The image processing apparatus according to claim 2, wherein: 画像中の被写体領域を判定する被写体領域判定工程と、前記被写体領域における代表色を抽出する代表色抽出工程と、前記代表色における補正量上限を設定する補正量上限設定工程と、前記代表色における階調補正前と階調補正後の色差が、前記補正量上限を超えない範囲内で、階調補正量を決定する補正量決定工程と、前記階調補正量に応じて、前記画像の階調を補正する階調補正工程を備えることを特徴とする画像処理方法。   A subject region determination step for determining a subject region in the image; a representative color extraction step for extracting a representative color in the subject region; a correction amount upper limit setting step for setting a correction amount upper limit for the representative color; and A correction amount determining step for determining a gradation correction amount within a range in which a color difference before and after gradation correction does not exceed the upper limit of the correction amount; and a step of the image according to the gradation correction amount. An image processing method comprising a gradation correction step for correcting a tone. 請求項6記載の画像処理方法をコンピュータに実現させるためのプログラム。   A program for causing a computer to realize the image processing method according to claim 6. 請求項6記載の画像処理方法をコンピュータに実現させるためのプログラムを記録したコンピュータ読み取り可能な記録媒体。   A computer-readable recording medium on which a program for causing a computer to implement the image processing method according to claim 6 is recorded.
JP2008227086A 2008-09-04 2008-09-04 Image processing apparatus, image processing method, program, and recording medium Expired - Fee Related JP5004305B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008227086A JP5004305B2 (en) 2008-09-04 2008-09-04 Image processing apparatus, image processing method, program, and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008227086A JP5004305B2 (en) 2008-09-04 2008-09-04 Image processing apparatus, image processing method, program, and recording medium

Publications (2)

Publication Number Publication Date
JP2010062920A true JP2010062920A (en) 2010-03-18
JP5004305B2 JP5004305B2 (en) 2012-08-22

Family

ID=42189220

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008227086A Expired - Fee Related JP5004305B2 (en) 2008-09-04 2008-09-04 Image processing apparatus, image processing method, program, and recording medium

Country Status (1)

Country Link
JP (1) JP5004305B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0544886A (en) * 1991-08-12 1993-02-23 Osaka Gas Co Ltd Pipe repairing tool
JP2016054355A (en) * 2014-09-02 2016-04-14 キヤノン株式会社 Image processing system, control method of the same, and program
JP2016528826A (en) * 2013-07-30 2016-09-15 ドルビー ラボラトリーズ ライセンシング コーポレイション System and method for generating scene invariant metadata
US11488289B2 (en) 2016-03-30 2022-11-01 Interdigital Vc Holdings, Inc. Method for detection of saturated pixels in an image

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002185771A (en) * 2000-12-14 2002-06-28 Noritsu Koki Co Ltd Image forming device, image data processing method and recording medium recording image data processing program
JP2003069822A (en) * 2001-08-29 2003-03-07 Ricoh Co Ltd Image processor, image processing method and recording medium
JP2005086772A (en) * 2003-09-11 2005-03-31 Sharp Corp Image processing method, image processing apparatus, image forming device, image pickup device, and computer program
JP2005086516A (en) * 2003-09-09 2005-03-31 Canon Inc Imaging device, printer, image processor and program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002185771A (en) * 2000-12-14 2002-06-28 Noritsu Koki Co Ltd Image forming device, image data processing method and recording medium recording image data processing program
JP2003069822A (en) * 2001-08-29 2003-03-07 Ricoh Co Ltd Image processor, image processing method and recording medium
JP2005086516A (en) * 2003-09-09 2005-03-31 Canon Inc Imaging device, printer, image processor and program
JP2005086772A (en) * 2003-09-11 2005-03-31 Sharp Corp Image processing method, image processing apparatus, image forming device, image pickup device, and computer program

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0544886A (en) * 1991-08-12 1993-02-23 Osaka Gas Co Ltd Pipe repairing tool
JP2016528826A (en) * 2013-07-30 2016-09-15 ドルビー ラボラトリーズ ライセンシング コーポレイション System and method for generating scene invariant metadata
JP2018042253A (en) * 2013-07-30 2018-03-15 ドルビー ラボラトリーズ ライセンシング コーポレイション System and method for forming metadata in which scene is unchanged
US10553255B2 (en) 2013-07-30 2020-02-04 Dolby Laboratories Licensing Corporation System and methods for generating scene stabilized metadata
JP2016054355A (en) * 2014-09-02 2016-04-14 キヤノン株式会社 Image processing system, control method of the same, and program
US11488289B2 (en) 2016-03-30 2022-11-01 Interdigital Vc Holdings, Inc. Method for detection of saturated pixels in an image

Also Published As

Publication number Publication date
JP5004305B2 (en) 2012-08-22

Similar Documents

Publication Publication Date Title
JP5611457B2 (en) Gradation and color gamut mapping method and apparatus
US8554010B2 (en) Image processing apparatus combining plural sets of image data and method for controlling the same
CN106791471B (en) Image optimization method, image optimization device and terminal
CN110033418B (en) Image processing method, image processing device, storage medium and electronic equipment
JP6415062B2 (en) Image processing apparatus, image processing method, control program, and recording medium
US6097836A (en) Image processing system and its smoothing method for correcting color fog and backlight of a digital image
JP2006345509A (en) Image processing method and apparatus
CN109801240A (en) A kind of image enchancing method and image intensifier device
JP5218767B2 (en) Image processing apparatus, image processing method, program, and recording medium
US10218953B2 (en) Image processing apparatus, image processing method, and storage medium
US11336834B2 (en) Device, control method, and storage medium, with setting exposure condition for each area based on exposure value map
JP5004305B2 (en) Image processing apparatus, image processing method, program, and recording medium
JP6278736B2 (en) Image processing apparatus, image processing method, control program, and recording medium
JP4289225B2 (en) Image processing apparatus and image processing method
JP4979090B2 (en) Image processing apparatus, image processing method, program, and recording medium
JP4013699B2 (en) Image processing apparatus and image processing method
US7576781B2 (en) Image processing of image data
JP2012083848A (en) Image processing device, image processing method, imaging device, and image processing program
JP6786273B2 (en) Image processing equipment, image processing methods, and programs
JP2010183416A (en) Image processing apparatus and method, program, and recording medium
JP4539674B2 (en) Image processing apparatus, image processing method, and processor used for image processing
JP5058903B2 (en) Image processing apparatus, image processing method, program, and recording medium
CN116962890B (en) Processing method, device, equipment and storage medium of point cloud image
JP5483949B2 (en) Image processing apparatus, image processing method, and program
JP2005175933A (en) Image processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110701

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120507

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120518

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

Free format text: PAYMENT UNTIL: 20150601

Year of fee payment: 3

R151 Written notification of patent or utility model registration

Ref document number: 5004305

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

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

Free format text: PAYMENT UNTIL: 20150601

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees