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 PDF

Info

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
Application number
JP2012171357A
Other languages
Japanese (ja)
Inventor
Erika Koishi
えりか 小石
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.)
Nikon Corp
Original Assignee
Nikon Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nikon Corp filed Critical Nikon Corp
Priority to JP2012171357A priority Critical patent/JP2014033272A/en
Publication of JP2014033272A publication Critical patent/JP2014033272A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Color Image Communication Systems (AREA)

Abstract

PROBLEM TO BE SOLVED: To prevent a color inside a color gamut of an output color space from being corrected on the outside of the color gamut.SOLUTION: An image processing apparatus 100 includes: inclination acquisition means for acquiring inclination of a first straight line that passes a white point and a maximum saturation point on an equal hue surface including a correction object color in a luminance color difference separation space; input value calculation means 104 for calculating an input value of a lookup table that outputs a correction value for correcting luminance and saturation of the correction object color on the basis of the luminance and saturation or color difference of the correction object color and the inclination of the first straight line; and correction means 104 for correcting at least one of the luminance and the saturation or the color difference of the correction object color on the basis of the correction value.

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).

特開2000−188768号公報JP 2000-188768 A

画像データを出力する色空間(出力色空間)が例えば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.

本発明の一実施の形態による画像処理装置(デジタルカメラ)の構成例を説明するブロック図である。It is a block diagram explaining the structural example of the image processing apparatus (digital camera) by one embodiment of this invention. 出力色空間の色域形状を説明する図である。It is a figure explaining the color gamut shape of an output color space. 出力色空間の色域形状を説明する図である。It is a figure explaining the color gamut shape of an output color space. 階調カーブを説明する図である。It is a figure explaining a gradation curve. 画像処理の流れを説明するフローチャートである。It is a flowchart explaining the flow of an image process. 階調補正軸を説明する図である。It is a figure explaining a gradation correction axis. 彩度補正軸を説明する図である。It is a figure explaining a saturation correction axis. コンピュータを例示する図である。It is a figure which illustrates a computer.

以下、図面を参照して本発明を実施するための形態について説明する。図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 image processing apparatus 100 according to an embodiment of the present invention. In this embodiment, an example in which a digital camera is used as the image processing apparatus 100 will be described. The digital camera 100 includes an operation member 101, an imaging lens 102, an imaging element 103, a control device 104, a memory card slot 105, and a monitor 106. The operation member 101 includes various input members operated by the user, such as a power button, a release button, a zoom button, a menu button, and the like.

撮像レンズ102は、被写体像を撮像素子103の撮像面に結像するように配置されている。撮像レンズ102は、図1では代表して1枚のレンズで表しているが、実際は複数の光学レンズから構成される。   The imaging lens 102 is disposed so as to form a subject image on the imaging surface of the imaging element 103. The imaging lens 102 is represented by a single lens in FIG. 1 as a representative, but actually includes a plurality of optical lenses.

撮像素子103は、例えばCMOSイメージセンサなどによって構成される。撮像素子103は、撮像レンズ102で結像される被写体像を撮像し、得られた画像信号を制御装置104へ出力する。撮像素子103には、R(赤)、G(緑)、B(青)がBayer配列されたカラーフィルタが形成されている。このため、デジタルカメラ100で取得される画像の色は、機器依存のRGB表色系で表される。   The image sensor 103 is configured by, for example, a CMOS image sensor. The image sensor 103 captures a subject image formed by the imaging lens 102 and outputs the obtained image signal to the control device 104. The image sensor 103 is formed with a color filter in which R (red), G (green), and B (blue) are arranged in a Bayer array. For this reason, the color of the image acquired by the digital camera 100 is represented by a device-dependent RGB color system.

制御装置104は、CPU、メモリ、およびその他の周辺回路により構成され、デジタルカメラ100が行う撮影動作を制御する。制御装置104を構成するメモリには、SDRAMやフラッシュメモリが含まれる。SDRAMは揮発性のメモリであって、制御装置104がプログラム実行時にプログラムを展開するためのワークメモリとして使用される。また、SDRAMは、データを一時的に記憶するためのバッファメモリとしても使用される。一方、フラッシュメモリは不揮発性のメモリであって、制御装置104が実行するプログラムや、プログラム実行時に読込まれる種々のパラメータなどを記憶する。   The control device 104 includes a CPU, a memory, and other peripheral circuits, and controls a shooting operation performed by the digital camera 100. Memory constituting the control device 104 includes SDRAM and flash memory. The SDRAM is a volatile memory, and is used as a work memory for the control device 104 to expand a program when the program is executed. The SDRAM is also used as a buffer memory for temporarily storing data. On the other hand, the flash memory is a non-volatile memory, and stores a program executed by the control device 104, various parameters read when the program is executed, and the like.

メモリカードスロット105は、記憶媒体としてのメモリカードを挿入するためのスロットである。制御装置104は、撮影処理を行うことによって生成した画像ファイルを、メモリカードスロット105に挿入されているメモリカードへ書込んで記録する。また、制御装置104は、メモリカードスロット105に挿入されているメモリカード内に記録されている画像ファイルを読込む。   The memory card slot 105 is a slot for inserting a memory card as a storage medium. The control device 104 writes and records the image file generated by performing the photographing process on the memory card inserted in the memory card slot 105. Further, the control device 104 reads an image file recorded in a memory card inserted in the memory card slot 105.

モニタ106は、デジタルカメラ100の背面に搭載された液晶モニタ(いわゆる背面モニタ)である。当該モニタ106には、メモリカードに記録されている画像ファイルに基づく再生画像や、デジタルカメラ100を設定するための設定メニューなどが表示される。また、使用者が操作部材101を操作してデジタルカメラ100を、背面液晶を使用する撮影モードに設定すると、制御装置104は、撮像素子103から時系列で取得した画像の表示用画像データをモニタ106に出力する。これにより、モニタ106にスルー画を表示することもできる。   The monitor 106 is a liquid crystal monitor (so-called rear monitor) mounted on the back of the digital camera 100. The monitor 106 displays a reproduction image based on the image file recorded on the memory card, a setting menu for setting the digital camera 100, and the like. When the user operates the operation member 101 to set the digital camera 100 to a shooting mode using the rear liquid crystal, the control device 104 monitors image data for display of images acquired from the image sensor 103 in time series. It outputs to 106. Thereby, the through image can be displayed on the monitor 106.

ところで、人間の明るさの知覚に近い色空間として、輝度色差分離空間である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 digital camera 100 of the present embodiment, gradation correction and saturation correction are performed while preventing the above-described problems. Hereinafter, such gradation correction and saturation correction will be specifically described. FIG. 5 is a flowchart for explaining the flow of image processing including gradation correction and saturation correction in the present embodiment. This image processing is processing executed by the control device 104 in accordance with an image processing program stored in the memory of the control device 104.

図5のステップS1において、制御装置104は、撮像素子103から読み出されたRGB画像データを取得する。そして制御装置104は、このRGB画像データに対して、補間、ホワイトバランス、ノイズ除去などの処理を施して、ステップS2へ進む。   In step S <b> 1 of FIG. 5, the control device 104 acquires RGB image data read from the image sensor 103. Then, the control device 104 performs processing such as interpolation, white balance, and noise removal on the RGB image data, and proceeds to step S2.

ステップS2において制御装置104は、ステップS1で処理が施されたRGB画像データを、撮像素子103固有のRGB空間から、階調補正および彩度補正を行うための色空間であるYCC空間に変換して、ステップS3へ進む。この変換は、画像を出力する色空間(出力色空間)として例えばsRGB空間を利用する場合、以下の式(1)〜(3)により行われる。なお、以下の式(1)〜(3)において、(R,G,B)は、式(1)の入力値(上記RGB画像データ)である。(R,G,B)は、式(1)の出力値且つ式(2)の入力値である。(R,G,B)は、式(2)の出力値且つ式(3)の入力値である。(Y,Cb,Cr)は、式(3)の出力値である。また、MRGB2XYZは、撮像素子103固有のRGB空間からXYZ空間(例えばCIE 1964 XYZ)へ変換するための変換マトリックスであり、撮像素子103の分光感度特性や撮影時の照明条件などに基づいて決定される。また、MXYZ2sRGBは、XYZ空間からsRGB空間へ変換するための変換マトリックスである。また、LUT1は、標準のsRGB空間におけるγ変換を行うためのルックアップテーブルである。また、MsRGB2YCCは、sRGB空間からYCC空間へ変換するための変換マトリックスである。

Figure 2014033272
Figure 2014033272
Figure 2014033272
In step S2, the control device 104 converts the RGB image data processed in step S1 from the RGB space unique to the image sensor 103 to a YCC space that is a color space for performing gradation correction and saturation correction. Then, the process proceeds to step S3. This conversion is performed by the following formulas (1) to (3) when, for example, an sRGB space is used as a color space (output color space) for outputting an image. In the following formulas (1) to (3), (R, G, B) are input values (the above RGB image data) of formula (1). (R 1 , G 1 , B 1 ) are the output value of Equation (1) and the input value of Equation (2). (R 2 , G 2 , B 2 ) are the output value of Expression (2) and the input value of Expression (3). (Y, Cb, Cr) is the output value of equation (3). M RGB2XYZ is a conversion matrix for converting an RGB space unique to the image sensor 103 to an XYZ space (for example, CIE 1964 XYZ), and is determined based on the spectral sensitivity characteristics of the image sensor 103, illumination conditions at the time of shooting, and the like. Is done. M XYZ2sRGB is a conversion matrix for converting from the XYZ space to the sRGB space. LUT1 is a lookup table for performing γ conversion in a standard sRGB space. M sRGB2YCC is a conversion matrix for converting from the sRGB space to the YCC space.
Figure 2014033272
Figure 2014033272
Figure 2014033272

