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

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

Info

Publication number
JP6494388B2
JP6494388B2 JP2015083468A JP2015083468A JP6494388B2 JP 6494388 B2 JP6494388 B2 JP 6494388B2 JP 2015083468 A JP2015083468 A JP 2015083468A JP 2015083468 A JP2015083468 A JP 2015083468A JP 6494388 B2 JP6494388 B2 JP 6494388B2
Authority
JP
Japan
Prior art keywords
image
moving body
frame image
luminance
frame
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.)
Expired - Fee Related
Application number
JP2015083468A
Other languages
Japanese (ja)
Other versions
JP2016208083A (en
Inventor
弘典 青景
弘典 青景
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2015083468A priority Critical patent/JP6494388B2/en
Publication of JP2016208083A publication Critical patent/JP2016208083A/en
Application granted granted Critical
Publication of JP6494388B2 publication Critical patent/JP6494388B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、画像処理装置、画像処理方法、及びプログラムに関する。   The present invention relates to an image processing apparatus, an image processing method, and a program.

従来の技術として、異なる露光量で撮影した複数フレームの画像を合成することにより、ハイダイナミックレンジ画像を得る画像合成処理(HDR:High Dynamic Range imaging)技術が知られている。HDR技術では、各フレーム画像のなかで適正露出となっている画像領域をつなぎ合わせるような画像合成を行うことでいわゆる白飛びや黒潰れの無い画像を得ることができる。このHDR技術による画像合成処理は、動画像撮影で得られた時系列順の複数フレーム画像を合成して1フレームの画像を生成するような処理を、それら時系列順の複数フレームごとに繰り返すことにより、動画像に対しても実現可能である。   As a conventional technique, there is known an image synthesis processing (HDR: High Dynamic Range imaging) technique for obtaining a high dynamic range image by synthesizing images of a plurality of frames taken with different exposure amounts. In the HDR technology, an image without so-called whiteout or blackout can be obtained by performing image composition such that image regions that are appropriately exposed in each frame image are connected. In the image synthesis process by the HDR technology, a process of generating one frame image by synthesizing a plurality of frame images in time series obtained by moving image shooting is repeated for each of the plurality of frames in time series. Therefore, it can be realized for moving images.

ただし、動画像に対してHDRによる合成処理を行った場合、複数フレームから1フレームの画像が合成されるため、合成処理後の動画像のフレームレートは、撮像がなされた際のフレームレートよりも低下してしまう。このため、例えば被写体が移動している移動体である場合には、その移動体の画像の動きが滑らかに見えないという問題がある。これに対して、移動体画像を合成して、その被写体画像が移動によりぶれているような状態の画像を生成することにより、移動体画像の動きを滑らかに見せる手法が知られている。しかしながらこの手法では、例えば移動体画像の移動量が大きい場合には不自然な描写になってしまう。   However, when HDR is combined with a moving image, one frame image is combined from a plurality of frames, so the frame rate of the moving image after the combining processing is higher than the frame rate at the time of image capture. It will decline. For this reason, for example, when the subject is a moving body that is moving, there is a problem that the movement of the image of the moving body does not look smooth. On the other hand, there is known a method for smoothly showing the movement of the moving body image by synthesizing the moving body image and generating an image in which the subject image is blurred by the movement. However, with this method, for example, when the moving amount of the moving object image is large, the image becomes unnatural.

このようなことから、特許文献1や特許文献2に記載されているような技術が提案されている。特許文献1には、HDRによる合成処理において、合成される画像の動きベクトルを算出し、動きベクトルがある閾値よりも大きい場合は、その画素の合成を行わないようにする技術が開示されている。特許文献2には、例えば撮影感度が低い場合や、合成画像の数が少ない場合、人物が検出された場合等の条件に当てはまるときには、HDRによる合成処理を行うか否かを決める閾値を小さくする技術が開示されている。   For this reason, techniques as described in Patent Document 1 and Patent Document 2 have been proposed. Patent Document 1 discloses a technique for calculating a motion vector of an image to be synthesized in a synthesis process using HDR, and not synthesizing the pixel when the motion vector is larger than a certain threshold value. . In Patent Document 2, for example, when the imaging sensitivity is low, the number of synthesized images is small, or when a person is detected, a threshold value for determining whether to perform HDR synthesis processing is reduced. Technology is disclosed.

特開平10−243288号公報JP-A-10-243288 特開2012−29014号公報JP 2012-29014 A

特許文献1に記載の技術では、移動量が小さい移動体画像に対して合成処理を行い、一方、移動量が大きい移動体画像に対しては合成処理を行わないようにしている。このため、移動量の大きい移動体画像が合成処理されることによる不自然な描写の発生は避けられる。しかしながら、移動量が小さいために合成処理されることになった移動体画像が、例えば目立つ画像であるような場合には、合成処理後の移動体画像が不自然な画像として描写されてしまうことがある。また、特許文献2に記載の技術では、様々な条件に応じて合成の仕方を変えるようになされているため、不自然な描写になることは非常に少なくなる。しかしながら、特許文献2の技術の場合も、合成されることになった移動体画像が、例えば目立つ画像であるような場合には、合成処理後の移動体画像が不自然な画像として描写されてしまうことがある。つまり、これらの技術では、合成処理後の移動体画像が不自然な画像として描写されてしまうような画質劣化が発生してしまう虞がある。   In the technique described in Patent Document 1, a composition process is performed on a moving object image with a small amount of movement, while a composition process is not performed on a moving object image with a large amount of movement. For this reason, generation | occurrence | production of the unnatural depiction by the synthetic | combination process of a moving body image with a large movement amount is avoided. However, if the moving body image that is to be combined because of the small amount of movement is a conspicuous image, for example, the moving body image after the combining process may be depicted as an unnatural image. There is. Further, in the technique described in Patent Document 2, since the way of synthesis is changed according to various conditions, the occurrence of unnatural depiction is extremely reduced. However, even in the case of the technique of Patent Document 2, when the moving body image to be combined is, for example, a conspicuous image, the combined moving body image is depicted as an unnatural image. May end up. That is, with these techniques, there is a possibility that image quality deterioration may occur such that the moving body image after the synthesis processing is depicted as an unnatural image.

本発明はこのような問題点に鑑みてなされたものであり、合成処理後の移動体画像が不自然な画像として描写されてしまうような画質劣化を低減可能とする画像処理装置、画像処理方法、及びプログラムを提供することを目的とする。   The present invention has been made in view of such a problem, and an image processing apparatus and an image processing method capable of reducing image quality deterioration such that a moving body image after synthesis processing is depicted as an unnatural image. And to provide a program.

本発明の画像処理装置は、動画撮影による第1のフレーム画像と第2のフレーム画像の少なくとも二つのフレーム画像から、前記第1のフレーム画像の撮影と前記第2のフレーム画像の撮影がなされた間に被写体位置が変化した被写体画像を移動体画像として検出する移動体検出手段と、前記第1のフレーム画像と前記第2のフレーム画像から、前記第1のフレーム画像の撮影と前記第2のフレーム画像の撮影がなされた間の前記移動体画像の移動量を求める移動量検出手段と、前記移動体画像の面積を求める面積検出手段と、前記第1のフレーム画像と前記第2のフレーム画像を合成する合成手段と、前記移動体画像の前記移動量と前記面積に基づいて、前記合成手段により前記第1のフレーム画像と前記第2のフレーム画像が合成される際の、前記第1のフレーム画像の前記移動体画像と前記第2のフレーム画像の前記移動体画像との合成比率を制御する制御手段とを有することを特徴とする。   In the image processing apparatus according to the present invention, the first frame image and the second frame image are captured from at least two frame images of the first frame image and the second frame image obtained by moving image capturing. A moving body detecting unit that detects a subject image whose subject position has changed between them as a moving body image; from the first frame image and the second frame image, photographing the first frame image; and Movement amount detection means for obtaining the movement amount of the moving body image during the shooting of the frame image, area detection means for obtaining the area of the moving body image, the first frame image and the second frame image The first frame image and the second frame image are combined by the combining unit based on the moving amount and the area of the moving object image. Of, and having a control means for controlling the mixing ratio of the moving object image of the first of said moving object image and the second frame image of the frame image.

本発明によれば、移動体画像の合成処理がなされる場合に、合成処理後の移動体画像が不自然な画像として描写されてしまうような画質劣化を低減可能となる。   According to the present invention, it is possible to reduce image quality deterioration that causes a moving body image after combining processing to be depicted as an unnatural image when a moving body image is combined.

画像処理装置の概略構成を示す図である。It is a figure which shows schematic structure of an image processing apparatus. 第1の実施形態のHDR処理部の構成例を示す図である。It is a figure which shows the structural example of the HDR process part of 1st Embodiment. 動画像のフレーム順序を説明する図である。It is a figure explaining the frame order of a moving image. 現像部の構成例を示す図である。It is a figure which shows the structural example of the image development part. 適フレーム用とアンダーフレーム用のガンマカーブを説明する図である。It is a figure explaining the gamma curve for suitable frames and under frames. 輝度合成比率と輝度の関係を説明するための図である。It is a figure for demonstrating the relationship between a brightness | luminance synthetic | combination ratio and a brightness | luminance. 動きベクトル検出を説明するための図である。It is a figure for demonstrating motion vector detection. カメラの動きと背景画像の移動量の関係を説明する図である。It is a figure explaining the relationship between the motion of a camera and the movement amount of a background image. 動きベクトルの算出例を説明するための図である。It is a figure for demonstrating the example of calculation of a motion vector. 移動体画像の動きベクトルの説明に用いる図である。It is a figure used for description of the motion vector of a moving body image. 移動体画像のブロックごとの動きベクトルを説明する図である。It is a figure explaining the motion vector for every block of a moving body image. 移動体画像を判定するため処理の説明に用いる図である。It is a figure used for description of a process in order to determine a moving body image. 移動被写体合成比率を適用する画像範囲を説明するための図である。It is a figure for demonstrating the image range to which a moving subject synthetic | combination ratio is applied. 合成量と評価値を説明するための図である。It is a figure for demonstrating a synthetic | combination amount and an evaluation value. 適フレーム画像の使用係数と平均輝度を説明するための図である。It is a figure for demonstrating the use coefficient and average brightness | luminance of a suitable frame image. 第2の実施形態のHDR処理部の構成例を示す図である。It is a figure which shows the structural example of the HDR process part of 2nd Embodiment. 同じ面積の移動体画像を説明するための図である。It is a figure for demonstrating the mobile body image of the same area. 第3の実施形態のHDR処理部の構成例を示す図である。It is a figure which shows the structural example of the HDR process part of 3rd Embodiment. 輝度差合成比率を説明するための図である。It is a figure for demonstrating a brightness | luminance difference synthetic | combination ratio. 第4の実施形態の情報処理装置の概略構成を示す図である。It is a figure which shows schematic structure of the information processing apparatus of 4th Embodiment. メモリの記憶エリアを説明するための図である。It is a figure for demonstrating the storage area of a memory. 第4の実施形態の画像処理の概略的なフローチャートである。It is a schematic flowchart of the image processing of 4th Embodiment. 第4の実施形態の画像処理の詳細なフローチャートである。It is a detailed flowchart of the image processing of 4th Embodiment.

本実施形態の画像処理装置は、一例としてデジタルカメラやデジタルビデオカメラであり、特にデジタル化された動画像信号の複数フレームの画像に対し、例えばHDRによる合成処理を行って広いダイナミックレンジの動画像を生成する。本実施形態では、移動している被写体(以下、移動体とする。)に対してHDRの合成処理がなされる場合に、動画像の見え方の滑らかさを維持した上で、HDRの合成処理による広いダイナミックレンジの動画像の生成を可能としている。具体的には、本実施形態では、動画撮影の際に、適正な露出による第1のフレーム(以下、「適フレーム」とする。)画像と、アンダー露出による第2のフレーム(以下、「アンダーフレーム」とする。)画像の、二つのフレーム画像を交互に撮像する。また、本実施形態では、それら交互に撮像された二つのフレーム画像を用いてHDRの画像合成を行う際に、後述するように、移動体画像の移動量と面積と輝度を求める。そして、本実施形態では、移動体画像の移動量と面積と輝度に基づいて、移動体画像の合成比率(以下、移動体合成比率とする。)を制御する。これにより、本実施形態では、例えば移動体画像の移動量が大きい場合や移動体画像の面積が大きい場合のように、移動体画像が特に目立つ画像であったとしても、HDRの合成処理後の移動体画像が不自然な描写になってしまう画質劣化を軽減可能としている。   The image processing apparatus of the present embodiment is a digital camera or a digital video camera as an example, and in particular, a moving image having a wide dynamic range by performing, for example, HDR synthesizing on a plurality of frames of a digitized moving image signal. Is generated. In this embodiment, when HDR composition processing is performed on a moving subject (hereinafter referred to as a moving object), HDR composition processing is performed while maintaining the smoothness of the appearance of a moving image. Enables generation of moving images with a wide dynamic range. Specifically, in the present embodiment, when shooting a moving image, a first frame (hereinafter referred to as “appropriate frame”) with proper exposure and a second frame (hereinafter referred to as “under”) with underexposure. "Frame")) Two frame images of the image are taken alternately. Further, in the present embodiment, when HDR image synthesis is performed using two frame images captured alternately, the movement amount, area, and luminance of the moving body image are obtained as described later. In this embodiment, the composition ratio of the moving object image (hereinafter referred to as the moving object composition ratio) is controlled based on the moving amount, area, and luminance of the moving object image. Thereby, in this embodiment, even if the moving body image is a particularly conspicuous image, for example, when the moving amount of the moving body image is large or the area of the moving body image is large, It is possible to reduce image quality deterioration that causes the moving body image to appear unnatural.

<第1の実施形態>
図1は、第1の実施形態の画像処理装置の一例としてのカメラの構成例を示す図である。図1に示すカメラは、光学系1と、撮像素子2と、信号処理部3と、HDR処理部4と、調整処理部5と、符号化処理部6と、出力部7と、UI部8と、角速度センサ9と、バス10とを有している。
<First Embodiment>
FIG. 1 is a diagram illustrating a configuration example of a camera as an example of an image processing apparatus according to the first embodiment. The camera shown in FIG. 1 includes an optical system 1, an imaging device 2, a signal processing unit 3, an HDR processing unit 4, an adjustment processing unit 5, an encoding processing unit 6, an output unit 7, and a UI unit 8. And an angular velocity sensor 9 and a bus 10.

図1において、アイリスやレンズ等を有する光学系1を通った光は、CMOS又はCCD等で構成される撮像素子2により光電変換される。撮像素子2での光電変換により取得された画像信号は、信号処理部3へ送られる。なお、撮像素子2は、いわゆるベイヤー配列の撮像デバイスである。UI部8は、ユーザインターフェイスのためのキーやスイッチ等と、それらキー等を介したユーザからの指示に基づいてカメラの各部に対する各種設定を行うための設定情報を生成する設定情報生成部とを有している。設定情報生成部は、ユーザの指示に基づいて、例えば動画モード又は静止画モードの選択とその選択されたモードに応じてカメラの各部を制御するための設定情報や、HDRモードの設定とそのHDRモードでカメラの各部を制御するための設定情報を生成する。また、UI部8の設定情報生成部は、ISO感度の設定やシャッタースピード、露光量の設定とそれらの設定に応じて撮影を行うための各種設定情報を生成する。UI部8で生成された各種の設定情報は、バス10を介して、光学系1、撮像素子2、信号処理部3、HDR処理部4、調整処理部5、符号化処理部6、出力部7等へ送られる。   In FIG. 1, light passing through an optical system 1 having an iris, a lens, and the like is photoelectrically converted by an image sensor 2 constituted by a CMOS or a CCD. An image signal acquired by photoelectric conversion in the image sensor 2 is sent to the signal processing unit 3. The image sensor 2 is a so-called Bayer array imaging device. The UI unit 8 includes a key, a switch, and the like for a user interface, and a setting information generation unit that generates setting information for performing various settings for each unit of the camera based on an instruction from the user via the key and the like. Have. Based on the user's instruction, the setting information generating unit selects, for example, a moving image mode or a still image mode, setting information for controlling each part of the camera according to the selected mode, setting of the HDR mode, and its HDR Setting information for controlling each part of the camera in the mode is generated. Also, the setting information generation unit of the UI unit 8 generates ISO sensitivity settings, shutter speeds, exposure amount settings, and various setting information for shooting according to these settings. Various setting information generated by the UI unit 8 is transmitted via the bus 10 to the optical system 1, the image sensor 2, the signal processing unit 3, the HDR processing unit 4, the adjustment processing unit 5, the encoding processing unit 6, and the output unit. Sent to 7 mag.

以下、動画モードとHDRモードに設定されて動画像撮影とHDRによる画像合成が行われる場合の、本実施形態のカメラにおける各処理の概要を説明する。ユーザからの指示により動画モードとHDRモードが選択された場合、UI部8は、適フレームとアンダーフレームの画像を交互に撮影してそれら両フレーム画像から1フレーム画像を合成する処理を行うための各設定情報を生成する。これら各設定情報は、前述のように光学系1や撮像素子2、信号処理部3、HDR処理部4等へ送られる。この場合の光学系1と撮像素子2では、適フレーム画像とアンダーフレーム画像が交互に撮像され、それら適フレームとアンダーフレームの画像信号が信号処理部3へ送られる。   Hereinafter, an overview of each process in the camera of the present embodiment when the moving image mode and the HDR mode are set and moving image shooting and HDR image synthesis are performed will be described. When the moving image mode and the HDR mode are selected according to an instruction from the user, the UI unit 8 performs processing for alternately capturing images of appropriate frames and underframes and synthesizing one frame image from both frame images. Each setting information is generated. These pieces of setting information are sent to the optical system 1, the image sensor 2, the signal processing unit 3, the HDR processing unit 4 and the like as described above. In this case, the optical system 1 and the image sensor 2 alternately capture appropriate frame images and underframe images, and send the appropriate frame and underframe image signals to the signal processing unit 3.

信号処理部3は、撮像素子2から供給された適フレームとアンダーフレームの画像信号に対し、A/D変換とゲインコントロール等の各処理を行い、それら処理後の画像データをHDR処理部4へ出力する。また、角速度センサ9は、カメラの角速度を検出し、その検出した角速度値を、バス10を介してHDR処理部4へ出力する。   The signal processing unit 3 performs various processes such as A / D conversion and gain control on the appropriate frame and underframe image signals supplied from the imaging device 2, and sends the processed image data to the HDR processing unit 4. Output. Further, the angular velocity sensor 9 detects the angular velocity of the camera and outputs the detected angular velocity value to the HDR processing unit 4 via the bus 10.

HDR処理部4は、信号処理部3から供給された適フレームとアンダーフレームの画像データと、角速度センサ9から供給された角速度値のデータとを用いて、後述するようなHDRの画像合成処理を実行する。そして、HDR処理部4は、その合成処理後の画像信号を、調整処理部5へ出力する。なお、HDR処理部4の構成と合成処理については後に詳しく説明する。   The HDR processing unit 4 uses the appropriate frame and underframe image data supplied from the signal processing unit 3 and the angular velocity value data supplied from the angular velocity sensor 9 to perform HDR image synthesis processing as described later. Run. Then, the HDR processing unit 4 outputs the combined image signal to the adjustment processing unit 5. The configuration of the HDR processing unit 4 and the composition process will be described in detail later.

調整処理部5は、HDR処理部4による合成処理後の画像データに対して、輝度のゲイン調整やリサイズ等の各種調整処理を行い、その調整処理後の画像データを、符号化処理部6へ送る。符号化処理部6は、調整処理部5での調整処理後の画像データを符号化し、その符号化処理後のデータを出力部7へ送る。出力部7は、符号化処理後の画像データを例えばHDMI(高精細度マルチメディアインターフェイス)(HDMIは登録商標)などへ出力、メモリカードなどの記憶メディアへ保存、カメラのいわゆる背面液晶などの表示デバイスへ表示させる等の出力処理を行う。   The adjustment processing unit 5 performs various adjustment processing such as luminance gain adjustment and resizing on the image data after the synthesis processing by the HDR processing unit 4, and the image data after the adjustment processing to the encoding processing unit 6. send. The encoding processing unit 6 encodes the image data after the adjustment processing in the adjustment processing unit 5 and sends the data after the encoding processing to the output unit 7. The output unit 7 outputs the encoded image data to, for example, HDMI (High Definition Multimedia Interface) (HDMI is a registered trademark), saves it in a storage medium such as a memory card, and displays a so-called rear liquid crystal of the camera Output processing such as displaying on the device.

図2は、図1のカメラのHDR処理部4の構成例を示す図である。図2に示すHDR処理部4は、入力端子401,402,403と、現像部404,405と、輝度合成比率算出部406と、動きベクトル算出部407と、背景分離部408と、位置合わせ部409とを有している。また、HDR処理部4は、面積算出部410と、移動量算出部411と、輝度算出部412と、移動体合成比率算出部413と、合成部414と、出力端子415とを有している。   FIG. 2 is a diagram illustrating a configuration example of the HDR processing unit 4 of the camera of FIG. 2 includes an input terminal 401, 402, 403, a developing unit 404, 405, a luminance composition ratio calculation unit 406, a motion vector calculation unit 407, a background separation unit 408, and an alignment unit. 409. The HDR processing unit 4 includes an area calculation unit 410, a movement amount calculation unit 411, a luminance calculation unit 412, a moving body synthesis ratio calculation unit 413, a synthesis unit 414, and an output terminal 415. .

図2において、入力端子402には信号処理部3から供給された適フレームの画像データが入力され、入力端子403には信号処理部3から供給されたアンダーフレームの画像データが入力される。入力端子402に入力された適フレームの画像データは現像部404へ送られ、入力端子403に入力されたアンダーフレームの画像データは現像部405へ送られる。また、入力端子401には図1の角速度センサ9にて検出された角速度値のデータが入力されて背景分離部408へ送られる。   In FIG. 2, the appropriate frame image data supplied from the signal processing unit 3 is input to the input terminal 402, and the underframe image data supplied from the signal processing unit 3 is input to the input terminal 403. Appropriate frame image data input to the input terminal 402 is sent to the developing unit 404, and underframe image data input to the input terminal 403 is sent to the developing unit 405. Further, the angular velocity value data detected by the angular velocity sensor 9 of FIG. 1 is input to the input terminal 401 and sent to the background separation unit 408.

現像部404は、適フレームの画像データに対する現像処理を行い、その現像処理後の適フレームの画像データを、輝度合成比率算出部406と動きベクトル算出部407へ出力する。なお、現像処理とは、撮像素子2で撮像された生の画像(RAW画像)をデベイヤー処理して輝度と色差から成る信号に変換し、それら輝度と色差の信号に対してノイズ除去や光学的な歪補正、画像の適正化などを行う処理である。現像部405は、アンダーフレームの画像データに対する現像処理を行い、その現像処理後のアンダーフレームの画像データを、輝度合成比率算出部406と動きベクトル算出部407へ出力する。現像部404,405の詳細は後述する。   The development unit 404 performs development processing on the image data of the appropriate frame, and outputs the image data of the appropriate frame after the development processing to the luminance composition ratio calculation unit 406 and the motion vector calculation unit 407. The development processing refers to a raw image (RAW image) captured by the image sensor 2 that is debayered to be converted into a signal composed of luminance and color difference, and noise and optical signals are removed from the luminance and color difference signals. This is a process for performing proper distortion correction and image optimization. The development unit 405 performs development processing on the underframe image data, and outputs the underframe image data after the development processing to the luminance composition ratio calculation unit 406 and the motion vector calculation unit 407. Details of the developing units 404 and 405 will be described later.

輝度合成比率算出部406は、現像処理後のアンダーフレームの画像の輝度を基に、現像処理後の適フレームと現像処理後のアンダーフレームの二つのフレーム画像間における輝度合成比率を算出する。そして、輝度合成比率算出部406は、算出した輝度合成比率の情報を合成部414へ送る。輝度合成比率算出部406による輝度合成比率の算出処理の詳細は後述する。   The luminance composition ratio calculation unit 406 calculates the luminance composition ratio between the two frame images of the appropriate frame after the development processing and the underframe after the development processing based on the luminance of the underframe image after the development processing. Then, the luminance synthesis ratio calculation unit 406 sends information on the calculated luminance synthesis ratio to the synthesis unit 414. Details of the luminance synthesis ratio calculation processing by the luminance synthesis ratio calculation unit 406 will be described later.

動きベクトル算出部407は、移動体検出手段の一例であり、現像処理後の適フレームの画像を基準として、現像処理後の適フレームと現像処理後のアンダーフレームの二つのフレーム画像間で動きベクトルを算出する。すなわち、動きベクトル算出部407は、適フレーム画像の撮影とアンダーフレーム画像の撮影がなされた間に被写体位置が変化した被写体画像を移動体画像として検出するための動きベクトルを算出する。そして、動きベクトル算出部407は、その動きベクトルの情報と現像処理後の適フレームの画像データと現像処理後のアンダーフレームの画像データを、面積算出部410と移動量算出部411と輝度算出部412と背景分離部408へ送る。動きベクトル算出部407による動きベクトル算出処理の詳細は後述する。   The motion vector calculation unit 407 is an example of a moving body detection unit, and uses a motion vector between two frame images of an appropriate frame after the development process and an under frame after the development process with reference to an image of the appropriate frame after the development process. Is calculated. That is, the motion vector calculation unit 407 calculates a motion vector for detecting, as a moving body image, a subject image whose subject position has changed while an appropriate frame image and an underframe image have been captured. Then, the motion vector calculation unit 407 includes the area calculation unit 410, the movement amount calculation unit 411, and the luminance calculation unit based on the motion vector information, the image data of the appropriate frame after the development process, and the image data of the under frame after the development process. 412 and the background separation unit 408. Details of the motion vector calculation processing by the motion vector calculation unit 407 will be described later.

背景分離部408は、現像処理後の適フレーム及び現像処理後のアンダーフレームの画像データと角速度値と動きベクトルとに基づいて、それら適フレーム画像とアンダーフレーム画像から背景画像と移動体画像とを分離する。そして、背景分離部408は、現像処理後の適フレーム及び現像処理後のアンダーフレームの画像データと、分離した背景画像と移動体画像に対応した動きベクトルの情報とを、位置合わせ部409へ送る。背景分離部408における背景分離処理の詳細は後述する。   Based on the image data, the angular velocity value, and the motion vector of the appropriate frame after the development process and the under frame after the development process, the background separation unit 408 extracts the background image and the moving body image from the appropriate frame image and the under frame image. To separate. Then, the background separation unit 408 sends the image data of the appropriate frame after the development process and the underframe after the development process, and the motion vector information corresponding to the separated background image and moving body image to the alignment unit 409. . Details of the background separation processing in the background separation unit 408 will be described later.

位置合わせ部409は、背景画像の動きベクトルに基づいて、現像処理後のアンダーフレーム画像に対して、現像処理後の適フレーム画像の位置を合わせる位置合わせ処理を行う。そして、位置合わせ部409は、現像処理後のアンダーフレームの画像データと位置合わせ処理後の適フレームの画像データと移動体画像の動きベクトルの情報を、面積算出部410と移動量算出部411と輝度算出部412へ送る。また、位置合わせ部409は、位置合わせ処理後の適フレームの画像データと現像処理後のアンダーフレームの画像データを、合成部414へ送る。位置合わせ部409による位置合わせ処理の詳細は後述する。   The alignment unit 409 performs alignment processing for aligning the position of an appropriate frame image after development processing with respect to the underframe image after development processing based on the motion vector of the background image. Then, the alignment unit 409 converts the underframe image data after the development process, the image data of the appropriate frame after the alignment process, and the motion vector information of the moving body image into the area calculation unit 410, the movement amount calculation unit 411, This is sent to the luminance calculation unit 412. Also, the alignment unit 409 sends the image data of the appropriate frame after the alignment process and the image data of the under frame after the development process to the synthesis unit 414. Details of the alignment processing by the alignment unit 409 will be described later.

面積算出部410は、面積検出手段の一例であり、現像処理後のアンダーフレームの画像データと位置合わせ処理後の適フレームの画像データと移動体画像の動きベクトルとに基づいて、移動体画像の面積を算出する。そして、面積算出部410は、移動体画像の面積の情報を、移動体合成比率算出部413へ送る。面積算出部410による面積算出処理の詳細は後述する。   The area calculation unit 410 is an example of an area detection unit, and based on the underframe image data after the development process, the image data of the appropriate frame after the alignment process, and the motion vector of the mobile object image, Calculate the area. Then, the area calculation unit 410 sends information on the area of the moving object image to the moving object composition ratio calculation unit 413. Details of the area calculation processing by the area calculation unit 410 will be described later.

移動量算出部411は、移動量検出手段の一例であり、現像処理後のアンダーフレームの画像データと位置合わせ処理後の適フレームの画像データと移動体画像の動きベクトルとに基づいて、移動体画像の移動量を算出する。すなわち、移動量算出部411は、適フレーム画像の撮影とアンダー画像の撮影がなされた間の移動体画像の移動量を求める。そして、移動量算出部411は、移動体画像の移動量の情報と現像処理後のアンダーフレームの画像データと位置合わせ処理後の適フレームの画像データとを、移動体合成比率算出部413へ送る。移動量算出部411による移動量算出処理の詳細は後述する。   The movement amount calculation unit 411 is an example of a movement amount detection unit, and is based on the underframe image data after the development process, the image data of the appropriate frame after the alignment process, and the motion vector of the moving body image. The amount of image movement is calculated. In other words, the movement amount calculation unit 411 obtains the movement amount of the moving body image during the appropriate frame image shooting and the under image shooting. Then, the movement amount calculation unit 411 sends the movement amount information of the moving object image, the underframe image data after the development process, and the image data of the appropriate frame after the alignment process to the moving object composition ratio calculation unit 413. . Details of the movement amount calculation processing by the movement amount calculation unit 411 will be described later.

輝度算出部412は、輝度検出手段の一例であり、現像処理後のアンダーフレームの画像データと、位置合わせ処理後の適フレームの画像データと、移動体画像の動きベクトルとに基づいて、移動体画像の輝度を算出する。そして、輝度算出部412は、移動体画像の輝度の情報を、移動体合成比率算出部413へ送る。輝度算出部412による輝度算出処理の詳細は後述する。   The luminance calculation unit 412 is an example of luminance detection means, and based on the underframe image data after the development process, the appropriate frame image data after the alignment process, and the motion vector of the mobile object image, Calculate the brightness of the image. Then, the luminance calculation unit 412 sends the luminance information of the moving object image to the moving object composition ratio calculation unit 413. Details of the luminance calculation processing by the luminance calculation unit 412 will be described later.

移動体合成比率算出部413は、現像処理後のアンダーフレームの画像データと位置合わせ処理後の適フレームの画像データと移動体画像の面積と移動量と輝度とに基づいて、各移動体画像に対する合成比率(移動体合成比率)を算出する。すなわち、移動体合成比率算出部413は、移動体画像の移動量と面積と輝度に基づいて、適フレーム画像の移動体画像とアンダーのフレーム画像の移動体画像との合成比率を制御する制御手段の一例である。そして、移動体合成比率算出部413は、移動体合成比率の情報を合成部414へ送る。移動体合成比率算出部413による移動体合成比率算出処理の詳細は後述する。   The moving object composition ratio calculation unit 413 applies the underframe image data after the development process, the image data of the appropriate frame after the alignment process, the area of the moving object image, the moving amount, and the luminance to each moving object image. A synthesis ratio (mobile body synthesis ratio) is calculated. That is, the moving body composition ratio calculation unit 413 controls the composition ratio of the moving body image of the appropriate frame image and the moving body image of the under frame image based on the moving amount, area, and luminance of the moving body image. It is an example. Then, the mobile body composition ratio calculation unit 413 sends information on the mobile body composition ratio to the composition unit 414. Details of the mobile body composition ratio calculation processing by the mobile body composition ratio calculation unit 413 will be described later.

合成部414は、輝度合成比率と位置合わせ処理後の適フレームの画像データと現像処理後のアンダーフレームの画像データと各移動体合成比率の情報とに基づいて、位置合わせ処理後の適フレームの画像と現像処理後のアンダーフレームの画像とを合成する。そして、合成部414にて合成処理された後のフレーム画像データは、出力端子415を介して図1の調整処理部5へ送られる。合成部414による画像合成処理の詳細は後述する。   Based on the luminance composition ratio, the image data of the appropriate frame after the alignment process, the image data of the underframe after the development process, and the information of each moving object composition ratio, the combining unit 414 The image and the underframe image after development processing are combined. Then, the frame image data after being synthesized by the synthesis unit 414 is sent to the adjustment processing unit 5 in FIG. 1 via the output terminal 415. Details of the image composition processing by the composition unit 414 will be described later.

以下、HDR処理部4における合成処理について、さらに詳しく説明する。入力端子402には、適フレームの画像データが、フレームごとに順次入力される。また、入力端子403には、アンダーフレームの画像データが、フレームごとに順次入力される。すなわちこのときの撮像素子2では、図3に示すように、適フレーム351r,アンダーフレーム351u,適フレーム352r,アンダーフレーム352u,・・・のように、適フレームとアンダーフレームの撮像が交互に行われている。そして、適フレーム351r,352r,353r,354r,・・・の画像データが入力端子402に順次入力され、アンダーフレーム351u,352u,353u,354u,・・・の画像データが入力端子403に順次入力されている。なお、本実施形態では、説明を簡単にするために、適フレーム画像とアンダーフレーム画像の露光量の差を、例えばISO感度の2段分に相当する差とし、適フレームとアンダーフレームの順に撮像がなされているものとしている。もちろん、これら露光量の差等は一例である。また図3では、適フレームとアンダーフレームの組み合わせは、適フレーム351rとアンダーフレーム351u、適フレーム352rとアンダーフレーム352u、・・・のような2フレームずつの組み合わせになっているが、これ以外の組み合わせでもよい。   Hereinafter, the synthesizing process in the HDR processing unit 4 will be described in more detail. Image data of an appropriate frame is sequentially input to the input terminal 402 for each frame. Also, underframe image data is sequentially input to the input terminal 403 for each frame. That is, in the imaging device 2 at this time, as shown in FIG. 3, imaging of the appropriate frame and the under frame is performed alternately like the appropriate frame 351r, the under frame 351u, the appropriate frame 352r, the under frame 352u,. It has been broken. The image data of the appropriate frames 351r, 352r, 353r, 354r,... Are sequentially input to the input terminal 402, and the image data of the under frames 351u, 352u, 353u, 354u,. Has been. In this embodiment, in order to simplify the explanation, the exposure amount difference between the appropriate frame image and the under frame image is set to a difference corresponding to, for example, two steps of ISO sensitivity, and images are taken in the order of the appropriate frame and the under frame. Is assumed to have been made. Of course, the difference in the exposure amount is an example. In FIG. 3, the combination of the appropriate frame and the under frame is a combination of two frames such as the appropriate frame 351r and the under frame 351u, the appropriate frame 352r and the under frame 352u,. A combination may be used.

現像部404では適フレームの画像データに対する現像処理が行われ、現像部405ではアンダーフレームの画像データに対する現像処理が行われる。図4(a)には現像部404の構成例を示し、図4(b)には現像部405の構成例を示す。図4(a)に示す現像部404は、ホワイトバランス部4041、NR処理部4042、色補間部4043、マトリクス変換部4044、ガンマ変換部4045、色調整部4046を有している。また、図4(b)に示す現像部405は、ホワイトバランス部4051、NR処理部4052、色補間部4053、マトリクス変換部4054、ガンマ変換部4055、色調整部4056を有している。なお、これら図4(a)の現像部404と図4(b)の現像部405は、殆どの部分が同じ構成となされているため、それら同じ構成については、図4(a)の現像部404の構成例についてのみ説明する。   The developing unit 404 performs a developing process for image data of an appropriate frame, and the developing unit 405 performs a developing process for image data of an under frame. 4A shows a configuration example of the developing unit 404, and FIG. 4B shows a configuration example of the developing unit 405. The developing unit 404 illustrated in FIG. 4A includes a white balance unit 4041, an NR processing unit 4042, a color interpolation unit 4043, a matrix conversion unit 4044, a gamma conversion unit 4045, and a color adjustment unit 4046. 4B includes a white balance unit 4051, an NR processing unit 4052, a color interpolation unit 4053, a matrix conversion unit 4054, a gamma conversion unit 4055, and a color adjustment unit 4056. The development unit 405 illustrated in FIG. The developing unit 404 in FIG. 4 (a) and the developing unit 405 in FIG. 4 (b) have almost the same configuration. Therefore, the same configuration is applied to the developing unit in FIG. 4 (a). Only the configuration example 404 will be described.

ホワイトバランス部4041は、いわゆるホワイトバランスを調整する処理を行う。具体的には、ホワイトバランス部4041は、白くあるべき画像のR,G,Bの各色信号の値が同じ値になるようなゲインを、R,G,Bの各色信号に各々にかけるようなホワイトバランス調整処理を行う。NR処理部4042は、入力された画像内で、被写体や背景の画像等に由来しない、センサ(撮像素子2)等に起因するノイズ等を低減するノイズリダクション処理を行う。色補間部4043は、ベイヤー配列の撮像素子2によるR,G,Bの色モザイク画像を補間することによって、全ての画素においてR,G,Bの色信号が揃ったカラー画像を生成する。色補間部4043で生成されたカラー画像は、マトリクス変換部4044にてR,G,BからY,U,Vへの変換がなされ、さらにガンマ変換部4045にて階調補正が行われて基本的なカラー画像に変換される。その後、色調整部4046は、画像の見栄えを改善するための色調整処理として、例えば、彩度強調、色相補正、エッジ強調といった画像補正を、カラー画像に対して施す。   The white balance unit 4041 performs processing for adjusting so-called white balance. Specifically, the white balance unit 4041 applies a gain to each of the R, G, and B color signals so that the values of the R, G, and B color signals of the image that should be white are the same. Perform white balance adjustment processing. The NR processing unit 4042 performs noise reduction processing for reducing noise caused by a sensor (imaging device 2) or the like that is not derived from a subject or a background image in the input image. The color interpolation unit 4043 generates a color image in which R, G, and B color signals are aligned in all the pixels by interpolating the R, G, and B color mosaic images from the Bayer-array image sensor 2. The color image generated by the color interpolation unit 4043 is converted from R, G, B to Y, U, V by the matrix conversion unit 4044, and further, tone correction is performed by the gamma conversion unit 4045. Converted to a typical color image. Thereafter, the color adjustment unit 4046 performs image correction such as saturation enhancement, hue correction, and edge enhancement on the color image as color adjustment processing for improving the appearance of the image.

ここで、HDRによる画像合成が行われる場合、異なる露出で撮影した画像データが使用されるため、画像データには予めゲインをかけて輝度レベルを揃えておく必要がある。ゲインの値は、いわゆる白飛びや黒潰れにならない値に設定する必要があるため、一律なゲインの値ではなく、例えば図5に示すようなガンマカーブに対応した値が用いられる。図5において、図中実線で示すガンマカーブ501は、適フレーム用のガンマカーブの一例を示し、図中点線で示すガンマカーブ502は、アンダーフレーム用のガンマカーブの一例を示している。適フレームの画像に対しては、ガンマ変換部4045が図5のガンマカーブ501によるガンマ変換処理を行い、アンダーフレームの画像に対しては、ガンマ変換部4055が図5のガンマカーブ502によるガンマ変換処理を行う。図5に示すガンマ特性をみてわかるように、アンダーフレームの画像に対しては、適フレームの画像よりも大きいゲインがかけられることになるため、現像処理後のアンダーフレームの画像はノイズが増大することが懸念される。そこで、アンダーフレーム用の現像部405のNR処理部4052は、適フレーム用の現像部404のNR処理部4042よりも強いノイズリダクション(NR)処理をかける。これにより、現像処理後の適フレーム画像と現像処理後のアンダーフレーム画像のノイズ量が揃えられる。この処理により、適フレーム画像とアンダーフレーム画像の違いによる、HDRの画像合成処理後のフレーム画像の違和感が低減されることになる。ノイズ低減の具体的な手法としては、適当なカーネルサイズにおける平滑化処理などの一般的なノイズ低減手法や、εフィルタやエッジ保存型のバイラテラルフィルタといった公知のフィルタによるノイズ低減手法など様々な手法が考えられる。それらのノイズ低減手法は公知であるためここではそれらの説明は省略する。それらノイズ低減手法の何れを用いるかについては、カメラの処理速度やメモリといったリソースとのバランスを考慮して適宜適切な手法を選択すればよい。   Here, when image composition by HDR is performed, image data captured at different exposures are used, and thus it is necessary to apply a gain to the image data in advance to make the luminance level uniform. Since the gain value needs to be set to a value that does not cause so-called whiteout or blackout, for example, a value corresponding to a gamma curve as shown in FIG. 5 is used instead of a uniform gain value. In FIG. 5, a gamma curve 501 indicated by a solid line in the drawing indicates an example of a gamma curve for an appropriate frame, and a gamma curve 502 indicated by a dotted line in the drawing indicates an example of a gamma curve for an underframe. The gamma conversion unit 4045 performs a gamma conversion process using the gamma curve 501 in FIG. 5 for an image of an appropriate frame, and the gamma conversion unit 4055 performs a gamma conversion by the gamma curve 502 in FIG. 5 for an underframe image. Process. As can be seen from the gamma characteristics shown in FIG. 5, a gain larger than that of an appropriate frame image is applied to an underframe image, and therefore noise in the underframe image after development processing increases. There is concern. Therefore, the NR processing unit 4052 of the under-frame developing unit 405 performs stronger noise reduction (NR) processing than the NR processing unit 4042 of the appropriate frame developing unit 404. As a result, the noise amounts of the appropriate frame image after the development processing and the underframe image after the development processing are aligned. By this processing, the uncomfortable feeling of the frame image after the HDR image composition processing due to the difference between the appropriate frame image and the underframe image is reduced. Specific methods for noise reduction include various methods such as general noise reduction methods such as smoothing processing at an appropriate kernel size, and noise reduction methods using known filters such as ε filters and edge-preserving bilateral filters. Can be considered. Since these noise reduction methods are known, their description is omitted here. As to which of these noise reduction methods is used, an appropriate method may be selected as appropriate in consideration of balance with resources such as camera processing speed and memory.

なお、本実施形態では、二つの現像部404,405を有する例を挙げた、各現像部404,405の構成は同じであるため、現像部を一つのみとし、現像に用いるパラメータを、適フレームとアンダーフレームの画像入力に応じて切り替えるようにしてもよい。   In this embodiment, the configuration of each developing unit 404, 405 is the same as an example having two developing units 404, 405. Therefore, only one developing unit is used, and parameters used for development are set appropriately. You may make it switch according to the image input of a flame | frame and an under frame.

図2に説明を戻し、輝度合成比率算出部406は、アンダーフレーム画像の各画像領域の輝度に応じて、それぞれ画像領域ごとの輝度合成比率を算出する。なお、輝度合成比率算出部406が輝度合成比率を算出する際の各画像領域は、フレーム画像を複数分割した各画像領域であり、例えば動きベクトル検出の際の後述するブロック画像に対応した画像領域でもよいし、それとは異なる画像領域でもよい。本実施形態では、説明を簡略にするために、輝度合成比率算出部406が輝度合成比率を算出する際の各画像領域は、後述するブロック画像に対応した画像領域であるとする。   Returning to FIG. 2, the luminance composition ratio calculation unit 406 calculates the luminance composition ratio for each image region in accordance with the luminance of each image region of the underframe image. Each image region when the luminance composition ratio calculation unit 406 calculates the luminance composition ratio is an image region obtained by dividing a frame image into a plurality of images. For example, an image region corresponding to a block image described later when detecting a motion vector However, it may be a different image area. In the present embodiment, in order to simplify the description, it is assumed that each image region when the luminance composition ratio calculation unit 406 calculates the luminance composition ratio is an image region corresponding to a block image described later.

図6には、輝度合成比率算出部406が、アンダーフレームの画像領域の輝度に応じて輝度合成比率を算出する際に参照する、輝度と輝度合成比率の関係を示すグラフの一例である。本実施形態のようにHDRの合成画像が生成される場合、図6に示すように、輝度合成比率算出部406は、輝度合成閾値Y1より暗い画像領域については適フレームの画像領域を使用する。一方、輝度合成比率算出部406は、輝度合成閾値Y2より明るい画像領域についてはアンダーフレームの画像領域を使用する。また、輝度合成比率算出部406は、輝度合成閾値Y1〜Y2の明るさの画像領域については、その画像領域の輝度に応じて、適フレームの画像領域とアンダーフレームの画像領域の輝度合成比率を徐々に変化させる。すなわち、輝度合成閾値Y1〜Y2の明るさの画像領域に関しては、輝度合成比率算出部406は、画像領域の明るさが輝度合成閾値Y1に近くなるほど、適フレームの画像領域の割合が多くなる輝度合成比率を生成する。逆に、輝度合成比率算出部406は、画像領域の明るさが輝度合成閾値Y2に近くなるほど、アンダーフレームの画像領域の割合が多くなる輝度合成比率を生成する。これにより、輝度合成閾値Y1〜Y2の明るさの画像領域では、適フレームの画像領域とアンダーフレームの画像領域の合成による画像の明るさの切り替わりが滑らかになる。   FIG. 6 is an example of a graph showing the relationship between the luminance and the luminance synthesis ratio, which is referred to when the luminance synthesis ratio calculation unit 406 calculates the luminance synthesis ratio according to the luminance of the image area of the underframe. When an HDR composite image is generated as in the present embodiment, as shown in FIG. 6, the luminance composition ratio calculation unit 406 uses an image region of an appropriate frame for an image region darker than the luminance composition threshold Y1. On the other hand, the luminance composition ratio calculation unit 406 uses an underframe image region for an image region brighter than the luminance composition threshold Y2. In addition, the luminance composition ratio calculation unit 406 calculates the luminance composition ratio between the image area of the appropriate frame and the image area of the under frame for the image area having the brightness of the luminance composition threshold values Y1 to Y2 according to the luminance of the image area. Change gradually. That is, with respect to the image area having the brightness of the brightness synthesis threshold Y1 to Y2, the brightness synthesis ratio calculation unit 406 increases the brightness of the image area of the appropriate frame as the brightness of the image area is closer to the brightness synthesis threshold Y1. Generate a composite ratio. Conversely, the luminance composition ratio calculation unit 406 generates a luminance composition ratio in which the ratio of the underframe image area increases as the brightness of the image area approaches the luminance composition threshold Y2. Thereby, in the image area having the brightness of the luminance synthesis threshold values Y1 to Y2, the switching of the brightness of the image by the synthesis of the image area of the appropriate frame and the image area of the under frame becomes smooth.

図2の動きベクトル算出部407は、現像処理後の適フレームと現像処理後のアンダーフレームの画像間で、移動体画像の動きベクトルを算出する。動きベクトル算出部407は、先ず、現像処理後の適フレーム画像と現像処理後のアンダーフレーム画像を、それぞれ複数個のブロック画像に分割して、それらブロック画像ごとにエッジ検出処理を行う。エッジ検出の手法としては、例えば、入力画像にローパスフィルタをかけることで暈け量が大きい画像を作成して、入力画像から暈け量の大きい画像を減算することでエッジを検出するような手法を用いることができる。他のエッジ検出の手法としては、例えば、公知の微分フィルタやプリューウィットフィルタなどを用いてエッジを検出する手法を用いてもよい。これらのエッジ検出によれば、センサ起因のノイズではなく、被写体像のエッジのみを検出して動きベクトル検出精度の向上を図ることができる。次に、動きベクトル算出部407は、前述したように現像処理後の適フレーム画像と現像処理後のアンダーフレーム画像のなかでエッジ検出ができたブロック画像に関して動きベクトル検出処理を行う。このように、動きベクトル算出部407は、エッジ検出ができたブロック画像に対してのみ動きベクトル検出を行うことで、動きベクトル検出精度を向上させている。   The motion vector calculation unit 407 in FIG. 2 calculates the motion vector of the moving object image between the appropriate frame after the development process and the underframe image after the development process. First, the motion vector calculation unit 407 divides an appropriate frame image after development processing and an underframe image after development processing into a plurality of block images, and performs edge detection processing for each block image. As an edge detection method, for example, a method of creating an image with a large amount of blur by applying a low-pass filter to the input image, and detecting an edge by subtracting an image with a large amount of blur from the input image Can be used. As another edge detection method, for example, a method of detecting an edge using a known differential filter, a pre-wit filter, or the like may be used. According to these edge detections, it is possible to improve the motion vector detection accuracy by detecting only the edge of the subject image, not the noise caused by the sensor. Next, as described above, the motion vector calculation unit 407 performs motion vector detection processing on the block image in which edge detection is possible in the appropriate frame image after development processing and the underframe image after development processing. As described above, the motion vector calculation unit 407 improves motion vector detection accuracy by performing motion vector detection only on a block image for which edge detection has been performed.

以下、図7(a)と図7(b)を参照して、動きベクトル算出部407における動きベクトル検出処理の詳細を説明する。なお、図7(a)と図7(b)中のP1〜P9はそれぞれ画素値を表している。動きベクトル算出部407は、先ず、動きベクトル検出の位置基準画像を、図7(a)に示すような現像処理後の適フレーム画像内でエッジ検出されたブロック画像701とする。また、動きベクトル算出部407は、現像処理後のアンダーフレーム画像のなかでエッジ検出された複数のブロック画像を含む画像部分を、位置基準画像(ブロック画像701)に対する動きベクトル検出対象画像702とする。次に、動きベクトル算出部407は、位置基準画像であるブロック画像701のなかの各画素と、動きベクトル検出対象画像702に含まれるブロック画像のなかの各画素との間の差分の絶対値を求め、それら各画素の差分絶対値の総和を求める。動きベクトル算出部407は、位置基準画像のブロック画像701に対して差分絶対値の総和を求める処理を、動きベクトル検出対象画像702内で座標位置を一画素分ごとに順次ずらしながら設定される各ブロック画像に対して行う。そして、動きベクトル算出部407は、動きベクトル検出対象画像702のなかで、前述のように座標位置を一画素分ごとに順次ずらしながら求めた総和が、最も小さくなるブロック画像703を求める。図7(b)は、動きベクトル検出対象画像702の左上端の座標を(x0,y0)とした場合において、前述の総和が最も小さくなるブロック画像703の左上端の座標が(x1,y2)である例が示されている。すなわち、動きベクトル算出部407は、動きベクトル検出対象画像702のなかの座標(x1,y2)に対応したブロック画像703を、図7(a)の位置基準画像のブロック画像701に対応したブロック画像として検出する。そして、動きベクトル算出部407は、適フレーム画像内の位置基準画像のブロック画像701の座標と、アンダーフレーム画像内の動きベクトル検出対象画像702のなかのブロック画像703の座標とから、動きベクトルを求める。すなわち、動きベクトル算出部407は、適フレーム画像内のブロック画像701の座標に対する、アンダーフレーム画像内のブロック画像703の座標の差分で表される方向と距離を、動きベクトルとして算出する。   Hereinafter, the details of the motion vector detection process in the motion vector calculation unit 407 will be described with reference to FIGS. 7A and 7B. Note that P1 to P9 in FIGS. 7A and 7B represent pixel values, respectively. First, the motion vector calculation unit 407 sets the position reference image for motion vector detection as a block image 701 whose edge is detected in an appropriate frame image after development processing as shown in FIG. In addition, the motion vector calculation unit 407 sets an image portion including a plurality of block images whose edges are detected in the underframe image after the development processing as a motion vector detection target image 702 for the position reference image (block image 701). . Next, the motion vector calculation unit 407 calculates the absolute value of the difference between each pixel in the block image 701 that is the position reference image and each pixel in the block image included in the motion vector detection target image 702. And the sum of the absolute differences of these pixels is obtained. The motion vector calculation unit 407 sets the processing for obtaining the sum of absolute difference values for the block image 701 of the position reference image while sequentially shifting the coordinate position for each pixel in the motion vector detection target image 702. Perform on block images. Then, the motion vector calculation unit 407 obtains a block image 703 having the smallest sum obtained by sequentially shifting the coordinate position for each pixel as described above in the motion vector detection target image 702. In FIG. 7B, when the coordinates of the upper left corner of the motion vector detection target image 702 are (x0, y0), the coordinates of the upper left corner of the block image 703 with the smallest sum are (x1, y2). An example is shown. That is, the motion vector calculation unit 407 converts the block image 703 corresponding to the coordinates (x1, y2) in the motion vector detection target image 702 into the block image 701 corresponding to the block reference image 701 in FIG. Detect as. Then, the motion vector calculation unit 407 calculates a motion vector from the coordinates of the block image 701 of the position reference image in the appropriate frame image and the coordinates of the block image 703 in the motion vector detection target image 702 in the underframe image. Ask. That is, the motion vector calculation unit 407 calculates, as a motion vector, the direction and distance represented by the difference between the coordinates of the block image 703 in the underframe image with respect to the coordinates of the block image 701 in the appropriate frame image.

図2の背景分離部408は、前述のようにして動きベクトル算出部407で算出された動きベクトルの情報と、入力端子401を介して角速度センサ9から供給された角速度の情報とに基づいて、移動体画像と背景画像とを分離する。以下、図8と図9を参照しながら、背景分離部408で行われる分離処理の詳細を説明する。   The background separation unit 408 in FIG. 2 is based on the motion vector information calculated by the motion vector calculation unit 407 as described above and the angular velocity information supplied from the angular velocity sensor 9 via the input terminal 401. A moving body image and a background image are separated. Hereinafter, the details of the separation process performed by the background separation unit 408 will be described with reference to FIGS. 8 and 9.

図8は、カメラをカメラ位置1101aからカメラ位置1101bへパンニングしたときに、カメラの撮像素子2の撮像面上で、背景画像がどのように移動するかを模式的に表した図である。なお、撮像素子2は実際にはカメラに内蔵されているが、図8では説明を判り易くするために、カメラと撮像素子2を分けて図示している。図8に示すように、カメラを位置1101aから位置1101bへパンニングして、静止している被写体1103を撮影した場合、撮像素子2の撮像面上に結像される被写体画像は、画像位置1104から画像位置1105まで移動することになる。ここで、静止している被写体1103とはすなわち背景であり、撮像素子2の撮像面上における背景画像の移動量1106は、パンニングによるカメラの移動角度1107と光学系1の焦点距離f(mm)とから算出できる。また、移動角度1107は、角速度センサ9で検出されたカメラの角速度ω(角度/秒)と、フレームレートfps(フレーム/秒)、移動量算出のためにサンプリングするフレーム画像間にある画像数n(フレーム数)を用いて算出することができる。そして、画素ピッチpp(mm/ピクセル数)を用いて、背景画像の移動量1106をピクセル数に換算することにより、撮像素子2の撮像面上で背景画像がどのくらい移動しているかを算出することができる。背景分離部408は、撮像素子2の撮像面上における背景画像の移動量を、式(1)により算出している。   FIG. 8 is a diagram schematically illustrating how the background image moves on the imaging surface of the imaging element 2 of the camera when the camera is panned from the camera position 1101a to the camera position 1101b. Although the image pickup device 2 is actually built in the camera, the camera and the image pickup device 2 are shown separately in FIG. 8 for easy understanding of the description. As shown in FIG. 8, when the camera 110 is panned from the position 1101 a to the position 1101 b and a stationary subject 1103 is photographed, the subject image formed on the imaging surface of the image sensor 2 is from the image position 1104. It moves to the image position 1105. Here, the stationary object 1103 is the background, and the movement amount 1106 of the background image on the imaging surface of the image sensor 2 is determined by the panning camera movement angle 1107 and the focal length f (mm) of the optical system 1. And can be calculated from Further, the moving angle 1107 is the angular velocity ω (angle / second) of the camera detected by the angular velocity sensor 9, the frame rate fps (frame / second), and the number of images n between the frame images sampled for calculating the moving amount. It can be calculated using (number of frames). Then, the amount of movement of the background image 1106 is converted into the number of pixels by using the pixel pitch pp (mm / number of pixels) to calculate how much the background image has moved on the imaging surface of the imaging device 2. Can do. The background separation unit 408 calculates the amount of movement of the background image on the imaging surface of the imaging device 2 using Expression (1).

Figure 0006494388
Figure 0006494388

図9は、背景分離部408が移動体画像と背景画像を分離する際に、動きベクトルをどのように用いるかを説明するための図である。図9の横軸は動きベクトルの大きさを示し、縦軸は同じ大きさを持つ動きベクトルの数量を示している。図9の横軸は、「0」を境に、動きベクトルの方向を区別している。また、式(1)により算出された背景画像の移動量(図8の移動量1106)は、図9では、移動量1201として示されている。この図9の例では、同じ大きさを持つ動きベクトルの集団として、ベクトル集団1211〜1214があり、ベクトル集団1214が式(1)で算出された背景画像の移動量1201に対応した動きベクトルの集団である。一方、ベクトル集団1211〜1213は、背景画像の移動量1201に対応したベクトル集団1214とは異なる大きさの動きベクトル集団である。すなわち、ベクトル集団1211〜1213の各動きベクトルは、背景画像の移動量1201に対応したベクトル集団1214とは異なる画像部分の動きベクトル、言い換えると、移動体画像の各動きベクトルであると考えられる。したがって、背景分離部408は、動きベクトルと背景画像の移動量との関係から、動きベクトル算出部407から供給された動きベクトルを、移動体画像に対応したグループ1202と背景画像に対応したグループ1203とに分離可能となる。   FIG. 9 is a diagram for explaining how the motion vector is used when the background separation unit 408 separates the moving body image and the background image. The horizontal axis in FIG. 9 indicates the magnitude of the motion vector, and the vertical axis indicates the quantity of motion vectors having the same magnitude. The horizontal axis in FIG. 9 distinguishes the direction of the motion vector with “0” as a boundary. Further, the movement amount of the background image (movement amount 1106 in FIG. 8) calculated by Expression (1) is shown as the movement amount 1201 in FIG. In the example of FIG. 9, there are vector groups 1211 to 1214 as a group of motion vectors having the same size, and the vector group 1214 is a motion vector corresponding to the movement amount 1201 of the background image calculated by the equation (1). It is a group. On the other hand, the vector group 1211 to 1213 is a motion vector group having a different size from the vector group 1214 corresponding to the movement amount 1201 of the background image. That is, each motion vector of the vector groups 1211 to 1213 is considered to be a motion vector of an image portion different from the vector group 1214 corresponding to the movement amount 1201 of the background image, in other words, each motion vector of the moving body image. Accordingly, the background separation unit 408 determines the motion vector supplied from the motion vector calculation unit 407 based on the relationship between the motion vector and the movement amount of the background image, and the group 1203 corresponding to the moving body image and the group 1203 corresponding to the background image. And can be separated.

図2の位置合わせ部409は、背景分離部408により分離された背景画像に対応したグループ1203に含まれる動きベクトルを用いて、いわゆるアフィン係数を算出する。アフィン係数とは、線形変換と平行移動を組み合わせたアフィン変換に用いる行列であり、以下の式(2)で表すことができる。なお、式(2)は公知の式であるため、詳細な説明は省略する。   The alignment unit 409 in FIG. 2 calculates a so-called affine coefficient using the motion vector included in the group 1203 corresponding to the background image separated by the background separation unit 408. An affine coefficient is a matrix used for affine transformation combining linear transformation and parallel movement, and can be expressed by the following equation (2). In addition, since Formula (2) is a well-known formula, detailed description is abbreviate | omitted.

Figure 0006494388
Figure 0006494388

式(2)において、アフィン変換による補正前画像の座標が(x,y)であり、アフィン変換による補正後画像の座標が(x´,y´)であり、この式(2)中の3×3行列がアフィン係数である。位置合わせ部409は、前述の動きベクトル算出部407が各ブロック画像から算出した動きベクトルを用いてアフィン係数を算出する。そして、位置合わせ部409は、補正前画像を現像処理後の適フレーム画像とし、現像処理後のアンダーフレーム画像に対してアフィン係数を算出して、そのアフィン係数を用いて、適フレーム画像のアフィン変換を行う。これにより、位置合わせ部409は、適フレーム画像の背景画像を、アンダーフレーム画像の背景画像に対して位置合わせすることができる。   In equation (2), the coordinates of the image before correction by affine transformation are (x, y), and the coordinates of the image after correction by affine transformation are (x ′, y ′), and 3 in this equation (2) A x3 matrix is an affine coefficient. The alignment unit 409 calculates an affine coefficient using the motion vector calculated from each block image by the motion vector calculation unit 407 described above. Then, the alignment unit 409 sets the pre-correction image as an appropriate frame image after development processing, calculates an affine coefficient for the under frame image after development processing, and uses the affine coefficient to affine the appropriate frame image. Perform conversion. Thereby, the alignment unit 409 can align the background image of the appropriate frame image with the background image of the underframe image.

図2の面積算出部410は、移動体に対応したグループ1202の動きベクトルと、背景画像の位置合わせがなされた後の適フレーム画像と、現像処理後のアンダーフレーム画像とを基に、移動体画像の面積を算出する。以下、図10、図11、図12(a)〜図12(d)を参照しながら、面積算出部410で行われる面積算出処理の詳細を説明する。   The area calculation unit 410 in FIG. 2 uses the moving vector of the group 1202 corresponding to the moving body, the appropriate frame image after the background image is aligned, and the underframe image after the development processing, as the moving body. Calculate the area of the image. The details of the area calculation process performed by the area calculation unit 410 will be described below with reference to FIGS. 10, 11, and 12 (a) to 12 (d).

図10は、前述の図9に示した移動被写体に対応したグループ1202に含まれる各動きベクトル集団1211〜1213を示した図である。図10の横軸は動きベクトルの大きさを示し、縦軸は同じ大きさを持つ動きベクトルの数量を示している。ここで、例えば動きベクトル集団1211を例に挙げた場合、この動きベクトル集団1211内のそれぞれ同じ大きさの複数の動きベクトルは、或る移動体画像を構成している複数のブロック画像の各動きベクトルである可能性が高いと考えられる。一方、動きベクトル集団1211内の各動きベクトルは、それらの大きさが同じであったとしても、異なる移動体画像の動きベクトルである可能性もある。したがって、同じ大きさの複数の動きベクトルがある場合、それら各動きベクトルが、同じ移動体画像の動きベクトルであるか否かを判定する必要がある。   FIG. 10 is a diagram showing motion vector groups 1211 to 1213 included in the group 1202 corresponding to the moving subject shown in FIG. The horizontal axis in FIG. 10 indicates the magnitude of the motion vector, and the vertical axis indicates the number of motion vectors having the same magnitude. Here, for example, when the motion vector group 1211 is taken as an example, a plurality of motion vectors having the same size in the motion vector group 1211 are each motion of a plurality of block images constituting a certain moving body image. It is highly likely that it is a vector. On the other hand, even if the motion vectors in the motion vector group 1211 have the same size, there is a possibility that they are motion vectors of different moving body images. Therefore, when there are a plurality of motion vectors having the same size, it is necessary to determine whether or not each of the motion vectors is a motion vector of the same moving object image.

図11と図12(a)〜図12(d)は、或るフレーム画像上にそれぞれ異なる移動体画像が存在している場合において、それら移動体画像を構成している各ブロック画像に対応した各動きベクトルの配置例を示している。すなわち、図中の小四角形領域は、それぞれが前述のブロック画像に対応した動きベクトルのブロック(以下、MVブロック1100とする。)を表している。また、図中斜線が描かれた複数のMVブロック1100がそれぞれ纏まったエリア(以下、MVエリア1101,1102,1103とする。)は、それぞれ異なる移動体画像に対応したMVブロックが纏まったエリアであるとする。そして、これら各MVエリア1101〜1103の各MVブロックの動きベクトルは、それぞれが同じ大きさであるとする。すなわち、各MVエリア1101〜1103の各MVブロックの動きベクトルは、それぞれ同じ大きさであるため、前述の図10では例えば一つの動きベクトル集団1211に含まれているとする。   FIGS. 11 and 12 (a) to 12 (d) correspond to each block image constituting the moving body image when different moving body images exist on a certain frame image. An arrangement example of each motion vector is shown. In other words, each small square area in the drawing represents a motion vector block (hereinafter referred to as an MV block 1100) corresponding to the block image. In addition, areas in which a plurality of MV blocks 1100 with hatched lines are gathered (hereinafter referred to as MV areas 1101, 1102, and 1103) are areas in which MV blocks corresponding to different moving body images are gathered. Suppose there is. The motion vectors of the MV blocks in the MV areas 1101 to 1103 are assumed to have the same size. That is, since the motion vectors of the MV blocks in the MV areas 1101 to 1103 have the same size, it is assumed that they are included in one motion vector group 1211 in FIG.

図12(a)〜図12(d)は、面積算出部410が、図11に示した各MVブロック1100の動きベクトルを、それぞれの何れかのMVエリア1101,1102,1103に分類する過程を説明するための図である。先ず、面積算出部410は、図12(b)に示すように、或るMVブロックを、何れのMVエリアに含まれるかを判定する際の対象MVブロックA1とする。次に、面積算出部410は、図12(b)に示すように、対象MVブロックA1に隣接する8方向の各MVブロックの動きベクトルが、対象MVブロックA1の動きベクトルと略々同じ(方向と大きさが略々同じ動きベクトル)であるか否かを判定する。なお、8方向とは、図12(b)中の矢印で示すように、対象MVブロックA1に対して上、下、左、右、斜め左上、斜め右上、斜め左下、斜め右下の各方向のことである。面積算出部410は、対象MVブロックA1の動きベクトルと略々同じ動きベクトルの隣接MVブロックがあった場合、その隣接MVブロックは対象MVブロックA1と同じMVエリアに含まれるMVブロックA1であると判定する。さらに、面積算出部410は、前述のように対象MVブロックA1と略々同じ動きベクトルのMVブロックであると判定された隣接MVブロックを、新たな対象MVブロックA1として設定し、図12(c)に示すように前述同様の処理を繰り返す。これにより、面積算出部410は、対象MVブロックA1と略々同じ動きベクトルの各隣接MVブロックからなるMVエリアが、同じ移動体画像に対応していると判定できる。図12(d)は、図12(a)の各MVエリア1101〜1103が、MVブロックA1とMVブロックA2とMVブロックA3の動きベクトルごとに分類された後の例を示している。そして、面積算出部410は、前述のようにしてMVブロックA1,A2,A3の動きベクトルごとに分類された各MVエリア1101,1102,1103において、それぞれMVブロックA1,A2,A3の個数を求める。また、これら各MVエリア1101,1102,1103における各MVブロックA1,A2,A3は、それぞれが前述のブロック画像に対応している。このため、面積算出部410は、各MVブロックA1,A2,A3の個数つまりブロック画像の個数N_A1,N_A2,N_A3から、各MVエリア1101〜1103に対応した移動体画像の面積を求めることができる。   12A to 12D show a process in which the area calculation unit 410 classifies the motion vector of each MV block 1100 shown in FIG. 11 into one of the MV areas 1101, 1102, and 1103, respectively. It is a figure for demonstrating. First, as shown in FIG. 12B, the area calculation unit 410 sets a certain MV block as a target MV block A1 when determining which MV area is included. Next, as shown in FIG. 12B, the area calculation unit 410 has the motion vectors of the eight MV blocks adjacent to the target MV block A1 substantially the same as the motion vectors of the target MV block A1 (direction). It is determined whether or not the motion vectors are substantially the same in size. In addition, as shown by the arrows in FIG. 12 (b), the eight directions are upward, downward, left, right, diagonally upper left, diagonally upper right, diagonally lower left, and diagonally lower right with respect to the target MV block A1. That's it. When there is an adjacent MV block having a motion vector substantially the same as the motion vector of the target MV block A1, the area calculation unit 410 determines that the adjacent MV block is an MV block A1 included in the same MV area as the target MV block A1. judge. Furthermore, as described above, the area calculation unit 410 sets an adjacent MV block that is determined to be an MV block having substantially the same motion vector as the target MV block A1 as a new target MV block A1, as shown in FIG. The same processing as described above is repeated as shown in FIG. Thereby, the area calculation part 410 can determine with the MV area which consists of each adjacent MV block of the substantially same motion vector as object MV block A1 corresponding to the same mobile body image. FIG. 12D shows an example after the MV areas 1101 to 1103 in FIG. 12A are classified for each motion vector of the MV block A1, the MV block A2, and the MV block A3. Then, the area calculation unit 410 obtains the number of MV blocks A1, A2, and A3 in each MV area 1101, 1102, and 1103 classified for each motion vector of the MV blocks A1, A2, and A3 as described above. . The MV blocks A1, A2, and A3 in the MV areas 1101, 1102, and 1103 correspond to the block images described above. Therefore, the area calculation unit 410 can obtain the area of the moving object image corresponding to each MV area 1101 to 1103 from the number of each MV block A1, A2, A3, that is, the number of block images N_A1, N_A2, N_A3. .

図2の移動量算出部411は、移動体画像の動きベクトルと、位置合わせ処理後の適フレーム画像と、現像処理後のアンダーフレーム画像とを基に、移動体画像の移動量を算出する。以下、図12(d)に示した各MVエリア1101〜1103の各MVブロックA1〜A3の動きベクトルを例に挙げて説明する。移動量算出部411は、各MVブロックA1の動きベクトルの大きさの平均値M_A1と、各MVブロックA2の動きベクトルの大きさの平均値M_A2と、各MVブロックA3の動きベクトルの大きさの平均値M_A3を算出する。そして、移動量算出部411は、MVブロックA1の動きベクトルの大きさの平均値M_A1を、MVエリア1101に対応した移動体画像の移動量とする。同様に、移動量算出部411は、MVブロックA2の平均値M_A2をMVエリア1102に対応した移動体画像の移動量とし、MVブロックA3の平均値M_A3をMVエリア1103に対応した移動体画像の移動量とする。   The movement amount calculation unit 411 in FIG. 2 calculates the movement amount of the moving body image based on the motion vector of the moving body image, the appropriate frame image after the alignment process, and the underframe image after the development process. Hereinafter, the motion vectors of the MV blocks A1 to A3 in the MV areas 1101 to 1103 shown in FIG. The movement amount calculation unit 411 includes the average value M_A1 of the motion vectors of each MV block A1, the average value M_A2 of the motion vectors of each MV block A2, and the size of the motion vector of each MV block A3. An average value M_A3 is calculated. Then, the movement amount calculation unit 411 uses the average value M_A1 of the motion vectors of the MV block A1 as the movement amount of the moving body image corresponding to the MV area 1101. Similarly, the movement amount calculation unit 411 uses the average value M_A2 of the MV block A2 as the movement amount of the moving object image corresponding to the MV area 1102, and sets the average value M_A3 of the MV block A3 as the moving object image corresponding to the MV area 1103. The amount of movement.

図2の輝度算出部412は、移動体画像の動きベクトルと、位置合わせ処理後の適フレーム画像と、現像処理後のアンダーフレーム画像とを基に、移動体画像の輝度を算出する。以下、図12(d)に示した各MVエリア1101〜1103の各MVブロックA1〜A3に対応したブロック画像の輝度を例に挙げて説明する。輝度算出部412は、各MVブロックA1に対応したブロック画像の輝度の平均値K_A1と、各MVブロックA2に対応したブロック画像の輝度の平均値K_A2と、各MVブロックA3に対応したブロック画像の輝度の平均値K_A3を算出する。そして、輝度算出部412は、各MVブロックA1に対応した各ブロック画像の各輝度の平均値K_A1を、MVエリア1101に対応した移動体画像の輝度とする。また、輝度算出部412は、各MVブロックA2に対応した各ブロック画像の各輝度の平均値K_A2をMVエリア1102に対応した移動体画像の輝度とする。同様に、輝度算出部412は、各MVブロックA3に対応した各ブロック画像の各輝度の平均値K_A3をMVエリア1103に対応した移動体画像の輝度とする。   The luminance calculation unit 412 in FIG. 2 calculates the luminance of the moving object image based on the motion vector of the moving object image, the appropriate frame image after the alignment process, and the underframe image after the development process. Hereinafter, the luminance of the block image corresponding to each MV block A1 to A3 of each MV area 1101 to 1103 shown in FIG. The luminance calculation unit 412 calculates the average luminance K_A1 of the block image corresponding to each MV block A1, the average luminance K_A2 of the block image corresponding to each MV block A2, and the block image corresponding to each MV block A3. An average luminance value K_A3 is calculated. Then, the luminance calculation unit 412 sets the average value K_A1 of each luminance of each block image corresponding to each MV block A1 as the luminance of the moving object image corresponding to the MV area 1101. In addition, the luminance calculation unit 412 sets the average value K_A2 of each luminance of each block image corresponding to each MV block A2 as the luminance of the moving body image corresponding to the MV area 1102. Similarly, the luminance calculation unit 412 sets the average value K_A3 of each luminance of each block image corresponding to each MV block A3 as the luminance of the moving object image corresponding to the MV area 1103.

図2の移動体合成比率算出部413は、位置合わせ処理後の適フレーム画像と、現像処理後のアンダーフレーム画像と、移動体画像の面積と移動量と輝度の情報とに基づいて、移動体合成比率を算出する。図13は、移動体画像に対して移動体合成比率を適用する画像上の範囲を示している。図13の例の場合、移動体画像に対して移動体合成比率が適用される画像上の範囲は、図中の網掛けで示された画像範囲1301,1302,1303である。画像範囲1301は、位置合わせ処理後の適フレームの移動体画像の各ブロック画像において、動きベクトルに対応した移動前のブロック画像と移動後のブロック画像、さらにそれら移動前後の両ブロック画像を線形に繋げることで生成される領域からなる。画像範囲1302、1303についても、画像範囲1301と同様にして生成される。移動体合成比率算出部413は、これらの画像範囲1301〜1303を、移動体合成比率が適用される画像上の範囲とする。   The moving body composition ratio calculation unit 413 in FIG. 2 determines the moving body based on the appropriate frame image after the alignment process, the underframe image after the development process, and the area, moving amount, and luminance information of the moving body image. Calculate the composite ratio. FIG. 13 shows a range on the image to which the moving object synthesis ratio is applied to the moving object image. In the case of the example in FIG. 13, the range on the image to which the moving object synthesis ratio is applied to the moving object image is image ranges 1301, 1302, and 1303 indicated by shading in the drawing. The image range 1301 linearly represents the block image before movement corresponding to the motion vector, the block image after movement, and both the block images before and after the movement in each block image of the moving body image of an appropriate frame after the alignment process. It consists of regions generated by connecting. The image ranges 1302 and 1303 are generated in the same manner as the image range 1301. The moving body composition ratio calculation unit 413 sets these image ranges 1301 to 1303 as ranges on the image to which the moving body composition ratio is applied.

次に、移動体合成比率算出部413は、移動体合成比率を算出するための評価値を算出する。本実施形態において、評価値は、移動体画像の移動量と面積の大きさを評価するための値となっている。前述のMVブロックA1,A2,A3を例に挙げると、移動体合成比率算出部413は、前述の個数N_A1,N_A2,N_A3と平均値M_A2,M_A3,M_A3を用いた式(3)により、それぞれの評価値E_A1,E_A2,E_A3を算出する。   Next, the mobile body composition ratio calculation unit 413 calculates an evaluation value for calculating the mobile body composition ratio. In the present embodiment, the evaluation value is a value for evaluating the moving amount and the area size of the moving object image. Taking the above-mentioned MV blocks A1, A2, A3 as an example, the moving body composition ratio calculation unit 413 uses the above-described number N_A1, N_A2, N_A3 and the average values M_A2, M_A3, M_A3, respectively, according to Equation (3). Evaluation values E_A1, E_A2, and E_A3 are calculated.

E_A1=N_A1×M_A1
E_A2=N_A2×M_A2 ・・・式(3)
E_A3=N_A3×M_A3
E_A1 = N_A1 × M_A1
E_A2 = N_A2 × M_A2 (3)
E_A3 = N_A3 × M_A3

図14は、評価値E_A1,E_A2,E_A3を一般化した評価値を「E」とした場合の、評価値Eと、位置合わせ処理後の適フレーム画像と現像処理後のアンダーフレーム画像の移動体画像における合成量Tとの関係を示す図である。図14のグラフは、横軸が評価値E、縦軸が合成量Tを示しており、第1の評価閾値として「E1」が設定され、第2の評価閾値として[E2]が設定されている。この図14のグラフによれば、評価値Eが「0」から「E1」までの範囲つまり評価値Eが第1の評価閾値以下(E1以下)の場合には合成量Tは第1の合成量である「0.5」で一定となされている。また、評価値Eが「E2」以上つまり第2の評価閾値以上の場合には、合成量Tは「0.5」より小さく「0」より大きい第2の合成量で一定となされている。一方、評価値Eが「E1」から「E2」までの範囲では評価値Eが大きくなるにつれて合成量Tは小さくなる。すなわち、図14の例においては、「E1」から「E2」までの範囲では、評価値Eが大きくなるにつれて適フレーム画像の移動体画像とアンダーフレーム画像の移動体画像における合成量Tが少なくなるように設定されている。ただし、ここで算出した合成量Tの値は、以下のような第1,第2の二通りの合成の割合パターンが考えられる。   FIG. 14 shows a moving body of the evaluation value E, the appropriate frame image after the alignment process, and the underframe image after the development process when the evaluation value obtained by generalizing the evaluation values E_A1, E_A2, and E_A3 is “E”. It is a figure which shows the relationship with the synthetic | combination amount T in an image. In the graph of FIG. 14, the horizontal axis indicates the evaluation value E, and the vertical axis indicates the composite amount T. “E1” is set as the first evaluation threshold, and [E2] is set as the second evaluation threshold. Yes. According to the graph of FIG. 14, when the evaluation value E is in the range from “0” to “E1”, that is, when the evaluation value E is less than or equal to the first evaluation threshold (E1 or less), the composition amount T is the first composition. The quantity is fixed at “0.5”. When the evaluation value E is equal to or greater than “E2”, that is, equal to or greater than the second evaluation threshold, the composite amount T is constant at a second composite amount that is smaller than “0.5” and larger than “0”. On the other hand, when the evaluation value E is in the range from “E1” to “E2”, the composite amount T decreases as the evaluation value E increases. That is, in the example of FIG. 14, in the range from “E1” to “E2”, the amount of synthesis T in the moving body image of the appropriate frame image and the moving body image of the underframe image decreases as the evaluation value E increases. Is set to However, the value of the synthesis amount T calculated here may be the following first and second synthesis ratio patterns.

第1の割合パターン→適フレーム画像:T、アンダーフレーム画像:1−T
第2の割合パターン→適フレーム画像:1−T、アンダーフレーム画像:T
First ratio pattern → appropriate frame image: T, underframe image: 1-T
Second ratio pattern → appropriate frame image: 1-T, underframe image: T

すなわち、適フレーム画像とアンダーフレーム画像の何れを基準にするかにより、第1の割合パターンと第2の割合パターンとで合成量Tの用い方が異なる。本実施形態の場合、移動体合成比率算出部413は、適フレーム画像の移動体画像の輝度とアンダーフレーム画像の移動体画像の輝度に基づいて、適フレーム画像の移動体画像を基準とした移動体合成比率を決定する。具体的には、移動体合成比率算出部413は、適フレーム画像の移動体画像の輝度とアンダーフレーム画像の移動体画像の輝度から、適フレーム画像の使用係数qを求め、その使用係数qと各ブロック画像の合成量Tとを基に最終的な移動体合成比率を算出する。以下、例えばMVブロックA1,A2,A3に対応した合成量T_A1,T_A2,T_A3と、適フレーム画像の使用係数q_A1,q_A2,q_A3を一般化した使用係数qとを用いて説明する。   That is, how to use the composite amount T differs between the first ratio pattern and the second ratio pattern depending on which of the appropriate frame image and the underframe image is used as a reference. In the case of the present embodiment, the moving body composition ratio calculation unit 413 moves based on the moving body image of the appropriate frame image based on the luminance of the moving body image of the appropriate frame image and the luminance of the moving body image of the underframe image. Determine body synthesis ratio. Specifically, the moving body composition ratio calculation unit 413 obtains the use coefficient q of the appropriate frame image from the luminance of the moving body image of the appropriate frame image and the luminance of the moving body image of the underframe image, and uses the use coefficient q. The final moving object composition ratio is calculated based on the composition amount T of each block image. Hereinafter, description will be made using, for example, the synthesis amounts T_A1, T_A2, and T_A3 corresponding to the MV blocks A1, A2, and A3 and the use coefficients q obtained by generalizing the use coefficients q_A1, q_A2, and q_A3 of the appropriate frame images.

図15は、移動体画像のMVブロックA1,A2,A3に対応する各ブロック画像の平均輝度の大きさK_A1,K_A2,K_A3を一般化した平均輝度Kと、適フレーム画像の使用係数qとの関係を示すグラフである。この図15のグラフは、横軸が移動体画像の平均輝度K、縦軸が適フレーム画像の使用係数qを示し、第1の輝度閾値として「K1」、第2の輝度閾値として「K2」が設定されている。この図15のグラフによれば、平均輝度Kが「0」から「K1」の範囲つまり第1の輝度閾値以下(「K1」以下)の場合には、適フレーム画像を基準とする割合が大きくなされる。すなわち、平均輝度Kが「K1」以下の場合には適フレーム画像の使用係数qが「1」となされる。また、平均輝度Kが「K2」以上つまり第2の輝度閾値以上の場合には、アンダーフレーム画像を基準とする割合が大きくなされる。すなわち、平均輝度Kが「K2」以上の場合は適フレーム画像の使用係数qが「0」となされる。一方、平均輝度Kが「K1」から「K2」の範囲では、それら適フレーム画像とアンダーフレーム画像の割合を徐々に変化させるような割合となされる。すなわち、「K1」から「K2」の範囲では、平均輝度Kが高くなるにつれて適フレーム画像の移動体画像の割合を徐々に大きくするような使用係数qが設定される。そして、移動体合成比率算出部413は、この図15のグラフに基づいて使用係数qを求め、その使用係数と合成量Tとを用いた以下の式(4)により、最終的な適フレーム画像の移動体合成比率Dを算出する。   FIG. 15 shows the average luminance K obtained by generalizing the average luminance magnitudes K_A1, K_A2, and K_A3 of the block images corresponding to the MV blocks A1, A2, and A3 of the moving object image, and the use coefficient q of the appropriate frame image. It is a graph which shows a relationship. In the graph of FIG. 15, the horizontal axis indicates the average luminance K of the moving body image, the vertical axis indicates the use coefficient q of the appropriate frame image, “K1” as the first luminance threshold, and “K2” as the second luminance threshold. Is set. According to the graph of FIG. 15, when the average luminance K is in the range of “0” to “K1”, that is, the first luminance threshold or less (“K1” or less), the ratio based on the appropriate frame image is large. Made. That is, when the average luminance K is equal to or lower than “K1”, the use coefficient q of the appropriate frame image is set to “1”. Further, when the average luminance K is “K2” or more, that is, the second luminance threshold or more, the ratio based on the underframe image is increased. That is, when the average luminance K is “K2” or more, the use coefficient q of the appropriate frame image is set to “0”. On the other hand, when the average luminance K is in the range of “K1” to “K2”, the ratio between the appropriate frame image and the underframe image is gradually changed. That is, in the range from “K1” to “K2”, the usage coefficient q is set such that the proportion of the moving body image of the appropriate frame image gradually increases as the average luminance K increases. Then, the moving body composition ratio calculation unit 413 obtains the use coefficient q based on the graph of FIG. 15, and obtains the final appropriate frame image by the following equation (4) using the use coefficient and the composition amount T. Is calculated.

D=T×(1−q)+(1−T)×q ・・・式(4)     D = T × (1-q) + (1-T) × q (4)

