JP7252400B2 - Image processing device - Google Patents

Image processing device Download PDF

Info

Publication number
JP7252400B2
JP7252400B2 JP2022114203A JP2022114203A JP7252400B2 JP 7252400 B2 JP7252400 B2 JP 7252400B2 JP 2022114203 A JP2022114203 A JP 2022114203A JP 2022114203 A JP2022114203 A JP 2022114203A JP 7252400 B2 JP7252400 B2 JP 7252400B2
Authority
JP
Japan
Prior art keywords
color space
value
correction coefficient
color
correction
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.)
Active
Application number
JP2022114203A
Other languages
Japanese (ja)
Other versions
JP2023026338A (en
Inventor
修二 奥野
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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Publication of JP2023026338A publication Critical patent/JP2023026338A/en
Application granted granted Critical
Publication of JP7252400B2 publication Critical patent/JP7252400B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、デジタル画像データの色処理を行う画像処理装置に関する。 The present invention relates to an image processing apparatus that performs color processing on digital image data.

従来より、デジタル映像などYCbCr色空間で表された画像データを、出力側のRGB色空間に変換することが行われている。しかしYCbCr色空間はRGB色空間より広い色空間を有するため、時として変換後の値が、RGB色空間の色域外に出ることがある。この場合、色域外に出た値をRGB色空間内へ単純に収める処理ではRGBの比率が変わってしまい画像データの明度や色相の変化が生じ、にじみなどの画質低下が起こってしまう。 Conventionally, image data expressed in the YCbCr color space such as digital video is converted into the RGB color space on the output side. However, since the YCbCr color space has a wider color space than the RGB color space, the values after conversion sometimes fall outside the color gamut of the RGB color space. In this case, if the value outside the color gamut is simply stored in the RGB color space, the RGB ratio will change, causing changes in the brightness and hue of the image data, resulting in image quality deterioration such as bleeding.

そこで、このような変換処理時に生じ得る画像データの明度や色相の変化を軽減するために、Y値(輝度値)を固定しつつ、RGBの色域の範囲に収まるようにCbCr(色差値)の比率を変えないで収める(すなわち、色相が同じままで彩度を下げる)ことができる画像処理装置が公開されている(例えば、特許文献1参照)。 Therefore, in order to reduce the change in the brightness and hue of the image data that may occur during such conversion processing, while fixing the Y value (luminance value), There is disclosed an image processing apparatus that can be stored without changing the ratio of (that is, lowering the saturation while maintaining the same hue) (see, for example, Patent Document 1).

また、出力用画像の色空間で再現可能な色域の外に色座標が存在する注目画素において、輝度信号を維持すると共に、複数の色差信号の比を維持した状態で、複数の色差信号を調整することで、注目画素の色相を維持しつつ彩度を調整する画像処理装置も開示されている(例えば、特許文献2参照)。 Also, in a pixel of interest whose color coordinates are outside the reproducible color gamut in the color space of the output image, a plurality of color difference signals are generated while maintaining the luminance signal and maintaining the ratio of the plurality of color difference signals. An image processing apparatus that adjusts saturation while maintaining the hue of a pixel of interest is also disclosed (see, for example, Patent Document 2).

特開2005-252393号公報JP-A-2005-252393 特許第6318497号公報Patent No. 6318497

上記特許文献に示すような従来の画像処理装置では、確かに、変換処理における出力側の色空間の色域外の色についても、輝度や色相を変化させることなく、好適な色再現を実現できる。しかしながら、従来の変換処理において出力側の色域外の画素値を、色域内の画素値に補正するための演算は冗長であり、処理時間を要するという問題がある。 In the conventional image processing apparatus as disclosed in the above-mentioned patent document, it is true that even colors outside the color gamut of the color space on the output side in conversion processing can be appropriately reproduced without changing the luminance or hue. However, in conventional conversion processing, there is a problem in that calculations for correcting pixel values outside the color gamut on the output side to pixel values within the color gamut are redundant and require processing time.

例えば、上記特許文献1における変換処理の演算方法を説明する。この特許文献1に示す画像処理装置においては、変換後の出力側のRGB色空間の色域外の画素値の位置よりY軸(輝度軸)に対して垂線を引き、RGB色空間に相当の範囲と交差した点の画素値から補正係数αを求める。そして、この補正係数αに基づいて補正後の画素値に置き換えるための演算を行っている。しかしながら、この補正係数αを求める際に、RGB変換後の各色成分値(r、g、b)と、y値(輝度値)との差分Δr, Δg、Δbを求め、このΔr, Δg、Δbから式変形により導かれた等式に基づいて、色成分毎の6つの彩度補正係数αR0,αR1,αG0,αG1,αB0,αB1(6つの境界)を求める。さらに、これらの彩度補正係数αR0,αR1,αG0,αG1,αB0,αB1の候補より、0.0未満、あるいは1.0より大きいものを除外し、続いて残った彩度補正係数のうち、最大のものを選択し、それを補正係数αとして決定する。最後に、決定された補正係数αに基づいてRGB色空間の色域外の画素値を色域内に補正している。このため、色域内の画素値に補正するための演算は冗長と言わざるを得ない。 For example, the calculation method of the conversion processing in the above-mentioned Patent Document 1 will be described. In the image processing apparatus disclosed in Patent Document 1, a vertical line is drawn from the position of the pixel value outside the color gamut of the RGB color space on the output side after conversion to the Y axis (luminance axis), and a range corresponding to the RGB color space is drawn. A correction coefficient α is obtained from the pixel value at the point of intersection with . Then, based on this correction coefficient α, a calculation is performed to replace the corrected pixel value. However, when obtaining this correction coefficient α, the differences Δr, Δg, and Δb between each color component value (r, g, b) after RGB conversion and the y value (luminance value) are obtained, and these Δr, Δg, and Δb Six saturation correction coefficients αR0, αR1, αG0, αG1, αB0, and αB1 (six boundaries) for each color component are obtained based on the equations derived by transforming the equations from . Furthermore, from these candidates for saturation correction coefficients αR0, αR1, αG0, αG1, αB0, and αB1, those less than 0.0 or greater than 1.0 are excluded, and among the remaining saturation correction coefficients, the maximum and determine it as the correction factor α. Finally, pixel values outside the color gamut of the RGB color space are corrected to within the color gamut based on the determined correction coefficient α. Therefore, it must be said that the calculation for correcting the pixel value within the color gamut is redundant.

本発明は、上記課題に鑑みてなされたものであり、出力用の色空間において色域外の色についても明度及び色相を変化させることなくその色空間内に収める変換処理を行う画像処理装置において、演算量を抑えて、より高速度での変換処理を実現できる画像処理装置を提供することを目的とする。 The present invention has been made in view of the above problems, and provides an image processing apparatus that performs conversion processing to fit colors outside the color gamut in the output color space within the color space without changing the lightness and hue, It is an object of the present invention to provide an image processing apparatus capable of realizing conversion processing at a higher speed by suppressing the amount of calculation.

上記目的を達成するために本発明は、第一の色空間で示される画像データを、明度と色差の比率とを固定し、且つ色差を補正して第二の色空間で示される画像データに変換処理をする画像処理装置であって、前記第一の色空間で示される画像データの信号値を、所定演算に基づいて前記第二の色空間で示される画像データの信号値に変換する変換手段と、前記変換手段における変換後の信号値が、前記第一の色空間における前記第二の色空間に対応する色域外に存在する場合に、当該信号値を補正するための補正係数を求める補正係数演算手段と、前記補正係数演算手段において演算された補正係数を用いて前記第二の色空間で示される信号値を補正して補正後の信号値を求める補正手段と、を備え、前記補正係数演算手段は、前記色域の上限を超えて存在する信号値のうち最も上限から離れた値、及び前記色域の下限未満に存在する信号値のうち最も下限から離れた値を求め、これらの値の1つから前記補正係数を決定することを特徴とする。
In order to achieve the above object, the present invention converts image data represented by a first color space into image data represented by a second color space by fixing the ratio of lightness and color difference and correcting the color difference. An image processing device that performs conversion processing, wherein the signal values of the image data indicated in the first color space are converted into the signal values of the image data indicated in the second color space based on a predetermined calculation. and calculating a correction coefficient for correcting the signal value when the signal value after conversion by the converting means exists outside the color gamut corresponding to the second color space in the first color space. correction coefficient calculation means; and correction means for correcting signal values represented in the second color space using the correction coefficients calculated by the correction coefficient calculation means to obtain post-correction signal values, A correction coefficient calculation means obtains a value farthest from the upper limit among signal values existing above the upper limit of the color gamut and a value farthest from the lower limit among signal values existing below the lower limit of the color gamut, The correction factor is determined from one of these values.

この画像処理装置において、前記第一の色空間はYCbCr色空間であり、前記第二の色空間はRGB色空間であり、前記変換手段は、YCbCr色空間における信号値(y,cb,cr)を、RGB色空間における画素値(r,g,b)に変換し、ここで、yは輝度成分、cb及びcrは色差成分であり、rはRチャネルの輝度値、gはGチャネルの輝度値、bはBチャネルの輝度値であり、前記補正係数演算手段は、前記画素値(r,g,b)の何れかが、YCbCr色空間におけるRGB色空間に対応する色域外に存在する場合には、前記色域外に存在する画素値(r,g,b)において、前記色域の上限との差の絶対値のうち最も大きい値をΔP、前記色域の下限との差の絶対値のうち最も大きい値をΔNとし、且つΔP又は(1-y)ΔN/yが最も大きな値をとる色成分の前記画素値に基づいて前記補正係数を算出することが好ましい。 In this image processing device, the first color space is a YCbCr color space, the second color space is an RGB color space, and the conversion means converts signal values (y, cb, cr) in the YCbCr color space to a pixel value (r, g, b) in the RGB color space, where y is the luminance component, cb and cr are the chrominance components, r is the luminance value of the R channel, g is the luminance of the G channel The value b is the brightness value of the B channel, and the correction coefficient calculation means detects when any of the pixel values (r, g, b) exists outside the color gamut corresponding to the RGB color space in the YCbCr color space. In pixel values (r, g, b) existing outside the color gamut, the maximum absolute value of the difference from the upper limit of the color gamut is ΔP, and the absolute value of the difference from the lower limit of the color gamut is It is preferable that the largest value among them be ΔN, and the correction coefficient be calculated based on the pixel value of the color component having the largest value of ΔP or (1−y)ΔN/y.

この画像処理装置において、前記補正係数演算手段において演算される補正係数αは、前記色域の上限との差の絶対値のうち最も大きい値ΔPから算出する場合には、α=(1-y)/(ΔP+1―y)、前記色域の下限との差の絶対値のうち最も大きい値ΔNから算出する場合には、α=y/(ΔN+y)で算出されることが好ましい。 In this image processing apparatus, the correction coefficient α calculated by the correction coefficient calculation means is α=(1−y )/(ΔP+1−y), and α=y/(ΔN+y) when calculating from the largest absolute value ΔN of the difference from the lower limit of the color gamut.

上記目的を達成するために本発明は、第一の色空間で示される画像データを、明度と色差の比率とを固定し、且つ色差を補正して第二の色空間で示される画像データに変換処理をする画像処理装置であって、前記第一の色空間で示される画像データの信号値を、所定演算に基づいて前記第二の色空間で示される画像データの信号値に変換する変換手段と、前記変換手段における変換後の信号値が、前記第一の色空間における前記第二の色空間に対応する色域外に存在する場合に、当該信号値を補正するための補正係数を求める補正係数演算手段と、前記補正係数演算手段において演算された補正係数を用いて前記第二の色空間で示される信号値を補正して補正後の信号値を求める補正手段と、を備え、前記補正係数演算手段は、前記色域の上限を超えて存在する信号値のうち最も上限から離れた値、及び前記色域の下限未満に存在する信号値のうち最も下限から離れた値を求め、これらの値の1つから前記補正係数を決定し、前記第一の色空間はYCbCr色空間であり、前記第二の色空間はRGB色空間であり、前記変換手段は、YCbCr色空間における信号値(y,cb,cr)を、RGB色空間における画素値(r,g,b)に変換し、ここで、yは輝度成分、cb及びcrは色差成分であり、rはRチャネルの輝度値、gはGチャネルの輝度値、bはBチャネルの輝度値であり、前記補正係数演算手段は、前記変換手段における変換後の画素値(r,g,b)の何れかの画素値が前記色域の上限を超える場合には、補正係数α=(1-y)/((上限を超えた(r,g,b)の何れかの画素値のうちの最大値)-y)とし、前記画素値(r,g,b)の何れかの画素値が前記色域の下限未満となる場合には、補正係数α=y/(y-(下限を超えた(r,g,b)の何れかの画素値のうちの最小値))とすることを特徴とする。
In order to achieve the above object, the present invention converts image data represented by a first color space into image data represented by a second color space by fixing the ratio of lightness and color difference and correcting the color difference. An image processing device that performs conversion processing, wherein the signal values of the image data indicated in the first color space are converted into the signal values of the image data indicated in the second color space based on a predetermined calculation. and calculating a correction coefficient for correcting the signal value when the signal value after conversion by the converting means exists outside the color gamut corresponding to the second color space in the first color space. correction coefficient calculation means; and correction means for correcting signal values represented in the second color space using the correction coefficients calculated by the correction coefficient calculation means to obtain post-correction signal values, A correction coefficient calculation means obtains a value farthest from the upper limit among signal values existing above the upper limit of the color gamut and a value farthest from the lower limit among signal values existing below the lower limit of the color gamut, determining the correction factor from one of these values, the first color space being the YCbCr color space, the second color space being the RGB color space, and the transforming means converting the signal in the YCbCr color space Convert the value (y,cb,cr) to a pixel value (r,g,b) in the RGB color space, where y is the luminance component, cb and cr are the chrominance components, and r is the luminance of the R channel. g is the luminance value of the G channel, and b is the luminance value of the B channel. When the upper limit of the color gamut is exceeded, the correction coefficient α = (1-y)/((maximum value of any pixel value of (r, g, b) exceeding the upper limit) - y) , when any pixel value of the pixel values (r, g, b) is less than the lower limit of the color gamut, the correction coefficient α=y/(y−(exceeding the lower limit (r, g, b ) is the minimum value among the pixel values of any one of )).

この画像処理装置において、前記補正係数演算手段は、さらに、複数の補正係数が導出される場合において、当該複数の補正係数のうちから最小のものを選択して前記補正係数とすることが好ましい。 In this image processing apparatus, it is preferable that, when a plurality of correction coefficients are derived, the correction coefficient calculation means selects the smallest one from among the plurality of correction coefficients as the correction coefficient.

また、上記目的を達成するために本発明は、第一の色空間で示される画像データを、明度と色差の比率とを固定し、且つ色差を補正して第二の色空間で示される画像データに変換処理をする画像処理装置において機能するプログラムであって、前記第一の色空間で示される画像データの信号値を、所定演算に基づいて前記第二の色空間で示される画像データの信号値に変換する変換ステップと、前記変換ステップにおける変換後の信号値が、前記第一の色空間における前記第二の色空間に対応する色域外に存在する場合に、当該信号値を補正するための補正係数を求める補正係数演算ステップと、前記補正係数演算ステップにおいて演算された補正係数を用いて前記第二の色空間で示される信号値を補正して補正後の信号値を求める補正ステップと、を含み、前記補正係数演算ステップにおいては、前記色域の上限を超えて存在する信号値のうち最も上限から離れた値、及び前記色域の下限未満に存在する信号値のうち最も下限から離れた値を求め、これらの値の1つから前記補正係数を決定することを特徴とするものである。
Further, in order to achieve the above object, the present invention converts image data represented in a first color space into an image represented in a second color space by fixing the ratio of lightness and color difference and correcting the color difference. A program that functions in an image processing device that performs data conversion processing, wherein the signal values of the image data represented by the first color space are transformed into the image data represented by the second color space based on a predetermined calculation. a converting step of converting into a signal value; and correcting the signal value when the converted signal value in the converting step exists outside the color gamut corresponding to the second color space in the first color space. and a correction step of obtaining a post-correction signal value by correcting the signal value represented by the second color space using the correction coefficient calculated in the correction coefficient calculation step. and, in the correction coefficient calculation step, among the signal values existing above the upper limit of the color gamut, the value farthest from the upper limit, and among the signal values existing below the lower limit of the color gamut, the lowest and determining the correction factor from one of these values.

また、上記目的を達成するために本発明は、第一の色空間で示される画像データを、明度と色差の比率とを固定し、且つ色差を補正して第二の色空間で示される画像データに変換処理をする画像処理方法であって、前記第一の色空間で示される画像データの信号値を、所定演算に基づいて前記第二の色空間で示される画像データの信号値に変換する変換ステップと、前記変換ステップにおける変換後の信号値が、前記第一の色空間における前記第二の色空間に対応する色域外に存在する場合に、当該信号値を補正するための補正係数を求める補正係数演算ステップと、前記補正係数演算ステップにおいて演算された補正係数を用いて前記第二の色空間で示される信号値を補正して補正後の信号値を求める補正ステップと、を含み、前記補正係数演算ステップにおいては、前記色域の上限を超えて存在する信号値のうち最も上限から離れた値、及び前記色域の下限未満に存在する信号値のうち最も下限から離れた値を求め、これらの値の1つから前記補正係数を決定することを特徴とするものである。
Further, in order to achieve the above object, the present invention converts image data represented in a first color space into an image represented in a second color space by fixing the ratio of lightness and color difference and correcting the color difference. An image processing method for converting data, wherein the signal values of the image data represented by the first color space are transformed into the signal values of the image data represented by the second color space based on a predetermined calculation. and a correction coefficient for correcting the signal value after conversion in the converting step when the signal value after conversion exists outside the color gamut corresponding to the second color space in the first color space. and a correction step of correcting the signal value represented in the second color space using the correction coefficient calculated in the correction coefficient calculation step to obtain the signal value after correction. , in the correction coefficient calculating step, the value farthest from the upper limit among the signal values existing above the upper limit of the color gamut and the value farthest from the lower limit among the signal values existing below the lower limit of the color gamut and determining the correction factor from one of these values.

本発明に係る画像処理装置は、YCbCr色空間で示される画像データの信号値を所定演算に基づいてRGB色空間で示される画像データの画素値に変換する変換部と、当該画素値が第一の色空間における第二の色空間に対応する色域外に存在する場合には当該画素値を補正するための補正係数を求める補正係数演算部と、当該補正係数を用いて第二の色空間で示される画素値を補正して補正後の画素値を求める補正部と、を備える。補正係数演算部は、色域の上限を超えて存在する信号値のうち最も上限から離れた値、及び色域の下限未満に存在する信号値のうち最も下限から離れた値を求め、これらの値の1つから前記補正係数を決定する。この構成により、本発明では、特にYCbCr色空間を RGB色空間に変換処理する際に、画像データの明度や色相の変化を防止するための補正における演算量を抑えて、より高速度での変換処理を実現できる。 An image processing apparatus according to the present invention includes a converter that converts a signal value of image data represented by the YCbCr color space into a pixel value of image data represented by the RGB color space based on a predetermined calculation; If it exists outside the color gamut corresponding to the second color space in the color space, a correction coefficient calculation unit that obtains a correction coefficient for correcting the pixel value, and a second color space using the correction coefficient and a correction unit that corrects the indicated pixel value to obtain a corrected pixel value. A correction coefficient calculation unit obtains a value farthest from the upper limit among signal values existing above the upper limit of the color gamut and a value farthest from the lower limit among signal values existing below the lower limit of the color gamut, and calculates these values. The correction factor is determined from one of the values. With this configuration, in the present invention, especially when converting the YCbCr color space to the RGB color space, the amount of calculation for correction for preventing changes in the brightness and hue of image data can be suppressed, and the conversion can be performed at a higher speed. processing can be realized.

本発明の実施の形態に係る画像処理装置の構成を示すブロック図である。1 is a block diagram showing the configuration of an image processing device according to an embodiment of the present invention; FIG. 同上画像処理装置の動作手順を示すフローチャートである。4 is a flow chart showing an operation procedure of the same image processing apparatus; 本発明の実施の形態の変形例に係る画像処理装置の動作手順を示すフローチャートである。9 is a flow chart showing the operation procedure of the image processing device according to the modified example of the embodiment of the present invention;

(実施の形態)
本発明の実施の形態に係る画像処理装置について図1乃至図3を参照して説明する。なお、本実施の形態に係る画像処理装置は、主としてデジタル映像における色空間がYCbCr方式の映像データをRGB色空間に変換した際、色域外に出た値をRGB空間の色域内へ補正するため演算を行うものである。
(Embodiment)
An image processing apparatus according to an embodiment of the present invention will be described with reference to FIGS. 1 to 3. FIG. Note that the image processing apparatus according to the present embodiment mainly corrects values outside the color gamut to within the color gamut of the RGB space when video data whose color space in digital video is the YCbCr format is converted into the RGB color space. It performs calculations.

最初に、画像処理装置1に備わる各処理部に関して図1を参照しながら説明する。画像処理装置1は、図1に示すように、制御部10、画像処理部11、記憶部12、通信部13、表示部14、操作部15及び読取部16を備える。なお、画像処理装置1及び画像処理装置1における動作について以下では、1台のコンピュータとして説明するが、複数のコンピュータによって処理を分散するようにして構成されてもよい。 First, each processing unit provided in the image processing apparatus 1 will be described with reference to FIG. The image processing apparatus 1 includes a control section 10, an image processing section 11, a storage section 12, a communication section 13, a display section 14, an operation section 15 and a reading section 16, as shown in FIG. Although the image processing apparatus 1 and the operation of the image processing apparatus 1 will be described below assuming one computer, the processing may be distributed among a plurality of computers.

制御部10は、CPUなどのプロセッサやメモリを用いて、画像処理装置1の構成部を制御して各種機能を実現する。この制御部10は、本実施の形態においては例えば記憶部12に記憶してある画像処理プログラム1Pの実行によって画像補正処理(色変換処理)を行う。すなわち、制御部10は、入力される対象画像データ(対象データ)に対して所定の変換を実行すると共に、色域外の変換値を補正する演算を行う。 The control unit 10 uses a processor such as a CPU and a memory to control components of the image processing apparatus 1 to realize various functions. In this embodiment, the control unit 10 performs image correction processing (color conversion processing) by executing an image processing program 1P stored in the storage unit 12, for example. That is, the control unit 10 performs a predetermined conversion on input target image data (target data), and performs calculations for correcting conversion values outside the color gamut.

画像処理部11は、GPU又は専用回路等のプロセッサ及びメモリを用い、制御部10からの制御指示に応じて画像処理を実行する。なお、制御部10及び画像処理部11は、CPU,GPU等のプロセッサ、メモリ、さらには記憶部12及び通信部13を集積した1つのハードウェア(SoC:System on a Chip)として構成されていてもよい。 The image processing unit 11 uses a processor such as a GPU or a dedicated circuit and a memory, and executes image processing according to control instructions from the control unit 10 . Note that the control unit 10 and the image processing unit 11 are configured as one piece of hardware (SoC: System on a Chip) in which a processor such as a CPU or GPU, a memory, a storage unit 12 and a communication unit 13 are integrated. good too.

記憶部12は、ハードディスクやフラッシュメモリを用いる。記憶部12には、画像処理プログラム1P、表示部14に表示される画像データ1Dなどが記憶されている。この画像データ1Dは、YCbCr色空間で表現されているデジタル映像を含み、例えば通信部13を介してネットワークから取得した画像データや読取部16から読み込んだ画像データである。 The storage unit 12 uses a hard disk or flash memory. The storage unit 12 stores an image processing program 1P, image data 1D to be displayed on the display unit 14, and the like. This image data 1D includes digital video expressed in the YCbCr color space, and is image data obtained from a network via the communication section 13 or image data read from the reading section 16, for example.

通信部13は、インターネット等の通信網への通信接続を実現する通信モジュールである。通信部13には、例えばネットワークカード、無線通信デバイス又はキャリア通信用モジュールを用いる。 The communication unit 13 is a communication module that realizes communication connection to a communication network such as the Internet. For the communication unit 13, for example, a network card, a wireless communication device, or a carrier communication module is used.

表示部14は、液晶パネル又は有機EL(Electro Luminescence)ディプレイ等を用いる。表示部14は、制御部10の指示による画像処理部11での処理によって画像を表示することが可能である。この表示部14は画面を構成する各画素における一般的なRGB形式のデータに従って画像データを表示する。通常、YCbCr色空間のデジタル映像を表示部14に表示する際には、sRGB(standard RGB)色空間に変換してから表示される。パソコンなど一般的な情報表示機器の表示部14に表示される画像はRGB形式のデータでしか表示できないためである。 The display unit 14 uses a liquid crystal panel, an organic EL (Electro Luminescence) display, or the like. The display unit 14 can display an image by processing in the image processing unit 11 according to instructions from the control unit 10 . The display unit 14 displays image data in accordance with general RGB format data for each pixel forming the screen. Normally, when a digital image in the YCbCr color space is displayed on the display unit 14, it is displayed after being converted into the sRGB (standard RGB) color space. This is because an image displayed on the display unit 14 of a general information display device such as a personal computer can only be displayed in RGB format data.

RGB色空間のデジタル画像データは、座標ごとに区画されたピクセル(画素)の集まりとして表現され、各ピクセルにはピクセル値(色情報RGBの3つの値)が付与される。ここでは、或る画素位置でのRチャネルの輝度値をr、Gチャネルの輝度値をg、Bチャネルの輝度値をbとする画素値を(r、g、b)で表現するものとする。通常、各(r、g、b)の値は8ビット(256段階)などで表現されるが、本実施の形態では便宜的に各(r、g、b)の取り得る範囲を0.0~1.0(上限1.0及び下限0.0)の範囲に正規化して説明する。 Digital image data in the RGB color space is expressed as a collection of pixels (picture elements) partitioned by coordinates, and each pixel is given a pixel value (three values of color information RGB). Here, a pixel value is represented by (r, g, b) where r is the luminance value of the R channel, g is the luminance value of the G channel, and b is the luminance value of the B channel at a certain pixel position. . Normally, each (r, g, b) value is represented by 8 bits (256 steps), etc., but in this embodiment, for convenience, each (r, g, b) can take a range of 0.0 to 1.0 Description will be made by normalizing to the range of (upper limit 1.0 and lower limit 0.0).

操作部15は、キーボード又はマウス等のユーザインタフェースを含む。筐体に設けられた物理的ボタンを用いてもよいし、表示部14に表示されるソフトウェアボタン等を用いてもよい。操作部15は、ユーザによる操作情報を制御部10へ通知する。 The operating unit 15 includes a user interface such as a keyboard or mouse. A physical button provided on the housing may be used, or a software button or the like displayed on the display unit 14 may be used. The operation unit 15 notifies the control unit 10 of operation information by the user.

読取部16は、例えばディスクドライブを用い、光ディスク等を用いた記録媒体2(光ディスク、磁気ディスクや光磁気ディスクなど)に記憶してある画像処理プログラム2Pを読み取ることが可能である。また、読取部16は、表示部14への表示対象のカラー画像の動画や静止画の画像データを記録媒体2などから読み込むときに用いても良い。なお、記憶部12に記憶してある画像処理プログラム1Pは、通信部13を介してネットワークから取得したものや、記録媒体2から読取部16が読み取った画像処理プログラム2Pを制御部10が記憶部12に複製したものであってもよい。 The reading unit 16 uses, for example, a disk drive, and can read the image processing program 2P stored in the recording medium 2 (optical disk, magnetic disk, magneto-optical disk, etc.) using an optical disk or the like. Further, the reading unit 16 may be used when reading image data of a moving image or a still image of a color image to be displayed on the display unit 14 from the recording medium 2 or the like. The image processing program 1P stored in the storage unit 12 is acquired from the network via the communication unit 13, or the image processing program 2P read from the recording medium 2 by the reading unit 16 is read by the control unit 10 from the storage unit. 12 may be replicated.

次に、YCbCr色空間で表現された画像データを RGB色空間に変換処理する際の画像処理装置1における補正演算に関して説明する。通常、YCbCr信号から成る画像データは、出力用の色空間(sRGB色空間)よりも広い範囲を再現可能である。そのため、表示部14への表示処理対象の画像データの内容によっては、変換後の色座標値がRGB色空間の色域外(すなわち0.0~1.0の範囲外)となることがある。そこで、画像処理装置1では、色域外の色座標を色域内に補正するための補正係数αを求め、補正処理を行うものである。 Next, correction calculations in the image processing apparatus 1 when converting image data expressed in the YCbCr color space into the RGB color space will be described. Normally, image data composed of YCbCr signals can reproduce a wider range than the output color space (sRGB color space). Therefore, depending on the content of the image data to be displayed on the display unit 14, the color coordinate values after conversion may be outside the color gamut of the RGB color space (that is, outside the range of 0.0 to 1.0). Therefore, the image processing apparatus 1 obtains a correction coefficient α for correcting the color coordinates outside the color gamut to within the color gamut, and performs correction processing.

具体的には、画像処理装置1の制御部10は変換部(変換手段)10a、補正係数演算部(補正係数演算手段)10b及び補正部(補正手段)10cを備える。変換部10aは、YCbCr色空間(第一の色空間)で示される画像データの信号値を、所定演算に基づいてRGB色空間(第二の色空間)で示される画像データの画素値に変換する。補正係数演算部10bは、変換部10aにおいて変換された画素値が、YCbCr色空間におけるRGB色空間に対応する色域外に存在する場合に、当該画素値を補正するための補正係数αを求める。この補正係数αの求め方は後述する。補正部10cは、補正係数演算部10bにおいて演算された補正係数αを用いてRGB色空間で示される画素値を補正して、補正後の画素値を求める。ここで、補正係数演算部10bは、色域の上限を超えて存在する画素値と当該色域の上限との差分、及び色域の下限未満に存在する画素値と当該色域の下限との差分を算出し、これら差分のうちの最も大きな差分に基づいて補正係数αを算出する。これより、画像処理装置1では、YCbCr空間をRGB空間に変換した際に、変換後のRGB色空間での画素値が0.0~1.0の範囲に収まらなかったとしても、補正処理をして0.0~1.0に収める処理を行う。
Specifically, the control section 10 of the image processing apparatus 1 includes a conversion section (conversion means) 10a, a correction coefficient calculation section (correction coefficient calculation means) 10b, and a correction section (correction means) 10c. The conversion unit 10a converts signal values of image data represented by the YCbCr color space (first color space) into pixel values of image data represented by the RGB color space (second color space) based on a predetermined calculation. Convert. The correction coefficient calculation unit 10b obtains a correction coefficient α for correcting the pixel value when the pixel value converted by the conversion unit 10a exists outside the color gamut corresponding to the RGB color space in the YCbCr color space. A method for obtaining the correction coefficient α will be described later. The correction unit 10c corrects the pixel values represented in the RGB color space using the correction coefficient α calculated by the correction coefficient calculation unit 10b, and obtains the corrected pixel values. Here, the correction coefficient calculation unit 10b calculates the difference between the pixel value existing above the upper limit of the color gamut and the upper limit of the color gamut, and the difference between the pixel value existing below the lower limit of the color gamut and the lower limit of the color gamut. Differences are calculated, and the correction coefficient α is calculated based on the largest difference among these differences. From this, in the image processing device 1, when the YCbCr space is converted into the RGB space, even if the pixel value in the converted RGB color space does not fall within the range of 0.0 to 1.0, the correction process is performed to Perform processing to fit in 1.0.

次に、画像処理装置1での補正係数の導出例に関して説明する。まず操作部15などを介してユーザから画像データの表示部14への表示指令を受けると、変換部10aは、指定された画像データをYCbCr色空間からRGB色空間へ変換する。この際、変換部10aは、例えば以下の式1に示す演算を行う。

Figure 0007252400000001
なお、ここでは、変換前の元の画像データのYCbCr色空間での信号値を(y、cb、cr)(ここで、yは輝度成分、cb及びcrは色差成分である)、式1を用いてRGB色空間へと変換したときの画素値を(r,g,b)(ここでrはRチャネルの輝度値、gはGチャネルの輝度値、bはBチャネルの輝度値)とする。また、YCbCr色空間での信号値yは0.0≦y≦1.0、式差信号cb、crは-0.5≦cb、cr≦0.5の範囲をとる。 Next, an example of derivation of correction coefficients in the image processing apparatus 1 will be described. First, upon receiving a display command of image data from the user via the operation unit 15 or the like to the display unit 14, the conversion unit 10a converts the designated image data from the YCbCr color space to the RGB color space. At this time, the conversion unit 10a performs, for example, the calculation shown in Equation 1 below.
Figure 0007252400000001
Here, the signal values in the YCbCr color space of the original image data before conversion are (y, cb, cr) (where y is the luminance component, cb and cr are the color difference components), and Equation 1 is Let (r, g, b) be the pixel value when converted to the RGB color space using . The signal value y in the YCbCr color space is in the range of 0.0≤y≤1.0, the difference signals cb and cr are in the range of -0.5≤cb and cr≤0.5.

この変換部10aにおける変換時に、YCbCr信号から成る画像データの信号値(y,cb,cr)のうちRGB変換後の画素値(r,g,b)が0.0~1.0の範囲外(すなわちRGB色空間の色域外)となることがある。なお、変換後の(r、g、b)は0.0~1.0の範囲外となることを許容するために、各色成分に対して元のビット数を超えるビット数を割り当てても良い。 During conversion by the conversion unit 10a, among the signal values (y, cb, cr) of the image data composed of YCbCr signals, the pixel values (r, g, b) after RGB conversion are outside the range of 0.0 to 1.0 (that is, the RGB color outside the color gamut of the space). In order to allow (r, g, b) after conversion to fall outside the range of 0.0 to 1.0, a number of bits exceeding the original number of bits may be assigned to each color component.

次に、補正係数演算部10bは、色域外の画素値が存在する場合に補正処理を行う。具体的には、入力画素の信号値(y,cb,cr)を、補正係数αを用いて、YCbCr色空間のY軸(輝度軸)に対して垂線を引いてRGB空間に相当の範囲と交差した点の補正後の信号値を(y’、cb’、cr’)と定義すると、次の式2が成り立っている。
y’=y
cb’=α×cb
cr’=α×cr …式2
ここで、y’=yは明度を固定していることを示し、cb’=α×cb及びcr’=α×crは色相(すなわち色差の比率)を固定していることを示している。
Next, the correction coefficient calculation unit 10b performs correction processing when there is a pixel value outside the color gamut. Specifically, the signal values (y, cb, cr) of the input pixel are divided into a range corresponding to the RGB space by drawing a perpendicular line to the Y axis (luminance axis) of the YCbCr color space using the correction coefficient α. If the corrected signal value at the crossing point is defined as (y', cb', cr'), the following equation 2 holds.
y' = y
cb′=α×cb
cr′=α×cr Expression 2
Here, y′=y indicates that the lightness is fixed, and cb′=α×cb and cr′=α×cr indicate that the hue (that is, color difference ratio) is fixed.

この補正後の信号値(y’、cb’、cr’)に基づいて、逆変換式である式1を適用して得られた補正後のRGB値を (r’,g’,b’)とすると、次の式3が成り立つ。
r’=y+α×(r-y)
g’=y+α×(g-y)
b’=y+α×(b-y) …式3
Based on the corrected signal values (y', cb', cr'), the corrected RGB values obtained by applying Equation 1, which is an inverse transformation formula, are (r', g', b') Then, the following formula 3 holds.
r'=y+α×(ry)
g′=y+α×(gy)
b′=y+α×(by) …Equation 3

補正係数演算部10bは、変換後の(r,g,b)の何れかが、YCbCr色空間におけるRGB色空間に対応する色域外にあるとき、この(r,g,b)において色域の上限(ここでは1.0)との差の絶対値のうち最も大きい値をΔP、色域の下限(ここでは0.0)との差の絶対値のうち最も大きい値をΔNとする。また、補正係数演算部10bは、ΔP又は(1-y)ΔN/yが最も大きな値をとる画素値を0.0~1.0の範囲から一番外れていると判定し、この画素値の位置でクリップが必要と判定し、それに基づいて式3より補正係数αを求める。例えば、変換後の画素値(r,g,b)の内、rに対応するΔPが最も大きな値となる場合には、上記のr’=y+α×(r-y)より補正係数αを求めることとなる。なお、輝度成分yが0か1のときは(r、g、b)が全て0または1になるので補正係数αを求めなくて良い。 When any of (r, g, b) after conversion is outside the color gamut corresponding to the RGB color space in the YCbCr color space, the correction coefficient calculation unit 10b corrects the color gamut in this (r, g, b). Let ΔP be the largest absolute value of the difference from the upper limit (1.0 here), and let ΔN be the largest absolute value of the difference from the lower limit of the color gamut (0.0 here). Further, the correction coefficient calculation unit 10b determines that the pixel value having the largest value of ΔP or (1−y)ΔN/y is the most out of the range of 0.0 to 1.0, and clips at the position of this pixel value. is necessary, and based on that, the correction coefficient α is obtained from Equation 3. For example, if the ΔP corresponding to r is the largest among the pixel values (r, g, b) after conversion, the correction coefficient α is obtained from the above r'=y+α×(ry). It will happen. When the luminance component y is 0 or 1, (r, g, b) are all 0 or 1, so the correction coefficient α need not be obtained.

なお、ここで、補正係数演算部10bがΔP及び(1-y)ΔN/yを演算する理由に関して説明する。
最初に、上限1.0に収める場合(すなわち色域の上限との差の絶対値のうち最も大きい値ΔPから補正係数αを求める場合)の補正係数αは上記の式3より以下の式4となる。
1=y+α(r-y)=y+α(1+ΔP―y)
∴α=(1-y)/(ΔP+1―y) …式4
なお、ここでrを用いて説明しているが、色域より一番外れている色成分を用いればよく、r以外のg又はbともなり得る。なお、0≦補正係数α≦1、輝度値yは0~1の定数、ΔPは1を超えた分(上限1.0との差分)である。また、この式4よりΔPが大きいほど補正係数αが小さくなることが分かる。
The reason why the correction coefficient calculator 10b calculates ΔP and (1−y)ΔN/y will now be described.
First, when the upper limit is set to 1.0 (that is, when the correction coefficient α is obtained from the largest value ΔP among the absolute values of the difference from the upper limit of the color gamut), the correction coefficient α is obtained from the above equation 3 by the following equation 4. .
1=y+α(ry)=y+α(1+ΔP-y)
∴α=(1−y)/(ΔP+1−y) Equation 4
Note that although r is used in the description here, a color component that is most out of the color gamut may be used, and g or b other than r may be used. Note that 0≦correction coefficient α≦1, luminance value y is a constant between 0 and 1, and ΔP is the amount exceeding 1 (difference from upper limit 1.0). Also, it can be seen from the equation 4 that the larger the ΔP, the smaller the correction coefficient α.

次に、下限0.0に収める場合(すなわち色域の下限との差の絶対値のうち最も大きい値ΔNから補正係数αを求める場合)の補正係数αは上記の式3より以下の式5となる。
0=y+α(r-y)=y+α(―ΔN―y)
∴α=y/(ΔN+y) …式5
なお、ここでもrを用いて説明しているが、色域より一番外れている色成分を用いればよく、r以外のg又はbともなり得る。ΔNは0.0未満となる分(下限0.0との差分)である。また、この式4よりΔNが大きいほど補正係数αが小さくなることが分かる。
Next, when the lower limit is set to 0.0 (that is, when the correction coefficient α is obtained from the largest value ΔN among the absolute values of the difference from the lower limit of the color gamut), the correction coefficient α is obtained from the above equation 3 by the following equation 5. .
0=y+α(ry)=y+α(-ΔN-y)
∴α=y/(ΔN+y) Equation 5
Although r is also used in the description here, the color component that is most out of the color gamut may be used, and g or b other than r may be used. ΔN is less than 0.0 (difference from the lower limit of 0.0). Also, it can be seen from Equation 4 that the larger ΔN is, the smaller the correction coefficient α is.

ここで式4及び式5のαが同じになる場合を考えると以下の式6となる。
(1-y)/(ΔP+1―y)=y/(ΔN+y) …式6
ここで分母と分子を反転させると以下の式7が導かれる。
(ΔP+1―y)/(1-y)=(ΔN+y)/y
ΔP/(1-y)+1=ΔN/y+1
ΔP/(1-y)=ΔN/y
ΔP=(1-y)/y×ΔN …式7
そして、この式7から(1-y)/yをΔNに掛けるとΔPと等価になり、ΔPとΔNが比較できるようになることが分かる。すなわち、補正係数演算部10bは、(r、g、b)のうち、ΔP又は(1-y)ΔN/yが最も大きな値をとる画素値を選択することで、色域の範囲から一番大きく外れている画素値を判定できるのである。
Considering the case where α in Equations 4 and 5 are the same, Equation 6 below is obtained.
(1−y)/(ΔP+1−y)=y/(ΔN+y) Equation 6
If the denominator and the numerator are inverted here, the following equation 7 is derived.
(ΔP+1−y)/(1−y)=(ΔN+y)/y
ΔP/(1−y)+1=ΔN/y+1
ΔP/(1−y)=ΔN/y
ΔP=(1−y)/y×ΔN Equation 7
Then, it can be seen from Equation 7 that if ΔN is multiplied by (1−y)/y, it becomes equivalent to ΔP, and ΔP and ΔN can be compared. That is, the correction coefficient calculation unit 10b selects the pixel value having the largest value of ΔP or (1−y)ΔN/y among (r, g, b), thereby Pixel values that deviate greatly can be determined.

最後に、補正部10cは、決定された補正係数α及び式3よりクリップ後の(r’,g’,b’)を算出する。なお、式3を利用して求めたクリップ後の(r’,g’,b’)の値は0.0~1.0の範囲にあり、且つ何れか一つの値(すなわちクリップした位置での画素値)は必ず1.0又は0.0の条件を満たす。このように、本実施の形態に係る画像処理装置1は、非常に簡易な演算で補正係数αを求めることができる。次に、この決定された補正係数αと式3に基づいて補正後の画素値(r’,g’,b’)を算出して、より演算量を抑え、ひいてはより高速度で色処理変換を実現できる。 Finally, the correction unit 10c calculates (r', g', b') after clipping from the determined correction coefficient α and Equation (3). Note that the values of (r', g', b') after clipping obtained using Equation 3 are in the range of 0.0 to 1.0, and any one value (that is, the pixel value at the clipped position) always satisfies the condition of 1.0 or 0.0. Thus, the image processing apparatus 1 according to the present embodiment can obtain the correction coefficient α by a very simple calculation. Next, the pixel values (r′, g′, b′) after correction are calculated based on the determined correction coefficient α and Equation 3 to further suppress the amount of calculation, and eventually color processing conversion can be performed at a higher speed. can be realized.

次に、本実施の形態に係る画像処理装置1の動作手順に関して図2に示すフローチャートを参照しながら説明する。最初に、操作部15などを介してユーザが表示部14への表示対象の画像データを選択すると、制御部10の変換部10aは当該画像データをYCbCr色空間からRGB色空間への変換処理を行う(S21)。例えば、画像データが1920×1080ピクセルのRGB色情報で表現される場合、 各ピクセルに対応してこの変換処理が実行される。 Next, the operation procedure of the image processing apparatus 1 according to this embodiment will be described with reference to the flowchart shown in FIG. First, when the user selects image data to be displayed on the display unit 14 via the operation unit 15 or the like, the conversion unit 10a of the control unit 10 converts the image data from the YCbCr color space to the RGB color space. (S21). For example, when the image data is represented by RGB color information of 1920×1080 pixels, this conversion process is executed for each pixel.

次に、補正係数演算部10bは、変換処理後の画素値(r,g,b)の何れかが0.0~1.0の範囲外となるかを判定する(S22)。そして、0.0~1.0の範囲外となる(すなわち変換後の色座標値がRGB色空間の色域外となる)場合には(S22でYes)、ΔP及び(1-y)ΔN/yが最も大きい値を持つ(r、g、b)の色成分の何れかの画素値でクリップが必要と判定し、それに基づいて式3より補正係数αを求める(S23)。 Next, the correction coefficient calculator 10b determines whether any of the pixel values (r, g, b) after conversion processing is outside the range of 0.0 to 1.0 (S22). Then, if it is outside the range of 0.0 to 1.0 (that is, the color coordinate value after conversion is outside the color gamut of the RGB color space) (Yes in S22), ΔP and (1−y)ΔN/y are the largest. It is determined that clipping is necessary for any pixel value of the (r, g, b) color components having values, and based on that, the correction coefficient α is obtained from Equation 3 (S23).

そして、補正部10cは、補正係数演算部10bにおいて演算された補正係数αと式3とを用いて、色域内の画素値(r’,g’,b’)を求める(S24)。この際、上述のようにクリップした位置での画素値はαから計算する必要なく0又は1になる。一方、補正係数演算部10bは、変換処理後のRBGの画素値(r,g,b)が0.0~1.0の範囲内である場合には(S22でNo)、特に補正処理が必要でないためにS22及び補正部10cにおける処理であるS23をスキップする。 Then, the correction unit 10c obtains pixel values (r', g', b') within the color gamut using the correction coefficient α calculated by the correction coefficient calculation unit 10b and Equation 3 (S24). At this time, the pixel value at the clipped position becomes 0 or 1 without the need to calculate from α as described above. On the other hand, when the RBG pixel values (r, g, b) after conversion processing are within the range of 0.0 to 1.0 (No in S22), the correction coefficient calculation unit 10b does not require correction processing. S22 and S23, which is the processing in the correction unit 10c, are skipped.

(変形例)
本発明の実施の形態に係る画像処理装置1の変形例に関して説明する。本変形例は、補正係数演算部10bの演算方法が上記実施の形態とは異なり、補正係数演算部10bは、ΔP及び(1-y)ΔN/yを演算しない。すなわち、本変形例に係る補正係数演算部10bは、変換処理後の画素値(r,g,b)のうちの上限値を超えた最も大きい値、又は及び下限値を超えた一番小さい値の補正係数αをそれぞれ計算し、何れか一方の、より小さい値を採用する。すなわち、本変形例では上記の実施の形態のようにΔP又は(1-y)ΔN/yが最も大きな値をとる画素値を算出する必要性がない。
(Modification)
A modified example of the image processing apparatus 1 according to the embodiment of the present invention will be described. In this modified example, the correction coefficient calculator 10b does not calculate ΔP and (1−y)ΔN/y in a different calculation method from the above-described embodiment. That is, the correction coefficient calculation unit 10b according to the present modification calculates the largest value exceeding the upper limit value or the smallest value exceeding the lower limit value among the pixel values (r, g, b) after conversion processing. are calculated, and the smaller value of either one is adopted. That is, in this modified example, there is no need to calculate the pixel value with the largest value of ΔP or (1−y)ΔN/y as in the above embodiment.

具体的には、本変形例に係る補正係数演算部10bは、変換後の画素値(r,g,b)の何れかの画素値が色域の上限(1.0)を超える場合は、上記式4より、補正係数α=(1-y)/((上限を超えた(r,g,b)の何れかの画素値のうちの最大値)-y)とする。一方、変換後の画素値(r,g,b)の何れかの画素値が色域の下限(0.0)未満となる場合は 上記式5より、補正係数α=y/(y-(下限を超えた(r,g,b)の何れかの画素値のうちの最小値))とする。 Specifically, if any pixel value of the converted pixel values (r, g, b) exceeds the upper limit (1.0) of the color gamut, the correction coefficient calculation unit 10b according to the present modification uses the above formula 4, the correction coefficient α=(1−y)/((maximum value of any pixel value of (r, g, b) exceeding the upper limit)−y). On the other hand, if any of the pixel values (r, g, b) after conversion is less than the lower limit (0.0) of the color gamut, the correction coefficient α = y/(y-(lower limit It is assumed that the minimum value among the pixel values exceeding (r, g, b))).

なお、補正係数演算部10bは、変換処理後の(r,g,b)から複数の補正係数αが導出される場合においては、当該複数の補正係数αのうちから最小のものを選択して補正係数αとすることができる。 When a plurality of correction coefficients α are derived from (r, g, b) after conversion processing, the correction coefficient calculation unit 10b selects the smallest one from among the plurality of correction coefficients α. can be a correction coefficient α.

次に、本変形例に係る画像処理装置1の動作手順に関して図3に示すフローチャートを参照しながら説明する。最初に、操作部15などを介してユーザが表示部14への表示対象の画像データを選択すると、制御部10の変換部10aは当該画像データをYCbCr色空間からRGB色空間への変換処理を行う(S31)。 Next, the operation procedure of the image processing apparatus 1 according to this modified example will be described with reference to the flowchart shown in FIG. First, when the user selects image data to be displayed on the display unit 14 via the operation unit 15 or the like, the conversion unit 10a of the control unit 10 converts the image data from the YCbCr color space to the RGB color space. (S31).

次に、補正係数演算部10bは、変換処理後の画素値(r,g,b)の何れかが上限1.0を超えるか否かを判定する(S32)。そして、上限を超える場合には(S32でYes)、下限未満となるか否かを判定する(S33)。そして、下限未満となる場合には(S33でYes)、上述のように補正係数α=(1-y)/((上限を超えた(r,g,b)の何れかの画素値のうちの最大値)-y)と補正係数α=y/(y-(下限を超えた(r,g,b)の何れかの画素値のうちの最小値))を求め、これらから最小のものを選択して補正係数αとする(S34)。一方、下限以上となる場合には(S33でNo)、補正係数α=(1-y)/((上限を超えた(r,g,b)の何れかの画素値のうちの最大値)-y)とする(S35)。 Next, the correction coefficient calculator 10b determines whether any of the pixel values (r, g, b) after conversion processing exceeds the upper limit of 1.0 (S32). Then, if the upper limit is exceeded (Yes in S32), it is determined whether or not it is less than the lower limit (S33). If it is less than the lower limit (Yes in S33), as described above, the correction coefficient α=(1-y)/((one of the pixel values (r, g, b) exceeding the upper limit) (maximum value)-y) and correction coefficient α = y/(y-(minimum value of any pixel value of (r, g, b) exceeding the lower limit))), and the smallest one from these is selected as the correction coefficient α (S34). On the other hand, if it is equal to or higher than the lower limit (No in S33), the correction coefficient α=(1-y)/((maximum value of any pixel value (r, g, b) exceeding the upper limit) -y) (S35).

また、変換処理後の画素値(r,g,b)の何れかが上限を超えない場合には(S32でNo)、下限未満となるか否かを判定し(S36)、下限未満となる場合には(S36でYes)、補正係数α=y/(y-(下限を超えた(r,g,b)の何れかの画素値のうちの最小値))を求める(S37)。次に、これらのS34,S35及びS37の後、補正部10cは導かれた補正係数αによって、色域内の画素値(r’,g’,b’)に補正する(S38)。一方、補正係数演算部10bは、変換処理後のRBGの画素値(r,g,b)の全てが0.0~1.0の範囲内である場合には(S36でNo)、特に補正係数αを求める必要がないために補正部10cにおける処理であるS38をスキップする。 Further, if any of the pixel values (r, g, b) after conversion processing does not exceed the upper limit (No in S32), it is determined whether or not it is less than the lower limit (S36). If so (Yes in S36), the correction coefficient α=y/(y-(minimum value of any pixel value of (r, g, b) exceeding the lower limit)) is obtained (S37). Next, after S34, S35 and S37, the correction unit 10c corrects the pixel values (r', g', b') within the color gamut using the derived correction coefficient α (S38). On the other hand, if all of the RBG pixel values (r, g, b) after the conversion process are within the range of 0.0 to 1.0 (No in S36), the correction coefficient calculator 10b particularly obtains the correction coefficient α. Since there is no need, S38, which is the processing in the correction unit 10c, is skipped.

以上の説明のように、本実施の形態は第一の色空間(YCbCr色空間)で示される画像データを、明度と色差の比率とを固定し、且つ色差を補正して第二の色空間(RGB色空間)で示される画像データに変換処理をする画像処理装置1であって、第一の色空間で示される画像データの信号値を所定演算に基づいて第二の色空間で示される画像データの信号値に変換する変換部10aと、変換部10aにおける変換後の信号値が、第一の色空間における第二の色空間に対応する色域外に存在する場合には当該信号値を補正するための補正係数を求める補正係数演算部10bと、補正係数演算部10bにおいて演算された補正係数を用いて第二の色空間で示される信号値を補正して補正後の信号値を求める補正部10cと、を備える。補正係数演算部10bは、色域の上限を超えて存在する信号値のうち最も上限から離れた値、及び色域の下限未満に存在する信号値のうち最も下限から離れた値を求め、これらの値の1つから前記補正係数を決定する。この構成により、画像処理装置1では、出力用の色空間において色域外の色についても明度及び色相を変化させることなく(すなわち明度と色相を固定して)その色空間内に収める変換処理を行う画像処理装置において、演算量を抑えて、より高速度での変換処理を実現できる。 As described above, in the present embodiment, the image data represented in the first color space (YCbCr color space) is converted to the second color space by fixing the lightness and the color difference ratio and correcting the color difference. (RGB color space), the signal values of the image data represented in the first color space are represented in the second color space based on a predetermined calculation. A conversion unit 10a that converts into signal values of image data, and if the signal values after conversion in the conversion unit 10a are outside the color gamut corresponding to the second color space in the first color space, the signal values are converted to A correction coefficient calculation unit 10b for obtaining a correction coefficient for correction, and a signal value after correction is obtained by correcting the signal value represented by the second color space using the correction coefficient calculated by the correction coefficient calculation unit 10b. and a correction unit 10c. The correction coefficient calculation unit 10b obtains the value farthest from the upper limit among the signal values existing above the upper limit of the color gamut and the value farthest from the lower limit among the signal values existing below the lower limit of the color gamut. The correction factor is determined from one of the values of . With this configuration, the image processing apparatus 1 performs conversion processing to fit colors outside the color gamut in the output color space into the color space without changing the lightness and hue (i.e., fixing the lightness and hue). In the image processing device, it is possible to reduce the amount of calculation and realize conversion processing at a higher speed.

なお、本発明は、上記実施の形態の構成に限られず、発明の趣旨を変更しない範囲で種々の変形が可能である。また、本発明の目的を達成するために、本発明は、画像処理装置1に含まれる特徴的な構成手段をステップとする画像処理方法としたり、それらの特徴的なステップを含むプログラムとして実現することもできる。そして、そのプログラムは、ROM等に格納しておくだけでなく、USBメモリ等の記録媒体や通信ネットワークを介して流通させることもできる。 The present invention is not limited to the configuration of the above-described embodiment, and various modifications are possible without changing the gist of the invention. Further, in order to achieve the object of the present invention, the present invention is implemented as an image processing method having steps of characteristic constituent means included in the image processing apparatus 1, or as a program including those characteristic steps. can also The program can be distributed not only in a ROM or the like, but also via a recording medium such as a USB memory or a communication network.

また、上述においてデジタル画像の変換処理としてYCbCr色空間をRGB色空間に変換する場合を説明したが、第一の色空間はYCbCr色空間に限定されるのもではなく、他の色空間(例えばYPbPr空間やYUV色空間)でも良い。また、上記の実施の形態の説明では画像処理装置1の各機能をプログラムによって実現する例を記載したがハードウェア的に実現しても良い。 In the above description, the case of converting the YCbCr color space into the RGB color space as the conversion processing of the digital image was explained, but the first color space is not limited to the YCbCr color space, and other color spaces (for example, YPbPr space or YUV color space) may also be used. Also, in the description of the above embodiment, an example in which each function of the image processing apparatus 1 is realized by a program was described, but it may be realized by hardware.

さらに、本発明は、画像処理装置又はコンピュータプログラムに向けて入力データを送信し、画像処理装置又はコンピュータプログラムからの出力データを受信して利用するコンピュータシステムとしても実現できる。本システムに用いる装置は、表示部及び通信部を備えた画像処理装置又はコンピュータと情報を送受信できる情報処理装置などであり、例えば所謂PC、スマートフォン、携帯端末、ゲーム機器などである。 Furthermore, the present invention can also be implemented as a computer system that transmits input data to an image processing device or computer program and receives and uses output data from the image processing device or computer program. A device used in this system is an image processing device having a display unit and a communication unit or an information processing device capable of transmitting and receiving information to and from a computer.

1 画像処理装置
10 制御部
10a 変換部(変換手段)
10b 補正係数演算部(補正係数演算手段)
10c 補正部(補正手段)
11 画像処理部
12 記憶部
13 通信部
14 表示部
15 操作部
16 読取部
1 image processing device 10 control section 10a conversion section (conversion means)
10b correction coefficient calculation unit (correction coefficient calculation means)
10c correction unit (correction means)
REFERENCE SIGNS LIST 11 image processing unit 12 storage unit 13 communication unit 14 display unit 15 operation unit 16 reading unit

Claims (7)

第一の色空間で示される画像データを、明度と色差の比率とを固定し、且つ色差を補正して第二の色空間で示される画像データに変換処理をする画像処理装置であって、
前記第一の色空間で示される画像データの信号値を、所定演算に基づいて前記第二の色空間で示される画像データの信号値に変換する変換手段と、
前記変換手段における変換後の信号値が、前記第一の色空間における前記第二の色空間に対応する色域外に存在する場合に、当該信号値を補正するための補正係数を求める補正係数演算手段と、
前記補正係数演算手段において演算された補正係数を用いて前記第二の色空間で示される信号値を補正して補正後の信号値を求める補正手段と、を備え、
前記補正係数演算手段は、前記色域の上限を超えて存在する信号値のうち最も上限から離れた値、及び前記色域の下限未満に存在する信号値のうち最も下限から離れた値を求め、これらの値の1つから前記補正係数を決定する、ことを特徴とする画像処理装置。
An image processing device for converting image data represented by a first color space into image data represented by a second color space by fixing the ratio of lightness and color difference and correcting the color difference ,
conversion means for converting the signal values of the image data represented by the first color space into the signal values of the image data represented by the second color space based on a predetermined calculation;
correction coefficient calculation for obtaining a correction coefficient for correcting the signal value when the signal value after conversion by the conversion means exists outside the color gamut corresponding to the second color space in the first color space means and
a correction means for correcting the signal value indicated in the second color space using the correction coefficient calculated by the correction coefficient calculation means to obtain a signal value after correction;
The correction coefficient calculation means obtains a value farthest from the upper limit among signal values existing above the upper limit of the color gamut and a value farthest from the lower limit among signal values existing below the lower limit of the color gamut. , determining said correction factor from one of these values.
前記第一の色空間はYCbCr色空間であり、前記第二の色空間はRGB色空間であり、
前記変換手段は、YCbCr色空間における信号値(y,cb,cr)を、RGB色空間における画素値(r,g,b)に変換し、
ここで、yは輝度成分、cb及びcrは色差成分であり、rはRチャネルの輝度値、gはGチャネルの輝度値、bはBチャネルの輝度値であり、
前記補正係数演算手段は、前記画素値(r,g,b)の何れかが、YCbCr色空間におけるRGB色空間に対応する色域外に存在する場合には、前記色域外に存在する画素値(r,g,b)において、前記色域の上限との差の絶対値のうち最も大きい値をΔP、前記色域の下限との差の絶対値のうち最も大きい値をΔNとし、且つΔP又は(1-y)ΔN/yが最も大きな値をとる色成分の前記画素値に基づいて前記補正係数を算出する、ことを特徴とする請求項1記載の画像処理装置。
the first color space is the YCbCr color space and the second color space is the RGB color space;
The converting means converts signal values (y, cb, cr) in the YCbCr color space into pixel values (r, g, b) in the RGB color space,
where y is the luminance component, cb and cr are the color difference components, r is the luminance value of the R channel, g is the luminance value of the G channel, b is the luminance value of the B channel,
If any of the pixel values (r, g, b) exists outside the color gamut corresponding to the RGB color space in the YCbCr color space, the correction coefficient calculation means calculates the pixel value outside the color gamut ( r, g, b), let ΔP be the largest absolute value of the difference from the upper limit of the color gamut, ΔN be the largest absolute value of the difference from the lower limit of the color gamut, and ΔP or 2. The image processing apparatus according to claim 1, wherein the correction coefficient is calculated based on the pixel value of the color component having the largest value of (1-y)ΔN/y.
前記補正係数演算手段において演算される補正係数αは、
前記色域の上限との差の絶対値のうち最も大きい値ΔPから算出する場合には、
α=(1-y)/(ΔP+1―y)
前記色域の下限との差の絶対値のうち最も大きい値ΔNから算出する場合には、
α=y/(ΔN+y)
で算出される、ことを特徴とする請求項2記載の画像処理装置。
The correction coefficient α calculated by the correction coefficient calculation means is
When calculating from the largest value ΔP among the absolute values of the difference from the upper limit of the color gamut,
α = (1-y) / (ΔP + 1-y)
When calculating from the largest value ΔN among the absolute values of the difference from the lower limit of the color gamut,
α=y/(ΔN+y)
3. The image processing apparatus according to claim 2, characterized in that it is calculated by:
第一の色空間で示される画像データを、明度と色差の比率とを固定し、且つ色差を補正して第二の色空間で示される画像データに変換処理をする画像処理装置であって、
前記第一の色空間で示される画像データの信号値を、所定演算に基づいて前記第二の色空間で示される画像データの信号値に変換する変換手段と、
前記変換手段における変換後の信号値が、前記第一の色空間における前記第二の色空間に対応する色域外に存在する場合に、当該信号値を補正するための補正係数を求める補正係数演算手段と、
前記補正係数演算手段において演算された補正係数を用いて前記第二の色空間で示される信号値を補正して補正後の信号値を求める補正手段と、を備え、
前記補正係数演算手段は、前記色域の上限を超えて存在する信号値のうち最も上限から離れた値、及び前記色域の下限未満に存在する信号値のうち最も下限から離れた値を求め、これらの値の1つから前記補正係数を決定し、
前記第一の色空間はYCbCr色空間であり、前記第二の色空間はRGB色空間であり、
前記変換手段は、YCbCr色空間における信号値(y,cb,cr)を、RGB色空間における画素値(r,g,b)に変換し、
ここで、yは輝度成分、cb及びcrは色差成分であり、rはRチャネルの輝度値、gはGチャネルの輝度値、bはBチャネルの輝度値であり、
前記補正係数演算手段は、前記変換手段における変換後の画素値(r,g,b)の何れかの画素値が前記色域の上限を超える場合には、補正係数α=(1-y)/((上限を超えた(r,g,b)の何れかの画素値のうちの最大値)-y)とし、
前記画素値(r,g,b)の何れかの画素値が前記色域の下限未満となる場合には、補正係数α=y/(y-(下限を超えた(r,g,b)の何れかの画素値のうちの最小値))とする、ことを特徴とする画像処理装置。
An image processing device for converting image data represented by a first color space into image data represented by a second color space by fixing the ratio of lightness and color difference and correcting the color difference ,
conversion means for converting the signal values of the image data represented by the first color space into the signal values of the image data represented by the second color space based on a predetermined calculation;
correction coefficient calculation for obtaining a correction coefficient for correcting the signal value when the signal value after conversion by the conversion means exists outside the color gamut corresponding to the second color space in the first color space means and
a correction means for correcting the signal value indicated in the second color space using the correction coefficient calculated by the correction coefficient calculation means to obtain a signal value after correction;
The correction coefficient calculation means obtains a value farthest from the upper limit among signal values existing above the upper limit of the color gamut and a value farthest from the lower limit among signal values existing below the lower limit of the color gamut. , determining said correction factor from one of these values;
the first color space is the YCbCr color space and the second color space is the RGB color space;
The converting means converts signal values (y, cb, cr) in the YCbCr color space into pixel values (r, g, b) in the RGB color space,
where y is the luminance component, cb and cr are the color difference components, r is the luminance value of the R channel, g is the luminance value of the G channel, b is the luminance value of the B channel,
The correction coefficient calculation means calculates a correction coefficient α=(1−y) when any one of the pixel values (r, g, b) after conversion in the conversion means exceeds the upper limit of the color gamut. / ((maximum value of any pixel value of (r, g, b) exceeding the upper limit) - y),
If any of the pixel values (r, g, b) is less than the lower limit of the color gamut, the correction coefficient α = y/(y-(over the lower limit (r, g, b) and the minimum value of any one of the pixel values))).
前記補正係数演算手段は、さらに、複数の補正係数が導出される場合において、当該複数の補正係数のうちから最小のものを選択して前記補正係数とする、ことを特徴とする請求項1乃至4の何れか一項に記載の画像処理装置。 1. The correction coefficient calculating means further selects the smallest one from among the plurality of correction coefficients and uses it as the correction coefficient when a plurality of correction coefficients are derived. 5. The image processing device according to any one of 4. 第一の色空間で示される画像データを、明度と色差の比率とを固定し、且つ色差を補正して第二の色空間で示される画像データに変換処理をする画像処理装置において機能するプログラムであって、
前記第一の色空間で示される画像データの信号値を、所定演算に基づいて前記第二の色空間で示される画像データの信号値に変換する変換ステップと、
前記変換ステップにおける変換後の信号値が、前記第一の色空間における前記第二の色空間に対応する色域外に存在する場合に、当該信号値を補正するための補正係数を求める補正係数演算ステップと、
前記補正係数演算ステップにおいて演算された補正係数を用いて前記第二の色空間で示される信号値を補正して補正後の信号値を求める補正ステップと、を含み、
前記補正係数演算ステップにおいては、前記色域の上限を超えて存在する信号値のうち最も上限から離れた値、及び前記色域の下限未満に存在する信号値のうち最も下限から離れた値を求め、これらの値の1つから前記補正係数を決定する、ことを特徴とするプログラム。
A program that functions in an image processing device that converts image data represented by a first color space into image data represented by a second color space by fixing the ratio of lightness and color difference and correcting the color difference. and
a conversion step of converting the signal values of the image data represented by the first color space into the signal values of the image data represented by the second color space based on a predetermined calculation;
Correction coefficient calculation for obtaining a correction coefficient for correcting the signal value after conversion in the conversion step when the signal value after conversion exists outside the color gamut corresponding to the second color space in the first color space a step;
a correction step of obtaining a post-correction signal value by correcting the signal value indicated in the second color space using the correction coefficient calculated in the correction coefficient calculation step;
In the correction coefficient calculating step, a value farthest from the upper limit among signal values existing above the upper limit of the color gamut and a value farthest from the lower limit among signal values existing below the lower limit of the color gamut are calculated. and determining said correction factor from one of these values.
第一の色空間で示される画像データを、明度と色差の比率とを固定し、且つ色差を補正して第二の色空間で示される画像データに変換処理をする画像処理方法であって、
前記第一の色空間で示される画像データの信号値を、所定演算に基づいて前記第二の色空間で示される画像データの信号値に変換する変換ステップと、
前記変換ステップにおける変換後の信号値が、前記第一の色空間における前記第二の色空間に対応する色域外に存在する場合に、当該信号値を補正するための補正係数を求める補正係数演算ステップと、
前記補正係数演算ステップにおいて演算された補正係数を用いて前記第二の色空間で示される信号値を補正して補正後の信号値を求める補正ステップと、を含み、
前記補正係数演算ステップにおいては、前記色域の上限を超えて存在する信号値のうち最も上限から離れた値、及び前記色域の下限未満に存在する信号値のうち最も下限から離れた値を求め、これらの値の1つから前記補正係数を決定する、ことを特徴とする画像処理方法。
An image processing method for converting image data represented by a first color space into image data represented by a second color space by fixing the ratio of lightness and color difference and correcting the color difference ,
a conversion step of converting the signal values of the image data represented by the first color space into the signal values of the image data represented by the second color space based on a predetermined calculation;
Correction coefficient calculation for obtaining a correction coefficient for correcting the signal value after conversion in the conversion step when the signal value after conversion exists outside the color gamut corresponding to the second color space in the first color space a step;
a correction step of obtaining a post-correction signal value by correcting the signal value indicated in the second color space using the correction coefficient calculated in the correction coefficient calculation step;
In the correction coefficient calculating step, a value farthest from the upper limit among signal values existing above the upper limit of the color gamut and a value farthest from the lower limit among signal values existing below the lower limit of the color gamut are calculated. and determining said correction factor from one of these values.
JP2022114203A 2021-08-13 2022-07-15 Image processing device Active JP7252400B2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2021131891 2021-08-13
JP2021131891 2021-08-13

Publications (2)

Publication Number Publication Date
JP2023026338A JP2023026338A (en) 2023-02-24
JP7252400B2 true JP7252400B2 (en) 2023-04-04

Family

ID=85252612

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2022114203A Active JP7252400B2 (en) 2021-08-13 2022-07-15 Image processing device

Country Status (1)

Country Link
JP (1) JP7252400B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002314827A (en) 2001-04-13 2002-10-25 Sharp Corp Image processing method, image processing device, image forming device equipped therewith, image processing program, and recording medium
JP2003153018A (en) 2001-11-09 2003-05-23 Fuji Xerox Co Ltd Apparatus and method of processing color image signal, and color image signal processing program
JP2003209706A (en) 2002-01-15 2003-07-25 Seiko Epson Corp Output and storage of image-processed image data

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002314827A (en) 2001-04-13 2002-10-25 Sharp Corp Image processing method, image processing device, image forming device equipped therewith, image processing program, and recording medium
JP2003153018A (en) 2001-11-09 2003-05-23 Fuji Xerox Co Ltd Apparatus and method of processing color image signal, and color image signal processing program
JP2003209706A (en) 2002-01-15 2003-07-25 Seiko Epson Corp Output and storage of image-processed image data

Also Published As

Publication number Publication date
JP2023026338A (en) 2023-02-24

Similar Documents

Publication Publication Date Title
JP4375781B2 (en) Image processing apparatus, image processing method, program, and recording medium
JP4341597B2 (en) Gamma curve adjustment device and adjustment point setting method
US8154563B2 (en) Color conversion method and apparatus for display device
JP4905552B2 (en) Image quality adjustment capability measurement method, apparatus and program, and image quality adjustment method, apparatus and program
KR101927968B1 (en) METHOD AND DEVICE FOR DISPLAYING IMAGE BASED ON METADATA, AND RECORDING MEDIUM THEREFOR
US10733957B2 (en) Method and system for display color calibration
US8478039B2 (en) Information processing device and method and program
KR101303874B1 (en) Apparatus and method for gamut mapping
JP5387713B2 (en) Image adjustment apparatus, image adjustment system, and program
US8248432B2 (en) Display apparatus and method of image enhancement thereof
US10783667B2 (en) Information processing device and method, and program, for gamut conversion of content
JP2007251709A (en) Color correction method, color correction apparatus, and color correction program
JP2004023328A (en) Apparatus and method of image processing, program and medium
JP7252400B2 (en) Image processing device
JP5664261B2 (en) Image processing apparatus and image processing program
US20100328343A1 (en) Image signal processing device and image signal processing program
JP4305917B2 (en) Video signal processing apparatus and television apparatus
JP2003333349A (en) Image processing apparatus, image processing method, program, and recording medium
JP2008245024A (en) Generation of lookup table
JP4608509B2 (en) Composite lookup table creation device, composite lookup table creation method, and printing device
KR20160007319A (en) Electronic apparatus and Method for controlling the electronic apparatus thereof
US11869174B2 (en) Image processing apparatus, display apparatus, image processing method, and non-transitory computer readable medium
JP2004110647A (en) Method, device for creating color conversion coefficient, program and storage medium
JP2005252392A (en) Image processing apparatus and method therefor, computer program and computer-readable storage medium
JP2023044689A (en) Image processing unit

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20220716

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20220811

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220906

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20221019

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20230123

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230126

R150 Certificate of patent or registration of utility model

Ref document number: 7252400

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250