JP2009003858A - Image processing program and image processor - Google Patents
Image processing program and image processor Download PDFInfo
- Publication number
- JP2009003858A JP2009003858A JP2007166341A JP2007166341A JP2009003858A JP 2009003858 A JP2009003858 A JP 2009003858A JP 2007166341 A JP2007166341 A JP 2007166341A JP 2007166341 A JP2007166341 A JP 2007166341A JP 2009003858 A JP2009003858 A JP 2009003858A
- Authority
- JP
- Japan
- Prior art keywords
- light source
- source region
- region
- image
- area
- 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
- 238000000034 method Methods 0.000 claims description 29
- 230000005484 gravity Effects 0.000 claims description 27
- 230000000694 effects Effects 0.000 claims description 18
- 239000000284 extract Substances 0.000 claims description 5
- 238000010187 selection method Methods 0.000 claims 5
- 238000000605 extraction Methods 0.000 description 57
- 230000014509 gene expression Effects 0.000 description 6
- 238000002156 mixing Methods 0.000 description 4
- 238000006243 chemical reaction Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 229910003460 diamond Inorganic materials 0.000 description 1
- 239000010432 diamond Substances 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000001771 impaired effect Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
Images
Abstract
Description
本発明は、画像処理プログラム、および画像処理装置に関する。 The present invention relates to an image processing program and an image processing apparatus.
次のような画像変換装置が知られている。この画像変換装置は、ピントを外して撮影された画像に発生するぼけを再現するために、画像データに基づいて露光量を算出し、露光量に基づいて、画像内の明るい部分が暗い部分に侵食するようなぼかしを付加する(例えば、特許文献1)。 The following image conversion apparatus is known. This image conversion device calculates an exposure amount based on image data in order to reproduce a blur generated in an image taken out of focus, and based on the exposure amount, a bright part in the image is changed to a dark part. A blur that erodes is added (for example, Patent Document 1).
しかしながら、従来の画像変換装置では、画像内の明るい部分が暗い部分に侵食するようなぼかしを付加しているが、その明るい部分が必ずしも光源などのような光を発している点であるとは限らず、不自然な位置にぼかし効果が付加されてしまう可能性があった。 However, in the conventional image conversion device, the bright portion in the image is blurred so that the dark portion erodes, but the bright portion does not necessarily emit light such as a light source. The blur effect may be added to an unnatural position.
本発明による画像処理プログラムは、画像内の光源を含む光源領域を特定し、あらかじめ用意された複数のフィルタの中から、光源領域にぼかし効果を付加するために用いるフィルタを選択し、選択したフィルタを用いて、光源領域にぼかし効果を付加することを特徴とする。
本発明では、光源領域内の色情報、光源領域の大きさ、画像内における光源領域の位置、光源領域の明るさ、画像取得時のレンズ情報、および撮影日時情報の少なくともいずれか1つに基づいて、光源領域に付加するぼかしの形状を決定し、決定したぼかしの形状に応じたフィルタを選択するようにしてもよい。
また、光源領域内の色情報、光源領域の大きさ、画像内における光源領域の位置、光源領域の明るさ、および画像内に含まれる光源領域の数の少なくともいずれか1つに基づいて、光源領域に付加するぼかしの大きさを決定し、決定したぼかしの大きさに応じたフィルタを選択するようにしてもよい。
あらかじめ設定された形状、および大きさのぼかしを光源領域に付加するためのフィルタを選択するようにしてもよい。
画像内から複数の光源領域が特定された場合に、使用者からの指示に基づいて、第1の光源領域と第2の光源領域とを入れ替えるようにしてもよい。このとき、第1の光源領域の大きさと第2の光源領域の大きさとが異なる場合には、それぞれを入れ替え先の光源領域の大きさに合わせて拡大または縮小することが好ましい。
画像内から輝度値が第1の閾値以上の領域を第1の領域として抽出し、画像内から輝度値が第1の閾値よりも小さい第2の閾値以上の領域を第2の領域として抽出し、第1の領域および第2の領域の特徴量に基づいて、光源領域を特定するようにしてもよい。このとき、第2の領域の面積と第2の領域内に含まれる第1の領域の面積との比、および第2の領域の重心と第2の領域内に含まれる第1の領域の重心との位置関係に基づいて、第2の領域が光源領域であるか否かを特定するようにしてもよい。
本発明による画像処理装置は、上記画像処理プログラムを実行するための実行手段を備えることを特徴とする。
An image processing program according to the present invention specifies a light source region including a light source in an image, selects a filter to be used for adding a blurring effect to the light source region from a plurality of filters prepared in advance, and selects the selected filter Is used to add a blurring effect to the light source region.
In the present invention, based on at least one of color information in the light source region, the size of the light source region, the position of the light source region in the image, the brightness of the light source region, lens information at the time of image acquisition, and shooting date / time information. Then, the shape of the blur to be added to the light source region may be determined, and a filter corresponding to the determined blur shape may be selected.
The light source is based on at least one of color information in the light source region, the size of the light source region, the position of the light source region in the image, the brightness of the light source region, and the number of light source regions included in the image. The size of the blur to be added to the region may be determined, and a filter corresponding to the determined blur size may be selected.
A filter for adding a blur having a preset shape and size to the light source region may be selected.
When a plurality of light source areas are specified from the image, the first light source area and the second light source area may be switched based on an instruction from the user. At this time, when the size of the first light source region is different from the size of the second light source region, it is preferable to enlarge or reduce each according to the size of the replacement light source region.
A region having a luminance value greater than or equal to the first threshold is extracted from the image as a first region, and a region having a luminance value greater than or equal to the second threshold smaller than the first threshold is extracted from the image as a second region. The light source region may be specified based on the feature amounts of the first region and the second region. At this time, the ratio between the area of the second region and the area of the first region included in the second region, and the centroid of the second region and the centroid of the first region included in the second region Whether the second area is a light source area or not may be specified based on the positional relationship between
An image processing apparatus according to the present invention comprises an execution means for executing the image processing program.
本発明によれば、画像内の光源位置にぼかし効果を付加することができる。 According to the present invention, it is possible to add a blurring effect to a light source position in an image.
図1は、本実施の形態における画像処理装置の一実施の形態の構成を示すブロック図である。画像処理装置100は、例えばパソコン(パーソナルコンピュータ)であって、操作部材101と、接続IF(インターフェース)102と、制御装置103と、HDD(ハードディスクドライブ)104と、モニタ105とを備えている。
FIG. 1 is a block diagram showing a configuration of an embodiment of an image processing apparatus according to the present embodiment. The
操作部材101は、使用者によって操作される種々の装置、例えばキーボードやマウスを含む。接続IF102は、デジタルカメラなどの外部機器を接続するためのインターフェースであって、例えばデジタルカメラと有線接続を行うためのUSBインターフェースや、無線接続を行うための無線LANモジュールなどが使用される。本実施の形態では、例えば、この接続IF102を介してデジタルカメラから画像データが取り込まれる。
The
HDD104は、接続IF102を介して取り込まれた画像データや、制御装置103で実行される種々のプログラム等を記録するための記録装置である。モニタ105は、例えば液晶モニタであって、制御装置103から出力される種々の表示用データが表示される。
The HDD 104 is a recording device for recording image data captured via the connection IF 102 and various programs executed by the
制御装置103は、CPU、メモリ、およびその他の周辺回路によって構成され、光源領域特定部103aと、光源色判定部103bと、ぼかし処理実行部103cとを機能的に備えている。本実施の形態では、光源領域特定部103aは、HDD104に記録されている画像を読み込んで、その画像内の光源を含む領域(光源領域)を特定する。光源色判定部103bは、光源領域特定部103aが特定した光源領域の色に基づいて光源の色を判定する。ぼかし処理実行部103bは、光原色判定部103bで判定した光源色に応じた色のぼかしを光源領域に付加する。なお、ここでは、HDD104には、RGB色空間で表される画像データが記録されているものとして説明を行う。
The
光源領域特定部103aは、画像内における光源を含む領域を光源領域として特定する。具体的には、光源領域特定部103aは、画像の輝度値Yを基準に光源領域の抽出を行う。このために、画像の画素値(R,G,B)(0≦R,G,B≦255)に基づいて、次式(1)で定義される輝度値Yを算出する。
Y=0.2990R+0.5870G+0.1140B ・・・(1)
The light source
Y = 0.2990R + 0.5870G + 0.1140B (1)
画像内から式(1)で算出した輝度値Yが所定値以上の画素で構成される領域を抽出することによって光源領域を抽出することができるようにも思われる。しかしながら、画像内に白い壁が存在する場合など、光源領域以外の領域も輝度値Yが所定値以上となる可能性があり、単純に輝度値Yが所定値以上の画素で構成される領域を抽出しただけではその領域に必ずしも光源が含まれているとは限らない。そこで、本実施の形態では、精度高く光源領域を特定するために、次のような処理を行う。 It seems that a light source region can be extracted by extracting a region composed of pixels having a luminance value Y calculated by the expression (1) of a predetermined value or more from the image. However, when there is a white wall in the image, the luminance value Y may also be a predetermined value or more in a region other than the light source region. Extraction does not necessarily include a light source in the area. Therefore, in the present embodiment, the following processing is performed in order to specify the light source region with high accuracy.
光源領域特定部103aは、式(1)で算出した輝度値Yが所定の輝度値Y1以上(例えば、Y1=250)である画素で構成される領域を抽出する。ここで、画像内に輝度値Yが所定の輝度値Y1以上である画素で構成される領域が複数ある場合には、複数の領域が抽出される。なお、ここで抽出した領域を、後に説明する領域と区別するために第1の抽出領域と呼ぶ。
Source
光源領域特定部103aは、抽出した第1の抽出領域のそれぞれについて、その領域の面積、重心位置を算出する。重心位置は、例えば、画像全体をXY座標系で表した場合の座標値(x座標値およびy座標値)として算出する。さらに、光源領域特定部103aは、第1の抽出領域のそれぞれについて、その領域の外形と接する外形枠を特定し、第1の抽出領域と外形枠との接点の座標値(x座標値およびy座標値)を算出する。例えば、図2に示すように第1の抽出領域2aが抽出された場合には、光源領域特定部103aは、その外形枠2bを特定し、領域と接点の接点2c〜2fのそれぞれの座標値を算出する。
The light source
また、光源領域特定部103aは、図3に示すように、第1の抽出領域の重心3aから上下左右および斜め方向の8方向を対象として、領域の縁までの距離ai(i=1〜8)を算出する。そして、光源領域特定部103aは、算出した領域の面積、重心位置の座標値、領域と外形枠との接点の座標値、および重心から領域の縁までの距離をメモリ内に保持しておく。
Further, as shown in FIG. 3, the light source
次に、光源領域特定部103aは、式(1)で算出した輝度値Yが所定の輝度値Y2以上(例えば、Y2=240)である画素で構成される領域を抽出する。ここで、画像内に輝度値Yが所定の輝度値Y2以上である画素で構成される領域が複数ある場合には、複数の領域が抽出される。なお、ここで抽出した領域を、上述した第1の抽出領域と区別するために第2の抽出領域と呼ぶ。
Next, the light source
光源領域特定部103aは、抽出した第2の抽出領域のそれぞれについて、その領域の面積、重心位置の座標値(x座標値およびy座標値)を算出する。さらに、光源領域特定部103aは、図3で上述した第1の抽出領域の場合と同様に、第2の抽出領域の重心から上下左右および斜め方向の8方向を対象として、領域の縁までの距離bi(i=1〜8)を算出する。そして、光源領域特定部103aは、算出した領域の面積、重心位置の座標値、および重心から領域の縁までの距離をメモリ内に保持しておく。
The light source
このように、Y1>Y2として第2の抽出領域を抽出したときには、図4(a)に示すように、第2の抽出領域4a内に第1の抽出領域2aが1つ含まれる場合と、図4(b)に示すように、第2の抽出領域4a内に第1の抽出領域2aが複数含まれる場合とがある。本実施の形態では、光源領域特定部103aは、第2の抽出領域4a内に第1の抽出領域2aを1つ含む場合と、複数含む場合とに場合を分けて、光源領域の特定を行う。
As described above, when the second extraction region is extracted with Y 1 > Y 2, as shown in FIG. 4A, one
なお、上述したように、画像内から複数の第2の抽出領域が抽出されていることも考えられるが、本実施の形態では、そのうちの1つの第2の抽出領域4aについて、その領域を光源領域として特定するか否かを判定する例について説明する。すなわち、第2の抽出領域4aが複数ある場合には、以下に説明する処理をそれぞれの第2の抽出領域ごとに行うようにすれば、各第2の抽出領域4aについて、それぞれ光源領域であるか否かを判定することが可能となる。
As described above, a plurality of second extraction regions may be extracted from the image. In the present embodiment, one of the
(A)第2の抽出領域4a内に第1の抽出領域2aを1つ含む場合
この場合には、第2の抽出領域は、光源領域としての独立性が高いと判断できることから、領域の形状がいびつでなければその領域を光源領域をみなすようにする。このため、光源領域特定部103aは、上述した重心から領域の縁までの8方向の距離biを用いて、次式(2)および(3)によって、第2の抽出領域を光源領域として特定するか否かを判定する。なお、次式(2)および(3)において、maxbiは、b1〜b8の中の最大値を表し、minbiは、b1〜b8の中の最小値を表す。
maxbi/minbi≦3.0 → 光源領域として特定する ・・・(2)
maxbi/minbi>3.0 → 光源領域として特定しない ・・・(3)
(A) When one
maxb i / minb i ≦ 3.0 → specified as a light source region (2)
maxb i / minb i > 3.0 → not specified as light source region (3)
光源領域特定部103aは、第2の抽出領域を光源領域として特定した場合には、その中に含まれる第1の光源領域の重心位置を光源位置として特定する。
When the second extraction area is specified as the light source area, the light source
(B)第2の抽出領域4a内に第1の抽出領域2aを複数含む場合
この場合には、抽出した第2の抽出領域4aをBと表し、第2の抽出領域4a内に含まれる1つまたは複数(n個)の第1の抽出領域2aをAi(i=1,2,・・・n)と表す。そして、Bの重心をgB、Ai(i=1,2,・・・n)の重心をそれぞれgi(i=1,2,・・・n)と表す。
(B) In the case where a plurality of
ここで、第2の抽出領域4a(B)内に第1の抽出領域2a(Ai)が複数含まれることとなった原因について考える。上述したように、領域を抽出する際に用いる輝度値Yの基準値(閾値)をY1(例えば250)からY2(例えば240)に少しだけ低下させたことにより、このような現象が発生していることから、考えられる理由は次の2つである。原因1:そもそも大きな領域Bは光源領域ではなく、個々のAiはその一部に過ぎない。
原因2:大きな領域Bが光源領域ではあるものの、基準値Y1の選び方により、領域B内に複数のAiが現れただけである。
Here, consider the reason why a plurality of
Cause 2: Although the large area B is the light source area, only a plurality of A i appear in the area B depending on how the reference value Y 1 is selected.
上記原因1および原因2のいずれの場合でも、大半のAiは光源領域ではないと判断してよく、仮に原因2のようにBが光源領域である場合には、後述するクロスの描画時に、Bの重心gB、あるいはgBにある程度近いAiの重心gi(i=1,2,・・・n)からクロスを発生させれば十分である。この点を踏まえ、光源領域特定部103aは、以下のような処理を行って、第2の抽出領域4a、すなわちBが光源領域であるか否かを判定する。
In both cases of
まず、光源領域特定部103aは、B内に含まれる複数のAiの重心gi(i=1,2,・・・n)のうち、Bの重心gBから最も近い位置に存在するものを重心Gとして抽出する。なお、本実施の形態では、Bが光源領域であると判定した場合に、この重心Gを光源位置として特定し、重心Gからのみクロスを発生させるようにし、他の重心giからはクロスを発生させないこととする。
First, the light source
ここで、Bが光源領域である場合には、Bの重心gBの位置と、抽出した重心Gの位置とは、図5(a)に示すように大きく異ならないはずであるが、Bが光源領域ではない場合には、両者の間の位置は、図5(b)に示すように大きく異なることになる。よって、本実施の形態では、このことを加味してBが光源領域として適当であるか否かを判定する。具体的には、光源領域特定部103aは、GとgBとの間の距離が許容範囲より大きいときは、Bを光源領域としては不適当であると判定する。これに対して、GとgBとの間の距離が許容範囲を以下である場合には、Bを光源領域として適当であると判定する。
Here, when B is a light source region, the position of the center of gravity g B of B and the position of the extracted center of gravity G should not greatly differ as shown in FIG. If it is not the light source region, the position between the two will be greatly different as shown in FIG. Therefore, in the present embodiment, in consideration of this, it is determined whether B is appropriate as the light source region. Specifically, the light source
光源領域特定部103aは、Bが光源領域として適当であるか否かを、例えば、次式(4)により判定する。すなわち、光源領域特定部103aは、GとgBとの間の距離が次式(4)に示す条件を満たす場合には、Bは光源領域として不適当であると判定し、満たさない場合には適当であると判定する。
GとgBとの間の距離>2×minai ・・・(4)
For example, the light source
Distance between G and g B > 2 × mina i (4)
光源領域特定部103aは、式(4)を用いた判定の結果、Bが光源領域として適当であると判定した場合には、さらに次式(5)および(6)を用いて、Bを光源領域として特定するか否かを判定する。すなわち、光源領域特定部103aは、次式(5)および(6)に示すいずれか一方の条件を満たす場合には、Bは光源領域としては不適当であると判定してBを光源領域として特定しないようにする。一方、光源領域特定部103aは、次式(5)および(6)に示す条件のいずれも満たさない場合には、Bは光源領域として適当であると判定してBを光源領域として特定する。
maxbi/minbi>3.0 ・・・(5)
領域Bの面積/Gを含む領域Aiの面積>1.0+(Y1/Y2) ・・・(6)
If the light source
maxb i / minb i > 3.0 (5)
Area> 1.0+ area A i including the area / G region B (Y 1 / Y 2) ··· (6)
光源領域特定部103aは、Bを光源領域として特定した場合には、B内に含まれる複数のAiの重心gi(i=1,2,・・・n)のうち、Bの重心gBから最も近い位置に存在する重心Gを光源位置として特定する。以上の処理によって、光源領域特定部103aは、画像内の光源領域、および光源位置を精度高く特定することができる。
When the light source
光源色特定部103bは、上述した光源領域特定部103aによる処理で特定された光源領域内の色情報に基づいて、光源領域内に含まれる光源の色を判定する。画像内における光源の中心部においては、その色は光源の色に関わらず白色となるため、その位置におけるR、G、Bの値はいずれも255に近くなり、光源の色を判定するための情報として用いるには不適当である。本実施の形態では、特定した光源領域内の外側部分、すなわち重心から所定距離離れた点の色情報に基づいて、光源の色を判定するようにする。例えば、光原色判定部103bは、図6に示す光源領域6aにおいて、中心部分の領域6bではなく、その外側の領域6c内の点の色情報を用いて光源色を判定する。
The light source
具体的には、光原色判定部103bは、次のように処理を行う。まず、光原色判定部103bは、外側の領域6c内の点の色情報を得るために、光源領域の重心、すなわち上述した第2の抽出領域の重心gBから上下左右および斜め方向の8方向を対象として、次式(7)または(8)のいずれかを満たす点を走査し、条件を満たす点を各方向から1点ずつ、すなわち8点抽出する。
max(R,G,B)−min(R,G,B)>140 ・・・(7)
Y<100 ・・・(8)
Specifically, the light primary
max (R, G, B) -min (R, G, B)> 140 (7)
Y <100 (8)
光原色判定部103bは、抽出した8点に対して、色相環の角度の分布を調べ、分布から大きく外れている点を排除する。そして、光原色判定部103bは、残った点の色相環の角度の平均に基づいて光源の色(Init_R,Init_G,Init_B)を判定する。
The light primary
ぼかし処理実行部103cは、まず、光原色判定部103bによって判定された光源の色、すなわち光源領域内の色情報に応じて、画像内の光源領域に付加するぼかしの形状を決定する。光源の色に応じたぼかしの形状はあらかじめ設定されており、例えば、光源の色が赤のときはぼかし形状は円形状、光源の色が青のときはぼかし形状はひし形、光源の色がオレンジのときはぼかし形状は六角形、光源の色がピンクであればぼかし形状はハートのように決定する。
First, the blurring
次に、ぼかし処理実行部103cは、あらかじめぼかし形状ごとに用意され、メモリに記録されているフィルタの中から、決定したぼかし形状に応じたフィルタを選択して読み込む。例えば、ぼかし処理実行部103cは、光源の色が青であって、ぼかし形状をひし形と決定した場合には、図7に示すような、光源領域をひし形にぼかすためのフィルタを選択する。なお、各形状のフィルタは、光源領域の大きさに応じて選択できるように、それぞれ複数サイズのフィルタが用意されている。
Next, the blurring
ぼかし処理実行部103cは、光原色に応じた形状の複数サイズのフィルタの中から、光源領域の大きさに合ったフィルタを選択して読み込んで、判定した光源の色を反映させたテンプレートを生成する。例えば、フィルタの各要素値に光源色をかけてテンプレートを作成する。図7に示す例において、光原色が(255,0,0)である場合には、フィルタ内の要素7aに対しては、要素値1に光源色(255,0,0)をかける。
The blurring
ぼかし処理実行部103cは、作成したテンプレートと、光源領域の画素値とをブレンドすることによって、画像内の光源領域にぼかし効果を付加する。なお、ブレンドは、光源領域の各画素の画素値をgo、テンプレートの各画素の画素値をgt、およびブレンド後の画素値をgbとした場合には、次式(9)により行うことができる。
gb=max(go,gt) ・・・(9)
The blurring
gb = max (go, gt) (9)
図8は、本実施の形態における画像処理装置100の処理を示すフローチャートである。図8に示す処理は、使用者によって光源領域へのぼかし効果の付加が指示されると起動するプログラムとして、制御装置103によって実行される。なお、処理対象の画像は、使用者によってあらかじめ選択されており、制御装置103は、選択された画像をメモリカードからメモリ内に読み込んであるものとする。
FIG. 8 is a flowchart showing processing of the
ステップS10において、光源領域特定部103aは、処理対象の画像に対して、上述した処理を実行して、画像内における光源を含む領域を光源領域として特定する。その後、ステップS20へ進み、光源色特定部103bは、光源領域特定部103aによって光源領域が特定されたか、すなわち画像内に光源領域が存在するか否かを判断する。否定判断した場合には、そのまま処理を終了する。これに対して、肯定判断した場合には、ステップS30へ進む。
In step S10, the light source
ステップS30では、光源色特定部103bは、上述したように、光源領域特定部103aによって特定された光源領域内の外側部分の色情報に基づいて、光源領域内に含まれる光源の色を判定する。その後、ステップS40へ進み、ぼかし処理実行部103cは、光原色判定部103bによって判定された光源の色に応じて、画像内の光源領域に付加するぼかしの形状を決定して、ステップS50へ進む。
In step S30, as described above, the light source
ステップS50では、ぼかし処理実行部103cは、決定したぼかし形状、および光源領域の大きさに応じたフィルタを選択して読み込む。その後、ステップS60へ進み、ぼかし処理実行部103cは、上述したように、読み込んだフィルタを用いて、光源の色を反映させたテンプレートを生成して、ステップS70へ進む。ステップS70では、ぼかし処理実行部103cは、作成したテンプレートと、光源領域の画素値とを、式(9)によってブレンドすることにより、画像内の光源領域にぼかし効果を付加する。その後、処理を終了する。
In step S50, the blurring
以上説明した本実施の形態によれば、以下のような作用効果を得ることができる。
(1)光源領域特定部103aは、画像内の光源を含む光源領域を特定し、ぼかし処理実行部103cは、あらかじめ用意された複数のフィルタの中から、光源領域にぼかし効果を付加するために用いるフィルタを選択し、選択したフィルタを用いて、光源領域にぼかし効果を付加するようにした。これによって、光源領域に対して自動的にぼかし効果を付加することができる。
According to the present embodiment described above, the following operational effects can be obtained.
(1) The light source
(2)ぼかし処理実行部103cは、光源領域内の色情報に基づいて、光源領域に付加するぼかしの形状を決定し、決定したぼかしの形状に応じたフィルタを選択するようにした。これによって、光源領域に対して、光源領域の色のイメージにマッチした形状のぼかしを付加することができる。
(2) The blurring
(3)ぼかし処理実行部103cは、光源領域の大きさに基づいて、光源領域に付加するぼかし効果の大きさを決定し、決定したぼかしの大きさに応じたフィルタを選択するようにした。これによって、光源領域に対して、光源領域の大きさに合った大きさのぼかしを付加することができる。
(4)光源領域特定部103aは、画像内から輝度値Yが所定の輝度値Y1以上の領域を第1の抽出領域として抽出し、画像内から輝度値YがY1よりも小さい所定の輝度値Y2以上の領域を第2の抽出領域として抽出し、第1の抽出領域および第2の抽出領域の特徴量に基づいて、画像内の光源を含む光源領域を特定するようにした。これによって、1つの輝度値を用いて光源を特定する場合と比較して、光源の特定精度を向上することができる。
(3) The blurring
(4) light source
(5)光源領域特定部103aは、第2の抽出領域の面積と第2の抽出領域内に含まれる第1の抽出領域の面積との比、および第2の抽出領域の重心と第2の抽出領域内に含まれる第1の抽出領域の重心との位置関係に基づいて、第2の抽出領域が光源領域であるか否かを特定するようにした。すなわち、第1の抽出領域および第2の抽出領域の特徴量として面積および重心を用いるようにした。これによって、画像内における光源領域を精度高く特定することができる。
(5) The light source
―変形例―
なお、上述した実施の形態の画像処理装置は、以下のように変形することもできる。
(1)上述した実施の形態では、ぼかし処理実行部103cは、光原色判定部103bによって判定された光源の色に応じて、画像内の光源領域に付加するぼかしの形状を決定する例について説明した。しかしながら、撮影時のレンズ情報や撮影日時を画像に関連付けて記録しておき、ぼかし処理実行部103cは、これらの情報に基づいて光源領域に付加するぼかし形状を決定するようにしてもよい。例えば、記録されているレンズ情報に基づいて使用されたレンズを特定し、レンズの絞りの形をぼかし形状とするようにしてもよい。また、撮影日時に基づいて季節を特定し、季節に合ったぼかし形状とするようにしてもよい。ここで、季節に合ったぼかし形状としては、例えば、春であれば花びらの形をぼかし形状としてもよい。これによって、光源領域に撮影時の状況を反映した形状のぼかしを付加することができる。
-Modification-
The image processing apparatus according to the above-described embodiment can be modified as follows.
(1) In the above-described embodiment, an example in which the blurring
あるいは、ぼかし処理実行部103cは、光源領域の大きさや明るさに基づいてぼかし形状を決定するようにしてもよい。例えば、光源領域の大きさや明るさに対して、いくつかの閾値を設けておき、それぞれの閾値との比較結果に基づいて、ぼかし形状を決定するようにしてもよい。また、ぼかし形状は、画像内で光源が存在する位置によって決定するようにしてもよい。例えば、画像内を16分割し、各領域にぼかし形状を割り当てておく。そして、光源領域がどの領域に存在するかによってぼかし形状を決定するようにしてもよい。これによって、光源領域に応じた最適なぼかし効果を付加することができる。なお、ぼかし処理実行部103cは、光源の色、撮影時のレンズ情報、撮影日時、光源領域の大きさ、光源領域明るさ、および画像内における光源領域の存在位置のそれぞれの要素を組み合わせて、ぼかし形状を決定するようにしてもよい。
Alternatively, the blurring
(2)上述した実施の形態では、ぼかし処理実行部103cは、テンプレート作成時に用いるフィルタの大きさは、光源領域の大きさに応じて選択する例について説明した。しかしながら、光源領域の色や光源領域の明るさに基づいてフィルタの大きさを決定するようにしてもよい。例えば、使用するフィルタの大きさを光源領域の色相に応じて決定するようにしてもよく、光源の輝度レベルに応じて決定するようにしてもよい。また、変形例(2)で上述したぼかし形状を決定する場合と同様に、画像内における光源領域の存在位置によって決定するようにしてもよい。これによって、光源領域に応じた最適なぼかし効果を付加することができる。
(2) In the above-described embodiment, the example in which the blurring
あるいは、ぼかし処理実行部103cは、フィルタの大きさを、画像内で特定された光源領域の数に応じて決定するようにしてもよい。画像内に多数の光源領域がある場合には、小さめフィルタを用いるようにし、光源領域が少ない場合には、大きめのフィルタを用いるようにしてもよい。画像内に多数の光源領域があるときに、大きいフィルタを用いた場合には、光源領域に付加するぼかしが重なりあう可能性が高くなるが、小さめのフィルタを用いることによって、このような重なりを回避することができる。なお、ぼかし処理実行部103cは、光源領域の大きさ、画像内における光源領域の数、光源領域の色、光源領域の明るさ、および画像内における光源領域の存在位置のそれぞれの要素を組み合わせて、使用するフィルタの大きさを決定するようにしてもよい。
Alternatively, the blurring
(3)上述した実施の形態では、ぼかし処理実行部103cは、使用するフィルタの形状や大きさを、光源領域に関する情報に基づいて自動的に決定してテンプレートを生成する例について説明した。すなわち、ぼかし処理実行部103cは、光源の色に応じてぼかし形状を決定し、光源領域の大きさに応じてフィルタを選択し、選択したフィルタと光源色とをブレンドして、光源の色を反映させたテンプレートを生成するようにした。しかしながら、これらの設定を使用者があらかじめ行うようにしてもよい。例えば、使用者は、画像内の全ての光源領域に対して、光源の色は青色と擬制し、フィルタ形状を六角形とするようにあらかじめ設定できるようにし、ぼかし処理実行部103cは、この設定に基づいてテンプレートを生成するようにしてもよい。これによって、使用者は、光源領域に好みの形状および大きさのフィルタを用いたぼかし効果を付加することができる。
(3) In the above-described embodiment, the example in which the blurring
(4)さらに、画像内で複数の光源領域が特定された場合には、その特定結果を使用者に提示し、使用者が、それぞれの光源領域を任意に入れ替えられるようにしてもよい。例えば、光源領域特定部103aは、特定した光源領域を枠で囲うなどして明示した画像をモニタ105に表示して使用者に提示する。そして、使用者からの光源領域の入れ替えを受け付ける。使用者は、入れ替えを行いたい2つの光源領域を操作部材101に含まれるマウスでそれぞれクリックすることにより入れ替え指示を行うことができる。光源領域特定部103aは、使用者によって、画像上のいずれか2つの光源領域がクリックされたことを検出した場合には、それぞれの光源領域を入れ替えて画像上に表示する。
(4) Furthermore, when a plurality of light source regions are specified in the image, the specification result may be presented to the user so that the user can arbitrarily replace each light source region. For example, the light source
なお、このとき、それぞれの光源領域の大きさが異なる場合には、入れ替え先の光源領域の大きさに合うように、光源領域を拡大または縮小して大きさを調整する必要がある。また、光源領域の色は、入れ替え前の光源領域の色を保持したまま入れ替えを行ってもよく、入れ替え先の光源領域の色に変更してから入れ替えを行うようにしてもよい。これによって、使用者は、任意に光源領域の位置を入れ替えることができる。 At this time, if the sizes of the respective light source regions are different, it is necessary to adjust the size by enlarging or reducing the light source region so as to match the size of the replacement light source region. Further, the color of the light source region may be replaced while retaining the color of the light source region before replacement, or may be replaced after changing to the color of the light source region of the replacement destination. Thereby, the user can arbitrarily change the position of the light source region.
なお、本発明の特徴的な機能を損なわない限り、本発明は、上述した実施の形態における構成に何ら限定されない。 Note that the present invention is not limited to the configurations in the above-described embodiments as long as the characteristic functions of the present invention are not impaired.
100 画像評価装置、101 操作部材、102 接続IF、103 制御装置、103a 光源領域特定部、103b 光源色判定部、103c ぼかし処理実行部、104 HDD、105 モニタ
DESCRIPTION OF
Claims (9)
あらかじめ用意された複数のフィルタの中から、前記光源領域にぼかし効果を付加するために用いるフィルタを前記コンピュータが選択するフィルタ選択手順と、
前記フィルタ選択手順で選択した前記フィルタを用いて、前記コンピュータが前記光源領域にぼかし効果を付加するぼかし効果付加手順とを前記コンピュータで実行するための画像処理プログラム。 A light source region specifying procedure in which a computer specifies a light source region including a light source in an image;
A filter selection procedure in which the computer selects a filter to be used for adding a blurring effect to the light source region from among a plurality of filters prepared in advance;
An image processing program for causing the computer to execute a blurring effect adding procedure in which the computer adds a blurring effect to the light source region using the filter selected in the filter selection procedure.
前記フィルタ選択手順では、前記コンピュータは、前記光源領域内の色情報、前記光源領域の大きさ、画像内における前記光源領域の位置、前記光源領域の明るさ、画像取得時のレンズ情報、および撮影日時情報の少なくともいずれか1つに基づいて、前記光源領域に付加するぼかしの形状を決定し、決定したぼかしの形状に応じた前記フィルタを選択することを特徴とする画像処理プログラム。 In the image processing program according to claim 1,
In the filter selection procedure, the computer performs color information in the light source region, a size of the light source region, a position of the light source region in an image, brightness of the light source region, lens information at the time of image acquisition, and photographing. An image processing program characterized by determining a blurring shape to be added to the light source region based on at least one of the date and time information, and selecting the filter according to the determined blurring shape.
前記フィルタ選択手順では、前記コンピュータは、前記光源領域内の色情報、前記光源領域の大きさ、画像内における前記光源領域の位置、前記光源領域の明るさ、および画像内に含まれる前記光源領域の数の少なくともいずれか1つに基づいて、前記光源領域に付加するぼかしの大きさを決定し、決定したぼかしの大きさに応じた前記フィルタを選択することを特徴とする画像処理プログラム。 The image processing program according to claim 1 or 2,
In the filter selection procedure, the computer performs color information in the light source region, the size of the light source region, the position of the light source region in the image, the brightness of the light source region, and the light source region included in the image. An image processing program characterized by determining a blur size to be added to the light source region based on at least one of the numbers and selecting the filter according to the determined blur size.
前記フィルタ選択手順では、前記コンピュータは、あらかじめ設定された形状、および大きさのぼかしを前記光源領域に付加するための前記フィルタを選択することを特徴とする画像処理プログラム。 In the image processing program according to claim 1,
In the filter selection procedure, the computer selects the filter for adding a blur having a preset shape and size to the light source region.
前記光源領域特定手順で画像内から複数の前記光源領域が特定された場合に、使用者からの指示に基づいて、前記コンピュータが第1の光源領域と第2の光源領域とを入れ替える光源領域入れ替え手順をさらに含むことを特徴とする画像処理プログラム。 In the image processing program according to any one of claims 1 to 4,
When the plurality of light source areas are specified from the image in the light source area specifying procedure, the computer replaces the first light source area and the second light source area based on an instruction from the user. An image processing program further comprising a procedure.
前記光源領域入れ替え手順では、前記コンピュータは、前記第1の光源領域の大きさと前記第2の光源領域の大きさとが異なる場合には、それぞれを入れ替え先の光源領域の大きさに合わせて拡大または縮小することを特徴とする画像処理プログラム。 The image processing program according to claim 5,
In the light source region replacement procedure, when the size of the first light source region is different from the size of the second light source region, the computer enlarges each according to the size of the replacement light source region. An image processing program characterized by reducing.
前記光源領域特定手順では、前記コンピュータは、画像内から輝度値が第1の閾値以上の領域を第1の領域として抽出し、画像内から輝度値が前記第1の閾値よりも小さい第2の閾値以上の領域を第2の領域として抽出し、前記第1の領域および前記第2の領域の特徴量に基づいて、前記光源領域を特定することを特徴とする画像処理プログラム。 In the image processing program according to any one of claims 1 to 6,
In the light source region specifying procedure, the computer extracts a region having a luminance value equal to or higher than a first threshold value from the image as a first region, and a second luminance value from the image is smaller than the first threshold value. An image processing program characterized in that an area equal to or greater than a threshold is extracted as a second area, and the light source area is specified based on feature amounts of the first area and the second area.
前記光源領域特定手順では、前記コンピュータは、前記第2の領域の面積と前記第2の領域内に含まれる前記第1の領域の面積との比、および前記第2の領域の重心と前記第2の領域内に含まれる前記第1の領域の重心との位置関係に基づいて、前記第2の領域が前記光源領域であるか否かを特定することを特徴とする画像処理プログラム。 The image processing program according to claim 7,
In the light source region specifying procedure, the computer has a ratio between an area of the second region and an area of the first region included in the second region, a center of gravity of the second region, and the first region. An image processing program that specifies whether or not the second area is the light source area based on a positional relationship with the center of gravity of the first area included in the second area.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007166341A JP2009003858A (en) | 2007-06-25 | 2007-06-25 | Image processing program and image processor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007166341A JP2009003858A (en) | 2007-06-25 | 2007-06-25 | Image processing program and image processor |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2009003858A true JP2009003858A (en) | 2009-01-08 |
Family
ID=40320150
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007166341A Pending JP2009003858A (en) | 2007-06-25 | 2007-06-25 | Image processing program and image processor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2009003858A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010263312A (en) * | 2009-04-30 | 2010-11-18 | Nikon Corp | Imaging device |
US20130021498A1 (en) * | 2011-07-23 | 2013-01-24 | Canon Kabushiki Kaisha | Image processing apparatus, image processing method, and program |
JP2013025650A (en) * | 2011-07-23 | 2013-02-04 | Canon Inc | Image processing apparatus, image processing method, and program |
JP2013025651A (en) * | 2011-07-23 | 2013-02-04 | Canon Inc | Image processing apparatus, image processing method, and program |
JP2016051982A (en) * | 2014-08-29 | 2016-04-11 | 株式会社ニコン | Image processing system, camera, and image processing program |
JP2016081466A (en) * | 2014-10-22 | 2016-05-16 | キヤノン株式会社 | Image processing device, and image processing method and program |
JP2022500792A (en) * | 2018-10-30 | 2022-01-04 | シェンチェン センスタイム テクノロジー カンパニー リミテッドShenzhen Sensetime Technology Co., Ltd | Image processing methods and devices, electronic devices and storage media |
-
2007
- 2007-06-25 JP JP2007166341A patent/JP2009003858A/en active Pending
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010263312A (en) * | 2009-04-30 | 2010-11-18 | Nikon Corp | Imaging device |
US20130021498A1 (en) * | 2011-07-23 | 2013-01-24 | Canon Kabushiki Kaisha | Image processing apparatus, image processing method, and program |
JP2013025650A (en) * | 2011-07-23 | 2013-02-04 | Canon Inc | Image processing apparatus, image processing method, and program |
JP2013026938A (en) * | 2011-07-23 | 2013-02-04 | Canon Inc | Image processing apparatus, image processing method, and program |
JP2013025651A (en) * | 2011-07-23 | 2013-02-04 | Canon Inc | Image processing apparatus, image processing method, and program |
US8885971B2 (en) | 2011-07-23 | 2014-11-11 | Canon Kabushiki Kaisha | Image processing apparatus, image processing method, and storage medium |
US9256928B2 (en) | 2011-07-23 | 2016-02-09 | Canon Kabushiki Kaisha | Image processing apparatus, image processing method, and storage medium capable of determining a region corresponding to local light from an image |
US9361669B2 (en) | 2011-07-23 | 2016-06-07 | Canon Kabushiki Kaisha | Image processing apparatus, image processing method, and program for performing a blurring process on an image |
JP2016051982A (en) * | 2014-08-29 | 2016-04-11 | 株式会社ニコン | Image processing system, camera, and image processing program |
JP2016081466A (en) * | 2014-10-22 | 2016-05-16 | キヤノン株式会社 | Image processing device, and image processing method and program |
JP2022500792A (en) * | 2018-10-30 | 2022-01-04 | シェンチェン センスタイム テクノロジー カンパニー リミテッドShenzhen Sensetime Technology Co., Ltd | Image processing methods and devices, electronic devices and storage media |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2009003858A (en) | Image processing program and image processor | |
WO2018032783A1 (en) | Image processing method and apparatus | |
JP5354842B2 (en) | Image processing method and image processing apparatus | |
US20070091334A1 (en) | Method of calculating correction data for correcting display characteristic, program for calculating correction data for correcting display characteristic and apparatus for calculating correction data for correcting display characteristic | |
JP2007531094A (en) | A method for extracting original data from images obtained from camera photographs | |
JP2006033656A (en) | User interface provider | |
JP2008527852A (en) | White balance correction of digital camera images | |
JP6946564B2 (en) | Image processing methods and image processing equipment, computer-readable storage media and computer equipment | |
TWI539820B (en) | Projection system and brightness adjusting method thereof | |
JP2013197918A5 (en) | ||
JP5246078B2 (en) | Object location program and camera | |
JP2004236110A (en) | Image processor, image processing method, storage medium and program | |
JP6794983B2 (en) | Information processing device, information processing method, program, and image display device | |
JP6766662B2 (en) | Image processing equipment, image projection equipment, and image processing methods | |
JP5818552B2 (en) | Image processing apparatus, image processing method, and program | |
JP2007096437A (en) | Determination of image creator's intention | |
JP2007053543A (en) | Image processor and image processing method | |
JP2010086379A (en) | Image processor, image processing method, and program | |
WO2019239462A1 (en) | Learning device, image generation device, learning method, image generation method, and program | |
JP2007065784A (en) | Image processor, image processing method, program, and computer-readable storage medium | |
JP4985117B2 (en) | Image processing program and image processing apparatus | |
JP2021175166A (en) | Projection system, projection method, and program | |
CN113923375B (en) | Method, device and equipment for supplementing light for shooting and storage medium | |
JP7074171B2 (en) | Image processing equipment, image projection equipment, and image processing methods | |
JP7391502B2 (en) | Image processing device, image processing method and program |