JP2015012482A - Image processing apparatus and image processing method - Google Patents

Image processing apparatus and image processing method Download PDF

Info

Publication number
JP2015012482A
JP2015012482A JP2013136923A JP2013136923A JP2015012482A JP 2015012482 A JP2015012482 A JP 2015012482A JP 2013136923 A JP2013136923 A JP 2013136923A JP 2013136923 A JP2013136923 A JP 2013136923A JP 2015012482 A JP2015012482 A JP 2015012482A
Authority
JP
Japan
Prior art keywords
images
alignment
movement vector
image processing
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Abandoned
Application number
JP2013136923A
Other languages
Japanese (ja)
Inventor
洋晃 朽木
Hiroaki Kuchiki
洋晃 朽木
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 JP2013136923A priority Critical patent/JP2015012482A/en
Priority to US14/286,848 priority patent/US9432575B2/en
Publication of JP2015012482A publication Critical patent/JP2015012482A/en
Abandoned legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide an image processing apparatus which aligns images by suppressing impact of any erroneous detection of a mobile vector when aligning three or more images, and aligns images by predominantly suppressing blurring of one particular part of a main object.SOLUTION: An image processing apparatus comprises: calculating means that calculates a mobile vector for every divided area in three or more images acquired by imaging means; aligning means that aligns the plurality of images on the basis of the mobile vector calculated by the calculating means; and counting means that counts the number of times the mobile vector used by the aligning means in which the mobile vector is in every divided area. The aligning means identifies a mobile vector used for the alignment of images by using the number of times counted by the counting means from the mobile vector calculated by the calculating means.

Description

本発明は、撮影で得られた複数の画像を位置合わせして合成する画像処理装置及び画像処理方法に関する。   The present invention relates to an image processing apparatus and an image processing method for aligning and synthesizing a plurality of images obtained by photographing.

移動している被写体のスピード感を表現する撮影技術として流し撮りがある。前記撮影技術は、撮影者が被写体の動きに合わせてカメラをパンニングすることにより、移動している被写体を撮影画像内では静止させて背景は流れるように写すことを目的とする。一般的な流し撮りは、撮影したい被写体(主被写体)の移動速度に合わせてシャッター速度を通常より遅めに調節することで撮影を行う。しかしながら、シャッター速度を遅くしているため、手ぶれや主被写体の移動速度とパンニング速度の差の影響により、主被写体までぶれた画像になることも多い。前記問題を鑑み、画像処理技術による流し撮りの容易化が望まれている。   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では、まず、ある一つの画像から特徴点を抽出し、特徴点から基準位置へのベクトルを算出する。次に、もう一つの画像からも特徴点を抽出し、最初の画像から算出された結果に基づいて、対応するベクトルの指し示す画素位置を算出する。そして、画素位置の算出回数を各画素ごとに集計し、集計結果に基づいて、二つの画像の位置を合わせる位置合わせ装置が開示されている。   For example, in Patent Document 1, image processing for detecting the start position with respect to the direction of motion of a moving object included in a plurality of images and adjusting the position of the moving object so that the detected start position is the same position on each image. An apparatus is disclosed. In Patent Document 2, first, a feature point is extracted from a certain image, and a vector from the feature point to a reference position is calculated. Next, feature points are extracted from another image, and the pixel position indicated by the corresponding vector is calculated based on the result calculated from the first image. An alignment device is disclosed in which the number of pixel position calculations is totaled for each pixel, and the positions of the two images are aligned based on the total result.

特開2012−109899号公報JP 2012-109899 A 特開平10−91788号公報JP-A-10-91788

しかしながら、上述の特許文献1に開示された従来技術では、動体の先頭位置を基準に位置を合わせているため、先頭位置の動き検出に誤りがあった場合には影響を受けやすい。また、動体の先頭位置以外をどのように扱うかまでは開示されていない。   However, in the prior art disclosed in Patent Document 1 described above, since the position is adjusted based on the leading position of the moving object, if there is an error in motion detection at the leading position, it is easily affected. Also, it is not disclosed how to handle other than the moving object head position.

特許文献2に開示された従来技術では、2画像間における位置合わせを前提としており、3画像以上の位置合わせにおける画像間の関係性までは開示されていない。   The prior art disclosed in Patent Document 2 is based on the premise of alignment between two images, and does not disclose the relationship between images in alignment of three or more images.

そこで、本発明の目的は、3以上の画像の位置合わせにおいて、移動ベクトル誤検出時の影響を抑制して位置を合わせる画像処理装置及び画像処理方法を提供すること。また、主被写体のある一部分のぶれを重点的に抑制した位置合わせを可能とする画像処理装置及び画像処理方法を提供することである。   SUMMARY OF THE INVENTION Accordingly, an object of the present invention is to provide an image processing apparatus and an image processing method for aligning three or more images by aligning the positions while suppressing the influence of erroneous movement vector detection. It is another object of the present invention to provide an image processing apparatus and an image processing method that enable alignment while focusing on blurring of a part of a main subject.

上記目的を達成するために、本発明の画像処理装置は、撮像手段により撮像される少なくとも3以上の複数の画像において、分割した領域ごとの移動ベクトルを算出する算出手段と、前記算出手段により算出される移動ベクトルに基づいて前記複数の画像を位置合わせする位置合わせ手段と、前記分割した領域ごとに、前記位置合わせ手段で用いられる移動ベクトルを有した回数をカウントするカウント手段と、を有し、前記位置合わせ手段は、前記算出手段により算出される移動ベクトルから、前記カウント手段によりカウントされる回数を用いて、画像間の位置合わせで用いる移動ベクトルを特定することを特徴とする。   In order to achieve the above object, an image processing apparatus of the present invention calculates a movement vector for each divided area in at least three or more images captured by an imaging unit, and calculates by the calculation unit. Positioning means for aligning the plurality of images based on the movement vector to be performed, and counting means for counting the number of times the movement vector used in the alignment means is used for each of the divided areas. The alignment means specifies a movement vector used for alignment between images using the number of times counted by the counting means from the movement vector calculated by the calculation means.