ステップS3において制御装置104は、ステップS2で変換されたYCbCr画像データにおいて、1画素ごとに色相を算出して、ステップS4へ進む。なお、色相は、例えばCbとCrとの比や、CrまたはCbと、CrおよびCbの絶対値を用いた彩度近似値との比に基づいて算出される。   In step S3, the control device 104 calculates a hue for each pixel in the YCbCr image data converted in step S2, and proceeds to step S4. The hue is calculated based on, for example, a ratio between Cb and Cr, or a ratio between Cr or Cb and a saturation approximation value using absolute values of Cr and Cb.

ステップS4において制御装置104は、YCbCr画像データの1画素ごとに、ステップS3で算出した色相の等色相面における出力色空間(sRGB空間)の色域形状を算出する。   In step S4, the control device 104 calculates the color gamut shape of the output color space (sRGB space) on the equal hue plane of the hue calculated in step S3 for each pixel of the YCbCr image data.

上述したように、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 control device 104, the first inclination pdy1 and the second inclination pdy2 are recorded in advance for at least three colors (for example, red, yellow, and green). Based on the first gradient pdy1 and the second gradient pdy2 for red, yellow, and green recorded in the memory, the control device 104 determines the first gradient pdy1 and the second gradient pdy2 for cyan, blue, and magenta. Can also be sought.

ステップ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 control device 104 calculates the first gradient pdy1 and the second gradient pdy2 in the hue of each pixel of the YCbCr image data, and proceeds to step S5.

ステップS5において制御装置104は、YCbCr画像データに対して階調補正を行う。この階調補正では、輝度(Y)軸に沿って補正するのではなく、図6に示すように、補正を行う画素の色(補正対象色)の等色相面において、補正対象色の輝度および彩度を示す点(補正対象色点)Tpと黒色点Bpとを結ぶ第3の直線L3に沿って輝度および彩度が変化するように補正する。   In step S5, the control device 104 performs tone correction on the YCbCr image data. In this gradation correction, correction is not performed along the luminance (Y) axis, but as shown in FIG. 6, the luminance of the correction target color and the color of the correction target color on the equal hue plane of the color of the pixel to be corrected (correction target color). Correction is performed so that the luminance and saturation change along a third straight line L3 connecting the point (color point to be corrected) Tp indicating the saturation and the black point Bp.

この階調補正について具体的に説明する。なお、以下の説明において、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 control device 104 calculates an approximate value of the saturation C of the target pixel from the Cb value and Cr value of the target pixel according to the following equation (4). The division (/ 4) in equation (4) may correspond using a bit shift.
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 control device 104 calculates the coordinate value of the correction target color point Tp in the coordinate system (hereinafter referred to as the gradation correction coordinate system) about the third straight line L3 as the gradation correction parameter yGainIn. The gradation correction coordinate system, the coordinate values of the black point Bp is 0, the coordinate values of the intersection point P 31 of the third straight line L3 and the first straight line L1 is 1, the intersection point P 31 from the black point Bp It is assumed that the coordinate system is such that the coordinate value increases in the direction toward. Specifically, the control device 104 calculates the gradation correction parameter yGainIn by the following equation (6) using the luminance Y and saturation C of the target pixel and the first gradient pdy1.
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 control device 104 obtains a gradation correction gain yGain. The gradation correction gain yGain is the ratio (Output / Input) of the luminance (Output) after gradation correction to the luminance (Input) before gradation correction. The gradation correction gain yGain is set so that gradation correction is performed using, for example, the S-shaped gradation curve Tc of FIG. 4 described above for Input. The gradation correction gain yGain is set so that Output, which is a value obtained by multiplying Input by the gradation correction gain yGain, is 0 or more and 1 or less when Input is 0 or more and 1 or less. Are converted into the color gamut. Note that when Input is larger than 1, Output may be set to be smaller than 1, so that colors outside the color gamut may be compressed within the color gamut.

制御装置104のメモリには、Inputを入力すると、このように設定された階調補正ゲインyGainを出力するルックアップテーブルLUT2が予め記録されている。制御装置104は、このルックアップテーブルLUT2を用いて、次式(7)により階調補正ゲインyGainを算出する。すなわち、階調補正パラメータyGainInをルックアップテーブルLUT2の入力値として階調補正ゲインyGainを求める。
yGain = LUT2(yGainIn) …(7)
In the memory of the control device 104, when Input is input, a lookup table LUT2 that outputs the gradation correction gain yGain set in this way is recorded in advance. The control device 104 uses the lookup table LUT2 to calculate the gradation correction gain yGain by the following equation (7). That is, the gradation correction gain yGain is obtained using the gradation correction parameter yGainIn as the input value of the lookup table LUT2.
yGain = LUT2 (yGainIn) (7)

次に、制御装置104は、次式(8)〜(11)により、対象画素のYCbCrおよび彩度Cに対して、それぞれ階調補正ゲインyGainを乗算することで、階調が補正されたYCbCrおよび彩度Cを算出する。
Y = Y * yGain …(8)
Cb = Cb * yGain …(9)
Cr = Cr * yGain …(10)
C = C * yGain …(11)
Next, the control device 104 multiplies YCbCr and saturation C of the target pixel by the tone correction gain yGain by the following equations (8) to (11), respectively, thereby correcting the tone. 1 Cb 1 Cr 1 and saturation C 1 are calculated.
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 control device 104 proceeds to step S6.

