JP7373297B2 - Image processing device, image processing method and program - Google Patents

Image processing device, image processing method and program Download PDF

Info

Publication number
JP7373297B2
JP7373297B2 JP2019084430A JP2019084430A JP7373297B2 JP 7373297 B2 JP7373297 B2 JP 7373297B2 JP 2019084430 A JP2019084430 A JP 2019084430A JP 2019084430 A JP2019084430 A JP 2019084430A JP 7373297 B2 JP7373297 B2 JP 7373297B2
Authority
JP
Japan
Prior art keywords
subject
image
area
image processing
captured image
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.)
Active
Application number
JP2019084430A
Other languages
Japanese (ja)
Other versions
JP2020181401A (en
Inventor
貴志 佐々木
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 JP2019084430A priority Critical patent/JP7373297B2/en
Publication of JP2020181401A publication Critical patent/JP2020181401A/en
Application granted granted Critical
Publication of JP7373297B2 publication Critical patent/JP7373297B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、画像処理装置、画像処理方法及びプログラムに関し、特に画像中の所望の被写体の領域を好適に抽出する技術に関する。 The present invention relates to an image processing device, an image processing method, and a program, and particularly relates to a technique for suitably extracting a desired subject area from an image.

撮像した画像に含まれる画素群を、該画素の像のデフォーカス量で分類し、特定のデフォーカス範囲に属する画素に対して画像処理を適用することで、異なる被写界深度の表現を示す画像を生成する技術がある(特許文献1)。 By classifying a group of pixels included in a captured image by the amount of defocus of the image of the pixel and applying image processing to pixels belonging to a specific defocus range, different depths of field can be expressed. There is a technique for generating images (Patent Document 1).

特開2008-015754号公報Japanese Patent Application Publication No. 2008-015754

ところで、印象的な画像表現の1つとして、注目したい被写体の距離範囲にのみ合焦し、その他の領域がボケた状態となっている、所謂、被写界深度の浅い表現がある。特許文献1の技術でも、所望の被写体の含まれる領域のデフォーカス範囲以外の画素に対してボケ付加処理を行うことで、同様の表現の画像を生成することができる。 By the way, one of the impressive image expressions is a so-called shallow depth of field expression in which only the distance range of the object of interest is focused, and other areas are blurred. The technique disclosed in Patent Document 1 also makes it possible to generate an image with a similar expression by performing blurring processing on pixels outside the defocus range of a region including a desired subject.

しかしながら、特許文献1のようにデフォーカス量で画素を特定して処理を行う方式では、被写体の分布によっては、所望の表現の画像が生成されない可能性がある。例えば、所望の被写体とは異なる被写体が、所望の被写体の被写体距離を含む、奥行き方向に拡がった距離範囲に配置されているような分布では、上述の画像処理を行った場合に、特許文献1の方式ではこれらの被写体を分離して特定することができない。即ち、例えば被写界深度の浅い表現の画像を生成しようとした場合に、所望の被写体だけでなく、該異なる被写体も含んだ距離範囲も合焦した状態で画像に現れることになり、好適な表現が実現されない可能性がある。 However, in the method disclosed in Patent Document 1, in which pixels are specified and processed based on the amount of defocus, an image with a desired expression may not be generated depending on the distribution of the subject. For example, in a distribution in which a subject different from the desired subject is arranged in a distance range that extends in the depth direction and includes the subject distance of the desired subject, when the above-mentioned image processing is performed, Patent Document 1 With this method, it is not possible to separate and identify these objects. That is, for example, when trying to generate an image with a shallow depth of field, not only the desired subject but also the distance range including the different subjects will appear in the image in a focused state, which is a preferable method. The expression may not be realized.

本発明は、上述の問題点に鑑みてなされたものであり、注目の被写体の領域を被写体の距離分布に基づいて好適に抽出する画像処理装置、画像処理方法及びプログラムを提供することを目的とする。 The present invention has been made in view of the above-mentioned problems, and an object of the present invention is to provide an image processing device, an image processing method, and a program that suitably extract a region of a subject of interest based on the distance distribution of the subject. do.

前述の目的を達成するために、本発明の画像処理装置は、撮像範囲の被写体を撮像した撮像画像と、該撮像画像と対応する領域についての、撮像範囲における被写体の奥行き方向の距離分布を示す値を格納した距離情報と、を取得する取得手段と、撮像画像について注目被写体を決定する決定手段と、撮像画像における注目被写体の位置に基づいて、距離分布を解析する解析領域を設定する設定手段と、距離情報のうちの解析領域に含まれる値の頻度分布に基づいて、該解析領域に含まれる被写体が分布する値範囲を特定する特定手段と、値範囲に含まれる情報を示す距離情報の領域を抽出することで、少なくとも注目被写体を含む被写体領域を抽出する抽出手段と、を有することを特徴とする。 In order to achieve the above-mentioned object, the image processing device of the present invention shows a distance distribution in the depth direction of the subject in the imaging range for a captured image of a subject in the imaging range and a region corresponding to the captured image. an acquisition means for acquiring distance information storing a value; a determining means for determining a subject of interest in the captured image; and a setting means for setting an analysis region for analyzing distance distribution based on the position of the subject of interest in the captured image. and identifying means for specifying a value range in which objects included in the analysis area are distributed based on the frequency distribution of values included in the analysis area of the distance information, and distance information indicating information included in the value range. The present invention is characterized by comprising an extraction means for extracting a subject area including at least a subject of interest by extracting a region.

このような構成により本発明によれば、注目の被写体の領域を被写体の距離分布に基づいて好適に抽出することが可能となる。 With such a configuration, according to the present invention, it is possible to suitably extract the region of the subject of interest based on the distance distribution of the subject.

本発明の実施形態及び変形例に係るデジタルカメラ100の機能構成を示したブロック図A block diagram showing the functional configuration of a digital camera 100 according to an embodiment and a modification of the present invention 本発明の実施形態及び変形例に係る撮像部105が備える撮像素子の構成を示した図A diagram showing the configuration of an image sensor included in the image capture unit 105 according to an embodiment and a modification of the present invention. 本発明の実施形態及び変形例に係る画像処理部107の構成を説明するためのブロック図A block diagram for explaining the configuration of the image processing unit 107 according to the embodiment and modification of the present invention 本発明の実施形態及び変形例に係るデジタルカメラ100で実行される画像加工処理を例示したフローチャートFlowchart illustrating image processing processing executed by the digital camera 100 according to the embodiment and modification of the present invention 本発明の実施形態で例示する撮像範囲の被写体分布を説明するための図Diagram for explaining subject distribution in an imaging range illustrated in an embodiment of the present invention 本発明の実施形態及び変形例に係るデフォーカス量の導出を説明するための図Diagram for explaining derivation of defocus amount according to embodiments and modified examples of the present invention 本発明の実施形態及び変形例に係るデフォーカス量の導出を説明するための別の図Another diagram for explaining derivation of the defocus amount according to the embodiment and modification of the present invention 本発明の実施形態に係るデフォーカスマップを例示した図A diagram illustrating a defocus map according to an embodiment of the present invention 従来技術に係るデフォーカスマップの全域について構成されたヒストグラムを例示した図A diagram illustrating a histogram constructed for the entire area of a defocus map according to conventional technology 従来技術に係る、所定のデフォーカス範囲の領域の抽出を説明するための図A diagram for explaining extraction of a region within a predetermined defocus range according to conventional technology 本発明の実施形態に係る注目被写体についてヒストグラムを構成する解析領域を説明するための図A diagram for explaining an analysis region forming a histogram for a subject of interest according to an embodiment of the present invention 本発明の実施形態に係る注目被写体に対応する領域について構成されたヒストグラムを例示した図A diagram illustrating a histogram constructed for a region corresponding to a subject of interest according to an embodiment of the present invention 本発明の実施形態に係るヒストグラムに基づいて抽出される領域を説明するための図Diagram for explaining regions extracted based on a histogram according to an embodiment of the present invention 本発明の実施形態に係るヒストグラムに基づいて抽出される領域を説明するための別の図Another diagram for explaining regions extracted based on a histogram according to an embodiment of the present invention 本発明の変形例に係る注目被写体についてヒストグラムを構成する領域を説明するための図Diagram for explaining regions forming a histogram for a subject of interest according to a modification of the present invention 本発明の実施形態に係る処理負荷の低いヒストグラムの構成について説明するための図Diagram for explaining the configuration of a histogram with low processing load according to an embodiment of the present invention 本発明の実施形態に係る処理負荷の低いヒストグラムの構成について説明するための別の図Another diagram for explaining the configuration of a histogram with a low processing load according to an embodiment of the present invention 本発明の実施形態に係る処理負荷の低いヒストグラムの構成について説明するためのさらに別の図Yet another diagram for explaining the configuration of a histogram with low processing load according to the embodiment of the present invention

[実施形態]
以下、添付図面を参照して実施形態を詳しく説明する。尚、以下の実施形態は特許請求の範囲に係る発明を限定するものでない。実施形態には複数の特徴が記載されているが、これらの複数の特徴の全てが発明に必須のものとは限らず、また、複数の特徴は任意に組み合わせられてもよい。さらに、添付図面においては、同一若しくは同様の構成に同一の参照番号を付し、重複した説明は省略する。
[Embodiment]
Hereinafter, embodiments will be described in detail with reference to the accompanying drawings. Note that the following embodiments do not limit the claimed invention. Although a plurality of features are described in the embodiments, not all of these features are essential to the invention, and the plurality of features may be arbitrarily combined. Furthermore, in the accompanying drawings, the same or similar components are designated by the same reference numerals, and redundant description will be omitted.

以下に説明する一実施形態は、画像処理装置の一例としての、撮像範囲の被写体の奥行き方向(深度方向)の距離分布と対応する情報(距離情報)を取得可能なデジタルカメラに、本発明を適用した例を説明する。しかし、本発明は、撮像画像と、該撮像画像の撮像範囲に係る距離情報を取得することが可能な任意の機器に適用可能である。 An embodiment described below applies the present invention to a digital camera, which is an example of an image processing device, and is capable of acquiring information (distance information) corresponding to a distance distribution in the depth direction (depth direction) of a subject in an imaging range. An example of application will be explained. However, the present invention is applicable to any device capable of acquiring a captured image and distance information related to the imaging range of the captured image.

また、本明細書において、「距離情報」とは、撮像画像の各画素の像のデフォーカス量分布を示す2次元情報であるものとし、以下では「デフォーカスマップ」として言及する。しかしながら、距離情報は、上述したように撮像範囲の被写体の奥行き方向の距離分布と対応する情報であればよく、例えば各画素の被写体距離を示す深度マップであってもよいし、デフォーカス量の導出に用いられた像ずれ量を示す2次元情報であってもよい。即ち、距離情報は、奥行き方向の距離分布に応じた変化を示す情報であれば、これらに限られず該当する。 Furthermore, in this specification, "distance information" is two-dimensional information indicating the defocus amount distribution of each pixel of the captured image, and hereinafter referred to as a "defocus map." However, as described above, the distance information only needs to be information that corresponds to the distance distribution in the depth direction of the subject in the imaging range, for example, it may be a depth map that indicates the subject distance of each pixel, or it may be a depth map that indicates the subject distance of each pixel, or it may be a depth map that indicates the subject distance of each pixel. It may be two-dimensional information indicating the amount of image shift used for derivation. That is, the distance information is not limited to the above information as long as it indicates a change according to the distance distribution in the depth direction.

《デジタルカメラの構成》
図1は、本発明の実施形態に係るデジタルカメラ100の機能構成を示したブロック図である。
《Digital camera configuration》
FIG. 1 is a block diagram showing the functional configuration of a digital camera 100 according to an embodiment of the present invention.

システム制御部101は、例えばCPU等の、デジタルカメラ100が備える各ブロックを制御する制御装置である。システム制御部101は、デジタルカメラ100が備える各ブロックの動作プログラムをROM102から読み出して、RAM103に展開して実行することによりデジタルカメラ100が備える各ブロックの動作を制御する。 The system control unit 101 is a control device, such as a CPU, that controls each block included in the digital camera 100. The system control unit 101 controls the operation of each block included in the digital camera 100 by reading out an operation program for each block included in the digital camera 100 from the ROM 102, loading it into the RAM 103, and executing the program.

ROM102は、例えばフラッシュROM等の書き換え可能な不揮発性メモリである。ROM102は、デジタルカメラ100が備える各ブロックの動作プログラムに加え、各ブロックの動作に必要なパラメータ等を記憶する。一方、RAM103は、書き換え可能な揮発性メモリである。RAM103は、デジタルカメラ100が備える各ブロックの動作プログラムの展開領域としてだけでなく、各ブロックの動作により出力された中間データの一時的な記憶領域としても用いられる。本実施形態では、システム制御部101と後述の画像処理部107が、RAM103をワークメモリとして使用するものとする。 The ROM 102 is, for example, a rewritable nonvolatile memory such as a flash ROM. The ROM 102 stores operation programs for each block included in the digital camera 100, as well as parameters necessary for the operation of each block. On the other hand, the RAM 103 is a rewritable volatile memory. The RAM 103 is used not only as a storage area for the operation programs of each block included in the digital camera 100, but also as a temporary storage area for intermediate data output by the operation of each block. In this embodiment, it is assumed that the system control unit 101 and the image processing unit 107 (described later) use the RAM 103 as a work memory.

光学系104は、被写体像を撮像部105に結像する。光学系104には、例えば、固定レンズ、焦点距離を変更する変倍レンズ、焦点調節を行うフォーカスレンズ等が含まれている。光学系104には絞りも含まれており、絞りにより光学系の開口径を調節することで撮影時の光量調節を行う。 The optical system 104 forms a subject image on the imaging unit 105 . The optical system 104 includes, for example, a fixed lens, a variable magnification lens that changes the focal length, a focus lens that adjusts the focus, and the like. The optical system 104 also includes a diaphragm, and by adjusting the aperture diameter of the optical system using the diaphragm, the amount of light during photographing is adjusted.

撮像部105は、例えばCCDイメージセンサやCMOSイメージセンサ等の撮像素子である。撮像部105は、光学系104により撮像素子の撮像面に結像された光学像を光電変換してアナログ画像信号を得る。撮像部105は、得られたアナログ画像信号をA/D変換部106に出力する。 The imaging unit 105 is, for example, an imaging device such as a CCD image sensor or a CMOS image sensor. The imaging unit 105 photoelectrically converts the optical image formed on the imaging surface of the image sensor by the optical system 104 to obtain an analog image signal. The imaging unit 105 outputs the obtained analog image signal to the A/D conversion unit 106.

A/D変換部106は、入力されたアナログ画像信号にA/D変換処理を適用することで、デジタル画像データ(以下では簡単に画像データとして言及)を得る。A/D変換部106は、得られた画像データをRAM103に出力して記憶させる。 The A/D conversion unit 106 obtains digital image data (hereinafter simply referred to as image data) by applying A/D conversion processing to the input analog image signal. The A/D converter 106 outputs the obtained image data to the RAM 103 and stores it therein.

画像処理部107は、RAM103に記憶されている画像データに対して、各種の画像処理を行う。具体的には、画像処理部107は、例えば、ホワイトバランス調整、色補間、縮小/拡大に係る処理等の画像処理を行う。画像処理部107は、画像処理後の画像データを記録媒体108に記録する。 The image processing unit 107 performs various image processing on the image data stored in the RAM 103. Specifically, the image processing unit 107 performs image processing such as white balance adjustment, color interpolation, and reduction/enlargement processing. The image processing unit 107 records the image data after the image processing onto the recording medium 108 .

また、画像処理部107は、本発明に係る機能を実現すべく、図3に示されるような処理を行うブロックを含む。詳細については後述するが、画像処理部107は、撮像を行った撮像範囲について、デフォーカス量の分布を示すデフォーカスマップ(距離情報)を生成する生成部300と、撮像範囲中の特定の被写体を検出する検出部301を含む。また画像処理部107は、検出部301による検出結果に基づいて設定された注目被写体について、解析用の領域を設定する領域設定部302と、該設定された領域についてのデフォーカス量の頻度マップ(ヒストグラム)を構成する構成部303を含む。さらに、画像処理部107は、最終的に決定した注目被写体の領域を抽出する領域抽出部304と、撮像画像を所望の画像表現を示す態様にするための画像処理を行う効果処理部305を含む。 Further, the image processing unit 107 includes blocks that perform processing as shown in FIG. 3 in order to realize the functions according to the present invention. Although the details will be described later, the image processing unit 107 includes a generation unit 300 that generates a defocus map (distance information) indicating the distribution of the amount of defocus for the imaging range in which the image has been captured, and a generation unit 300 that It includes a detection unit 301 that detects. The image processing unit 107 also includes a region setting unit 302 that sets an area for analysis regarding the target subject set based on the detection result by the detection unit 301, and a frequency map (of defocus amount) for the set area. a histogram). Furthermore, the image processing unit 107 includes an area extraction unit 304 that extracts the finally determined area of the subject of interest, and an effect processing unit 305 that performs image processing to transform the captured image into a form that shows a desired image expression. .

