JP2009003858A - Image processing program and image processor - Google Patents

Image processing program and image processor Download PDF

Info

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
Application number
JP2007166341A
Other languages
Japanese (ja)
Inventor
Hiroki Uei
弘樹 上井
Tomohisa Hasumi
友久 蓮見
Junji Matsushita
順司 松下
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nikon Corp
Original Assignee
Nikon Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nikon Corp filed Critical Nikon Corp
Priority to JP2007166341A priority Critical patent/JP2009003858A/en
Publication of JP2009003858A publication Critical patent/JP2009003858A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To blur a light source area in an image. <P>SOLUTION: A light source area specifying part 103a specifies the light source area including a light source in the image. A blur performing part 103c selects a filter used for blurring the light source area from a plurality of filters prepared in advance, and blurs the light source area by using the selected filter. <P>COPYRIGHT: (C)2009,JPO&INPIT

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

特開2001−216513号公報JP 2001-216513 A

しかしながら、従来の画像変換装置では、画像内の明るい部分が暗い部分に侵食するようなぼかしを付加しているが、その明るい部分が必ずしも光源などのような光を発している点であるとは限らず、不自然な位置にぼかし効果が付加されてしまう可能性があった。   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 image processing apparatus 100 is, for example, a personal computer (PC), and includes an operation member 101, a connection IF (interface) 102, a control device 103, an HDD (hard disk drive) 104, and a monitor 105.

操作部材101は、使用者によって操作される種々の装置、例えばキーボードやマウスを含む。接続IF102は、デジタルカメラなどの外部機器を接続するためのインターフェースであって、例えばデジタルカメラと有線接続を行うためのUSBインターフェースや、無線接続を行うための無線LANモジュールなどが使用される。本実施の形態では、例えば、この接続IF102を介してデジタルカメラから画像データが取り込まれる。   The operation member 101 includes various devices operated by the user, such as a keyboard and a mouse. The connection IF 102 is an interface for connecting an external device such as a digital camera. For example, a USB interface for performing a wired connection with the digital camera, a wireless LAN module for performing a wireless connection, or the like is used. In the present embodiment, for example, image data is captured from a digital camera via the connection IF 102.

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 control device 103. The monitor 105 is a liquid crystal monitor, for example, and displays various display data output from the control device 103.

制御装置103は、CPU、メモリ、およびその他の周辺回路によって構成され、光源領域特定部103aと、光源色判定部103bと、ぼかし処理実行部103cとを機能的に備えている。本実施の形態では、光源領域特定部103aは、HDD104に記録されている画像を読み込んで、その画像内の光源を含む領域(光源領域)を特定する。光源色判定部103bは、光源領域特定部103aが特定した光源領域の色に基づいて光源の色を判定する。ぼかし処理実行部103bは、光原色判定部103bで判定した光源色に応じた色のぼかしを光源領域に付加する。なお、ここでは、HDD104には、RGB色空間で表される画像データが記録されているものとして説明を行う。   The control device 103 includes a CPU, a memory, and other peripheral circuits, and functionally includes a light source region specifying unit 103a, a light source color determination unit 103b, and a blurring process execution unit 103c. In the present embodiment, the light source area specifying unit 103a reads an image recorded in the HDD 104 and specifies an area (light source area) including a light source in the image. The light source color determination unit 103b determines the color of the light source based on the color of the light source region specified by the light source region specifying unit 103a. The blurring process execution unit 103b adds a blurring of a color corresponding to the light source color determined by the light primary color determination unit 103b to the light source region. In the following description, it is assumed that image data represented in the RGB color space is recorded in the HDD 104.

光源領域特定部103aは、画像内における光源を含む領域を光源領域として特定する。具体的には、光源領域特定部103aは、画像の輝度値Yを基準に光源領域の抽出を行う。このために、画像の画素値(R,G,B)(0≦R,G,B≦255)に基づいて、次式(1)で定義される輝度値Yを算出する。
Y=0.2990R+0.5870G+0.1140B ・・・(1)
The light source region specifying unit 103a specifies a region including a light source in the image as a light source region. Specifically, the light source region specifying unit 103a extracts the light source region based on the luminance value Y of the image. For this purpose, the luminance value Y defined by the following equation (1) is calculated based on the pixel values (R, G, B) (0 ≦ R, G, B ≦ 255) of the image.
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が所定の輝度値Y以上(例えば、Y=250)である画素で構成される領域を抽出する。ここで、画像内に輝度値Yが所定の輝度値Y以上である画素で構成される領域が複数ある場合には、複数の領域が抽出される。なお、ここで抽出した領域を、後に説明する領域と区別するために第1の抽出領域と呼ぶ。 Source region specifying unit 103a, the formula (1) luminance value Y calculated in the predetermined luminance value Y 1 or more (e.g., Y 1 = 250) extracts an area formed by the pixel is. Here, when the luminance value Y is more regions composed of pixels having a predetermined luminance value Y 1 or more in the image, a plurality of regions are extracted. Note that the region extracted here is referred to as a first extraction region in order to distinguish from the region described later.

光源領域特定部103aは、抽出した第1の抽出領域のそれぞれについて、その領域の面積、重心位置を算出する。重心位置は、例えば、画像全体をXY座標系で表した場合の座標値(x座標値およびy座標値)として算出する。さらに、光源領域特定部103aは、第1の抽出領域のそれぞれについて、その領域の外形と接する外形枠を特定し、第1の抽出領域と外形枠との接点の座標値(x座標値およびy座標値)を算出する。例えば、図2に示すように第1の抽出領域2aが抽出された場合には、光源領域特定部103aは、その外形枠2bを特定し、領域と接点の接点2c〜2fのそれぞれの座標値を算出する。   The light source region specifying unit 103a calculates the area and the barycentric position of each extracted first extraction region. The barycentric position is calculated, for example, as coordinate values (x coordinate value and y coordinate value) when the entire image is expressed in the XY coordinate system. Further, the light source region specifying unit 103a specifies, for each of the first extraction regions, an outer shape frame that is in contact with the outer shape of the region, and a coordinate value (x coordinate value and y of the contact point between the first extraction region and the outer shape frame). (Coordinate value) is calculated. For example, when the first extraction region 2a is extracted as shown in FIG. 2, the light source region specifying unit 103a specifies the outline frame 2b, and the coordinate values of the contact points 2c to 2f of the region and the contact point. Is calculated.

また、光源領域特定部103aは、図3に示すように、第1の抽出領域の重心3aから上下左右および斜め方向の8方向を対象として、領域の縁までの距離a(i=1〜8)を算出する。そして、光源領域特定部103aは、算出した領域の面積、重心位置の座標値、領域と外形枠との接点の座標値、および重心から領域の縁までの距離をメモリ内に保持しておく。 Further, as shown in FIG. 3, the light source region specifying unit 103a has distances a i (i = 1 to 1) from the center of gravity 3a of the first extraction region to the edge of the region in eight directions, up and down, left and right, and diagonal directions. 8) is calculated. Then, the light source region specifying unit 103a holds the calculated area of the region, the coordinate value of the center of gravity position, the coordinate value of the contact point between the region and the outer frame, and the distance from the center of gravity to the edge of the region in the memory.

次に、光源領域特定部103aは、式(1)で算出した輝度値Yが所定の輝度値Y以上(例えば、Y=240)である画素で構成される領域を抽出する。ここで、画像内に輝度値Yが所定の輝度値Y以上である画素で構成される領域が複数ある場合には、複数の領域が抽出される。なお、ここで抽出した領域を、上述した第1の抽出領域と区別するために第2の抽出領域と呼ぶ。 Next, the light source region specifying unit 103a extracts a region composed of pixels in which the luminance value Y calculated by Expression (1) is equal to or higher than a predetermined luminance value Y 2 (for example, Y 2 = 240). Here, when the luminance value Y is more regions composed of pixels having a predetermined luminance value Y 2 or more in the image, a plurality of regions are extracted. The region extracted here is referred to as a second extraction region in order to distinguish it from the first extraction region described above.

光源領域特定部103aは、抽出した第2の抽出領域のそれぞれについて、その領域の面積、重心位置の座標値(x座標値およびy座標値)を算出する。さらに、光源領域特定部103aは、図3で上述した第1の抽出領域の場合と同様に、第2の抽出領域の重心から上下左右および斜め方向の8方向を対象として、領域の縁までの距離b(i=1〜8)を算出する。そして、光源領域特定部103aは、算出した領域の面積、重心位置の座標値、および重心から領域の縁までの距離をメモリ内に保持しておく。 The light source region specifying unit 103a calculates the area value of the extracted second extraction region and the coordinate value (x coordinate value and y coordinate value) of the barycentric position. Further, the light source region specifying unit 103a extends from the center of gravity of the second extraction region to the edge of the region in the eight directions of up, down, left, right, and diagonal directions as in the case of the first extraction region described above with reference to FIG. The distance b i (i = 1 to 8) is calculated. The light source region specifying unit 103a holds the calculated area of the region, the coordinate value of the center of gravity position, and the distance from the center of gravity to the edge of the region in the memory.

このように、Y>Yとして第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 first extraction region 2 a is included in the second extraction region 4 a. In some cases, as shown in FIG. 4B, the second extraction region 4a includes a plurality of first extraction regions 2a. In the present embodiment, the light source region specifying unit 103a specifies the light source region in a case where one second extraction region 4a is included in the second extraction region 4a and a case where a plurality of first extraction regions 2a are included. .

なお、上述したように、画像内から複数の第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 second extraction regions 4a is used as a light source. An example of determining whether to specify a region will be described. That is, when there are a plurality of second extraction areas 4a, if the processing described below is performed for each second extraction area, each second extraction area 4a is a light source area. It is possible to determine whether or not.

(A)第2の抽出領域4a内に第1の抽出領域2aを1つ含む場合
この場合には、第2の抽出領域は、光源領域としての独立性が高いと判断できることから、領域の形状がいびつでなければその領域を光源領域をみなすようにする。このため、光源領域特定部103aは、上述した重心から領域の縁までの8方向の距離bを用いて、次式(2)および(3)によって、第2の抽出領域を光源領域として特定するか否かを判定する。なお、次式(2)および(3)において、maxbは、b〜bの中の最大値を表し、minbは、b〜bの中の最小値を表す。
maxb/minb≦3.0 → 光源領域として特定する ・・・(2)
maxb/minb>3.0 → 光源領域として特定しない ・・・(3)
(A) When one first extraction region 2a is included in the second extraction region 4a In this case, since the second extraction region can be determined to be highly independent as a light source region, the shape of the region If it is not distorted, the area is regarded as the light source area. For this reason, the light source region specifying unit 103a specifies the second extraction region as the light source region by the following equations (2) and (3) using the above-described eight-direction distance b i from the center of gravity to the edge of the region. It is determined whether or not to do. In the following expressions (2) and (3), maxb i represents the maximum value among b 1 to b 8 , and minb i represents the minimum value among b 1 to b 8 .
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 area specifying unit 103a specifies the barycentric position of the first light source area included therein as the light source position.

(B)第2の抽出領域4a内に第1の抽出領域2aを複数含む場合
この場合には、抽出した第2の抽出領域4aをBと表し、第2の抽出領域4a内に含まれる1つまたは複数(n個)の第1の抽出領域2aをA(i=1,2,・・・n)と表す。そして、Bの重心をg、A(i=1,2,・・・n)の重心をそれぞれg(i=1,2,・・・n)と表す。
(B) In the case where a plurality of first extraction regions 2a are included in the second extraction region 4a In this case, the extracted second extraction region 4a is represented by B, and is included in the second extraction region 4a. One or a plurality (n) of first extraction regions 2a are represented as A i (i = 1, 2,... N). The center of gravity of B is expressed as g B , and the center of gravity of A i (i = 1, 2,... N) is expressed as g i (i = 1, 2,... N), respectively.

ここで、第2の抽出領域4a(B)内に第1の抽出領域2a(A)が複数含まれることとなった原因について考える。上述したように、領域を抽出する際に用いる輝度値Yの基準値(閾値)をY(例えば250)からY(例えば240)に少しだけ低下させたことにより、このような現象が発生していることから、考えられる理由は次の2つである。原因1:そもそも大きな領域Bは光源領域ではなく、個々のAはその一部に過ぎない。
原因2:大きな領域Bが光源領域ではあるものの、基準値Yの選び方により、領域B内に複数のAが現れただけである。
Here, consider the reason why a plurality of first extraction regions 2a (A i ) are included in the second extraction region 4a (B). As described above, this phenomenon occurs when the reference value (threshold value) of the luminance value Y used when extracting the region is slightly reduced from Y 1 (for example, 250) to Y 2 (for example, 240). Because of this, there are two possible reasons. Cause 1: In the first place, the large area B is not a light source area, and each A i is only a part thereof.
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のいずれの場合でも、大半のAは光源領域ではないと判断してよく、仮に原因2のようにBが光源領域である場合には、後述するクロスの描画時に、Bの重心g、あるいはgにある程度近いAの重心g(i=1,2,・・・n)からクロスを発生させれば十分である。この点を踏まえ、光源領域特定部103aは、以下のような処理を行って、第2の抽出領域4a、すなわちBが光源領域であるか否かを判定する。 In both cases of cause 1 and cause 2, it may be determined that most of A i is not the light source region, and if B is the light source region as in cause 2, when drawing a cross, which will be described later, It is sufficient to generate a cross from the centroid g B of B or the centroid g i (i = 1, 2,..., N) of A i close to g B to some extent. In consideration of this point, the light source region specifying unit 103a performs the following process to determine whether or not the second extraction region 4a, that is, B is a light source region.

まず、光源領域特定部103aは、B内に含まれる複数のAの重心g(i=1,2,・・・n)のうち、Bの重心gから最も近い位置に存在するものを重心Gとして抽出する。なお、本実施の形態では、Bが光源領域であると判定した場合に、この重心Gを光源位置として特定し、重心Gからのみクロスを発生させるようにし、他の重心gからはクロスを発生させないこととする。 First, the light source region specifying unit 103a is present at a position closest to the centroid g B of the B among the centroids g i (i = 1, 2,..., N) of the plurality of A i included in the B. Is extracted as the center of gravity G. In this embodiment, when B is determined to be a light source area, to identify the center of gravity G as a light source position, so as to generate only the cross from the center of gravity G, the cross from another center of gravity g i It shall not be generated.

ここで、Bが光源領域である場合には、Bの重心gの位置と、抽出した重心Gの位置とは、図5(a)に示すように大きく異ならないはずであるが、Bが光源領域ではない場合には、両者の間の位置は、図5(b)に示すように大きく異なることになる。よって、本実施の形態では、このことを加味してBが光源領域として適当であるか否かを判定する。具体的には、光源領域特定部103aは、Gとgとの間の距離が許容範囲より大きいときは、Bを光源領域としては不適当であると判定する。これに対して、Gとgとの間の距離が許容範囲を以下である場合には、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 region specifying unit 103a determines that B is inappropriate as the light source region when the distance between G and g B is larger than the allowable range. On the other hand, if the distance between G and g B is within the allowable range, it is determined that B is appropriate as the light source region.

光源領域特定部103aは、Bが光源領域として適当であるか否かを、例えば、次式(4)により判定する。すなわち、光源領域特定部103aは、Gとgとの間の距離が次式(4)に示す条件を満たす場合には、Bは光源領域として不適当であると判定し、満たさない場合には適当であると判定する。
Gとgとの間の距離>2×mina ・・・(4)
For example, the light source region specifying unit 103a determines whether or not B is appropriate as the light source region by the following equation (4). That is, the light source region specifying unit 103a determines that B is inappropriate as the light source region when the distance between G and g B satisfies the condition shown in the following expression (4), and when the distance is not satisfied Is determined to be appropriate.
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を光源領域として特定する。
maxb/minb>3.0 ・・・(5)
領域Bの面積/Gを含む領域Aの面積>1.0+(Y/Y) ・・・(6)
If the light source region specifying unit 103a determines that B is appropriate as the light source region as a result of the determination using the equation (4), the light source region specifying unit 103a further uses the following equations (5) and (6) as a light source. It is determined whether or not the area is specified. That is, the light source area specifying unit 103a determines that B is inappropriate as the light source area when either one of the following expressions (5) and (6) is satisfied, and B is used as the light source area. Do not specify. On the other hand, if neither of the conditions shown in the following equations (5) and (6) is satisfied, the light source region specifying unit 103a determines that B is appropriate as the light source region and specifies B as the light source region.
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内に含まれる複数のAの重心g(i=1,2,・・・n)のうち、Bの重心gから最も近い位置に存在する重心Gを光源位置として特定する。以上の処理によって、光源領域特定部103aは、画像内の光源領域、および光源位置を精度高く特定することができる。 When the light source area specifying unit 103a specifies B as the light source area, the center of gravity g of B out of the centers of gravity g i (i = 1, 2,..., N) of A i included in B is included. The center of gravity G present at the position closest to B is specified as the light source position. Through the above processing, the light source region specifying unit 103a can specify the light source region and the light source position in the image with high accuracy.

光源色特定部103bは、上述した光源領域特定部103aによる処理で特定された光源領域内の色情報に基づいて、光源領域内に含まれる光源の色を判定する。画像内における光源の中心部においては、その色は光源の色に関わらず白色となるため、その位置におけるR、G、Bの値はいずれも255に近くなり、光源の色を判定するための情報として用いるには不適当である。本実施の形態では、特定した光源領域内の外側部分、すなわち重心から所定距離離れた点の色情報に基づいて、光源の色を判定するようにする。例えば、光原色判定部103bは、図6に示す光源領域6aにおいて、中心部分の領域6bではなく、その外側の領域6c内の点の色情報を用いて光源色を判定する。   The light source color specifying unit 103b determines the color of the light source included in the light source region based on the color information in the light source region specified by the processing by the light source region specifying unit 103a described above. At the center of the light source in the image, the color is white regardless of the color of the light source, so the values of R, G, B at that position are all close to 255, and the color of the light source is determined. It is unsuitable for use as information. In the present embodiment, the color of the light source is determined based on the color information of the outer portion in the identified light source region, that is, a point that is a predetermined distance away from the center of gravity. For example, in the light source region 6a shown in FIG. 6, the light primary color determination unit 103b determines the light source color by using the color information of the points in the region 6c outside the central region 6b.

具体的には、光原色判定部103bは、次のように処理を行う。まず、光原色判定部103bは、外側の領域6c内の点の色情報を得るために、光源領域の重心、すなわち上述した第2の抽出領域の重心gから上下左右および斜め方向の8方向を対象として、次式(7)または(8)のいずれかを満たす点を走査し、条件を満たす点を各方向から1点ずつ、すなわち8点抽出する。
max(R,G,B)−min(R,G,B)>140 ・・・(7)
Y<100 ・・・(8)
Specifically, the light primary color determination unit 103b performs processing as follows. First, light primary color determination unit 103b, in order to obtain color information of a point in the outer regions 6c, the center of gravity of light source areas, that is, the second vertical and horizontal and 8 directions of the oblique direction from the center of gravity g B of the extraction area above Are scanned for points satisfying either of the following formulas (7) or (8), and the points satisfying the condition are extracted one by one from each direction, that is, eight points.
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 color determination unit 103b examines the distribution of the angle of the hue circle with respect to the extracted eight points, and excludes points that are greatly deviated from the distribution. Then, the light primary color determination unit 103b determines the color of the light source (Init_R, Init_G, Init_B) based on the average of the hue ring angles of the remaining points.

ぼかし処理実行部103cは、まず、光原色判定部103bによって判定された光源の色、すなわち光源領域内の色情報に応じて、画像内の光源領域に付加するぼかしの形状を決定する。光源の色に応じたぼかしの形状はあらかじめ設定されており、例えば、光源の色が赤のときはぼかし形状は円形状、光源の色が青のときはぼかし形状はひし形、光源の色がオレンジのときはぼかし形状は六角形、光源の色がピンクであればぼかし形状はハートのように決定する。   First, the blurring processing execution unit 103c determines the shape of blurring to be added to the light source region in the image according to the color of the light source determined by the light primary color determination unit 103b, that is, the color information in the light source region. For example, when the light source color is red, the blur shape is circular, when the light source color is blue, the blur shape is diamond, and the light source color is orange. In this case, the blur shape is determined as a hexagon, and if the light source is pink, the blur shape is determined as a heart.

次に、ぼかし処理実行部103cは、あらかじめぼかし形状ごとに用意され、メモリに記録されているフィルタの中から、決定したぼかし形状に応じたフィルタを選択して読み込む。例えば、ぼかし処理実行部103cは、光源の色が青であって、ぼかし形状をひし形と決定した場合には、図7に示すような、光源領域をひし形にぼかすためのフィルタを選択する。なお、各形状のフィルタは、光源領域の大きさに応じて選択できるように、それぞれ複数サイズのフィルタが用意されている。   Next, the blurring processing execution unit 103c selects and reads a filter corresponding to the determined blurring shape from filters prepared in advance for each blurring shape and recorded in the memory. For example, when the color of the light source is blue and the blurring shape is determined to be a rhombus, the blurring processing execution unit 103c selects a filter for blurring the light source region into a rhombus as illustrated in FIG. A plurality of sizes of filters are prepared so that the filters of each shape can be selected according to the size of the light source region.

ぼかし処理実行部103cは、光原色に応じた形状の複数サイズのフィルタの中から、光源領域の大きさに合ったフィルタを選択して読み込んで、判定した光源の色を反映させたテンプレートを生成する。例えば、フィルタの各要素値に光源色をかけてテンプレートを作成する。図7に示す例において、光原色が(255,0,0)である場合には、フィルタ内の要素7aに対しては、要素値1に光源色(255,0,0)をかける。   The blurring process execution unit 103c selects and reads a filter that matches the size of the light source region from among a plurality of sizes of filters according to the light primary color, and generates a template that reflects the determined light source color. To do. For example, a template is created by applying a light source color to each element value of the filter. In the example shown in FIG. 7, when the light primary color is (255, 0, 0), the light source color (255, 0, 0) is applied to the element value 1 for the element 7a in the filter.

ぼかし処理実行部103cは、作成したテンプレートと、光源領域の画素値とをブレンドすることによって、画像内の光源領域にぼかし効果を付加する。なお、ブレンドは、光源領域の各画素の画素値をgo、テンプレートの各画素の画素値をgt、およびブレンド後の画素値をgbとした場合には、次式(9)により行うことができる。
gb=max(go,gt) ・・・(9)
The blurring processing execution unit 103c adds a blurring effect to the light source region in the image by blending the created template with the pixel values of the light source region. The blending can be performed by the following equation (9) when the pixel value of each pixel in the light source region is go, the pixel value of each pixel of the template is gt, and the pixel value after blending is gb. .
gb = max (go, gt) (9)

図8は、本実施の形態における画像処理装置100の処理を示すフローチャートである。図8に示す処理は、使用者によって光源領域へのぼかし効果の付加が指示されると起動するプログラムとして、制御装置103によって実行される。なお、処理対象の画像は、使用者によってあらかじめ選択されており、制御装置103は、選択された画像をメモリカードからメモリ内に読み込んであるものとする。   FIG. 8 is a flowchart showing processing of the image processing apparatus 100 according to the present embodiment. The processing shown in FIG. 8 is executed by the control device 103 as a program that starts when the user instructs the user to add a blurring effect to the light source region. Note that the processing target image is selected in advance by the user, and the control apparatus 103 reads the selected image from the memory card into the memory.

ステップS10において、光源領域特定部103aは、処理対象の画像に対して、上述した処理を実行して、画像内における光源を含む領域を光源領域として特定する。その後、ステップS20へ進み、光源色特定部103bは、光源領域特定部103aによって光源領域が特定されたか、すなわち画像内に光源領域が存在するか否かを判断する。否定判断した場合には、そのまま処理を終了する。これに対して、肯定判断した場合には、ステップS30へ進む。   In step S10, the light source region specifying unit 103a performs the above-described processing on the processing target image, and specifies a region including the light source in the image as the light source region. Thereafter, the process proceeds to step S20, and the light source color specifying unit 103b determines whether the light source region is specified by the light source region specifying unit 103a, that is, whether or not the light source region exists in the image. If a negative determination is made, the process is terminated as it is. On the other hand, if a positive determination is made, the process proceeds to step S30.

ステップS30では、光源色特定部103bは、上述したように、光源領域特定部103aによって特定された光源領域内の外側部分の色情報に基づいて、光源領域内に含まれる光源の色を判定する。その後、ステップS40へ進み、ぼかし処理実行部103cは、光原色判定部103bによって判定された光源の色に応じて、画像内の光源領域に付加するぼかしの形状を決定して、ステップS50へ進む。   In step S30, as described above, the light source color specifying unit 103b determines the color of the light source included in the light source region based on the color information of the outer portion in the light source region specified by the light source region specifying unit 103a. . Thereafter, the process proceeds to step S40, and the blurring process execution unit 103c determines the blurring shape to be added to the light source region in the image according to the color of the light source determined by the light primary color determination unit 103b, and then proceeds to step S50. .

ステップS50では、ぼかし処理実行部103cは、決定したぼかし形状、および光源領域の大きさに応じたフィルタを選択して読み込む。その後、ステップS60へ進み、ぼかし処理実行部103cは、上述したように、読み込んだフィルタを用いて、光源の色を反映させたテンプレートを生成して、ステップS70へ進む。ステップS70では、ぼかし処理実行部103cは、作成したテンプレートと、光源領域の画素値とを、式(9)によってブレンドすることにより、画像内の光源領域にぼかし効果を付加する。その後、処理を終了する。   In step S50, the blurring process execution unit 103c selects and reads a filter corresponding to the determined blurring shape and the size of the light source region. Thereafter, the process proceeds to step S60, and the blurring process execution unit 103c generates a template reflecting the color of the light source using the read filter as described above, and then proceeds to step S70. In step S70, the blurring process execution unit 103c adds a blurring effect to the light source region in the image by blending the created template and the pixel value of the light source region according to Expression (9). Thereafter, the process ends.

以上説明した本実施の形態によれば、以下のような作用効果を得ることができる。
(1)光源領域特定部103aは、画像内の光源を含む光源領域を特定し、ぼかし処理実行部103cは、あらかじめ用意された複数のフィルタの中から、光源領域にぼかし効果を付加するために用いるフィルタを選択し、選択したフィルタを用いて、光源領域にぼかし効果を付加するようにした。これによって、光源領域に対して自動的にぼかし効果を付加することができる。
According to the present embodiment described above, the following operational effects can be obtained.
(1) The light source region specifying unit 103a specifies a light source region including a light source in the image, and the blurring processing execution unit 103c is for adding a blurring effect to the light source region from among a plurality of filters prepared in advance. A filter to be used was selected, and a blurring effect was added to the light source region using the selected filter. As a result, a blurring effect can be automatically added to the light source region.

(2)ぼかし処理実行部103cは、光源領域内の色情報に基づいて、光源領域に付加するぼかしの形状を決定し、決定したぼかしの形状に応じたフィルタを選択するようにした。これによって、光源領域に対して、光源領域の色のイメージにマッチした形状のぼかしを付加することができる。 (2) The blurring processing execution unit 103c determines a blurring shape to be added to the light source region based on the color information in the light source region, and selects a filter according to the determined blurring shape. Accordingly, it is possible to add a blur of a shape that matches the color image of the light source region to the light source region.

(3)ぼかし処理実行部103cは、光源領域の大きさに基づいて、光源領域に付加するぼかし効果の大きさを決定し、決定したぼかしの大きさに応じたフィルタを選択するようにした。これによって、光源領域に対して、光源領域の大きさに合った大きさのぼかしを付加することができる。
(4)光源領域特定部103aは、画像内から輝度値Yが所定の輝度値Y以上の領域を第1の抽出領域として抽出し、画像内から輝度値YがYよりも小さい所定の輝度値Y以上の領域を第2の抽出領域として抽出し、第1の抽出領域および第2の抽出領域の特徴量に基づいて、画像内の光源を含む光源領域を特定するようにした。これによって、1つの輝度値を用いて光源を特定する場合と比較して、光源の特定精度を向上することができる。
(3) The blurring processing execution unit 103c determines the size of the blurring effect to be added to the light source region based on the size of the light source region, and selects a filter corresponding to the determined blurring size. Accordingly, it is possible to add a blur of a size suitable for the size of the light source region to the light source region.
(4) light source region identifying unit 103a, the luminance value Y from the image extracts a predetermined luminance value Y 1 or more regions as a first extraction region, from the image luminance value Y is smaller predetermined than Y 1 extracting the luminance value Y 2 or more regions as a second extraction region based on the feature amount of the first extraction region and a second extraction region, and to identify the source region including a light source in an image. As a result, the light source identification accuracy can be improved as compared with the case where the light source is identified using one luminance value.

(5)光源領域特定部103aは、第2の抽出領域の面積と第2の抽出領域内に含まれる第1の抽出領域の面積との比、および第2の抽出領域の重心と第2の抽出領域内に含まれる第1の抽出領域の重心との位置関係に基づいて、第2の抽出領域が光源領域であるか否かを特定するようにした。すなわち、第1の抽出領域および第2の抽出領域の特徴量として面積および重心を用いるようにした。これによって、画像内における光源領域を精度高く特定することができる。 (5) The light source region specifying unit 103a includes the ratio between the area of the second extraction region and the area of the first extraction region included in the second extraction region, the center of gravity of the second extraction region, and the second Whether or not the second extraction region is a light source region is specified based on a positional relationship with the center of gravity of the first extraction region included in the extraction region. That is, the area and the center of gravity are used as the feature amounts of the first extraction region and the second extraction region. Thereby, the light source region in the image can be specified with high accuracy.

―変形例―
なお、上述した実施の形態の画像処理装置は、以下のように変形することもできる。
(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 processing execution unit 103c determines the shape of blurring to be added to the light source region in the image according to the color of the light source determined by the light primary color determination unit 103b. did. However, the lens information at the time of shooting and the shooting date and time may be recorded in association with the image, and the blurring processing execution unit 103c may determine the blurring shape to be added to the light source region based on these information. For example, the lens used may be specified based on the recorded lens information, and the shape of the aperture of the lens may be a blurred shape. Alternatively, the season may be specified based on the shooting date and time, and the blur shape may be adapted to the season. Here, as a blurred shape suitable for the season, for example, in the case of spring, the shape of a petal may be a blurred shape. As a result, it is possible to add blurring of the shape reflecting the situation at the time of shooting to the light source region.

あるいは、ぼかし処理実行部103cは、光源領域の大きさや明るさに基づいてぼかし形状を決定するようにしてもよい。例えば、光源領域の大きさや明るさに対して、いくつかの閾値を設けておき、それぞれの閾値との比較結果に基づいて、ぼかし形状を決定するようにしてもよい。また、ぼかし形状は、画像内で光源が存在する位置によって決定するようにしてもよい。例えば、画像内を16分割し、各領域にぼかし形状を割り当てておく。そして、光源領域がどの領域に存在するかによってぼかし形状を決定するようにしてもよい。これによって、光源領域に応じた最適なぼかし効果を付加することができる。なお、ぼかし処理実行部103cは、光源の色、撮影時のレンズ情報、撮影日時、光源領域の大きさ、光源領域明るさ、および画像内における光源領域の存在位置のそれぞれの要素を組み合わせて、ぼかし形状を決定するようにしてもよい。   Alternatively, the blurring processing execution unit 103c may determine the blurring shape based on the size and brightness of the light source region. For example, some threshold values may be provided for the size and brightness of the light source region, and the blurring shape may be determined based on a comparison result with each threshold value. The blur shape may be determined depending on the position where the light source exists in the image. For example, the image is divided into 16 and a blur shape is assigned to each area. Then, the blurring shape may be determined depending on in which region the light source region exists. As a result, an optimum blur effect corresponding to the light source region can be added. Note that the blurring process execution unit 103c combines the elements of the light source color, lens information at the time of shooting, the shooting date and time, the size of the light source region, the light source region brightness, and the location of the light source region in the image, The blur shape may be determined.

(2)上述した実施の形態では、ぼかし処理実行部103cは、テンプレート作成時に用いるフィルタの大きさは、光源領域の大きさに応じて選択する例について説明した。しかしながら、光源領域の色や光源領域の明るさに基づいてフィルタの大きさを決定するようにしてもよい。例えば、使用するフィルタの大きさを光源領域の色相に応じて決定するようにしてもよく、光源の輝度レベルに応じて決定するようにしてもよい。また、変形例(2)で上述したぼかし形状を決定する場合と同様に、画像内における光源領域の存在位置によって決定するようにしてもよい。これによって、光源領域に応じた最適なぼかし効果を付加することができる。 (2) In the above-described embodiment, the example in which the blurring process execution unit 103c selects the size of the filter used when creating the template according to the size of the light source region has been described. However, the size of the filter may be determined based on the color of the light source region and the brightness of the light source region. For example, the size of the filter to be used may be determined according to the hue of the light source region, or may be determined according to the luminance level of the light source. Further, as in the case of determining the blur shape described in the modification (2), it may be determined based on the position of the light source region in the image. As a result, an optimum blur effect corresponding to the light source region can be added.

あるいは、ぼかし処理実行部103cは、フィルタの大きさを、画像内で特定された光源領域の数に応じて決定するようにしてもよい。画像内に多数の光源領域がある場合には、小さめフィルタを用いるようにし、光源領域が少ない場合には、大きめのフィルタを用いるようにしてもよい。画像内に多数の光源領域があるときに、大きいフィルタを用いた場合には、光源領域に付加するぼかしが重なりあう可能性が高くなるが、小さめのフィルタを用いることによって、このような重なりを回避することができる。なお、ぼかし処理実行部103cは、光源領域の大きさ、画像内における光源領域の数、光源領域の色、光源領域の明るさ、および画像内における光源領域の存在位置のそれぞれの要素を組み合わせて、使用するフィルタの大きさを決定するようにしてもよい。   Alternatively, the blurring process execution unit 103c may determine the size of the filter according to the number of light source regions specified in the image. If there are a large number of light source regions in the image, a smaller filter may be used, and if there are fewer light source regions, a larger filter may be used. When a large filter is used when there are many light source areas in the image, there is a high possibility that the blur to be added to the light source area will be overlapped. It can be avoided. The blurring process execution unit 103c combines the elements of the size of the light source region, the number of light source regions in the image, the color of the light source region, the brightness of the light source region, and the location of the light source region in the image. The size of the filter to be used may be determined.

(3)上述した実施の形態では、ぼかし処理実行部103cは、使用するフィルタの形状や大きさを、光源領域に関する情報に基づいて自動的に決定してテンプレートを生成する例について説明した。すなわち、ぼかし処理実行部103cは、光源の色に応じてぼかし形状を決定し、光源領域の大きさに応じてフィルタを選択し、選択したフィルタと光源色とをブレンドして、光源の色を反映させたテンプレートを生成するようにした。しかしながら、これらの設定を使用者があらかじめ行うようにしてもよい。例えば、使用者は、画像内の全ての光源領域に対して、光源の色は青色と擬制し、フィルタ形状を六角形とするようにあらかじめ設定できるようにし、ぼかし処理実行部103cは、この設定に基づいてテンプレートを生成するようにしてもよい。これによって、使用者は、光源領域に好みの形状および大きさのフィルタを用いたぼかし効果を付加することができる。 (3) In the above-described embodiment, the example in which the blurring process execution unit 103c automatically determines the shape and size of the filter to be used based on the information on the light source region and generates the template has been described. That is, the blurring process execution unit 103c determines a blurring shape according to the color of the light source, selects a filter according to the size of the light source region, blends the selected filter and the light source color, and sets the color of the light source. The reflected template was generated. However, the user may make these settings in advance. For example, the user can preliminarily set the color of the light source as blue for all the light source regions in the image and set the filter shape to be a hexagon, and the blurring process execution unit 103c sets this setting. A template may be generated based on the above. Accordingly, the user can add a blurring effect using a filter having a desired shape and size to the light source region.

(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 area specifying unit 103a displays an image clearly shown by surrounding the specified light source area with a frame on the monitor 105 and presents it to the user. Then, the replacement of the light source region from the user is accepted. The user can instruct replacement by clicking each of the two light source regions to be replaced with the mouse included in the operation member 101. When the user detects that any two light source areas on the image are clicked by the user, the light source area specifying unit 103a replaces the respective light source areas and displays them on the image.

なお、このとき、それぞれの光源領域の大きさが異なる場合には、入れ替え先の光源領域の大きさに合うように、光源領域を拡大または縮小して大きさを調整する必要がある。また、光源領域の色は、入れ替え前の光源領域の色を保持したまま入れ替えを行ってもよく、入れ替え先の光源領域の色に変更してから入れ替えを行うようにしてもよい。これによって、使用者は、任意に光源領域の位置を入れ替えることができる。   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.

画像処理装置の一実施の形態の構成を示すブロック図である。It is a block diagram which shows the structure of one Embodiment of an image processing apparatus. 第1の抽出領域と外形枠との接点の具体例を示す図である。It is a figure which shows the specific example of the contact of a 1st extraction area | region and an external shape frame. 第1の抽出領域の重心から領域の縁までの8方向の距離の具体例を示す図である。It is a figure which shows the specific example of the distance of 8 directions from the gravity center of a 1st extraction area | region to the edge of an area | region. 第2の抽出領域内に含まれる第1の抽出領域の具体例を示す図である。It is a figure which shows the specific example of the 1st extraction area | region contained in a 2nd extraction area | region. 第2の抽出領域が光源領域である場合とそうでない場合の具体例を示す図である。It is a figure which shows the specific example in the case where the 2nd extraction area | region is a light source area, and the case where it is not so. 光源の中心部分の領域と外側の部分の領域の具体例を示す図である。It is a figure which shows the specific example of the area | region of the center part of a light source, and the area | region of an outer part. ひし形のフィルタの具体例を示す図である。It is a figure which shows the specific example of a rhombus filter. 画像処理装置100の処理を示すフローチャート図である。3 is a flowchart showing processing of the image processing apparatus 100. FIG.

符号の説明Explanation of symbols

100 画像評価装置、101 操作部材、102 接続IF、103 制御装置、103a 光源領域特定部、103b 光源色判定部、103c ぼかし処理実行部、104 HDD、105 モニタ DESCRIPTION OF SYMBOLS 100 Image evaluation apparatus, 101 Operation member, 102 Connection IF, 103 Control apparatus, 103a Light source area specific | specification part, 103b Light source color determination part, 103c Blur process execution part, 104 HDD, 105 monitor

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に記載の画像処理プログラムにおいて、
前記フィルタ選択手順では、前記コンピュータは、前記光源領域内の色情報、前記光源領域の大きさ、画像内における前記光源領域の位置、前記光源領域の明るさ、画像取得時のレンズ情報、および撮影日時情報の少なくともいずれか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または2に記載の画像処理プログラムにおいて、
前記フィルタ選択手順では、前記コンピュータは、前記光源領域内の色情報、前記光源領域の大きさ、画像内における前記光源領域の位置、前記光源領域の明るさ、および画像内に含まれる前記光源領域の数の少なくともいずれか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.
請求項1に記載の画像処理プログラムにおいて、
前記フィルタ選択手順では、前記コンピュータは、あらかじめ設定された形状、および大きさのぼかしを前記光源領域に付加するための前記フィルタを選択することを特徴とする画像処理プログラム。
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〜4のいずれか一項に記載の画像処理プログラムにおいて、
前記光源領域特定手順で画像内から複数の前記光源領域が特定された場合に、使用者からの指示に基づいて、前記コンピュータが第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.
請求項5に記載の画像処理プログラムにおいて、
前記光源領域入れ替え手順では、前記コンピュータは、前記第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〜6のいずれか一項に記載の画像処理プログラムにおいて、
前記光源領域特定手順では、前記コンピュータは、画像内から輝度値が第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.
請求項7に記載の画像処理プログラムにおいて、
前記光源領域特定手順では、前記コンピュータは、前記第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.
請求項1〜8のいずれか一項に記載の画像処理プログラムを実行するための実行手段を備えることを特徴とする画像処理装置。   An image processing apparatus comprising an execution unit for executing the image processing program according to claim 1.
JP2007166341A 2007-06-25 2007-06-25 Image processing program and image processor Pending JP2009003858A (en)

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)

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

Cited By (11)

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