ステップS6において制御装置104は、ステップS5の階調補正後の画像データ(YCbCr)に対して、彩度補正を行う。この彩度補正では、彩度(C)軸に沿って補正するのではなく、図7に示すように、補正対象色点Tpを通り且つ第1の直線L1に平行である第4の直線L4に沿って輝度および彩度が変化するように補正する。 In step S6, the control device 104 performs saturation correction on the image data (Y 1 Cb 1 Cr 1 ) after the gradation correction in step S5. In this saturation correction, correction is not performed along the saturation (C) axis, but a fourth straight line L4 that passes through the correction target color point Tp and is parallel to the first straight line L1 as shown in FIG. So that the luminance and saturation change along the line.

この彩度補正について具体的に説明する。まず、制御装置104は、第4の直線L4を軸とする座標系(以下、彩度補正座標系と呼ぶ)における補正対象色点Tpの座標値を彩度補正パラメータcGainInとして算出する。この彩度補正座標系では、第2の直線L2と第4の直線L4との交点P42の座標値が1であり、第4の直線L4と輝度(Y)軸(すなわち黒色点Bpと白色点Wpとを通る直線)との交点P4Yから交点P42へ向かう方向に座標-値が大きくなる座標系であるとする。具体的には、制御装置104は、対象画素の輝度Yおよび彩度Cと第2の傾きpdy2とを用いて、次式(12)により、彩度補正パラメータcGainInを算出する。
cGainIn = 1 -Y + pDy2 * C …(12)
This saturation correction will be specifically described. First, the control device 104 calculates the coordinate value of the correction target color point Tp in the coordinate system (hereinafter referred to as the saturation correction coordinate system) with the fourth straight line L4 as an axis as the saturation correction parameter cGainIn. This saturation correction coordinate system, the coordinate values of the intersection point P 42 of the second straight line L2 and the fourth straight line L4 is 1, fourth straight line L4 and the luminance (Y) axis (i.e. black point Bp and white coordinate in a direction from the intersection P 4Y of the straight line) to the intersection point P 42 which passes through the point Wp - value is assumed to be larger coordinate system. Specifically, the control unit 104 uses the luminance Y 1 and chroma C 1 of the target pixel and the second inclination pdy2, the following equation (12), calculates the saturation correction parameter CGainIn.
cGainIn = 1 -Y 1 + pDy2 * C 1 ... (12)

すなわち、補正対象色点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 control device 104 obtains a saturation correction gain cGain. The saturation correction gain cGain is a ratio (Output / Input) of saturation (Output) after saturation correction to saturation (Input) before saturation correction. The saturation correction gain cGain is set so that saturation correction is performed using, for example, an S-shaped saturation curve similar to FIG. 5 described above for Input. The saturation correction gain cGain is set so that Output, which is a value obtained by multiplying Input by the saturation correction gain cGain, is 0 or more and 1 or less when Input is 0 or more and 1 or less. Are converted into the color gamut. Even when Input is larger than 1, by setting Output to be smaller than 1, colors outside the color gamut may be compressed into the color gamut.

制御装置104のメモリには、Inputを入力すると、このように設定された彩度補正ゲインcGainを出力するルックアップテーブルLUT3が予め記録されている。制御装置104は、このルックアップテーブルLUT3を用いて、次式(13)により彩度補正ゲインcGainを算出する。すなわち、彩度補正パラメータcGainInをルックアップテーブルLUT3の入力値として彩度補正ゲインcGainを求める。
cGain = LUT3(cGainIn) …(13)
In the memory of the control device 104, when Input is input, a lookup table LUT3 that outputs the saturation correction gain cGain set in this way is recorded in advance. The control device 104 uses the lookup table LUT3 to calculate the saturation correction gain cGain by the following equation (13). That is, the saturation correction gain cGain is obtained using the saturation correction parameter cGainIn as the input value of the lookup table LUT3.
cGain = LUT3 (cGainIn) (13)

次に、制御装置104は、対象画素のYおよびCと第1の傾きpdy1と彩度補正ゲインcGainとに基づいて、次式(14)により、彩度が補正されたYを算出する。また制御装置104は、次式(15)〜(16)により、対象画素のCbCrに対して、それぞれ彩度補正ゲインcGainを乗算することで、彩度が補正されたCbCrを算出する。
Y = Y - C * (cGain-1) * pDy1 …(14)
Cb = Cb * cGain …(15)
Cr = Cr * cGain …(16)
Next, based on Y 1 and C 1 of the target pixel, the first slope pdy 1, and the saturation correction gain cGain, the control device 104 calculates Y 2 with the saturation corrected by the following equation (14). To do. Further, the control device 104 multiplies Cb 1 Cr 1 of the target pixel by a saturation correction gain cGain by the following equations (15) to (16), thereby correcting Cb 2 Cr 2 whose saturation is corrected. Is calculated.
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 control device 104 performs the saturation correction on each pixel of the YCbCr image data, the process proceeds to step S7.

ステップS7において制御装置104は、ガマットマッピングのレベル(すなわち色域の圧縮度合い)を設定して、ステップS8へ進む。具体的に制御装置104は、ステップS5およびS6で算出した階調補正パラメータyGainInおよび彩度補正パラメータcGainInのヒストグラムを作成し、このヒストグラムから、yGainIn>1またはcGainIn>1となる(すなわち出力色空間の色域外である)画素数の分布を求める。そして、この出力色空間の色域外である画素数の分布に応じてガマットマッピングレベルを設定する。例えば、出力色空間の色域外である画素数が多いほど、ガマットマッピングレベルを大きく設定し、出力色空間の色域外である画素数が少ないほど、ガマットマッピングレベルを小さく設定する。   In step S7, the control device 104 sets the level of gamut mapping (that is, the degree of color gamut compression), and proceeds to step S8. Specifically, the control device 104 creates a histogram of the tone correction parameter yGainIn and the saturation correction parameter cGainIn calculated in steps S5 and S6, and yGainIn> 1 or cGainIn> 1 from this histogram (that is, the output color space). The distribution of the number of pixels (outside the color gamut) is obtained. Then, the gamut mapping level is set according to the distribution of the number of pixels outside the color gamut of the output color space. For example, the larger the number of pixels outside the color gamut of the output color space, the larger the gamut mapping level is set. The smaller the number of pixels outside the color gamut of the output color space, the smaller the gamut mapping level is set.

なお、ガマットマッピングレベルは、ユーザにより設定された色再現モード(彩度強調モード、または、彩度は強調せず階調感を重視する階調感重視モードなど)に応じて調整してもよい。例えば、階調を残すより高彩度で飽和気味でも全体の彩度感を重視する彩度強調モードの場合には、ガマットマッピングレベルを最低(すなわちガマットマッピングを行わない)に設定し、階調感重視モードの場合には、ガマットマッピングレベルを上記ヒストグラムに応じて設定する。   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 control device 104 selects a color gamut compression curve for compressing the color gamut according to the gamut mapping level set in step S7. Note that the color gamut compression curve is a curve showing the relationship between the value before color gamut compression and the value after color gamut compression, and a plurality of color gamut compression curves are prepared according to various gamut mapping levels. Using the selected color gamut compression curve, the control device 104 compresses and converts the color gamut of the YCbCr image data after the saturation correction in step S6, and proceeds to step S9.

ステップS9において制御装置104は、ステップS8のガマットマッピング後のYCbCr画像データを、公知の変換式を用いて出力色空間(ここではsRGB空間)の値へ変換して、ステップS10へ進む。   In step S9, the control device 104 converts the YCbCr image data after the gamut mapping in step S8 into a value in the output color space (here, sRGB space) using a known conversion formula, and proceeds to step S10.

ステップS10において制御装置104は、ステップS9で出力色空間に変換した画像データを、出力ファイルフォーマットに従ってエンコーディングを行い、メモリカードスロット105に挿入されているメモリカードへ記録して、図5の処理を終了する。   In step S10, the control device 104 encodes the image data converted into the output color space in step S9 in accordance with the output file format, records it on the memory card inserted in the memory card slot 105, and performs the processing of FIG. finish.

以上説明した実施形態によれば、次の作用効果が得られる。
(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 digital camera 100 controls to obtain the slope pdy1 of the first straight line L1 passing through the white point Wp and the maximum saturation point Cp on the equal hue plane including the correction target color in the luminance / color difference separation space (YCC space). The input value (tone correction parameter yGainIn) of the device 104 and the look-up table LUT2 that outputs correction values for correcting the luminance and saturation of the correction target color are set as the luminance of the correction target color and the saturation or color difference. A control device 104 that calculates based on the slope pdy1 of the first straight line L1, a control device 104 that inputs an input value to the lookup table LUT2 and obtains a correction value (tone correction gain yGain), and a correction value And a control device 104 that corrects at least one of luminance and saturation or color difference of the color to be corrected. As a result, the correction target color can be corrected according to the color gamut shape of the output color space, so that it is possible to prevent a color within the color gamut of the output color space from being corrected outside the color gamut.

(2)上記(1)のデジタルカメラ100において、補正対象色は、上記補正により、補正対象色を含む等色相面において黒色点Bpと補正対象色点Tpとを通る第3の直線L3に沿って輝度および彩度が変化するように補正されるように構成した。これにより、例えば赤や青などの輝度が低い高彩度色について暗く補正されることなく適切に階調を補正できる。 (2) In the digital camera 100 of (1), the correction target color is along the third straight line L3 passing through the black point Bp and the correction target color point Tp on the equal hue plane including the correction target color by the correction. The brightness and the saturation are corrected so as to change. As a result, for example, a high-saturation color with a low luminance such as red or blue can be corrected appropriately without dark correction.

(3)上記(2)のデジタルカメラ100において、制御装置104は、補正対象色の輝度および、色差または彩度と第1の直線L1の傾きpdy1とに基づいて、第3の直線L3を軸とする階調補正座標系における補正対象色点Tpの座標値(階調補正パラメータyGainIn)を算出し、ルックアップテーブルLUT2の入力値とするように構成した。これにより、処理負荷をかけずに出力色空間の色域形状に応じて補正することができる。 (3) In the digital camera 100 of the above (2), the control device 104 sets the third straight line L3 as an axis based on the brightness of the color to be corrected, the color difference or saturation, and the inclination pdy1 of the first straight line L1. The coordinate value (gradation correction parameter yGainIn) of the correction target color point Tp in the gradation correction coordinate system is calculated and used as the input value of the lookup table LUT2. Thereby, it can correct | amend according to the color gamut shape of output color space, without applying processing load.

(4)上記(3)のデジタルカメラ100において、ルックアップテーブルLUT2が出力する補正値(階調補正ゲインyGain)は、補正前の輝度に対する補正後の輝度の比であり、制御装置104は、補正対象色の輝度および、色差または彩度の少なくとも一方のそれぞれに対して補正値を乗算することにより、補正対象色の輝度および、色差または彩度の少なくとも一方を補正するように構成した。これにより、用いるルックアップテーブルLUT2が1つでよいので、補正後の輝度および、色差または彩度の少なくとも一方をそれぞれ出力する複数のルックアップテーブルを用いる場合と比較して、メモリの容量を節約することができる。 (4) In the digital camera 100 of (3) above, the correction value (tone correction gain yGain) output by the lookup table LUT2 is the ratio of the luminance after correction to the luminance before correction. At least one of the luminance and the color difference or the saturation of the correction target color is corrected by multiplying at least one of the luminance and the color difference or the saturation of the correction target color by a correction value. As a result, since only one lookup table LUT2 is required, memory capacity can be saved as compared with the case of using a plurality of lookup tables that output at least one of luminance after correction and color difference or saturation. can do.

(5)上記(4)のデジタルカメラ100において、階調補正座標系では、第1の直線L1と第3の直線L3との交点P31の座標値が基準値(1)であり、且つ黒色点Bpから交点P31に向かう方向に座標値が大きくなり、ルックアップテーブルLUT2では、入力値が基準値(1)以下である場合には、入力値(Input)に補正値(yGain)を乗算した値(Output)が基準値(1)以下となるように、入力値と補正値とが対応付けられているように構成した。これにより、出力色空間の色域内にある色を色域内で補正することができる。 (5) in the digital camera 100 described above (4), the gradation correction coordinate system, a first straight line L1 coordinate values reference values of the intersection point P 31 of the third straight line L3 (1), and black coordinate value increases in the direction toward the intersection P 31 from point Bp, the look-up table LUT 2, when the input value is a reference value (1) or less is multiplied by the correction value (Ygain) to the input value (input) The input value and the correction value are associated with each other so that the obtained value (Output) is equal to or less than the reference value (1). This makes it possible to correct a color within the color gamut of the output color space within the color gamut.

(6)上記(1)〜(5)のデジタルカメラ100において、少なくとも3色相以上の色相における第1の直線L1の傾きpdy1を記憶するメモリをさらに備え、制御装置104は、メモリに記憶された第1の直線L1の傾きpdy1からの補間により、補正対象色の色相における第1の直線L1の傾きpdy1を取得するように構成した。このように、少なくとも3色相における第1の直線の傾きpdy1を記憶すればよいので、多数の色相における第1の直線の傾きpdy1を記憶する場合と比較してメモリの容量を節約することができる。 (6) In the digital camera 100 of the above (1) to (5), the digital camera 100 further includes a memory for storing the inclination pdy1 of the first straight line L1 in a hue of at least three hues, and the control device 104 is stored in the memory The configuration is such that the slope pdy1 of the first straight line L1 in the hue of the correction target color is obtained by interpolation from the slope pdy1 of the first straight line L1. As described above, since it is sufficient to store the slope pdy1 of the first straight line in at least three hues, the memory capacity can be saved as compared with the case of storing the slope pdy1 of the first straight line in many hues. .

(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 digital camera 100 includes the slope pdy1 of the first straight line L1 passing through the white point Wp and the maximum saturation point Cp on the equal hue plane including the correction target color in the luminance / color difference separation space (YCC space), and the black point. Input of the control device 104 that acquires Bp and the slope pdy2 of the second straight line L2 that passes through the maximum saturation point Wp, and a lookup table LUT3 that outputs correction values for correcting the luminance and saturation of the correction target color A controller 104 that calculates a value (saturation correction parameter cGainIn) based on the brightness of the color to be corrected, the saturation or color difference, and the slope pdy2 of the second straight line L2, and the input value cGainIn to the lookup table LUT3. The brightness of the color to be corrected based on the control device 104 that receives the correction value (saturation correction gain cGain) and inputs the correction value cGain and the slope pdy1 of the first straight line. And includes a control unit 104 for correcting at least one of a chroma or color difference, the. As a result, the correction target color can be corrected according to the color gamut shape of the output color space, so that it is possible to prevent a color within the color gamut of the output color space from being corrected outside the color gamut.

(8)上記(7)のデジタルカメラ100において、補正対象色は、上記補正により、補正対象色を含む等色相面において補正対象色点Tpを通り且つ第1の直線L1と平行である第4の直線L4に沿って輝度および彩度が変化するように補正されるように構成した。これにより、出力色空間の色域内にある色を色域外に補正することなく、彩度補正を行うことができる。 (8) In the digital camera 100 of the above (7), the correction target color passes through the correction target color point Tp on the equal hue plane including the correction target color and is parallel to the first straight line L1 by the correction. The brightness and the saturation are corrected so as to change along the straight line L4. As a result, it is possible to perform saturation correction without correcting colors within the color gamut of the output color space outside the color gamut.

(9)上記(8)のデジタルカメラ100において、制御装置104は、補正対象色の輝度および、彩度または色差と第2の直線の傾きpdy2とに基づいて、第4の直線L4を軸とする彩度補正座標系における補正対象色点Tpの座標値を算出し、ルックアップテーブルLUT3の入力値とするように構成した。これにより、処理負荷をかけずに出力色空間の色域形状に応じて補正することができる。 (9) In the digital camera 100 of the above (8), the control device 104 uses the fourth straight line L4 as an axis based on the luminance and saturation or color difference of the color to be corrected and the inclination pdy2 of the second straight line. The coordinate value of the correction target color point Tp in the saturation correction coordinate system to be calculated is calculated and used as the input value of the lookup table LUT3. Thereby, it can correct | amend according to the color gamut shape of output color space, without applying processing load.

(10)上記(9)のデジタルカメラ100において、ルックアップテーブルLUT3が出力する補正値(彩度補正ゲインcGain)は、補正前の彩度に対する補正後の彩度の比であり、制御装置104は、補正対象色の彩度または色差の少なくとも一方に対して補正値cGainを乗算することにより補正対象色の彩度または色差の少なくとも一方を補正し、補正値cGainと第1の直線の傾きpdy1とに基づいて補正対象色の輝度を補正するように構成した。これにより、用いるルックアップテーブルLUT3が1つでよいので、補正後の輝度および、彩度または色差の少なくとも一方をそれぞれ出力する複数のルックアップテーブルを用いる場合と比較して、メモリの容量を節約することができる。 (10) In the digital camera 100 of (9) above, the correction value (saturation correction gain cGain) output by the lookup table LUT3 is the ratio of the saturation after correction to the saturation before correction, and the control device 104 Corrects at least one of the saturation or the color difference of the correction target color by multiplying at least one of the saturation or the color difference of the correction target color by the correction value cGain, and the slope pdy1 of the correction value cGain and the first straight line. Based on the above, the luminance of the correction target color is corrected. As a result, since only one lookup table LUT3 is required, the memory capacity can be saved as compared with the case of using a plurality of lookup tables that output at least one of corrected luminance and saturation or color difference. can do.

(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 digital camera 100 described above (10), the saturation correction coordinate system, is the second straight line L2 coordinate values reference values of the intersection point P 42 of the fourth straight line L4 (1), and black from the fifth linear (brightness axis) the intersection 4Y of the fourth straight line L4 which passes through the point Bp and white point Wp, coordinate values in a direction in which the second straight line L2 toward the intersection P 42 the fourth straight line L4 In the lookup table LUT3, when the input value is equal to or less than the reference value (1), a value (output) obtained by multiplying the input value (input) by the correction value cGain is equal to or less than the reference value (1). As described above, the input value and the correction value are associated with each other. This makes it possible to correct a color within the color gamut of the output color space within the color gamut.

(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 digital camera 100 of the above (7) to (11) further includes a memory for storing the slope pdy1 of the first straight line L1 and the slope pdy2 of the second straight line L2 in a hue of at least three hues or more. The control device 104 interpolates from the slope pdy1 of the first straight line L1 and the slope pdy2 of the second straight line L2 stored in the memory, and the slope pdy1 and second slope of the first straight line L1 in the hue of the correction target color. The inclination pdy2 of the straight line L2 is acquired. In this way, since it is only necessary to store the slopes pdy1 and pdy2 of the first and second straight lines in at least three hues, as compared with the case of storing the slopes pdy1 and pdy2 of the first and second straight lines in many hues. Memory capacity can be saved.

(変形例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 digital camera 100 has been described. However, the image processing apparatus may be configured by a personal computer. Further, the image processing apparatus may be configured by causing the personal computer 200 illustrated in FIG. 8 to execute a program for performing the processing illustrated in the flowchart illustrated in FIG. When the program is loaded into the personal computer 200 and used, the program is loaded into the data storage device of the personal computer 200 and then used as an image processing apparatus by executing the program.

パーソナルコンピュータ200に対するプログラムのローディングは、プログラムを格納したCD−ROMなどの記憶媒体201をパーソナルコンピュータ200にセットして行ってもよいし、ネットワークなどの通信回線202を経由する方法でパーソナルコンピュータ200へローディングしてもよい。通信回線202を経由する場合は、通信回線202に接続されたサーバー(コンピュータ)203のハードディスク装置204などにプログラムを格納しておく。プログラムは、記憶媒体201や通信回線202を介する提供など、種々の形態のコンピュータプログラム製品として供給することができる。   The loading of the program to the personal computer 200 may be performed by setting a storage medium 201 such as a CD-ROM storing the program in the personal computer 200, or to the personal computer 200 by a method via the communication line 202 such as a network. You may load. When passing through the communication line 202, the program is stored in the hard disk device 204 of the server (computer) 203 connected to the communication line 202. The program can be supplied as various forms of computer program products such as provision via the storage medium 201 or the communication line 202.

なお、パーソナルコンピュータ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 SYMBOLS 100 ... Digital camera, 101 ... Operation member, 102 ... Imaging lens, 103 ... Imaging element, 104 ... Control apparatus, 105 ... Memory card slot, 106 ... Monitor

Claims (17)

輝度色差分離空間における補正対象色を含む等色相面において、白色点および最大彩度点を通る第1の直線の傾きを取得する傾き取得手段と、
前記補正対象色の輝度および彩度を補正するための補正値を出力するルックアップテーブルの入力値を、前記補正対象色の輝度および、彩度または色差と前記第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:
請求項1に記載の画像処理装置において、
前記補正対象色は、前記補正により、前記補正対象色を含む等色相面において黒色点と前記補正対象色点とを通る第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.
請求項2に記載の画像処理装置において、
前記入力値算出手段は、前記補正対象色の輝度および、彩度または色差と前記第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.
請求項3に記載の画像処理装置において、
前記ルックアップテーブルが出力する前記補正値は、前記補正前の輝度に対する前記補正後の輝度の比であり、
前記補正手段は、前記補正対象色の輝度および、彩度または色差の少なくとも一方のそれぞれに対して前記補正値を乗算することにより、前記補正対象色の輝度および、彩度または色差の少なくとも一方を補正することを特徴とする画像処理装置。
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.
請求項4に記載の画像処理装置において、
前記補正座標系では、前記第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.
請求項1〜5のいずれか1項に記載の画像処理装置において、
少なくとも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.
輝度色差分離空間における補正対象色を含む等色相面において、白色点および最大彩度点を通る第1の直線の傾きと、黒色点および前記最大彩度点を通る第2の直線の傾きとを取得する傾き取得手段と、
前記補正対象色の輝度および彩度を補正するための補正値を出力するルックアップテーブルの入力値を、前記補正対象色の輝度および、彩度または色差と前記第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:
請求項7に記載の画像処理装置において、
前記補正対象色は、前記補正により、前記補正対象色を含む等色相面において前記補正対象色点を通り且つ前記第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.
請求項8に記載の画像処理装置において、
前記入力値算出手段は、前記補正対象色の輝度および、彩度または色差と前記第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.
請求項9に記載の画像処理装置において、
前記ルックアップテーブルが出力する前記補正値は、前記補正前の彩度に対する前記補正後の彩度の比であり、
前記補正手段は、前記補正対象色の彩度または色差の少なくとも一方に対して前記補正値を乗算することにより前記補正対象色の彩度または色差の少なくとも一方を補正し、前記補正値と前記第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.
請求項10に記載の画像処理装置において、
前記補正座標系では、前記第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.
請求項7〜11のいずれか1項に記載の画像処理装置において、
少なくとも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.
請求項1〜6のいずれか一項に記載の画像処理装置と、
請求項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〜13のいずれか一項に記載の画像処理装置として機能させることを特徴とする画像処理プログラム。   An image processing program for causing a computer to function as the image processing apparatus according to any one of claims 1 to 13. 輝度色差分離空間における補正対象色を含む等色相面において、白色点および最大彩度点を通る第1の直線の傾きを取得する傾き取得工程と、
前記補正対象色の輝度および彩度を補正するための補正値を出力するルックアップテーブルの入力値を、前記補正対象色の輝度および、彩度または色差と前記第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:
輝度色差分離空間における補正対象色を含む等色相面において、白色点および最大彩度点を通る第1の直線の傾きと、黒色点および前記最大彩度点を通る第2の直線の傾きとを取得する傾き取得工程と、
前記補正対象色の輝度および彩度を補正するための補正値を出力するルックアップテーブルの入力値を、前記補正対象色の輝度および、彩度または色差と前記第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:
JP2012171357A 2012-08-01 2012-08-01 Image processing apparatus, digital camera, image processing program, and image processing method Pending JP2014033272A (en)

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)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115330607A (en) * 2022-07-11 2022-11-11 内蒙古工业大学 Saturation enhancement method for color image

Cited By (2)

* Cited by examiner, † Cited by third party
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