本発明によれば、3以上の画像の位置合わせにおいて、移動ベクトル誤検出時の影響を抑制して位置を合わせることができる。また、主被写体のある一部分のぶれを重点的に抑制した位置合わせを可能とする。   According to the present invention, in the alignment of three or more images, it is possible to align the positions while suppressing the influence at the time of erroneous detection of the movement vector. In addition, it is possible to perform alignment while mainly suppressing the shake of a part of the main subject.

第1の実施形態にかかわる撮像装置の基本構成図1 is a basic configuration diagram of an imaging apparatus according to a first embodiment. 第1の実施形態にかかわるCPUの処理のフローチャートFlowchart of CPU processing according to the first embodiment 第1の実施形態にかかわる主被写体と探索領域の説明図Explanatory drawing of a main subject and a search area according to the first embodiment 第1の実施形態にかかわる位置合わせのフローチャートFlow chart of alignment according to the first embodiment 第1の実施形態にかかわる位置合わせの説明図Explanatory drawing of the alignment concerning 1st Embodiment 第2の実施形態にかかわるCPUの処理のフローチャートFlowchart of CPU processing according to the second embodiment 第2の実施形態にかかわる位置合わせのフローチャートFlow chart of alignment according to the second embodiment 第2の実施形態にかかわる位置合わせの説明図Explanatory drawing of the alignment concerning 2nd Embodiment 本発明の実施形態にかかわる流し撮り撮影で生成される画像のイメージ図FIG. 4 is an image diagram of an image generated by panning shooting according to an embodiment of the present invention.

(第1の実施形態)
図1は、本発明の第1の実施形態にかかわる画像処理装置の一例としての撮像装置のブロック図である。
(First embodiment)
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 such as a CCD (Charge Coupled Device) or a CMOS (Complementary Metal Oxide Semiconductor) 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 according to an instruction from the CPU 103. The present embodiment has a live view (viewfinder) display function for sequentially displaying at least 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から設定可能である。   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.

画像処理部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 may be a number that is automatically calculated from the speed of the main subject, the amount of panning, a setting that blurs the background area, and the like.

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, a moving subject area (moving body area) is detected as a main subject area for panning. That is, a stationary object (stationary object) among a plurality of shootings is handled 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 by the same amount 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によって得られる角速度から算出できる。これに限らず、例えば、主被写体領域が撮影された複数の画像間で一致するように位置合わせを行って加算し、さらに合成後の画像の主被写体領域、つまり動体の存在する動体領域以外の背景領域にぼかし処理を施してもよい。また、合成後の画像を上記のようにぼかした画像と、ぼかす前の画像とをさらに合成した画像を最終的な合成画像としてもよい。   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 this embodiment, the background area of a plurality of images obtained by shooting is subjected to a blurring process (filtering process or the like) with a blurring amount (number of taps) based on the amount of background movement between images, and the main subject area is shot. Position alignment is performed so that the plurality of images coincide with each other, and the result is synthesized by addition averaging. Here, the amount of movement of the background can be calculated from the angular velocity obtained by the angular velocity sensor 105. Not limited to this, for example, alignment is performed so that the main subject region matches between a plurality of captured images, and addition is performed. Further, the main subject region of the combined image, that is, a moving subject region other than the moving subject region exists. Blur processing may be applied to the background area. 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.

S214では、CPU103は、S213で生成された合成画像データやその元となった合成前の画像データに画像処理部106によって表示用処理が施された画像データを、表示部109に表示する。   In S <b> 214, the CPU 103 displays, on the display unit 109, image data obtained by performing display processing by the image processing unit 106 on the combined image data generated in S <b> 213 and the original image data before combining.

そして、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.

また、S212の主被写体領域の検出処理では、主被写体の位置が移動ベクトルを検出する探索領域内におさまることを前提としており、各画像の主被写体の位置が探索領域内におさまらない場合は、主被写体の位置が探索領域内に収まるようにする必要がある。本実施例では、S212で、画像を縮小し、低コントラストな被写体の特徴点も拾える十分な大きさの探索用ブロックを用いて移動ベクトルを検出、低精度でも主被写体の位置が探索領域におさまるようにした後、より高精度な移動ベクトル検出を行う。図3は、ユーザが車両を主被写体としてパンニングをしながら撮影を行った3枚の画像から車両を主被写体として検出し、画像間を主被写体で位置合わせする様子を示したものである。画像301、画像304、画像305がこの順で撮影された画像をそのまま表示した様子を示し、画像306は主被写体を特定するために求められるブロック単位の移動ベクトルの例を示している。画像301、画像304間で画像306のように移動ベクトル306を検出し、画像301の主被写体を302aと検出し、画像301において主被写体302aのいる領域を探索領域303として設定する。画像304、画像305において、画像301の画角内と同じ領域に設定された探索領域303に主被写体302b、302cがおさまっていないことが分かる。このような場合、主被写体302b、主被写体302cが探索領域303におさまるよう画像304、画像305を画像308、画像309のようにメモリ内で移動する。画像308、画像309における点線は、移動前の画像304、画像305での画像の端を示している。なお、図3では、画像301が基準画像であるため、画像307は移動していない。   In the main subject area detection processing in S212, it is assumed that the position of the main subject is within the search area for detecting the movement vector. If the position of the main subject in each image does not fall within the search area, The position of the main subject needs to be within the search area. In this embodiment, in S212, the motion vector is detected using a search block large enough to reduce the image and pick up the feature points of the low-contrast subject, and the position of the main subject fits in the search region even with low accuracy. After that, more accurate movement vector detection is performed. FIG. 3 shows a state in which a user is detected as a main subject from three images taken by the user while panning with the vehicle as the main subject, and the images are aligned with the main subject. An image 301, an image 304, and an image 305 show a state in which images taken in this order are displayed as they are, and an image 306 shows an example of a block-unit movement vector required for specifying a main subject. The movement vector 306 is detected between the image 301 and the image 304 as in the image 306, the main subject of the image 301 is detected as 302 a, and the region where the main subject 302 a is located in the image 301 is set as the search region 303. In the images 304 and 305, it can be seen that the main subjects 302b and 302c are not contained in the search area 303 set in the same area as the angle of view of the image 301. In such a case, the image 304 and the image 305 are moved in the memory like the image 308 and the image 309 so that the main subject 302b and the main subject 302c fit in the search area 303. The dotted lines in the images 308 and 309 indicate the edges of the images 304 and 305 before movement. In FIG. 3, since the image 301 is the reference image, the image 307 is not moved.

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

S401で、CPU103は、画像を複数の領域に分割した探索用ブロックを設定し、探索用ブロック単位で画像間における移動ベクトルを検出する。検出した移動ベクトルの中で、ほぼ同じベクトルとなるものの数を数える。計数後の状態を横軸にベクトルの大きさ、縦軸に数(度数)でヒストグラム化したものを図4(b)に示す。横軸は0を境に、移動ベクトルの方向を区別している。まず、角速度センサ105で検出される振れ(すなわち複数の画像間の撮像手段の動き情報)に基づく背景の移動量410を基準として図のように移動ベクトルが背景の移動量から離れた主被写体成分411と背景の移動量近傍の背景成分412に分類する。次に、分類された主被写体成分411の移動ベクトルの中で、数が最も多かった移動ベクトルを主被写体ベクトル413とする。ここで角速度センサ105で検出される振れの情報を用いずに移動ベクトルのヒストグラムから主被写体と背景を分類することも可能である。この場合、例えば流し撮りがユーザのパンニング撮影によって各画像でほぼ中心付近に主被写体がいると仮定し、ベクトルの大きさがゼロに近く、画像内で連続した領域に固まって存在する移動ベクトルに対応する領域が、主被写体領域と考えられる。しかし、移動ベクトルの探索領域の大きさによっては移動ベクトルの誤検出も存在するため、上記実施形態のように、センサからの振れ情報を参照した方がより精度良く主被写体と背景を分類できる。   In step S401, 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. Among the detected movement vectors, the number of the same vector is counted. FIG. 4B shows the state after counting as a histogram of the vector size on the horizontal axis and the number (frequency) on the vertical axis. The horizontal axis distinguishes the direction of the movement vector from 0 as a boundary. First, the main subject component in which the movement vector is separated from the background movement amount as shown in the drawing with reference to the background movement amount 410 based on the shake detected by the angular velocity sensor 105 (that is, the movement information of the imaging means between a plurality of images). 411 and the background component 412 in the vicinity of the background movement amount. Next, the movement vector having the largest number among the movement vectors of the classified main subject component 411 is set as a main subject vector 413. 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. In this case, for example, assuming that there is a main subject in the vicinity of the center in each image by panning shooting by the user, for example, the vector size is close to zero, and the moving vector is present in a continuous area in the image. The corresponding area is considered the main subject area. 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.

上述のようにして、S402で、CPU103は、主被写体領域に該当する移動ベクトルを検出した探索用ブロックが、それ以前の画像の位置合わせで用いられた移動ベクトルを持ったことがある場合、その回数に相当する重みを付加する。   As described above, in step S402, the CPU 103 determines that the search block that has detected the movement vector corresponding to the main subject area has a movement vector used in previous image alignment. A weight corresponding to the number of times is added.

S403で、CPU103は、主被写体領域に対応する移動ベクトルを特定する。本実施形態では、角速度センサ105からの信号に基づいて対象の画像間での背景の移動量を推定し、背景に対応する移動ベクトルを除いたときに、数が最多である移動ベクトルを主被写体に対応する移動ベクトルと推定する。ただし、カウントし、移動ベクトル間で比較する数はS402で領域ごとに付加される重みを踏まえた数である。また、本実施形態では、撮像装置100の角速度を角速度センサ105によって検出しているが、これに限らず、加速度センサ、その他位置を計測するセンサ等を用いてもよい。   In step S403, the CPU 103 specifies a movement vector corresponding to the main subject area. In the present embodiment, the movement amount of the background between the target images is estimated based on the signal from the angular velocity sensor 105, and the movement vector having the largest number when the movement vector corresponding to the background is excluded is the main subject. The movement vector corresponding to is estimated. However, the number to be counted and compared between the movement vectors is a number based on the weight added to each region in S402. In this embodiment, the angular velocity of the imaging apparatus 100 is detected by the angular velocity sensor 105. However, the present invention is not limited to this, and an acceleration sensor, a sensor for measuring a position, or the like may be used.

また、S401で移動ベクトルの数を数える際、S402の探索用ブロックの重みを考慮して(重みの分、カウントするなどして)同時に処理を行っても良い。   Further, when counting the number of movement vectors in S401, the processing may be performed simultaneously in consideration of the weight of the search block in S402 (for example, counting the weight).

S404で、CPU103は、当該主被写体の移動ベクトルを用いて、一次記憶装置104のメモリ内でシフト移動による画像の位置合わせを行う。ここでは、主被写体の移動ベクトルの決定方法として、撮影がパンニングを伴って行われていることを想定しているので、上記方法で背景の移動ベクトルを分類した。上記のように背景の移動ベクトルを角速度センサ105の信号によって分類できない場合には、2番目に多い移動ベクトルを判定したり、当該移動ベクトルを持つ領域がある程度のかたまりを持って存在しているかを検出して、主被写体の移動ベクトルを推定する。また、三脚を使って撮像装置100を固定して撮影を行う場合を想定している場合、単に画像上で最多な移動ベクトルを主被写体の移動ベクトルと判定することも出来る。また、移動ベクトルは、H方向、V方向を別々に扱っても良いし、合せたものを扱っても良い。   In step S <b> 404, the CPU 103 performs image alignment by shift movement in the memory of the primary storage device 104 using the movement vector of the main subject. Here, since it is assumed that the shooting is performed with panning as a method for determining the movement vector of the main subject, the background movement vectors are classified by the above method. As described above, when the background movement vector cannot be classified by the signal of the angular velocity sensor 105, the second most movement vector is determined, or whether an area having the movement vector exists with a certain amount of clumps. Detect and estimate the movement vector of the main subject. 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. Further, the movement vector may be handled separately in the H direction and the V direction, or may be handled in combination.

S405で、CPU103は、主被写体に対応する移動ベクトルと推定された移動ベクトルが算出された探索用ブロックに、次の探索に用いるために重みを付加する。   In step S <b> 405, the CPU 103 adds a weight for use in the next search to the search block in which the estimated motion vector corresponding to the main subject is calculated.

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

図4(a)の位置合わせ処理における主被写体領域の移動ベクトルの推定方法の詳細を、さらに図5(a)、(b)を用いて説明する。   Details of the method of estimating the movement vector of the main subject area in the alignment process of FIG. 4A will be described with reference to FIGS. 5A and 5B.

図5(a)において、501〜504は、連続して撮影された画像とし、領域505における位置合わせを例として取り上げる。領域505を拡大して探索用ブロックを配置したものが506である。各探索用ブロックに対して、図3の306のような移動ベクトルを検出する。   In FIG. 5A, images 501 to 504 are taken continuously, and the alignment in the region 505 is taken as an example. An area 505 is enlarged and a search block is arranged 506. A movement vector such as 306 in FIG. 3 is detected for each search block.

図5(b)は506のように設定された各探索用ブロックに対応する重みを示したものであり、RAM上に探索用ブロックの位置と対応づけられて一時的に記憶されている。507が初期値であり、本実施形態では初期値0を取る。508は、画像501と画像502の移動ベクトルの検出結果であり、512、515は、それぞれ画像502と画像503の移動ベクトルの検出結果、画像503と画像504との検出結果を示している。そして検出結果508、512、515の移動ベクトルから主被写体の移動ベクトルを算出する際に用いる重み分布はそれぞれ509、513、516である。対応する重み分布509における模様510aは検出結果508の中で最も数の多い移動ベクトルとほぼ同じベクトルである領域を示している。模様511aは、検出結果508の中で、2番目に数の多い移動ベクトルとほぼ同じベクトルである領域を示している。さらに、検出結果512に対応する重み分布513における模様510b、模様511bは、移動ベクトルの検出結果512の中で、最も数の多い移動ベクトル、2番目に数の多い移動ベクトルとそれぞれほぼ同じベクトルである領域を示している。また、検出結果515に対応する重み分布516における模様510c、模様511cは、移動ベクトルの検出結果515の中で、最も数の多い移動ベクトル、2番目に数の多い移動ベクトルとそれぞれほぼ同じベクトルである領域を示している。   FIG. 5B shows the weight corresponding to each search block set as 506, and is temporarily stored in the RAM in association with the position of the search block. Reference numeral 507 denotes an initial value. In this embodiment, the initial value is 0. Reference numeral 508 denotes detection results of the movement vectors of the images 501 and 502, and 512 and 515 denote detection results of the movement vectors of the images 502 and 503 and detection results of the images 503 and 504, respectively. The weight distributions used when calculating the movement vector of the main subject from the movement vectors of the detection results 508, 512, and 515 are 509, 513, and 516, respectively. A pattern 510 a in the corresponding weight distribution 509 indicates a region that is substantially the same as the most numerous movement vectors in the detection result 508. The pattern 511a indicates a region in the detection result 508 that is substantially the same vector as the second largest number of movement vectors. Furthermore, the patterns 510b and 511b in the weight distribution 513 corresponding to the detection result 512 are almost the same vectors as the movement vector having the largest number and the movement vector having the second largest number in the movement vector detection result 512, respectively. It shows a certain area. In addition, the patterns 510c and 511c in the weight distribution 516 corresponding to the detection result 515 are substantially the same vectors as the movement vector having the largest number and the movement vector having the second largest number among the movement vector detection results 515, respectively. It shows a certain area.

検出結果509では、重み分布509における各探索用ブロックの重みは初期値の0であるため、移動ベクトルの数が最も多い移動ベクトルを主被写体の移動ベクトルとすれば良い。したがって、重み分布509にて模様510aと模様511aの移動ベクトルの数を比較すると、模様510aが5個、模様511bが4個で模様510aの方が大きい。このため、模様510aの移動ベクトルが主被写体領域の移動ベクトルとして、後の位置合わせ処理にて用いられる。   In the detection result 509, since the weight of each search block in the weight distribution 509 has an initial value of 0, the movement vector having the largest number of movement vectors may be used as the movement vector of the main subject. Accordingly, when the number of movement vectors of the pattern 510a and the pattern 511a is compared in the weight distribution 509, the pattern 510a has five patterns 510a and four patterns 511b, and the pattern 510a is larger. For this reason, the movement vector of the pattern 510a is used as a movement vector of the main subject area in the subsequent alignment processing.

次に、検出結果512では、重み分布513において、画像501と画像502の位置合わせで用いられた移動ベクトルを持つ探索用ブロックに、重みとして1が加算されている。本例では、模様510bが移動ベクトルの数が4個、探索用ブロックの重みが2の合計6となる。したがって、模様510bの移動ベクトルを用いて位置合わせを行う。ちなみに、重みを踏まえて合計を比較したときに、最有力候補となる移動ベクトルが2種類以上になる場合は、移動ベクトルの数と探索用ブロックの重みのどちらかにより比重を与えておき、決定するものとする。あるいは、検出順に従うものとする。   Next, in the detection result 512, 1 is added as a weight to the search block having the movement vector used in the alignment of the image 501 and the image 502 in the weight distribution 513. In this example, the pattern 510b has a total of six, with four movement vectors and two search block weights. Therefore, alignment is performed using the movement vector of the pattern 510b. By the way, when comparing the totals based on the weight, if there are two or more types of movement vectors that are the most promising candidates, give a specific gravity according to either the number of movement vectors or the weight of the search block. It shall be. Or it shall follow a detection order.

最後に、検出結果515では、重み分布516において、画像503と画像504の位置合わせで用いられた移動ベクトルを持つ探索用ブロックに、今までの重みを引き継いだ上で1が加算されている。模様510cは、移動ベクトルの数が4個、探索用ブロックの重みが4の合計8。また、模様511cは、移動ベクトルの数が4個、探索用ブロックの重みが3の合計7となる。したがって、模様510cの移動ベクトルを主被写体領域に対応する移動ベクトルとして用いて位置合わせを行う。   Finally, in the detection result 515, in the weight distribution 516, 1 is added to the search block having the movement vector used for the alignment of the image 503 and the image 504 after taking over the current weight. The pattern 510c has a total of eight, including four movement vectors and four search block weights. In addition, the pattern 511c has a total of 7, with four movement vectors and three search block weights. Therefore, alignment is performed using the movement vector of the pattern 510c as a movement vector corresponding to the main subject area.

以上のように、本実施形態では、過去に位置合わせに用いられた被写体領域と同じ領域からの評価値を優先的に見て位置合わせする。こうすることで、501と502、502と503、503と504のように直接移動ベクトルを検出していない501と504のような関係にある画像も、画像のずれを抑えることができる。また、同じ領域の移動ベクトルを単に用いているわけではなく、重みをつけて優先的に扱うようにしている。すなわち、移動ベクトルの誤検出が発生した際も、他領域の移動ベクトルと積み重ねられてきた重みを利用することで、誤検出の影響を抑制することができる。   As described above, in the present embodiment, alignment is performed with priority given to evaluation values from the same region as the subject region used for alignment in the past. By doing so, image misalignment can also be suppressed for images such as 501 and 502, 502 and 503, and 503 and 504 that have a relationship such as 501 and 504 that do not directly detect a movement vector. In addition, the movement vectors in the same region are not simply used, but weights are given priority for handling. That is, even when an erroneous detection of a movement vector occurs, the influence of the erroneous detection can be suppressed by using the weight accumulated with the movement vector of another area.

なお、図5では、ブロックの重みを1として説明しているが、この限りではなく、重みとなる係数を自由に調節することができる。例えば、係数を0から1の間に設定し、位置合わせで用いられた回数をかけることで重みとしても良い。   In FIG. 5, the block weight is described as 1. However, the present invention is not limited to this, and the weight coefficient can be freely adjusted. For example, the coefficient may be set between 0 and 1, and the weight may be obtained by multiplying the number of times used for alignment.

以上のように、本実施形態では、3以上の画像の位置合わせにおいて、画像間で検出された主被写体の移動ベクトルに対応する領域に重みを付けて次の画像間の主被写体の移動ベクトル算出に用いる。このようにすることで、移動ベクトル誤検出時の影響を抑制して位置を合わせることができる。また、この位置合わせ手法を用いて適切な流し撮り風の合成画像を生成することができる。   As described above, in the present embodiment, in the alignment of three or more images, the area corresponding to the movement vector of the main subject detected between the images is weighted to calculate the movement vector of the main subject between the next images. Used for. By doing in this way, the position can be aligned while suppressing the influence at the time of erroneous detection of the movement vector. In addition, an appropriate panning-like composite image can be generated using this alignment method.

(第2の実施形態)
第1の実施形態では、複数の画像を主被写体で順次位置合わせする際に、画像間で検出された主被写体の移動ベクトルに対応する領域に重みを付けていき、位置合わせの精度を向上させる処理を示した。本実施形態ではさらに、角速度センサ105の信号や、公知の画像解析による顔検出、人体検出などの被写体検出結果などの補助情報を用いて、主被写体領域の中でも特にぶれさせたくない領域で位置合わせが行われるようにする。第2の実施形態にかかる撮像装置の構成は図1に示す第1の実施形態での構成と同様であるため、説明を省略する。
(Second Embodiment)
In the first embodiment, when sequentially aligning a plurality of images with a main subject, a region corresponding to the movement vector of the main subject detected between the images is weighted to improve the alignment accuracy. Processing was shown. Further, in the present embodiment, alignment is performed in an area in the main subject area that is not desired to be shaken by using auxiliary information such as a signal from the angular velocity sensor 105 and subject detection results such as face detection and human body detection by known image analysis. To be done. Since the configuration of the imaging apparatus according to the second embodiment is the same as that of the first embodiment shown in FIG.

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

図2と同様のステップには同一のステップ番号を付して説明を省略する。S601では、角速度センサ105の信号から検出される角速度や、公知の被写体検出結果を用いて主被写体領域と主被写体領域の中でもとくに重要とされるであろう特定の領域を決定し、この特定の領域を基準に位置合わせを行う。   Steps similar to those in FIG. 2 are denoted by the same step numbers and description thereof is omitted. In step S601, a specific area that is particularly important among the main subject area and the main subject area is determined using the angular velocity detected from the signal of the angular velocity sensor 105 and a known subject detection result. Align with the area as a reference.

図7は、図6のS601で行われる補助情報を用いた主被写体検出および位置合わせの処理の詳細を示したフローチャートである。なお、図4と同様の処理を行うステップには同一のステップ番号を付して説明を省略する。   FIG. 7 is a flowchart showing details of main subject detection and alignment processing using auxiliary information performed in S601 of FIG. Note that steps that perform the same processing as in FIG.

本実施形態では、S701で、CPU103は、角速度センサ105で検出される撮像装置100の角速度や、前述した被写体検出結果などから決まる被写体内で重要となる領域を基に、探索用ブロックに重みを設定する。図8を用いてより詳細に説明する。   In the present embodiment, in step S701, the CPU 103 weights the search block based on the region that is important in the subject determined from the angular velocity of the imaging device 100 detected by the angular velocity sensor 105 and the subject detection result described above. Set. This will be described in more detail with reference to FIG.

ここでは、撮像装置100の角速度からパンニング方向が判別でき、領域ごとの移動ベクトルから相対的に主被写体の移動方向901が判別できたとする。このとき、重み分布902の重みを左の色塗り部903のように主被写体の先頭を優先するように設定する。なお、色塗り部904のように主被写体の先頭の一部、例えば、主被写体の最先端を優先するように重みを設定しても良い。   Here, it is assumed that the panning direction can be determined from the angular velocity of the imaging apparatus 100, and the moving direction 901 of the main subject can be determined relatively from the movement vector for each region. At this time, the weight of the weight distribution 902 is set so that the top of the main subject is given priority as in the left colored portion 903. Note that the weight may be set so that priority is given to a part of the head of the main subject, for example, the leading edge of the main subject, as in the color painting unit 904.

画像処理部106内に組み込まれた顔検出回路等の被写体検出手段によって顔が検出された場合は、検出した被写体(領域)内の、重要となるであろう領域905、たとえば顔領域内の目の領域を中心に、重み分布906のように探索用ブロックの重みを設定する。また例えば、重み分布902と、重み分布906の考え方を組み合わせて重み分布907のように探索用ブロックの重みを設定してもよい。重要な特定の領域を決定する他の方法としては、AF動作における合焦領域の情報に基づいて合焦位置に対応する主被写体領域を特定の領域としても良い。   When a face is detected by subject detection means such as a face detection circuit incorporated in the image processing unit 106, an area 905 that will be important in the detected subject (area), for example, an eye in the face area The weight of the search block is set like the weight distribution 906 centering on the area of. For example, the weight of the search block may be set like the weight distribution 907 by combining the concepts of the weight distribution 902 and the weight distribution 906. As another method for determining an important specific area, the main subject area corresponding to the focus position may be set as the specific area based on the information of the focus area in the AF operation.

以上のように、本実施形態では、過去に位置合わせに用いられた被写体領域と同じ領域からの評価値を優先的に見て位置合わせする。こうすることで、画像501と画像504のような直接移動ベクトルを検出していない関係にある画像も、画像のずれを抑えることができる。特に本実施形態では、撮像装置の動き情報あるいは被写体検出情報に基づいて、特に基準としたい特定の領域を決定している。また、同じ領域の移動ベクトルを単に用いているわけではなく、重みを付けて優先的に扱うようにしている。すなわち、移動ベクトルの誤検出が発生した際も、他領域の移動ベクトルと積み重ねられてきた重みを利用することで、誤検出の影響を抑制することができる。   As described above, in the present embodiment, alignment is performed with priority given to evaluation values from the same region as the subject region used for alignment in the past. By doing so, image misalignment can also be suppressed for images such as the image 501 and the image 504 that are not related to the direct movement vector detection. In particular, in the present embodiment, a specific region that is particularly desired as a reference is determined based on the motion information of the imaging apparatus or the subject detection information. Also, the movement vectors in the same region are not simply used, but are weighted and handled preferentially. That is, even when an erroneous detection of a movement vector occurs, the influence of the erroneous detection can be suppressed by using the weight accumulated with the movement vector of another area.

また、本実施形態では、探索用ブロックに重みを付加することで、主被写体のある一部分のぶれを重点的に抑制した位置合わせが可能となる。また、撮像装置100の角速度のような撮影条件や、顔検出や人体検出のような被写体認識を用いることで、主被写体の特徴のある部分でぶれを抑制することが可能なため、より被写体ぶれの目立ちにくい画像を提供することができる。   Further, in the present embodiment, by adding a weight to the search block, it is possible to perform an alignment that mainly suppresses blurring of a part of the main subject. Further, by using shooting conditions such as the angular velocity of the imaging apparatus 100 and subject recognition such as face detection and human body detection, it is possible to suppress blur at a characteristic part of the main subject. It is possible to provide an image that is inconspicuous.

上記各実施形態において生成される合成後の画像のイメージを図9(a)〜(d)に示す。画像904は、画像901,902、903に基づいてステップS213で合成を行い生成された画像のイメージ図である。動体であり、主被写体である車両がくっきりと写り、背景の木が流れて写っている。本方法では、撮影間隔(フレームレート)や合成枚数、ぼかし処理のタップ数等によって背景の流れ方を変更、制御することができる。   Images of the combined images generated in the above embodiments are shown in FIGS. An image 904 is an image diagram of an image generated by combining in step S213 based on the images 901, 902, and 903. The moving object, the main subject vehicle, is clearly visible, and the background trees are reflected. In this method, the background flow can be changed and controlled according to the shooting interval (frame rate), the number of combined images, the number of taps of blurring processing, and the like.

(他の実施形態)
本発明の目的は以下のようにしても達成できる。すなわち、前述した各実施形態の機能を実現するための手順が記述されたソフトウェアのプログラムコードを記録した記憶媒体を、システムまたは装置に供給する。そしてそのシステムまたは装置のコンピュータ(または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 操作部
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 Image processing device 106 Recording medium 107 Secondary storage device 108 Display unit 109 Operation unit

Claims (12)

撮像手段により撮像される少なくとも3以上の複数の画像において、分割した領域ごとの移動ベクトルを算出する算出手段と、
前記算出手段により算出される移動ベクトルに基づいて前記複数の画像の中の一部分を位置合わせする位置合わせ手段と、
前記分割した領域ごとに、前記位置合わせ手段で用いられる移動ベクトルを有した回数をカウントするカウント手段と、を有し、
前記位置合わせ手段は、前記算出手段により算出される移動ベクトルから、前記カウント手段によりカウントされる回数を用いて、画像間の位置合わせで用いる移動ベクトルを特定することを特徴とする画像処理装置。
Calculating means for calculating a movement vector for each divided region in at least three or more images picked up by the image pickup means;
Alignment means for aligning a part of the plurality of images based on the movement vector calculated by the calculation means;
Counting means for counting the number of movement vectors used in the alignment means for each of the divided areas;
The image processing apparatus characterized in that the alignment unit specifies a movement vector used for alignment between images from the movement vector calculated by the calculation unit, using the number of times counted by the counting unit.
前記位置合わせ手段は、
前記分割した領域ごとの移動ベクトルに、前記カウント手段によりカウントされる回数に応じた重みを付けて、前記画像間の位置合わせで用いる移動ベクトルを特定することを特徴とする請求項1に記載の画像処理装置。
The alignment means includes
The movement vector used for the alignment between the images is specified by adding a weight according to the number of times counted by the counting unit to the movement vector for each divided area. Image processing device.
前記位置合わせ手段は、
前記算出手段により算出される移動ベクトルから、主被写体領域であり位置合わせの基準とする特定の領域に対応する移動ベクトルを特定して画像間の位置合わせに用い、
前記複数の画像間での前記複数の画像を撮像する撮像手段の動き情報に基づいて、前記分割した領域ごとの移動ベクトルから、前記複数の画像における背景に対応する移動ベクトルを推定することを特徴とする請求項1または2に記載の画像処理装置。
The alignment means includes
From the movement vector calculated by the calculating means, a movement vector corresponding to a specific area which is a main subject area and is used as a reference for alignment is specified and used for alignment between images.
A motion vector corresponding to a background in the plurality of images is estimated from a motion vector for each of the divided regions based on motion information of an imaging unit that captures the plurality of images between the plurality of images. The image processing apparatus according to claim 1 or 2.
前記位置合わせ手段は、
前記算出手段により算出される移動ベクトルから、主被写体領域であり位置合わせの基準とする特定の領域に対応する移動ベクトルを特定して画像間の位置合わせに用い、
前記複数の画像間での前記複数の画像を撮像する撮像手段の動き情報と、前記移動ベクトルとに基づいて、主被写体の移動方向を判別し、分割した領域ごとに前記主被写体の移動方向に応じた重みを付けて、前記画像間の位置合わせで用いる移動ベクトルを特定することを特徴とする請求項1乃至3のいずれか1つに記載の画像処理装置。
The alignment means includes
From the movement vector calculated by the calculating means, a movement vector corresponding to a specific area which is a main subject area and is used as a reference for alignment is specified and used for alignment between images.
Based on the movement information of the imaging means that captures the plurality of images between the plurality of images and the movement vector, the moving direction of the main subject is determined, and the moving direction of the main subject is determined for each divided region. 4. The image processing apparatus according to claim 1, wherein a movement vector to be used for alignment between the images is specified by assigning a corresponding weight. 5.
前記複数の画像間での前記複数の画像を撮像する撮像手段の動き情報は、前記撮像手段の角速度、加速度、変位の少なくとも1つであることを特徴とする請求項3または4に記載の画像処理装置。   5. The image according to claim 3, wherein movement information of an imaging unit that captures the plurality of images between the plurality of images is at least one of angular velocity, acceleration, and displacement of the imaging unit. Processing equipment. 前記複数の画像において特定の被写体を検出する被写体検出手段を有し、
前記位置合わせ手段は、前記被写体検出手段により検出される前記特定の被写体に対応する領域の移動ベクトルを前記画像間の位置合わせで用いる移動ベクトルとして特定することを特徴とする請求項1乃至5のいずれか1つに記載の画像処理装置。
Subject detection means for detecting a specific subject in the plurality of images;
6. The alignment unit according to claim 1, wherein the alignment unit specifies a movement vector of an area corresponding to the specific subject detected by the subject detection unit as a movement vector used for alignment between the images. The image processing apparatus according to any one of the above.
前記位置合わせ手段は、
前記複数の画像における合焦位置に対応する領域の移動ベクトルを前記画像間の位置合わせで用いる移動ベクトルとして特定することを特徴とする請求項1乃至6のいずれか1つに記載の画像処理装置。
The alignment means includes
The image processing apparatus according to claim 1, wherein a movement vector of an area corresponding to an in-focus position in the plurality of images is specified as a movement vector used for alignment between the images. .
前記複数の画像の背景領域にぼかし処理を施し、前記位置合わせ手段により前記主被写体領域で位置合わせが行われた前記複数の画像を合成する合成手段を有することを特徴とする請求項1乃至7のいずれか1つに記載の画像処理装置。   8. The image processing apparatus according to claim 1, further comprising a combining unit that performs a blurring process on a background area of the plurality of images and combines the plurality of images that have been aligned in the main subject region by the alignment unit. The image processing apparatus according to any one of the above. 前記合成手段は、前記複数の画像の背景領域に、画像間の背景の移動量に対応したぼかし量でぼかし処理を行うことを特徴とする請求項8に記載の画像処理装置。   The image processing apparatus according to claim 8, wherein the synthesizing unit performs a blurring process on a background area of the plurality of images with a blurring amount corresponding to a movement amount of a background between images. 撮像手段により撮像される少なくとも3以上の複数の画像において、分割した領域ごとの移動ベクトルを算出する算出ステップと、
前記算出手段により算出される移動ベクトルに基づいて前記複数の画像を位置合わせする位置合わせステップと、
前記分割した領域ごとに、前記位置合わせ手段で用いられる移動ベクトルを有した回数をカウントするカウントステップと、を有し、
前記位置合わせステップでは、前記算出手段により算出される移動ベクトルから、前記カウント手段によりカウントされる回数を用いて、画像間の位置合わせで用いる移動ベクトルを特定することを特徴とする画像処理方法。
A calculation step of calculating a movement vector for each divided region in at least three or more images captured by the imaging means;
An alignment step of aligning the plurality of images based on a movement vector calculated by the calculation means;
A counting step for counting the number of movement vectors used in the alignment means for each of the divided areas;
The image processing method characterized in that, in the alignment step, a movement vector to be used for alignment between images is specified from the movement vector calculated by the calculation means using the number of times counted by the counting means.
請求項10に記載の画像処理方法の手順が記述されたコンピュータで実行可能なプログラム。   A computer-executable program in which the procedure of the image processing method according to claim 10 is described. コンピュータに、請求項10に記載の画像処理方法の各工程を実行させるためのプログラムが記憶されたコンピュータが読み取り可能な記憶媒体。   A computer-readable storage medium storing a program for causing a computer to execute each step of the image processing method according to claim 10.
JP2013136923A 2013-06-28 2013-06-28 Image processing apparatus and image processing method Abandoned JP2015012482A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2013136923A JP2015012482A (en) 2013-06-28 2013-06-28 Image processing apparatus and image processing method
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
JP2013136923A JP2015012482A (en) 2013-06-28 2013-06-28 Image processing apparatus and image processing method

Publications (1)

Publication Number Publication Date
JP2015012482A true JP2015012482A (en) 2015-01-19

Family

ID=52305266

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013136923A Abandoned JP2015012482A (en) 2013-06-28 2013-06-28 Image processing apparatus and image processing method

Country Status (1)

Country Link
JP (1) JP2015012482A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016171460A (en) * 2015-03-12 2016-09-23 キヤノン株式会社 Image processing system, image processing method, program and storage medium
JP2017103688A (en) * 2015-12-03 2017-06-08 キヤノン株式会社 Motion vector detection device and its control method
JP2018036366A (en) * 2016-08-30 2018-03-08 キヤノン株式会社 Image tremor correction device, imaging device and control method
JP2018513640A (en) * 2015-04-10 2018-05-24 クゥアルコム・インコーポレイテッドQualcomm Incorporated Automatic panning shot generation
CN108093181A (en) * 2018-01-16 2018-05-29 奇酷互联网络科技(深圳)有限公司 Picture shooting method, device, readable storage medium storing program for executing and mobile terminal
JP2019120631A (en) * 2018-01-10 2019-07-22 株式会社デンソーテン Camera deviation detection device, and camera deviation detection method
US20200192932A1 (en) * 2018-12-13 2020-06-18 Sap Se On-demand variable feature extraction in database environments

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016171460A (en) * 2015-03-12 2016-09-23 キヤノン株式会社 Image processing system, image processing method, program and storage medium
JP2018513640A (en) * 2015-04-10 2018-05-24 クゥアルコム・インコーポレイテッドQualcomm Incorporated Automatic panning shot generation
JP2017103688A (en) * 2015-12-03 2017-06-08 キヤノン株式会社 Motion vector detection device and its control method
JP2018036366A (en) * 2016-08-30 2018-03-08 キヤノン株式会社 Image tremor correction device, imaging device and control method
JP2019120631A (en) * 2018-01-10 2019-07-22 株式会社デンソーテン Camera deviation detection device, and camera deviation detection method
CN108093181A (en) * 2018-01-16 2018-05-29 奇酷互联网络科技(深圳)有限公司 Picture shooting method, device, readable storage medium storing program for executing and mobile terminal
CN108093181B (en) * 2018-01-16 2021-03-30 奇酷互联网络科技(深圳)有限公司 Picture shooting method and device, readable storage medium and mobile terminal
US20200192932A1 (en) * 2018-12-13 2020-06-18 Sap Se On-demand variable feature extraction in database environments

Similar Documents

Publication Publication Date Title
US9489747B2 (en) Image processing apparatus for performing object recognition focusing on object motion, and image processing method therefor
JP6271990B2 (en) Image processing apparatus and image processing method
KR101521441B1 (en) Image pickup apparatus, control method for image pickup apparatus, and storage medium
US9865064B2 (en) Image processing apparatus, image processing method, and storage medium
JP5237721B2 (en) Imaging device
JP2015012482A (en) Image processing apparatus and image processing method
JP2008271241A (en) Imaging apparatus, image processing apparatus, imaging method, and image processing method
US20150381893A1 (en) Image processing apparatus, method for controlling the same, and storage medium
JP2015072324A (en) Image processor, imaging device and image processing method
KR101728042B1 (en) Digital photographing apparatus and control method thereof
TWI469085B (en) Image processing apparatus, image processing method and computer readable storage medium
JP5936358B2 (en) Image display device, image display method, imaging device and control method thereof, program, and storage medium storing the same
JP6261205B2 (en) Image processing device
JP5144724B2 (en) Imaging apparatus, image processing apparatus, imaging method, and image processing method
JP6300670B2 (en) Focus adjustment apparatus, focus adjustment method and program, and imaging apparatus
JP6326631B2 (en) Imaging device
JP4807582B2 (en) Image processing apparatus, imaging apparatus, and program thereof
JP2011066827A (en) Image processing apparatus, image processing method and program
JP6645711B2 (en) Image processing apparatus, image processing method, and program
JP2015041865A (en) Image processing apparatus and image processing method
JP2006243609A (en) Autofocus device
JP6089232B2 (en) Imaging device
JP2014138378A (en) Image pickup device, control method thereof, and control program thereof
JP2014131188A (en) Imaging apparatus, control method of the same, and control program
JP5447579B2 (en) Tracking device, focus adjustment device, and photographing device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160614

A762 Written abandonment of application

Free format text: JAPANESE INTERMEDIATE CODE: A762

Effective date: 20160804