記録媒体108は、例えば、メモリカード等の、デジタルカメラ100に着脱可能に構成されていてよい記録装置である。記録媒体108には、画像処理部107により画像処理が適用された画像データ(撮像画像)やA/D変換部106によりA/D変換された画像信号(RAW画像)等が、記録画像として記録される。 The recording medium 108 is, for example, a recording device such as a memory card that may be configured to be removably attached to the digital camera 100. In the recording medium 108, image data (captured image) to which image processing is applied by the image processing unit 107, image signals (RAW images) converted from A/D by the A/D conversion unit 106, etc. are recorded as recorded images. be done.

表示部110は、例えばLCD等の表示装置であり、デジタルカメラ100における各種の情報提示を行う。表示部110は、撮像部105により撮像が行われている際、A/D変換された画像データを表示(スルー表示)することで、デジタルビューファインダとして機能する。 The display unit 110 is, for example, a display device such as an LCD, and presents various information on the digital camera 100. The display unit 110 functions as a digital viewfinder by displaying (through-display) A/D-converted image data when the image capturing unit 105 is capturing an image.

操作入力部109は、例えばレリーズスイッチ、設定ボタン、モード設定ダイアル等のユーザ入力インタフェースを含み、ユーザによりなされた操作入力を検出すると、該操作入力に対応する制御信号をシステム制御部101に出力する。また表示部110がタッチパネルセンサを備えている態様においては、操作入力部109は、表示部110に対してなされたタッチ操作を検出するインタフェースとしても機能する。 The operation input unit 109 includes a user input interface such as a release switch, a setting button, a mode setting dial, etc., and upon detecting an operation input made by the user, outputs a control signal corresponding to the operation input to the system control unit 101. . Further, in an embodiment in which the display unit 110 includes a touch panel sensor, the operation input unit 109 also functions as an interface that detects a touch operation performed on the display unit 110.

デジタルカメラ100が備えるこれらの機能ブロックは、基本的にはバス111によって接続され、バス111を介してブロック間の信号のやり取りが可能に構成される。 These functional blocks included in the digital camera 100 are basically connected by a bus 111, and are configured such that signals can be exchanged between the blocks via the bus 111.

本実施形態ではハードウェアとしてデジタルカメラ100が備える各ブロックに対応した回路やプロセッサにより処理が実現されるものとして説明する。しかしながら、本発明の実施はこれに限られるものではなく、各ブロックの処理が該各ブロックと同様の処理を行うプログラムにより実現されるものであってもよい。 In this embodiment, processing will be described as hardware implemented by circuits and processors corresponding to each block included in the digital camera 100. However, the implementation of the present invention is not limited to this, and the processing of each block may be realized by a program that performs the same processing as that of each block.

《撮像部の構成》
次に、本実施形態の撮像部105が備える撮像素子の詳細構成について、図2を参照して説明する。
《Configuration of imaging section》
Next, the detailed configuration of the image sensor included in the image capture unit 105 of this embodiment will be described with reference to FIG. 2.

撮像素子は、図2(a)に示されるように、複数の画素200が2次元に規則的に配列されている。具体的には、複数の画素200は、例えば二次元格子状に配列されている。なお、画素200の配列構成は、格子状の配列構成に限定されるものではなく、他の配列構成が採用されるものであってもよい。 As shown in FIG. 2(a), the image sensor has a plurality of pixels 200 regularly arranged in two dimensions. Specifically, the plurality of pixels 200 are arranged, for example, in a two-dimensional grid. Note that the arrangement configuration of the pixels 200 is not limited to a grid-like arrangement, and other arrangement configurations may be adopted.

撮像面位相差測距方式の測距機能を実現すべく、各画素200は、図2(b)に示されるようにマイクロレンズ201と、一対の光電変換部202a及びb(以下、それぞれ瞳分割画素202a及びbとして言及)を有している。瞳分割画素202a及びbは、撮像面がy軸方向を長手方向とする長方形状を有する、同形同大に構成された光電変換部である。各画素200において、瞳分割画素202a及びbは、マイクロレンズ201のy軸方向に沿った垂直二等分線を対称軸として、線対称に配置されている。なお、瞳分割画素202a及びbの撮像面形状は、これに限定されるものではなく、形状であってもよい。また、瞳分割画素202a及びbの配置態様も、x方向に並列に配置されるものに限られれるものではなく、他の配置態様が採用されるものであってよい。 In order to realize the distance measurement function of the imaging plane phase difference distance measurement method, each pixel 200 includes a microlens 201 and a pair of photoelectric conversion units 202a and 202b (hereinafter referred to as pupil division) as shown in FIG. 2(b). pixels 202a and b). The pupil division pixels 202a and 202b are photoelectric conversion units that are configured to have the same shape and size and have a rectangular imaging surface whose longitudinal direction is the y-axis direction. In each pixel 200, the pupil division pixels 202a and 202b are arranged symmetrically with respect to the perpendicular bisector of the microlens 201 along the y-axis direction as an axis of symmetry. Note that the shape of the imaging surface of the pupil division pixels 202a and 202b is not limited to this, and may be any other shape. Furthermore, the arrangement of the pupil division pixels 202a and 202b is not limited to being arranged in parallel in the x direction, and other arrangements may be adopted.

このような構成により、本実施形態の撮像部105は、撮像素子の全ての画素が有する瞳分割画素202aから出力された画像信号に係るA像と、同様に瞳分割画素202bから出力された画像信号に係るB像とを出力する。A像とB像とは、合焦している位置との距離に応じた視差を有する関係にある。 With such a configuration, the imaging unit 105 of this embodiment can capture the A image related to the image signal output from the pupil division pixel 202a that all pixels of the image sensor have, and the image similarly output from the pupil division pixel 202b. A B image related to the signal is output. The A image and the B image have a parallax that corresponds to the distance from the in-focus position.

より詳しくは、各画素200において、瞳分割画素202aとbは、マイクロレンズ201を介して入光した光束のうちの異なる光束を受光するよう構成されているため、光学系104の射出瞳の異なる領域を通過した光束に係る光学像を光電変換する。即ち、この射出瞳の異なる領域(瞳分割領域)を通過した光束について、A像とB像は生成されるものであるため、被写体を瞳分割領域の重心位置の差の分ずれた撮影位置で撮像された関係になっており、視差が生じることになる。換言すれば、A像とB像とは、異なる視点について撮像範囲を撮像して得られた画像群に相当する。 More specifically, in each pixel 200, the pupil division pixels 202a and 202b are configured to receive different light fluxes among the light fluxes incident through the microlens 201. The optical image related to the light beam passing through the area is photoelectrically converted. In other words, since images A and B are generated for the light beams that have passed through different areas of the exit pupil (pupil division areas), the subject is photographed at a photographing position that is shifted by the difference in the center of gravity of the pupil division areas. The relationship between the images is taken, and parallax will occur. In other words, the A image and the B image correspond to a group of images obtained by imaging the imaging range from different viewpoints.

なお、本実施形態では、撮像部105の撮像素子を図2のように構成することで、撮像範囲の被写体の距離分布の導出に用いられるA像とB像とを取得するものとして説明するが、A像とB像の取得方法はこれに限られるものではない。例えば、基線長離間させて設置した複数台の撮像装置により撮像された画像群をA像、B像とするものでもよいし、複数の光学系と撮像部を有する1台の撮像装置(所謂、両眼カメラ等)により取得された画像群をそれぞれA像、B像とするものでもよい。 In this embodiment, the image sensor of the imaging unit 105 is configured as shown in FIG. 2 to obtain the A image and the B image used for deriving the distance distribution of the object in the imaging range. , the method of acquiring the A image and the B image is not limited to this. For example, images A and B may be a group of images captured by multiple imaging devices installed with a baseline length apart, or a single imaging device having multiple optical systems and imaging units (so-called A group of images acquired by a binocular camera, etc.) may be used as images A and B, respectively.

《デフォーカス量の導出》
生成部300は、撮像範囲の奥行き方向における被写体の距離分布を示す情報として、撮像画像に含まれる各被写体の像のデフォーカス量を含む、撮像画像と対応する画素構造を有したデフォーカスマップを生成する。デフォーカス量は、本実施形態のように取得した視差を有する画像群(A像及びB像)に基づいて導出する場合、例えば以下のように行えばよい。
《Derivation of defocus amount》
The generation unit 300 generates a defocus map having a pixel structure corresponding to the captured image, which includes the amount of defocus of each subject image included in the captured image, as information indicating the distance distribution of the subject in the depth direction of the captured image. generate. When the defocus amount is derived based on the acquired image group (image A and image B) having parallax as in this embodiment, it may be performed as follows, for example.

デフォーカス量の導出は、例えば図7に示されるように画像(A像とB像)700を、破線で示される微小ブロック701に分割する処理を含む。微小ブロック701は、例えば対象であるA像の各画素を着目画素とした場合に、該画素を中心とする予め定められたサイズの領域に対して設定されるものであってよい。なお、以下の説明では微小ブロック701は、着目画素を中心とするm×m画素の正方領域として設定されるものとして説明するが、微小ブロック701の形状やサイズはいずれであってもよい。また微小ブロック701は着目画素ごとに設定されるものであり、異なる着目画素間で微小ブロック701の重複が生じてもよい。また、生成部300は、位相差を検出するA像とB像に対して、予めバンドパスフィルタをかける処理を適用した後に、デフォーカス量の導出を行うものとしてもよい。 Derivation of the defocus amount includes, for example, a process of dividing an image (image A and image B) 700 into minute blocks 701 shown by broken lines, as shown in FIG. For example, when each pixel of the target image A is a pixel of interest, the micro block 701 may be set for a region of a predetermined size centered on the pixel. In the following description, the microblock 701 will be described as being set as a square area of m×m pixels centered on the pixel of interest, but the microblock 701 may have any shape or size. Further, the minute block 701 is set for each pixel of interest, and the minute blocks 701 may overlap between different pixels of interest. Further, the generation unit 300 may derive the defocus amount after applying a process of applying a bandpass filter to the A image and the B image whose phase difference is to be detected in advance.

例えばA像及びB像の各画素について微小ブロック701が設定されると、両画像間で画素(着目画素)ごとに相関演算処理を行い、該画素に対応する微小ブロック701に含まれる像のずれ量(像ずれ量)を導出する。A像及びB像とで同一位置の着目画素について定められた(一対の)微小ブロック701のデータ数(画素数)がmである場合、該一対の微小ブロック701の画素データをそれぞれE(1)~E(m)、F(1)~F(m)として表現する。この場合、相関演算は、(データの)ずらし量をk(整数)[pixel]とすると、相関量C(k)は
C(k)=Σ|E(n)-F(n+k)|
で導出できる。ここで、Σ演算はnについて行われ、n及びn+kは1~mの範囲に限定されるものとする。また、ずらし量kは、一対の画像データの検出ピッチを単位とした相対的シフト量である。このように、1つの着目画素に係る一対の瞳分割画像(一対の微小ブロック701)について相関量を導出すると、ずらし量kと相関量C(k)は、例えば図6のグラフに離散的に示されるような関係となる。このとき、相関が最も高い像ずれ量において相関量C(k)が最小になるため、下記の3点内挿の手法を用いて、連続的な相関量に対する最小値C(x)を与えるずらし量xを導出する。
x=kj+D/SLOP
C(x)=C(kj)-|D|
D={C(kj-1)-C(kj+1)}/2
SLOP=MAX{C(kj+1)-C(kj),C(kj-1)-C(kj)}
ここで、kjは離散的な相関量C(k)が最小となるずらし量kである。このようにして求めたずらし量xが、1つの着目画素における像ずれ量として、距離情報に含められる。なお、像ずれ量xの単位も[pixel]であるものとする。
For example, when a microblock 701 is set for each pixel of image A and image B, correlation calculation processing is performed for each pixel (pixel of interest) between both images, and the deviation of the image included in the microblock 701 corresponding to the pixel is calculated. The amount (image shift amount) is derived. When the number of data (number of pixels) of a (pair of) micro blocks 701 determined for the pixel of interest at the same position in the A image and the B image is m, the pixel data of the pair of micro blocks 701 are each expressed as E(1 ) to E(m), and F(1) to F(m). In this case, in the correlation calculation, if the shift amount (of data) is k (integer) [pixel], the correlation amount C(k) is C(k)=Σ|E(n)−F(n+k)|
It can be derived as Here, it is assumed that the Σ operation is performed on n, and n and n+k are limited to the range of 1 to m. Further, the shift amount k is a relative shift amount in units of detection pitches of a pair of image data. In this way, when the correlation amount is derived for a pair of pupil division images (a pair of microblocks 701) related to one pixel of interest, the shift amount k and the correlation amount C(k) are discretely shown in the graph of FIG. 6, for example. The relationship is as shown. At this time, since the correlation amount C(k) is the minimum at the image shift amount where the correlation is highest, the following three-point interpolation method is used to shift the amount to give the minimum value C(x) for the continuous correlation amount. Derive the quantity x.
x=kj+D/SLOP
C(x)=C(kj)−|D|
D={C(kj-1)-C(kj+1)}/2
SLOP=MAX{C(kj+1)-C(kj), C(kj-1)-C(kj)}
Here, kj is the shift amount k that minimizes the discrete correlation amount C(k). The shift amount x obtained in this way is included in the distance information as the image shift amount for one pixel of interest. Note that the unit of the image shift amount x is also [pixel].

従って、各着目画素におけるデフォーカス量DEFは、像ずれ量xを用いて、
DEF=KX・PY・x
で導出することができる。ここで、PYは、撮像素子の画素ピッチ(撮像素子を構成する画素間距離。単位[mm/pixel])であり、KXは、一対の測距瞳を通過する光束の重心の開き角の大きさによって決まる変換係数である。なお、一対の測距瞳を通過する光束の重心の開き角の大きさは、レンズの絞り開口の大きさ(F値)に応じて変化するため、撮像時の設定の情報に応じて決定されるものとする。
Therefore, the defocus amount DEF for each pixel of interest is calculated using the image shift amount x.
DEF=KX・PY・x
It can be derived as Here, PY is the pixel pitch of the image sensor (distance between pixels constituting the image sensor, unit [mm/pixel]), and KX is the size of the aperture angle of the center of gravity of the light flux passing through a pair of ranging pupils. It is a conversion coefficient determined by the Note that the size of the aperture angle of the center of gravity of the light flux passing through a pair of distance measuring pupils changes depending on the size of the aperture aperture (F number) of the lens, so it is determined according to the information set at the time of imaging. shall be

このように、生成部300は、着目画素位置を1画素ずつずらしながら繰り返し計算することで、撮像画像の各画素における被写体のデフォーカス量を導出することができる。生成部300は、各画素のデフォーカス量を導出すると、これを画素値とする、撮像画像と同一の構造の2次元情報であるデフォーカスマップを、距離情報として生成する。即ち、デフォーカス量は、撮像画像において合焦している被写体距離からの奥行き方向の位置のずれ量に応じて変化する値であるため、デフォーカスマップは、撮像時の被写体の奥行き方向の距離分布と等価な情報である。 In this way, the generation unit 300 can derive the defocus amount of the subject at each pixel of the captured image by repeatedly calculating while shifting the pixel position of interest one pixel at a time. When the generation unit 300 derives the defocus amount of each pixel, it generates a defocus map, which is two-dimensional information having the same structure as the captured image, and uses this as the pixel value as distance information. In other words, the amount of defocus is a value that changes depending on the amount of deviation in the position in the depth direction from the distance of the subject that is in focus in the captured image, so the defocus map is a value that changes depending on the distance in the depth direction of the subject at the time of imaging. This is information equivalent to distribution.

《画像加工処理》
以下、本実施形態のデジタルカメラ100において、撮像画像とデフォーカスマップとに基づいて、注目被写体の距離範囲のみに合焦した、撮像時よりも被写界深度を狭めた表現の画像を生成する画像加工処理について、図4のフローチャートを用いて説明する。該フローチャートに対応する処理は、システム制御部101が、例えばROM102に記憶されている対応する処理プログラムを読み出し、RAM103に展開して実行することにより実現することができる。本画像加工処理は、例えばデジタルカメラ100が撮像後に表現を変更した画像を生成する撮影モードに設定され、撮像指示に係る操作入力が検出された際に開始されるものとして説明する。
《Image processing》
Hereinafter, in the digital camera 100 of this embodiment, based on the captured image and the defocus map, an image that is focused only on the distance range of the subject of interest and has a narrower depth of field than when the image was captured is generated. The image processing process will be explained using the flowchart of FIG. The processing corresponding to the flowchart can be realized by the system control unit 101 reading out a corresponding processing program stored in, for example, the ROM 102, loading it into the RAM 103, and executing it. This image processing process will be described assuming that, for example, the digital camera 100 is set to a shooting mode that generates an image whose expression has been changed after shooting, and is started when an operation input related to a shooting instruction is detected.

S401で、撮像部105はシステム制御部101の制御の下、被写体の撮像を行う。撮像によりアナログ画像信号が得られると、A/D変換部106はこれをA/D変換し、RAM103に格納する。本画像加工処理においてRAM103に格納される画像データは、瞳分割画素202aに係り撮像されたA像及び瞳分割画素202bに係り撮像されたB像と、該A像とB像とを加算することで構成された撮像画像(瞳分割していない状態に対応する画像)である。 In S401, the imaging unit 105 images a subject under the control of the system control unit 101. When an analog image signal is obtained by imaging, the A/D converter 106 A/D converts it and stores it in the RAM 103 . In this image processing process, the image data stored in the RAM 103 is obtained by adding the A image captured by the pupil division pixel 202a, the B image captured by the pupil division pixel 202b, and the A image and the B image. This is a captured image (an image corresponding to a state in which the pupils are not divided).

以下の説明では、撮像範囲において被写体は図5に示されるように分布しているものとする。図示されるように、撮像範囲には手を挙げた状態の人物被写体500、人物被写体500よりもデジタルカメラ100に近い位置から人物被写体500よりも遠い位置にかけて延びた生垣501、生垣501よりも更に遠方に存在する木502が含まれる。また、撮像画像は、人物被写体500に合焦する撮像設定で撮像されているものとする。本実施形態の画像加工処理では、後述のステップにおいて該人物被写体500が注目被写体として選択され、該注目被写体に距離範囲にのみ合焦し、他の距離範囲の被写体についてはぼかしを付与することで、被写界深度の浅い画像を生成するものとして説明する。また簡単のため、奥行き方向の距離分布は、撮像範囲に分布する地面については除外し、人物被写体500、生垣501及び木502についてのみ導出されるものとして説明する。 In the following description, it is assumed that objects are distributed as shown in FIG. 5 in the imaging range. As shown in the figure, the imaging range includes a human subject 500 with his hand raised, a hedge 501 extending from a position closer to the digital camera 100 than the human subject 500 to a position farther than the human subject 500, and a hedge 501 extending further than the hedge 501. A tree 502 that exists far away is included. Further, it is assumed that the captured image is captured with an imaging setting that focuses on the human subject 500. In the image processing process of this embodiment, the human subject 500 is selected as a subject of interest in a step described later, and the subject of interest is focused only in a distance range, and objects in other distance ranges are blurred. , the following description assumes that an image with a shallow depth of field is generated. Further, for the sake of simplicity, the description will be made assuming that the distance distribution in the depth direction is derived only for the human subject 500, the hedge 501, and the tree 502, excluding the ground distributed in the imaging range.

S402で、生成部300はシステム制御部101の制御の下、S401においてRAM103に格納されたA像及びB像に基づき、撮像画像と対応するデフォーカスマップを生成する。図8に、デフォーカスマップを、画素値であるデフォーカス量をグレースケール値に変換して可視化して例示する。説明をわかりやすくするため、図8の例では、被写体距離が近い画素ほど白に近い値(画素値が高い)を有し、遠離するほど黒に近い値(画素値が低い)となるように変換されているものとする。 In S402, under the control of the system control unit 101, the generation unit 300 generates a defocus map corresponding to the captured image based on the A image and the B image stored in the RAM 103 in S401. FIG. 8 shows an example of a defocus map visualized by converting the defocus amount, which is a pixel value, into a gray scale value. To make the explanation easier to understand, in the example in Figure 8, the closer the object distance is, the closer the pixel is to white (higher pixel value), and the further away the object is, the closer to black the value (lower pixel value). Assume that it has been converted.

ところで、上述したような分布で人物被写体500、生垣501及び木502が配置されている場合、特許文献1の技術のように該デフォーカスマップについてデフォーカス量に基づくヒストグラム(頻度分布)を構成した場合、図9のような分布となる。図9において、901で示されるヒストグラムの山は、遠方に配置された木502に係る画素群におけるデフォーカス量の分布を示している。一方、900で示されるヒストグラムの山は、人物被写体500及び生垣501に係る画素群におけるデフォーカス量の分布を示している。 By the way, when the human subject 500, the hedge 501, and the tree 502 are arranged in the distribution as described above, a histogram (frequency distribution) based on the defocus amount is constructed for the defocus map as in the technique of Patent Document 1. In this case, the distribution will be as shown in FIG. In FIG. 9, a mountain in the histogram indicated by 901 indicates the distribution of defocus amount in a pixel group related to a tree 502 located far away. On the other hand, the peak of the histogram indicated by 900 indicates the distribution of defocus amounts in the pixel group related to the human subject 500 and the hedge 501.

ここで、引用文献1に記載のように所定の閾値902を上回るの頻度を示す、d1~d2で示されるデフォーカス範囲の画素を抽出したとしても、図10に示されるように、人物被写体500と生垣501に係る領域(図中の白領域)が抽出されるだけである。従って、このような抽出結果に基づいて処理をしたとしても、本実施形態のように注目被写体としたい人物被写体500の距離範囲にのみ合焦させる、被写界深度の浅い表現の画像を得ることはできない。換言すれば、生垣501が奥行き方向に広く延びた形状をしており、人物被写体500の被写体距離の範囲を含んで配置されている態様では、人物被写体500の距離範囲のみを、引用文献1に記載の技術では分離抽出することができない。故に、抽出された領域外についてぼかし処理を適用したとしても、生垣501の奥行き方向の距離範囲について合焦してしまうため、被写界深度を好適に狭めることができず、所望の表現の画像とならない。 Here, even if pixels in the defocus range indicated by d1 to d2, which indicate the frequency of exceeding a predetermined threshold value 902, are extracted as described in Cited Document 1, as shown in FIG. Only the area related to the hedge 501 (white area in the figure) is extracted. Therefore, even if processing is performed based on such extraction results, it is not possible to obtain an image with a shallow depth of field that focuses only on the distance range of the human subject 500 that is desired to be the subject of interest, as in this embodiment. I can't. In other words, in an embodiment in which the hedge 501 has a shape that extends widely in the depth direction and is arranged to include the subject distance range of the human subject 500, only the distance range of the human subject 500 is Separation and extraction cannot be performed using the described technique. Therefore, even if blurring processing is applied to areas outside the extracted area, the distance range in the depth direction of the hedge 501 will be in focus, making it impossible to suitably narrow the depth of field, resulting in an image with the desired expression. Not.

このため、本発明に係る画像加工処理では、デフォーカス量のヒストグラムに基づいて抽出するデフォーカス量の値範囲を特定する際に、撮像画像の全域についてのヒストグラムではなく、注目被写体とする被写体の領域についてのヒストグラムを用いる。以下、処理の詳細についてさらに説明する。 Therefore, in the image processing according to the present invention, when specifying the value range of the defocus amount to be extracted based on the histogram of the defocus amount, instead of using the histogram for the entire area of the captured image, Use a histogram for regions. The details of the process will be further explained below.

S403で、検出部301はシステム制御部101の制御の下、撮像画像中に含まれる所定の被写体を検出する処理を行う。上述したように、本実施形態では人物被写体500の領域を特定する必要があるため、検出部301は、撮像画像に含まれる人物の顔領域を検出し、該顔領域の位置及びサイズ(FACE_SIZE_X, FACE_SIZE_Y)の情報を取得する。なお、本実施形態では検出部301は人物の顔領域を検出するものとして説明するが、本発明の実施はこれに限られるものではなく、例えば人物の胴体、乗用車、ペット、植物等が検出対象として設定されるものであってもよい。 In S403, the detection unit 301 performs processing to detect a predetermined subject included in the captured image under the control of the system control unit 101. As described above, in this embodiment, it is necessary to specify the area of the human subject 500, so the detection unit 301 detects the face area of the person included in the captured image, and determines the position and size (FACE_SIZE_X, FACE_SIZE_Y) information. In this embodiment, the detection unit 301 will be described as detecting a person's face area, but the implementation of the present invention is not limited to this. For example, the detection target may be a person's torso, a passenger car, a pet, a plant, etc. It may be set as .

なお、本実施形態では、検出部301が、予め定められた種類の被写体が撮像画像に含まれるか否かを検出し、該検出結果に基づいて注目被写体を設定するものとして説明するが、本発明の実施はこれに限られるものではないことは容易に理解されよう。即ち、撮像画像中から注目被写体を設定する方法は、画像解析に基づくものである必要はなく、例えばユーザによる注目被写体の選択操作に基づいて設定されるものであってもよいし、撮像画像中の特定の領域について設定されるものとして定められていてもよい。 In this embodiment, the detection unit 301 detects whether or not a predetermined type of subject is included in the captured image, and sets the subject of interest based on the detection result. It will be readily understood that the implementation of the invention is not limited to this. That is, the method of setting the subject of interest from the captured image does not need to be based on image analysis, and may be set based on the user's selection operation of the subject of interest, for example. may be set for a specific area.

S404で、領域設定部302はシステム制御部101の制御の下、S403における検出部301の検出結果に基づいて、撮像画像に対応するデフォーカスマップ中のヒストグラムを構成する解析領域を設定する。本実施形態では、人物の顔領域が検出部301により検出されるため、領域設定部302は、例えば図11に示されるように顔領域1100のサイズに対して相対的に定められた解析領域1102を、ヒストグラムを構成する解析領域として設定する。図11の例では、解析領域1102は、人物被写体500の顔領域1100のサイズ(FACE_SIZE_X, FACE_SIZE_Y)に対して、予め設定した拡大率(MAG_X, MAG_Y)を乗じたサイズとなっている。解析領域1102の配置位置は、顔領域1100の上端から、顔領域1100のサイズに応じたFACE_MARGIN分(1101)だけY軸方向に移動した位置を上端とするように決定される。 In S404, under the control of the system control unit 101, the area setting unit 302 sets an analysis area constituting a histogram in the defocus map corresponding to the captured image, based on the detection result of the detection unit 301 in S403. In this embodiment, since the face area of a person is detected by the detection unit 301, the area setting unit 302 defines an analysis area 1102 that is defined relative to the size of the face area 1100, as shown in FIG. 11, for example. is set as the analysis area that constitutes the histogram. In the example of FIG. 11, the analysis area 1102 has a size obtained by multiplying the size (FACE_SIZE_X, FACE_SIZE_Y) of the face area 1100 of the human subject 500 by a preset magnification rate (MAG_X, MAG_Y). The arrangement position of the analysis region 1102 is determined so that the upper end is a position moved from the upper end of the face region 1100 by FACE_MARGIN (1101) corresponding to the size of the face region 1100 in the Y-axis direction.

ここで、解析領域1102のサイズを決定するための拡大率は、撮像画像における被写界深度に応じて変更することが好ましい。例えば、被写界深度が浅くなる撮像条件で、人物被写体500の顔に合焦させてポートレート撮影を行うと、該被写体の胴体の像の境界部分が光学的なボケによって、被写界深度が深い撮像条件の場合よりも外側に膨張する傾向がある。故に、拡大率は、撮像画像における被写界深度が浅くなっているほど、デフォーカス量の範囲抽出に用いる領域が大きくなるよう設定されるものであってよい。 Here, the magnification rate for determining the size of the analysis region 1102 is preferably changed depending on the depth of field in the captured image. For example, if you take a portrait shot by focusing on the face of a human subject 500 under imaging conditions that result in a shallow depth of field, the boundary between the image of the subject's torso will be optically blurred, resulting in a shallow depth of field. tends to expand outwards than under deep imaging conditions. Therefore, the magnification ratio may be set such that the shallower the depth of field in the captured image, the larger the area used for extracting the defocus amount range.

なお、本実施形態では人物の顔領域を検出するため、顔領域1100と解析領域1102を図11のような態様で設定するものとして説明するが、ヒストグラムを構成する解析領域の設定は、これに限られるものではない。例えば、人物の胴体も検出する態様においては、人体の検出結果に基づいて、人物被写体500により合致した領域を設定することができる。また、ヒストグラムを構成する解析領域は、検出する被写体の種類、あるいは注目被写体として選択された被写体の種類に応じて、動的にサイズが変更され、設定されるものであってもよい。ここで、図示されるように解析領域1102は、厳密に被写体の輪郭に合致するよう設定される必要はない。 Note that in this embodiment, in order to detect a person's face area, the face area 1100 and the analysis area 1102 are set as shown in FIG. 11. It is not limited. For example, in an embodiment in which a person's torso is also detected, an area that more closely matches the human subject 500 can be set based on the human body detection result. Furthermore, the size of the analysis area forming the histogram may be dynamically changed and set depending on the type of subject to be detected or the type of subject selected as the subject of interest. Here, the analysis area 1102 does not need to be set to exactly match the outline of the subject as shown in the figure.

S405で、構成部303はシステム制御部101の制御の下、S404において設定されたヒストグラムを構成する解析領域について、デフォーカスマップに基づくヒストグラムを構成する。本ステップで生成されるヒストグラムは、図11で示したように、人物被写体500について設定された解析領域1102に含まれる画素のみで構成されるため、例えば図12のように現れる。換言すれば、本ステップでは単純にデフォーカスマップの全域についてヒストグラムを生成する場合よりも、より人物被写体500に合わせた領域でヒストグラムを構成できる。このため、人物被写体500と共通する被写体距離に存在する他の被写体が存在していても、該他の被写体の距離範囲に依らず、人物被写体500に係る画素が分布するデフォーカス量の範囲を取得することができる。 In S405, under the control of the system control unit 101, the configuration unit 303 configures a histogram based on the defocus map for the analysis area that configures the histogram set in S404. As shown in FIG. 11, the histogram generated in this step is composed only of pixels included in the analysis area 1102 set for the human subject 500, and therefore appears as shown in FIG. 12, for example. In other words, in this step, a histogram can be constructed in an area more suited to the human subject 500 than in the case where a histogram is simply generated for the entire area of the defocus map. Therefore, even if there is another subject at a common subject distance with the human subject 500, the defocus amount range in which pixels related to the human subject 500 are distributed is determined regardless of the distance range of the other subject. can be obtained.

S406で、システム制御部101は、構成された解析領域1102についてのデフォーカス量のヒストグラムに基づいて、閾値1201を上回る数の頻度を示すデフォーカス量の範囲(最小デフォーカス量d1及び最大デフォーカス量d2)を特定する。システム制御部101は、特定したデフォーカス量の範囲の情報を、RAM103に格納する。 In S406, the system control unit 101 determines, based on the histogram of defocus amounts for the configured analysis region 1102, the range of defocus amounts (minimum defocus amount d1 and maximum defocus amount) that indicates the frequency of the number exceeding the threshold value 1201. Specify the quantity d2). The system control unit 101 stores information on the specified defocus amount range in the RAM 103.

S407で、領域抽出部304はシステム制御部101の制御の下、デフォーカスマップの全域から、S406において特定した範囲に含まれるデフォーカス量を示す画素(領域)を抽出する。このようにして、人物被写体500の顔領域1100に合わせて設定された解析領域1102に基づいて特定したデフォーカス量の範囲に含まれる画素を抽出すると、図13に示されるようになる。図示されるように、解析領域1102に基づいて特定したデフォーカス量の範囲に含まれる画素のみを抽出すると、人物被写体500と、生垣501のうちの該範囲に含まれる位置の像のみが抽出される。 In S407, under the control of the system control unit 101, the area extraction unit 304 extracts pixels (areas) indicating the defocus amount included in the range specified in S406 from the entire area of the defocus map. When pixels included in the range of the defocus amount specified based on the analysis region 1102 set according to the face region 1100 of the human subject 500 are extracted in this way, the result is as shown in FIG. 13. As shown in the figure, when only pixels included in the defocus amount range specified based on the analysis region 1102 are extracted, only images of the human subject 500 and the hedge 501 at positions included in the range are extracted. Ru.

本実施形態のデジタルカメラ100では、輝度情報や色情報のヒストグラムとは異なり、デフォーカス量に係るヒストグラムに基づいて被写体領域の抽出を行うため、1つの被写体は一定の距離範囲に分布するとの特徴を生かした抽出を行うことができる。故に、解析領域1102に基づいてデフォーカス量の範囲を設定したとしても、図13に示されるように、人物被写体500が挙げている手や胴体のその他の部位も抽出され得る。 In the digital camera 100 of this embodiment, a subject area is extracted based on a histogram related to defocus amount, unlike a histogram of brightness information or color information, so one subject is distributed over a certain distance range. It is possible to perform extraction that takes advantage of the Therefore, even if the defocus amount range is set based on the analysis region 1102, the hands and other parts of the body raised by the human subject 500 can also be extracted, as shown in FIG.

なお、デフォーカスマップのヒストグラムの山は、被写界深度が浅い撮像条件で撮像画像が取得されている場合ほど、山の裾野が広がり、かつ、デフォーカス量の頻度の変動も大きくなる傾向にある。このため、被写界深度が浅い撮像条件の場合には、システム制御部101は、デフォーカス量の範囲抽出に用いる閾値を低減させるようにし、より広範囲の領域を抽出できるように範囲の設定をすることが好適である。このように構成することで、例えばポートレート撮影のような、人物被写体500の顔部分に合焦した、被写界深度が浅い撮像条件で撮像が行われた場合に、顔領域に比べてデフォーカスしているような胴体部についても、抽出が可能になる。 Note that the peaks in the histogram of the defocus map tend to have wider bases and larger fluctuations in the frequency of the defocus amount when images are acquired under imaging conditions with a shallower depth of field. be. Therefore, in the case of imaging conditions with a shallow depth of field, the system control unit 101 reduces the threshold value used for range extraction of the defocus amount, and sets the range so that a wider area can be extracted. It is preferable to do so. With this configuration, when an image is captured under an imaging condition where the face of the human subject 500 is focused and the depth of field is shallow, such as in portrait photography, the area is smaller than the face area. It is also possible to extract the body part that is in focus.

S408で、領域抽出部304はシステム制御部101の制御の下、撮像画像のうちのS407において抽出された領域の画像を分離する。即ち、領域抽出部304は、デフォーカスマップと対応する撮像画像中から、図13において白色で示した領域の部分画像を分離する。 In S408, the region extraction unit 304 separates the image of the region extracted in S407 from the captured image under the control of the system control unit 101. That is, the region extraction unit 304 separates a partial image of the region shown in white in FIG. 13 from the captured image corresponding to the defocus map.

なお、本実施形態では人物被写体500の距離範囲に合焦する表現の画像を生成するものとしたため、該範囲に存在する生垣501の領域についても分離するものとして説明するが、人物被写体500にのみ合焦する表現では、生垣501の領域も除外してよい。この場合、領域抽出部304は、例えば人物被写体500の距離範囲に該当する領域のうち、解析領域1102の基準となった顔領域1100と連続性のない領域を除外するよう処理すれば、図14のように人物被写体500の領域のみを分離することができる。 Note that in this embodiment, since an image is generated that focuses on the distance range of the human subject 500, the area of the hedge 501 existing in this range will also be separated. In the in-focus expression, the area of the hedge 501 may also be excluded. In this case, the region extracting unit 304 performs processing to exclude, for example, regions corresponding to the distance range of the human subject 500 that are not continuous with the face region 1100 that is the reference of the analysis region 1102, as shown in FIG. Only the area of the human subject 500 can be separated as shown in FIG.

S409で、効果処理部305はシステム制御部101の制御の下、撮像画像のうちのS408において分離されなかった領域に対して、例えばローパスフィルタを適用することでぼかし処理を行う。また画像処理部107は、ぼかし処理が適用された画像とS408において分離された画像とを合成することで、撮像時よりも被写界深度の浅い表現の加工画像を生成して記録媒体108に記録させ、本画像加工処理を完了する。 In S409, under the control of the system control unit 101, the effect processing unit 305 performs blurring processing on the region of the captured image that was not separated in S408 by applying, for example, a low-pass filter. In addition, the image processing unit 107 generates a processed image with a shallower depth of field than that at the time of imaging by combining the image to which the blurring process has been applied and the image separated in S408, and stores the processed image in the recording medium 108. Record it and complete the main image processing process.

以上説明したように、本実施形態の画像処理装置によれば、注目の被写体の領域を被写体の距離分布に基づいて好適に抽出することができる。より詳しくは、画像処理装置は、撮像画像と、該撮像画像とに対応して得られた被写体の距離分布を示す距離情報に基づき、所望の被写体の領域に限定して、該被写体の距離範囲を特定する。そして、特定した距離範囲に基づき、所望の被写体の距離範囲に含まれる被写体の領域を、撮像画像中から抽出することができるため、画像処理装置は、これを用いた種々の表現の画像生成を行うことができる。 As described above, according to the image processing apparatus of this embodiment, the region of the subject of interest can be suitably extracted based on the distance distribution of the subject. More specifically, the image processing device determines the distance range of a desired object based on a captured image and distance information indicating a distance distribution of the object obtained corresponding to the captured image. Identify. Then, based on the specified distance range, the area of the subject included in the distance range of the desired subject can be extracted from the captured image, so the image processing device can generate images of various expressions using this. It can be carried out.

なお、本実施形態では、注目被写体の距離範囲にのみ合焦し、その他の距離範囲の被写体はぼけた状態の、被写界深度の浅い表現の画像を生成するものとして説明したが、本発明の実施はこれに限られるものではない。即ち、分離した領域または分離しなかった領域に対して、効果処理部305が適用する画像処理は、ぼかし処理に限らず、例えば明るさ補正やコントラスト補正等、種々の画像処理を含むものであってよい。換言すれば、本発明は、注目被写体の距離範囲か範囲外であるかに応じて、画像処理の適用を分けることで実現される表現であれば、適用可能である。 In this embodiment, an image with a shallow depth of field is generated in which only the distance range of the subject of interest is in focus and objects in other distance ranges are blurred. However, the present invention The implementation is not limited to this. That is, the image processing applied by the effect processing unit 305 to the separated region or the non-separated region is not limited to blurring processing, but includes various image processing such as brightness correction and contrast correction. It's fine. In other words, the present invention is applicable to any expression that can be realized by dividing the application of image processing depending on whether the object of interest is within the distance range or outside the range.

また、本実施形態ではデジタルカメラ100が撮像面位相差測距方式の測距機能を有する撮像素子を有し、撮像画像とともに視差を有する関係の画像群を取得し、デフォーカスマップを生成するものとして説明したが、本発明の実施はこれに限られない。撮像範囲に係るデフォーカスマップは、撮像画像と同時に取得されるものでなく、予め記録媒体108等に記録されているものであってもよい。 Furthermore, in the present embodiment, the digital camera 100 has an image sensor having a distance measurement function based on the imaging plane phase difference distance measurement method, acquires a group of images having a parallax relationship together with the captured image, and generates a defocus map. However, the implementation of the present invention is not limited to this. The defocus map related to the imaging range may not be acquired simultaneously with the captured image, but may be recorded in advance on the recording medium 108 or the like.

また本実施形態では、デフォーカスマップは視差を有する関係にある画像群に基づいて生成されるものとして説明したが、撮像画像に対応し、撮像範囲における被写体の距離分布を取得可能であれば、この方式に限られるものではない。デフォーカスマップの生成方式は、例えばピントや絞り値が異なる2枚の画像の相関からデフォーカス量を導出するDFD(Depth From Defocus)方式であってもよい。あるいは、被写体の距離分布は、TOF(Time of Flight)方式等の測距センサモジュールから得た距離分布に関連する情報を用いて導出されるものであってもよい。いずれの方式で得た距離分布であっても、距離分布に係るヒストグラムを取得する領域を、注目被写体に係る領域に限定する態様とすることで、同様に本発明を実現することができる。 Furthermore, in this embodiment, the defocus map has been described as being generated based on a group of images having a parallax relationship, but if it corresponds to the captured image and it is possible to obtain the distance distribution of the subject in the imaging range, The method is not limited to this method. The defocus map generation method may be, for example, a DFD (Depth From Defocus) method in which the amount of defocus is derived from the correlation between two images with different focuses or aperture values. Alternatively, the distance distribution of the subject may be derived using information related to the distance distribution obtained from a distance measurement sensor module such as a TOF (Time of Flight) method. Regardless of the distance distribution obtained by any method, the present invention can be similarly implemented by limiting the area from which the histogram related to the distance distribution is obtained to the area related to the subject of interest.

本実施形態では、撮像範囲における被写体の距離分布を示す距離情報として、デフォーカス量を参照するデフォーカスマップを用いるものとして説明したが、本発明の実施はこれに限られるものではない。即ち、被写体の距離分布を示す情報は、デフォーカス量ではなく、例えばデフォーカス量の導出において導出されたずらし量(像ずれ量)や、デフォーカス量にもとづいて導出される被写体距離を値として格納するものであってもよい。前者の場合、撮像素子の画素ピッチPYや一対の測距瞳を通過する光束の重心の開き角で定まる変換係数KXを保持しておく必要がなく、情報量を減らすことができる。また後者の場合は、ユーザが把握しやすい数値となっているため、例えば表示部110を介して処理の過程で提示することで、どのような表現の画像が生成されるかをユーザに好適に伝えることができる。 Although the present embodiment has been described as using a defocus map that refers to the amount of defocus as the distance information indicating the distance distribution of the subject in the imaging range, the implementation of the present invention is not limited to this. In other words, the information indicating the distance distribution of the object is not determined by the amount of defocus, but by using, for example, the amount of shift (image shift amount) derived in deriving the amount of defocus, or the object distance derived based on the amount of defocus as a value. It may also be something that is stored. In the former case, there is no need to hold the conversion coefficient KX determined by the pixel pitch PY of the image sensor or the aperture angle of the center of gravity of the light beam passing through the pair of distance measuring pupils, and the amount of information can be reduced. In the latter case, since the numerical value is easy for the user to understand, for example, by presenting it during the processing process via the display unit 110, it is possible to suitably show the user what kind of expression the image will be generated. I can tell you.

また本実施形態の画像加工処理では、注目被写体とする人物被写体500に合焦している条件で撮像が行われた態様について説明したが、本発明の実施はこれに限られるものではない。即ち、本発明によれば、合焦していない状態の被写体を注目被写体とした場合であっても、該被写体の領域のデフォーカス量を参照して被写体の距離範囲に存在する画素を特定することができるため、撮像時における合焦の有無は本発明の実施に無関係である。 Furthermore, in the image processing processing of the present embodiment, a mode has been described in which imaging is performed under the condition that the human subject 500 as the subject of interest is in focus, but the implementation of the present invention is not limited to this. That is, according to the present invention, even when an out-of-focus subject is set as the subject of interest, pixels existing within the distance range of the subject are identified by referring to the amount of defocus in the area of the subject. Therefore, the presence or absence of focus during imaging is irrelevant to the implementation of the present invention.

なお、処理負荷やヒストグラム自体のデータ量の低減の観点からは、ヒストグラムの横軸で表される階級数を低減させることで、ヒストグラム構成に係る演算量を低減することができる。 Note that from the viewpoint of reducing the processing load and the amount of data of the histogram itself, the amount of calculations related to the histogram configuration can be reduced by reducing the number of classes represented by the horizontal axis of the histogram.

例えば、図16に示されるように、撮像範囲に複数の被写体が分布している態様について検討する。図16は、撮像範囲における被写体の配置を示した鳥瞰図である。図において、撮像地点1600はデジタルカメラ100が設置される位置(撮像面の位置)を示し、光学系104として焦点距離が200mmのレンズが採用されて撮像が行われるものとする。ここで、被写体A1601は、撮像地点1600よりも2m奥に存在し、デジタルカメラ100は被写体A1601に合焦させた状態で撮像を行うものとする。また被写体B1602は撮像地点1600よりも2.1m奥、被写体C1603は撮像地点1600よりも1m奥、被写体D1604は撮像地点1600よりも100m奥に存在するよう分布しており、奥行方向に広範囲に被写体が存在するシーンとなっている。このような配置態様において、合焦させた被写体A1601の距離範囲のみをデフォーカスマップから抽出するとする。なお、ヒストグラムの階級数は32階級(0~31)に設定されるものとし、ヒストグラムの構成時には、デフォーカス量の値は、最小値が0~最大値が31までのいずれかの分類となるように正規化される。 For example, as shown in FIG. 16, consider a mode in which a plurality of subjects are distributed in the imaging range. FIG. 16 is a bird's-eye view showing the arrangement of subjects in the imaging range. In the figure, an imaging point 1600 indicates the position where the digital camera 100 is installed (the position of the imaging surface), and it is assumed that a lens with a focal length of 200 mm is employed as the optical system 104 to perform imaging. Here, it is assumed that the subject A1601 exists 2 m further back than the imaging point 1600, and the digital camera 100 performs imaging while focusing on the subject A1601. In addition, the object B1602 is 2.1m behind the imaging point 1600, the object C1603 is 1m behind the imaging point 1600, and the object D1604 is 100m behind the imaging point 1600. It is a scene where there is. In this arrangement, it is assumed that only the distance range of the focused subject A1601 is extracted from the defocus map. Note that the number of classes in the histogram is set to 32 classes (0 to 31), and when configuring the histogram, the value of the defocus amount is classified into one of the following categories, from the minimum value of 0 to the maximum value of 31. It is normalized as follows.

レンズを境界とする被写体側(物体側)と撮像素子の(像面側)の結像関係を、図18のように表される。該レンズの焦点距離をfとすると、
1/Zo+1/So=1/f
1/Zdef+1/(So+def)=1/f
となる。ここで、Zoは合焦被写体の物体側距離、Zdefはデフォーカス被写体の物体側距離、Soは合焦被写体の像面側距離、Sdefはデフォーカス被写体の像面側距離である。これらの式から
So=(Zo・f)/(Zo-f)
Sdef=(Zdef・f)/(Zdef-f)
を導くことができるため、デフォーカス被写体に係るデフォーカス量defは、
def=Sdef-So
として導出できる。
The imaging relationship between the subject side (object side) with the lens as the boundary and the image sensor (image plane side) is expressed as shown in FIG. If the focal length of the lens is f, then
1/Zo+1/So=1/f
1/Zdef+1/(So+def)=1/f
becomes. Here, Zo is the object side distance of the focused subject, Zdef is the object side distance of the defocused subject, So is the image side distance of the focused subject, and Sdef is the image side distance of the defocused subject. From these formulas, So=(Zo・f)/(Zo−f)
Sdef=(Zdef・f)/(Zdef−f)
can be derived, so the defocus amount def for the defocused subject is:
def=Sdef-So
It can be derived as

図17に示されるように、各被写体の被写体距離とデフォース量との関係が導かれた場合、撮像画像に対応するデフォーカスマップの全域についてヒストグラムを構成しようとすると、少なくとも被写体Dから被写体Cまでのデフォーカス量を含める必要がある。より詳しくは、少なくとも被写体D1604のデフォーカス量-21.82mmをヒストグラムの0とし、被写体Cのデフォーカス量27.78mmをヒストグラムの31に分類するように会長の正規化が必要となる。そのため、ひとつの階級におけるデフォーカス量の階級幅は(|-21.82|+|27.78|)/31=1.6mmとなる。故に、ヒストグラムにおけるデフォーカス量の分解能よりも、被写体B1602のデフォーカス量の方が小さくなり、被写体A1601と被写体B1602とをヒストグラムに基づいて分離することができない。ここで、例えば得られたデフォーカス分布に応じて、ヒストグラムの階級幅を狭めて階級数を上げれば、被写体A1601と被写体B1602を分離することは可能であるが、先に述べたようにヒストグラムの階級数は低い方が、演算量の観点で有利である。 As shown in FIG. 17, when the relationship between the subject distance and the amount of deforce for each subject is derived, if you try to construct a histogram for the entire area of the defocus map corresponding to the captured image, at least from subject D to subject C. It is necessary to include the amount of defocus. More specifically, Chairman's normalization is required so that at least the defocus amount of -21.82 mm of the subject D1604 is classified as 0 in the histogram, and the defocus amount of 27.78 mm of the subject C is classified as 31 in the histogram. Therefore, the class width of the defocus amount in one class is (|−21.82|+|27.78|)/31=1.6 mm. Therefore, the defocus amount of the subject B1602 is smaller than the resolution of the defocus amount in the histogram, and the subject A1601 and the subject B1602 cannot be separated based on the histogram. Here, it is possible to separate subject A1601 and subject B1602 by narrowing the class width of the histogram and increasing the number of classes according to the obtained defocus distribution. A lower number of classes is advantageous in terms of the amount of calculation.

一方で、本発明によればヒストグラムの構成を、注目被写体に係る領域に限定してヒストグラムを構成するため、そもそもサンプル数が少なくて済むだけでなく、領域に含まれない被写体の距離を除外できる。即ち、ヒストグラムの取得領域を被写体A1601の近傍に限定するため、例えば被写体C1603や被写体D1604のデフォーカス量を正規化に含める必要がなくなるため、ヒストグラムの階級をデフォーカス量0mm近傍で割り当てることができる。つまり、ヒストグラムの取得領域に含まれるデフォーカス量の分布に対して予め定められた階級数を割り振ることができるため、階級幅を狭めるように設定してより精査に解析を行うことができる。故に、ヒストグラムの階級数を上げなくても被写体A1601と被写体B1602とを、デフォーカスマップのヒストグラムを参考にして分離することができる。その結果、被写体A1601のみの距離範囲をデフォーカスマップから好適に抽出することが実現できる。 On the other hand, according to the present invention, since the histogram is configured by limiting it to the area related to the subject of interest, not only does the number of samples need to be small in the first place, but also the distances of subjects that are not included in the area can be excluded. . That is, since the histogram acquisition area is limited to the vicinity of the subject A1601, it is not necessary to include the defocus amount of the subject C1603 or the subject D1604 in the normalization, for example, so that the histogram class can be assigned near the defocus amount of 0 mm. . In other words, since a predetermined number of classes can be assigned to the distribution of defocus amounts included in the histogram acquisition area, it is possible to perform a more detailed analysis by narrowing the range of classes. Therefore, the subject A 1601 and the subject B 1602 can be separated with reference to the histogram of the defocus map without increasing the number of histogram classes. As a result, it is possible to suitably extract the distance range of only the subject A1601 from the defocus map.

[変形例]
上述した実施形態では、撮像画像から人物被写体の顔領域を検出して注目被写体を特定する態様について説明したが、このような態様において、例えば、検出部301が顔領域を複数検出するケースも存在し得る。このとき、1人の人物被写体についてのみ合焦するよう、該被写体の距離範囲を特定するためには、以下のように処理すればよい。
[Modified example]
In the above-described embodiment, a mode has been described in which a face area of a human subject is detected from a captured image to identify a subject of interest. However, in such a mode, for example, there are cases in which the detection unit 301 detects a plurality of face areas. It is possible. At this time, in order to specify the distance range of one human subject so that only one human subject is in focus, the following processing may be performed.

例えば、図15に示されるように、撮像範囲中に、人物被写体1500aと、その後方に位置する人物被写体1500bとが存在し、検出部301によって検出された各被写体の顔領域の中心が顔中心1501aと顔中心1501bが配置されているとする。このとき、人物被写体1500aの距離範囲の被写体の領域のみを抽出すべく、人物被写体1500aの顔領域に対して予め設定した拡大率(MAG_X, MAG_Y)を乗じた、破線で示される解析領域1502を設定したとする。しかしながら、図示されるように、人物被写体1500aと人物被写体1500bとが近接している態様では、解析領域1502に人物被写体1500bの像が含まれ得る。結果、解析領域1502についてデフォーカス量のヒストグラムを構成したとしても、人物被写体1500aと人物被写体1500bの距離範囲を好適に分離することができない可能性がある。 For example, as shown in FIG. 15, there are a human subject 1500a and a human subject 1500b located behind it in the imaging range, and the center of the face area of each subject detected by the detection unit 301 is the face center. Assume that a face center 1501a and a face center 1501b are arranged. At this time, in order to extract only the area of the subject within the distance range of the human subject 1500a, an analysis area 1502 indicated by a broken line is created by multiplying the face area of the human subject 1500a by a preset magnification rate (MAG_X, MAG_Y). Suppose you set it. However, as shown in the figure, in a mode where the human subject 1500a and the human subject 1500b are close to each other, the image of the human subject 1500b may be included in the analysis area 1502. As a result, even if a histogram of the defocus amount is constructed for the analysis region 1502, there is a possibility that the distance range between the human subject 1500a and the human subject 1500b cannot be appropriately separated.

従って、このように検出部301が複数の顔領域を演出し、いずれかの顔領域に係る被写体の距離範囲のみを抽出したい場合、拡大率は、ヒストグラムを構成する解析領域が人物被写体1500bの領域を除外した調整領域1503となるよう、調整されてよい。具体的には領域設定部302は、顔中心1501aの座標(FACE1_POS_X, FACE1_POS_Y)と顔中心1501bの座標(FACE2_POS_X, FACE2_POS_Y)とがなす距離応じて拡大率を補正することで、調整領域1503を設定すればよい。 Therefore, when the detection unit 301 produces a plurality of face areas in this way and you want to extract only the distance range of the subject related to any of the face areas, the magnification rate is such that the analysis area that makes up the histogram is the area of the human subject 1500b. The adjustment may be made such that the adjustment area 1503 excludes the. Specifically, the area setting unit 302 sets the adjustment area 1503 by correcting the magnification rate according to the distance between the coordinates (FACE1_POS_X, FACE1_POS_Y) of the face center 1501a and the coordinates (FACE2_POS_X, FACE2_POS_Y) of the face center 1501b. do it.

発明は上記実施形態に制限されるものではなく、発明の精神及び範囲から離脱することなく、様々な変更及び変形が可能である。従って、発明の範囲を公にするために請求項を添付する。 The invention is not limited to the embodiments described above, and various changes and modifications can be made without departing from the spirit and scope of the invention. Therefore, the following claims are hereby appended to disclose the scope of the invention.

[その他の実施形態]
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
[Other embodiments]
The present invention provides a system or device with a program that implements one or more functions of the embodiments described above via a network or a storage medium, and one or more processors in a computer of the system or device reads and executes the program. This can also be achieved by processing. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.

100:デジタルカメラ、101:システム制御部、102:ROM、103:RAM、104:光学系、105:撮像部、106:A/D変換部、107:画像処理部、108:記録媒体、109:操作入力部、110:表示部、300:生成部、301:検出部、302:領域設定部、303:構成部、304:領域抽出部、305:効果処理部 100: Digital camera, 101: System control unit, 102: ROM, 103: RAM, 104: Optical system, 105: Imaging unit, 106: A/D conversion unit, 107: Image processing unit, 108: Recording medium, 109: Operation input unit, 110: Display unit, 300: Generation unit, 301: Detection unit, 302: Area setting unit, 303: Configuration unit, 304: Area extraction unit, 305: Effect processing unit

Claims (14)

撮像範囲の被写体を撮像した撮像画像と、該撮像画像と対応する領域についての、前記撮像範囲における被写体の奥行き方向の距離分布を示す値を格納した距離情報と、を取得する取得手段と、
前記撮像画像について注目被写体を決定する決定手段と、
前記撮像画像における前記注目被写体の位置に基づいて、距離分布を解析する解析領域を設定する設定手段と、
前記距離情報のうちの前記解析領域に含まれる値の頻度分布に基づいて、該解析領域に含まれる被写体が分布する値範囲を特定する特定手段と、
前記値範囲に含まれる情報を示す前記距離情報の領域を抽出することで、少なくとも前記注目被写体を含む被写体領域を抽出する抽出手段と、
を有することを特徴とする画像処理装置。
acquisition means for acquiring a captured image of a subject in an imaging range, and distance information storing a value indicating a distance distribution in a depth direction of the subject in the imaging range for an area corresponding to the captured image;
determining means for determining a subject of interest for the captured image;
Setting means for setting an analysis region for analyzing distance distribution based on the position of the subject of interest in the captured image;
Identification means for identifying a value range in which objects included in the analysis area are distributed based on a frequency distribution of values included in the analysis area of the distance information;
Extracting means for extracting a subject region including at least the subject of interest by extracting a region of the distance information indicating information included in the value range;
An image processing device comprising:
前記撮像画像のうちの、前記抽出手段により抽出された前記被写体領域に含まれる画素と、前記被写体領域に含まれない画素に対して異なる画像処理を適用することで、加工画像を生成する生成手段をさらに有することを特徴とする請求項1に記載の画像処理装置。 A generation unit that generates a processed image by applying different image processing to pixels included in the subject area extracted by the extraction unit and pixels not included in the subject area, of the captured image. The image processing apparatus according to claim 1, further comprising: an image processing apparatus; 前記生成手段は、前記被写体領域から前記注目被写体の領域をさらに抽出し、前記撮像画像の前記被写体領域に含まれる画素のうち、該注目被写体の領域に含まれる画素と、該注目被写体の領域に含まれない画素に対して異なる画像処理を適用することを特徴とする請求項2に記載の画像処理装置。 The generating means further extracts a region of the subject of interest from the subject region, and extracts a region of the subject of interest from among pixels included in the subject region of the captured image and a region of the subject of interest. The image processing apparatus according to claim 2, wherein different image processing is applied to pixels that are not included. 前記特定手段は、前記距離情報の前記解析領域に含まれる値の頻度分布において、閾値を上回る頻度を示す値に基づいて前記値範囲を特定することを特徴とする請求項1乃至3のいずれか1項に記載の画像処理装置。 4. The specifying means specifies the value range based on a value that indicates a frequency exceeding a threshold value in a frequency distribution of values included in the analysis area of the distance information. The image processing device according to item 1 . 前記特定手段は、前記撮像画像の被写界深度が浅いほど、頻度の前記閾値を低減させて前記値範囲を特定することを特徴とする請求項に記載の画像処理装置。 The image processing apparatus according to claim 4 , wherein the specifying unit specifies the value range by reducing the frequency threshold as the depth of field of the captured image becomes shallower. 前記特定手段は、前記解析領域に含まれる値の範囲に応じて、前記頻度分布における階級幅を変更することを特徴とする請求項またはに記載の画像処理装置。 6. The image processing apparatus according to claim 4 , wherein the specifying means changes a class width in the frequency distribution according to a range of values included in the analysis area. 前記決定手段は、前記撮像画像に含まれる所定の被写体を検出することで、検出した該所定の被写体のうちから前記注目被写体を決定し、
前記設定手段は、前記注目被写体に対応する前記所定の被写体の像が現れる領域を含む所定の大きさの領域を、前記解析領域として設定する
ことを特徴とする請求項1乃至のいずれか1項に記載の画像処理装置。
The determining means determines the object of interest from among the detected predetermined objects by detecting a predetermined object included in the captured image,
7. The setting means sets an area of a predetermined size including an area where an image of the predetermined subject corresponding to the subject of interest appears as the analysis area. The image processing device described in .
前記設定手段は、前記撮像画像の被写界深度が浅いほど、前記所定の大きさの領域を拡大させて前記解析領域を設定することを特徴とする請求項に記載の画像処理装置。 8. The image processing apparatus according to claim 7 , wherein the setting unit sets the analysis area by enlarging the area of the predetermined size as the depth of field of the captured image becomes shallower. 前記設定手段は、前記注目被写体に対応する前記所定の被写体の像が現れる領域を含む所定の大きさの領域に、前記決定手段により検出された、前記注目被写体とは異なる前記所定の被写体の像が現れる領域が含まれる場合に、該異なる所定の被写体の像が現れる領域を含まないように、前記解析領域を変形することを特徴とする請求項またはに記載の画像処理装置。 The setting means includes an image of the predetermined subject, which is different from the subject of interest, detected by the determining means, in an area of a predetermined size that includes an area where an image of the predetermined subject corresponding to the subject of interest appears. 9. The image processing apparatus according to claim 7 , wherein when the analysis area includes an area where an image of the different predetermined subject appears, the analysis area is transformed so as not to include an area where an image of the different predetermined subject appears. 前記距離情報は、前記撮像画像と同一の画素構造を有する2次元情報であり、
前記距離情報の各画素に格納される値は、前記撮像画像において該画素に存在する被写体の像のデフォーカス量である
ことを特徴とする請求項1乃至のいずれか1項に記載の画像処理装置。
The distance information is two-dimensional information having the same pixel structure as the captured image,
The image according to any one of claims 1 to 9 , wherein the value stored in each pixel of the distance information is a defocus amount of an image of a subject existing at the pixel in the captured image. Processing equipment.
前記距離情報は、前記撮像画像と同一の画素構造を有する2次元情報であって、異なる複数の視点で前記撮像範囲を撮像した画像群に基づいて値が格納される情報であり、
前記距離情報の各画素に格納される値は、前記撮像画像において該画素に存在する被写体の、前記画像群における相対的な像ずれ量である
ことを特徴とする請求項1乃至のいずれか1項に記載の画像処理装置。
The distance information is two-dimensional information having the same pixel structure as the captured image, and is information in which a value is stored based on a group of images captured in the imaging range from a plurality of different viewpoints,
Any one of claims 1 to 9 , wherein the value stored in each pixel of the distance information is a relative image shift amount in the group of images of a subject existing at the pixel in the captured image. The image processing device according to item 1.
前記距離情報は、前記撮像画像と同一の画素構造を有する2次元情報であり、
前記距離情報の各画素に格納される値は、前記撮像画像において該画素に存在する被写体の奥行き方向の距離である
ことを特徴とする請求項1乃至のいずれか1項に記載の画像処理装置。
The distance information is two-dimensional information having the same pixel structure as the captured image,
The image processing according to any one of claims 1 to 9 , wherein the value stored in each pixel of the distance information is a distance in the depth direction of a subject existing at the pixel in the captured image. Device.
撮像範囲の被写体を撮像した撮像画像と、該撮像画像と対応する領域についての、前記撮像範囲における被写体の奥行き方向の距離分布を示す値を格納した距離情報と、を取得する取得工程と、
前記撮像画像について注目被写体を決定する決定工程と、
前記撮像画像における前記注目被写体の位置に基づいて、距離分布を解析する解析領域を設定する設定工程と、
前記距離情報のうちの前記解析領域に含まれる値の頻度分布に基づいて、該解析領域に含まれる被写体が分布する値範囲を特定する特定工程と、
前記値範囲に含まれる情報を示す前記距離情報の領域を抽出することで、少なくとも前記注目被写体を含む被写体領域を抽出する抽出工程と、
を有することを特徴とする画像処理方法。
an acquisition step of acquiring a captured image of a subject in an imaging range, and distance information storing a value indicating a distance distribution in a depth direction of the subject in the imaging range for an area corresponding to the captured image;
a determining step of determining a subject of interest for the captured image;
a setting step of setting an analysis region for analyzing distance distribution based on the position of the subject of interest in the captured image;
a specifying step of specifying a value range in which objects included in the analysis area are distributed based on a frequency distribution of values included in the analysis area of the distance information;
an extraction step of extracting a subject region including at least the subject of interest by extracting a region of the distance information indicating information included in the value range;
An image processing method comprising:
コンピュータを、請求項1乃至1のいずれか1項に記載の画像処理装置の各手段として機能させるためのプログラム。 A program for causing a computer to function as each means of the image processing apparatus according to any one of claims 1 to 12 .
JP2019084430A 2019-04-25 2019-04-25 Image processing device, image processing method and program Active JP7373297B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019084430A JP7373297B2 (en) 2019-04-25 2019-04-25 Image processing device, image processing method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019084430A JP7373297B2 (en) 2019-04-25 2019-04-25 Image processing device, image processing method and program

Publications (2)

Publication Number Publication Date
JP2020181401A JP2020181401A (en) 2020-11-05
JP7373297B2 true JP7373297B2 (en) 2023-11-02

Family

ID=73024708

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019084430A Active JP7373297B2 (en) 2019-04-25 2019-04-25 Image processing device, image processing method and program

Country Status (1)

Country Link
JP (1) JP7373297B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024034449A1 (en) * 2022-08-06 2024-02-15 モルゲンロット株式会社 Information processing device, and information processing method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014197824A (en) 2013-03-05 2014-10-16 キヤノン株式会社 Image processing apparatus, image capturing apparatus, image processing method, and program
JP2017126979A (en) 2016-01-13 2017-07-20 キヤノン株式会社 Image processing apparatus, method of controlling image processing apparatus, imaging apparatus, and program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014197824A (en) 2013-03-05 2014-10-16 キヤノン株式会社 Image processing apparatus, image capturing apparatus, image processing method, and program
JP2017126979A (en) 2016-01-13 2017-07-20 キヤノン株式会社 Image processing apparatus, method of controlling image processing apparatus, imaging apparatus, and program

Also Published As

Publication number Publication date
JP2020181401A (en) 2020-11-05

Similar Documents

Publication Publication Date Title
US9607240B2 (en) Image processing apparatus, image capturing apparatus, image processing method, image capturing method, and non-transitory computer-readable medium for focus bracketing
US9208396B2 (en) Image processing method and device, and program
CN105391932B (en) Image processing apparatus and its control method and photographic device and its control method
US9503633B2 (en) Image processing apparatus, image capturing apparatus, image processing method, and storage medium
US9076214B2 (en) Image acquisition apparatus and image processing apparatus using selected in-focus image data
US10855903B2 (en) Image processing apparatus, image capturing apparatus, control method and recording medium
JP2016024489A (en) Image processing apparatus, imaging device, image processing method, and program
EP2635019B1 (en) Image processing device, image processing method, and program
JP6611531B2 (en) Image processing apparatus, image processing apparatus control method, and program
JP6234401B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
US11812137B2 (en) Measurement apparatus, image capturing apparatus, control method, and recording medium
JP6529360B2 (en) Image processing apparatus, imaging apparatus, image processing method and program
JP2020009180A (en) Information processing apparatus, imaging apparatus, image processing method, and program
JP7373297B2 (en) Image processing device, image processing method and program
JP2018018425A (en) Image processing device and image processing method
JP6728020B2 (en) Image processing apparatus, image processing method and program
JP7437915B2 (en) Image processing device, imaging device, image processing method, and program
JP2016099322A (en) Imaging device, control method of imaging device, and program
KR101599434B1 (en) Space detecting apparatus for image pickup apparatus using auto focusing and the method thereof
JP6448324B2 (en) Image processing apparatus, imaging apparatus, image processing system, image processing method, and image processing program
JP7346021B2 (en) Image processing device, image processing method, imaging device, program and recording medium
JP2021164066A (en) Image processing device, imaging apparatus, image processing method and program
JP6245974B2 (en) Image processing apparatus, control method, and program
JP2023069386A (en) Image measurement device, method and program
JP2021135725A (en) Image processing apparatus, control method of the same and program

Legal Events

Date Code Title Description
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20210103

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210113

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220425

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230407

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230605

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: 20230922

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20231023

R151 Written notification of patent or utility model registration

Ref document number: 7373297

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151