JP2014033272A - Image processing apparatus, digital camera, image processing program, and image processing method - Google Patents
Image processing apparatus, digital camera, image processing program, and image processing method Download PDFInfo
- Publication number
- JP2014033272A JP2014033272A JP2012171357A JP2012171357A JP2014033272A JP 2014033272 A JP2014033272 A JP 2014033272A JP 2012171357 A JP2012171357 A JP 2012171357A JP 2012171357 A JP2012171357 A JP 2012171357A JP 2014033272 A JP2014033272 A JP 2014033272A
- Authority
- JP
- Japan
- Prior art keywords
- correction
- straight line
- saturation
- value
- 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.)
- Pending
Links
Images
Landscapes
- Image Processing (AREA)
- Facsimile Image Signal Circuits (AREA)
- Color Image Communication Systems (AREA)
Abstract
Description
本発明は、画像処理装置、デジタルカメラ、画像処理プログラムおよび画像処理方法に関する。 The present invention relates to an image processing apparatus, a digital camera, an image processing program, and an image processing method.
輝度色差分離空間であるYUV空間において、画像データに対して階調補正を行う画像処理方法が知られている(特許文献1参照)。 An image processing method is known in which tone correction is performed on image data in a YUV space that is a luminance / color difference separation space (see Patent Document 1).
画像データを出力する色空間(出力色空間)が例えばRGB空間など複数の原色で表される色空間である場合、上記従来技術のように輝度色差分離空間において輝度階調補正を行うと、出力色空間の色域内にあった色が色域外となってしまう可能性がある。また、彩度補正を行った際も、同様に、出力色空間の色域内にあった色が色域外となってしまう可能性がある。このように出力色空間の色域内にあった色が色域外となると、出力色空間に変換されたときに色域境界値にクリップされるため、色相が回転したり色がつぶれたりする(飽和する)という問題があった。 When the color space for outputting image data (output color space) is a color space represented by a plurality of primary colors such as RGB space, output is performed when luminance gradation correction is performed in the luminance color difference separation space as in the conventional technique described above. There is a possibility that a color that is in the color gamut of the color space may be out of the color gamut. Similarly, when saturation correction is performed, there is a possibility that a color that is in the color gamut of the output color space is out of the color gamut. In this way, when a color that falls within the color gamut of the output color space goes out of the color gamut, it is clipped to the color gamut boundary value when converted to the output color space, so the hue is rotated or the color is crushed (saturated) There was a problem.
(1)請求項1に記載の発明による画像処理装置は、輝度色差分離空間における補正対象色を含む等色相面において、白色点および最大彩度点を通る第1の直線の傾きを取得する傾き取得手段と、補正対象色の輝度および彩度を補正するための補正値を出力するルックアップテーブルの入力値を、補正対象色の輝度および、彩度または色差と第1の直線の傾きとに基づいて算出する入力値算出手段と、入力値をルックアップテーブルへ入力して補正値を取得する補正値取得手段と、補正値に基づいて、補正対象色の輝度および、色差または彩度の少なくとも一方を補正する補正手段と、を備えることを特徴とする。
(2)請求項7に記載の発明による画像処理装置は、輝度色差分離空間における補正対象色を含む等色相面において、白色点および最大彩度点を通る第1の直線の傾きと、黒色点および最大彩度点を通る第2の直線の傾きとを取得する傾き取得手段と、補正対象色の輝度および彩度を補正するための補正値を出力するルックアップテーブルの入力値を、補正対象色の輝度および、彩度または色差と第2の直線の傾きとに基づいて算出する入力値算出手段と、入力値をルックアップテーブルへ入力して補正値を取得する補正値取得手段と、補正値と第1の直線の傾きとに基づいて、補正対象色の輝度および、色差または彩度の少なくとも一方を補正する補正手段と、を備えることを特徴とする。
(3)請求項14に記載の発明によるデジタルカメラは、被写体像を撮像する撮像手段と、請求項1〜13のいずれか一項に記載の画像処理装置と、を備え、画像処理装置は、撮像手段により撮像された画像に対して補正処理を行うことを特徴とする。
(4)請求項15に記載の発明による画像処理プログラムは、コンピュータを、請求項1〜13のいずれか一項に記載の画像処理装置として機能させることを特徴とする。
(5)請求項16に記載の発明による画像処理方法は、輝度色差分離空間における補正対象色を含む等色相面において、白色点および最大彩度点を通る第1の直線の傾きを取得する傾き取得工程と、補正対象色の輝度および彩度を補正するための補正値を出力するルックアップテーブルの入力値を、補正対象色の輝度および、彩度または色差と第1の直線の傾きとに基づいて算出する入力値算出工程と、入力値をルックアップテーブルへ入力して補正値を取得する補正値取得工程と、補正値に基づいて、補正対象色の輝度および、色差または彩度の少なくとも一方を補正する補正工程と、を備えることを特徴とする。
(6)請求項17に記載の発明による画像処理方法は、輝度色差分離空間における補正対象色を含む等色相面において、白色点および最大彩度点を通る第1の直線の傾きと、黒色点および最大彩度点を通る第2の直線の傾きとを取得する傾き取得工程と、補正対象色の輝度および彩度を補正するための補正値を出力するルックアップテーブルの入力値を、補正対象色の輝度および、彩度または色差と第2の直線の傾きとに基づいて算出する入力値算出工程と、入力値をルックアップテーブルへ入力して補正値を取得する補正値取得工程と、補正値と第1の直線の傾きとに基づいて、補正対象色の輝度および、色差または彩度の少なくとも一方を補正する補正工程と、を備えることを特徴とする。
(1) The image processing apparatus according to the first aspect of the present invention is an inclination for acquiring the inclination of the first straight line passing through the white point and the maximum saturation point on the equal hue plane including the correction target color in the luminance / color difference separation space. The input value of the lookup table that outputs the correction value for correcting the luminance and the saturation of the correction target color is used as the luminance and the saturation or color difference of the correction target color and the slope of the first straight line. Input value calculation means for calculating based on, correction value acquisition means for acquiring the correction value by inputting the input value to the lookup table, and at least luminance and color difference or saturation of the correction target color based on the correction value And a correcting means for correcting one of them.
(2) In the image processing device according to the seventh aspect of the present invention, the slope of the first straight line passing through the white point and the maximum saturation point on the equal hue plane including the correction target color in the luminance / color difference separation space, and the black point And an inclination acquisition means for acquiring the inclination of the second straight line passing through the maximum saturation point, and an input value of a lookup table that outputs a correction value for correcting the luminance and saturation of the correction target color, An input value calculating means for calculating based on the luminance of the color and saturation or color difference and the slope of the second straight line; a correction value acquiring means for acquiring the correction value by inputting the input value to the lookup table; And correcting means for correcting at least one of luminance and color difference or saturation of the color to be corrected based on the value and the slope of the first straight line.
(3) A digital camera according to a fourteenth aspect of the present invention includes an image pickup unit that picks up a subject image and the image processing device according to any one of the first to thirteenth aspects. A correction process is performed on the image captured by the imaging unit.
(4) An image processing program according to a fifteenth aspect of the invention causes a computer to function as the image processing apparatus according to any one of the first to thirteenth aspects.
(5) In the image processing method according to the sixteenth aspect of the present invention, an inclination for acquiring the inclination of the first straight line passing through the white point and the maximum saturation point on the equal hue plane including the correction target color in the luminance / color difference separation space. The input value of the look-up table that outputs the correction process and the correction value for correcting the luminance and saturation of the correction target color is set to the luminance and saturation or color difference of the correction target color and the slope of the first straight line. An input value calculating step to calculate based on, a correction value acquiring step to input the input value to a lookup table to acquire a correction value, and based on the correction value, at least luminance and color difference or saturation of the correction target color And a correction step of correcting one of the two.
(6) In the image processing method according to the seventeenth aspect of the present invention, the slope of the first straight line passing through the white point and the maximum saturation point on the equal hue plane including the color to be corrected in the luminance / color difference separation space, and the black point And an inclination acquisition step for acquiring the inclination of the second straight line passing through the maximum saturation point, and an input value of a lookup table that outputs a correction value for correcting the luminance and saturation of the correction target color, An input value calculating step for calculating based on the luminance of the color, saturation or color difference and the inclination of the second straight line, a correction value acquiring step for acquiring the correction value by inputting the input value to the lookup table, and correction And a correction step of correcting at least one of luminance and color difference or saturation of the correction target color based on the value and the slope of the first straight line.
本発明によれば、出力色空間の色域内にある色を色域外に補正してしまうことを防止することができる。 According to the present invention, it is possible to prevent a color within the color gamut of the output color space from being corrected out of the color gamut.
以下、図面を参照して本発明を実施するための形態について説明する。図1は、本発明の一実施形態による画像処理装置100の構成を例示するブロック図である。本実施形態では、画像処理装置100としてデジタルカメラを用いる例を説明する。デジタルカメラ100は、操作部材101と、撮像レンズ102と、撮像素子103と、制御装置104と、メモリカードスロット105と、モニタ106とを備える。操作部材101は、使用者によって操作される種々の入力部材、例えば電源ボタン、レリーズボタン、ズームボタン、メニューボタンなどを含む。
Hereinafter, embodiments for carrying out the present invention will be described with reference to the drawings. FIG. 1 is a block diagram illustrating the configuration of an
撮像レンズ102は、被写体像を撮像素子103の撮像面に結像するように配置されている。撮像レンズ102は、図1では代表して1枚のレンズで表しているが、実際は複数の光学レンズから構成される。
The
撮像素子103は、例えばCMOSイメージセンサなどによって構成される。撮像素子103は、撮像レンズ102で結像される被写体像を撮像し、得られた画像信号を制御装置104へ出力する。撮像素子103には、R(赤)、G(緑)、B(青)がBayer配列されたカラーフィルタが形成されている。このため、デジタルカメラ100で取得される画像の色は、機器依存のRGB表色系で表される。
The
制御装置104は、CPU、メモリ、およびその他の周辺回路により構成され、デジタルカメラ100が行う撮影動作を制御する。制御装置104を構成するメモリには、SDRAMやフラッシュメモリが含まれる。SDRAMは揮発性のメモリであって、制御装置104がプログラム実行時にプログラムを展開するためのワークメモリとして使用される。また、SDRAMは、データを一時的に記憶するためのバッファメモリとしても使用される。一方、フラッシュメモリは不揮発性のメモリであって、制御装置104が実行するプログラムや、プログラム実行時に読込まれる種々のパラメータなどを記憶する。
The
メモリカードスロット105は、記憶媒体としてのメモリカードを挿入するためのスロットである。制御装置104は、撮影処理を行うことによって生成した画像ファイルを、メモリカードスロット105に挿入されているメモリカードへ書込んで記録する。また、制御装置104は、メモリカードスロット105に挿入されているメモリカード内に記録されている画像ファイルを読込む。
The
モニタ106は、デジタルカメラ100の背面に搭載された液晶モニタ(いわゆる背面モニタ)である。当該モニタ106には、メモリカードに記録されている画像ファイルに基づく再生画像や、デジタルカメラ100を設定するための設定メニューなどが表示される。また、使用者が操作部材101を操作してデジタルカメラ100を、背面液晶を使用する撮影モードに設定すると、制御装置104は、撮像素子103から時系列で取得した画像の表示用画像データをモニタ106に出力する。これにより、モニタ106にスルー画を表示することもできる。
The
ところで、人間の明るさの知覚に近い色空間として、輝度色差分離空間であるYCC空間や均等色空間であるCIELAB等の色空間が知られている。これらの色空間では、色相を保ったまま階調や彩度を補正することが容易であるため、画像処理によく用いられる。 By the way, color spaces such as a YCC space that is a luminance color difference separation space and CIELAB that is a uniform color space are known as color spaces that are close to human perception of brightness. These color spaces are often used for image processing because it is easy to correct gradation and saturation while maintaining hue.
画像データを出力する色空間(出力色空間)が、輝度色差分離空間ではなく、RGB表色系のような複数の原色で表される色空間である場合、YCC空間やCIELAB空間における出力色空間の色域形状は、等色相面において、図2に示すように、黒色点Bpと白色点Wpと最大彩度点Cpとを結んだ三角形に近くなる。なお、図2において、縦軸が輝度(Y)であり、横軸が彩度(C)である。YCC空間では、Y軸方向が輝度を表し、CbCr面での原点まわりの角度が色相を表す。つまり、Y軸を含んでCb軸あるいはCr軸と一定の角度をなす平面上の色はみな同じ色相となり、これを等色相面と呼んでいる。等色相面ではY軸からの距離が彩度を表している。また、黒色点Bpは、出力色空間で表現しうる最も輝度が低い色を示し、白色点Wpは、出力色空間で表現しうる最も輝度が高い色を示す。最大彩度点Cpは、各色相において出力色空間で表現しうる最も彩度が高い色を示す。 When the color space (output color space) for outputting image data is not a luminance color difference separation space but a color space represented by a plurality of primary colors such as an RGB color system, an output color space in a YCC space or CIELAB space As shown in FIG. 2, the color gamut shape is close to a triangle connecting the black point Bp, the white point Wp, and the maximum saturation point Cp, as shown in FIG. In FIG. 2, the vertical axis represents luminance (Y), and the horizontal axis represents saturation (C). In the YCC space, the Y-axis direction represents luminance, and the angle around the origin on the CbCr plane represents hue. That is, all the colors on the plane including the Y axis and forming a certain angle with the Cb axis or the Cr axis have the same hue, and this is called an equal hue plane. On the equi-hue surface, the distance from the Y axis represents the saturation. Further, the black point Bp indicates the color with the lowest luminance that can be expressed in the output color space, and the white point Wp indicates the color with the highest luminance that can be expressed in the output color space. The maximum saturation point Cp indicates a color having the highest saturation that can be expressed in the output color space in each hue.
また、出力色空間の等色相面での色域形状は、色相によって異なる。これは、最大彩度点Cpにおける輝度が色相によって異なるためである。例えば、赤や青は黄色より暗く感じられるため、図3に示すように、赤や青の最大彩度点Cpにおける輝度は、黄色の最大彩度点Cpにおける最大輝度より低い。また、有彩色の最大彩度点Cpの輝度は、無彩色の最大輝度(すなわち白色点Wp)よりも低い。 Further, the color gamut shape on the equal hue plane of the output color space differs depending on the hue. This is because the luminance at the maximum saturation point Cp varies depending on the hue. For example, since red and blue are felt darker than yellow, the luminance at the maximum saturation point Cp for red and blue is lower than the maximum luminance at the maximum saturation point Cp for yellow as shown in FIG. Further, the luminance of the maximum saturation point Cp of the chromatic color is lower than the maximum luminance of the achromatic color (that is, the white point Wp).
階調補正は、例えば、図4に示すように、階調補正前の値(Input)と階調補正後の値(Output)との関係を示すS字の階調カーブTcを用いて行われる。なお、図4の階調カーブTcでは、最小値を0とし、最大値を1として、Inputが正規化されているとする。例えばYCC空間を用いて階調補正を行う場合に、無彩色の輝度について調整された階調カーブTcを有彩色に対して適用すると、赤や青の様な色相では、高彩度色の輝度が低いため、階調補正によって高彩度色の輝度がさらに低く補正されてしまい、高彩度色が暗く表現されてしまう。 For example, as shown in FIG. 4, the gradation correction is performed using an S-shaped gradation curve Tc indicating the relationship between the value before gradation correction (Input) and the value after gradation correction (Output). . In the gradation curve Tc in FIG. 4, it is assumed that Input is normalized with the minimum value being 0 and the maximum value being 1. For example, when tone correction is performed using a YCC space, if a tone curve Tc adjusted for achromatic luminance is applied to a chromatic color, the luminance of a high chroma color is low in hues such as red and blue. Therefore, the luminance of the high saturation color is corrected to be lower by the gradation correction, and the high saturation color is expressed darkly.
また、この階調補正の結果、元々色域内にあった色が色域外に出てしまう可能性がある。このように色域外に出てしまった色は、出力色空間に変換されると出力色空間の色域境界値にクリップされてしまうため、色相が回転したり、色がつぶれたりする(飽和する)などの不具合が生じる。例えば、高彩度の黄色においてB成分が負値から0にクリップされるとオレンジに色相が回ったり、高輝度の肌色が黄色く変化したりするなどの不具合が生じてしまう。 In addition, as a result of this gradation correction, there is a possibility that a color originally in the color gamut may go out of the color gamut. Thus, when the color that has gone out of the color gamut is clipped to the color gamut boundary value of the output color space when converted to the output color space, the hue rotates or the color is crushed (saturates). ) And other problems occur. For example, when the B component is clipped from a negative value to 0 in yellow with high saturation, problems such as the hue turning to orange or the skin color of high brightness changing to yellow occur.
一方、彩度強調などの補正をYCC空間で行う場合も、輝度によって最大彩度が異なるため、色域境界付近の色については色域外に強調されてしまう可能性がある。したがって、この場合も、出力色空間に変換されると出力色空間の色域境界値にクリップされてしまうため、色相が回転したり、色がつぶれたりする(飽和する)などの不具合が生じる。 On the other hand, when correction such as saturation enhancement is performed in the YCC space, since the maximum saturation differs depending on the luminance, there is a possibility that colors near the color gamut boundary are emphasized outside the color gamut. Therefore, in this case as well, when converted to the output color space, it is clipped to the color gamut boundary value of the output color space, causing problems such as hue rotation and color collapse (saturation).
そこで本実施形態のデジタルカメラ100では、上述した不具合を防止しながら階調補正や彩度補正を行うようになっている。以下、このような階調補正および彩度補正について、具体的に説明する。図5は、本実施形態における階調補正や彩度補正を含む画像処理の流れを説明するフローチャートである。なお、この画像処理は、制御装置104のメモリに記憶された画像処理プログラムに従って制御装置104が実行する処理である。
Therefore, in the
図5のステップS1において、制御装置104は、撮像素子103から読み出されたRGB画像データを取得する。そして制御装置104は、このRGB画像データに対して、補間、ホワイトバランス、ノイズ除去などの処理を施して、ステップS2へ進む。
In step S <b> 1 of FIG. 5, the
ステップS2において制御装置104は、ステップS1で処理が施されたRGB画像データを、撮像素子103固有のRGB空間から、階調補正および彩度補正を行うための色空間であるYCC空間に変換して、ステップS3へ進む。この変換は、画像を出力する色空間(出力色空間)として例えばsRGB空間を利用する場合、以下の式(1)〜(3)により行われる。なお、以下の式(1)〜(3)において、(R,G,B)は、式(1)の入力値(上記RGB画像データ)である。(R1,G1,B1)は、式(1)の出力値且つ式(2)の入力値である。(R2,G2,B2)は、式(2)の出力値且つ式(3)の入力値である。(Y,Cb,Cr)は、式(3)の出力値である。また、MRGB2XYZは、撮像素子103固有のRGB空間からXYZ空間(例えばCIE 1964 XYZ)へ変換するための変換マトリックスであり、撮像素子103の分光感度特性や撮影時の照明条件などに基づいて決定される。また、MXYZ2sRGBは、XYZ空間からsRGB空間へ変換するための変換マトリックスである。また、LUT1は、標準のsRGB空間におけるγ変換を行うためのルックアップテーブルである。また、MsRGB2YCCは、sRGB空間からYCC空間へ変換するための変換マトリックスである。
ステップS3において制御装置104は、ステップS2で変換されたYCbCr画像データにおいて、1画素ごとに色相を算出して、ステップS4へ進む。なお、色相は、例えばCbとCrとの比や、CrまたはCbと、CrおよびCbの絶対値を用いた彩度近似値との比に基づいて算出される。
In step S3, the
ステップS4において制御装置104は、YCbCr画像データの1画素ごとに、ステップS3で算出した色相の等色相面における出力色空間(sRGB空間)の色域形状を算出する。
In step S4, the
上述したように、YCC空間における等色相面において、出力色空間(sRGB空間)の色域を表すと、図6に示すように、黒色点Bpと白色点Wpと最大彩度点Cpとを結んだ三角形で近似して表すことができる。なお、図6において、縦軸が輝度(Y)であり、横軸が彩度(C)である。また図6では、黒色点Bpの輝度および彩度を(0,0)とし、白色点Wpの輝度および彩度を(1,0)として、各画素の輝度および彩度が正規化されているとする。ステップS4では、各画素の色相について、等色相面における輝度色度座標上における、白色点Wpと最大彩度点Cpとを通る第1の直線L1の傾き(以下、第1の傾きと呼ぶ)pdy1と、黒色点Bpと最大彩度点Cpとを通る第2の直線L2の傾き(以下、第2の傾きと呼ぶ)pdy2とを、対象画素の色相における出力色空間の色域形状として算出する。なお、pdy1およびpdy2は、それぞれ絶対値であるとする。 As described above, when the color gamut of the output color space (sRGB space) is represented on the equal hue plane in the YCC space, the black point Bp, the white point Wp, and the maximum saturation point Cp are connected as shown in FIG. It can be approximated by a triangle. In FIG. 6, the vertical axis represents luminance (Y), and the horizontal axis represents saturation (C). In FIG. 6, the luminance and saturation of the black point Bp are (0, 0), and the luminance and saturation of the white point Wp are (1, 0), and the luminance and saturation of each pixel are normalized. And In step S4, for the hue of each pixel, the slope of the first straight line L1 passing through the white point Wp and the maximum saturation point Cp on the luminance and chromaticity coordinates on the equal hue plane (hereinafter referred to as the first slope). pdy1 and the slope (hereinafter referred to as the second slope) pdy2 of the second straight line L2 passing through the black point Bp and the maximum saturation point Cp are calculated as the gamut shape of the output color space in the hue of the target pixel. To do. Note that pdy1 and pdy2 are absolute values.
ここで、赤、黄、緑における第1の傾きpdy1は、それぞれ反対色であるシアン、青、マゼンタにおける第2の傾きpdy2と等しい。一方、赤、黄、緑における第2の傾きpdy2は、それぞれ反対色であるシアン、青、マゼンタにおける第1の傾きpdy1と等しい。そこで、制御装置104内のメモリ(不図示)には、少なくとも3色(例えば赤、黄、緑)において、それぞれ第1の傾きpdy1および第2の傾きpdy2が予め記録されている。制御装置104は、このメモリに記録された赤、黄、緑における第1の傾きpdy1および第2の傾きpdy2に基づいて、シアン、青、マゼンタにおける第1の傾きpdy1および第2の傾きpdy2についても求めることができる。
Here, the first slope pdy1 for red, yellow, and green is equal to the second slope pdy2 for cyan, blue, and magenta, which are opposite colors, respectively. On the other hand, the second slopes pdy2 for red, yellow, and green are equal to the first slopes pdy1 for cyan, blue, and magenta, which are opposite colors, respectively. Therefore, in the memory (not shown) in the
ステップS4では、この計6色(赤、黄、緑、シアン、青、マゼンタ)のうち、対象画素の色相に隣接する2色相における第1の傾きpdy1および第2の傾きpdy2からの補間により、対象画素の色相における第1の傾きpdy1および第2の傾きpdy2を算出する。例えば、対象画素の色相が緑からシアンの間にある場合は、メモリに記録された赤における第1の傾きpdy1および第2の傾きpdy2を用いて、シアンにおける第1の傾きpdy1および第2の傾きpdy2を求める。そして、このシアンにおける第1の傾きpdy1および第2の傾きpdy2と、メモリに記録された緑における第1の傾きpdy1および第2の傾きpdy2を、対象画素の色相と緑およびシアンとの差分を考慮して重み付けして、対象画素の色相における第1の傾きpdy1および第2の傾きpdy2を算出する。 In step S4, among the six colors (red, yellow, green, cyan, blue, magenta), by interpolation from the first gradient pdy1 and the second gradient pdy2 in two hues adjacent to the hue of the target pixel, A first gradient pdy1 and a second gradient pdy2 in the hue of the target pixel are calculated. For example, when the hue of the target pixel is between green and cyan, the first slope pdy1 and the second slope pdy1 and the second slope pdy2 in red recorded in the memory are used. Find the slope pdy2. Then, the first slope pdy1 and the second slope pdy2 in cyan, the first slope pdy1 and the second slope pdy2 in green recorded in the memory, and the difference between the hue of the target pixel and green and cyan The first gradient pdy1 and the second gradient pdy2 in the hue of the target pixel are calculated in consideration.
このようにして制御装置104は、YCbCr画像データの1画素ごとに、その画素の色相における第1の傾きpdy1および第2の傾きpdy2を算出して、ステップS5へ進む。
In this way, the
ステップS5において制御装置104は、YCbCr画像データに対して階調補正を行う。この階調補正では、輝度(Y)軸に沿って補正するのではなく、図6に示すように、補正を行う画素の色(補正対象色)の等色相面において、補正対象色の輝度および彩度を示す点(補正対象色点)Tpと黒色点Bpとを結ぶ第3の直線L3に沿って輝度および彩度が変化するように補正する。
In step S5, the
この階調補正について具体的に説明する。なお、以下の説明において、YCbCr画像データは、Yの最小値(最小輝度)を0とし、Yの最大値(最大輝度)を1として正規化された値を用いている。まず、制御装置104は、対象画素のCb値およびCr値から、次式(4)により、対象画素の彩度Cの近似値を算出する。式(4)における除算(/4)はビットシフトを用いて対応してもよい。
C = (|Cb|+|Cr|+|Cb + Cr|+|Cb - Cr|)/4 …(4)
This gradation correction will be specifically described. In the following description, the YCbCr image data uses values normalized by setting the minimum value of Y (minimum luminance) to 0 and the maximum value of Y (maximum luminance) to 1. First, the
C = (| Cb | + | Cr | + | Cb + Cr | + | Cb-Cr |) / 4 (4)
なお、処理負荷を軽くしつつ良好な彩度近似値を算出するため、式(4)を用いたが、処理負荷に余裕がある場合は、次の式(5)を用いたり、式(4)、(5)以外の式で彩度を算出したりしてもよい。
C = (Cb2+ Cr2)1/2 …(5)
In order to calculate a good saturation approximation value while reducing the processing load, the equation (4) is used. However, when there is a margin in the processing load, the following equation (5) is used or the equation (4) is used. ) And (5) may be used to calculate the saturation.
C = (Cb 2 + Cr 2 ) 1/2 (5)
次に、制御装置104は、第3の直線L3を軸とする座標系(以下、階調補正座標系と呼ぶ)における補正対象色点Tpの座標値を階調補正パラメータyGainInとして算出する。この階調補正座標系は、黒色点Bpの座標値が0であり、第3の直線L3と第1の直線L1との交点P31の座標値が1であり、黒色点Bpから交点P31へ向かう方向に座標値が大きくなる座標系であるとする。具体的には、制御装置104は、対象画素の輝度Yおよび彩度Cと第1の傾きpdy1とを用いて、次式(6)により、階調補正パラメータyGainInを算出する。
yGainIn = Y + C * pDy1 …(6)
Next, the
yGainIn = Y + C * pDy1 (6)
すなわち、補正対象色点Tpが黒色点Bp上にあればyGainIn=0となり、補正対象色点Tpが交点P31上にあればyGainIn=1となる。また、補正対象色点Tpが黒色点Bpと交点P31との間にある場合は、0<yGainIn<1となり、補正対象色点Tpが交点P31に近くなるほどyGainInは1に向かって大きくなり、補正対象色点Tpが黒色点Bpに近くなるほどyGainInは0に向かって小さくなる。また、補正対象色点Tpが交点P31よりも黒色点Bpから遠い場合には、yGainIn>1となる。この場合、補正対象色点Tpは出力色空間の色域外に位置している。 That is, the correction target color point Tp is next yGainIn = 0 If on a black point Bp, corrected color point Tp is yGainIn = 1 if on the intersection P 31. Further, when the correction target color point Tp is between the black point Bp and the intersection P 31 , 0 <yGainIn <1, and as the correction target color point Tp is closer to the intersection P 31 , yGainIn increases toward 1. As the correction target color point Tp becomes closer to the black point Bp, yGainIn becomes smaller toward zero. Further, when the correction target color point Tp is far from the black point Bp than the intersection point P 31 is a yGainIn> 1. In this case, the correction target color point Tp is located outside the color gamut of the output color space.
次に、制御装置104は、階調補正ゲインyGainを求める。階調補正ゲインyGainとは、階調補正前の輝度(Input)に対する階調補正後の輝度(Output)の比(Output/Input)である。階調補正ゲインyGainは、例えば、Inputに対して上述した図4のS字の階調カーブTcを用いて階調補正が行われるように設定されている。また、階調補正ゲインyGainは、Inputが0以上1以下である場合にはInputに階調補正ゲインyGainを乗算した値であるOutputが0以上1以下となるように設定されており、色域内の色は色域内に変換される。なお、Inputが1より大きい場合にはOutputが1より小さくなるように設定することで、色域外の色も色域内に圧縮してもよい。
Next, the
制御装置104のメモリには、Inputを入力すると、このように設定された階調補正ゲインyGainを出力するルックアップテーブルLUT2が予め記録されている。制御装置104は、このルックアップテーブルLUT2を用いて、次式(7)により階調補正ゲインyGainを算出する。すなわち、階調補正パラメータyGainInをルックアップテーブルLUT2の入力値として階調補正ゲインyGainを求める。
yGain = LUT2(yGainIn) …(7)
In the memory of the
yGain = LUT2 (yGainIn) (7)
次に、制御装置104は、次式(8)〜(11)により、対象画素のYCbCrおよび彩度Cに対して、それぞれ階調補正ゲインyGainを乗算することで、階調が補正されたY1Cb1Cr1および彩度C1を算出する。
Y1 = Y * yGain …(8)
Cb1 = Cb * yGain …(9)
Cr1 = Cr * yGain …(10)
C1 = C * yGain …(11)
Next, the
Y 1 = Y * yGain (8)
Cb 1 = Cb * yGain (9)
Cr 1 = Cr * yGain (10)
C 1 = C * yGain (11)
この結果、補正対象色点Tpが黒色点Bpと交点P31との間にある場合は、黒色点Bpと交点P31との間で第3の直線L3に沿って補正が行われる。これにより、出力色空間の色域内の画素について、色域内で階調補正を行うことができる。したがって、出力色空間の色域内の画素が色域外に変換されることがないので、出力色空間に変換した時に出力色空間の色域境界値にクリップされて色相回転が生じるという不具合を防止することができる。 As a result, if the correction target color point Tp is between the black point Bp and the intersection P 31 is corrected along a third straight line L3 between the black point Bp and the intersection P 31 is performed. Thereby, gradation correction can be performed in the color gamut for pixels in the color gamut of the output color space. Therefore, since the pixels in the color gamut of the output color space are not converted out of the color gamut, it is possible to prevent a problem that hue rotation occurs due to clipping to the color gamut boundary value of the output color space when converted to the output color space. be able to.
また、ルックアップテーブルLUT2の入力値をYとするのではなく、第1の傾きpdy1を用いて正規化した階調補正パラメータyGainInとしたことで、高彩度色については輝度を上げる補正を行うことができるので、特に赤や青などの輝度が低い高彩度色について輝度を下げる補正が行われてしまうことを防止できる。したがって、有彩色と無彩色とで同じ階調カーブTcを用いても階調補正を弊害なく行うことができ、簡易で高性能な色処理を行うことができる。 In addition, the input value of the lookup table LUT2 is not set to Y, but the gradation correction parameter yGainIn normalized using the first slope pdy1 is used, so that correction for increasing the luminance of high chroma color can be performed. Therefore, it is possible to prevent correction for lowering the luminance of high-saturation colors with particularly low luminance such as red and blue. Therefore, even if the same gradation curve Tc is used for chromatic colors and achromatic colors, gradation correction can be performed without adverse effects, and simple and high-performance color processing can be performed.
また、第1の傾きpDy1を用いて階調補正パラメータyGainInを算出し、ルックアップテーブルLUT2の入力値としたので、処理負荷の重い除算処理を行わなくても、出力色空間の色域形状に応じてルックアップテーブルLUT2の入力値を補正することができ、色相によらずに1つの階調カーブTcを用いて階調補正を行うことができる。なお、式(4)では、4による除算が入るが、これはビットシフトの手法を用いれば非常に小さな負荷で実現できる。 In addition, since the tone correction parameter yGainIn is calculated using the first slope pDy1 and used as the input value of the lookup table LUT2, the color gamut shape of the output color space can be obtained without performing heavy division processing. Accordingly, the input value of the lookup table LUT2 can be corrected, and gradation correction can be performed using one gradation curve Tc regardless of the hue. In equation (4), division by 4 is included, but this can be realized with a very small load by using the bit shift method.
以上のように制御装置104は、YCbCr画像データの各画素に対して上記階調補正を行うと、ステップS6へ進む。
As described above, when the gradation correction is performed on each pixel of the YCbCr image data, the
ステップS6において制御装置104は、ステップS5の階調補正後の画像データ(Y1Cb1Cr1)に対して、彩度補正を行う。この彩度補正では、彩度(C)軸に沿って補正するのではなく、図7に示すように、補正対象色点Tpを通り且つ第1の直線L1に平行である第4の直線L4に沿って輝度および彩度が変化するように補正する。
In step S6, the
この彩度補正について具体的に説明する。まず、制御装置104は、第4の直線L4を軸とする座標系(以下、彩度補正座標系と呼ぶ)における補正対象色点Tpの座標値を彩度補正パラメータcGainInとして算出する。この彩度補正座標系では、第2の直線L2と第4の直線L4との交点P42の座標値が1であり、第4の直線L4と輝度(Y)軸(すなわち黒色点Bpと白色点Wpとを通る直線)との交点P4Yから交点P42へ向かう方向に座標-値が大きくなる座標系であるとする。具体的には、制御装置104は、対象画素の輝度Y1および彩度C1と第2の傾きpdy2とを用いて、次式(12)により、彩度補正パラメータcGainInを算出する。
cGainIn = 1 -Y1 + pDy2 * C1 …(12)
This saturation correction will be specifically described. First, the
cGainIn = 1 -Y 1 + pDy2 *
すなわち、補正対象色点Tpが交点P42上にあればcGainIn=1となる。また、補正対象色点Tpが交点P4Yと交点P42との間にある場合は、cGainIn<1となり、補正対象色点Tpが交点P42に近くなるほどcGainInは1に向かって大きくなり、補正対象色点Tpが交点P4Yに近くなるほどcGainInは小さくなる。また、補正対象色点Tpが交点P42よりも交点P4Yから遠い場合には、cGainIn>1となる。この場合、補正対象色点Tpは出力色空間の色域外に位置している。 That is, the correction target color point Tp is cGainIn = 1 if on the intersection P 42. Further, when the correction target color point Tp is between the intersection point P 4Y and the intersection point P 42 , cGainIn <1, and as the correction target color point Tp is closer to the intersection point P 42 , cGainIn increases toward 1, and correction is performed. nearer cGainIn target color point Tp is the intersection P 4Y is reduced. Further, when the correction target color point Tp is far from the intersection point P 4Y than the intersection point P 42 is a cGainIn> 1. In this case, the correction target color point Tp is located outside the color gamut of the output color space.
次に、制御装置104は、彩度補正ゲインcGainを求める。彩度補正ゲインcGainとは、彩度補正前の彩度(Input)に対する彩度補正後の彩度(Output)の比(Output/Input)である。彩度補正ゲインcGainは、例えば、Inputに対して上述した図5と同様のS字状である彩度カーブを用いて彩度補正が行われるように設定されている。また、彩度補正ゲインcGainは、Inputが0以上1以下である場合にはInputに彩度補正ゲインcGainを乗算した値であるOutputが0以上1以下となるように設定されており、色域内の色は色域内に変換される。なお、Inputが1より大きい場合にもOutputが1より小さくなるように設定することで、色域外の色も色域内に圧縮してもよい。
Next, the
制御装置104のメモリには、Inputを入力すると、このように設定された彩度補正ゲインcGainを出力するルックアップテーブルLUT3が予め記録されている。制御装置104は、このルックアップテーブルLUT3を用いて、次式(13)により彩度補正ゲインcGainを算出する。すなわち、彩度補正パラメータcGainInをルックアップテーブルLUT3の入力値として彩度補正ゲインcGainを求める。
cGain = LUT3(cGainIn) …(13)
In the memory of the
cGain = LUT3 (cGainIn) (13)
次に、制御装置104は、対象画素のY1およびC1と第1の傾きpdy1と彩度補正ゲインcGainとに基づいて、次式(14)により、彩度が補正されたY2を算出する。また制御装置104は、次式(15)〜(16)により、対象画素のCb1Cr1に対して、それぞれ彩度補正ゲインcGainを乗算することで、彩度が補正されたCb2Cr2を算出する。
Y2 = Y1 - C1 * (cGain-1) * pDy1 …(14)
Cb2 = Cb1 * cGain …(15)
Cr2 = Cr1 * cGain …(16)
Next, based on Y 1 and C 1 of the target pixel, the
Y 2 = Y 1 - C 1 * (cGain-1) * pDy1 ... (14)
Cb 2 = Cb 1 * cGain (15)
Cr 2 = Cr 1 * cGain (16)
この結果、第4の直線L4上において補正対象色点Tpが交点P4Yと交点P42との間にある場合は、交点P4Yと交点P42との間で第4の直線L4に沿って補正が行われる。これにより、出力色空間の色域内の画素について、色域内で彩度補正を行うことができる。したがって、出力色空間の色域内の画素が色域外に変換されることがないので、出力色空間に変換した時に出力色空間の色域境界値にクリップされて色相回転が生じるという不具合を防止することができる。 As a result, if the correction target color point Tp on a fourth straight line L4 is between the intersection point P 4Y and the intersection P 42 is between the intersection point P 4Y and the intersection P 42 along a fourth straight line L4 Correction is performed. Thereby, it is possible to perform saturation correction within the color gamut for the pixels within the color gamut of the output color space. Therefore, since the pixels in the color gamut of the output color space are not converted out of the color gamut, it is possible to prevent a problem that hue rotation occurs due to clipping to the color gamut boundary value of the output color space when converted to the output color space. be able to.
また、第2の傾きpDy2を用いて彩度補正パラメータcGainInを算出し、ルックアップテーブルLUT3の入力値としたので、処理負荷の重い除算処理を行わなくても、出力色空間の色域形状に応じてルックアップテーブルLUT3の入力値を正規化することができ、色相によらずに1つの彩度カーブを用いて彩度補正を行うことができる。 In addition, the saturation correction parameter cGainIn is calculated using the second slope pDy2 and is used as the input value of the lookup table LUT3, so that the color gamut shape of the output color space can be obtained without performing heavy division processing. Accordingly, the input value of the lookup table LUT3 can be normalized, and the saturation correction can be performed using one saturation curve regardless of the hue.
以上のように制御装置104は、YCbCr画像データの各画素に対して上記彩度補正を行うと、ステップS7へ進む。
As described above, when the
ステップS7において制御装置104は、ガマットマッピングのレベル(すなわち色域の圧縮度合い)を設定して、ステップS8へ進む。具体的に制御装置104は、ステップS5およびS6で算出した階調補正パラメータyGainInおよび彩度補正パラメータcGainInのヒストグラムを作成し、このヒストグラムから、yGainIn>1またはcGainIn>1となる(すなわち出力色空間の色域外である)画素数の分布を求める。そして、この出力色空間の色域外である画素数の分布に応じてガマットマッピングレベルを設定する。例えば、出力色空間の色域外である画素数が多いほど、ガマットマッピングレベルを大きく設定し、出力色空間の色域外である画素数が少ないほど、ガマットマッピングレベルを小さく設定する。
In step S7, the
なお、ガマットマッピングレベルは、ユーザにより設定された色再現モード(彩度強調モード、または、彩度は強調せず階調感を重視する階調感重視モードなど)に応じて調整してもよい。例えば、階調を残すより高彩度で飽和気味でも全体の彩度感を重視する彩度強調モードの場合には、ガマットマッピングレベルを最低(すなわちガマットマッピングを行わない)に設定し、階調感重視モードの場合には、ガマットマッピングレベルを上記ヒストグラムに応じて設定する。 Note that the gamut mapping level may be adjusted according to a color reproduction mode (saturation emphasis mode or tone emphasis mode that emphasizes tone without emphasizing saturation) set by the user. . For example, in the saturation enhancement mode that emphasizes the overall saturation even if it is saturated and saturated rather than leaving the gradation, the gamut mapping level is set to the lowest (that is, gamut mapping is not performed) and the gradation is emphasized. In the mode, the gamut mapping level is set according to the histogram.
ステップS8において制御装置104は、ステップS7で設定したガマットマッピングレベルに応じて、色域を圧縮するための色域圧縮カーブを選択する。なお、色域圧縮カーブは、色域圧縮前の値と色域圧縮後の値との関係を示す曲線であり、種々のガマットマッピングレベルに応じて複数用意されている。制御装置104は、当該選択した色域圧縮カーブを用いて、ステップS6の彩度補正後のYCbCr画像データの色域を圧縮変換し、ステップS9へ進む。
In step S8, the
ステップS9において制御装置104は、ステップS8のガマットマッピング後のYCbCr画像データを、公知の変換式を用いて出力色空間(ここではsRGB空間)の値へ変換して、ステップS10へ進む。
In step S9, the
ステップS10において制御装置104は、ステップS9で出力色空間に変換した画像データを、出力ファイルフォーマットに従ってエンコーディングを行い、メモリカードスロット105に挿入されているメモリカードへ記録して、図5の処理を終了する。
In step S10, the
以上説明した実施形態によれば、次の作用効果が得られる。
(1)デジタルカメラ100は、輝度色差分離空間(YCC空間)における補正対象色を含む等色相面において、白色点Wpおよび最大彩度点Cpを通る第1の直線L1の傾きpdy1を取得する制御装置104と、補正対象色の輝度および彩度を補正するための補正値を出力するルックアップテーブルLUT2の入力値(階調補正パラメータyGainIn)を、補正対象色の輝度および、彩度または色差と第1の直線L1の傾きpdy1とに基づいて算出する制御装置104と、入力値をルックアップテーブルLUT2へ入力して補正値(階調補正ゲインyGain)を取得する制御装置104と、補正値に基づいて、補正対象色の輝度および、彩度または色差の少なくとも一方を補正する制御装置104と、を備える。これにより、出力色空間の色域形状に応じて補正対象色を補正することができるので、出力色空間の色域内にある色を色域外に補正してしまうことを防止することができる。
According to the embodiment described above, the following operational effects can be obtained.
(1) The
(2)上記(1)のデジタルカメラ100において、補正対象色は、上記補正により、補正対象色を含む等色相面において黒色点Bpと補正対象色点Tpとを通る第3の直線L3に沿って輝度および彩度が変化するように補正されるように構成した。これにより、例えば赤や青などの輝度が低い高彩度色について暗く補正されることなく適切に階調を補正できる。
(2) In the
(3)上記(2)のデジタルカメラ100において、制御装置104は、補正対象色の輝度および、色差または彩度と第1の直線L1の傾きpdy1とに基づいて、第3の直線L3を軸とする階調補正座標系における補正対象色点Tpの座標値(階調補正パラメータyGainIn)を算出し、ルックアップテーブルLUT2の入力値とするように構成した。これにより、処理負荷をかけずに出力色空間の色域形状に応じて補正することができる。
(3) In the
(4)上記(3)のデジタルカメラ100において、ルックアップテーブルLUT2が出力する補正値(階調補正ゲインyGain)は、補正前の輝度に対する補正後の輝度の比であり、制御装置104は、補正対象色の輝度および、色差または彩度の少なくとも一方のそれぞれに対して補正値を乗算することにより、補正対象色の輝度および、色差または彩度の少なくとも一方を補正するように構成した。これにより、用いるルックアップテーブルLUT2が1つでよいので、補正後の輝度および、色差または彩度の少なくとも一方をそれぞれ出力する複数のルックアップテーブルを用いる場合と比較して、メモリの容量を節約することができる。
(4) In the
(5)上記(4)のデジタルカメラ100において、階調補正座標系では、第1の直線L1と第3の直線L3との交点P31の座標値が基準値(1)であり、且つ黒色点Bpから交点P31に向かう方向に座標値が大きくなり、ルックアップテーブルLUT2では、入力値が基準値(1)以下である場合には、入力値(Input)に補正値(yGain)を乗算した値(Output)が基準値(1)以下となるように、入力値と補正値とが対応付けられているように構成した。これにより、出力色空間の色域内にある色を色域内で補正することができる。
(5) in the
(6)上記(1)〜(5)のデジタルカメラ100において、少なくとも3色相以上の色相における第1の直線L1の傾きpdy1を記憶するメモリをさらに備え、制御装置104は、メモリに記憶された第1の直線L1の傾きpdy1からの補間により、補正対象色の色相における第1の直線L1の傾きpdy1を取得するように構成した。このように、少なくとも3色相における第1の直線の傾きpdy1を記憶すればよいので、多数の色相における第1の直線の傾きpdy1を記憶する場合と比較してメモリの容量を節約することができる。
(6) In the
(7)デジタルカメラ100は、輝度色差分離空間(YCC空間)における補正対象色を含む等色相面において、白色点Wpおよび最大彩度点Cpを通る第1の直線L1の傾きpdy1と、黒色点Bpおよび最大彩度点Wpを通る第2の直線L2の傾きpdy2とを取得する制御装置104と、補正対象色の輝度および彩度を補正するための補正値を出力するルックアップテーブルLUT3の入力値(彩度補正パラメータcGainIn)を、補正対象色の輝度および、彩度または色差と第2の直線L2の傾きpdy2とに基づいて算出する制御装置104と、入力値cGainInをルックアップテーブルLUT3へ入力して補正値(彩度補正ゲインcGain)を取得する制御装置104と、補正値cGainと第1の直線の傾きpdy1とに基づいて、補正対象色の輝度および、彩度または色差の少なくとも一方を補正する制御装置104と、を備える。これにより、出力色空間の色域形状に応じて補正対象色を補正することができるので、出力色空間の色域内にある色を色域外に補正してしまうことを防止することができる。
(7) The
(8)上記(7)のデジタルカメラ100において、補正対象色は、上記補正により、補正対象色を含む等色相面において補正対象色点Tpを通り且つ第1の直線L1と平行である第4の直線L4に沿って輝度および彩度が変化するように補正されるように構成した。これにより、出力色空間の色域内にある色を色域外に補正することなく、彩度補正を行うことができる。
(8) In the
(9)上記(8)のデジタルカメラ100において、制御装置104は、補正対象色の輝度および、彩度または色差と第2の直線の傾きpdy2とに基づいて、第4の直線L4を軸とする彩度補正座標系における補正対象色点Tpの座標値を算出し、ルックアップテーブルLUT3の入力値とするように構成した。これにより、処理負荷をかけずに出力色空間の色域形状に応じて補正することができる。
(9) In the
(10)上記(9)のデジタルカメラ100において、ルックアップテーブルLUT3が出力する補正値(彩度補正ゲインcGain)は、補正前の彩度に対する補正後の彩度の比であり、制御装置104は、補正対象色の彩度または色差の少なくとも一方に対して補正値cGainを乗算することにより補正対象色の彩度または色差の少なくとも一方を補正し、補正値cGainと第1の直線の傾きpdy1とに基づいて補正対象色の輝度を補正するように構成した。これにより、用いるルックアップテーブルLUT3が1つでよいので、補正後の輝度および、彩度または色差の少なくとも一方をそれぞれ出力する複数のルックアップテーブルを用いる場合と比較して、メモリの容量を節約することができる。
(10) In the
(11)上記(10)のデジタルカメラ100において、彩度補正座標系では、第2の直線L2と第4の直線L4との交点P42の座標値が基準値(1)であり、且つ黒色点Bpおよび白色点Wpを通る第5の直線(輝度軸)と第4の直線L4との交点4Yから、第2の直線L2と第4の直線L4との交点P42へ向かう方向に座標値が大きくなり、ルックアップテーブルLUT3では、入力値が基準値(1)以下である場合には、入力値(input)に補正値cGainを乗算した値(output)が基準値(1)以下となるように、入力値と補正値とが対応付けられているように構成した。これにより、出力色空間の色域内にある色を色域内で補正することができる。
(11) in the
(12)上記(7)〜(11)のデジタルカメラ100において、少なくとも3色相以上の色相における第1の直線L1の傾きpdy1と第2の直線L2の傾きpdy2とを記憶するメモリをさらに備え、制御装置104は、メモリに記憶された第1の直線L1の傾きpdy1および第2の直線L2の傾きpdy2からの補間により、補正対象色の色相における第1の直線L1の傾きpdy1および第2の直線L2の傾きpdy2を取得するように構成した。このように、少なくとも3色相における第1および第2直線の傾きpdy1およびpdy2を記憶すればよいので、多数の色相における第1および第2の直線の傾きpdy1およびpdy2を記憶する場合と比較してメモリの容量を節約することができる。
(12) The
(変形例1)
上述した実施の形態では、出力色空間としてsRGB空間を用いる例について説明した。しかしながら、出力色空間として、AdobeRGBやその他の多原色色空間を用いるようにしてもよい。
(Modification 1)
In the above-described embodiment, the example in which the sRGB space is used as the output color space has been described. However, Adobe RGB or other multi-primary color space may be used as the output color space.
(変形例2)
上述した実施の形態では、階調補正および彩度補正を行う色空間としてYCC空間を用いる例について説明した。しかしながら、階調補正および彩度補正を行う色空間として、CIELAB空間やHSV空間など、その他の輝度色差(彩度)分離空間を用いるようにしてもよい。
(Modification 2)
In the above-described embodiment, the example in which the YCC space is used as the color space for performing gradation correction and saturation correction has been described. However, other color-chrominance (saturation) separation spaces such as CIELAB space and HSV space may be used as the color space for gradation correction and saturation correction.
(変形例3)
上述した実施の形態の画像処理では、上記階調補正および上記彩度補正を両方実行する例について説明したが、上記階調補正または上記彩度補正のいずれかを実行するようにしてもよい。
(Modification 3)
In the image processing of the above-described embodiment, an example in which both the gradation correction and the saturation correction are executed has been described. However, either the gradation correction or the saturation correction may be executed.
(変形例4)
上述した実施の形態では、デジタルカメラ100に画像処理装置を搭載する例を説明したが、画像処理装置をパーソナルコンピュータによって構成するようにしてもよい。また図8に示すパーソナルコンピュータ200に図5に例示したフローチャートの処理を行うプログラムを実行させることにより、画像処理装置を構成してもよい。プログラムをパーソナルコンピュータ200に取込んで使用する場合には、パーソナルコンピュータ200のデータストレージ装置にプログラムをローディングした上で、当該プログラムを実行させることによって画像処理装置として使用する。
(Modification 4)
In the above-described embodiment, the example in which the image processing apparatus is mounted on the
パーソナルコンピュータ200に対するプログラムのローディングは、プログラムを格納したCD−ROMなどの記憶媒体201をパーソナルコンピュータ200にセットして行ってもよいし、ネットワークなどの通信回線202を経由する方法でパーソナルコンピュータ200へローディングしてもよい。通信回線202を経由する場合は、通信回線202に接続されたサーバー(コンピュータ)203のハードディスク装置204などにプログラムを格納しておく。プログラムは、記憶媒体201や通信回線202を介する提供など、種々の形態のコンピュータプログラム製品として供給することができる。
The loading of the program to the
なお、パーソナルコンピュータ200が処理対象として入力する(ステップS1)RGB画像は、いわゆるRAWデータ(すなわち、撮像素子102の受光光量に対して線形階調のRGB画像)である。 Note that the RGB image input as a processing target by the personal computer 200 (step S1) is so-called RAW data (that is, an RGB image having a linear gradation with respect to the amount of light received by the image sensor 102).
以上の説明はあくまで一例であり、上記の実施形態の構成に何ら限定されるものではない。また、上記実施形態に各変形例の構成を適宜組み合わせてもかまわない。 The above description is merely an example, and is not limited to the configuration of the above embodiment. Moreover, you may combine the structure of each modification suitably with the said embodiment.
100…デジタルカメラ、101…操作部材、102…撮像レンズ、103…撮像素子、104…制御装置、105…メモリカードスロット、106…モニタ
DESCRIPTION OF
Claims (17)
前記補正対象色の輝度および彩度を補正するための補正値を出力するルックアップテーブルの入力値を、前記補正対象色の輝度および、彩度または色差と前記第1の直線の傾きとに基づいて算出する入力値算出手段と、
前記入力値を前記ルックアップテーブルへ入力して前記補正値を取得する補正値取得手段と、
前記補正値に基づいて、前記補正対象色の輝度および、彩度または色差の少なくとも一方を補正する補正手段と、
を備えることを特徴とする画像処理装置。 Inclination acquisition means for acquiring the inclination of the first straight line passing through the white point and the maximum saturation point on the equal hue plane including the correction target color in the luminance / chrominance separation space;
The input value of the lookup table that outputs the correction value for correcting the luminance and saturation of the correction target color is based on the luminance of the correction target color, the saturation or the color difference, and the slope of the first straight line. Input value calculating means for calculating
Correction value acquisition means for inputting the input value to the lookup table and acquiring the correction value;
Correction means for correcting at least one of luminance and saturation or color difference of the correction target color based on the correction value;
An image processing apparatus comprising:
前記補正対象色は、前記補正により、前記補正対象色を含む等色相面において黒色点と前記補正対象色点とを通る第3の直線に沿って輝度および彩度が変化するように補正されることを特徴とする画像処理装置。 The image processing apparatus according to claim 1.
The correction target color is corrected by the correction so that the luminance and the saturation change along a third straight line passing through the black point and the correction target color point on the equal hue plane including the correction target color. An image processing apparatus.
前記入力値算出手段は、前記補正対象色の輝度および、彩度または色差と前記第1の直線の傾きとに基づいて、前記第3の直線を軸とする補正座標系における前記補正対象色点の座標値を算出し、当該座標値を、前記ルックアップテーブルの入力値とすることを特徴とする画像処理装置。 The image processing apparatus according to claim 2,
The input value calculating means is configured to determine the correction target color point in a correction coordinate system having the third straight line as an axis based on the luminance and saturation or color difference of the correction target color and the slope of the first straight line. The image processing apparatus is characterized in that the coordinate value is calculated, and the coordinate value is used as an input value of the lookup table.
前記ルックアップテーブルが出力する前記補正値は、前記補正前の輝度に対する前記補正後の輝度の比であり、
前記補正手段は、前記補正対象色の輝度および、彩度または色差の少なくとも一方のそれぞれに対して前記補正値を乗算することにより、前記補正対象色の輝度および、彩度または色差の少なくとも一方を補正することを特徴とする画像処理装置。 The image processing apparatus according to claim 3.
The correction value output by the lookup table is a ratio of the luminance after correction to the luminance before correction,
The correction unit multiplies at least one of luminance and saturation or color difference of the correction target color by the correction value, thereby obtaining at least one of luminance and saturation or color difference of the correction target color. An image processing apparatus that performs correction.
前記補正座標系では、前記第1の直線と前記第3の直線との交点の座標値が基準値であり、且つ前記黒色点から前記交点に向かう方向に座標値が大きくなり、
前記ルックアップテーブルでは、前記入力値が前記基準値以下である場合には、前記入力値に前記補正値を乗算した値が前記基準値以下となるように、前記入力値と前記補正値とが対応付けられていることを特徴とする画像処理装置。 The image processing apparatus according to claim 4.
In the correction coordinate system, the coordinate value of the intersection of the first straight line and the third straight line is a reference value, and the coordinate value increases in the direction from the black point toward the intersection,
In the lookup table, when the input value is equal to or less than the reference value, the input value and the correction value are set such that a value obtained by multiplying the input value by the correction value is equal to or less than the reference value. An image processing apparatus characterized by being associated with each other.
少なくとも3色相以上の色相における第1の直線の傾きを記憶する記憶手段をさらに備え、
前記傾き取得手段は、前記記憶手段に記憶された第1の直線の傾きからの補間により、前記補正対象色の色相における第1の直線の傾きを取得することを特徴とする画像処理装置。 In the image processing device according to any one of claims 1 to 5,
Storage means for storing the slope of the first straight line in a hue of at least three or more hues;
The image processing apparatus according to claim 1, wherein the inclination acquisition unit acquires the inclination of the first straight line in the hue of the correction target color by interpolation from the inclination of the first straight line stored in the storage unit.
前記補正対象色の輝度および彩度を補正するための補正値を出力するルックアップテーブルの入力値を、前記補正対象色の輝度および、彩度または色差と前記第2の直線の傾きとに基づいて算出する入力値算出手段と、
前記入力値を前記ルックアップテーブルへ入力して前記補正値を取得する補正値取得手段と、
前記補正値と前記第1の直線の傾きとに基づいて、前記補正対象色の輝度および、彩度または色差の少なくとも一方を補正する補正手段と、
を備えることを特徴とする画像処理装置。 In the equal hue plane including the color to be corrected in the luminance / chrominance separation space, the slope of the first straight line passing through the white point and the maximum saturation point and the slope of the second straight line passing through the black point and the maximum saturation point are calculated. An inclination acquisition means to acquire;
The input value of the look-up table that outputs correction values for correcting the luminance and saturation of the correction target color is based on the luminance of the correction target color and the saturation or color difference and the slope of the second straight line. Input value calculating means for calculating
Correction value acquisition means for inputting the input value to the lookup table and acquiring the correction value;
Correction means for correcting at least one of luminance and saturation or color difference of the correction target color based on the correction value and the slope of the first straight line;
An image processing apparatus comprising:
前記補正対象色は、前記補正により、前記補正対象色を含む等色相面において前記補正対象色点を通り且つ前記第1の直線と平行である第4の直線に沿って輝度および彩度が変化するように補正されることを特徴とする画像処理装置。 The image processing apparatus according to claim 7.
The correction target color changes in luminance and saturation along a fourth straight line that passes through the correction target color point and is parallel to the first straight line on the equal hue plane including the correction target color due to the correction. An image processing apparatus which is corrected so as to perform.
前記入力値算出手段は、前記補正対象色の輝度および、彩度または色差と前記第2の直線の傾きとに基づいて、前記第4の直線を軸とする補正座標系における前記補正対象色点の座標値を算出し、当該座標値を前記ルックアップテーブルの入力値とすることを特徴とする画像処理装置。 The image processing apparatus according to claim 8.
The input value calculating means is configured to determine the correction target color point in a correction coordinate system having the fourth straight line as an axis based on the luminance and saturation or color difference of the correction target color and the slope of the second straight line. An image processing apparatus characterized in that the coordinate value is calculated and the coordinate value is used as an input value of the lookup table.
前記ルックアップテーブルが出力する前記補正値は、前記補正前の彩度に対する前記補正後の彩度の比であり、
前記補正手段は、前記補正対象色の彩度または色差の少なくとも一方に対して前記補正値を乗算することにより前記補正対象色の彩度または色差の少なくとも一方を補正し、前記補正値と前記第1の直線の傾きとに基づいて前記補正対象色の輝度を補正することを特徴とする画像処理装置。 The image processing apparatus according to claim 9.
The correction value output by the lookup table is a ratio of the saturation after the correction to the saturation before the correction,
The correction unit corrects at least one of saturation or color difference of the correction target color by multiplying at least one of saturation or color difference of the correction target color by the correction value, and corrects the correction value and the first difference. An image processing apparatus that corrects the luminance of the correction target color based on the slope of one straight line.
前記補正座標系では、前記第2の直線と前記第4の直線との交点の座標値が基準値であり、且つ前記黒色点および前記白色点を通る第5の直線と前記第4の直線との交点から、前記第2の直線と前記第4の直線との交点へ向かう方向に座標値が大きくなり、
前記ルックアップテーブルでは、前記入力値が前記基準値以下である場合には、前記入力値に前記補正値を乗算した値が前記基準値以下となるように、前記入力値と前記補正値とが対応付けられていることを特徴とする画像処理装置。 The image processing apparatus according to claim 10.
In the correction coordinate system, the coordinate value of the intersection of the second straight line and the fourth straight line is a reference value, and the fifth straight line passing through the black point and the white point and the fourth straight line The coordinate value increases in the direction from the intersection point to the intersection point of the second straight line and the fourth straight line,
In the lookup table, when the input value is equal to or less than the reference value, the input value and the correction value are set such that a value obtained by multiplying the input value by the correction value is equal to or less than the reference value. An image processing apparatus characterized by being associated with each other.
少なくとも3色相以上の色相における第1の直線の傾きと第2の直線の傾きとを記憶する記憶手段をさらに備え、
前記傾き取得手段は、前記記憶手段に記憶された第1の直線の傾きおよび第2の直線の傾きからの補間により、前記補正対象色の色相における第1の直線の傾きおよび第2の直線の傾きを取得することを特徴とする画像処理装置。 The image processing apparatus according to any one of claims 7 to 11,
Storage means for storing the slope of the first straight line and the slope of the second straight line in hues of at least three hues or more;
The inclination acquisition means interpolates from the inclination of the first straight line and the inclination of the second straight line stored in the storage means, and the inclination of the first straight line and the second straight line in the hue of the correction target color. An image processing apparatus characterized by acquiring an inclination.
請求項7〜12のいずれか一項に記載の画像処理装置と、
を備えることを特徴とする画像処理装置。 The image processing apparatus according to any one of claims 1 to 6,
An image processing apparatus according to any one of claims 7 to 12,
An image processing apparatus comprising:
請求項1〜13のいずれか一項に記載の画像処理装置と、
を備え、
前記画像処理装置は、前記撮像手段により撮像された画像に対して前記補正処理を行うことを特徴とするデジタルカメラ。 Imaging means for capturing a subject image;
The image processing apparatus according to any one of claims 1 to 13,
With
The digital processing apparatus, wherein the image processing apparatus performs the correction process on an image captured by the imaging unit.
前記補正対象色の輝度および彩度を補正するための補正値を出力するルックアップテーブルの入力値を、前記補正対象色の輝度および、彩度または色差と前記第1の直線の傾きとに基づいて算出する入力値算出工程と、
前記入力値を前記ルックアップテーブルへ入力して前記補正値を取得する補正値取得工程と、
前記補正値に基づいて、前記補正対象色の輝度および、彩度または色差の少なくとも一方を補正する補正工程と、
を有することを特徴とする画像処理方法。 An inclination acquisition step of acquiring an inclination of a first straight line passing through the white point and the maximum saturation point in the equal hue plane including the correction target color in the luminance color difference separation space;
The input value of the lookup table that outputs the correction value for correcting the luminance and saturation of the correction target color is based on the luminance of the correction target color, the saturation or the color difference, and the slope of the first straight line. An input value calculating step for calculating
A correction value obtaining step of obtaining the correction value by inputting the input value to the lookup table;
A correction step of correcting at least one of luminance and saturation or color difference of the correction target color based on the correction value;
An image processing method comprising:
前記補正対象色の輝度および彩度を補正するための補正値を出力するルックアップテーブルの入力値を、前記補正対象色の輝度および、彩度または色差と前記第2の直線の傾きとに基づいて算出する入力値算出工程と、
前記入力値を前記ルックアップテーブルへ入力して前記補正値を取得する補正値取得工程と、
前記補正値と前記第1の直線の傾きとに基づいて、前記補正対象色の輝度および、彩度または色差の少なくとも一方を補正する補正工程と、
を有することを特徴とする画像処理方法。 In the equal hue plane including the color to be corrected in the luminance / chrominance separation space, the slope of the first straight line passing through the white point and the maximum saturation point and the slope of the second straight line passing through the black point and the maximum saturation point are calculated. An inclination acquisition step to acquire;
The input value of the look-up table that outputs correction values for correcting the luminance and saturation of the correction target color is based on the luminance of the correction target color and the saturation or color difference and the slope of the second straight line. An input value calculating step for calculating
A correction value obtaining step of obtaining the correction value by inputting the input value to the lookup table;
A correction step of correcting at least one of luminance and saturation or color difference of the correction target color based on the correction value and the slope of the first straight line;
An image processing method comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012171357A JP2014033272A (en) | 2012-08-01 | 2012-08-01 | Image processing apparatus, digital camera, image processing program, and image processing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012171357A JP2014033272A (en) | 2012-08-01 | 2012-08-01 | Image processing apparatus, digital camera, image processing program, and image processing method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2014033272A true JP2014033272A (en) | 2014-02-20 |
Family
ID=50282800
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012171357A Pending JP2014033272A (en) | 2012-08-01 | 2012-08-01 | Image processing apparatus, digital camera, image processing program, and image processing method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2014033272A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115330607A (en) * | 2022-07-11 | 2022-11-11 | 内蒙古工业大学 | Saturation enhancement method for color image |
-
2012
- 2012-08-01 JP JP2012171357A patent/JP2014033272A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115330607A (en) * | 2022-07-11 | 2022-11-11 | 内蒙古工业大学 | Saturation enhancement method for color image |
CN115330607B (en) * | 2022-07-11 | 2024-03-01 | 内蒙古工业大学 | Saturation enhancement method for color image |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8363125B2 (en) | Image processing apparatus, image processing method, and computer program product | |
US8103119B2 (en) | Image processing device, image processing method, image processing program product, and image-capturing device | |
US9142187B2 (en) | Semiconductor device, image processing system, and program | |
JP2007094742A (en) | Image signal processor and image signal processing program | |
JP4687673B2 (en) | Monotone processing of color image | |
KR101927968B1 (en) | METHOD AND DEVICE FOR DISPLAYING IMAGE BASED ON METADATA, AND RECORDING MEDIUM THEREFOR | |
JP2004192614A (en) | Image processing device, image processing method, program and recording medium | |
JP2004312467A (en) | Imaging systems, image processing program | |
JP2006229925A (en) | Dynamic image saturation enhancement apparatus | |
JP2012165204A (en) | Signal processing apparatus, signal processing method, imaging apparatus, and imaging processing method | |
JP2014033273A (en) | Color gamut conversion device, digital camera, color gamut conversion program, and color gamut conversion method | |
US20110181760A1 (en) | Image processing device | |
JP2005354372A (en) | Apparatus and method for image recording device, method and system for image processing | |
JP4001079B2 (en) | Monotone processing of color image | |
JP5664261B2 (en) | Image processing apparatus and image processing program | |
JP2008072551A (en) | Image processing method, image processing apparatus, program and recording medium | |
WO2009093294A1 (en) | Image signal processing device and image signal processing program | |
JP2014033274A (en) | Color gamut conversion device, digital camera, color gamut conversion program, and color gamut conversion method | |
JP4007964B2 (en) | Image processing apparatus, image processing method, and image processing program | |
JP5743456B2 (en) | Image processing apparatus, image processing method, and imaging apparatus | |
JP2014033272A (en) | Image processing apparatus, digital camera, image processing program, and image processing method | |
JP6413210B2 (en) | Image processing apparatus, imaging apparatus, and program | |
KR102160247B1 (en) | Electronic apparatus and Method for controlling the electronic apparatus thereof | |
JP6318497B2 (en) | Image processing apparatus, imaging apparatus, and program | |
JP2014033275A (en) | Color gamut conversion device, digital camera, color gamut conversion program, and color gamut conversion method |