JP6443486B2 - 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
JP6443486B2
JP6443486B2 JP2017077610A JP2017077610A JP6443486B2 JP 6443486 B2 JP6443486 B2 JP 6443486B2 JP 2017077610 A JP2017077610 A JP 2017077610A JP 2017077610 A JP2017077610 A JP 2017077610A JP 6443486 B2 JP6443486 B2 JP 6443486B2
Authority
JP
Japan
Prior art keywords
unit
mask
cpu
image
determination
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
JP2017077610A
Other languages
Japanese (ja)
Other versions
JP2017121092A (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 JP2017077610A priority Critical patent/JP6443486B2/en
Publication of JP2017121092A publication Critical patent/JP2017121092A/en
Application granted granted Critical
Publication of JP6443486B2 publication Critical patent/JP6443486B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Studio Devices (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

特許文献1に開示された撮像装置は、被写体形状の変化量に応じてAF測距枠を変形するため、被写体がカメラ方向に移動する場合に良好な効果を得ることができる。しかし、実際の被写体は、様々な動きをすることがあるとともに、撮影を行うユーザの目的も様々であり、必ずしもユーザにとって望ましい被写体に対して焦点調節が行われない場合もある。   Since the imaging device disclosed in Patent Document 1 deforms the AF distance measurement frame in accordance with the amount of change in the subject shape, a favorable effect can be obtained when the subject moves in the camera direction. However, an actual subject may move in various ways, and the purpose of a user who performs shooting also varies, and focus adjustment may not always be performed on a subject desired for the user.

本発明は、前記の点に鑑みてなされたものであり、容易かつ的確に主要被写体領域の抽出を継続的に行うことを目的とする。   The present invention has been made in view of the above points, and an object of the present invention is to continuously extract a main subject region easily and accurately.

本発明の画像処理装置は、時間的に連続して生成された複数の画像データを順次取得する取得部と、前記画像データにより示される画像の特徴量を算出し、前記特徴量に基づいて被写体領域を検出する領域検出部と、前記取得部により取得された前記複数の画像データにより示される画像のうち、少なくとも2枚の画像において検出された前記被写体領域を比較することにより、前記領域検出部により検出された領域が安定しているか否かを判定する判定部と、前記判定部により前記領域が安定していると判定すると、前記判定の対象となった前記被写体領域を主要被写体領域として設定する設定部とを備え、前記判定部は、記録部に記録された前記領域検出部の検出結果と、前記記録部に記録された前記判定部の判定結果と、の少なくとも一方に基づいて、任意の前記被写体領域が過去に判定されているか否かを判定し、判定結果に基づいて、安定していると判定する基準を変える。 An image processing apparatus according to the present invention includes: an acquisition unit that sequentially acquires a plurality of pieces of image data generated continuously in time; a feature amount of an image indicated by the image data; and a subject based on the feature amount An area detection unit that detects an area, and the area detection unit by comparing the subject areas detected in at least two images among images indicated by the plurality of image data acquired by the acquisition unit A determination unit that determines whether or not the region detected by the step is stable; and when the determination unit determines that the region is stable, the subject region that is the target of the determination is set as a main subject region comprising a setting unit that, the, the determination unit includes a detection result of the recording unit the area detecting unit, the determination unit determination result recorded in the recording unit, the less the On the other hand, on the basis, to determine whether any of the subject region is determined in the past, based on the determination result, changing the criteria for determining that the stable.

なお、前記画像に対し位置関係がわかるように、前記設定部により設定した前記主要被写体領域を視認可能に表示する表示部をさらに備えても良い。   In addition, a display unit that displays the main subject region set by the setting unit so as to be visible may be further provided so that the positional relationship with the image can be understood.

また、前記設定部により設定した前記主要被写体領域に関する情報を記録する記録部をさらに備えても良い。   Further, a recording unit that records information on the main subject region set by the setting unit may be further provided.

また、前記判定部は、所定の枚数の画像において連続あるいは間欠連続して同一の前記被写体領域が前記領域検出部により検出された場合に、前記領域が安定していると判定しても良い。   The determination unit may determine that the region is stable when the same region of the subject is detected continuously or intermittently in a predetermined number of images by the region detection unit.

また、前記領域検出部は、前記特徴量に基づいてマスク抽出を行うことにより前記被写体領域を検出し、前記判定部は、前記マスク抽出の抽出条件と、前記マスク抽出により抽出されたマスクの位置変化と、前記マスクの大きさ変化との少なくとも1つに基づいて、前記被写体領域の比較を行っても良い。   The region detection unit detects the subject region by performing mask extraction based on the feature amount, and the determination unit detects the extraction condition of the mask extraction and the position of the mask extracted by the mask extraction. The subject areas may be compared based on at least one of a change and a change in the size of the mask.

また、前記領域検出部による検出結果と、前記判定部による判定結果とを記録する履歴記録部をさらに備え、前記判定部は、少なくとも前記マスクの位置変化に基づいて前記被写体領域の比較を行う際に、前記マスクの位置変化の変化量を、前記履歴記録部に記録された前記検出結果と前記判定結果との少なくとも一方に基づく閾値と比較することにより、前記被写体領域の比較を行っても良い。   In addition, a history recording unit that records a detection result by the region detection unit and a determination result by the determination unit is further provided, and the determination unit performs comparison of the subject region based on at least a change in the position of the mask. In addition, the subject areas may be compared by comparing the amount of change in the mask position change with a threshold value based on at least one of the detection result and the determination result recorded in the history recording unit. .

また、前記領域検出部による検出結果と、前記判定部による判定結果とを記録する履歴記録部をさらに備え、前記判定部は、少なくとも前記マスクの大きさ変化に基づいて前記被写体領域の比較を行う際に、前記マスクの大きさ変化の変化量を、前記履歴記録部に記録された前記検出結果と前記判定結果との少なくとも一方に基づく閾値と比較することにより、前記被写体領域の比較を行っても良い。   In addition, a history recording unit that records a detection result by the region detection unit and a determination result by the determination unit is provided, and the determination unit compares the subject regions based on at least a change in the size of the mask. In this case, the subject region is compared by comparing the amount of change in the size of the mask with a threshold value based on at least one of the detection result and the determination result recorded in the history recording unit. Also good.

また、前記領域検出部による検出結果と、前記判定部による判定結果とを記録する履歴記録部をさらに備え、前記判定部は、前記履歴記録部に記録された前記検出結果と前記判定結果との少なくとも一方に基づき、任意の前記被写体領域が過去に検出されているか否かを判定し、任意の前記被写体領域が過去に検出されていた場合には、前記所定の枚数よりも少ない任意の枚数の画像において連続あるいは間欠連続して同一の前記被写体領域が前記領域検出部により検出されていれば、前記領域が安定していると判定しても良い。   In addition, a history recording unit that records a detection result by the region detection unit and a determination result by the determination unit is further provided, and the determination unit includes the detection result and the determination result recorded in the history recording unit. Based on at least one, it is determined whether or not any subject area has been detected in the past, and if any subject area has been detected in the past, an arbitrary number less than the predetermined number If the same subject area is detected continuously or intermittently in the image by the area detection unit, it may be determined that the area is stable.

また、前記領域検出部による検出が有効であるか否かを判定する第2判定部をさらに備え、前記判定部は、前記複数の画像のうち少なくとも2枚の画像において、前記被写体領域を比較することにより、前記領域が安定しているか否かを判定しても良い。   The image forming apparatus further includes a second determination unit that determines whether or not the detection by the region detection unit is valid, and the determination unit compares the subject region in at least two images of the plurality of images. Thus, it may be determined whether or not the region is stable.

また、前記領域検出部により複数の前記被写体領域が検出された場合に、前記判定部は、前記領域が安定しているか否かの判定を中止し、前記設定部は、前記主要被写体領域の設定を中止しても良い。   Further, when a plurality of the subject regions are detected by the region detection unit, the determination unit stops determining whether the region is stable, and the setting unit sets the main subject region. May be canceled.

また、前記取得部は、前記複数の画像として、時間的に連続して生成された前記複数の画像に代えて、時間的に間欠して生成された複数の画像データを順次取得しても良い。   The acquisition unit may sequentially acquire a plurality of image data generated intermittently in time instead of the plurality of images generated continuously in time as the plurality of images. .

本発明の撮像装置は、光学系による像を撮像して画像データを生成する撮像部と、上述した画像処理装置とを備えた撮像装置であって、前記撮像装置の動きを検出するセンサを有する動き検出部をさらに備え、前記取得部は、前記撮像部により生成された画像を取得し、前記第2判定部は、前記動き検出部による検出結果に基づいて、前記領域検出部による検出が有効であるか否かを判定する。   An imaging apparatus according to the present invention is an imaging apparatus that includes an imaging unit that captures an image by an optical system and generates image data, and the above-described image processing apparatus, and includes a sensor that detects the movement of the imaging apparatus. A motion detection unit; the acquisition unit acquires an image generated by the imaging unit; and the second determination unit is effective in detecting by the region detection unit based on a detection result of the motion detection unit. It is determined whether or not.

本発明の別の撮像装置は、光学系による像を撮像して画像データを生成する撮像部と、上述した画像処理装置とを備えた撮像装置であって、前記取得部により取得した前記複数の画像のうち、少なくとも2枚の画像に基づいて、前記撮像装置の動きを検出する動き検出部をさらに備え、前記取得部は、前記撮像部により生成された画像を取得し、前記第2判定部は、前記動き検出部による検出結果に基づいて、前記領域検出部による検出が有効であるか否かを判定する。   Another imaging device of the present invention is an imaging device including an imaging unit that captures an image by an optical system to generate image data, and the above-described image processing device, and the plurality of images acquired by the acquisition unit The image processing apparatus further includes a motion detection unit that detects a motion of the imaging device based on at least two images, and the acquisition unit acquires an image generated by the imaging unit, and the second determination unit Determines whether the detection by the region detection unit is effective based on the detection result by the motion detection unit.

なお、前記第2判定部による判定結果に基づいて、前記領域検出部と、前記判定部と、前記設定部と、前記動き検出部との少なくとも1つを制御する制御部をさらに備えても良い。   Note that a control unit that controls at least one of the region detection unit, the determination unit, the setting unit, and the motion detection unit based on a determination result by the second determination unit may be further provided. .

また、前記第2判定部による判定結果に基づいて、前記領域検出部による前記被写体領域の検出を中止する制御部をさらに備えても良い。   In addition, a control unit may be provided that stops detection of the subject area by the area detection unit based on a determination result by the second determination unit.

また、前記判定部は、前記領域検出部において過去に検出した被写体領域を再び検出し、かつ、前記動き検出部による検出結果により前記撮像装置が所定の動きをしたと推測できる場合には、前記領域が安定していると判定しても良い。   In addition, when the determination unit detects again the subject region detected in the past by the region detection unit, and can estimate that the imaging device has made a predetermined movement based on the detection result by the motion detection unit, It may be determined that the region is stable.

また、前記判定部は、前記領域検出部において過去に検出した被写体領域を再び検出し、かつ、前記動き検出部による検出結果により前記撮像装置が所定の動きをしたと推測できる場合には、それ以外の場合よりも条件を緩めて前記領域が安定しているか否かを判定しても良い。   In addition, if the determination unit detects again the subject region detected in the past by the region detection unit and can estimate that the imaging apparatus has made a predetermined movement based on the detection result by the motion detection unit, It may be determined whether the region is stable by loosening the conditions than in other cases.

また、前記判定部は、前記領域検出部において前記被写体領域を検出し、かつ、前記動き検出部による検出結果により、前記撮像装置が一定の速度で一定時間以上継続して動いたと推測できる場合には、前記領域が安定していると判定しても良い。   Further, when the determination unit detects the subject region in the region detection unit, and can estimate that the imaging apparatus has continuously moved at a constant speed for a certain time or more based on a detection result by the motion detection unit. May determine that the region is stable.

また、前記設定部は、前記判定部による判定結果に基づいて主要被写体領域を設定する第1のモードと、焦点調節情報に基づいて主要被写体領域を設定する第2のモードとを切り替え可能に有し、前記第1のモードによって前記主要被写体領域を設定できない場合には、前記第2のモードに切り替えても良い。   The setting unit can switch between a first mode in which a main subject region is set based on a determination result by the determination unit and a second mode in which a main subject region is set based on focus adjustment information. If the main subject area cannot be set in the first mode, the mode may be switched to the second mode.

本発明の別の撮像装置は、光学系による像を撮像して画像データを生成する撮像部と、時間的に連続して生成された複数の画像データを前記撮像部から順次取得する取得部と、前記画像データにより示される画像における特徴量を算出し、前記特徴量に基づいて被写体領域を検出する領域検出部と、前記取得部により取得された前記複数の画像データにより示される画像のうち、少なくとも2枚の画像において検出された前記被写体領域を比較することにより、前記領域検出部により検出された領域が安定しているか否かを判定する判定部と、前記判定部により前記領域が安定していると判定すると、前記判定の対象となった前記被写体領域を主要被写体領域として設定する設定部とを備える。   Another imaging device of the present invention includes an imaging unit that captures an image by an optical system to generate image data, and an acquisition unit that sequentially acquires a plurality of temporally generated image data from the imaging unit. Calculating a feature amount in the image indicated by the image data and detecting a subject region based on the feature amount; and among the images indicated by the plurality of image data acquired by the acquisition unit, A determination unit that determines whether the region detected by the region detection unit is stable by comparing the subject regions detected in at least two images, and the region is stabilized by the determination unit. A setting unit that sets the subject area that is the subject of the determination as a main subject area.

本発明の画像処理プログラムは、コンピュータに、時間的に連続して生成された複数の画像データを順次取得する取得手順と、前記画像データにより示される画像の特徴量を算出し、前記特徴量に基づいて被写体領域を検出する領域検出手順と、前記取得手順において取得した前記複数の画像データにより示される画像のうち、少なくとも2枚の画像において検出された前記被写体領域を比較することにより、前記領域検出手順により検出された領域が安定しているか否かを判定する判定手順と、前記判定手順において前記領域が安定していると判定すると、前記判定の対象となった前記被写体領域を主要被写体領域として設定する設定手順とを実行させる。   The image processing program of the present invention calculates, in the computer, an acquisition procedure for sequentially acquiring a plurality of pieces of image data generated sequentially in time, and a feature amount of an image indicated by the image data. An area detection procedure for detecting a subject area on the basis of the area detected by comparing the subject areas detected in at least two images among images indicated by the plurality of image data acquired in the acquisition procedure; A determination procedure for determining whether or not the area detected by the detection procedure is stable, and if it is determined that the area is stable in the determination procedure, the subject area that is the object of the determination is a main subject area The setting procedure to be set as is executed.

本発明によれば、容易かつ的確に主要被写体領域の抽出を継続的に行うことができる。   According to the present invention, the main subject region can be continuously extracted easily and accurately.

レンズ鏡筒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. マスク抽出処理により抽出されたマスクが安定しているか否かの判定について説明する図である。It is a figure explaining determination of whether the mask extracted by the mask extraction process is stable. 自動検出モード実行時のCPU26の動作を示す別のフローチャートである。It is another flowchart which shows operation | movement of CPU26 at the time of automatic detection mode execution. 自動検出モード実行時のCPU26の動作を示す別のフローチャート(続き)である。It is another flowchart (continuation) which shows operation | movement of CPU26 at the time of automatic detection mode execution.

<第1実施形態>
以下、第1実施形態について図面を参照して詳細に説明する。
<First Embodiment>
Hereinafter, a first embodiment will be described in detail with reference to the drawings.

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

撮像装置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のフローチャートを参照して説明する。   Hereinafter, the operation of the CPU 26 when the automatic detection mode is executed will be described with reference to the flowchart of FIG.

ステップ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は、図3に示すように、n回以上連続して同一のマスクを抽出したと判定すると後述するステップS108に進む。一方、n回以上連続して同一のマスクを抽出していないと判定すると、CPU26は、ステップS108に進む。   In step S106, the CPU 26 determines whether or not the same mask has been extracted continuously n times (n frames) or more. When the CPU 26 determines that the same mask has been extracted n times or more consecutively as shown in FIG. 3, the CPU 26 proceeds to step S108 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 S108.

同一のマスクを抽出する場合とは、複数フレームにおいて、略同色、略同サイズのマスクが、略同じ位置において抽出する場合である。この判定には、ステップ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. In this way, by comparing the extracted masks, the subject regions that are candidates for the main subject region can be compared between frames. Based on the mask information and 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. The threshold for determining whether or not can be changed as appropriate. 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 the mask extracted by the mask extraction process in step S103 is stable. If the mask extracted by the mask extraction process in step S103 is stable, it can be determined that the main subject region 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.

また、n回(nフレーム)以上連続して同一のマスクを抽出したか否かを判定する代わりに、N/M回(N/Mフレーム)同一のマスクを抽出したか否かを判定しても良い。例えば、N=3、M=5として、5回(5フレーム)のうち、3回(3フレーム)において同一のマスクを抽出した場合には、ステップS103のマスク抽出処理により抽出されたマスクが安定していると判定しても良い。NおよびMは上述したnの値と同様に、適宜変更可能としても良い。   Instead of determining whether the same mask has been extracted n times (n frames) or more, it is determined whether the same mask has been extracted N / M times (N / M frames). Also good. For example, when N = 3 and M = 5 and the same mask is extracted 3 times (3 frames) out of 5 times (5 frames), the mask extracted by the mask extraction process in step S103 is stable. You may determine that you are doing. N and M may be appropriately changed in the same manner as the value of n described above.

また、ステップ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.

ステップS107において、CPU26は、前回まで連続して同一のマスクを抽出したか否かを判定する。この判定にも、ステップS105で説明したマスク情報等を用いれば良い。CPU26は、前回まで連続して同一のマスクを抽出したと判定するとステップS108に進む。一方、n回以上連続して同一のマスクを抽出していないと判定すると、CPU26は、後述するステップS111に進む。   In step S107, the CPU 26 determines whether or not the same mask has been extracted continuously until the previous time. For this determination, the mask information described in step S105 may be used. If the CPU 26 determines that the same mask has been extracted continuously until the previous time, the process proceeds to step S108. 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 S111 described later.

前回まで連続して同一のマスクを抽出した場合には、今回のみ一時の未抽出が発生した可能性がある。上述した未抽出は、被写体の一時的な変化、光源変化、抽出処理のエラーなどにより発生する。したがって、このような場合には、一時的な未抽出によりそれまでの蓄積を無効にせず、次のフレームにおいて同一のマスクを抽出した場合には、前回までの安定状態が維持されているものとし、後述するステップS108に進む。なお、このような一時的な未抽出が発生した場合に、ステップS102に戻る構成としても良い。さらに、ステップS102に戻った後は、ステップS106におけるnの値を小さめに変更しても良い。例えば、通常は7回以上で安定と判断するが、一時的な未検出が発生した後は、3回以上で安定と判断するなどの例が考えられる。   If the same mask is extracted continuously until the previous time, there is a possibility that temporary unextraction has occurred only this time. The unextraction described above occurs due to a temporary change in the subject, a change in the light source, an error in extraction processing, and the like. Therefore, in such a case, if the same mask is extracted in the next frame without invalidating the previous accumulation due to temporary unextraction, the stable state up to the previous time is maintained. Then, the process proceeds to step S108 described later. It should be noted that when such a temporary unextraction occurs, the configuration may return to step S102. Further, after returning to step S102, the value of n in step S106 may be changed to a smaller value. For example, although it is normally determined that it is stable after 7 times or more, an example is considered in which it is determined that it is stable after 3 times or more after a temporary undetection occurs.

ステップS108において、CPU26は、抽出したマスクに基づいて主要被写体領域を設定する。主要被写体領域は、ステップS106またはステップS107において判定の対象となったフレームの画像において、ステップS103で抽出されたマスクに基づいて求められる。   In step S108, the CPU 26 sets a 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 determined in step S106 or step S107.

ステップS109において、CPU26は、主要被写体領域の情報をバッファメモリ部24や記憶部25等に記録する。主要被写体領域の情報には、用いられたマスクに関するマスク情報、主要被写体領域の位置、主要被写体領域の大きさや形状などの情報が含まれる。   In step S109, 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.

ステップS110において、CPU26は、主要被写体領域の情報を表示部23に表示する。CPU26は、表示部26を制御し、ステップS101で取得したスルー画像に重畳して、主要被写体領域を視認可能に表示する。例えば、CPU26は、主要被写体領域に枠などを表示する。なお、この枠は、主要被写体領域の形状に応じたものであっても良いし、矩形や円形など所定の形状であっても良い。また、線の太さ、濃淡、色などはどのようなものであっても良い。いずれにせよ、このような表示を行うことにより、ユーザは、CPU26が自動で検出している主要被写体領域がどのようなものであるかを、容易に把握することができる。   In step S <b> 110, the CPU 26 displays information on the main subject area on the display unit 23. The CPU 26 controls the display unit 26 to display the main subject area so as to be visible by superimposing it on the through image acquired in step S101. For example, the CPU 26 displays a frame or the like in the main subject area. The frame may be in accordance with the shape of the main subject area, or may be a predetermined shape such as a rectangle or a circle. Also, the line thickness, shading, color, etc. may be anything. In any case, by performing such display, the user can easily grasp what the main subject area is automatically detected by the CPU 26 is.

ステップS111において、CPU26は、m回(mフレーム)以上連続して設定に失敗したか否かを判定する。CPU26は、m回以上連続してステップS108で説明した主要被写体領域の設定処理を行えなかった場合、m回以上連続して失敗したと判定してステップS112に進む。一方、m回以上連続して失敗していないと判定すると、CPU26は、後述するステップS113に進む。なお、上述したmは所定の閾値(例えば、m=30)であり、操作部27を介したユーザ操作などに基づいて適宜変更可能としても良い。   In step S111, the CPU 26 determines whether or not the setting has failed continuously m times (m frames) or more. If the CPU 26 has not been able to perform the main subject area setting process described in step S108 continuously for at least m times, the CPU 26 determines that the process has failed continuously for at least m times and proceeds to step S112. On the other hand, when determining that it has not failed continuously for m times or more, the CPU 26 proceeds to step S113 described later. Note that m described above is a predetermined threshold (for example, m = 30), and may be appropriately changed based on a user operation via the operation unit 27.

ステップS112において、CPU26は、自動検出モードによる検出は困難であると判断し、焦点調節情報に基づいて主要被写体領域を検出する通常モードに変更して一連の処理を終了する。なお、自動検出モードから変更する際には、表示部23等を利用して、ユーザに対する報知を行っても良い。   In step S112, the CPU 26 determines that detection in the automatic detection mode is difficult, changes to the normal mode in which the main subject region is detected based on the focus adjustment information, and ends the series of processes. In addition, when changing from automatic detection mode, you may alert | report to a user using the display part 23 grade | etc.,.

ステップS113において、CPU26は、主要被写体領域の設定処理を行っていない状態で撮影指示が行われてしまう場合に備えて、通常の3A処理を行う。3A処理とは、焦点調整(AF)の設定処理、露出調整(AE)の設定処理、ホワイトバランス調整処理(AWB)であり、公知技術と同様に行われる。   In step S113, the CPU 26 performs normal 3A processing in preparation for a case where a shooting instruction is issued in a state where the main subject area setting processing 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.

なお、任意の被写体領域がステップS108の処理により主要被写体領域として設定されている場合には、CPU26は、その設定を解除するとともに、表示部23における主要被写体領域の情報の表示を終了してステップS114に進む。   If an arbitrary subject area has been set as the main subject area by the processing of step S108, the CPU 26 cancels the setting and ends the display of information on the main subject area on the display unit 23. Proceed to S114.

ステップS114において、CPU26は、撮影指示が行われたか否かを判定する。CPU26は、撮影指示が行われたと判定するとステップS115に進む。一方、撮影指示が行われないと判定すると、CPU26は、ステップS102に戻り、次のフレームの画像に対してステップS102以降の処理を行う。撮影指示は、操作部27のシャッタボタンを介したユーザ操作により行われる。このユーザ操作は、いわゆる半シャッタと全シャッタの何れであっても良い。   In step S114, 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 S115. 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.

ステップS115において、CPU26は、各部を制御して撮影を実行する。このとき、CPU26は、ステップS108で設定した主要被写体領域の情報に基づいて撮影を行う。CPU26は、ステップS108で主要被写体領域を設定している場合には、設定した主要被写体領域の情報に基づいて、焦点調整(AF)の設定処理、露出調整(AE)の設定処理、ホワイトバランス調整処理(AWB)の3A処理を行うとともに、画像処理装置22における各種画像処理の条件等を決定する。また、ステップS113で通常の3A処理を行っている場合には、3A処理の結果に基づいて、焦点調整(AF)の設定処理、露出調整(AE)の設定処理、ホワイトバランス調整処理(AWB)の3A処理を行うとともに、画像処理装置22における各種画像処理の条件等を決定する。   In step S115, the CPU 26 controls each unit to perform shooting. At this time, the CPU 26 performs shooting based on information on the main subject area set in step S108. When the main subject area is set in step S108, the CPU 26 sets focus adjustment (AF) setting processing, exposure adjustment (AE) setting processing, and white balance adjustment based on the set main subject area information. In addition to performing 3A processing (AWB), conditions for various image processing in the image processing apparatus 22 are determined. When normal 3A processing is performed in step S113, focus adjustment (AF) setting processing, exposure adjustment (AE) setting processing, and white balance adjustment processing (AWB) are performed based on the result of the 3A processing. 3A processing is performed, and various image processing conditions in the image processing device 22 are determined.

ステップ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.

以上説明した一連の処理により、CPU26は、主要被写体の遷移状態を継続的に検出することができる。遷移状態には以下のようなものがある。
・検出:ある被写体が、規定フレームに渡って安定的にマスク抽出されることにより、主要被写体領域として設定される(ステップS106→ステップS108等)。
・継続:設定された主要被写体領域が後続のフレームでも安定的にマスク抽出される(ステップS108等)。
・中止:設定された主要被写体領域が後続のフレームで消失し、設定が解除される(ステップS113等)。
・更新:設定された主要被写体領域が後続のフレームで消失し、新たな被写体が主要被写体領域として設定される(ステップS113→(中略)→ステップS106→ステップS108等)。
・復元:設定された主要被写体領域が後続のフレームで一旦消失し、再度出現して主要被写体領域として設定される(ステップS107→ステップS108等)。
Through the series of processes described above, the CPU 26 can continuously detect the transition state of the main subject. Transition states include the following.
Detection: A certain subject is set as a main subject region by performing mask extraction stably over a specified frame (step S106 → step S108, etc.).
Continuation: The set main subject area is stably mask extracted even in subsequent frames (step S108, etc.).
Cancel: The set main subject area disappears in the subsequent frame, and the setting is canceled (step S113, etc.).
Update: The set main subject area disappears in the subsequent frame, and a new subject is set as the main subject area (step S113 → (omitted) → step S106 → step S108, etc.).
Restoration: The set main subject area once disappears in the subsequent frame, appears again, and is set as the main subject area (step S107 → step S108, etc.).

以上説明したように、第1実施形態によれば、時間的に連続して生成された複数の画像データを順次取得し、画像データにより示される画像の特徴量を算出し、特徴量に基づいて被写体領域を検出する。そして、複数の画像のうち、少なくとも2枚の画像において検出された被写体領域を比較することにより、検出された領域が安定しているかを判定し、安定していると判定すると、判定の対象となった被写体領域を主要被写体領域として設定する。   As described above, according to the first embodiment, a plurality of pieces of image data generated successively in time are sequentially acquired, the feature amount of the image indicated by the image data is calculated, and based on the feature amount. Detect the subject area. Then, by comparing subject areas detected in at least two images of the plurality of images, it is determined whether the detected area is stable. The set subject area is set as the main subject area.

通常、撮影において最も一般的なケースは、静止している被写体を撮影するケースである。このような場合には、撮像装置自体の動きは少なく、かつ、撮影対象の画面内にも動いている物体はほとんどない状態である。したがって、上述の構成により、容易かつ的確に主要被写体領域の抽出を継続的に行うことができる。特に、従来のいわゆる追尾技術とは異なり、ユーザの指定操作を必要としない上に、新しい被写体が出現した場合でも柔軟に対応することができる。また、従来のいわゆる顔認識技術と異なり、顔以外の被写体であっても、主要被写体領域として設定することができる。   Usually, the most common case of shooting is a case of shooting a stationary subject. In such a case, there is little movement of the imaging apparatus itself, and there is almost no moving object in the screen to be imaged. Therefore, with the above-described configuration, the main subject area can be continuously extracted easily and accurately. In particular, unlike a conventional so-called tracking technique, a user's designation operation is not required, and even when a new subject appears, it is possible to respond flexibly. Further, unlike a so-called face recognition technique in the past, even a subject other than a face can be set as a main subject region.

また、第1実施形態によれば、画像に対し位置関係がわかるように、設定した主要被写体領域を視認可能に表示する。したがって、ユーザは、撮像装置が自動で検出している主要被写体領域がどのようなものであるかを、容易に把握することができる。   Further, according to the first embodiment, the set main subject area is displayed so as to be visible so that the positional relationship with the image can be understood. Therefore, the user can easily grasp what the main subject area is automatically detected by the imaging apparatus.

また、第1実施形態によれば、設定した主要被写体領域に関する情報を記録する。したがって、主要被写体領域の情報を撮影時や撮影後の画像処理時に重点的に利用することができる。   Further, according to the first embodiment, information regarding the set main subject area is recorded. Therefore, information on the main subject area can be used preferentially at the time of shooting or image processing after shooting.

<第2実施形態>
以下、第2実施形態について図面を参照して詳細に説明する。第2実施形態は、第1実施形態の変形例である。したがって、第1実施形態と異なる部分についてのみ説明し、第1実施形態と同様の部分については説明を省略する。
Second Embodiment
Hereinafter, the second embodiment will be described in detail with reference to the drawings. The second embodiment is a modification of the first embodiment. Therefore, only the parts different from the first embodiment will be described, and the description of the same parts as the first embodiment will be omitted.

第2実施形態では、第1実施形態の図1に示したレンズ鏡筒10と、撮像装置20と、記録媒体40とからなる装置を例に挙げて説明する。ただし、第2実施形態において、撮像装置20は、撮像装置20自体の動きを検出する動きセンサ(不図示)をさらに有する。この動きセンサは加速度センサなどにより構成され、その検出結果は、CPU26に出力される。   In the second embodiment, a description will be given by taking as an example an apparatus including the lens barrel 10, the imaging device 20, and the recording medium 40 shown in FIG. 1 of the first embodiment. However, in the second embodiment, the imaging device 20 further includes a motion sensor (not shown) that detects the motion of the imaging device 20 itself. This motion sensor is constituted by an acceleration sensor or the like, and the detection result is output to the CPU 26.

第1実施形態では、上述したように、静止している被写体を撮影するケースを前提とした処理を説明した。第2実施形態では、以下に1)〜5)に示す様々なケースに対応可能な処理について説明する。はじめに各ケースについて説明し、次に、各ケースに対応するための一連の処理について説明する。
1)静止している被写体の撮影
撮像装置自体の動きは少なく、かつ、撮影対象の画面内にも動いている物体はほとんどない状態である。このような場合には、構図は略決まっているため、第1実施形態と略同様の処理を行う。
2)動いている被写体(動く乗り物、動物など)の撮影
撮像装置自体の動き量は一定以下で比較的少なく、かつ、撮影対象の画面内に動いている物体がある状態である。このような場合には、構図は略決まっていて、動いている被写体を、好みの状態、好みの位置で撮影しようとしている可能性が高い。そのため、抽出されたマスクの位置がある程度変化しても、主要被写体領域として設定する処理を行う。
3)構図決め中、動く乗り物からの撮影
撮像装置自体の動き量は一定以上で比較的多く、かつ、移動速度が一般的なフレーミング速度より遅い状態である。このような場合には、撮影対象の被写体は決まっていて、被写体の確認中、構図の調整中、シャッタチャンス待機中である可能性が高い。そのため、抽出は継続しつつ、主要被写体領域の設定の待機をし、ある程度安定したら主要被写体領域として設定する処理を行う。
4)被写体の探索中
撮像装置自体の動き量は一定以上で比較的多く、かつ、上述した3)よりも移動速度が若干速い状態である。このような場合には、被写体の探索中である可能性が高い。そのため、抽出は継続しつつ、主要被写体領域の設定の待機をする処理を行う。
5)被写体の追跡中、流し撮り撮影
撮像装置自体がある程度の移動速度で移動していて、かつ、撮影対象の画面の中心近傍の被写体を追っている状態である。このような場合には、被写体の追跡中、あるいは、流し撮り撮影中である可能性が高い。そのため、抽出は継続しつつ、主要被写体領域の設定の待機をし、ある程度安定したら主要被写体領域として設定する処理を行う。ただし、流し撮り撮影の場合、抽出されたマスクが主要被写体領域である確度が極めて高いため、抽出されたマスクが一旦消失し、再度出現した場合(被写体の復元)には、安定と判断する条件を緩めても良い。
In the first embodiment, as described above, the processing has been described on the premise of the case of photographing a stationary subject. In the second embodiment, processing that can handle various cases shown in 1) to 5) will be described below. First, each case will be described, and then a series of processes for dealing with each case will be described.
1) Shooting of a stationary subject The movement of the imaging apparatus itself is small, and there is almost no moving object in the screen of the shooting target. In such a case, since the composition is almost determined, the same processing as in the first embodiment is performed.
2) Shooting a moving subject (moving vehicle, animal, etc.) The amount of movement of the imaging device itself is relatively below a certain level, and there is a moving object in the screen to be imaged. In such a case, the composition is roughly determined, and there is a high possibility that the moving subject is being photographed in a favorite state and a favorite position. Therefore, even if the position of the extracted mask changes to some extent, the process of setting as the main subject region is performed.
3) Shooting from a moving vehicle during composition determination The amount of movement of the image pickup apparatus itself is a certain level and relatively large, and the moving speed is slower than a general framing speed. In such a case, the subject to be photographed is determined, and there is a high possibility that the subject is being confirmed, the composition is being adjusted, and the photo opportunity is on standby. For this reason, while continuing extraction, the process waits for setting of the main subject area, and performs processing for setting the main subject area when it is stabilized to some extent.
4) While searching for a subject The amount of movement of the imaging apparatus itself is a certain level and relatively large, and the moving speed is slightly faster than 3) described above. In such a case, there is a high possibility that the subject is being searched. Therefore, a process of waiting for setting of the main subject area is performed while the extraction is continued.
5) Panning shooting during tracking of the subject The imaging device itself is moving at a certain moving speed and is following the subject near the center of the screen to be shot. In such a case, there is a high possibility that the subject is being tracked or a panning shot is being taken. For this reason, while continuing extraction, the process waits for setting of the main subject area, and performs processing for setting the main subject area when it is stabilized to some extent. However, in the case of panning shots, the probability that the extracted mask is the main subject area is extremely high, so if the extracted mask once disappears and reappears (subject restoration), the condition for determining that it is stable May be loosened.

何れのケースにおいても、基本的には、マスク抽出自体が有効であるか否かを判定し、有効と判定されたマスク抽出により抽出されたマスクに基づく被写体領域のみを対象として、マスク抽出処理により抽出されたマスクが安定している否かを判定する。   In any case, basically, it is determined whether or not the mask extraction itself is effective, and only the subject area based on the mask extracted by the mask extraction determined to be effective is targeted by the mask extraction process. It is determined whether or not the extracted mask is stable.

以下、自動検出モード実行時のCPU26の動作について、図4および図5のフローチャートを参照して説明する。   Hereinafter, the operation of the CPU 26 when the automatic detection mode is executed will be described with reference to the flowcharts of FIGS. 4 and 5.

ステップS201において、CPU26は、第1実施形態のステップS101と同様に、撮像部21を制御して、スルー画像の取得を開始する。   In step S <b> 201, the CPU 26 controls the imaging unit 21 and starts acquiring a through image, similarly to step S <b> 101 of the first embodiment.

ステップS202において、CPU26は、第1実施形態のステップS102と同様に、画像処理装置22を制御して通常の画像処理を行う。   In step S202, the CPU 26 controls the image processing device 22 to perform normal image processing, similarly to step S102 of the first embodiment.

ステップS203において、CPU26は、連続して取得された少なくとも2枚の画像に基づいて、撮像装置20の動き量を検出する。動き量の検出は公知技術と同様に行われる。例えば、画像解析、フレーム差分、マッチング誤差、動きベクトルなどによって動き量を検出することができる。なお、ここで検出した動き量は、後述するステップS207のマスク抽出処理、後述するステップS210からS213の判定処理、ステップS218からS220の各処理などに適宜利用しても良い。例えば、動き量を、ステップS207のマスク抽出処理時に加味して処理を行っても良い。また、動き量が所定の上限量以上の場合には、撮像装置20の動き量が多すぎて、自動検出に相応しくないと考えられるので、以降の処理を行わずに、ステップS202に戻る構成としても良い、この場合、動き量が自動検出相応しい動き量となるまで、ステップS202の通常の画像処理およびステップS203の動き量の検出を繰り返す。   In step S <b> 203, the CPU 26 detects the amount of motion of the imaging device 20 based on at least two images acquired successively. The amount of movement is detected in the same manner as in the known technique. For example, the amount of motion can be detected by image analysis, frame difference, matching error, motion vector, and the like. The amount of motion detected here may be used as appropriate for a mask extraction process in step S207 described later, a determination process in steps S210 to S213 described later, and each process in steps S218 to S220. For example, the process may be performed by adding the amount of motion to the mask extraction process in step S207. When the amount of motion is equal to or greater than the predetermined upper limit amount, the amount of motion of the imaging device 20 is too large and is not suitable for automatic detection. Therefore, the process returns to step S202 without performing the subsequent processing. In this case, the normal image processing in step S202 and the detection of the motion amount in step S203 are repeated until the motion amount becomes a motion amount suitable for automatic detection.

ステップS204において、CPU26は、ステップS203で検出した動き量が所定の閾値Ta以上であるか否かを判定する。CPU26は、ステップS203で検出した動き量が所定の閾値Ta以上であると判定するとステップS205に進む。一方、ステップS203で検出した動き量が所定の閾値Ta未満であると判定すると、CPU26は、後述するステップS206に進む。   In step S204, the CPU 26 determines whether or not the amount of motion detected in step S203 is equal to or greater than a predetermined threshold value Ta. If the CPU 26 determines that the amount of motion detected in step S203 is greater than or equal to the predetermined threshold Ta, the CPU 26 proceeds to step S205. On the other hand, when determining that the amount of motion detected in step S203 is less than the predetermined threshold Ta, the CPU 26 proceeds to step S206 described later.

この判定は、撮像装置20自体が静止していると見なせるか否かを判定するためのものである。撮像装置20自体が静止していると見なせる場合、CPU26は、マスク抽出を行うために、後述するステップS206に進む。一方、撮像装置20自体が静止していると見なせない場合、CPU26は、さらに詳細な情報を得るためにステップS205に進む。なお、上述したTaは経験的に定められる所定の閾値であり、操作部27を介したユーザ操作などに基づいて適宜変更可能としても良い。   This determination is for determining whether or not the imaging apparatus 20 itself can be regarded as stationary. If the imaging device 20 itself can be considered to be stationary, the CPU 26 proceeds to step S206 described later in order to perform mask extraction. On the other hand, if the imaging apparatus 20 itself cannot be regarded as stationary, the CPU 26 proceeds to step S205 to obtain more detailed information. Note that Ta described above is a predetermined threshold determined empirically, and may be changed as appropriate based on a user operation via the operation unit 27 or the like.

ステップS205において、CPU26は、不図示の動きセンサの出力値が所定の閾値Tb以上であるか否かを判定する。CPU26は、動きセンサの出力値が所定の閾値Tb以上であると判定するとステップS202に戻る。一方、動きセンサの出力値が所定の閾値Tb未満であると判定すると、CPU26は、ステップS206に進む。   In step S205, the CPU 26 determines whether or not the output value of a motion sensor (not shown) is equal to or greater than a predetermined threshold value Tb. If CPU26 determines with the output value of a motion sensor being more than predetermined threshold value Tb, it will return to step S202. On the other hand, when determining that the output value of the motion sensor is less than the predetermined threshold value Tb, the CPU 26 proceeds to step S206.

この判定は、撮像装置20自体がどの程度の速さで動いているかを判定するためのものである。撮像装置20自体の動き量が多すぎる場合には、撮像装置20が速い速度で動いている可能性や、急速なズームが行われている可能性が高い。このように、自動検出に相応しくない場合には、CPU26は、以降の処理を行わずにステップS202に戻る。一方、撮像装置20自体の動き量がある程度少ない場合、CPU26は、マスク抽出を行うために、ステップS206に進む。なお、上述したTbは経験的に定められる所定の閾値であり、操作部27を介したユーザ操作などに基づいて適宜変更可能としても良い。   This determination is for determining how fast the imaging apparatus 20 itself is moving. When the amount of movement of the imaging device 20 itself is too large, there is a high possibility that the imaging device 20 is moving at a high speed or that rapid zooming is being performed. Thus, if it is not suitable for automatic detection, the CPU 26 returns to step S202 without performing the subsequent processing. On the other hand, when the amount of motion of the imaging device 20 itself is small to some extent, the CPU 26 proceeds to step S206 in order to perform mask extraction. Note that Tb described above is a predetermined threshold that is determined empirically, and may be appropriately changed based on a user operation via the operation unit 27.

ステップS206において、CPU26は、動き情報をバッファメモリ部24や記憶部25等に記録する。動き情報には、ステップS203で検出した動き量、ステップS205で説明した不図示の動きセンサの出力値などの情報が含まれる。   In step S206, the CPU 26 records the motion information in the buffer memory unit 24, the storage unit 25, and the like. The motion information includes information such as the amount of motion detected in step S203 and the output value of the motion sensor (not shown) described in step S205.

ステップS207において、CPU26は、第1実施形態のステップS103と同様に、画像処理装置22を制御してマスク抽出処理を行う。このとき、CPU26は、ステップS206で記録した動き情報を適宜利用しても良い。   In step S207, the CPU 26 controls the image processing device 22 to perform mask extraction processing, as in step S103 of the first embodiment. At this time, the CPU 26 may appropriately use the motion information recorded in step S206.

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

ステップS209において、CPU26は、第1実施形態のステップS105と同様に、マスク情報をバッファメモリ部24や記憶部25等に記録する。   In step S209, the CPU 26 records the mask information in the buffer memory unit 24, the storage unit 25, and the like, similarly to step S105 of the first embodiment.

ステップS210において、CPU26は、撮像装置20が低速移動しているか否かを判定する。CPU26は、撮像装置20が低速移動していると判定するとステップS211に進む。一方、撮像装置20が低速移動していないと判定すると、CPU26は、後述するステップS212に進む。この判定は、ステップS206で記録した動き情報を、所定の閾値と比較することにより行われる。   In step S210, the CPU 26 determines whether or not the imaging device 20 is moving at a low speed. If the CPU 26 determines that the imaging device 20 is moving at a low speed, the CPU 26 proceeds to step S211. On the other hand, when determining that the imaging device 20 is not moving at a low speed, the CPU 26 proceeds to step S212 described later. This determination is performed by comparing the motion information recorded in step S206 with a predetermined threshold value.

ステップS211において、CPU26は、追跡マスクが再登場したか否かを判定する。CPU26は、追跡マスクが再登場したと判定すると後述するステップS218に進む。一方、追跡マスクが再登場していないと判定すると、CPU26は、後述するステップS213に進む。追跡マスクとは、過去にマスク抽出により抽出され、主要被写体領域として設定されたマスクのうち、出現頻度がある程度高いマスクである。この判定は、ステップS209で説明したマスク情報に基づいて行うことができる。そして、追跡マスクが再登場した場合には、設定された主要被写体領域が後続のフレームで一旦消失し、再度出現した場合や、撮像装置20が、一定の速度で一定時間以上継続して動いたと推測できる場合を含む。このような場合には、CPU26は、ステップS207のマスク抽出処理により抽出されたマスクが安定しているか否かを判定せずに、主要被写体領域の設定を行うためにステップS218に進む。ただし、主要被写体領域の設定と主要被写体領域情報の記録のみ行い、主要被写体情報の表示を行わない構成としても良い。これは、被写体領域が次々に変化する可能性があり、表示が見づらくなる可能性があるためである。   In step S211, the CPU 26 determines whether or not the tracking mask has reappeared. If the CPU 26 determines that the tracking mask has reappeared, the CPU 26 proceeds to step S218 described later. On the other hand, when determining that the tracking mask has not reappeared, the CPU 26 proceeds to step S213 described later. The tracking mask is a mask having a certain appearance frequency among masks extracted in the past by mask extraction and set as the main subject region. This determination can be made based on the mask information described in step S209. When the tracking mask reappears, the main subject area that has been set once disappears in the subsequent frame and reappears, or the imaging device 20 has moved continuously for a certain time at a certain speed. Includes cases that can be guessed. In such a case, the CPU 26 proceeds to step S218 to set the main subject area without determining whether or not the mask extracted by the mask extraction process in step S207 is stable. However, the main subject area may be set and the main subject area information only recorded, and the main subject information may not be displayed. This is because the subject area may change one after another and the display may be difficult to see.

なお、追跡マスクが再登場した場合には、(ステップS207のマスク抽出処理により抽出されたマスクが安定しているか否かを判定せずに)主要被写体領域の設定を行う代わりに、ステップS207のマスク抽出処理により抽出されたマスクが安定しているか否かの判定に関する判定の条件を緩めて判定を行っても良い。また、追跡マスクが再登場した場合には、ステップS207のマスク抽出処理の抽出条件を緩めて再度抽出を行う構成としても良い。   When the tracking mask reappears, instead of setting the main subject area (without determining whether or not the mask extracted by the mask extraction process in step S207 is stable), the process proceeds to step S207. The determination may be performed by loosening the conditions for determination regarding whether or not the mask extracted by the mask extraction process is stable. Further, when the tracking mask reappears, the extraction may be performed again by relaxing the extraction condition of the mask extraction process in step S207.

ステップS212において、CPU26は、第1実施形態のステップS106と略同様に、p回(pフレーム)以上連続して同一のマスクを抽出したか否かを判定する。CPU26は、p回以上連続して同一のマスクを抽出したと判定すると後述するステップS218に進む。一方、p回以上連続して同一のマスクを抽出していないと判定すると、CPU26は、後述するステップS215に進む。   In step S212, the CPU 26 determines whether or not the same mask has been extracted p times (p frames) or more in a manner substantially similar to step S106 of the first embodiment. If the CPU 26 determines that the same mask has been extracted continuously p times or more, the CPU 26 proceeds to step S218 described later. On the other hand, when determining that the same mask has not been extracted p times or more in succession, the CPU 26 proceeds to step S215 to be described later.

なお、上述したpは所定の閾値であり、撮像部21による撮像時のフレームレート、レンズ鏡筒10におけるズーム倍率、操作部27を介したユーザ操作などに基づいて適宜変更可能としても良い。さらに、ステップS209で説明したマスク情報等に基づいて、過去に行われたマスク抽出の傾向(抽出されたマスクの種類、出現頻度など)を求め、この傾向に応じて上述したpの値を適宜変更可能としても良い。例えば、過去に高い頻度で抽出されたマスクについては、pの値を小さめに変更しても良い。   Note that p described above is a predetermined threshold value, and may be changed as appropriate based on a frame rate at the time of image capturing by the image capturing unit 21, a zoom magnification in the lens barrel 10, a user operation via the operation unit 27, and the like. Furthermore, 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 S209, and the value of p 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 p may be changed to a smaller value.

ステップS213において、CPU26は、第1実施形態のステップS106と略同様に、q回(qフレーム)以上連続して同一のマスクを抽出したか否かを判定する。CPU26は、q回以上連続して同一のマスクを抽出したと判定するとステップS214に進む。一方、q回以上連続して同一のマスクを抽出していないと判定すると、CPU26は、後述するステップS215に進む。   In step S213, the CPU 26 determines whether or not the same mask has been extracted q times (q frames) or more in a manner substantially similar to step S106 of the first embodiment. If the CPU 26 determines that the same mask has been extracted continuously q times or more, the process proceeds to step S214. On the other hand, if it is determined that the same mask has not been extracted q times or more, the CPU 26 proceeds to step S215 to be described later.

この判定においては、ステップS207のマスク抽出処理の抽出条件を緩めて再度抽出を行い、q回以上連続して同一のマスクを抽出したか否かを判定する。なお、上述したqは所定の閾値であり、上述した閾値pよりも小さい値である。この結果、ステップS213においてq回以上連続して同一のマスクを抽出したと判定される場合とは、対象マスクが、ステップS211で説明した追跡マスクに該当する場合であり、CPU26は、追跡マスクを設定するためにステップS214に進む。   In this determination, the extraction condition of the mask extraction process in step S207 is relaxed and extraction is performed again, and it is determined whether or not the same mask has been extracted q times or more. In addition, q mentioned above is a predetermined threshold value, and is a value smaller than the threshold value p mentioned above. As a result, the case where it is determined in step S213 that the same mask has been extracted q times or more in succession is a case where the target mask corresponds to the tracking mask described in step S211. Proceed to step S214 for setting.

ステップS214において、CPU26は、マスク情報をバッファメモリ部24や記憶部25等に記録する。ステップS214におけるマスク情報とは、対象マスクが、ステップS211で説明した追跡マスクであることを示す情報である。   In step S214, the CPU 26 records the mask information in the buffer memory unit 24, the storage unit 25, and the like. The mask information in step S214 is information indicating that the target mask is the tracking mask described in step S211.

ステップS215において、CPU26は、第1実施形態のステップS111と略同様に、m回(mフレーム)以上連続して設定に失敗したか否かを判定する。CPU26は、m回以上連続してステップS218で説明した主要被写体領域の設定処理を行えなかった場合、m回以上連続して失敗したと判定してステップS216に進む。一方、m回以上連続して失敗していないと判定すると、CPU26は、後述するステップS217に進む。   In step S215, the CPU 26 determines whether or not the setting has failed continuously for m times (m frames) or more in substantially the same manner as in step S111 of the first embodiment. If the CPU 26 has not been able to perform the main subject area setting process described in step S218 continuously for m times or more, the CPU 26 determines that the process has failed continuously for m times or more and proceeds to step S216. On the other hand, when determining that it has not failed continuously for m times or more, the CPU 26 proceeds to step S217 described later.

ステップS216において、CPU26は、第1実施形態のステップS112と同様に、自動検出モードによる検出は困難であると判断し、焦点調節情報に基づいて主要被写体領域を検出する通常モードに変更して一連の処理を終了する。   In step S216, as in step S112 of the first embodiment, the CPU 26 determines that detection in the automatic detection mode is difficult, and changes to the normal mode in which the main subject region is detected based on the focus adjustment information. Terminate the process.

ステップS217において、CPU26は、第1実施形態のステップS113と同様に、主要被写体領域の設定処理を行っていない状態で撮影指示が行われてしまう場合に備えて、通常の3A処理を行う。   In step S217, as in step S113 of the first embodiment, 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.

ステップS218において、CPU26は、第1実施形態のステップS108と同様に、抽出したマスクに基づいて主要被写体領域を設定する。   In step S218, the CPU 26 sets a main subject area based on the extracted mask, as in step S108 of the first embodiment.

ステップS219において、CPU26は、第1実施形態のステップS109と同様に、主要被写体領域の情報をバッファメモリ部24や記憶部25等に記録する。   In step S219, the CPU 26 records information on the main subject area in the buffer memory unit 24, the storage unit 25, and the like, as in step S109 of the first embodiment.

ステップS220において、CPU26は、第1実施形態のステップS110と同様に、主要被写体領域の情報を表示部23に表示する。   In step S220, the CPU 26 displays information on the main subject area on the display unit 23 as in step S110 of the first embodiment.

ステップS221において、CPU26は、第1実施形態のステップS114と略同様に、撮影指示が行われたか否かを判定する。CPU26は、撮影指示が行われたと判定するとステップS222に進む。一方、撮影指示が行われないと判定すると、CPU26は、ステップS202に戻り、次のフレームの画像に対してステップS202以降の処理を行う。   In step S221, the CPU 26 determines whether or not a shooting instruction has been issued, in substantially the same manner as in step S114 of the first embodiment. If the CPU 26 determines that a shooting instruction has been given, the process proceeds to step S222. On the other hand, if it is determined that no shooting instruction is given, the CPU 26 returns to step S202, and performs the processing from step S202 onward for the image of the next frame.

ステップS222において、CPU26は、第1実施形態のステップS115と同様に、各部を制御して撮影を実行する。   In step S222, the CPU 26 performs shooting by controlling each unit as in step S115 of the first embodiment.

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

なお、図4および図5のフローチャートにおいて、ステップS204で画像に基づいて求めた動き量と閾値Taとを比較し、ステップS205で動きセンサの出力値と閾値Tbとを比較する例を示したが、何れか一方のみ行っても良い。すなわち、動きセンサを備えずに、ステップS204で画像に基づいて求めた動き量と閾値Taとを比較して以降の処理を決定しても良いし、画像に基づいて動き量を求めずに、ステップS205で動きセンサの出力値と閾値Tbとを比較して以降の処理を決定しても良い。   In the flowcharts of FIG. 4 and FIG. 5, an example is shown in which the motion amount obtained based on the image in step S204 is compared with the threshold value Ta, and the output value of the motion sensor is compared with the threshold value Tb in step S205. Any one of them may be performed. That is, without providing a motion sensor, the amount of motion obtained based on the image in step S204 may be compared with the threshold value Ta to determine subsequent processing, or without obtaining the amount of motion based on the image, In step S205, the output value of the motion sensor and the threshold value Tb may be compared to determine subsequent processing.

また、上述した1)から5)のケースを、画像解析、シーン解析、撮影モードの種類などにより判別し、ケース毎に予め定められた処理を行う構成としても良い。この場合、ケース毎に適切な閾値や判定条件を定めることが好ましい。   Further, the cases 1) to 5) described above may be determined based on image analysis, scene analysis, shooting mode type, and the like, and a predetermined process may be performed for each case. In this case, it is preferable to determine an appropriate threshold value and determination condition for each case.

以上説明したように、第2実施形態によれば、被写体領域の検出が有効であるか否かを判定し、有効と判定された検出により検出された被写体領域を比較することにより、検出された被写体領域が安定しているか否かを判定する。一般に、構図や画角がある程度定まるまでは、被写体領域の検出や主要被写体領域の抽出は、無駄になる処理が多くなる可能性が高く、効果的でない場合が多い。上述の構成により、第1実施形態の効果に加えて、不要な被写体検出や主要被写体領域の抽出を行ってしまうという問題に対処することができる。特に、主要被写体領域の設定に伴う表示や記録は、無闇に行うとユーザにとって不利益となる場合がある。上述の構成により、効果が期待できる場合にのみ主要被写体領域の設定に伴う表示や記録を行うことができる。   As described above, according to the second embodiment, whether or not the detection of the subject area is valid is determined, and the detection is performed by comparing the subject areas detected by the detection determined to be valid. It is determined whether or not the subject area is stable. In general, until the composition and the angle of view are determined to some extent, the detection of the subject area and the extraction of the main subject area are likely to be wasteful and often not effective. With the above-described configuration, in addition to the effects of the first embodiment, it is possible to cope with the problem that unnecessary subject detection and main subject region extraction are performed. In particular, the display and recording associated with the setting of the main subject area may be disadvantageous for the user if performed in the dark. With the above-described configuration, display and recording associated with the setting of the main subject area can be performed only when an effect can be expected.

以上、この発明の実施形態について図面を参照して詳述してきたが、具体的な構成はこの実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の設計等も含まれる。   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.

上述の各実施形態において、マスク抽出により複数の被写体領域が抽出された場合には、以下の(a)または(b)の処理を行う。   In each of the embodiments described above, when a plurality of subject areas are extracted by mask extraction, the following processing (a) or (b) is performed.

マスク抽出により複数の被写体領域が抽出された場合、以下の各処理が考えられる。
(a)マスク抽出処理に抽出されたマスクが安定しているか否かの判定を中止する。
When a plurality of subject areas are extracted by mask extraction, the following processes can be considered.
(A) The determination of whether or not the mask extracted in the mask extraction process is stable is stopped.

マスク抽出のみを継続的に行い、マスクが安定しているか否かの判定および主要被写体領域の設定処理は中止する。この処理は、一連の処理を開始した際でも、処理の途中で複数の被写体領域が抽出された際でも同様である。
(b)予め設定された条件にしたがって以降の処理を行う。
Only the mask extraction is continuously performed, and the determination of whether the mask is stable and the setting process of the main subject area are stopped. This process is the same whether a series of processes is started or a plurality of subject areas are extracted during the process.
(B) The subsequent processing is performed in accordance with preset conditions.

例えば、最も評価値の高い被写体領域のみを対象として以降の各処理を行っても良いし、複数の被写体領域のすべてを対象として以降の各処理を行っても良いし、複数の被写体領域のうち、一部の被写体領域のみを対象として以降の各処理を行っても良い。複数の被写体領域のうち、一部の被写体領域のみを対象とする場合、表示部23等を利用してユーザに対象とする被写体領域を選択させる構成としても良いし、評価値、位置、出現頻度などに応じて一部の被写体領域を自動で選択する構成としても良い。   For example, each of the subsequent processes may be performed only on the subject area with the highest evaluation value, or each of the subsequent processes may be performed on all of the plurality of subject areas. The subsequent processes may be performed for only a part of the subject area. When only some of the subject areas are targeted, the display unit 23 or the like may be used to cause the user to select the subject area, and the evaluation value, position, and appearance frequency may be selected. For example, a configuration may be adopted in which a part of the subject area is automatically selected.

なお、複数の被写体領域を主要被写体領域として設定する場合は、表示部23に主要被写体領域の情報を表示する(図2ステップS110、図5ステップS220)際に、表示内容を工夫することが好ましい。例えば、表示枠の色を変える、線の太さを変える、線の濃淡を変える、線の種類(実線/点線)を変えるなどし、区別可能とするのが好ましい。   When a plurality of subject areas are set as the main subject areas, it is preferable to devise display contents when displaying information on the main subject areas on the display unit 23 (step S110 in FIG. 2, step S220 in FIG. 5). . For example, it is preferable to make the distinction possible by changing the color of the display frame, changing the thickness of the line, changing the density of the line, changing the type of line (solid line / dotted line), and the like.

また、複数の被写体領域のうち、一部の被写体領域のみを対象として以降の各処理を行う場合には、対象外となる被写体領域についても一部の処理を行い、情報の記録のみを行っても良い。また、複数の被写体領域が抽出された場合には、表示部23等を利用して、エラー表示を行っても良い。   In addition, when performing the following processes for only a part of the subject areas of the plurality of subject areas, perform a part of the processes for the subject areas that are not targeted, and only record information. Also good. When a plurality of subject areas are extracted, an error display may be performed using the display unit 23 or the like.

また、上記の各実施形態では、自動で主要被写体領域を検出する自動検出モードと、焦点調節情報に基づいて主要被写体領域を検出する通常モードとを備える例を示したが、通常モードに代えてS1起動モード(詳細は後述する)を備えても良いし、通常モードおよび自動検出モードに加えてS1起動モードを備えても良い。   In each of the above-described embodiments, an example in which an automatic detection mode for automatically detecting a main subject area and a normal mode for detecting a main subject area based on focus adjustment information has been described. An S1 activation mode (details will be described later) may be provided, or an S1 activation mode may be provided in addition to the normal mode and the automatic detection mode.

S1起動モードとは、上述した各実施形態における自動検出モードとは異なり、操作部27を介したユーザ操作(例えば、シャッタボタンの半シャッタ)に基づいて主要被写体領域の設定、主要被写体領域情報の表示および記録を行うモードである。このS1起動モードは、上述した各実施形態で説明した通常モードに代えて利用しても良い。例えば、自動検出モードによる検出は困難である場合に、S1起動モードを実行しても良い。   Unlike the automatic detection mode in each embodiment described above, the S1 activation mode is different from the automatic detection mode in each of the above-described embodiments. The main subject region setting and the main subject region information are set based on a user operation via the operation unit 27 (for example, a half shutter of a shutter button). This mode is for displaying and recording. This S1 activation mode may be used in place of the normal mode described in the above-described embodiments. For example, when the detection in the automatic detection mode is difficult, the S1 activation mode may be executed.

また、S1起動モードにおいては、上述した各実施形態における自動検出モードよりも各種条件を緩める構成としても良い。すなわち、マスク抽出の抽出条件を緩く(抽出しやすく)しても良いし、マスク抽出処理により抽出されたマスクが安定しているか否かの判定を行う判定条件を緩くしても良い。逆に言えば、上述した各実施形態における自動検出モードにおいては、S1起動モードよりも各種条件を厳しくする構成としても良い。これは、自動検出を行う代わりに、その精度を可能な限り高くするためである。   Moreover, in S1 starting mode, it is good also as a structure which loosens various conditions rather than the automatic detection mode in each embodiment mentioned above. That is, the extraction conditions for mask extraction may be relaxed (easy to extract), or the determination conditions for determining whether the mask extracted by the mask extraction process is stable may be relaxed. Conversely, in the automatic detection mode in each embodiment described above, various conditions may be stricter than in the S1 activation mode. This is to make the accuracy as high as possible instead of performing automatic detection.

また、上記の各実施形態において、自動検出モードの中断処理、再開処理を適宜実行しても良い。例えば、上述したように、自動検出モードから通常モードやS1起動モードへ変更を行った後に、撮像装置20の動き量や動きセンサの出力に応じて、自動検出モードを再開しても良い。また、例えば、自動検出モードによる検出は困難である場合にも、通常モードやS1起動モードへ変更せずに、処理を継続し続けても良い。   In each of the above embodiments, the automatic detection mode interruption processing and resumption processing may be appropriately executed. For example, as described above, after changing from the automatic detection mode to the normal mode or the S1 activation mode, the automatic detection mode may be resumed according to the amount of motion of the imaging device 20 or the output of the motion sensor. Further, for example, even when detection in the automatic detection mode is difficult, the processing may be continued without changing to the normal mode or the S1 activation mode.

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

また、上記の各実施形態においては、構図確認用のスルー画像に基づいて、一連の処理を行う例を示したが、本発明はこの例に限定されない。例えば、一眼レフカメラなどにおいて生成される構図確認用のライブビュー画像を対象とする場合にも、本発明を同様に適用することができる。また、記録媒体40等に記録された動画像を対象とする場合にも、本発明を同様に適用することができる。   In each of the above embodiments, 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 each of the above embodiments, an example in which a series of processing is performed for all frames has been described. However, 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 processing in each of the above embodiments may be performed for a plurality of thinned images, and display may be performed for all images. By performing such processing, the processing load can be reduced.

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

また、「コンピュータシステム」は、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 (1)

時間的に連続して生成された複数の画像データを順次取得する取得部と、
前記画像データにより示される画像の特徴量を算出し、前記特徴量に基づいて被写体領域を検出する領域検出部と、
前記取得部により取得された前記複数の画像データにより示される画像のうち、少なくとも2枚の画像において検出された前記被写体領域を比較することにより、前記領域検出部により検出された領域が安定しているか否かを判定する判定部と、
前記判定部により前記領域が安定していると判定すると、前記判定の対象となった前記被写体領域を主要被写体領域として設定する設定部とを備え
前記判定部は、記録部に記録された前記領域検出部の検出結果と、前記記録部に記録された前記判定部の判定結果と、の少なくとも一方に基づいて、任意の前記被写体領域が過去に判定されているか否かを判定し、判定結果に基づいて、安定していると判定する基準を変える画像処理装置。
An acquisition unit that sequentially acquires a plurality of pieces of image data generated continuously in time;
A region detecting unit that calculates a feature amount of an image indicated by the image data and detects a subject region based on the feature amount;
By comparing the subject regions detected in at least two images among the images indicated by the plurality of image data acquired by the acquisition unit, the region detected by the region detection unit is stabilized. A determination unit for determining whether or not,
When the area by the determination unit is determined to be stable, and a setting unit for setting the object region as a target of the determination as the main subject area,
The determination unit determines whether any subject area has been recorded in the past based on at least one of the detection result of the area detection unit recorded in the recording unit and the determination result of the determination unit recorded in the recording unit. An image processing apparatus that determines whether or not a determination is made, and changes a criterion for determining that the determination is stable based on a determination result .
JP2017077610A 2017-04-10 2017-04-10 Image processing apparatus, imaging apparatus, and image processing program Active JP6443486B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017077610A JP6443486B2 (en) 2017-04-10 2017-04-10 Image processing apparatus, imaging apparatus, and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017077610A JP6443486B2 (en) 2017-04-10 2017-04-10 Image processing apparatus, imaging apparatus, and image processing program

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2012161892A Division JP2014023054A (en) 2012-07-20 2012-07-20 Image processing apparatus, imaging apparatus, and image processing program

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2018223700A Division JP2019041414A (en) 2018-11-29 2018-11-29 Electronic apparatus, imaging apparatus, and program

Publications (2)

Publication Number Publication Date
JP2017121092A JP2017121092A (en) 2017-07-06
JP6443486B2 true JP6443486B2 (en) 2018-12-26

Family

ID=59272501

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017077610A Active JP6443486B2 (en) 2017-04-10 2017-04-10 Image processing apparatus, imaging apparatus, and image processing program

Country Status (1)

Country Link
JP (1) JP6443486B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5147670B2 (en) * 2008-12-15 2013-02-20 キヤノン株式会社 Image processing apparatus, image processing method, and imaging apparatus
JP5676956B2 (en) * 2010-07-28 2015-02-25 キヤノン株式会社 Image processing apparatus, image processing method, and program
JP2012054810A (en) * 2010-09-02 2012-03-15 Olympus Corp Image processing device, image processing method, imaging apparatus, and image processing program

Also Published As

Publication number Publication date
JP2017121092A (en) 2017-07-06

Similar Documents

Publication Publication Date Title
JP5159515B2 (en) Image processing apparatus and control method thereof
US8818055B2 (en) Image processing apparatus, and method, and image capturing apparatus with determination of priority of a detected subject and updating the priority
EP2168005B1 (en) Focus control apparatus, image sensing apparatus, and control method therefor
JP4907740B2 (en) Imaging device
JP2014168227A (en) Image processing apparatus, imaging apparatus, and image processing method
US8284994B2 (en) Image processing apparatus, image processing method, and storage medium
JP5115210B2 (en) Imaging device
JP4730478B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, AND PROGRAM
JP6702746B2 (en) Imaging device, control method thereof, program, and storage medium
JP2009268086A (en) Imaging apparatus
JP2009199049A (en) Imaging apparatus and imaging apparatus control method, and computer program
JP2007067559A (en) Image processing method, image processing apparatus, and control method of imaging apparatus
JP5217451B2 (en) Imaging device
JP6253454B2 (en) IMAGING DEVICE AND IMAGING DEVICE CONTROL METHOD
JP2019041414A (en) Electronic apparatus, imaging apparatus, and program
JP2014023054A (en) Image processing apparatus, imaging apparatus, and image processing program
JP6443486B2 (en) Image processing apparatus, imaging apparatus, and image processing program
JP5111293B2 (en) Imaging apparatus and control method thereof
JP2018061292A (en) Image processing apparatus, image processing method, and program
JP6858065B2 (en) Imaging device and its control method
JP2006243609A (en) Autofocus device
JP6465322B2 (en) IMAGING DEVICE AND IMAGING DEVICE CONTROL METHOD
US20240179393A1 (en) Imaging apparatus, control method of the same, and storage medium
JP2018116723A (en) Image processing system
JP2016219984A (en) Imaging device, imaging method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170410

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20171225

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180109

A601 Written request for extension of time

Free format text: JAPANESE INTERMEDIATE CODE: A601

Effective date: 20180309

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180510

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20181112

R150 Certificate of patent or registration of utility model

Ref document number: 6443486

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