JP6452481B2 - Image processing apparatus and control method thereof - Google Patents
Image processing apparatus and control method thereof Download PDFInfo
- Publication number
- JP6452481B2 JP6452481B2 JP2015023544A JP2015023544A JP6452481B2 JP 6452481 B2 JP6452481 B2 JP 6452481B2 JP 2015023544 A JP2015023544 A JP 2015023544A JP 2015023544 A JP2015023544 A JP 2015023544A JP 6452481 B2 JP6452481 B2 JP 6452481B2
- Authority
- JP
- Japan
- Prior art keywords
- image
- subject
- group
- image processing
- processing apparatus
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Studio Devices (AREA)
- Image Analysis (AREA)
Description
本発明は画像処理装置およびその制御方法に関し、特には複数の画像を合成するための技術に関する。 The present invention relates to an image processing apparatus and a control method thereof, and more particularly to a technique for synthesizing a plurality of images.
撮影範囲の重複した複数の画像を位置合わせして合成することにより、ノイズを低減した画像を取得したり、ダイナミックレンジを拡大した画像を取得したりする技術が知られている。このような画像合成技術において、合成する画像を幾何変換して基準画像と位置合わせする方法が知られており、アフィン変換や射影変換が代表的な幾何変換として用いられている。 A technique for acquiring an image with reduced noise or acquiring an image with an expanded dynamic range by aligning and synthesizing a plurality of images with overlapping shooting ranges is known. In such an image synthesis technique, a method of geometrically transforming an image to be synthesized and aligning it with a reference image is known, and affine transformation and projective transformation are used as typical geometric transformations.
幾何変換を規定する係数(幾何変換係数)は、合成する画像と基準画像の両方に含まれる被写体の動きの方向と大きさを表す複数の動きベクトルから算出することができる。画像間での被写体の移動は、手持ち撮影時のように撮影位置および/または撮影方向の変化によって画像全体に生じるものと、被写体自体が背景に対して移動することで生じるものに大別できる。そして、前者の移動を表す動きベクトルをグローバル動きベクトル、後者の移動を表す動きベクトルを動体の動きベクトルと呼ぶ。 A coefficient defining the geometric transformation (geometric transformation coefficient) can be calculated from a plurality of motion vectors representing the direction and magnitude of the motion of the subject included in both the image to be synthesized and the reference image. The movement of the subject between images can be broadly divided into those that occur in the entire image due to changes in the shooting position and / or shooting direction as in hand-held shooting, and those that occur when the subject itself moves relative to the background. The motion vector representing the former movement is called a global motion vector, and the motion vector representing the latter movement is called a moving object motion vector.
画像間で静止被写体を位置合わせするためには、グローバル動きベクトルのみで算出された幾何変換係数を用いる必要がある。また、移動被写体を位置合わせするためには、被写体毎に動体の動きベクトルから算出された幾何変換係数を用いる必要がある。 In order to align a stationary subject between images, it is necessary to use a geometric transformation coefficient calculated only by a global motion vector. Further, in order to align the moving subject, it is necessary to use a geometric transformation coefficient calculated from the motion vector of the moving object for each subject.
特許文献1には、グローバルな動きベクトルと、画像を複数のブロックに分割してブロックごとに算出したローカル動きベクトルとの一致度から、各ブロックが背景か移動被写体なのか判定し、位置合わせに用いる動きベクトルを決定する方法が開示されている。 In Patent Document 1, it is determined whether each block is a background or a moving subject from the degree of coincidence between a global motion vector and a local motion vector calculated for each block by dividing an image into a plurality of blocks. A method for determining a motion vector to use is disclosed.
特許文献2には、複数のテンプレートの各々について得られる動きベクトルの頻度分布を算出し、最大頻度の動きベクトルをグローバル動きベクトルと判定する方法が開示されている。 Patent Document 2 discloses a method of calculating a frequency distribution of motion vectors obtained for each of a plurality of templates and determining a motion vector having the maximum frequency as a global motion vector.
カメラの動きによる撮像画像内の被写体の移動量は被写体距離によって異なり、近い被写体ほど画像内での移動量は大きくなる。しかしながら、特許文献1や特許文献2では、グローバル動きベクトルの算出に被写体距離を考慮していないため、近距離の静止被写体に関する動きベクトルを移動被写体の動きベクトルと誤判定する可能性があった。 The amount of movement of the subject in the captured image due to the movement of the camera varies depending on the subject distance, and the closer the subject, the larger the amount of movement in the image. However, in Patent Literature 1 and Patent Literature 2, since the subject distance is not considered in the calculation of the global motion vector, there is a possibility that a motion vector related to a short-distance still subject is erroneously determined as a motion vector of a moving subject.
また、移動被写体が画像内で占める面積が大きいと動体の動きベクトルが支配的になるため、数の多い動体の動きベクトルがグローバル動きベクトルとして誤判定される可能性もあった。 In addition, since the motion vector of the moving object becomes dominant when the area occupied by the moving subject in the image is large, the motion vector of a large number of moving objects may be erroneously determined as a global motion vector.
本発明はこのような従来技術の課題に鑑み、被写体の距離を考慮することによって画像中の静止被写体と移動被写体とを精度よく判別することが可能な画像処理装置およびその制御方法を提供することを目的とする。 The present invention provides an image processing apparatus capable of accurately discriminating between a stationary subject and a moving subject in an image by considering the distance of the subject, and a method for controlling the same, in view of the problems of the prior art. With the goal.
上述の目的は、距離情報を用いて、画像の領域をグループ化するグループ化手段と、グループごとに、他の画像に対する動きを検出する検出手段と、動きの大きさを、特定の距離に基づいて正規化する正規化手段と、大きさが正規化された動きに基づいて、グループごとに、静止被写体の領域か移動被写体の領域かを判定する判定手段と、を有することを特徴とする画像処理装置によって達成される。 The above-described object is based on a specific distance based on a specific distance, a grouping unit that groups image regions using distance information, a detection unit that detects a motion relative to another image for each group, and a magnitude of the motion. And a normalizing unit that normalizes the image and a determination unit that determines, for each group, whether the region is a stationary subject region or a moving subject region based on a motion whose size is normalized. Achieved by processing equipment.
このような構成により本発明によれば、被写体の距離を考慮することによって画像中の静止被写体と移動被写体とを精度よく判別することが可能な画像処理装置およびその制御方法を提供することができる。 With such a configuration, according to the present invention, it is possible to provide an image processing apparatus capable of accurately discriminating between a stationary subject and a moving subject in an image by considering the distance of the subject, and a control method therefor. .
●(第1の実施形態)
以下、図面を参照して本発明の例示的な実施形態について詳細に説明する。なお、ここでは被写体の距離情報を取得可能な画像処理装置の一例としての、撮像素子の各画素が複数の光電変換領域を有し、1度の撮影(露光)で複数の視差画像を取得可能な構成を有するデジタルカメラに本発明を適用した例を説明する。しかしながら、多眼カメラを用いるなど、他の方法で視差画像を取得してもよい。また、被写体の距離情報が取得できれば、必ずしも視差画像を用いなくてもよい。
● (first embodiment)
Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the drawings. Here, as an example of an image processing apparatus capable of acquiring subject distance information, each pixel of the image sensor has a plurality of photoelectric conversion regions, and a plurality of parallax images can be acquired by one photographing (exposure). An example in which the present invention is applied to a digital camera having various configurations will be described. However, the parallax image may be acquired by other methods such as using a multi-lens camera. Further, if the distance information of the subject can be acquired, the parallax image is not necessarily used.
さらに、本発明において撮像機能や被写体の距離情報を生成する機能は必須でない。例えば、画像データと、この画像データが表す画像中の被写体の距離情報とが対応付けて記憶された記憶装置から、合成を行う複数の画像データと、対応する被写体の距離情報とを取得する構成であってよい。距離情報は例えば距離画像、奥行き画像、デプスマップなどと呼ばれる形式の情報であってよい。 Furthermore, in the present invention, an imaging function and a function for generating subject distance information are not essential. For example, a configuration for acquiring a plurality of pieces of image data to be combined and corresponding subject distance information from a storage device in which image data and distance information of the subject in the image represented by the image data are stored in association with each other It may be. The distance information may be information in a format called a distance image, a depth image, a depth map, or the like.
図1は、本実施形態に係るデジタルカメラ200の機能構成例を示すブロック図である。
システム制御部201は例えばCPUであり、デジタルカメラ200が備える各ブロックの制御プログラムをROM202より読み出し、RAM203に展開して実行することにより各ブロックの動作を制御し、デジタルカメラ200の各種機能を実現する。
FIG. 1 is a block diagram illustrating a functional configuration example of a
The
ROM202は、書き換え可能な不揮発性メモリであり、デジタルカメラ200が備える各ブロックの制御プログラムに加え、各ブロックの動作に必要なパラメータや、GUIデータ等を記憶する。また、射出瞳距離などのレンズ情報もROM202が記憶する。
The
RAM203は、書き換え可能な揮発性メモリであり、制御プログラムがロードされるほか、システム制御部201のワークエリアや、各ブロックから出力されたデータの一時的な記憶領域などとしても用いられる。
The
光学系204は、絞りおよびフォーカスレンズを含み、撮像部205に被写体像を形成する。撮像部205(撮像手段)は、例えばCCDやCMOSセンサ等の撮像素子であり、光学系204により形成された被写体像を、各画素で光電変換し、得られたアナログ画像信号をA/D変換部206に出力する。
The
上述の通り、本実施形態のデジタルカメラ200は、複数の視差画像を一度の撮影(露光)で取得することができる。このようなカメラとしてはステレオカメラの様な多眼カメラを代表としてさまざまなものが知られているが、本実施形態では、撮像部205(撮像素子)が受光面上に光学系204の射出瞳を分割するマイクロレンズアレイ(以下、MLA)を備えている。そして、このような撮像素子で得られる複数の視差画像の位相差を検出することで、被写体の距離情報(奥行き情報)を得ることができる。また、視差画像を加算することで、通常の撮像画像も得ることができる。
As described above, the
A/D変換部206は、入力されたアナログ画像信号にA/D変換処理を適用し、得られたデジタル画像データを出力する。デジタル画像データは、例えばシステム制御部201がRAM203に記憶する。
The A /
画像処理部207(画像処理手段)は、RAM203に記憶されている画像データに、ガンマ補正処理、ホワイトバランス調整処理や、色補間処理等の画像処理を適用する。なお、画像処理部207は、視差画像データを加算して通常画像を生成したり、必要に応じて画像データの符号化処理や復号処理も行ったりする。
An image processing unit 207 (image processing means) applies image processing such as gamma correction processing, white balance adjustment processing, and color interpolation processing to the image data stored in the
記録媒体208は例えば着脱可能なメモリカード等であり、画像処理部207で処理された画像データやA/D変換部206が出力する画像データなどが、予め定められた形式の画像ファイルとして記録される。
The
バス209は、各ブロックを、制御信号やデータを互いに通信可能に接続する。
距離情報算出部210(第4の算出手段)は画像処理部207で処理された視差画像データを読み込み、画像の各画素についての距離情報を算出する。距離情報算出部210の動作の詳細については後述する。
A
A distance information calculation unit 210 (fourth calculation unit) reads the parallax image data processed by the
変換係数算出部211は、基準画像データと、基準画像データに合成する画像データ(被合成画像データ)と、被合成画像データに対応する距離情報を取得する。そして、変換係数算出部211(グループ化手段)は、距離情報を用いて被合成画像内の被写体領域を抽出し、被写体領域をグループ化する。あるいは、変換係数算出部211は、被合成画像の領域を、距離範囲ごとのグループに分類する。変換係数算出部211(第1の算出手段)は、被写体グループごとに動きベクトルを算出し、被写体グループの被写体領域(被写体グループ領域)を基準画像に位置合わせするための幾何変換係数を、動きベクトルに基づいて算出する。
The conversion
変換係数算出部211(第3の算出手段)はさらに、後述する変換係数判定部212が出力する判定情報を所得し、判定情報からグローバルな動きと判定された被写体グループ領域の動きベクトルのみを用い、画像全体に対する幾何変換係数を算出する。
The conversion coefficient calculation unit 211 (third calculation unit) further obtains determination information output from the conversion
変換係数判定部212(生成手段)は変換係数算出部211が算出した幾何変換係数を用いて、被写体グループごとに代表動きベクトルを生成する。そして、変換係数判定部212(正規化手段および推定手段)は、代表動きベクトルを特定の距離によって正規化し、被写体距離に依存しない動きに変換してから、基準画像と被合成画像のグローバルな動きを表す動きベクトルを推定する。そして、変換係数判定部212(判定手段)は、被写体グループ領域の動きがグローバルな動き(静止被写体)か、個別の動き(移動被写体)かを判定し、判定結果を表す判定情報を被写体グループごとに出力する。変換係数算出部211と、変換係数判定部212は、グループごとに、他の画像に対する動きを検出する検出手段を構成する。
The conversion coefficient determination unit 212 (generation unit) generates a representative motion vector for each subject group using the geometric conversion coefficient calculated by the conversion
幾何変換部213(変換手段)は被合成画像データと、被写体グループごとの幾何変換係数とを取得し、被合成画像内の各グループに属する被写体領域を対応する幾何変換係数に基づいて変換し、基準画像に位置合わせされた被合成画像のデータを生成する。
もしくは幾何変換部213は、被合成画像データと、被合成画像全体に対する幾何変換係数とを取得し、被合成画像を幾何変換係数に基づいて変換し、基準画像に位置合わせされた被合成画像のデータを生成する。
幾何変換部213(合成手段)はさらに、生成した被合成画像のデータを基準画像のデータに合成する処理を行ってもよい。
The geometric conversion unit 213 (conversion unit) acquires the combined image data and the geometric conversion coefficient for each subject group, converts the subject region belonging to each group in the combined image based on the corresponding geometric conversion coefficient, Data of a composite image aligned with the reference image is generated.
Alternatively, the
The geometric conversion unit 213 (synthesizing unit) may further perform a process of combining the generated combined image data with the reference image data.
次に、本実施形態における被写体の距離情報の生成方法について説明する。まず、撮像部205の構成例について、図2(a)〜図2(d)を用いて説明する。図2(a)は撮像部205をデジタルカメラ200の正面および側方から見た状態を模式的に示している。撮像部205が有する画素群143の受光面上にはMLA141が形成され、画素群143を構成する各画素は、図2(b)および(c)に示すように、一つのマイクロレンズ142と二つのフォトダイオード(光電変換領域)143a,143bで構成される。以下、フォトダイオード143aをA像用フォトダイオード(Aピクセル)、フォトダイオード143bをB像用フォトダイオード(Bピクセル)と呼ぶ。
Next, a method for generating subject distance information in the present embodiment will be described. First, a configuration example of the
図2(d)は光学系204の射出瞳144を概念的に示しており、A像瞳145aとAピクセル143a、B像瞳145bとBピクセル143bは、それぞれマイクロレンズ142により共役の関係を有する。従って、撮像部205の各画素は瞳分割機能を有し、Aピクセル143aには射出瞳144の右半分のA像瞳145aを通過した光束が、Bピクセル143bには射出瞳144の左半分のB像瞳145bを通過した光束が入射する。従って、Aピクセル群からなる画像と、Bピクセル群からなる画像は視差画像である。
FIG. 2D conceptually shows the
複数の画素について、Aピクセル群から構成される像信号をA像、Bピクセル群から構成される像信号をB像とし、A像とB像のずれ量を検出することにより、光学系204のデフォーカス量とデフォーカス方向を検出することができる。従って、撮像部205の出力する信号から位相差検出方式の自動焦点検出(AF)を実現することができる。
For a plurality of pixels, an image signal composed of an A pixel group is an A image, an image signal composed of a B pixel group is a B image, and a deviation amount between the A image and the B image is detected. The defocus amount and defocus direction can be detected. Accordingly, automatic focus detection (AF) using the phase difference detection method can be realized from the signal output from the
図2(e)〜(g)は位相差検出方式の焦点検出の原理を模式的に示している。図2(e)の状態は被写体よりも前にピントが合っている様子を、図2(f)は被写体にピントが合っている様子を、図2(g)は被写体よりも後ろにピントが合っている様子をそれぞれ表している。147aおよび147bは撮像部205に設定された焦点検出領域内の画素群から得られるA像およびB像をそれぞれ模式的に表したものである。図2(f)の場合はA像147aとB像147bのずれがなく、被写体に対して合焦している。図2(e)の場合はA像147aが中心に対して左側に、B像147bが中心に対して右側に離れており、図2(g)の場合はA像147aが中心に対して右側に、B像147bが中心に対して左側に離れている。このA像、B像のズレ量(デフォーカス量)と中心からのズレ方向、光学系204の焦点距離、撮像部205とフォーカスレンズとの距離から、被写体の距離情報を得ることができる。
FIGS. 2E to 2G schematically show the principle of focus detection by the phase difference detection method. 2 (e) shows how the subject is in focus before the subject, FIG. 2 (f) shows how the subject is in focus, and FIG. 2 (g) shows the subject behind the subject. Represents the state of suitability.
次に、図3を用いて、距離情報算出部210が行う距離情報の算出方法について説明する。図3は被写体距離の算出方法を模式的に表している。A像151aとB像151bが得られているとすると、光学系204の焦点距離および、フォーカスレンズと撮像部205との距離情報から、実線のように光束が屈折されることがわかる。従って、ピントの合う被写体は152aの位置にあることがわかる。同様にして、A像151aに対してB像151cが得られた場合には位置152b、B像151dが得られた場合には位置152cにピントの合う被写体があることがわかる。以上のように、各画素において、その画素を含むA像信号と、対応するB像信号との相対位置から、その画素位置における被写体の距離情報を算出することができる。
Next, a distance information calculation method performed by the distance
例えば図3においてA像151aとB像151dが得られている場合、像のずれ量の半分に相当する中間点の画素154から被写体位置152cまでの距離153を、画素154における被写体の距離情報として記憶する。このようにして、各画素について、被写体の距離情報を保持することが可能である。距離情報は、奥行き画像または距離画像として記憶してもよい。
For example, when the
次に、図4Aおよび図4Bに示すフローチャートを用いて、本実施形態における被合成画像の位置合わせ処理の全体について説明する。複数の画像のうち基準画像を除く各画像に対して順次以下の位置合わせ処理が適用される。ここでは、合成を行う複数の画像が連写などによって予め取得されているものとする。 Next, with reference to the flowcharts shown in FIG. 4A and FIG. 4B, the overall alignment process of the composite image in this embodiment will be described. The following alignment process is sequentially applied to each of the plurality of images excluding the reference image. Here, it is assumed that a plurality of images to be combined are acquired in advance by continuous shooting or the like.
S1500
システム制御部201は、被合成画像を構成する視差画像を用い、距離情報算出部210によって上述した方法で距離情報を算出し、例えばRAM203に保存する。なお、これも上述したが、距離情報の算出処理は必須でなく、予め算出された距離情報を取得する場合にはS1500は省略可能である。
S1500
The
システム制御部201は、S1501〜S1512において変換係数算出部211および変換係数判定部212を用い、位置合わせを行うための幾何変換係数の算出および、静止被写体と移動被写体の判定を行う。
S1501
変換係数算出部211は、距離情報に基づいて被合成画像内の被写体をグループ化する。グループ化の具体例を、図5および図6を用いて説明する。
図5(a)は撮影シーンの一例を示す図であり、デジタルカメラ200に近い順に静止被写体A 100、静止被写体B 101、移動被写体a 104、静止被写体C 102、静止被写体D 103が存在する。なお、背景部分についても1つ以上の被写体として取り扱ってよいが、以下の説明では省略する。
The
S1501
The conversion
FIG. 5A is a diagram illustrating an example of a shooting scene. A
図6(a)は、図5(a)の撮影シーンに含まれる被写体と、デジタルカメラ200からの距離を模式的に表している。また、図6(b)は、被合成画像について算出した画素ごとの距離情報のヒストグラムであり、被写体距離を示す横軸の縮尺は図6(a)と対応している。
FIG. 6A schematically shows the distance from the subject included in the shooting scene of FIG. 5A and the
本実施形態において変換係数算出部211は、被合成画像の距離情報の頻度分布(ヒストグラム)において、極大となる頻度を含む、予め定めた閾値以上の頻度が連続する距離情報のまとまりを1つの被写体グループとして、被写体をグループ化する。グループの境界は極小となる頻度か、閾値未満となる頻度の境界として定めることができるが、近接した距離に存在する2つの被写体グループを1つの被写体グループにまとめてもよい。これらの方法により、画像中の被写体領域は、同じ距離範囲に含まれる領域が同じグループに属するようにグループ化される。
In the present embodiment, the transform
図5〜図6の例では、静止被写体A 100,静止被写体B 101,静止被写体D 103がそれぞれ独立した被写体グループA,B,Dにグループ化され、近接している移動被写体a 104と静止被写体C 102が1つの被写体グループCにグループ化されている。
図5(b)は、グループ化の結果を被合成画像の領域として示している。被写体グループA〜Dはそれぞれ被写体グループ領域500〜503に相当する。
5 to 6, the
FIG. 5B shows the result of grouping as a region of the combined image. Subject groups A to D correspond to
変換係数算出部211は、グループ化の結果として、各被写体グループの代表距離(例えば頻度が最も高い距離情報)と、各被写体グループに対応する画像領域(被写体グループ領域)を表す情報(例えば座標情報)とを、例えばRAM203に保存する。
As a result of grouping, the conversion
S1502
次に変換係数算出部211は、各被写体グループ領域について動きベクトルを算出する。本実施形態において変換係数算出部211は、テンプレートマッチングに基づいて動きベクトルを算出する。
S1502
Next, the conversion
動きベクトルの算出方法について図7を用いて説明する。図7(a)および(b)は被合成画像と基準画像における被写体A 100の領域(被写体グループ領域500)をそれぞれクローズアップしたものである。
変換係数算出部211は、被合成画像における被写体グループ領域500に、n×n画素の矩形領域をターゲット領域600として設定する。ターゲット領域600の中心座標が動きベクトルの始点座標となる。
A motion vector calculation method will be described with reference to FIG. 7A and 7B are close-up views of the area of the subject A 100 (subject group area 500) in the combined image and the reference image.
The conversion
次に変換係数算出部211は、基準画像における被写体グループ領域500に、探索領域601を設定する。探索領域601は、ターゲット領域600に対応する領域を含み、かつターゲット領域600よりも広い範囲である。そして、変換係数算出部211は、探索領域601内でターゲット領域600と輝度や色差などで一致度が最も高い領域の中心の座標を動きベクトルの終点座標とする。テンプレートマッチングを用いた動きベクトルの検出については公知であるため、これ以上の詳細については説明を省略する。変換係数算出部211は、個々の被写体領域について複数箇所にターゲット領域を設定し、ターゲット領域ごとに動きベクトルを検出する。設定するターゲット領域の大きさ、位置および数については、予め条件を設定しておくことができるが、被写体領域内に満遍なく設定されるような条件とする。
Next, the conversion
図7(c)は、図5(b)に示した被合成画像に、被写体グループ領域500〜503について算出された動きベクトル700〜703を模式的に示した図である。
被写体グループAに対応する被写体グループ領域500で算出された複数の動きベクトル700のそれぞれは、長さで移動量を、矢印の方向で移動方向を示している。他の被写体グループB〜Dについても同様に、複数の動きベクトル701〜703を示している。
FIG. 7C is a diagram schematically showing
Each of the plurality of
S1503
変換係数算出部211は、まず最初の被写体グループ(i=0番目)を選択する。説明のためグループAは0番目、グループBは1番目のように、グループのアルファベット順(あるいは距離の近い順)に番号が割り当てられるものとする。
S1503
The conversion
S1504
変換係数算出部211は、i番目の被写体グループの領域について算出されている動きベクトルの数が第1の所定値以上か判定し、第1の所定値以上ならS1505に、第1の所定値未満ならS1508に、処理を進める。ここで第1の所定値は、被写体グループ領域についての幾何変換係数を算出するに必要な数であり、幾何変換を射影変換で行う場合には4となる。アフィン変換など他の方法を用いる場合には方法に応じた数とする。
S1504
The conversion
S1505
変換係数算出部211は、i番目の被写体グループの領域について算出されている動きベクトルを用いて、その被写体グループ領域に対する幾何変換係数を算出する。
幾何変換係数が射影変換係数である場合の算出方法について説明する。射影変換は以下の式1で表すことができる。
The conversion
A calculation method when the geometric transformation coefficient is a projective transformation coefficient will be described. Projective transformation can be expressed by Equation 1 below.
式(1)は以下の式(2)および式(3)のように変換することができる。
S1506
変換係数判定部212は、変換係数算出部211がS1505で算出した幾何変換係数を用いて基準点の座標変換を行い、変換前の座標を始点、変換後の座標を終点とする動きベクトルを作成する。この動きベクトルを、i番目の被写体グループ領域の代表動きベクトルと呼ぶ。なお、本実施形態では基準点を座標原点(0,0)とする。図8(a)〜(d)に、被写体グループ領域500〜503(被写体グループA〜D)について得られた代表動きベクトル800〜803を示している。
S1506
The conversion
S1507
変換係数判定部212は、i番目の被写体グループ領域の代表動きベクトルを、特定の被写体グループの距離情報に基づいて正規化し、正規化代表動きベクトルを生成する。特定の距離情報で正規化することにより、静止被写体のみで構成された被写体グループの正規化代表動きベクトルの大きさは、被写体距離によらず同等な大きさを示すようになる。
S1507
The conversion
正規化代表動きベクトルの生成方法について説明する。
まず、変換係数判定部212は、正規化を行う光軸方向の距離を決定する。本実施形態ではデジタルカメラ200からの被写体グループAの距離(被写体グループAの代表距離)を、正規化距離とする。
正規化距離をDA(図6(b))、正規化を行いたい被写体グループの代表距離をDとすると、以下の式(4)によって、正規化を行いたい被写体グループの代表動きベクトルの大きさを正規化する。
|正規化代表動きベクトル|=|代表動きベクトル|×D/DA ・・・式(4)
A method for generating a normalized representative motion vector will be described.
First, the conversion
When the normalized distance is DA (FIG. 6B) and the representative distance of the subject group to be normalized is D, the size of the representative motion vector of the subject group to be normalized is expressed by the following equation (4). Is normalized.
| Normalized representative motion vector | = | Representative motion vector | × D / DA Expression (4)
図8(e)〜(h)は、図8(a)〜(d)に示した各被写体グループの代表動きベクトル800〜803の正規化代表動きベクトル804〜807を示している。ここでは、被写体グループAの距離で正規化しているため、図8(e)に示す被写体グループAの正規化代表動きベクトル804は、正規化前の代表動きベクトル800と等しい。なお、図8(e)〜(h)における808〜811は、正規化領域動きベクトル804〜807がx軸となす角(動きの方向)である。
FIGS. 8E to 8H show normalized
変換係数判定部212は、算出した正規化代表動きベクトルの情報を、被写体グループの番号(i)と関連付けて例えばRAM203に保存し、処理をS1509へ進める。
The conversion
S1508
S1504で、算出されている動きベクトルの数が第1の所定値よりも少ないと判定された場合、変換係数算出部211は、変換係数のない被写体グループを特定する情報として例えば被写体グループの番号iをRAM203に保存し、処理をS1509へ進める。
S1508
In S1504, when it is determined that the number of calculated motion vectors is less than the first predetermined value, the conversion
S1509
システム制御部201は、全ての被写体グループ領域について正規化代表動きベクトルの算出もしくはグループ番号の保存を行ったか判定し、未処理の被写体グループ領域があればS1510へ、未処理の被写体グループ領域がなければS1511へ処理を進める。
S1509
The
S1510
システム制御部201は、グループ番号iをインクリメントして処理をS1504へ戻す。
S1510
The
S1511
変換係数判定部212は、算出した正規化代表動きベクトルから、基準画像と被合成画像の撮影位置の変化量および変化方向に関する推定グローバル動きベクトルを生成する。ここでは、幾何変換係数が算出された被写体グループ領域のみを処理対象とする。
まず変換係数判定部212は、正規化代表動きベクトルについて、大きさと方向に関するヒストグラムを作成する。ここでは、方向をx軸と正規化代表動きベクトルとがなす角808〜811(図8(e)〜(h))で表すものとする。
S1511
The transform
First, the transform
図9(a),(b)に、正規化代表動きベクトルの大きさと角度のヒストグラムの例を示す。そして、変換係数判定部212は、頻度が最も高い大きさ900、方向901を有するベクトルを、推定グローバル動きベクトルとする。推定グローバル動きベクトルを図9(c)に示す。推定グローバル動きベクトル1000は、正規化代表動きベクトルの最頻値の大きさ900と角度901を有する。
FIGS. 9A and 9B show examples of normalized and representative motion vector magnitude and angle histograms. Then, the transform
S1512
次に変換係数判定部212は、被写体グループ領域ごとに、グローバルな動き(静止被写体)なのか、個別な動き(移動被写体)なのかを判定する。ここでも、幾何変換係数が算出された被写体グループ領域のみを処理対象とする。
S1512
Next, the conversion
この判定処理の詳細について、図10のフローチャートを用いて説明する。
S1600
変換係数判定部212は、最初の被写体グループ領域(i=0)の正規化代表動きベクトルを選択する。
Details of this determination processing will be described with reference to the flowchart of FIG.
S1600
The conversion
S1601
変換係数判定部212は、正規化代表動きベクトルの大きさと推定グローバル動きベクトルの大きさの差分絶対値を算出し、差分絶対値が第2の所定値未満か否か判定する。変換係数判定部212は、差分絶対値が第2の所定値未満の場合はS1602へ、第2の所定値以上の場合はS1604へ処理を進める。例えば第2の所定値は1[画素]とする。
S1601
The transform
S1602
変換係数判定部212は、正規化代表動きベクトルの方向(角度)と推定グローバル動きベクトルの方向(角度)の差分絶対値を算出し、差分絶対値が第3の所定値未満か否か判定する。変換係数判定部212は、差分絶対値が第3の所定値未満の場合はS1603へ、第2の所定値以上の場合はS1604へ処理を進める。例えば第3の所定値は1[度]とする。
S1602
The transform
S1603
変換係数判定部212は、処理対象の被写体グループ領域がグローバルな動きをしている(静止被写体)と判定し、処理をS1605へ進める。
S1603
The conversion
S1604
変換係数判定部212は、処理対象の被写体グループ領域がグローバルな動きをしていない(移動被写体)と判定し、処理をS1605へ進める。
S1604
The conversion
S1605
システム制御部201は、全ての(幾何変換係数が算出された)被写体グループ領域について判定処理を行なったか判定し、未処理の被写体グループ領域があればS1606へ処理を進める。未処理の被写体グループ領域がなければシステム制御部201は、個々の被写体グループ領域についての判定結果を表す情報を例えばRAM203に保存し、判定処理を終了してS1513(図4B)へ処理を進める。
S1605
The
S1606
システム制御部201は、グループ番号iをインクリメントして処理をS1601へ戻す。
S1606
The
S1513
システム制御部201は、S1512の判定処理において、グローバルな動きではない(移動被写体)と判定された被写体グループ領域について、グループ分けの精度を上げて再判定を行うか否か判定する。
S1513
In step S1512, the
静止被写体の領域と移動被写体の領域の両方を含んだ被写体グループ領域は、S1512の判定処理でグローバルな動きでないと判定される可能性が高い。そのため、グローバルな動きではない(移動被写体)と判定された被写体グループ領域が複数の被写体領域を含んでいると考えられる場合には、個々の被写体領域に再グループ化して再判定処理を行う。 There is a high possibility that the subject group region including both the stationary subject region and the moving subject region is determined not to be a global movement in the determination processing in S1512. For this reason, when it is considered that the subject group area determined not to be a global movement (moving subject) includes a plurality of subject areas, re-determination processing is performed by regrouping into individual subject areas.
システム制御部201は、グローバルな動きではない(移動被写体)と判定された被写体グループ領域に対応する距離情報のヒストグラムが、離散的な距離に高頻度を有している場合に、複数の被写体領域が含まれるものと判定し、再判定処理を行うと決定する。より具体的には、システム制御部201は、被写体グループ領域の距離情報のヒストグラムが、頻度の極大値を複数有する場合に、複数の被写体領域が含まれるものと判定する。なお、この判定方法は例示であり、例えば被写体グループ領域の距離情報に該当する画素の画像内における分布(座標)に基づいて、複数の被写体領域が含まれるか否かを判定してもよい。
When the histogram of the distance information corresponding to the subject group region that is determined not to be a global movement (moving subject) has a high frequency at discrete distances, the
再判定を行うと決定した被写体グループ領域が存在する場合、システム制御部201は処理をS1514へ進める。また、再判定を行うと決定した被写体グループ領域が存在しないか、全ての被写体グループ領域がグローバルな動きと判定されている場合、システム制御部201は処理をS1515へ進める。
If there is a subject group area determined to be redetermined, the
S1514
システム制御部201は、変換係数算出部211および変換係数判定部212によって再判定処理を行う。再判定処理の詳細について、図11のフローチャートを用いて説明する。
S1514
The
S2300
変換係数算出部211は、再判定処理を行うと決定された被写体グループ領域を複数のグループに再グループ化する。
例えば変換係数算出部211は、対応する距離情報のヒストグラムにおいて、離散的に頻度の高い距離を代表距離とする複数の被写体グループ領域を生成する。あるいは、処理対象の被写体グループ領域が、S1501において複数の被写体グループをまとめたものである場合には、S1501における被写体グループの検出結果を用いてもよい。
S2300
The conversion
For example, the conversion
例えば、距離情報のヒストグラムを、頻度が予め定めた閾値以上である極大値に対応する距離を代表距離とした複数の距離範囲に分割することで、再グループ化することができる。
図7〜図8の例では、被写体グループC(被写体グループ領域502)の正規化代表動きベクトルが推定グローバルベクトルと大きさ、方向において大きく異なる。そのため、S1512の判定処理では、被写体グループ領域502はグローバルな動きでないと判定される。
For example, the distance information histogram can be regrouped by dividing the histogram into a plurality of distance ranges with the distance corresponding to the maximum value having a frequency equal to or higher than a predetermined threshold as a representative distance.
7 to 8, the normalized representative motion vector of the subject group C (subject group region 502) is greatly different in magnitude and direction from the estimated global vector. Therefore, in the determination process of S1512, it is determined that the
被写体グループ領域502に対応する距離情報のヒストグラム(図6(b))には、移動被写体a 104に対応する部分と、静止被写体C 102に対応する部分が含まれている。そのため、変換係数算出部211は、被写体グループ領域502に対応する距離情報のヒストグラムをそれぞれの被写体に対応する被写体グループCA,CBに再グループ化する。
The histogram of distance information corresponding to the subject group area 502 (FIG. 6B) includes a portion corresponding to the moving subject a 104 and a portion corresponding to the stationary subject C102. Therefore, the conversion
再グループ化の結果を図12(a)に示す。移動被写体a 104は被写体グループCAとして、静止被写体C 102は被写体グループCBとして再グループ化される。その結果、被写体グループ領域502は、2つの被写体グループ領域1100、1101に分かれる。
以後、変換係数算出部211および変換係数判定部212は、個々の被写体グループ領域について、図4AのS1503〜S1510,図4BのS1512と同じ処理を行い、処理をS1515へ進める。推定グローバルベクトルは既に算出されているため、再判定処理ではS1511に相当する処理は行わない。
The result of regrouping is shown in FIG. The moving subject a 104 is regrouped as a subject group CA, and the
Thereafter, the conversion
図12(b),(c)は被写体グループ領域1100、1101(被写体グループCA、CB)の代表動きベクトル1200,1201を、図12(d),(e)は正規化代表動きベクトル1202,1203をそれぞれ示している。また、1203,1204は正規化領域動きベクトル1202,1203がx軸となす角である。
12B and 12C show the
S1515
システム制御部201は、幾何変換係数が算出されていない被写体グループ領域があるか判定し、ある場合はS1516へ、ない場合はS1518へ処理を進める。
S1515
The
S1516
システム制御部201は、幾何変換係数が算出されていない被写体グループ領域に対する幾何変換係数を変換係数算出部211によって生成する。本実施形態で変換係数算出部211は、算出済みの幾何変換係数から、被写体グループ領域の距離の関係に基づいて、幾何変換係数が算出されていない被写体グループ領域に対する幾何変換係数を生成する。
S1516
The
まず変換係数算出部211は、幾何変換係数が算出された被写体グループ領域のうち、グローバルな動きと判定されたものを2つ以上選択する。ここでは2つ選択するものとし、代表距離がデジタルカメラ200から近い順に被写体グループ領域1、被写体グループ領域2とし、それぞれの幾何変換係数をPi,Pjとする。
First, the conversion
図13(a)は、幾何変換係数が算出されていない被写体グループ領域、被写体グループ領域1、被写体グループ領域2の距離関係と、幾何変換係数の関係例を模式的に示す。変換係数算出部211は、幾何変換係数Pi 1301,Pj 1302を取得する。
次に変換係数算出部211は、被写体グループ領域1と被写体グループ領域2の代表距離の差Δdist 1303と、対応する幾何変換係数の差分Δparam 1304を算出する。
FIG. 13A schematically shows an example of the relationship between the distance relationship between the subject group region, the subject group region 1 and the subject group region 2 for which the geometric transformation coefficient is not calculated, and the geometric transformation coefficient. The conversion
Next, the conversion
変換係数算出部211は、幾何変換係数が算出できなかった被写体グループ領域の代表距離と、選択した被写体グループ領域のうち、デジタルカメラ200に最も近いものの代表距離との差dist 1305を算出する。
そして、変換係数算出部211は、幾何変換係数が算出されていない被写体グループ領域の幾何変換係数P 1300を、以下の式(5)によって算出する。
P=Pi+dist×Δparam/Δdist ・・・式(5)
なお、式(5)による算出は、式(1)に示した幾何変換係数a〜iの各々について行う。
The conversion
Then, the conversion
P = Pi + dist × Δparam / Δdist (5)
Note that the calculation using the equation (5) is performed for each of the geometric transformation coefficients a to i shown in the equation (1).
ここでは、幾何変換係数が算出できなかった被写体グループ領域よりデジタルカメラ200に近い、幾何変換係数が算出された被写体グループ領域を2つ選択した場合について例示した。しかし、幾何変換係数が算出できなかった被写体グループ領域より近いものと遠いものを1つずつ選択した場合や、遠いものを2つ選択した場合も、同様にして算出することができる。
Here, the case where two subject group regions with calculated geometric transformation coefficients that are closer to the
S1517
変換係数判定部212は、S1516で幾何変換係数を算出した被写体グループ領域がグローバルな動きなのか判定する。基本的な判定方法は図10を用いて説明した動きの判定処理と同様であるが、大きさおよび方向(角度)を比較するベクトルが異なる。
S1517
The conversion
具体的な方法について図13(b)を用いて説明する。図13(b)は、S1516で幾何変換係数を算出した被写体グループ領域1400と、算出されている動きベクトル1402を示している。なお、ここでは1つの動きベクトル1402しか示していないが、他の動きベクトルが算出されていてもよい。
A specific method will be described with reference to FIG. FIG. 13B shows the
変換係数判定部212は、算出されている1つの動きベクトル(ここでは動きベクトル1402とする)の始点1401を基準点として、S1516で算出した幾何変換係数を用いてS1506と同様にして動きベクトル1405を算出する。ここでは、幾何変換係数により、始点1401、終点1404の動きベクトル1405が算出されたものとする。
The transformation
次に変換係数判定部212は、動きベクトル1402と、動きベクトル1405について、S1601〜S1604と同様に大きさと方向(角度)の差を判定する。具体的には、変換係数判定部212は、大きさの差分絶対値が第4の所定値未満で、かつ方向(角度)の差分絶対値が第5の所定値未満であれば、被写体グループ領域1400がグローバルな動きをしている(静止被写体)と判定する。一方、いずれかの条件を満たさなければ、変換係数判定部212は、被写体グループ領域1400が個別な動きをしている(移動被写体)と判定する。例えば第4の所定値を1[画素]、第5の所定値を1[度]とする。
Next, the transform
S1516で幾何変換係数を算出した全ての被写体グループ領域について判定処理が行われたら、システム制御部201は個々の被写体グループ領域についての判定結果を表す情報を例えばRAM203に保存し、処理をS1518へ進める。
When the determination process is performed for all the subject group areas for which the geometric transformation coefficients have been calculated in S1516, the
S1518
システム制御部201は、被合成画像に対して幾何変換部213で幾何変換処理を適用し、基準画像へ位置合わせされた画像を生成する。幾何変換処理は以下の方法のいずれかであってよい。
(第1の方法)
被合成画像の被写体グループ領域ごとに、それぞれに対して算出された幾何変換係数を用いて幾何変換処理を適用する。
(第2の方法)
被合成画像の被写体グループ領域のうち、グローバルな動きをしていると判定されたものについて得られている動きベクトルから1つの幾何変換係数を算出し、被合成画像全体に適用する。なお、この場合、S1505と同様にして、変換係数算出部211で幾何変換係数を求めることができる。
S1518
The
(First method)
A geometric transformation process is applied to each subject group region of the composite image using the geometric transformation coefficient calculated for each.
(Second method)
One geometric transformation coefficient is calculated from a motion vector obtained for a subject group region of the composite image that is determined to have a global motion, and is applied to the entire composite image. In this case, the geometric transformation coefficient can be obtained by the transformation
第1の方法は被写体領域ごとの幾何変換係数を用いるため、位置合わせの精度は第2の方法より高いが、被写体領域ごとに幾何変換係数を切り替え、変換を行う必要があるため処理負荷および処理時間の点で第2の方法より不利である。
第2の方法は、1回の変換処理で済むため、処理負荷および処理時間の点で第1の方法より有利であるが、位置合わせの精度は第1の方法より低くなる。特に、移動被写体の位置合わせの精度低下が大きくなる可能性がある。
Since the first method uses a geometric transformation coefficient for each subject area, the alignment accuracy is higher than that of the second method. However, since it is necessary to switch the geometric transformation coefficient for each subject area and perform transformation, the processing load and processing It is disadvantageous over the second method in terms of time.
Since the second method requires only one conversion process, the second method is more advantageous than the first method in terms of processing load and processing time, but the accuracy of alignment is lower than that of the first method. In particular, there is a possibility that the accuracy of positioning of the moving subject will be greatly reduced.
これらの方法のどちらを用いるかは、画像処理装置の性能や利用可能なリソース、処理負荷などに応じて適宜決定すれば良く、動的に切り替えて用いてもよい。 Which of these methods is used may be determined as appropriate according to the performance of the image processing apparatus, available resources, processing load, and the like, and may be switched dynamically.
本実施形態では距離情報を用いて正規化した動きベクトルを用いて画像間の全体的な動きを推定し、各被写体領域がグローバルな動きをしている(静止被写体)かグローバルな動きをしていない(移動被写体)かを判定する。そのため、被写体距離に応じた画像中の移動量の差や、画像中に占める移動被写体の影響を抑制し、静止被写体か否かを精度良く判定でき、グローバル動きベクトルの推定精度が向上する。そのため、位置合わせの精度を向上させることができる。 In this embodiment, the overall motion between images is estimated using a motion vector normalized using distance information, and each subject region is moving globally (a stationary subject) or moving globally. It is determined whether it is present (moving subject). Therefore, the difference in the amount of movement in the image according to the subject distance and the influence of the moving subject in the image can be suppressed, and it can be accurately determined whether or not the subject is a stationary subject, and the global motion vector estimation accuracy is improved. Therefore, the alignment accuracy can be improved.
●(第2の実施形態)
次に、本発明の第2の実施形態について説明する。本実施形態は、第1の実施形態における被写体グループの複数に跨るような大きな奥行きを有する静止被写体が存在し、また同一距離に静止被写体と移動被写体が存在するシーンにおける位置合わせ処理に関する。位置合わせ処理の内容以外は第1の実施形態と同様で良いため、本実施形態もデジタルカメラ200の構成を用いて説明する。
● (Second Embodiment)
Next, a second embodiment of the present invention will be described. The present embodiment relates to an alignment process in a scene in which there are still subjects having a large depth straddling a plurality of subject groups in the first embodiment, and there are still subjects and moving subjects at the same distance. Since the contents other than the contents of the alignment process may be the same as those in the first embodiment, this embodiment will also be described using the configuration of the
図14は本実施形態における撮影シーンの一例を模式的に示す図であり、図5(a)に示したシーンに移動被写体b 1700と移動被写体c 1701とが加わっている。移動被写体b 1700は静止被写体A 100およびB 101の距離範囲に跨がる奥行きを有し、移動被写体c 1701は静止被写体D 103と同じ距離に存在する。なお、背景部分についても1つ以上の被写体として取り扱ってよいが、以下の説明では省略する。
FIG. 14 is a diagram schematically showing an example of a shooting scene in the present embodiment. A moving
次に、本実施形態における位置合わせ処理について、図15のフローチャートを用いて説明する。なお、図15において第1の実施形態と同様の処理を行う工程には図4A、図4Bと同じ参照数字を付し、説明は省略する。 Next, the alignment process in this embodiment is demonstrated using the flowchart of FIG. In FIG. 15, the same reference numerals as those in FIG. 4A and FIG.
S2400
変換係数算出部211は、距離情報に基づいて被合成画像内の被写体をグループ化する。本実施形態においては2段階のグループ化を行うが、この工程で行うグループ化は基本的にS1501におけるグループ化と同様である。
図16は、図6と同様に、図14の撮影シーンに含まれる被写体の、デジタルカメラ200からの距離と、被合成画像の距離情報の頻度分布とを模式的に表している。
変換係数算出部211は、被合成画像の距離情報の頻度分布(ヒストグラム)において、極大となる頻度を含む、予め定めた閾値以上の頻度が連続する距離情報のまとまりを1つの被写体グループとして、被写体をグループ化する。
S2400
The conversion
FIG. 16 schematically shows the distance from the
The conversion
被写体グループCは、第1の実施形態と同一である。被写体グループDは、新たに移動被写体c 1701を含んでいる。一方、奥行きの大きな移動被写体b 1700が加わったことにより、静止被写体A 100、B 101に対応する距離情報の区切りが明確で無くなり、被写体グループA,Bは一連の頻度分布の極小値を境界としてグループ化されている。
The subject group C is the same as in the first embodiment. The subject group D newly includes a moving
S2401
次に変換係数算出部211は、本実施形態に特徴的な2段階目のグループ化を行う。具体的には変換係数算出部211は、各被写体グループに対応する画像中の領域に基づいてグループ化する。
S2401
Next, the transform
例えば、変換係数算出部211(グループ化手段)は、各被写体グループに対応する距離情報から画素座標を特定し、被写体グループに対応する閉領域を抽出する。閉領域の抽出は、例えば動的輪郭モデル(Snake法)など公知の手法を用いることができる。抽出した閉領域のうち、隣接している、もしくは間隔が閾値以内の領域はまとめて1つの被写体グループとする。 For example, the conversion coefficient calculation unit 211 (grouping unit) specifies pixel coordinates from distance information corresponding to each subject group, and extracts a closed region corresponding to the subject group. For extraction of the closed region, for example, a known method such as a dynamic contour model (Snake method) can be used. Of the extracted closed regions, the adjacent regions or the regions whose intervals are within the threshold are collectively set as one subject group.
図17は、S2401におけるグループ化の結果を模式的に示している。S2400でグループ化された被写体グループA〜Dの各々は、S2401でさらに2つの被写体グループにグループ化されている。具体的には、被写体グループAは、静止被写体A 100に対応する被写体グループAAと、移動被写体b 1700の近距離側の一部に対応する被写体グループABとに再グループ化されている。2000,2001は対応する被写体グループ領域である。
FIG. 17 schematically shows the result of grouping in S2401. Each of the subject groups A to D grouped in S2400 is further grouped into two subject groups in S2401. Specifically, the subject group A is regrouped into a subject group AA corresponding to the
同様に、被写体グループBは、静止被写体B 101に対応する被写体グループBAと、移動被写体b 1700の遠距離側の一部に対応する被写体グループBBとに再グループ化されている。2002,2003は対応する被写体グループ領域である。
Similarly, the subject group B is regrouped into a subject group BA corresponding to the
被写体グループCは、移動被写体a 104に対応する被写体グループCAと、静止被写体C 101に対応する被写体グループCBとに再グループ化されている。2004,2005は対応する被写体グループ領域である。
被写体グループDは、静止被写体D 103に対応する被写体グループDAと、移動被写体c 1701に対応する被写体グループDBとに再グループ化されている。2006,2007は対応する被写体グループ領域である。
The subject group C is regrouped into a subject group CA corresponding to the moving subject a 104 and a subject group CB corresponding to the
The subject group D is regrouped into a subject group DA corresponding to the
次に、変換係数判定部212は、被写体グループAA〜DBについて第1の実施形態と同様にして正規化動きベクトルを算出する。
Next, the transform
S2402
変換係数判定部212は、まず最初の被写体グループ(i=0番目)を選択する。説明のためグループAAは0番目、グループABは1番目のように、グループのアルファベット順(あるいは距離の近い順)に番号が割り当てられるものとする。
S2402
The conversion
S2403
変換係数判定部212は、S1505で変換係数算出部211が算出した幾何変換係数を用いて基準点の座標変換を行い、変換前の座標を始点、変換後の座標を終点とする動きベクトルを作成する。処理の内容はS1506と同一である。この動きベクトルを、i番目の被写体グループ領域の代表動きベクトルと呼ぶ。なお、本実施形態では基準点を座標原点(0,0)とする。図18(a)〜(h)に、被写体グループAA〜DBの領域について算出した代表動きベクトル2100〜2107を示している。
S2403
The conversion
S2404
変換係数判定部212は、i番目の被写体グループ領域の代表動きベクトルを、特定の被写体グループの距離情報に基づいて正規化し、正規化代表動きベクトルを生成する。処理の内容はS1507と同一である。本実施形態では、デジタルカメラ200からの被写体グループAAの距離(被写体グループAAの代表距離)を正規化距離DAとし、S1507と同様にする。
S2404
The conversion
図19(a)〜(h)は、図18(a)〜(h)に示した各被写体グループの代表動きベクトル2100〜2107の正規化代表動きベクトル2200〜2207を示している。ここでは、被写体グループAAの距離で正規化しているため、図18(a)に示す被写体グループAAの正規化代表動きベクトル2200は、正規化前の代表動きベクトル2100と等しい。なお、図19(a)〜(h)における2208〜2215は、正規化領域動きベクトル2200〜2207がx軸となす角(動きの方向)である。
FIGS. 19A to 19H show normalized
S2405
変換係数判定部212は、算出した正規化代表動きベクトルから、基準画像と被合成画像の撮影位置の変化量および変化方向に関する推定グローバル動きベクトルを生成する。ここでは、幾何変換係数が算出された被写体グループ領域のみを処理対象とする。処理の内容はS1511と同一であるため、詳細の説明は省略する。
S1512の判定処理以下は第1実施形態と同一の処理であるため説明を省略する。
S2405
The transform
Since the determination processing in S1512 and subsequent steps are the same as those in the first embodiment, description thereof will be omitted.
以上説明したように、本実施形態によれば、距離情報の頻度分布に基づいて被写体をグループ化した後、各グループを、対応する画像領域に基づいてさらにグループ化する。そのため、奥行きの大きな被写体が存在する場合や、同一距離に静止被写体と移動被写体が存在するようなシーンであっても、静止被写体か否かを精度良く判定でき、グローバル動きベクトルの推定精度が向上する。そのため、位置合わせの精度を向上させることができる。 As described above, according to the present embodiment, the subjects are grouped based on the frequency distribution of distance information, and then each group is further grouped based on the corresponding image region. Therefore, even when there is a subject with a large depth, or even in a scene where a stationary subject and a moving subject exist at the same distance, it is possible to accurately determine whether or not the subject is a stationary subject, improving the accuracy of global motion vector estimation. To do. Therefore, the alignment accuracy can be improved.
(その他の実施形態)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサーがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
(Other embodiments)
The present invention supplies a program that realizes one or more functions of the above-described embodiments to a system or apparatus via a network or a storage medium, and one or more processors in a computer of the system or apparatus read and execute the program This process can be realized. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.
200…デジタルカメラ、201…システム制御部、204…光学系、205…撮像部、206…変換部、207…画像処理部、208…記録媒体、209…バス、210…距離情報算出部、211…変換係数算出部、212…変換係数判定部、213…幾何変換部
DESCRIPTION OF
Claims (15)
前記グループごとに、他の画像に対する動きを検出する検出手段と、
前記動きの大きさを、特定の距離に基づいて正規化する正規化手段と、
前記大きさが正規化された動きに基づいて、前記グループごとに、静止被写体の領域か移動被写体の領域かを判定する判定手段と、
を有することを特徴とする画像処理装置。 Grouping means for grouping image regions using distance information;
Detecting means for detecting movement relative to other images for each group;
Normalizing means for normalizing the magnitude of the movement based on a specific distance;
Determining means for determining, for each of the groups, a region of a stationary subject or a region of a moving subject based on the movement whose size has been normalized;
An image processing apparatus comprising:
前記グループごとに、前記他の画像に位置合わせするための変換係数を算出する第1の算出手段と、
前記変換係数を用いて、前記グループごとに、前記動きを表す代表動きベクトルを生成する生成手段と、
を有し、
前記正規化手段が、前記代表動きベクトルの大きさを、前記特定の距離とグループに対応する距離との比で正規化することにより、前記動きの大きさを正規化する、
ことを特徴とする請求項1記載の画像処理装置。 The detecting means;
First calculation means for calculating a conversion coefficient for aligning with the other image for each group;
Generating means for generating a representative motion vector representing the motion for each of the groups using the transform coefficient;
Have
The normalizing means normalizes the magnitude of the motion by normalizing the magnitude of the representative motion vector by a ratio of the specific distance to a distance corresponding to a group.
The image processing apparatus according to claim 1.
前記第1の算出手段は、
検出された前記動きベクトルの数が予め定められた定めた所定値未満であるグループに対しては前記変換係数を算出せず、
検出された前記動きベクトルの数が予め定められた定めた所定値以上であるグループに対しては前記動きベクトルに基づいて前記変換係数を算出する、
ことを特徴とする請求項2に記載の画像処理装置。 The detecting means detects a motion vector representing the motion for each group;
The first calculation means includes
For the group in which the number of detected motion vectors is less than a predetermined value determined in advance, the conversion coefficient is not calculated,
For the group in which the number of detected motion vectors is equal to or greater than a predetermined value, the conversion coefficient is calculated based on the motion vectors.
The image processing apparatus according to claim 2.
前記他の画像に位置合わせされた画像を前記他の画像に合成する合成手段と、
をさらに有することを特徴とする請求項2から4のいずれか1項に記載の画像処理装置。 Transform means for applying the transform coefficient for each group and generating an image aligned with the other image;
Synthesizing means for synthesizing the image aligned with the other image with the other image;
The image processing apparatus according to claim 2, further comprising:
前記画像の全体に前記変換係数を適用し、前記他の画像に位置合わせされた画像を生成する変換手段と、
前記他の画像に位置合わせされた画像を前記他の画像に合成する合成手段と、
をさらに有することを特徴とする請求項2から4のいずれか1項に記載の画像処理装置。 Based on the motion vector detected by the detection means for the group determined as the area of the stationary subject by the determination means, a third conversion coefficient is calculated for aligning the entire image with the other image. A calculation means;
Transform means for applying the transform coefficient to the entire image and generating an image aligned with the other image;
Synthesizing means for synthesizing the image aligned with the other image with the other image;
The image processing apparatus according to claim 2, further comprising:
前記グループごとの前記大きさが正規化された動きに基づいて、前記他の画像に対する前記画像の全体の動きを推定する推定手段を有し、
前記大きさが正規化された動きと、前記全体の動きとの差が所定値未満であるグループを静止被写体の領域と判定し、前記大きさが正規化された動きと、前記全体の動きとの差が所定値以上であるグループを移動被写体の領域と判定する、
ことを特徴とする請求項1から6のいずれか1項に記載の画像処理装置。 The determination means is
Estimating means for estimating the overall motion of the image relative to the other image based on the normalized motion of the group for each group;
A group in which the difference between the motion with the normalized size and the overall motion is less than a predetermined value is determined as a still subject region, and the motion with the normalized size and the overall motion are A group in which the difference between the two is greater than or equal to a predetermined value is determined as a moving subject area;
The image processing apparatus according to claim 1, wherein the image processing apparatus is an image processing apparatus.
前記視差画像から前記距離情報を生成する第4の算出手段と、
前記視差画像から前記画像を生成する画像処理手段と、
請求項1から12のいずれか1項に記載の画像処理装置と、
を有することを特徴とする撮像装置。 Imaging means capable of acquiring parallax images;
Fourth calculation means for generating the distance information from the parallax image;
Image processing means for generating the image from the parallax image;
The image processing apparatus according to any one of claims 1 to 12,
An imaging device comprising:
検出手段が、前記グループごとに、他の画像に対する動きを検出する検出工程と、
正規化手段が、前記動きの大きさを、特定の距離に基づいて正規化する正規化工程と、
判定手段が、前記大きさが正規化された動きに基づいて、前記グループごとに、静止被写体の領域か移動被写体の領域かを判定する判定工程と、
を有することを特徴とする画像処理装置の制御方法。 A grouping means for grouping image regions using distance information;
A detecting step for detecting movement of the other image for each of the groups;
A normalizing step in which normalizing means normalizes the magnitude of the movement based on a specific distance;
A determination step of determining, for each of the groups, a region of a stationary subject or a region of a moving subject based on the movement whose size has been normalized;
A control method for an image processing apparatus, comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015023544A JP6452481B2 (en) | 2015-02-09 | 2015-02-09 | Image processing apparatus and control method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015023544A JP6452481B2 (en) | 2015-02-09 | 2015-02-09 | Image processing apparatus and control method thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2016146601A JP2016146601A (en) | 2016-08-12 |
JP6452481B2 true JP6452481B2 (en) | 2019-01-16 |
Family
ID=56685654
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2015023544A Active JP6452481B2 (en) | 2015-02-09 | 2015-02-09 | Image processing apparatus and control method thereof |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6452481B2 (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6602286B2 (en) * | 2016-12-07 | 2019-11-06 | キヤノン株式会社 | Image processing apparatus, image processing method, and program |
JP7030431B2 (en) * | 2017-06-26 | 2022-03-07 | 株式会社東芝 | Inspection support system and inspection support control program |
JP2019168886A (en) * | 2018-03-23 | 2019-10-03 | カシオ計算機株式会社 | Detection body region detecting device, imaging device, flying device, detection body region detecting method, imaging method and program |
WO2023089706A1 (en) * | 2021-11-17 | 2023-05-25 | 日本電信電話株式会社 | Image processing device, image processing method, and program |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2600504B2 (en) * | 1991-01-25 | 1997-04-16 | 日本ビクター株式会社 | Motion vector detection circuit |
JP2008294785A (en) * | 2007-05-25 | 2008-12-04 | Sanyo Electric Co Ltd | Image processor, imaging apparatus, image file, and image processing method |
JP4506875B2 (en) * | 2008-05-19 | 2010-07-21 | ソニー株式会社 | Image processing apparatus and image processing method |
JP5155110B2 (en) * | 2008-11-17 | 2013-02-27 | 株式会社日立国際電気 | Monitoring device |
-
2015
- 2015-02-09 JP JP2015023544A patent/JP6452481B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2016146601A (en) | 2016-08-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5954668B2 (en) | Image processing apparatus, imaging apparatus, and image processing method | |
US9253377B2 (en) | Image processing device and image processing system where de-mosaic image is generated based on shift amount estimation of pixels of captured images | |
US9025862B2 (en) | Range image pixel matching method | |
US8144974B2 (en) | Image processing apparatus, method, and program | |
US9619886B2 (en) | Image processing apparatus, imaging apparatus, image processing method and program | |
JP6561512B2 (en) | Parallax value deriving device, moving body, robot, parallax value deriving method, parallax value producing method, and program | |
JP2017531976A (en) | System and method for dynamically calibrating an array camera | |
JP6452481B2 (en) | Image processing apparatus and control method thereof | |
US8836765B2 (en) | Apparatus and method for generating a fully focused image by using a camera equipped with a multi-color filter aperture | |
US9483825B2 (en) | Apparatus and method for estimating distance using dual off-axis color filter aperture | |
JP7024736B2 (en) | Image processing equipment, image processing method, and program | |
US20170034436A1 (en) | Image capturing apparatus | |
JPWO2012176556A1 (en) | Corresponding point search device and distance measurement device | |
JP6544978B2 (en) | Image output apparatus, control method therefor, imaging apparatus, program | |
JP7195801B2 (en) | Image processing device and its control method, distance detection device, imaging device, program | |
JP2016070774A (en) | Parallax value derivation device, moving body, robot, parallax value production method and program | |
WO2019216229A1 (en) | Data processing device, data processing method, and program | |
US20130076868A1 (en) | Stereoscopic imaging apparatus, face detection apparatus and methods of controlling operation of same | |
JP6648916B2 (en) | Imaging device | |
JP7293100B2 (en) | camera system | |
US10332259B2 (en) | Image processing apparatus, image processing method, and program | |
JP7013205B2 (en) | Image shake correction device and its control method, image pickup device | |
JP2016099322A (en) | Imaging device, control method of imaging device, and program | |
JP6292785B2 (en) | Image processing apparatus, image processing method, and program | |
JP7346021B2 (en) | Image processing device, image processing method, imaging device, program and recording medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20180205 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20181105 |
|
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: 20181112 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20181211 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 6452481 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |