JP2021164063A - Image processing apparatus, image processing method, and program - Google Patents

Image processing apparatus, image processing method, and program Download PDF

Info

Publication number
JP2021164063A
JP2021164063A JP2020063880A JP2020063880A JP2021164063A JP 2021164063 A JP2021164063 A JP 2021164063A JP 2020063880 A JP2020063880 A JP 2020063880A JP 2020063880 A JP2020063880 A JP 2020063880A JP 2021164063 A JP2021164063 A JP 2021164063A
Authority
JP
Japan
Prior art keywords
map
subject
image
degree
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.)
Granted
Application number
JP2020063880A
Other languages
Japanese (ja)
Other versions
JP7451264B2 (en
Inventor
正明 松岡
Masaaki Matsuoka
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2020063880A priority Critical patent/JP7451264B2/en
Publication of JP2021164063A publication Critical patent/JP2021164063A/en
Application granted granted Critical
Publication of JP7451264B2 publication Critical patent/JP7451264B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Studio Devices (AREA)
  • Image Processing (AREA)

Abstract

To enable suppression of generation of an artifact due to insufficient extraction accuracy of a subject region.SOLUTION: An image processing apparatus includes: map obtaining means (301) configured to obtain an evaluation value distribution corresponding to an image as an evaluation value map; map generating means (301) configured to generate a first subject map based on a subject region extracted from the image using the evaluation value map; degree obtaining means (303) configured to obtain a sparse degree indicating a degree of a sparse region included in the first subject map; and correction means (303, 305) configured to execute correction processing on the image using at least any one of the first subject map and a second subject map (307) generated without using the evaluation value map. The correction means (303, 305) executes the correction processing using the second subject map preferentially rather than the first subject map, as the sparse degree becomes higher.SELECTED DRAWING: Figure 2

Description

本発明は、撮像された画像に対する画像処理技術に関する。 The present invention relates to an image processing technique for captured images.

従来、撮像画像から被写体領域を抽出し、被写体領域内だけ明るさを補正したり、被写体領域以外に背景ぼかし効果を付与したりするカメラが知られている。特許文献1では、デフォーカス量分布に基づいて被写体領域を抽出し、被写体領域以外をぼかすことで電子的に背景ぼかし効果を調節する技術が開示されている。 Conventionally, there are known cameras that extract a subject area from a captured image, correct the brightness only in the subject area, or apply a background blur effect to the area other than the subject area. Patent Document 1 discloses a technique of extracting a subject region based on a defocus amount distribution and electronically adjusting the background blur effect by blurring a region other than the subject region.

特開2008−15754号公報Japanese Unexamined Patent Publication No. 2008-15754

しかしながら、上述の特許文献に開示された従来技術では、デフォーカス量分布のヒストグラムを解析して被写体領域のデフォーカス量範囲を決定するため、人物などの被写体と壁などの背景が接近している場合はデフォーカス量範囲が精度よく決定できない。結果、被写体領域に背景の一部が疎らに含まれたり、逆に被写体領域の一部が疎らに欠けたりして、画像補正や画像効果が疎らに適用され出力画像に斑状等のアーティファクトが発生してしまう。 However, in the prior art disclosed in the above-mentioned patent document, since the histogram of the defocus amount distribution is analyzed to determine the defocus amount range of the subject area, the subject such as a person and the background such as a wall are close to each other. In that case, the defocus amount range cannot be determined accurately. As a result, part of the background is sparsely included in the subject area, or conversely, part of the subject area is sparsely lacking, and image correction and image effects are applied sparsely, causing artifacts such as spots in the output image. Resulting in.

そこで、本発明は、被写体領域の抽出精度不足によるアーティファクト発生を抑圧可能にすることを目的とする。 Therefore, an object of the present invention is to make it possible to suppress the occurrence of artifacts due to insufficient extraction accuracy of the subject area.

本発明の画像処理装置は、画像に対応した評価値分布を評価値マップとして取得するマップ取得手段と、前記評価値マップを用いて前記画像から抽出した被写体領域に基づく第1の被写体マップを生成するマップ生成手段と、前記第1の被写体マップに含まれる疎ら領域の度合を表す、疎ら度合を取得する度合取得手段と、前記第1の被写体マップと、前記評価値マップを用いずに生成された第2の被写体マップとの、少なくともいずれかを用いて前記画像に補正処理を行う補正手段と、を有し、前記補正手段は、前記疎ら度合が高いほど前記第1の被写体マップよりも前記第2の被写体マップを優先的に用いて、前記補正処理を行うことを特徴とする。 The image processing apparatus of the present invention generates a map acquisition means for acquiring an evaluation value distribution corresponding to an image as an evaluation value map, and a first subject map based on a subject area extracted from the image using the evaluation value map. The map generation means for acquiring the degree of sparseness, which represents the degree of the sparse area included in the first subject map, the first subject map, and the evaluation value map are not used. The image has a correction means for correcting the image using at least one of the second subject map, and the correction means has a higher degree of sparseness than the first subject map. The correction process is performed by preferentially using the second subject map.

本発明によれば、被写体領域の抽出精度不足によるアーティファクト発生を抑圧可能になる。 According to the present invention, it is possible to suppress the occurrence of artifacts due to insufficient extraction accuracy of the subject area.

実施形態に係るデジタルカメラの構成例を示す図である。It is a figure which shows the structural example of the digital camera which concerns on embodiment. 撮像部の構成を説明するための図である。It is a figure for demonstrating the structure of the image pickup part. 画像処理部の構成例を示す図である。It is a figure which shows the structural example of the image processing part. 被写体領域抽出部の動作を説明するための図である。It is a figure for demonstrating operation of a subject area extraction part. 被写体マップ合成部の動作を説明するための図である。It is a figure for demonstrating the operation of the subject map synthesis part. 疎ら判定部の構成を説明するための図である。It is a figure for demonstrating the structure of the sparseness determination part. 膨張フィルタ部の構成例を示す図である。It is a figure which shows the structural example of the expansion filter part. 収縮フィルタ部の構成例を示す図である。It is a figure which shows the structural example of the shrinkage filter part. MAX/MEDIAN/MINフィルタ部の動作フローチャートである。It is an operation flowchart of the MAX / MEDIAN / MIN filter unit. 静止画撮影時の制御部の動作フローチャートである。It is an operation flowchart of the control unit at the time of still image shooting. 疎ら判定部の他の構成を説明するための図である。It is a figure for demonstrating another structure of a sparseness determination part.

以下、本発明の実施形態を、添付の図面に基づいて詳細に説明する。なお、以下の実施形態において示す構成は一例に過ぎず、本発明は図示された構成に限定されるものではない。同一の構成または処理については、同じ参照符号を付して説明する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. The configuration shown in the following embodiments is only an example, and the present invention is not limited to the illustrated configuration. The same configuration or processing will be described with the same reference numerals.

図1は、本発明実施形態の画像処理装置の一適用例としての撮像装置(以下、デジタルカメラ100とする)の概略的な構成例を示したブロック図である。
制御部101は、例えばCPUである。ROM102は、書き換え可能な不揮発性メモリであり、デジタルカメラ100が備える各ブロックの動作を制御する動作プログラムに加え、各ブロックの動作に必要なパラメータ等を記憶する。制御部101は、ROM102から動作プログラムを読み出し、RAM103に展開して実行することにより、本実施形態のデジタルカメラ100が備える各ブロックの動作を制御する。RAM103は、書き換え可能な揮発性メモリであり、デジタルカメラ100が備える各ブロックの動作において出力されたデータの一時的な記憶領域として用いられる。
FIG. 1 is a block diagram showing a schematic configuration example of an image pickup apparatus (hereinafter referred to as a digital camera 100) as an application example of the image processing apparatus according to the embodiment of the present invention.
The control unit 101 is, for example, a CPU. The ROM 102 is a rewritable non-volatile memory, and stores, in addition to an operation program for controlling the operation of each block included in the digital camera 100, parameters and the like necessary for the operation of each block. The control unit 101 reads an operation program from the ROM 102, expands it into the RAM 103, and executes it to control the operation of each block included in the digital camera 100 of the present embodiment. The RAM 103 is a rewritable volatile memory, and is used as a temporary storage area for data output in the operation of each block included in the digital camera 100.

光学系104は、被写体等の光学像を撮像部105の撮像面上に結像させる。
撮像部105は、例えばCCDやCMOSセンサ等の撮像素子であり、光学系104により撮像素子に結像された光学像を光電変換し、得られた撮像信号(アナログ信号)をA/D変換部106に出力する。
A/D変換部106は、入力された撮像信号にA/D変換処理を適用し、得られた撮像データ(デジタル撮像信号)をRAM103に出力して記憶させる。
The optical system 104 forms an optical image of a subject or the like on the imaging surface of the imaging unit 105.
The image pickup unit 105 is, for example, an image pickup element such as a CCD or a CMOS sensor. The optical image image formed on the image pickup device by the optical system 104 is photoelectrically converted, and the obtained image pickup signal (analog signal) is converted to an A / D converter. Output to 106.
The A / D conversion unit 106 applies the A / D conversion process to the input imaging signal, outputs the obtained imaging data (digital imaging signal) to the RAM 103, and stores the obtained imaging data (digital imaging signal).

画像処理部107は、RAM103に記憶されている撮像データに対して、ホワイトバランス調整、色補間、縮小/拡大、フィルタリングなど、様々な画像処理を適用し、得られた画像データをRAM103に出力して記憶させる。本実施形態に係る後述する補正処理は、画像処理部107において行われる。 The image processing unit 107 applies various image processing such as white balance adjustment, color interpolation, reduction / enlargement, and filtering to the imaged data stored in the RAM 103, and outputs the obtained image data to the RAM 103. And memorize it. The correction process described later according to this embodiment is performed by the image processing unit 107.

記録媒体108は、着脱可能なメモリカード等であり、画像処理部107で画像処理がなされてRAM103に記憶されている画像データや、A/D変換部106でA/D変換された撮像データなどを記録画像として記録する。
表示部109は、液晶ディスプレイ(LCD)等の表示デバイスであり、撮像部105で取り込まれた被写体像をスルー表示するなど、様々な情報を表示する。撮像部105で取り込まれた被写体像をスルー表示する場合、表示部109は、EVF(電子ビューファインダ)として機能する。
The recording medium 108 is a detachable memory card or the like, such as image data that has been image-processed by the image processing unit 107 and stored in the RAM 103, image data that has been A / D-converted by the A / D conversion unit 106, and the like. Is recorded as a recorded image.
The display unit 109 is a display device such as a liquid crystal display (LCD), and displays various information such as a through display of a subject image captured by the image pickup unit 105. When the subject image captured by the imaging unit 105 is displayed through, the display unit 109 functions as an EVF (electronic viewfinder).

ピントマップ処理部110は、撮像部105による撮像信号を解析することで、被写体等のピント分布に関連する情報をピントマップとして生成し、そのピントマップのデータをRAM103に出力して記憶させる。ピントマップ処理部110におけるピントマップの生成処理の詳細は後述する。本実施形態の場合、ピントマップ処理部110が取得した被写体等のピント分布に関連する情報であるピントマップは、撮像された画像に対する評価値分布を表した評価値マップとして用いられる。 The focus map processing unit 110 analyzes the image pickup signal by the image pickup unit 105 to generate information related to the focus distribution of the subject or the like as a focus map, and outputs the focus map data to the RAM 103 for storage. The details of the focus map generation process in the focus map processing unit 110 will be described later. In the case of the present embodiment, the focus map, which is the information related to the focus distribution of the subject or the like acquired by the focus map processing unit 110, is used as an evaluation value map showing the evaluation value distribution for the captured image.

図2は、撮像部105の撮像面の構成例を説明するための図である。
画素202は、マイクロレンズ201と一対の光電変換部203、204とから構成される。図1の撮像部105の撮像面には、それらマイクロレンズ201と一対の光電変換部203、204とで構成された画素202が、二次元的に規則的に配列されている。図2に示す構成の撮像部105では、二次元的に規則的に配列された各画素202の一対の光電変換部203、204の出力から、一対の画像としてA像、B像が出力される。すなわち、撮像部105によれば、図1の光学系104の瞳の異なる領域を通過する一対の光束を一対の光学像として結像させて、それらを一対の画像であるA像およびB像として出力することができる。
FIG. 2 is a diagram for explaining a configuration example of the imaging surface of the imaging unit 105.
The pixel 202 is composed of a microlens 201 and a pair of photoelectric conversion units 203 and 204. On the imaging surface of the imaging unit 105 of FIG. 1, pixels 202 composed of the microlens 201 and a pair of photoelectric conversion units 203 and 204 are arranged two-dimensionally and regularly. In the imaging unit 105 having the configuration shown in FIG. 2, A image and B image are output as a pair of images from the outputs of the pair of photoelectric conversion units 203 and 204 of the pixels 202 arranged two-dimensionally regularly. .. That is, according to the imaging unit 105, a pair of light fluxes passing through different regions of the pupil of the optical system 104 of FIG. 1 are imaged as a pair of optical images, and these are formed as a pair of images, A image and B image. Can be output.

図1のピントマップ処理部110は、それらA像とB像との位相差分布、つまり視点がそれぞれ異なる二つの画像群から取得される視差情報分布を、評価値マップ(ピントマップ)として出力する。A像とB像の位相差分布としては、例えば特許文献1に開示されている手法を用いたデフォーカス量分布を取得すればよい。 The focus map processing unit 110 of FIG. 1 outputs the phase difference distribution between the A image and the B image, that is, the parallax information distribution acquired from two image groups having different viewpoints as an evaluation value map (focus map). .. As the phase difference distribution between the A image and the B image, for example, the defocus amount distribution using the method disclosed in Patent Document 1 may be obtained.

図3は、画像処理部107の構成例を示すブロック図である。図3に示すように、画像処理部107は、被写体領域抽出部301、疎ら判定部302、被写体マップ合成部303、及び補正処理部305を有して構成されている。 FIG. 3 is a block diagram showing a configuration example of the image processing unit 107. As shown in FIG. 3, the image processing unit 107 includes a subject area extraction unit 301, a sparseness determination unit 302, a subject map composition unit 303, and a correction processing unit 305.

被写体領域抽出部301は、ピントマップ処理部110から入力されるピントマップ(評価値マップ)を用いて被写体領域を抽出して被写体マップを生成する被写体マップ取得処理を行う。そして、被写体領域抽出部301は、その被写体マップの情報を、被写体マップ合成部303と疎ら判定部302とに出力する。なお被写体領域は、例えば特許文献1に開示されているデフォーカス量分布を用いて抽出することができる。 The subject area extraction unit 301 performs a subject map acquisition process of extracting a subject area using a focus map (evaluation value map) input from the focus map processing unit 110 to generate a subject map. Then, the subject area extraction unit 301 outputs the information of the subject map to the subject map synthesizing unit 303 and the sparse determination unit 302. The subject region can be extracted using, for example, the defocus amount distribution disclosed in Patent Document 1.

図4(a)〜図4(d)は、被写体領域抽出部301における被写体マップ生成処理の動作を説明するための図である。
図4(a)は図1の撮像部105の撮像面401上に結像された被写体像を説明するための図である。図4(a)の例では、主被写体である人物412にピントが合っていて、その手前に人物411が立っているとする。図4(a)の例の場合、主被写体の人物412は、部屋の壁の直前に立っているとする。また図4(a)の場合、部屋内には家具413もあり、その家具413は背面が壁につくように設置されている。このため、主被写体の人物412にピントが合っている場合、その家具413もピントが合った状態になっているとする。一方、人物411は、人物412よりも手前に立っているため、その人物411にはピントが合っていない。
4 (a) to 4 (d) are diagrams for explaining the operation of the subject map generation process in the subject area extraction unit 301.
FIG. 4A is a diagram for explaining a subject image formed on the imaging surface 401 of the imaging unit 105 of FIG. In the example of FIG. 4A, it is assumed that the person 412, which is the main subject, is in focus, and the person 411 stands in front of the person 412. In the case of the example of FIG. 4A, it is assumed that the person 412 of the main subject stands in front of the wall of the room. Further, in the case of FIG. 4A, there is also furniture 413 in the room, and the furniture 413 is installed so that the back surface is attached to the wall. Therefore, when the person 412 of the main subject is in focus, it is assumed that the furniture 413 is also in focus. On the other hand, since the person 411 stands in front of the person 412, the person 411 is out of focus.

図4(b)は、ピントマップ402を表した図である。図4(b)に示したピントマップ402はグレースケールで表現されており、デフォーカス量が大きいほど白く表され、デフォーカス量が小さいほどグレーに表されている。なお図4(b)中の領域422は図4(a)の人物412に対応した領域であり、領域423は図4(a)の家具413に対応した領域であり、領域421は図4(a)の人物411に対応した領域である。図4(a)の主被写体の人物412と家具413及びその背後の壁は距離が近くそれぞれデフォーカス量が小さいため、領域422と423および壁はグレーで表され、一方、手前側の人物411はデフォーカス量が大きいため、領域421は白で表されている。 FIG. 4B is a diagram showing the focus map 402. The focus map 402 shown in FIG. 4B is represented in gray scale, and the larger the defocus amount is, the whiter it is, and the smaller the defocus amount is, the grayer it is. The area 422 in FIG. 4B is the area corresponding to the person 412 in FIG. 4A, the area 423 is the area corresponding to the furniture 413 in FIG. 4A, and the area 421 is the area corresponding to FIG. 4 (a). This is the area corresponding to the person 411 in a). Since the main subject person 412 and furniture 413 in FIG. 4A and the wall behind them are close to each other and the amount of defocus is small, the areas 422 and 423 and the wall are shown in gray, while the person 411 on the front side. Since the amount of defocus is large, the area 421 is represented by white.

図4(d)は、デフォーカス量頻度分布を示した図である。図4(d)の頻度分布404は人物411のデフォーカス量頻度分布を示し、頻度分布405は人物412および家具413のデフォーカス量頻度分布を、頻度分布406は壁のデフォーカス量頻度分布を示している。前述したように人物412と家具413は壁に近いため、人物412及び家具413のデフォーカス量頻度分布405と、壁のデフォーカス量頻度分布406との境界(頻度分布の谷部分)は、不鮮明になっている。一方、人物412及び家具413や壁から離れている人物411のデフォーカス量頻度分布404は、それら人物412及び家具413や壁のデフォーカス量頻度分布405,406と明確に区別可能になっている。 FIG. 4D is a diagram showing a defocus amount frequency distribution. The frequency distribution 404 in FIG. 4 (d) shows the defocus amount frequency distribution of the person 411, the frequency distribution 405 shows the defocus amount frequency distribution of the person 412 and the furniture 413, and the frequency distribution 406 shows the defocus amount frequency distribution of the wall. Shown. As described above, since the person 412 and the furniture 413 are close to the wall, the boundary between the defocus frequency distribution 405 of the person 412 and the furniture 413 and the defocus frequency distribution 406 of the wall (the valley part of the frequency distribution) is unclear. It has become. On the other hand, the defocus frequency distribution 404 of the person 412 and the furniture 413 or the person 411 away from the wall is clearly distinguishable from the defocus frequency distributions 405 and 406 of the person 412 and the furniture 413 or the wall. ..

図4(c)は、図4(d)のデフォーカス量頻度分布に基づいて生成される被写体マップ403を示した図である。被写体マップは、白が255で黒が0の8ビットの2値で表されるマップである。白部分は、被写体領域を表す被写体ラベルとして用いられ、黒部分は被写体領域外(非被写体領域)を表す非被写体ラベルとして用いられる。このように、被写体マップは、白部分で表される被写体ラベルと、黒部分で表される非被写体ラベルとの、少なくとも二つのラベル領域にクラス分けされている。被写体マップの生成時には、デフォーカス量0を含むデフォーカス量頻度分布405のピークを挟む一方の谷d1から他方の谷d2までのL2範囲に含まれる領域が白(255)の被写体ラベルで表される被写体領域となされる。L2範囲外(L1範囲やL3範囲)の領域は黒(0)の非被写体ラベルで表される非被写体領域となされる。なお、図4(c)中の領域432は図4(a)の人物412に対応した領域であり、領域433は図4(a)の家具413に対応した領域である。 FIG. 4C is a diagram showing a subject map 403 generated based on the defocus amount frequency distribution of FIG. 4D. The subject map is an 8-bit binary map in which white is 255 and black is 0. The white portion is used as a subject label representing the subject area, and the black portion is used as a non-subject label representing the outside of the subject area (non-subject area). As described above, the subject map is classified into at least two label areas, that is, a subject label represented by a white portion and a non-subject label represented by a black portion. When the subject map is generated, the area included in the L2 range from one valley d1 to the other valley d2 sandwiching the peak of the defocus amount frequency distribution 405 including the defocus amount 0 is represented by a white (255) subject label. It is the subject area. The area outside the L2 range (L1 range or L3 range) is a non-subject area represented by a black (0) non-subject label. The area 432 in FIG. 4C is the area corresponding to the person 412 in FIG. 4A, and the area 433 is the area corresponding to the furniture 413 in FIG. 4A.

ただし、図4(d)のデフォーカス量頻度分布例の場合、デフォーカス量頻度分布405と406との境界が不鮮明である。このため、図4(c)の被写体マップ403では、人物412に対応した領域432および家具413に対応した領域433だけでなく、部屋の壁の一部が被写体ラベルを表す白(255)の領域434として生成されている。この領域434は、本来の主被写体ではない領域であるため、主被写体の人物412のように纏まった領域にはならず、疎らに散らばった斑状等の小領域になることが多い。以下、被写体マップにおいて疎らに散らばった斑状等の各小領域434を、疎ら領域と呼ぶことにする。 However, in the case of the defocus amount frequency distribution example of FIG. 4D, the boundary between the defocus amount frequency distributions 405 and 406 is unclear. Therefore, in the subject map 403 of FIG. 4C, not only the area 432 corresponding to the person 412 and the area 433 corresponding to the furniture 413, but also a white (255) area in which a part of the wall of the room represents the subject label. Generated as 434. Since this region 434 is a region that is not the original main subject, it is not a region that is organized like the person 412 of the main subject, but is often a small region such as sparsely scattered spots. Hereinafter, each small area 434 such as spots scattered sparsely in the subject map will be referred to as a sparse area.

図3に説明を戻す。
疎ら判定部302は、被写体領域抽出部301によって生成された被写体マップにおいて疎ら領域を検出し、被写体マップ内に疎ら領域がどの程度含まれているかを示す疎ら度合を判定する疎ら度合取得処理を行う。そして、疎ら判定部302は、その取得した疎ら度合を表す情報を、被写体マップ合成部303に出力する。
The explanation is returned to FIG.
The sparseness determination unit 302 detects a sparse area in the subject map generated by the subject area extraction unit 301, and performs a sparseness degree acquisition process for determining the degree of sparseness indicating how much the sparse area is included in the subject map. .. Then, the sparseness determination unit 302 outputs the acquired information indicating the degree of sparseness to the subject map composition unit 303.

本実施形態の場合、疎ら判定部302は、被写体マップに含まれる各疎ら領域の面積を求め、それら疎ら領域の面積を基に当該被写体マップの疎ら度合を判定する。疎ら度合は一例として0〜100%の割合を示す値となされており、疎ら判定部302は、被写体マップの全面積に対して疎ら領域の面積が相対的に大きくなるほど、当該被写体マップの疎ら度合を高い値にする。図4(c)に例示した被写体マップ403の場合、壁の一部の小領域414が疎ら領域として検出され、被写体マップに対して疎ら領域の面積が相対的に大きいほど高い値の疎ら度合が出力される。なお、疎ら判定部302の構成、疎ら領域検出、および疎ら度合の判定処理等の詳細な説明は後述する。 In the case of the present embodiment, the sparseness determination unit 302 obtains the area of each sparse area included in the subject map, and determines the degree of sparseness of the subject map based on the area of the sparse area. The degree of sparseness is set to a value indicating a ratio of 0 to 100% as an example, and the sparseness determination unit 302 increases the degree of sparseness of the subject map as the area of the sparse area becomes relatively larger than the total area of the subject map. To a high value. In the case of the subject map 403 illustrated in FIG. 4C, a small area 414 of a part of the wall is detected as a sparse area, and the larger the area of the sparse area with respect to the subject map, the higher the degree of sparseness. It is output. A detailed description of the configuration of the sparseness determination unit 302, the detection of the sparse area, the determination process of the degree of sparseness, and the like will be described later.

そして、被写体マップ合成部303は、被写体領域抽出部301からの被写体マップと、予め用意された代替シルエット307とを、疎ら度合に基づいて合成し、その合成後の被写体マップを補正処理部305に出力する。詳細は後述するが、本実施形態の場合、被写体マップ合成部303では、疎ら度合が高いほど、代替シルエット307が被写体マップ403よりも優先的に用いられるように合成された合成後被写体マップが生成される。そしてこの場合、補正処理部305では、疎ら度合が高いほど代替シルエット307が被写体マップ403よりも優先的に用いられるように合成された合成後被写体マップに基づく補正処理が行われることになる。 Then, the subject map synthesizing unit 303 synthesizes the subject map from the subject area extraction unit 301 and the alternative silhouette 307 prepared in advance based on the degree of sparseness, and the combined subject map is sent to the correction processing unit 305. Output. Although the details will be described later, in the case of the present embodiment, the subject map compositing unit 303 generates a post-composite subject map synthesized so that the higher the degree of sparseness, the more preferentially the alternative silhouette 307 is used over the subject map 403. Will be done. In this case, the correction processing unit 305 performs correction processing based on the synthesized subject map so that the alternative silhouette 307 is used preferentially over the subject map 403 as the degree of sparseness increases.

図5(a)〜図5(d)は、被写体マップ合成部303の動作を説明するための図である。
図5(b)は代替シルエット307の一例を示した図である。図5(b)に示した代替シルエット307は、人型510を含む固定形状マップである。前述した被写体マップはピントマップ(評価値マップ)を用いて生成された第1の被写体マップであり、一方、代替シルエットは評価値マップを用いずに予め生成されている第2の被写体マップである。代替シルエット307の情報は、例えば図1のROM102が保持しており、画像処理部107において利用される時に、図1のRAM103に展開されて被写体マップ合成部303に送られる。なお、疎ら度合を基に代替シルエット307が合成される場合、画像処理部107では、例えば撮像画像から既知の人物画像認識処理などで人型の領域を検出する。そして、被写体マップ合成部303では、その検出位置に、代替シルエット307の人型510の位置を合わせるようにして合成するものとする。
5 (a) to 5 (d) are diagrams for explaining the operation of the subject map compositing unit 303.
FIG. 5B is a diagram showing an example of the alternative silhouette 307. The alternative silhouette 307 shown in FIG. 5B is a fixed shape map including the humanoid 510. The subject map described above is the first subject map generated using the focus map (evaluation value map), while the alternative silhouette is the second subject map generated in advance without using the evaluation value map. .. The information of the alternative silhouette 307 is held by, for example, the ROM 102 of FIG. 1, and when it is used by the image processing unit 107, it is expanded in the RAM 103 of FIG. 1 and sent to the subject map compositing unit 303. When the alternative silhouette 307 is synthesized based on the degree of sparseness, the image processing unit 107 detects a humanoid region by, for example, a known person image recognition process from the captured image. Then, the subject map synthesizing unit 303 synthesizes the humanoid 510 of the alternative silhouette 307 so as to match the detected position.

図5(a)のグラフ501は、代替シルエット使用率と疎ら度合との関係を示した図である。図5(a)の縦軸が代替シルエット使用率[%]を示し、横軸が疎ら度合[%]を示している。グラフ501に示すように、疎ら度合が第1の閾値TH1未満である場合には代替シルエット使用率が0%となされ、疎ら度合が第2の閾値TH2以上である場合には代替シルエット使用率が100%となされる。また、疎ら度合が第1の閾値TH1以上で第2の閾値TH2未満である場合には、疎ら度合が高くなるほど、代替シルエット使用率が高くなる。 Graph 501 of FIG. 5A is a diagram showing the relationship between the alternative silhouette usage rate and the degree of sparseness. The vertical axis of FIG. 5A shows the alternative silhouette usage rate [%], and the horizontal axis shows the degree of sparseness [%]. As shown in Graph 501, when the degree of sparseness is less than the first threshold value TH1, the alternative silhouette usage rate is set to 0%, and when the degree of sparseness is greater than or equal to the second threshold value TH2, the alternative silhouette usage rate is set to 0%. It is made 100%. Further, when the degree of sparseness is equal to or higher than the first threshold value TH1 and less than the second threshold value TH2, the higher the degree of sparseness, the higher the usage rate of the alternative silhouette.

図5(d)は図4(c)に示した被写体マップ403を示した図である。
図5(c)は、被写体マップ合成部303において、図5(d)の被写体マップ403と図5(b)の代替シルエット307とを、図5(a)のグラフ501の疎ら度合を基に合成した後の合成後被写体マップ503を示した図である。なお、被写体マップ合成部303における合成処理の詳細は後述する。
FIG. 5D is a diagram showing the subject map 403 shown in FIG. 4C.
5 (c) shows the subject map 403 of FIG. 5 (d) and the alternative silhouette 307 of FIG. 5 (b) in the subject map synthesizer 303 based on the degree of sparseness of the graph 501 of FIG. 5 (a). It is a figure which showed the subject map 503 after composition after composition. The details of the compositing process in the subject map compositing unit 303 will be described later.

図5(c)の例は、被写体マップの疎ら度合が例えば図5(a)の第2の閾値TH2以上であったため、代替シルエット使用率が100%になされた場合の合成後被写体マップ503を示している。図5(c)の例では、図5(d)の被写体マップ403内の図4(a)の家具413に対応した領域433が白(255)の被写体レベルとはならず黒(0)の非被写体レベルになるが、疎ら領域434についてはすべて黒(0)の非被写体レベルになっている。この合成後被写体マップ503が後段の補正処理部305で後述する補正処理に用いられた場合、疎ら領域に補正が行われて不要なアーティファクトが発生してしまうのを防ぐことができることになる。 In the example of FIG. 5 (c), since the degree of sparseness of the subject map is, for example, the second threshold value TH2 or more of FIG. 5 (a), the combined subject map 503 when the alternative silhouette usage rate is 100% is used. Shown. In the example of FIG. 5 (c), the area 433 corresponding to the furniture 413 of FIG. 4 (a) in the subject map 403 of FIG. 5 (d) does not become the subject level of white (255) and is black (0). Although it is a non-subject level, all the sparse areas 434 are black (0) non-subject levels. When the combined subject map 503 is used in the correction processing described later in the correction processing unit 305 in the subsequent stage, it is possible to prevent the sparse region from being corrected and unnecessary artifacts from being generated.

図5の説明では、代替シルエット307は予め用意され加工等されずに被写体マップ403と合成される例を挙げたが、本実施形態はこれに限定されるものではない。代替シルエット307を加工して被写体マップ403と合成してもよい。例えば、図4(a)の主被写体の人物412の顔器官位置、関節位置や姿勢情報などを検出し、その検出結果を基に、代替シルエット307の人型510の位置と形状を、主被写体の人物412の位置と形状に合うように変形や拡大・縮小等するようにしても良い。その他にも、代替シルエットは撮像された画像の解析を行うことで生成されてもよい。例えば、機械学習に基づいた意味的領域分割などの手法を使って、主被写体の人物412の人物マップを検出し、その人物マップを代替シルエットとして用いても良い。 In the description of FIG. 5, the alternative silhouette 307 is prepared in advance and combined with the subject map 403 without being processed or the like, but the present embodiment is not limited to this. The alternative silhouette 307 may be processed and combined with the subject map 403. For example, the facial organ position, joint position, posture information, etc. of the person 412 of the main subject in FIG. 4A are detected, and the position and shape of the humanoid 510 of the alternative silhouette 307 are determined based on the detection results. It may be deformed, enlarged / reduced, etc. so as to match the position and shape of the person 412. In addition, the alternative silhouette may be generated by analyzing the captured image. For example, a person map of the person 412 of the main subject may be detected by using a technique such as semantic region division based on machine learning, and the person map may be used as an alternative silhouette.

図3に説明を戻す。
加算部304は、A像308とB像309の一対の視差画像が入力され、それらA像308とB像309の一対の視差画像を加算する。加算部304による加算後の画像(加算画像)は補正処理部305に送られる。
The explanation is returned to FIG.
The addition unit 304 inputs a pair of parallax images of the A image 308 and the B image 309, and adds the pair of parallax images of the A image 308 and the B image 309. The image after addition by the addition unit 304 (addition image) is sent to the correction processing unit 305.

補正処理部305は、加算画像の明るさを、合成後被写体マップに基づいて補正する。補正処理部305における補正処理は、以下の式(1)の演算により表される。なお、式(1)において、Xは加算画像の画素値、Gは合成後被写体マップの画素値、Yは補正処理が行われた後の画像の画素値である。この補正処理部305による補正処理後の画像は、画像処理部107における補正後画像310として出力される。 The correction processing unit 305 corrects the brightness of the added image based on the subject map after composition. The correction processing in the correction processing unit 305 is expressed by the calculation of the following equation (1). In the equation (1), X is the pixel value of the added image, G is the pixel value of the subject map after composition, and Y is the pixel value of the image after the correction process is performed. The image after the correction processing by the correction processing unit 305 is output as the corrected image 310 in the image processing unit 107.

Y=X・(1+G/255) 式(1) Y = X · (1 + G / 255) Equation (1)

式(1)は加算画像の明るさを合成後被写体マップに基づいて補正する補正処理の演算例であるため、補正後画像310は、着目被写体つまり主被写体である人物412にライトを照らしたようなライティング補正効果が付与された画像となる。本実施形態では、ライティング補正効果を付与する補正処理を挙げたが、補正処理はこの例に限定されるものではない。例えば、合成後被写体マップに基づいて加算画像にシャープネス調整を行う補正処理でも良く、この場合、着目被写体のシャープネスが向上した画像の取得が可能となる。その他にも、着目被写体に対する補正処理ではなく、合成後被写体マップに基づいて着目被写体の領域外の背景領域について背景ぼかしや背景コントラスト調整を行うような補正処理でもよい。この場合、着目被写体の領域外の背景がぼけた画像や背景コントラストが調整された画像の取得が可能となる。またこれらライティング補正、シャープネス調整、背景ぼかし、背景コントラスト調整等は、それぞれ別個に行われても良いし、二つ以上が組み合わされて行われても良い。 Since the equation (1) is an calculation example of the correction process for correcting the brightness of the added image based on the subject map after composition, the corrected image 310 seems to illuminate the subject of interest, that is, the person 412 which is the main subject. The image will have a good lighting correction effect. In the present embodiment, the correction process for imparting the lighting correction effect is mentioned, but the correction process is not limited to this example. For example, a correction process that adjusts the sharpness of the added image based on the combined subject map may be used, and in this case, it is possible to acquire an image with improved sharpness of the subject of interest. In addition, instead of the correction processing for the subject of interest, the correction processing may be performed such that the background blur or the background contrast is adjusted for the background area outside the area of the subject of interest based on the combined subject map. In this case, it is possible to acquire an image in which the background outside the region of the subject of interest is blurred or an image in which the background contrast is adjusted. Further, these lighting corrections, sharpness adjustments, background blurring, background contrast adjustments, etc. may be performed separately, or may be performed in combination of two or more.

図6(a)は、図3の疎ら判定部302の構成例を示す図であり、図6(b)〜図6(g)は図6(a)の構成における動作を説明するための図である。
図6(a)に示すように、疎ら判定部302は、膨張フィルタ部601、収縮フィルタ部602、差分検出部603、差分検出部604、マップ統合部605、MEDIANフィルタ部606、及び疎ら度合算出部607を有する。
6 (a) is a diagram showing a configuration example of the sparseness determination unit 302 of FIG. 3, and FIGS. 6 (b) to 6 (g) are diagrams for explaining the operation in the configuration of FIG. 6 (a). Is.
As shown in FIG. 6A, the sparseness determination unit 302 includes an expansion filter unit 601, a contraction filter unit 602, a difference detection unit 603, a difference detection unit 604, a map integration unit 605, a median filter unit 606, and a sparseness degree calculation. It has a part 607.

膨張フィルタ部601は、入力被写体マップ608の白(255)の被写体ラベル部分を膨張させるフィルタ部である。図6(b)は、入力被写体マップ608が前述の図4(c)に示した被写体マップ403である場合に、その被写体マップ403を膨張フィルタ部601にて膨張フィルタ処理した後の、膨張後被写体マップ611を示した図である。すなわち図4(c)の被写体マップ403に対して膨張フィルタ処理が行われた場合、被写体マップ403内で互いに近い白部分同士(被写体ラベル部分同士)が繋がった、図6(b)に示すような膨張後被写体マップ611が生成される。本実施形態の場合、膨張後被写体マップ611は第3の被写体マップに相当する。 The expansion filter unit 601 is a filter unit that expands the white (255) subject label portion of the input subject map 608. FIG. 6B shows that when the input subject map 608 is the subject map 403 shown in FIG. 4C described above, the subject map 403 is expanded and filtered by the expansion filter unit 601 after expansion. It is a figure which showed the subject map 611. That is, when the expansion filter processing is performed on the subject map 403 of FIG. 4 (c), the white portions (subject label portions) that are close to each other in the subject map 403 are connected, as shown in FIG. 6 (b). After expansion, the subject map 611 is generated. In the case of the present embodiment, the expanded subject map 611 corresponds to the third subject map.

収縮フィルタ部602は、入力被写体マップ608の白(255)の被写体ラベルを収縮させるフィルタ部である。図6(c)は、入力被写体マップ608が図4(c)に示した被写体マップ403である場合に、その被写体マップ403を収縮フィルタ部602にて収縮フィルタ処理した後の、収縮後被写体マップ612を示した図である。すなわち図4(c)の被写体マップ403に対して収縮フィルタ処理が行われた場合、被写体マップ403内で互いに近い黒部分同士が繋がった、図6(c)に示すような収縮後被写体マップ612が生成される。本実施形態の場合、収縮後被写体マップ612は第4の被写体マップに相当する。 The shrink filter unit 602 is a filter unit that shrinks the white (255) subject label of the input subject map 608. FIG. 6 (c) shows a post-shrinkage subject map after the input subject map 608 is the subject map 403 shown in FIG. 4 (c) and the subject map 403 is shrink-filtered by the shrink filter unit 602. It is a figure which showed 612. That is, when the subject map 403 of FIG. 4 (c) is subjected to the shrinkage filter processing, the black portions close to each other in the subject map 403 are connected to each other, and the contracted subject map 612 as shown in FIG. 6 (c). Is generated. In the case of the present embodiment, the contracted subject map 612 corresponds to the fourth subject map.

差分検出部603は、膨張フィルタ処理前後の被写体マップで差分があるところを白(255)の被写体ラベルとし、それ以外を黒(0)の非被写体ラベルとするような差分検出処理を行う。図6(d)は、膨張フィルタ処理前である図4(c)の被写体マップ403と、膨張フィルタ処理後である図6(b)の膨張後被写体マップ611とから、差分検出部603が差分検出処理を行った後の、差分検出マップ613を示した図である。すなわち図4(c)の被写体マップ403と図6(b)の膨張後被写体マップ611との差分検出処理が行われた場合、差分部分が白(255)となり、それ以外が黒(0)の非被写体ラベルとなった、図6(d)に示すような差分検出マップ613が生成される。本実施形態の場合、差分検出マップ613は第1の疎ら領域マップに相当する。 The difference detection unit 603 performs the difference detection process so that the white (255) subject label is used for the difference in the subject map before and after the expansion filter processing, and the black (0) non-subject label is used for the other parts. In FIG. 6 (d), the difference detection unit 603 is different from the subject map 403 of FIG. 4 (c) before the expansion filter processing and the post-expansion subject map 611 of FIG. 6 (b) after the expansion filter processing. It is a figure which showed the difference detection map 613 after performing the detection process. That is, when the difference detection process between the subject map 403 of FIG. 4 (c) and the expanded subject map 611 of FIG. 6 (b) is performed, the difference portion becomes white (255) and the other portion becomes black (0). A difference detection map 613 as shown in FIG. 6D, which is a non-subject label, is generated. In the case of the present embodiment, the difference detection map 613 corresponds to the first sparse area map.

差分検出部604は、収縮フィルタ処理前後の被写体マップで差分があるところを白(255)の被写体ラベルとし、それ以外の黒(0)の非被写体ラベルとするような差分検出処理を行う。図6(e)は、収縮フィルタ処理前である図4(c)の被写体マップ403と、収縮フィルタ処理後である図6(c)の収縮後被写体マップ612とから、差分検出部604が差分検出処理を行った後の、差分検出マップ614を示した図である。つまり図4(c)の被写体マップ403と図6(c)の収縮後被写体マップ612との差分検出処理によれば、差分部分が白(255)の被写体ラベルで、それ以外が黒(0)の非被写体ラベルとなる図6(e)に示すような差分検出マップ614が生成される。本実施形態の場合、差分検出マップ614は第2の疎ら領域マップに相当する。 The difference detection unit 604 performs the difference detection process so that the white (255) subject label is used as the difference in the subject map before and after the shrinkage filter processing, and the other black (0) non-subject label is used. In FIG. 6 (e), the difference detection unit 604 is different from the subject map 403 of FIG. 4 (c) before the shrinkage filter processing and the post-shrinkage subject map 612 of FIG. 6 (c) after the contraction filter processing. It is a figure which showed the difference detection map 614 after performing the detection process. That is, according to the difference detection process between the subject map 403 of FIG. 4 (c) and the contracted subject map 612 of FIG. 6 (c), the difference portion is the subject label of white (255), and the rest is black (0). The difference detection map 614 as shown in FIG. 6E, which is the non-subject label of the above, is generated. In the case of the present embodiment, the difference detection map 614 corresponds to the second sparse area map.

これら差分検出部603、604における差分検出処理は、以下の式(2)で表される。なお、式(2)において、X0及びX1は差分検出部へ入力される被写体マップである。つまりX0とX1は、差分検出部603の場合には膨張フィルタ処理前後の被写体マップであり、差分検出部604の場合には膨張フィルタ処理前後の被写体マップである。また式(2)において、ABSは絶対値関数、Sは差分検出部の出力である。 The difference detection process in the difference detection units 603 and 604 is represented by the following equation (2). In the equation (2), X0 and X1 are subject maps input to the difference detection unit. That is, X0 and X1 are subject maps before and after the expansion filter processing in the case of the difference detection unit 603, and subject maps before and after the expansion filter processing in the case of the difference detection unit 604. Further, in the equation (2), ABS is an absolute value function, and S is an output of the difference detection unit.

S=ABS(X0−X1) 式(2) S = ABS (X0-X1) Equation (2)

このように、膨張フィルタ部601による膨張フィルタ処理前後の被写体マップを用い、差分検出部603で差分検出処理を行うように構成することで、疎ら領域における黒部分を検出することができることになる。つまり膨張フィルタ部601の膨張フィルタ処理で被写体マップの疎ら領域の黒部分(非被写体ラベル)が変化(白の被写体ラベルに変化)することになり、さらに差分検出部603で差分検出処理で疎ら領域における黒部分を検出することができることになる。また、収縮フィルタ部602による収縮フィルタ処理前後の被写体マップを用い、差分検出部604で差分検出処理を行うように構成することで、疎ら領域における白部分を検出することができることになる。つまり収縮フィルタ部602の収縮フィルタ処理によって被写体マップの疎ら領域の白部分が変化(黒部分に変化)することになり、さらに差分検出部604で差分検出処理を行うことで、その疎ら領域における白部分を検出することができることになる。 In this way, by using the subject map before and after the expansion filter processing by the expansion filter unit 601 and configuring the difference detection unit 603 to perform the difference detection processing, it is possible to detect the black portion in the sparse region. That is, the black part (non-subject label) of the sparse area of the subject map changes (changes to the white subject label) by the expansion filter processing of the expansion filter unit 601, and further, the sparse area by the difference detection process by the difference detection unit 603. It will be possible to detect the black part in. Further, by using the subject map before and after the contraction filter processing by the contraction filter unit 602 and configuring the difference detection unit 604 to perform the difference detection process, the white portion in the sparse region can be detected. That is, the white part of the sparse area of the subject map changes (changes to the black part) by the shrinkage filter processing of the shrinkage filter unit 602, and the difference detection process of the difference detection unit 604 further changes the white part in the sparse area. The part can be detected.

なお本実施形態では、差分検出部603,604における差分検出処理を式(2)で表される演算としたが、この例に限定されるものではない。例えば、白(255)の部分をTRUE(真)、黒(0)の部分をFALSE(偽)としたうえで、XOR(排他的論理和)の論理演算を行って差分検出を行うようにしても良い。 In the present embodiment, the difference detection process in the difference detection units 603 and 604 is an operation represented by the equation (2), but the present invention is not limited to this example. For example, after the white (255) part is TRUE (true) and the black (0) part is FALSE (false), the difference is detected by performing the logical operation of XOR (exclusive OR). Is also good.

差分検出部603による差分検出マップと、差分検出部604による差分検出マップとは、マップ統合部605に入力される。
マップ統合部605は、入力された差分検出マップのいずれかが白なら白(255)の被写体ラベルとし、それ以外を黒(0)の非被写体ラベルにして出力するマップ統合処理を行う。図6(f)は、図6(d)に示した差分検出マップ613と、図6(e)に示した差分検出マップ614とを、マップ統合処理した後の統合マップ615を示した図である。
The difference detection map by the difference detection unit 603 and the difference detection map by the difference detection unit 604 are input to the map integration unit 605.
If any of the input difference detection maps is white, the map integration unit 605 sets the subject label as white (255), and sets the other labels as non-subject labels of black (0) and outputs the map integration process. FIG. 6 (f) is a diagram showing an integrated map 615 after the difference detection map 613 shown in FIG. 6 (d) and the difference detection map 614 shown in FIG. 6 (e) are subjected to map integration processing. be.

マップ統合部605におけるマップ統合処理は、以下の式(3)で表される。なお、式(3)において、X2およびX3はマップ統合部へ入力される差分検出マップである。また式(3)において、CLIPは0以下なら0、255以上なら255に値をクリップするクリップ関数、Iはマップ統合部の出力である。 The map integration process in the map integration unit 605 is represented by the following equation (3). In the equation (3), X2 and X3 are difference detection maps input to the map integration unit. Further, in the equation (3), CLIP is a clip function that clips the value to 0 if it is 0 or less and 255 if it is 255 or more, and I is the output of the map integration unit.

I=CLIP(X2+X3) 式(3) I = CLIP (X2 + X3) Equation (3)

マップ統合部605において式(3)で表されるようなマップ統合処理が行われることで、図4(c)の被写体マップ403から疎ら領域全体を検出することができる。すなわち、図6(f)に示した統合マップ615は、被写体マップ403から検出された疎ら領域マップ615となされている。 By performing the map integration process as represented by the equation (3) in the map integration unit 605, the entire sparse region can be detected from the subject map 403 of FIG. 4 (c). That is, the integrated map 615 shown in FIG. 6 (f) is a sparse area map 615 detected from the subject map 403.

なお本実施形態では、マップ統合部605において式(3)の演算を行う例を挙げたが、これに限定されるものではない。例えば白(255)の部分をTRUEとし、黒(0)の部分をFALSEとしたうえで、OR(論理和)の論理演算を行ってマップ統合を行うようにしても良い。 In the present embodiment, an example in which the calculation of the equation (3) is performed in the map integration unit 605 is given, but the present invention is not limited to this. For example, the white (255) part may be TRUE, the black (0) part may be FALSE, and then OR (logical sum) logical operation may be performed to integrate the map.

また本実施形態においては、差分検出部603による疎ら領域の黒部分検出結果と、差分検出部604による疎ら領域の白部分検出結果との両方を疎ら領域として評価する構成としたが、これに限定されるものではない。例えば、差分検出部603の検出結果だけ用いても良いし、逆に差分検出部604の検出結果だけ用いるようにしても良い。 Further, in the present embodiment, both the black portion detection result of the sparse region by the difference detection unit 603 and the white portion detection result of the sparse region by the difference detection unit 604 are evaluated as the sparse region, but the configuration is limited to this. It is not something that is done. For example, only the detection result of the difference detection unit 603 may be used, or conversely, only the detection result of the difference detection unit 604 may be used.

図6(a)のMEDIANフィルタ部606は、マップ統合部605にて生成された疎ら領域マップ615に対し、メディアンフィルタをかけるフィルタ処理部である。図6(g)は、図6(f)に示した疎ら領域マップ615にメディアンフィルタ処理が行われた後の疎ら領域マップ616を示した図である。疎ら領域マップ615に対するメディアンフィルタ処理は、当該疎ら領域マップ615の孤立領域を除去する孤立領域除去処理となる。すなわち疎ら領域マップ615に対してメディアンフィルタ処理が行われると、疎ら領域マップ615内の細い線や細かい点等を除去することができ、被写体の輪郭部などで発生する疎ら領域マップの誤判定領域を除去することができる。 The MEDIAN filter unit 606 of FIG. 6A is a filter processing unit that applies a median filter to the sparse area map 615 generated by the map integration unit 605. FIG. 6 (g) is a diagram showing a sparse region map 616 after the median filter processing is performed on the sparse region map 615 shown in FIG. 6 (f). The median filter process for the sparse area map 615 is an isolated area removal process for removing the isolated area of the sparse area map 615. That is, when the median filter processing is performed on the sparse area map 615, fine lines and fine points in the sparse area map 615 can be removed, and an erroneous determination area of the sparse area map generated in the contour portion of the subject or the like can be removed. Can be removed.

図6(a)の疎ら度合算出部607は、メディアンフィルタ処理後の疎ら領域マップ616の白の被写体ラベル部分の画素数を計測し、その計測画素数がマップ内の全画素数に対して占める割合を、疎ら度合として算出するような疎ら度合算出処理を行う。そして、疎ら度合算出部607は、算出した疎ら度合609の情報を前述した図3の被写体マップ合成部303へ出力する。なお本実施形態では、疎ら度合を画素数の割合として算出したが、例えば疎ら領域マップの白の被写体ラベル部分の画素数をそのまま疎ら度合の値としても良い。 The sparseness degree calculation unit 607 of FIG. 6A measures the number of pixels of the white subject label portion of the sparse area map 616 after the median filter processing, and the measured pixel number occupies the total number of pixels in the map. The sparseness degree calculation process is performed so that the ratio is calculated as the sparseness degree. Then, the sparseness degree calculation unit 607 outputs the calculated information of the sparseness degree degree 609 to the subject map synthesis unit 303 of FIG. 3 described above. In the present embodiment, the degree of sparseness is calculated as a ratio of the number of pixels, but for example, the number of pixels of the white subject label portion of the sparse area map may be used as the value of the degree of sparseness as it is.

図7は、図6(a)の膨張フィルタ部601の構成例を示した図である。膨張フィルタ部601は、MAXフィルタ部701、MEDIANフィルタ部702、およびMINフィルタ部703を有する。
図8は、図6(a)の収縮フィルタ部602の構成例を示した図である。収縮フィルタ部602は、MINフィルタ部801、MEDIANフィルタ部802、およびMAXフィルタ部803を有する。
これら図7と図8に示されたMAXフィルタ部701と803、MEDIANフィルタ部702と802、MINフィルタ部703と801の各動作を、図9のフローチャートを用いて説明する。なお図9のフローチャートでは、MAXフィルタ、MEDIANフィルタ部、およびMINフィルタ部を区別せずに、単に、フィルタ部と呼ぶ。
FIG. 7 is a diagram showing a configuration example of the expansion filter unit 601 of FIG. 6A. The expansion filter unit 601 includes a MAX filter unit 701, a MEDIAn filter unit 702, and a MIN filter unit 703.
FIG. 8 is a diagram showing a configuration example of the contraction filter unit 602 of FIG. 6A. The contraction filter unit 602 includes a MIN filter unit 801 and a MEDIAn filter unit 802, and a MAX filter unit 803.
The operations of the MAX filter units 701 and 803, the MEDIA filter units 702 and 802, and the MIN filter units 703 and 801 shown in FIGS. 7 and 8 will be described with reference to the flowchart of FIG. In the flowchart of FIG. 9, the MAX filter, the MEDIAn filter unit, and the MIN filter unit are not distinguished and are simply referred to as a filter unit.

ステップS901において、フィルタ部は、図6(a)の入力被写体マップ608の着目画素それぞれについて、その着目画素の周辺画素の値を積算し、その積算値ΣPixと閾値thとを比較する。そして、フィルタ部は、積算値ΣPixが閾値th以上であればステップS902へ処理を進めて白の値(255)を出力し、一方、積算値ΣPixが閾値th未満である場合にはステップS903に処理を進めて黒の値(0)を出力する。 In step S901, the filter unit integrates the values of the peripheral pixels of the pixel of interest for each of the pixels of interest in the input subject map 608 of FIG. 6A, and compares the integrated value ΣPix with the threshold value th. Then, if the integrated value ΣPix is equal to or more than the threshold value th, the process proceeds to step S902 and outputs a white value (255), while if the integrated value ΣPix is less than the threshold value th, the process proceeds to step S903. The process proceeds and the black value (0) is output.

ここで、着目画素に対する周辺画素の範囲(参照範囲とする)が、着目画素を中心として縦横7×7画素の範囲である場合、閾値thを255×1=255とすることで、当該フィルタ部はMAXフィルタ部として動作する。また、閾値thを255×7×7=12495とすることで、当該フィルタ部はMIXフィルタ部として動作する。また、閾値thを255×(7×7/2)=255×(24.5)=255×25=6375とすることで、当該フィルタ部はMEDIANフィルタ部として動作する。 Here, when the range of peripheral pixels (referred to as a reference range) with respect to the pixel of interest is a range of 7 × 7 pixels in the vertical and horizontal directions centered on the pixel of interest, the threshold value th is set to 255 × 1 = 255, so that the filter unit is concerned. Operates as a MAX filter unit. Further, by setting the threshold value th to 255 × 7 × 7 = 12495, the filter unit operates as a MIX filter unit. Further, by setting the threshold value th to 255 × (7 × 7/2) = 255 × (24.5) = 255 × 25 = 6375, the filter unit operates as a median filter unit.

この図9のフローチャートの動作により、図7の膨張フィルタ部601の場合、MAXフィルタ部701では、入力被写体マップ608の白(255)の被写体ラベル部分が一律に膨張し、疎ら領域の黒(0)の非被写体ラベル部分が白で埋まるようになる。その後、MINフィルタ部703により被写体の輪郭部が膨張したところは収縮させて元に戻す。これにより、疎ら領域の黒(0)の非被写体ラベル部分だけを変化させることができる。さらに、MEDIANフィルタ部702により、疎ら領域の黒(0)の非被写体ラベル部分の埋め残しを白(255)で埋める。これにより、後段のMINフィルタ部703の処理で黒(0)の非被写体ラベル部分の埋め残しが再度広がることがない。 Due to the operation of the flowchart of FIG. 9, in the case of the expansion filter unit 601 of FIG. 7, in the MAX filter unit 701, the white (255) subject label portion of the input subject map 608 is uniformly expanded, and the black (0) of the sparse region is uniformly expanded. ) Non-subject label part will be filled with white. After that, the portion where the contour portion of the subject is expanded by the MIN filter unit 703 is contracted and restored. As a result, only the black (0) non-subject label portion in the sparse region can be changed. Further, the median filter unit 702 fills the unfilled portion of the black (0) non-subject label portion in the sparse region with white (255). As a result, the unfilled portion of the black (0) non-subject label portion does not spread again in the processing of the MIN filter unit 703 in the subsequent stage.

また図8の収縮フィルタ部602の場合、MINフィルタ部801では、入力被写体マップ608の白(255)の部分が一律に収縮し、疎ら領域の白の被写体ラベル部分が黒(0)で埋まる。その後、MAXフィルタ部803により被写体輪郭部が収縮したところは膨張させて元に戻す。これにより、疎ら領域の白部分だけを変化させることができる。さらにMEDIANフィルタ部802により、疎ら領域の白の被写体ラベル部分の埋め残しを黒で埋めることで、後段のMAXフィルタ部803の処理で白部分の埋め残しが再度広がることがない。 Further, in the case of the contraction filter unit 602 of FIG. 8, in the MIN filter unit 801 the white (255) portion of the input subject map 608 is uniformly contracted, and the white subject label portion of the sparse region is filled with black (0). After that, the part where the subject contour portion is contracted by the MAX filter unit 803 is expanded and restored. As a result, only the white portion of the sparse region can be changed. Further, the median filter unit 802 fills the unfilled portion of the white subject label portion in the sparse region with black, so that the unfilled portion of the white portion does not spread again in the processing of the MAX filter unit 803 in the subsequent stage.

図10は、図1のデジタルカメラ100において、静止画撮影が行われる場合の制御部101の動作を説明するためのフローチャートである。
ステップS1001の処理として、制御部101は、不図示のシャッターボタンがいわゆる半押し状態(SW1オン)になるまで、表示部109にEVF映像を表示させるEVF撮像制御を行う。
FIG. 10 is a flowchart for explaining the operation of the control unit 101 when still image shooting is performed in the digital camera 100 of FIG.
As a process of step S1001, the control unit 101 performs EVF imaging control for displaying the EVF image on the display unit 109 until the shutter button (not shown) is in a so-called half-pressed state (SW1 is on).

次にステップS1002において、制御部101は、シャッターボタンが半押し状態(SW1オン)であるか否かを判定する。制御部101は、半押し状態(SW1オン)でないと判定した場合にはステップS1001に処理を戻し、一方、ユーザにてシャッターボタンが操作されることで半押し状態(SW1オン)になっていると判定した場合にはステップS1003に処理を進める。 Next, in step S1002, the control unit 101 determines whether or not the shutter button is in the half-pressed state (SW1 on). When the control unit 101 determines that it is not in the half-pressed state (SW1 on), the process returns to step S1001, while the shutter button is operated by the user to enter the half-pressed state (SW1 on). If it is determined, the process proceeds to step S1003.

ステップS1003に進むと、制御部101は、光学系104のフォーカスレンズを駆動制御するオートフォーカス(AF)処理を行って、被写体にフォーカスを合わせるようにする。 Proceeding to step S1003, the control unit 101 performs an autofocus (AF) process for driving and controlling the focus lens of the optical system 104 to focus on the subject.

次にステップS1004において、制御部101は、シャッターボタンがいわゆる全押し状態(SW2オン)であるか否かを判定する。制御部101は、全押し状態(SW2オン)でないと判定した場合にはステップS1001に処理を戻し、一方、全押し状態(SW2オン)になっていると判定した場合にはステップS1005に処理を進める。 Next, in step S1004, the control unit 101 determines whether or not the shutter button is in the so-called fully pressed state (SW2 on). When the control unit 101 determines that it is not in the fully pressed state (SW2 on), it returns the process to step S1001, while when it determines that it is in the fully pressed state (SW2 on), it performs the process in step S1005. Proceed.

ステップS1005に進むと、制御部101は、各部を制御して静止画を撮像させる。
その後、ステップS1006に進むと、制御部101は、画像処理部107を制御して本実施形態に係る補正処理を含む画像処理を行わせる。画像処理部107における補正処理は、前述の図3等を用いて説明したような補正処理であり、例えばライティング補正、シャープネス調整、背景ぼかし、背景コントラスト調整などの何れか若しくは二つ以上を組み合わせた補正処理である。
When the process proceeds to step S1005, the control unit 101 controls each unit to capture a still image.
After that, when the process proceeds to step S1006, the control unit 101 controls the image processing unit 107 to perform image processing including the correction processing according to the present embodiment. The correction process in the image processing unit 107 is a correction process as described with reference to FIG. 3 and the like described above, and is a combination of any or two or more of, for example, lighting correction, sharpness adjustment, background blurring, and background contrast adjustment. This is a correction process.

なお図10のフローチャートの例では、撮像された静止画のみに補正処理を施す例を挙げたが、この例に限定されるものではない。例えば、EVF撮像中に補正処理を行ってもよい。EVF撮像中に補正処理を行うと、ユーザは記録される静止画の仕上がり具合を、EVF映像を見ることで事前に確認しながら、レリーズを切ることができ、利便性が高い。 In the example of the flowchart of FIG. 10, an example in which correction processing is performed only on the captured still image is given, but the present invention is not limited to this example. For example, correction processing may be performed during EVF imaging. If the correction process is performed during the EVF imaging, the user can release the recorded still image while checking the finish condition of the recorded still image in advance by viewing the EVF image, which is highly convenient.

また前述した実施形態の説明では、被写体マップの疎ら領域の黒(非被写体ラベル)部分と白(被写体ラベル)部分をそれぞれ検出して統合することで疎ら領域を検出する構成としたが、これに限定されるものではない。例えば、図3に示した疎ら判定部302は、図11(a)のような構成であっても良い。なお、図11の構成例において、膨張フィルタ部601、収縮フィルタ部602、MEDIANフィルタ部606、疎ら度合算出部607、被写体マップ608、疎ら度合609は、図6と同様であるためそれらの説明は省略する。 Further, in the description of the above-described embodiment, the sparse region is detected by detecting and integrating the black (non-subject label) portion and the white (subject label) portion of the sparse region of the subject map. It is not limited. For example, the sparseness determination unit 302 shown in FIG. 3 may have a configuration as shown in FIG. 11 (a). In the configuration example of FIG. 11, the expansion filter unit 601, the contraction filter unit 602, the median filter unit 606, the sparseness degree calculation unit 607, the subject map 608, and the sparseness degree degree 609 are the same as those in FIG. Omit.

図11の構成の疎ら判定部302において、膨張フィルタ部601からは前述の図6(b)に示した膨張後被写体マップ611が出力され、収縮フィルタ部602からは前述の図6(c)に示した収縮後被写体マップ612が出力される。これら膨張後被写体マップ611と収縮後被写体マップ612は、差分検出部1105に入力される。 In the sparseness determination unit 302 having the configuration of FIG. 11, the expansion filter unit 601 outputs the post-expansion subject map 611 shown in FIG. 6 (b), and the contraction filter unit 602 displays the above-mentioned FIG. 6 (c). After the contraction shown, the subject map 612 is output. The expanded subject map 611 and the contracted subject map 612 are input to the difference detection unit 1105.

差分検出部1105は、前述した式(2)と同様の演算を行って、それら膨張後被写体マップ611と収縮後被写体マップ612との差分を検出する。差分検出部1105による差分検出処理の結果、前述の図6(f)に示したのと同様の疎ら領域マップ615が生成される。図11の構成例の場合、差分検出部1105による差分検出処理結果のマップは第3の疎ら領域マップに相当する。 The difference detection unit 1105 performs the same calculation as the above-mentioned equation (2) to detect the difference between the expanded subject map 611 and the contracted subject map 612. As a result of the difference detection process by the difference detection unit 1105, a sparse region map 615 similar to that shown in FIG. 6 (f) described above is generated. In the case of the configuration example of FIG. 11, the map of the difference detection processing result by the difference detection unit 1105 corresponds to the third sparse area map.

MEDIANフィルタ部606では、疎ら領域マップ615の被写体輪郭部などの誤検出を排除して、前述の図6(g)と同様の疎ら領域マップ616を出力する。
図11の構成例の場合、被写体マップの差分検出処理およびマップ統合処理のための構成及び演算を減らすことができる。
The median filter unit 606 eliminates erroneous detection of the subject contour portion of the sparse area map 615 and outputs the sparse area map 616 similar to FIG. 6 (g) described above.
In the case of the configuration example of FIG. 11, the configuration and calculation for the difference detection process and the map integration process of the subject map can be reduced.

以上説明したように、本実施形態によれば、例えば被写体領域ごとに適応的に画像補正や画像効果を適用する画像処理装置において、被写体領域抽出精度不足によるアーティファクト発生を抑圧することが可能である。 As described above, according to the present embodiment, for example, in an image processing device that adaptively applies image correction and image effects to each subject area, it is possible to suppress the occurrence of artifacts due to insufficient subject area extraction accuracy. ..