図2の合成部414は、位置合わせ処理後の適フレーム画像と、現像処理後のアンダーフレーム画像に対して、移動体画像については移動体合成比率Dに応じた合成を、一方、背景画像に対しては輝度合成比率に応じた合成を行う。すなわち、輝度合成比率を「J」とした場合、合成部414は、以下の式(5)により、各画素ごとに合成画像の算出を行う。   The combining unit 414 in FIG. 2 combines the appropriate frame image after the alignment processing and the underframe image after the development processing according to the moving object combining ratio D for the moving object image, while the background image. On the other hand, the synthesis is performed according to the luminance synthesis ratio. That is, when the luminance composition ratio is “J”, the composition unit 414 calculates a composite image for each pixel by the following equation (5).

背景画像:アンダーフレーム画像×J+適フレーム画像×(1−J)
移動体画像:アンダーフレーム画像×(1−D)+適フレーム画像×D
・・・・式(5)
Background image: Underframe image × J + appropriate frame image × (1-J)
Mobile object image: underframe image × (1-D) + appropriate frame image × D
.... Formula (5)

以上説明したように、本実施形態によれば、動画像に対するHDRの画像合成処理により、移動体画像が合成されてフレームレートが低下することによる動画の滑らかさの劣化を抑えることが実現出来ている。本実施形態ではさらに、移動体画像の面積と移動量と輝度とに基づいて移動体合成比率を制御することにより、不自然な描写の画像合成が行われてしまうことを防ぎ、最適な動画像HDR画像を得ることができる。特に、本実施形態では、例えば移動体画像の移動量が大きい場合や移動体画像の面積が大きい場合のように、移動体画像が目立つ画像である場合に、HDRの合成処理によって移動体画像が不自然な画像として描写されてしまうような画質劣化を低減できる。すなわち、本実施形態によれば、HDRによる画像合成処理の効果を維持しつつ、動画の滑らかさの劣化を抑えるような処理が実現でき、さらに、移動体画像が不自然に見えてしまう描写になるのを防止可能となっている。   As described above, according to the present embodiment, it is possible to suppress the deterioration of the smoothness of the moving image due to the moving body image being combined and the frame rate being lowered by the HDR image combining processing for the moving image. Yes. Further, in the present embodiment, by controlling the moving object composition ratio based on the area, moving amount, and brightness of the moving object image, it is possible to prevent unnatural image composition from being performed, and to optimize the moving image. HDR images can be obtained. In particular, in the present embodiment, when the moving body image is a conspicuous image, for example, when the moving amount of the moving body image is large or the area of the moving body image is large, the moving body image is obtained by the HDR synthesizing process. It is possible to reduce image quality deterioration that is rendered as an unnatural image. That is, according to the present embodiment, it is possible to realize a process that suppresses the deterioration of the smoothness of the moving image while maintaining the effect of the image composition process by HDR, and further, the depiction that the moving body image looks unnatural. Can be prevented.

<第2の実施形態>
次に、第2の実施形態の画像処理装置について以下に説明する。第2の実施形態の画像処理装置は、第1の実施形態と同様に、動画像撮影で交互に撮像された適フレームとアンダーフレームの移動体画像をHDR合成処理する際に、移動体画像の移動量と面積と輝度に基づいて、移動体合成比率を制御する。さらに第2の実施形態では、移動体画像の面積を、それぞれ各移動体画像間で比較し、面積が略々等しい各移動体画像についてはそれぞれ移動体合成比率を近づけるように(略々同じ比率になるように)調整し、その調整後の移動体合成比率で画像合成を行う。第2の実施形態では、面積が同等の移動体画像がそれぞれ近い移動体合成比率による画像合成がなされるため、見た目の違和感が少ないHDR合成画像を生成することが可能となる。
<Second Embodiment>
Next, an image processing apparatus according to the second embodiment will be described below. As in the first embodiment, the image processing apparatus according to the second embodiment performs HDR composition processing on a moving body image of appropriate frames and underframes that are alternately captured by moving image shooting. Based on the moving amount, the area, and the luminance, the moving body synthesis ratio is controlled. Furthermore, in the second embodiment, the areas of the moving body images are compared among the respective moving body images, and the moving body synthesis ratios of the moving body images having substantially the same area are made closer (approximately the same ratio). And adjust the moving object composition ratio after the adjustment. In the second embodiment, since the moving object images having the same area are combined with the moving object combining ratios close to each other, it is possible to generate an HDR combined image with less unnatural appearance.

第2の実施形態の画像処理装置の一例であるカメラの構成は、前述した図1と同じであるため、ここでは説明を省略する。図16には、第2の実施形態におけるHDR処理部4の一構成例を示す。なお、図16に示すHDR処理部4に関しても、大部分は第1の実施形態のHDR処理部4と同じであるため、以下の説明では、第1の実施形態のHDR処理部4とは異なる部分についてのみ説明する。   The configuration of a camera, which is an example of an image processing apparatus according to the second embodiment, is the same as that in FIG. FIG. 16 shows a configuration example of the HDR processing unit 4 in the second embodiment. Note that the HDR processing unit 4 shown in FIG. 16 is mostly the same as the HDR processing unit 4 of the first embodiment, and therefore differs from the HDR processing unit 4 of the first embodiment in the following description. Only the part will be described.

図16に示す第2の実施形態のHDR処理部4において、面積算出部410にて算出された移動体画像の面積の情報は、移動体合成比率算出部413と、同一面積補正部416に送られる。同一面積補正部416は、移動体合成比率算出部413の出力である移動体合成比率と、面積算出部410の出力である移動体画像の面積とに基づいて、移動体合成比率を補正し、その補正済移動体合成比率を合成部414へ送る。   In the HDR processing unit 4 of the second embodiment shown in FIG. 16, the information on the area of the moving object image calculated by the area calculating unit 410 is sent to the moving object composition ratio calculating unit 413 and the same area correcting unit 416. It is done. The same area correction unit 416 corrects the moving object composition ratio based on the moving object composition ratio that is the output of the moving object composition ratio calculation unit 413 and the area of the moving object image that is the output of the area calculation unit 410, The corrected mobile body composition ratio is sent to the composition unit 414.

以下、同一面積補正部416で行われる移動体合成比率の補正処理について更に詳細に説明する。図17は、フレーム画像内に同じ面積を持つ移動体画像が複数存在する場合の一例を示す図である。図17において、図中の網掛けで示された画像範囲1701,1702,1703は、前述同様に動きベクトルに基づいて求められた移動体画像に対して移動体合成比率が適用される画像範囲を示している。なお、図17には、各移動体画像の動きベクトルに対応したMVブロックを表す「A4,A5,A6」も描かれている。これら画像範囲1701,1702,1703にそれぞれ対応した移動体画像の面積は、画像範囲内のMVブロック数により求められる。ここでは、画像範囲1701の移動体画像におけるMVブロックの個数をN_A4、画像範囲1702の移動体画像におけるMVブロックの個数をN_A5、画像範囲1703の移動体画像におけるMVブロックの個数をN_A5とする。図17の例では、それら各MVブロックの個数N_A4,N_A5,N_A6は、それぞれ同じ数(N_A4=N_A5=N_A6)になっているとする。   Hereinafter, the correction process of the moving body composition ratio performed by the same area correction unit 416 will be described in more detail. FIG. 17 is a diagram illustrating an example when a plurality of moving body images having the same area exist in the frame image. In FIG. 17, image ranges 1701, 1702, and 1703 indicated by shading in the figure are image ranges to which the moving object composition ratio is applied to the moving object image obtained based on the motion vector as described above. Show. In FIG. 17, “A4, A5, A6” representing MV blocks corresponding to the motion vectors of the respective moving body images are also drawn. The area of the moving object image corresponding to each of the image ranges 1701, 1702, and 1703 is obtained from the number of MV blocks in the image range. Here, the number of MV blocks in the moving body image in the image range 1701 is N_A4, the number of MV blocks in the moving body image in the image range 1702 is N_A5, and the number of MV blocks in the moving body image in the image range 1703 is N_A5. In the example of FIG. 17, it is assumed that the numbers N_A4, N_A5, and N_A6 of the MV blocks are the same (N_A4 = N_A5 = N_A6).

またこのとき、同一面積補正部416には、移動体合成比率算出部413がMVブロックA4,A5,A6に対応して算出した適フレームの移動体合成比率D_A4、D_A5、D_A6が供給される。同一面積補正部416は、それらMVブロックの個数N_A4,N_A5,N_A6が閾値Lよりも少なく、且つ、それらの個数が等しい(N_A4=N_A5=N_A6)場合、以下の式(6)により補正済移動体合成比率D2を算出する。すなわち、同一面積補正部416は、適フレームの移動体合成比率D_A4、D_A5、D_A6の平均合成比率を補正済移動体合成比率D2として算出する。   At this time, the same area correction unit 416 is supplied with the moving body synthesis ratios D_A4, D_A5, and D_A6 of the appropriate frames calculated by the moving body synthesis ratio calculation unit 413 corresponding to the MV blocks A4, A5, and A6. When the number N_A4, N_A5, N_A6 of these MV blocks is smaller than the threshold value L and the number thereof is equal (N_A4 = N_A5 = N_A6), the same area correction unit 416 performs the corrected movement by the following equation (6). The body synthesis ratio D2 is calculated. That is, the same area correction unit 416 calculates the average composition ratio of the mobile object composition ratios D_A4, D_A5, and D_A6 of the appropriate frame as the corrected mobile object composition ratio D2.

D2=(D_A4+D_A5+D_A6)/3 ・・・式(6)   D2 = (D_A4 + D_A5 + D_A6) / 3 Formula (6)

同一面積補正部416は、以上のような処理により算出した補正済移動体合成比率D2を、合成部414へ送る。合成部414では、画像範囲1701,1702,1703に対応した各移動体画像について、補正済移動体合成比率D2を用いて、前述の第1の実施形態の場合と同様に適フレームとアンダーフレームの移動体画像の合成を行う。   The same area correction unit 416 sends the corrected moving body composition ratio D2 calculated by the above processing to the composition unit 414. The combining unit 414 uses the corrected moving body combining ratio D2 for each moving body image corresponding to the image ranges 1701, 1702, and 1703, and uses the corrected moving body combining ratio D2 in the same manner as in the first embodiment described above. The moving body image is synthesized.

以上説明した第2の実施形態によれば、第1の実施形態の場合と同様な効果を得ることができる。さらに、第2の実施形態においては、移動体画像の面積が閾値Lよりも小さく、且つその面積が略々等しい移動体画像に関しては移動体合成比率が略々同じになるように修正を行うようにしている。これにより、第2の実施形態によれば、面積が同等の移動体画像が、それぞれ近い移動体合成比率により画像合成されるため、見た目の違和感が少ないHDR合成画像を生成することが可能となる。   According to the second embodiment described above, the same effect as that of the first embodiment can be obtained. Furthermore, in the second embodiment, correction is performed so that the moving object composition ratio is approximately the same for moving object images in which the area of the moving object image is smaller than the threshold value L and the area is substantially equal. I have to. As a result, according to the second embodiment, the moving body images having the same area are combined with each other at the moving body combining ratios close to each other, so that it is possible to generate an HDR combined image with less unnatural appearance. .

<第3の実施形態>
次に、第3の実施形態の画像処理装置について以下に説明する。第3の実施形態の画像処理装置は、第1の実施形態と同様に、動画像撮影で交互に撮像された適フレームとアンダーフレームの移動体画像をHDR合成処理する際に、移動体画像の移動量と面積と輝度に基づいて、移動体合成比率を制御する。さらに第3の実施形態では、動きベクトルの情報だけではなく、適フレーム画像とアンダーフレーム画像の差分値に基づいて、移動体合成比率を制御する。すなわち、第3の実施形態では、適フレーム画像とアンダーフレーム画像の移動体画像における画素単位の動きに基づいて、移動体画像に対する移動体合成比率を詳細に算出可能としている。
<Third Embodiment>
Next, an image processing apparatus according to the third embodiment will be described below. As in the first embodiment, the image processing apparatus according to the third embodiment performs HDR composition processing on a moving body image of appropriate frames and underframes alternately captured by moving image shooting. Based on the moving amount, the area, and the luminance, the moving body synthesis ratio is controlled. Furthermore, in the third embodiment, the moving object composition ratio is controlled based on not only the motion vector information but also the difference value between the appropriate frame image and the underframe image. That is, in the third embodiment, it is possible to calculate in detail the moving object composition ratio with respect to the moving object image, based on the movement of the pixel unit in the moving object image of the appropriate frame image and the under frame image.

第3の実施形態の画像処理装置の一例であるカメラの構成は、前述した図1と同じであるため、ここでは説明を省略する。図18には、第3の実施形態におけるHDR処理部4の一構成例を示す。なお、図18に示すHDR処理部4に関しても、大部分は第1の実施形態のHDR処理部4と同じであるため、以下の説明では、第1の実施形態のHDR処理部4とは異なる部分についてのみ説明する。   The configuration of a camera, which is an example of an image processing apparatus according to the third embodiment, is the same as that in FIG. FIG. 18 shows a configuration example of the HDR processing unit 4 in the third embodiment. Note that the HDR processing unit 4 shown in FIG. 18 is mostly the same as the HDR processing unit 4 of the first embodiment, and therefore differs from the HDR processing unit 4 of the first embodiment in the following description. Only the part will be described.

図18に示すHDR処理部4において、輝度差合成比率算出部417は、輝度差検出手段の一例であり、位置合わせ部409の出力である位置合わせ処理後の適フレームの画像データと、現像処理後のアンダーフレームの画像データとが入力される。輝度差合成比率算出部417は、位置合わせ処理後の適フレームの画像データと現像処理後のアンダーフレームの画像データに基づいて、輝度差合成比率を算出する。輝度差合成比率算出部417で算出された輝度差合成比率の情報は、移動体合成比率算出部413へ送られる。移動体合成比率算出部413は、輝度差合成比率に基づいて前述の移動体合成比率Dを補正して、補正済移動体合成比率D3を算出する。   In the HDR processing unit 4 illustrated in FIG. 18, the luminance difference combination ratio calculation unit 417 is an example of a luminance difference detection unit, and the image data of an appropriate frame after the alignment process, which is an output of the alignment unit 409, and the development process The subsequent underframe image data is input. The luminance difference composition ratio calculation unit 417 calculates a luminance difference composition ratio based on the image data of the appropriate frame after the alignment process and the image data of the under frame after the development process. Information on the luminance difference synthesis ratio calculated by the luminance difference synthesis ratio calculation unit 417 is sent to the moving object synthesis ratio calculation unit 413. The moving body composition ratio calculation unit 413 corrects the above-described moving body composition ratio D based on the luminance difference composition ratio and calculates a corrected moving body composition ratio D3.

以下、第3の実施形態における輝度差合成比率算出部417と移動体合成比率算出部413についてさらに詳しく説明する。輝度差合成比率算出部417は、位置合わせ処理後の適フレーム画像と現像処理後のアンダーフレームの画像の各画素の輝度の差分絶対値Pを算出する。図19は、差分絶対値Pと、輝度差合成比率PKの関係をグラフにしたものである。図19のグラフは、横軸が差分絶対値Pを示し、縦軸が輝度差合成比率PKを示し、第1の差閾値として「P1」、第2の差閾値として「P2」が設定されている。この図19の例によれば、差分絶対値Pが0〜P1の範囲つまり第1の差閾値以下(P1以下)の場合には輝度差合成比率PKは第1の比率であるゼロ(0)パーセントとなされる。また、差分絶対値PがP2以上つまり第2の差閾値以上である場合には輝度差合成比率PKは第2の比率である100パーセントとなされる。一方、差分絶対値PがP1〜P2の範囲のときは、輝度差合成比率PKがゼロパーセントから100パーセントに徐々に増加するようになされている。すなわち、差分絶対値PがP1〜P2の範囲である場合、差分絶対値Pが大きくなるにつれてセロパーセントから100パーセントまで変化するような輝度差合成比率PKが画素単位で設定される。移動体合成比率算出部413は、図19のグラフに基づいて求めた輝度差合成比率PKと、第1の実施形態のように算出された移動体合成比率Dとを用いて、各画素について下記式(7)により補正済移動体合成比率D3を算出する。   Hereinafter, the luminance difference composition ratio calculation unit 417 and the moving object composition ratio calculation unit 413 according to the third embodiment will be described in more detail. The luminance difference composition ratio calculation unit 417 calculates the absolute difference value P of the luminance of each pixel of the appropriate frame image after the alignment processing and the underframe image after the development processing. FIG. 19 is a graph showing the relationship between the absolute difference value P and the luminance difference composition ratio PK. In the graph of FIG. 19, the horizontal axis represents the difference absolute value P, the vertical axis represents the luminance difference composition ratio PK, “P1” is set as the first difference threshold, and “P2” is set as the second difference threshold. Yes. According to the example of FIG. 19, when the difference absolute value P is in the range of 0 to P1, that is, the first difference threshold value or less (P1 or less), the luminance difference composition ratio PK is the first ratio of zero (0). Made as a percentage. When the difference absolute value P is equal to or greater than P2, that is, equal to or greater than the second difference threshold, the luminance difference composition ratio PK is set to 100%, which is the second ratio. On the other hand, when the difference absolute value P is in the range of P1 to P2, the luminance difference composition ratio PK is gradually increased from zero percent to 100 percent. That is, when the difference absolute value P is in the range of P1 to P2, a luminance difference composition ratio PK that changes from zero percent to 100 percent as the difference absolute value P increases is set for each pixel. The moving body composition ratio calculation unit 413 uses the luminance difference composition ratio PK calculated based on the graph of FIG. 19 and the moving body composition ratio D calculated as in the first embodiment, for each pixel. The corrected mobile body composition ratio D3 is calculated by the equation (7).

D3=PK×D ・・・式(7)   D3 = PK × D (7)

移動体合成比率算出部413は、以上のようにして算出された補正済移動体合成比率D3を合成部414へ送る。合成部414は、補正済移動体合成比率D3を用いて、画素単位で前述の第1の実施形態の場合と同様に適フレームとアンダーフレームの移動体画像の合成を行う。   The mobile body composition ratio calculation unit 413 sends the corrected mobile body composition ratio D3 calculated as described above to the composition unit 414. The combining unit 414 uses the corrected moving body combining ratio D3 to combine the appropriate frame and underframe moving body images on a pixel-by-pixel basis as in the case of the first embodiment described above.

以上説明した第3の実施形態によれば、第1の実施形態の場合と同様な効果を得ることができる。さらに、第3の実施形態においては、画素単位の移動体画像の動きに基づいて、移動体合成比率を詳細に算出しているため、見た目の違和感が非常に少ない自然な合成画像を生成可能となる。   According to the third embodiment described above, the same effect as in the case of the first embodiment can be obtained. Furthermore, in the third embodiment, since the moving object combining ratio is calculated in detail based on the movement of the moving object image in units of pixels, it is possible to generate a natural combined image with very little visual discomfort. Become.

<第4の実施形態>
前述した第1、第2、第3の実施形態における画像処理装置は、パーソナルコンピュータ等の情報処理装置と、その情報処理装置にて実行されるコンピュータプログラムにより実現することも可能である。以下、第4の実施形態として、パーソナルコンピュータがプログラムを実行して前述した画像合成処理等を実現する場合について説明する。
<Fourth Embodiment>
The image processing apparatuses in the first, second, and third embodiments described above can also be realized by an information processing apparatus such as a personal computer and a computer program executed by the information processing apparatus. Hereinafter, as a fourth embodiment, a case where a personal computer executes a program and realizes the above-described image composition processing and the like will be described.

図20は、第4の実施形態における情報処理装置の概略構成を示す図である。図20において、CPU300は、本実施形態の情報処理装置全体の制御、及び種々の処理を行う中央演算装置である。メモリ301は、いわゆるBIOSやブートプログラムを記憶しているROMと、CPU300がワークエリアとして使用するRAMとで構成されている。指示入力部303は、例えばキーボード、マウスなどのポインティングデバイス、及び、各種スイッチ等により構成されている。外部記憶装置304は、例えばハードディスク装置などであり、本実施形態の情報処理装置の各種制御を実行するオペレーティングシステム(OS)や、前述の第1〜第3の実施形態で説明した各種処理を実行するコンピュータプログラムが記憶されている。また、外部記憶装置304は、各種演算に必要な記憶領域としても使用される。記憶装置305は、例えば動画データを記憶する可搬性記憶媒体(例えばBD−ROMやDVD−ROMディスク等)をアクセスするための装置である。バス302は、コンピュータと外部インタフェースとの間で画像データのやり取りが行われるバスである。デジタルカメラ306は、動画像や静止画像を撮像するためのカメラであり、有線若しくは無線により第4の実施形態の情報処理装置と通信する。また、デジタルカメラ306は、図1の光学系1と撮像素子2と角速度センサ9を有しており、撮影した画像データと角速度センサ9が検出した角速度の情報を情報処理装置へ送信する。ディスプレイ307は、動画像や静止画像、本実施形態においてHDRによる合成処理後の画像等を表示するための表示装置である。通信回線309は、例えば、LAN、公衆回線、無線回線、放送電波で構成されている。通信インタフェース308は、通信回線309を介して画像データ等を送受信する。   FIG. 20 is a diagram illustrating a schematic configuration of an information processing apparatus according to the fourth embodiment. In FIG. 20, a CPU 300 is a central processing unit that controls the entire information processing apparatus according to the present embodiment and performs various processes. The memory 301 includes a ROM that stores a so-called BIOS and a boot program, and a RAM that the CPU 300 uses as a work area. The instruction input unit 303 includes, for example, a pointing device such as a keyboard and a mouse, various switches, and the like. The external storage device 304 is, for example, a hard disk device or the like, and executes an operating system (OS) that executes various controls of the information processing apparatus according to the present embodiment and various processes described in the first to third embodiments. A computer program to be stored is stored. The external storage device 304 is also used as a storage area necessary for various calculations. The storage device 305 is a device for accessing a portable storage medium (for example, a BD-ROM or a DVD-ROM disc) that stores moving image data, for example. A bus 302 is a bus through which image data is exchanged between the computer and an external interface. The digital camera 306 is a camera for capturing a moving image or a still image, and communicates with the information processing apparatus of the fourth embodiment by wire or wireless. The digital camera 306 includes the optical system 1, the image sensor 2, and the angular velocity sensor 9 in FIG. 1, and transmits captured image data and information on the angular velocity detected by the angular velocity sensor 9 to the information processing apparatus. The display 307 is a display device for displaying a moving image, a still image, an image after combining processing by HDR in the present embodiment, and the like. The communication line 309 includes, for example, a LAN, a public line, a wireless line, and a broadcast radio wave. The communication interface 308 transmits and receives image data and the like via the communication line 309.

図20に示した情報処理装置について更に詳細に説明する。先ず、指示入力部303を介したユーザからの電源投入指示に応じて電源が供給されると、CPU300は、メモリ301のROMに格納されているブートプログラムに従って、外部記憶装置304のOSをメモリ301(RAM)にロードする。そして、指示入力部303を介したユーザからの指示に従い、CPU300は、外部記憶装置304からアプリケーションプログラムをメモリ301にロードする。これにより、情報処理装置は、前述の各実施形態で説明した画像処理装置の各機能を実行可能となる。   The information processing apparatus shown in FIG. 20 will be described in more detail. First, when power is supplied in response to a power-on instruction from the user via the instruction input unit 303, the CPU 300 loads the OS of the external storage device 304 into the memory 301 according to a boot program stored in the ROM of the memory 301. (RAM). Then, in accordance with an instruction from the user via the instruction input unit 303, the CPU 300 loads an application program from the external storage device 304 to the memory 301. As a result, the information processing apparatus can execute each function of the image processing apparatus described in the above embodiments.

図21は、そのアプリケーションプログラムがメモリ301にロードされた際の、メモリ301の記憶エリアの一例を示す図である。すなわち、このときのメモリ301には、記憶エリア2101〜2106が用意される。記憶エリア2101は、CPU300が情報処理装置全体を制御し、また、各種ソフトウェアの実行を制御するためのOS(オペレーティングシステム)が展開されるエリアである。記憶エリア2102は、CPU300がHDRの画像合成処理を実行するための映像処理ソフトウェアプログラムが展開されるエリアである。記憶エリア2103は、CPU300がカメラ306を制御して、適フレームとアンダーフレームの画像を交互に撮像させ、それらのフレーム画像を1フレームずつ入力(キャプチャ)するための画像入力ソフトウェアプログラムが展開されるエリアである。記憶エリア2104は、CPU300がディスプレイ307へ表示させる画像データを生成する処理を実行するための映像表示ソフトウェアプログラムが展開されるエリアである。記憶エリア2105は、画像データが格納される画像エリアである。記憶エリア2106は、例えば各種のパラメータ等が格納されるワーキングエリアである。   FIG. 21 is a diagram illustrating an example of a storage area of the memory 301 when the application program is loaded into the memory 301. That is, storage areas 2101 to 2106 are prepared in the memory 301 at this time. A storage area 2101 is an area where an OS (operating system) for controlling the entire information processing apparatus by the CPU 300 and controlling the execution of various software is developed. The storage area 2102 is an area where a video processing software program for the CPU 300 to execute HDR image composition processing is developed. In the storage area 2103, an image input software program for allowing the CPU 300 to control the camera 306 to alternately capture images of appropriate frames and underframes and input (capture) those frame images frame by frame is developed. It is an area. The storage area 2104 is an area where a video display software program for executing processing for generating image data to be displayed on the display 307 by the CPU 300 is developed. A storage area 2105 is an image area in which image data is stored. The storage area 2106 is a working area for storing various parameters, for example.

図22は、CPU300が本実施形態のアプリケーションプログラムを実行して前述した各実施形態の画像処理を行う際のフローチャートである。図22において、CPU300は、先ず、ステップS1の処理として各部の初期化を行う。ステップS1の後、CPU300は、処理をステップS2へ進める。   FIG. 22 is a flowchart when the CPU 300 executes the application program of this embodiment and performs the image processing of each embodiment described above. In FIG. 22, the CPU 300 first initializes each unit as the processing of step S1. After step S1, CPU 300 advances the process to step S2.

ステップS2では、CPU300は、アプリケーションプログラムを終了させるか否かの判定を行う。このステップS2における終了判定は、ユーザが指示入力部303を介して終了指示を入力したか否かに基づいて行われる。すなわちCPU300は、ステップS2において、指示入力部303を介してユーザから終了指示が入力されたと判定した場合にはこのフローチャートの処理を終了する。一方、CPU300は、ステップS2において、指示入力部303を介してユーザから終了指示が入力されていないと判定した場合には処理をステップS3へ進める。   In step S2, CPU 300 determines whether or not to end the application program. The end determination in step S <b> 2 is performed based on whether or not the user inputs an end instruction via the instruction input unit 303. That is, if it is determined in step S2 that an end instruction has been input from the user via the instruction input unit 303, the CPU 300 ends the process of this flowchart. On the other hand, if the CPU 300 determines in step S2 that an end instruction has not been input from the user via the instruction input unit 303, the process proceeds to step S3.

ステップS3では、CPU300は、カメラ306にて撮像されたフレーム単位の画像データを、メモリ301の記憶エリア2105のうちの画像エリアに格納させる。ステップS3の後、CPU300は、処理をステップS4へ進める。ステップS4では、CPU300は、前述の実施形態で説明したようなHDRの画像合成処理等の各種画像処理を実行する。ステップS4の後、CPU300は、処理をステップS2へ戻す。   In step S <b> 3, the CPU 300 stores the frame-unit image data captured by the camera 306 in the image area in the storage area 2105 of the memory 301. After step S3, CPU 300 advances the process to step S4. In step S4, the CPU 300 executes various types of image processing such as HDR image composition processing as described in the above embodiment. After step S4, the CPU 300 returns the process to step S2.

図23には、図22のステップS4の画像処理を更に詳細に示すフローチャートである。CPU300は、先ずステップS401の処理として、記憶装置305に記憶されている画像データのなかの少なくとも時間的に連続した適フレームとアンダーフレームの2フレームの画像データと、角速度等のパラメータを、メモリ301に記憶させる。ステップS401の後、CPU300は、処理をステップS402へ進める。   FIG. 23 is a flowchart showing in more detail the image processing in step S4 of FIG. First, as a process of step S401, the CPU 300 stores, in the memory 301, parameters such as two frames of image data of an appropriate frame and an underframe that are continuous in time among the image data stored in the storage device 305, and angular velocity. Remember me. After step S401, the CPU 300 advances the process to step S402.

ステップS402では、CPU300は、メモリ301に記憶された2フレームの画像データを、前述したように、それぞれの明るさに合うように現像処理する。ステップS402の後、CPU300は、処理をステップS403へ進める。ステップS403では、CPU300は、アンダーフレームに対する輝度合成比率を算出する。ステップS403の後、CPU300は、処理をステップS404へ進める。   In step S402, the CPU 300 develops the two frames of image data stored in the memory 301 so as to match the respective brightness as described above. After step S402, CPU 300 advances the process to step S403. In step S403, the CPU 300 calculates a luminance synthesis ratio with respect to the underframe. After step S403, the CPU 300 advances the process to step S404.

ステップS404では、CPU300は、適フレーム画像とアンダーフレーム画像の間の動きベクトルを算出する。ステップS404の後、CPU300は、処理をステップS405へ進める。ステップS405では、CPU300は、動きベクトルと角速度を用いて、移動体画像と背景画像を分離する。ステップS405の後、CPU300は、処理をステップS406へ進める。   In step S404, the CPU 300 calculates a motion vector between the appropriate frame image and the underframe image. After step S404, CPU 300 advances the process to step S405. In step S405, the CPU 300 separates the moving body image and the background image using the motion vector and the angular velocity. After step S405, CPU 300 advances the process to step S406.

ステップS406では、CPU300は、動きベクトルを用いて適フレームの背景画像をアンダーフレームの背景画像に対して位置合わせする。ステップS406の後、CPU300は、処理をステップS407へ進める。   In step S406, the CPU 300 aligns the background image of the appropriate frame with the background image of the underframe using the motion vector. After step S406, CPU 300 advances the process to step S407.

ステップS407では、CPU300は、動きベクトルを用いて移動体画像の面積を算出する。ステップS407の後、CPU300は、処理をステップS408へ進める。ステップS408では、CPU300は、動きベクトルを用いて移動体画像の移動量を算出する。ステップS408の後、CPU300は、処理をステップS409へ進める。ステップS409では、CPU300は、動きベクトルを用いて移動体画像の輝度を算出する。ステップS409の後、CPU300は、処理をステップS410へ進める。   In step S407, the CPU 300 calculates the area of the moving object image using the motion vector. After step S407, CPU 300 advances the process to step S408. In step S408, the CPU 300 calculates the moving amount of the moving body image using the motion vector. After step S408, CPU 300 advances the process to step S409. In step S409, the CPU 300 calculates the luminance of the moving object image using the motion vector. After step S409, CPU 300 advances the process to step S410.

ステップS410では、CPU300は、移動体画像の面積と移動量と輝度とに基づいて、移動体合成比率を算出する。ステップS410の後、CPU300は、処理をステップS411へ進める。ステップS411では、CPU300は、輝度合成比率と移動体合成比率とを用いて、適フレームとアンダーフレームの画像の合成処理を行い、その合成処理後のフレーム画像データをメモリ301に格納させる。   In step S410, the CPU 300 calculates a moving body composition ratio based on the area, moving amount, and luminance of the moving body image. After step S410, CPU 300 advances the process to step S411. In step S <b> 411, the CPU 300 uses the luminance composition ratio and the moving object composition ratio to perform composition processing of the appropriate frame and underframe images, and stores the frame image data after the composition processing in the memory 301.

以上説明したように、第4の実施形態によれば、パーソナルコンピュータ等の情報処理装置において、前述した第1〜第3の各実施形態と同等の画像合成処理を実現できる。なお、コンピュータプログラムは、通常はコンピュータ可読装置に格納されており、これをコンピュータが有する読み取り装置にセットし、内部のメモリ等にコピー若しくはインストールすることで実行可能である。したがって、このようなコンピュータ可読記憶媒体が本実施形態の範疇に入ることは言うまでもない。   As described above, according to the fourth embodiment, in the information processing apparatus such as a personal computer, it is possible to realize an image composition process equivalent to each of the first to third embodiments described above. The computer program is normally stored in a computer readable device, and can be executed by setting it in a reading device of the computer and copying or installing it in an internal memory or the like. Therefore, it goes without saying that such a computer-readable storage medium falls within the category of this embodiment.

また、上述した実施形態の1以上の機能を実現するプログラムは、ネットワーク又は記憶媒体を介してシステム又は装置に供給されてもよい。そして、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーが、プログラムを読出して実行する。その他、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。   In addition, a program that realizes one or more functions of the above-described embodiments may be supplied to a system or an apparatus via a network or a storage medium. One or more processors in the computer of the system or apparatus read and execute the program. In addition, it can be realized by a circuit (for example, ASIC) that realizes one or more functions.

上述の実施形態は、何れも本発明を実施するにあたっての具体化の例を示したものに過ぎず、これらによって本発明の技術的範囲が限定的に解釈されてはならないものである。即ち、本発明は、その技術思想、又はその主要な特徴から逸脱することなく、様々な形で実施することができる。   The above-described embodiments are merely examples of implementation in carrying out the present invention, and the technical scope of the present invention should not be construed as being limited thereto. That is, the present invention can be implemented in various forms without departing from the technical idea or the main features thereof.

前述した実施形態では、HDRによる画像合成処理を例に挙げたが、その他にも、例えば、フォーカス方向の合焦距離を異ならせた複数のフレーム画像の合成処理や、色味を異ならせた複数フレームの合成処理など、様々な画像合成処理にも適用可能である。   In the above-described embodiment, HDR image synthesis processing is taken as an example, but in addition, for example, a plurality of frame images with different focus distances in the focus direction, or a plurality of colors with different colors. The present invention can also be applied to various image composition processing such as frame composition processing.

1 光学系、2 撮像素子、3 信号処理部、4 HDR処理部、5 調整処理部、6 符号化処理部、7 出力部、8 UI部、9 角速度センサ、404,405 現像部、406 輝度合成比率算出部、407 動きベクトル算出部、408 背景分離部、409 位置合わせ部、410 面積算出部、411 移動量算出部、412 輝度算出部、413 移動体合成比率算出部、414 合成部、416 同一面積補正部、417 輝度差合成比率算出部   DESCRIPTION OF SYMBOLS 1 Optical system, 2 Image pick-up element, 3 Signal processing part, 4 HDR processing part, 5 Adjustment processing part, 6 Coding process part, 7 Output part, 8 UI part, 9 Angular velocity sensor, 404,405 Development part, 406 Luminance composition Ratio calculation unit, 407 Motion vector calculation unit, 408 Background separation unit, 409 Position adjustment unit, 410 Area calculation unit, 411 Movement amount calculation unit, 412 Luminance calculation unit, 413 Mobile body composition ratio calculation unit, 414 Composition unit, 416 Identical Area correction unit, 417 Luminance difference composite ratio calculation unit

Claims (13)

動画撮影による第1のフレーム画像と第2のフレーム画像の少なくとも二つのフレーム画像から、前記第1のフレーム画像の撮影と前記第2のフレーム画像の撮影がなされた間に被写体位置が変化した被写体画像を移動体画像として検出する移動体検出手段と、
前記第1のフレーム画像と前記第2のフレーム画像から、前記第1のフレーム画像の撮影と前記第2のフレーム画像の撮影がなされた間の前記移動体画像の移動量を求める移動量検出手段と、
前記移動体画像の面積を求める面積検出手段と、
前記第1のフレーム画像と前記第2のフレーム画像を合成する合成手段と、
前記移動体画像の前記移動量と前記面積に基づいて、前記合成手段により前記第1のフレーム画像と前記第2のフレーム画像が合成される際の、前記第1のフレーム画像の前記移動体画像と前記第2のフレーム画像の前記移動体画像との合成比率を制御する制御手段とを有する
ことを特徴とする画像処理装置。
A subject whose subject position has changed between the shooting of the first frame image and the shooting of the second frame image from at least two frame images of the first frame image and the second frame image by moving image shooting Moving body detecting means for detecting an image as a moving body image;
From the first frame image and the second frame image, a moving amount detection means for obtaining a moving amount of the moving body image during the shooting of the first frame image and the shooting of the second frame image. When,
Area detecting means for determining the area of the moving object image;
Combining means for combining the first frame image and the second frame image;
The moving body image of the first frame image when the first frame image and the second frame image are combined by the combining unit based on the moving amount and the area of the moving body image. And a control means for controlling a synthesis ratio of the second frame image and the moving body image.
前記第1のフレーム画像は第1の露光量で撮影されたフレーム画像であり、前記第2のフレーム画像は前記第1の露光量より少ない露光量である第2の露光量で撮影されたフレーム画像であることを特徴とする請求項1に記載の画像処理装置。   The first frame image is a frame image taken with a first exposure amount, and the second frame image is a frame taken with a second exposure amount that is smaller than the first exposure amount. The image processing apparatus according to claim 1, wherein the image processing apparatus is an image. 前記制御手段は、前記移動体画像の前記移動量と前記面積の大きさを表す評価値を求め、前記評価値が大きくなるにつれて、前記第1のフレーム画像の前記移動体画像の合成量が少なくなるように前記合成比率を制御することを特徴とする請求項2に記載の画像処理装置。   The control means obtains an evaluation value representing the amount of movement and the size of the area of the moving body image, and the amount of synthesis of the moving body image of the first frame image decreases as the evaluation value increases. The image processing apparatus according to claim 2, wherein the composition ratio is controlled to be 前記制御手段は、
前記評価値が第1の評価閾値以下の場合には前記合成量を第1の合成量で一定となるように前記合成比率を制御し、
前記評価値が前記第1の評価閾値より大きい第2の評価閾値以上の場合には前記合成量を前記第1の合成量より小さい第2の合成量で一定となるように前記合成比率を制御し、
前記評価値が前記第1の評価閾値と前記第2の評価閾値との間の場合には前記評価値が大きくなるにつれて前記合成量を前記第1の合成量から前記第2の合成量へ少なくなるように前記合成比率を制御することを特徴とする請求項3に記載の画像処理装置。
The control means includes
When the evaluation value is equal to or less than a first evaluation threshold, the synthesis ratio is controlled so that the synthesis amount is constant at the first synthesis amount;
When the evaluation value is greater than or equal to a second evaluation threshold greater than the first evaluation threshold, the synthesis ratio is controlled so that the synthesis amount is constant at a second synthesis amount smaller than the first synthesis amount. And
When the evaluation value is between the first evaluation threshold and the second evaluation threshold, the amount of synthesis decreases from the first synthesis amount to the second synthesis amount as the evaluation value increases. The image processing apparatus according to claim 3, wherein the composition ratio is controlled to be
前記第1のフレーム画像の前記移動体画像の輝度と前記第2のフレーム画像の前記移動体画像の輝度を検出する輝度検出手段を有し、
前記制御手段は、前記輝度検出手段により検出された前記第1のフレーム画像の前記移動体画像の輝度と前記第2のフレーム画像の前記移動体画像の輝度に基づいて、前記第1のフレーム画像の前記移動体画像を基準とした前記合成比率を決定する請求項3又は4に記載の画像処理装置。
Brightness detecting means for detecting the brightness of the moving body image of the first frame image and the brightness of the moving body image of the second frame image;
The control means is configured to determine the first frame image based on the luminance of the moving body image of the first frame image detected by the luminance detecting means and the luminance of the moving body image of the second frame image. The image processing apparatus according to claim 3, wherein the composition ratio based on the moving body image is determined.
前記輝度検出手段は、前記第1のフレーム画像の前記移動体画像と前記第2のフレーム画像の前記移動体画像の平均輝度を求め、
前記制御手段は、
前記平均輝度が第1の輝度閾値以下である場合には前記第1のフレーム画像の前記移動体画像の割合を大きくする係数を設定し、
前記平均輝度が前記第1の輝度閾値より高い第2の輝度閾値以上である場合には前記第2のフレーム画像の前記移動体画像の割合を大きくする前記係数を設定し、
前記平均輝度が前記第1の輝度閾値と前記第2の輝度閾値の間である場合には前記平均輝度が低くなるにつれて前記第1のフレーム画像の前記移動体画像の割合を大きくする前記係数を設定し、
前記係数と前記合成量とに基づいて、前記第1のフレーム画像の前記移動体画像を基準とした前記合成比率を決定する請求項5に記載の画像処理装置。
The luminance detection means obtains an average luminance of the moving body image of the first frame image and the moving body image of the second frame image;
The control means includes
If the average luminance is less than or equal to a first luminance threshold, set a coefficient to increase the proportion of the moving body image of the first frame image,
When the average luminance is equal to or higher than a second luminance threshold higher than the first luminance threshold, the coefficient for increasing the ratio of the moving body image in the second frame image is set.
When the average luminance is between the first luminance threshold and the second luminance threshold, the coefficient that increases the ratio of the moving body image in the first frame image as the average luminance decreases. Set,
The image processing apparatus according to claim 5, wherein the composition ratio based on the moving body image of the first frame image is determined based on the coefficient and the composition amount.
前記制御手段は、前記第1のフレーム画像の前記移動体画像と、前記第2のフレーム画像の前記移動体画像と、前記第1のフレーム画像の前記移動体画像と前記第2のフレーム画像の前記移動体画像を線形に繋げた際の領域と、からなる画像範囲を、前記合成比率による合成がなされる移動体画像の範囲とすることを特徴とする請求項1〜6のいずれか1項に記載の画像処理装置。   The control means includes the moving body image of the first frame image, the moving body image of the second frame image, the moving body image of the first frame image, and the second frame image. The range of an image formed by linearly connecting the moving body images is set as a range of a moving body image to be combined by the combining ratio. An image processing apparatus according to 1. 前記移動体検出手段は、複数の移動体画像を検出し、
前記面積検出手段は、前記複数の移動体画像のそれぞれの面積を検出し、
前記制御手段は、前記複数の移動体画像についてそれぞれ前記合成比率を制御するとともに、前記複数の移動体画像のうち前記面積が略々等しい各移動体画像の合成比率については略々同じ合成比率となるように制御することを特徴とする請求項1〜7のいずれか1項に記載の画像処理装置。
The moving body detecting means detects a plurality of moving body images,
The area detecting means detects each area of the plurality of moving body images,
The control means controls the composition ratio for each of the plurality of moving body images, and the composition ratio of each of the plurality of moving body images having substantially the same area is substantially the same. It controls so that it may become. The image processing apparatus of any one of Claims 1-7 characterized by the above-mentioned.
前記制御手段は、前記面積が略々等しい各移動体画像の前記合成比率から平均合成比率を求め、前記平均合成比率を前記面積が略々等しい各移動体画像の前記合成比率とすることを特徴とする請求項8に記載の画像処理装置。   The control means obtains an average composition ratio from the composition ratio of each mobile object image having substantially the same area, and uses the average composition ratio as the composition ratio of each mobile object image having substantially the same area. The image processing apparatus according to claim 8. 前記第1のフレーム画像の前記移動体画像と前記第2のフレーム画像の前記移動体画像の画素単位の輝度差を求める輝度差検出手段を有し、
前記制御手段は、前記画素単位の輝度差に基づいて、前記移動体画像の画素単位で前記合成比率を制御することを特徴とする請求項2〜9のいずれか1項に記載の画像処理装置。
A luminance difference detecting means for obtaining a luminance difference in pixel units between the moving body image of the first frame image and the moving body image of the second frame image;
The image processing apparatus according to claim 2, wherein the control unit controls the synthesis ratio in units of pixels of the moving body image based on a luminance difference in units of pixels. .
前記輝度差検出手段は、
前記画素単位の輝度差が第1の差閾値以下である場合には第1の比率となる輝度差合成比率を画素単位で設定し、
前記画素単位の輝度差が前記第1の差閾値より大きい第2の差閾値以上である場合には前記第1の比率より大きい第2の比率となる輝度差合成比率を画素単位で設定し、
前記画素単位の輝度差が前記第1の差閾値と前記第2の差閾値の間である場合には前記画素単位の輝度差が大きくなるにつれて前記比率が前記第1の比率から前記第2の比率に変化するような輝度差合成比率を画素単位で設定し、
前記制御手段は、前記画素単位の輝度差合成比率により、前記第1のフレーム画像の前記移動体画像を基準とした前記合成比率を画素単位で補正することを特徴とする請求項10に記載の画像処理装置。
The brightness difference detecting means includes
If the luminance difference in pixel units is less than or equal to the first difference threshold, a luminance difference synthesis ratio that is the first ratio is set in pixel units,
If the luminance difference in pixel units is equal to or greater than a second difference threshold value that is greater than the first difference threshold value, a luminance difference composition ratio that is a second ratio that is greater than the first ratio is set in pixel units;
When the luminance difference of the pixel unit is between the first difference threshold and the second difference threshold, the ratio is increased from the first ratio to the second difference as the luminance difference of the pixel unit increases. Set the luminance difference composition ratio that changes to the ratio in pixel units,
The said control means correct | amends the said composition ratio on the basis of the said moving body image of the said 1st frame image by a pixel unit by the brightness | luminance difference composition ratio of the said pixel unit. Image processing device.
移動体検出手段が、動画撮影による第1のフレーム画像と第2のフレーム画像の少なくとも二つのフレーム画像から、前記第1のフレーム画像の撮影と前記第2のフレーム画像の撮影がなされた間に被写体位置が変化した被写体画像を移動体画像として検出するステップと、
移動量検出手段が、前記第1のフレーム画像と前記第2のフレーム画像から、前記第1のフレーム画像の撮影と前記第2のフレーム画像の撮影がなされた間の前記移動体画像の移動量を求めるステップと、
面積検出手段が、前記移動体画像の面積を求めるステップと、
合成手段が、前記第1のフレーム画像と前記第2のフレーム画像を合成するステップと、
制御手段が、前記移動体画像の前記移動量と前記面積に基づいて、前記合成手段により前記第1のフレーム画像と前記第2のフレーム画像が合成される際の、前記第1のフレーム画像の前記移動体画像と前記第2のフレーム画像の前記移動体画像との合成比率を制御するステップと
を含むことを特徴とする画像処理方法。
The moving body detecting means is configured to capture the first frame image and the second frame image from at least two frame images of the first frame image and the second frame image obtained by moving image shooting. Detecting a subject image whose subject position has changed as a moving body image;
The moving amount detection means moves the moving body image from the first frame image and the second frame image during the shooting of the first frame image and the shooting of the second frame image. A step of seeking
An area detecting means for determining an area of the moving object image;
Combining means for combining the first frame image and the second frame image;
Based on the amount of movement and the area of the moving body image, the control unit is configured to display the first frame image when the first frame image and the second frame image are combined by the combining unit. And a step of controlling a composition ratio of the moving body image and the moving body image of the second frame image.
コンピュータを、請求項1〜11のいずれか1項に記載の画像処理装置の各手段として機能させるためのプログラム。   The program for functioning a computer as each means of the image processing apparatus of any one of Claims 1-11.
JP2015083468A 2015-04-15 2015-04-15 Image processing apparatus, image processing method, and program Expired - Fee Related JP6494388B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015083468A JP6494388B2 (en) 2015-04-15 2015-04-15 Image processing apparatus, image processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015083468A JP6494388B2 (en) 2015-04-15 2015-04-15 Image processing apparatus, image processing method, and program

Publications (2)

Publication Number Publication Date
JP2016208083A JP2016208083A (en) 2016-12-08
JP6494388B2 true JP6494388B2 (en) 2019-04-03

Family

ID=57490377

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015083468A Expired - Fee Related JP6494388B2 (en) 2015-04-15 2015-04-15 Image processing apparatus, image processing method, and program

Country Status (1)

Country Link
JP (1) JP6494388B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114387248B (en) * 2022-01-12 2022-11-25 苏州天准科技股份有限公司 Silicon material melting degree monitoring method, storage medium, terminal and crystal pulling equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5820213B2 (en) * 2011-09-26 2015-11-24 キヤノン株式会社 Image processing apparatus and method, and imaging apparatus
JP5713885B2 (en) * 2011-12-26 2015-05-07 キヤノン株式会社 Image processing apparatus, image processing method, program, and storage medium
JP6046966B2 (en) * 2012-04-19 2016-12-21 キヤノン株式会社 Image processing apparatus, image processing method, program, and storage medium

Also Published As

Publication number Publication date
JP2016208083A (en) 2016-12-08

Similar Documents

Publication Publication Date Title
US9646397B2 (en) Image processing apparatus and image processing method
JP5713752B2 (en) Image processing apparatus and control method thereof
TWI602152B (en) Image capturing device nd image processing method thereof
JP5767485B2 (en) Image processing apparatus and control method
JP2021114696A (en) Image processing device, image processing method and program
CN113313661A (en) Image fusion method and device, electronic equipment and computer readable storage medium
JP2015201842A (en) Image processing system and control method and control program of the same
JP2015144475A (en) Imaging apparatus, control method of the same, program and storage medium
JP2022179514A (en) Control apparatus, imaging apparatus, control method, and program
JP5882702B2 (en) Imaging device
JP6887853B2 (en) Imaging device, its control method, program
JP6541501B2 (en) IMAGE PROCESSING APPARATUS, IMAGING APPARATUS, AND IMAGE PROCESSING METHOD
JP7057079B2 (en) Image processing device, image pickup device, image processing method, and program
JP2011171842A (en) Image processor and image processing program
JP5911340B2 (en) Imaging apparatus and control method thereof
JP6494388B2 (en) Image processing apparatus, image processing method, and program
JP5952574B2 (en) Image processing apparatus and control method thereof
JP2019016893A (en) Image processing apparatus, control method therefor, and program
JP2023090492A (en) Image processing device, image processing method, and imaging apparatus
JP2018128764A (en) Image processing device, image processing method and program
JP2022086311A (en) Imaging apparatus, control method of imaging apparatus, and program
JP5952573B2 (en) Image processing apparatus and control method thereof
JP6603557B2 (en) Image processing apparatus and image processing method
JP5541956B2 (en) Image composition method, image composition program, and image composition apparatus
JP2016208118A (en) Image processing apparatus, image processing method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180405

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190118

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190305

R151 Written notification of patent or utility model registration

Ref document number: 6494388

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees