JP5949306B2 - Image processing apparatus, imaging apparatus, and image processing program - Google Patents

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

Info

Publication number
JP5949306B2
JP5949306B2 JP2012179351A JP2012179351A JP5949306B2 JP 5949306 B2 JP5949306 B2 JP 5949306B2 JP 2012179351 A JP2012179351 A JP 2012179351A JP 2012179351 A JP2012179351 A JP 2012179351A JP 5949306 B2 JP5949306 B2 JP 5949306B2
Authority
JP
Japan
Prior art keywords
area
region
image processing
subject
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
JP2012179351A
Other languages
Japanese (ja)
Other versions
JP2014039099A (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.)
Nikon Corp
Original Assignee
Nikon Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nikon Corp filed Critical Nikon Corp
Priority to JP2012179351A priority Critical patent/JP5949306B2/en
Publication of JP2014039099A publication Critical patent/JP2014039099A/en
Application granted granted Critical
Publication of JP5949306B2 publication Critical patent/JP5949306B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Automatic Focus Adjustment (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)
  • Focusing (AREA)
  • Indication In Cameras, And Counting Of Exposures (AREA)

Description

本発明は、画像処理装置、撮像装置、および画像処理プログラムに関する。   The present invention relates to an image processing device, an imaging device, and an image processing program.

従来、被写体抽出に関する様々な技術が考えられている。例えば、特許文献1の発明では、被写体形状の変化量に応じてAF測距枠を変形することにより、被写体がカメラ方向に移動する場合でも、被写体に対して最適に自動焦点調節する撮像装置が開示されている。   Conventionally, various techniques relating to subject extraction have been considered. For example, in the invention of Patent Document 1, an imaging device that automatically adjusts an automatic focus on a subject even when the subject moves in the camera direction by deforming an AF distance measurement frame according to the amount of change in the subject shape. It is disclosed.

特開2009−069748号公報JP 2009-069748 A

ところで、被写体抽出に際しては、抽出した被写体領域にバラツキが生じる場合や、抽出自体が不安定である場合がある。このような場合には、被写体抽出により抽出した被写体領域の表示に際して、ユーザによる視認性が低下する場合もある。   By the way, when extracting a subject, the extracted subject region may vary, or the extraction itself may be unstable. In such a case, when the subject area extracted by subject extraction is displayed, the visibility by the user may be reduced.

本発明は、前記の点に鑑みてなされたものであり、特徴量に基づいて検出した被写体領域の表示に際にして、画像処理の精度を維持しつつ、ユーザにとって視認性の高い表示を行うことを目的とする。   The present invention has been made in view of the above points, and performs display with high visibility for a user while maintaining the accuracy of image processing when displaying a subject area detected based on a feature amount. For the purpose.

本発明の画像処理装置は、処理対象の画像データを取得する取得部と、前記画像データにより示される画像の特徴量を算出し、前記特徴量に基づいて定まる被写体領域を検出する領域検出部と、前記画像に対して、前記領域検出部により検出した前記被写体領域の情報に基づいて、画像処理を施す画像処理部と、前記領域検出部により検出した前記被写体領域もしくは、前記被写体領域に基づく領域を視認可能に表示する表示部と、前記画像処理における注目領域である第1の領域と、前記第1の領域とは異なる領域であり、前記表示部により前記被写体領域もしくは、前記被写体領域に基づく領域を表示する際の表示領域である第2の領域とを、前記領域検出部により検出した前記被写体領域の情報に基づいて決定する制御部とを備える。   An image processing apparatus according to the present invention includes an acquisition unit that acquires image data to be processed, an area detection unit that calculates a feature amount of an image indicated by the image data, and detects a subject region determined based on the feature amount; An image processing unit that performs image processing on the image based on information on the subject area detected by the region detection unit, and the subject region detected by the region detection unit or a region based on the subject region Is a region that is different from the first region that is a region of interest in the image processing, and is based on the subject region or the subject region by the display unit. A control unit that determines a second region, which is a display region when displaying the region, based on information on the subject region detected by the region detection unit.

なお、前記制御部は、ユーザによる前記被写体領域についての視認性を加味して前記第2の領域を決定しても良い。   The control unit may determine the second region in consideration of the visibility of the subject region by the user.

また、前記制御部は、所定の図形への近似を行うことにより前記第1の領域および前記第2の領域を決定し、前記近似における精度は、前記第1の領域の方が前記第2の領域よりも高い、または、前記第1の領域と前記第2の領域とで同じであっても良い。   In addition, the control unit determines the first region and the second region by performing approximation to a predetermined figure, and the accuracy in the approximation is higher in the first region than in the second region. It may be higher than the region, or may be the same in the first region and the second region.

また、前記近似における精度は、前記図形の形状と、前記図形の大きさと、近似に用いる前記図形の個数との少なくとも1つにより決まっても良い。   The accuracy in the approximation may be determined by at least one of the shape of the graphic, the size of the graphic, and the number of the graphic used for the approximation.

また、前記制御部は、前記画像処理装置における処理能力と、前記第1の領域および前記第2の領域の決定に要求される速度と、前記第1の領域および前記第2の領域の決定に要求される精度との少なくとも1つに基づいて、前記第1の領域および前記第2の領域に関する前記近似における精度を決定しても良い。   The control unit may determine the processing capability of the image processing apparatus, the speed required for determining the first area and the second area, and the determination of the first area and the second area. Based on at least one of the required accuracy, the accuracy in the approximation with respect to the first region and the second region may be determined.

また、前記制御部は、前記領域検出部により複数の前記被写体領域が検出された場合に、前記第2の領域については、複数の前記被写体領域もしくは、それぞれの前記被写体領域に対応する複数の前記表示領域の重複具合に応じて、前記第2の領域を決定しても良い。   In addition, when the plurality of subject regions are detected by the region detection unit, the control unit may include a plurality of the subject regions or a plurality of the subject regions corresponding to the respective subject regions. The second area may be determined according to the overlapping state of the display areas.

また、前記制御部は、時間的に連続或いは間欠連続した複数の前記画像に関する前記第2の領域について、位置と大きさと形状との少なくとも1つを比較し、変化の度合が所定の範囲以内である場合には、同じ前記第2の領域としても良い。   Further, the control unit compares at least one of the position, the size, and the shape of the second region related to the plurality of images that are temporally continuous or intermittently continuous, and the degree of change is within a predetermined range. In some cases, the second region may be the same.

また、前記制御部は、前記領域検出部により検出した前記被写体領域の面積変化に応じて、前記第2の領域を決定しても良い。   Further, the control unit may determine the second region in accordance with a change in the area of the subject region detected by the region detection unit.

また、前記制御部は、複数の前記画像に関する前記第2の領域について、アスペクト比を固定してそれぞれの前記第2の領域を決定しても良い。   Further, the control unit may determine each of the second regions with a fixed aspect ratio for the second regions related to the plurality of images.

また、前記制御部は、時間的に連続或いは間欠連続する2枚の前記画像に関する前記第2の領域について、位置と大きさとアスペクト比との少なくとも1つを固定してそれぞれの前記第2の領域を決定しても良い。   Further, the control unit fixes at least one of a position, a size, and an aspect ratio for each of the second regions related to the two images that are continuous or intermittently continuous in time. May be determined.

本発明の撮像装置は、光学系による像を撮像して画像を生成する撮像部と、上述した何れかに記載の画像処理装置とを備え、 前記取得部は、前記撮像部から前記画像を取得する。   An imaging apparatus according to the present invention includes an imaging unit that captures an image by an optical system and generates an image, and the image processing device according to any one of the above-described units, and the acquisition unit acquires the image from the imaging unit. To do.

なお、前記第1の領域は、焦点調節に関わる領域であっても良い。   The first area may be an area related to focus adjustment.

また、前記第1の領域は、前記領域検出部により検出した前記被写体領域の周辺エッジを含み、前記被写体領域よりも広い領域と前記被写体領域に内接する領域との少なくとも一方であっても良い。   The first region may include at least one of a region wider than the subject region and a region inscribed in the subject region, including a peripheral edge of the subject region detected by the region detection unit.

また、前記第1の領域は、露出調整に関わる領域であっても良い。   The first area may be an area related to exposure adjustment.

また、前記第1の領域は、前記領域検出部により検出した前記被写体領域に内接する領域であっても良い。   The first area may be an area inscribed in the subject area detected by the area detecting unit.

本発明の画像処理プログラムは、コンピュータに、処理対象の画像データを取得する取得手順と、前記画像データにより示される画像の特徴量を算出し、前記特徴量に基づいて定まる被写体領域を検出する領域検出手順と、前記画像に対して、前記領域検出手順において検出した前記被写体領域の情報に基づいて、画像処理を施す画像処理手順と、前記領域検出手順において検出した前記被写体領域もしくは、前記被写体領域に基づく領域を表示部に視認可能に表示する表示手順と、前記画像処理における注目領域である第1の領域と、前記第1の領域とは異なる領域であり、前記表示手順により前記被写体領域もしくは、前記被写体領域に基づく領域を表示する際の表示領域である第2の領域とを、前記領域検出手順において検出した前記被写体領域の情報に基づいて決定する制御手順とを実行させる。   An image processing program according to the present invention is an area for detecting an object region determined based on an acquisition procedure for acquiring image data to be processed, a feature amount of an image indicated by the image data, and a computer. A detection procedure, an image processing procedure for performing image processing on the image based on information on the subject region detected in the region detection procedure, and the subject region or the subject region detected in the region detection procedure. A display procedure for displaying a region based on the display unit in a visible manner, a first region that is a region of interest in the image processing, and a region different from the first region. The second area which is a display area when displaying an area based on the subject area is detected in the area detection procedure. To execute a control procedure for determining based on the information of Utsushitai area.

本発明によれば、特徴量に基づいて検出した被写体領域の表示に際にして、画像処理の精度を維持しつつ、ユーザにとって視認性の高い表示を行うことができる。   According to the present invention, it is possible to perform display with high visibility for a user while maintaining the accuracy of image processing when displaying a subject area detected based on a feature amount.

レンズ鏡筒10と、撮像装置20と、記憶媒体40との構成を示すブロック図である。2 is a block diagram illustrating configurations of a lens barrel 10, an imaging device 20, and a storage medium 40. FIG. 自動検出モード実行時のCPU26の動作を示すフローチャートである。It is a flowchart which shows operation | movement of CPU26 at the time of automatic detection mode execution. 自動検出モード実行時のCPU26の動作を示すフローチャート(続き)である。It is a flowchart (continuation) which shows operation | movement of CPU26 at the time of automatic detection mode execution. 自動検出モード実行時のCPU26の動作を示すフローチャート(続き)である。It is a flowchart (continuation) which shows operation | movement of CPU26 at the time of automatic detection mode execution. 自動検出モード実行時のCPU26の動作を示すフローチャート(続き)である。It is a flowchart (continuation) which shows operation | movement of CPU26 at the time of automatic detection mode execution. AF用注目領域の設定について説明する図である。It is a figure explaining the setting of the attention area for AF. AE用注目領域の設定について説明する図である。It is a figure explaining the setting of the attention area for AE. 表示領域の設定について説明する図である。It is a figure explaining the setting of a display area. 表示領域の設定について説明する別の図である。It is another figure explaining the setting of a display area. 表示領域の設定について説明する別の図である。It is another figure explaining the setting of a display area. 表示領域の設定について説明する別の図である。It is another figure explaining the setting of a display area. 表示領域の設定について説明する別の図である。It is another figure explaining the setting of a display area.

以下、本実施形態について図面を参照して詳細に説明する。   Hereinafter, the present embodiment will be described in detail with reference to the drawings.

本実施形態では、図1に示すようなレンズ鏡筒10と、撮像装置20と、記録媒体40とからなる装置を例に挙げて説明する。   In the present embodiment, a description will be given by taking as an example an apparatus including a lens barrel 10, an imaging device 20, and a recording medium 40 as shown in FIG.

撮像装置20は、レンズ鏡筒10から入射される光学像を撮像する。得られた画像は静止画又は動画の画像として、記憶媒体40に記憶される。   The imaging device 20 captures an optical image incident from the lens barrel 10. The obtained image is stored in the storage medium 40 as a still image or a moving image.

レンズ鏡筒10は、焦点調整レンズ(以下、「AF(Auto Focus)レンズ」と称する)11と、レンズ駆動部12と、AFエンコーダ13と、鏡筒制御部14とを備える。なお、レンズ鏡筒10は、撮像装置20に着脱可能に接続されてもよいし、撮像装置20と一体であってもよい。   The lens barrel 10 includes a focus adjustment lens (hereinafter referred to as an “AF (Auto Focus) lens”) 11, a lens driving unit 12, an AF encoder 13, and a lens barrel control unit 14. The lens barrel 10 may be detachably connected to the imaging device 20 or may be integrated with the imaging device 20.

撮像装置20は、撮像部21と、画像処理装置22と、表示部23と、バッファメモリ部24と、記憶部25と、CPU26と、操作部27と、通信部28とを備える。撮像部21は、撮像素子29と、A/D(Analog/Digital)変換部30とを備える。撮像部21は、設定された撮像条件(例えば絞り値、露出値等)に従って、CPU26により制御される。   The imaging device 20 includes an imaging unit 21, an image processing device 22, a display unit 23, a buffer memory unit 24, a storage unit 25, a CPU 26, an operation unit 27, and a communication unit 28. The imaging unit 21 includes an imaging element 29 and an A / D (Analog / Digital) conversion unit 30. The imaging unit 21 is controlled by the CPU 26 in accordance with the set imaging conditions (for example, aperture value, exposure value, etc.).

レンズ鏡筒10において、AFレンズ11は、レンズ駆動部12により駆動され、撮像装置20の撮像素子29の受光面(光電変換面)に、光学像を導く。AFエンコーダ13は、AFレンズ11の移動を検出し、AFレンズ11の移動量に応じた信号を、鏡筒制御部14に出力する。ここで、AFレンズ11の移動量に応じた信号とは、例えば、AFレンズ11の移動量に応じて位相が変化するサイン(sin)波信号であってもよい。   In the lens barrel 10, the AF lens 11 is driven by the lens driving unit 12 and guides an optical image to the light receiving surface (photoelectric conversion surface) of the imaging element 29 of the imaging device 20. The AF encoder 13 detects the movement of the AF lens 11 and outputs a signal corresponding to the movement amount of the AF lens 11 to the lens barrel control unit 14. Here, the signal corresponding to the movement amount of the AF lens 11 may be, for example, a sine wave signal whose phase changes according to the movement amount of the AF lens 11.

鏡筒制御部14は、撮像装置20のCPU26から入力される駆動制御信号に応じて、レンズ駆動部12を制御する。ここで、駆動制御信号とは、AFレンズ11を光軸方向に駆動させる制御信号である。鏡筒制御部14は、駆動制御信号に応じて、例えば、レンズ駆動部12に出力するパルス電圧のステップ数を変更する。また、鏡筒制御部14は、AFレンズ11の移動量に応じた信号に基づいて、レンズ鏡筒10におけるAFレンズ11の位置(フォーカスポジション)を、撮像装置20のCPU26に出力する。ここで、鏡筒制御部14は、例えば、AFレンズ11の移動量に応じた信号を、AFレンズ11の移動方向に応じて積算することで、レンズ鏡筒10におけるAFレンズ11の移動量(位置)を算出してもよい。レンズ駆動部12は、鏡筒制御部14の制御に応じてAFレンズ11を駆動し、AFレンズ11をレンズ鏡筒10内で光軸方向に移動させる。   The lens barrel control unit 14 controls the lens driving unit 12 in accordance with a drive control signal input from the CPU 26 of the imaging device 20. Here, the drive control signal is a control signal for driving the AF lens 11 in the optical axis direction. The lens barrel control unit 14 changes, for example, the number of steps of the pulse voltage output to the lens driving unit 12 according to the drive control signal. Further, the lens barrel control unit 14 outputs the position (focus position) of the AF lens 11 in the lens barrel 10 to the CPU 26 of the imaging device 20 based on a signal corresponding to the movement amount of the AF lens 11. Here, the lens barrel control unit 14 integrates, for example, signals according to the movement amount of the AF lens 11 according to the movement direction of the AF lens 11, thereby moving the AF lens 11 in the lens barrel 10 ( Position) may be calculated. The lens driving unit 12 drives the AF lens 11 according to the control of the lens barrel control unit 14 and moves the AF lens 11 in the optical axis direction within the lens barrel 10.

撮像装置20において、撮像素子29は、光電変換面を備え、レンズ鏡筒10(光学系)により光電変換面に結像された光学像を電気信号に変換して、A/D変換部30に出力する。撮像素子29は、例えば、CMOS(Complementary Metal Oxide Semiconductor)などの光電変換素子で構成される。また、撮像素子29は、光電変換面の一部の領域について、光学像を電気信号に変換するようにしてもよい(画像切り出し)。また、撮像素子29は、操作部27を介してユーザからの撮影指示を受け付けた際に得られる画像を、A/D変換部30および通信部28を介して記憶媒体40に出力する。一方、撮像素子29は、操作部27を介してユーザからの撮影指示を受け付ける前の状態において、連続的に得られる画像をスルー画像として、バッファメモリ部24及び表示部23に、A/D変換部30を介して出力する。   In the imaging device 20, the imaging element 29 includes a photoelectric conversion surface, converts an optical image formed on the photoelectric conversion surface by the lens barrel 10 (optical system) into an electric signal, and supplies the electric signal to the A / D conversion unit 30. Output. The imaging element 29 is configured by a photoelectric conversion element such as a CMOS (Complementary Metal Oxide Semiconductor), for example. Further, the image sensor 29 may convert an optical image into an electric signal for a partial region of the photoelectric conversion surface (image cutout). Further, the image sensor 29 outputs an image obtained when a photographing instruction from the user is received via the operation unit 27 to the storage medium 40 via the A / D conversion unit 30 and the communication unit 28. On the other hand, the image pickup device 29 converts the continuously obtained image into a through image and converts it into a buffer memory unit 24 and the display unit 23 in the state before accepting a shooting instruction from the user via the operation unit 27. The data is output via the unit 30.

A/D変換部30は、撮像素子29によって変換された電気信号をデジタル化して、デジタル信号である画像をバッファメモリ部24等に出力する。   The A / D conversion unit 30 digitizes the electrical signal converted by the image sensor 29 and outputs an image, which is a digital signal, to the buffer memory unit 24 and the like.

画像処理装置22は、記憶部25に記憶されている画像処理条件に基づいて、バッファメモリ部24に一時的に記憶されている画像に対する画像処理を行う。そして、画像処理後の画像は、通信部28を介して記憶媒体40に記憶される。また、画像処理装置22は、バッファメモリ部24に一時的に記憶されている画像に対して、マスク抽出処理を行う(詳細は後述する)。そして、抽出したマスクに関する情報は、CPU26に出力されるとともに、記憶部25や記憶媒体40等に記憶される。   The image processing device 22 performs image processing on the image temporarily stored in the buffer memory unit 24 based on the image processing conditions stored in the storage unit 25. The image after image processing is stored in the storage medium 40 via the communication unit 28. Further, the image processing device 22 performs mask extraction processing on the image temporarily stored in the buffer memory unit 24 (details will be described later). The extracted mask information is output to the CPU 26 and stored in the storage unit 25, the storage medium 40, and the like.

表示部23は、例えば液晶ディスプレイであって、撮像部21によって生成された画像、及び操作画面等を表示する。バッファメモリ部24は、撮像部21によって生成された画像を一時的に記憶する。記憶部25は、撮像条件や、各種判定の際にCPU26によって参照される判定条件などを記憶する。   The display unit 23 is, for example, a liquid crystal display, and displays an image generated by the imaging unit 21, an operation screen, and the like. The buffer memory unit 24 temporarily stores the image generated by the imaging unit 21. The storage unit 25 stores imaging conditions, determination conditions referred to by the CPU 26 in various determinations, and the like.

CPU26は、画像処理部22や記憶部25などから適宜必要な情報を取得し、取得した情報に基づいて、撮像装置20内の各部を統括的に制御する。CPU26による制御には、焦点調整(AF)の設定、露出調整(AE)の設定、ホワイトバランス調整(AWB)の設定、閃光の発光量の変更の設定、被写体追尾の設定、各種撮影モードの設定、各種画像処理の設定、各種表示の設定、ズーム倍率に連動した明るさの最適化の設定などが含まれる。また、CPU26は、操作部27の操作状態を監視するとともに、表示部23への画像データの出力を行う。   The CPU 26 appropriately acquires necessary information from the image processing unit 22, the storage unit 25, and the like, and comprehensively controls each unit in the imaging device 20 based on the acquired information. Control by the CPU 26 includes focus adjustment (AF) setting, exposure adjustment (AE) setting, white balance adjustment (AWB) setting, flash emission amount change setting, subject tracking setting, and various shooting mode settings. , Various image processing settings, various display settings, brightness optimization settings linked to zoom magnification, and the like. In addition, the CPU 26 monitors the operation state of the operation unit 27 and outputs image data to the display unit 23.

操作部27は、例えば、電源スイッチ、シャッタボタン、マルチセレクタ(十字キー)、又はその他の操作キーを備え、ユーザによって操作されることでユーザの操作入力を受け付け、操作入力に応じた信号をCPU26に出力する。   The operation unit 27 includes, for example, a power switch, a shutter button, a multi-selector (cross key), or other operation keys. The operation unit 27 receives a user operation input when operated by the user, and outputs a signal corresponding to the operation input to the CPU 26. Output to.

通信部28は、カードメモリ等の取り外しが可能な記憶媒体40と接続され、この記憶媒体40への情報(画像データ、領域の情報など)の書込み、読み出し、あるいは消去を行う。   The communication unit 28 is connected to a removable storage medium 40 such as a card memory, and writes, reads, or deletes information (image data, area information, etc.) to the storage medium 40.

記憶媒体40は、撮像装置20に対して着脱可能に接続される記憶部であって、情報(画像データ、領域の情報など)を記憶する。なお、記憶媒体40は、撮像装置20と一体であってもよい。   The storage medium 40 is a storage unit that is detachably connected to the imaging device 20 and stores information (image data, area information, and the like). Note that the storage medium 40 may be integrated with the imaging device 20.

撮像装置20は、撮影時に、焦点調節情報に基づいて主要被写体領域を検出する通常モードの他に、自動で主要被写体領域を検出する自動検出モードを備える。自動検出モードは、構図確認用のスルー画像等に基づいて、主要被写体領域を自動で継続的に検出し、検出した主要被写体領域の情報を表示部23に表示するとともに、バッファメモリ部24や記憶部25等に記憶するモードである。この自動検出モードは操作部27を介したユーザ操作により設定可能であっても良いし、CPU26により自動で設定可能であっても良い。   The imaging device 20 includes an automatic detection mode for automatically detecting the main subject area in addition to the normal mode for detecting the main subject area based on the focus adjustment information at the time of shooting. In the automatic detection mode, a main subject area is automatically and continuously detected based on a through image for composition confirmation, etc., and information on the detected main subject area is displayed on the display unit 23, and the buffer memory unit 24 and storage This mode is stored in the unit 25 or the like. This automatic detection mode may be set by a user operation via the operation unit 27, or may be automatically set by the CPU.

以下、自動検出モード実行時のCPU26の動作について、図2から図5のフローチャートおよび図6から図12の模式図を参照して説明する。   Hereinafter, the operation of the CPU 26 during execution of the automatic detection mode will be described with reference to the flowcharts of FIGS. 2 to 5 and the schematic diagrams of FIGS. 6 to 12.

ステップS101において、CPU26は、撮像部21を制御して、スルー画像の取得を開始する。取得されたスルー画像の画像情報はバッファメモリ部24に一時的に記憶される。このスルー画像は、所定の時間間隔で連続して生成される。そして、CPU26によるスルー画像の取得は、時間的に連続して順次行われる。   In step S <b> 101, the CPU 26 controls the imaging unit 21 to start acquiring a through image. The acquired image information of the through image is temporarily stored in the buffer memory unit 24. This through image is continuously generated at a predetermined time interval. The acquisition of the through image by the CPU 26 is sequentially performed sequentially in time.

ステップS102において、CPU26は、画像処理装置22を制御して通常の画像処理を行う。通常の画像処理とは、ホワイトバランス調整、補間処理、色調補正処理、階調変換処理などである。各処理の具体的な方法は公知技術と同様であるため説明を省略する。画像処理装置22は、バッファメモリ部24から対象となる画像の画像データを取得し、画像処理を施した後に、再びバッファメモリ部24に出力する。   In step S102, the CPU 26 controls the image processing device 22 to perform normal image processing. Normal image processing includes white balance adjustment, interpolation processing, color tone correction processing, gradation conversion processing, and the like. Since the specific method of each process is the same as that of a well-known technique, description is abbreviate | omitted. The image processing device 22 acquires the image data of the target image from the buffer memory unit 24, performs image processing, and then outputs the image data to the buffer memory unit 24 again.

ステップS103において、CPU26は、画像処理装置22を制御してマスク抽出処理を行う。マスク抽出処理とは、画像における特徴量を算出し、前記特徴量に基づいて被写体領域を検出するための一手法である。例えば、画像における特徴量から評価値を求め、同じ評価値の連続領域を求めることによりマスク抽出を行う。マスク抽出の手法はどのような方法であっても良い。また、マスク抽出の具体的な方法は公知技術と同様であるため説明を省略する。   In step S103, the CPU 26 controls the image processing device 22 to perform mask extraction processing. The mask extraction process is a technique for calculating a feature amount in an image and detecting a subject area based on the feature amount. For example, the mask extraction is performed by obtaining an evaluation value from the feature amount in the image and obtaining a continuous region having the same evaluation value. Any method of mask extraction may be used. In addition, since a specific method for extracting a mask is the same as that of a known technique, description thereof is omitted.

ステップS104において、CPU26は、被写体領域を抽出できたか否かを判定する。CPU26は、被写体領域を抽出できたと判定するとステップS105に進む。一方、被写体領域を抽出できないと判定すると、CPU26は、ステップS102に戻り、次のフレームの画像に対してステップS102以降の処理を行う。   In step S104, the CPU 26 determines whether or not the subject area has been extracted. If the CPU 26 determines that the subject area has been extracted, the CPU 26 proceeds to step S105. On the other hand, if it is determined that the subject area cannot be extracted, the CPU 26 returns to step S102 and performs the processing from step S102 onward for the image of the next frame.

被写体領域を抽出できたか否かとは、すなわち、ステップS103におけるマスク抽出処理によりマスク抽出が成功したか否かということである。例えば、ステップS103におけるマスク抽出処理において、特徴量が算出できなかったり、評価値が低すぎたりした場合には、マスク抽出が失敗し、被写体領域を抽出できないことになる。被写体領域を抽出できない場合、CPU26は、以降の処理を行わずに、被写体領域を抽出できるまで、ステップS102の通常の画像処理およびステップS103のマスク抽出処理を繰り返す。   Whether or not the subject area has been extracted means that the mask extraction has succeeded by the mask extraction processing in step S103. For example, if the feature amount cannot be calculated or the evaluation value is too low in the mask extraction process in step S103, the mask extraction fails and the subject area cannot be extracted. If the subject area cannot be extracted, the CPU 26 repeats the normal image processing in step S102 and the mask extraction process in step S103 until the subject area can be extracted without performing the subsequent processing.

ステップS105において、CPU26は、マスク情報をバッファメモリ部24や記憶部25等に記録する。マスク情報には、ステップS103のマスク抽出処理の抽出条件(色区分やマスク区分など)、マスクの位置、マスクの大きさや形状などの情報が含まれる。   In step S105, the CPU 26 records the mask information in the buffer memory unit 24, the storage unit 25, and the like. The mask information includes information such as the extraction conditions (color classification, mask classification, etc.) of the mask extraction process in step S103, the position of the mask, and the size and shape of the mask.

ステップS106において、CPU26は、n回(nフレーム)以上連続して同一のマスクを抽出したか否かを判定する。CPU26は、n回以上連続して同一のマスクを抽出したと判定すると後述するステップS107に進む。一方、n回以上連続して同一のマスクを抽出していないと判定すると、CPU26は、後述するステップS112に進む。   In step S106, the CPU 26 determines whether or not the same mask has been extracted continuously n times (n frames) or more. If the CPU 26 determines that the same mask has been extracted continuously n times or more, the CPU 26 proceeds to step S107 described later. On the other hand, when determining that the same mask has not been extracted n times or more in succession, the CPU 26 proceeds to step S112 described later.

同一のマスクを抽出する場合とは、複数フレームにおいて、略同色、略同サイズのマスクが、略同じ位置において抽出する場合である。この判定には、ステップS105で説明したマスク情報等を用いれば良い。何れの場合も、フレーム間の変化量が規定以内である場合に、同一と判定することができる。ステップS105で説明したマスク情報等に基づいて、過去に行われたマスク抽出の傾向(抽出されたマスクの種類、出現頻度など)を求め、この傾向に応じて上述した変化量が規定以内であるかを判断する閾値を適宜変更可能としても良い。例えば、過去に高い頻度で抽出されたマスクについては、閾値を大きめに変更しても良い。   The case where the same mask is extracted is a case where masks of substantially the same color and size are extracted at substantially the same position in a plurality of frames. For this determination, the mask information described in step S105 may be used. In any case, when the amount of change between frames is within a specified range, it can be determined that they are the same. Based on the mask information or the like described in step S105, the tendency of mask extraction performed in the past (extracted mask type, appearance frequency, etc.) is obtained, and the amount of change described above is within the specified range according to this tendency. It may be possible to appropriately change the threshold for determining whether or not. For example, the threshold value may be changed to a larger value for a mask extracted at a high frequency in the past.

この判定は、ステップS103のマスク抽出処理により任意の主要被写体領域が安定して検出されているか否かを判定するためのものである。このように、連続(あるいは間欠連続)の複数のフレームにおいて、略同色、略同サイズ、略同じ位置の被写体が検出され手射る状態を、「マスク抽出処理が安定して行われている」と称する。ステップS103のマスク抽出処理が安定して行われている場合、主要被写体領域を正しく検出していると判断することができる。なお、上述したnは所定の閾値(例えば、n=7)であり、撮像部21による撮像時のフレームレート、レンズ鏡筒10におけるズーム倍率、操作部27を介したユーザ操作などに基づいて適宜変更可能としても良い。さらに、ステップS105で説明したマスク情報等に基づいて、過去に行われたマスク抽出の傾向(抽出されたマスクの種類、出現頻度など)を求め、この傾向に応じて上述したnの値を適宜変更可能としても良い。例えば、過去に高い頻度で抽出されたマスクについては、nの値を小さめに変更しても良い。   This determination is for determining whether or not an arbitrary main subject region has been stably detected by the mask extraction processing in step S103. In this way, in a plurality of continuous (or intermittent continuous) frames, a state in which a subject of substantially the same color, substantially the same size, and substantially the same position is detected and shot manually is referred to as “the mask extraction process is stably performed”. Called. If the mask extraction process in step S103 is performed stably, it can be determined that the main subject area is correctly detected. Note that n described above is a predetermined threshold (for example, n = 7), and is appropriately determined based on the frame rate at the time of image capturing by the image capturing unit 21, the zoom magnification in the lens barrel 10, the user operation via the operation unit 27, and the like. It may be changeable. Further, the tendency of mask extraction performed in the past (the type of extracted mask, the appearance frequency, etc.) is obtained based on the mask information described in step S105, and the value of n described above is appropriately set according to this tendency. It may be changeable. For example, for a mask extracted at a high frequency in the past, the value of n may be changed to a smaller value.

また、ステップS106で行った判定の内容を、ステップS105で説明したマスク情報に追加して記録しておき、以降のフレームに関する処理時に用いる構成としても良い。   Further, the contents of the determination made in step S106 may be recorded in addition to the mask information described in step S105, and used in subsequent processing relating to frames.

また、上述した以外の方法でマスク抽出処理が安定して行われているか否かを判定する構成としても良い。例えば、前回まで連続して同一のマスクを抽出したか否かを加味して判定を行っても良い。このような構成とすれば、今回のみ一時の未抽出が発生した場合でも、それまでの蓄積を無効にせず、次のフレームにおいて同一のマスクを抽出した場合には、前回までの安定状態が維持されているものと見なすことができる。   Moreover, it is good also as a structure which determines whether the mask extraction process is performed stably by methods other than the above-mentioned. For example, the determination may be performed in consideration of whether the same mask has been extracted continuously until the previous time. With this configuration, even if temporary unextraction occurs only this time, if the same mask is extracted in the next frame without invalidating the previous accumulation, the previous stable state is maintained. Can be considered.

ステップS107において、CPU26は、抽出したマスクに基づいて主要被写体領域を記録する。主要被写体領域は、ステップS106において判定の対象となったフレームの画像において、ステップS103で抽出されたマスクに基づいて求められる。CPU26は、主要被写体領域の情報をバッファメモリ部24や記憶部25等に記録する。主要被写体領域の情報には、用いられたマスクに関するマスク情報、主要被写体領域の位置、主要被写体領域の大きさや形状などの情報が含まれる。   In step S107, the CPU 26 records the main subject area based on the extracted mask. The main subject area is obtained based on the mask extracted in step S103 in the image of the frame subjected to the determination in step S106. The CPU 26 records information on the main subject area in the buffer memory unit 24, the storage unit 25, and the like. The information on the main subject area includes mask information related to the mask used, information on the position of the main subject area, and the size and shape of the main subject area.

ステップS108において、CPU26は、AF用注目領域を設定する。CPU26は、ステップS107で記録した主要被写体領域に基づいて、撮影時のAF処理における注目領域であるAF用注目領域を設定する。AF用注目領域の設定の詳細は後述する。   In step S108, the CPU 26 sets an AF attention area. Based on the main subject area recorded in step S107, the CPU 26 sets an attention area for AF, which is an attention area in AF processing at the time of shooting. Details of setting the AF attention area will be described later.

ステップS109において、CPU26は、AE用注目領域を設定する。CPU26は、ステップS107で記録した主要被写体領域に基づいて、撮影時のAE処理における注目領域であるAE用注目領域を設定する。AE用注目領域の設定の詳細は後述する。   In step S109, the CPU 26 sets an AE attention area. Based on the main subject area recorded in step S107, the CPU 26 sets an AE attention area that is an attention area in the AE processing at the time of shooting. Details of setting the attention area for AE will be described later.

ステップS110において、CPU26は、表示領域を設定する。CPU26は、ステップS107で記録した主要被写体領域に基づいて、表示部23により主要被写体領域を表示する際の表示領域を設定する。なお、表示領域は、上述したAF用注目領域およびAE用注目領域とは異なる領域である。表示領域の設定の詳細は後述する。   In step S110, the CPU 26 sets a display area. The CPU 26 sets a display area when the main subject area is displayed by the display unit 23 based on the main subject area recorded in step S107. The display area is an area different from the AF attention area and the AE attention area described above. Details of the display area setting will be described later.

ステップS111において、CPU26は、主要被写体領域の情報を表示部23に表示する。CPU26は、表示部23を制御し、ステップS101で取得を開始したスルー画像に重畳して、ステップS107で記録した主要被写体領域を視認可能に表示する。このとき、CPU26は、ステップS110で設定した表示領域に合わせて、主要被写体領域に枠などを表示する。このような表示を行うことにより、ユーザは、CPU26が自動で検出している主要被写体領域がどのようなものであるかを、容易に把握することができる。なお、上述した枠を表示する際に、枠の線の太さ、濃淡、色などはどのようなものであっても良い。また、これらのファクターと、検出の精度などを関連付けて表示を行う構成としても良い。   In step S <b> 111, the CPU 26 displays information on the main subject area on the display unit 23. The CPU 26 controls the display unit 23 to display the main subject area recorded in step S107 so as to be visible by superimposing it on the through image started to be acquired in step S101. At this time, the CPU 26 displays a frame or the like in the main subject area in accordance with the display area set in step S110. By performing such display, the user can easily grasp what the main subject area is automatically detected by the CPU 26 is. When displaying the above-described frame, the line thickness, shading, color, etc. of the frame may be any. Further, the display may be performed by associating these factors with the detection accuracy.

ステップS112において、CPU26は、主要被写体領域の設定処理を行っていない状態で撮影指示が行われてしまう場合に備えて、通常の3A処理を行う。3A処理とは、焦点調整(AF)の設定処理、露出調整(AE)の設定処理、ホワイトバランス調整処理(AWB)であり、公知技術と同様に行われる。   In step S112, the CPU 26 performs a normal 3A process in preparation for a case where a shooting instruction is issued in a state where the main subject area setting process is not performed. The 3A process is a focus adjustment (AF) setting process, an exposure adjustment (AE) setting process, and a white balance adjustment process (AWB), and is performed in the same manner as a known technique.

なお、任意の被写体領域がステップS107の処理により主要被写体領域として記録されている場合には、CPU26は、その記録に基づく一部または全ての設定を解除するとともに、表示部23における主要被写体領域の情報の表示を終了してステップS113に進む。   If an arbitrary subject area is recorded as the main subject area by the process of step S107, the CPU 26 cancels a part or all of the settings based on the recording, and sets the main subject area on the display unit 23. The display of information is terminated, and the process proceeds to step S113.

ステップS113において、CPU26は、撮影指示が行われたか否かを判定する。CPU26は、撮影指示が行われたと判定するとステップS114に進む。一方、撮影指示が行われないと判定すると、CPU26は、ステップS102に戻り、次のフレームの画像に対してステップS102以降の処理を行う。撮影指示は、操作部27のシャッタボタンを介したユーザ操作により行われる。このユーザ操作は、いわゆる半シャッタと全シャッタの何れであっても良い。   In step S113, the CPU 26 determines whether or not a shooting instruction has been issued. If the CPU 26 determines that a shooting instruction has been given, the process proceeds to step S114. On the other hand, if it is determined that the shooting instruction is not performed, the CPU 26 returns to step S102 and performs the processing after step S102 on the image of the next frame. The shooting instruction is given by a user operation via the shutter button of the operation unit 27. This user operation may be a so-called half shutter or all shutter.

ステップS114において、CPU26は、AF・AE処理を行う。CPU26は、ステップS108で設定したAF用注目領域に基づいて、AF処理(焦点調整)を行うとともに、ステップS109で設定したAE用注目領域に基づいて、AE処理(露出調整)を行う。なお、ステップS112で通常の3A処理を行っている場合には、CPU26は、3A処理の結果に基づいて、AF処理およびAE処理を行う。   In step S114, the CPU 26 performs AF / AE processing. The CPU 26 performs AF processing (focus adjustment) based on the AF attention area set in step S108, and performs AE processing (exposure adjustment) based on the AE attention area set in step S109. If normal 3A processing is performed in step S112, the CPU 26 performs AF processing and AE processing based on the result of the 3A processing.

ステップS115において、CPU26は、各部を制御して撮影を実行する。このとき、CPU26は、ステップS107で記録した主要被写体領域の情報に基づいて、画像処理装置22における各種画像処理の条件等を決定する。また、ステップS112で通常の3A処理を行っている場合には、3A処理の結果に基づいて、画像処理装置22における各種画像処理の条件等を決定する。   In step S115, the CPU 26 controls each unit to perform shooting. At this time, the CPU 26 determines various image processing conditions and the like in the image processing device 22 based on the information of the main subject area recorded in step S107. If normal 3A processing is performed in step S112, conditions for various image processing in the image processing device 22 are determined based on the result of the 3A processing.

ステップS116において、CPU26は、撮像により生成した画像を、通信部28を介して記憶媒体40に記録して一連の処理を終了する。   In step S116, the CPU 26 records the image generated by the imaging on the storage medium 40 via the communication unit 28, and ends the series of processes.

次に、ステップS108で説明したAF用注目領域の設定について、図3のフローチャートおよび図6の模式図を参照して説明する。CPU26は、ステップS107で記録した主要被写体領域を、所定の図形へ近似させることにより、AF用注目領域の設定を行う。ここでは、主要被写体領域を1つ以上の矩形に近似させる場合を例に挙げて説明する。なお、矩形以外のどのような図形を採用しても良い。また、複数種類の図形を組み合わせて採用しても良い。   Next, the setting of the AF attention area described in step S108 will be described with reference to the flowchart of FIG. 3 and the schematic diagram of FIG. The CPU 26 sets the attention area for AF by approximating the main subject area recorded in step S107 to a predetermined figure. Here, a case where the main subject area is approximated to one or more rectangles will be described as an example. Any figure other than a rectangle may be adopted. Moreover, you may employ | adopt combining a multiple types of figure.

AF用注目領域は、焦点調節に用いられる領域であり、基本的に、上述した主要被写体領域の周辺エッジを含み、主要被写体領域よりも広い領域であることが求められる。したがって、従来採用されている外接矩形よりも、より主要被写体領域の形状に即したものの方が好ましい。そこで、CPU26は、主要被写体領域を、複数の矩形の集合に近似させる。なお、この近似における精度は、近似に用いる図形の形状や、図形の大きさや、図形の個数などにより決まる。また、この近似における精度は、撮像装置20の処理能力や、要求される速度や、要求される精度等に基づいて変化する。さらに、AF用注目領域の近似における精度は、後述する表示領域の近似における精度以上であることが好ましい。これは、AF用注目領域は、焦点調節に最適化させるための十分な精度が必要であるが、表示領域は、ユーザによる視認性を重視する必要があるためである。   The AF attention area is an area used for focus adjustment, and basically includes a peripheral edge of the main subject area described above and is wider than the main subject area. Therefore, it is more preferable to conform to the shape of the main subject area than the circumscribed rectangle conventionally employed. Therefore, the CPU 26 approximates the main subject area to a set of a plurality of rectangles. The accuracy in this approximation is determined by the shape of the figure used for the approximation, the size of the figure, the number of figures, and the like. The accuracy in this approximation changes based on the processing capability of the imaging device 20, the required speed, the required accuracy, and the like. Further, the accuracy in approximating the AF attention area is preferably equal to or higher than the accuracy in approximating the display area described later. This is because the AF attention area needs to have sufficient accuracy to be optimized for focus adjustment, but the display area needs to emphasize visibility by the user.

ステップS201において、CPU26は、最大分割数をチェックする。最大分割数は、撮像装置20の処理能力に応じて予め決められた数である。   In step S201, the CPU 26 checks the maximum number of divisions. The maximum number of divisions is a number determined in advance according to the processing capability of the imaging device 20.

ステップS202において、CPU26は、図6Aに示すように、ステップS107で記録した主要被写体領域の外接矩形A1を算出する。   In step S202, the CPU 26 calculates a circumscribed rectangle A1 of the main subject area recorded in step S107 as shown in FIG. 6A.

ステップS203において、CPU26は、図6Bに示すように、ステップS107で記録した主要被写体領域の画像を分割する。なお、初期段階においては、図6Bに示すように、分割数は4とする。2回目以降は、後述するステップS207で変更された分割数にしたがって、主要被写体領域の画像を分割する。また、分割数は、レンズ鏡筒10におけるズーム倍率や絞り、操作部27を介したユーザ操作などに基づいて適宜変更可能としても良い。例えば、レンズ鏡筒10におけるズーム倍率がテレ側の時には、精度が必要であるため分割数を多く設定し、ワイド側の時には、最小分割数など、分割数を少なめに設定すると良い。CPU26は、上述した分割数で主要被写体領域の画像を分割する。図6Bは、分割数が4である場合の例であり、図6Cは、分割数が9である場合の例を示す。   In step S203, the CPU 26 divides the image of the main subject area recorded in step S107 as shown in FIG. 6B. In the initial stage, the number of divisions is four as shown in FIG. 6B. From the second time onward, the image of the main subject area is divided according to the number of divisions changed in step S207 described later. Further, the number of divisions may be changed as appropriate based on the zoom magnification and aperture in the lens barrel 10, user operation via the operation unit 27, and the like. For example, when the zoom magnification in the lens barrel 10 is on the tele side, accuracy is required, so that the number of divisions is set to be large. The CPU 26 divides the image of the main subject area with the number of divisions described above. FIG. 6B shows an example when the number of divisions is 4, and FIG. 6C shows an example when the number of divisions is 9.

ステップS204において、CPU26は、分割領域ごとの充填率を算出する。   In step S204, the CPU 26 calculates a filling rate for each divided area.

ステップS205において、CPU26は、低充填率の分割領域を除外する。ある分割領域が低充填率であるか否かの判定は、ステップS204で算出した分割領域ごとの充填率と所定の閾値を比較することにより行う。そして、CPU26は、低充填率であると判定された分割領域を、主要被写体領域から除外する。例えば、図6Bの例では、右下の分割領域が主要被写体領域から除外されている例を示し、図6Cの例では、上段の左端の分割領域と、中段の右端の分割領域と、下段の右側2つの分割領域が主要被写体領域から除外されている例を示す。   In step S205, the CPU 26 excludes the divided region having a low filling rate. Whether or not a certain divided region has a low filling rate is determined by comparing the filling rate for each divided region calculated in step S204 with a predetermined threshold value. Then, the CPU 26 excludes the divided areas determined to have a low filling rate from the main subject area. For example, the example in FIG. 6B shows an example in which the lower right divided area is excluded from the main subject area. In the example in FIG. 6C, the upper left divided area, the middle right divided area, and the lower divided area An example is shown in which the two right divided areas are excluded from the main subject area.

ステップS206において、CPU26は、全体の充填率が所定の閾値Ta以上であるか否かを判定する。CPU26は、ステップS205で低充填率の分割領域が除外された主要被写体領域全体の充填率を算出し、算出した主要被写体領域全体の充填率が所定の閾値Ta以上であると判定すると後述するステップS208に進む。一方、主要被写体領域全体の充填率が所定の閾値Ta未満であると判定すると、CPU26は、ステップS207に進む。なお、上述した閾値Taは予め定められても良いし、対象画像の解像度や、操作部27を介したユーザ操作などに基づいて適宜変更可能としても良い。さらに、後述する分割数に応じて上述した閾値Taの値を適宜変更可能としても良い。例えば、分割数が多いほど、閾値Taの値を大きく変更しても良い。   In step S206, the CPU 26 determines whether or not the overall filling rate is equal to or greater than a predetermined threshold value Ta. If the CPU 26 calculates the filling rate of the entire main subject region from which the low filling rate divided regions are excluded in step S205 and determines that the calculated filling rate of the entire main subject region is equal to or greater than a predetermined threshold Ta, a step described later is performed. Proceed to S208. On the other hand, when determining that the filling rate of the entire main subject area is less than the predetermined threshold value Ta, the CPU 26 proceeds to step S207. The threshold value Ta described above may be determined in advance, or may be changed as appropriate based on the resolution of the target image, a user operation via the operation unit 27, and the like. Furthermore, the value of the threshold value Ta described above may be appropriately changed according to the number of divisions described later. For example, as the number of divisions increases, the value of the threshold Ta may be changed greatly.

ステップS207において、CPU26は、分割数を変更する。CPU26は、前回の画像の分割(ステップS203)よりも分割数を大きく変更する。なお、分割数の増やし方は予め定められている(例えば、分割数=4,9,16・・・n)ものとする。ただし、分割数の上限はステップS201でチェックした最大分割数である。 In step S207, the CPU 26 changes the number of divisions. The CPU 26 changes the number of divisions larger than the previous image division (step S203). It is assumed that the number of divisions is increased in advance (for example, the number of divisions = 4, 9, 16,... N 2 ). However, the upper limit of the number of divisions is the maximum number of divisions checked in step S201.

つまり、CPU26は、主要被写体領域全体の充填率が所定の閾値Ta以上となるまで、ステップS203からステップS207の処理を繰り返し、分割数を増やしつつ、低充填率の分割領域が除外された主要被写体領域全体の充填率をチェックする。なお、主要被写体領域全体の充填率が所定の閾値Ta以上となる前に、分割数が最大分割数に到達してしまった場合には、CPU26は、処理を中断したり、前回までの処理による主要被写体領域を採用するなどのエラー処理を行う。   That is, the CPU 26 repeats the processing from step S203 to step S207 until the filling ratio of the entire main subject area becomes equal to or greater than the predetermined threshold Ta, and the main subject from which the divided areas having a low filling rate are excluded while increasing the number of divisions. Check the filling rate of the whole area. Note that if the number of divisions reaches the maximum number of divisions before the filling rate of the entire main subject area becomes equal to or greater than the predetermined threshold Ta, the CPU 26 interrupts the processing or depends on the processing up to the previous time. Error processing such as adopting the main subject area is performed.

ステップS208において、CPU26は、ステップS205で低充填率の分割領域が除外された残りである残留分割領域の番地を、バッファメモリ部24や記憶部25等に記録する。残留分割領域とは、ステップS206において主要被写体領域全体の充填率の算出対象となった領域と同じである。   In step S208, the CPU 26 records, in the buffer memory unit 24, the storage unit 25, and the like, the addresses of the remaining divided areas remaining after the division of the low filling rate divided areas in step S205. The remaining divided area is the same as the area that is the target for calculating the filling rate of the entire main subject area in step S206.

上述した一連の処理により、CPU26は、AF用注目領域として、主要被写体領域の周辺エッジを含む包含枠、あるいは包絡矩形領域のうち、最小の領域を設定することができる。   Through the series of processes described above, the CPU 26 can set the minimum area of the inclusion frame including the peripheral edge of the main subject area or the envelope rectangular area as the AF attention area.

なお、より精度良くAF用注目領域を求める際には、上述した分割領域を移動させて充填率をさらに向上させても良い。例えば、図6Dに示すように、分割領域を横方向に移動させて、より充填率の高い配置を求める構成としても良い。また、分割領域を縦方向に移動させても良いし、回転・拡大縮小させても良い。   When obtaining the AF attention area with higher accuracy, the filling ratio may be further improved by moving the above-described divided areas. For example, as illustrated in FIG. 6D, a configuration may be employed in which the divided region is moved in the horizontal direction to obtain an arrangement with a higher filling rate. Further, the divided area may be moved in the vertical direction, or may be rotated / enlarged / reduced.

次に、ステップS109で説明したAE用注目領域の設定について、図4のフローチャートおよび図7の模式図を参照して説明する。CPU26は、ステップS107で記録した主要被写体領域に内接する矩形を求めることにより、主要被写体領域を矩形に近似させ、AE用注目領域の設定を行う。ここでは、主要被写体領域に内接する1つの矩形を求める場合を例に挙げて説明する。なお、矩形以外のどのような図形を採用しても良い。また、複数種類の図形を組み合わせて採用しても良い。   Next, the setting of the attention area for AE described in step S109 will be described with reference to the flowchart of FIG. 4 and the schematic diagram of FIG. The CPU 26 obtains a rectangle inscribed in the main subject area recorded in step S107, thereby approximating the main subject area to a rectangle, and sets an attention area for AE. Here, a case where one rectangle inscribed in the main subject area is obtained will be described as an example. Any figure other than a rectangle may be adopted. Moreover, you may employ | adopt combining a multiple types of figure.

AE用注目領域は、露出調整に用いられる領域であり、上述した主要被写体領域外の余分な領域が含まれない領域であることが求められる。そこで、CPU26は、上述したように、主要被写体領域に内接する領域を求める。なお、この近似における精度は、図形の形状や、図形の大きさや、近似に用いる図形の個数などにより決まる。また、この近似における精度は、撮像装置20の処理能力や、要求される速度や、要求される精度等に基づいて変化する。さらに、AE用注目領域の近似における精度は、上述したAF用注目領域と同様に、後述する表示領域の近似における精度以上であることが好ましい。   The AE attention area is an area used for exposure adjustment, and is required to be an area that does not include an extra area outside the main subject area described above. Therefore, as described above, the CPU 26 obtains an area inscribed in the main subject area. The accuracy in this approximation is determined by the shape of the figure, the size of the figure, the number of figures used for the approximation, and the like. The accuracy in this approximation changes based on the processing capability of the imaging device 20, the required speed, the required accuracy, and the like. Further, it is preferable that the accuracy in approximation of the AE attention area is equal to or higher than the accuracy in approximation of the display area, which will be described later, like the AF attention area described above.

ステップS301において、CPU26は、図7Aに示すように、ステップS107で記録した主要被写体領域の内接矩形A2を算出する。なお、内接矩形A2は、図7Aに示すように複数存在するが、CPU26は、図7Aに示すように面積が最大となる内接矩形A2を算出する。   In step S301, as shown in FIG. 7A, the CPU 26 calculates the inscribed rectangle A2 of the main subject area recorded in step S107. Although there are a plurality of inscribed rectangles A2 as shown in FIG. 7A, the CPU 26 calculates the inscribed rectangle A2 having the largest area as shown in FIG. 7A.

ステップS302において、CPU26は、ステップS301で算出した内接矩形A2内の輝度値を算出する。   In step S302, the CPU 26 calculates the luminance value in the inscribed rectangle A2 calculated in step S301.

ステップS303において、CPU26は、ステップS302で算出した内接矩形A2内の輝度値に基づいてAE値を算出する。AE値の算出は、公知技術と同様に行われる。   In step S303, the CPU 26 calculates an AE value based on the luminance value in the inscribed rectangle A2 calculated in step S302. The calculation of the AE value is performed in the same manner as in the known technique.

ステップS304において、CPU26は、ステップS303で算出したAE値をバッファメモリ部24や記憶部25等に記録する。   In step S304, the CPU 26 records the AE value calculated in step S303 in the buffer memory unit 24, the storage unit 25, or the like.

なお、より精度良くAE用注目領域を求める際には、上述したAF用注目領域と同様に、分割領域を組み合わせても良い。例えば、図7Bに示すように、複数の分割領域を横方向に移動して適宜配置し、より充填率の高い配置を求めてAE用注目領域としても良い。さらに、分割領域を縦方向に移動させても良いし、回転・拡大縮小させても良い。   When obtaining the AE attention area with higher accuracy, the divided areas may be combined in the same manner as the AF attention area described above. For example, as shown in FIG. 7B, a plurality of divided regions may be moved in the horizontal direction and appropriately arranged, and an arrangement with a higher filling rate may be obtained and used as the attention region for AE. Furthermore, the divided area may be moved in the vertical direction, or may be rotated / enlarged / reduced.

さらに、AE用注目領域を、上述したAF用注目領域として利用しても良い。例えば、上述したAF用注目領域において説明した「主要被写体領域の周辺エッジを含み、主要被写体領域よりも広い領域」と、AE用注目領域として説明した「主要被写体領域に内接する領域」との両方をAF用注目領域として求め、2つのAF用注目領域を用いてAF処理を行っても良い。この場合、例えば、小さい方の領域である「主要被写体領域に内接する領域」に基づいてAF処理を行い、AF処理が良好に行えない(合焦しない等)場合には、大きい方の領域である「主要被写体領域の周辺エッジを含み、主要被写体領域よりも広い領域」に基づいてAF処理を行うと良い。   Further, the AE attention area may be used as the AF attention area described above. For example, both the “region including the peripheral edge of the main subject region and wider than the main subject region” described in the AF attention region described above and the “region inscribed in the main subject region” described as the AE attention region May be obtained as the AF attention area, and the AF processing may be performed using the two AF attention areas. In this case, for example, when the AF process is performed based on the smaller area “area inscribed in the main subject area” and the AF process cannot be performed satisfactorily (not in focus), the larger area is used. The AF process may be performed based on a certain “region including the peripheral edge of the main subject region and wider than the main subject region”.

次に、ステップS110で説明した表示領域の設定について、図5のフローチャートおよび図8から図12の模式図を参照して説明する。CPU26は、ステップS107で記録した主要被写体領域に外接する矩形を求めることにより、主要被写体領域を矩形に近似させ、表示領域の設定を行う。ここでは、主要被写体領域に外接する1つの矩形を求める場合を例に挙げて説明する。なお、矩形以外のどのような図形を採用しても良い。また、複数種類の図形を組み合わせて採用しても良い。   Next, the setting of the display area described in step S110 will be described with reference to the flowchart of FIG. 5 and the schematic diagrams of FIGS. The CPU 26 obtains a rectangle that circumscribes the main subject area recorded in step S107, thereby approximating the main subject area to a rectangle and sets the display area. Here, a case where one rectangle circumscribing the main subject area is obtained will be described as an example. Any figure other than a rectangle may be adopted. Moreover, you may employ | adopt combining a multiple types of figure.

表示領域は、ステップS107で記録した主要被写体領域を視認可能に表示部23に表示する際に用いられる領域であり、ユーザにとっての視認性の高さが求められる。そこで、CPU26は、ユーザによる視認性を加味して表示領域を求める。なお、この近似における精度は、近似に用いる図形の形状や、図形の大きさや、図形の個数などにより決まる。また、この近似における精度は、撮像装置20の処理能力や、要求される速度や、要求される精度等に基づいて変化する。さらに、表示領域の近似における精度は、上述したAF用注目領域およびAE表示領域の近似における精度未満であって構わない。これは、これは、表示領域は、ユーザによる視認性を満たしていれば、上述したAF用注目領域やAE用注目領域のように厳密な精度を必要としないためである。   The display area is an area that is used when the main subject area recorded in step S107 is displayed on the display unit 23 so as to be visible, and requires high visibility for the user. Therefore, the CPU 26 obtains the display area in consideration of the visibility by the user. The accuracy in this approximation is determined by the shape of the figure used for the approximation, the size of the figure, the number of figures, and the like. The accuracy in this approximation changes based on the processing capability of the imaging device 20, the required speed, the required accuracy, and the like. Furthermore, the accuracy in the approximation of the display area may be less than the accuracy in the approximation of the AF attention area and the AE display area described above. This is because the display area does not require strict accuracy like the AF attention area and the AE attention area described above as long as the visibility by the user is satisfied.

ステップS401において、CPU26は、図8Aに示すように、ステップS107で記録した主要被写体領域の外接矩形A3を算出する。   In step S401, as shown in FIG. 8A, the CPU 26 calculates a circumscribed rectangle A3 of the main subject area recorded in step S107.

ステップS402において、CPU26は、ステップS401で算出した外接矩形A3内の充填率を算出する。   In step S402, the CPU 26 calculates the filling rate in the circumscribed rectangle A3 calculated in step S401.

ステップS403において、CPU26は、ステップS402で算出した外接矩形A3内の充填率が所定の閾値Tb以上であるか否かを判定する。CPU26は、外接矩形A3内の充填率が所定の閾値Tb以上であると判定するとステップS404に進む。一方、外接矩形A3内の充填率が所定の閾値Tb未満であると判定すると、CPU26は、後述するステップS406に進む。なお、上述した閾値Tbは予め定められても良いし、対象画像の解像度や、操作部27を介したユーザ操作などに基づいて適宜変更可能としても良い。   In step S403, the CPU 26 determines whether or not the filling rate in the circumscribed rectangle A3 calculated in step S402 is equal to or greater than a predetermined threshold value Tb. If the CPU 26 determines that the filling rate in the circumscribed rectangle A3 is equal to or greater than the predetermined threshold value Tb, the process proceeds to step S404. On the other hand, when determining that the filling rate in the circumscribed rectangle A3 is less than the predetermined threshold value Tb, the CPU 26 proceeds to step S406 described later. Note that the threshold value Tb described above may be determined in advance, or may be appropriately changed based on the resolution of the target image, a user operation via the operation unit 27, and the like.

ステップS404において、CPU26は、ステップS402で算出した外接矩形A3の中心の座標を算出する。   In step S404, the CPU 26 calculates the coordinates of the center of the circumscribed rectangle A3 calculated in step S402.

ステップS405において、CPU26は、ステップS402で算出した外接矩形A3の大きさを算出する。   In step S405, the CPU 26 calculates the size of the circumscribed rectangle A3 calculated in step S402.

ステップS406において、CPU26は、ステップS107で記録した主要被写体領域の重心の座標を算出する。   In step S406, the CPU 26 calculates the coordinates of the center of gravity of the main subject area recorded in step S107.

ステップS407において、CPU26は、ステップS402で算出した外接矩形A3の1/2の大きさを算出する。   In step S407, the CPU 26 calculates the size of ½ of the circumscribed rectangle A3 calculated in step S402.

ステップS408において、CPU26は、表示領域の中心座標および大きさをバッファメモリ部24や記憶部25等に記録する。   In step S408, the CPU 26 records the central coordinates and size of the display area in the buffer memory unit 24, the storage unit 25, and the like.

ステップS404およびステップS405の処理において、表示領域は、図8Bに示す矩形A4の領域となる。一方、ステップS406およびステップS407の処理において、表示領域は、図8Cに示す矩形A5の領域となる。ステップS406およびステップS407の処理は、上述したように、外接矩形A3内の充填率<所定の閾値Tbである場合に行われる。このような場合には、外接矩形A3を表示領域とするよりも、充填率に合わせて小さめの矩形A5を表示領域とするほうがユーザの違和感が少ない。また、AF用注目領域やAE用注目領域と同じ領域を表示領域としてしまうと、ユーザがスルー画像を目視する際の主要被写体領域の視認性が低下してしまう。   In the processing of step S404 and step S405, the display area is an area of a rectangle A4 shown in FIG. 8B. On the other hand, in the processing of step S406 and step S407, the display area is an area of a rectangle A5 shown in FIG. 8C. As described above, the processes in steps S406 and S407 are performed when the filling rate in the circumscribed rectangle A3 <the predetermined threshold Tb. In such a case, the user feels less uncomfortable when the smaller rectangle A5 is used as the display area in accordance with the filling rate than when the circumscribed rectangle A3 is used as the display area. Further, if the same region as the AF attention region or the AE attention region is set as the display region, the visibility of the main subject region when the user views the through image is deteriorated.

なお、上述した表示領域の設定において、以下(a)〜(d)のような処理を行っても良い。   In the above-described display area setting, the following processes (a) to (d) may be performed.

(a)主要被写体領域の変化が少ない場合に、表示領域を固定する(変化させない)。   (A) When there is little change in the main subject area, the display area is fixed (not changed).

CPU26は、複数フレームの画像において求めた表示領域を比較し、その変化の度合いが所定の範囲内である場合には、表示領域を変化させずに固定する。変化の度合いは、それぞれの表示領域の位置や大きさ(面積)や形状などを比較し、変化量に基づいて求めることができる。例えば、第nフレームにおける表示領域が図9Aの矩形A6−1であり、次のフレームである第(n+1)フレームにおける表示領域が図9Bの矩形A6−2である場合、CPU26は、矩形A6−1および矩形A6−2を比較し、その変化の度合いが所定の範囲内である場合には、図9Cに示すように、第(n+1)フレームにおける表示領域を矩形A6−2ではなく矩形A6−1とする。つまり、前フレームにおける表示領域を継続する。さらに、図9Dに示すように、矩形A6−1および矩形A6−2を包含する矩形A6−3を採用する構成としても良い。ただし、このような統合を繰り返すことにより、表示領域が過剰に大きくなることは好ましくない。したがって、表示領域の大きさ(面積)には上限を定めておくものとする。   The CPU 26 compares the display areas obtained in the images of a plurality of frames, and when the degree of change is within a predetermined range, the display area is fixed without being changed. The degree of change can be determined based on the amount of change by comparing the position, size (area), shape, and the like of each display region. For example, if the display area in the nth frame is the rectangle A6-1 in FIG. 9A and the display area in the (n + 1) th frame, which is the next frame, is the rectangle A6-2 in FIG. 1 and the rectangle A6-2 are compared, and if the degree of change is within a predetermined range, as shown in FIG. 9C, the display area in the (n + 1) th frame is not the rectangle A6-2, but the rectangle A6-2. Set to 1. That is, the display area in the previous frame is continued. Furthermore, as shown to FIG. 9D, it is good also as a structure which employ | adopts the rectangle A6-3 containing the rectangle A6-1 and the rectangle A6-2. However, it is not preferable that the display area becomes excessively large by repeating such integration. Therefore, an upper limit is set for the size (area) of the display area.

このように、表示領域を固定することにより、表示領域が小刻みに変化するなどのバラツキを抑え、ユーザによる視認性を向上させることができる。   In this way, by fixing the display area, it is possible to suppress variations such as a small change in the display area and improve visibility by the user.

(b)アスペクト比を固定する。   (B) The aspect ratio is fixed.

CPU26は、複数フレームの画像において、それぞれの主要被写体領域の面積変化に基づいて、アスペクト比を固定する。例えば、第nフレームにおける表示領域が図10Aの矩形A7−1であり、縦長がa、横長がb、主要被写体領域の面積がS1であるものとする。そして、次のフレームである第(n+1)フレームにおける主要被写体領域の面積がS2である場合、CPU26は、図10Bの矩形A7−2に示すように、縦長および横長については、面積変化(S2/S1)の平方根を上述した縦長aおよび横長bに乗じたものとする。なお、位置については、第nフレームにおける主要被写体領域の重心位置や第(n+1)フレームにおける主要被写体領域の重心位置などに応じて定めれば良い。   The CPU 26 fixes the aspect ratio in the images of a plurality of frames based on the area change of each main subject region. For example, it is assumed that the display area in the nth frame is the rectangle A7-1 in FIG. When the area of the main subject area in the (n + 1) th frame, which is the next frame, is S2, the CPU 26 changes the area (S2 / S) for the portrait and landscape orientations as indicated by the rectangle A7-2 in FIG. 10B. The square root of S1) is multiplied by the above-described vertical length a and horizontal length b. The position may be determined in accordance with the position of the center of gravity of the main subject area in the nth frame, the position of the center of gravity of the main subject area in the (n + 1) th frame, and the like.

このように、表示領域のアスペクト比を固定することにより、表示領域の見た目の変化を抑え、ユーザによる視認性を向上させることができる。なお、上述した例以外にも、第nフレームにおける主要被写体領域の面積や第(n+1)フレームにおける主要被写体領域の面積変化に応じていれば、どのようにアスペクト比を固定しても良い。   Thus, by fixing the aspect ratio of the display area, it is possible to suppress changes in the appearance of the display area and improve the visibility by the user. In addition to the above-described example, the aspect ratio may be fixed as long as the area of the main subject region in the nth frame and the change in the area of the main subject region in the (n + 1) th frame are met.

(c)位置、大きさ、アスペクト比の一部を固定する。   (C) A part of the position, size, and aspect ratio is fixed.

CPU26は、複数フレームの画像において、表示領域の位置、大きさ、アスペクト比の少なくとも1つを固定する。例えば、位置および大きさを変更する際にはアスペクト比を固定し、位置およびアスペクト比を変更する際には大きさを固定するなど、位置、大きさ、アスペクト比の一部を固定することにより、表示領域の見た目の変化を抑え、ユーザによる視認性を向上させることができる。   The CPU 26 fixes at least one of the position, size, and aspect ratio of the display area in a plurality of frames of images. For example, by fixing a part of the position, size, and aspect ratio, such as fixing the aspect ratio when changing the position and size, and fixing the size when changing the position and aspect ratio. The change in the appearance of the display area can be suppressed and the visibility by the user can be improved.

(d)複数の被写体領域について、表示領域の重複具合に応じて表示領域を決定する。   (D) For a plurality of subject areas, the display area is determined according to the overlapping state of the display areas.

CPU26は、ステップS103のマスク抽出処理により複数の主要被写体領域が検出された場合に、各々の主要被写体領域について表示領域を求めた後に、それらの重複具合に応じて表示領域を決定する。例えば、図11Aに示すように、ステップS103において2つの主要被写体領域が検出された場合、CPU26は、それぞれの表示領域である矩形A8−1および矩形A8−2を比較し、矩形A8−2が矩形A8−1に包含されている場合には、図11Bに示すように、より広い方の矩形A8−1を表示領域とする。なお、選択的に一方の表示領域を採用する代わりに、2つの表示領域の平均を取って表示領域を決める構成としても良い。   When a plurality of main subject areas are detected by the mask extraction process in step S103, the CPU 26 obtains display areas for the respective main subject areas, and then determines display areas according to their overlapping conditions. For example, as shown in FIG. 11A, when two main subject areas are detected in step S103, the CPU 26 compares the rectangles A8-1 and A8-2 that are the display areas, and the rectangle A8-2 is displayed. If it is included in the rectangle A8-1, as shown in FIG. 11B, the wider rectangle A8-1 is set as the display area. Instead of selectively adopting one display area, the display area may be determined by taking the average of the two display areas.

また、例えば、図12Aに示すように、ステップS103において2つの主要被写体領域が検出された場合、CPU26は、それぞれの表示領域である矩形A9−1および矩形A9−2を比較し、図11Bに示すように、重複部分が占める割合がより高い矩形A9−2を表示領域とする。   Also, for example, as shown in FIG. 12A, when two main subject areas are detected in step S103, the CPU 26 compares the rectangles A9-1 and A9-2, which are the display areas, and FIG. As shown, a rectangle A9-2 having a higher proportion of overlapping portions is taken as a display area.

なお、ステップS103のマスク抽出処理により複数の主要被写体領域が検出された場合に、表示領域については重複具合に応じて表示領域を決定するが、AF用注目領域およびAE用注目領域については、それぞれの主要被写体領域を独立に扱い、AF用注目領域およびAE用注目領域をそれぞれ決定するものとする。   In addition, when a plurality of main subject areas are detected by the mask extraction process in step S103, the display area is determined according to the degree of overlap for the display area. For the AF attention area and the AE attention area, The main subject area is independently handled, and the AF attention area and the AE attention area are respectively determined.

このように、複数の主要被写体領域について、表示領域の重複具合に応じて表示領域を決定することにより、ユーザによる見た目が煩雑化するのを防ぎ、ユーザによる視認性を向上させることができる。   As described above, by determining the display areas of the plurality of main subject areas in accordance with the overlapping state of the display areas, it is possible to prevent the appearance of the user from becoming complicated and to improve the visibility of the user.

以上説明したように、本実施形態によれば、取得した画像データにより示される画像の特徴量を算出し、特徴量に基づいて定まる被写体領域を検出する。そして、画像に対して、検出した被写体領域の情報に基づいて、画像処理を施すとともに、検出した被写体領域もしくは、検出した被写体領域に基づく領域を視認可能に表示する。このとき、画像処理における注目領域である第1の領域と、第1の領域とは異なる領域であり、被写体領域もしくは、検出した被写体領域に基づく領域を表示する際の表示領域である第2の領域とを、領域検出部により検出した被写体領域の情報に基づいて決定する。   As described above, according to the present embodiment, the feature amount of the image indicated by the acquired image data is calculated, and the subject area determined based on the feature amount is detected. Then, image processing is performed on the image based on the detected subject area information, and the detected subject area or the area based on the detected subject area is displayed so as to be visible. At this time, the first area, which is the attention area in the image processing, is different from the first area, and is the second display area when displaying the subject area or the area based on the detected subject area. The region is determined based on the information of the subject region detected by the region detection unit.

したがって、画像処理に最適化した第1の領域と、表示に最適化した第2の領域とを独立に決定することにより、特徴量に基づいて検出した被写体領域の表示に際にして、画像処理の精度を維持しつつ、ユーザにとって視認性の高い表示を行うことができる。   Accordingly, by independently determining the first region optimized for image processing and the second region optimized for display, image processing is performed when displaying the subject region detected based on the feature amount. While maintaining this accuracy, it is possible to perform display with high visibility for the user.

特に、第2の領域である表示領域については、単純に検出した被写体領域に即した領域とすると、抽出した被写体領域にバラツキが生じる場合や、抽出自体が不安定である場合や、見た目が煩雑化する場合などがある。しかし、本実施形態のように、ユーザの視認性を加味して表示領域を決定することにより、適切な加工が加えられ、ユーザによる利便性も向上する。また、構図確認用のスルー画像については、一般に表示時間が長くなるため、このような工夫が大きな効果を発揮することとなる。   In particular, regarding the display area that is the second area, if the area is simply adapted to the detected subject area, the extracted subject area may vary, the extraction itself may be unstable, or the appearance may be complicated. There are some cases. However, as in this embodiment, by determining the display area in consideration of the visibility of the user, appropriate processing is added, and the convenience for the user is improved. In addition, since a display time is generally increased for a through image for composition confirmation, such a device has a great effect.

また、特に、第1の領域として、焦点調節に関わる領域を決定する際には、基本的に、検出した被写体領域に即した領域を採用する。したがって、領域を助長させて余分な情報が混入することにより焦点調節の精度が低下するという問題を抑えることができる。   In particular, when determining a region related to focus adjustment as the first region, a region corresponding to the detected subject region is basically employed. Therefore, it is possible to suppress the problem that the accuracy of the focus adjustment is deteriorated by promoting the area and mixing extra information.

以上、この発明の実施形態について図面を参照して詳述してきたが、具体的な構成はこの実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の設計等も含まれる。   The embodiment of the present invention has been described in detail with reference to the drawings. However, the specific configuration is not limited to this embodiment, and includes designs and the like that do not depart from the gist of the present invention.

また、上記の実施形態においては、図2のステップS106において、マスク抽出処理が安定して行われているか否かを判定する例を示したが、この判定を行わない構成としても良い。すなわち、図2のステップS104において被写体領域を抽出できたと判定された全ての画像を対象としてステップS107からステップS111の処理を行う構成としても良い。   In the above embodiment, the example in which it is determined whether or not the mask extraction process is stably performed in step S106 in FIG. 2 is described. However, a configuration in which this determination is not performed may be employed. In other words, the process from step S107 to step S111 may be performed for all images for which it has been determined that the subject area has been extracted in step S104 of FIG.

また、上記の実施形態において、自動検出モードの中断処理、再開処理を適宜実行しても良い。   In the above-described embodiment, the automatic detection mode interruption processing and resumption processing may be appropriately executed.

また、上記の実施形態においては、主要被写体領域の設定処理を行っていない状態で撮影指示が行われてしまう場合に備えて、通常の3A処理を行う例を示したが、本発明はこの例に限定されない。例えば、主要被写体領域の設定処理を行っていない状態で撮影指示を含む所定のユーザ操作が行われた場合に、マスク情報(図2ステップS105等)を用いて簡易的に主要被写体領域を設定する構成としても良い。   In the above-described embodiment, an example in which normal 3A processing is performed is shown in preparation for a case where a shooting instruction is performed in a state where the main subject region setting processing is not performed. It is not limited to. For example, when a predetermined user operation including a photographing instruction is performed in a state where the main subject region setting process is not performed, the main subject region is simply set using mask information (step S105 in FIG. 2). It is good also as a structure.

また、上記の実施形態においては、構図確認用のスルー画像に基づいて、一連の処理を行う例を示したが、本発明はこの例に限定されない。例えば、一眼レフカメラなどにおいて生成される構図確認用のライブビュー画像を対象とする場合にも、本発明を同様に適用することができる。また、記録媒体40等に記録された動画像を対象とする場合にも、本発明を同様に適用することができる。   In the above-described embodiment, an example in which a series of processing is performed based on a through image for composition confirmation has been described, but the present invention is not limited to this example. For example, the present invention can be similarly applied to a case where a live view image for composition confirmation generated in a single-lens reflex camera or the like is targeted. Further, the present invention can be similarly applied to a case where a moving image recorded on the recording medium 40 or the like is targeted.

また、上記の実施形態においては、すべてのフレームを対象として一連の処理を行う例を示したが、本発明はこの例に限定されない。例えば、時間的に間欠連続して生成された複数の画像を対象としても良い。具体的には、適宜フレーム間引きを行った複数の画像を対象としても良い。この場合、上記の実施形態における一連の処理は間引きされた複数の画像を対象として実行しつつ、すべての画像について表示を行っても良い。このような処理を行うことにより、処理負荷を軽減することができる。   In the above embodiment, an example in which a series of processing is performed for all frames has been described, but the present invention is not limited to this example. For example, a plurality of images generated intermittently in time may be targeted. Specifically, a plurality of images subjected to frame thinning as appropriate may be targeted. In this case, a series of processes in the above embodiment may be performed on a plurality of thinned images, and all the images may be displayed. By performing such processing, the processing load can be reduced.

また、コンピュータと画像処理プログラムとからなる「コンピュータシステム」により、上述した実施形態で説明した画像処理をソフトウェア的に実現しても良い。この場合、実施形態で説明したフローチャートの処理の一部または全部をコンピュータシステムで実行する構成とすれば良い。例えば、図2のステップS101からステップS111の処理の一部または全部をコンピュータで実行しても良い。このような構成とすることにより、上述した実施形態と同様の処理を実施することが可能になる。   Further, the image processing described in the above-described embodiment may be realized by software by a “computer system” including a computer and an image processing program. In this case, a part or all of the processing of the flowchart described in the embodiment may be configured to be executed by the computer system. For example, part or all of the processing from step S101 to step S111 in FIG. 2 may be executed by a computer. By adopting such a configuration, it is possible to perform the same processing as in the above-described embodiment.

この画像処理プログラムにおいては、画像処理の内容として様々なものが考えられる。例えば、動画像の編集時にも本発明を同様に適用することができる。また、例えば、対象画像がマルチアレイレンズを備えた撮像装置により生成された画像である場合に、画像処理としてリフォーカス処理を行う際にも、本発明を同様に適用することができる。   In this image processing program, various contents of image processing can be considered. For example, the present invention can be similarly applied when editing a moving image. Further, for example, when the target image is an image generated by an imaging device including a multi-array lens, the present invention can be similarly applied when performing refocus processing as image processing.

また、「コンピュータシステム」は、wwwシステムを利用している場合であれば、ホームページ提供環境(あるいは表示環境)も含むものとする。また、コンピュータ読み取り可能な記録媒体とは、フレキシブルディスク、光磁気ディスク、ROM、フラッシュメモリ等の書き込み可能な不揮発性メモリ、CD−ROM等の可搬媒体、コンピュータシステムに内蔵されるハードディスク等の記憶装置のことをいう。   Further, the “computer system” includes a homepage providing environment (or display environment) if a www system is used. The computer-readable recording medium is a writable nonvolatile memory such as a flexible disk, a magneto-optical disk, a ROM, or a flash memory, a portable medium such as a CD-ROM, and a storage such as a hard disk built in the computer system. Refers to the device.

さらにコンピュータ読み取り可能な記録媒体とは、インターネット等のネットワークや電話回線等の通信回線を介してプログラムが送信された場合のサーバやクライアントとなるコンピュータシステム内部の揮発性メモリ(例えばDRAM(Dynamic Random Access Memory))のように、一定時間プログラムを保持しているものも含むものとする。   Further, the computer-readable recording medium is a volatile memory (for example, DRAM (Dynamic Random Access) in a computer system serving as a server or a client when a program is transmitted via a network such as the Internet or a communication line such as a telephone line. Memory)) that holds a program for a certain period of time is also included.

また、上記プログラムは、このプログラムを記憶装置等に格納したコンピュータシステムから、伝送媒体を介して、あるいは、伝送媒体中の伝送波により他のコンピュータシステムに伝送されてもよい。ここで、プログラムを伝送する「伝送媒体」は、インターネット等のネットワーク(通信網)や電話回線等の通信回線(通信線)のように情報を伝送する機能を有する媒体のことをいう。   The program may be transmitted from a computer system storing the program in a storage device or the like to another computer system via a transmission medium or by a transmission wave in the transmission medium. Here, the “transmission medium” for transmitting the program refers to a medium having a function of transmitting information, such as a network (communication network) such as the Internet or a communication line (communication line) such as a telephone line.

また、上記プログラムは、前述した機能の一部を実現するためのものであっても良い。
さらに、前述した機能をコンピュータシステムにすでに記録されているプログラムとの組み合わせで実現できるもの、いわゆる差分ファイル(差分プログラム)であっても良い。
The program may be for realizing a part of the functions described above.
Furthermore, what can implement | achieve the function mentioned above in combination with the program already recorded on the computer system, and what is called a difference file (difference program) may be sufficient.

20…撮像装置、21…撮像部、22…画像処理装置、23‥表示部、26…CPU DESCRIPTION OF SYMBOLS 20 ... Imaging device, 21 ... Imaging part, 22 ... Image processing apparatus, 23 ... Display part, 26 ... CPU

Claims (16)

処理対象の画像データを取得する取得部と、
前記画像データにより示される画像の特徴量を算出し、前記特徴量に基づいて定まる被写体領域を検出する領域検出部と、
前記画像に対して、前記領域検出部により検出した前記被写体領域の情報に基づいて、画像処理を施す画像処理部と、
前記領域検出部により検出した前記被写体領域もしくは、前記被写体領域に基づく領域を視認可能に表示する表示部と、
前記画像処理における注目領域である第1の領域と、前記第1の領域とは異なる領域であり、前記表示部により前記被写体領域もしくは、前記被写体領域に基づく領域を表示する際の表示領域である第2の領域とを、前記領域検出部により検出した前記被写体領域の情報に基づいて決定する制御部と
を備えることを特徴とする画像処理装置。
An acquisition unit for acquiring image data to be processed;
A region detecting unit that calculates a feature amount of an image indicated by the image data and detects a subject region determined based on the feature amount;
An image processing unit that performs image processing on the image based on information on the subject region detected by the region detection unit;
A display unit that displays the subject region detected by the region detection unit or a region based on the subject region so as to be visible;
The first area, which is the attention area in the image processing, is an area different from the first area, and is a display area when the display area displays the subject area or an area based on the subject area. An image processing apparatus comprising: a control unit that determines a second region based on information on the subject region detected by the region detection unit.
請求項1に記載の画像処理装置において、
前記制御部は、ユーザによる前記被写体領域についての視認性を加味して前記第2の領域を決定する
ことを特徴とする画像処理装置。
The image processing apparatus according to claim 1.
The image processing apparatus, wherein the control unit determines the second region in consideration of visibility of the subject region by a user.
請求項1または請求項2に記載の画像処理装置において、
前記制御部は、所定の図形への近似を行うことにより前記第1の領域および前記第2の領域を決定し、
前記近似における精度は、前記第1の領域の方が前記第2の領域よりも高い、または、前記第1の領域と前記第2の領域とで同じである
ことを特徴とする画像処理装置。
The image processing apparatus according to claim 1 or 2,
The controller determines the first region and the second region by approximating a predetermined figure,
The accuracy in the approximation is higher in the first area than in the second area, or is the same in the first area and the second area.
請求項3に記載の画像処理装置において、
前記近似における精度は、前記図形の形状と、前記図形の大きさと、近似に用いる前記図形の個数との少なくとも1つにより決まる
ことを特徴とする画像処理装置。
The image processing apparatus according to claim 3.
The accuracy in the approximation is determined by at least one of the shape of the graphic, the size of the graphic, and the number of the graphic used for the approximation.
請求項3または請求項4に記載の画像処理装置において、
前記制御部は、前記画像処理装置における処理能力と、前記第1の領域および前記第2の領域の決定に要求される速度と、前記第1の領域および前記第2の領域の決定に要求される精度との少なくとも1つに基づいて、前記第1の領域および前記第2の領域に関する前記近似における精度を決定する
ことを特徴とする画像処理装置。
The image processing apparatus according to claim 3 or 4,
The control unit is required for determining the processing capacity of the image processing apparatus, the speed required for determining the first area and the second area, and determining the first area and the second area. An image processing apparatus, wherein the accuracy in the approximation relating to the first region and the second region is determined based on at least one of the following accuracy.
請求項1から請求項5の何れか1項に記載の画像処理装置において、
前記制御部は、前記領域検出部により複数の前記被写体領域が検出された場合に、前記第2の領域については、複数の前記被写体領域もしくは、それぞれの前記被写体領域に対応する複数の前記表示領域の重複具合に応じて、前記第2の領域を決定する
ことを特徴とする画像処理装置。
The image processing apparatus according to any one of claims 1 to 5,
When the plurality of subject regions are detected by the region detection unit, the control unit may include the plurality of subject regions or the plurality of display regions corresponding to the subject regions for the second region. The image processing apparatus, wherein the second region is determined in accordance with the degree of overlap.
請求項1から請求項6の何れか1項に記載の画像処理装置において、
前記制御部は、時間的に連続或いは間欠連続した複数の前記画像に関する前記第2の領域について、位置と大きさと形状との少なくとも1つを比較し、変化の度合が所定の範囲以内である場合には、同じ前記第2の領域とする
ことを特徴とする画像処理装置。
The image processing apparatus according to any one of claims 1 to 6,
The control unit compares at least one of a position, a size, and a shape with respect to the second region related to the plurality of images that are temporally continuous or intermittently continuous, and the degree of change is within a predetermined range. In the image processing apparatus, the second region is the same.
請求項7に記載の画像処理装置において、
前記制御部は、前記領域検出部により検出した前記被写体領域の面積変化に応じて、前記第2の領域を決定する
ことを特徴とする画像処理装置。
The image processing apparatus according to claim 7.
The image processing apparatus, wherein the control unit determines the second region according to a change in the area of the subject region detected by the region detection unit.
請求項7または請求項8に記載の画像処理装置において、
前記制御部は、複数の前記画像に関する前記第2の領域について、アスペクト比を固定してそれぞれの前記第2の領域を決定する
ことを特徴とする画像処理装置。
The image processing apparatus according to claim 7 or 8,
The control unit determines the second regions by fixing an aspect ratio for the second regions related to the plurality of images.
請求項7から請求項9の何れか1項に記載の画像処理装置において、
前記制御部は、時間的に連続或いは間欠連続する2枚の前記画像に関する前記第2の領域について、位置と大きさとアスペクト比との少なくとも1つを固定してそれぞれの前記第2の領域を決定する
ことを特徴とする画像処理装置。
The image processing apparatus according to any one of claims 7 to 9,
The control unit determines each of the second regions by fixing at least one of a position, a size, and an aspect ratio for the second region relating to the two images that are continuous or intermittently continuous in time. An image processing apparatus.
光学系による像を撮像して画像を生成する撮像部と、
請求項1から請求項10の何れか1項に記載の画像処理装置とを備え、
前記取得部は、前記撮像部から前記画像を取得する
ことを特徴とする撮像装置。
An imaging unit that captures an image by an optical system and generates an image;
An image processing apparatus according to any one of claims 1 to 10,
The said acquisition part acquires the said image from the said imaging part. The imaging device characterized by the above-mentioned.
請求項11に記載の撮像装置において、
前記第1の領域は、焦点調節に関わる領域である
ことを特徴とする撮像装置。
The imaging device according to claim 11,
The imaging device, wherein the first region is a region related to focus adjustment.
請求項12に記載の撮像装置において、
前記第1の領域は、前記領域検出部により検出した前記被写体領域の周辺エッジを含み、前記被写体領域よりも広い領域と前記被写体領域に内接する領域との少なくとも一方である
ことを特徴とする撮像装置。
The imaging apparatus according to claim 12,
The first area includes a peripheral edge of the subject area detected by the area detection unit, and is at least one of an area wider than the subject area and an area inscribed in the subject area. apparatus.
請求項11から請求項13の何れか1項に記載の撮像装置において、
前記第1の領域は、露出調整に関わる領域である
ことを特徴とする撮像装置。
The imaging apparatus according to any one of claims 11 to 13,
The image pickup apparatus, wherein the first area is an area related to exposure adjustment.
請求項14に記載の撮像装置において、
前記第1の領域は、前記領域検出部により検出した前記被写体領域に内接する領域である
ことを特徴とする撮像装置。
The imaging device according to claim 14, wherein
The imaging apparatus, wherein the first area is an area inscribed in the subject area detected by the area detection unit.
コンピュータに、
処理対象の画像データを取得する取得手順と、
前記画像データにより示される画像の特徴量を算出し、前記特徴量に基づいて定まる被写体領域を検出する領域検出手順と、
前記画像に対して、前記領域検出手順において検出した前記被写体領域の情報に基づいて、画像処理を施す画像処理手順と、
前記領域検出手順において検出した前記被写体領域もしくは、前記被写体領域に基づく領域を表示部に視認可能に表示する表示手順と、
前記画像処理における注目領域である第1の領域と、前記第1の領域とは異なる領域であり、前記表示手順により前記被写体領域もしくは、前記被写体領域に基づく領域を表示する際の表示領域である第2の領域とを、前記領域検出手順において検出した前記被写体領域の情報に基づいて決定する制御手順と
を実行させるための画像処理プログラム。
On the computer,
An acquisition procedure for acquiring image data to be processed;
A region detection procedure for calculating a feature amount of an image indicated by the image data and detecting a subject region determined based on the feature amount;
An image processing procedure for performing image processing on the image based on information on the subject region detected in the region detection procedure;
A display procedure for displaying the subject area detected in the area detection procedure or an area based on the subject area in a visible manner on a display unit;
The first area, which is the attention area in the image processing, is an area different from the first area, and is a display area when the subject area or an area based on the subject area is displayed by the display procedure. An image processing program for executing a control procedure for determining a second region based on information on the subject region detected in the region detection procedure.
JP2012179351A 2012-08-13 2012-08-13 Image processing apparatus, imaging apparatus, and image processing program Active JP5949306B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012179351A JP5949306B2 (en) 2012-08-13 2012-08-13 Image processing apparatus, imaging apparatus, and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012179351A JP5949306B2 (en) 2012-08-13 2012-08-13 Image processing apparatus, imaging apparatus, and image processing program

Publications (2)

Publication Number Publication Date
JP2014039099A JP2014039099A (en) 2014-02-27
JP5949306B2 true JP5949306B2 (en) 2016-07-06

Family

ID=50286920

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012179351A Active JP5949306B2 (en) 2012-08-13 2012-08-13 Image processing apparatus, imaging apparatus, and image processing program

Country Status (1)

Country Link
JP (1) JP5949306B2 (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7769285B2 (en) * 2005-02-07 2010-08-03 Panasonic Corporation Imaging device
JP5055018B2 (en) * 2006-06-14 2012-10-24 キヤノン株式会社 Image processing apparatus, imaging apparatus, and control method for image processing apparatus
JP4775644B2 (en) * 2006-06-20 2011-09-21 カシオ計算機株式会社 Imaging apparatus and program thereof
JP2009177358A (en) * 2008-01-22 2009-08-06 Canon Inc Image processor, image processing method, and program
JP5195663B2 (en) * 2009-06-19 2013-05-08 カシオ計算機株式会社 Imaging apparatus, focusing method, and program
JP6083987B2 (en) * 2011-10-12 2017-02-22 キヤノン株式会社 Imaging apparatus, control method thereof, and program

Also Published As

Publication number Publication date
JP2014039099A (en) 2014-02-27

Similar Documents

Publication Publication Date Title
JP6512810B2 (en) Image pickup apparatus, control method and program
JP6518452B2 (en) Imaging apparatus and imaging method
JP6418879B2 (en) Image processing apparatus, control method thereof, control program, and imaging apparatus
US11184524B2 (en) Focus control device, focus control method, program, and imaging device
US11275230B2 (en) Detection apparatus, detection method, detection program, and imaging apparatus
JP6460721B2 (en) Image processing apparatus, image processing method, and program
WO2016002355A1 (en) Image capturing device and image capturing method
US20130128090A1 (en) Image photographing device and image photographing method thereof
US11252347B2 (en) Image pickup apparatus, image pickup method, and storage medium
US9986163B2 (en) Digital photographing apparatus and digital photographing method
JP5370555B2 (en) Imaging apparatus, imaging method, and program
US11513315B2 (en) Focus control device, focus control method, program, and imaging device
US20130265473A1 (en) Imaging apparatus, focus control method, and program
JP5949306B2 (en) Image processing apparatus, imaging apparatus, and image processing program
US10694096B2 (en) Image pickup apparatus, method for controlling image pickup apparatus, and computer-readable storage medium
CN106464783B (en) Image pickup control apparatus, image pickup apparatus, and image pickup control method
US20230217126A1 (en) Imaging apparatus, imaging method
JP2018151415A (en) Imaging device, method of controlling imaging device, and program
JP2011164428A (en) Imaging apparatus and control method for the imaging apparatus
JP6003383B2 (en) Image processing apparatus, imaging apparatus, and image processing program
US9979861B2 (en) Photographing apparatus
JP6148575B2 (en) IMAGING DEVICE, ITS CONTROL METHOD, PROGRAM, AND STORAGE MEDIUM
JP2018116723A (en) Image processing system
JP2013243440A (en) Imaging apparatus
JP2014232418A (en) Image processing apparatus, imaging device, and image processing program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150629

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160421

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160523

R150 Certificate of patent or registration of utility model

Ref document number: 5949306

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250