前述した本実施形態では、MAXフィルタ部やMINフィルタ部などの空間フィルタで疎ら領域が変化するのを検出して疎ら度合を算出する構成としたが、これに限定されるものではない。例えば、被写体マップを縦や横に走査して白の被写体ラベルと黒の非被写体ラベルとがトグルするようなトグル回数を数えて疎ら度合を算出するようにしても良い。また白(被写体ラベル)と黒(非被写体ラベル)とがトグルする回数が多い領域について、白から黒へ変化したときに白が持続した幅を疎ら領域の白部分の数とし、黒から白へ変化した時に黒が持続した幅を疎ら領域の黒部分の数としてカウントしても良い。このように構成することで、空間フィルタを使うよりも演算コストを軽くすることができる。 In the above-described embodiment, the spatial filter such as the MAX filter unit and the MIN filter unit detects the change in the sparse region and calculates the degree of sparseness, but the present invention is not limited to this. For example, the degree of sparseness may be calculated by scanning the subject map vertically or horizontally and counting the number of times the white subject label and the black non-subject label are toggled. Also, for areas where white (subject label) and black (non-subject label) are frequently toggled, the width at which white persists when changing from white to black is defined as the number of white areas in the sparse area, and from black to white. The width in which black lasts when it changes may be counted as the number of black portions in the sparse region. With this configuration, the calculation cost can be reduced as compared with the use of a spatial filter.

また例えば、離散フーリエ変換(FFT)や離散コサイン変換(DCT)を用いて、被写体マップの疎ら領域に対応する周波数帯域を解析することで疎ら度合を算出するようにしても良い。すなわち疎ら判定部302は、評価値マップを用いて抽出した被写体マップを周波数領域に変換する周波数領域変換処理を行って周波数領域マップを生成し、その周波数領域マップに基づいて疎ら度合を算出する。この例の場合、疎ら判定部302は、予め疎ら周波数範囲が決定されており、被写体マップを小ブロックごとに分けて周波数変換処理した周波数領域マップの小ブロックごとに、その疎ら周波数範囲で所定の閾値以上の応答を示しているか否かを判定する。そして、疎ら判定部302は、所定以上の応答を示している小ブロックの数に応じて疎ら度合を算出する。より具体的に説明すると、疎ら判定部302は、被写体マップに対し、例えば8×8画素のブロックごとにFFT処理を実施して、疎ら領域に対応する周波数応答が閾値より高いブロックのブロック数を数え、それらのブロックの割合を疎ら度合とする。このように構成することで、空間フィルタを使うよりもきめ細かく疎ら領域の周波数帯域を決めることができる。 Further, for example, the degree of sparseness may be calculated by analyzing the frequency band corresponding to the sparse region of the subject map by using the discrete Fourier transform (FFT) or the discrete cosine transform (DCT). That is, the sparseness determination unit 302 performs frequency domain conversion processing for converting the subject map extracted using the evaluation value map into a frequency domain to generate a frequency domain map, and calculates the degree of sparseness based on the frequency domain map. In the case of this example, the sparseness determination unit 302 has a sparse frequency range determined in advance, and the subject map is divided into small blocks and frequency conversion processing is performed for each small block of the frequency domain map. It is determined whether or not the response is equal to or higher than the threshold value. Then, the sparseness determination unit 302 calculates the degree of sparseness according to the number of small blocks showing a response equal to or greater than a predetermined value. More specifically, the sparseness determination unit 302 performs FFT processing on the subject map, for example, for each block of 8 × 8 pixels, and determines the number of blocks of blocks having a frequency response higher than the threshold value corresponding to the sparse area. Count and let the percentage of those blocks be the degree of sparseness. With this configuration, the frequency band in the sparse region can be determined more finely than using a spatial filter.

また本実施形態では、評価値分布として位相差分布(例えばデフォーカス量分布によるピント分布)を用いているが、これに限定されるものではない。評価値分布は、例えば、A像とB像のずれ量(つまり視差)を表すシフト量の分布であっても良い。なおシフト量は、検出ピッチ(同一種類の画素の配置ピッチ)をかけてマイクロメートルなどの長さの単位で表しても良い。また例えば、評価値分布は、デフォーカス量を焦点深度(2Fδもしくは1Fδ。Fは絞り値、δは許容錯乱円径)で正規化した値の分布であっても良い。なお、絞り値Fは像高中央付近の絞り値を代表値として全面固定値としても良いし、光学系104のケラレで周辺像高の絞り値が暗くなるのを加味した絞り値分布を適用するようにしても良い。 Further, in the present embodiment, the phase difference distribution (for example, the focus distribution based on the defocus amount distribution) is used as the evaluation value distribution, but the present invention is not limited to this. The evaluation value distribution may be, for example, a distribution of a shift amount representing the amount of deviation (that is, parallax) between the A image and the B image. The shift amount may be expressed in units of length such as micrometer by multiplying the detection pitch (arrangement pitch of pixels of the same type). Further, for example, the evaluation value distribution may be a distribution of values obtained by normalizing the defocus amount with the depth of focus (2Fδ or 1Fδ. F is the aperture value and δ is the permissible circle of confusion diameter). The aperture value F may be a fixed value on the entire surface with the aperture value near the center of the image height as a representative value, or an aperture value distribution that takes into account that the aperture value of the peripheral image height becomes dark due to the eclipse of the optical system 104 is applied. You may do so.

また本実施形態では、画像のピント情報分布、例えば位相差測距方式によるデフォーカス量分布を、評価値マップとして取得する例を挙げたが、これに限定されるものではない。例えば、評価値マップは、コントラスト測距方式による被写体距離つまりフォーカス位置を逐次異ならせて得られる画像群から取得されるコントラスト情報分布に基づいて生成されても良い。また例えば、評価値マップは、像面側のデフォーカス量を物体面側の距離値に変換した距離情報分布に基づいて生成されても良い。また距離情報分布を取得する際の測距の方式は、位相差測距方式、コントラスト測距方式あるいは画像特徴に基づくパッシブ方式に限定されない。例えば、測距の方式は、TOF(Time Of Flight)方式やストロボ反射光の有無を比較するようなアクティブ方式が用いられてもよい。さらには被写体距離によらない方式でも良く、例えば動きベクトル分布をマップ化したオプティカルフロー、色情報を基にラベリングした色ラベルマップ、機械学習に基づいた意味的領域分割などに基づいて被写体マップが生成されてもよい。意味的領域分割を利用する場合は、代替シルエットはそれ以外の方式を用いる必要があるが、人型の固定形状マップを用いるなど、シーン変化によりロバストな方式を選択するようにすればよい。すなわち、記評価値マップは、画像のピント情報分布、距離情報分布、動きベクトル情報分布、色ラベリング情報分布、もしくは機械学習による意味的領域分割の、少なくともいずれかを基に生成されてもよい。 Further, in the present embodiment, an example of acquiring the focus information distribution of an image, for example, the defocus amount distribution by the phase difference distance measurement method as an evaluation value map has been given, but the present invention is not limited to this. For example, the evaluation value map may be generated based on the contrast information distribution acquired from the image group obtained by sequentially changing the subject distance, that is, the focus position by the contrast ranging method. Further, for example, the evaluation value map may be generated based on the distance information distribution obtained by converting the defocus amount on the image plane side into the distance value on the object plane side. Further, the distance measurement method for acquiring the distance information distribution is not limited to the phase difference distance measurement method, the contrast distance measurement method, or the passive method based on image features. For example, as the distance measuring method, a TOF (Time Of Flight) method or an active method for comparing the presence or absence of strobe reflected light may be used. Furthermore, a method that does not depend on the subject distance may be used. For example, a subject map is generated based on an optical flow that maps a motion vector distribution, a color label map that is labeled based on color information, and a semantic region division based on machine learning. May be done. When using semantic region division, it is necessary to use another method for the alternative silhouette, but it is sufficient to select a robust method depending on the scene change, such as using a humanoid fixed shape map. That is, the evaluation value map may be generated based on at least one of the focus information distribution, the distance information distribution, the motion vector information distribution, the color labeling information distribution, and the semantic region division by machine learning of the image.

本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける一つ以上のプロセッサがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
上述の実施形態は、何れも本発明を実施するにあたっての具体化の例を示したものに過ぎず、これらによって本発明の技術的範囲が限定的に解釈されてはならないものである。すなわち、本発明は、その技術思想、又はその主要な特徴から逸脱することなく、様々な形で実施することができる。
The present invention supplies a program that realizes one or more functions of the above-described embodiment to a system or device via a network or storage medium, and one or more processors in the computer of the system or device reads and executes the program. It can also be realized by the processing to be performed. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.
The above-described embodiments are merely examples of embodiment of the present invention, and the technical scope of the present invention should not be construed in a limited manner by these. That is, the present invention can be implemented in various forms without departing from the technical idea or its main features.

100:デジタルカメラ、101:制御部、107:画像処理部、110:ピントマップ処理部、301:被写体領域抽出部、302:疎ら判定部、303:被写体マップ合成部、304:加算部、305:補正処理部 100: Digital camera, 101: Control unit, 107: Image processing unit, 110: Focus map processing unit, 301: Subject area extraction unit, 302: Sparseness determination unit, 303: Subject map composition unit, 304: Addition unit, 305: Correction processing unit

Claims (15)

画像に対応した評価値分布を評価値マップとして取得するマップ取得手段と、
前記評価値マップを用いて前記画像から抽出した被写体領域に基づく第1の被写体マップを生成するマップ生成手段と、
前記第1の被写体マップに含まれる疎ら領域の度合を表す、疎ら度合を取得する度合取得手段と、
前記第1の被写体マップと、前記評価値マップを用いずに生成された第2の被写体マップとの、少なくともいずれかを用いて前記画像に補正処理を行う補正手段と、を有し、
前記補正手段は、前記疎ら度合が高いほど前記第1の被写体マップよりも前記第2の被写体マップを優先的に用いて、前記補正処理を行うことを特徴とする画像処理装置。
A map acquisition method that acquires the evaluation value distribution corresponding to the image as an evaluation value map,
A map generation means for generating a first subject map based on a subject area extracted from the image using the evaluation value map, and a map generation means.
A degree acquisition means for acquiring the degree of sparseness, which represents the degree of the sparse area included in the first subject map, and
It has a correction means for performing correction processing on the image using at least one of the first subject map and the second subject map generated without using the evaluation value map.
The image processing apparatus is characterized in that the correction processing is performed by preferentially using the second subject map over the first subject map as the degree of sparseness increases.
前記マップ生成手段は、被写体領域を表す被写体ラベルと非被写体を表す非被写体ラベルとの、少なくとも二つのラベル領域にクラス分けした、前記第1の被写体マップを生成し、
前記度合取得手段は、
前記第1の被写体マップに対する所定の処理によって前記被写体ラベルが疎らに分布している領域を変化させた第3の被写体マップを生成し、
前記第1の被写体マップに対する所定の処理によって前記非被写体ラベルが疎らに分布している領域を変化させた第4の被写体マップを生成し、
前記第3の被写体マップと前記第4の被写体マップとの、少なくともいずれかに基づいて、前記疎ら度合を算出することを特徴とする請求項1に記載の画像処理装置。
The map generation means generates the first subject map classified into at least two label areas, that is, a subject label representing a subject area and a non-subject label representing a non-subject.
The degree acquisition means
A third subject map in which the region where the subject labels are sparsely distributed is changed by a predetermined process on the first subject map is generated.
A fourth subject map in which the region where the non-subject labels are sparsely distributed is changed by a predetermined process on the first subject map is generated.
The image processing apparatus according to claim 1, wherein the degree of sparseness is calculated based on at least one of the third subject map and the fourth subject map.
前記度合取得手段は、
前記第1の被写体マップと前記第3の被写体マップとを基に第1の疎ら領域マップを生成し、
前記第1の被写体マップと前記第4の被写体マップとを基に第2の疎ら領域マップを生成して、
前記第1の疎ら領域マップと前記第2の疎ら領域マップとの、少なくともいずれかに基づいて、前記疎ら度合を算出することを特徴とする請求項2に記載の画像処理装置。
The degree acquisition means
A first sparse area map is generated based on the first subject map and the third subject map.
A second sparse area map is generated based on the first subject map and the fourth subject map.
The image processing apparatus according to claim 2, wherein the degree of sparseness is calculated based on at least one of the first sparse area map and the second sparse area map.
前記度合取得手段は、前記第3の被写体マップと前記第4の被写体マップとを基に第3の疎ら領域マップを生成し、前記第3の疎ら領域マップに基づいて前記疎ら度合を算出することを特徴とする請求項2に記載の画像処理装置。 The degree acquisition means generates a third sparse area map based on the third subject map and the fourth subject map, and calculates the degree of sparseness based on the third sparse area map. The image processing apparatus according to claim 2. 前記第3の被写体マップを生成する際の前記所定の処理は、前記被写体ラベルのラベル領域を収縮させた後、少なくとも前記被写体ラベルのラベル領域を膨張させるフィルタ処理を含むことを特徴とする請求項2から請求項4のいずれか1項に記載の画像処理装置。 The predetermined process for generating the third subject map includes a filter process for contracting the label area of the subject label and then expanding at least the label area of the subject label. The image processing apparatus according to any one of claims 2 to 4. 前記第4の被写体マップを生成する際の前記所定の処理は、前記非被写体ラベルのラベル領域を収縮させた後、少なくとも前記非被写体ラベルのラベル領域を膨張させるフィルタ処理を含むことを特徴とする請求項2から請求項4のいずれか1項に記載の画像処理装置。 The predetermined process for generating the fourth subject map is characterized by including a filter process of shrinking the label area of the non-subject label and then expanding at least the label area of the non-subject label. The image processing apparatus according to any one of claims 2 to 4. 前記度合取得手段は、前記疎ら領域マップに対して孤立領域を除去する孤立領域除去処理をも行うことを特徴とする請求項3から請求項6のいずれか1項に記載の画像処理装置。 The image processing apparatus according to any one of claims 3 to 6, wherein the degree acquisition means also performs an isolated area removing process for removing an isolated area from the sparse area map. 前記マップ生成手段は、被写体領域を表す被写体ラベルと非被写体を表す非被写体ラベルとの、少なくとも二つのラベル領域にクラス分けした、前記第1の被写体マップを生成し、
前記度合取得手段は、前記被写体ラベルと前記非被写体ラベルとがトグルする回数に基づいて前記疎ら度合を算出することを特徴とする請求項1に記載の画像処理装置。
The map generation means generates the first subject map classified into at least two label areas, that is, a subject label representing a subject area and a non-subject label representing a non-subject.
The image processing apparatus according to claim 1, wherein the degree acquisition means calculates the degree of sparseness based on the number of times the subject label and the non-subject label toggle.
前記度合取得手段は、前記第1の被写体マップを周波数領域に変換して周波数領域マップを生成し、前記周波数領域マップに基づいて前記疎ら度合を算出することを特徴とする請求項1に記載の画像処理装置。 The first aspect of claim 1, wherein the degree acquisition means converts the first subject map into a frequency domain to generate a frequency domain map, and calculates the sparseness based on the frequency domain map. Image processing device. 前記度合取得手段は、前記第1の被写体マップを小ブロックごとに周波数領域に変換して周波数領域マップを生成し、前記周波数領域マップの小ブロックごとに、予め決定された疎ら周波数範囲で所定の閾値以上の応答を示しているか否かを判定し、所定の閾値以上の応答を示している小ブロックの数に応じて、前記疎ら度合を算出することを特徴とする請求項9に記載の画像処理装置。 The degree acquisition means converts the first subject map into a frequency domain for each small block to generate a frequency domain map, and determines a predetermined sparse frequency range for each small block of the frequency domain map. The image according to claim 9, wherein it is determined whether or not the response is equal to or higher than the threshold value, and the degree of sparseness is calculated according to the number of small blocks showing the response equal to or higher than a predetermined threshold value. Processing equipment. 前記評価値マップは、前記画像のピント情報分布と、距離情報分布と、動きベクトル情報分布と、色ラベリング情報分布と、機械学習による意味的領域分割との、いずれかを含むことを特徴とする請求項1から請求項10のいずれか1項に記載の画像処理装置。 The evaluation value map is characterized by including one of a focus information distribution, a distance information distribution, a motion vector information distribution, a color labeling information distribution, and a semantic region division by machine learning of the image. The image processing apparatus according to any one of claims 1 to 10. 前記ピント情報分布は、視点の異なる画像群から取得される視差情報分布、もしくはフォーカス位置を逐次異ならせて得られた画像群から取得されるコントラスト情報分布であることを特徴とする請求項11に記載の画像処理装置。 The eleventh aspect of claim 11 is characterized in that the focus information distribution is a parallax information distribution acquired from image groups having different viewpoints, or a contrast information distribution acquired from image groups obtained by sequentially changing the focus positions. The image processing apparatus described. 前記視差情報分布は、視差を表すシフト量に基づいたマップ、デフォーカス量に基づいたマップ、もしくは距離値に基づいたマップの、いずれかを含むことを特徴とする請求項12に記載の画像処理装置。 The image processing according to claim 12, wherein the parallax information distribution includes one of a map based on a shift amount representing parallax, a map based on a defocus amount, and a map based on a distance value. Device. 画像処理装置が実行する画像処理方法であって、
画像に対応した評価値分布を評価値マップとして取得するマップ取得工程と、
前記評価値マップを用いて前記画像から抽出した被写体領域に基づく第1の被写体マップを生成するマップ生成工程と、
前記第1の被写体マップに含まれる疎ら領域の度合を表す、疎ら度合を取得する度合取得工程と、
前記第1の被写体マップと、前記評価値マップを用いずに生成された第2の被写体マップとの、少なくともいずれかを用いて前記画像に補正処理を行う補正工程と、を有し、
前記補正工程では、前記疎ら度合が高いほど前記第1の被写体マップよりも前記第2の被写体マップを優先的に用いて、前記補正処理を行うことを特徴とする画像処理方法。
An image processing method executed by an image processing device.
A map acquisition process that acquires the evaluation value distribution corresponding to the image as an evaluation value map, and
A map generation step of generating a first subject map based on a subject area extracted from the image using the evaluation value map, and a map generation step.
A degree acquisition step for acquiring the degree of sparseness, which represents the degree of the sparse area included in the first subject map, and
It has a correction step of performing correction processing on the image using at least one of the first subject map and the second subject map generated without using the evaluation value map.
The image processing method is characterized in that, in the correction step, the correction processing is performed by preferentially using the second subject map over the first subject map as the degree of sparseness increases.
コンピュータを、請求項1から請求項13のいずれか1項に記載の画像処理装置が有する各手段として機能させるためのプログラム。 A program for causing a computer to function as each means included in the image processing apparatus according to any one of claims 1 to 13.
JP2020063880A 2020-03-31 2020-03-31 Image processing device, image processing method, and program Active JP7451264B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2020063880A JP7451264B2 (en) 2020-03-31 2020-03-31 Image processing device, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2020063880A JP7451264B2 (en) 2020-03-31 2020-03-31 Image processing device, image processing method, and program

Publications (2)

Publication Number Publication Date
JP2021164063A true JP2021164063A (en) 2021-10-11
JP7451264B2 JP7451264B2 (en) 2024-03-18

Family

ID=78005204

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020063880A Active JP7451264B2 (en) 2020-03-31 2020-03-31 Image processing device, image processing method, and program

Country Status (1)

Country Link
JP (1) JP7451264B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5980294B2 (en) 2014-10-27 2016-08-31 キヤノン株式会社 Data processing apparatus, imaging apparatus, and data processing method
JP2017054337A (en) 2015-09-10 2017-03-16 ソニー株式会社 Image processor and method
JP2017130106A (en) 2016-01-21 2017-07-27 キヤノン株式会社 Data processing apparatus, imaging apparatus and data processing method

Also Published As

Publication number Publication date
JP7451264B2 (en) 2024-03-18

Similar Documents

Publication Publication Date Title
JP5226600B2 (en) Image deformation apparatus and operation control method thereof
CN109255810B (en) Image processing apparatus and image processing method
JP5968073B2 (en) Image processing apparatus, imaging apparatus, image processing method, and image processing program
JP2015035658A (en) Image processing apparatus, image processing method, and imaging apparatus
JP5374119B2 (en) Distance information acquisition device, imaging device, and program
JP6833415B2 (en) Image processing equipment, image processing methods, and programs
JP2011135563A (en) Image capturing apparatus, and image processing method
JP2012124555A (en) Imaging apparatus
KR20160000422A (en) Image pickup apparatus, control apparatus, control method, and storage medium
JP2010263423A (en) Method and device for processing image
JP4145308B2 (en) Image stabilizer
US11080873B2 (en) Image processing apparatus, image capturing apparatus, image processing method, and storage medium
JP6604908B2 (en) Image processing apparatus, control method thereof, and control program
JP2016144042A (en) Image processing apparatus, image processing method, and program
US20180033127A1 (en) Image processing apparatus, image processing method, and computer readable storage medium
JP2019047336A (en) Image processing apparatus, imaging device, image processing method, and program
JP2015207090A (en) Image processor, and control method thereof
JP7451264B2 (en) Image processing device, image processing method, and program
JP5115297B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
JP7373297B2 (en) Image processing device, image processing method and program
JP6537228B2 (en) Image processing apparatus, imaging apparatus, image processing method, image processing program, and storage medium
JP2008058279A (en) Apparatus and method for forming range image, and program
JP2014131188A (en) Imaging apparatus, control method of the same, and control program
JP7437915B2 (en) Image processing device, imaging device, image processing method, and program
JP6029464B2 (en) Imaging device, control method thereof, and control program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20230327

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20240131

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20240206

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20240306

R151 Written notification of patent or utility model registration

Ref document number: 7451264

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151