JP6261205B2 - Image processing device - Google Patents

Image processing device Download PDF

Info

Publication number
JP6261205B2
JP6261205B2 JP2013136922A JP2013136922A JP6261205B2 JP 6261205 B2 JP6261205 B2 JP 6261205B2 JP 2013136922 A JP2013136922 A JP 2013136922A JP 2013136922 A JP2013136922 A JP 2013136922A JP 6261205 B2 JP6261205 B2 JP 6261205B2
Authority
JP
Japan
Prior art keywords
image
images
main subject
amount
background
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
JP2013136922A
Other languages
Japanese (ja)
Other versions
JP2015012481A5 (en
JP2015012481A (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 JP2013136922A priority Critical patent/JP6261205B2/en
Priority to US14/286,848 priority patent/US9432575B2/en
Publication of JP2015012481A publication Critical patent/JP2015012481A/en
Publication of JP2015012481A5 publication Critical patent/JP2015012481A5/ja
Application granted granted Critical
Publication of JP6261205B2 publication Critical patent/JP6261205B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

本発明は、画像処理装置に関し、特に画像合成を用いた流し撮りにおける流し量の調節に関するものである。   The present invention relates to an image processing apparatus, and more particularly to adjustment of a flow amount in panning using image composition.

移動している被写体のスピード感を表現する撮影技術として流し撮りがある。前記撮影技術は、撮影者が被写体の動きに合わせてカメラをパンニングすることにより、移動している被写体を撮影画像内では静止させて背景は流れるように写すことを目的とする。一般的な流し撮りは、撮影したい被写体(主被写体)の移動速度に合わせてシャッター速度を通常より遅めに調節することで撮影を行う。しかしながら、シャッター速度を遅くしているため、手ぶれや主被写体の移動速度とパンニング速度の差の影響により、主被写体までぶれた画像になることも多い。前記問題を鑑み、画像処理技術による流し撮りの容易化が望まれている。   There is panning as a shooting technique that expresses the speed of moving subjects. The purpose of the photographing technique is to make the photographer pan the camera in accordance with the movement of the subject so that the moving subject is stopped in the photographed image and the background flows. In general panning, shooting is performed by adjusting the shutter speed slower than usual in accordance with the moving speed of the subject (main subject) to be shot. However, since the shutter speed is slow, the main subject is often blurred due to camera shake or the difference between the moving speed of the main subject and the panning speed. In view of the above problem, facilitation of panning using an image processing technique is desired.

例えば、特許文献1では、相対的に低感度な画像と高感度な画像を撮影し、相対的に高感度な画像のうち、主被写体領域に対応する部分画像と、相対的に低感度な画像を合成する撮像装置が開示されている。特許文献2では、撮像領域中に主被写体領域を設定し、設定された主被写体領域とは異なる領域、すなわち、背景領域で1回の露光が行われる間に、主被写体領域で複数回の露光を行う。そして、各露光に対して取得された画像を合成する撮像装置が開示されている。   For example, in Patent Document 1, a relatively low-sensitivity image and a high-sensitivity image are taken, and among the relatively high-sensitivity images, a partial image corresponding to the main subject region and a relatively low-sensitivity image An imaging device that synthesizes is disclosed. In Patent Document 2, a main subject region is set in an imaging region, and a plurality of exposures are performed in the main subject region while one exposure is performed in a region different from the set main subject region, that is, in the background region. I do. And the imaging device which synthesize | combines the image acquired with respect to each exposure is disclosed.

特開2012−094984号公報JP 2012-094984 A 特開2010−166304号公報JP 2010-166304 A

しかしながら、上述の特許文献1に開示された従来技術では、背景の流れを1枚の画像で表現しているため、主被写体をきちんと追従できていない場合は、高感度画像の主被写体領域を合成しても、その周囲に低感度画像の主被写体が残ってしまう可能性がある。また、主被写体と背景を異なるタイミングで撮影しているため、2画像間における主被写体の形が変化し、主被写体領域が正確に重ならない可能性もある。   However, in the conventional technique disclosed in Patent Document 1 described above, the background flow is expressed by a single image. Therefore, if the main subject cannot be tracked properly, the main subject region of the high-sensitivity image is synthesized. Even so, there is a possibility that the main subject of the low-sensitivity image remains in the vicinity. In addition, since the main subject and the background are photographed at different timings, the shape of the main subject between the two images changes, and the main subject region may not overlap exactly.

特許文献2に開示された従来技術でも、主被写体領域を予め設定し、背景の流れを1枚の画像で表現している。このため、撮影中、主被写体が主被写体領域外に出てしまった場合や、主被写体領域に背景が入り込んでしまった場合は、主被写体と背景の境界が不自然になる可能性がある。   In the prior art disclosed in Patent Document 2, the main subject area is set in advance, and the background flow is expressed by a single image. For this reason, if the main subject goes out of the main subject area during shooting, or if the background enters the main subject area, the boundary between the main subject and the background may become unnatural.

そこで、本発明の目的は、主被写体と背景の境界を滑らかにすることを可能にした流し撮り風の画像を生成できる画像処理装置及び画像処理方法を提供することである。   SUMMARY OF THE INVENTION Accordingly, an object of the present invention is to provide an image processing apparatus and an image processing method capable of generating a panning-like image that can smooth the boundary between a main subject and a background.

上記目的を達成するために、本発明は、撮像手段により撮像される複数の画像について主被写体領域と前記主被写体領域とは異なる背景領域を特定する特定手段と、前記複数の画像の前記主被写体領域を位置合わせし、前記背景領域にローパスフィルタを適用して所定のぼかし処理を加えた合成画像を生成する合成手段と、前記複数の画像について、前記背景領域の画像または前記撮像手段の振れの情報に基づいて、前記複数の画像間での前記背景領域の移動量を検出する検出手段と、前記検出手段により検出される前記複数の画像間での前記背景領域の移動量に基づき前記ぼかし処理におけるぼかし量を制御する制御手段と、を有し、前記制御手段は、前記ローパスフィルタのタップ数を前記ぼかし量に対応させて制御するとともに、前記ローパスフィルタのタップ内の係数を前記合成画像の領域に応じて制御することを特徴とする。 In order to achieve the above object, the present invention provides a specifying means for specifying a main subject area and a background area different from the main subject area for a plurality of images captured by an imaging means, and the main subject of the plurality of images. A combination unit that aligns the regions and generates a combined image obtained by applying a low-pass filter to the background region and applying a predetermined blurring process; and for the plurality of images, the image of the background region or the shake of the imaging unit Detection means for detecting a movement amount of the background region between the plurality of images based on the information; and the blurring process based on the movement amount of the background region between the plurality of images detected by the detection unit. together possess control means for controlling the amount of blur, and said control means controls the number of taps of said low-pass filter so as to correspond to the blurring amount in the And controlling in response the coefficients in the taps of-pass filter in the region of the composite image.

本発明によれば、主被写体と背景の境界を滑らかにすることを可能にした流し撮り風の画像を生成できる。   According to the present invention, it is possible to generate a panning-like image that can smooth the boundary between the main subject and the background.

本発明の実施形態1、2にかかわる撮像装置の基本構成図。1 is a basic configuration diagram of an imaging apparatus according to first and second embodiments of the present invention. 本発明の実施形態1、2にかかわるCPUの処理のフローチャート。The flowchart of the process of CPU concerning Embodiment 1, 2 of this invention. 本発明の実施形態1にかかわる流し撮り合成のフローチャート。3 is a flowchart of panning composition relating to the first embodiment of the present invention. 本発明の実施形態1にかかわるLPFのタップ数の算出の第1の説明図。FIG. 3 is a first explanatory diagram of calculation of the number of taps of LPF according to the first embodiment of the present invention. 本発明の実施形態1にかかわるLPFのタップ数の算出の第2の説明図。FIG. 5 is a second explanatory diagram for calculating the number of taps of the LPF according to the first embodiment of the present invention. 本発明の実施形態1、2にかかわる移動ベクトルの算出例を示す図。The figure which shows the example of calculation of the movement vector in connection with Embodiment 1, 2 of this invention. 本発明の実施形態1、2にかかわる撮像装置の角速度を用いる算出例を示す図。The figure which shows the example of calculation using the angular velocity of the imaging device concerning Embodiment 1, 2 of this invention. 本発明の実施形態1、2にかかわるLPFの説明図。Explanatory drawing of LPF concerning Embodiment 1, 2 of this invention. 本発明の実施形態2にかかわる流し撮り合成のフローチャート。6 is a flowchart of panning composition relating to Embodiment 2 of the present invention. 本発明の実施形態2にかかわるLPFのタップ数の算出の説明図。Explanatory drawing of calculation of the tap number of LPF concerning Embodiment 2 of this invention. 本発明の実施形態にかかわる流し撮り合成画像のイメージ図。The image figure of the panning composite image concerning embodiment of this invention. 本発明の実施形態にかかわる流し撮り合成のUIを示す図。FIG. 5 is a diagram showing a UI for panning composition related to an embodiment of the present invention.

(第1の実施形態)
画像処理技術による流し撮りを実現するためには、主被写体がぶれていない画像が必要になる。主被写体がぶれないシャッター速度で撮影した場合、背景のぶれ幅も小さくなりやすいため、背景に流し撮りの効果を付与する必要がある。上記の課題に鑑み、本実施形態では、主被写体がぶれていない画像と、背景がぼけている画像を合成することで、流し撮りと同様の効果を持たせることを特徴とする。
(First embodiment)
In order to realize panning using image processing technology, an image in which the main subject is not blurred is necessary. When shooting at a shutter speed at which the main subject does not blur, the background blur width tends to be small, so it is necessary to add a panning effect to the background. In view of the above problems, the present embodiment is characterized in that an effect similar to panning is provided by combining an image in which the main subject is not blurred and an image in which the background is blurred.

図1は、本発明の第1の実施形態にかかわる画像処理装置の一例としての撮像装置のブロック図である。   FIG. 1 is a block diagram of an imaging apparatus as an example of an image processing apparatus according to the first embodiment of the present invention.

撮像装置100は、デジタルカメラ、デジタルビデオカメラのようなカメラはもとより、カメラ機能付き携帯電話、カメラ付きコンピュータ、スキャナなど、撮像機能を備える任意の電子機器であっても良い。また、本実施形態における撮像装置100の一部あるいは全部をもって本実施形態における画像処理装置とすることができる。画像処理装置としては必ずしも撮像機能を有する必要はなく、撮像素子102から出力される画像あるいは各記憶装置に記憶されている画像を処理する機能を有していればよい。   The imaging apparatus 100 may be any electronic device having an imaging function, such as a digital camera and a digital video camera, as well as a mobile phone with a camera function, a computer with a camera, and a scanner. In addition, a part or all of the imaging apparatus 100 in the present embodiment can be used as the image processing apparatus in the present embodiment. The image processing apparatus does not necessarily have an imaging function, and may have a function of processing an image output from the imaging element 102 or an image stored in each storage device.

光学系101は、レンズ、シャッター、絞りから構成されており、被写体からの光束を撮像素子102に導き、被写体の光学像を撮像素子102上に結像する。そして、焦点距離、シャッター速度、絞り値などの情報を中央演算装置(以降、CPU)103へ伝達する。   The optical system 101 includes a lens, a shutter, and a diaphragm. The optical system 101 guides a light beam from a subject to the image sensor 102 and forms an optical image of the subject on the image sensor 102. Information such as the focal length, shutter speed, and aperture value is transmitted to the central processing unit (hereinafter referred to as CPU) 103.

CCD(Charge Coupled Device)、CMOS(Complementary Metal Oxide Semiconductor)などで構成される撮像素子102は、光学系101により結像された光学像を電気信号に変換する。その後AD変換器を通してデジタル化した後、一次記憶装置104に記憶する。また、本実施形態では、撮像素子102の画素配列はRGBの画素によるBayer配列とするが、本発明の適用はこの画素配置に限られない。例えば補色の色フィルタの画素の配列であってもよいし、このような撮影用の画素とは別に測色、測距などの目的で機能画素などを配していてもよい。なお、撮像素子102の電気的利得(以降、ISO感度)は、CPU103によって設定される。   An image sensor 102 composed of a CCD (Charge Coupled Device), a CMOS (Complementary Metal Oxide Semiconductor), or the like converts an optical image formed by the optical system 101 into an electrical signal. Thereafter, it is digitized through an AD converter and then stored in the primary storage device 104. In this embodiment, the pixel array of the image sensor 102 is a Bayer array of RGB pixels, but the application of the present invention is not limited to this pixel arrangement. For example, it may be an array of complementary color filter pixels, or a functional pixel or the like may be provided for the purpose of color measurement, distance measurement, and the like in addition to such shooting pixels. The electrical gain (hereinafter referred to as ISO sensitivity) of the image sensor 102 is set by the CPU 103.

ジャイロセンサなどの角速度センサ105は、振れを検出し、電気信号として変換してCPU103へ伝達する。   An angular velocity sensor 105 such as a gyro sensor detects a shake, converts it as an electrical signal, and transmits it to the CPU 103.

制御部として機能するCPU103は、入力された信号や予め記憶されたプログラムに従い、撮像装置100を構成する各部を制御することで、撮像装置100の各機能を実現させる。なお、以下の説明において、CPU103がプログラムを実行して実現する機能の少なくとも一部は、ASIC(Application Specific Integrated Circuit)などの専用ハードウェアによって実現されても良い。   The CPU 103 functioning as a control unit realizes each function of the imaging apparatus 100 by controlling each part of the imaging apparatus 100 according to an input signal or a prestored program. In the following description, at least a part of the functions realized by the CPU 103 executing the program may be realized by dedicated hardware such as ASIC (Application Specific Integrated Circuit).

一次記憶装置104は、例えばRAM(Random Access Memory)のような揮発性装置であり、CPU103の作業用に使われる。また、一次記憶装置104に記憶されている情報は、画像処理部106で利用されたり、記録媒体107へ記録されたりもする。   The primary storage device 104 is a volatile device such as a RAM (Random Access Memory), and is used for the work of the CPU 103. Information stored in the primary storage device 104 is used by the image processing unit 106 or recorded on the recording medium 107.

二次記憶装置108は、例えばEEPROMのような不揮発性記憶装置であり、撮像装置100を制御するためのプログラム(ファームウェア)や各種の設定情報を記憶し、CPU103によって利用される。   The secondary storage device 108 is a nonvolatile storage device such as an EEPROM, for example, stores a program (firmware) for controlling the imaging device 100 and various setting information, and is used by the CPU 103.

記録媒体107は、一次記憶装置104に記憶されている、撮影により得られた画像のデータなどを記録する。なお、記録媒体107は、例えば半導体メモリカードのように撮像装置100から取り外し可能であり、記録されたデータはパーソナルコンピュータなど他の機器で読み出し可能である。つまり、撮像装置100は、記録媒体107の着脱機構及び読み書き機能を有する。   The recording medium 107 records data of an image obtained by photographing that is stored in the primary storage device 104. Note that the recording medium 107 can be detached from the imaging apparatus 100, for example, like a semiconductor memory card, and the recorded data can be read out by other devices such as a personal computer. That is, the imaging apparatus 100 has a mechanism for attaching and detaching the recording medium 107 and a read / write function.

表示部109は、CPU103の指示により一時記憶装置104内に表示用に記憶される情報を液晶等の表示媒体に表示させる機能を有する。本実施形態では、撮像素子102から連続的に取得される画像の少なくとも一部を順次表示するライブビュー(ビューファインダ)表示の機能も有する。また、撮影後記録媒体107等に記録されている記録画像の再生表示、対話的な操作のためのGUI(Graphical User Interface)などの表示の機能を有する。   The display unit 109 has a function of displaying information stored for display in the temporary storage device 104 on a display medium such as a liquid crystal according to an instruction from the CPU 103. The present embodiment also has a live view (viewfinder) display function for sequentially displaying at least a part of images continuously acquired from the image sensor 102. In addition, it has a display function such as a GUI (Graphical User Interface) for interactive display and playback and display of recorded images recorded on the recording medium 107 and the like after shooting.

操作部110は、ユーザの操作を受け付けてCPU103へ入力情報を伝達する入力デバイス群であり、例えばボタン、レバー、タッチパネル等はもちろん、音声や視線などを用いた入力機器であっても良い。なお、本実施形態の撮像装置100は、画像処理装置106が撮像画像に適用する画像処理のパターンを複数有し、パターンを撮像モードとして操作部110から設定可能である。また、操作部110は、表示部109が表示に用いる表示媒体が備えるタッチパネルへの操作も検知する。   The operation unit 110 is an input device group that receives user operations and transmits input information to the CPU 103. For example, the operation unit 110 may be an input device using voice, line of sight, etc. as well as buttons, levers, touch panels, and the like. Note that the imaging apparatus 100 according to the present embodiment has a plurality of image processing patterns that the image processing apparatus 106 applies to the captured image, and the patterns can be set as the imaging mode from the operation unit 110. The operation unit 110 also detects an operation on a touch panel included in a display medium used for display by the display unit 109.

画像処理部106は、いわゆる現像処理と呼ばれる画像処理をはじめ、撮影モードに応じた色調の調整なども行う。例えばデモザイキング処理などの補間処理、ホワイトバランス処理、収差、歪などの補正処理、シャープネス、ガンマ処理、マトリクス演算、ルックアップテーブル等による色変換処理などがあげられる。表示部109で表示するためのリサイズ、ガンマ変換等の表示用処理、記録媒体107への記録時の符号化、圧縮等の記録用処理も画像処理部106により行う。また、本実施形態にある流し撮り画像を生成する処理も画像処理部106が行う。合成される複数の画像や処理過程で生成される画像データは、例えば一次記憶装置104に記憶される。なお、画像処理部106の機能の少なくとも一部は、CPU103がソフトウェア的に実現しても良い。   The image processing unit 106 performs image processing called so-called development processing, and also adjusts color tone according to the shooting mode. For example, interpolation processing such as demosaicing processing, white balance processing, correction processing such as aberration and distortion, sharpness, gamma processing, matrix calculation, color conversion processing using a lookup table, and the like can be given. The image processing unit 106 also performs display processing such as resizing and gamma conversion for display on the display unit 109 and recording processing such as encoding and compression during recording on the recording medium 107. The image processing unit 106 also performs processing for generating a panning image in the present embodiment. A plurality of images to be combined and image data generated in the process are stored in the primary storage device 104, for example. Note that at least a part of the functions of the image processing unit 106 may be realized by the CPU 103 as software.

図2は、流し撮り撮影モードでの撮影、記録に関するCPU103の処理に関するフローチャートである。   FIG. 2 is a flowchart relating to processing of the CPU 103 relating to shooting and recording in the panning shooting mode.

なお、本実施形態では、画像の撮影、記録までの指示が2段階になっており、以降に出てくる操作部110のS1は、撮影準備の指示を意味し、操作部110のS2は、本画像の撮影、記録の指示を意味する。また、本実施形態では、S1を操作部110のシャッターボタンの半押し、S2をシャッターボタンの全押しと対応付けてユーザが入力可能なようにしている。この他にも操作部110がタッチパネルである場合、タッチパネルへのタッチ操作を変えることが考えられ、任意の操作をS1、S2に割り当てることが可能である。   Note that in this embodiment, there are two steps for capturing and recording an image. S1 of the operation unit 110 that appears after that means an instruction to prepare for shooting, and S2 of the operation unit 110 is This means an instruction to capture and record the main image. In the present embodiment, S1 is associated with half-pressing of the shutter button of the operation unit 110, and S2 is associated with full-pressing of the shutter button so that the user can input. In addition, when the operation unit 110 is a touch panel, it is conceivable to change the touch operation on the touch panel, and any operation can be assigned to S1 and S2.

S201で、CPU103は、操作部110からのユーザの入力を受け付ける。   In step S <b> 201, the CPU 103 receives a user input from the operation unit 110.

S202で、CPU103は、入力された情報を基に、光学系101の焦点距離、シャッター速度、絞り値などの設定を調節する。   In step S202, the CPU 103 adjusts settings such as the focal length, shutter speed, and aperture value of the optical system 101 based on the input information.

S203で、CPU103は、入力された情報を基に、撮像素子102のISO感度などの設定を調節する。   In step S <b> 203, the CPU 103 adjusts settings such as the ISO sensitivity of the image sensor 102 based on the input information.

S204で、CPU103は、変更された設定に関する情報を表示部109でユーザに提示する。   In step S <b> 204, the CPU 103 presents information regarding the changed setting to the user on the display unit 109.

S205で、CPU103は、角速度センサ105で検出された撮像装置100の角速度の情報を受信する。また、S205をS202やS203と同様に常に実行することで、焦点距離、シャッター速度、絞り値、ISO感度などの情報と併せて、角速度の情報も画像情報として埋め込むことができる。そして、撮影済みの画像に対して、カメラ内での再処理や、PCアプリケーションでの後加工を容易にする。記録する角速度の情報としては、角速度自体であっても良いし、画像間で移動した角度、角変位であっても良い。   In step S <b> 205, the CPU 103 receives information on the angular velocity of the imaging apparatus 100 detected by the angular velocity sensor 105. Further, by always executing S205 in the same manner as S202 and S203, information on angular velocity can be embedded as image information together with information on focal length, shutter speed, aperture value, ISO sensitivity, and the like. Then, the reprocessed image in the camera and the post-processing by the PC application are facilitated for the captured image. The information on the angular velocity to be recorded may be the angular velocity itself, the angle moved between images, or the angular displacement.

なお、S201〜S205の順番はこの限りではなく、処理に応じて自由に順番を入れ替えることができる。   The order of S201 to S205 is not limited to this, and the order can be freely changed according to the process.

S206で、操作部110のS1の入力の有無(ON/OFF)を判定し、操作部110のS1が入力されない限り、CPU103は、S201〜S205の動作を繰り返し行う。   In S206, the presence or absence (ON / OFF) of the input of S1 of the operation unit 110 is determined, and the CPU 103 repeats the operations of S201 to S205 unless S1 of the operation unit 110 is input.

以降は、S206で、操作部110のS1が入力(ON)された後の処理である。   The subsequent processing is processing after S1 of the operation unit 110 is input (ON) in S206.

S207で、CPU103は、光学系101の一部である測光センサを用いて明るさを計測する。また、自動露出制御を行うAE(Auto Exposure)モードの場合は、シャッター速度と絞り値、ISO感度を用いて、自動的に露出を調節する。   In step S <b> 207, the CPU 103 measures brightness using a photometric sensor that is a part of the optical system 101. In the case of an AE (Auto Exposure) mode in which automatic exposure control is performed, exposure is automatically adjusted using the shutter speed, aperture value, and ISO sensitivity.

S208で、CPU103は、自動焦点調節制御を行うAF(Auto Focus)モードの場合、光学系101の一部あるいは撮像素子102内に配されている測距センサを用いて、被写体距離を測定し、デフォーカス量に基づいて焦点調節を行う。   In S208, in the AF (Auto Focus) mode in which automatic focus adjustment control is performed, the CPU 103 measures the subject distance using a distance measuring sensor disposed in a part of the optical system 101 or in the image sensor 102, and Focus adjustment is performed based on the defocus amount.

なお、S207、S208の順番はこの限りではなく、処理に応じて自由に順番を入れ替えることができる。   Note that the order of S207 and S208 is not limited to this, and the order can be freely changed according to the processing.

S209では、操作部110のS2の入力の有無(ON/OFF)を判定し、操作部110のS2が入力されない限り、CPU103は、S201〜S208の動作を繰り返し行う。また、S209において操作部110のS1の入力が継続されているかどうかの検出を行い、操作部110のS1の入力が行われていない(OFF)の場合、ステップS201に戻るように構成してもよい。   In S209, the presence or absence (ON / OFF) of the input of S2 of the operation unit 110 is determined, and the CPU 103 repeats the operations of S201 to S208 unless S2 of the operation unit 110 is input. Further, it may be configured to detect whether or not the input of S1 of the operation unit 110 is continued in S209 and to return to step S201 when the input of S1 of the operation unit 110 is not performed (OFF). Good.

以降は、S209で、操作部110のS2が入力(ON)された後の処理である。   The subsequent processing is processing after S2 of the operation unit 110 is input (ON) in S209.

S210では、操作部10からのS2の撮影指示を受けて、流し撮り処理に必要な数の画像を撮影する。この際、流し撮りモードでは、ユーザが、流し撮り効果を得るため、撮像装置100(あるいは撮像素子102を含むその一部)をパンニングして撮影を行うことを想定している。流し撮りに用いる画像の数はユーザによりあらかじめ設定されていてもよいし、後述するように、主被写体の速度、パンニングの量、背景領域をぼかす程度の設定などから自動的に算出される数であってもよい。   In S210, in response to the shooting instruction in S2 from the operation unit 10, the number of images necessary for the panning process is shot. At this time, in the panning mode, it is assumed that the user pans the imaging device 100 (or a part thereof including the imaging device 102) to obtain a panning effect. The number of images used for panning may be set in advance by the user, or, as will be described later, is a number automatically calculated from the setting of the speed of the main subject, the amount of panning, the degree of blurring of the background area, etc. There may be.

S211では、S210で撮影された画像データに対して画像処理部106が上述したような現像処理を行う。   In S211, the image processing unit 106 performs the development process as described above on the image data captured in S210.

S212では、CPU103は、複数の画像間の分割した領域ごとの移動ベクトルを検出することによる主被写体領域の検出と、検出された主被写体領域での位置合わせ処理を行う。ここで、本実施形態で主被写体領域とは、撮影画像の画像内において後述する背景領域と区別して検出される被写体領域のことを指し、当該領域内の被写体が例えば複数の人物から構成されていてもよいものとする。また、本実施形態では、流し撮りの主被写体領域として、大きく動いている被写体の領域(動体領域)を検出することとする。すなわち、被写体領域以外で、複数の撮影の中で静止している被写体(静止体)は背景として取り扱われる。ただし、上述したとおり、パンニングして撮影が行われることを想定している場合、画像間で比較すると、パンニング方向の逆方向にパンニング量に対応するような動きをする被写体が元は静止している被写体である。パンニング方向にパンニング量と同様の動きをする被写体が動体と判定される。詳細は後述する。一方、三脚等で固定して撮影が行われることを想定している場合、動きベクトルが大きく検出できる領域が主被写体領域と考えられる。   In S212, the CPU 103 detects a main subject region by detecting a movement vector for each divided region between a plurality of images, and performs alignment processing in the detected main subject region. Here, in the present embodiment, the main subject area refers to a subject area that is detected separately from a background area, which will be described later, in the captured image, and the subject in the area is composed of, for example, a plurality of persons. It may be. In the present embodiment, an area of a moving subject (moving body area) is detected as a main subject area for panning. That is, a subject (stationary object) that is stationary in a plurality of shootings outside the subject region is treated as a background. However, as described above, when it is assumed that shooting is performed by panning, a subject that moves corresponding to the panning amount in the opposite direction of the panning direction is stationary when compared between images. The subject. A subject that moves in the panning direction in the same manner as the panning amount is determined as a moving object. Details will be described later. On the other hand, when it is assumed that shooting is performed with a tripod or the like fixed, an area where a motion vector can be largely detected is considered as a main subject area.

S213では、CPU103は、画像処理部106によってS212で主被写体領域が一致するように位置合わせが行われた複数枚の画像を合成し、流し撮り画像として合成画像を生成する。流し撮りと同様の視覚効果のある合成画像の生成方法としては複数の方法が考えられる。本実施形態では、主被写体領域が撮影された複数の画像間で一致するように位置合わせを行って加算し、さらに合成後の画像の主被写体領域とは異なる背景領域にぼかし処理を行う。また、最終的な合成画像を生成する方法としてはこれに限らない。たとえば、撮影で得られた複数の画像の背景領域に、画像間の背景の移動量に基づいたぼかし量(タップ数)でぼかし処理(フィルタ処理等)を施し、主被写体領域が撮影された複数の画像間で一致するように位置合わせを行って加算平均で合成してもよい。ここで、背景の移動量は、角速度センサ105によって得られる角速度から算出できる。また、合成後の画像を上記のようにぼかした画像と、ぼかす前の画像とをさらに合成した画像を最終的な合成画像としてもよい。合成後の画像のイメージを図11に示す。画像1104は、画像1101,1102、1103に基づいて上記のステップで合成を行い生成された画像のイメージ図である。動体であり、主被写体である車両がくっきりと写り、背景の木が流れて写っている。   In S213, the CPU 103 combines the plurality of images that have been aligned so that the main subject areas match in S212 by the image processing unit 106, and generates a composite image as a panning image. A plurality of methods are conceivable as a method for generating a composite image having a visual effect similar to that of panning. In the present embodiment, alignment is performed so that the main subject region matches between a plurality of captured images, addition is performed, and blurring processing is performed on a background region different from the main subject region of the combined image. Further, the method for generating the final composite image is not limited to this. For example, the background area of a plurality of images obtained by shooting is subjected to a blurring process (filtering process, etc.) with a blurring amount (number of taps) based on the amount of movement of the background between the images, and a plurality of images in which the main subject area is shot The images may be aligned so as to match, and may be combined by averaging. Here, the amount of movement of the background can be calculated from the angular velocity obtained by the angular velocity sensor 105. Further, an image obtained by further combining the image obtained by blurring the combined image as described above and the image before blurring may be used as the final combined image. An image of the synthesized image is shown in FIG. An image 1104 is an image diagram of an image generated by performing synthesis in the above steps based on the images 1101, 1102, and 1103. The moving object, the main subject vehicle, is clearly visible, and the background trees are reflected.

図2に戻り、S214では、CPU103は、S213で生成された合成画像データやその元となった合成前の画像データに画像処理部106によって表示用処理が施された画像データを、表示部109に表示する。   Returning to FIG. 2, in S214, the CPU 103 displays the image data obtained by performing the display processing by the image processing unit 106 on the combined image data generated in S213 and the image data before combining that is the original image data. To display.

そして、S215では、CPU103は、記録媒体107にS213で生成された合成画像データやその元となった合成前の画像データに、記録用に符号化、圧縮等の処理が施された画像データを記録する。また、本実施形態では、記録画像の設定として、現像処理等を行っていないRAW画像の記録や、現像処理を施し規格に準拠したJPEG画像の記録などを設定可能である。それらの設定によってはS210の現像処理やS216での符号化等の処理は適用されない場合もある。   In step S215, the CPU 103 stores the image data obtained by performing encoding processing, compression processing, and the like on the composite image data generated in step S213 on the recording medium 107 and the original pre-combination image data. Record. In the present embodiment, as the setting of the recording image, it is possible to set recording of a RAW image that has not been subjected to development processing or the like, or recording of a JPEG image that has been subjected to development processing and conforms to the standard. Depending on these settings, the development process in S210 and the encoding process in S216 may not be applied.

また、本実施形態では、S211における現像処理後の画像に対してS212の主被写体の検出処理、及びS213の流し撮り合成処理を行ったが、これに限らず、現像処理前の画像に対して各処理を適用することも可能である。   In this embodiment, the main subject detection process in S212 and the panning composition process in S213 are performed on the image after the development process in S211. However, the present invention is not limited to this, and the image before the development process is processed. Each process can also be applied.

図3(a)は、図2のS212で行われる主被写体領域(動体領域)の検出、および主被写体領域での画像間の位置合わせ処理の詳細を示したフローチャートである。   FIG. 3A is a flowchart showing details of detection of the main subject area (moving object area) and registration processing between images in the main subject area performed in S212 of FIG.

S301で、CPU103は、画像を複数の領域に分割した探索用ブロックを設定し、探索用ブロック単位で画像間における移動ベクトルを検出する。   In step S301, the CPU 103 sets a search block obtained by dividing an image into a plurality of areas, and detects a movement vector between images in units of search blocks.

S302で、CPU103は、検出した移動ベクトルの中で、ほぼ同じベクトルとなるものの数を数える。計数後の状態を、横軸にベクトルの大きさ、縦軸に数(度数)でヒストグラム化したものを図3(b)に示す。横軸は0を境に、移動ベクトルの方向を区別している。まず、角速度センサ105で検出される振れ(すなわち複数の画像間の撮像手段の動き情報)に基づく背景の移動量310を基準とし、図のように移動ベクトルを、背景の移動量から離れた主被写体成分311と、背景の移動量近傍の背景成分312に分類する。次に、分類された主被写体成分311の移動ベクトルの中で、数が最も多かった移動ベクトルを主被写体ベクトル313とする。   In S302, the CPU 103 counts the number of detected movement vectors that are substantially the same vector. FIG. 3B shows a state after counting, in which the horizontal axis represents the vector size and the vertical axis represents the number (frequency). The horizontal axis distinguishes the direction of the movement vector from 0 as a boundary. First, based on the movement amount 310 of the background based on the shake detected by the angular velocity sensor 105 (that is, movement information of the imaging means between a plurality of images), the movement vector is separated from the movement amount of the background as shown in the figure. The object component 311 and the background component 312 in the vicinity of the background movement amount are classified. Next, the movement vector having the largest number among the movement vectors of the classified main subject component 311 is set as the main subject vector 313.

尚、ここで角速度センサ105で検出される振れの情報を用いずに移動ベクトルのヒストグラムから主被写体と背景を分類することも可能である。例えば流し撮りがユーザのパンニング撮影によって行われた場合には、各画像でほぼ中心付近に主被写体がいると仮定し、ベクトルの大きさがゼロに近く、画像内で連続した領域に固まって存在する移動ベクトルに対応する領域が、主被写体領域と考えられる。しかし、移動ベクトルの探索領域の大きさによっては移動ベクトルの誤検出も存在するため、上記実施形態のように、センサからの振れ情報を参照した方がより精度良く主被写体と背景を分類できる。   Here, it is possible to classify the main subject and the background from the histogram of the movement vector without using the shake information detected by the angular velocity sensor 105. For example, when panning is performed by panning shooting by the user, it is assumed that the main subject is almost near the center in each image, and the vector size is close to zero and exists in a continuous area in the image. The region corresponding to the movement vector to be considered is considered as the main subject region. However, depending on the size of the search area of the movement vector, there is also an erroneous detection of the movement vector. Therefore, the main subject and the background can be classified more accurately by referring to the shake information from the sensor as in the above embodiment.

上述のようにして、S303で、CPU103は、主被写体領域に対応する移動ベクトルを特定する。本実施形態では、各画像を撮像する際の角速度センサ105からの信号を画像間の撮像装置100の移動量に換算して対象の画像間での背景の移動量を推定し、静止している背景の移動ベクトルとそれ以外のベクトルを分類する。背景に対応する移動ベクトルを除いたときに、数が最多である移動ベクトルを主被写体に対応する移動ベクトルと推定する。なお、本実施形態では、撮像装置100の角速度を角速度センサ105によって検出しているが、これに限らず、加速度センサ、その他位置を計測するセンサ等を用いて加速度、変位を検出し、カメラの画像間の移動量に換算してもよい。また本実施形態では、撮影がパンニングを伴って行われていることを想定しているので、主被写体の移動ベクトルの決定方法として、上記方法で背景の移動ベクトルを分類した。上記のように背景の移動ベクトルを角速度センサ105の信号によって分類しない場合には、2番目に多い移動ベクトルを主被写体の移動ベクトルと判定する。あるいは、当該移動ベクトルを持つ領域がある程度のかたまりを持って存在しているかを検出したりして、主被写体の移動ベクトルを推定する。また、三脚を使って撮像装置100を固定して撮影を行う場合を想定している場合、単に画像上で最多な移動ベクトルを主被写体の移動ベクトルと判定することも出来る。また、移動ベクトルは、画像水平方向、画像垂直方向を別々に扱っても良いし、合わせたものを扱っても良い。   As described above, in S303, the CPU 103 identifies a movement vector corresponding to the main subject area. In the present embodiment, a signal from the angular velocity sensor 105 at the time of capturing each image is converted into a movement amount of the imaging device 100 between the images, and a background movement amount between the target images is estimated, and the image is stationary. Classify the background movement vector and other vectors. When the movement vector corresponding to the background is excluded, the movement vector having the largest number is estimated as the movement vector corresponding to the main subject. In this embodiment, the angular velocity of the imaging device 100 is detected by the angular velocity sensor 105, but the present invention is not limited to this, and acceleration and displacement are detected using an acceleration sensor, other position measuring sensors, and the like. You may convert into the movement amount between images. In this embodiment, since it is assumed that shooting is performed with panning, the background movement vectors are classified by the above method as a method for determining the movement vector of the main subject. As described above, when the background movement vector is not classified by the signal of the angular velocity sensor 105, the second most frequent movement vector is determined as the main subject movement vector. Alternatively, the movement vector of the main subject is estimated by detecting whether an area having the movement vector exists with a certain amount of clumps. When it is assumed that shooting is performed with the imaging apparatus 100 fixed using a tripod, the largest number of movement vectors on the image can be simply determined as the movement vector of the main subject. In addition, as the movement vector, the horizontal direction and the vertical direction of the image may be handled separately, or a combined vector may be handled.

S304で、CPU103は、当該主被写体の移動ベクトルの値に基づいて、基準画像に対して主被写体の位置が合うように、一次記憶装置104のメモリ内でシフト移動による画像の位置合わせを行う。   In step S304, the CPU 103 performs image alignment by shift movement in the memory of the primary storage device 104 so that the position of the main subject matches the reference image based on the value of the movement vector of the main subject.

最後に、S305で、位置合わせする残りの画像の有無を判定する。すなわち、位置合わせする対象の画像が残っている限り、S301に戻り次の画像の位置合わせを行い、全ての画像の位置合わせが終了した際、図2のS212の処理を終了する。   Finally, in S305, it is determined whether or not there are remaining images to be aligned. That is, as long as the target image to be aligned remains, the process returns to S301 to perform the alignment of the next image, and when the alignment of all the images is completed, the process of S212 in FIG.

図3(c)は、図2のS213で行われる(流し撮り)合成処理の詳細を示したフローチャートである。   FIG. 3C is a flowchart showing details of the composition process (panning shot) performed in S213 of FIG.

S321で、CPU103は、図3のS304で位置合わせされた複数の画像を合成することで、主被写体においても、時間の経過に伴う主被写体の変化を、ぶれを抑えた上で表現した第1の合成画像を作成する。たとえば、走る人間を主被写体としたときに、人間の手が振られている動きを、合成することにより表現することが出来る。この第1の合成画像は最終的な合成画像において主被写体領域に主として用いられる。   In S321, the CPU 103 combines the plurality of images aligned in S304 in FIG. 3 to express the change in the main subject over time even in the main subject while suppressing blurring. Create a composite image. For example, when a running person is a main subject, the movement of a person's hand can be expressed by synthesis. This first composite image is mainly used for the main subject area in the final composite image.

S322で、CPU103は、S321で合成した画像にかけるローパスフィルタ(以降、LPF)のタップ数を算出する。詳細は後述するが、LPFのタップ数は、流れるような画像効果を掛ける対象である背景の移動量に応じて、背景を流すために不足する画素数分を補うようなタップ数が算出される。また、ユーザから背景を流す程度について手動あるいは自動で指定がある場合、指定された流す程度に対応するぼかし量を得るためのタップ数が算出される。   In S322, the CPU 103 calculates the number of taps of a low-pass filter (hereinafter referred to as LPF) to be applied to the image synthesized in S321. As will be described in detail later, the number of taps of the LPF is calculated so as to compensate for the number of pixels that are insufficient to flow the background, according to the amount of movement of the background to which the flowing image effect is applied. . In addition, when there is a manual or automatic designation about the degree of background flow from the user, the number of taps for obtaining the blur amount corresponding to the designated degree of flow is calculated.

S323で、CPU103は、S321で合成した画像に前記タップ数のLPFをかけることで、背景の流れを表現した第2の合成画像を生成する。ここで、本実施形態では、S321で合成した第1の合成画像に対してLPFを掛けたが、合成前の各画像に対してLPFを掛けた後に合成して第2の合成画像を生成してもよい。   In step S323, the CPU 103 generates a second composite image expressing the background flow by applying the LPF of the number of taps to the image combined in step S321. Here, in the present embodiment, LPF is applied to the first combined image combined in S321, but the second combined image is generated by applying LPF to each image before combining to generate the second combined image. May be.

S324で、CPU103は、S321で合成した第1の合成画像と、S323でLPFをかけた画像を、図2、S212で検出した主被写体領域の情報を用いて合成する。このとき、主被写体領域はS321で合成した第1の合成画像を主として用い、背景領域はS323で生成した第2の合成画像を主として用いるように合成することで、流し撮りと同様の効果を持つ第3の合成画像を生成する。   In step S324, the CPU 103 combines the first combined image combined in step S321 and the image subjected to LPF processing in step S323 using information on the main subject area detected in step S212 in FIG. At this time, the main subject area is synthesized mainly using the first synthesized image synthesized in S321, and the background area is synthesized mainly using the second synthesized image generated in S323. A third composite image is generated.

次に、図3(c)のS322におけるLPFのタップ数の算出の概念を、図4、図5を用いて説明する。一般的な流し撮りは、1回の露光で撮影するため、背景は連続的に流れるように変化する。すなわち、例えば、図4における1枚目の画像401とその直後の2枚目の画像402の画像における背景403のぼけ方は、前記1枚目の画像と2枚目の画像を合成した際に、合成画像404における背景のようになることが望ましい。しかしながら、画像401と画像402の画像を単純に合成すると合成画像405のように背景が離散的に表示されてしまうため、本実施形態においては、背景の移動量406で表される部分に存在しない背景403の不足画素を補い、画像404のようにつなげて表示している。   Next, the concept of calculating the number of taps of the LPF in S322 in FIG. 3C will be described with reference to FIGS. Since general panning is performed with one exposure, the background changes so as to flow continuously. That is, for example, the background 403 in the first image 401 in FIG. 4 and the second image 402 immediately thereafter is blurred when the first image and the second image are combined. The background in the composite image 404 is desirable. However, if the images 401 and 402 are simply combined, the background is displayed discretely as in the combined image 405. Therefore, in the present embodiment, the background does not exist in the portion represented by the amount of movement 406. The deficient pixels in the background 403 are compensated for, and are connected and displayed as an image 404.

すなわち、本実施形態では、この合成画像405において表示される離散的な背景の間の不足画素を補うようなタップ数で、カメラのパンニング方向(所定方向)に応じたフィルタを用いて背景が適切に流れている画像を生成する。例えば、背景の移動量406が5画素分だとした場合、1×5画素以上のローパスフィルタを設定する。また、フィルタ上の基準画素を、パンニング方向に応じて、例えばパンニングが左方向なら右端に設定する。このようにフィルタを設定し、合成画像の背景領域に対してフィルタ処理を行うことで、背景が適切な方向に、繋がって流れている流し撮り風の合成画像を生成することが出来る。   In other words, in the present embodiment, the background is appropriate by using a filter corresponding to the panning direction (predetermined direction) of the camera with the number of taps that compensates for insufficient pixels between the discrete backgrounds displayed in the composite image 405. The image that is flowing in is generated. For example, when the background movement amount 406 is 5 pixels, a low-pass filter of 1 × 5 pixels or more is set. Also, the reference pixel on the filter is set to the right end according to the panning direction, for example, if panning is in the left direction. By setting the filter in this way and performing the filtering process on the background area of the composite image, it is possible to generate a composite image of the panning style in which the background is connected in an appropriate direction.

また、本実施形態では、合成画像において、ユーザーによって設定された所定のシャッター速度(ここでは相当シャッター速度と呼ぶ)で流し撮りを行ったのと同様の効果を得るために以下のような制御をおこなう。すなわち、ユーザによって設定された相当シャッター速度の合成画像にするために、単位時間当たりの撮影枚数(あるいはフレームレート)に応じて合成枚数を決定する。例えば、毎秒60枚の速度で画像を撮影する場合、ユーザによって設定された相当シャッター速度が1/60秒以下のときは1枚の画像から、1/20秒のときは3枚の画像から生成する。このように、合計の撮影時間が相当シャッター速度に対応するように合成枚数を決定する。なお、相当シャッター速度に対応する枚数以下の枚数であっても、その分背景領域のぼかし量を大きくすればよい。   In the present embodiment, the following control is performed in the composite image in order to obtain the same effect as when panning is performed at a predetermined shutter speed (referred to as an equivalent shutter speed here) set by the user. Do it. That is, in order to obtain a composite image with an equivalent shutter speed set by the user, the composite number is determined according to the number of images to be taken (or frame rate) per unit time. For example, when shooting an image at a speed of 60 sheets per second, it is generated from one image when the corresponding shutter speed set by the user is 1/60 seconds or less, and from three images when it is 1/20 seconds. To do. Thus, the number of combined images is determined so that the total shooting time corresponds to the equivalent shutter speed. Even if the number is equal to or smaller than the number corresponding to the equivalent shutter speed, the blur amount of the background area may be increased accordingly.

例えば図5において、図5(b)、(c)は、ユーザが中央にある車両を主被写体としてパンニングしながら撮影した画像を、時間的に連続した2枚ずつで合成した画像をそれぞれ示している。図5(b)は撮影画像を時系列で並べた場合の1枚目の撮影画像と2枚目の撮影画像の合成画像、図5(c)は2枚目の撮影画像と3枚目の撮影画像の合成画像を示す。図5(d)は3枚目に撮影された画像を示し、点線で描かれた背景の木は、ユーザが従来の方法でパンニング中、露光したまま流し撮りをした場合に流れて写るであろう場所が示されている。   For example, in FIGS. 5A and 5B, FIGS. 5B and 5C respectively show images obtained by combining two images that are temporally continuous, taken by a user panning with the vehicle in the center as the main subject. Yes. FIG. 5B shows a composite image of the first photographed image and the second photographed image when the photographed images are arranged in time series. FIG. 5C shows the second photographed image and the third photographed image. A composite image of the captured image is shown. FIG. 5 (d) shows an image taken on the third sheet, and the background tree drawn with a dotted line flows and appears when the user takes a panning shot while exposed while panning in the conventional method. The place of the wax is shown.

図5(a)はLPFのタップ数の設定の概念を説明する図であり、今、ユーザから最終的な合成画像の相当シャッター速度として1/20秒が設定され、毎秒60枚の速度で3枚の撮影を行ったとする。図において、背景403の所定位置の基準画素501が、1枚目、2枚目、3枚目の撮影で、基準画素501、基準画素502、基準画素503のように変化した様子を示している。このとき、基準画素501と基準画素502の間隔504、基準画素502と基準画素503の間隔505をそれぞれ画素がつながるように補間する必要がある。また、設定された相当シャッター速度で実際にパンニング中にも露光しながら撮影した場合には、基準画素503と基準画素506の間も背景は流れるため、基準画素503と基準画素506の間隔507も画素がつながるように補間する必要がある。したがって、合成後の画像に対して、図5(a)に示すように間隔504(あるいは、間隔505、間隔507)のタップ数のLPFをかけ、全体的な流し量を流し量508とする。   FIG. 5A is a diagram for explaining the concept of setting the number of taps of the LPF. Now, 1/20 second is set as the equivalent shutter speed of the final composite image by the user, and 3 at a speed of 60 sheets per second. Suppose that a picture was taken. In the figure, the reference pixel 501 at a predetermined position on the background 403 is changed as the reference pixel 501, the reference pixel 502, and the reference pixel 503 in the first, second, and third photographing. . At this time, it is necessary to interpolate the interval 504 between the reference pixel 501 and the reference pixel 502 and the interval 505 between the reference pixel 502 and the reference pixel 503 so that the pixels are connected. In addition, when a picture is taken while being exposed even during actual panning at a set equivalent shutter speed, the background flows between the reference pixel 503 and the reference pixel 506, and therefore the interval 507 between the reference pixel 503 and the reference pixel 506 is also set. It is necessary to interpolate so that the pixels are connected. Therefore, an LPF having the number of taps having an interval 504 (or interval 505 or interval 507) is applied to the combined image as shown in FIG.

タップ数504を算出する方法、言い換えれば画像間の背景の移動量を算出する方法は、前述したように複数の画像を解析する方法と、撮像装置100の角速度を測定に用いる手法のいずれを用いても良い。複数の画像を解析する方法では、S301〜S303と同様に、領域ごとの移動ベクトルのヒストグラムから、ここでは背景の移動量として、背景の代表的な移動ベクトルを算出する。図6は、画像601と画像602との間で、図3(b)のようなヒストグラムから、背景603の移動ベクトルとして移動ベクトル604が算出されることを示すイメージ図である。   The method of calculating the number of taps 504, in other words, the method of calculating the amount of movement of the background between images, uses either the method of analyzing a plurality of images as described above or the method of using the angular velocity of the imaging device 100 for measurement. May be. In the method of analyzing a plurality of images, as in steps S301 to S303, a representative movement vector of the background is calculated as the amount of movement of the background from the movement vector histogram for each region. FIG. 6 is an image diagram showing that a movement vector 604 is calculated as a movement vector of the background 603 from the histogram as shown in FIG. 3B between the image 601 and the image 602.

ここで、撮像装置100の角速度から背景の移動量を算出する手法について、図7と式1を用いて説明する。   Here, a method for calculating the amount of movement of the background from the angular velocity of the imaging apparatus 100 will be described with reference to FIG.

Figure 0006261205
Figure 0006261205

図7は、カメラがパンニング等で回転した時に、静止している背景が撮像面上でどのように移動するかを表している。   FIG. 7 shows how the stationary background moves on the imaging surface when the camera is rotated by panning or the like.

撮像装置100を701のようにパンニングして、静止している被写体702を撮影した場合、静止している被写体702は、撮像素子102において、702’の位置から702”の位置まで移動する。   When the imaging device 100 is panned like 701 and a stationary subject 702 is photographed, the stationary subject 702 moves from the position 702 ′ to the position 702 ″ on the imaging element 102.

式1を用いて、前述の静止している被写体603の画像上の移動量を算出する。   Using Equation 1, the amount of movement of the stationary subject 603 on the image is calculated.

式(1)に示す通り、静止している被写体、すなわち、背景の移動量705は、パンニングによる撮像装置100の移動角度703と、光学系101の焦点距離fから算出できる。移動角度703は、角速度センサ105で検出された撮像装置100の角速度ωと、単位時間当たりの撮影枚数(フレームレートfps)、サンプリングする画像間にある画像数nを用いて算出する。最後に、画素ピッチppを用いて画像上での背景の移動量705をピクセルに換算する。そして前述したように背景の移動量705に対応するタップ数を、今回のぼかし処理に用いるLPFのタップ数として扱う。   As shown in Expression (1), the moving amount 705 of the stationary subject, that is, the background can be calculated from the moving angle 703 of the imaging device 100 by panning and the focal length f of the optical system 101. The moving angle 703 is calculated using the angular velocity ω of the imaging apparatus 100 detected by the angular velocity sensor 105, the number of images taken per unit time (frame rate fps), and the number of images n between images to be sampled. Finally, the background movement amount 705 on the image is converted into pixels using the pixel pitch pp. As described above, the number of taps corresponding to the background movement amount 705 is handled as the number of taps of the LPF used for the current blurring process.

移動角度703は、各画像に対応した角速度から毎回正確に算出しても、全画像の平均角速度から一括して算出しても良い。   The movement angle 703 may be accurately calculated every time from the angular velocity corresponding to each image, or may be calculated collectively from the average angular velocity of all images.

次に図3のS323における合成画像に対するLPF処理の詳細を、図8を用いて説明する。   Next, details of the LPF processing for the composite image in S323 of FIG. 3 will be described with reference to FIG.

画像801、画像802の主被写体を803とする。図2のS212の主被写体認識で、被写体の移動ベクトルに基づいて画像内の各領域を2値化した主被写体領域マップが、主被写体領域マップ804のように主被写体と背景の境界で正確に分離できるものとする。このとき、S324の画像合成において、LPFをかけた後の画像、すなわち、背景画像805で主被写体領域の画素を用いる必要はほとんどない。したがって、前述した方法で主被写体領域を抽出し、当該主被写体領域を除いた領域、すなわち、背景領域の画素について、前記のようにして設定されたタップ数のLPFをかけた画像を背景画像805とする。   The main subject of the image 801 and the image 802 is 803. In the main subject recognition in S212 of FIG. 2, the main subject region map obtained by binarizing each region in the image based on the subject movement vector is accurately at the boundary between the main subject and the background as in the main subject region map 804. It shall be separable. At this time, in the image composition in S324, it is almost unnecessary to use the pixels of the main subject area in the image after applying the LPF, that is, the background image 805. Therefore, the main subject region is extracted by the above-described method, and an image obtained by applying the LPF of the tap number set as described above to the region excluding the main subject region, that is, the pixels in the background region, is used as the background image 805. And

最後に、S324で、主被写体画像(第1の合成画像)806から主被写体領域を選択し、背景画像(第2の合成画像)805から背景領域を選択して合成し、最終的な合成画像を生成する。当手法は、主被写体が正確に抽出できているときは、主被写体の周囲に残像がほとんど発生しないが、主被写体が正確に抽出できていないときは、主被写体と背景の境界が不自然になる可能性がある。境界が不自然になる対策として境界処理として主被写体領域と背景領域との境界を別途ぼかすフィルタ等のぼかし処理を行うことも考えられるが、主被写体領域と誤判定された領域は、境界処理としてのぼかし処理しか適用されず、やはり不自然に見えてしまう。主被写体領域がうまく抽出できない例として、例えば主被写体と背景の境界にコントラスト差がほとんどない場合がある。また、他にも移動ベクトルが上手く取れず、背景まで主被写体領域として抽出されてしまう可能性や、主被写体の一部が背景領域に分類されてしまう可能性がある。従って、当手法は適用する被写体を選ぶ可能性がある。   Finally, in S324, the main subject region is selected from the main subject image (first composite image) 806, the background region is selected from the background image (second composite image) 805, and the final composite image is selected. Is generated. In this method, when the main subject is correctly extracted, there is almost no afterimage around the main subject, but when the main subject is not correctly extracted, the boundary between the main subject and the background is unnatural. There is a possibility. As a countermeasure to make the boundary unnatural, it may be possible to perform a blurring process such as a filter that blurs the boundary between the main subject area and the background area as a boundary process. Only the blur processing is applied, and it still looks unnatural. As an example in which the main subject region cannot be extracted well, for example, there is a case where there is almost no contrast difference between the main subject and the background. In addition, there is a possibility that the movement vector is not obtained well and the background is extracted as the main subject area, or a part of the main subject is classified as the background area. Therefore, there is a possibility that the subject to select the subject to be applied.

この手法に対して、次のような方法を採用することができる。すなわち、検出された主被写体領域の情報を用いて、主被写体領域周囲の画素を用いて主被写体領域内の画素を補間し、LPFをかけた画像を背景画像807とする。そして主被写体領域マップ808のように、主被写体と背景の境界をぼかし、S324で、主被写体領域の画素値に重みづけしつつ、主被写体画像806と背景画像807を主被写体領域マップ808にしたがって混ぜ合わせながら合成することもできる。   The following method can be adopted for this method. That is, using the information of the detected main subject region, pixels in the main subject region are interpolated using pixels around the main subject region, and an image obtained by applying LPF is set as a background image 807. Then, like the main subject area map 808, the boundary between the main subject and the background is blurred, and in step S324, the main subject image 806 and the background image 807 are weighted according to the main subject area map 808 while weighting the pixel values of the main subject area. It can also be synthesized while mixing.

しかし、本手法においても、主被写体領域が中抜けした主被写体領域809のような形になった場合、合成後の画像の主被写体領域に背景が挿入されたり、映り込んだりする可能性もある。   However, even in this method, when the main subject area has a shape like the main subject area 809 in which the main subject area is omitted, there is a possibility that a background is inserted or reflected in the main subject area of the combined image. .

Figure 0006261205
Figure 0006261205

そこで、本実施形態では以下の手法を用いる。まず、主被写体領域マップ804を、主被写体領域マップ810のように、ぼかし処理にて主被写体と背景の境界をぼかす。これにより主被写体領域マップ809のように中抜けが生じていた場合でも、中抜けの影響を主被写体領域マップ810のように軽減することができる。そして、主被写体画像(第1の合成画像)806に対して、式2のような主被写体領域マップ810の主被写体領域の画素値を係数としたLPFをかける。こうすることで、画像全体をぼかしつつも、主被写体領域の画素が周囲へ広まりにくいようにした背景画像(第2の合成画像)811を作成する。最後に、S324で、主被写体領域マップ810の画素値を重みとして、主被写体画像806と背景画像811を混ぜ合わせながら合成することで、流し撮り画像(第3の合成画像)812を生成する。当手法は、主被写体領域の画素が周囲へ広がることを抑制するだけではなく、中抜けのような場合にも効果がある。式2で示すようなタップ内の係数のLPFでぼかし処理を行うため、主被写体領域として認識された周囲の画素があまり用いられなくなり、低コントラストな領域の画素も単にぼけたような画像となる程度で、目立ちにくい。さらに、主被写体画像と合成することで、主被写体領域と誤判別された領域の不自然さはより目立たなくなる。   Therefore, the following method is used in the present embodiment. First, the main subject area map 804 is blurred as in the main subject area map 810 by blurring processing. As a result, even when a void has occurred as in the main subject region map 809, the influence of the void can be reduced as in the main subject region map 810. Then, the main subject image (first composite image) 806 is subjected to LPF using the pixel value of the main subject region in the main subject region map 810 as shown in Equation 2 as a coefficient. In this way, a background image (second composite image) 811 is created in which the pixels of the main subject region are difficult to spread around while the entire image is blurred. Finally, in S324, the panning image (third composite image) 812 is generated by combining the main subject image 806 and the background image 811 with the pixel value of the main subject region map 810 as a weight and mixing them. This technique not only suppresses the pixels of the main subject area from spreading to the surroundings, but is also effective in the case of a void. Since blur processing is performed with the LPF of the coefficient in the tap as shown in Equation 2, the surrounding pixels recognized as the main subject region are not used much, and the pixels in the low contrast region are also simply blurred. Inconspicuous. Furthermore, by combining with the main subject image, the unnaturalness of the area misidentified as the main subject area becomes less noticeable.

以上のように、本実施形態では、被写体のぶれていない画像を位置合わせして合成し、背景をぼかすぼかし処理を施す。こうすることで、一般的な流し撮りでは撮影が難しいようなシャッター速度での撮影画像と同様の効果を持つ流し撮り風の合成画像を提供することができる。また、複数の画像を合成するに当たって、主被写体を基準とした背景の移動量に応じて背景にぼかし処理を行うことで、より効果的な流し撮り風の合成画像を提供することができる。また、ユーザの所望する流し撮りの相当シャッター速度にあわせて画像の合成枚数を制御することで、より効果的な流し撮り風の合成画像を提供することができる。   As described above, in the present embodiment, the unblurred image is aligned and combined, and the blurring process is performed to blur the background. By doing so, it is possible to provide a panning-like composite image having the same effect as a photographed image at a shutter speed that is difficult to shoot in general panning. Further, when combining a plurality of images, a more effective panning-like composite image can be provided by performing a blurring process on the background according to the amount of movement of the background relative to the main subject. In addition, by controlling the number of images to be combined in accordance with the shutter speed equivalent to the panning desired by the user, a more effective panning-like composite image can be provided.

(第2の実施形態)
第1の実施形態では、ユーザが操作部110を用いて設定するのは、合成画像が相当する流し撮りのシャッター速度(従来の流し撮りで撮影する場合のシャッター速度)だったが、第2の実施形態においては、最終的な画像上で流し撮りの効果として背景を流したい量をユーザーが設定できるようにする。例えば、ユーザは、予め設定されている大中小という3つの効果から効果量を選択して撮影を行う。例えば、効果小はnピクセル、効果中は2nピクセル、効果大は3nピクセルという形で、ぼかす幅を設定することで、効果量を変更する。また、効果量は、ユーザが、事前に任意の幅に設定できるものとする。
(Second Embodiment)
In the first embodiment, the setting by the user using the operation unit 110 is the shutter speed of the panning shot corresponding to the composite image (the shutter speed when shooting with the conventional panning shot). In the embodiment, the user can set the amount of the background to be flowed as the effect of panning on the final image. For example, the user performs shooting by selecting an effect amount from three effects of large, medium, and small that are set in advance. For example, the effect amount is changed by setting the blur width in the form of n pixels for the small effect, 2n pixels for the effect, and 3n pixels for the large effect. The effect amount can be set to an arbitrary width in advance by the user.

撮像装置100の構成は第1の実施形態と同様であるため、説明を省略する。   Since the configuration of the imaging apparatus 100 is the same as that of the first embodiment, description thereof is omitted.

図9は、S213で行われる流し撮り合成の詳細を示したフローチャートである。   FIG. 9 is a flowchart showing details of the panning composition performed in S213.

S901で、CPU103は、S212で位置合わせされた複数の画像を合成することで、時間の経過に伴う主被写体の変化を、ぶれを抑えた上で表現した画像を生成する。   In step S <b> 901, the CPU 103 combines the plurality of images aligned in step S <b> 212 to generate an image that expresses changes in the main subject over time while suppressing blurring.

S902で、CPU103は、現在、対象の画像に適用している総流し量を格納する変数を初期化する。   In step S <b> 902, the CPU 103 initializes a variable that stores the total flow amount currently applied to the target image.

S903で、CPU103は、S212で位置合わせされた2画像間にかけるローパスフィルタのタップ数を算出値として算出する。タップ数の算出方法の詳細は後述する。   In S903, the CPU 103 calculates the number of taps of the low-pass filter applied between the two images aligned in S212 as a calculated value. Details of the tap count calculation method will be described later.

S904は、算出値のタップ数のLPFを現在の対象画像にかけたときに、現在の対象画像までを合成して得られる合成画像の流し量が、ユーザから設定された前述の効果量(流し量)の設定値をオーバーしないかを、総流し量+算出値と、設定値との比較演算により判定する。   In S904, when the LPF having the calculated number of taps is applied to the current target image, the flow amount of the composite image obtained by combining up to the current target image is the above-described effect amount (flow amount) set by the user. ) Is not exceeded by a comparison operation between the total flow amount + calculated value and the set value.

総流し量+算出値が設定値をオーバーした場合は、S905で、算出値として、設定値と総流し量の差を新たに設定することで、設定値をオーバーしないようにする。   If the total flow amount + calculated value exceeds the set value, the difference between the set value and the total flow amount is newly set as the calculated value in S905 so that the set value is not exceeded.

S906で、CPU103は、2画像のうち、先に撮影された画像に対して、LPFをかけることで不足画素を補う。   In step S <b> 906, the CPU 103 compensates for the deficient pixels by applying LPF to the previously captured image of the two images.

S907で、CPU103は、総流し量に今回のLPFの流し量を追加する。   In S907, the CPU 103 adds the current LPF flow rate to the total flow rate.

S908は、総流し量が設定された効果量に達するかを判定する。   In S908, it is determined whether the total flow amount reaches the set effect amount.

総流し量が設定された効果量に達しなかった場合は、S909により、次の画像に対して、S903〜S907の動作を繰り返し行う。   If the total flow amount does not reach the set effect amount, the operations of S903 to S907 are repeated for the next image in S909.

以降は、S908で、総流し量が設定された効果量に達した後の処理である。   The subsequent processing is processing after the total flow amount reaches the set effect amount in S908.

S910で、CPU103は、S903〜S908で、LPFをかけた全ての画像を合成することで、背景の流れを表現した画像を作成する。なお、本実施形態では、S906にて合成前の各撮影画像に対して、S903にて決まるタップ数でLPF処理を施してから、S910で合成している。しかし、S903で決まるタップ数の例えば最大値を保持しておき、S905の調整が入る前までの画像については合成後に当該最大値のタップ数でLPF処理を施しても良い。   In step S910, the CPU 103 generates an image representing the background flow by combining all the images subjected to the LPF in steps S903 to S908. In the present embodiment, LPF processing is performed on each captured image before combination in S906 with the number of taps determined in S903, and then combined in S910. However, for example, the maximum value of the number of taps determined in S903 may be held, and the LPF process may be performed on the image before the adjustment in S905 with the maximum number of taps after synthesis.

S911で、CPU103は、S901で合成した位置合わせ合成画像、すなわち、主被写体画像(第1の合成画像)と、S910で合成したLPF合成画像(第2の合成画像)、すなわち、背景画像を合成する。これにより、流し撮りと同様の効果を持つ第3の合成画像を作成する。   In step S911, the CPU 103 combines the alignment composite image combined in step S901, that is, the main subject image (first composite image) and the LPF composite image (second composite image) combined in step S910, that is, the background image. To do. As a result, a third composite image having the same effect as the panning is created.

図9、S902〜S910におけるLPFに関する一連の処理の詳細を、図10を用いて説明する。図10(a)はLPFのタップ数の概念を示す図である。   Details of a series of processing relating to LPF in FIG. 9 and S902 to S910 will be described with reference to FIG. FIG. 10A is a diagram showing the concept of the number of taps of the LPF.

背景1001が、背景1002、背景1003、背景1006と変化し、かつ、全体的な流し量(総流し量)を1008としたい場合、背景の移動量1004、背景の移動量1005の間を補間する必要がある。しかしながら、最終的な目標値(設定値)は総流し量1008であるため、背景1003と背景1006の間をすべて埋めるように補間してしまうと総流し量はユーザの流し量の設定値1008をオーバーすることになる。この状況が図9のS904でYESとなった場合に対応する。このような場合、背景1003と背景1009の間においては、図10(a)に示すようにLPFのタップ数の目標値を1009に変更し(S905)、1003と1009の間である1007のみを補間する。   When the background 1001 changes to the background 1002, the background 1003, and the background 1006, and the overall flow amount (total flow amount) is 1008, interpolation is performed between the background movement amount 1004 and the background movement amount 1005. There is a need. However, since the final target value (set value) is the total flow amount 1008, if interpolation is performed so as to fill the entire space between the background 1003 and the background 1006, the total flow amount becomes the set value 1008 of the user's flow amount. It will be over. This situation corresponds to the case where S904 in FIG. 9 is YES. In such a case, between the background 1003 and the background 1009, the target value of the LPF tap number is changed to 1009 as shown in FIG. 10A (S905), and only 1007 between 1003 and 1009 is changed. Interpolate.

前記1007は、最終的な目標値である総流し量1008と、背景1001〜背景1003における流し量1004、1005の差から求めることができる。このようにして、S907において、現在の処理対象の画像までのLPFのタップ数(ぼかし量)を現在の流し量として蓄積することで、合成枚数の増加に伴う総流し量の変化を把握し、適切な枚数、適切な効果量での流し撮り合成を可能とする。   1007 can be obtained from the difference between the total flow amount 1008 that is the final target value and the flow amounts 1004 and 1005 in the background 1001 to the background 1003. In this way, in S907, by accumulating the number of taps (blurring amount) of the LPFs up to the current image to be processed as the current flow amount, the change in the total flow amount with the increase in the number of combined images is grasped. Enables panning composition with appropriate number of sheets and appropriate effect amount.

それ以外の構成やフローは基本的に実施例1と同様である。ただし、前述の通り、実施例1では、LPFのタップ数は、不足画素を補うものだけでしかなかったが、本実施形態では、流し撮りの効果量に基づき制御する。   Other configurations and flows are basically the same as those in the first embodiment. However, as described above, in the first embodiment, the number of taps of the LPF is only for compensating for the insufficient pixels, but in the present embodiment, the number of taps is controlled based on the effect amount of the panning.

なお、主被写体の速度が短時間で変わることは稀なため、背景の画像間における移動量の平均値、あるいは、最大値を算出し、最初の画像から最後一つ手前の画像までは、前記値を用いて、同じタップ数のLPFをかけても良い。当手法を用いると、合成可能枚数を最初に算出することもできるため、処理の高速化にもつながる。   Since the speed of the main subject rarely changes in a short time, the average value or the maximum value of the movement amount between the background images is calculated, and from the first image to the last image, You may apply LPF of the same number of taps using a value. If this method is used, the number of images that can be combined can be calculated first, which leads to faster processing.

図12は、上記各実施形態にかかわるUIの構成の一例であり、表示部105により表示される画面を示した図である。   FIG. 12 is an example of a UI configuration according to each of the above embodiments, and is a diagram illustrating a screen displayed by the display unit 105.

画像選択ボタン1201は、流し撮り効果を付与したい画像を選択する指示を受け付ける。画像選択ボタン1201がタッチ、あるいはカーソル等により選択されると、CPU103が画像選択ボタン1201による指示を受け、記録媒体107内の対象画像候補あるいは対象画像候補のファイル名を、スクロール表示あるいは一覧表示する。ユーザは一覧表示された画像の中から処理対象となる画像を選択する。   The image selection button 1201 receives an instruction to select an image to which a panning effect is desired. When the image selection button 1201 is touched or selected by a cursor or the like, the CPU 103 receives an instruction from the image selection button 1201 and scrolls or displays a list of target image candidates or target image candidate file names in the recording medium 107. . The user selects an image to be processed from the displayed images.

モード選択ボタン1202は、画像を手動で編集するか、自動で編集するかを選択する指示を受け付ける。画像を手動で編集する場合は、対象の画像あるいは画像群の選択、流し撮りの効果量の選択、調整等をユーザ自身で行う。自動で編集するを選択した場合、対象の画像あるいは画像群から画像解析により自動で流し量を設定し処理を行う。また、対象画像の選定も、画像のヘッダ情報などを参照して、例えば一番最後に連写された画像群を対象とするなど、自動で決定しても良い。   The mode selection button 1202 accepts an instruction for selecting whether to edit an image manually or automatically. When an image is manually edited, the user himself selects the target image or image group, selects and adjusts the effect amount of panning. If automatic editing is selected, the flow amount is automatically set from the target image or image group by image analysis, and processing is performed. In addition, the selection of the target image may be automatically determined by referring to the header information of the image, for example, targeting the last group of continuously shot images.

効果選択ボタン1203は、どれだけ背景を流すか、流し撮りの効果量を選択する指示を受け付ける。上記各実施形態では、効果量としての背景の流し量は、相当するシャッター速度かあるいは効果小、中、大か、あるいはピクセル数を入力するかのいずれかで指定する。しかし、これに限らず、流し量を設定するUIとしては、例えば合成対象の画像のいずれかを表示部105によって表示媒体に表示し、効果量の大小をバーのアイコンで表示し、バー上の指標をタッチ操作で動かすことで、効果量の大小を設定してもよい。また、表示された画像の背景部分のいずれかをタッチしたまま所定方向にドラッグしたり、流しの開始点と終了点を規定する少なくとも2点をタッチすることで、所定方向に指示された長さ分だけ流し量を与えた合成画像を生成するようにしてもよい。流し量が規定できるタッチ操作であれば、上記に限らない。   The effect selection button 1203 receives an instruction to select how much the background is to be played and the effect amount of the panning shot. In each of the embodiments described above, the background flow amount as the effect amount is designated by either the corresponding shutter speed, the effect small, medium, large, or the number of pixels input. However, the UI for setting the flow amount is not limited to this. For example, one of the images to be combined is displayed on the display medium by the display unit 105, the magnitude of the effect amount is displayed as a bar icon, The magnitude of the effect amount may be set by moving the index by a touch operation. In addition, by dragging in a predetermined direction while touching one of the background parts of the displayed image, or by touching at least two points that define the start and end points of the sink, the length indicated in the predetermined direction You may make it produce | generate the synthetic | combination image which gave the flow amount only by the part. The touch operation is not limited to the above as long as the flow amount can be defined.

結果画像表示部1204は、それぞれの条件で生成された合成画像を複数一覧表示できるようになっている。各合成画像の編集の設定値(流し量など)は領域1205に表示される。図12では効果量の小、中、大で一覧表示されているが、シャッター速度を3段階設定して一覧表示させるなどしても良い。また、合成対象となる画像群の中でどの画像を合成するかのパターンを変えたものを一覧表示させても良い。   The result image display unit 1204 can display a plurality of composite images generated under the respective conditions. Setting values (such as a flow amount) for editing each composite image are displayed in an area 1205. In FIG. 12, the effect amount is listed as small, medium, or large, but the shutter speed may be set in three stages and displayed as a list. Further, a list of images in which the pattern of which images are to be combined among the image groups to be combined may be displayed.

保存ボタン1206は、結果画像表示部1204に表示された画像を記録媒体に記録する指示を受け付ける。   A save button 1206 receives an instruction to record the image displayed on the result image display unit 1204 on a recording medium.

設定表示部1207は、現在の編集モードや記録画像に設定されている効果量など、現在のステータスを表示する。   The setting display unit 1207 displays the current status such as the current editing mode and the effect amount set for the recorded image.

初期画像表示部1208は、選択された画像あるいは画像群のうちの1つを初期画像として表示する。初期画像として表示される画像は画像群のうちの何れでもよいが、例えば時系列的に最初の画像や、位置合わせ等で基準になり得る時系列的に中間にいる画像などが表示される。表示されている画像をタッチあるいはカーソルで選択することにより、表示画像を、画像群として選択された画像内で、変更できるようにしても良い。   The initial image display unit 1208 displays one of the selected image or image group as an initial image. The image displayed as the initial image may be any of the group of images. For example, the first image in time series or the image in the middle in time series that can be used as a reference for alignment or the like is displayed. The displayed image may be changed within the image selected as the image group by touching or selecting the displayed image with a cursor.

画像情報表示部1209は初期画像、画像群全体、保存された合成画像いずれかの画像情報を表示する。例えば、保存ボタン1206により結果画像が保存された直後には、結果画像表示部1204には保存された結果画像が大きく一枚表示され、画像情報表示部1209には結果画像のファイル名、焦点距離、流し量や流し量に相当するシャッター速度などが表示される。   The image information display unit 1209 displays image information of one of the initial image, the entire image group, and the stored composite image. For example, immediately after the result image is saved by the save button 1206, one large result image is displayed on the result image display unit 1204, and the file name and focal length of the result image are displayed on the image information display unit 1209. The flow rate and the shutter speed corresponding to the flow rate are displayed.

以上のように、本実施形態では、被写体のぶれていない画像を位置合わせして合成し、背景をぼかすぼかし処理を施す。こうすることで、一般的な流し撮りでは撮影が難しいようなシャッター速度での撮影画像と同様の効果を持つ流し撮り風の合成画像を提供することができる。また、複数の画像を合成するに当たって、主被写体を基準とした背景の移動量に応じて背景にぼかし処理を行うことで、より効果的な流し撮り風の合成画像を提供することができる。また、主被写体の速度にかかわらず、ユーザが背景を流したい流し量での撮影ができるため、流し撮りで最も重要な設定項目であるシャッター速度を適切にすることを意識しなくても、適切な流し撮り風の合成画像の生成が可能となる。   As described above, in the present embodiment, the unblurred image is aligned and combined, and the blurring process is performed to blur the background. By doing so, it is possible to provide a panning-like composite image having the same effect as a photographed image at a shutter speed that is difficult to shoot in general panning. Further, when combining a plurality of images, a more effective panning-like composite image can be provided by performing a blurring process on the background according to the amount of movement of the background relative to the main subject. In addition, because the user can shoot at the amount of sinking that the background wants to flow regardless of the speed of the main subject, it is appropriate even without being aware of the appropriate shutter speed, which is the most important setting item in panning. It is possible to generate a composite image in the form of a panning shot.

(他の実施形態)
本発明の目的は以下のようにしても達成できる。すなわち、前述した各実施形態の機能を実現するための手順が記述されたソフトウェアのプログラムコードを記録した記憶媒体を、システムまたは装置に供給する。そしてそのシステムまたは装置のコンピュータ(またはCPU、MPU等)が記憶媒体に格納されたプログラムコードを読み出して実行するのである。
(Other embodiments)
The object of the present invention can also be achieved as follows. That is, a storage medium in which a program code of software in which a procedure for realizing the functions of the above-described embodiments is described is recorded is supplied to the system or apparatus. The computer (or CPU, MPU, etc.) of the system or apparatus reads out and executes the program code stored in the storage medium.

この場合、記憶媒体から読み出されたプログラムコード自体が本発明の新規な機能を実現することになり、そのプログラムコードを記憶した記憶媒体およびプログラムは本発明を構成することになる。   In this case, the program code itself read from the storage medium realizes the novel function of the present invention, and the storage medium and program storing the program code constitute the present invention.

また、プログラムコードを供給するための記憶媒体としては、例えば、フレキシブルディスク、ハードディスク、光ディスク、光磁気ディスクなどが挙げられる。また、CD−ROM、CD−R、CD−RW、DVD−ROM、DVD−RAM、DVD−RW、DVD−R、磁気テープ、不揮発性のメモリカード、ROM等も用いることができる。   Examples of the storage medium for supplying the program code include a flexible disk, a hard disk, an optical disk, and a magneto-optical disk. Further, a CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD-R, magnetic tape, nonvolatile memory card, ROM, or the like can also be used.

また、コンピュータが読み出したプログラムコードを実行可能とすることにより、前述した各実施形態の機能が実現される。さらに、そのプログラムコードの指示に基づき、コンピュータ上で稼動しているOS(オペレーティングシステム)等が実際の処理の一部または全部を行い、その処理によって前述した各実施形態の機能が実現される場合も含まれる。   Further, by making the program code read by the computer executable, the functions of the above-described embodiments are realized. Furthermore, when the OS (operating system) running on the computer performs part or all of the actual processing based on the instruction of the program code, the functions of the above-described embodiments are realized by the processing. Is also included.

更に、以下の場合も含まれる。まず記憶媒体から読み出されたプログラムコードが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書き込まれる。その後、そのプログラムコードの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPU等が実際の処理の一部または全部を行う。   Furthermore, the following cases are also included. First, the program code read from the storage medium is written in a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer. Thereafter, based on the instruction of the program code, the CPU or the like provided in the function expansion board or function expansion unit performs part or all of the actual processing.

また、本発明はデジタルカメラのような撮影を主目的とした機器にかぎらず、携帯電話、パーソナルコンピュータ(ラップトップ型、デスクトップ型、タブレット型など)、ゲーム機など、撮像装置を内蔵もしくは外部接続する任意の機器に適用可能である。従って、本明細書における「撮像装置」は、撮像機能を備えた任意の電子機器を包含することが意図されている。   In addition, the present invention is not limited to devices such as digital cameras, but includes built-in or external connection of imaging devices such as mobile phones, personal computers (laptop type, desktop type, tablet type, etc.), game machines, etc. It can be applied to any device. Therefore, the “imaging device” in this specification is intended to include any electronic device having an imaging function.

100 撮像装置
101 光学系
102 撮像素子
103 中央演算装置(CPU)
104 一次記憶装置
105 角速度センサ
106 画像処理装置
107 記録媒体
108 二次記憶装置
109 表示部
110 操作部
DESCRIPTION OF SYMBOLS 100 Image pick-up device 101 Optical system 102 Image pick-up element 103 Central processing unit (CPU)
104 Primary storage device 105 Angular velocity sensor 106 Image processing device 107 Recording medium 108 Secondary storage device 109 Display unit 110 Operation unit

Claims (10)

撮像手段により撮像される複数の画像について主被写体領域と前記主被写体領域とは異なる背景領域を特定する特定手段と、
前記複数の画像の前記主被写体領域を位置合わせし、
前記背景領域にローパスフィルタを適用して所定のぼかし処理を加えた合成画像を生成する合成手段と、
前記複数の画像について、前記背景領域の画像または前記撮像手段の振れの情報に基づいて、前記複数の画像間での前記背景領域の移動量を検出する検出手段と、
前記検出手段により検出される前記複数の画像間での前記背景領域の移動量に基づき前記ぼかし処理におけるぼかし量を制御する制御手段と、を有し、
前記制御手段は、前記ローパスフィルタのタップ数を前記ぼかし量に対応させて制御するとともに、前記ローパスフィルタのタップ内の係数を前記合成画像の領域に応じて制御することを特徴とする画像処理装置。
A specifying unit for specifying a main subject region and a background region different from the main subject region for a plurality of images captured by the imaging unit;
Aligning the main subject areas of the plurality of images;
A combining unit that generates a combined image obtained by applying a predetermined blurring process by applying a low-pass filter to the background region;
Detecting means for detecting the amount of movement of the background area between the plurality of images based on the image of the background area or information on shake of the imaging means for the plurality of images;
Have a, and a control means for controlling the amount of blur in the blurring process on the basis of the amount of movement of the background region between the plurality of images detected by the detection unit,
Said control means, said controls to correspond to the amount of blurring the number of taps of the low-pass filter, image processing, wherein the control child in accordance with coefficients in the taps of said low-pass filter in the region of the synthesized image apparatus.
前記合成画像における前記背景領域の流し量を設定する設定手段を有し、
前記合成手段は、前記設定手段によって設定された流し量に基づいて、合成する画像数を制御することを特徴とする請求項1に記載の画像処理装置。
Setting means for setting a flow amount of the background region in the composite image;
The image processing apparatus according to claim 1, wherein the combining unit controls the number of images to be combined based on the flow amount set by the setting unit.
前記流し量とは前記合成画像の相当するシャッター速度に対応する情報であり、
前記合成手段は、合成に用いる画像のシャッター速度の合計が、前記設定手段により設定されるシャッター速度となるように、合成する画像数を制御することを特徴とする請求項2に記載の画像処理装置。
The flow amount is information corresponding to the shutter speed corresponding to the composite image,
3. The image processing according to claim 2, wherein the synthesizing unit controls the number of images to be synthesized so that a total shutter speed of images used for synthesis becomes a shutter speed set by the setting unit. apparatus.
前記流し量とは、前記合成画像における前記背景領域の流れる幅に対応する情報であり、
前記合成手段は、前記背景領域の移動量と前記流し量に基づいて、合成する画像数を制御することを特徴とする請求項2に記載の画像処理装置。
The amount of flow is information corresponding to the flow width of the background region in the composite image,
The image processing apparatus according to claim 2, wherein the synthesizing unit controls the number of images to be synthesized based on the movement amount of the background region and the flow amount.
前記検出手段は、前記複数の画像間で移動ベクトルを算出し、当該移動ベクトルに基づいて前記背景領域の移動量を検出することを特徴とする請求項1乃至のいずれか1つに記載の画像処理装置。 Said detecting means, said calculating a motion vector between a plurality of images, according to any one of claims 1 to 4, characterized in that to detect the moving amount of the background area based on the movement vector Image processing device. 前記検出手段は、前記撮像手段の振れの情報に基づいて前記背景領域の移動量を検出することを特徴とする請求項1乃至のいずれか1つに記載の画像処理装置。 The detecting device, an image processing apparatus according to any one of claims 1 to 4, characterized in that to detect the moving amount of the background region on the basis of the shake information of the image pickup means. 前記特定手段は、前記複数の画像間で移動ベクトルを算出し、当該移動ベクトルに基づいて前記被写体領域を特定することを特徴とする請求項1乃至のいずれか1つに記載の画像処理装置。 The specifying unit may calculate a motion vector between the plurality of images, the image processing according to any one of claims 1 to 6, wherein the identifying the main subject area based on the movement vector apparatus. 前記特定手段は、前記撮像手段の振れの情報に基づいて前記被写体領域を特定することを特徴とする請求項1乃至のいずれか1つに記載の画像処理装置。 The specifying unit, an image processing apparatus according to any one of claims 1 to 6, wherein the identifying the main subject area based on the shake information of the image pickup means. 前記複数の画像を表示媒体に表示する表示手段と、
前記表示媒体へのタッチ操作を検知する検知手段と、を有し、
前記制御手段は、前記表示媒体に表示された画像へのタッチ操作を検知して、前記合成画像における前記背景領域の流し量を設定することを特徴とする請求項乃至のいずれか1つに記載の画像処理装置。
Display means for displaying the plurality of images on a display medium;
Detecting means for detecting a touch operation on the display medium,
Said control means detects the touch operation on the display medium in the displayed image, any one of claims 2 to 8, characterized in that for setting the flow amount of the background region in the composite image An image processing apparatus according to 1.
撮像手段により撮像される複数の画像について主被写体領域と前記主被写体領域とは異なる背景領域を特定する特定ステップと、
前記複数の画像の前記主被写体領域を位置合わせし、前記背景領域にローパスフィルタを適用して所定のぼかし処理を加えた合成画像を生成する合成ステップと、
前記複数の画像について、前記背景領域の画像または前記撮像手段の振れの情報に基づいて、前記複数の画像間での前記背景領域の移動量を検出する検出ステップと、
前記検出ステップにより検出される前記複数の画像間での前記背景領域の移動量に基づき前記ぼかし処理におけるぼかし量を制御する制御ステップと、を有し、
前記制御ステップにおいて、前記ローパスフィルタのタップ数を前記ぼかし量に対応させて制御するとともに、前記ローパスフィルタのタップ内の係数を前記合成画像の領域に応じて制御することを特徴とする画像処理方法。
A specifying step for specifying a main subject region and a background region different from the main subject region for a plurality of images picked up by the image pickup means;
A step of aligning the main subject areas of the plurality of images, and applying a low-pass filter to the background area to generate a composite image with a predetermined blurring process;
Detecting the amount of movement of the background region between the plurality of images based on the image of the background region or information on shake of the imaging means for the plurality of images;
Have a, and a control step of controlling the amount of blur in the blurring process on the basis of the amount of movement of the background region between the plurality of images detected by the detecting step,
In the control step, the controls so as to correspond to the amount of blurring the number of taps of the low-pass filter, image processing, wherein the control child in accordance with coefficients in the taps of said low-pass filter in the region of the synthesized image Method.
JP2013136922A 2013-06-28 2013-06-28 Image processing device Expired - Fee Related JP6261205B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2013136922A JP6261205B2 (en) 2013-06-28 2013-06-28 Image processing device
US14/286,848 US9432575B2 (en) 2013-06-28 2014-05-23 Image processing apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013136922A JP6261205B2 (en) 2013-06-28 2013-06-28 Image processing device

Publications (3)

Publication Number Publication Date
JP2015012481A JP2015012481A (en) 2015-01-19
JP2015012481A5 JP2015012481A5 (en) 2016-08-12
JP6261205B2 true JP6261205B2 (en) 2018-01-17

Family

ID=52305265

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013136922A Expired - Fee Related JP6261205B2 (en) 2013-06-28 2013-06-28 Image processing device

Country Status (1)

Country Link
JP (1) JP6261205B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6577703B2 (en) * 2014-08-05 2019-09-18 キヤノン株式会社 Image processing apparatus, image processing method, program, and storage medium
JP6465705B2 (en) * 2015-03-16 2019-02-06 キヤノン株式会社 Motion vector detection device, moving object angular velocity calculation device, imaging device, and lens device
US9591237B2 (en) * 2015-04-10 2017-03-07 Qualcomm Incorporated Automated generation of panning shots
JP6594180B2 (en) * 2015-11-25 2019-10-23 キヤノン株式会社 IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, AND PROGRAM
CN113315903B (en) * 2020-02-26 2023-08-22 北京小米移动软件有限公司 Image acquisition method and device, electronic equipment and storage medium
WO2022195910A1 (en) * 2021-03-15 2022-09-22 ソニーグループ株式会社 Control device, control method, and program

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007074031A (en) * 2005-09-02 2007-03-22 Canon Inc Imaging device, and image processing apparatus and method therefor
JP5179398B2 (en) * 2009-02-13 2013-04-10 オリンパス株式会社 Image processing apparatus, image processing method, and image processing program
JP5018937B2 (en) * 2010-07-16 2012-09-05 カシオ計算機株式会社 Imaging apparatus and image processing program

Also Published As

Publication number Publication date
JP2015012481A (en) 2015-01-19

Similar Documents

Publication Publication Date Title
JP6157242B2 (en) Image processing apparatus and image processing method
US9432575B2 (en) Image processing apparatus
JP6288952B2 (en) Imaging apparatus and control method thereof
JP6261205B2 (en) Image processing device
WO2016002228A1 (en) Image-capturing device
JP5237721B2 (en) Imaging device
JP5262417B2 (en) Image processing apparatus, image processing method, and image processing program
JP5806623B2 (en) Imaging apparatus, imaging method, and program
JP2007124279A (en) Image processor
JP2009017223A (en) Imaging device, image processing device, and their image processing method and program
JP2011114823A (en) Image processing apparatus, and imaging apparatus
JP2019176249A (en) Image processing device, image processing method, image processing program, and imaging device
JP2015040941A (en) Image-capturing device, control method therefor, and program
JP2015012482A (en) Image processing apparatus and image processing method
JP2019047336A (en) Image processing apparatus, imaging device, image processing method, and program
JP5402242B2 (en) Image reproduction apparatus, imaging apparatus, image reproduction method, and image reproduction program
JP2009044329A (en) Program, image processing method, and image processor
JP2023033355A (en) Image processing device and control method therefor
JP2011193066A (en) Image sensing device
JP2015233211A (en) Imaging apparatus, control method thereof, and program
JP7353821B2 (en) Image processing device, its control method, program
JP2019047436A (en) Image processing device, image processing method, image processing program, and imaging device
JP2014138378A (en) Image pickup device, control method thereof, and control program thereof
JP2012186538A (en) Electronic camera, image display device, program, and recording medium
JP2012142978A (en) Image processor

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160624

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160624

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170330

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170509

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170620

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20171212

R151 Written notification of patent or utility model registration

Ref document number: 6261205

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees