JP2017028687A - Image processing device - Google Patents
Image processing device Download PDFInfo
- Publication number
- JP2017028687A JP2017028687A JP2016132548A JP2016132548A JP2017028687A JP 2017028687 A JP2017028687 A JP 2017028687A JP 2016132548 A JP2016132548 A JP 2016132548A JP 2016132548 A JP2016132548 A JP 2016132548A JP 2017028687 A JP2017028687 A JP 2017028687A
- Authority
- JP
- Japan
- Prior art keywords
- reference frame
- image
- frame
- blur
- parameter
- 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.)
- Granted
Links
- 238000012545 processing Methods 0.000 title claims abstract description 151
- 238000000034 method Methods 0.000 claims description 135
- 230000006870 function Effects 0.000 claims description 3
- 239000011159 matrix material Substances 0.000 description 20
- 230000009466 transformation Effects 0.000 description 15
- 238000011156 evaluation Methods 0.000 description 12
- 238000013507 mapping Methods 0.000 description 10
- 238000001514 detection method Methods 0.000 description 8
- 238000006243 chemical reaction Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 230000001815 facial effect Effects 0.000 description 6
- 230000000694 effects Effects 0.000 description 5
- 230000002411 adverse Effects 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000000593 degrading effect Effects 0.000 description 1
- 230000005484 gravity Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/73—Deblurring; Sharpening
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/14—Transformations for image registration, e.g. adjusting or mapping for alignment of images
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/40—Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T3/4053—Scaling of whole images or parts thereof, e.g. expanding or contracting based on super-resolution, i.e. the output image resolution being higher than the sensor resolution
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/50—Image enhancement or restoration using two or more images, e.g. averaging or subtraction
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Studio Devices (AREA)
- Image Processing (AREA)
Abstract
Description
本発明は、画像処理装置に係り、特に、それぞれが共通する部分領域を有する複数の入力フレームの低解像度画像を位置合わせして高解像度画像を生成する画像処理装置に関する。 The present invention relates to an image processing apparatus, and more particularly to an image processing apparatus that generates a high-resolution image by aligning low-resolution images of a plurality of input frames each having a common partial area.
同一の被写体を撮影した複数入力フレームの画像に対し、各画像が低解像度で、かつ位置ずれがあれば、それらの画像の位置を合わせて重ね合わせることで、解像度の高い画像を生成することができる。この複数の低解像度画像から高解像度画像を生成する処理は、超解像処理と呼ばれる。 If there are multiple input frame images taken from the same subject and each image has a low resolution and a positional shift, a high-resolution image can be generated by aligning and superimposing the positions of those images. it can. The process of generating a high resolution image from the plurality of low resolution images is called super-resolution processing.
ここで、画像に位置ずれが生ずる撮影とは、静止している被写体に対してカメラを動かしながら撮影する場合、もしくは、動いている被写体を固定したカメラで撮影する場合である。なお、被写体もカメラも完全に静止している場合は、画像を何枚重ね合わせても解像度は上がらない。 Here, the shooting where the image is displaced is when shooting while moving the camera with respect to a stationary subject, or when shooting with a camera with a moving subject fixed. If the subject and the camera are completely stationary, the resolution will not increase no matter how many images are superimposed.
また、画像の位置合わせ(マッチング)には、テンプレートマッチングや特徴点マッチングを用いて位置合わせパラメータ(平行移動・回転などの幾何変換行列)を求めるのが一般的である。また、画像の重ね合わせには、再構成法を用いるのが一般的である。再構成法とは、高解像度画像の推定画像を生成し、その推定画像の尤もらしさが最大となるように推定画像の更新・評価を繰り返して、推定画像の収束解を最終出力とするものである。推定画像の尤もらしさとしては、[1]推定画像の位置をずらして解像度を劣化させて得られる低解像度画像がどれだけ元の入力画像に近いか、[2]推定画像において画素値のつながりが自然かどうか、などである。 For image alignment (matching), it is common to obtain alignment parameters (geometric transformation matrix such as translation and rotation) using template matching or feature point matching. In addition, a reconstruction method is generally used for overlaying images. The reconstruction method is to generate an estimated image of a high-resolution image, repeat the update and evaluation of the estimated image so that the likelihood of the estimated image is maximized, and use the converged solution of the estimated image as the final output. is there. As the likelihood of the estimated image, [1] how close the low resolution image obtained by shifting the position of the estimated image and degrading the resolution is close to the original input image, and [2] the connection of pixel values in the estimated image. Whether it is natural or not.
ところで、画像の位置合わせを自動で行う自動マッチング処理では、複数入力フレームの画像の位置合わせにおいて、基準点を見つけて合わせるという処理が行われるが、基準点の誤検出によるミスマッチは避けられない。特に、動いている被写体を遅いシャッタースピードで撮影すると被写体ブレが生じるため、ミスマッチする可能性が高くなる。 By the way, in the automatic matching process that automatically aligns images, a process of finding and matching a reference point is performed in the alignment of images of a plurality of input frames, but mismatch due to erroneous detection of the reference point is unavoidable. In particular, if a moving subject is photographed at a slow shutter speed, subject blurring occurs, so the possibility of mismatching increases.
被写体ブレによるミスマッチの可能性を低減させるには、超解像処理を行う前に画像の被写体ブレを除去すればよい。被写体ブレを除去するためには、ブレの無い原画像にブレPSF(Point Spread Function、点ひろがり関数)を畳み込んだ結果がブレ画像であるというモデルに基づき、ブレ画像とブレPSFから逆畳み込み(Deconvolution)を行うという手法が採られる(特許文献1参照)。この手法を用いることで、原画像に近いブレ除去画像を得ることができる。 In order to reduce the possibility of mismatch due to subject blur, it is only necessary to remove subject blur in the image before performing the super-resolution processing. In order to remove subject blurring, based on a model in which a blurring PSF (Point Spread Function) is convolved with an original image without blurring, the result is a blurry image. Deconvolution) is used (see Patent Document 1). By using this method, a deblurred image close to the original image can be obtained.
しかしながら、超解像処理を行う前に被写体ブレを除去するようにしても、ノイズ等の影響もあってミスマッチの課題を完全に回避することは難しい。自動マッチング処理では、上手くマッチングができない場合、本来使えるはずのフレームの画像が排除されてしまう。この結果、利用できるフレームの数が減少してしまい、超解像処理を行っても高解像度画像を得ることができなくなる。 However, even if subject blurring is removed before performing super-resolution processing, it is difficult to completely avoid the mismatch problem due to the influence of noise and the like. In the automatic matching process, if the matching cannot be performed well, an image of a frame that should originally be usable is excluded. As a result, the number of frames that can be used decreases, and a high-resolution image cannot be obtained even if super-resolution processing is performed.
この課題は、自動マッチング処理を通さず手動で各画像の位置合わせを行うにすることで回避することができるが、複数入力フレームの画像を1枚1枚表示させて手作業で少しずつずらすことで位置合わせする作業は非常に煩雑で、非生産的である。 This problem can be avoided by manually aligning the images without going through the automatic matching process, but manually shifting the images of multiple input frames one by one. The alignment process is very complicated and unproductive.
本発明は、かかる点に鑑みてなされたものであり、複数入力フレームの画像の位置合わせを手作業で行う場合に、作業効率の向上を図ることができる画像処理装置を提供することを目的とする。 The present invention has been made in view of such points, and an object of the present invention is to provide an image processing apparatus capable of improving work efficiency when manually aligning images of a plurality of input frames. To do.
本発明の画像処理装置は、それぞれが共通する部分領域を有する複数の入力フレームの低解像度画像を位置合わせして高解像度画像を生成する画像処理装置であって、前記複数入力フレームの中から選択された1つの基準フレームの画像および前記高解像度画像を生成する際に用いられるパラメータを表示させ、前記表示されたパラメータの調整に基づいて前記基準フレームの画像の表示内容を更新し、前記調整されたパラメータを前記基準フレームのパラメータとしてメモリに記憶させる基準フレーム調整部と、前記基準フレーム以外の入力フレームの1つである参照フレームの画像、および、前記基準フレームのパラメータを前記参照フレームのパラメータとして表示させ、前記表示されたパラメータの調整に基づいて前記参照フレームの画像の表示内容を更新し、前記調整されたパラメータを前記参照フレームのパラメータとしてメモリに記憶させる参照フレーム調整部と、前記各入力フレームに対して、対応する前記パラメータを用いて前記入力フレームに含まれるブレを除去する処理を行うブレ除去部と、前記ブレが除去された入力フレームの低解像度画像を位置合わせして高解像度画像を生成する画像生成部と、を具備する。 An image processing apparatus of the present invention is an image processing apparatus that generates a high-resolution image by aligning low-resolution images of a plurality of input frames each having a common partial area, and is selected from the plurality of input frames Display one reference frame image and a parameter used when generating the high-resolution image, update display content of the reference frame image based on the adjustment of the displayed parameter, and adjust A reference frame adjustment unit that stores the obtained parameters in the memory as parameters of the reference frame, an image of a reference frame that is one of the input frames other than the reference frame, and a parameter of the reference frame as a parameter of the reference frame Display and reference frame based on adjustment of the displayed parameter A reference frame adjustment unit that updates display content of an image and stores the adjusted parameter in a memory as a parameter of the reference frame, and the input frame includes the corresponding parameter for each input frame. A blur removing unit that performs processing to remove the blur, and an image generation unit that generates a high resolution image by aligning the low resolution image of the input frame from which the blur is removed.
本発明によれば、基準フレームでの調整結果を他の全ての参照フレームに対して反映できるので、複数入力フレームの画像の位置合わせを手作業で行う場合に、入力作業を少なくし、作業効率の向上を図ることができる。この結果、超解像処理に利用できるフレームの数を増やすことができるので、超解像処理によって高解像度画像を得ることができる。 According to the present invention, since the adjustment result in the base frame can be reflected on all other reference frames, the input work can be reduced and the work efficiency can be reduced when manually aligning the images of the plurality of input frames. Can be improved. As a result, the number of frames that can be used for the super-resolution processing can be increased, so that a high-resolution image can be obtained by the super-resolution processing.
以下、本実施の形態を図面に基づいて詳細に説明する。 Hereinafter, the present embodiment will be described in detail with reference to the drawings.
(実施の形態1)
図1は、本発明の実施の形態1に係る画像処理装置1の概略構成を示すブロック図である。同図において、本実施の形態に係る画像処理装置1は、複数の低解像度画像から高解像度画像を生成する超解像処理を行うことが可能な装置であり、画像データ入力部10、フレームメモリ11、グラフィカルユーザインタフェース部12、基準フレーム選択部13、注目被写体領域選択部14、マッチング計算部15、ブレPSF推定部16、メモリ部17、基準フレーム調整部18、参照フレーム調整部19、ブレ除去部20、再構成処理部21、及び超解像画像出力部22を備える。メモリ部17は、基準点位置保持メモリ17AとブレPSFパラメータ保持メモリ17Bから構成される。なお、再構成処理部21と超解像画像出力部22は、画像生成部23を構成する。
(Embodiment 1)
FIG. 1 is a block diagram showing a schematic configuration of an
画像データ入力部10は、不図示のカメラからフレーム単位で順次出力される画像データを入力する。なお、画像データ入力部10が入力したフレーム単位の画像データを、入力フレームとも言う。フレームメモリ11は、入力フレームを一時的に保存する。グラフィカルユーザインタフェース部12は、コンピュータグラフィックスと、マウス等のポインティング・デバイスとを用いて、直感的な操作を提供するユーザインタフェースである。
The image
基準フレーム選択部13は、フレームメモリ11に保存された複数入力フレームの中の1つを選択し、それを基準フレームとする。基準フレームとなる入力フレームの選択は、フレームメモリ11に保存された複数入力フレームのそれぞれの画質を評価し、最も評価の高い入力フレームを選択するか、またはフレームメモリ11に保存された複数入力フレームの一覧を表示して、その中の1つをユーザに選択させる。
The reference frame selection unit 13 selects one of a plurality of input frames stored in the
注目被写体領域選択部14は、基準フレーム選択部13で選択された基準フレームに注目被写体領域(部分領域)を設定する。基準フレームに対する注目被写体領域の設定はユーザによって行われる。すなわち、ユーザがマウス等のポインティング・デバイスを使用して注目被写体領域を設定する。
The target subject
マッチング計算部15は、フレームメモリ11に保存されている基準フレーム以外の複数入力フレームのそれぞれに対し、基準フレームの注目被写体領域とマッチする領域を見つける。
The matching
ブレPSF推定部16は、基準フレーム以外の複数入力フレームのそれぞれにおいて基準フレームの注目被写体領域の画像データとマッチする領域の中心点を求め、さらに、その中心点の動きベクトルよりブレの角度と長さを求めて、これらをブレPSFパラメータとして保存する。
The blur
基準フレーム調整部18は、複数入力フレームの中から選択された1つの基準フレームの画像および高解像度画像を生成する際に用いられる部分領域の位置とブレPSFパラメータを表示させ、表示された部分領域の位置とブレPSFパラメータの調整に基づいて基準フレームの画像の表示内容を更新し、調整された部分領域の位置とブレPSFパラメータを基準フレームの部分領域の位置とブレPSFパラメータとして基準点位置保持メモリ17AとブレPSFパラメータ保持メモリ17Bにそれぞれ記憶させるとともに、基準フレーム以外の複数入力フレームの部分領域の位置とブレPSFパラメータを更新して基準点位置保持メモリ17AとブレPSFパラメータ保持メモリ17Bにそれぞれさらに記憶させる。
The reference
参照フレーム調整部19は、基準フレーム以外の複数入力フレームの1つのである参照フレームの画像および参照フレームの部分領域の位置とブレPSFパラメータを表示させ、表示された部分領域の位置とブレPSFパラメータの調整に基づいて参照フレームの画像の表示内容を更新し、調整された部分領域の位置とブレPSFパラメータを参照フレームの部分領域の位置とブレPSFパラメータとして基準点位置保持メモリ17AとブレPSFパラメータ保持メモリ17Bにそれぞれ記憶させる。
The reference
ブレ除去部20は、フレームメモリ11に保存されている複数入力フレームのそれぞれに対して、対応するブレPSFパラメータを用いて当該入力フレームに含まれるブレを除去する処理を行う。再構成処理部21は、ブレが除去されたフレームの低解像度画像を位置合わせして高解像度画像を生成する。超解像画像出力部22は、再構成処理部21で生成された高解像度画像を出力する。
The
次に、本実施の形態に係る画像処理装置1の動作について説明する。
Next, the operation of the
(超解像処理)
図2は、超解像処理を示すフローチャートである。同図において、超解像処理は、画像データの読み込み(ステップS1)、基準フレームの選択(ステップS2)、注目被写体領域の設定(ステップS3)、自動位置合わせ(ステップS4)、ブレPSFの推定(ステップS5)、基準フレームでのパラメータ調整(ステップS6)、参照フレームでのパラメータ調整(ステップS7)、ブレの除去(ステップS8)、再構成処理(ステップS9)及び超解像画像の出力(ステップS10)の10ステップからなる。なお、図2に示す超解像処理は、自動位置合わせをする場合であるが、手動で位置合わせする場合もある。図3は、手動で位置合わせするようにした超解像処理を示すフローチャートである。手動で位置合わせする場合、ステップS4の自動位置合わせと、ステップS5のブレPSFの推定の2つのステップが不要となる。以下、自動位置合わせを利用した場合の超解像処理の各ステップを詳細に説明する。
(Super-resolution processing)
FIG. 2 is a flowchart showing the super-resolution processing. In the figure, super-resolution processing includes reading of image data (step S1), selection of a reference frame (step S2), setting of a subject area of interest (step S3), automatic alignment (step S4), and estimation of blur PSF. (Step S5), parameter adjustment in the reference frame (Step S6), parameter adjustment in the reference frame (Step S7), blur removal (Step S8), reconstruction processing (Step S9), and super-resolution image output ( It consists of 10 steps of step S10). Note that the super-resolution processing shown in FIG. 2 is a case where automatic alignment is performed, but there is a case where alignment is performed manually. FIG. 3 is a flowchart showing a super-resolution process in which manual alignment is performed. In the case of manual alignment, the two steps of the automatic alignment in step S4 and the blur PSF estimation in step S5 are not necessary. Hereinafter, each step of the super-resolution processing when using automatic alignment will be described in detail.
(画像データ読み込み処理)
図4は、画像データの読み込み処理を説明するためのフローチャートである。なお、同図において、PosC、PosP及びPosNは、それぞれレジスタである。まず画像ファイルを開き(ステップS20)、指定されたフレームへシーク(移動)する(ステップS21)。そして、指定された現在入力フレームのフレーム番号をPosCに設定する(ステップS22)。次いで、PosCに設定した現在入力フレームのフレーム番号のフレームデータをフレームメモリ11に読み込む(ステップS23)。次いで、PosCの設定値を「1」減算し、その値をPosPに設定する(ステップS24)。すなわち、現在入力フレームの1つ前方の入力フレームのフレーム番号をPosPに設定する。次いで、PosPに設定したフレーム番号のフレームデータが存在するどうか判定する(ステップS25)。この判定において、PosPに設定したフレーム番号のフレームデータが存在する場合(ステップS25:YES)、PosCに設定したフレーム番号からPosPに設定したフレーム番号を減算した値が「R」以下かどうか判定する(ステップS26)。ここで、「R」は、現在フレームを基点として、前方および後方それぞれに参照可能な最大フレーム数で、予めユーザが設定した値である。
(Image data reading process)
FIG. 4 is a flowchart for explaining the image data reading process. In the figure, PosC, PosP, and PosN are registers. First, an image file is opened (step S20), and seek (move) to a designated frame (step S21). Then, the frame number of the designated current input frame is set to PosC (step S22). Next, the frame data of the frame number of the current input frame set in PosC is read into the frame memory 11 (step S23). Next, “1” is subtracted from the set value of PosC, and the value is set to PosP (step S24). In other words, the frame number of the input frame immediately preceding the current input frame is set to PosP. Next, it is determined whether or not there is frame data with the frame number set in PosP (step S25). In this determination, if there is frame data of the frame number set in PosP (step S25: YES), it is determined whether or not the value obtained by subtracting the frame number set in PosP from the frame number set in PosC is equal to or less than “R”. (Step S26). Here, “R” is a maximum number of frames that can be referenced forward and backward from the current frame as a base point, and is a value set in advance by the user.
PosCに設定したフレーム番号からPosPに設定したフレーム番号を減算した値が「R」以下である場合(ステップS26:YES)、PosPに設定したフレーム番号のフレームデータをフレームメモリ11に読み込む(ステップS27)。そして、PosPに設定したフレーム番号を「1」減算し(ステップS28)、ステップS25の判定に戻る。 If the value obtained by subtracting the frame number set in PosP from the frame number set in PosC is equal to or less than “R” (step S26: YES), the frame data of the frame number set in PosP is read into the frame memory 11 (step S27). ). Then, “1” is subtracted from the frame number set in PosP (step S28), and the process returns to the determination in step S25.
一方、ステップS25において、PosPに設定したフレーム番号のフレームデータが存在しない場合(ステップS25:NO)、または、ステップS26において、PosCに設定したフレーム番号からPosPに設定したフレーム番号を減算した値が「R」より大きい場合(ステップS26:NO)、PosCの値に「1」加算し、その値をPosNに設定する(ステップS29)。すなわち、現在入力フレームの1つ後方の入力フレームのフレーム番号をPosNに設定する。そして、PosNに設定したフレーム番号のフレームデータが存在するかどうか判定する(ステップS30)。この判定において、PosNに設定したフレーム番号のフレームデータが存在する場合(ステップS30:YES)、PosNに設定したフレーム番号からPosCに設定したフレーム番号を減算した値がR以下かどうか判定する(ステップS31)。 On the other hand, if there is no frame data of the frame number set in PosP in step S25 (step S25: NO), or a value obtained by subtracting the frame number set in PosP from the frame number set in PosC in step S26. When larger than “R” (step S26: NO), “1” is added to the value of PosC, and the value is set to PosN (step S29). In other words, the frame number of the input frame immediately after the current input frame is set to PosN. Then, it is determined whether or not the frame data having the frame number set in PosN exists (step S30). In this determination, when there is frame data of the frame number set in PosN (step S30: YES), it is determined whether or not a value obtained by subtracting the frame number set in PosC from the frame number set in PosN is equal to or less than R (step S30). S31).
PosNに設定したフレーム番号からPosCに設定したフレーム番号を減算した値が「R」以下である場合(ステップS31:YES)、PosNに設定したフレーム番号のフレームデータをフレームメモリ11に読み込む(ステップS32)。次いで、PosNに設定したフレーム番号に「1」加算し(ステップS33)、ステップS30の判定に戻る。 When the value obtained by subtracting the frame number set in PosC from the frame number set in PosN is equal to or less than “R” (step S31: YES), the frame data of the frame number set in PosN is read into the frame memory 11 (step S32). ). Next, “1” is added to the frame number set in PosN (step S33), and the process returns to the determination in step S30.
一方、ステップS30において、PosNに設定したフレーム番号のフレームデータが存在しない場合(ステップS30:NO)、または、ステップS31において、PosNに設定したフレーム番号からPosCに設定したフレーム番号を減算した値が「R」以下ではない場合(ステップS31:NO)、画像データの読み込みを終了する。 On the other hand, if there is no frame data of the frame number set to PosN in step S30 (step S30: NO), or the value obtained by subtracting the frame number set to PosC from the frame number set to PosN in step S31 is If it is not less than “R” (step S31: NO), the reading of the image data is terminated.
(基準フレーム選択処理)
図5は、基準フレーム選択処理を説明するためのフローチャートである。なお、同図において、FrmRはレジスタである。まずFrmRに「1」を設定する(ステップS40)。次いで、フレームメモリ11中のFrmR番目の入力フレームのデータを取得する(ステップS41)。そして、取得したフレームデータの画質を評価し、評価スコアを得る(ステップS42)。次いで、今回得られた評価スコアが評価済みの入力フレームの中で最大かどうか判定し(ステップS43)、今回得られた評価スコアが最大ではない場合(ステップS43:NO)、FrmRの値に「1」加算し、その値をFrmRに設定する(ステップS44)。
(Reference frame selection process)
FIG. 5 is a flowchart for explaining the reference frame selection process. In the figure, FrmR is a register. First, “1” is set in FrmR (step S40). Next, data of the FrmR-th input frame in the
一方、今回得られた評価スコアが最大である場合(ステップS43:YES)、FrmR番目の入力フレームを基準フレーム(FrmA)とする(ステップS45)。ここで、画質が高い(コーデックで強い圧縮がかけられておらず、高周波成分が良く残っている)入力フレームを基準フレームとするのが好ましい。例えば、各フレームデータを周波数領域に変換して、高周波成分の多い・少ないで画質を評価し、最も高周波成分が多い入力フレームを基準フレームとする方法が有効である。 On the other hand, when the evaluation score obtained this time is the maximum (step S43: YES), the FrmR-th input frame is set as the reference frame (FrmA) (step S45). Here, it is preferable to use an input frame having high image quality (not strongly compressed by the codec and having good high-frequency components) as a reference frame. For example, it is effective to convert each frame data into the frequency domain, evaluate the image quality with a large or small amount of high-frequency components, and use an input frame with the highest high-frequency components as a reference frame.
ステップS45の処理後、FrmRの値に「1」加算し、その値をFrmRに設定する(ステップS44)。次いで、FrmRの値が「N」(フレームメモリ11に格納された入力フレームの総数)以下かどうか判定し(ステップS46)、「N」以下の場合(ステップS46:YES)、ステップS41に戻り、「N」以下ではない場合(ステップS46:NO)、基準フレーム選択処理を終了する。 After the process of step S45, “1” is added to the value of FrmR, and the value is set to FrmR (step S44). Next, it is determined whether or not the value of FrmR is equal to or less than “N” (the total number of input frames stored in the frame memory 11) (step S46). If it is equal to or less than “N” (step S46: YES), the process returns to step S41. If it is not less than “N” (step S46: NO), the reference frame selection process is terminated.
なお、上記基準フレーム選択処理は、自動で基準フレームを選択する場合であるが、ユーザが手動によって基準フレームを選択するようにしてもよい。図6は、ユーザが手動によって基準フレームを選択する場合の基準フレーム選択処理を説明するためのフローチャートである。まずフレームメモリ11に格納された入力フレーム一覧を表示する(ステップS40a)。そして、ユーザに、基準フレームに対する入力フレームを入力フレーム一覧から選択させる(ステップS41a)。すなわち、基準フレームに対する入力フレームを入力フレーム一覧から選択させる指示をユーザに出す。当該指示を出した後、基準フレームに対する入力フレームの選択が完了したかどうか判定し(ステップS42a)、選択が完了していない場合(ステップS42a:NO)、ステップS41aに戻り、選択が完了した場合(ステップS42a:YES)、選択された入力フレームを基準フレーム(FrmA)とする(ステップS43a)。この処理後、基準フレーム選択処理を終了する。
The reference frame selection process is performed when the reference frame is automatically selected, but the user may manually select the reference frame. FIG. 6 is a flowchart for explaining reference frame selection processing when the user manually selects a reference frame. First, the input frame list stored in the
(注目被写体領域設定処理)
図7は、注目被写体領域設定処理を説明するためのフローチャートである。同図において、まずフレームメモリ11に格納された基準フレーム(FrmA)全体を表示する(ステップS50)。次いで、ユーザに、注目被写体領域を基準フレームに設定させる(ステップS51)。すなわち、基準フレームに注目被写体領域を設定する指示をユーザに出す。この場合、表示したフレーム画像上で、矩形領域をマウスでクリック&ドラッグすることで選択させるか、または、設定ウィンドウを開いて、矩形領域の四隅の座標値を数値入力させる。もしくは、画像処理を併用することで、次のようなバリエーションも考えられる。すなわち、表示されたフレーム画像上で、注目被写体上の1点のみをクリックさせることで、クリックされた点近傍を画像処理して、注目被写体領域を自動検出・設定する。例えば、エッジ検出して、クリック点を囲む四角形を抽出し、最もナンバープレートらしい四角形を選んで、その四角形を囲む矩形領域を注目被写体領域とする。
(Attention subject area setting process)
FIG. 7 is a flowchart for explaining the target subject area setting process. In the figure, first, the entire reference frame (FrmA) stored in the
次いで、基準フレームに対する注目被写体領域の設定が完了したかどうか判定し(ステップS52)、基準フレームに対する注目被写体領域の設定が完了していない場合(ステップS52:NO)、ステップS51に戻り、基準フレームに対する注目被写体領域の設定が完了した場合(ステップS52:YES)、設定された領域を注目被写体領域(RoiA)とする(ステップS53)。この処理後、注目被写体領域設定処理を終了する。 Next, it is determined whether or not the setting of the target subject area for the reference frame has been completed (step S52). If the setting of the target subject area for the reference frame has not been completed (step S52: NO), the process returns to step S51 to return to the reference frame. When the setting of the subject area of interest is completed (step S52: YES), the set area is set as the subject area of interest (RoiA) (step S53). After this process, the target subject area setting process ends.
(自動位置合わせ処理)
図8は、自動位置合わせ処理を説明するためのフローチャートである。同図において、まず基準フレーム(FrmA)から注目被写体領域(RoiA)の画像データ(ImgA)を取得する(ステップS60)。次いで、FrmAの値を「1」減算し、その値をFrmRに設定し(ステップS61)、FrmRの値が「1」以上かどうか判定する(ステップS62)。この判定において、FrmRの値が「1」以上である場合(ステップS62:YES)、フレームメモリ11内のFrmR番目のフレームデータを取得する(ImgR)(ステップS63)。次いで、ImgRの中でImgAとマッチする領域を見つける(RoiR)(ステップS64)。ImgRの中でImgAとマッチする領域を見つけると、当該RoiRをRoiAに写像する幾何変換行列(MFrmR−FrmA)を求める(ステップS65)。
(Automatic alignment processing)
FIG. 8 is a flowchart for explaining the automatic alignment processing. In the figure, first, image data (ImgA) of the subject area of interest (RoiA) is acquired from the reference frame (FrmA) (step S60). Next, “1” is subtracted from the value of FrmA, the value is set to FrmR (step S61), and it is determined whether the value of FrmR is “1” or more (step S62). In this determination, when the value of FrmR is “1” or more (step S62: YES), the FrmR-th frame data in the
次いで、RoiRおよび幾何変換行列(MFrmR−FrmA)を基準点位置保持メモリ17Aに格納する(ステップS66)。その後、FrmRの値を「1」減算し、その値をFrmRに設定し(ステップS67)、ステップS62に戻る。
Next, the RoiR and the geometric transformation matrix (M FrmR−FrmA ) are stored in the reference point
一方、ステップS62でFrmRの値が「1」以上ではないと判定した場合(ステップS62:NO)、FrmAの値を「1」加算し、その値をFrmRに設定し(ステップS68)、FrmRの値が「N」以下かどうか判定する(ステップS69)。この判定において、FrmRの値が「N」以下である場合(ステップS69:YES)、フレームメモリ11内のFrmR番目のフレームデータを取得する(ImgR)(ステップS70)。次いで、ImgRの中でImgAとマッチする領域を見つける(RoiR)(ステップS71)。そして、見つけたRoiRをRoiAに写像する幾何変換行列(MFrmR−FrmA)を求める(ステップS72)。そして、RoiRおよび幾何変換行列(MFrmR−FrmA)を基準点位置保持メモリ17Aに格納する(ステップS73)。その後、FrmRの値に「1」加算し、その値をFrmRに設定し(ステップS74)、ステップS69に戻る。
On the other hand, if it is determined in step S62 that the value of FrmR is not “1” or more (step S62: NO), the value of FrmA is incremented by “1”, and the value is set to FrmR (step S68). It is determined whether the value is “N” or less (step S69). In this determination, when the value of FrmR is “N” or less (step S69: YES), the FrmR-th frame data in the
また、ステップS69でFrmRの値が「N」以下ではないと判定した場合(ステップS69:NO)、自動位置合わせ処理を終了する。 If it is determined in step S69 that the value of FrmR is not equal to or less than “N” (step S69: NO), the automatic alignment process is terminated.
ここで、マッチングには、テンプレートマッチングや特徴点マッチング等の公知の手法を用いることができる。また、幾何変換行列Mは、以下の8元連立方程式を解くことで得られる。
RoiA.C1=M×RoiR.C1
RoiA.C2=M×RoiR.C2
RoiA.C3=M×RoiR.C3
RoiA.C4=M×RoiR.C4
幾何変換行列Mは、図9に示すようになり、h1〜h8は未知数である。
RoiX.Cnは、注目被写体領域のコーナー点nの位置ベクトル(座標をx,yとすると、(x,y,1)T)である。
Here, for the matching, a known method such as template matching or feature point matching can be used. Further, the geometric transformation matrix M can be obtained by solving the following 8-ary simultaneous equations.
RoiA. C1 = M × RoiR. C1
RoiA. C2 = M × RoiR. C2
RoiA. C3 = M × RoiR. C3
RoiA. C4 = M × RoiR. C4
The geometric transformation matrix M is as shown in FIG. 9, and h1 to h8 are unknown numbers.
RoiX. Cn is a position vector ((x, y, 1) T , where x and y are coordinates) of the corner point n of the subject area of interest.
(ブレPSF推定処理)
図10及び図11は、ブレPSF推定処理を説明するためのフローチャートである。このブレPSF推定処理は、各入力フレームについて、隣接入力フレームとの位置合わせ結果に基づいて動きベクトルを計算し、動きベクトルの長さと方向をその入力フレームにおける被写体ブレの長さ・方向とするものである。
(Break PSF estimation process)
10 and 11 are flowcharts for explaining the blur PSF estimation processing. In this blur PSF estimation process, for each input frame, a motion vector is calculated based on the alignment result with the adjacent input frame, and the length and direction of the motion vector are set as the length and direction of subject blur in the input frame. It is.
これらの図において、まずFrmRに「1」を設定する(ステップS80)。次いで、基準点位置保持メモリ17AからRoiRを取得する(ステップS81)。そして、取得したRoiRの中心点(CtrR)を求める(ステップS82)。次いで、FrmRの値を「1」減算し、その値をFrmPに設定するとともに、FrmRの値を「1」加算し、その値をFrmNに設定する(ステップS83)。そして、FrmPの値が「1」以上「N」以下かどうか判定し(ステップS84)、「1」以上「N」以下である場合(ステップS84:YES)、CtrRをFrmPに写像する(CtrP)(ステップS85)。
In these figures, first, “1” is set in FrmR (step S80). Next, RoiR is acquired from the reference point
ステップS85の写像の計算は、CtrP←MFrmR→FrmP*CtrRである。
ここで、MFrmR→FrmP=MFrmA→FrmP*MFrmR→FrmA=MFrmP→FrmA −1*MFrmR→FrmA=である。右辺のMFrmR→FrmA及びMFrmR→FrmAは、基準点位置保持メモリ17Aから取得する。
The calculation of the mapping in step S85 is CtrP ← MFrmR → FrmP * CtrR.
Here, M FrmR → FrmP = M FrmA → FrmP * M FrmR → FrmA = M FrmP → FrmA −1 * M FrmR → FrmA =. M FrmR → FrmA and M FrmR → FrmA on the right side are acquired from the reference point
CtrRをFrmPに写像した後、FrmNの値が「1」以上「N」以下かどうか判定し(ステップS86)、「1」以上「N」以下である場合(ステップS86:YES)、CtrRをFrmNに写像する(CtrN)(ステップS87)。なお、ステップS87の写像の計算は、ステップS85のものと同様である。 After mapping CtrR to FrmP, it is determined whether the value of FrmN is “1” or more and “N” or less (step S86). If it is “1” or more and “N” or less (step S86: YES), CtrR is set to FrmN. (CtrN) (step S87). The calculation of the mapping in step S87 is the same as that in step S85.
次いで、(ベクトル(CtrP→CtrR)+ベクトル(CtrR→CtrN))÷2の値を動きベクトルMvRに設定する(ステップS88)。 Next, a value of (vector (CtrP → CtrR) + vector (CtrR → CtrN)) / 2 is set as the motion vector MvR (step S88).
一方、ステップS86でFrmNの値が「1」以上「N」以下ではないと判定された場合(ステップS86:NO)、ベクトル(CtrP→CtrR)を動きベクトルMvRに設定する(ステップS89)。 On the other hand, when it is determined in step S86 that the value of FrmN is not “1” or more and “N” or less (step S86: NO), the vector (CtrP → CtrR) is set as the motion vector MvR (step S89).
また、ステップS84でFrmPの値が「1」以上「N」以下ではないと判定された場合(ステップS84:NO)、FrmNの値が「1」以上「N」以下かどうか判定し(ステップS90)、「1」以上「N」以下である場合(ステップS90:YES)、CtrRをFrmNに写像する(CtrN)(ステップS91)。なお、ステップS91の写像の計算は、ステップS85のものと同様である。 When it is determined in step S84 that the value of FrmP is not “1” or more and “N” or less (step S84: NO), it is determined whether the value of FrmN is “1” or more and “N” or less (step S90). ), If “1” or more and “N” or less (step S90: YES), CtrR is mapped to FrmN (CtrN) (step S91). The calculation of the mapping in step S91 is the same as that in step S85.
次いで、ベクトル(CtrR→CtrN)の値を動きベクトルMvRに設定する(ステップS92)。 Next, the value of the vector (CtrR → CtrN) is set to the motion vector MvR (step S92).
ステップS88,ステップS89及びステップS92の中のいずれか1つの処理を行った後、MvRがx軸となす角度・MvRの長さを、ブレの角度(BaR)・長さ(BlR)とする(ステップS93)。そして、求めたブレの角度(BaR)・長さ(BlR)をブレPSFパラメータ保持メモリ17Bに格納する(ステップS94)。そして、FrmRの値に「1」加算し、その値をFrmRに設定する(ステップS95)。次いで、FrmRが「N」以下かどうか判定し(ステップS96)、「N」以下である場合(ステップS96:YES)、ステップS81に戻る。これに対して、FrmRが「N」以下ではない場合(ステップS96:NO)、ブレPSFの推定処理を終了する。 After performing any one of steps S88, S89 and S92, the angle MvR and the length of MvR made by the x-axis are set as the blur angle (BaR) and length (BlR) ( Step S93). Then, the obtained blur angle (BaR) and length (BlR) are stored in the blur PSF parameter holding memory 17B (step S94). Then, “1” is added to the value of FrmR, and the value is set to FrmR (step S95). Next, it is determined whether FrmR is “N” or less (step S96). If it is “N” or less (step S96: YES), the process returns to step S81. On the other hand, when FrmR is not equal to or less than “N” (step S96: NO), the blur PSF estimation process is terminated.
一方、ステップS90でFrmNの値が「1」以上「N」以下ではないと判定された場合(ステップS90:NO)、RoiR近傍の画像データをフレームメモリ11から取得し(ステップS104)、取得した画像データからブレの角度(BaR)・長さ(BlR)を推定する(ステップS105)。その後、ステップS94に移行する。 On the other hand, when it is determined in step S90 that the value of FrmN is not “1” or more and “N” or less (step S90: NO), image data in the vicinity of RoiR is acquired from the frame memory 11 (step S104). The blur angle (BaR) and length (BlR) are estimated from the image data (step S105). Thereafter, the process proceeds to step S94.
(基準フレームでのパラメータ調整処理)
図12は、基準フレームでのパラメータ調整処理を説明するためのフローチャートである。同図において、まず基準フレーム(FrmA)の画像データをフレームメモリ11から取得し(ステップS110)、これを表示する(ステップS111)。次いで、基準点位置保持メモリ17AからFrmAの注目被写体領域(RoiA)を取得し(ステップS112)、取得したRoiAのコーナー点及び領域枠を表示する(ステップS113)。さらに、RoiAのコーナー点の座標を表示する(ステップS114)。
(Parameter adjustment processing in the reference frame)
FIG. 12 is a flowchart for explaining the parameter adjustment processing in the reference frame. In the figure, first, image data of a reference frame (FrmA) is acquired from the frame memory 11 (step S110), and this is displayed (step S111). Next, the subject area (RoiA) of FrmA is acquired from the reference point
次いで、ブレPSFパラメータ保持メモリ17BからFrmAのブレ角度(BaA)・ブレ長(BlA)を取得し(ステップS115)、取得したブレ角度(BaA)・ブレ長(BlA)からブレPSF画像を生成して表示する(ステップS116)。また、ブレ角度(BaA)・ブレ長(BlA)の数値を表示する(ステップS117)。 Next, the blur angle (BaA) and blur length (BlA) of FrmA are acquired from the blur PSF parameter holding memory 17B (step S115), and a blur PSF image is generated from the acquired blur angle (BaA) and blur length (BlA). Are displayed (step S116). Further, numerical values of the blur angle (BaA) and the blur length (BlA) are displayed (step S117).
そして、表示中のRoiAの位置やブレPSFパラメータをユーザに調整させる(ステップS118)。すなわち、ユーザに対し、表示中のRoiAの位置やブレPSFパラメータを調整するように指示を出す。これにより、ユーザがRoiAの位置やブレPSFパラメータを調整すると、調整内容に応じて画面表示内容を更新する(ステップS119)。そして、ユーザによる調整が完了したかどうか判定し(ステップS120)、完了していない場合(ステップS120:NO)、ステップS118に戻り、完了した場合(ステップS120:YES)、基準フレームの元のブレ長BlAと調整後のブレ長BlA’の比(B’2BlA)を求める(ステップS121)。 Then, the user adjusts the position of RoiA being displayed and the blur PSF parameter (step S118). That is, the user is instructed to adjust the position of the RoiA being displayed and the blur PSF parameter. Accordingly, when the user adjusts the position of RoiA and the blur PSF parameter, the screen display content is updated according to the adjustment content (step S119). Then, it is determined whether or not the adjustment by the user is completed (step S120). If the adjustment is not completed (step S120: NO), the process returns to step S118, and if completed (step S120: YES), the original blurring of the reference frame is performed. A ratio (B′2B1A) between the length B1A and the adjusted blur length B1A ′ is obtained (step S121).
次いで、FrmRに「1」を設定する(ステップS122)。そして、ブレPSFパラメータ保持メモリ17BからFrmR番フレームのブレ長(BlR)を取得し(ステップS123)、BlR*B’2BlAを計算し、その結果をBlR’に設定する(ステップS124)。次いで、ブレPSFパラメータ保持メモリ17Bに格納されたBlRをBlR’で更新する(ステップS125)。次いで、基準点位置保持メモリ17AからFrmRの幾何変換行列MFrmR→FrmAを取得し(ステップS126)、MFrmR→FrmA −1*RoiA’を計算して、その結果をRoiR’とする(ステップS127)。
Next, “1” is set in FrmR (step S122). Then, the blur length (BlR) of the FrmR-th frame is obtained from the blur PSF parameter holding memory 17B (step S123), B1R * B′2B1A is calculated, and the result is set to B1R ′ (step S124). Next, B1R stored in the blur PSF parameter holding memory 17B is updated with B1R ′ (step S125). Next, the FrmR geometric transformation matrix M FrmR → FrmA is acquired from the reference point
ここで、RoiA’:ユーザによる調整完了時点でのRoiAの位置である。また、
RoiR’←MFrmR→FrmA −1×RoiA’とは、
RoiR’.C1←MFrmR→FrmA −1×RoiA’.C1
RoiR’.C2←MFrmR→FrmA −1×RoiA’.C2
RoiR’.C3←MFrmR→FrmA −1×RoiA’.C3
RoiR’.C4←MFrmR→FrmA −1×RoiA’.C4
を表現したもので、RoiA’の各コーナー座標を幾何変換行列MFrmR→FrmA −1によって写像した座標を計算する。自動位置合わせ処理を行わなかった場合は、MFrmR→FrmA −1を単位行列と見做して計算する。
Here, RoiA ′: the position of RoiA when the adjustment is completed by the user. Also,
RoiR ′ ← M FrmR → FrmA −1 × RoiA ′
RoiR′.C1 ← MFrmR → FrmA −1 × RoiA′.C1
RoiR′.C2 ← MFrmR → FrmA −1 × RoiA′.C2
RoiR′.C3 ← MFrmR → FrmA −1 × RoiA′.C3
RoiR′.C4 ← MFrmR → FrmA −1 × RoiA′.C4
The coordinates obtained by mapping each corner coordinate of RoiA ′ by the geometric transformation matrix M FrmR → FrmA −1 are calculated. When the automatic alignment process is not performed, the calculation is performed assuming that M FrmR → FrmA −1 is a unit matrix.
次いで、基準点位置保持メモリ17Aに格納された注目被写体領域RoiRをRoiR’で更新する(ステップS128)。次いで、FrmRの値に「1」加算し、その値をFrmRに設定する(ステップS129)。そして、FrmRが「N」以下かどうか判定し(ステップS130)、「N」以下である場合(ステップS130:YES)、ステップS123に戻り、「N」以下ではない場合(ステップS130:NO)、基準フレームでのパラメータ調整処理を終了する。
Next, the target subject area RoiR stored in the reference point
ステップS121〜ステップS130の処理(すなわちユーザによる調整完了後の一連の処理)によって、参照フレームの個別調整にかかる後の作業が大きく軽減される。 By the processing from step S121 to step S130 (that is, a series of processing after completion of adjustment by the user), the work after the individual adjustment of the reference frame is greatly reduced.
なお、ブレPSFパラメータ保持メモリ17Bに格納した他のパラメータ(焦点ボケの大きさ・形状や、ボケ除去時の強度設定など)を表示し、設定値をユーザで変更できるようにしてもよい。 It should be noted that other parameters stored in the blur PSF parameter holding memory 17B (the size / shape of the out-of-focus blur, the intensity setting at the time of blur removal, etc.) may be displayed so that the setting value can be changed by the user.
図13は、基準フレームでのパラメータ調整前のユーザインタフェース画面の一例を示す図である。同図(a)は基準フレームの画像、同図(b)はブレPSF画像である。基準フレームの調整では、位置合わせの基準とする4点(点1〜点4)の位置を基準フレームにて調整する。例えば、初期状態で注目被写体領域の4隅に置かれている各点(点1〜点4)を注目被写体領域内のナンバープレート100の4隅に移動する操作を行う。また、ブレPSFパラメータである、ブレ角度とブレ長の調整前は、ブレPSF画像が実際のブレ長よりも横長になっており、このままブレ除去を施すと過補正となり、ノイズが生じ得る状態となっている。
FIG. 13 is a diagram illustrating an example of a user interface screen before parameter adjustment in the reference frame. FIG. 4A is an image of a reference frame, and FIG. 4B is a blurred PSF image. In the adjustment of the reference frame, the positions of the four points (
図14は、基準フレームでのパラメータ調整後のユーザインタフェース画面の一例を示す図である。同図(a)は基準フレームの画像、同図(b)はブレPSF画像である。初期状態で注目被写体領域の4隅に置かれている各点(点1〜点4)が注目被写体領域内のナンバープレート100の4隅に位置している。また、ブレPSFパラメータである、ブレ角度とブレ長が調整されているので、ブレPSF画像が略点になっており、適切なブレ長が設定され、ブレ除去結果が良好となる状態となっている。
FIG. 14 is a diagram illustrating an example of a user interface screen after parameter adjustment in the reference frame. FIG. 4A is an image of a reference frame, and FIG. 4B is a blurred PSF image. Each point (
(参照フレームでのパラメータ調整処理)
図15及び図16は、参照フレームでのパラメータ調整処理を説明するためのフローチャートである。同図において、まず基準フレーム(FrmA)の画像データをフレームメモリ11から取得し(ステップS140)、これを表示する(ステップS141)。次いで、基準点位置保持メモリ17AからFrmAの注目被写体領域(RoiA)を取得する(ステップS142)。そして、取得した注目被写体領域(RoiA)のコーナー点及び領域枠を表示する(ステップS143)。また、RoiAのコーナー点の座標を表示する(ステップS144)。さらに、フレームメモリ11に格納された全フレームの一覧を表示する(ステップS145)。また、フレーム一覧に表示された個々のフレームに注目被写体領域の枠を表示する(ステップS146)。
(Parameter adjustment processing in the reference frame)
15 and 16 are flowcharts for explaining the parameter adjustment processing in the reference frame. In the figure, first, image data of a reference frame (FrmA) is acquired from the frame memory 11 (step S140) and displayed (step S141). Next, the subject area (RoiA) of FrmA is acquired from the reference point
次いで、任意の1フレームを選択状態にし(ステップS147)、参照フレームの選択変更や選択中参照フレームのパラメータ調整をユーザに行わせる(ステップS148)。すなわち、ユーザに対し、参照フレームの選択変更や選択中参照フレームのパラメータ調整するように指示を出す。これにより、ユーザが参照フレームの選択変更や選択中参照フレームのパラメータ調整を行う。次いで、参照フレームの選択状態が変更されたかどうか判定し(ステップS149)、参照フレームの選択状態が変更された場合(ステップS149:YES)、選択中参照フレーム(FrmR)の画像データをフレームメモリ11から取得し(ステップS150)、これを表示する(ステップS151)。
Next, one arbitrary frame is selected (step S147), and the user is caused to change the selection of the reference frame or adjust the parameters of the selected reference frame (step S148). That is, the user is instructed to change the selection of the reference frame and adjust the parameters of the reference frame being selected. Thereby, the user changes the selection of the reference frame and adjusts the parameters of the selected reference frame. Next, it is determined whether or not the reference frame selection state has been changed (step S149). If the reference frame selection state has been changed (step S149: YES), the image data of the selected reference frame (FrmR) is stored in the
FrmRを表示した後、基準点位置保持メモリ17AからFrmRの注目被写体領域(RoiR)を取得する(ステップS152)。そして、取得したRoiRのコーナー点及び領域枠を表示し(ステップS153)、またRoiRのコーナー点の座標を表示する(ステップS154)。さらに、ブレPSFパラメータ保持メモリ17BからFrmRのブレ角度(BaR)・ブレ長(BlR)を取得し(ステップS155)、ブレ角度(BaR)・ブレ長(BlR)からブレPSF画像を生成して表示する(ステップS156)。また、ブレ角度(BaR)・ブレ長(BlR)の数値を表示する(ステップS157)。その後、ステップS148に戻る。
After displaying FrmR, the target subject area (RoiR) of FrmR is acquired from the reference point
一方、ステップS149で参照フレームの選択状態が変更されていないと判定された場合(ステップS149:NO)、RoiRやブレPSFパラメータが変更されたかどうか判定する(ステップS158)。RoiRやブレPSFパラメータが変更された場合(ステップS158:YES)、調整内容に応じて画面表示内容を更新する(ステップS159)。そして、調整内容に応じて、選択中参照フレーム(FrmR)に対する、基準点位置保持メモリ17AやブレPSFパラメータ保持メモリ17Bの設定値を変更する(ステップS160)。その後、ステップS148に戻る。
On the other hand, if it is determined in step S149 that the selection state of the reference frame has not been changed (step S149: NO), it is determined whether or not the RoiR or blur PSF parameter has been changed (step S158). When the RoiR or blur PSF parameter is changed (step S158: YES), the screen display content is updated according to the adjustment content (step S159). Then, the set values of the reference point
また、ステップS158でRoiRやブレPSFパラメータが変更されていないと判定された場合(ステップS158:NO)、調整完了かどうか判定し(ステップS161)、調整完了ではない場合(ステップS161:NO)、ステップS148に戻り、調整完了の場合(ステップS161:YES)、参照フレームでのパラメータ調整処理を終了する。 If it is determined in step S158 that the RoiR or blur PSF parameter has not been changed (step S158: NO), it is determined whether or not the adjustment is completed (step S161). If the adjustment is not completed (step S161: NO), Returning to step S148, if the adjustment is completed (step S161: YES), the parameter adjustment process in the reference frame is terminated.
図17は、参照フレームでのパラメータ調整前のユーザインタフェース画面の一例を示す図である。同図(a)は選択中の入力フレーム(参照フレーム)の画像、同図(b)は選択中の入力フレーム(参照フレーム)におけるブレPSF画像である。参照フレームの調整では、基準フレームの前後の全てのフレームのそれぞれについて、基準フレームに設定した基準点に対する4点(点1〜点4)の位置調整を行う。参照フレームの調整では、基準フレームに設定した基準点を利用するので、調整前でも基準フレームと略一致することから、4点(点1〜点4)の位置が略ナンバープレート100の4隅に位置する。これにより、短時間で4点(点1〜点4)の位置をナンバープレート100の4隅に位置させることができる。調整前の4点(点1〜点4)のうち、点1の座標は「X=290.7500、Y=357.2500」、点2の座標は「X=313.0000、Y=355.5000」、点3の座標は「X=291.0449、Y=368.3445」、点4の座標は「X=313.2500、Y=366.7500」である。
FIG. 17 is a diagram illustrating an example of a user interface screen before parameter adjustment in the reference frame. FIG. 4A shows an image of the selected input frame (reference frame), and FIG. 4B shows a blurred PSF image of the selected input frame (reference frame). In the adjustment of the reference frame, the positions of four points (
また、ブレPSFパラメータである、ブレ角度とブレ長も基準フレームでの調整に略一致していることから、ブレ長がほぼ適切な長さに予め調整されている。 In addition, since the blur angle and the blur length, which are blur PSF parameters, substantially coincide with the adjustment in the reference frame, the blur length is adjusted in advance to an approximately appropriate length.
図18は、参照フレームでのパラメータ調整後のユーザインタフェース画面の一例を示す図である。同図(a)は選択中の入力フレーム(参照フレーム)の画像、同図(b)は選択中の入力フレーム(参照フレーム)におけるブレPSF画像である。基準フレームに設定した基準点に対する4点(点1〜点4)の位置調整を極短時間で終えることができる。図18に示す調整後の4点(点1〜点4)のうち、点1の座標は「X=290.6185、Y=357.3225」、点2の座標は「X=313.2253、Y=355.5452」、点3の座標は「X=291.0449、Y=368.3445」、点4の座標は「X=313.6530、Y=366.8148」であり、パラメータ調整前の各点の位置との差が僅かである。
FIG. 18 is a diagram illustrating an example of a user interface screen after parameter adjustment in the reference frame. FIG. 4A shows an image of the selected input frame (reference frame), and FIG. 4B shows a blurred PSF image of the selected input frame (reference frame). Position adjustment of four points (
このように、基準フレームで位置合わせの基準点の位置や、ブレ長さ等のブレPSFパラメータを調整できて、基準フレームでの調整結果を他の全ての参照フレームに対して反映させることができる。 In this way, the position of the reference point for alignment in the base frame and the blur PSF parameters such as the blur length can be adjusted, and the adjustment result in the base frame can be reflected on all other reference frames. .
(ブレの除去処理)
図19は、ブレの除去処理を説明するためのフローチャートである。同図において、まずFrmRに「1」を設定する(ステップS170)。次いで、基準点位置保持メモリ17AからRoiRを取得する(ステップS171)。次いで、RoiR近傍の画像データ(ImgR)をフレームメモリ11から取得する(ステップS172)。さらに、ブレPSFパラメータ保持メモリ17BからブレPSFパラメータを取得する(ステップS173)。
(Blur removal process)
FIG. 19 is a flowchart for explaining blur removal processing. In the figure, first, “1” is set to FrmR (step S170). Next, RoiR is acquired from the reference point
そして、取得したブレPSFパラメータからブレPSF画像を生成する(ステップS174)。なお、ブレPSF画像の生成の詳細は後述する。 Then, a blurred PSF image is generated from the acquired blurred PSF parameters (step S174). Details of the generation of the blurred PSF image will be described later.
そして、生成したブレPSF画像で画像データ(ImgR)にDeconvolutionを施し、画像データ(ImgR’)を得る(ステップS175)。 Then, the image data (ImgR) is subjected to deconvolution with the generated blurred PSF image to obtain image data (ImgR ′) (step S175).
なお、Deconvolutionには、公知の方法を使うことができる。以下、公知の例を挙げる。 A known method can be used for Deconvolution. Hereafter, a well-known example is given.
・Inverse Filter
畳み込み演算とフーリエ変換の性質を利用して、
X×PSF=Y → FT(X) FT(PSF)=FT(Y)→ FT(X)=FT(Y)/FT(PSF)に基づき、原画像を復元するもの。
(X:ボケ・ブレのない原画像、PSF:ボケ・ブレの点広がり関数、Y:ボケ・ブレのある観測画像、*:畳み込み演算、FT(・):フーリエ変換)
・ Inverse Filter
Using the properties of convolution and Fourier transform,
X × PSF = Y → FT (X) FT (PSF) = FT (Y) → FT (X) = Restore original image based on FT (Y) / FT (PSF).
(X: original image without blurring / blurring, PSF: point spread function of blurring / blurring, Y: observation image with blurring / blurring, *: convolution operation, FT (•): Fourier transform)
・Wiener Filter
上記の改良版で、ランダムノイズの項をモデル式に含め(X * PSF + W = Y)、弊害を抑えたもの(W:ランダムノイズ成分)。
・ Wiener Filter
In the above-mentioned improved version, a random noise term is included in the model formula (X * PSF + W = Y) to suppress adverse effects (W: random noise component).
・W.H.Richardson,’’Bayesian-Based Iterative Method of Image Restoration’’,Journal of Optical Society of America, Vol. 62, NO. 1, 1972
Xの初期解を置いて、XとPSFとYの値から、次のXを求めてXを更新する手順を反復的にXが収束するまで繰り返す方法で、フーリエ変換には依らない。
・ W. H. Richardson, "Bayesian-Based Iterative Method of Image Restoration", Journal of Optical Society of America, Vol. 62, No. 1, 1972
This is a method in which an initial solution of X is set, the next X is obtained from the values of X, PSF, and Y and the X is updated repeatedly until X converges, and does not depend on the Fourier transform.
そして、画像データ(ImgR’)を得た後、フレームメモリ11内の画像データ(ImgR)を画像データ(ImgR’)に置き換える(ステップS176)。その後、FrmRの値に「1」加算し、その値をFrmRに設定する(ステップS177)。その後、FrmRの値が「N」以下かどうか判定し(ステップS178)、「N」以下である場合(ステップS178:YES)、ステップS171に戻り、「N」以下ではない場合(ステップS178:NO)、ブレの除去処理を終了する。
Then, after obtaining the image data (ImgR ′), the image data (ImgR) in the
以下、ブレPSFパラメータ(ブレ角度BaR、ブレ長さBlR)からブレPSF画像を生成する例を挙げる。
1.ブレの軌跡を収めるのに必要十分なサイズの画像データを用意し、0で初期化する。
2.用意した画像の中心を原点として、原点を通り、x軸とのなす角度がBaR、長さがBlRである線分(線分の中点は原点に等しい)上の各点に位置する画像データの画素値を1.0(=最大輝度レベル)に書き換える。
3.画素値の総和が1.0となるように、画像データ全体の画素値を一律に正規化する。
さらに、ブレPSFパラメータにボケ半径BrR(ブレ軌跡のぼやけ具合を表し、焦点もずれている画像の先鋭化に使うパラメータ)を含める場合には、次のステップを加える。
4.生成した画像データに半径BrRの真円データを畳み込む。
真円データ:中心から半径BrR以内の点=画素値K、それ以外の点=画素値0
K:1/(中心から半径BrR内の点の総数)
Hereinafter, an example of generating a blur PSF image from the blur PSF parameters (blur angle BaR, blur length BIR) will be described.
1. Prepare image data of a size sufficient to contain the blur locus and initialize it with zero.
2. Image data that is located at each point on a line segment (the midpoint of the line segment is equal to the origin) whose origin is the center of the prepared image, passes through the origin, has an angle with the x-axis of BaR, and has a length of BlR. Is rewritten to 1.0 (= maximum luminance level).
3. The pixel values of the entire image data are uniformly normalized so that the sum of the pixel values becomes 1.0.
Furthermore, when the blur radius BrR (a parameter used to sharpen an image that represents the blur condition of the blur locus and is out of focus) is included in the blur PSF parameter, the following step is added.
4). The perfect circle data of radius BrR is convolved with the generated image data.
True circle data: point within radius BrR from center = pixel value K, other points = pixel value 0
K: 1 / (total number of points within radius BrR from center)
(再構成処理)
図20は、再構成処理を説明するためのフローチャートである。同図において、まずXに初期推定画像を設定する(ステップS180)。なお、初期推定画像は、基準フレームの注目被写体領域の画像を縦横z倍に拡大したものであれば、拡大方法は何でも良い。
(Reconfiguration process)
FIG. 20 is a flowchart for explaining the reconstruction process. In the figure, first, an initial estimated image is set to X (step S180). Note that the initial estimated image may be any enlargement method as long as the image of the target subject area of the reference frame is enlarged z times vertically and horizontally.
次いで、評価値Sと修正画像Uを初期化し(ステップS181)、その後、FrmRに「1」を設定する(ステップS182)。次いで、基準点位置保持メモリ17Aから参照フレームFrmRの注目被写体領域(RoiR)と幾何変換行列(MFrmR→FrmA)を取得する(ステップS183)。さらに、RoiR近傍の画像データをフレームメモリ11から取得する(ImgR)(ステップS184)。
Next, the evaluation value S and the corrected image U are initialized (step S181), and then “1” is set to FrmR (step S182). Next, the target subject region (RoiR) and the geometric transformation matrix (M FrmR → FrmA ) of the reference frame FrmR are acquired from the reference point
次いで、画像XをFrmRでの位置に幾何変形する(ステップS185)。すなわち、(Mz*MFrmR→FrmA −1)*Xの計算を行い、その結果を画像Y’に設定する(Y’← (Mz*MFrmR→FrmA −1)*X)。ここで、Mzは拡大変換行列である(超解像拡大倍率をzとすると、図21に示すようになる)。 Next, the image X is geometrically deformed to a position at FrmR (step S185). That is, (Mz * M FrmR → FrmA −1 ) * X is calculated, and the result is set in the image Y ′ (Y ′ ← (Mz * M FrmR → FrmA −1 ) * X). Here, Mz is an enlargement conversion matrix (assuming that the super-resolution enlargement magnification is z, it becomes as shown in FIG. 21).
画像XをFrmRでの位置に幾何変形した後、画像Y’を解像度劣化させる(Y”)(ステップS186)。そして、画像Y”とImgRの差分を元に評価値Sと修正画像Uを更新する(ステップS187)。その後、FrmRの値に「1」加算し、その値をFrmRに設定する(ステップS188)。そして、FrmRの値が「N」以下かどうか判定し(ステップS189)、「N」以下である場合(ステップS189:YES)、ステップS183に戻り、「N」以下ではない場合(ステップS189:NO)、画像Xの拘束条件を評価し、評価値Sと修正画像Uを更新する(ステップS190)。そして、Xが十分に収束したかどうか判定し(ステップS191)、十分に収束した場合(ステップS191:YES)、画像Xを出力し(ステップS192)、再構成処理を終了する。これに対し、Xが十分に収束していない場合(ステップS191:NO)、修正画像Uを元にXを更新し(ステップS193)、ステップS181に戻る。 After geometrically deforming the image X to the position at FrmR, the resolution of the image Y ′ is degraded (Y ″) (step S186). Then, the evaluation value S and the modified image U are updated based on the difference between the image Y ″ and ImgR. (Step S187). Thereafter, “1” is added to the value of FrmR, and the value is set to FrmR (step S188). Then, it is determined whether the value of FrmR is “N” or less (step S189). If it is “N” or less (step S189: YES), the process returns to step S183, and if it is not “N” or less (step S189: NO). ), The constraint condition of the image X is evaluated, and the evaluation value S and the modified image U are updated (step S190). Then, it is determined whether or not X has sufficiently converged (step S191). If the X has sufficiently converged (step S191: YES), the image X is output (step S192), and the reconstruction process ends. On the other hand, when X is not sufficiently converged (step S191: NO), X is updated based on the corrected image U (step S193), and the process returns to step S181.
(効果)
以上のように、本実施の形態では、画像処理装置1は、基準フレームの画像およびパラメータ(注目被写体領域の位置やブレPSFパラメータ)を表示し、ユーザの調整に基づいて基準フレームの画像の表示内容を更新し、調整されたパラメータを基準フレームのパラメータとして記憶する。そして、画像処理装置1は、次の参照フレームの画像を表示させる際に、記憶された基準フレームのパラメータを当該参照フレームのパラメータとして表示し、ユーザの調整に基づいて当該参照フレームの画像の表示内容を更新し、調整されたパラメータを当該参照フレームのパラメータとして記憶する。以降、画像処理装置1は、新たな参照フレームの画像を表示させる際には、基準フレームのパラメータを、当該新たな参照フレームのパラメータとして表示する。
(effect)
As described above, in the present embodiment, the
これにより、基準フレームでの調整結果を他の全ての参照フレームに対して反映できるので、複数入力フレームの画像の位置合わせを手作業で行う場合に、入力作業を少なくし、作業効率の向上を図ることができる。この結果、超解像処理に利用できるフレームの数を増やすことができるので、超解像処理によって高解像度画像を得ることができる。 As a result, the adjustment result in the base frame can be reflected in all other reference frames, so when manually aligning the images of multiple input frames, the input work is reduced and the work efficiency is improved. You can plan. As a result, the number of frames that can be used for the super-resolution processing can be increased, so that a high-resolution image can be obtained by the super-resolution processing.
(実施の形態2)
実施の形態2では、実施の形態1において図10、図11を用いて説明したものと異なるブレPSF推定処理について説明する。
(Embodiment 2)
In the second embodiment, a blur PSF estimation process different from that described in the first embodiment with reference to FIGS. 10 and 11 will be described.
(ブレPSF推定処理)
図22及び図23は、本実施の形態に係る画像処理装置1のブレPSF推定処理を説明するためのフローチャートである。なお、図22及び図23において、図10及び図11と共通するステップには図10及び図11と同一符号を付して説明を省略する。
(Break PSF estimation process)
22 and 23 are flowcharts for explaining the blur PSF estimation process of the
図22及び図23では、まずFrmRに「1」を設定する(ステップS80)。次いで、基準点位置保持メモリ17AからRoiRを取得する(ステップS81)。そして、取得したRoiR近傍の画像データをフレームメモリ11から取得する(ImgR)(ステップS200)。次いで、取得したRoiRの中心点を求める(CtrR)(ステップS82)。その後、FrmRの値を「1」減算し、その値をFrmPに設定するとともに、FrmRの値を「1」加算し、その値をFrmNに設定する(ステップS83)。次いで、FrmPの値が「1」以上「N」以下かどうか判定し(ステップS84)、「1」以上「N」以下である場合(ステップS84:YES)、CtrRをFrmPに写像する(CtrP)(ステップS85)。
22 and 23, first, “1” is set to FrmR (step S80). Next, RoiR is acquired from the reference point
CtrRをFrmPに写像した後、FrmNの値が「1」以上「N」以下かどうか判定し(ステップS86)、「1」以上「N」以下である場合(ステップS86:YES)、CtrRをFrmNに写像する(ステップS87)。次いで、(ベクトル(CtrP→CtrR)+ベクトル(CtrR→CtrN))÷2を計算し、その結果を動きベクトルMvRに設定する(ステップS88)。 After mapping CtrR to FrmP, it is determined whether the value of FrmN is “1” or more and “N” or less (step S86). If it is “1” or more and “N” or less (step S86: YES), CtrR is set to FrmN. (Step S87). Next, (vector (CtrP → CtrR) + vector (CtrR → CtrN)) / 2 is calculated, and the result is set as the motion vector MvR (step S88).
一方、ステップS86でFrmNの値が「1」以上「N」以下ではないと判定された場合(ステップS86:NO)、ベクトル(CtrP→CtrR)を動きベクトルMvRに設定する(ステップS89)。 On the other hand, when it is determined in step S86 that the value of FrmN is not “1” or more and “N” or less (step S86: NO), the vector (CtrP → CtrR) is set as the motion vector MvR (step S89).
また、ステップS84でFrmPの値が「1」以上「N」以下ではない場合(ステップS84:NO)、FrmNの値が「1」以上「N」以下かどうか判定し(ステップS90)、「1」以上「N」以下である場合(ステップS90:YES)、CtrRをFrmNに写像する(CtrN)(ステップS91)。次いで、ベクトル(CtrR→CtrN)の値を動きベクトルMvRに設定する(ステップS92)。 If the value of FrmP is not “1” or more and “N” or less in step S84 (step S84: NO), it is determined whether the value of FrmN is “1” or more and “N” or less (step S90). If it is greater than or equal to “N” (step S90: YES), CtrR is mapped to FrmN (CtrN) (step S91). Next, the value of the vector (CtrR → CtrN) is set to the motion vector MvR (step S92).
ステップS88,ステップS89及びステップS92の中のいずれか1つの処理を行った後、MvRがx軸となす角度・MvRの長さを、ブレの角度(BaR)・長さ(MlR)とする(ステップS93)。次いで、求めたブレの角度(BaR)・長さ(MlR)をブレPSFパラメータ保持メモリ17Bに格納する(ステップS94)。次いで、画像データImgRとブレ角度BaRからブレの長さを推定する(BlR)(ステップS201)。そして、推定したブレ長さBlRとベクトル長MlRの比を算出する(B2MlR)(ステップS202)。 After performing any one of Step S88, Step S89, and Step S92, the angle MvR and the length of MvR that the MvR makes with the x-axis are the blur angle (BaR) and length (MlR) ( Step S93). Next, the obtained blur angle (BaR) and length (MlR) are stored in the blur PSF parameter holding memory 17B (step S94). Next, the blur length is estimated from the image data ImgR and the blur angle BaR (BlR) (step S201). Then, the ratio between the estimated blur length BlR and the vector length MlR is calculated (B2MlR) (step S202).
その後、FrmRの値に「1」加算し、その値をFrmRに設定する(ステップS95)。そして、FrmRが「N」以下かどうか判定し(ステップS96)、FrmRが「N」以下である場合(ステップS96:YES)、ステップS81に戻る。これに対し、FrmRが「N」以下ではない場合(ステップS96:NO)、全フレーム(R=1〜N)で算出した比B2MlRの代表値を計算する(B2Ml)(ステップS203)。その後、FrmRに「1」を設定する(ステップS204)。次いで、ブレPSFパラメータ保持メモリ17Bに格納したブレの長さMlRにB2Mlを乗じた値をブレの長さBlRとして格納する(ステップS205)。次いで、FrmRの値に「1」加算し、その値をFrmRに設定し(ステップS206)、FrmRが「N」以下かどうか判定する(ステップS207)。FrmRが「N」以下である場合(ステップS207:YES)、ステップS205に戻る。これに対し、FrmRが「N」以下ではない場合(ステップS207:NO)、ブレPSFの推定処理を終了する。 Thereafter, “1” is added to the value of FrmR, and the value is set to FrmR (step S95). Then, it is determined whether or not FrmR is “N” or less (step S96). If FrmR is “N” or less (step S96: YES), the process returns to step S81. On the other hand, if FrmR is not equal to or less than “N” (step S96: NO), the representative value of the ratio B2MlR calculated for all frames (R = 1 to N) is calculated (B2Ml) (step S203). Thereafter, “1” is set in FrmR (step S204). Next, a value obtained by multiplying the blur length MlR stored in the blur PSF parameter holding memory 17B by B2Ml is stored as the blur length BlR (step S205). Next, “1” is added to the value of FrmR, the value is set to FrmR (step S206), and it is determined whether or not FrmR is “N” or less (step S207). If FrmR is “N” or less (step S207: YES), the process returns to step S205. On the other hand, if FrmR is not equal to or less than “N” (step S207: NO), the blur PSF estimation process is terminated.
一方、ステップS90でFrmNの値が「1」以上「N」以下ではないと判定された場合(ステップS90:NO)、画像データImgRからブレの角度・長さを推定する(BaR、BlR)(ステップS208)。その後、BlRの値をMlRに設定し(ステップS209)、ステップS94に戻る。 On the other hand, if it is determined in step S90 that the value of FrmN is not “1” or more and “N” or less (step S90: NO), the angle / length of blur is estimated from the image data ImgR (BaR, BIR) ( Step S208). Thereafter, the value of BlR is set to MlR (step S209), and the process returns to step S94.
(効果)
以上のように、本実施の形態によれば、ブレPSF推定処理においてブレPSFの長さを推定する際に、1枚の画像データからブレPSFの長さを推定し、推定したブレPSFの長さと動きベクトルの長さとの比率をフレーム毎に求め、その比率を全フレームにわたって平滑化し、各動きベクトルの長さに平滑化した比率を乗算することにより各フレームのブレPSFの長さを計算する。これにより、カメラのシャッタースピードを考慮してブレPSFの長さを推定することができるので、正確なブレPSFを用いてブレの除去処理を行うことができ、リンギングノイズを伴わない先鋭な画像を得ることができる。
(effect)
As described above, according to the present embodiment, when the length of the blur PSF is estimated in the blur PSF estimation process, the length of the blur PSF is estimated from one piece of image data, and the length of the blur PSF thus estimated is estimated. Is calculated for each frame, the ratio is smoothed over the entire frame, and the length of each motion vector is multiplied by the smoothed ratio to calculate the length of the blur PSF of each frame. . As a result, the length of the blur PSF can be estimated in consideration of the shutter speed of the camera, so that the blur removal process can be performed using the accurate blur PSF, and a sharp image without ringing noise can be obtained. Can be obtained.
(実施の形態3)
実施の形態3では、実施の形態1で説明した処理内容を顔画像の検出に適用する場合について説明する。なお、本実施の形態における画像処理装置の概略構成は、実施の形態1で説明した図1の画像処理装置1と同一である。また、本実施の形態における画像処理装置の超解像処理のフローは、実施の形態1で説明した図2、図3のものと略同一である。ただし、図2の自動位置合わせ処理(S4)が顔特徴点検出処理に変更される。
(Embodiment 3)
In the third embodiment, a case where the processing content described in the first embodiment is applied to face image detection will be described. The schematic configuration of the image processing apparatus in the present embodiment is the same as that of the
また、本実施の形態における画像処理装置の画像データ読み込み処理のフローは、実施の形態1で説明した図4のものと同一である。また、本実施の形態における画像処理装置の基準フレーム選択処理のフローは、実施の形態1で説明した図5、図6のものと同一である。また、本実施の形態における画像処理装置の注目被写体領域設定処理のフローは、実施の形態1で説明した図7のものと同一である。また、本実施の形態における画像処理装置のブレの除去処理のフローは、実施の形態1で説明した図19のものと同一である。 The flow of the image data reading process of the image processing apparatus in the present embodiment is the same as that in FIG. 4 described in the first embodiment. Further, the flow of the reference frame selection process of the image processing apparatus in the present embodiment is the same as that in FIGS. 5 and 6 described in the first embodiment. Further, the flow of the target subject area setting process of the image processing apparatus in the present embodiment is the same as that in FIG. 7 described in the first embodiment. Further, the flow of the blur removal process of the image processing apparatus in the present embodiment is the same as that in FIG. 19 described in the first embodiment.
(顔特徴点検出処理)
図24は、顔特徴点検出処理を説明するためのフローチャートである。同図において、まずFrmRの値を「1」に設定する(ステップS300)。次いで、FrmRの値が「N」以下かどうか判定する(ステップS301)。この判定において、FrmRの値が「N」以下である場合(ステップS301:YES)、フレームメモリ11内のFrmR番目のフレームデータを取得する(ImgR)(ステップS302)。次いで、ImgRの中で顔特徴点を検出する(PFrmR,i)(ステップS303)。顔特徴点の検出方法として、AAM(Active Appearance Models)を使う方法が知られている。この方法は、事前に、顔画像およびその顔画像上の複数の特徴点の位置をセットにして多数のセットのデータから学習データを作成する処理(オフライン処理:超解像処理の前に行う処理)を行い、次に、未知の顔画像を入力して上記の学習データを用いてフィッティングを行うことにより、入力画像の中での特徴点の位置を推定する処理(オンライン処理:超解像処理を行う個々の入力フレームに対して行う処理)を行う方法である(参考文献:"Active Appearance Models Revisited", Iain Matthews and Simon Baker, International Journal of Computer Vision, Vol. 60, No. 2, pp. 135 - 164, November, 2004.)。なお、PFrmR,iは、ImgRの中で検出されたi番目の顔特徴点の位置情報である(1≦i≦(ImgR内の全特徴点数))。
(Face feature point detection processing)
FIG. 24 is a flowchart for explaining the face feature point detection processing. In the figure, first, the value of FrmR is set to “1” (step S300). Next, it is determined whether the value of FrmR is “N” or less (step S301). In this determination, when the value of FrmR is “N” or less (step S301: YES), the FrmR-th frame data in the
次いで、ImgRの中で全ての顔特徴点を囲む領域を算出し(RoiR)(ステップS304)、ImgRの隣接顔特徴点が構成する平面パッチ(図25参照)を列挙する(SFrmR,*(SFrmR,k(1≦k≦ImgR内の全パッチ数)の全て))(ステップS305)。なお、図25では、〇印が顔特徴点であり、点線で囲まれたS1からS12の各領域が平面パッチである。 Next, a region surrounding all face feature points in ImgR is calculated (RoiR) (step S304), and planar patches (see FIG. 25) formed by adjacent face feature points of ImgR are listed (S FrmR, * ( S FrmR, k (all of the patches in 1 ≦ k ≦ ImgR))) (step S305). In FIG. 25, a face feature point .smallcircle, each region of the S 12 from S 1 surrounded by the dotted line is a flat patch.
そして、RoiR、PFrmR,*(PFrmR,iの全て)およびSFrmR,*を基準点位置保持メモリ17Aに格納する(ステップS306)。その後、FrmRの値を「1」加算し、その値をFrmRに設定し(ステップS307)、ステップS301に戻る。
Then, RoiR, P FrmR, * (all of P FrmR, i ) and S FrmR, * are stored in the reference point
一方、ステップS301でFrmRの値がNより大きいと判定した場合(ステップS301:NO)、FrmRの値を「1」に設定し(ステップS308)、FrmRの値が「N」以下かどうか判定する(ステップS309)。 On the other hand, if it is determined in step S301 that the value of FrmR is greater than N (step S301: NO), the value of FrmR is set to “1” (step S308), and it is determined whether the value of FrmR is “N” or less. (Step S309).
この判定において、FrmRの値が「N」以下である場合(ステップS309:YES)、パッチ番号kを「1」に設定し(ステップS310)、kの値が全パッチ数以下かどうか判定する(ステップS311)。 In this determination, when the value of FrmR is equal to or smaller than “N” (step S309: YES), the patch number k is set to “1” (step S310), and it is determined whether the value of k is equal to or smaller than the total number of patches (step S310). Step S311).
この判定において、kの値が全パッチ数以下である場合(ステップS311:YES)、FrmRのパッチSFrmR,kの各頂点の位置を、FrmAにおいて対応するパッチSFrmA,kの各頂点の位置に写像する幾何変換行列を求める(MFrmR,k→FrmA,k)(ステップS312)。そして、幾何変換行列MFrmR,k→FrmA,kを基準点位置保持メモリ17Aに格納する(ステップS313)。その後、kの値に「1」加算し、その値をkに設定し(ステップS314)、ステップS311に戻る。
In this determination, if the value of k is equal to or less than the total number of patches (step S311: YES), the position of each vertex of the patch S FrmR, k of FrmR is determined as the position of each vertex of the corresponding patch S FrmA, k of FrmA. (M FrmR, k → FrmA, k ) is obtained (step S312). Then, the geometric transformation matrix M FrmR, k → FrmA, k is stored in the reference point
一方、ステップS311でkの値が全パッチ数より大きいと判定した場合(ステップS311:NO)、FrmRの値を「1」加算し、その値をFrmRに設定し(ステップS315)、ステップS309に戻る。 On the other hand, if it is determined in step S311 that the value of k is larger than the total number of patches (step S311: NO), the value of FrmR is incremented by “1”, and the value is set to FrmR (step S315). Return.
また、ステップS309でFrmRの値が「N」以下ではないと判定した場合(ステップS309:NO)、顔特徴点検出処理を終了する。 If it is determined in step S309 that the value of FrmR is not equal to or less than “N” (step S309: NO), the facial feature point detection process ends.
(ブレPSFの推定処理)
図26及び図27は、ブレPSF推定処理を説明するためのフローチャートである。なお、図26及び図27において、図10及び図11と共通するステップには、図10及び図11と同一符号を付して説明を省略する。
(Breaking PSF estimation process)
26 and 27 are flowcharts for explaining the blur PSF estimation process. 26 and 27, steps common to those in FIGS. 10 and 11 are denoted by the same reference numerals as those in FIGS. 10 and 11, and description thereof is omitted.
図26及び図27では、まずFrmRに「1」を設定する(ステップS80)。次いで、基準点位置保持メモリ17AからPFrmR,*を取得する(ステップS320)。そして、取得したPFrmR,*の代表点を求める(CtrFrmR)(ステップS321)。その後、FrmRの値を「1」加算し、その値をFrmRに設定する(ステップS322)。次いで、FrmRの値が「N」以下かどうか判定し(ステップS323)、「N」以下である場合(ステップS323:YES)、ステップS320に戻る。
26 and 27, first, “1” is set to FrmR (step S80). Next, P FrmR, * is acquired from the reference point
一方、ステップS323でFrmRの値が「N」より大きいと判定された場合(ステップS323:NO)、FrmRの値を「1」に設定する(ステップS324)。 On the other hand, if it is determined in step S323 that the value of FrmR is greater than “N” (step S323: NO), the value of FrmR is set to “1” (step S324).
次いで、FrmRの値を「1」減算し、その値をFrmPに設定するとともに、FrmRの値を「1」加算し、その値をFrmNに設定する(ステップS83)。そして、FrmPの値が「1」以上「N」以下かどうか判定し(ステップS84)、「1」以上「N」以下である場合(ステップS84:YES)、ステップS86に進む。 Next, “1” is subtracted from the value of FrmR, the value is set to FrmP, and the value of FrmR is incremented by “1”, and the value is set to FrmN (step S83). Then, it is determined whether the value of FrmP is “1” or more and “N” or less (step S84). If it is “1” or more and “N” or less (step S84: YES), the process proceeds to step S86.
そして、FrmNの値が「1」以上「N」以下かどうか判定し(ステップS86)、「1」以上「N」以下である場合(ステップS86:YES)、(ベクトル(CtrFrmP→CtrFrmR)+ベクトル(CtrFrmR→CtrFrmN))÷2の値を動きベクトルMvRに設定する(ステップS325)。 Then, it is determined whether the value of FrmN is “1” or more and “N” or less (step S86). If it is “1” or more and “N” or less (step S86: YES), (vector (Ctr FrmP → Ctr FrmR )) A value of + vector (Ctr FrmR → Ctr FrmN )) / 2 is set as the motion vector MvR (step S325).
一方、ステップS86でFrmNの値が「1」以上「N」以下ではないと判定された場合(ステップS86:NO)、ベクトル(CtrFrmP→CtrFrmR)を動きベクトルMvRに設定する(ステップS326)。 On the other hand, if it is determined in step S86 that the value of FrmN is not “1” or more and “N” or less (step S86: NO), the vector (Ctr FrmP → Ctr FrmR ) is set as the motion vector MvR (step S326). .
また、ステップS84でFrmPの値が「1」以上「N」以下ではないと判定された場合(ステップS84:NO)、FrmNの値が「1」以上「N」以下かどうか判定し(ステップS90)、「1」以上「N」以下である場合(ステップS90:YES)、ベクトル(CtrFrmR→CtrFrmN)の値を動きベクトルMvRに設定する(ステップS327)。 When it is determined in step S84 that the value of FrmP is not “1” or more and “N” or less (step S84: NO), it is determined whether the value of FrmN is “1” or more and “N” or less (step S90). ), If it is “1” or more and “N” or less (step S90: YES), the value of the vector (Ctr FrmR → Ctr FrmN ) is set to the motion vector MvR (step S327).
ステップS325、S326、S327の中のいずれか1つの処理を行った後、MvRがx軸となす角度・MvRの長さを、ブレの角度(BaR)・長さ(BlR)とする(ステップS93)。そして、求めたブレの角度(BaR)・長さ(BlR)をブレPSFパラメータ保持メモリ17Bに格納する(ステップS94)。そして、FrmRの値に「1」加算し、その値をFrmRに設定する(ステップS95)。次いで、FrmRが「N」以下かどうか判定し(ステップS96)、「N」以下である場合(ステップS96:YES)、ステップS83に戻る。これに対して、FrmRが「N」以下ではない場合(ステップS96:NO)、ブレPSFの推定処理を終了する。 After performing any one of steps S325, S326, and S327, the angle MvR and the length of MvR that the MvR makes with the x axis are set as the blur angle (BaR) and the length (BlR) (step S93). ). Then, the obtained blur angle (BaR) and length (BlR) are stored in the blur PSF parameter holding memory 17B (step S94). Then, “1” is added to the value of FrmR, and the value is set to FrmR (step S95). Next, it is determined whether FrmR is “N” or less (step S96). If it is “N” or less (step S96: YES), the process returns to step S83. On the other hand, when FrmR is not equal to or less than “N” (step S96: NO), the blur PSF estimation process is terminated.
一方、ステップS90でFrmNの値が「1」以上「N」以下ではないと判定された場合(ステップS90:NO)、RoiR近傍の画像データをフレームメモリ11から取得し(ステップS104)、取得した画像データからブレの角度(BaR)・長さ(BlR)を推定する(ステップS105)。その後、ステップS94に移行する。 On the other hand, when it is determined in step S90 that the value of FrmN is not “1” or more and “N” or less (step S90: NO), image data in the vicinity of RoiR is acquired from the frame memory 11 (step S104). The blur angle (BaR) and length (BlR) are estimated from the image data (step S105). Thereafter, the process proceeds to step S94.
(基準フレームでのパラメータ調整処理)
図28は、基準フレームでのパラメータ調整処理を説明するためのフローチャートである。なお、図28において、図12と共通するステップには、図12と同一符号を付して説明を省略する。
(Parameter adjustment processing in the reference frame)
FIG. 28 is a flowchart for explaining parameter adjustment processing in a reference frame. In FIG. 28, steps that are the same as in FIG. 12 are assigned the same reference numerals as in FIG.
図28において、まず基準フレーム(FrmA)の画像データをフレームメモリ11から取得し(ステップS110)、これを表示する(ステップS111)。次いで、基準点位置保持メモリ17Aから顔特徴点(PFrmA,*)を取得し(ステップS330)、顔特徴点PFrmA,*及び顔特徴点間を結ぶメッシュを表示する(ステップS331)。
In FIG. 28, first, image data of the reference frame (FrmA) is acquired from the frame memory 11 (step S110), and this is displayed (step S111). Next, the face feature point (P FrmA, * ) is acquired from the reference point
次いで、ブレPSFパラメータ保持メモリ17BからFrmAのブレ角度(BaA)・ブレ長(BlA)を取得し(ステップS115)、取得したブレ角度(BaA)・ブレ長(BlA)からブレPSF画像を生成して表示する(ステップS116)。また、ブレ角度(BaA)・ブレ長(BlA)の数値を表示する(ステップS117)。 Next, the blur angle (BaA) and blur length (BlA) of FrmA are acquired from the blur PSF parameter holding memory 17B (step S115), and a blur PSF image is generated from the acquired blur angle (BaA) and blur length (BlA). Are displayed (step S116). Further, numerical values of the blur angle (BaA) and the blur length (BlA) are displayed (step S117).
そして、表示中の顔特徴点の位置やブレPSFパラメータをユーザに調整させ(ステップS332)、ユーザの調整内容に応じて画面表示内容を更新する(ステップS119)。そして、ユーザによる調整が完了したかどうか判定し(ステップS120)、完了していない場合(ステップS120:NO)、ステップS332に戻り、完了した場合(ステップS120:YES)、基準フレームの元のブレ長BlAと調整後のブレ長BlA’の比(B’2BlA)を求め(ステップS121)、基準フレームの各パッチについて調整前の頂点位置を調整後の位置に写像する幾何変形行列を求める(MFrmA,*→FrmA,*’)(ステップS333)。 Then, the position of the facial feature point being displayed and the blur PSF parameter are adjusted by the user (step S332), and the screen display content is updated according to the adjustment content of the user (step S119). Then, it is determined whether or not the adjustment by the user is completed (step S120). If the adjustment is not completed (step S120: NO), the process returns to step S332, and if completed (step S120: YES), the original blurring of the reference frame is performed. A ratio (B′2B1A) between the length B1A and the adjusted blur length B1A ′ is obtained (step S121), and a geometric deformation matrix that maps the position of the vertex before adjustment to the position after adjustment for each patch of the reference frame is obtained (M FrmA, * → FrmA, * ′ ) (step S333).
次いで、FrmRに「1」を設定する(ステップS122)。そして、ブレPSFパラメータ保持メモリ17BからFrmR番フレームのブレ長(BlR)を取得し(ステップS123)、BlR*B’2BlAを計算し、その結果をBlR’に設定する(ステップS124)。次いで、ブレPSFパラメータ保持メモリ17Bに格納されたBlRをBlR’で更新する(ステップS125)。次いで、基準点位置保持メモリ17AからFrmRの顔特徴点(PFrmR,*)、パッチの情報(SFrmR,*)および幾何変換行列(MFrmR,*→FrmA,*)を取得し(ステップS334)、顔特徴点PFrmR,*を写像する(PFrmR,*’)(図29参照)(ステップS335)。
Next, “1” is set in FrmR (step S122). Then, the blur length (BlR) of the FrmR-th frame is obtained from the blur PSF parameter holding memory 17B (step S123), B1R * B′2B1A is calculated, and the result is set to B1R ′ (step S124). Next, B1R stored in the blur PSF parameter holding memory 17B is updated with B1R ′ (step S125). Next, FrmR face feature points (P FrmR, * ), patch information (S FrmR, * ), and a geometric transformation matrix (M FrmR, * → FrmA, * ) are acquired from the reference point
次いで、基準点位置保持メモリ17Aに格納された顔特徴点PFrmR,*をPFrmR,*’で更新する(ステップS336)。次いで、FrmRの値に「1」加算し、その値をFrmRに設定する(ステップS129)。そして、FrmRが「N」以下かどうか判定し(ステップS130)、「N」以下である場合(ステップS130:YES)、ステップS123に戻り、「N」以下ではない場合(ステップS130:NO)、基準フレームでのパラメータ調整処理を終了する。
Next, the face feature point P FrmR, * stored in the reference point
ステップS121〜ステップS130の処理(すなわちユーザによる調整完了後の一連の処理)によって、参照フレームの個別調整にかかる後の作業が大きく軽減される。 By the processing from step S121 to step S130 (that is, a series of processing after completion of adjustment by the user), the work after the individual adjustment of the reference frame is greatly reduced.
なお、ブレPSFパラメータ保持メモリ17Bに格納した他のパラメータ(焦点ボケの大きさ・形状や、ボケ除去時の強度設定など)を表示し、設定値をユーザで変更できるようにしてもよい。 It should be noted that other parameters stored in the blur PSF parameter holding memory 17B (the size / shape of the out-of-focus blur, the intensity setting at the time of blur removal, etc.) may be displayed so that the setting value can be changed by the user.
次に、図28のステップS335の顔特徴点の写像処理の詳細について図29を用いて説明する。 Next, details of the face feature point mapping processing in step S335 of FIG. 28 will be described with reference to FIG.
同図において、まずパッチ番号kを「1」に設定し(ステップS340)、kの値が全パッチ数以下かどうか判定する(ステップS341)。 In the figure, first, the patch number k is set to “1” (step S340), and it is determined whether or not the value of k is equal to or less than the total number of patches (step S341).
この判定において、kの値が全パッチ数以下である場合(ステップS341:YES)、参照フレームFrmRでのパッチkの各頂点座標を幾何変換行列MFrmR,k→FrmA,k’で変換する(PFrmR,*’)(ステップS342)。その後、kの値に「1」加算し、その値をkに設定し(ステップS343)、ステップS341に戻る。 In this determination, if the value of k is less than or equal to the total number of patches (step S341: YES), each vertex coordinate of the patch k in the reference frame FrmR is converted by the geometric transformation matrix M FrmR, k → FrmA, k ′ ( P FrmR, * ′ ) (step S342). Thereafter, “1” is added to the value of k, the value is set to k (step S343), and the process returns to step S341.
一方、ステップS341でkの値が全パッチ数より大きいと判定した場合(ステップS341:NO)、ステップS335の顔特徴点の写像処理を終了する。 On the other hand, if it is determined in step S341 that the value of k is larger than the total number of patches (step S341: NO), the mapping process of the facial feature points in step S335 is terminated.
なお、パッチの頂点は、隣接パッチの頂点と共有されているため、図29のフローにおいて、あるパッチの座標変換処理と別のパッチの座標変換処理とで、同じ頂点(すなわち、顔特徴点)に対する変換後座標が複数通り算出される場合があり得る。このため、本実施の形態では、複数算出された変換後座標の中から1つの変換後座標を所定の方法により決定し、決定した座標をその顔特徴点iに対するPFrmR,i’とする。決定の方法として、重心を求める、初出の値を採用する、あるいは、最後の値を採用する等が挙げられる。 Note that since the vertex of the patch is shared with the vertex of the adjacent patch, in the flow of FIG. 29, the same vertex (that is, the facial feature point) is used in the coordinate conversion processing of one patch and the coordinate conversion processing of another patch. There may be a case where a plurality of converted coordinates for is calculated. For this reason, in the present embodiment, one post-conversion coordinate is determined from a plurality of post-conversion coordinates calculated by a predetermined method, and the determined coordinate is defined as P FrmR, i ′ for the face feature point i. Examples of the determination method include obtaining the center of gravity, adopting the first appearing value, or employing the last value.
(参照フレームでのパラメータ調整処理)
図30及び図31は、参照フレームでのパラメータ調整処理を説明するためのフローチャートである。なお、図30及び図31において、図15及び図16と共通するステップには、図15及び図16と同一符号を付して説明を省略する。
(Parameter adjustment processing in the reference frame)
30 and 31 are flowcharts for explaining the parameter adjustment processing in the reference frame. 30 and 31, steps common to those in FIGS. 15 and 16 are denoted by the same reference numerals as those in FIGS. 15 and 16, and description thereof is omitted.
図30及び図31において、まず基準フレーム(FrmA)の画像データをフレームメモリ11から取得し(ステップS140)、これを表示する(ステップS141)。次いで、基準点位置保持メモリ17AからFrmAの顔特徴点(PFrmA,*)を取得し(ステップS350)、顔特徴点PFrmA,*及び顔特徴点間を結ぶメッシュを表示する(ステップS351)。さらに、フレームメモリ11に格納された全フレームの一覧を表示する(ステップS145)。また、フレーム一覧に表示された個々のフレームに注目被写体領域の枠を表示する(ステップS146)。
30 and 31, first, image data of a reference frame (FrmA) is acquired from the frame memory 11 (step S140), and this is displayed (step S141). Next, FrmA face feature points (P FrmA, * ) are acquired from the reference point
次いで、任意の1フレームを選択状態にし(ステップS147)、参照フレームの選択変更や選択中参照フレームのパラメータ調整をユーザに行わせる(ステップS148)。次いで、参照フレームの選択状態が変更されたかどうか判定し(ステップS149)、参照フレームの選択状態が変更された場合(ステップS149:YES)、選択中参照フレーム(FrmR)の画像データをフレームメモリ11から取得し(ステップS150)、これを表示する(ステップS151)。
Next, one arbitrary frame is selected (step S147), and the user is caused to change the selection of the reference frame or adjust the parameters of the selected reference frame (step S148). Next, it is determined whether or not the reference frame selection state has been changed (step S149). If the reference frame selection state has been changed (step S149: YES), the image data of the selected reference frame (FrmR) is stored in the
FrmRを表示した後、基準点位置保持メモリ17AからFrmRの顔特徴点(PFrmR,*)を取得し(ステップS352)、顔特徴点PFrmR,*及び顔特徴点間を結ぶメッシュを表示する(ステップS353)。
After displaying FrmR, the face feature point (P FrmR, * ) of FrmR is acquired from the reference point
さらに、ブレPSFパラメータ保持メモリ17BからFrmRのブレ角度(BaR)・ブレ長(BlR)を取得し(ステップS155)、ブレ角度(BaR)・ブレ長(BlR)からブレPSF画像を生成して表示する(ステップS156)。また、ブレ角度(BaR)・ブレ長(BlR)の数値を表示する(ステップS157)。その後、ステップS148に戻る。 Further, the blur angle (BaR) and blur length (BlR) of FrmR are acquired from the blur PSF parameter holding memory 17B (step S155), and a blur PSF image is generated from the blur angle (BaR) and blur length (BlR) and displayed. (Step S156). Also, numerical values of the blur angle (BaR) and the blur length (BlR) are displayed (step S157). Thereafter, the process returns to step S148.
一方、ステップS149で参照フレームの選択状態が変更されていないと判定された場合(ステップS149:NO)、RoiRやブレPSFパラメータが変更されたかどうか判定する(ステップS158)。RoiRやブレPSFパラメータが変更された場合(ステップS158:YES)、調整内容に応じて画面表示内容を更新する(ステップS159)。そして、調整内容に応じて、選択中参照フレーム(FrmR)に対する、基準点位置保持メモリ17AやブレPSFパラメータ保持メモリ17Bの設定値を変更する(ステップS160)。その後、ステップS148に戻る。
On the other hand, if it is determined in step S149 that the selection state of the reference frame has not been changed (step S149: NO), it is determined whether or not the RoiR or blur PSF parameter has been changed (step S158). When the RoiR or blur PSF parameter is changed (step S158: YES), the screen display content is updated according to the adjustment content (step S159). Then, the set values of the reference point
また、ステップS158でRoiRやブレPSFパラメータが変更されていないと判定された場合(ステップS158:NO)、調整完了かどうか判定し(ステップS161)、調整完了ではない場合(ステップS161:NO)、ステップS148に戻り、調整完了の場合(ステップS161:YES)、参照フレームでのパラメータ調整処理を終了する。 If it is determined in step S158 that the RoiR or blur PSF parameter has not been changed (step S158: NO), it is determined whether or not the adjustment is completed (step S161). If the adjustment is not completed (step S161: NO), Returning to step S148, if the adjustment is completed (step S161: YES), the parameter adjustment process in the reference frame is terminated.
(再構成処理)
図32は、再構成処理を説明するためのフローチャートである。なお、図32において、図20と共通するステップには、図20と同一符号を付して説明を省略する。
(Reconfiguration process)
FIG. 32 is a flowchart for explaining the reconstruction process. In FIG. 32, the steps common to those in FIG. 20 are denoted by the same reference numerals as those in FIG.
図32において、まずXに初期推定画像を設定する(ステップS180)。次いで、評価値Sと修正画像Uを初期化し(ステップS181)、その後、FrmRに「1」を設定する(ステップS182)。 In FIG. 32, first, an initial estimated image is set to X (step S180). Next, the evaluation value S and the corrected image U are initialized (step S181), and then “1” is set to FrmR (step S182).
次いで、基準点位置保持メモリ17Aから参照フレームFrmRのパッチの情報(SFrmR,*)および幾何変換行列(MFrmR,*→FrmA,*)を取得する(ステップS360)。さらに、各パッチ近傍の画像データをフレームメモリ11から取得する(ImgRS*)(ステップS361)。
Next, the patch information (S FrmR, * ) and the geometric transformation matrix (M FrmR, * → FrmA, * ) of the reference frame FrmR are acquired from the reference point
次いで、パッチ毎に画像XをFrmRでの位置に幾何変形する(ステップS362)。すなわち、各kについて、(Mz*MFrmR,k→FrmA,k −1)*Xの計算を行い、その結果を画像Y’に設定する(Y’← (Mz*MFrmR,k→FrmA,k −1)*X)。ここで、Mzは拡大変換行列である(超解像拡大倍率をzとすると、図21に示すようになる)。 Next, the image X is geometrically deformed to the position of FrmR for each patch (step S362). That is, for each k, (Mz * M FrmR, k → FrmA, k −1 ) * X is calculated, and the result is set in the image Y ′ (Y ′ ← (Mz * M FrmR, k → FrmA, k −1 ) * X). Here, Mz is an enlargement conversion matrix (assuming that the super-resolution enlargement magnification is z, it becomes as shown in FIG. 21).
画像XをFrmRでの位置に幾何変形した後、画像Y’を解像度劣化させる(Y”)(ステップS186)。そして、画像Y”とImgRの差分を元に評価値Sと修正画像Uを更新する(ステップS187)。その後、FrmRの値に「1」加算し、その値をFrmRに設定する(ステップS188)。そして、FrmRの値が「N」以下かどうか判定し(ステップS189)、「N」以下である場合(ステップS189:YES)、ステップS360に戻り、「N」以下ではない場合(ステップS189:NO)、画像Xの拘束条件を評価し、評価値Sと修正画像Uを更新する(ステップS190)。そして、Xが十分に収束したかどうか判定し(ステップS191)、十分に収束した場合(ステップS191:YES)、画像Xを出力し(ステップS192)、再構成処理を終了する。これに対し、Xが十分に収束していない場合(ステップS191:NO)、修正画像Uを元にXを更新し(ステップS193)、ステップS181に戻る。 After geometrically deforming the image X to the position at FrmR, the resolution of the image Y ′ is degraded (Y ″) (step S186). Then, the evaluation value S and the modified image U are updated based on the difference between the image Y ″ and ImgR. (Step S187). Thereafter, “1” is added to the value of FrmR, and the value is set to FrmR (step S188). Then, it is determined whether the value of FrmR is “N” or less (step S189). If it is “N” or less (step S189: YES), the process returns to step S360, and if it is not “N” or less (step S189: NO). ), The constraint condition of the image X is evaluated, and the evaluation value S and the modified image U are updated (step S190). Then, it is determined whether or not X has sufficiently converged (step S191). If the X has sufficiently converged (step S191: YES), the image X is output (step S192), and the reconstruction process ends. On the other hand, when X is not sufficiently converged (step S191: NO), X is updated based on the corrected image U (step S193), and the process returns to step S181.
(効果)
以上のように、本実施の形態では、画像処理装置1は、基準フレームの画像およびパラメータ(顔特徴点の位置、顔特徴点間を結ぶメッシュおよびブレPSFパラメータ)を表示し、ユーザの調整に基づいて基準フレームの画像の表示内容を更新し、調整されたパラメータを基準フレームのパラメータとして記憶する。そして、画像処理装置1は、次の参照フレームの画像を表示させる際に、記憶された基準フレームのパラメータを当該参照フレームのパラメータとして表示し、ユーザの調整に基づいて当該参照フレームの画像の表示内容を更新し、調整されたパラメータを当該参照フレームのパラメータとして記憶する。以降、画像処理装置1は、新たな参照フレームの画像を表示させる際には、基準フレームのパラメータを、当該新たな参照フレームのパラメータとして表示する。
(effect)
As described above, in the present embodiment, the
これにより、基準フレームでの調整結果を他の全ての参照フレームに対して反映できるので、複数入力フレームの画像の位置合わせを手作業で行う場合に、入力作業を少なくし、作業効率の向上を図ることができる。この結果、超解像処理に利用できるフレームの数を増やすことができるので、超解像処理によって高解像度画像を得ることができる。 As a result, the adjustment result in the base frame can be reflected in all other reference frames, so when manually aligning the images of multiple input frames, the input work is reduced and the work efficiency is improved. Can be planned. As a result, the number of frames that can be used for the super-resolution processing can be increased, so that a high-resolution image can be obtained by the super-resolution processing.
(実施の形態4)
実施の形態4では、実施の形態3において図26、図27を用いて説明したものと異なるブレPSF推定処理について説明する。
(Embodiment 4)
In the fourth embodiment, a blur PSF estimation process different from that described in the third embodiment with reference to FIGS. 26 and 27 will be described.
(ブレPSF推定処理)
図33、図34及び図35は、本実施の形態に係る画像処理装置1のブレPSF推定処理を説明するためのフローチャートである。なお、図33、図34及び図35において、図26及び図27と共通するステップには図26及び図27と同一符号を付して説明を省略する。
(Break PSF estimation process)
33, 34 and 35 are flowcharts for explaining the blur PSF estimation process of the
図33、図34及び図35では、まずFrmRに「1」を設定する(ステップS80)。次いで、基準点位置保持メモリ17AからPFrmR,*を取得する(ステップS400)。そして、取得したRoiR近傍の画像データをフレームメモリ11から取得する(ImgR)(ステップS200)。次いで、取得したPFrmR,*の代表点を求める(CtrFrmR)(ステップS401)。その後、FrmRの値を「1」加算し、その値をFrmRに設定する(ステップS402)。次いで、FrmRの値が「N」以下かどうか判定し(ステップS403)、「N」以下である場合(ステップS403:YES)、ステップS400に戻る。
In FIG. 33, FIG. 34 and FIG. 35, first, “1” is set to FrmR (step S80). Next, P FrmR, * is acquired from the reference point
一方、ステップS403でFrmRの値が「N」より大きいと判定された場合(ステップS403:NO)、FrmRの値を「1」に設定する(ステップS404)。 On the other hand, when it is determined in step S403 that the value of FrmR is larger than “N” (step S403: NO), the value of FrmR is set to “1” (step S404).
次いで、FrmRの値を「1」減算し、その値をFrmPに設定するとともに、FrmRの値を「1」加算し、その値をFrmNに設定する(ス以下ではないテップS83)。そして、FrmPの値が「1」以上「N」以下かどうか判定し(ステップS84)、「1」以上「N」以下である場合(ステップS84:YES)、ステップS86に進む。 Next, “1” is subtracted from the value of FrmR, the value is set to FrmP, and the value of FrmR is incremented by “1”, and the value is set to FrmN (step S83 which is not less than or equal to step S83). Then, it is determined whether the value of FrmP is “1” or more and “N” or less (step S84). If it is “1” or more and “N” or less (step S84: YES), the process proceeds to step S86.
そして、FrmNの値が「1」以上「N」以下かどうか判定し(ステップS86)、「1」以上「N」以下である場合(ステップS86:YES)、(ベクトル(CtrFrmP→CtrFrmR)+ベクトル(CtrFrmR→CtrFrmN))÷2の値を動きベクトルMvRに設定する(ステップS405)。 Then, it is determined whether the value of FrmN is “1” or more and “N” or less (step S86). If it is “1” or more and “N” or less (step S86: YES), (vector (Ctr FrmP → Ctr FrmR )) A value of + vector (Ctr FrmR → Ctr FrmN )) / 2 is set as the motion vector MvR (step S405).
一方、ステップS86でFrmNの値が「1」以上「N」以下ではないと判定された場合(ステップS86:NO)、ベクトル(CtrFrmP→CtrFrmR)を動きベクトルMvRに設定する(ステップS406)。 On the other hand, when it is determined in step S86 that the value of FrmN is not “1” or more and “N” or less (step S86: NO), the vector (Ctr FrmP → Ctr FrmR ) is set as the motion vector MvR (step S406). .
また、ステップS84でFrmPの値が「1」以上「N」以下ではないと判定された場合(ステップS84:NO)、FrmNの値が「1」以上「N」以下かどうか判定し(ステップS90)、「1」以上「N」以下である場合(ステップS90:YES)、ベクトル(CtrFrmR→CtrFrmN)の値を動きベクトルMvRに設定する(ステップS407)。 When it is determined in step S84 that the value of FrmP is not “1” or more and “N” or less (step S84: NO), it is determined whether the value of FrmN is “1” or more and “N” or less (step S90). ), If it is “1” or more and “N” or less (step S90: YES), the value of the vector (Ctr FrmR → Ctr FrmN ) is set to the motion vector MvR (step S407).
ステップS405、S406、S407の中のいずれか1つの処理を行った後、MvRがx軸となす角度・MvRの長さを、ブレの角度(BaR)・長さ(MlR)とする(ステップS93)。そして、求めたブレの角度(BaR)・長さ(MlR)をブレPSFパラメータ保持メモリ17Bに格納する(ステップS94)。次いで、画像データImgRとブレ角度BaRからブレの長さを推定する(BlR)(ステップS201)。そして、推定したブレ長さBlRとベクトル長MlRの比を算出する(B2MlR)(ステップS202)。 After performing any one of the processes in steps S405, S406, and S407, the angle MvR and the length of MvR that the MvR makes with the x-axis are set as the blur angle (BaR) and the length (MlR) (step S93). ). Then, the obtained blur angle (BaR) and length (MlR) are stored in the blur PSF parameter holding memory 17B (step S94). Next, the blur length is estimated from the image data ImgR and the blur angle BaR (BlR) (step S201). Then, the ratio between the estimated blur length BlR and the vector length MlR is calculated (B2MlR) (step S202).
その後、FrmRの値に「1」加算し、その値をFrmRに設定する(ステップS95)。そして、FrmRが「N」以下かどうか判定し(ステップS96)、FrmRが「N」以下である場合(ステップS96:YES)、ステップS83に戻る。これに対し、FrmRが「N」以下ではない場合(ステップS96:NO)、全フレーム(R=1〜N)で算出した比B2MlRの代表値を計算する(B2Ml)(ステップS203)。その後、FrmRに「1」を設定する(ステップS204)。次いで、ブレPSFパラメータ保持メモリ17Bに格納したブレの長さMlRにB2Mlを乗じた値をブレの長さBlRとして格納する(ステップS205)。次いで、FrmRの値に「1」加算し、その値をFrmRに設定し(ステップS206)、FrmRが「N」以下かどうか判定する(ステップS207)。FrmRが「N」以下である場合(ステップS207:YES)、ステップS205に戻る。これに対し、FrmRが「N」以下ではない場合(ステップS207:NO)、ブレPSFの推定処理を終了する。 Thereafter, “1” is added to the value of FrmR, and the value is set to FrmR (step S95). Then, it is determined whether FrmR is “N” or less (step S96). If FrmR is “N” or less (step S96: YES), the process returns to step S83. On the other hand, if FrmR is not equal to or less than “N” (step S96: NO), the representative value of the ratio B2MlR calculated for all frames (R = 1 to N) is calculated (B2Ml) (step S203). Thereafter, “1” is set in FrmR (step S204). Next, a value obtained by multiplying the blur length MlR stored in the blur PSF parameter holding memory 17B by B2Ml is stored as the blur length BlR (step S205). Next, “1” is added to the value of FrmR, the value is set to FrmR (step S206), and it is determined whether or not FrmR is “N” or less (step S207). If FrmR is “N” or less (step S207: YES), the process returns to step S205. On the other hand, if FrmR is not equal to or less than “N” (step S207: NO), the blur PSF estimation process is terminated.
一方、ステップS90でFrmNの値が「1」以上「N」以下ではないと判定された場合(ステップS90:NO)、画像データImgRからブレの角度・長さを推定する(BaR、BlR)(ステップS208)。その後、BlRの値をMlRに設定し(ステップS209)、ステップS94に戻る。 On the other hand, if it is determined in step S90 that the value of FrmN is not “1” or more and “N” or less (step S90: NO), the angle / length of blur is estimated from the image data ImgR (BaR, BIR) ( Step S208). Thereafter, the value of BlR is set to MlR (step S209), and the process returns to step S94.
(効果)
以上のように、本実施の形態によれば、ブレPSF推定処理においてブレPSFの長さを推定する際に、1枚の画像データからブレPSFの長さを推定し、推定したブレPSFの長さと動きベクトルの長さとの比率をフレーム毎に求め、その比率を全フレームにわたって平滑化し、各動きベクトルの長さに平滑化した比率を乗算することにより各フレームのブレPSFの長さを計算する。これにより、カメラのシャッタースピードを考慮してブレPSFの長さを推定することができるので、正確なブレPSFを用いてブレの除去処理を行うことができ、リンギングノイズを伴わない先鋭な画像を得ることができる。
(effect)
As described above, according to the present embodiment, when the length of the blur PSF is estimated in the blur PSF estimation process, the length of the blur PSF is estimated from one piece of image data, and the length of the blur PSF thus estimated is estimated. Is calculated for each frame, the ratio is smoothed over the entire frame, and the length of each motion vector is multiplied by the smoothed ratio to calculate the length of the blur PSF of each frame. . As a result, the length of the blur PSF can be estimated in consideration of the shutter speed of the camera, so that the blur removal process can be performed using the accurate blur PSF, and a sharp image without ringing noise can be obtained. Can be obtained.
本発明は、監視カメラで撮影された画像を処理する画像処理装置に用いるに好適である。 The present invention is suitable for use in an image processing apparatus that processes an image taken by a surveillance camera.
1 画像処理装置
10 画像データ入力部
11 フレームメモリ
12 グラフィカルユーザインタフェース部
13 基準フレーム選択部
14 注目被写体領域選択部
15 マッチング計算部
16 ブレPSF推定部
17 メモリ部
17A 基準点位置保持メモリ
17B ブレPSFパラメータ保持メモリ
18 基準フレーム調整部
19 参照フレーム調整部
20 ブレ除去部
21 再構成処理部
22 超解像画像出力部
23 画像生成部
100 ナンバープレート
DESCRIPTION OF
Claims (5)
前記複数入力フレームの中から選択された1つの基準フレームの画像および前記高解像度画像を生成する際に用いられるパラメータを表示させ、前記表示されたパラメータの調整に基づいて前記基準フレームの画像の表示内容を更新し、前記調整されたパラメータを前記基準フレームのパラメータとしてメモリに記憶させる基準フレーム調整部と、
前記基準フレーム以外の入力フレームの1つである参照フレームの画像、および、前記基準フレームのパラメータを前記参照フレームのパラメータとして表示させ、前記表示されたパラメータの調整に基づいて前記参照フレームの画像の表示内容を更新し、前記調整されたパラメータを前記参照フレームのパラメータとしてメモリに記憶させる参照フレーム調整部と、
前記各入力フレームに対して、対応する前記パラメータを用いて前記入力フレームに含まれるブレを除去する処理を行うブレ除去部と、
前記ブレが除去された入力フレームの低解像度画像を位置合わせして高解像度画像を生成する画像生成部と、
を具備する画像処理装置。 An image processing device that generates a high-resolution image by aligning low-resolution images of a plurality of input frames each having a common partial area,
Displaying an image of one reference frame selected from the plurality of input frames and a parameter used when generating the high-resolution image, and displaying the image of the reference frame based on adjustment of the displayed parameter A reference frame adjustment unit that updates contents and stores the adjusted parameter in a memory as a parameter of the reference frame;
An image of a reference frame that is one of the input frames other than the reference frame, and a parameter of the reference frame are displayed as parameters of the reference frame, and an image of the reference frame is displayed based on the adjustment of the displayed parameter. A reference frame adjustment unit that updates display content and stores the adjusted parameter in a memory as a parameter of the reference frame;
A blur removal unit that performs a process of removing blur included in the input frame using the corresponding parameter for each input frame;
An image generation unit configured to generate a high-resolution image by aligning a low-resolution image of the input frame from which the blur is removed;
An image processing apparatus comprising:
前記入力フレームのそれぞれについて、時間方向に前記入力フレームと近接する複数の入力フレームの間で動きベクトルを計算し、前記動きベクトルの長さと方向から前記入力フレームのブレPSFの長さと角度を推定するブレPSF推定部をさらに有し、
前記基準フレーム調整部は、前記ブレPSF推定部により推定された前記基準フレームの前記ブレPSFの長さと調整後の前記ブレPSFの長さとの比率を求め、前記基準フレーム以外の前記入力フレームの前記ブレPSFの長さに前記比率を乗じる、
請求項1に記載の画像処理装置。 The parameter is the length of blur PSF (Point Spread Function),
For each of the input frames, a motion vector is calculated between a plurality of input frames adjacent to the input frame in the time direction, and the length and angle of the blur PSF of the input frame are estimated from the length and direction of the motion vector. It further has a blur PSF estimation unit,
The reference frame adjustment unit obtains a ratio between the length of the blur PSF of the reference frame estimated by the blur PSF estimation unit and the length of the blur PSF after adjustment, and calculates the ratio of the input frame other than the reference frame. Multiply the length of blur PSF by the above ratio,
The image processing apparatus according to claim 1.
請求項2に記載の画像処理装置。 The blur PSF estimation unit estimates the length of the blur PSF from the image data of each of the input frames when estimating the length of the blur PSF, and determines the length of the blur blur PSF and the length of the motion vector. Is calculated for each frame, the ratio is smoothed over all frames, and the length of each motion vector is multiplied by the smoothed ratio to calculate the length of the blur PSF of each frame.
The image processing apparatus according to claim 2.
前記基準フレーム調整部は、前記基準フレームの前記複数の基準点座標を表示させ、前記表示された複数の基準点座標の調整に基づいて前記基準フレームの画像の複数の基準点座標を更新し、前記調整された複数の基準点座標をメモリに記憶させる、
請求項1から3のいずれか一項に記載の画像処理装置。 The parameter is a plurality of reference point coordinates indicating the position of the partial area included in each input frame,
The reference frame adjustment unit displays the plurality of reference point coordinates of the reference frame, updates the plurality of reference point coordinates of the image of the reference frame based on the adjustment of the displayed plurality of reference point coordinates, Storing the adjusted plurality of reference point coordinates in a memory;
The image processing apparatus according to claim 1.
前記パラメータは、前記各入力フレームに含まれる前記顔画像の複数の顔特徴点の位置であり、
前記基準フレーム調整部は、前記基準フレームの前記顔特徴点の位置および前記顔特徴点間を結ぶメッシュを表示させ、前記表示された顔特徴点の位置の調整に基づいて前記基準フレームの画像の前記顔特徴点の位置を更新し、前記調整された顔特徴点の位置をメモリに記憶させる、
請求項1から3のいずれか一項に記載の画像処理装置。 The partial area is a face image;
The parameter is a position of a plurality of face feature points of the face image included in each input frame,
The reference frame adjustment unit displays a mesh connecting the position of the face feature point of the reference frame and the face feature point, and based on the adjustment of the position of the displayed face feature point, the image of the reference frame Updating the position of the face feature point and storing the adjusted face feature point in a memory;
The image processing apparatus according to claim 1.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US15/743,467 US10346956B2 (en) | 2015-07-22 | 2016-07-19 | Image processing device |
PCT/JP2016/003386 WO2017013871A1 (en) | 2015-07-22 | 2016-07-19 | Image processing device |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015144912 | 2015-07-22 | ||
JP2015144912 | 2015-07-22 |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2017028687A true JP2017028687A (en) | 2017-02-02 |
JP6771148B2 JP6771148B2 (en) | 2020-10-21 |
Family
ID=57950760
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2016132548A Active JP6771148B2 (en) | 2015-07-22 | 2016-07-04 | Image processing device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6771148B2 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110717859A (en) * | 2019-10-09 | 2020-01-21 | 哈尔滨工业大学 | Super-resolution reconstruction method based on two-way video |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005352720A (en) * | 2004-06-10 | 2005-12-22 | Olympus Corp | Imaging apparatus and method for attaining high resolution of image |
JP2012100000A (en) * | 2010-11-01 | 2012-05-24 | Olympus Corp | Image pickup device, image processing device, and computer program product |
-
2016
- 2016-07-04 JP JP2016132548A patent/JP6771148B2/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005352720A (en) * | 2004-06-10 | 2005-12-22 | Olympus Corp | Imaging apparatus and method for attaining high resolution of image |
JP2012100000A (en) * | 2010-11-01 | 2012-05-24 | Olympus Corp | Image pickup device, image processing device, and computer program product |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110717859A (en) * | 2019-10-09 | 2020-01-21 | 哈尔滨工业大学 | Super-resolution reconstruction method based on two-way video |
Also Published As
Publication number | Publication date |
---|---|
JP6771148B2 (en) | 2020-10-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Lourenço et al. | sRD-SIFT: keypoint detection and matching in images with radial distortion | |
US11080833B2 (en) | Image manipulation using deep learning techniques in a patch matching operation | |
CN111932673B (en) | Object space data augmentation method and system based on three-dimensional reconstruction | |
ES2769636T3 (en) | Automatic 3-D surface coating | |
CN112967381B (en) | Three-dimensional reconstruction method, apparatus and medium | |
Lee et al. | Automatic distortion correction of endoscopic images captured with wide-angle zoom lens | |
GB2565354A (en) | Method and corresponding device for generating a point cloud representing a 3D object | |
US20140313224A1 (en) | Image processing device and method, and program | |
JP2014021487A (en) | Method and apparatus for simulating depth of field (dof) in microscopy | |
CN112163996A (en) | Flat-angle video fusion method based on image processing | |
JP5987114B2 (en) | High resolution image generation apparatus, high resolution image generation method, and high resolution image generation program | |
Camponez et al. | Super-resolution image reconstruction using nonparametric Bayesian INLA approximation | |
JP2018063693A (en) | Image processing device, image processing method, and program | |
JP6771148B2 (en) | Image processing device | |
Alsalamah et al. | Medical image inpainting with RBF interpolation technique | |
JP2023532755A (en) | Computer-implemented method, computer program product, and system for processing images | |
WO2016098323A1 (en) | Information processing device, information processing method, and recording medium | |
Ji et al. | Frequency consistent adaptation for real world super resolution | |
WO2017013871A1 (en) | Image processing device | |
JP2006350562A (en) | Image processor and image processing program | |
Zhou et al. | Parameter-free Gaussian PSF model for extended depth of field in brightfield microscopy | |
CN116628250A (en) | Image generation method, device, electronic equipment and computer readable storage medium | |
JP7343336B2 (en) | Inspection support device and inspection support method | |
KR102243079B1 (en) | Microscope apparatus and method for calibrating position of light source | |
JP2013148467A (en) | Measurement device, method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20190415 |
|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20190625 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20191018 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20200303 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20200428 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20200526 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20200722 |
|
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: 20200811 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20200910 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 6771148 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |