JP2010154494A - Device, method and program for video conversion - Google Patents

Device, method and program for video conversion Download PDF

Info

Publication number
JP2010154494A
JP2010154494A JP2009115837A JP2009115837A JP2010154494A JP 2010154494 A JP2010154494 A JP 2010154494A JP 2009115837 A JP2009115837 A JP 2009115837A JP 2009115837 A JP2009115837 A JP 2009115837A JP 2010154494 A JP2010154494 A JP 2010154494A
Authority
JP
Japan
Prior art keywords
conversion
video
value
color
creating
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
JP2009115837A
Other languages
Japanese (ja)
Inventor
Kenji Hara
謙治 原
Atsuhiko Maeda
篤彦 前田
Hiroto Inagaki
博人 稲垣
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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone 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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2009115837A priority Critical patent/JP2010154494A/en
Publication of JP2010154494A publication Critical patent/JP2010154494A/en
Pending legal-status Critical Current

Links

Abstract

<P>PROBLEM TO BE SOLVED: To convert colors while suppressing excessive conversion of a contrast when a video is color-converted. <P>SOLUTION: An area division unit 22 divides the video into areas of a plurality of objects, and an RGB conversion parameter generation unit 23 generates histograms of the respective areas to generate RGB conversion parameters for distributing the histograms of the respective areas to a target distribution range. An RGB conversion function generation unit 25 generates color conversion functions by using the RGB conversion parameters. A video conversion unit 27 applies the color conversion functions to the video to convert the video, calculates conversion synthesis coefficients of respective pixels of an input video, and adjusts intensity of conversion of the video according as whether the conversion synthesis coefficients are large or small when generating a video from the input video and the video generated by the conversion. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、映像の階調を自動で変換する技術に関するものであり、特に、デジタル映像処理装置において、入力された映像の階調を変換する技術に関する。   The present invention relates to a technique for automatically converting the gradation of an image, and more particularly to a technique for converting the gradation of an input image in a digital image processing apparatus.

映像のヒストグラムは、映像内の各ピクセルに対する明暗値の分布を示したものである。コントラストストレッチングは、明暗値の分布が偏った画像について明暗値を低い値から高い値まで広く分布させることによって映像のコントラストを向上させる手法である。コントラストストレッチングを通して暗すぎる映像は明るくなり、明るすぎる映像は暗くなって適当な明暗値を維持する。すなわち、映像の輝度値分布を修正することによって、映像の全体的なコントラストバランスが改善される。   The histogram of the video shows the distribution of light and dark values for each pixel in the video. Contrast stretching is a technique for improving the contrast of an image by widely distributing the light and dark values from a low value to a high value for an image with a skewed light and dark value distribution. Through contrast stretching, an image that is too dark becomes brighter, and an image that is too bright becomes darker to maintain an appropriate brightness value. That is, the overall contrast balance of the video is improved by correcting the luminance value distribution of the video.

図19は、従来のコントラストストレッチング装置の構成を示すブロック図である。同図に示すように、従来のコントラストストレッチング装置は、分布計算部42及びストレッチング部43を有する。   FIG. 19 is a block diagram showing a configuration of a conventional contrast stretching apparatus. As shown in the figure, the conventional contrast stretching apparatus has a distribution calculation unit 42 and a stretching unit 43.

分布計算部42は、入力された映像から明暗値を計数してヒストグラム値またはヒストグラム関数を求める。目標値入力部は目標最低値と目標最高値とが入力され、入力された値をストレッチング部43に出力する。ストレッチング部43は、分布計算部42で求めたヒストグラム関数を用いて最低値と最高値を有する明暗値を求め、入力映像の明度の最低値と最高値が目標分布入力部に入力された目標最低値と目標最高値とに一致するようにヒストグラムを変換する。ストレッチング部43の処理において、目標最低値が0であり、目標最高値が255であれば、映像は0から255までの明暗値を有し映像のコントラストが増加する。   The distribution calculation unit 42 counts the brightness value from the input video to obtain a histogram value or a histogram function. The target value input unit receives the target minimum value and the target maximum value, and outputs the input values to the stretching unit 43. The stretching unit 43 obtains a light / dark value having a minimum value and a maximum value using the histogram function obtained by the distribution calculation unit 42, and a target value in which the minimum value and the maximum value of the brightness of the input video are input to the target distribution input unit. Transform the histogram to match the lowest and target highest values. In the processing of the stretching unit 43, if the target minimum value is 0 and the target maximum value is 255, the image has brightness values from 0 to 255, and the contrast of the image increases.

また、上述したヒストグラムの拡大処理を映像のR成分とG成分とB成分とに対して同様に施すことで色味を保ったままコントラストを増加させることが可能となる。或いは、R成分とG成分とB成分とに対してそれぞれ独立にヒストグラムの拡大処理を施すことで、色味の偏りが少ないコントラストが増加した映像を作成することが可能となる。なお、本願に関連する先行技術文献としては、次のものがある。   Further, the above-described histogram enlarging process is similarly applied to the R component, the G component, and the B component of the video, so that the contrast can be increased while maintaining the color. Alternatively, it is possible to create a video with an increased contrast with little color bias by performing histogram enlargement processing independently on the R component, the G component, and the B component. As prior art documents related to the present application, there are the following.

特開平4−257082号公報Japanese Patent Laid-Open No. 4-257082

しかし、従来の技術に係るコントラストストレッチングの場合、色味を変換するためにR成分とG成分とB成分とに対してそれぞれコントラスト拡大処理を施した場合、背景などの色味が過剰に変換されて色のバランスが崩れてしまう場合がある。特に、肌色のみを変換すると、茶色に染めてある髪などとの色のバランスが崩れることがあり望み通りに調整することができなかった。   However, in the case of contrast stretching according to the conventional technology, when the contrast enlargement process is performed on the R component, the G component, and the B component in order to convert the color, the color of the background is excessively converted. The color balance may be lost. In particular, when only the skin color is converted, the color balance with the hair dyed in brown may be lost, and it cannot be adjusted as desired.

本発明は、上記各問題を解決するためになされたものであり、その課題とするところは、映像の色変換の際に過剰なコントラストの変換を抑えながら色を変換でき、特に、肌色のみを変換しても、茶色に染めてある髪などとの色のバランスが崩れることがなく、望み通りに調整することができる映像変換装置を提供することにある。   The present invention has been made to solve the above-mentioned problems, and the problem is that the color can be converted while suppressing excessive contrast conversion during the color conversion of the image, and in particular, only the skin color can be converted. An object of the present invention is to provide a video conversion device that can adjust as desired without causing a loss of color balance with brown hair or the like even after conversion.

第1の本発明に係る映像変換装置は、入力された映像を記憶する記憶手段と、前記映像を読み出し、複数の領域に分割して記憶手段に記憶させる領域分割手段と、所望の色成分における前記各領域のヒストグラムを作成するヒストグラム作成手段と、前記各ヒストグラムに対して目標とする分布範囲を指定する目標範囲指定手段と、前記各ヒストグラムを前記目標の分布範囲に分布させるように前記映像を変換するための変換パラメタを作成する変換パラメタ作成手段と、前記変換パラメタを用いて色変換関数を作成する色変換関数作成手段と、前記色変換関数を前記映像に適用して映像を変換する映像変換手段と、前記入力された映像における各ピクセルの変換合成係数を算出する変換合成係数算出手段と、前記入力された映像と前記変換後の映像とから変換調整映像を作成する際に、前記変換合成係数の大小に応じて映像の変換の強度を調整する変換調整映像作成手段とを有し、前記領域分割手段は、顔の領域を検出し、前記ヒストグラム作成手段は、前記各領域についてR成分、G成分、B成分のヒストグラムを作成し、前記変換合成係数算出手段は、肌色からの距離を算出することを特徴とする。   According to a first aspect of the present invention, there is provided a video conversion device, a storage unit for storing an input video, a region dividing unit for reading the video, dividing the video into a plurality of regions, and storing the divided video in a storage unit, and a desired color component Histogram creation means for creating a histogram of each region; target range designating means for designating a target distribution range for each histogram; and the video so that each histogram is distributed in the target distribution range. Conversion parameter creation means for creating a conversion parameter for conversion, color conversion function creation means for creating a color conversion function using the conversion parameter, and video for converting the video by applying the color conversion function to the video Conversion means; conversion synthesis coefficient calculation means for calculating a conversion synthesis coefficient of each pixel in the input video; and the input video and the conversion Conversion adjustment image creating means for adjusting the intensity of image conversion according to the magnitude of the conversion synthesis coefficient when creating a conversion adjustment image from the image of the image, and the region dividing means And the histogram creating means creates a histogram of R component, G component, and B component for each region, and the conversion synthesis coefficient calculating means calculates a distance from the skin color.

