JP2013161348A - Image correction device, method, program, and recording medium - Google Patents
Image correction device, method, program, and recording medium Download PDFInfo
- Publication number
- JP2013161348A JP2013161348A JP2012024131A JP2012024131A JP2013161348A JP 2013161348 A JP2013161348 A JP 2013161348A JP 2012024131 A JP2012024131 A JP 2012024131A JP 2012024131 A JP2012024131 A JP 2012024131A JP 2013161348 A JP2013161348 A JP 2013161348A
- Authority
- JP
- Japan
- Prior art keywords
- area
- color
- correction
- shine
- pixel
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Image Processing (AREA)
- Facsimile Image Signal Circuits (AREA)
- Image Analysis (AREA)
Abstract
【課題】元の明るさのバランスを維持し立体感を損なうことなくテカリ領域を補正する。
【解決手段】顔検出部は、入力された画像から顔画像領域を検出する。テカリ領域検出部は、顔画像領域で所定の明るさより明るい領域をテカリ領域として検出する。平均色取得部18は、テカリ領域の周囲の肌の色を平均した平均色を取得する。明るさ分類部19は、テカリ領域内の全画素の明るさを検出して、各画素を明るさに応じて複数のグループに分類する。最明画素検出部21は、テカリ領域の中で補正していない画素のうちの最も明るい画素の色を取得する。補正色決定部22は、平均色とテカリ領域内の最も明るい画素の色との合成比率を補正の回数に応じて変えて補正色を作る。塗りつぶし補正部23は、作成した補正色で画素を明るいグループに属する画素から順に塗りつぶす。
【選択図】図2The present invention corrects a shine area without losing the stereoscopic effect while maintaining the original brightness balance.
A face detection unit detects a face image region from an input image. The shine area detection unit detects an area brighter than a predetermined brightness in the face image area as a shine area. The average color acquisition unit 18 acquires an average color obtained by averaging the skin colors around the shine area. The brightness classification unit 19 detects the brightness of all the pixels in the shine area, and classifies each pixel into a plurality of groups according to the brightness. The brightest pixel detection unit 21 acquires the color of the brightest pixel among the pixels not corrected in the shine area. The correction color determination unit 22 creates a correction color by changing the synthesis ratio of the average color and the color of the brightest pixel in the shine area according to the number of corrections. The fill correction unit 23 paints pixels in order from the pixels belonging to the bright group with the created correction color.
[Selection] Figure 2
Description
本発明は、顔画像のテカリを補正する画像補正装置、方法、及びプログラム、並びに記録媒体に関する。 The present invention relates to an image correction apparatus, a method, a program, and a recording medium for correcting the shine of a face image.
従来、人物が撮像された画像において、いわゆる「テカリ」の発生が問題となっている。テカリとは、写真撮像時に発せられるストロボ等の光が、被写体人物の肌の表面で反射(特に鏡面反射)することにより、肌の一部が白く撮像されてしまうことである。このため、テカリが発生した部位(以下、「テカリ部位」と呼ぶ)は、周囲の肌に比べて高輝度に撮像されてしまう。このようなテカリは、その画像を見る者に対して不快な印象を与える。このため、テカリが発生してしまった画像において、テカリを除去若しくは軽減する技術が要求されている。 Conventionally, the occurrence of so-called “shine” has been a problem in an image in which a person is imaged. The term “shine” means that a part of the skin is imaged white because light such as a strobe emitted at the time of taking a picture is reflected (particularly specularly reflected) on the surface of the skin of the subject person. For this reason, a site where shine occurs (hereinafter referred to as “shine site”) is imaged with higher brightness than the surrounding skin. Such shine gives an unpleasant impression to those who see the image. For this reason, there is a demand for a technique for removing or reducing shine in an image where shine has occurred.
このような要求に対し、従来、オペレータが目視で高輝度の部位を見つけフォトレタッチソフト等を使用することにより手動で高輝度の部位の明るさや輝度を下げることによりテカリを抑制する補正方法が実現されている。 In response to such demands, conventionally, a correction method has been realized that suppresses shine by manually reducing the brightness and brightness of high-brightness parts by manually finding high-brightness parts and using photo retouching software. Has been.
また、画像の中から被写体人物の目が含まれる顔画像領域を検出し、検出された顔画像領域の中からテカリ領域を検出し、テカリ領域内で最大明度を抑制する補正を行う発明が提案されている(特許文献1)。 Further, an invention is proposed in which a face image area including the eyes of a subject person is detected from an image, a shine area is detected from the detected face image area, and correction is performed to suppress the maximum brightness in the shine area. (Patent Document 1).
しかしながら、特許文献1に記載の発明では、最大明度を抑制する補正として、テカリ領域内の画像データをたんに平滑化している。このため、テカリ領域の立体感が損なわれ、テカリ領域の明るさ(輝度)のバランスが変わってしまうおそれがある。
However, in the invention described in
本発明は、かかる点に鑑みてなされたものであり、原画通りのテカリの明るさのバランスを維持して立体感を損なうことなく補正するようにした画像補正装置、方法、及びプログラム、並びに記録媒体を提供することを目的とする。 The present invention has been made in view of the above points, and is an image correction apparatus, method, program, and recording that maintain the brightness balance of the shine as in the original image without correcting the stereoscopic effect. The purpose is to provide a medium.
本発明では、入力された画像から顔画像領域を検出する顔検出手段と、顔画像領域で所定の明るさより明るい領域又は周囲よりも明るさが所定以上明るい領域をテカリ領域として検出するテカリ領域検出手段と、テカリ領域を最も明るい領域から周囲に向けて周囲の色に徐々に近づくように塗りつぶす補正を行うテカリ補正手段と、を備えたものである。 In the present invention, face detection means for detecting a face image area from an input image, and a shine area detection for detecting, as a shine area, an area brighter than a predetermined brightness in the face image area or an area brighter than a surrounding by a predetermined brightness. And a shine correction means for correcting the shine area so as to gradually approach the surrounding color from the brightest area toward the periphery.
テカリ補正手段としては、テカリ領域を最も明るい領域から周囲に向けて徐々に塗りつぶす補正色を、テカリ領域内の塗りつぶし対象となる画素の色に対して、テカリ領域の周囲の画素の色を平均した平均色を混合する割合を徐々に増やして作成する。 As a shine correction means, the correction color that gradually fills the shine area from the brightest area to the periphery is averaged over the color of the pixels that are the target of filling in the shine area. Create by gradually increasing the ratio of mixing average colors.
具体的には、テカリ領域の周囲の画素の色を平均した平均色を取得する平均色取得部と、テカリ領域を画素の明るさに応じて複数のグループに分類する分類部と、前記平均色を塗りつぶし対象となるグループの画素の色に前記平均色の合成比率が徐々に増えるように合成して補正色を作成し作成した補正色で最も明るいグループの画素から順に塗りつぶす補正部と、でテカリ補正手段を構成するのが好適である。 Specifically, an average color acquisition unit that acquires an average color obtained by averaging the colors of pixels around the shine area, a classification unit that classifies the shine area into a plurality of groups according to pixel brightness, and the average color A correction unit that creates a correction color by combining the average pixel color with the color of the pixel of the group to be filled and gradually increases the average color composition ratio. It is preferable to constitute the correcting means.
また、テカリ補正手段としては、テカリ領域の周囲の画素の色を平均した平均色を取得する平均色取得部と、テカリ領域のうちの最も明るい画素を検出する最明画素検出部と、前記平均色と塗りつぶし対象となる画素の色とを前記周囲との間の距離が短い画素ほど前記平均色の合成比率が徐々に増えるように合成して補正色を作成し作成した補正色で前記最も明るい画素から周囲の画素に向けて順に画素を塗りつぶす補正部と、で構成してもよい。 Further, as the shine correction means, an average color acquisition unit that acquires an average color obtained by averaging the colors of pixels around the shine area, a brightest pixel detection unit that detects the brightest pixel in the shine area, and the average A correction color is created by combining a color and the color of a pixel to be filled so that the pixel having a shorter distance from the surrounding area gradually increases the composite ratio of the average color. You may comprise by the correction | amendment part which paints a pixel in order toward a surrounding pixel from a pixel.
また、本発明としては、画像補正方法としてもよい。さらに本発明は、画像補正方法を実行させるコンピュータが読み取り可能なプログラム、並びにコンピュータが読み取り可能なプログラムを記録した記録媒体の発明としてもよい。 In the present invention, an image correction method may be used. Furthermore, the present invention may be a computer-readable program for executing the image correction method and a recording medium on which the computer-readable program is recorded.
本発明によれば、テカリ領域を最も明るい領域から周囲に向けて周囲の色に徐々に近づくように塗りつぶすため、テカリ領域を元の明るさのバランスを維持して、立体感を損なうことなく補正することができる。 According to the present invention, the shining area is filled from the brightest area toward the surroundings so as to gradually approach the surrounding colors, so that the shining area is corrected without losing the stereoscopic effect while maintaining the original brightness balance. can do.
本発明の画像補正装置10は、周知のように、バスを介して接続されるCPU、ROM、RAM、記憶部、操作部、及び外部I/F等を備える。記憶部には、各種のプログラム(OS、アプリケーション等)が記憶されており、操作部から起動操作に応答してCPUにロードされ、CPUにより実行されることによって、図1に示すように、画像入力部11、顔検出部12、目・口検出部13、テカリ領域検出部14、テカリ領域補正部15、及び補正画像出力部16等を含む装置として機能する。
As is well known, the
これら顔検出部12、目・口検出部13、テカリ領域検出部14、及びテカリ領域補正部15は、プログラムがCPUによって実行されることにより実現される。なお、顔検出部12、目・口検出部13、テカリ領域検出部14、及びテカリ領域補正部15は、専用のチップに記憶されたものでも良い。
The
画像入力部11は、原画像のデータを画像補正装置10へ入力するためのインターフェースとして機能する。例えば、記録媒体(例えば電子カメラに内蔵するものも含む各種メモリやフレキシブルディスクやCD(Compact Disk)、DVD(Digital Versatile Disc、Digital Video Disc))に記録された原画像のデータが画像補正装置10へ入力される。この場合、画像入力部11は、記録媒体からデータを読み出す装置(例えばメモリリーダやフレキシブルディスク、CDドライブ、及びDVDドライブ)を用いて構成される。
The
顔検出部12は、原画像から人の顔画像を含む領域を顔画像領域として検出し、顔画像領域の位置や大きさ等を示す顔画像情報を特定する。顔検出部12は、例えば、顔全体の輪郭に対応した基準テンプレートを用いたテンプレートマッチングによって顔を検出するように構成されている。
The
目・口検出部13は、顔画像領域から目及び口の画像を含む領域を目及び口画像領域として検出し、目及び口画像領域の位置や大きさ等を示す目及び口画像情報を特定する。
The eye /
テカリ領域検出部14は、顔画像領域のうちの目及び口画像領域を除外した領域の中で著しく明るい部分を、テカリ領域として検出する。著しく明るい部分の検出としては、例えば所定の明るさより明るく写っている領域をテカリ領域として検出すればよい。所定の明るさは、予め設定しておいた固定値としてもよいし、白目の部分や歯の部分の明度を基準として設定することもできる。また、周りの領域よりも明るさが所定以上明るい領域をテカリ領域として検出してもよい。
The shine
テカリ領域補正部15は、テカリ領域を明るい画素から順に、テカリ領域の周囲の肌の色に徐々に近づく色で補正する。補正した画像データは、補正画像出力部16から出力される。ここで、記録部等から読み出した画像データの場合には、上書き保存、又は新たな名前を付けて保存される。
The shining
テカリ領域補正部15は、図2に示すように、平均色取得部18、明るさ分類部19、及び補正部20とで構成されている。平均色取得部18は、テカリ領域の周囲の肌の色を平均した平均色aを取得する。
As shown in FIG. 2, the shine
明るさ分類部19は、テカリ領域内の全画素の明るさ(輝度)を検出して、各画素を明るさに応じて複数のグループに分類する。明るさの程度は、各画素が表現できる階調に対する数値として表現される。8ビット256階調の場合、各画素の明るさの最小値は「0」、最大値は「255」になる。カラー画像では、R,G,Bの色成分毎に0〜255値を持っている。このRGB値の平均値が各画素における明るさになる。
The
補正部20は、最明画素検出部21、補正色決定部22、及び塗りつぶし補正部23とで構成されており、テカリ領域内を明るい画素から順に、補正の回数に応じて決められる補正色cで塗りつぶしていく。最明画素検出部21は、テカリ領域の中で補正していない画素のうちの最も明るい画素の色bを取得する。補正色決定部22は、前述した平均色aとテカリ領域内の最も明るい画素の色bとの合成比率を補正の回数iに応じて変えて補正色cを作る。合成比率は、[数1]に示す式に基づいて決められる。
The
[数1]
c=a・(i+1)/2・x+b・(i−1)/2・x
[Equation 1]
c = a · (i + 1) / 2 · x + b · (i−1) / 2 · x
[数1]に記載の「c」は補正色(塗りつぶす色)、「a」はテカリ領域の周囲の肌の色を平均した平均色、「b」はテカリ領域内のうちの補正していない画素のうちの最も明るい画素の色、「x」は分類数、「i」は補正の回数である。 “C” described in [Equation 1] is a correction color (filling color), “a” is an average color obtained by averaging skin colors around the shine area, and “b” is not corrected in the shine area. The color of the brightest pixel among the pixels, “x” is the number of classifications, and “i” is the number of corrections.
[数1]に記載の式は、補正の回数iに応じて、その時点で最も明るい画素の色bに対して平均色aを少しずつ混合して補正色cを作る式である。塗りつぶし補正部23は、明るいグループで分類される画素群から順に補正色cで塗りつぶす。
The equation described in [Equation 1] is an equation for making the correction color c by mixing the average color a little by little with the color b of the brightest pixel at that time according to the number of corrections i. The
分類数xは、補正の回数iの最大数と同じである。最初に補正をする時には、補正の回数iに「0」が代入される。ここで、最初に補正するテカリ領域のうちの最も明るい画素の色を「b0」、最初に塗りつぶす(補正する)補正色cを「c0」、次に補正するテカリ領域のうちの補正していない最も明るい画素の色を「b1」、塗りつぶす補正色を「c1」とすると、補正色c1は、2回目の補正である(補正の回数iを「1」として計算する)ため、最初の補正色c0に対して平均色aが少し多く混合されており、かつ明るい画素の色b1も最初の明るい画素の色b0よりも少し暗い色であるため、テカリ領域の周囲の画素の平均色aに近づく色になる。このような作業を分類数xの分だけ繰り返し行うことで、テカリ領域を、光の当たる方向、及びテカリのバランスを変えずに補正することができる。 The classification number x is the same as the maximum number of corrections i. When the correction is performed for the first time, “0” is substituted for the number of corrections i. Here, the color of the brightest pixel in the shining area to be corrected first is “b0”, the correction color c to be filled (corrected) first is “c0”, and the correction in the shining area to be corrected next is not corrected. Assuming that the color of the brightest pixel is “b1” and the correction color to be filled is “c1”, the correction color c1 is the second correction (the number of corrections i is calculated as “1”). Since the average color a is slightly mixed with c0, and the bright pixel color b1 is also slightly darker than the first bright pixel color b0, it approaches the average color a of the surrounding pixels of the shine area. Become a color. By repeating such operations for the number of classifications x, the shine area can be corrected without changing the direction of light and the balance of the shine.
次に、上記構成の作用を、図3を参照しながら説明する。画像入力部11により入力される画像データは、顔検出部12により顔画像領域が検出される(S−1)。顔画像領域が検出されると、目・口検出部13が顔画像領域内から目・口の画像領域を検出する(S−2)。
Next, the operation of the above configuration will be described with reference to FIG. In the image data input by the
顔画像領域内に目・口画像領域を検出した場合、テカリ領域検出部14は、顔画像領域のうちの目・口画像領域以外の領域で、所定の明るさより明るく写っている領域をテカリ領域として検出する(S−3)。目・口画像領域を検出していない場合には、顔画像領域で、所定の明るさより明るく写っている領域をテカリ領域として検出する(S−4)。
When the eye / mouth image area is detected in the face image area, the shine
テカリ領域の補正は、まず、平均色取得部18が、テカリ領域の周り(周辺部)の肌の色、すなわち、図4に示すように、テカリ領域25の境界に隣接する画素26の色の平均色aを取得する(S−5)。
In the correction of the shine area, first, the average
その後、明るさ分類部19は、テカリ領域25内の全画素の明るさを調べ、メモリ等の記憶部に一時的に保存する。そして、テカリ領域内の全画素の明るさを予め決めた閾値に基づいて複数のグループに分類する(S−6)。また、取得した画素と直前に取得した画素との明るさを順に比較していき、最も明るい画素の色を検出する(S−7)。
Thereafter, the
例えば5つの分類になった場合、テカリ領域25の全画素は、5つのグループ27〜31に分類される。第1〜第5グループ27〜31は、図5に示す横軸の明るさの範囲ごとに分類されている。なお、図5に示すグラフの縦軸は、画素数を示している。図5のヒストグラムに示される第1〜第5グループ27〜31に属する画素群は、図4に示すテカリ領域25のうちの第1〜第5の領域27〜31に対応するものとする。
For example, in the case of five classifications, all pixels in the
補正部20は、平均色aと最も明るい画素(第1領域27の画素A)の色bとの合成比率を補正の回数iに応じて変えて補正色cを作り(S−8)、作成した補正色cで前記画素A(第1領域27の画素)を塗りつぶす。補正色cは、[数1]に示す式に基づいて決められる。
The
例えば、前述したように分類数xが「5」である場合、[数1]の式に基づいて最初の補正で塗りつぶす補正色c0を求める。最初の補正であるので補正の回数iに「0」を代入し、またテカリ領域25内で最も明るい画素(第1の領域27の画素)の色bを「b0」とすると、最初に塗りつぶす補正色c0はc0=[1/2・a+1/2・(b0)]となる。つまり、最初の補正で塗りつぶす補正色c0は、平均色aと最も明るい画素の色b0とを半分ずつ合成して作られる。したがって、最初の補正では、図4に示す第1の領域27が補正色c0で塗りつぶされる(S−9)。
For example, as described above, when the classification number x is “5”, the correction color c0 to be filled in by the first correction is obtained based on the formula [Equation 1]. Since this is the first correction, if “0” is substituted for the number of corrections i, and the color b of the brightest pixel (the pixel in the first area 27) in the
その後、補正部20は、テカリ領域内で補正していない画素がある場合(S−10)、テカリ領域25内で補正していない画素のうちの最も明るい画素(第2領域28の画素)の色bを「b1」として取得する。そして、[数1]を用い、補正の回数iに「1」を代入すると(S−11)、2回目に塗りつぶす補正色c1は、C1=[3/5・a+2/5・(b1)]となる。つまり、2回目の補正で作られる補正色c1は、最初に作った補正色c0に対して、次に明るい画素(第2領域28の画素)の色b1の割合を少し減し、かつ平均色aの割合を少し増やした混合比で作られている。これにより、図4に示す次に明るい画素群(第2領域28)は、作成した補正色c1により塗りつぶされる。
Thereafter, when there is a pixel that has not been corrected in the shine area 25 (S-10), the
このように前述した作業を分類数xの分だけ繰り返すことで、明るさに応じて分類した画素(グループ)を、補正の回数に応じて合成比率を変えた補正色cで、明るさの高い画素群から順に塗りつぶしていく。ここで、補正の回数iに応じて[数1]の式から算出される補正色c0〜c4の合成比率を図6に記載する。 In this way, by repeating the above-described operation for the number of classifications x, pixels (groups) classified according to the brightness have a high brightness with the correction color c in which the composition ratio is changed according to the number of corrections. Paint sequentially from the pixel group. Here, the composition ratio of the correction colors c0 to c4 calculated from the equation [Equation 1] according to the number of corrections i is shown in FIG.
なお、テカリ領域は、顔画像領域に対して複数検出される場合がある。検出されたテカリ領域に対して、テカリ領域補正部15は、順にテカリ補正を行う(S−12)。
Note that a plurality of shine areas may be detected for the face image area. With respect to the detected shine area, the shine
このように、補正色cは、補正の回数iが増すことに応じて平均色aを徐々に増やし、逆にその時点で最も明るい画素の色bの合成を減して作られる。テカリ領域25は、明るい領域27から暗い領域31に向けて平均色aに徐々に近づく補正色で、1画素分のステップずつ塗りつぶされる。これにより、立体感を損なわず、テカリ領域の周りになじむ自然なグラデーションで補正される。
In this way, the correction color c is created by gradually increasing the average color a as the number of corrections i increases, and conversely reducing the composition of the color b of the brightest pixel at that time. The
なお、上記実施形態のテカリ補正では、テカリ領域を画素の明るさに応じて分類した複数のグループを最も明るい画素のグループから順に、前述した平均色aに徐々に近づくように補正色cで塗りつぶす補正を行っているが、本発明ではこれに限らず、平均色と塗りつぶし対象となる画素の色とを、最も明るい画素とテカリ領域の周囲の画素との間隔に応じて平均色aの合成比率を変えて作成した補正色で最も明るい画素から順に塗りつぶしてもよい。 In the shine correction of the above-described embodiment, a plurality of groups in which the shine area is classified according to the brightness of the pixels are filled with the correction color c so as to gradually approach the above-described average color a in order from the brightest pixel group. Although the correction is performed, the present invention is not limited to this, and the average color and the color of the pixel to be filled are determined by combining the average color a with the interval between the brightest pixel and the surrounding pixels of the shine area. It is also possible to paint in order from the brightest pixel in the correction color created by changing the.
例えば、最も明るい画素とテカリ領域の周囲との間隔が短い領域にある画素ほど、基準の補正色に対して1回の補正で平均色aを混合する量を多めにして作成した補正色で塗りつぶし、また、逆に前記距離が長い領域にある画素ほど、基準の補正色に対して1回の補正で平均色aを混合する量を少なくして作成した補正色で徐々に塗りつぶす。このため、最も明るい画素の領域がテカリ領域の中で偏った位置に存在していても、最も明るい画素の領域と周囲との間隔が短い領域では基準の補正色から平均色aに向けて、色の連続した変化が早い階調で補正され、また、間隔の長い領域では基準の補正色から平均色aに向けて、色の連続した変化が遅い階調で補正される。よって、最も明るい画素の領域と周囲との間の間隔に応じて自然なグラデーションになるようにテカリ領域を補正することができる。 For example, a pixel in a region where the distance between the brightest pixel and the periphery of the shine area is short is filled with a correction color created with a larger amount of the average color a mixed by one correction with respect to the reference correction color. On the contrary, as the pixel is located in the region with the longer distance, the correction color is gradually filled with the correction color created by reducing the amount of mixing the average color a by one correction with respect to the reference correction color. For this reason, even if the brightest pixel area exists at a position biased in the shine area, in the area where the distance between the brightest pixel area and the surrounding area is short, the reference correction color is shifted toward the average color a. A continuous change in color is corrected with a fast gradation, and in a long interval, a continuous change in color is corrected with a slow gradation from the reference correction color toward the average color a. Therefore, it is possible to correct the shine area so that a natural gradation is obtained according to the interval between the brightest pixel area and the surrounding area.
この場合、補正部は、[数2]に記載の式を用いて距離に応じて画素を塗りつぶす補正色dを決める。 In this case, the correction unit determines the correction color d for painting the pixel according to the distance using the equation described in [Equation 2].
[数2]
d=a・(0.5+0.5/n)+e・(0.5−0.5/n)
ここで、dは補正色、eは塗りつぶした画素に隣接する画素の色、nは塗りつぶし対象の画素と周囲との最短距離k/「1画素の大きさ」、つまり画素数(ドット数)である。
[Equation 2]
d = a · (0.5 + 0.5 / n) + e · (0.5−0.5 / n)
Here, d is the correction color, e is the color of the pixel adjacent to the filled pixel, n is the shortest distance k / “size of one pixel” between the pixel to be filled and the surroundings, that is, the number of pixels (number of dots) is there.
補正部は、図7及び図8に示すように、テカリ領域40の周囲の肌の色を平均した平均色aを取得し(S−13)、テカリ領域40内の全画素の明るさを取得してテカリ領域40内で一番明るい画素fの色wを取得する(S−14)。そして、平均色aと一番明るい画素fの色wとを1対1の比率で合成して補正色dを作成する(S−15)。そして、作成した補正色dで一番明るい画素fを塗りつぶす(S−16)。つまり、テカリ領域40のうちの一番明るい画素f(一番最初に塗りつぶす画素)は、0.5a+0.5eの合成比率で作成した基準の補正色dで塗りつぶされる。 As shown in FIGS. 7 and 8, the correction unit acquires an average color a obtained by averaging the skin colors around the shine area 40 (S-13), and acquires the brightness of all pixels in the shine area 40. Then, the color w of the brightest pixel f in the shine area 40 is acquired (S-14). Then, the correction color d is created by synthesizing the average color a and the color w of the brightest pixel f at a ratio of 1: 1 (S-15). Then, the brightest pixel f is filled with the created correction color d (S-16). That is, the brightest pixel f (the pixel to be filled first) in the shine area 40 is filled with the reference correction color d created at a composite ratio of 0.5a + 0.5e.
2回目の補正では、先に塗りつぶした画素fに隣接する画素z1の色eを取得し(S−17)、その画素z1に対して最も近くにある周囲の画素p1を検出し、これらの間の最短距離k1を算出する(S−18)。基準の補正色に対して最短距離k1に応じた比率で平均色aを混合して補正色dを作成する(S−19)。 In the second correction, the color e of the pixel z1 adjacent to the previously filled pixel f is acquired (S-17), the surrounding pixel p1 closest to the pixel z1 is detected, and the interval between them is detected. The shortest distance k1 is calculated (S-18). A correction color d is created by mixing the average color a at a ratio corresponding to the shortest distance k1 with respect to the reference correction color (S-19).
例えば図8に示す例では、最も明るい画素fの群41は、前述した基準の補正色dで塗りつぶされる。2回目の補正では、画素群41に隣接する画素z1の色eを取得し、その後、画素z1と周囲の画素p1との最短距離k1を算出する。そして、[数2]に記載の式に画素z1の色eと距離k1との値を代入して、補正色d1を算出する。そして、算出した補正色d1で画素z1を塗りつぶす(S−20)。 For example, in the example shown in FIG. 8, the brightest pixel f group 41 is filled with the reference correction color d described above. In the second correction, the color e of the pixel z1 adjacent to the pixel group 41 is acquired, and then the shortest distance k1 between the pixel z1 and the surrounding pixel p1 is calculated. Then, the correction color d1 is calculated by substituting the values of the color e of the pixel z1 and the distance k1 into the equation described in [Equation 2]. Then, the pixel z1 is painted with the calculated correction color d1 (S-20).
n回目の補正では、画素群41に隣接する画素znの色eを取得し、その後、画素znと周囲の画素pnとの最短距離knを算出する。そして、[数2]に記載の式に画素znの色eと距離knとの値を代入して、補正色dnを算出する。そして、算出した補正色dnで画素znを塗りつぶす。 In the n-th correction, the color e of the pixel zn adjacent to the pixel group 41 is acquired, and then the shortest distance kn between the pixel zn and the surrounding pixel pn is calculated. Then, the correction color dn is calculated by substituting the values of the color e and the distance kn of the pixel zn into the equation described in [Equation 2]. Then, the pixel zn is filled with the calculated correction color dn.
以後、前述した手順を繰り返して先に塗りつぶした画素の隣の画素から順に塗りつぶしていくことで、テカリ領域の全部の画素を補正する(S−21)。 Thereafter, the above-described procedure is repeated, and the pixels adjacent to the previously painted pixel are painted in order to correct all the pixels in the shine area (S-21).
平均色aは、基準の補正色dに対して距離kに応じた比率で合成される。[数2]の式を用いる場合、図9に示すように、塗りつぶし対象の画素と周囲の画素との距離kが短くなるほど、平均色aの比率を増やして補正色dが作成される。なお、これに伴って補正対象となる画素の色eの合成比率を減らしていくのは勿論である。そして、n=1のときには、平均色aで塗りつぶすことになる。 The average color a is synthesized at a ratio corresponding to the distance k with respect to the reference correction color d. When using the formula [2], as shown in FIG. 9, the correction color d is created by increasing the ratio of the average color a as the distance k between the pixel to be filled and the surrounding pixels becomes shorter. Along with this, it goes without saying that the composition ratio of the color e of the pixel to be corrected is reduced. When n = 1, the color is painted with the average color a.
ところで、補正色dを作る平均色aの合成比率を、口・目以外の部位に応じて変えるのが望ましい場合がある。例えば鼻の領域にテカリ領域が有る場合には、前述した[数1]又は[数2]に記載の式を用いて補正すると、平均色aを少なくとも半分混合した基準の補正色で最も明るい領域を塗りつぶすとともに、この領域から周囲に向かって基準の補正色に対して平均色aの比率を徐々に上げて作成した補正色で塗りつぶしていくため、平均色の合成比率が最初から多く、よって、立体感が得られなくなる不都合が生じる。 Incidentally, there are cases where it is desirable to change the composition ratio of the average color a that forms the correction color d in accordance with the part other than the mouth and eyes. For example, when there is a shine area in the nose area, the brightest area of the reference correction color in which the average color a is mixed at least half is corrected by using the formula described in [Expression 1] or [Expression 2]. In addition, the ratio of the average color a is gradually increased with respect to the reference correction color from this region toward the periphery, and the correction color is created, so that the composite ratio of the average color is large from the beginning. There is an inconvenience that the stereoscopic effect cannot be obtained.
そこで、この場合には、平均色aを少なくとも半分以下の比率で合成した第2基準の補正色で最も明るい領域を塗りつぶすとともに、この領域から周囲に向かって前記第2基準の補正色に対して平均色の比率を徐々に上げた補正色で塗りつぶしていけばよい。 Therefore, in this case, the brightest area is filled with the second reference correction color obtained by synthesizing the average color a at a ratio of at least half or less, and the second reference correction color is extended from this area toward the periphery. What is necessary is just to paint with the correction color which gradually increased the ratio of the average color.
勿論この場合には、テカリ領域が鼻領域であるか否かを判定する判定部を設け、鼻の領域にテカリ領域が存在する場合の補正である。また、前述したような合成比率になるように、予め決めた補正係数を前述した[数1]又は[数2]の式のうちの平均色aの比率を求める部分に掛けて補正するようにしてもよい。これにより、鼻の立体感が無くなることを防ぐことができる。 Of course, in this case, a determination unit that determines whether or not the shine area is a nose area is provided, and correction is performed when the shine area exists in the nose area. In addition, a correction coefficient determined in advance is corrected by multiplying the portion for obtaining the ratio of the average color a in the above-described equation [Equation 1] or [Equation 2] so that the composition ratio as described above is obtained. May be. Thereby, it can prevent that a nose three-dimensional effect is lost.
10 画像補正装置
12 顔検出部
14 テカリ領域検出部
15 テカリ領域補正部
DESCRIPTION OF
Claims (12)
顔画像領域で所定の明るさより明るい領域、又は周囲よりも明るさが所定以上明るい領域をテカリ領域として検出するテカリ領域検出手段と、
前記テカリ領域を最も明るい領域から周囲に向けて周囲の色に徐々に近づくように塗りつぶす補正を行うテカリ補正手段と、
を備えたことを特徴とする画像補正装置。 Face detection means for detecting a face image area from the input image;
A shine area detection means for detecting, as a shine area, an area brighter than a predetermined brightness in the face image area or an area brighter than the surrounding area by a predetermined amount;
Shine correction means for correcting the shine area so as to gradually approach the surrounding color from the brightest area toward the periphery; and
An image correction apparatus comprising:
前記テカリ補正手段は、
前記テカリ領域を最も明るい領域から周囲に向けて徐々に塗りつぶす補正色を、前記テカリ領域内の塗りつぶし対象となる画素の色に対して、前記テカリ領域の周囲の画素の色を平均した平均色を混合する割合を徐々に増やして作成することを特徴とする画像補正装置。 The image correction apparatus according to claim 1,
The shine correction means is
A correction color that gradually fills the shine area from the brightest area to the periphery, and an average color obtained by averaging the colors of the pixels around the shine area with respect to the color of the pixel to be filled in the shine area. An image correction apparatus characterized by gradually increasing the mixing ratio.
前記テカリ補正手段は、
前記テカリ領域の周囲の画素の色を平均した平均色を取得する平均色取得部と、
前記テカリ領域を画素の明るさに応じて複数のグループに分類する分類部と、
前記平均色を、塗りつぶし対象となるグループの画素の色に、前記平均色の比率が徐々に増えるように合成して補正色を作成し、作成した補正色で最も明るいグループの画素から順に塗りつぶす補正部と、
で構成されていることを特徴とする画像補正装置。 The image correction apparatus according to claim 1 or 2,
The shine correction means is
An average color acquisition unit that acquires an average color obtained by averaging the colors of pixels around the shine area;
A classification unit for classifying the shine area into a plurality of groups according to pixel brightness;
A correction color is created by combining the average color with the color of the pixel of the group to be filled so that the ratio of the average color gradually increases, and the correction is performed by filling the pixels in order from the brightest group of the created correction color. And
An image correction apparatus comprising:
前記テカリ補正手段は、
テカリ領域の周囲の画素の色を平均した平均色を取得する平均色取得部と、
テカリ領域のうちの最も明るい画素を検出する最明画素検出部と、
前記平均色と塗りつぶし対象となる画素の色とを、前記周囲との間の距離が短い画素ほど前記平均色の比率が徐々に増えるように合成して補正色を作成し、作成した補正色で前記最も明るい画素から周囲の画素に向けて順に画素を塗りつぶす補正部と、
で構成されていることを特徴とする画像補正装置。 The image correction apparatus according to claim 1 or 2,
The shine correction means is
An average color acquisition unit that acquires an average color obtained by averaging the colors of pixels around the shine area;
The brightest pixel detection unit for detecting the brightest pixel in the shine area;
The correction color is created by combining the average color and the color of the pixel to be filled so that the ratio of the average color gradually increases as the distance from the surrounding area becomes shorter. A correction unit that fills pixels in order from the brightest pixel to surrounding pixels;
An image correction apparatus comprising:
顔画像領域で所定の明るさより明るい領域、又は周囲よりも明るさが所定以上明るい領域をテカリ領域として検出するテカリ領域検出ステップと、
前記テカリ領域を最も明るい領域から周囲に向けて周囲の色に徐々に近づくように塗りつぶす補正を行うテカリ補正ステップと、
を含むことを特徴とする画像補正方法。 A face detection step for detecting a face image area from the input image;
A shining area detecting step for detecting, as a shining area, an area brighter than a predetermined brightness in the face image area or an area brighter than the surrounding area by a predetermined amount;
A shine correction step for correcting the shine area so as to gradually approach the surrounding color from the brightest area toward the periphery,
An image correction method comprising:
前記テカリ補正ステップは、
前記テカリ領域を最も明るい領域から周囲に向けて徐々に塗りつぶす補正色を、前記テカリ領域内の塗りつぶし対象となる画素の色に対して、前記テカリ領域の周囲の画素の色を平均した平均色を混合する割合を徐々に増やして作成することを特徴とする画像補正方法。 The image correction method according to claim 5,
The shine correction step includes
A correction color that gradually fills the shine area from the brightest area to the periphery, and an average color obtained by averaging the colors of the pixels around the shine area with respect to the color of the pixel to be filled in the shine area. A method for correcting an image, characterized by gradually increasing the mixing ratio.
前記テカリ補正ステップは、
テカリ領域の周囲の画素の色を平均した平均色を取得する平均色取得ステップと、
テカリ領域を画素の明るさに応じて複数のグループに分類する分類ステップと、
前記平均色と塗りつぶし対象となるグループの画素の色とを、前記平均色の合成比率が徐々に増えるように合成して補正色を作成し、作成した補正色で最も明るいグループの画素から順に塗りつぶす補正ステップと、
を含むことを特徴とする画像補正方法。 The image correction method according to claim 5 or 6,
The shine correction step includes
An average color acquisition step of acquiring an average color obtained by averaging the colors of pixels around the shine area;
A classification step of classifying the shine area into a plurality of groups according to pixel brightness;
The average color and the colors of the pixels of the group to be filled are synthesized so that the synthesis ratio of the average color gradually increases to create a correction color, and the correction color thus created is filled in order from the brightest group of pixels. A correction step;
An image correction method comprising:
前記テカリ補正ステップは、
テカリ領域の周囲の画素の色を平均した平均色を取得する平均色取得ステップと、
テカリ領域のうちの最も明るい画素を検出する最明画素検出ステップと、
前記平均色と塗りつぶし対象となる画素の色とを、前記周囲との間の距離が短い画素ほど前記平均色の合成比率が徐々に増えるように合成して補正色を作成し、作成した補正色で前記最も明るい画素から周囲の画素に向けて順に画素を塗りつぶす補正ステップと、
を含むことを特徴とする画像補正方法。 The image correction method according to claim 5 or 6,
The shine correction step includes
An average color acquisition step of acquiring an average color obtained by averaging the colors of pixels around the shine area;
A brightest pixel detection step for detecting the brightest pixel in the shine area;
A correction color is created by combining the average color and the color of the pixel to be filled so that a pixel having a shorter distance from the surrounding area gradually increases the average color combination ratio, A correction step of filling the pixels in order from the brightest pixel to the surrounding pixels;
An image correction method comprising:
顔画像領域で所定の明るさより明るい領域、又は周囲よりも明るさが所定以上明るい領域をテカリ領域として検出するテカリ領域検出ステップと、
前記テカリ領域を最も明るい領域から周囲に向けて周囲の色に徐々に近づくように塗りつぶす補正を行うテカリ補正ステップと、
をコンピュータに実行せるためのプログラム。 A face detection step for detecting a face image area from the input image;
A shining area detecting step for detecting, as a shining area, an area brighter than a predetermined brightness in the face image area or an area brighter than the surrounding area by a predetermined amount;
A shine correction step for correcting the shine area so as to gradually approach the surrounding color from the brightest area toward the periphery,
A program that allows a computer to execute.
顔画像領域で所定の明るさより明るい領域、又は周囲よりも明るさが所定以上明るい領域をテカリ領域として検出するテカリ領域検出ステップと、
テカリ領域の周囲の画素の色を平均した平均色を取得する平均色取得ステップと、
前記テカリ領域を画素の明るさに応じて複数のグループに分類する分類ステップと、
前記平均色と塗りつぶし対象となるグループの画素の色とを、前記平均色の合成比率が徐々に増えるように合成して補正色を作成し、作成した補正色で最も明るいグループの画素から順に塗りつぶす補正ステップと、
をコンピュータに実行せるためのプログラム。 A face detection step for detecting a face image area from the input image;
A shining area detecting step for detecting, as a shining area, an area brighter than a predetermined brightness in the face image area or an area brighter than the surrounding area by a predetermined amount;
An average color acquisition step of acquiring an average color obtained by averaging the colors of pixels around the shine area;
A classification step of classifying the shine area into a plurality of groups according to pixel brightness;
The average color and the colors of the pixels of the group to be filled are synthesized so that the synthesis ratio of the average color gradually increases to create a correction color, and the correction color thus created is filled in order from the brightest group of pixels. A correction step;
A program that allows a computer to execute.
顔画像領域で所定の明るさより明るい領域、又は周囲よりも明るさが所定以上明るい領域をテカリ領域として検出するテカリ領域検出ステップと、
テカリ領域の周囲の画素の色を平均した平均色を取得する平均色取得ステップと、
テカリ領域のうちの最も明るい画素を検出する最明画素検出ステップと、
前記平均色と塗りつぶし対象となる画素の色とを、前記周囲との間の距離が短い画素ほど前記平均色の合成比率が徐々に増えるように合成して補正色を作成し、作成した補正色で前記最も明るい画素から周囲の画素に向けて順に画素を塗りつぶす補正ステップと、
をコンピュータに実行せるためのプログラム。 A face detection step for detecting a face image area from the input image;
A shining area detecting step for detecting, as a shining area, an area brighter than a predetermined brightness in the face image area or an area brighter than the surrounding area by a predetermined amount;
An average color acquisition step of acquiring an average color obtained by averaging the colors of pixels around the shine area;
A brightest pixel detection step for detecting the brightest pixel in the shine area;
A correction color is created by combining the average color and the color of the pixel to be filled so that a pixel having a shorter distance from the surrounding area gradually increases the average color combination ratio, A correction step of filling the pixels in order from the brightest pixel to the surrounding pixels;
A program that allows a computer to execute.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2012024131A JP2013161348A (en) | 2012-02-07 | 2012-02-07 | Image correction device, method, program, and recording medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2012024131A JP2013161348A (en) | 2012-02-07 | 2012-02-07 | Image correction device, method, program, and recording medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2013161348A true JP2013161348A (en) | 2013-08-19 |
Family
ID=49173524
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2012024131A Pending JP2013161348A (en) | 2012-02-07 | 2012-02-07 | Image correction device, method, program, and recording medium |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2013161348A (en) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2018005573A (en) * | 2016-07-01 | 2018-01-11 | キヤノン株式会社 | Image processing apparatus, image processing method, program, and storage medium |
| JP2018041380A (en) * | 2016-09-09 | 2018-03-15 | キヤノン株式会社 | Image processing apparatus, image processing method, and program |
| JP2018198029A (en) * | 2017-05-25 | 2018-12-13 | キヤノン株式会社 | Image processing apparatus, image processing method, and program |
| US10248843B2 (en) | 2015-03-12 | 2019-04-02 | Omron Corporation | Image processing apparatus and method for removing a facial object |
| JP2021128791A (en) * | 2016-12-02 | 2021-09-02 | キヤノン株式会社 | Image processing apparatus, image processing method, and program |
-
2012
- 2012-02-07 JP JP2012024131A patent/JP2013161348A/en active Pending
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10248843B2 (en) | 2015-03-12 | 2019-04-02 | Omron Corporation | Image processing apparatus and method for removing a facial object |
| JP2018005573A (en) * | 2016-07-01 | 2018-01-11 | キヤノン株式会社 | Image processing apparatus, image processing method, program, and storage medium |
| JP2018041380A (en) * | 2016-09-09 | 2018-03-15 | キヤノン株式会社 | Image processing apparatus, image processing method, and program |
| JP2021128791A (en) * | 2016-12-02 | 2021-09-02 | キヤノン株式会社 | Image processing apparatus, image processing method, and program |
| JP7129520B2 (en) | 2016-12-02 | 2022-09-01 | キヤノン株式会社 | Image processing device, image processing method, and program |
| JP2018198029A (en) * | 2017-05-25 | 2018-12-13 | キヤノン株式会社 | Image processing apparatus, image processing method, and program |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP5889431B2 (en) | Image processing apparatus and image processing method | |
| CN101483711B (en) | Gradation correction device, gradation correction method | |
| JP5960513B2 (en) | Video processing apparatus and method | |
| US10291823B2 (en) | Apparatus and method for color calibration | |
| CN103679733B (en) | A kind of signal lamp image processing method and its device | |
| KR100901353B1 (en) | Image processing apparatus and method | |
| US8737762B2 (en) | Method for enhancing image edge | |
| US9185265B2 (en) | Image processing method and image processing apparatus for performing a tone correction to acquire a combined image | |
| US9449375B2 (en) | Image processing apparatus, image processing method, program, and recording medium | |
| JP2013161348A (en) | Image correction device, method, program, and recording medium | |
| JP4066803B2 (en) | Image processing apparatus, image processing program, image processing method, and electronic camera | |
| CN108337450A (en) | Image processing apparatus, image processing method and recording medium | |
| US9299003B2 (en) | Image processing apparatus, non-transitory computer readable medium, and image processing method | |
| CN105338214B (en) | Image processing method and image processing apparatus | |
| JP6365355B2 (en) | Image generating apparatus and image generating method | |
| US9235773B2 (en) | Image processing device capable of determining types of images accurately | |
| US11636576B2 (en) | Image processing apparatus for reducing influence of fine particle in an image, control method of same, and non-transitory computer-readable storage medium | |
| KR20150037203A (en) | Device for correcting depth map of three dimensional image and method for correcting the same | |
| JP6889336B2 (en) | Image demosaic processing system and method | |
| JP5884605B2 (en) | Image processing apparatus and program | |
| CN114240800A (en) | Scattering scene-oriented coded camera image enhancement method and device | |
| JP5147912B2 (en) | Image processing method, image processing apparatus, program, and recording medium | |
| KR101488641B1 (en) | Image processing apparatus and Image processing method | |
| JP2000099701A (en) | Image color processor, image color processing method and recording medium | |
| JP4831344B2 (en) | Eye position detection method |