本発明にあっては、映像を複数の領域に分割し、各領域のヒストグラムを目標の分布範囲に分布させるべく変換パラメタを作成し、変換パラメタを用いて色変換関数を作成し、色変換関数を合成するための合成係数を算出し、該合成係数を用いて、複数の色変換関数を合成し、合成後の色変換関数を適用して映像を変換し、入力された映像における各ピクセルの変換合成係数を算出し、入力された映像と変換後の映像とから変換調整映像を作成する際に、変換合成係数の大小に応じて映像の変換の強度を調整することで、映像の色変換の際に過剰なコントラストの変換を抑えながら色を変換することができ、特に、肌色のみを変換しても、茶色に染めてある髪などとの色のバランスが崩れることがなく、望み通りに調整することができる。   In the present invention, the image is divided into a plurality of regions, a conversion parameter is created to distribute the histogram of each region in the target distribution range, a color conversion function is created using the conversion parameter, and the color conversion function A composite coefficient for combining the image is calculated, a plurality of color conversion functions are combined using the composite coefficient, the image is converted by applying the combined color conversion function, and each pixel in the input image is converted. Color conversion of the video by calculating the conversion synthesis coefficient and adjusting the intensity of the video conversion according to the size of the conversion synthesis coefficient when creating the conversion adjustment video from the input video and the converted video In this case, the color can be converted while suppressing excessive contrast conversion.In particular, even if only the skin color is converted, the color balance with the hair that has been dyed in brown will not be lost. Can be adjusted.

上記映像変換装置において、前記変換調整映像作成手段は、前記変換後の映像の輝度を使用することにより輝度の変換の強弱を調整しない一方、色味の変換の強弱を調整することを特徴とする。本発明にあっては、色味の変換の強弱のみを調整する。   In the video conversion device, the conversion adjustment video creation means does not adjust the intensity of luminance conversion by using the luminance of the video after conversion, but adjusts the intensity of color conversion. . In the present invention, only the strength of color conversion is adjusted.

上記映像変換装置において、前記変換調整映像作成手段は、前記入力された映像のピクセルと前記変換後の映像のピクセルのR値、G値、B値それぞれの差に前記変換合成係数を乗じることで高速変換テーブルを作成し、該高速変換テーブルを利用して前記入力された映像のピクセルの輝度と前記変換後の映像のピクセルの輝度との差を算出することを特徴とする。本発明にあっては、映像の変換を高速化する。   In the video conversion apparatus, the conversion adjustment video creation means may multiply the difference between the R value, the G value, and the B value of the input video pixel and the converted video pixel by the conversion synthesis coefficient. A high-speed conversion table is created, and a difference between the luminance of the pixel of the input video and the luminance of the pixel of the converted video is calculated using the high-speed conversion table. In the present invention, the speed of video conversion is increased.

上記映像変換装置において、前記変換調整映像作成手段は、前記入力された映像を前記変換合成係数を用いて変換する手段と、当該変換後の映像のピクセルのR値、G値、B値の少なくとも1つに予め定められた値を加える手段と、当該予め定められた値を加えられたR値、G値、B値による映像と前記入力された映像とから変換調整映像を作成する手段とを有することを特徴とする。本発明にあっては、例えば、肌色領域の変換を強くする。   In the video conversion device, the conversion adjustment video creation means includes means for converting the input video using the conversion synthesis coefficient, and at least R, G, and B values of pixels of the video after the conversion. Means for adding a predetermined value to one, and means for creating a conversion adjustment video from the video based on the R value, G value, and B value added with the predetermined value and the input video. It is characterized by having. In the present invention, for example, the skin color region is strongly converted.

上記映像変換装置において、前記変換合成係数を用いた変換後の映像のピクセルのR値、G値、B値の少なくとも1つに前記予め定められた値を加えることに対応して前記目標範囲指定手段に指定される目標の分布範囲が変更されること特徴とする。本発明にあっては、例えば、肌色領域の変換を強くした影響が、肌色以外の領域に及ばないようにする。   In the video conversion apparatus, the target range designation is performed in response to adding the predetermined value to at least one of an R value, a G value, and a B value of a pixel of a video after conversion using the conversion synthesis coefficient. The target distribution range designated by the means is changed. In the present invention, for example, the effect of strengthening the conversion of the skin color area is prevented from affecting the areas other than the skin color.

第2の本発明に係る映像変換方法は、映像変換装置により行う映像変換方法であって、入力された映像を記憶手段に記憶させるステップと、前記映像を読み出し、複数の領域に分割して記憶手段に記憶させるステップと、所望の色成分における前記各領域のヒストグラムを作成するステップと、前記各ヒストグラムに対して目標とする分布範囲を指定するステップと、前記各ヒストグラムを前記目標の分布範囲に分布させるように前記映像を変換するための変換パラメタを作成するステップと、前記変換パラメタを用いて色変換関数を作成するステップと、前記変換パラメタを用いて色変換関数を作成するステップと、前記色変換関数を前記映像に適用して映像を変換するステップと、前記入力された映像における各ピクセルの変換合成係数を算出するステップと、前記入力された映像と前記変換後の映像とから変換調整映像を作成する際に、前記変換合成係数の大小に応じて映像の変換の強度を調整するステップとを有し、前記映像を複数の領域に分割するステップでは、顔の領域を検出し、前記ヒストグラムを作成するステップでは、前記各領域についてR成分、G成分、B成分のヒストグラムを作成し、前記変換合成係数を算出するステップでは、肌色からの距離を算出することを特徴とする。   A video conversion method according to a second aspect of the present invention is a video conversion method performed by a video conversion device, the step of storing an input video in a storage means, and the video is read out and divided into a plurality of areas and stored. Means for storing, a step of creating a histogram of each region in a desired color component, a step of designating a target distribution range for each histogram, and each histogram as the target distribution range Creating a conversion parameter for converting the video to be distributed, creating a color conversion function using the conversion parameter, creating a color conversion function using the conversion parameter, and Applying a color conversion function to the video to convert the video, and conversion synthesis coefficients of each pixel in the input video Calculating a conversion adjustment video from the input video and the converted video, and adjusting a conversion strength of the video according to the size of the conversion synthesis coefficient; In the step of dividing the video into a plurality of regions, a face region is detected, and in the step of creating the histogram, a histogram of R component, G component, and B component is created for each region, and the transform synthesis coefficient is calculated. In the calculating step, a distance from the skin color is calculated.

第3の本発明に係る映像変換プログラムは、入力された映像を記憶手段に記憶させる処理と、前記映像を読み出し、複数の領域に分割して記憶手段に記憶させる処理と、所望の色成分における前記各領域のヒストグラムを作成する処理と、前記各ヒストグラムに対して目標とする分布範囲を指定する処理と、前記各ヒストグラムを前記目標の分布範囲に分布させるように前記映像を変換するための変換パラメタを作成する処理と、前記変換パラメタを用いて色変換関数を作成する処理と、前記変換パラメタを用いて色変換関数を作成する処理と、前記色変換関数を前記映像に適用して映像を変換する処理と、前記入力された映像における各ピクセルの変換合成係数を算出する処理と、前記入力された映像と前記変換後の映像とから変換調整映像を作成する際に、前記変換合成係数の大小に応じて映像の変換の強度を調整する処理とをコンピュータに実行させ、前記映像を複数の領域に分割する処理では、顔の領域を検出させ、前記ヒストグラムを作成する処理では、前記各領域についてR成分、G成分、B成分のヒストグラムを作成させ、前記変換合成係数を算出する処理では、肌色からの距離を算出させることを特徴とする。   According to a third aspect of the present invention, there is provided a video conversion program, a process for storing an input video in a storage unit, a process for reading the video, dividing it into a plurality of areas and storing it in a storage unit, and a desired color component A process for creating a histogram for each region; a process for specifying a target distribution range for each histogram; and a conversion for converting the video so that each histogram is distributed in the target distribution range. A process of creating a parameter, a process of creating a color conversion function using the conversion parameter, a process of creating a color conversion function using the conversion parameter, and applying the color conversion function to the video A conversion adjustment process, a conversion calculation coefficient for each pixel in the input video, a conversion adjustment coefficient from the input video and the converted video. In the process of adjusting the intensity of the conversion of the video according to the magnitude of the conversion synthesis coefficient, in the process of dividing the video into a plurality of areas, to detect the face area, In the process of creating the histogram, a histogram of R component, G component, and B component is created for each region, and in the process of calculating the conversion synthesis coefficient, the distance from the skin color is calculated.

本発明によれば、映像の色変換の際に過剰なコントラストの変換を抑えながら色を変換することができ、特に、肌色のみを変換しても、茶色に染めてある髪などとの色のバランスが崩れることがなく、望み通りに調整することができる。   According to the present invention, it is possible to convert colors while suppressing excessive contrast conversion at the time of color conversion of an image. In particular, even if only skin color is converted, the color of hair that is dyed brown or the like The balance can be adjusted without any loss.

一実施形態における映像変換装置の全体的な構成を示すブロック図である。It is a block diagram which shows the whole structure of the video converter in one Embodiment. 顔領域情報と黒目領域情報を検出し、入力映像を顔領域と黒目領域に分割するための領域分割部22の構成を示すブロック図である。It is a block diagram which shows the structure of the area division part 22 for detecting face area information and black eye area information, and dividing an input image | video into a face area and a black eye area. 領域分割部22で人の顔を検出する際の処理の一例を示す図である。It is a figure which shows an example of the process at the time of detecting a human face in the area | region division part. RGB分布情報の一例を示す図である。It is a figure which shows an example of RGB distribution information. ある色成分におけるピクセルpの色値がxとなる確率を表す確率密度関数(ヒストグラム関数)の一例を示す図である。It is a figure which shows an example of the probability density function (histogram function) showing the probability that the color value of the pixel p in a certain color component will be x. 図5に示す確率密度関数についての累積分布関数を示す図である。It is a figure which shows the cumulative distribution function about the probability density function shown in FIG. 累積割合値Aから制御値を算出するための制御値算出関数の一例を示す図である。It is a figure which shows an example of the control value calculation function for calculating a control value from the accumulation ratio value A. 図4の各RGB分布レコードに制御値と目標値を追加したものを示す図である。It is a figure which shows what added the control value and the target value to each RGB distribution record of FIG. 入力映像の輝度ヒストグラムの一例を示す図である。It is a figure which shows an example of the brightness | luminance histogram of an input image | video. 図9に用いた入力映像のRGBデータに色変換関数を適用した後の映像の輝度ヒストグラムを示す図である。It is a figure which shows the luminance histogram of the image | video after applying a color conversion function to the RGB data of the input image | video used for FIG. 図4の各RGB分布レコードにR目標値、G目標値、B目標値の情報を追加したものを示す図である。FIG. 5 is a diagram showing information obtained by adding R target value, G target value, and B target value information to each RGB distribution record of FIG. 4. R成分、G成分、B成分のそれぞれの色変換用のルックアップテーブルの一例を示す図である。It is a figure which shows an example of the look-up table for each color conversion of R component, G component, and B component. 変換LUTを利用して色味を調整しつつ入力映像の変換を行う映像変換部27の構成を示すブロック図である。It is a block diagram which shows the structure of the image | video conversion part 27 which converts an input image | video, adjusting a color using conversion LUT. 色味調整部272で背景の色味の変化を抑える場合の一例を示す図である。It is a figure which shows an example in the case of suppressing the change of the color of a background in the color adjustment part 272. FIG. 第2の実施の形態における映像変換部27の構成を示すブロック図である。It is a block diagram which shows the structure of the video conversion part 27 in 2nd Embodiment. 第2の実施の形態の色味調整部272で背景の色味の変化を抑える場合の一例を示す図である。It is a figure which shows an example in the case of suppressing the change of the color of a background in the color adjustment part 272 of 2nd Embodiment. 目標色のR値より20低い値をR目標値に設定した目標RGB分布レコードを示す図である。It is a figure which shows the target RGB distribution record which set 20 values lower than R value of the target color to R target value. 背景の階調を維持しつつ顔領域の色に変換する過程でのヒストグラムの変化を示す図である。It is a figure which shows the change of the histogram in the process of converting into the color of a face area, maintaining the gradation of a background. 従来のコントラストストレッチング装置の構成を示すブロック図である。It is a block diagram which shows the structure of the conventional contrast stretching apparatus.

[第1の実施の形態]
図1は、第1の実施形態における映像変換装置の全体的な構成を示すブロック図である。同図に示すように、本映像変換装置は、入力装置1、中央処理制御装置2、記憶装置3を有する。入力装置1は、映像信号入力部11、シャッター入力部12、目標分布選択部13を有し、中央処理制御装置2は、フレーム抽出部21、領域分割部22、RGB変換パラメタ作成部23、目標RGB分布作成部24、RGB変換関数作成部25、変換LUT(ルックアッフ゜テーフ゛ル)作成部26、映像変換部27を有し、記憶装置3は、各部が出力する情報を記憶する記憶部の他、RGB分布記憶部31、変換LUT記憶部32を有する。
[First Embodiment]
FIG. 1 is a block diagram showing an overall configuration of a video conversion apparatus according to the first embodiment. As shown in FIG. 1, the video conversion apparatus includes an input device 1, a central processing control device 2, and a storage device 3. The input device 1 includes a video signal input unit 11, a shutter input unit 12, and a target distribution selection unit 13. The central processing control device 2 includes a frame extraction unit 21, a region division unit 22, an RGB conversion parameter creation unit 23, a target The storage device 3 includes an RGB distribution generation unit 24, an RGB conversion function generation unit 25, a conversion LUT (look-up table) generation unit 26, and a video conversion unit 27. The storage device 3 stores information output by each unit, An RGB distribution storage unit 31 and a conversion LUT storage unit 32 are included.

本映像変換装置は、専用のハードウェアとして構成してもよいし、汎用的なコンピュータを用いて構成し、各部の処理をコンピュータプログラムによって実行させるようにしてもよい。尚、各部が処理した結果は、記憶部に読み出し可能に記憶される。   The video conversion apparatus may be configured as dedicated hardware, or may be configured using a general-purpose computer so that the processing of each unit is executed by a computer program. The results processed by each unit are stored in the storage unit so as to be readable.

映像信号入力部11は、映像信号が入力されると、これをフレーム抽出部21と映像変換部27に出力する。ここでは、映像信号入力部11が出力する映像を入力映像と呼ぶ。   When the video signal is input, the video signal input unit 11 outputs the video signal to the frame extraction unit 21 and the video conversion unit 27. Here, the video output from the video signal input unit 11 is referred to as an input video.

本実施形態で扱う入力映像は、複数のフレームによって構成される動画であり、各フレームは、複数のピクセルによって構成される静止画像である。入力映像の幅をwidth、高さをheightで表すと、各フレームは、width×height個のピクセルによって構成される。各ピクセルは、RGBカラーモデルで色を表現するデータであり、フレームにおけるx座標値とy座標値とR値とG値とB値によって構成され、x座標値は1以上width以下の整数値であり、y座標値は1以上height以下の整数値であり、R値とG値とB値はそれぞれ0以上255以下の整数値である。   The input video handled in the present embodiment is a moving image composed of a plurality of frames, and each frame is a still image composed of a plurality of pixels. When the width of the input video is represented by width and the height is represented by height, each frame is composed of width × height pixels. Each pixel is data representing a color in the RGB color model, and is composed of an x coordinate value, a y coordinate value, an R value, a G value, and a B value in the frame. The x coordinate value is an integer value of 1 or more and width or less. Yes, the y-coordinate value is an integer value between 1 and height, and the R value, G value, and B value are integer values between 0 and 255, respectively.

目標分布選択部13では、ユーザが選択した目標RGB分布名を目標RGB分布作成部24に出力する。   The target distribution selection unit 13 outputs the target RGB distribution name selected by the user to the target RGB distribution creation unit 24.

目標RGB分布作成部24は、目標RGB分布名とRGB分布情報群が入力され、目標RGB分布情報を作成し、作成された目標RGB分布情報はRGB変換パラメタ作成部23に出力される。なお、RGB分布情報群は、RGB分布記憶部31から読み出すことで入力される。   The target RGB distribution creation unit 24 receives the target RGB distribution name and the RGB distribution information group, creates the target RGB distribution information, and outputs the created target RGB distribution information to the RGB conversion parameter creation unit 23. Note that the RGB distribution information group is input by reading from the RGB distribution storage unit 31.

シャッター入力部12は、ユーザによりシャッター操作が行われると、フレーム抽出部21にシャッター操作を伝えるシャッター信号を出力する。   When a shutter operation is performed by the user, the shutter input unit 12 outputs a shutter signal that tells the frame extraction unit 21 of the shutter operation.

フレーム抽出部21は、映像信号とシャッター信号が入力され、静止画像を出力する。フレーム抽出部21が出力する静止画像は入力映像から取り出した1フレームの静止画像である。   The frame extraction unit 21 receives a video signal and a shutter signal and outputs a still image. The still image output from the frame extraction unit 21 is a one-frame still image extracted from the input video.

領域分割部22は、入力映像を複数の対象物の領域に分割する。   The area dividing unit 22 divides the input image into a plurality of object areas.

RGB変換パラメタ作成部23は、R成分・G成分・B成分における各領域のヒストグラムを作成すると共に目標RGB分布作成部24が出力する目標値を入力として受け取り、RGB変換パラメタを作成する。   The RGB conversion parameter creation unit 23 creates a histogram of each region in the R component, the G component, and the B component, receives the target value output from the target RGB distribution creation unit 24 as an input, and creates an RGB conversion parameter.

RGB変換関数作成部25は、RGB変換パラメタが入力され、R成分・G成分・B成分のヒストグラムがRGB変換パラメタに合致する分布範囲となるように各ヒストグラムに対応したR変換関数とG変換関数とB変換関数とを作成する。   The RGB conversion function creating unit 25 receives the RGB conversion parameters, and the R conversion function and the G conversion function corresponding to each histogram so that the histograms of the R component, the G component, and the B component are in a distribution range that matches the RGB conversion parameters. And B conversion function.

領域分割部22は、静止画像が入力され、領域情報群を出力する。領域情報群は、複数の領域情報によって構成され、各領域情報は領域名Rと領域集合RegionR によって構成される。ピクセルpのx座標値をxp 、y座標値をyp とすると領域集合RegionR
と表される。領域分割部22では、静止画像の被写体が人物である場合は、全体領域情報と顔領域情報と黒目領域情報を検出してもよい。或いは静止画像の被写体が物体である場合には、全体領域情報と被写体領域情報と背景領域情報を検出してもよい。以下では被写体が人物である場合に、全体領域情報と顔領域情報と黒目領域情報を検出するときの例について説明する。
The region dividing unit 22 receives a still image and outputs a region information group. The area information group includes a plurality of area information, and each area information includes an area name R and an area set Region R. If the x coordinate value of pixel p is xp and the y coordinate value is yp, the region set Region R is
It is expressed. The area dividing unit 22 may detect the entire area information, the face area information, and the black eye area information when the subject of the still image is a person. Alternatively, when the subject of the still image is an object, the entire region information, the subject region information, and the background region information may be detected. Hereinafter, an example in which the entire area information, the face area information, and the black eye area information are detected when the subject is a person will be described.

ここでは、全体領域情報は領域名WHOLEと全体領域集合RegionWHOLEによって構成され、顔領域集合は領域名FACEと顔領域集合RegionFACEによって構成され、黒目領域集合は領域名EYEと黒目領域集合RegionEYEによって構成されるものとする。なお、全体領域集合RegionWHOLEとは、入力された静止画像に含まれるすべてのピクセルを含む集合である。 Here, the whole area information is composed of the area name WHOLE and the whole area set Region WHOLE , the face area set is composed of the area name FACE and the face area set Region FACE , and the black eye area set is the area name EYE and the black eye area set Region EYE. It shall be comprised by. The whole region set Region WHOLE is a set including all pixels included in the input still image.

図2は、顔領域情報と黒目領域情報を検出し、入力映像を顔領域と黒目領域に分割するための領域分割部22の構成を示すブロック図である。領域分割部22は、画像スケール変換部221と、検出対象領域切出部222と、空間周波数分析部223と、顔候補判定部224と、顔候補選択部225と、肌領域抽出部226と、黒目領域抽出部227と、によって構成される。   FIG. 2 is a block diagram showing a configuration of the area dividing unit 22 for detecting face area information and black eye area information and dividing an input image into a face area and a black eye area. The region dividing unit 22 includes an image scale converting unit 221, a detection target region extracting unit 222, a spatial frequency analyzing unit 223, a face candidate determining unit 224, a face candidate selecting unit 225, a skin region extracting unit 226, And a black eye region extraction unit 227.

領域分割部22における顔候補の選択はHaar型の特徴量を用い、AdaBoost学習法、及びカスケード構造検出器による方法を用いる(例えば、特開2006−293720号公報参照)。   Selection of face candidates in the region dividing unit 22 uses Haar-type feature values, and uses an AdaBoost learning method and a method using a cascade structure detector (see, for example, JP-A-2006-293720).

検出対象領域切出部222では、スケール変換された画像から既定のサイズの領域の切り出しを行う。ただし、ここで扱う領域の形状は、任意形状であってよいものとする。   The detection target region cutout unit 222 cuts out a region having a predetermined size from the scale-converted image. However, the shape of the region handled here may be an arbitrary shape.

空間周波数分析部223では、切り出された領域に対し空間周波数フィルタリングを行う。例えば、AdaBoost学習法、及びカスケード検出器構造をもつ、Haar型の特徴量検出による手法を用いてもよい。   The spatial frequency analysis unit 223 performs spatial frequency filtering on the cut out region. For example, an AdaBoost learning method and a Haar type feature amount detection method having a cascade detector structure may be used.

顔候補判定部224では、空間周波数分析部223の出力値をもとに、領域が顔領域候補となり得るかを判定する。   The face candidate determination unit 224 determines whether the region can be a face region candidate based on the output value of the spatial frequency analysis unit 223.

顔候補選択部225では、顔候補となり得ると判断された顔領域候補のうち面積が最大となる顔領域候補を選択し、出力する。   The face candidate selection unit 225 selects and outputs a face area candidate having the maximum area among face area candidates determined to be face candidates.

肌領域抽出部226では、顔領域候補を入力として顔領域集合RegionFACEを出力する。顔領域集合RegionFACEは、顔領域候補内に含まれるピクセルのうち、ピクセルの色が肌色であるものによって構成される。すなわちRegionFACEは、ピクセルpのx座標値をxp 、y座標値をyp 、R値をrp、G値をgp 、B値をbp とすると
と表される。なお、肌色として扱うRGB値は予め設定してあるものとする。例えばYUVカラーモデルにおいてCb 値が−40以上−20以下でありCb 値が15以上35以下の値を肌色とするなどの手法を用いる。
The skin area extraction unit 226 receives a face area candidate and outputs a face area set Region FACE . The face area set Region FACE is composed of pixels included in face area candidates whose pixel color is skin color. In other words, the Region FACE has xp as the x coordinate value of pixel p, yp as the y coordinate value, rp as the R value, gp as the G value, and bp as the B value.
It is expressed. Note that the RGB values handled as skin color are set in advance. For example, in the YUV color model, a method is used in which the Cb value is -40 or more and -20 or less and the Cb value is 15 or more and 35 or less as skin color.

黒目領域抽出部227では、顔領域候補を入力として黒目領域集合RegionEYEを出力する。黒目領域集合RegionEYEは、顔領域候補内に含まれるピクセルのうち、輝度値が低いピクセルによって構成される。より具体的には顔領域候補内に含まれるピクセルのうち輝度値の低い順に1%のピクセル群を黒目領域集合とする。図3は、領域分割部22で人の顔を検出する際の処理の一例を示す図である。 The black eye region extraction unit 227 outputs a black eye region set Region EYE with the face region candidate as an input. The black eye region set Region EYE is composed of pixels with low luminance values among the pixels included in the face region candidate. More specifically, among the pixels included in the face area candidate, a 1% pixel group is set as a black eye area set in order of increasing luminance value. FIG. 3 is a diagram illustrating an example of processing when the area dividing unit 22 detects a human face.

目標RGB分布作成部24は、目標RGB分布名とRGB分布情報群が入力され、目標RGB分布情報を出力する。RGB分布情報群はRGB分布記憶部31より読み出される。RGB分布情報群は複数のRGB分布情報によって構成され、各RGB分布情報はRGB分布名を持ち、複数のRGB分布レコードによって構成される。図4は、RGB分布情報の一例を示す図である。各RGB分布レコードはレコード番号と領域名と累積割合値と目標色によって構成される。ここで累積割合値0以上1以下の少数値である。   The target RGB distribution creation unit 24 receives the target RGB distribution name and the RGB distribution information group and outputs target RGB distribution information. The RGB distribution information group is read from the RGB distribution storage unit 31. The RGB distribution information group includes a plurality of RGB distribution information, and each RGB distribution information has an RGB distribution name and includes a plurality of RGB distribution records. FIG. 4 is a diagram illustrating an example of RGB distribution information. Each RGB distribution record is composed of a record number, a region name, a cumulative ratio value, and a target color. Here, the cumulative ratio value is a decimal value between 0 and 1.

本実施形態において扱う色成分について説明すると、Luminance(輝度:YCb CrカラーモデルにおけるY成分)、Cb(YCbCrカラーモデルにおけるCb成分)、Cr(YCbCrカラーモデルにおけるCr成分)、墨(CMYKカラーモデルにおけるK成分)、レッド(RGBカラーモデルにおけるR成分)、グリーン(RGBカラーモデルにおけるG成分)、ブルー(RGBカラーモデルにおけるB成分)、色相(HSVカラーモデルにおけるH成分)、彩度(HSVカラーモデルにおけるS成分)、明度(HSVカラーモデルにおけるV成分)の10種類であり、全ての色成分において最小値は0、最大値は255とする。   The color components handled in this embodiment will be described. Luminance (luminance: Y component in the YCbCr color model), Cb (Cb component in the YCbCr color model), Cr (Cr component in the YCbCr color model), black (in the CMYK color model) K component), red (R component in RGB color model), green (G component in RGB color model), blue (B component in RGB color model), hue (H component in HSV color model), saturation (HSV color model) S component) and brightness (V component in the HSV color model), and the minimum value is 0 and the maximum value is 255 in all color components.

RGB変換パラメタ作成部23は静止画像と領域情報群と目標RGB分布情報が入力され、RGB変換パラメタを作成し、出力する。RGB変換パラメタは、以下の手順によって作成される。   The RGB conversion parameter creation unit 23 receives a still image, a region information group, and target RGB distribution information, and creates and outputs an RGB conversion parameter. The RGB conversion parameter is created by the following procedure.

まず、色成分Componentにおけるピクセルpの色値を返す色値算出関数を
とする。ここでg(Component,p,x)を
と定義すると、ピクセルの集合Pにおいて領域集合RegionR にも含まれるピクセルpを取り出したとき、色成分Componentにおけるピクセルpの色値がxとなる確率、すなわちcolor(p,Component)=xとなる確率を表す確率密度関数(ヒストグラム関数)frequency(P,RegionR,Component,x)は
と定義される。
First, a color value calculation function that returns the color value of the pixel p in the color component Component
And Where g (Component, p, x)
If the pixel p included in the region set Region R in the pixel set P is extracted, the probability that the color value of the pixel p in the color component Component is x, that is, color (p, Component) = x. Probability density function (histogram function) frequency (P, Region R , Component, x)
It is defined as

例えば、画像全体領域情報(領域名WHOLE、領域集合RegionWHOLE)と、顔領域情報(領域名FACE、領域集合RegionFACE)と、黒目領域情報(領域名EYE、領域集合RegionEYE)との領域情報があったとしたとき、ある画像を表すピクセルの集合をPyとし、輝度の色成分をYとすると、全体領域の輝度のヒストグラムは、frequency(Py,RegionWHOLE,Y,x)と表され、同様に顔領域の輝度のヒストグラムは、frequency(P,RegionFACE,Y,x)と表され、黒目領域の輝度のヒストグラムは、frequency(P,RegionEYE,Y,x)と表される。 For example, region information of whole image region information (region name WHOLE, region set Region WHOLE ), face region information (region name FACE, region set Region FACE ), and black eye region information (region name EYE, region set Region EYE ) If the set of pixels representing an image is Py and the luminance color component is Y, the luminance histogram of the entire area is expressed as frequency (Py, Region WHOLE , Y, x). In addition, the luminance histogram of the face region is represented as frequency (P, Region FACE , Y, x), and the luminance histogram of the black eye region is represented as frequency (P, Region EYE , Y, x).

また、色成分Componentのヒストグラムを表す確立密度関数frequency(P,RegionR,Component,x)から導き出される累積分布関数cumulative(P,RegionR,Component,x)は
と表される。
The cumulative distribution function cumulative (P, Region R , Component, x) derived from the probability density function frequency (P, Region R , Component, x) representing the histogram of the color component Component is
It is expressed.

確率密度関数が図5の曲線で表されたとすると、その累積分布関数は、図6のように表される曲線となる。さらに、累積分布関数のxに関する逆関数は
と表される。ただし、ここで、yはy=cumulative(P,RegionR,Component,x)の関係を満たす値である。
If the probability density function is represented by the curve of FIG. 5, the cumulative distribution function is a curve represented as shown in FIG. Furthermore, the inverse function of the cumulative distribution function with respect to x is
It is expressed. Here, y is a value satisfying the relationship y = cumulative (P, Region R , Component, x).

ここで、制御値算出関数control(P,RegionR,Component,A)を前記累積分布関数cumulativeを用いて下記のように定義する。
Here, the control value calculation function control (P, Region R , Component, A) is defined as follows using the cumulative distribution function cumulative.

ただし、ここでは入力された静止画像に含まれるピクセルの集合をP、目標のRGB分布レコードにおける領域名をR、静止画像を領域分割して作成した領域名Rに対応する領域集合をRegionR、色成分をComponent、累積割合値をAとしている。 However, here, the set of pixels included in the input still image is P, the region name in the target RGB distribution record is R, the region set corresponding to the region name R created by dividing the still image into regions is Region R , The color component is Component, and the cumulative ratio value is A.

この制御値算出関数を累積割合値Aに適用することによって、図7に示されるように、
より、累積割合値Aに対応する制御値Cが算出される。
By applying this control value calculation function to the cumulative ratio value A, as shown in FIG.
Thus, the control value C corresponding to the cumulative ratio value A is calculated.

また、制御値数列[Ck]k=1,2,,n(ただしC1≦C2≦…≦Cn)と、目標値数列[Tk]k=1,2,,nを用いて、色値xの変換を行う色変換関数convert([Ck]k=1,2,,n,[Tk]k=1,2,,n,x)を
と定義する。
Further, the control value sequence [C k] k = 1,2, ..., a n (although C1 ≦ C2 ≦ ... ≦ Cn) , the target value sequence [T k] k = 1,2, ..., with n, The color conversion function convert ([C k ] k = 1, 2, ... , N , [T k ] k = 1, 2, ... , N , x) for converting the color value x
It is defined as

ここで、例えば静止画像の輝度ヒストグラムが図9のように分布しており、制御値[C1,C2,C3,C4]と目標値[T1,T2,T3,T4]が図のように定められていたとすると、色変換関数convert([C1,C2,C3,C4],[T1,T2,T3,T4],x)を適用して輝度値の変換を行った後のヒストグラムは図10のようになる。同図に示すように、色変換関数は制御値と目標値が合致するようにヒストグラムを変換する。   Here, for example, a luminance histogram of a still image is distributed as shown in FIG. 9, and control values [C1, C2, C3, C4] and target values [T1, T2, T3, T4] are determined as shown in the figure. FIG. 10 shows a histogram after the luminance value is converted by applying the color conversion function convert ([C1, C2, C3, C4], [T1, T2, T3, T4], x). become. As shown in the figure, the color conversion function converts the histogram so that the control value matches the target value.

ここで図11に示すように各目標RGB分布レコードに対して目標色のR値をR目標値、G値をG目標値、B値をB目標値として設定する。   Here, as shown in FIG. 11, the R value of the target color is set as the R target value, the G value as the G target value, and the B value as the B target value for each target RGB distribution record.

また、静止画像のピクセルの集合をP、ある目標RGB分布レコードRecordの領域名をAREA、累積割合値をAとすると、制御値算出関数controlを用いて、R制御値CR
と算出され、全目標RGB分布レコードについて制御値を算出することでR制御値列{CR,kk=1,2,,n(ただしCR,1≦CR,2≦…≦CR,n)を算出できる。
Further, assuming that a set of pixels of a still image is P, an area name of a certain target RGB distribution record Record is AREA, and an accumulation ratio value is A, an R control value C R is calculated using a control value calculation function control.
R control value sequence {C R, k } k = 1, 2, ... , N (where C R, 1 ≦ C R, 2 ≦ ... ≦) by calculating control values for all target RGB distribution records. C R, n ) can be calculated.

同様に、RecordのG制御値CG
と算出され、G制御値列{CG,kk=1,2,,nが算出できる。
Similarly, G control value C G of Record is
And the G control value sequence {C G, k } k = 1, 2, ... , N can be calculated.

また、RecordのB制御値CB
と算出され、B制御値列{CB,kk=1,2,,nが算出できる。
Also, the B control value C B of Record is
And B control value sequence {C B, k } k = 1, 2, ... , N can be calculated.

RGB変換関数作成部25は、RGB変換パラメタが入力され、R変換関数、G変換関数、B変換関数を出力する。   The RGB conversion function creation unit 25 receives RGB conversion parameters and outputs an R conversion function, a G conversion function, and a B conversion function.

ここで、R制御値列{CR,kk=1,2,,n(ただしCR,1≦CR,2≦…≦CR,n)と、R目標値列{TR,kk=1,2,,nを用いてR値の変換を行うR変換関数convertR(x)を
と定義し、G制御値列{CG,kk=1,2,,nと、G目標値列{TG,kk=1,2,,nを用いてG値の変換を行うG変換関数convertG(x)を
B制御値列{CB,kk=1,2,,nと、B目標値列{TB,kk=1,2,,nを用いてB値の変換を行うB変換関数convertB(x)を
と定義する。
Here, the R control value sequence {C R, k } k = 1, 2, ... , N (where C R, 1 ≦ C R, 2 ≦ ... ≦ C R, n ) and the R target value sequence {T R , k } k = 1, 2,, n , an R conversion function convert R (x) that converts R values
Is defined as, G control value column {C G, k} k = 1,2, ..., and n, G target value column {T G, k} k = 1,2, ..., the G value by using the n G conversion function convert G (x)
B control value column {C B, k} k = 1,2, ..., B to perform and n, B target value column {T B, k} k = 1,2, ..., the conversion of B values with n Convert function convert B (x)
It is defined as

RGB変換関数作成部25は、上記のR変換関数convertR(x)とG変換関数convertG(x)とB変換関数convertB(x)を出力する。 The RGB conversion function creation unit 25 outputs the R conversion function convert R (x), the G conversion function convert G (x), and the B conversion function convert B (x).

変換LUT作成部26は、R変換合成関数とG変換合成関数とB変換合成関数を入力として、R変換LUTとG変換LUTとB変換LUTを出力する。具体的には、値として取り得る全てのR値、G値、B値に対して、それぞれR変換関数、G変換関数、B変換関数を適用した値が対応する図12に示すようなLUTを作成し、変換LUT記憶部32に記憶させる。   The conversion LUT creation unit 26 receives the R conversion synthesis function, the G conversion synthesis function, and the B conversion synthesis function, and outputs an R conversion LUT, a G conversion LUT, and a B conversion LUT. Specifically, an LUT as shown in FIG. 12 corresponding to values obtained by applying the R conversion function, the G conversion function, and the B conversion function to all R values, G values, and B values that can be taken as values, respectively. It is created and stored in the conversion LUT storage unit 32.

映像変換部27は、入力映像と色変換LUTを入力として変換映像を出力する。   The video conversion unit 27 receives the input video and the color conversion LUT and outputs a converted video.

図13は、変換LUTを利用して色味を調整しつつ入力映像の変換を行う映像変換部27の構成を示すブロック図である。映像変換部27は、LUT参照部271と色味調整部272によって構成され、入力映像の全てのピクセルについて変換を施して変換映像を出力する。   FIG. 13 is a block diagram illustrating the configuration of the video conversion unit 27 that converts the input video while adjusting the color using the conversion LUT. The video conversion unit 27 includes an LUT reference unit 271 and a color adjustment unit 272, converts all the pixels of the input video, and outputs the converted video.

LUT参照部271は入力ピクセル値(r,g,b)を入力として受け取り、変換LUTを利用したときのLUT変換ピクセル値(r',g',b')を
として求める。ただしLUTrはR変換LUT、LUGgはG変換LUT,LUTbはB変換LUTである。
The LUT reference unit 271 receives an input pixel value (r, g, b) as an input, and uses the LUT conversion pixel value (r ′, g ′, b ′) when the conversion LUT is used.
Asking. However, LUTr is an R conversion LUT, LUGg is a G conversion LUT, and LUTb is a B conversion LUT.

色味調整部272は入力ピクセル値(r,g,b)とLUT変換ピクセル値(r',g',b')を受け取り、例えば背景の色味の変化を抑えた色味調整ピクセル値(r",g",b")を算出する。   The color adjustment unit 272 receives the input pixel value (r, g, b) and the LUT conversion pixel value (r ′, g ′, b ′), and, for example, a color adjustment pixel value (in which a change in the color of the background is suppressed) r ", g", b ") is calculated.

例えば肌色領域のLUT変換を強く、肌色以外の領域のLUT変換を弱くする場合の手順を以下に説明する。   For example, a procedure in the case where the LUT conversion of the skin color region is strong and the LUT conversion of the region other than the skin color is weak will be described below.

(実施例)
図14は、色味調整部272で背景の色味の変化を抑える場合の一例を示す図である。図14では、まず入力映像のLUT変換映像を作成し、LUT変換映像の輝度情報と色味情報を算出する。また、入力映像の肌色度情報と色味情報の算出も行い、LUT変換映像の色味情報と入力映像の色味情報の色味情報を肌色度情報に基づいて合成する。
(Example)
FIG. 14 is a diagram illustrating an example of a case where the color adjustment unit 272 suppresses a change in background color. In FIG. 14, first, an LUT converted video of an input video is created, and luminance information and color information of the LUT converted video are calculated. Also, the skin color information and the color information of the input video are calculated, and the color information of the LUT converted video and the color information of the color information of the input video are combined based on the skin color information.

前記の色味情報の合成では、肌色度の強い領域はLUT変換映像の色味情報を、肌色度の弱い領域は入力映像の色味情報を利用することで、肌色領域のLUT変換を強く、肌色以外のLUT変換を弱くすることが可能となる。   In the synthesis of the above-described color information, the region with strong skin chromaticity uses the color information of the LUT conversion image, and the region with low skin chromaticity uses the color information of the input image, thereby strongly performing LUT conversion of the skin color region It becomes possible to weaken LUT conversion other than skin color.

以上の手順によって作成したLUT変換映像の輝度情報と、合成した色味情報を足し合わせることで色味調整が可能となる。以下では具体的な色味調整の手順について説明する。   By adjusting the luminance information of the LUT-converted video created by the above procedure and the synthesized color information, the color can be adjusted. Hereinafter, a specific color adjustment procedure will be described.

まず、あるピクセル値(r,g,b)の色味値(colorR,colorG,colorB)を算出する色味値算出関数colorBalance(r,g,b)を
とする。
First, the color value calculation function colorBalance (r, g, b) for calculating the color value (colorR, colorG, colorB) of a certain pixel value (r, g, b)
And

ここで、想定する肌色のRGB値を(skinR,skinG,skinB)とすると、肌色の色味値(skinColorR,skinColorG,skinColorB)は
によって算出される。
Here, if the assumed skin color RGB values are (skinR, skinG, skinB), the skin color tone values (skinColorR, skinColorG, skinColorB) are
Is calculated by

次に肌色の色味値の幅を(skinRangeR,skinRangeG,skinRangeB)として、あるピクセル値の肌色からの距離を算出する関数skinDistance(r,g,b)を以下のように定義する。
なお、(skinR,skinG、skinB)は例えば(200,140,130)、(skinRangeR,skinRangeG,skinRangeB)は例えば(15,5,5)などの値を用いる。
Next, a function skinDistance (r, g, b) for calculating a distance from a skin color of a certain pixel value is defined as follows, with the width of the skin color tint value being (skinRangeR, skinRangeG, skinRangeB).
Note that (skinR, skinG, skinB) uses values such as (200, 140, 130), and (skinRangeR, skinRangeG, skinRangeB) uses values such as (15, 5, 5).

次にskinDistance(r,g,b)によって求まる距離の正規化まで行う関数normalizeSkinDistance(r,g,b)を、最小距離minDist、最大距離maxDistを用いて
とする。
Next, the function normalizeSkinDistance (r, g, b), which performs the normalization of the distance obtained by skinDistance (r, g, b), using the minimum distance minDist and the maximum distance maxDist
And

さらに、LUT変換合成係数算出関数alphaLUT(r,g,b)を、最小合成係数minAlpha、最大合成係数maxAlphaを用いて
とする。
Furthermore, the LUT conversion synthesis coefficient calculation function alphaLUT (r, g, b) is used with the minimum synthesis coefficient minAlpha and the maximum synthesis coefficient maxAlpha.
And

次に輝度合成係数alphaLと色味合成係数alphaColorを定義するが、例えば輝度はLUT変換の通りに、色味は肌色領域を中心に変換を行う場合には
とする。
Next, the luminance synthesis coefficient alphaL and the tint synthesis coefficient alphaColor are defined. For example, in the case where the luminance is converted according to the LUT conversion and the color is converted around the skin color region, for example.
And

以上の定義から合成輝度synthLは
と算出する。ここで
は入力ピクセルの輝度値のみを変更したRGB値となり、入力画像の合成色味値(synthR,synthG,synthB)は
と算出でき、色味調整ピクセル値(r",g",b")を
によって算出し、色味調整部272から出力する。
From the above definition, the synthetic luminance synthL is
And calculate. here
Is an RGB value that changes only the luminance value of the input pixel, and the composite color value (synthR, synthG, synthB) of the input image is
The color adjustment pixel value (r ", g", b ")
And output from the color adjustment unit 272.

また、常にalphaL=1.0、alphaColor=0.0とした場合は、色味調整部272はLUT変換による輝度変換のみを行う。この場合は以下の手順により高速化が可能である。まず、高速変換テーブルFCT(Fast Conversion Table)を
として作成する。ここでFCTrはR変換FCT、FCTgはG変換FCT、FCTbはB変換FCTである。
When always alphaL = 1.0 and alphaColor = 0.0, the color adjustment unit 272 performs only luminance conversion by LUT conversion. In this case, the speed can be increased by the following procedure. First, the fast conversion table FCT (Fast Conversion Table)
Create as. Here, FCTr is R conversion FCT, FCTg is G conversion FCT, and FCTb is B conversion FCT.

このとき(r,g,b)に対する(LUTr[r],LUTg[g],LUTb[b])の輝度差を算出する関数、輝度差算出関数yDiff(r,g,b)が
となり、色味調整ピクセル値(r",g",b")は
により、3回のテーブル参照と5回の加算のみで高速に算出できる。
At this time, the function for calculating the luminance difference of (LUTr [r], LUTg [g], LUTb [b]) with respect to (r, g, b), the luminance difference calculating function yDiff (r, g, b) is
The color adjustment pixel value (r ", g", b ") is
Thus, it can be calculated at high speed only by referring to the table three times and adding five times.

上記手順によるピクセル変換を入力映像の全てのピクセルに対して施すことにより、色味を調整した変換映像を出力できる。   By performing pixel conversion according to the above procedure on all the pixels of the input video, it is possible to output a converted video with adjusted color.

以上説明したように、第1の実施の形態によれば、映像の色変換の際に過剰なコントラストの変換を抑えながら色を変換することができる。特に、肌色のみを変換しても、茶色に染めてある髪などとの色のバランスが崩れることがなく、望み通りに調整することができる。   As described above, according to the first embodiment, it is possible to convert colors while suppressing excessive contrast conversion when converting the color of an image. In particular, even if only the skin color is converted, the color balance with the hair dyed in brown is not lost, and it can be adjusted as desired.

[第2の実施の形態]
次に、本発明の第2の実施の形態について説明する。なお、ここでは、第1の実施の形態との差異を中心に説明する。
[Second Embodiment]
Next, a second embodiment of the present invention will be described. Here, the description will focus on differences from the first embodiment.

図15は、第2の実施の形態における映像変換部27の構成を示すブロック図である。   FIG. 15 is a block diagram illustrating a configuration of the video conversion unit 27 in the second embodiment.

映像変換部27は、LUT参照部271と色味調整部272とRGB値加工部273によって構成され、入力映像の全てのピクセルについて変換を施して変換映像を出力する。   The video conversion unit 27 includes an LUT reference unit 271, a color adjustment unit 272, and an RGB value processing unit 273, converts all the pixels of the input video, and outputs a converted video.

LUT参照部271は、入力ピクセル値(r,g,b)を入力として受け取り、変換LUTを利用したときのLUT変換ピクセル値を
として求める。ただしLUTrはR変換LUT、LUGgはG変換LUT,LUTbはB変換LUTである。
The LUT reference unit 271 receives an input pixel value (r, g, b) as an input, and determines an LUT conversion pixel value when the conversion LUT is used.
Asking. However, LUTr is an R conversion LUT, LUGg is a G conversion LUT, and LUTb is a B conversion LUT.

RGB値加工部273は、例えばR値、G値、B値にそれぞれliftR、liftG、liftBを加えて、変換ピクセル値(r',g',b')を
によって求める。なお、liftR、liftG、liftBは、予め定められた値であり、映像変換装置に記憶されている。liftR、liftG、liftBは、それぞれ負の値でもよい。また、liftR、liftG、liftBは、少なくとも1つが0でなければ、他は0であってもよい。
The RGB value processing unit 273 adds, for example, liftR, liftG, and liftB to the R value, G value, and B value, respectively, and converts the converted pixel value (r ′, g ′, b ′).
Ask for. Note that liftR, liftG, and liftB are predetermined values and are stored in the video conversion device. liftR, liftG, and liftB may each be a negative value. Further, at least one of liftR, liftG, and liftB may be 0 unless the other is 0.

色味調整部272は入力ピクセル値(r,g,b)と変換ピクセル値(r',g',b')を受け取り、例えば背景の色味の変化を抑えた色味調整ピクセル値(r",g",b")を算出する。   The color adjustment unit 272 receives the input pixel value (r, g, b) and the converted pixel value (r ′, g ′, b ′) and, for example, the color adjustment pixel value (r that suppresses the change in the color of the background) ", g", b ") is calculated.

例えば肌色領域の変換を強く、肌色以外の領域の変換を弱くする場合の手順を以下に説明する。   For example, the procedure in the case where the conversion of the skin color region is strong and the conversion of the region other than the skin color is weak will be described below.

(実施例)
図16は、第2の実施の形態の色味調整部272で背景の色味の変化を抑える場合の一例を示す図である。図16では、まず入力映像のLUT変換映像を作成し、LUT変換映像のRGB値に加工を施し、加工後のRGB値の輝度情報と色味情報を算出する。また、入力映像の肌色度情報と色味情報の算出も行い、加工後のRGB値の色味情報と入力映像の色味情報の色味情報を肌色度情報に基づいて合成する。
(Example)
FIG. 16 is a diagram illustrating an example of a case where a change in background color is suppressed by the color adjustment unit 272 according to the second embodiment. In FIG. 16, first, an LUT converted image of the input image is created, the RGB values of the LUT converted image are processed, and luminance information and color information of the processed RGB values are calculated. Also, the skin color information and the color information of the input video are calculated, and the color information of the processed RGB value and the color information of the color information of the input video are combined based on the skin color information.

前記の色味情報の合成では、肌色度の強い領域は加工後のRGB値の色味情報を、肌色度の弱い領域は入力映像の色味情報を利用することで、肌色領域の色味変換を強く、肌色以外の色味変換を弱くすることが可能となる。   In the synthesis of the above-described color information, the skin color region color conversion is performed by using the processed RGB value color information for regions with high skin chromaticity and the color information of the input video for regions with low skin chromaticity. It is possible to weaken the color conversion other than the skin color.

以上の手順によって作成した加工後のRGB値の輝度情報と、合成した色味情報を足し合わせることで色味調整が可能となる。   By adjusting the luminance information of the processed RGB value created by the above procedure and the synthesized color information, the color can be adjusted.

また、第1の実施の形態で説明した具体的な色味調整の手順において、数27によって算出され、色味調整部272から出力された色味調整ピクセル値(r",g",b")が表す色は、第2の実施の形態では、肌色領域についてはLUT変換およびRGB値の加工によって色味が変化し、背景領域については色味の変化がないものとなる。   Further, in the specific tint adjustment procedure described in the first embodiment, the tint adjustment pixel value (r ", g", b "calculated by Expression 27 and output from the tint adjusting unit 272 is used. In the second embodiment, the color represented by) is changed in color by the LUT conversion and RGB value processing for the skin color area, and no change in color is performed for the background area.

さて、ヒストグラム変換の程度が大きい場合、LUT変換によって背景色の階調が失われてしまう場合がある。そのような場合にLUT変換による色変換の程度を弱め、その代わりにRGB値の加工を利用した色味調整を行うことで、背景色の階調を保ったまま、色変換を行うことが可能となる。   If the degree of histogram conversion is large, the background color gradation may be lost due to LUT conversion. In such a case, it is possible to perform color conversion while maintaining the gradation of the background color by weakening the degree of color conversion by LUT conversion and performing color adjustment using RGB value processing instead. It becomes.

具体的には、各目標RGB分布レコードに対して、R目標値、G目標値、B目標値を設定する際に、目標色のR値をR目標値、G値をG目標値、B値をB目標値にそのまま設定するのでなく、図17に示すように、いくつかの目標RGB分布レコードについては、目標色のR値より例えば20低い値をR目標値に設定しておく。   Specifically, when setting the R target value, G target value, and B target value for each target RGB distribution record, the R value of the target color is the R target value, the G value is the G target value, and the B value. Is set as the B target value as it is, as shown in FIG. 17, for some target RGB distribution records, for example, a value 20 lower than the R value of the target color is set as the R target value.

また、このような設定をしたときは、RGB値加工部273では、例えば、liftR=20、liftG=0、liftB=0として、R値に20を加えて、映像変換を行う(図18のSTEP1)。   Further, when such a setting is made, the RGB value processing unit 273 performs, for example, video conversion by adding 20 to the R value with liftR = 20, liftG = 0, liftB = 0 (STEP 1 in FIG. 18). ).

そして、図17の目標RGB分布レコードを使用して、ヒストグラム変換を行う(図18のSTEP2)。これにより、背景色の色味を調整することができる。   Then, histogram conversion is performed using the target RGB distribution record of FIG. 17 (STEP 2 of FIG. 18). Thereby, the color of the background color can be adjusted.

その結果、背景領域の階調を維持しつつ、顔領域の色を目標の色に変換することが可能となる。   As a result, it is possible to convert the color of the face area to the target color while maintaining the gradation of the background area.

上記手順によるピクセル変換を入力映像の全てのピクセルに対して施すことにより、色味を調整した変換映像を出力することができる。   By performing pixel conversion according to the above procedure on all the pixels of the input video, it is possible to output a converted video with adjusted color.

1…入力装置
2…中央処理制御装置
3…記憶装置
11…映像信号入力部
12…シャッター入力部
13…目標分布選択部
21…フレーム抽出部
22…領域分割部
23…RGB変換パラメタ作成部
24…目標RGB分布作成部
25…RGB変換関数作成部
26…変換LUT作成部
27…映像変換部
31…RGB分布記憶部
32…変換LUT記憶部
42…分布計算部
43…ストレッチング部
221…画像スケール変換部
222…検出対象領域切出部
223…空間周波数分析部
224…顔候補判定部
225…顔候補選択部
226…肌領域抽出部
227…黒目領域抽出部
271…LUT参照部
272…色味調整部
273…RGB値加工部
DESCRIPTION OF SYMBOLS 1 ... Input device 2 ... Central processing control device 3 ... Memory | storage device 11 ... Video signal input part 12 ... Shutter input part 13 ... Target distribution selection part 21 ... Frame extraction part 22 ... Area division part 23 ... RGB conversion parameter creation part 24 ... Target RGB distribution creation unit 25 ... RGB conversion function creation unit 26 ... conversion LUT creation unit 27 ... video conversion unit 31 ... RGB distribution storage unit 32 ... conversion LUT storage unit 42 ... distribution calculation unit 43 ... stretching unit 221 ... image scale conversion Unit 222 ... detection target region extraction unit 223 ... spatial frequency analysis unit 224 ... face candidate determination unit 225 ... face candidate selection unit 226 ... skin region extraction unit 227 ... black eye region extraction unit 271 ... LUT reference unit 272 ... color adjustment unit 273 ... RGB value processing section

Claims (11)

入力された映像を記憶する記憶手段と、
前記映像を読み出し、複数の領域に分割して記憶手段に記憶させる領域分割手段と、
所望の色成分における前記各領域のヒストグラムを作成するヒストグラム作成手段と、
前記各ヒストグラムに対して目標とする分布範囲を指定する目標範囲指定手段と、
前記各ヒストグラムを前記目標の分布範囲に分布させるように前記映像を変換するための変換パラメタを作成する変換パラメタ作成手段と、
前記変換パラメタを用いて色変換関数を作成する色変換関数作成手段と、
前記色変換関数を前記映像に適用して映像を変換する映像変換手段と、
前記入力された映像における各ピクセルの変換合成係数を算出する変換合成係数算出手段と、
前記入力された映像と前記変換後の映像とから変換調整映像を作成する際に、前記変換合成係数の大小に応じて映像の変換の強度を調整する変換調整映像作成手段とを有し、
前記領域分割手段は、顔の領域を検出し、
前記ヒストグラム作成手段は、前記各領域についてR成分、G成分、B成分のヒストグラムを作成し、
前記変換合成係数算出手段は、肌色からの距離を算出する
ことを特徴とする映像変換装置。
Storage means for storing the input video;
Area dividing means for reading out the video, dividing it into a plurality of areas and storing it in a storage means;
A histogram creating means for creating a histogram of each region in a desired color component;
Target range specifying means for specifying a target distribution range for each histogram;
Conversion parameter creating means for creating a conversion parameter for converting the video so that each histogram is distributed in the target distribution range;
Color conversion function creating means for creating a color conversion function using the conversion parameter;
Video conversion means for converting the video by applying the color conversion function to the video;
Conversion synthesis coefficient calculation means for calculating a conversion synthesis coefficient of each pixel in the input video;
Conversion adjustment video creating means for adjusting the strength of the video conversion according to the magnitude of the conversion synthesis coefficient when creating a conversion adjustment video from the input video and the converted video,
The area dividing means detects a face area,
The histogram creating means creates a histogram of R component, G component, and B component for each region,
The image conversion apparatus, wherein the conversion synthesis coefficient calculation means calculates a distance from the skin color.
前記変換調整映像作成手段は、前記変換後の映像の輝度を使用することにより輝度の変換の強弱を調整しない一方、色味の変換の強弱を調整する
ことを特徴とする請求項1記載の映像変換装置。
The video according to claim 1, wherein the conversion adjustment video creation means adjusts the strength of the color conversion while not adjusting the strength of the luminance conversion by using the luminance of the video after the conversion. Conversion device.
前記変換調整映像作成手段は、前記入力された映像のピクセルと前記変換後の映像のピクセルのR値、G値、B値それぞれの差に前記変換合成係数を乗じることで高速変換テーブルを作成し、該高速変換テーブルを利用して前記入力された映像のピクセルの輝度と前記変換後の映像のピクセルの輝度との差を算出する
ことを特徴とする請求項1記載の映像変換装置。
The conversion-adjusted image creation means creates a high-speed conversion table by multiplying the difference between the R value, G value, and B value of the input image pixel and the converted image pixel by the conversion synthesis coefficient. The video conversion apparatus according to claim 1, wherein a difference between a luminance of a pixel of the input video and a luminance of a pixel of the converted video is calculated using the high-speed conversion table.
前記変換調整映像作成手段は、
前記入力された映像を前記変換合成係数を用いて変換する手段と、
当該変換後の映像のピクセルのR値、G値、B値の少なくとも1つに予め定められた値を加える手段と、
当該予め定められた値を加えられたR値、G値、B値による映像と前記入力された映像とから変換調整映像を作成する手段と
を有することを特徴とする請求項1記載の映像変換装置。
The conversion adjustment video creation means includes:
Means for converting the input video using the conversion synthesis coefficient;
Means for adding a predetermined value to at least one of the R value, G value, and B value of the pixel of the converted image;
2. The video conversion according to claim 1, further comprising means for creating a conversion adjustment video from the video based on the R value, the G value, and the B value added with the predetermined value and the input video. apparatus.
前記変換合成係数を用いた変換後の映像のピクセルのR値、G値、B値の少なくとも1つに前記予め定められた値を加えることに対応して前記目標範囲指定手段に指定される目標の分布範囲が変更されること特徴とする請求項4記載の映像変換装置。   The target specified by the target range specifying means in correspondence with adding the predetermined value to at least one of the R value, G value, and B value of the pixel of the image after conversion using the conversion synthesis coefficient. 5. The video conversion apparatus according to claim 4, wherein the distribution range of the video is changed. 映像変換装置により行う映像変換方法であって、
入力された映像を記憶手段に記憶させるステップと、
前記映像を読み出し、複数の領域に分割して記憶手段に記憶させるステップと、
所望の色成分における前記各領域のヒストグラムを作成するステップと、
前記各ヒストグラムに対して目標とする分布範囲を指定するステップと、
前記各ヒストグラムを前記目標の分布範囲に分布させるように前記映像を変換するための変換パラメタを作成するステップと、
前記変換パラメタを用いて色変換関数を作成するステップと、
前記変換パラメタを用いて色変換関数を作成するステップと、
前記色変換関数を前記映像に適用して映像を変換するステップと、
前記入力された映像における各ピクセルの変換合成係数を算出するステップと、
前記入力された映像と前記変換後の映像とから変換調整映像を作成する際に、前記変換合成係数の大小に応じて映像の変換の強度を調整するステップとを有し、
前記映像を複数の領域に分割するステップでは、顔の領域を検出し、
前記ヒストグラムを作成するステップでは、前記各領域についてR成分、G成分、B成分のヒストグラムを作成し、
前記変換合成係数を算出するステップでは、肌色からの距離を算出する
ことを特徴とする映像変換方法。
A video conversion method performed by a video conversion device,
Storing the input video in a storage means;
Reading the video, dividing it into a plurality of areas and storing it in a storage means;
Creating a histogram of each region in a desired color component;
Designating a target distribution range for each of the histograms;
Creating a conversion parameter for converting the video so that each histogram is distributed in the target distribution range;
Creating a color conversion function using the conversion parameters;
Creating a color conversion function using the conversion parameters;
Applying the color conversion function to the video to convert the video;
Calculating a transform synthesis coefficient for each pixel in the input video;
Adjusting the conversion strength of the video according to the magnitude of the conversion synthesis coefficient when creating a conversion adjustment video from the input video and the converted video,
In the step of dividing the video into a plurality of areas, a face area is detected,
In the step of creating the histogram, a histogram of R component, G component, and B component is created for each region,
In the step of calculating the conversion synthesis coefficient, a distance from the skin color is calculated.
前記変換調整映像を作成するステップでは、前記変換後の映像の輝度を使用することにより輝度の変換の強弱を調整しない一方、色味の変換の強弱を調整する
ことを特徴とする請求項6記載の映像変換方法。
The step of creating the conversion adjustment video does not adjust the intensity of luminance conversion by using the luminance of the video after conversion, but adjusts the intensity of color conversion. Video conversion method.
前記変換調整映像を作成するステップでは、前記入力された映像のピクセルと前記変換後の映像のピクセルのR値、G値、B値それぞれの差に前記変換合成係数を乗じることで高速変換テーブルを作成し、該高速変換テーブルを利用して前記入力された映像のピクセルの輝度と前記変換後の映像のピクセルの輝度との差を算出する
ことを特徴とする請求項6記載の映像変換方法。
In the step of creating the conversion adjustment image, a high-speed conversion table is obtained by multiplying the difference between the R value, the G value, and the B value of the input image pixel and the converted image pixel by the conversion synthesis coefficient. The video conversion method according to claim 6, wherein a difference between the brightness of the input image pixel and the brightness of the pixel of the converted image is calculated using the high-speed conversion table.
前記変換調整映像を作成するステップは、
前記入力された映像を前記変換合成係数を用いて変換するステップと、
当該変換後の映像のピクセルのR値、G値、B値の少なくとも1つに予め定められた値を加えるステップと、
当該予め定められた値を加えられたR値、G値、B値による映像と前記入力された映像とから変換調整映像を作成するステップと
を有することを特徴とする請求項6記載の映像変換方法。
The step of creating the conversion adjustment video includes:
Converting the input video using the conversion synthesis coefficient;
Adding a predetermined value to at least one of the R value, G value, and B value of the pixel of the converted video;
7. The image conversion according to claim 6, further comprising the step of creating a conversion adjustment image from the image based on the R value, the G value, and the B value added with the predetermined value and the input image. Method.
前記変換合成係数を用いた変換後の映像のピクセルのR値、G値、B値の少なくとも1つに前記予め定められた値を加えることに対応して前記目標範囲指定手段に指定される目標の分布範囲が変更されることを特徴とする請求項6記載の映像変換方法。   The target specified by the target range specifying means in correspondence with adding the predetermined value to at least one of the R value, G value, and B value of the pixel of the image after conversion using the conversion synthesis coefficient. The video conversion method according to claim 6, wherein the distribution range of the video is changed. 請求項1ないし5のいずれかに記載の映像変換装置としてのコンピュータに当該映像変換装置が行う処理を実行させることを特徴とする映像変換プログラム。   6. A video conversion program for causing a computer as the video conversion device according to claim 1 to execute processing performed by the video conversion device.
JP2009115837A 2008-11-18 2009-05-12 Device, method and program for video conversion Pending JP2010154494A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009115837A JP2010154494A (en) 2008-11-18 2009-05-12 Device, method and program for video conversion

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2008294777 2008-11-18
JP2009115837A JP2010154494A (en) 2008-11-18 2009-05-12 Device, method and program for video conversion

Publications (1)

Publication Number Publication Date
JP2010154494A true JP2010154494A (en) 2010-07-08

Family

ID=42572985

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009115837A Pending JP2010154494A (en) 2008-11-18 2009-05-12 Device, method and program for video conversion

Country Status (1)

Country Link
JP (1) JP2010154494A (en)

Similar Documents

Publication Publication Date Title
US8929681B2 (en) Image processing apparatus and image processing method
US8923612B2 (en) Image processing apparatus and method, and program
JP3880553B2 (en) Image processing method and apparatus
JP3959909B2 (en) White balance adjustment method and adjustment device
US20060062562A1 (en) Apparatus, program, and method for image tone transformation, and electronic camera
US20110206280A1 (en) Image brightness controlling apparatus and method thereof
JP2000224607A (en) Image processor
JP2003309859A (en) Image processing apparatus, image processing method, and image processing program
JP3673092B2 (en) Image quality adjusting apparatus, image quality adjusting method, and recording medium recording image adjusting program
JP2014078808A (en) Image processing apparatus and image processing method
JP2007042033A (en) Color correction apparatus and image display device
WO2010128683A1 (en) Blue sky color detection technique
JPH118768A (en) Image processor, image processing method and medium recording image processing control program
JP2006114006A (en) Gradation conversion apparatus, program, electronic camera, and method therefor
JP2009050035A (en) Image processing method, image processing system, and image processing program
JP2010154484A (en) Device, method and program for video conversion
JP5227651B2 (en) Video conversion apparatus, video conversion method, and video conversion program
JP2008294969A (en) Video image conversion apparatus, method, and program
JP2007243987A (en) Image processing method, image processing system, and image processing program
JP5069599B2 (en) Video conversion apparatus, video conversion method, and video conversion program
JP2010154494A (en) Device, method and program for video conversion
JP2008312177A (en) Apparatus, method and program, for converting gradation of video image
JP4708866B2 (en) Lookup table creation device and method, and lookup table creation program
KR102160247B1 (en) Electronic apparatus and Method for controlling the electronic apparatus thereof
JP4838224B2 (en) Gradation conversion device and method, program