JP4325252B2 - Image processing apparatus and method, recording medium, and program - Google Patents
Image processing apparatus and method, recording medium, and program Download PDFInfo
- Publication number
- JP4325252B2 JP4325252B2 JP2003094659A JP2003094659A JP4325252B2 JP 4325252 B2 JP4325252 B2 JP 4325252B2 JP 2003094659 A JP2003094659 A JP 2003094659A JP 2003094659 A JP2003094659 A JP 2003094659A JP 4325252 B2 JP4325252 B2 JP 4325252B2
- Authority
- JP
- Japan
- Prior art keywords
- pixel
- image
- foreground
- frame
- unit
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000012545 processing Methods 0.000 title claims description 215
- 238000000034 method Methods 0.000 title description 149
- 239000000203 mixture Substances 0.000 claims description 300
- 238000002156 mixing Methods 0.000 claims description 177
- 238000001514 detection method Methods 0.000 claims description 86
- 238000009499 grossing Methods 0.000 claims description 45
- 230000015572 biosynthetic process Effects 0.000 claims description 38
- 238000003786 synthesis reaction Methods 0.000 claims description 38
- 230000002194 synthesizing effect Effects 0.000 claims description 11
- 238000003672 processing method Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 134
- 230000014509 gene expression Effects 0.000 description 100
- 230000008569 process Effects 0.000 description 100
- 238000004364 calculation method Methods 0.000 description 93
- 230000015654 memory Effects 0.000 description 86
- 230000003068 static effect Effects 0.000 description 85
- 238000000926 separation method Methods 0.000 description 45
- 230000008859 change Effects 0.000 description 42
- 238000000605 extraction Methods 0.000 description 33
- 238000013213 extrapolation Methods 0.000 description 24
- 239000000284 extract Substances 0.000 description 21
- 239000002131 composite material Substances 0.000 description 16
- 238000003706 image smoothing Methods 0.000 description 12
- 238000012937 correction Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 8
- 238000003384 imaging method Methods 0.000 description 8
- 239000011159 matrix material Substances 0.000 description 5
- 238000006243 chemical reaction Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 239000004065 semiconductor Substances 0.000 description 3
- 230000002123 temporal effect Effects 0.000 description 3
- 230000015556 catabolic process Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000007796 conventional method Methods 0.000 description 2
- 230000008030 elimination Effects 0.000 description 2
- 238000003379 elimination reaction Methods 0.000 description 2
- 230000010354 integration Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 239000000243 solution Substances 0.000 description 2
- 238000009825 accumulation Methods 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 239000000470 constituent Substances 0.000 description 1
- 239000013256 coordination polymer Substances 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 230000004069 differentiation Effects 0.000 description 1
- 238000002347 injection Methods 0.000 description 1
- 239000007924 injection Substances 0.000 description 1
- 230000037452 priming Effects 0.000 description 1
- 238000012887 quadratic function Methods 0.000 description 1
- 238000012776 robust process Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000010408 sweeping Methods 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
- Studio Circuits (AREA)
- Editing Of Facsimile Originals (AREA)
- Image Analysis (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、画像処理装置および方法、記録媒体、並びにプログラムに関し、特に、破綻のない画像を合成できるようにした画像処理装置および方法、記録媒体、並びにプログラムに関する。
【0002】
【従来の技術】
前景成分画像と、背景成分画像とを1枚の画像に合成する画像合成技術が一般に普及している。すなわち、画像合成技術とは、第1の画像に含まれている前景成分画像と、第2の画像に含まれている背景成分画像を合成することにより、1枚の合成画像を生成すると言うものである。
【0003】
また、前景成分画像の動きボケを調整して、背景成分画像と合成するものがある。(例えば、特許文献1参照)。
【0004】
【特許文献1】
特開2003−18564号公報(特願2001−195605)
【0005】
【発明が解決しようとする課題】
ところで、上述した従来手法を用いて、図1Aで示されるような合成画像を生成した場合、その前景成分画像と背景成分画像のそれぞれの混合比は、図1Bのような分布となる。図1Bは、各画素毎の前景成分と背景成分の混合比の分布を色で示している。図1Bにおいて、白は前景成分の割合が1で背景成分が0を示し、黒は、逆に、前景成分の割合が0で背景成分が1であることを示している。従って、前景成分と背景成分の割合がそれぞれ1/2の場合、灰色(白と黒の中間色)が表示されていることになる。
【0006】
図1A,Bにおいて、前景成分となっている画像は、水平方向に動きのある画像であるため、背景成分に対して動きボケが生じており、このため、前景成分と背景成分の間の混合領域には、それぞれの成分が混合した混合領域が存在する。
【0007】
また、図2は、図1A上の前景成分画像の画素と背景成分画像の画素値の分布を示したものであり、水平方向と垂直方向の座標位置上の画素値の分布が示されている。
【0008】
図1A,B、または、図2で示されるように、前景成分画像と背景成分画像の境界付近は、階段状に画素値や混合比が変化している。このため、合成された画像には、混合領域において破綻が生じて、見た目に不自然なものとなってしまうという課題があった。
【0009】
これは、前景成分画像、および、背景成分画像のそれぞれを画素単位で求めていたため境界部分は、図3で示されるように、動きボケが除去された前景成分画像と背景成分画像とを合成してみるとわかるように、形状の連続性が保たれず、階段状にギザギザとした形状になってしまうからである。
【0010】
すなわち、図4で示されるように、CCD(Charge Coupled Device)などに入射される光を、各画素毎に表現していた。図4では、背景成分画像の光の発する領域を黒色で、前景成分画像の光の発する部分を斜線部で示しており、発せられた光をCCDの各画素に見立てたコップ状の入れ物に充填させることにより、各画素が表現されることを示している。図4の場合、左から4番目までの画素は前景成分画像を、右から6番目までの背景成分画像を、それぞれ示す画素値となっている。つまり、図4においては、各画素単位で前景成分画像と背景成分画像が表現されている。しかしながら、実際の前景成分画像と背景成分画像の境界は、CCDの各画素単位で存在するわけではなく、その境界が画素上となることも考えられる。
【0011】
例えば、図5で示されるように、実際には、CCDの画素上に前景成分画像と背景成分画像の境界が存在することもある。図5においては、左から5番目の画素の中央位置までが前景成分画像であり、右から6番目の画素の中央位置までが背景成分画像を表しており、左から5番目の画素(右から6番目の画素)の中央位置が境界となっている。この場合、実際には、左から5番目の画素は、前景成分画像と、背景成分画像が、混合した画素値となるはずである。
【0012】
しかしながら、上述した前景成分画像と背景成分画像は、画素毎に分けられているため、これらを合成し、動きボケを付加しても、その境界部分が階段状となってしまい、違和感のある画像になってしまうと言う課題があった。
【0013】
本発明はこのような状況に鑑みてなされたものであり、前景成分画像と背景成分画像との境界となる混合領域をより詳細に表現することにより正確に合成画像を生成できるようにするものである。
【0014】
【課題を解決するための手段】
本発明の画像処理装置は、動きボケの無い前景画像の輪郭部を検出する画素検出手段と、輪郭部内の注目画素に対応する複数の画素の画素位置を回帰して回帰直線を検出する回帰直線検出手段と、回帰直線近傍の各画素における前景画像の成分の面積に応じて、各画素の空間混合比を求める空間混合比生成手段と、画素検出手段により検出された輪郭部を形成する画素の画素値に空間混合比生成手段によって求められた空間混合比を乗じることにより、輪郭部をスムージングするスムージング手段と、前景画像の輪郭部内の各注目画素に対応する回帰直線検出手段により検出された回帰直線を結ぶことにより輪郭部がスムージングされた前景画像に対して所定の方向に動きボケを付加した動きボケ付加前景画像を生成する動きボケ付加手段と、動きボケ付加前景画像と背景画像を合成する合成手段とを備えることを特徴とする。
【0016】
本発明の画像処理方法は、動きボケの無い前景画像の輪郭部を検出する画素検出ステップと、輪郭部内の注目画素に対応する複数の画素の画素位置を回帰して回帰直線を検出する回帰直線検出ステップと、回帰直線近傍の各画素における前景画像の成分の面積に応じて、各画素の空間混合比を求める空間混合比生成ステップと、画素検出ステップの処理で検出された輪郭部を形成する画素の画素値に空間混合比生成ステップの処理によって求められた空間混合比を乗じることにより、輪郭部をスムージングするスムージングステップと、前景画像の輪郭部内の各注目画素に対応する回帰直線検出ステップの処理により検出された回帰直線を結ぶことにより輪郭部がスムージングされた前景画像に対して所定の方向に動きボケを付加した動きボケ付加前景画像を生成する動きボケ付加ステップと、動きボケ付加前景画像と背景画像を合成する合成ステップとを含むことを特徴とする。
【0017】
本発明の記録媒体のプログラムは、動きボケの無い前景画像の輪郭部を検出する画素検出ステップと、輪郭部内の注目画素に対応する複数の画素の画素位置を回帰して回帰直線を検出する回帰直線検出ステップと、回帰直線近傍の各画素における前景画像の成分の面積に応じて、各画素の空間混合比を求める空間混合比生成ステップと、画素検出ステップの処理で検出された輪郭部を形成する画素の画素値に空間混合比生成ステップの処理によって求められた空間混合比を乗じることにより、輪郭部をスムージングするスムージングステップと、前景画像の輪郭部内の各注目画素に対応する回帰直線検出ステップの処理により検出された回帰直線を結ぶことにより輪郭部がスムージングされた前景画像に対して所定の方向に動きボケを付加した動きボケ付加前景画像を生成する動きボケ付加ステップと、動きボケ付加前景画像と背景画像を合成する合成ステップとを含むコンピュータが読み取り可能なプログラムが記録されていることを特徴とする。
【0018】
本発明のプログラムは、動きボケの無い前景画像の輪郭部を検出する画素検出ステップと、輪郭部内の注目画素に対応する複数の画素の画素位置を回帰して回帰直線を検出する回帰直線検出ステップと、回帰直線近傍の各画素における前景画像の成分の面積に応じて、各画素の空間混合比を求める空間混合比生成ステップと、画素検出ステップの処理で検出された輪郭部を形成する画素の画素値に空間混合比生成ステップの処理によって求められた空間混合比を乗じることにより、輪郭部をスムージングするスムージングステップと、前景画像の輪郭部内の各注目画素に対応する回帰直線検出ステップの処理により検出された回帰直線を結ぶことにより輪郭部がスムージングされた前景画像に対して所定の方向に動きボケを付加した動きボケ付加前景画像を生成する動きボケ付加ステップと、動きボケ付加前景画像と背景画像を合成する合成ステップとをコンピュータに実行させることを特徴とする。
【0019】
本発明の画像処理装置および方法、並びにプログラムにおいては、動きボケの無い前景画像の輪郭部が検出され、輪郭部内の注目画素に対応する複数の画素の画素位置が回帰されて回帰直線が検出され、回帰直線近傍の各画素における前景画像の成分の面積に応じて、各画素の空間混合比が求められ、検出された輪郭部を形成する画素の画素値に空間混合比を乗じることにより、輪郭部がスムージングされ、前景画像の輪郭部内の各注目画素に対応する回帰直線を結ぶことにより輪郭部がスムージングされた前景画像に対して所定の方向に動きボケを付加した動きボケ付加前景画像が生成され、動きボケ付加前景画像と背景画像が合成される。
【0020】
本発明の画像処理装置は、独立した装置であっても良いし、画像処理を行うブロックであっても良い。
【0021】
【発明の実施の形態】
以下に本発明の実施の形態を説明するが、請求項に記載の構成要件と、発明の実施の形態における具体例との対応関係を例示すると、次のようになる。この記載は、請求項に記載されている発明をサポートする具体例が、発明の実施の形態に記載されていることを確認するためのものである。従って、発明の実施の形態中には記載されているが、構成要件に対応するものとして、ここには記載されていない具体例があったとしても、そのことは、その具体例が、その構成要件に対応するものではないことを意味するものではない。逆に、具体例が構成要件に対応するものとしてここに記載されていたとしても、そのことは、その具体例が、その構成要件以外の構成要件には対応しないものであることを意味するものでもない。
【0022】
さらに、この記載は、発明の実施の形態に記載されている具体例に対応する発明が、請求項に全て記載されていることを意味するものではない。換言すれば、この記載は、発明の実施の形態に記載されている具体例に対応する発明であって、この出願の請求項には記載されていない発明の存在、すなわち、将来、分割出願されたり、補正により追加される発明の存在を否定するものではない。
【0023】
即ち、本発明の画像処理装置は、動きボケの無い前景画像の輪郭部を検出する画素検出手段(例えば、図87の輪郭抽出部1001)と、輪郭部内の注目画素に対応する複数の画素の画素位置を回帰して回帰直線を検出する回帰直線検出手段(例えば、図87の輪郭平滑化部1002)と、回帰直線近傍の各画素における前景画像の成分の面積に応じて、各画素の空間混合比を求める空間混合比生成手段(例えば、図87の空間混合比生成部1003)と、画素検出手段により検出された輪郭部を形成する画素の画素値に空間混合比生成手段によって求められた空間混合比を乗じることにより、輪郭部をスムージングするスムージング手段(例えば、図87の前景成分画像スムージング部1004)と、前景画像の輪郭部内の各注目画素に対応する回帰直線検出手段により検出された回帰直線を結ぶことにより輪郭部がスムージングされた前景画像に対して所定の方向に動きボケを付加した動きボケ付加前景画像を生成する動きボケ付加手段(例えば、図87の動きボケ付加部1005)と、動きボケ付加前景画像と背景画像を合成する合成手段(例えば、図87の画像合成部1010)とを備えることを特徴とする。
【0024】
また、本発明の画像処理方法は、動きボケの無い前景画像の輪郭部を検出する画素検出ステップ(例えば、図93のフローチャートにおけるステップS921の処理)と、輪郭部内の注目画素に対応する複数の画素の画素位置を回帰して回帰直線を検出する回帰直線検出ステップ(例えば、図93のフローチャートにおけるステップS922の処理)と、回帰直線近傍の各画素における前景画像の成分の面積に応じて、各画素の空間混合比を求める空間混合比生成ステップ(例えば、図93のフローチャートにおけるステップS923の処理)と、画素検出ステップの処理で検出された輪郭部を形成する画素の画素値に空間混合比生成ステップの処理によって求められた空間混合比を乗じることにより、輪郭部をスムージングするスムージングステップ(例えば、図93のフローチャートにおけるステップS924の処理)と、前景画像の輪郭部内の各注目画素に対応する回帰直線検出ステップの処理により検出された回帰直線を結ぶことにより輪郭部がスムージングされた前景画像に対して所定の方向に動きボケを付加した動きボケ付加前景画像を生成する動きボケ付加ステップ(例えば、図93のフローチャートにおけるステップS925の処理)と、動きボケ付加前景画像と背景画像を合成する合成ステップ(例えば、図93のフローチャートにおけるステップS930の処理)とを含むことを特徴とする。
【0025】
図6は、本発明を適用した画像処理部の一実施の形態の構成を示すブロック図である。
【0026】
なお、画像処理部の各機能をハードウェアで実現するか、ソフトウェアで実現するかは問わない。つまり、本明細書の各ブロック図は、ハードウェアのブロック図と考えても、ソフトウェアによる機能ブロック図と考えても良い。
【0027】
ここで、動きボケとは、撮像の対象となる、現実世界におけるオブジェクトの動きと、センサの撮像の特性とにより生じる、動いているオブジェクトに対応する画像に含まれている歪みをいう。
【0028】
この明細書では、撮像の対象となる、現実世界におけるオブジェクトに対応する画像を、画像オブジェクトと称する。
【0029】
画像処理部に供給された入力画像は、オブジェクト抽出部101、領域特定部103、混合比算出部104、および前景背景分離部105に供給される。
【0030】
オブジェクト抽出部101は、入力画像に含まれる前景のオブジェクトに対応する画像オブジェクトを粗く抽出して、抽出した画像オブジェクトを動き検出部102に供給する。オブジェクト抽出部101は、例えば、入力画像に含まれる前景のオブジェクトに対応する画像オブジェクトの輪郭を検出することで、前景のオブジェクトに対応する画像オブジェクトを粗く抽出する。
【0031】
オブジェクト抽出部101は、入力画像に含まれる背景のオブジェクトに対応する画像オブジェクトを粗く抽出して、抽出した画像オブジェクトを動き検出部102に供給する。オブジェクト抽出部101は、例えば、入力画像と、抽出された前景のオブジェクトに対応する画像オブジェクトとの差から、背景のオブジェクトに対応する画像オブジェクトを粗く抽出する。
【0032】
また、例えば、オブジェクト抽出部101は、内部に設けられている背景メモリに記憶されている背景の画像と、入力画像との差から、前景のオブジェクトに対応する画像オブジェクト、および背景のオブジェクトに対応する画像オブジェクトを粗く抽出するようにしてもよい。
【0033】
動き検出部102は、例えば、ブロックマッチング法、勾配法、位相相関法、およびペルリカーシブ法などの手法により、粗く抽出された前景のオブジェクトに対応する画像オブジェクトの動きベクトルを算出して、算出した動きベクトルおよび動きベクトルの位置情報(動きベクトルに対応する画素の位置を特定する情報)を領域特定部103、混合比算出部104、および動きボケ抽出部106に供給する。
【0034】
動き検出部102が出力する動きベクトルには、動き量vに対応する情報が含まれている。
【0035】
また、例えば、動き検出部102は、画像オブジェクトに画素を特定する画素位置情報と共に、画像オブジェクト毎の動きベクトルを動きボケ除去部106に出力するようにしてもよい。
【0036】
動き量vは、動いているオブジェクトに対応する画像の位置の変化を画素間隔を単位として表す値である。例えば、前景に対応するオブジェクトの画像が、あるフレームを基準として次のフレームにおいて4画素分離れた位置に表示されるように移動しているとき、前景に対応するオブジェクトの画像の動き量vは、4とされる。
【0037】
なお、オブジェクト抽出部101および動き検出部102は、動いているオブジェクトに対応した動きボケ量の調整を行う場合に必要となる。
【0038】
領域特定部103は、入力された画像の画素のそれぞれを、前景領域、背景領域、または混合領域のいずれかに特定し、画素毎に前景領域、背景領域、または混合領域のいずれかに属するかを示す情報(以下、領域情報と称する)を混合比算出部104、前景背景分離部105、および動きボケ除去部106に供給する。
【0039】
混合比算出部104は、入力画像、および領域特定部103から供給された領域情報を基に、混合領域63に含まれる画素に対応する混合比(以下、混合比αと称する)を算出して、算出した混合比を前景背景分離部105に供給する。
【0040】
混合比αは、後述する式(3)に示されるように、画素値における、背景のオブジェクトに対応する画像の成分(以下、背景の成分とも称する)の割合を示す値である。
【0041】
前景背景分離部105は、領域特定部103から供給された領域情報、および混合比算出部104から供給された混合比αを基に、前景のオブジェクトに対応する画像の成分(以下、前景の成分とも称する)のみから成る前景成分画像と、背景の成分のみから成る背景成分画像とに入力画像を分離して、前景成分画像を動きボケ除去部106および合成部107に供給する。従来の混合領域を考慮しないで前景と背景だけを特定し、分離していた方式に比べ正確な前景と背景を得ることが出来る。
【0042】
動きボケ除去部106は、動きベクトルからわかる動き量vおよび領域情報を基に、前景成分画像に含まれる1以上の画素を示す処理単位を決定する。処理単位は、動きボケの量の調整の処理の対象となる1群の画素を指定するデータである。
【0043】
動きボケ除去部106は、前景背景分離部105から供給された前景成分画像、動き検出部102から供給された動きベクトルおよびその位置情報、並びに処理単位を基に、前景成分画像に含まれる動きボケを除去して、動きボケを除去した前景成分画像を合成部107に出力する。動きベクトルとその位置情報は使わないこともある。
【0044】
合成部107は、動き検出部102から供給された動きベクトルおよびその位置情報、並びに、領域特定部103より入力された領域情報に基づいて、動きボケ除去部106により動きボケが除去された前景成分画像を入力された任意の背景画像と合成し、合成画像を生成して出力する。
【0045】
次に、図7乃至図22を参照して、画像処理部に供給される入力画像について説明する。
【0046】
図7は、センサによる撮像を説明する図である。センサは、例えば、固体撮像素子であるCCD(Charge-Coupled Device)エリアセンサを備えたCCDビデオカメラなどで構成される。現実世界における、前景に対応するオブジェクトは、現実世界における、背景に対応するオブジェクトと、センサとの間を、例えば、図中の左側から右側に水平に移動する。
【0047】
センサは、前景に対応するオブジェクトを、背景に対応するオブジェクトと共に撮像する。センサは、撮像した画像を1フレーム単位で出力する。例えば、センサは、1秒間に30フレームから成る画像を出力する。センサの露光時間は、1/30秒とすることができる。露光時間は、センサが入力された光の電荷への変換を開始してから、入力された光の電荷への変換を終了するまでの期間である。以下、露光時間をシャッタ時間とも称する。
【0048】
図8は、画素の配置を説明する図である。図8中において、A乃至Iは、個々の画素を示す。画素は、画像に対応する平面上に配置されている。1つの画素に対応する1つの検出素子は、センサ上に配置されている。センサが画像を撮像するとき、1つの検出素子は、画像を構成する1つの画素に対応する画素値を出力する。例えば、検出素子のX方向の位置は、画像上の横方向の位置に対応し、検出素子のY方向の位置は、画像上の縦方向の位置に対応する。
【0049】
図9に示すように、例えば、CCDである検出素子は、シャッタ時間に対応する期間、入力された光を電荷に変換して、変換された電荷を蓄積する。電荷の量は、入力された光の強さと、光が入力されている時間にほぼ比例する。検出素子は、シャッタ時間に対応する期間において、入力された光から変換された電荷を、既に蓄積されている電荷に加えていく。すなわち、検出素子は、シャッタ時間に対応する期間、入力される光を積分して、積分された光に対応する量の電荷を蓄積する。検出素子は、時間に対して、積分効果があるとも言える。
【0050】
検出素子に蓄積された電荷は、図示せぬ回路により、電圧値に変換され、電圧値は更にデジタルデータなどの画素値に変換されて出力される。従って、センサから出力される個々の画素値は、前景または背景に対応するオブジェクトの空間的に広がりを有するある部分を、シャッタ時間について積分した結果である、1次元の空間に射影された値を有する。
【0051】
画像処理部は、このようなセンサの蓄積の動作により、出力信号に埋もれてしまった有意な情報、例えば、混合比αを抽出する。画像処理部は、前景の画像オブジェクト自身が混ざり合うことによる生ずる歪みの量、例えば、動きボケの量などを調整する。また、画像処理部は、前景の画像オブジェクトと背景の画像オブジェクトとが混ざり合うことにより生ずる歪みの量を調整する。
【0052】
図10は、動いている前景に対応するオブジェクトと、静止している背景に対応するオブジェクトとを撮像して得られる画像を説明する図である。図10Aは、動きを伴う前景に対応するオブジェクトと、静止している背景に対応するオブジェクトとを撮像して得られる画像を示している。図10Aに示す例において、前景に対応するオブジェクトは、画面に対して水平に左から右に動いている。
【0053】
図10Bは、図10Aに示す画像の1つのラインに対応する画素値を時間方向に展開したモデル図である。図10Bの横方向は、図10Aの空間方向Xに対応している。
【0054】
背景領域の画素は、背景の成分、すなわち、背景のオブジェクトに対応する画像の成分のみから、その画素値が構成されている。前景領域の画素は、前景の成分、すなわち、前景のオブジェクトに対応する画像の成分のみから、その画素値が構成されている。
【0055】
混合領域の画素は、背景の成分、および前景の成分から、その画素値が構成されている。混合領域は、背景の成分、および前景の成分から、その画素値が構成されているので、歪み領域ともいえる。混合領域は、更に、カバードバックグラウンド領域およびアンカバードバックグラウンド領域に分類される。
【0056】
カバードバックグラウンド領域は、前景領域に対して、前景のオブジェクトの進行方向の前端部に対応する位置の混合領域であり、時間の経過に対応して背景成分が前景に覆い隠される領域をいう。
【0057】
これに対して、アンカバードバックグラウンド領域は、前景領域に対して、前景のオブジェクトの進行方向の後端部に対応する位置の混合領域であり、時間の経過に対応して背景成分が現れる領域をいう。
【0058】
このように、前景領域、背景領域、またはカバードバックグラウンド領域若しくはアンカバードバックグラウンド領域を含む画像が、領域特定部103、混合比算出部104、および前景背景分離部105に入力画像として入力される。
【0059】
図11は、以上のような、背景領域、前景領域、混合領域、カバードバックグラウンド領域、およびアンカバードバックグラウンド領域を説明する図である。図11に示す画像に対応する場合、背景領域は、静止部分であり、前景領域は、動き部分であり、混合領域のカバードバックグラウンド領域は、背景から前景に変化する部分であり、混合領域のアンカバードバックグラウンド領域は、前景から背景に変化する部分である。
【0060】
図12は、静止している前景に対応するオブジェクトおよび静止している背景に対応するオブジェクトを撮像した画像における、隣接して1列に並んでいる画素の画素値を時間方向に展開したモデル図である。例えば、隣接して1列に並んでいる画素として、画面の1つのライン上に並んでいる画素を選択することができる。
【0061】
図12に示すF01乃至F04の画素値は、静止している前景のオブジェクトに対応する画素の画素値である。図12に示すB01乃至B04の画素値は、静止している背景のオブジェクトに対応する画素の画素値である。
【0062】
図12における縦方向は、図中の上から下に向かって時間が経過する。図12中の矩形の上辺の位置は、センサが入力された光の電荷への変換を開始する時刻に対応し、図12中の矩形の下辺の位置は、センサが入力された光の電荷への変換を終了する時刻に対応する。すなわち、図12中の矩形の上辺から下辺までの距離は、シャッタ時間に対応する。
【0063】
以下において、シャッタ時間とフレーム間隔とが同一である場合を例に説明する。
【0064】
図12における横方向は、図10で説明した空間方向Xに対応する。より具体的には、図12に示す例において、図12中の”F01”と記載された矩形の左辺から”B04”と記載された矩形の右辺までの距離は、画素のピッチの8倍、すなわち、連続している8つの画素の間隔に対応する。
【0065】
前景のオブジェクトおよび背景のオブジェクトが静止している場合、シャッタ時間に対応する期間において、センサに入力される光は変化しない。
【0066】
ここで、シャッタ時間に対応する期間を2つ以上の同じ長さの期間に分割する。例えば、仮想分割数を4とすると、図12に示すモデル図は、図13に示すモデルとして表すことができる。仮想分割数は、前景に対応するオブジェクトのシャッタ時間内での動き量vなどに対応して設定される。例えば、4である動き量vに対応して、仮想分割数は、4とされ、シャッタ時間に対応する期間は4つに分割される。
【0067】
図中の最も上の行は、シャッタが開いて最初の、分割された期間に対応する。図中の上から2番目の行は、シャッタが開いて2番目の、分割された期間に対応する。図中の上から3番目の行は、シャッタが開いて3番目の、分割された期間に対応する。図中の上から4番目の行は、シャッタが開いて4番目の、分割された期間に対応する。
【0068】
以下、動き量vに対応して分割されたシャッタ時間をシャッタ時間/vとも称する。
【0069】
前景に対応するオブジェクトが静止しているとき、センサに入力される光は変化しないので、前景の成分F01/vは、画素値F01を仮想分割数で除した値に等しい。同様に、前景に対応するオブジェクトが静止しているとき、前景の成分F02/vは、画素値F02を仮想分割数で除した値に等しく、前景の成分F03/vは、画素値F03を仮想分割数で除した値に等しく、前景の成分F04/vは、画素値F04を仮想分割数で除した値に等しい。
【0070】
背景に対応するオブジェクトが静止しているとき、センサに入力される光は変化しないので、背景の成分B01/vは、画素値B01を仮想分割数で除した値に等しい。同様に、背景に対応するオブジェクトが静止しているとき、背景の成分B02/vは、画素値B02を仮想分割数で除した値に等しく、B03/vは、画素値B03を仮想分割数で除した値に等しく、B04/vは、画素値B04を仮想分割数で除した値に等しい。
【0071】
すなわち、前景に対応するオブジェクトが静止している場合、シャッタ時間に対応する期間において、センサに入力される前景のオブジェクトに対応する光が変化しないので、シャッタが開いて最初の、シャッタ時間/vに対応する前景の成分F01/vと、シャッタが開いて2番目の、シャッタ時間/vに対応する前景の成分F01/vと、シャッタが開いて3番目の、シャッタ時間/vに対応する前景の成分F01/vと、シャッタが開いて4番目の、シャッタ時間/vに対応する前景の成分F01/vとは、同じ値となる。F02/v乃至F04/vも、F01/vと同様の関係を有する。
【0072】
背景に対応するオブジェクトが静止している場合、シャッタ時間に対応する期間において、センサに入力される背景のオブジェクトに対応する光は変化しないので、シャッタが開いて最初の、シャッタ時間/vに対応する背景の成分B01/vと、シャッタが開いて2番目の、シャッタ時間/vに対応する背景の成分B01/vと、シャッタが開いて3番目の、シャッタ時間/vに対応する背景の成分B01/vと、シャッタが開いて4番目の、シャッタ時間/vに対応する背景の成分B01/vとは、同じ値となる。B02/v乃至B04/vも、同様の関係を有する。
【0073】
次に、前景に対応するオブジェクトが移動し、背景に対応するオブジェクトが静止している場合について説明する。
【0074】
図14は、前景に対応するオブジェクトが図中の右側に向かって移動する場合の、カバードバックグラウンド領域を含む、1つのライン上の画素の画素値を時間方向に展開したモデル図である。図14において、前景の動き量vは、4である。1フレームは短い時間なので、前景に対応するオブジェクトが剛体であり、等速で移動していると仮定することができる。図14において、前景に対応するオブジェクトの画像は、あるフレームを基準として次のフレームにおいて4画素分右側に表示されるように移動する。
【0075】
図14において、最も左側の画素乃至左から4番目の画素は、前景領域に属する。図14において、左から5番目乃至左から7番目の画素は、カバードバックグラウンド領域である混合領域に属する。図14において、最も右側の画素は、背景領域に属する。
【0076】
前景に対応するオブジェクトが時間の経過と共に背景に対応するオブジェクトを覆い隠すように移動しているので、カバードバックグラウンド領域に属する画素の画素値に含まれる成分は、シャッタ時間に対応する期間のある時点で、背景の成分から、前景の成分に替わる。
【0077】
例えば、図14中に太線枠を付した画素値Mは、式(1)で表される。
【0078】
M=B02/v+B02/v+F07/v+F06/v ・・・(1)
【0079】
例えば、左から5番目の画素は、1つのシャッタ時間/vに対応する背景の成分を含み、3つのシャッタ時間/vに対応する前景の成分を含むので、左から5番目の画素の混合比αは、1/4である。左から6番目の画素は、2つのシャッタ時間/vに対応する背景の成分を含み、2つのシャッタ時間/vに対応する前景の成分を含むので、左から6番目の画素の混合比αは、1/2である。左から7番目の画素は、3つのシャッタ時間/vに対応する背景の成分を含み、1つのシャッタ時間/vに対応する前景の成分を含むので、左から7番目の画素の混合比αは、3/4である。
【0080】
前景に対応するオブジェクトが、剛体であり、前景の画像が次のフレームにおいて4画素右側に表示されるように等速で移動すると仮定できるので、例えば、図14中の左から4番目の画素の、シャッタが開いて最初の、シャッタ時間/vの前景の成分F07/vは、図14中の左から5番目の画素の、シャッタが開いて2番目のシャッタ時間/vに対応する前景の成分に等しい。同様に、前景の成分F07/vは、図14中の左から6番目の画素の、シャッタが開いて3番目のシャッタ時間/vに対応する前景の成分と、図14中の左から7番目の画素の、シャッタが開いて4番目のシャッタ時間/vに対応する前景の成分とに、それぞれ等しい。
【0081】
前景に対応するオブジェクトが、剛体であり、前景の画像が次のフレームにおいて4画素右側に表示されるように等速で移動すると仮定できるので、例えば、図14中の左から3番目の画素の、シャッタが開いて最初のシャッタ時間/vの前景の成分F06/vは、図14中の左から4番目の画素の、シャッタが開いて2番目のシャッタ時間/vに対応する前景の成分に等しい。同様に、前景の成分F06/vは、図14中の左から5番目の画素の、シャッタが開いて3番目のシャッタ時間/vに対応する前景の成分と、図14中の左から6番目の画素の、シャッタが開いて4番目のシャッタ時間/vに対応する前景の成分とに、それぞれ等しい。
【0082】
前景に対応するオブジェクトが、剛体であり、前景の画像が次のフレームにおいて4画素右側に表示されるように等速で移動すると仮定できるので、例えば、図14中の左から2番目の画素の、シャッタが開いて最初のシャッタ時間/vの前景の成分F05/vは、図14中の左から3番目の画素の、シャッタが開いて2番目のシャッタ時間/vのに対応する前景の成分に等しい。同様に、前景の成分F05/vは、図14中の左から4番目の画素の、シャッタが開いて3番目のシャッタ時間/vに対応する前景の成分と、図14中の左から5番目の画素の、シャッタが開いて4番目のシャッタ時間/vに対応する前景の成分とに、それぞれ等しい。
【0083】
前景に対応するオブジェクトが、剛体であり、前景の画像が次のフレームにおいて4画素右側に表示されるように等速で移動すると仮定できるので、例えば、図14中の最も左側の画素の、シャッタが開いて最初のシャッタ時間/vの前景の成分F04/vは、図14中の左から2番目の画素の、シャッタが開いて2番目のシャッタ時間/vに対応する前景の成分に等しい。同様に、前景の成分F04/vは、図14中の左から3番目の画素の、シャッタが開いて3番目のシャッタ時間/vに対応する前景の成分と、図14中の左から4番目の画素の、シャッタが開いて4番目のシャッタ時間/vに対応する前景の成分とに、それぞれ等しい。
【0084】
動いているオブジェクトに対応する前景の領域は、このように動きボケを含むので、歪み領域とも言える。
【0085】
図15は、前景が図中の右側に向かって移動する場合の、アンカバードバックグラウンド領域を含む、1つのライン上の画素の画素値を時間方向に展開したモデル図である。図15において、前景の動き量vは、4である。1フレームは短い時間なので、前景に対応するオブジェクトが剛体であり、等速で移動していると仮定することができる。図15において、前景に対応するオブジェクトの画像は、あるフレームを基準として次のフレームにおいて4画素分右側に移動する。
【0086】
図15において、最も左側の画素乃至左から4番目の画素は、背景領域に属する。図15において、左から5番目乃至左から7番目の画素は、アンカバードバックグラウンドである混合領域に属する。図15において、最も右側の画素は、前景領域に属する。
【0087】
背景に対応するオブジェクトを覆っていた前景に対応するオブジェクトが時間の経過と共に背景に対応するオブジェクトの前から取り除かれるように移動しているので、アンカバードバックグラウンド領域に属する画素の画素値に含まれる成分は、シャッタ時間に対応する期間のある時点で、前景の成分から、背景の成分に替わる。
【0088】
例えば、図15中に太線枠を付した画素値M'は、式(2)で表される。
【0089】
M'=F02/v+F01/v+B26/v+B26/v ・・・(2)
【0090】
例えば、左から5番目の画素は、3つのシャッタ時間/vに対応する背景の成分を含み、1つのシャッタ時間/vに対応する前景の成分を含むので、左から5番目の画素の混合比αは、3/4である。左から6番目の画素は、2つのシャッタ時間/vに対応する背景の成分を含み、2つのシャッタ時間/vに対応する前景の成分を含むので、左から6番目の画素の混合比αは、1/2である。左から7番目の画素は、1つのシャッタ時間/vに対応する背景の成分を含み、3つのシャッタ時間/vに対応する前景の成分を含むので、左から7番目の画素の混合比αは、1/4である。
【0091】
式(1)および式(2)をより一般化すると、画素値Mは、式(3)で表される。
【0092】
【数1】
・・・(3)
ここで、αは、混合比である。Bは、背景の画素値であり、Fi/vは、前景の成分である。
【0093】
前景に対応するオブジェクトが剛体であり、等速で動くと仮定でき、かつ、動き量vが4であるので、例えば、図15中の左から5番目の画素の、シャッタが開いて最初の、シャッタ時間/vの前景の成分F01/vは、図15中の左から6番目の画素の、シャッタが開いて2番目のシャッタ時間/vに対応する前景の成分に等しい。同様に、F01/vは、図15中の左から7番目の画素の、シャッタが開いて3番目のシャッタ時間/vに対応する前景の成分と、図15中の左から8番目の画素の、シャッタが開いて4番目のシャッタ時間/vに対応する前景の成分とに、それぞれ等しい。
【0094】
前景に対応するオブジェクトが剛体であり、等速で動くと仮定でき、かつ、仮想分割数が4であるので、例えば、図15中の左から6番目の画素の、シャッタが開いて最初の、シャッタ時間/vの前景の成分F02/vは、図15中の左から7番目の画素の、シャッタが開いて2番目のシャッタ時間/vに対応する前景の成分に等しい。同様に、前景の成分F02/vは、図15中の左から8番目の画素の、シャッタが開いて3番目のシャッタ時間/vに対応する前景の成分に等しい。
【0095】
前景に対応するオブジェクトが剛体であり、等速で動くと仮定でき、かつ、動き量vが4であるので、例えば、図15中の左から7番目の画素の、シャッタが開いて最初の、シャッタ時間/vの前景の成分F03/vは、図15中の左から8番目の画素の、シャッタが開いて2番目のシャッタ時間/vに対応する前景の成分に等しい。
【0096】
図13乃至図15の説明において、仮想分割数は、4であるとして説明したが、仮想分割数は、動き量vに対応する。動き量vは、一般に、前景に対応するオブジェクトの移動速度に対応する。例えば、前景に対応するオブジェクトが、あるフレームを基準として次のフレームにおいて4画素分右側に表示されるように移動しているとき、動き量vは、4とされる。動き量vに対応し、仮想分割数は、4とされる。同様に、例えば、前景に対応するオブジェクトが、あるフレームを基準として次のフレームにおいて6画素分左側に表示されるように移動しているとき、動き量vは、6とされ、仮想分割数は、6とされる。
【0097】
図16および図17に、以上で説明した、前景領域、背景領域、カバードバックグラウンド領域若しくはアンカバードバックグラウンド領域から成る混合領域と、分割されたシャッタ時間に対応する前景の成分および背景の成分との関係を示す。
【0098】
図16は、静止している背景の前を移動しているオブジェクトに対応する前景を含む画像から、前景領域、背景領域、および混合領域の画素を抽出した例を示す。図16に示す例において、前景に対応するオブジェクトは、画面に対して水平に移動している。
【0099】
フレーム#n+1は、フレーム#nの次のフレームであり、フレーム#n+2は、フレーム#n+1の次のフレームである。
【0100】
フレーム#n乃至フレーム#n+2のいずれかから抽出した、前景領域、背景領域、および混合領域の画素を抽出して、動き量vを4として、抽出された画素の画素値を時間方向に展開したモデルを図17に示す。
【0101】
前景領域の画素値は、前景に対応するオブジェクトが移動するので、シャッタ時間/vの期間に対応する、4つの異なる前景の成分から構成される。例えば、図17に示す前景領域の画素のうち最も左側に位置する画素は、F01/v,F02/v,F03/v、およびF04/vから構成される。すなわち、前景領域の画素は、動きボケを含んでいる。
【0102】
背景に対応するオブジェクトが静止しているので、シャッタ時間に対応する期間において、センサに入力される背景に対応する光は変化しない。この場合、背景領域の画素値は、動きボケを含まない。
【0103】
カバードバックグラウンド領域若しくはアンカバードバックグラウンド領域から成る混合領域に属する画素の画素値は、前景の成分と、背景の成分とから構成される。
【0104】
次に、オブジェクトに対応する画像が動いているとき、複数のフレームにおける、隣接して1列に並んでいる画素であって、フレーム上で同一の位置の画素の画素値を時間方向に展開したモデルについて説明する。例えば、オブジェクトに対応する画像が画面に対して水平に動いているとき、隣接して1列に並んでいる画素として、画面の1つのライン上に並んでいる画素を選択することができる。
【0105】
図18は、静止している背景に対応するオブジェクトを撮像した画像の3つのフレームの、隣接して1列に並んでいる画素であって、フレーム上で同一の位置の画素の画素値を時間方向に展開したモデル図である。フレーム#nは、フレーム#n-1の次のフレームであり、フレーム#n+1は、フレーム#nの次のフレームである。他のフレームも同様に称する。
【0106】
図18に示すB01乃至B12の画素値は、静止している背景のオブジェクトに対応する画素の画素値である。背景に対応するオブジェクトが静止しているので、フレーム#n-1乃至フレームn+1において、対応する画素の画素値は、変化しない。例えば、フレーム#n-1におけるB05の画素値を有する画素の位置に対応する、フレーム#nにおける画素、およびフレーム#n+1における画素は、それぞれ、B05の画素値を有する。
【0107】
図19は、静止している背景に対応するオブジェクトと共に図中の右側に移動する前景に対応するオブジェクトを撮像した画像の3つのフレームの、隣接して1列に並んでいる画素であって、フレーム上で同一の位置の画素の画素値を時間方向に展開したモデル図である。図19に示すモデルは、カバードバックグラウンド領域を含む。
【0108】
図19において、前景に対応するオブジェクトが、剛体であり、等速で移動すると仮定でき、前景の画像が次のフレームにおいて4画素右側に表示されるように移動するので、前景の動き量vは、4であり、仮想分割数は、4である。
【0109】
例えば、図19中のフレーム#n-1の最も左側の画素の、シャッタが開いて最初のシャッタ時間/vの前景の成分は、F12/vとなり、図19中の左から2番目の画素の、シャッタが開いて2番目のシャッタ時間/vの前景の成分も、F12/vとなる。図19中の左から3番目の画素の、シャッタが開いて3番目のシャッタ時間/vの前景の成分、および図19中の左から4番目の画素の、シャッタが開いて4番目のシャッタ時間/vの前景の成分は、F12/vとなる。
【0110】
図19中のフレーム#n-1の最も左側の画素の、シャッタが開いて2番目のシャッタ時間/vの前景の成分は、F11/vとなり、図19中の左から2番目の画素の、シャッタが開いて3番目のシャッタ時間/vの前景の成分も、F11/vとなる。図19中の左から3番目の画素の、シャッタが開いて4番目のシャッタ時間/vの前景の成分は、F11/vとなる。
【0111】
図19中のフレーム#n-1の最も左側の画素の、シャッタが開いて3番目のシャッタ時間/vの前景の成分は、F10/vとなり、図19中の左から2番目の画素の、シャッタが開いて4番目のシャッタ時間/vの前景の成分も、F10/vとなる。図19中のフレーム#n-1の最も左側の画素の、シャッタが開いて4番目のシャッタ時間/vの前景の成分は、F09/vとなる。
【0112】
背景に対応するオブジェクトが静止しているので、図19中のフレーム#n-1の左から2番目の画素の、シャッタが開いて最初のシャッタ時間/vの背景の成分は、B01/vとなる。図19中のフレーム#n-1の左から3番目の画素の、シャッタが開いて最初および2番目のシャッタ時間/vの背景の成分は、B02/vとなる。図19中のフレーム#n-1の左から4番目の画素の、シャッタが開いて最初乃至3番目のシャッタ時間/vの背景の成分は、B03/vとなる。
【0113】
図19中のフレーム#n-1において、最も左側の画素は、前景領域に属し、左側から2番目乃至4番目の画素は、カバードバックグラウンド領域である混合領域に属する。
【0114】
図19中のフレーム#n-1の左から5番目の画素乃至12番目の画素は、背景領域に属し、その画素値は、それぞれ、B04乃至B11となる。
【0115】
図19中のフレーム#nの左から1番目の画素乃至5番目の画素は、前景領域に属する。フレーム#nの前景領域における、シャッタ時間/vの前景の成分は、F05/v乃至F12/vのいずれかである。
【0116】
前景に対応するオブジェクトが、剛体であり、等速で移動すると仮定でき、前景の画像が次のフレームにおいて4画素右側に表示されるように移動するので、図19中のフレーム#nの左から5番目の画素の、シャッタが開いて最初のシャッタ時間/vの前景の成分は、F12/vとなり、図19中の左から6番目の画素の、シャッタが開いて2番目のシャッタ時間/vの前景の成分も、F12/vとなる。図19中の左から7番目の画素の、シャッタが開いて3番目のシャッタ時間/vの前景の成分、および図19中の左から8番目の画素の、シャッタが開いて4番目のシャッタ時間/vの前景の成分は、F12/vとなる。
【0117】
図19中のフレーム#nの左から5番目の画素の、シャッタが開いて2番目のシャッタ時間/vの前景の成分は、F11/vとなり、図19中の左から6番目の画素の、シャッタが開いて3番目のシャッタ時間/vの前景の成分も、F11/vとなる。図19中の左から7番目の画素の、シャッタが開いて4番目のシャッタ時間/vの前景の成分は、F11/vとなる。
【0118】
図19中のフレーム#nの左から5番目の画素の、シャッタが開いて3番目のシャッタ時間/vの前景の成分は、F10/vとなり、図19中の左から6番目の画素の、シャッタが開いて4番目のシャッタ時間/vの前景の成分も、F10/vとなる。図19中のフレーム#nの左から5番目の画素の、シャッタが開いて4番目のシャッタ時間/vの前景の成分は、F09/vとなる。
【0119】
背景に対応するオブジェクトが静止しているので、図19中のフレーム#nの左から6番目の画素の、シャッタが開いて最初のシャッタ時間/vの背景の成分は、B05/vとなる。図19中のフレーム#nの左から7番目の画素の、シャッタが開いて最初および2番目のシャッタ時間/vの背景の成分は、B06/vとなる。図19中のフレーム#nの左から8番目の画素の、シャッタが開いて最初乃至3番目の、シャッタ時間/vの背景の成分は、B07/vとなる。
【0120】
図19中のフレーム#nにおいて、左側から6番目乃至8番目の画素は、カバードバックグラウンド領域である混合領域に属する。
【0121】
図19中のフレーム#nの左から9番目の画素乃至12番目の画素は、背景領域に属し、画素値は、それぞれ、B08乃至B11となる。
【0122】
図19中のフレーム#n+1の左から1番目の画素乃至9番目の画素は、前景領域に属する。フレーム#n+1の前景領域における、シャッタ時間/vの前景の成分は、F01/v乃至F12/vのいずれかである。
【0123】
前景に対応するオブジェクトが、剛体であり、等速で移動すると仮定でき、前景の画像が次のフレームにおいて4画素右側に表示されるように移動するので、図19中のフレーム#n+1の左から9番目の画素の、シャッタが開いて最初のシャッタ時間/vの前景の成分は、F12/vとなり、図19中の左から10番目の画素の、シャッタが開いて2番目のシャッタ時間/vの前景の成分も、F12/vとなる。図19中の左から11番目の画素の、シャッタが開いて3番目のシャッタ時間/vの前景の成分、および図19中の左から12番目の画素の、シャッタが開いて4番目のシャッタ時間/vの前景の成分は、F12/vとなる。
【0124】
図19中のフレーム#n+1の左から9番目の画素の、シャッタが開いて2番目のシャッタ時間/vの期間の前景の成分は、F11/vとなり、図19中の左から10番目の画素の、シャッタが開いて3番目のシャッタ時間/vの前景の成分も、F11/vとなる。図19中の左から11番目の画素の、シャッタが開いて4番目の、シャッタ時間/vの前景の成分は、F11/vとなる。
【0125】
図19中のフレーム#n+1の左から9番目の画素の、シャッタが開いて3番目の、シャッタ時間/vの前景の成分は、F10/vとなり、図19中の左から10番目の画素の、シャッタが開いて4番目のシャッタ時間/vの前景の成分も、F10/vとなる。図19中のフレーム#n+1の左から9番目の画素の、シャッタが開いて4番目のシャッタ時間/vの前景の成分は、F09/vとなる。
【0126】
背景に対応するオブジェクトが静止しているので、図19中のフレーム#n+1の左から10番目の画素の、シャッタが開いて最初のシャッタ時間/vの背景の成分は、B09/vとなる。図19中のフレーム#n+1の左から11番目の画素の、シャッタが開いて最初および2番目のシャッタ時間/vの背景の成分は、B10/vとなる。図19中のフレーム#n+1の左から12番目の画素の、シャッタが開いて最初乃至3番目の、シャッタ時間/vの背景の成分は、B11/vとなる。
【0127】
図19中のフレーム#n+1において、左側から10番目乃至12番目の画素は、カバードバックグラウンド領域である混合領域に対応する。
【0128】
図20は、図19に示す画素値から前景の成分を抽出した画像のモデル図である。
【0129】
図21は、静止している背景と共に図中の右側に移動するオブジェクトに対応する前景を撮像した画像の3つのフレームの、隣接して1列に並んでいる画素であって、フレーム上で同一の位置の画素の画素値を時間方向に展開したモデル図である。図21において、アンカバードバックグラウンド領域が含まれている。
【0130】
図21において、前景に対応するオブジェクトは、剛体であり、かつ等速で移動していると仮定できる。前景に対応するオブジェクトが、次のフレームにおいて4画素分右側に表示されるように移動しているので、動き量vは、4である。
【0131】
例えば、図21中のフレーム#n-1の最も左側の画素の、シャッタが開いて最初の、シャッタ時間/vの前景の成分は、F13/vとなり、図21中の左から2番目の画素の、シャッタが開いて2番目のシャッタ時間/vの前景の成分も、F13/vとなる。図21中の左から3番目の画素の、シャッタが開いて3番目のシャッタ時間/vの前景の成分、および図21中の左から4番目の画素の、シャッタが開いて4番目のシャッタ時間/vの前景の成分は、F13/vとなる。
【0132】
図21中のフレーム#n-1の左から2番目の画素の、シャッタが開いて最初のシャッタ時間/vの前景の成分は、F14/vとなり、図21中の左から3番目の画素の、シャッタが開いて2番目のシャッタ時間/vの前景の成分も、F14/vとなる。図21中の左から3番目の画素の、シャッタが開いて最初の、シャッタ時間/vの前景の成分は、F15/vとなる。
【0133】
背景に対応するオブジェクトが静止しているので、図21中のフレーム#n-1の最も左側の画素の、シャッタが開いて2番目乃至4番目の、シャッタ時間/vの背景の成分は、B25/vとなる。図21中のフレーム#n-1の左から2番目の画素の、シャッタが開いて3番目および4番目の、シャッタ時間/vの背景の成分は、B26/vとなる。図21中のフレーム#n-1の左から3番目の画素の、シャッタが開いて4番目のシャッタ時間/vの背景の成分は、B27/vとなる。
【0134】
図21中のフレーム#n-1において、最も左側の画素乃至3番目の画素は、アンカバードバックグラウンド領域である混合領域に属する。
【0135】
図21中のフレーム#n-1の左から4番目の画素乃至12番目の画素は、前景領域に属する。フレームの前景の成分は、F13/v乃至F24/vのいずれかである。
【0136】
図21中のフレーム#nの最も左側の画素乃至左から4番目の画素は、背景領域に属し、画素値は、それぞれ、B25乃至B28となる。
【0137】
前景に対応するオブジェクトが、剛体であり、等速で移動すると仮定でき、前景の画像が次のフレームにおいて4画素右側に表示されるように移動するので、図21中のフレーム#nの左から5番目の画素の、シャッタが開いて最初のシャッタ時間/vの前景の成分は、F13/vとなり、図21中の左から6番目の画素の、シャッタが開いて2番目のシャッタ時間/vの前景の成分も、F13/vとなる。図21中の左から7番目の画素の、シャッタが開いて3番目のシャッタ時間/vの前景の成分、および図21中の左から8番目の画素の、シャッタが開いて4番目のシャッタ時間/vの前景の成分は、F13/vとなる。
【0138】
図21中のフレーム#nの左から6番目の画素の、シャッタが開いて最初のシャッタ時間/vの前景の成分は、F14/vとなり、図21中の左から7番目の画素の、シャッタが開いて2番目のシャッタ時間/vの前景の成分も、F14/vとなる。図21中の左から8番目の画素の、シャッタが開いて最初のシャッタ時間/vの前景の成分は、F15/vとなる。
【0139】
背景に対応するオブジェクトが静止しているので、図21中のフレーム#nの左から5番目の画素の、シャッタが開いて2番目乃至4番目のシャッタ時間/vの背景の成分は、B29/vとなる。図21中のフレーム#nの左から6番目の画素の、シャッタが開いて3番目および4番目のシャッタ時間/vの背景の成分は、B30/vとなる。図21中のフレーム#nの左から7番目の画素の、シャッタが開いて4番目のシャッタ時間/vの背景の成分は、B31/vとなる。
【0140】
図21中のフレーム#nにおいて、左から5番目の画素乃至7番目の画素は、アンカバードバックグラウンド領域である混合領域に属する。
【0141】
図21中のフレーム#nの左から8番目の画素乃至12番目の画素は、前景領域に属する。フレーム#nの前景領域における、シャッタ時間/vの期間に対応する値は、F13/v乃至F20/vのいずれかである。
【0142】
図21中のフレーム#n+1の最も左側の画素乃至左から8番目の画素は、背景領域に属し、画素値は、それぞれ、B25乃至B32となる。
【0143】
前景に対応するオブジェクトが、剛体であり、等速で移動すると仮定でき、前景の画像が次のフレームにおいて4画素右側に表示されるように移動するので、図21中のフレーム#n+1の左から9番目の画素の、シャッタが開いて最初のシャッタ時間/vの前景の成分は、F13/vとなり、図21中の左から10番目の画素の、シャッタが開いて2番目のシャッタ時間/vの前景の成分も、F13/vとなる。図21中の左から11番目の画素の、シャッタが開いて3番目のシャッタ時間/vの前景の成分、および図21中の左から12番目の画素の、シャッタが開いて4番目のシャッタ時間/vの前景の成分は、F13/vとなる。
【0144】
図21中のフレーム#n+1の左から10番目の画素の、シャッタが開いて最初のシャッタ時間/vの前景の成分は、F14/vとなり、図21中の左から11番目の画素の、シャッタが開いて2番目のシャッタ時間/vの前景の成分も、F14/vとなる。図21中の左から12番目の画素の、シャッタが開いて最初のシャッタ時間/vの前景の成分は、F15/vとなる。
【0145】
背景に対応するオブジェクトが静止しているので、図21中のフレーム#n+1の左から9番目の画素の、シャッタが開いて2番目乃至4番目の、シャッタ時間/vの背景の成分は、B33/vとなる。図21中のフレーム#n+1の左から10番目の画素の、シャッタが開いて3番目および4番目のシャッタ時間/vの背景の成分は、B34/vとなる。図21中のフレーム#n+1の左から11番目の画素の、シャッタが開いて4番目のシャッタ時間/vの背景の成分は、B35/vとなる。
【0146】
図21中のフレーム#n+1において、左から9番目の画素乃至11番目の画素は、アンカバードバックグラウンド領域である混合領域に属する。
【0147】
図21中のフレーム#n+1の左から12番目の画素は、前景領域に属する。フレーム#n+1の前景領域における、シャッタ時間/vの前景の成分は、F13/v乃至F16/vのいずれかである。
【0148】
図22は、図21に示す画素値から前景の成分を抽出した画像のモデル図である。
【0149】
図6に戻り、領域特定部103は、複数のフレームの画素値を用いて、前景領域、背景領域、カバードバックグラウンド領域、またはアンカバードバックグラウンド領域に属することを示すフラグを画素毎に対応付けて、領域情報として、混合比算出部104および動きボケ除去部106に供給する。
【0150】
混合比算出部104は、複数のフレームの画素値、および領域情報を基に、混合領域に含まれる画素について画素毎に混合比αを算出し、算出した混合比αを前景背景分離部105に供給する。
【0151】
前景背景分離部105は、複数のフレームの画素値、領域情報、および混合比αを基に、前景の成分のみからなる前景成分画像を抽出して、動きボケ除去部106に供給する。
【0152】
動きボケ除去部106は、前景背景分離部105から供給された前景成分画像、動き検出部102から供給された動きベクトル、および領域特定部103から供給された領域情報を基に、前景成分画像に含まれる動きボケを除去して、動きボケを除去した前景成分画像を出力する。
【0153】
図23のフローチャートを参照して、画像処理部による合成画像生成の処理を説明する。ステップS11において、領域特定部103は、入力画像を基に、入力画像の画素毎に前景領域、背景領域、カバードバックグラウンド領域、またはアンカバードバックグラウンド領域のいずれかに属するかを示す領域情報を生成する領域特定の処理を実行する。領域特定の処理の詳細は、後述する。領域特定部103は、生成した領域情報を混合比算出部104に供給する。
【0154】
なお、ステップS11において、領域特定部103は、入力画像を基に、入力画像の画素毎に前景領域、背景領域、または混合領域(カバードバックグラウンド領域、またはアンカバードバックグラウンド領域の区別をしない)のいずれかに属するかを示す領域情報を生成するようにしてもよい。この場合において、前景背景分離部105および動きボケ除去部106は、動きベクトルの方向を基に、混合領域がカバードバックグラウンド領域であるか、またはアンカバードバックグラウンド領域であるかを判定する。例えば、動きベクトルの方向に対応して、前景領域、混合領域、および背景領域と順に並んでいるとき、その混合領域は、カバードバックグラウンド領域と判定され、動きベクトルの方向に対応して、背景領域、混合領域、および前景領域と順に並んでいるとき、その混合領域は、アンカバードバックグラウンド領域と判定される。
【0155】
ステップS12において、混合比算出部104は、入力画像および領域情報を基に、混合領域に含まれる画素毎に、混合比αを算出する。混合比算出の処理の詳細は、後述する。混合比算出部104は、算出した混合比αを前景背景分離部105に供給する。
【0156】
ステップS13において、前景背景分離部105は、領域情報、および混合比αを基に、入力画像から前景の成分を抽出して、前景成分画像として動きボケ除去部106に供給する。
【0157】
ステップS14において、動きボケ除去部106は、動きベクトルおよび領域情報を基に、動き方向に並ぶ連続した画素であって、アンカバードバックグラウンド領域、前景領域、およびカバードバックグラウンド領域のいずれかに属するものの画像上の位置を示す処理単位を生成し、処理単位に対応する前景成分に含まれる動きボケの量を除去する。動きボケの除去の処理の詳細については、後述する。
【0158】
ステップS15において、画像処理部は、画面全体について処理を終了したか否かを判定し、画面全体について処理を終了していないと判定された場合、ステップS14に進み、処理単位に対応する前景の成分を対象とした動きボケの除去の処理を繰り返す。
【0159】
ステップS15において、画面全体について処理を終了したと判定された場合、ステップS16において、合成部107は、前景成分画像と任意の背景画像を合成し、合成画像を生成して出力する。尚、合成画像の生成処理については、詳細を後述する。
【0160】
このように、画像処理部は、前景と背景を分離して、前景に含まれる動きボケを除去し、任意の背景画像と合成することができる。
【0161】
以下、領域特定部103、混合比算出部104、前景背景分離部105、および動きボケ除去部106のそれぞれの構成について説明する。
【0162】
図24は、領域特定部103の構成を示すブロック図である。図24に構成を示す領域特定部103は、動きベクトルを利用しない。フレームメモリ201は、入力された画像をフレーム単位で記憶する。フレームメモリ201は、処理の対象がフレーム#nであるとき、フレーム#nの2つ前のフレームであるフレーム#n-2、フレーム#nの1つ前のフレームであるフレーム#n-1、フレーム#n、フレーム#nの1つ後のフレームであるフレーム#n+1、およびフレーム#nの2つ後のフレームであるフレーム#n+2を記憶する。
【0163】
静動判定部202−1は、フレーム#nの領域特定の対象である画素の画像上の位置と同一の位置にあるフレーム#n+2の画素の画素値、およびフレーム#nの領域特定の対象である画素の画像上の位置と同一の位置にあるフレーム#n+1の画素の画素値をフレームメモリ201から読み出して、読み出した画素値の差の絶対値を算出する。静動判定部202−1は、フレーム#n+2の画素値とフレーム#n+1の画素値との差の絶対値が、予め設定している閾値Thより大きいか否かを判定し、差の絶対値が閾値Thより大きいと判定された場合、動きを示す静動判定を領域判定部203−1に供給する。フレーム#n+2の画素の画素値とフレーム#n+1の画素の画素値との差の絶対値が閾値Th以下であると判定された場合、静動判定部202−1は、静止を示す静動判定を領域判定部203−1に供給する。
【0164】
静動判定部202−2は、フレーム#nの領域特定の対象である画素の画像上の位置と同一の位置にあるフレーム#n+1の画素の画素値、およびフレーム#nの対象となる画素の画素値をフレームメモリ201から読み出して、画素値の差の絶対値を算出する。静動判定部202−2は、フレーム#n+1の画素値とフレーム#nの画素値との差の絶対値が、予め設定している閾値Thより大きいか否かを判定し、画素値の差の絶対値が、閾値Thより大きいと判定された場合、動きを示す静動判定を領域判定部203−1および領域判定部203−2に供給する。フレーム#n+1の画素の画素値とフレーム#nの画素の画素値との差の絶対値が、閾値Th以下であると判定された場合、静動判定部202−2は、静止を示す静動判定を領域判定部203−1および領域判定部203−2に供給する。
【0165】
静動判定部202−3は、フレーム#nの領域特定の対象である画素の画素値、およびフレーム#nの領域特定の対象である画素の画像上の位置と同一の位置にあるフレーム#n-1の画素の画素値をフレームメモリ201から読み出して、画素値の差の絶対値を算出する。静動判定部202−3は、フレーム#nの画素値とフレーム#n-1の画素値との差の絶対値が、予め設定している閾値Thより大きいか否かを判定し、画素値の差の絶対値が、閾値Thより大きいと判定された場合、動きを示す静動判定を領域判定部203−2および領域判定部203−3に供給する。フレーム#nの画素の画素値とフレーム#n-1の画素の画素値との差の絶対値が、閾値Th以下であると判定された場合、静動判定部202−3は、静止を示す静動判定を領域判定部203−2および領域判定部203−3に供給する。
【0166】
静動判定部202−4は、フレーム#nの領域特定の対象である画素の画像上の位置と同一の位置にあるフレーム#n-1の画素の画素値、およびフレーム#nの領域特定の対象である画素の画像上の位置と同一の位置にあるフレーム#n-2の画素の画素値をフレームメモリ201から読み出して、画素値の差の絶対値を算出する。静動判定部202−4は、フレーム#n-1の画素値とフレーム#n-2の画素値との差の絶対値が、予め設定している閾値Thより大きいか否かを判定し、画素値の差の絶対値が、閾値Thより大きいと判定された場合、動きを示す静動判定を領域判定部203−3に供給する。フレーム#n-1の画素の画素値とフレーム#n-2の画素の画素値との差の絶対値が、閾値Th以下であると判定された場合、静動判定部202−4は、静止を示す静動判定を領域判定部203−3に供給する。
【0167】
領域判定部203−1は、静動判定部202−1から供給された静動判定が静止を示し、かつ、静動判定部202−2から供給された静動判定が動きを示しているとき、フレーム#nにおける領域特定の対象である画素がアンカバードバックグラウンド領域に属すると判定し、領域の判定される画素に対応するアンカバードバックグラウンド領域判定フラグに、アンカバードバックグラウンド領域に属することを示す”1”を設定する。
【0168】
領域判定部203−1は、静動判定部202−1から供給された静動判定が動きを示すか、または、静動判定部202−2から供給された静動判定が静止を示しているとき、フレーム#nにおける領域特定の対象である画素がアンカバードバックグラウンド領域に属しないと判定し、領域の判定される画素に対応するアンカバードバックグラウンド領域判定フラグに、アンカバードバックグラウンド領域に属しないことを示す”0”を設定する。
【0169】
領域判定部203−1は、このように”1”または”0”が設定されたアンカバードバックグラウンド領域判定フラグを判定フラグ格納フレームメモリ204に供給する。
【0170】
領域判定部203−2は、静動判定部202−2から供給された静動判定が静止を示し、かつ、静動判定部202−3から供給された静動判定が静止を示しているとき、フレーム#nにおける領域特定の対象である画素が静止領域に属すると判定し、領域の判定される画素に対応する静止領域判定フラグに、静止領域に属することを示す”1”を設定する。
【0171】
領域判定部203−2は、静動判定部202−2から供給された静動判定が動きを示すか、または、静動判定部202−3から供給された静動判定が動きを示しているとき、フレーム#nにおける領域特定の対象である画素が静止領域に属しないと判定し、領域の判定される画素に対応する静止領域判定フラグに、静止領域に属しないことを示す”0”を設定する。
【0172】
領域判定部203−2は、このように”1”または”0”が設定された静止領域判定フラグを判定フラグ格納フレームメモリ204に供給する。
【0173】
領域判定部203−2は、静動判定部202−2から供給された静動判定が動きを示し、かつ、静動判定部202−3から供給された静動判定が動きを示しているとき、フレーム#nにおける領域特定の対象である画素が動き領域に属すると判定し、領域の判定される画素に対応する動き領域判定フラグに、動き領域に属することを示す”1”を設定する。
【0174】
領域判定部203−2は、静動判定部202−2から供給された静動判定が静止を示すか、または、静動判定部202−3から供給された静動判定が静止を示しているとき、フレーム#nにおける領域特定の対象である画素が動き領域に属しないと判定し、領域の判定される画素に対応する動き領域判定フラグに、動き領域に属しないことを示す”0”を設定する。
【0175】
領域判定部203−2は、このように”1”または”0”が設定された動き領域判定フラグを判定フラグ格納フレームメモリ204に供給する。
【0176】
領域判定部203−3は、静動判定部202−3から供給された静動判定が動きを示し、かつ、静動判定部202−4から供給された静動判定が静止を示しているとき、フレーム#nにおける領域特定の対象である画素がカバードバックグラウンド領域に属すると判定し、領域の判定される画素に対応するカバードバックグラウンド領域判定フラグに、カバードバックグラウンド領域に属することを示す”1”を設定する。
【0177】
領域判定部203−3は、静動判定部202−3から供給された静動判定が静止を示すか、または、静動判定部202−4から供給された静動判定が動きを示しているとき、フレーム#nにおける領域特定の対象である画素がカバードバックグラウンド領域に属しないと判定し、領域の判定される画素に対応するカバードバックグラウンド領域判定フラグに、カバードバックグラウンド領域に属しないことを示す”0”を設定する。
【0178】
領域判定部203−3は、このように”1”または”0”が設定されたカバードバックグラウンド領域判定フラグを判定フラグ格納フレームメモリ204に供給する。
【0179】
判定フラグ格納フレームメモリ204は、領域判定部203−1から供給されたアンカバードバックグラウンド領域判定フラグ、領域判定部203−2から供給された静止領域判定フラグ、領域判定部203−2から供給された動き領域判定フラグ、および領域判定部203−3から供給されたカバードバックグラウンド領域判定フラグをそれぞれ記憶する。
【0180】
判定フラグ格納フレームメモリ204は、記憶しているアンカバードバックグラウンド領域判定フラグ、静止領域判定フラグ、動き領域判定フラグ、およびカバードバックグラウンド領域判定フラグを合成部205に供給する。合成部205は、判定フラグ格納フレームメモリ204から供給された、アンカバードバックグラウンド領域判定フラグ、静止領域判定フラグ、動き領域判定フラグ、およびカバードバックグラウンド領域判定フラグを基に、各画素が、アンカバードバックグラウンド領域、静止領域、動き領域、およびカバードバックグラウンド領域のいずれかに属することを示す領域情報を生成し、判定フラグ格納フレームメモリ206に供給する。
【0181】
判定フラグ格納フレームメモリ206は、合成部205から供給された領域情報を記憶すると共に、記憶している領域情報を出力する。
【0182】
次に、領域特定部103の処理の例を図25乃至図29を参照して説明する。
【0183】
前景に対応するオブジェクトが移動しているとき、オブジェクトに対応する画像の画面上の位置は、フレーム毎に変化する。図25に示すように、フレーム#nにおいて、Yn(x,y)で示される位置に位置するオブジェクトに対応する画像は、次のフレームであるフレーム#n+1において、Yn+1(x,y)に位置する。
【0184】
前景のオブジェクトに対応する画像の動き方向に隣接して1列に並ぶ画素の画素値を時間方向に展開したモデル図を図26に示す。例えば、前景のオブジェクトに対応する画像の動き方向が画面に対して水平であるとき、図26におけるモデル図は、1つのライン上の隣接する画素の画素値を時間方向に展開したモデルを示す。
【0185】
図26において、フレーム#nにおけるラインは、フレーム#n+1におけるラインと同一である。
【0186】
フレーム#nにおいて、左から2番目の画素乃至13番目の画素に含まれているオブジェクトに対応する前景の成分は、フレーム#n+1において、左から6番目乃至17番目の画素に含まれる。
【0187】
フレーム#nにおいて、カバードバックグラウンド領域に属する画素は、左から11番目乃至13番目の画素であり、アンカバードバックグラウンド領域に属する画素は、左から2番目乃至4番目の画素である。フレーム#n+1において、カバードバックグラウンド領域に属する画素は、左から15番目乃至17番目の画素であり、アンカバードバックグラウンド領域に属する画素は、左から6番目乃至8番目の画素である。
【0188】
図26に示す例において、フレーム#nに含まれる前景の成分が、フレーム#n+1において4画素移動しているので、動き量vは、4である。仮想分割数は、動き量vに対応し、4である。
【0189】
次に、注目しているフレームの前後における混合領域に属する画素の画素値の変化について説明する。
【0190】
図27に示す、背景が静止し、前景の動き量vが4であるフレーム#nにおいて、カバードバックグラウンド領域に属する画素は、左から15番目乃至17番目の画素である。動き量vが4であるので、1つ前のフレーム#n-1において、左から15番目乃至17番目の画素は、背景の成分のみを含み、背景領域に属する。また、更に1つ前のフレーム#n-2において、左から15番目乃至17番目の画素は、背景の成分のみを含み、背景領域に属する。
【0191】
ここで、背景に対応するオブジェクトが静止しているので、フレーム#n-1の左から15番目の画素の画素値は、フレーム#n-2の左から15番目の画素の画素値から変化しない。同様に、フレーム#n-1の左から16番目の画素の画素値は、フレーム#n-2の左から16番目の画素の画素値から変化せず、フレーム#n-1の左から17番目の画素の画素値は、フレーム#n-2の左から17番目の画素の画素値から変化しない。
【0192】
すなわち、フレーム#nにおけるカバードバックグラウンド領域に属する画素に対応する、フレーム#n-1およびフレーム#n-2の画素は、背景の成分のみから成り、画素値が変化しないので、その差の絶対値は、ほぼ0の値となる。従って、フレーム#nにおける混合領域に属する画素に対応する、フレーム#n-1およびフレーム#n-2の画素に対する静動判定は、静動判定部202−4により、静止と判定される。
【0193】
フレーム#nにおけるカバードバックグラウンド領域に属する画素は、前景の成分を含むので、フレーム#n-1における背景の成分のみから成る場合と、画素値が異なる。従って、フレーム#nにおける混合領域に属する画素、および対応するフレーム#n-1の画素に対する静動判定は、静動判定部202−3により、動きと判定される。
【0194】
このように、領域判定部203−3は、静動判定部202−3から動きを示す静動判定の結果が供給され、静動判定部202−4から静止を示す静動判定の結果が供給されたとき、対応する画素がカバードバックグラウンド領域に属すると判定する。
【0195】
図28に示す、背景が静止し、前景の動き量vが4であるフレーム#nにおいて、アンカバードバックグラウンド領域に含まれる画素は、左から2番目乃至4番目の画素である。動き量vが4であるので、1つ後のフレーム#n+1において、左から2番目乃至4番目の画素は、背景の成分のみを含み、背景領域に属する。また、更に1つ後のフレーム#n+2において、左から2番目乃至4番目の画素は、背景の成分のみを含み、背景領域に属する。
【0196】
ここで、背景に対応するオブジェクトが静止しているので、フレーム#n+2の左から2番目の画素の画素値は、フレーム#n+1の左から2番目の画素の画素値から変化しない。同様に、フレーム#n+2の左から3番目の画素の画素値は、フレーム#n+1の左から3番目の画素の画素値から変化せず、フレーム#n+2の左から4番目の画素の画素値は、フレーム#n+1の左から4番目の画素の画素値から変化しない。
【0197】
すなわち、フレーム#nにおけるアンカバードバックグラウンド領域に属する画素に対応する、フレーム#n+1およびフレーム#n+2の画素は、背景の成分のみから成り、画素値が変化しないので、その差の絶対値は、ほぼ0の値となる。従って、フレーム#nにおける混合領域に属する画素に対応する、フレーム#n+1およびフレーム#n+2の画素に対する静動判定は、静動判定部202−1により、静止と判定される。
【0198】
フレーム#nにおけるアンカバードバックグラウンド領域に属する画素は、前景の成分を含むので、フレーム#n+1における背景の成分のみから成る場合と、画素値が異なる。従って、フレーム#nにおける混合領域に属する画素、および対応するフレーム#n+1の画素に対する静動判定は、静動判定部202−2により、動きと判定される。
【0199】
このように、領域判定部203−1は、静動判定部202−2から動きを示す静動判定の結果が供給され、静動判定部202−1から静止を示す静動判定の結果が供給されたとき、対応する画素がアンカバードバックグラウンド領域に属すると判定する。
【0200】
図29は、フレーム#nにおける領域特定部103の判定条件を示す図である。フレーム#nの判定の対象となる画素の画像上の位置と同一の位置にあるフレーム#n-2の画素と、フレーム#nの判定の対象となる画素の画像上の位置と同一の位置にあるフレーム#n-1の画素とが静止と判定され、フレーム#nの判定の対象となる画素の画像上の位置と同一の位置にあるフレーム#n-1の画素と、フレーム#nの画素とが動きと判定されたとき、領域特定部103は、フレーム#nの判定の対象となる画素がカバードバックグラウンド領域に属すると判定する。
【0201】
フレーム#nの判定の対象となる画素の画像上の位置と同一の位置にあるフレーム#n-1の画素と、フレーム#nの画素とが静止と判定され、フレーム#nの画素と、フレーム#nの判定の対象となる画素の画像上の位置と同一の位置にあるフレーム#n+1の画素とが静止と判定されたとき、領域特定部103は、フレーム#nの判定の対象となる画素が静止領域に属すると判定する。
【0202】
フレーム#nの判定の対象となる画素の画像上の位置と同一の位置にあるフレーム#n-1の画素と、フレーム#nの画素とが動きと判定され、フレーム#nの画素と、フレーム#nの判定の対象となる画素の画像上の位置と同一の位置にあるフレーム#n+1の画素とが動きと判定されたとき、領域特定部103は、フレーム#nの判定の対象となる画素が動き領域に属すると判定する。
【0203】
フレーム#nの画素と、フレーム#nの判定の対象となる画素の画像上の位置と同一の位置にあるフレーム#n+1の画素とが動きと判定され、フレーム#nの判定の対象となる画素の画像上の位置と同一の位置にあるフレーム#n+1の画素と、フレーム#nの判定の対象となる画素の画像上の位置と同一の位置にあるフレーム#n+2の画素とが静止と判定されたとき、領域特定部103は、フレーム#nの判定の対象となる画素がアンカバードバックグラウンド領域に属すると判定する。
【0204】
図26は、領域特定部103の領域の特定の結果の例を示す図である。図30Aにおいて、カバードバックグラウンド領域に属すると判定された画素は、白で表示されている。図30Bにおいて、アンカバードバックグラウンド領域に属すると判定された画素は、白で表示されている。
【0205】
図30Cにおいて、動き領域に属すると判定された画素は、白で表示されている。図30Dにおいて、静止領域に属すると判定された画素は、白で表示されている。
【0206】
図31は、判定フラグ格納フレームメモリ206が出力する領域情報の内、混合領域を示す領域情報を画像として示す図である。図31において、カバードバックグラウンド領域またはアンカバードバックグラウンド領域に属すると判定された画素、すなわち混合領域に属すると判定された画素は、白で表示されている。判定フラグ格納フレームメモリ206が出力する混合領域を示す領域情報は、混合領域、および前景領域内のテクスチャの無い部分に囲まれたテクスチャの有る部分を示す。
【0207】
次に、図32のフローチャートを参照して、領域特定部103の領域特定の処理を説明する。ステップS201において、フレームメモリ201は、判定の対象となるフレーム#nを含むフレーム#n-2乃至フレーム#n+2の画像を取得する。
【0208】
ステップS202において、静動判定部202−3は、フレーム#n-1の画素とフレーム#nの同一位置の画素とで、静止か否かを判定し、静止と判定された場合、ステップS203に進み、静動判定部202−2は、フレーム#nの画素とフレーム#n+1の同一位置の画素とで、静止か否かを判定する。
【0209】
ステップS203において、フレーム#nの画素とフレーム#n+1の同一位置の画素とで、静止と判定された場合、ステップS204に進み、領域判定部203−2は、領域の判定される画素に対応する静止領域判定フラグに、静止領域に属することを示す”1”を設定する。領域判定部203−2は、静止領域判定フラグを判定フラグ格納フレームメモリ204に供給し、手続きは、ステップS205に進む。
【0210】
ステップS202において、フレーム#n-1の画素とフレーム#nの同一位置の画素とで、動きと判定された場合、または、ステップS203において、フレーム#nの画素とフレーム#n+1の同一位置の画素とで、動きと判定された場合、フレーム#nの画素が静止領域には属さないので、ステップS204の処理はスキップされ、手続きは、ステップS205に進む。
【0211】
ステップS205において、静動判定部202−3は、フレーム#n-1の画素とフレーム#nの同一位置の画素とで、動きか否かを判定し、動きと判定された場合、ステップS206に進み、静動判定部202−2は、フレーム#nの画素とフレーム#n+1の同一位置の画素とで、動きか否かを判定する。
【0212】
ステップS206において、フレーム#nの画素とフレーム#n+1の同一位置の画素とで、動きと判定された場合、ステップS207に進み、領域判定部203−2は、領域の判定される画素に対応する動き領域判定フラグに、動き領域に属することを示す”1”を設定する。領域判定部203−2は、動き領域判定フラグを判定フラグ格納フレームメモリ204に供給し、手続きは、ステップS208に進む。
【0213】
ステップS205において、フレーム#n-1の画素とフレーム#nの同一位置の画素とで、静止と判定された場合、または、ステップS206において、フレーム#nの画素とフレーム#n+1の同一位置の画素とで、静止と判定された場合、フレーム#nの画素が動き領域には属さないので、ステップS207の処理はスキップされ、手続きは、ステップS208に進む。
【0214】
ステップS208において、静動判定部202−4は、フレーム#n-2の画素とフレーム#n-1の同一位置の画素とで、静止か否かを判定し、静止と判定された場合、ステップS209に進み、静動判定部202−3は、フレーム#n-1の画素とフレーム#nの同一位置の画素とで、動きか否かを判定する。
【0215】
ステップS209において、フレーム#n-1の画素とフレーム#nの同一位置の画素とで、動きと判定された場合、ステップS210に進み、領域判定部203−3は、領域の判定される画素に対応するカバードバックグラウンド領域判定フラグに、カバードバックグラウンド領域に属することを示す”1”を設定する。領域判定部203−3は、カバードバックグラウンド領域判定フラグを判定フラグ格納フレームメモリ204に供給し、手続きは、ステップS211に進む。
【0216】
ステップS208において、フレーム#n-2の画素とフレーム#n-1の同一位置の画素とで、動きと判定された場合、または、ステップS209において、フレーム#n-1の画素とフレーム#nの同一位置の画素とで、静止と判定された場合、フレーム#nの画素がカバードバックグラウンド領域には属さないので、ステップS210の処理はスキップされ、手続きは、ステップS211に進む。
【0217】
ステップS211において、静動判定部202−2は、フレーム#nの画素とフレーム#n+1の同一位置の画素とで、動きか否かを判定し、動きと判定された場合、ステップS212に進み、静動判定部202−1は、フレーム#n+1の画素とフレーム#n+2の同一位置の画素とで、静止か否かを判定する。
【0218】
ステップS212において、フレーム#n+1の画素とフレーム#n+2の同一位置の画素とで、静止と判定された場合、ステップS213に進み、領域判定部203−1は、領域の判定される画素に対応するアンカバードバックグラウンド領域判定フラグに、アンカバードバックグラウンド領域に属することを示す”1”を設定する。領域判定部203−1は、アンカバードバックグラウンド領域判定フラグを判定フラグ格納フレームメモリ204に供給し、手続きは、ステップS214に進む。
【0219】
ステップS211において、フレーム#nの画素とフレーム#n+1の同一位置の画素とで、静止と判定された場合、または、ステップS212において、フレーム#n+1の画素とフレーム#n+2の同一位置の画素とで、動きと判定された場合、フレーム#nの画素がアンカバードバックグラウンド領域には属さないので、ステップS213の処理はスキップされ、手続きは、ステップS214に進む。
【0220】
ステップS214において、領域特定部103は、フレーム#nの全ての画素について領域を特定したか否かを判定し、フレーム#nの全ての画素について領域を特定していないと判定された場合、手続きは、ステップS202に戻り、他の画素について、領域特定の処理を繰り返す。
【0221】
ステップS214において、フレーム#nの全ての画素について領域を特定したと判定された場合、ステップS215に進み、合成部205は、判定フラグ格納フレームメモリ204に記憶されているアンカバードバックグラウンド領域判定フラグ、およびカバードバックグラウンド領域判定フラグを基に、混合領域を示す領域情報を生成し、更に、各画素が、アンカバードバックグラウンド領域、静止領域、動き領域、およびカバードバックグラウンド領域のいずれかに属することを示す領域情報を生成し、生成した領域情報を判定フラグ格納フレームメモリ206に設定し、処理は終了する。
【0222】
このように、領域特定部103は、フレームに含まれている画素のそれぞれについて、動き領域、静止領域、アンカバードバックグラウンド領域、またはカバードバックグラウンド領域に属することを示す領域情報を生成することができる。
【0223】
なお、領域特定部103は、アンカバードバックグラウンド領域およびカバードバックグラウンド領域に対応する領域情報に論理和を適用することにより、混合領域に対応する領域情報を生成して、フレームに含まれている画素のそれぞれについて、動き領域、静止領域、または混合領域に属することを示すフラグから成る領域情報を生成するようにしてもよい。
【0224】
前景に対応するオブジェクトがテクスチャを有す場合、領域特定部103は、より正確に動き領域を特定することができる。
【0225】
領域特定部103は、動き領域を示す領域情報を前景領域を示す領域情報として、また、静止領域を示す領域情報を背景領域を示す領域情報として出力することができる。
【0226】
なお、背景に対応するオブジェクトが静止しているとして説明したが、背景領域に対応する画像が動きを含んでいても上述した領域を特定する処理を適用することができる。例えば、背景領域に対応する画像が一様に動いているとき、領域特定部103は、この動きに対応して画像全体をシフトさせ、背景に対応するオブジェクトが静止している場合と同様に処理する。また、背景領域に対応する画像が局所毎に異なる動きを含んでいるとき、領域特定部103は、動きに対応した画素を選択して、上述の処理を実行する。
【0227】
図33は、領域特定部103の構成を示すブロック図である。図33に示す領域特定部103は、動きベクトルを使用しない。背景画像生成部301は、入力画像に対応する背景画像を生成し、生成した背景画像を2値オブジェクト画像抽出部302に供給する。背景画像生成部301は、例えば、入力画像に含まれる背景のオブジェクトに対応する画像オブジェクトを抽出して、背景画像を生成する。
【0228】
前景のオブジェクトに対応する画像の動き方向に隣接して1列に並ぶ画素の画素値を時間方向に展開したモデル図の例を図34に示す。例えば、前景のオブジェクトに対応する画像の動き方向が画面に対して水平であるとき、図34におけるモデル図は、1つのライン上の隣接する画素の画素値を時間方向に展開したモデルを示す。
【0229】
図34において、フレーム#nにおけるラインは、フレーム#n-1およびフレーム#n+1におけるラインと同一である。
【0230】
フレーム#nにおいて、左から6番目の画素乃至17番目の画素に含まれているオブジェクトに対応する前景の成分は、フレーム#n-1において、左から2番目乃至13番目の画素に含まれ、フレーム#n+1において、左から10番目乃至21番目の画素に含まれる。
【0231】
フレーム#n-1において、カバードバックグラウンド領域に属する画素は、左から11番目乃至13番目の画素であり、アンカバードバックグラウンド領域に属する画素は、左から2番目乃至4番目の画素である。フレーム#nにおいて、カバードバックグラウンド領域に属する画素は、左から15番目乃至17番目の画素であり、アンカバードバックグラウンド領域に属する画素は、左から6番目乃至8番目の画素である。フレーム#n+1において、カバードバックグラウンド領域に属する画素は、左から19番目乃至21番目の画素であり、アンカバードバックグラウンド領域に属する画素は、左から10番目乃至12番目の画素である。
【0232】
フレーム#n-1において、背景領域に属する画素は、左から1番目の画素、および左から14番目乃至21番目の画素である。フレーム#nにおいて、背景領域に属する画素は、左から1番目乃至5番目の画素、および左から18番目乃至21番目の画素である。フレーム#n+1において、背景領域に属する画素は、左から1番目乃至9番目の画素である。
【0233】
背景画像生成部301が生成する、図34の例に対応する背景画像の例を図35に示す。背景画像は、背景のオブジェクトに対応する画素から構成され、前景のオブジェクトに対応する画像の成分を含まない。
【0234】
2値オブジェクト画像抽出部302は、背景画像および入力画像の相関を基に、2値オブジェクト画像を生成し、生成した2値オブジェクト画像を時間変化検出部303に供給する。
【0235】
図36は、2値オブジェクト画像抽出部302の構成を示すブロック図である。相関値演算部321は、背景画像生成部301から供給された背景画像および入力画像の相関を演算し、相関値を生成して、生成した相関値をしきい値処理部322に供給する。
【0236】
相関値演算部321は、例えば、図37Aに示すように、X4を中心とした3×3の背景画像の中のブロックと、図37Bに示すように、背景画像の中のブロックに対応するY4を中心とした3×3の入力画像の中のブロックに、式(4)を適用して、Y4に対応する相関値を算出する。
【0237】
【数2】
・・・(4)
【0238】
【数3】
・・・(5)
【0239】
【数4】
・・・(6)
【0240】
相関値演算部321は、このように各画素に対応して算出された相関値をしきい値処理部322に供給する。
【0241】
また、相関値演算部321は、例えば、図38Aに示すように、X4を中心とした3×3の背景画像の中のブロックと、図38Bに示すように、背景画像の中のブロックに対応するY4を中心とした3×3の入力画像の中のブロックに、式(7)を適用して、Y4に対応する差分絶対値和を算出するようにしてもよい。
【0242】
【数5】
・・・(7)
【0243】
相関値演算部321は、このように算出された差分絶対値和を相関値として、しきい値処理部322に供給する。
【0244】
しきい値処理部322は、相関画像の画素値としきい値th0とを比較して、相関値がしきい値th0以下である場合、2値オブジェクト画像の画素値に1を設定し、相関値がしきい値th0より大きい場合、2値オブジェクト画像の画素値に0を設定して、0または1が画素値に設定された2値オブジェクト画像を出力する。しきい値処理部322は、しきい値th0を予め記憶するようにしてもよく、または、外部から入力されたしきい値th0を使用するようにしてもよい。
【0245】
図39は、図34に示す入力画像のモデルに対応する2値オブジェクト画像の例を示す図である。2値オブジェクト画像において、背景画像と相関の高い画素には、画素値に0が設定される。
【0246】
図40は、時間変化検出部303の構成を示すブロック図である。フレームメモリ341は、フレーム#nの画素について領域を判定するとき、2値オブジェクト画像抽出部302から供給された、フレーム#n-1、フレーム#n、およびフレーム#n+1の2値オブジェクト画像を記憶する。
【0247】
領域判定部342は、フレームメモリ341に記憶されているフレーム#n-1、フレーム#n、およびフレーム#n+1の2値オブジェクト画像を基に、フレーム#nの各画素について領域を判定して、領域情報を生成し、生成した領域情報を出力する。
【0248】
図41は、領域判定部342の判定を説明する図である。フレーム#nの2値オブジェクト画像の注目している画素が0であるとき、領域判定部342は、フレーム#nの注目している画素が背景領域に属すると判定する。
【0249】
フレーム#nの2値オブジェクト画像の注目している画素が1であり、フレーム#n-1の2値オブジェクト画像の対応する画素が1であり、フレーム#n+1の2値オブジェクト画像の対応する画素が1であるとき、領域判定部342は、フレーム#nの注目している画素が前景領域に属すると判定する。
【0250】
フレーム#nの2値オブジェクト画像の注目している画素が1であり、フレーム#n-1の2値オブジェクト画像の対応する画素が0であるとき、領域判定部342は、フレーム#nの注目している画素がカバードバックグラウンド領域に属すると判定する。
【0251】
フレーム#nの2値オブジェクト画像の注目している画素が1であり、フレーム#n+1の2値オブジェクト画像の対応する画素が0であるとき、領域判定部342は、フレーム#nの注目している画素がアンカバードバックグラウンド領域に属すると判定する。
【0252】
図42は、図34に示す入力画像のモデルに対応する2値オブジェクト画像について、時間変化検出部303の判定した例を示す図である。時間変化検出部303は、2値オブジェクト画像のフレーム#nの対応する画素が0なので、フレーム#nの左から1番目乃至5番目の画素を背景領域に属すると判定する。
【0253】
時間変化検出部303は、2値オブジェクト画像のフレーム#nの画素が1であり、フレーム#n+1の対応する画素が0なので、左から6番目乃至9番目の画素をアンカバードバックグラウンド領域に属すると判定する。
【0254】
時間変化検出部303は、2値オブジェクト画像のフレーム#nの画素が1であり、フレーム#n-1の対応する画素が1であり、フレーム#n+1の対応する画素が1なので、左から10番目乃至13番目の画素を前景領域に属すると判定する。
【0255】
時間変化検出部303は、2値オブジェクト画像のフレーム#nの画素が1であり、フレーム#n-1の対応する画素が0なので、左から14番目乃至17番目の画素をカバードバックグラウンド領域に属すると判定する。
【0256】
時間変化検出部303は、2値オブジェクト画像のフレーム#nの対応する画素が0なので、左から18番目乃至21番目の画素を背景領域に属すると判定する。
【0257】
次に、図43のフローチャートを参照して、領域判定部103の領域特定の処理を説明する。ステップS301において、領域判定部103の背景画像生成部301は、入力画像を基に、例えば、入力画像に含まれる背景のオブジェクトに対応する画像オブジェクトを抽出して背景画像を生成し、生成した背景画像を2値オブジェクト画像抽出部302に供給する。
【0258】
ステップS302において、2値オブジェクト画像抽出部302は、例えば、図37を参照して説明した演算により、入力画像と背景画像生成部301から供給された背景画像との相関値を演算する。ステップS303において、2値オブジェクト画像抽出部302は、例えば、相関値としきい値th0とを比較することにより、相関値およびしきい値th0から2値オブジェクト画像を演算する。
【0259】
ステップS304において、時間変化検出部303は、領域判定の処理を実行して、処理は終了する。
【0260】
図44のフローチャートを参照して、ステップS304に対応する領域判定の処理の詳細を説明する。ステップS321において、時間変化検出部303の領域判定部342は、フレームメモリ341に記憶されているフレーム#nにおいて、注目する画素が0であるか否かを判定し、フレーム#nにおいて、注目する画素が0であると判定された場合、ステップS322に進み、フレーム#nの注目する画素が背景領域に属すると設定して、処理は終了する。
【0261】
ステップS321において、フレーム#nにおいて、注目する画素が1であると判定された場合、ステップS323に進み、時間変化検出部303の領域判定部342は、フレームメモリ341に記憶されているフレーム#nにおいて、注目する画素が1であり、かつ、フレーム#n-1において、対応する画素が0であるか否かを判定し、フレーム#nにおいて、注目する画素が1であり、かつ、フレーム#n-1において、対応する画素が0であると判定された場合、ステップS324に進み、フレーム#nの注目する画素がカバードバックグラウンド領域に属すると設定して、処理は終了する。
【0262】
ステップS323において、フレーム#nにおいて、注目する画素が0であるか、または、フレーム#n-1において、対応する画素が1であると判定された場合、ステップS325に進み、時間変化検出部303の領域判定部342は、フレームメモリ341に記憶されているフレーム#nにおいて、注目する画素が1であり、かつ、フレーム#n+1において、対応する画素が0であるか否かを判定し、フレーム#nにおいて、注目する画素が1であり、かつ、フレーム#n+1において、対応する画素が0であると判定された場合、ステップS326に進み、フレーム#nの注目する画素がアンカバードバックグラウンド領域に属すると設定して、処理は終了する。
【0263】
ステップS325において、フレーム#nにおいて、注目する画素が0であるか、または、フレーム#n+1において、対応する画素が1であると判定された場合、ステップS327に進み、時間変化検出部303の領域判定部342は、フレーム#nの注目する画素を前景領域と設定して、処理は終了する。
【0264】
このように、領域特定部103は、入力された画像と対応する背景画像との相関値を基に、入力画像の画素が前景領域、背景領域、カバードバックグラウンド領域、およびアンカバードバックグラウンド領域のいずれかに属するかを特定して、特定した結果に対応する領域情報を生成することができる。
【0265】
図45は、領域特定部103の他の構成を示すブロック図である。図45に示す領域特定部103は、動き検出部102から供給される動きベクトルとその位置情報を使用する。図33に示す場合と同様の部分には、同一の番号を付してあり、その説明は省略する。
【0266】
ロバスト化部361は、2値オブジェクト画像抽出部302から供給された、N個のフレームの2値オブジェクト画像を基に、ロバスト化された2値オブジェクト画像を生成して、時間変化検出部303に出力する。
【0267】
図46は、ロバスト化部361の構成を説明するブロック図である。動き補償部381は、動き検出部102から供給された動きベクトルとその位置情報を基に、N個のフレームの2値オブジェクト画像の動きを補償して、動きが補償された2値オブジェクト画像をスイッチ382に出力する。
【0268】
図47および図48の例を参照して、動き補償部381の動き補償について説明する。例えば、フレーム#nの領域を判定するとき、図47に例を示すフレーム#n-1、フレーム#n、およびフレーム#n+1の2値オブジェクト画像が入力された場合、動き補償部381は、動き検出部102から供給された動きベクトルを基に、図48に例を示すように、フレーム#n-1の2値オブジェクト画像、およびフレーム#n+1の2値オブジェクト画像を動き補償して、動き補償された2値オブジェクト画像をスイッチ382に供給する。
【0269】
スイッチ382は、1番目のフレームの動き補償された2値オブジェクト画像をフレームメモリ383−1に出力し、2番目のフレームの動き補償された2値オブジェクト画像をフレームメモリ383−2に出力する。同様に、スイッチ382は、3番目乃至N−1番目のフレームの動き補償された2値オブジェクト画像のそれぞれをフレームメモリ383−3乃至フレームメモリ383−(N−1)のいずれかに出力し、N番目のフレームの動き補償された2値オブジェクト画像をフレームメモリ383−Nに出力する。
【0270】
フレームメモリ383−1は、1番目のフレームの動き補償された2値オブジェクト画像を記憶し、記憶されている2値オブジェクト画像を重み付け部384−1に出力する。フレームメモリ383−2は、2番目のフレームの動き補償された2値オブジェクト画像を記憶し、記憶されている2値オブジェクト画像を重み付け部384−2に出力する。
【0271】
同様に、フレームメモリ383−3乃至フレームメモリ383−(N−1)のそれぞれは、3番目のフレーム乃至N−1番目のフレームの動き補償された2値オブジェクト画像のいずれかを記憶し、記憶されている2値オブジェクト画像を重み付け部384−3乃至重み付け部384−(N−1)のいずれかに出力する。フレームメモリ383−Nは、N番目のフレームの動き補償された2値オブジェクト画像を記憶し、記憶されている2値オブジェクト画像を重み付け部384−Nに出力する。
【0272】
重み付け部384−1は、フレームメモリ383−1から供給された1番目のフレームの動き補償された2値オブジェクト画像の画素値に予め定めた重みw1を乗じて、積算部385に供給する。重み付け部384−2は、フレームメモリ383−2から供給された2番目のフレームの動き補償された2値オブジェクト画像の画素値に予め定めた重みw2を乗じて、積算部385に供給する。
【0273】
同様に、重み付け部384−3乃至重み付け部384−(N−1)のそれぞれは、フレームメモリ383−3乃至フレームメモリ383−(N−1)のいずれかから供給された3番目乃至N−1番目のいずれかのフレームの動き補償された2値オブジェクト画像の画素値に予め定めた重みw3乃至重みw(N-1)のいずれかを乗じて、積算部385に供給する。重み付け部384−Nは、フレームメモリ383−Nから供給されたN番目のフレームの動き補償された2値オブジェクト画像の画素値に予め定めた重みwNを乗じて、積算部385に供給する。
【0274】
積算部385は、1乃至N番目のフレームの動き補償され、それぞれ重みw1乃至wNのいずれかが乗じられた、2値オブジェクト画像の対応する画素値を積算して、積算された画素値を予め定めたしきい値th0と比較することにより2値オブジェクト画像を生成する。
【0275】
このように、ロバスト化部361は、N個の2値オブジェクト画像からロバスト化された2値オブジェト画像を生成して、時間変化検出部303に供給するので、図45に構成を示す領域特定部103は、入力画像にノイズが含まれていても、図33に示す場合に比較して、より正確に領域を特定することができる。
【0276】
次に、図45に構成を示す領域特定部103の領域特定の処理について、図49のフローチャートを参照して説明する。ステップS341乃至ステップS343の処理は、図43のフローチャートで説明したステップS301乃至ステップS303とそれぞれ同様なのでその説明は省略する。
【0277】
ステップS344において、ロバスト化部361は、ロバスト化の処理を実行する。
【0278】
ステップS345において、時間変化検出部303は、領域判定の処理を実行して、処理は終了する。ステップS345の処理の詳細は、図44のフローチャートを参照して説明した処理と同様なのでその説明は省略する。
【0279】
次に、図50のフローチャートを参照して、図49のステップS344の処理に対応する、ロバスト化の処理の詳細について説明する。ステップS361において、動き補償部381は、動き検出部102から供給される動きベクトルとその位置情報を基に、入力された2値オブジェクト画像の動き補償の処理を実行する。ステップS362において、フレームメモリ383−1乃至383−Nのいずれかは、スイッチ382を介して供給された動き補償された2値オブジェクト画像を記憶する。
【0280】
ステップS363において、ロバスト化部361は、N個の2値オブジェクト画像が記憶されたか否かを判定し、N個の2値オブジェクト画像が記憶されていないと判定された場合、ステップS361に戻り、2値オブジェクト画像の動き補償の処理および2値オブジェクト画像の記憶の処理を繰り返す。
【0281】
ステップS363において、N個の2値オブジェクト画像が記憶されたと判定された場合、ステップS364に進み、重み付け部384−1乃至384−Nのそれぞれは、N個の2値オブジェクト画像のそれぞれにw1乃至wNのいずれかの重みを乗じて、重み付けする。
【0282】
ステップS365において、積算部385は、重み付けされたN個の2値オブジェクト画像を積算する。
【0283】
ステップS366において、積算部385は、例えば、予め定められたしきい値th1との比較などにより、積算された画像から2値オブジェクト画像を生成して、処理は終了する。
【0284】
このように、図45に構成を示す領域特定部103は、ロバスト化された2値オブジェクト画像を基に、領域情報を生成することができる。
【0285】
以上のように、領域特定部103は、フレームに含まれている画素のそれぞれについて、動き領域、静止領域、アンカバードバックグラウンド領域、またはカバードバックグラウンド領域に属することを示す領域情報を生成することができる。
【0286】
図51は、混合比算出部104の構成の一例を示すブロック図である。推定混合比処理部401は、入力画像を基に、カバードバックグラウンド領域のモデルに対応する演算により、画素毎に推定混合比を算出して、算出した推定混合比を混合比決定部403に供給する。
【0287】
推定混合比処理部402は、入力画像を基に、アンカバードバックグラウンド領域のモデルに対応する演算により、画素毎に推定混合比を算出して、算出した推定混合比を混合比決定部403に供給する。
【0288】
前景に対応するオブジェクトがシャッタ時間内に等速で動いていると仮定できるので、混合領域に属する画素の混合比αは、以下の性質を有する。すなわち、混合比αは、画素の位置の変化に対応して、直線的に変化する。画素の位置の変化を1次元とすれば、混合比αの変化は、直線で表現することができ、画素の位置の変化を2次元とすれば、混合比αの変化は、平面で表現することができる。
【0289】
なお、1フレームの期間は短いので、前景に対応するオブジェクトが剛体であり、等速で移動していると仮定が成り立つ。
【0290】
この場合、混合比αの傾きは、前景のシャッタ時間内での動き量vの逆比となる。
【0291】
理想的な混合比αの例を図52に示す。理想的な混合比αの混合領域における傾きlは、動き量vの逆数として表すことができる。
【0292】
図52に示すように、理想的な混合比αは、背景領域において、1の値を有し、前景領域において、0の値を有し、混合領域において、0を越え1未満の値を有する。
【0293】
図53の例において、フレーム#nの左から7番目の画素の画素値C06は、フレーム#n-1の左から7番目の画素の画素値P06を用いて、式(8)で表すことができる。
【0294】
【数6】
・・・(8)
【0295】
式(8)において、画素値C06を混合領域の画素の画素値Mと、画素値P06を背景領域の画素の画素値Bと表現する。すなわち、混合領域の画素の画素値Mおよび背景領域の画素の画素値Bは、それぞれ、式(9)および式(10)のように表現することができる。
【0296】
M=C06 ・・・(9)
B=P06 ・・・(10)
【0297】
式(8)中の2/vは、混合比αに対応する。動き量vが4なので、フレーム#nの左から7番目の画素の混合比αは、0.5となる。
【0298】
以上のように、注目しているフレーム#nの画素値Cを混合領域の画素値と見なし、フレーム#nの前のフレーム#n-1の画素値Pを背景領域の画素値と見なすことで、混合比αを示す式(3)は、式(11)のように書き換えられる。
【0299】
C=α・P+f ・・・(11)
式(11)のfは、注目している画素に含まれる前景の成分の和ΣiFi/vである。式(11)に含まれる変数は、混合比αおよび前景の成分の和fの2つである。
【0300】
同様に、アンカバードバックグラウンド領域における、動き量vが4であり、時間方向の仮想分割数が4である、画素値を時間方向に展開したモデルを図54に示す。
【0301】
アンカバードバックグラウンド領域において、上述したカバードバックグラウンド領域における表現と同様に、注目しているフレーム#nの画素値Cを混合領域の画素値と見なし、フレーム#nの後のフレーム#n+1の画素値Nを背景領域の画素値と見なすことで、混合比αを示す式(3)は、式(12)のように表現することができる。
【0302】
C=α・N+f ・・・(12)
【0303】
なお、背景のオブジェクトが静止しているとして説明したが、背景のオブジェクトが動いている場合においても、背景の動き量vに対応させた位置の画素の画素値を利用することにより、式(8)乃至式(12)を適用することができる。例えば、図53において、背景に対応するオブジェクトの動き量vが2であり、仮想分割数が2であるとき、背景に対応するオブジェクトが図中の右側に動いているとき、式(10)における背景領域の画素の画素値Bは、画素値P04とされる。
【0304】
式(11)および式(12)は、それぞれ2つの変数を含むので、そのままでは混合比αを求めることができない。ここで、画像は一般的に空間的に相関が強いので近接する画素同士でほぼ同じ画素値となる。
【0305】
そこで、前景成分は、空間的に相関が強いので、前景の成分の和fを前または後のフレームから導き出せるように式を変形して、混合比αを求める。
【0306】
図55のフレーム#nの左から7番目の画素の画素値Mcは、式(13)で表すことができる。
【0307】
【数7】
・・・(13)
式(13)の右辺第1項の2/vは、混合比αに相当する。式(13)の右辺第2項は、後のフレーム#n+1の画素値を利用して、式(14)のように表すこととする。
【0308】
【数8】
・・・(14)
【0309】
ここで、前景の成分の空間相関を利用して、式(15)が成立するとする。
【0310】
F=F05=F06=F07=F08=F09=F10=F11=F12 ・・・(15)
式(14)は、式(15)を利用して、式(16)のように置き換えることができる。
【0311】
【数9】
・・・(16)
【0312】
結果として、βは、式(17)で表すことができる。
【0313】
β=2/4 ・・・(17)
【0314】
一般的に、式(15)に示すように混合領域に関係する前景の成分が等しいと仮定すると、混合領域の全ての画素について、内分比の関係から式(18)が成立する。
【0315】
β=1-α ・・・(18)
【0316】
式(18)が成立するとすれば、式(11)は、式(19)に示すように展開することができる。
【0317】
【数10】
・・・(19)
【0318】
同様に、式(18)が成立するとすれば、式(12)は、式(20)に示すように展開することができる。
【0319】
【数11】
・・・(20)
【0320】
式(19)および式(20)において、C,N、およびPは、既知の画素値なので、式(19)および式(20)に含まれる変数は、混合比αのみである。式(19)および式(20)における、C,N、およびPの関係を図56に示す。Cは、混合比αを算出する、フレーム#nの注目している画素の画素値である。Nは、注目している画素と空間方向の位置が対応する、フレーム#n+1の画素の画素値である。Pは、注目している画素と空間方向の位置が対応する、フレーム#n-1の画素の画素値である。
【0321】
従って、式(19)および式(20)のそれぞれに1つの変数が含まれることとなるので、3つのフレームの画素の画素値を利用して、混合比αを算出することができる。式(19)および式(20)を解くことにより、正しい混合比αが算出されるための条件は、混合領域に関係する前景の成分が等しい、すなわち、前景のオブジェクトが静止しているとき撮像された前景の画像オブジェクトにおいて、前景のオブジェクトの動きの方向に対応する、画像オブジェクトの境界に位置する画素であって、動き量vの2倍の数の連続している画素の画素値が、一定であることである。
【0322】
以上のように、カバードバックグラウンド領域に属する画素の混合比αは、式(21)により算出され、アンカバードバックグラウンド領域に属する画素の混合比αは、式(22)により算出される。
【0323】
α=(C-N)/(P-N) ・・・(21)
α=(C-P)/(N-P) ・・・(22)
【0324】
図57は、推定混合比処理部401の構成を示すブロック図である。フレームメモリ421は、入力された画像をフレーム単位で記憶し、入力画像として入力されているフレームから1つ後のフレームをフレームメモリ422および混合比演算部423に供給する。
【0325】
フレームメモリ422は、入力された画像をフレーム単位で記憶し、フレームメモリ421から供給されているフレームから1つ後のフレームを混合比演算部423に供給する。
【0326】
従って、入力画像としてフレーム#n+1が混合比演算部423に入力されているとき、フレームメモリ421は、フレーム#nを混合比演算部423に供給し、フレームメモリ422は、フレーム#n-1を混合比演算部423に供給する。
【0327】
混合比演算部423は、式(21)に示す演算により、フレーム#nの注目している画素の画素値C、注目している画素と空間的位置が対応する、フレーム#n+1の画素の画素値N、および注目している画素と空間的位置が対応する、フレーム#n-1の画素の画素値Pを基に、注目している画素の推定混合比を算出して、算出した推定混合比を出力する。例えば、背景が静止しているとき、混合比演算部423は、フレーム#nの注目している画素の画素値C、注目している画素とフレーム内の位置が同じ、フレーム#n+1の画素の画素値N、および注目している画素とフレーム内の位置が同じ、フレーム#n-1の画素の画素値Pを基に、注目している画素の推定混合比を算出して、算出した推定混合比を出力する。
【0328】
このように、推定混合比処理部401は、入力画像を基に、推定混合比を算出して、混合比決定部403に供給することができる。
【0329】
なお、推定混合比処理部402は、推定混合比処理部401が式(21)に示す演算により、注目している画素の推定混合比を算出するのに対して、式(22)に示す演算により、注目している画素の推定混合比を算出する部分が異なることを除き、推定混合比処理部401と同様なので、その説明は省略する。
【0330】
図58は、推定混合比処理部401により算出された推定混合比の例を示す図である。図58に示す推定混合比は、等速で動いているオブジェクトに対応する前景の動き量vが11である場合の結果を、1ラインに対して示すものである。
【0331】
推定混合比は、混合領域において、図58に示すように、ほぼ直線的に変化していることがわかる。
【0332】
図51に戻り、混合比決定部403は、領域特定部103から供給された、混合比αの算出の対象となる画素が、前景領域、背景領域、カバードバックグラウンド領域、またはアンカバードバックグラウンド領域のいずれかに属するかを示す領域情報を基に、混合比αを設定する。混合比決定部403は、対象となる画素が前景領域に属する場合、0を混合比αに設定し、対象となる画素が背景領域に属する場合、1を混合比αに設定し、対象となる画素がカバードバックグラウンド領域に属する場合、推定混合比処理部401から供給された推定混合比を混合比αに設定し、対象となる画素がアンカバードバックグラウンド領域に属する場合、推定混合比処理部402から供給された推定混合比を混合比αに設定する。混合比決定部403は、領域情報を基に設定した混合比αを出力する。
【0333】
図59は、混合比算出部104の他の構成を示すブロック図である。選択部441は、領域特定部103から供給された領域情報を基に、カバードバックグラウンド領域に属する画素および、これに対応する前および後のフレームの画素を推定混合比処理部442に供給する。選択部441は、領域特定部103から供給された領域情報を基に、アンカバードバックグラウンド領域に属する画素および、これに対応する前および後のフレームの画素を推定混合比処理部443に供給する。
【0334】
推定混合比処理部442は、選択部441から入力された画素値を基に、式(21)に示す演算により、カバードバックグラウンド領域に属する、注目している画素の推定混合比を算出して、算出した推定混合比を選択部444に供給する。
【0335】
推定混合比処理部443は、選択部441から入力された画素値を基に、式(22)に示す演算により、アンカバードバックグラウンド領域に属する、注目している画素の推定混合比を算出して、算出した推定混合比を選択部444に供給する。
【0336】
選択部444は、領域特定部103から供給された領域情報を基に、対象となる画素が前景領域に属する場合、0である推定混合比を選択して、混合比αに設定し、対象となる画素が背景領域に属する場合、1である推定混合比を選択して、混合比αに設定する。選択部444は、対象となる画素がカバードバックグラウンド領域に属する場合、推定混合比処理部442から供給された推定混合比を選択して混合比αに設定し、対象となる画素がアンカバードバックグラウンド領域に属する場合、推定混合比処理部443から供給された推定混合比を選択して混合比αに設定する。選択部444は、領域情報を基に選択して設定した混合比αを出力する。
【0337】
このように、図59に示す他の構成を有する混合比算出部104は、画像の含まれる画素毎に混合比αを算出して、算出した混合比αを出力することができる。
【0338】
図60のフローチャートを参照して、図51に構成を示す混合比算出部104の混合比αの算出の処理を説明する。ステップS401において、混合比算出部104は、領域特定部103から供給された領域情報を取得する。ステップS402において、推定混合比処理部401は、カバードバックグラウンド領域に対応するモデルにより推定混合比の演算の処理を実行し、算出した推定混合比を混合比決定部403に供給する。混合比推定の演算の処理の詳細は、図61のフローチャートを参照して、後述する。
【0339】
ステップS403において、推定混合比処理部402は、アンカバードバックグラウンド領域に対応するモデルにより推定混合比の演算の処理を実行し、算出した推定混合比を混合比決定部403に供給する。
【0340】
ステップS404において、混合比算出部104は、フレーム全体について、混合比αを推定したか否かを判定し、フレーム全体について、混合比αを推定していないと判定された場合、ステップS402に戻り、次の画素について混合比αを推定する処理を実行する。
【0341】
ステップS404において、フレーム全体について、混合比αを推定したと判定された場合、ステップS405に進み、混合比決定部403は、画素が、前景領域、背景領域、カバードバックグラウンド領域、またはアンカバードバックグラウンド領域のいずれかに属するかを示す、領域特定部103から供給された領域情報を基に、混合比αを設定する。混合比決定部403は、対象となる画素が前景領域に属する場合、0を混合比αに設定し、対象となる画素が背景領域に属する場合、1を混合比αに設定し、対象となる画素がカバードバックグラウンド領域に属する場合、推定混合比処理部401から供給された推定混合比を混合比αに設定し、対象となる画素がアンカバードバックグラウンド領域に属する場合、推定混合比処理部402から供給された推定混合比を混合比αに設定し、処理は終了する。
【0342】
このように、混合比算出部104は、領域特定部103から供給された領域情報、および入力画像を基に、各画素に対応する特徴量である混合比αを算出することができる。
【0343】
図59に構成を示す混合比算出部104の混合比αの算出の処理は、図60のフローチャートで説明した処理と同様なので、その説明は省略する。
【0344】
次に、図60のステップS402に対応する、カバードバックグラウンド領域に対応するモデルによる混合比推定の処理を図61のフローチャートを参照して説明する。
【0345】
ステップS421において、混合比演算部423は、フレームメモリ421から、フレーム#nの注目画素の画素値Cを取得する。
【0346】
ステップS422において、混合比演算部423は、フレームメモリ422から、注目画素に対応する、フレーム#n-1の画素の画素値Pを取得する。
【0347】
ステップS423において、混合比演算部423は、入力画像に含まれる注目画素に対応する、フレーム#n+1の画素の画素値Nを取得する。
【0348】
ステップS424において、混合比演算部423は、フレーム#nの注目画素の画素値C、フレーム#n-1の画素の画素値P、およびフレーム#n+1の画素の画素値Nを基に、推定混合比を演算する。
【0349】
ステップS425において、混合比演算部423は、フレーム全体について、推定混合比を演算する処理を終了したか否かを判定し、フレーム全体について、推定混合比を演算する処理を終了していないと判定された場合、ステップS421に戻り、次の画素について推定混合比を算出する処理を繰り返す。
【0350】
ステップS425において、フレーム全体について、推定混合比を演算する処理を終了したと判定された場合、処理は終了する。
【0351】
このように、推定混合比処理部401は、入力画像を基に、推定混合比を演算することができる。
【0352】
図60のステップS403におけるアンカバードバックグラウンド領域に対応するモデルによる混合比推定の処理は、アンカバードバックグラウンド領域のモデルに対応する式を利用した、図61のフローチャートに示す処理と同様なので、その説明は省略する。
【0353】
なお、図59に示す推定混合比処理部442および推定混合比処理部443は、図61に示すフローチャートと同様の処理を実行して推定混合比を演算するので、その説明は省略する。
【0354】
また、背景に対応するオブジェクトが静止しているとして説明したが、背景領域に対応する画像が動きを含んでいても上述した混合比αを求める処理を適用することができる。例えば、背景領域に対応する画像が一様に動いているとき、推定混合比処理部401は、背景の動きに対応して画像全体をシフトさせ、背景に対応するオブジェクトが静止している場合と同様に処理する。また、背景領域に対応する画像が局所毎に異なる背景の動きを含んでいるとき、推定混合比処理部401は、混合領域に属する画素に対応する画素として、背景の動きに対応した画素を選択して、上述の処理を実行する。
【0355】
また、混合比算出部104は、全ての画素について、カバードバックグラウンド領域に対応するモデルによる混合比推定の処理のみを実行して、算出された推定混合比を混合比αとして出力するようにしてもよい。この場合において、混合比αは、カバードバックグラウンド領域に属する画素について、背景の成分の割合を示し、アンカバードバックグラウンド領域に属する画素について、前景の成分の割合を示す。アンカバードバックグラウンド領域に属する画素について、このように算出された混合比αと1との差分の絶対値を算出して、算出した絶対値を混合比αに設定すれば、分離処理サーバ11は、アンカバードバックグラウンド領域に属する画素について、背景の成分の割合を示す混合比αを求めることができる。
【0356】
なお、同様に、混合比算出部104は、全ての画素について、アンカバードバックグラウンド領域に対応するモデルによる混合比推定の処理のみを実行して、算出された推定混合比を混合比αとして出力するようにしてもよい。
【0357】
次に、混合比αが直線的に変化する性質を利用して混合比αを算出する混合比算出部104について説明する。
【0358】
上述したように、式(11)および式(12)は、それぞれ2つの変数を含むので、そのままでは混合比αを求めることができない。
【0359】
そこで、シャッタ時間内において、前景に対応するオブジェクトが等速で動くことによる、画素の位置の変化に対応して、混合比αが直線的に変化する性質を利用して、空間方向に、混合比αと前景の成分の和fとを近似した式を立てる。混合領域に属する画素の画素値および背景領域に属する画素の画素値の組の複数を利用して、混合比αと前景の成分の和fとを近似した式を解く。
【0360】
混合比αの変化を、直線として近似すると、混合比αは、式(23)で表される。
【0361】
α=il+p ・・・(23)
式(23)において、iは、注目している画素の位置を0とした空間方向のインデックスである。lは、混合比αの直線の傾きである。pは、混合比αの直線の切片である共に、注目している画素の混合比αである。式(23)において、インデックスiは、既知であるが、傾きlおよび切片pは、未知である。
【0362】
インデックスi、傾きl、および切片pの関係を図62に示す。
【0363】
混合比αを式(23)のように近似することにより、複数の画素に対して複数の異なる混合比αは、2つの変数で表現される。図62に示す例において、5つの画素に対する5つの混合比は、2つの変数である傾きlおよび切片pにより表現される。
【0364】
図63に示す平面で混合比αを近似すると、画像の水平方向および垂直方向の2つの方向に対応する動きvを考慮したとき、式(23)を平面に拡張して、混合比αは、式(24)で表される。
【0365】
α=jm+kq+p ・・・(24)
式(24)において、jは、注目している画素の位置を0とした水平方向のインデックスであり、kは、垂直方向のインデックスである。mは、混合比αの面の水平方向の傾きであり、qは、混合比αの面の垂直方向の傾きである。pは、混合比αの面の切片である。
【0366】
例えば、図53に示すフレーム#nにおいて、C05乃至C07について、それぞれ、式(25)乃至式(27)が成立する。
【0367】
C05=α05・B05/v+f05 ・・・(25)
C06=α06・B06/v+f06 ・・・(26)
C07=α07・B07/v+f07 ・・・(27)
【0368】
前景の成分が近傍で一致する、すなわち、F01乃至F03が等しいとして、F01乃至F03をFcに置き換えると式(28)が成立する。
【0369】
f(x)=(1-α(x))・Fc ・・・(28)
式(28)において、xは、空間方向の位置を表す。
【0370】
α(x)を式(24)で置き換えると、式(28)は、式(29)として表すことができる。
【0371】
f(x)=(1-(jm+kq+p))・Fc
=j・(-m・Fc)+k・(-q・Fc)+((1-p)・Fc)
=js+kt+u ・・・(29)
【0372】
式(29)において、(-m・Fc)、(-q・Fc)、および(1-p)・Fcは、式(30)乃至式(32)に示すように置き換えられている。
【0373】
s=-m・Fc ・・・(30)
t=-q・Fc ・・・(31)
u=(1-p)・Fc ・・・(32)
【0374】
式(29)において、jは、注目している画素の位置を0とした水平方向のインデックスであり、kは、垂直方向のインデックスである。
【0375】
このように、前景に対応するオブジェクトがシャッタ時間内において等速に移動し、前景に対応する成分が近傍において一定であるという仮定が成立するので、前景の成分の和は、式(29)で近似される。
【0376】
なお、混合比αを直線で近似する場合、前景の成分の和は、式(33)で表すことができる。
【0377】
f(x)=is+u ・・・(33)
【0378】
式(13)の混合比αおよび前景成分の和を、式(24)および式(29)を利用して置き換えると、画素値Mは、式(34)で表される。
【0379】
M=(jm+kq+p)・B+js+kt+u
=jB・m+kB・q+B・p+j・s+k・t+u ・・・(34)
【0380】
式(34)において、未知の変数は、混合比αの面の水平方向の傾きm、混合比αの面の垂直方向の傾きq、混合比αの面の切片p、s、t、およびuの6つである。
【0381】
注目している画素の近傍の画素に対応させて、式(34)に示す正規方程式に、画素値Mまたは画素値Bを設定し、画素値Mまたは画素値Bが設定された複数の正規方程式を最小自乗法で解いて、混合比αを算出する。
【0382】
例えば、注目している画素の水平方向のインデックスjを0とし、垂直方向のインデックスkを0とし、注目している画素の近傍の3×3の画素について、式(34)に示す正規方程式に画素値Mまたは画素値Bを設定すると、式(35)乃至式(43)を得る。
【0383】
M-1,-1=(-1)・B-1,-1・m+(-1)・B-1,-1・q+B-1,-1・p+(-1)・s+(-1)・t+u
・・・(35)
M0,-1=(0)・B0,-1・m+(-1)・B0,-1・q+B0,-1・p+(0)・s+(-1)・t+u
・・・(36)
M+1,-1=(+1)・B+1,-1・m+(-1)・B+1,-1・q+B+1,-1・p+(+1)・s+(-1)・t+u
・・・(37)
M-1,0=(-1)・B-1,0・m+(0)・B-1,0・q+B-1,0・p+(-1)・s+(0)・t+u
・・・(38)
M0,0=(0)・B0,0・m+(0)・B0,0・q+B0,0・p+(0)・s+(0)・t+u
・・・(39)
M+1,0=(+1)・B+1,0・m+(0)・B+1,0・q+B+1,0・p+(+1)・s+(0)・t+u
・・・(40)
M-1,+1=(-1)・B-1,+1・m+(+1)・B-1,+1・q+B-1,+1・p+(-1)・s+(+1)・t+u
・・・(41)
M0,+1=(0)・B0,+1・m+(+1)・B0,+1・q+B0,+1・p+(0)・s+(+1)・t+u
・・・(42)
M+1,+1=(+1)・B+1,+1・m+(+1)・B+1,+1・q+B+1,+1・p+(+1)・s+(+1)・t+u
・・・(43)
【0384】
注目している画素の水平方向のインデックスjが0であり、垂直方向のインデックスkが0であるので、注目している画素の混合比αは、式(24)より、j=0およびk=0のときの値、すなわち、切片pに等しい。
【0385】
従って、式(35)乃至式(43)の9つの式を基に、最小自乗法により、水平方向の傾きm、垂直方向の傾きq、切片p、s、t、およびuのそれぞれの値を算出し、切片pを混合比αとして出力すればよい。
【0386】
次に、最小自乗法を適用して混合比αを算出するより具体的な手順を説明する。
【0387】
インデックスiおよびインデックスkを1つのインデックスxで表現すると、インデックスi、インデックスk、およびインデックスxの関係は、式(44)で表される。
【0388】
x=(j+1)・3+(k+1) ・・・(44)
【0389】
水平方向の傾きm、垂直方向の傾きq、切片p、s、t、およびuをそれぞれ変数w0,w1,w2,w3,w4、およびW5と表現し、jB,kB,B,j,k、および1をそれぞれa0,a1,a2,a3,a4、およびa5と表現する。誤差exを考慮すると、式(35)乃至式(43)は、式(45)に書き換えることができる。
【0390】
【数12】
・・・(45)
式(45)において、xは、0乃至8の整数のいずれかの値である。
【0391】
式(45)から、式(46)を導くことができる。
【0392】
【数13】
・・・(46)
【0393】
ここで、最小自乗法を適用するため、誤差の自乗和Eを式(47)に示すようにに定義する。
【0394】
【数14】
・・・(47)
【0395】
誤差が最小になるためには、誤差の自乗和Eに対する、変数Wvの偏微分が0になればよい。ここで、vは、0乃至5の整数のいずれかの値である。従って、式(48)を満たすようにwyを求める。
【0396】
【数15】
・・・(48)
【0397】
式(48)に式(46)を代入すると、式(49)を得る。
【0398】
【数16】
・・・(49)
【0399】
式(49)のvに0乃至5の整数のいずれか1つを代入して得られる6つの式に、例えば、掃き出し法(Gauss-Jordanの消去法)などを適用して、wyを算出する。上述したように、w0は水平方向の傾きmであり、w1は垂直方向の傾きqであり、w2は切片pであり、w3はsであり、w4はtであり、w5はuである。
【0400】
以上のように、画素値Mおよび画素値Bを設定した式に、最小自乗法を適用することにより、水平方向の傾きm、垂直方向の傾きq、切片p、s、t、およびuを求めることができる。
【0401】
式(35)乃至式(43)に対応する説明において、混合領域に含まれる画素の画素値をMとし、背景領域に含まれる画素の画素値をBとして説明したが、注目している画素が、カバードバックグラウンド領域に含まれる場合、またはアンカバードバックグラウンド領域に含まれる場合のそれぞれに対して、正規方程式を立てる必要がある。
【0402】
例えば、図53に示す、フレーム#nのカバードバックグラウンド領域に含まれる画素の混合比αを求める場合、フレーム#nの画素のC04乃至C08、およびフレーム#n-1の画素の画素値P04乃至P08が、正規方程式に設定される。
【0403】
図53に示す、フレーム#nのアンカバードバックグラウンド領域に含まれる画素の混合比αを求める場合、フレーム#nの画素のC28乃至C32、およびフレーム#n+1の画素の画素値N28乃至N32が、正規方程式に設定される。
【0404】
また、例えば、図64に示す、カバードバックグラウンド領域に含まれる画素の混合比αを算出するとき、以下の式(50)乃至式(58)が立てられる。混合比αを算出する画素の画素値は、Mc5である。
【0405】
Mc1=(-1)・Bc1・m+(-1)・Bc1・q+Bc1・p+(-1)・s+(-1)・t+u・・・(50)
Mc2=(0)・Bc2・m+(-1)・Bc2・q+Bc2・p+(0)・s+(-1)・t+u・・・(51)
Mc3=(+1)・Bc3・m+(-1)・Bc3・q+Bc3・p+(+1)・s+(-1)・t+u・・・(52)
Mc4=(-1)・Bc4・m+(0)・Bc4・q+Bc4・p+(-1)・s+(0)・t+u・・・(53)
Mc5=(0)・Bc5・m+(0)・Bc5・q+Bc5・p+(0)・s+(0)・t+u・・・(54)
Mc6=(+1)・Bc6・m+(0)・Bc6・q+Bc6・p+(+1)・s+(0)・t+u・・・(55)
Mc7=(-1)・Bc7・m+(+1)・Bc7・q+Bc7・p+(-1)・s+(+1)・t+u・・・(56)
Mc8=(0)・Bc8・m+(+1)・Bc8・q+Bc8・p+(0)・s+(+1)・t+u・・・(57)
Mc9=(+1)・Bc9・m+(+1)・Bc9・q+Bc9・p+(+1)・s+(+1)・t+u・・・(58)
【0406】
フレーム#nのカバードバックグラウンド領域に含まれる画素の混合比αを算出するとき、式(50)乃至式(58)において、フレーム#nの画素に対応する、フレーム#n-1の画素の背景領域の画素の画素値Bc1乃至Bc9が使用される。
【0407】
図64に示す、アンカバードバックグラウンド領域に含まれる画素の混合比αを算出するとき、以下の式(59)乃至式(67)が立てられる。混合比αを算出する画素の画素値は、Mu5である。
【0408】
Mu1=(-1)・Bu1・m+(-1)・Bu1・q+Bu1・p+(-1)・s+(-1)・t+u・・・(59)
Mu2=(0)・Bu2・m+(-1)・Bu2・q+Bu2・p+(0)・s+(-1)・t+u・・・(60)
Mu3=(+1)・Bu3・m+(-1)・Bu3・q+Bu3・p+(+1)・s+(-1)・t+u・・・(61)
Mu4=(-1)・Bu4・m+(0)・Bu4・q+Bu4・p+(-1)・s+(0)・t+u・・・(62)
Mu5=(0)・Bu5・m+(0)・Bu5・q+Bu5・p+(0)・s+(0)・t+u・・・(63)
Mu6=(+1)・Bu6・m+(0)・Bu6・q+Bu6・p+(+1)・s+(0)・t+u・・・(64)
Mu7=(-1)・Bu7・m+(+1)・Bu7・q+Bu7・p+(-1)・s+(+1)・t+u・・・(65)
Mu8=(0)・Bu8・m+(+1)・Bu8・q+Bu8・p+(0)・s+(+1)・t+u・・・(66)
Mu9=(+1)・Bu9・m+(+1)・Bu9・q+Bu9・p+(+1)・s+(+1)・t+u・・・(67)
【0409】
フレーム#nのアンカバードバックグラウンド領域に含まれる画素の混合比αを算出するとき、式(59)乃至式(67)において、フレーム#nの画素に対応する、フレーム#n+1の画素の背景領域の画素の画素値Bu1乃至Bu9が使用される。
【0410】
図65は、推定混合比処理部401の構成を示すブロック図である。推定混合比処理部401に入力された画像は、遅延部501および足し込み部502に供給される。
【0411】
遅延回路221は、入力画像を1フレーム遅延させ、足し込み部502に供給する。足し込み部502に、入力画像としてフレーム#nが入力されているとき、遅延回路221は、フレーム#n-1を足し込み部502に供給する。
【0412】
足し込み部502は、混合比αを算出する画素の近傍の画素の画素値、およびフレーム#n-1の画素値を、正規方程式に設定する。例えば、足し込み部502は、式(50)乃至式(58)に基づいて、正規方程式に画素値Mc1乃至Mc9および画素値Bc1乃至Bc9を設定する。足し込み部502は、画素値が設定された正規方程式を演算部503に供給する。
【0413】
演算部503は、足し込み部502から供給された正規方程式を掃き出し法などにより解いて推定混合比を求め、求められた推定混合比を出力する。
【0414】
このように、推定混合比処理部401は、入力画像を基に、推定混合比を算出して、混合比決定部403に供給することができる。
【0415】
なお、推定混合比処理部402は、推定混合比処理部401と同様の構成を有するので、その説明は省略する。
【0416】
図66は、推定混合比処理部401により算出された推定混合比の例を示す図である。図66に示す推定混合比は、等速で動いているオブジェクトに対応する前景の動きvが11であり、7×7画素のブロックを単位として方程式を生成して算出された結果を、1ラインに対して示すものである。
【0417】
推定混合比は、混合領域において、図66に示すように、ほぼ直線的に変化していることがわかる。
【0418】
次に、図65に構成を示す推定混合比処理部401による、カバードバックグラウンド領域に対応するモデルによる混合比推定の処理を図67のフローチャートを参照して説明する。
【0419】
ステップS521において、足し込み部502は、入力された画像に含まれる画素値、および遅延回路221から供給される画像に含まれる画素値を、カバードバックグラウンド領域のモデルに対応する正規方程式に設定する。
【0420】
ステップS522において、推定混合比処理部401は、対象となる画素についての設定が終了したか否かを判定し、対象となる画素についての設定が終了していないと判定された場合、ステップS521に戻り、正規方程式への画素値の設定の処理を繰り返す。
【0421】
ステップS522において、対象となる画素についての画素値の設定が終了したと判定された場合、ステップS523に進み、演算部173は、画素値が設定された正規方程式を基に、推定混合比を演算して、求められた推定混合比を出力する。
【0422】
このように、図65に構成を示す推定混合比処理部401は、入力画像を基に、推定混合比を演算することができる。
【0423】
アンカバードバックグラウンド領域に対応するモデルによる混合比推定の処理は、アンカバードバックグラウンド領域のモデルに対応する正規方程式を利用した、図67のフローチャートに示す処理と同様なので、その説明は省略する。
【0424】
なお、背景に対応するオブジェクトが静止しているとして説明したが、背景領域に対応する画像が動きを含んでいても上述した混合比を求める処理を適用することができる。例えば、背景領域に対応する画像が一様に動いているとき、推定混合比処理部401は、この動きに対応して画像全体をシフトさせ、背景に対応するオブジェクトが静止している場合と同様に処理する。また、背景領域に対応する画像が局所毎に異なる動きを含んでいるとき、推定混合比処理部401は、混合領域に属する画素に対応する画素として、動きに対応した画素を選択して、上述の処理を実行する。
【0425】
このように、混合比算出部102は、領域特定部101から供給された領域情報、および入力画像を基に、各画素に対応する特徴量である混合比αを算出することができる。
【0426】
混合比αを利用することにより、動いているオブジェクトに対応する画像に含まれる動きボケの情報を残したままで、画素値に含まれる前景の成分と背景の成分とを分離することが可能になる。
【0427】
また、混合比αに基づいて画像を合成すれば、実世界を実際に撮影し直したような動いているオブジェクトのスピードに合わせた正しい動きボケを含む画像を作ることが可能になる。
【0428】
次に、前景背景分離部105について説明する。図68は、前景背景分離部105の構成の一例を示すブロック図である。前景背景分離部105に供給された入力画像は、分離部601、スイッチ602、およびスイッチ604に供給される。カバードバックグラウンド領域を示す情報、およびアンカバードバックグラウンド領域を示す、領域特定部103から供給された領域情報は、分離部601に供給される。前景領域を示す領域情報は、スイッチ602に供給される。背景領域を示す領域情報は、スイッチ604に供給される。
【0429】
混合比算出部104から供給された混合比αは、分離部601に供給される。
【0430】
分離部601は、カバードバックグラウンド領域を示す領域情報、アンカバードバックグラウンド領域を示す領域情報、および混合比αを基に、入力画像から前景の成分を分離して、分離した前景の成分を合成部603に供給するとともに、入力画像から背景の成分を分離して、分離した背景の成分を合成部605に供給する。
【0431】
スイッチ602は、前景領域を示す領域情報を基に、前景に対応する画素が入力されたとき、閉じられ、入力画像に含まれる前景に対応する画素のみを合成部603に供給する。
【0432】
スイッチ604は、背景領域を示す領域情報を基に、背景に対応する画素が入力されたとき、閉じられ、入力画像に含まれる背景に対応する画素のみを合成部605に供給する。
【0433】
合成部603は、分離部601から供給された前景に対応する成分、スイッチ602から供給された前景に対応する画素を基に、前景成分画像を合成し、合成した前景成分画像を出力する。前景領域と混合領域とは重複しないので、合成部603は、例えば、前景に対応する成分と、前景に対応する画素とに論理和の演算を適用して、前景成分画像を合成する。
【0434】
合成部603は、前景成分画像の合成の処理の最初に実行される初期化の処理において、内蔵しているフレームメモリに全ての画素値が0である画像を格納し、前景成分画像の合成の処理において、前景成分画像を格納(上書き)する。従って、合成部603が出力する前景成分画像の内、背景領域に対応する画素には、画素値として0が格納されている。
【0435】
合成部605は、分離部601から供給された背景に対応する成分、スイッチ604から供給された背景に対応する画素を基に、背景成分画像を合成して、合成した背景成分画像を出力する。背景領域と混合領域とは重複しないので、合成部605は、例えば、背景に対応する成分と、背景に対応する画素とに論理和の演算を適用して、背景成分画像を合成する。
【0436】
合成部605は、背景成分画像の合成の処理の最初に実行される初期化の処理において、内蔵しているフレームメモリに全ての画素値が0である画像を格納し、背景成分画像の合成の処理において、背景成分画像を格納(上書き)する。従って、合成部605が出力する背景成分画像の内、前景領域に対応する画素には、画素値として0が格納されている。
【0437】
図69は、前景背景分離部105に入力される入力画像、並びに前景背景分離部105から出力される前景成分画像および背景成分画像を示す図である。
【0438】
図69は、表示される画像の模式図であり、図70は、図69に対応する前景領域に属する画素、背景領域に属する画素、および混合領域に属する画素を含む1ラインの画素を時間方向に展開したモデル図を示す。
【0439】
図69および図70に示すように、前景背景分離部105から出力される背景成分画像は、背景領域に属する画素、および混合領域の画素に含まれる背景の成分から構成される。
【0440】
図69および図70に示すように、前景背景分離部105から出力される前景成分画像は、前景領域に属する画素、および混合領域の画素に含まれる前景の成分から構成される。
【0441】
混合領域の画素の画素値は、前景背景分離部105により、背景の成分と、前景の成分とに分離される。分離された背景の成分は、背景領域に属する画素と共に、背景成分画像を構成する。分離された前景の成分は、前景領域に属する画素と共に、前景成分画像を構成する。
【0442】
このように、前景成分画像は、背景領域に対応する画素の画素値が0とされ、前景領域に対応する画素および混合領域に対応する画素に意味のある画素値が設定される。同様に、背景成分画像は、前景領域に対応する画素の画素値が0とされ、背景領域に対応する画素および混合領域に対応する画素に意味のある画素値が設定される。
【0443】
次に、分離部601が実行する、混合領域に属する画素から前景の成分、および背景の成分を分離する処理について説明する。
【0444】
図71は、図中の左から右に移動するオブジェクトに対応する前景を含む、2つのフレームの前景の成分および背景の成分を示す画像のモデルである。図71に示す画像のモデルにおいて、前景の動き量vは4であり、仮想分割数は、4とされている。
【0445】
フレーム#nにおいて、最も左の画素、および左から14番目乃至18番目の画素は、背景の成分のみから成り、背景領域に属する。フレーム#nにおいて、左から2番目乃至4番目の画素は、背景の成分および前景の成分を含み、アンカバードバックグラウンド領域に属する。フレーム#nにおいて、左から11番目乃至13番目の画素は、背景の成分および前景の成分を含み、カバードバックグラウンド領域に属する。フレーム#nにおいて、左から5番目乃至10番目の画素は、前景の成分のみから成り、前景領域に属する。
【0446】
フレーム#n+1において、左から1番目乃至5番目の画素、および左から18番目の画素は、背景の成分のみから成り、背景領域に属する。フレーム#n+1において、左から6番目乃至8番目の画素は、背景の成分および前景の成分を含み、アンカバードバックグラウンド領域に属する。フレーム#n+1において、左から15番目乃至17番目の画素は、背景の成分および前景の成分を含み、カバードバックグラウンド領域に属する。フレーム#n+1において、左から9番目乃至14番目の画素は、前景の成分のみから成り、前景領域に属する。
【0447】
図72は、カバードバックグラウンド領域に属する画素から前景の成分を分離する処理を説明する図である。図72において、α1乃至α18は、フレーム#nにおける画素のぞれぞれに対応する混合比である。図72において、左から15番目乃至17番目の画素は、カバードバックグラウンド領域に属する。
【0448】
フレーム#nの左から15番目の画素の画素値C15は、式(68)で表される。
【0449】
C15=B15/v+F09/v+F08/v+F07/v
=α15・B15+F09/v+F08/v+F07/v
=α15・P15+F09/v+F08/v+F07/v ・・・(68)
【0450】
ここで、α15は、フレーム#nの左から15番目の画素の混合比である。P15は、フレーム#n-1の左から15番目の画素の画素値である。
【0451】
式(68)を基に、フレーム#nの左から15番目の画素の前景の成分の和f15は、式(69)で表される。
【0452】
f15=F09/v+F08/v+F07/v
=C15-α15・P15 ・・・(69)
【0453】
同様に、フレーム#nの左から16番目の画素の前景の成分の和f16は、式(70)で表され、フレーム#nの左から17番目の画素の前景の成分の和f17は、式(71)で表される。
【0454】
f16=C16-α16・P16 ・・・(70)
f17=C17-α17・P17 ・・・(71)
【0455】
このように、カバードバックグラウンド領域に属する画素の画素値Cに含まれる前景の成分fcは、式(72)で計算される。
【0456】
fc=C-α・P ・・・(72)
【0457】
Pは、1つ前のフレームの、対応する画素の画素値である。
【0458】
図73は、アンカバードバックグラウンド領域に属する画素から前景の成分を分離する処理を説明する図である。図73において、α1乃至α18は、フレーム#nにおける画素のぞれぞれに対応する混合比である。図73において、左から2番目乃至4番目の画素は、アンカバードバックグラウンド領域に属する。
【0459】
フレーム#nの左から2番目の画素の画素値C02は、式(73)で表される。
【0460】
C02=B02/v+B02/v+B02/v+F01/v
=α2・B02+F01/v
=α2・N02+F01/v ・・・(73)
【0461】
ここで、α2は、フレーム#nの左から2番目の画素の混合比である。N02は、フレーム#n+1の左から2番目の画素の画素値である。
【0462】
式(73)を基に、フレーム#nの左から2番目の画素の前景の成分の和f02は、式(74)で表される。
【0463】
f02=F01/v
=C02-α2・N02 ・・・(74)
【0464】
同様に、フレーム#nの左から3番目の画素の前景の成分の和f03は、式(75)で表され、フレーム#nの左から4番目の画素の前景の成分の和f04は、式(76)で表される。
【0465】
f03=C03-α3・N03 ・・・(75)
f04=C04-α4・N04 ・・・(76)
【0466】
このように、アンカバードバックグラウンド領域に属する画素の画素値Cに含まれる前景の成分fuは、式(77)で計算される。
【0467】
fu=C-α・N ・・・(77)
【0468】
Nは、1つ後のフレームの、対応する画素の画素値である。
【0469】
このように、分離部601は、領域情報に含まれる、カバードバックグラウンド領域を示す情報、およびアンカバードバックグラウンド領域を示す情報、並びに画素毎の混合比αを基に、混合領域に属する画素から前景の成分、および背景の成分を分離することができる。
【0470】
図74は、以上で説明した処理を実行する分離部601の構成の一例を示すブロック図である。分離部601に入力された画像は、フレームメモリ621に供給され、混合比算出部104から供給されたカバードバックグラウンド領域およびアンカバードバックグラウンド領域を示す領域情報、並びに混合比αは、分離処理ブロック622に入力される。
【0471】
フレームメモリ621は、入力された画像をフレーム単位で記憶する。フレームメモリ621は、処理の対象がフレーム#nであるとき、フレーム#nの1つ前のフレームであるフレーム#n-1、フレーム#n、およびフレーム#nの1つ後のフレームであるフレーム#n+1を記憶する。
【0472】
フレームメモリ621は、フレーム#n-1、フレーム#n、およびフレーム#n+1の対応する画素を分離処理ブロック622に供給する。
【0473】
分離処理ブロック622は、カバードバックグラウンド領域およびアンカバードバックグラウンド領域を示す領域情報、並びに混合比αを基に、フレームメモリ621から供給されたフレーム#n-1、フレーム#n、およびフレーム#n+1の対応する画素の画素値に図72および図73を参照して説明した演算を適用して、フレーム#nの混合領域に属する画素から前景の成分および背景の成分を分離して、フレームメモリ623に供給する。
【0474】
分離処理ブロック622は、アンカバード領域処理部631、カバード領域処理部632、合成部633、および合成部634で構成されている。
【0475】
アンカバード領域処理部631の乗算器641は、混合比αを、フレームメモリ621から供給されたフレーム#n+1の画素の画素値に乗じて、スイッチ642に出力する。スイッチ642は、フレームメモリ621から供給されたフレーム#nの画素(フレーム#n+1の画素に対応する)がアンカバードバックグラウンド領域であるとき、閉じられ、乗算器641から供給された混合比αを乗じた画素値を演算器643および合成部634に供給する。スイッチ642から出力されるフレーム#n+1の画素の画素値に混合比αを乗じた値は、フレーム#nの対応する画素の画素値の背景の成分に等しい。
【0476】
演算器643は、フレームメモリ621から供給されたフレーム#nの画素の画素値から、スイッチ642から供給された背景の成分を減じて、前景の成分を求める。演算器643は、アンカバードバックグラウンド領域に属する、フレーム#nの画素の前景の成分を合成部633に供給する。
【0477】
カバード領域処理部632の乗算器651は、混合比αを、フレームメモリ621から供給されたフレーム#n-1の画素の画素値に乗じて、スイッチ652に出力する。スイッチ652は、フレームメモリ621から供給されたフレーム#nの画素(フレーム#n-1の画素に対応する)がカバードバックグラウンド領域であるとき、閉じられ、乗算器651から供給された混合比αを乗じた画素値を演算器653および合成部634に供給する。スイッチ652から出力されるフレーム#n-1の画素の画素値に混合比αを乗じた値は、フレーム#nの対応する画素の画素値の背景の成分に等しい。
【0478】
演算器653は、フレームメモリ621から供給されたフレーム#nの画素の画素値から、スイッチ652から供給された背景の成分を減じて、前景の成分を求める。演算器653は、カバードバックグラウンド領域に属する、フレーム#nの画素の前景の成分を合成部633に供給する。
【0479】
合成部633は、フレーム#nの、演算器643から供給された、アンカバードバックグラウンド領域に属する画素の前景の成分、および演算器653から供給された、カバードバックグラウンド領域に属する画素の前景の成分を合成して、フレームメモリ623に供給する。
【0480】
合成部634は、フレーム#nの、スイッチ642から供給された、アンカバードバックグラウンド領域に属する画素の背景の成分、およびスイッチ652から供給された、カバードバックグラウンド領域に属する画素の背景の成分を合成して、フレームメモリ623に供給する。
【0481】
フレームメモリ623は、分離処理ブロック622から供給された、フレーム#nの混合領域の画素の前景の成分と、背景の成分とをそれぞれに記憶する。
【0482】
フレームメモリ623は、記憶しているフレーム#nの混合領域の画素の前景の成分、および記憶しているフレーム#nの混合領域の画素の背景の成分を出力する。
【0483】
特徴量である混合比αを利用することにより、画素値に含まれる前景の成分と背景の成分とを完全に分離することが可能になる。
【0484】
図75は、図71のフレーム#nに対応する、前景成分画像の例と、背景成分画像の例を示す図である。
【0485】
図75Aは、図71のフレーム#nに対応する、前景成分画像の例を示す。最も左の画素、および左から14番目の画素は、前景と背景が分離される前において、背景の成分のみから成っていたので、画素値が0とされる。
【0486】
左から2番目乃至4番目の画素は、前景と背景とが分離される前において、アンカバードバックグラウンド領域に属し、背景の成分が0とされ、前景の成分がそのまま残されている。左から11番目乃至13番目の画素は、前景と背景とが分離される前において、カバードバックグラウンド領域に属し、背景の成分が0とされ、前景の成分がそのまま残されている。左から5番目乃至10番目の画素は、前景の成分のみから成るので、そのまま残される。
【0487】
図75Bは、図71のフレーム#nに対応する、背景成分画像の例を示す。最も左の画素、および左から14番目の画素は、前景と背景とが分離される前において、背景の成分のみから成っていたので、そのまま残される。
【0488】
左から2番目乃至4番目の画素は、前景と背景とが分離される前において、アンカバードバックグラウンド領域に属し、前景の成分が0とされ、背景の成分がそのまま残されている。左から11番目乃至13番目の画素は、前景と背景とが分離される前において、カバードバックグラウンド領域に属し、前景の成分が0とされ、背景の成分がそのまま残されている。左から5番目乃至10番目の画素は、前景と背景とが分離される前において、前景の成分のみから成っていたので、画素値が0とされる。
【0489】
次に、図76に示すフローチャートを参照して、前景背景分離部105による前景と背景との分離の処理を説明する。ステップS601において、分離部601のフレームメモリ621は、入力画像を取得し、前景と背景との分離の対象となるフレーム#nを、その前のフレーム#n-1およびその後のフレーム#n+1と共に記憶する。
【0490】
ステップS602において、分離部601の分離処理ブロック622は、混合比算出部104から供給された領域情報を取得する。ステップS603において、分離部601の分離処理ブロック622は、混合比算出部104から供給された混合比αを取得する。
【0491】
ステップS604において、アンカバード領域処理部631は、領域情報および混合比αを基に、フレームメモリ621から供給された、アンカバードバックグラウンド領域に属する画素の画素値から、背景の成分を抽出する。
【0492】
ステップS605において、アンカバード領域処理部631は、領域情報および混合比αを基に、フレームメモリ621から供給された、アンカバードバックグラウンド領域に属する画素の画素値から、前景の成分を抽出する。
【0493】
ステップS606において、カバード領域処理部632は、領域情報および混合比αを基に、フレームメモリ621から供給された、カバードバックグラウンド領域に属する画素の画素値から、背景の成分を抽出する。
【0494】
ステップS607において、カバード領域処理部632は、領域情報および混合比αを基に、フレームメモリ621から供給された、カバードバックグラウンド領域に属する画素の画素値から、前景の成分を抽出する。
【0495】
ステップS608において、合成部633は、ステップS605の処理で抽出されたアンカバードバックグラウンド領域に属する画素の前景の成分と、ステップS607の処理で抽出されたカバードバックグラウンド領域に属する画素の前景の成分とを合成する。合成された前景の成分は、合成部603に供給される。更に、合成部603は、スイッチ602を介して供給された前景領域に属する画素と、分離部601から供給された前景の成分とを合成して、前景成分画像を生成する。
【0496】
ステップS609において、合成部634は、ステップS604の処理で抽出されたアンカバードバックグラウンド領域に属する画素の背景の成分と、ステップS606の処理で抽出されたカバードバックグラウンド領域に属する画素の背景の成分とを合成する。合成された背景の成分は、合成部605に供給される。更に、合成部605は、スイッチ604を介して供給された背景領域に属する画素と、分離部601から供給された背景の成分とを合成して、背景成分画像を生成する。
【0497】
ステップS610において、合成部603は、前景成分画像を出力する。ステップS611において、合成部605は、背景成分画像を出力し、処理は終了する。
【0498】
このように、前景背景分離部105は、領域情報および混合比αを基に、入力画像から前景の成分と、背景の成分とを分離し、前景の成分のみから成る前景成分画像、および背景の成分のみから成る背景成分画像を出力することができる。
【0499】
次に、前景成分画像の動きボケの除去について説明する。
【0500】
図77は、動きボケ除去部106の構成の一例を示すブロック図である。動き検出部102から供給された動きベクトルとその位置情報は、処理単位決定部801、モデル化部802、および演算部805に供給される。領域特定部103から供給された領域情報は、処理単位決定部801に供給される。前景背景分離部105から供給された前景成分画像は、足し込み部804に供給される。
【0501】
処理単位決定部801は、動きベクトルとその位置情報、および領域情報を基に、処理単位を生成し、生成した処理単位をモデル化部802および足し込み部804に供給する。
【0502】
処理単位決定部801が生成する処理単位は、図78に例を示すように、前景成分画像のカバードバックグラウンド領域に対応する画素から始まり、アンカバードバックグラウンド領域に対応する画素までの動き方向に並ぶ連続する画素、またはアンカバードバックグラウンド領域に対応する画素から始まり、カバードバックグラウンド領域に対応する画素までの動き方向に並ぶ連続する画素を示す。処理単位は、例えば、左上点(処理単位で指定される画素であって、画像上で最も左または最も上に位置する画素の位置)および右下点の2つのデータから成る。
【0503】
モデル化部802は、動きベクトルおよび入力された処理単位を基に、モデル化を実行する。より具体的には、例えば、モデル化部802は、処理単位に含まれる画素の数、画素値の時間方向の仮想分割数、および画素毎の前景の成分の数に対応する複数のモデルを予め記憶しておき、処理単位、および画素値の時間方向の仮想分割数を基に、図79に示すような、画素値と前景の成分との対応を指定するモデルを選択する。
【0504】
例えば、処理単位に対応する画素の数が12でありシャッタ時間内の動き量vが5であるときにおいては、モデル化部802は、仮想分割数を5とし、最も左に位置する画素が1つの前景の成分を含み、左から2番目の画素が2つの前景の成分を含み、左から3番目の画素が3つの前景の成分を含み、左から4番目の画素が4つの前景の成分を含み、左から5番目の画素が5つの前景の成分を含み、左から6番目の画素が5つの前景の成分を含み、左から7番目の画素が5つの前景の成分を含み、左から8番目の画素が5つの前景の成分を含み、左から9番目の画素が4つの前景の成分を含み、左から10番目の画素が3つの前景の成分を含み、左から11番目の画素が2つの前景の成分を含み、左から12番目の画素が1つの前景の成分を含み、全体として8つの前景の成分から成るモデルを選択する。
【0505】
なお、モデル化部802は、予め記憶してあるモデルから選択するのではなく、動きベクトル、および処理単位が供給されたとき、動きベクトル、および処理単位を基に、モデルを生成するようにしてもよい。
【0506】
モデル化部802は、選択したモデルを方程式生成部803に供給する。
【0507】
方程式生成部803は、モデル化部802から供給されたモデルを基に、方程式を生成する。図79に示す前景成分画像のモデルを参照して、前景の成分の数が8であり、処理単位に対応する画素の数が12であり、動き量vが5であり、仮想分割数が5であるときの、方程式生成部803が生成する方程式について説明する。
【0508】
前景成分画像に含まれるシャッタ時間/vに対応する前景成分がF01/v乃至F08/vであるとき、F01/v乃至F08/vと画素値C01乃至C12との関係は、式(78)乃至式(89)で表される。
【0509】
C01=F01/v ・・・(78)
C02=F02/v+F01/v ・・・(79)
C03=F03/v+F02/v+F01/v ・・・(80)
C04=F04/v+F03/v+F02/v+F01/v ・・・(81)
C05=F05/v+F04/v+F03/v+F02/v+F01/v ・・・(82)
C06=F06/v+F05/v+F04/v+F03/v+F02/v ・・・(83)
C07=F07/v+F06/v+F05/v+F04/v+F03/v ・・・(84)
C08=F08/v+F07/v+F06/v+F05/v+F04/v ・・・(85)
C09=F08/v+F07/v+F06/v+F05/v ・・・(86)
C10=F08/v+F07/v+F06/v ・・・(87)
C11=F08/v+F07/v ・・・(88)
C12=F08/v ・・・(89)
【0510】
方程式生成部803は、生成した方程式を変形して方程式を生成する。方程式生成部803が生成する方程式を、式(90)乃至式(101)に示す。
【0511】
C01=1・F01/v+0・F02/v+0・F03/v+0・F04/v+0・F05/v
+0・F06/v+0・F07/v+0・F08/v ・・・(90)
C02=1・F01/v+1・F02/v+0・F03/v+0・F04/v+0・F05/v
+0・F06/v+0・F07/v+0・F08/v ・・・(91)
C03=1・F01/v+1・F02/v+1・F03/v+0・F04/v+0・F05/v
+0・F06/v+0・F07/v+0・F08/v ・・・(92)
C04=1・F01/v+1・F02/v+1・F03/v+1・F04/v+0・F05/v
+0・F06/v+0・F07/v+0・F08/v ・・・(93)
C05=1・F01/v+1・F02/v+1・F03/v+1・F04/v+1・F05/v
+0・F06/v+0・F07/v+0・F08/v ・・・(94)
C06=0・F01/v+1・F02/v+1・F03/v+1・F04/v+1・F05/v
+1・F06/v+0・F07/v+0・F08/v ・・・(95)
C07=0・F01/v+0・F02/v+1・F03/v+1・F04/v+1・F05/v
+1・F06/v+1・F07/v+0・F08/v ・・・(96)
C08=0・F01/v+0・F02/v+0・F03/v+1・F04/v+1・F05/v
+1・F06/v+1・F07/v+1・F08/v ・・・(97)
C09=0・F01/v+0・F02/v+0・F03/v+0・F04/v+1・F05/v
+1・F06/v+1・F07/v+1・F08/v ・・・(98)
C10=0・F01/v+0・F02/v+0・F03/v+0・F04/v+0・F05/v
+1・F06/v+1・F07/v+1・F08/v ・・・(99)
C11=0・F01/v+0・F02/v+0・F03/v+0・F04/v+0・F05/v
+0・F06/v+1・F07/v+1・F08/v ・・・(100)
C12=0・F01/v+0・F02/v+0・F03/v+0・F04/v+0・F05/v
+0・F06/v+0・F07/v+1・F08/v ・・・(101)
【0512】
式(90)乃至式(101)は、式(102)として表すこともできる。
【0513】
【数17】
・・・(102)
【0514】
式(102)において、jは、画素の位置を示す。この例において、jは、1乃至12のいずれか1つの値を有する。また、iは、前景値の位置を示す。この例において、iは、1乃至8のいずれか1つの値を有する。aijは、iおよびjの値に対応して、0または1の値を有する。
【0515】
誤差を考慮して表現すると、式(102)は、式(103)のように表すことができる。
【0516】
【数18】
・・・(103)
【0517】
式(103)において、ejは、注目画素Cjに含まれる誤差である。
【0518】
式(103)は、式(104)に書き換えることができる。
【0519】
【数19】
・・・(104)
【0520】
ここで、最小自乗法を適用するため、誤差の自乗和Eを式(105)に示すように定義する。
【0521】
【数20】
・・・(105)
【0522】
誤差が最小になるためには、誤差の自乗和Eに対する、変数Fkによる偏微分の値が0になればよい。式(106)を満たすようにFkを求める。
【0523】
【数21】
・・・(106)
【0524】
式(106)において、動き量vは固定値であるから、式(107)を導くことができる。
【0525】
【数22】
・・・(107)
【0526】
式(107)を展開して、移項すると、式(108)を得る。
【0527】
【数23】
・・・(108)
【0528】
式(108)のkに1乃至8の整数のいずれか1つを代入して得られる8つの式に展開する。得られた8つの式を、行列により1つの式により表すことができる。この式を正規方程式と呼ぶ。
【0529】
このような最小自乗法に基づく、方程式生成部803が生成する正規方程式の例を式(109)に示す。
【0530】
【数24】
・・・(109)
【0531】
式(109)をA・F=v・Cと表すと、C,A,vが既知であり、Fは未知である。また、A,vは、モデル化の時点で既知だが、Cは、足し込み動作において画素値を入力することで既知となる。
【0532】
最小自乗法に基づく正規方程式により前景成分を算出することにより、画素Cに含まれている誤差を分散させることができる。
【0533】
方程式生成部803は、このように生成された正規方程式を足し込み部804に供給する。
【0534】
足し込み部804は、処理単位決定部801から供給された処理単位を基に、前景成分画像に含まれる画素値Cを、方程式生成部803から供給された行列の式に設定する。足し込み部804は、画素値Cを設定した行列を演算部805に供給する。
【0535】
演算部805は、掃き出し法(Gauss-Jordanの消去法)などの解法に基づく処理により、動きボケが除去された前景成分Fi/vを算出して、動きボケが除去された前景の画素値である、0乃至8の整数のいずれかのiに対応するFiを算出して、図80に例を示す、動きボケが除去された画素値であるFiから成る、動きボケが除去された前景成分画像を出力する。
【0536】
なお、図80に示す動きボケが除去された前景成分画像において、C03乃至C10のそれぞれにF01乃至F08のそれぞれが設定されているのは、画面に対する前景成分画像の位置を変化させないためであり、任意の位置に対応させることができる。
【0537】
このように、動きボケ除去部106は、選択信号および動きボケ調整量v'を基に、動きボケの量を除去することができる。
【0538】
次に、図81のフローチャートを参照して、動きボケ除去部106による前景成分画像に含まれる動きボケの量の調整の処理を説明する。
【0539】
ステップS801において、動きボケ除去部106の処理単位決定部801は、動きベクトルおよび領域情報を基に、処理単位を生成し、生成した処理単位をモデル化部802に供給する。
【0540】
ステップS802において、動きボケ除去部106のモデル化部802は、動き量vおよび処理単位に対応して、モデルの選択や生成を行う。ステップS803において、方程式生成部803は、選択されたモデルを基に、正規方程式を作成する。
【0541】
ステップS804において、足し込み部804は、作成された正規方程式に前景成分画像の画素値を設定する。ステップS805において、足し込み部804は、処理単位に対応する全ての画素の画素値の設定を行ったか否かを判定し、処理単位に対応する全ての画素の画素値の設定を行っていないと判定された場合、ステップS804に戻り、正規方程式への画素値の設定の処理を繰り返す。
【0542】
ステップS805において、処理単位の全ての画素の画素値の設定を行ったと判定された場合、ステップS806に進み、演算部805は、足し込み部804から供給された画素値が設定された正規方程式を基に、動きボケの量を除去した前景の画素値を算出して、処理は終了する。
【0543】
このように、動きボケ除去部106は、動きベクトルおよび領域情報を基に、動きボケを含む前景画像から動きボケの量を除去することができる。
【0544】
すなわち、サンプルデータである画素値に含まれる動きボケの量を調整することができる。
【0545】
図82は、動きボケ除去部106の構成の他の一例を示すブロック図である。動き検出部102から供給された動きベクトルとその位置情報は、処理単位決定部901および補正部905に供給され、領域特定部103から供給された領域情報は、処理単位決定部901に供給される。前景背景分離部105から供給された前景成分画像は、演算部904に供給される。
【0546】
処理単位決定部901は、動きベクトルとその位置情報、および領域情報を基に、処理単位を生成し、動きベクトルと共に、生成した処理単位をモデル化部902に供給する。
【0547】
モデル化部902は、動きベクトルおよび入力された処理単位を基に、モデル化を実行する。より具体的には、例えば、モデル化部902は、処理単位に含まれる画素の数、画素値の時間方向の仮想分割数、および画素毎の前景の成分の数に対応する複数のモデルを予め記憶しておき、処理単位、および画素値の時間方向の仮想分割数を基に、図83に示すような、画素値と前景の成分との対応を指定するモデルを選択する。
【0548】
例えば、処理単位に対応する画素の数が12であり動き量vが5であるときにおいては、モデル化部902は、仮想分割数を5とし、最も左に位置する画素が1つの前景の成分を含み、左から2番目の画素が2つの前景の成分を含み、左から3番目の画素が3つの前景の成分を含み、左から4番目の画素が4つの前景の成分を含み、左から5番目の画素が5つの前景の成分を含み、左から6番目の画素が5つの前景の成分を含み、左から7番目の画素が5つの前景の成分を含み、左から8番目の画素が5つの前景の成分を含み、左から9番目の画素が4つの前景の成分を含み、左から10番目の画素が3つの前景の成分を含み、左から11番目の画素が2つの前景の成分を含み、左から12番目の画素が1つの前景の成分を含み、全体として8つの前景の成分から成るモデルを選択する。
【0549】
なお、モデル化部902は、予め記憶してあるモデルから選択するのではなく、動きベクトル、および処理単位が供給されたとき、動きベクトル、および処理単位を基に、モデルを生成するようにしてもよい。
【0550】
方程式生成部903は、モデル化部902から供給されたモデルを基に、方程式を生成する。
【0551】
図83乃至図85に示す前景成分画像のモデルを参照して、前景の成分の数が8であり、処理単位に対応する画素の数が12であり、動き量vが5であるときの、方程式生成部903が生成する方程式の例について説明する。
【0552】
前景成分画像に含まれるシャッタ時間/vに対応する前景成分がF01/v乃至F08/vであるとき、F01/v乃至F08/vと画素値C01乃至C12との関係は、上述したように、式(78)乃至式(89)で表される。
【0553】
画素値C12およびC11に注目すると、画素値C12は、式(110)に示すように、前景の成分F08/vのみを含み、画素値C11は、前景の成分F08/vおよび前景の成分F07/vの積和から成る。従って、前景の成分F07/vは、式(111)で求めることができる。
【0554】
F08/v=C12 ・・・(110)
F07/v=C11-C12 ・・・(111)
【0555】
同様に、画素値C10乃至C01に含まれる前景の成分を考慮すると、前景の成分F06/v乃至F01/vは、式(112)乃至式(117)により求めることができる。
【0556】
F06/v=C10-C11 ・・・(112)
F05/v=C09-C10 ・・・(113)
F04/v=C08-C09 ・・・(114)
F03/v=C07-C08+C12 ・・・(115)
F02/v=C06-C07+C11-C12 ・・・(116)
F01/v=C05-C06+C10-C11 ・・・(117)
【0557】
方程式生成部903は、式(110)乃至式(117)に例を示す、画素値の差により前景の成分を算出するための方程式を生成する。方程式生成部903は、生成した方程式を演算部904に供給する。
【0558】
演算部904は、方程式生成部903から供給された方程式に前景成分画像の画素値を設定して、画素値を設定した方程式を基に、前景の成分を算出する。演算部904は、例えば、式(110)乃至式(117)が方程式生成部903から供給されたとき、式(110)乃至式(117)に画素値C05乃至C12を設定する。
【0559】
演算部904は、画素値が設定された式に基づき、前景の成分を算出する。例えば、演算部904は、画素値C05乃至C12が設定された式(110)乃至式(117)に基づく演算により、図84に示すように、前景の成分F01/v乃至F08/vを算出する。演算部904は、前景の成分F01/v乃至F08/vを補正部905に供給する。
【0560】
補正部905は、演算部904から供給された前景の成分に、処理単位決定部901から供給された動きベクトルに含まれる動き量vを乗じて、動きボケを除去した前景の画素値を算出する。例えば、補正部905は、演算部904から供給された前景の成分F01/v乃至F08/vが供給されたとき、前景の成分F01/v乃至F08/vのそれぞれに、5である動き量vを乗じることにより、図85に示すように、動きボケを除去した前景の画素値F01乃至F08を算出する。
【0561】
補正部905は、以上のように算出された、動きボケを除去した前景の画素値から成る前景成分画像を出力する。
【0562】
このように、動きボケ除去部106は、選択信号および動きボケ調整量v'を基に、動きボケの量を除去することができる。
【0563】
次に、図82に構成を示す動きボケ除去部106による前景の動きボケの除去の処理を図86のフローチャートを参照して説明する。
【0564】
ステップS901において、動きボケ除去部106の処理単位決定部901は、動きベクトルおよび領域情報を基に、処理単位を生成し、生成した処理単位をモデル化部902および補正部905に供給する。
【0565】
ステップS902において、動きボケ除去部106のモデル化部902は、動き量vおよび処理単位に対応して、モデルの選択や生成を行う。ステップS903において、方程式生成部903は、選択または生成されたモデルを基に、前景成分画像の画素値の差により前景の成分を算出するための方程式を生成する。
【0566】
ステップS904において、演算部904は、作成された方程式に前景成分画像の画素値を設定し、画素値が設定された方程式を基に、画素値の差分から前景の成分を抽出する。ステップS905において、演算部904は、処理単位に対応する全ての前景の成分を抽出したか否かを判定し、処理単位に対応する全ての前景の成分を抽出していないと判定された場合、ステップS904に戻り、前景の成分を抽出の処理を繰り返す。
【0567】
ステップS905において、処理単位に対応する全ての前景の成分を抽出したと判定された場合、ステップS906に進み、補正部905は、動き量vを基に、演算部904から供給された前景の成分F01/v乃至F08/vのそれぞれを補正して、動きボケを除去した前景の画素値F01乃至F08を算出する。
【0568】
ステップS907において、補正部905は、動きボケを除去した前景の画素値を算出して、出力し、処理は終了する。
【0569】
このように、図82に構成を示す動きボケ除去部106は、より簡単な演算で、より迅速に、動きボケを含む前景画像から動きボケを除去することができる。
【0570】
ウィナー・フィルタなど従来の動きボケを部分的に除去する手法が、理想状態では効果が認められるが、量子化され、ノイズを含んだ実際の画像に対して十分な効果が得られないのに対し、図82に構成を示す動きボケ除去部106においては、量子化され、ノイズを含んだ実際の画像に対しても十分な効果が認められ、精度の良い動きボケの除去が可能となる。
【0571】
次に、図87を参照して、合成部107の構成について説明する。
【0572】
輪郭抽出部1001は、動きボケ除去部106より入力されてくる動きボケが除去された前景成分画像の輪郭となる画素の情報を抽出し輪郭平滑化部1002に出力する。
【0573】
輪郭平滑化部1002は、輪郭抽出部1001より供給されてくる動きボケが除去された前景成分画像の輪郭部の画素(輪郭を形成する画素)の情報に基づいて、輪郭部の画素の画素値を平滑化して空間混合比生成部1003に供給する。
【0574】
すなわち、動きボケが除去された前景成分画像は、混合比が1の画像である。この混合比が1である前景成分画像の輪郭部分は、図88の実線(太線)で示されるような、画素単位の階段状の形状となる。
【0575】
そこで、輪郭平滑化部1002は、この階段状の輪郭部分の各画素について、端部となる1辺の中央部の各点(例えば、図中の点B1乃至B6)毎に、その点を通る直線を回帰法により求めて、輪郭部分を直線近似することにより、例えば、図88の点線で示されるような線分により、輪郭を平滑化する。
【0576】
すなわち、図88においては、前景成分画像の輪郭を形成する各画素の(輪郭の)端部の1辺の中央の各点B1乃至B6のそれぞれを通る直線を設定し、その直線の傾きを回帰法(最小自乗法)により求め、前景成分画像の輪郭を平滑化する。図88においては、各点B1乃至B6に対応する線分OP,PQ,QR,RS,ST,TUが点線で示されている。結果として、前景成分画像の輪郭は、階段状の断面から、滑らかな断面(90度以上の鈍角からなる面)へと変化している。
【0577】
尚、輪郭平滑化部1002による平滑化は、上述したように回帰法により求められる直線を用いて求めるのみならず、例えば、スプライン近似や多項式近似により輪郭を平滑化するようにしてもよい。
【0578】
空間混合比生成部1003は、輪郭平滑化部1002より供給された、平滑化されている前景成分画像の輪郭に基づいて、輪郭部周辺の画素の空間混合比を算出し、前景成分画像スムージング部1004、および、領域情報調整部1006に出力する。すなわち、空間混合比生成部1003は、図89で示されるように、点線で示される平滑化された前景成分画像の輪郭形状から、対応する画素の空間的な混合比を求める。空間混合比とは、画素内で生じる混合比のことであり、これまで扱ってきた混合比は、これに対して、時間的に生じる混合であるので以降においては、時間混合比とも称する。
【0579】
例えば、図89で示されるように、太線の実線が元々の輪郭であって、細線で囲まれる正方形が輪郭付近の画素であるものとすると、元々の輪郭の図中左部分が前景成分画像であるものとすれば、従来の前景成分画像は、空間的には、図中の太線で示された輪郭の周辺の画素の空間混合比は前景成分画像の輪郭となる画素が1、今の場合、その前景成分画像の輪郭となる画素の右隣に存在する画素の空間混合比は0となっているはずである。尚、図89においては、前景成分画像の領域については、斜線部で示されており、それ以外の部分、すなわち、背景成分画像の領域は、無地で示されている。
【0580】
空間混合比生成部1003は、この空間混合比を平滑化された輪郭形状に合わせて求める。すなわち、元々の前景成分画像の輪郭は、図89で示される太線であり、太線の図中左側の斜線で示される領域である。そして、その斜線部の領域の混合比が1であり、太線より右側の領域が前景成分画像ではない領域(背景成分画像が付加される背景領域)、すなわち、画像を合成するときの混合比が0となる領域である。
【0581】
しかしながら、前景成分画像の領域は、平滑化されることにより、図89(図88も同じ)で示される点線のように平滑化されている。そこで、空間混合比生成部1003は、この平滑化された輪郭の情報に基づいて、輪郭を形成する線が跨いでいる領域に存在する各画素について、前景成分画像の占める各画素の面積の割合から空間混合比を求める。
【0582】
すなわち、各画素の面積が1であるとすると、図90で示されるように、図中最上部左側の画素(輪郭となる端部の1辺の中央の点B1を有する画素)は、点線により示される輪郭により、斜線部で示される前傾成分画像となる領域の面積が、略0.7となるので、空間混合比は、0.7となる。同様に、図中の最上部右側の画素(輪郭となる端部の1辺の中央の点B1を共有する画素)は、点線により示される輪郭により、斜線部で示される前傾成分画像となる領域の面積が、略0.3となるので空間混合比は、0.3となる。同様にして、図中上から2段目の点B2を共有する2画素の空間混合比は、それぞれの斜線部の面積に応じて、左から0.9と0.1であり、図中上から3段目の点B3を共有する2画素の空間混合比は、左から0.8と0.2であり、図中上から4段目の点B4を共有する2画素の空間混合比は、左から0.9と0.1であり、図中上から5段目の点B5を共有する2画素の空間混合比は、左から0.7と0.3であり、さらに、図中上から6段目の点B6を共有する2画素、および、さらに左側の画素からなる3画素の空間混合比は、左から0.95、0.65、および0.3である。
【0583】
前景成分画像スムージング部1004は、空間混合比生成部1003より供給された空間混合比に基づいて、前景成分画像をスムージングして動きボケ付加部1005に出力する。すなわち、前景成分画像スムージング部1004は、平滑化された前景成分画像の輪郭に対応した空間混合比に基づいて前景成分画像の輪郭部をスムージングする。より詳細には、前景成分画像スムージング部1004は、入力された前景成分画像の各画素に対して、対応する空間混合比を乗じて、画素値を調整し、全体として前景成分画像の輪郭をスムージングする。
【0584】
このように、平滑化された輪郭を用いることにより各画素の混合比は、これまで1および0の2値による表現から平滑化された輪郭に合わせて、空間混合比が考慮された値となり、前景成分画像の占める面積の割合に応じた値が設定される。結果として、前景成分画像が、この空間混合比に応じて、スムージングされることにより、これまで画素単位でしか表現することのできなかった前景成分画像の輪郭を画素以下のサイズまで考慮した処理を実行することが可能となる。
【0585】
尚、前景成分画像の輪郭がスムージングされることにより、前景成分画像の領域(前景成分画像の空間混合比が0以外となる画素の領域)は、水平方向、または、垂直方向に数画素分増えることになる。また、同様にして、背景成分画像を含む画素の領域も増えるようにしてもよい。
【0586】
動きボケ付加部1005は、動き検出部102より供給される動きベクトルの情報に基づいて、前景成分画像スムージング部1004により、その輪郭がスムージングされた前景成分画像に動きボケを付加し、時間混合比算出部1007、混合領域画像合成部1009、および、画像合成部1010に出力する。
【0587】
すなわち、動きボケ付加部1005は、動き量vとは異なる値の動きボケ調整量v'、例えば、動き量vの半分の値の動きボケ調整量v'や、動き量vと無関係の値の動きボケ調整量v'を与えることで、動きボケの量を調整することができる。例えば、図91に示すように、動きボケ付加部1005は、動きボケが除去された前景の画素値Fiを動きボケ調整量v'で除すことにより、前景成分Fi/v'を算出して、前景成分Fi/v'の和を算出して、動きボケの量が調整された画素値を生成する。例えば、動きボケ調整量v'が3のとき、画素値C02は、(F01)/v'とされ、画素値C03は、(F01+F02)/v'とされ、画素値C04は、(F01+F02+F03)/v'とされ、画素値C05は、(F02+F03+F04)/v'とされる。
【0588】
また、例えば、図92に示すように、処理単位に対応する画素の数が8であり、動き量vが4であるとき、動きボケ付加部1005は、式(118)に示す行列の式を生成する。
【0589】
【数25】
・・・(118)
【0590】
動きボケ付加部1005は、このように処理単位の長さに対応した数の式を立てて、動きボケの量が調整された画素値であるFiを算出する。同様に、例えば、処理単位に含まれる画素の数が100あるとき、100個の画素に対応する式を生成して、Fiを算出する。
【0591】
領域情報調整部1006は、領域特定部103より供給された領域情報を、空間混合比生成部1003より供給される空間混合比の情報に基づいて調整し、調整した領域情報を時間混合比算出部1007、および、画像合成部1010に出力する。すなわち、上述したように前景成分画像の輪郭をスムージングすることにより新たに生成された空間混合比により前景成分画像の領域は、広がることになるため、領域情報調整部1006は、前景成分画像の輪郭部分の領域が対応して広がるように領域情報を調整する。
【0592】
時間混合比算出部1007は、図6の混合比算出部104と同様のものであり、動きボケが付加された前景成分画像と、領域情報調整部1006より供給される領域情報に基づいて、スムージングされた前景成分画像に対応した時間混合比の情報を背景成分生成部1008に供給する。
【0593】
背景成分生成部1008は、時間混合比および任意の背景画像を基に、背景成分画像を生成して、混合領域画像合成部1009に供給する。
【0594】
混合領域画像合成部1009は、背景成分生成部1007から供給された背景成分画像と前景成分画像との混合領域の画像を合成することにより、混合領域合成画像を生成して、生成した混合領域合成画像を画像合成部1010に供給する。
【0595】
画像合成部1010は、領域情報調整部1006より供給される領域情報を基に、動きボケ付加部1005により動きボケが付加された前景成分画像、混合領域画像合成部1009から供給された混合領域合成画像、および任意の背景画像を合成して、合成画像を生成して出力する。
【0596】
次に、図93のフローチャートを参照して、図23のステップS16の処理に対応する、図87の合成部107による画像の合成の処理について説明する。
【0597】
ステップS921において、輪郭抽出部1001は、動きボケ除去部106より入力されてくる動きボケが除去された前景成分画像の輪郭となる画素の情報を抽出し、輪郭平滑化部1002に出力する。すなわち、輪郭抽出部1001は、例えば、図89で示される点B1乃至B6を有する画素、および、その近傍の画素の情報を抽出し、輪郭平滑化部1002に出力する。
【0598】
ステップS922において、輪郭平滑下部1002は、輪郭抽出部1001より供給されてくる動きボケが除去された前景成分画像の輪郭部分の画素の情報に基づいて、輪郭部を平滑化して空間混合比生成部1003に供給する。すなわち、輪郭部分の画素の情報に基づいて、輪郭平滑下部1002は、この階段状の輪郭部分の各画素について、端部となる1辺の中央部の各点(例えば、図中の点B1乃至B6)毎に回帰直線を求めて、輪郭部分を直線近似することにより、例えば、図88の点線で示されるような線分により、輪郭を平滑化する。すなわち、図88においては、前景成分画像の輪郭を形成する各画素の(輪郭の)端部の1辺の中央の各点B1乃至B6のそれぞれを通る直線を設定し、その直線の傾きを回帰法(最小自乗法)により求め、各点B1乃至B6に対応する線分OP,PQ,QR,RS,ST,TUを点線で示している。
【0599】
より詳細には、輪郭平滑下部1002は、例えば、各点B1乃至B6の各点に対応する直線を以下の式(119)で示されるような関数として定義し、その傾きを回帰法(最小自乗法)により求める。
【0600】
y=Ax
・・・(119)
【0601】
尚、ここで、(x,y)は、各点B1乃至B6の座標であり、Aは、その傾きである。また、上述の式(119)の原点は、求めようとする直線が通る上述の点B1乃至B6の位置であるものとする。従って、例えば、求めようとする直線が点B1を通る線分OPに対応するものである場合、原点は点B1の位置であり、同様にして、直線が点B2を通る線分PQに対応するものである場合、原点は点B2であるものとする。従って、点B1乃至B6の座標は、求める直線の通る点の位置により変化する。
【0602】
最小自乗法は、以下の式(120)により定義される、設定された傾きAにより得られるy'と、実際のyとの差分自乗和Qが最小となる傾きAを求める方法である。
【0603】
【数26】
・・・(120)
【0604】
式(120)で示される差分自乗和Qは、2次関数であるので、変数A(傾きA)について下に凸の曲線となるため、傾きAが最小となるAminが最小自乗法の解となる。
【0605】
式(120)で示される差分自乗和Qは、変数Aで微分されると、以下に示す式(121)で示される(Roud dQ)/(Roud dA)となる。
【0606】
【数27】
・・・(121)
【0607】
式(121)が、0となるAが差分自乗和Qの最小値をとるAminとなるので、式(121)が0となるときの式を展開することにより、以下の式(122)で傾きAが求められることになる。
【0608】
【数28】
・・・(122)
【0609】
上述の式(122)は、いわゆる、1変数(傾きA)の正規方程式となる。
【0610】
このようにして、得られた傾きAにより各点の線分となる直線(図89中の点線により示される各線分)が求められ、各点に対応する線分が前景成分画像の輪郭を平滑化する。尚、平滑化の手法は、回帰法(最小自乗法)により各点に対応する線分を求めるのみならず、各点を用いてスプライン近似により得られる曲線を用いてもよいし、多項式近似により輪郭となる曲線を求めるようにしてもよい。
【0611】
ステップS923において、空間混合比生成部1003は、輪郭平滑化部1002より供給された平滑化された輪郭情報に基づいて、空間混合比を求める。すなわち、上述したように、図88の太線で示された階段状の輪郭が図89の点線で示されるように平滑化された輪郭に基づいて、輪郭近傍の各画素上の前景成分画像の面積に対応して、図90で示されるように、輪郭近傍の画素の空間混合比を求めて前景成分画像スムージング部1007、および、領域情報調整部1006に出力する。
【0612】
ステップS924において、前景成分画像スムージング部1004は、動きボケが除去された前景成分画像を、空間混合比生成部1003より供給された、前景成分画像の輪郭部分の画素の空間混合比の情報に基づいて、スムージング処理を施し、スムージングした前景成分画像を動きボケ付加部1005に出力する。すなわち、前景成分画像スムージング部1004は、空間混合比を前景成分画像の各画素(実際には、輪郭を形成する画素のみ)の画素値に空間混合比を乗じて、前景成分画像の輪郭をスムージングする。
【0613】
ステップS925において、動きボケ付加部1005は、図91,図92で示して、上述したようにスムージングされた前景成分画像に、動き検出部102より供給される動きベクトルに基づいて動きボケを付加することにより、入力画像に元々含まれていた動きボケを付加して、時間混合比算出部1007、混合領域画像合成部1009、および、画像合成部1010に出力する。
【0614】
ステップS926において、領域情報生成部1006は、領域特定部103より供給された領域情報を、空間混合比生成部1003より供給される空間混合比の情報に基づいて調整し、調整した領域情報を時間混合比算出部1007、および、画像合成部1010に出力する。すなわち、上述したように前景成分画像の輪郭をスムージングすることにより新たに生成された空間混合比により前景成分画像の領域は、平滑化された輪郭となる線分が通る画素にまで広がることになるため、領域情報調整部1006は、前景成分画像の輪郭部分の領域が広がるように調整する。
【0615】
ステップS927において、時間混合比算出部1007は、図6の混合比算出部104と同様に、動きボケが付加された前景成分画像と、領域情報調整部1006より供給される領域情報に基づいて、入力される任意の背景画像から背景成分画像を生成し、混合領域画像合成部1009に供給する。
【0616】
ステップS928において、背景成分生成部1008は、時間混合比および任意の背景画像を基に、背景成分画像を生成して、混合領域画像合成部1009に供給する。
【0617】
ステップS929において、混合領域画像合成部1009は、背景成分生成部1007から供給された背景成分画像と動きボケが付加された前景成分画像とを合成することにより、混合領域合成画像を生成して、生成した混合領域合成画像を画像合成部1010に供給する。
【0618】
画像合成部1010は、領域情報調整部1006より供給される領域情報を基に、動きボケ付加部1005により動きボケが付加された前景成分画像、混合領域画像合成部1022から供給された混合領域合成画像、および任意の背景画像を合成して、合成画像を生成して出力する。
【0619】
以上の処理により、前景成分画像の輪郭部分が画素単位で形成された輪郭ではなく、空間混合比を考慮して、スムージングした前景成分画像が合成されるため、図94で示される混合比のように、階段状の前景成分画像の空間の連続性が考慮された、違和感のない合成画像を生成することが可能となる。尚、図94では、白色が前景成分画像の混合比1を示し、黒色が前景成分画像の混合比0、すなわち、前景成分画像以外の領域(例えば、背景成分画像の領域)を示している。従って、白、および、黒の中間色は、混合領域であることを示しており、黒色に近い部分ほど混合比が高いことが示されている。
【0620】
また、図95は、図94上の前景成分画像の画素と背景成分画像の画素の混合比に基づいて、合成された画像の画素値の分布を示したものであり、水平方向と垂直方向の座標位置上の画素値の分布が示されている。高いところほど画素値が高いことを示している。
【0621】
図95で示されるように、以上の処理により、前景成分画像と背景成分画像の境界付近は、滑らかに画素値が変化している。このため、合成された画像には、混合領域においても破綻が生じることなく、見た目にも自然な合成画像が生成されていることが示されている。
【0622】
結果として、図96で示されているような前景成分画像と背景成分画像が、より自然な状態で合成された合成画像を生成することが可能となる。尚、図96においては、図中下部で示されるように、略左部が前景成分画像であり、略右部が背景成分画像となっている。
【0623】
以上においては、前景成分画像の輪郭を形成する画素の空間混合比を、前景成分画像の輪郭を平滑化して、輪郭の画素上の面積の割合に応じた空間混合比を求めることによりスムージングし、前景成分画像と背景成分画像を見た目に自然に合成させる例について説明してきたが、前景成分画像の輪郭となる端部の画素は、上述したように空間的に前景成分画像と背景成分画像が混合していることが多い。そこで、前景成分画像の輪郭を形成する画素については、空間的に前景成分画像と背景成分画像が混合しているものとし、端部以外の画素より外挿補間により空間混合比を求めるようにしてもよい。
【0624】
図97は、前景成分画像の輪郭を形成する画素については、空間的に前景成分画像と背景成分画像が混合しているものとし、端部以外の画素より外挿補間により空間混合比を求めるようにした合成部107の構成を示している。
【0625】
尚、図87で示した構成と同一のものについては、同一の番号を付して適宜説明は省略するものとする。
【0626】
図97の合成部107は、図87の合成部107と基本的に同様の機能を果たすものであるが、輪郭抽出部1001、輪郭平滑化部1002、および空間混合比生成部1003に代えて、輪郭近傍画素抽出部1101、外挿補間部1102および、空間混合比生成部1103が設けられており、さらに、領域情報調整部1006が削除されていることが異なる。
【0627】
輪郭近傍画素抽出部1101は、入力された動きボケが除去された前景成分画像(動きボケのない前景画像)の輪郭となる端部とその付近の画素の情報を抽出し、外挿補間部1102に供給する。
【0628】
外挿補間部1102は、輪郭近傍画素抽出部1101より供給された前景成分画像の輪郭とその近傍の画素に基づいて、前景成分画像の輪郭を形成する画素の前景成分画像のみからなる画素値を外挿補間により求めて、求められた前景成分画像の輪郭を形成する画素の情報と、輪郭の近傍の画素を空間混合比生成部1103に供給する。
【0629】
すなわち、前景成分画像の画素値と、背景成分画像の画素値が図98の図中左部で示されるような場合、対応する空間混合比は、図98の右部で示されるように、前景成分画像の画素が存在する領域は1となり背景成分画像の領域は0となる。これは、前景成分画像の輪郭を形成する画素に空間的な混合が生じていないことが前提となったものであり、図98の右部で示される前景成分画像の輪郭を形成する画素には、背景成分画像の成分を含まない(混合が生じていないこと)が前提となっている。尚、図98の左部においては、左から3番目までの縦棒が前景成分画像の画素の画素値のレベルを示しており、右から2番目までの縦棒が背景成分画像の画素の画素値のレベルを示している。従って、左から3番目の縦棒が前景成分画像の輪郭を形成する端部の画素である。
【0630】
しかしながら、前景成分画像の輪郭を形成する画素は、図88で示されるように、画素内で輪郭(エッジ)が生じることが多く、実際には、前景成分画像と背景成分画像が混合しているものと考えられる。
【0631】
外挿補間部1102は、前景成分画像の輪郭を形成する端部の画素の画素値を、その端部近傍の画素を用いた外挿補間により前景成分画像の輪郭を形成する端部の、前景成分画像の成分のみからなる画素値を求める(推定する)。例えば、図99の左部で示されるように、前景成分画像の画素が左から3画素連続して、水平方向、または、垂直方向に並んでいるものとする。
【0632】
このとき、図99の左部の左から3番目の画素に対応する縦棒で示される画素のレベルは、前景成分画像と背景成分画像が空間的に混合している画素値であり、左から2番目までの画素のレベルは、前景成分画像のみのレベルであるので、前景成分画像の輪郭を形成する画素(図99右部の左から3番目の画素)の本来の画素値(前景成分画像だけの画素値)は、図99中の右上部の左から2番目までの画素値に基づいて外挿補間された値(外挿補間により推定された値)である。
【0633】
より詳細には、外挿補間部1102は、前景成分画像の輪郭を形成する複数の画素(例えば、図99の右上部左から2番目までの画素)の画素値から図99中の右上部の点線で示された直線に相当する関数を求めると共に、その関数を用いて前景成分画像の輪郭を形成する画素(図99中の右上部の左から3番目の画素)の前景成分画像のみからなる画素値を求める。尚、図99の右上部においては、黒色で塗られた縦棒が、入力された前景成分画像の画素値(前景成分画像と背景成分画像が空間的に混合している画素の画素値)を示し、黒色と灰色の領域を合計した縦棒が外挿補間により求められた前景成分画像のみの画素値(推定画素値)を示している。
【0634】
尚、外挿補間に用いられる前景成分画像の輪郭を形成する画素の近傍画素は、輪郭を形成する画素から見て、後述する動きボケを付加する処理において、付加される動きの方向に隣接する画素が用いられる。このようにすることで、前景成分画像を構成する画素間の連続性が保たれるので、前景成分画像により自然な動きボケを付加することが可能となり、さらに、任意の背景画像と合成することで、より自然な合成画像を生成することが可能となる。また、外挿補間するために求められる関数を求める際、外挿補間部1102は、前景成分画像の輪郭を形成する画素の近傍の2画素を用いて求めるように説明してきているが、2画素以上の画素を用いるようにしてもよい。
【0635】
空間混合比生成部1103は、入力された前景成分画像の輪郭を形成する画素の外挿補間により求められた画素値を用いて、輪郭を形成する画素の空間混合比を生成し前景成分画像スムージング部1004に出力する。
【0636】
すなわち、空間混合比生成部1103は、外挿補間により求められた前景成分画像の輪郭を形成する画素に対する入力された前景成分画像の輪郭を形成する画素の画素値の割合を求め、これを空間混合比として前景成分画像スムージング部1004に出力する。
【0637】
より詳細には、図99の右上部の左から3番目の画素の画素値の黒色と灰色で塗られた部分で示されている画素値(外挿補間により求められた画素値)をPpとし、黒色のみが塗られた部分で示される画素値(入力された前景成分画像の画素値)をPrとするとき、空間混合比生成部1103は、空間混合比としてPr/Ppを求める。
【0638】
このような処理により、空間混合が考慮された空間混合比は、図99の右下部で示されるような分布となる。すなわち、左から2番目までの画素の空間混合比は1であり、左から3番目の画素の混合比は、Pr/Ppとなり、さらに、左から4,5番目の画素の空間混合比は0となる。
【0639】
次に、図100のフローチャートを参照して、図97の合成部107による画像の合成の処理について説明する。尚、図100のステップS944乃至S949の処理は、図93のフローチャートを参照して説明したステップS924,S925,927乃至930の処理と同様であるので、その説明は省略する。
【0640】
ステップS941において、輪郭近傍画素抽出部1101は、入力された前景成分画像より、その輪郭を形成している画素とその近傍の画素を抽出して、外挿補間部1102に出力する。
【0641】
すなわち、輪郭近傍画素抽出部1101は、例えば、図99を参照して説明したように、図99の左部の左から3番目の画素は、前景成分画像の輪郭を形成する画素となるので、その画素そのものと、左から2番目までの画素を、前景成分画像の輪郭を形成する画素の近傍の画素として抽出する。輪郭近傍画素抽出部1101は、このような処理を、前景成分画像の輪郭を形成している全ての画素について実行し、抽出した輪郭を形成する画素と、その近傍の画素の情報を外挿補間部1102に出力する。
【0642】
ステップS942において、外挿補間部1102は、輪郭近傍画素抽出部1101より供給される前景成分画像の輪郭を形成する画素と、その近傍の画素の画素値の情報に基づいて、輪郭を形成する画素を外挿補間により生成する。
【0643】
すなわち、外挿補間部1102は、例えば、図99の右上部の左から1,2番目の画素を前景成分画像の輪郭を形成する画素の近傍の画素として用い、例えば、最小自乗法により、図99の右上部の点線で示されるような近傍画素の画素値の変化を直線近似し、さらに、近似により求められた直線を用いて外挿補間することにより、図99の右上部の黒色と灰色に塗りつぶされた領域からなる縦棒からなる画素値を、前景成分画像の輪郭を形成する画素の画素値として求めて(推定して)、輪郭近傍画素抽出部1101より供給された入力された、前景成分画像の輪郭を形成する画素の画素値と共に空間混合比生成部1103に供給する。
【0644】
ステップS943において、空間混合比生成部1103は、外挿補間により求められた、前景成分画像の輪郭を形成する画素の画素値に対する、入力された前景成分画像の輪郭を形成する画素の画素値の割合を空間混合比として、全ての前景成分画像の輪郭を形成する画素毎に求めて、前景成分画像スムージング部1004に出力する。
【0645】
すなわち、空間混合比生成部1103は、上述したように、図99の右上部の左から3番目の画素の画素値の黒色と灰色で塗られた部分で示されている画素値(外挿補間により求められた画素値)をPpとし、黒色のみが塗られた部分で示される画素値(入力された前景成分画像の画素値)をPrとするとき、空間混合比生成部1103は、Pr/Ppを空間混合比として求めて出力する。
【0646】
このような処理により、空間混合が考慮された空間混合比は、図99の右下部で示されるように、左から2番目までの画素の空間混合比は1となり、左から3番目の画素の混合比は、Pr/Ppとなり、さらに、左から4,5番目の画素の空間混合比は0となる。
【0647】
以上によれば、画素単位で前景成分画像の輪郭を表現することにより生じていた階段状の破綻現象は、空間混合比が考慮されるので、輪郭を形成する画素の画素値を正確に表現することができ、前景成分画像と任意の背景成分画像を合成しても、見た目に自然な合成画像を生成することが可能となる。
【0648】
なお、センサは、CCDに限らす、固体撮像素子である、例えば、BBD(Bucket Brigade Device)、CID(Charge Injection Device)、またはCPD(Charge Priming Device)などのセンサでもよく、また、検出素子がマトリックス状に配置されているセンサに限らず、検出素子が1列に並んでいるセンサでもよい。
【0649】
上述した一連の処理は、ハードウェアにより実行させることもできるが、ソフトウェアにより実行させることもできる。一連の処理をソフトウェアにより実行させる場合には、そのソフトウェアを構成するプログラムが、専用のハードウェアに組み込まれているコンピュータ、または、各種のプログラムをインストールすることで、各種の機能を実行させることが可能な、例えば汎用のパーソナルコンピュータなどに記録媒体からインストールされる。
【0650】
図101は、図6の画像処理部の電気的な内部構成をソフトウェアにより実現する場合のパーソナルコンピュータの一実施の形態の構成を示している。パーソナルコンピュータのCPU2001は、パーソナルコンピュータの全体の動作を制御する。また、CPU2001は、バス2004および入出力インタフェース2005を介してユーザからキーボードやマウスなどからなる入力部2006から指令が入力されると、それに対応してROM(Read Only Memory)2002に格納されているプログラムを実行する。あるいはまた、CPU2001は、ドライブ2010に接続された磁気ディスク2021、光ディスク2022、光磁気ディスク2023、または半導体メモリ2024から読み出され、記憶部2008にインストールされたプログラムを、RAM(Random Access Memory)2003にロードして実行する。これにより、上述した図6の画像処理部の機能が、ソフトウェアにより実現されている。さらに、CPU2001は、通信部2009を制御して、外部と通信し、データの授受を実行する。
【0651】
プログラムが記録されている記録媒体は、図101に示すように、コンピュータとは別に、ユーザにプログラムを提供するために配布される、プログラムが記録されている磁気ディスク2021(フレキシブルディスクを含む)、光ディスク2022(CD-ROM(Compact Disc-Read Only Memory),DVD(Digital Versatile Disk)を含む)、光磁気ディスク2023(MD(Mini-Disc)を含む)、もしくは半導体メモリ2024などよりなるパッケージメディアにより構成されるだけでなく、コンピュータに予め組み込まれた状態でユーザに提供される、プログラムが記録されているROM2002や、記憶部2008に含まれるハードディスクなどで構成される。
【0652】
尚、本明細書において、記録媒体に記録されるプログラムを記述するステップは、記載された順序に沿って時系列的に行われる処理は、もちろん、必ずしも時系列的に処理されなくとも、並列的あるいは個別に実行される処理を含むものである。
【0653】
【発明の効果】
本発明によれば、前景成分画像と任意の背景成分画像を見た目に自然な画像として合成することが可能となる。
【図面の簡単な説明】
【図1】従来の合成画像を示す図である。
【図2】従来の合成画像の画素値の分布を示す図である。
【図3】従来の合成画像の混合比を示す図である。
【図4】従来の合成画像の前景成分画像と背景成分画像の画素単位の関係を示す図である。
【図5】本来の合成画像の前景成分画像と背景成分画像の画素単位の関係を示す図である。
【図6】画像処理部の構成例を示すブロック図である。
【図7】センサによる撮像を説明する図である。
【図8】画素の配置を説明する図である。
【図9】検出素子の動作を説明する図である。
【図10】動いている前景に対応するオブジェクトと、静止している背景に対応するオブジェクトとを撮像して得られる画像を説明する図である。
【図11】背景領域、前景領域、混合領域、カバードバックグラウンド領域、およびアンカバードバックグラウンド領域を説明する図である。
【図12】静止している前景に対応するオブジェクトおよび静止している背景に対応するオブジェクトを撮像した画像における、隣接して1列に並んでいる画素の画素値を時間方向に展開したモデル図である。
【図13】画素値を時間方向に展開し、シャッタ時間に対応する期間を分割したモデル図である。
【図14】画素値を時間方向に展開し、シャッタ時間に対応する期間を分割したモデル図である。
【図15】画素値を時間方向に展開し、シャッタ時間に対応する期間を分割したモデル図である。
【図16】前景領域、背景領域、および混合領域の画素を抽出した例を示す図である。
【図17】画素と画素値を時間方向に展開したモデルとの対応を示す図である。
【図18】画素値を時間方向に展開し、シャッタ時間に対応する期間を分割したモデル図である。
【図19】画素値を時間方向に展開し、シャッタ時間に対応する期間を分割したモデル図である。
【図20】画素値を時間方向に展開し、シャッタ時間に対応する期間を分割したモデル図である。
【図21】画素値を時間方向に展開し、シャッタ時間に対応する期間を分割したモデル図である。
【図22】画素値を時間方向に展開し、シャッタ時間に対応する期間を分割したモデル図である。
【図23】合成画像生成の処理を説明するフローチャートである。
【図24】領域特定部103の構成を示すブロック図である。
【図25】前景に対応するオブジェクトが移動しているときの画像を説明する図である。
【図26】画素値を時間方向に展開し、シャッタ時間に対応する期間を分割したモデル図である。
【図27】画素値を時間方向に展開し、シャッタ時間に対応する期間を分割したモデル図である。
【図28】画素値を時間方向に展開し、シャッタ時間に対応する期間を分割したモデル図である。
【図29】領域判定の条件を説明する図である。
【図30】領域特定部103の領域の特定の結果の例を示す図である。
【図31】領域特定部103の領域の特定の結果の例を示す図である。
【図32】領域特定の処理を説明するフローチャートである。
【図33】領域特定部103の他の構成を示すブロック図である。
【図34】画素値を時間方向に展開し、シャッタ時間に対応する期間を分割したモデル図である。
【図35】背景画像の例を示す図である。
【図36】2値オブジェクト画像抽出部302の構成を示すブロック図である。
【図37】相関値の算出を説明する図である。
【図38】相関値の算出を説明する図である。
【図39】2値オブジェクト画像の例を示す図である。
【図40】時間変化検出部303の構成を示すブロック図である。
【図41】領域判定部342の判定を説明する図である。
【図42】時間変化検出部303の判定の例を示す図である。
【図43】領域判定部103の領域特定の処理を説明するフローチャートである。
【図44】領域判定の処理の詳細を説明するフローチャートである。
【図45】領域特定部103のさらに他の構成を示すブロック図である。
【図46】ロバスト化部361の構成を説明するブロック図である。
【図47】動き補償部381の動き補償を説明する図である。
【図48】動き補償部381の動き補償を説明する図である。
【図49】領域特定の処理を説明するフローチャートである。
【図50】ロバスト化の処理の詳細を説明するフローチャートである。
【図51】混合比算出部104の構成を示すブロック図である。
【図52】推定混合比処理部401の構成を示すブロック図である。
【図53】画素値を時間方向に展開し、シャッタ時間に対応する期間を分割したモデル図である。
【図54】重み付け差分を説明するモデル図である。
【図55】重み付け差分を説明するモデル図である。
【図56】重み付け差分と動きベクトルとの関係を説明するモデル図である。
【図57】相関値の演算を説明するモデル図である。
【図58】相関値の演算の対象となる画素のブロックの例を示す図である。
【図59】混合比算出部104の他の構成を示すブロック図である。
【図60】混合比の算出の処理を説明するフローチャートである。
【図61】カバードバックグラウンド領域に対応する混合比推定の処理を説明するフローチャートである。
【図62】混合比αを近似する直線を説明する図である。
【図63】混合比αを近似する平面を説明する図である。
【図64】混合比αを算出するときの複数のフレームの画素の対応を説明する図である。
【図65】混合比推定処理部401の他の構成を示すブロック図である。
【図66】推定混合比の例を示す図である。
【図67】カバードバックグラウンド領域に対応するモデルによる混合比推定の処理を説明するフローチャートである。
【図68】前景背景分離部105の構成の一例を示すブロック図である。
【図69】入力画像、前景成分画像、および背景成分画像を示す図である。
【図70】入力画像、前景成分画像、および背景成分画像を示す図である。
【図71】画素値を時間方向に展開し、シャッタ時間に対応する期間を分割したモデル図である。
【図72】画素値を時間方向に展開し、シャッタ時間に対応する期間を分割したモデル図である。
【図73】画素値を時間方向に展開し、シャッタ時間に対応する期間を分割したモデル図である。
【図74】分離部601の構成の一例を示すブロック図である。
【図75】分離された前景成分画像、および背景成分画像の例を示す図である。
【図76】前景と背景との分離の処理を説明するフローチャートである。
【図77】動きボケ除去部106の構成の一例を示すブロック図である。
【図78】処理単位を説明する図である。
【図79】前景成分画像の画素値を時間方向に展開し、シャッタ時間に対応する期間を分割したモデル図である。
【図80】前景成分画像の画素値を時間方向に展開し、シャッタ時間に対応する期間を分割したモデル図である。
【図81】動きボケ除去部106による前景成分画像に含まれる動きボケの除去の処理を説明するフローチャートである。
【図82】動きボケ除去部106の他の構成を示す図である。
【図83】画素値と前景の成分のとの対応を指定するモデルの例を示す図である。
【図84】前景の成分の算出を説明する図である。
【図85】前景の成分の算出を説明する図である。
【図86】前景の動きボケの除去の処理を説明するフローチャートである。
【図87】合成部107の構成の一例を示すブロック図である。
【図88】前景成分画像の輪郭部の平滑化処理を説明する図である。
【図89】前景成分画像の輪郭部のスムージング処理を説明する図である。
【図90】前景成分画像の輪郭部のスムージング処理を説明する図である。
【図91】前景成分画像の画素値を時間方向に展開し、シャッタ時間に対応する期間を分割したモデル図である。
【図92】前景成分画像の画素値を時間方向に展開し、シャッタ時間に対応する期間を分割したモデル図である。
【図93】画像の合成の処理を説明するフローチャートである。
【図94】合成された画像の混合比を示す図である。
【図95】合成された画像の画素値の分布を示す図である。
【図96】合成された画像を示す図である。
【図97】合成部107の構成のその他の一例を示すブロック図である。
【図98】前景成分画像の画素値レベルと混合比の対応を示す図である。
【図99】前景成分画像の輪郭を形成する画素の画素値レベルを外挿補間して求め、外挿補間により求められた画素値と、入力された画像の画素値に基づいて混合比を求める手法を説明する図である。
【図100】画像の合成の処理を説明するフローチャートである。
【図101】記録媒体を説明する図である。
【符号の説明】
21 CPU, 22 ROM, 23 RAM, 26 入力部, 27 出力部,28 記憶部, 29 通信部, 51 磁気ディスク, 52 光ディスク, 53 光磁気ディスク, 54 半導体メモリ, 101 オブジェクト抽出部, 102 動き検出部, 103 領域特定部, 104 混合比算出部, 105 前景背景分離部, 106 動きボケ除去部, 107 合成部,201 フレームメモリ, 202−1乃至202−4 静動判定部, 203−1乃至203−3 領域判定部, 204 判定フラグ格納フレームメモリ, 205 合成部, 206 判定フラグ格納フレームメモリ, 301 背景画像生成部, 302 2値オブジェクト画像抽出部, 303 時間変化検出部, 321 相関値演算部, 322 しきい値処理部, 341 フレームメモリ, 342 領域判定部, 361 ロバスト化部, 381 動き補償部, 382 スイッチ, 383−1乃至383−N フレームメモリ、 384−1乃至384−N 重み付け部, 385 積算部, 401 推定混合比処理部, 402 推定混合比処理部, 403 混合比決定部, 421フレームメモリ, 422 重み生成部, 423 重み付けフレーム差分演算部, 424 動き補償部, 425 フレームメモリ, 426 相関値演算部, 427 最大値判定部, 441 選択部, 442 選択部, 601 分離部, 602 スイッチ, 603 合成部, 604 スイッチ, 605 合成部, 621 フレームメモリ, 622 分離処理ブロック, 623 フレームメモリ, 631 アンカバード領域処理部, 632 カバード領域処理部, 633 合成部, 634 合成部, 801 処理単位決定部, 802 モデル化部, 803 方程式生成部, 804 足し込み部, 805 演算部, 901 処理単位決定部, 902 モデル化部, 903 方程式生成部, 904 演算部, 905 補正部, 1001 輪郭抽出部, 1002 輪郭平滑化部, 1003 空間混合比生成部, 1004 前景成分画像スムージング部, 1005 動きボケ付加部, 1006 領域情報調整部, 1007 時間混合比算出部, 1008 背景成分生成部, 1009 混合領域画像合成部, 1010 画像合成部, 1101 輪郭近傍画素抽出部, 1102 外挿補間部, 1103 空間混合比生成部[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image processing apparatus and method, a recording medium, and a program, and more particularly to an image processing apparatus and method, a recording medium, and a program that can synthesize an image without failure.
[0002]
[Prior art]
An image synthesis technique for synthesizing a foreground component image and a background component image into one image is generally popular. That is, the image composition technique is to generate one composite image by compositing the foreground component image included in the first image and the background component image included in the second image. It is.
[0003]
In addition, there is one that adjusts the motion blur of the foreground component image and combines it with the background component image. (For example, refer to Patent Document 1).
[0004]
[Patent Document 1]
JP 2003-18564 A (Japanese Patent Application 2001-195605)
[0005]
[Problems to be solved by the invention]
By the way, when the composite image as shown in FIG. 1A is generated using the above-described conventional method, the mixing ratio of the foreground component image and the background component image has a distribution as shown in FIG. 1B. FIG. 1B shows the distribution of the mixture ratio of the foreground component and the background component for each pixel in color. In FIG. 1B, white indicates that the foreground component ratio is 1 and the background component is 0, and black indicates that the foreground component ratio is 0 and the background component is 1. Therefore, when the ratio of the foreground component and the background component is ½, gray (an intermediate color between white and black) is displayed.
[0006]
In FIGS. 1A and 1B, since the image that is the foreground component is an image that moves in the horizontal direction, motion blur occurs with respect to the background component. Therefore, the mixing between the foreground component and the background component In the region, there is a mixed region where the respective components are mixed.
[0007]
FIG. 2 shows the distribution of the pixel values of the foreground component image and the background component image on FIG. 1A, and the distribution of the pixel values at the coordinate positions in the horizontal and vertical directions. .
[0008]
As shown in FIGS. 1A, 1B, or 2, the pixel values and the mixing ratio change stepwise near the boundary between the foreground component image and the background component image. For this reason, the synthesized image has a problem in that the breakdown occurs in the mixed region and the image becomes unnatural.
[0009]
This is because the foreground component image and the background component image are obtained in units of pixels, so that the boundary portion combines the foreground component image from which motion blur is removed and the background component image as shown in FIG. As you can see, the continuity of the shape is not maintained, and the shape becomes stepped and jagged.
[0010]
That is, as shown in FIG. 4, light incident on a CCD (Charge Coupled Device) or the like is expressed for each pixel. In FIG. 4, the light-emitting area of the background component image is shown in black, and the light-emitting portion of the foreground component image is shown by a hatched portion, and the cup-like container is filled with the emitted light as if each pixel of the CCD was used. This indicates that each pixel is expressed. In the case of FIG. 4, the pixels from the left to the fourth have pixel values indicating the foreground component image, and the pixels from the right to the sixth background component image. That is, in FIG. 4, the foreground component image and the background component image are expressed in units of pixels. However, the actual boundary between the foreground component image and the background component image does not exist for each pixel of the CCD, and the boundary may be on the pixel.
[0011]
For example, as shown in FIG. 5, there may actually be a boundary between the foreground component image and the background component image on the CCD pixel. In FIG. 5, the center position of the fifth pixel from the left is the foreground component image, and the center position of the sixth pixel from the right represents the background component image. The fifth pixel from the left (from the right) The center position of the sixth pixel) is the boundary. In this case, in fact, the fifth pixel from the left should have a pixel value obtained by mixing the foreground component image and the background component image.
[0012]
However, since the foreground component image and the background component image described above are divided for each pixel, even if they are combined and motion blur is added, the boundary portion becomes a stepped shape, and the image is uncomfortable. There was a problem that it would become.
[0013]
The present invention has been made in view of such a situation, and enables a composite image to be accurately generated by expressing a mixed region that becomes a boundary between a foreground component image and a background component image in more detail. is there.
[0014]
[Means for Solving the Problems]
An image processing apparatus according to the present invention includes a pixel detection unit that detects a contour portion of a foreground image without motion blur, Regression line detection means for detecting a regression line by regressing the pixel positions of a plurality of pixels corresponding to the target pixel in the contour portion, and the space of each pixel according to the area of the foreground image component in each pixel near the regression line A spatial mixing ratio generating means for obtaining a mixing ratio; Contour portion detected by pixel detection means By multiplying the pixel value of the pixel forming the pixel by the spatial mixing ratio obtained by the spatial mixing ratio generating means Smoothing means for smoothing, By connecting the regression lines detected by the regression line detection means corresponding to each pixel of interest in the contour of the foreground image Motion blur adding means for generating a motion blur added foreground image in which motion blur is added in a predetermined direction to the foreground image whose contour is smoothed, and synthesis means for synthesizing the motion blur added foreground image and the background image. It is characterized by that.
[0016]
The image processing method of the present invention includes a pixel detection step for detecting a contour portion of a foreground image without motion blur, A regression line detection step for detecting a regression line by regressing the pixel positions of a plurality of pixels corresponding to the target pixel in the contour portion, and the space of each pixel according to the area of the foreground image component in each pixel near the regression line A spatial mixing ratio generation step for obtaining a mixing ratio; Contour part detected by pixel detection step By multiplying the pixel value of the pixel forming the pixel by the spatial mixture ratio obtained by the processing of the spatial mixture ratio generation step. A smoothing step for smoothing, By connecting the regression lines detected by the process of the regression line detection step corresponding to each pixel of interest in the contour of the foreground image A motion blur adding step for generating a motion blur added foreground image in which motion blur is added in a predetermined direction to the foreground image whose contour is smoothed, and a synthesis step for combining the motion blur added foreground image and the background image. It is characterized by that.
[0017]
The recording medium program of the present invention includes a pixel detection step for detecting a contour portion of a foreground image without motion blur, A regression line detection step for detecting a regression line by regressing the pixel positions of a plurality of pixels corresponding to the target pixel in the contour portion, and the space of each pixel according to the area of the foreground image component in each pixel near the regression line A spatial mixing ratio generation step for obtaining a mixing ratio; Contour part detected by pixel detection step By multiplying the pixel value of the pixel forming the pixel by the spatial mixture ratio obtained by the processing of the spatial mixture ratio generation step. A smoothing step for smoothing, By connecting the regression lines detected by the process of the regression line detection step corresponding to each pixel of interest in the contour of the foreground image A motion blur adding step for generating a motion blur added foreground image in which motion blur is added in a predetermined direction to the foreground image whose contour is smoothed, and a synthesis step for combining the motion blur added foreground image and the background image. A computer-readable program is recorded.
[0018]
The program of the present invention includes a pixel detection step for detecting a contour portion of a foreground image without motion blur, A regression line detection step for detecting a regression line by regressing the pixel positions of a plurality of pixels corresponding to the target pixel in the contour portion, and the space of each pixel according to the area of the foreground image component in each pixel near the regression line A spatial mixing ratio generation step for obtaining a mixing ratio; Contour part detected by pixel detection step By multiplying the pixel value of the pixel forming the pixel by the spatial mixture ratio obtained by the processing of the spatial mixture ratio generation step. A smoothing step for smoothing, By connecting the regression lines detected by the process of the regression line detection step corresponding to each pixel of interest in the contour of the foreground image A motion blur adding step for generating a motion blur added foreground image in which motion blur is added in a predetermined direction to the foreground image whose contour is smoothed, and a synthesis step for combining the motion blur added foreground image and the background image It is made to perform.
[0019]
In the image processing apparatus and method and the program of the present invention, a contour portion of a foreground image without motion blur is detected, The pixel position of a plurality of pixels corresponding to the target pixel in the contour is regressed to detect a regression line, and the spatial mixing ratio of each pixel is obtained according to the area of the foreground image component in each pixel near the regression line. , Detected contour By multiplying the pixel value of the pixels forming the pixel by the spatial mixing ratio Is smoothed, By connecting a regression line corresponding to each pixel of interest in the contour of the foreground image A motion blur added foreground image is generated by adding motion blur in a predetermined direction to the foreground image in which the contour portion is smoothed, and the motion blur added foreground image and the background image are combined.
[0020]
The image processing apparatus of the present invention may be an independent apparatus or a block that performs image processing.
[0021]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of the present invention will be described below. Correspondences between constituent elements described in the claims and specific examples in the embodiments of the present invention are exemplified as follows. This description is intended to confirm that specific examples supporting the invention described in the claims are described in the embodiments of the invention. Therefore, even though there are specific examples that are described in the embodiment of the invention but are not described here as corresponding to the configuration requirements, the specific examples are not included in the configuration. It does not mean that it does not correspond to a requirement. On the contrary, even if a specific example is described here as corresponding to a configuration requirement, this means that the specific example does not correspond to a configuration requirement other than the configuration requirement. not.
[0022]
Further, this description does not mean that all the inventions corresponding to the specific examples described in the embodiments of the invention are described in the claims. In other words, this description is an invention corresponding to the specific example described in the embodiment of the invention, and the existence of an invention not described in the claims of this application, that is, a future divisional application. Or the existence of an invention added by amendment is not denied.
[0023]
That is, the image processing apparatus of the present invention includes a pixel detection unit (for example, the contour extraction unit 1001 in FIG. 87) that detects a contour portion of a foreground image without motion blur, Regression line detection means (for example, the contour smoothing unit 1002 in FIG. 87) for regressing the pixel positions of a plurality of pixels corresponding to the target pixel in the contour part to detect a regression line, and the foreground image in each pixel near the regression line A spatial mixing ratio generating means (for example, a spatial mixing ratio generating unit 1003 in FIG. 87) for obtaining a spatial mixing ratio of each pixel according to the area of the component of Contour portion detected by pixel detection means By multiplying the pixel value of the pixel forming the pixel by the spatial mixing ratio obtained by the spatial mixing ratio generating means Smoothing means for smoothing (for example, foreground component image smoothing unit 1004 in FIG. 87); By connecting the regression lines detected by the regression line detection means corresponding to each pixel of interest in the contour of the foreground image Motion blur adding means (for example, motion blur adding unit 1005 in FIG. 87) for generating a motion blur added foreground image in which motion blur is added in a predetermined direction with respect to the foreground image whose contour is smoothed, and motion blur added foreground The image processing apparatus includes combining means (for example, the image combining unit 1010 in FIG. 87) for combining the image and the background image.
[0024]
Further, the image processing method of the present invention includes a pixel detection step (for example, the process of step S921 in the flowchart of FIG. 93) for detecting a contour portion of a foreground image without motion blur, A regression line detection step (for example, the process of step S922 in the flowchart of FIG. 93) for regressing the pixel positions of a plurality of pixels corresponding to the target pixel in the contour portion to detect a regression line, and the foreground in each pixel near the regression line A spatial mixing ratio generation step for obtaining a spatial mixing ratio of each pixel in accordance with the area of the component of the image (for example, the process of step S923 in the flowchart of FIG. 93); Contour part detected by pixel detection step By multiplying the pixel value of the pixel forming the pixel by the spatial mixture ratio obtained by the processing of the spatial mixture ratio generation step. A smoothing step (for example, the process of step S924 in the flowchart of FIG. 93), By connecting the regression lines detected by the process of the regression line detection step corresponding to each pixel of interest in the contour of the foreground image A motion blur addition step for generating a motion blur added foreground image in which motion blur is added in a predetermined direction to the foreground image in which the contour portion is smoothed (for example, processing in step S925 in the flowchart of FIG. 93), and motion blur addition And a synthesis step of synthesizing the foreground image and the background image (for example, the process of step S930 in the flowchart of FIG. 93).
[0025]
FIG. 6 is a block diagram showing a configuration of an embodiment of an image processing unit to which the present invention is applied.
[0026]
It does not matter whether each function of the image processing unit is realized by hardware or software. That is, each block diagram in this specification may be considered as a hardware block diagram or a software functional block diagram.
[0027]
Here, the motion blur refers to a distortion included in an image corresponding to a moving object, which is caused by the movement of an object in the real world to be imaged and the imaging characteristics of the sensor.
[0028]
In this specification, an image corresponding to an object in the real world to be imaged is referred to as an image object.
[0029]
The input image supplied to the image processing unit is supplied to the
[0030]
The
[0031]
The
[0032]
Further, for example, the
[0033]
The motion detection unit 102 calculates the motion vector of the image object corresponding to the coarsely extracted foreground object by a method such as a block matching method, a gradient method, a phase correlation method, and a per-recursive method. The motion vector and the position information of the motion vector (information specifying the position of the pixel corresponding to the motion vector) are supplied to the
[0034]
The motion vector output from the motion detection unit 102 includes information corresponding to the motion amount v.
[0035]
Further, for example, the motion detection unit 102 may output a motion vector for each image object to the motion
[0036]
The motion amount v is a value that represents a change in the position of the image corresponding to the moving object in units of pixel intervals. For example, when the image of the object corresponding to the foreground is moved so as to be displayed at a position separated by four pixels in the next frame with reference to a certain frame, the motion amount v of the image of the object corresponding to the foreground is 4.
[0037]
Note that the
[0038]
The
[0039]
Based on the input image and the region information supplied from the
[0040]
The mixing ratio α is a value indicating a ratio of an image component (hereinafter also referred to as a background component) corresponding to a background object in a pixel value, as shown in an equation (3) described later.
[0041]
Based on the region information supplied from the
[0042]
The motion
[0043]
The motion
[0044]
The synthesizing
[0045]
Next, an input image supplied to the image processing unit will be described with reference to FIGS.
[0046]
FIG. 7 is a diagram for explaining imaging by a sensor. The sensor is composed of, for example, a CCD video camera equipped with a CCD (Charge-Coupled Device) area sensor which is a solid-state image sensor. The object corresponding to the foreground in the real world moves horizontally between the object corresponding to the background and the sensor in the real world, for example, from the left side to the right side in the drawing.
[0047]
The sensor images an object corresponding to the foreground together with an object corresponding to the background. The sensor outputs the captured image in units of one frame. For example, the sensor outputs an image composed of 30 frames per second. The exposure time of the sensor can be 1/30 second. The exposure time is a period from the start of the conversion of the input light into the electric charge until the end of the conversion of the input light into the electric charge. Hereinafter, the exposure time is also referred to as shutter time.
[0048]
FIG. 8 is a diagram for explaining the arrangement of pixels. In FIG. 8, A to I indicate individual pixels. The pixels are arranged on a plane corresponding to the image. One detection element corresponding to one pixel is arranged on the sensor. When the sensor captures an image, one detection element outputs a pixel value corresponding to one pixel constituting the image. For example, the position of the detection element in the X direction corresponds to the horizontal position on the image, and the position of the detection element in the Y direction corresponds to the vertical position on the image.
[0049]
As shown in FIG. 9, for example, a detection element that is a CCD converts input light into electric charges for a period corresponding to a shutter time, and accumulates the converted electric charges. The amount of charge is approximately proportional to the intensity of input light and the time during which light is input. The detection element adds the electric charge converted from the input light to the already accumulated electric charge in a period corresponding to the shutter time. That is, the detection element integrates the input light for a period corresponding to the shutter time, and accumulates an amount of charge corresponding to the integrated light. It can be said that the detection element has an integration effect with respect to time.
[0050]
The electric charge accumulated in the detection element is converted into a voltage value by a circuit (not shown), and the voltage value is further converted into a pixel value such as digital data and output. Therefore, each pixel value output from the sensor is a value projected onto a one-dimensional space, which is the result of integrating a part of the object corresponding to the foreground or background having a spatial extent with respect to the shutter time. Have.
[0051]
The image processing unit extracts significant information buried in the output signal, for example, the mixing ratio α, by the accumulation operation of the sensor. The image processing unit adjusts the amount of distortion caused by the mixture of the foreground image objects themselves, for example, the amount of motion blur. In addition, the image processing unit adjusts the amount of distortion caused by the mixture of the foreground image object and the background image object.
[0052]
FIG. 10 is a diagram for explaining an image obtained by imaging an object corresponding to a moving foreground and an object corresponding to a stationary background. FIG. 10A shows an image obtained by imaging an object corresponding to a foreground with movement and an object corresponding to a stationary background. In the example shown in FIG. 10A, the object corresponding to the foreground is moving horizontally from the left to the right with respect to the screen.
[0053]
FIG. 10B is a model diagram in which pixel values corresponding to one line of the image shown in FIG. 10A are expanded in the time direction. The horizontal direction in FIG. 10B corresponds to the spatial direction X in FIG. 10A.
[0054]
The pixel value of the background region pixel is composed of only the background component, that is, the image component corresponding to the background object. The pixel value of the foreground region pixel is composed of only the foreground component, that is, the image component corresponding to the foreground object.
[0055]
The pixel value of the pixel in the mixed area is composed of a background component and a foreground component. Since the pixel value is composed of the background component and the foreground component, the mixed region can be said to be a distortion region. The mixed area is further classified into a covered background area and an uncovered background area.
[0056]
The covered background area is a mixed area at a position corresponding to the front end of the foreground object in the advancing direction with respect to the foreground area, and is an area where the background component is covered with the foreground as time passes.
[0057]
On the other hand, the uncovered background area is a mixed area at a position corresponding to the rear end portion of the foreground object in the advancing direction with respect to the foreground area, and an area where a background component appears as time passes. Say.
[0058]
In this way, an image including a foreground area, a background area, or a covered background area or an uncovered background area is input as an input image to the
[0059]
FIG. 11 is a diagram illustrating the background area, the foreground area, the mixed area, the covered background area, and the uncovered background area as described above. In the case of corresponding to the image shown in FIG. 11, the background area is a static part, the foreground area is a moving part, and the covered background area of the mixed area is a part that changes from the background to the foreground. The uncovered background area is a portion that changes from the foreground to the background.
[0060]
FIG. 12 is a model diagram in which pixel values of pixels arranged in a row adjacent to each other in an image obtained by capturing an object corresponding to a stationary foreground and an object corresponding to a stationary background are expanded in the time direction. It is. For example, pixels arranged on one line of the screen can be selected as the pixels arranged adjacent to each other in one column.
[0061]
The pixel values F01 to F04 shown in FIG. 12 are pixel values corresponding to the still foreground object. The pixel values B01 to B04 shown in FIG. 12 are pixel values corresponding to the stationary background object.
[0062]
In the vertical direction in FIG. 12, time elapses from the top to the bottom in the figure. The position of the upper side of the rectangle in FIG. 12 corresponds to the time when the sensor starts to convert the input light into electric charge, and the position of the lower side of the rectangle in FIG. 12 indicates the electric charge of the light input by the sensor. Corresponds to the time to finish conversion of. That is, the distance from the upper side to the lower side of the rectangle in FIG. 12 corresponds to the shutter time.
[0063]
Hereinafter, a case where the shutter time and the frame interval are the same will be described as an example.
[0064]
The horizontal direction in FIG. 12 corresponds to the spatial direction X described in FIG. More specifically, in the example shown in FIG. 12, the distance from the left side of the rectangle described as “F01” in FIG. 12 to the right side of the rectangle described as “B04” is eight times the pixel pitch, That is, it corresponds to the interval between eight consecutive pixels.
[0065]
When the foreground object and the background object are stationary, the light input to the sensor does not change during the period corresponding to the shutter time.
[0066]
Here, the period corresponding to the shutter time is divided into two or more periods having the same length. For example, if the number of virtual divisions is 4, the model diagram shown in FIG. 12 can be represented as the model shown in FIG. The virtual division number is set corresponding to the amount of movement v of the object corresponding to the foreground within the shutter time. For example, the number of virtual divisions is 4 corresponding to the motion amount v being 4, and the period corresponding to the shutter time is divided into 4.
[0067]
The top row in the figure corresponds to the first divided period after the shutter opens. The second row from the top in the figure corresponds to the second divided period from when the shutter has opened. The third line from the top in the figure corresponds to the third divided period from when the shutter has opened. The fourth row from the top in the figure corresponds to the fourth divided period from when the shutter has opened.
[0068]
Hereinafter, the shutter time divided in accordance with the motion amount v is also referred to as shutter time / v.
[0069]
Since the light input to the sensor does not change when the object corresponding to the foreground is stationary, the foreground component F01 / v is equal to a value obtained by dividing the pixel value F01 by the virtual division number. Similarly, when the object corresponding to the foreground is stationary, the foreground component F02 / v is equal to the value obtained by dividing the pixel value F02 by the number of virtual divisions, and the foreground component F03 / v is the virtual value of the pixel value F03. The foreground component F04 / v is equal to the value obtained by dividing the pixel value F04 by the virtual division number.
[0070]
Since the light input to the sensor does not change when the object corresponding to the background is stationary, the background component B01 / v is equal to the value obtained by dividing the pixel value B01 by the virtual division number. Similarly, when the object corresponding to the background is stationary, the background component B02 / v is equal to the value obtained by dividing the pixel value B02 by the virtual division number, and B03 / v is obtained by dividing the pixel value B03 by the virtual division number. B04 / v is equal to a value obtained by dividing the pixel value B04 by the number of virtual divisions.
[0071]
That is, when the object corresponding to the foreground is stationary, the light corresponding to the foreground object input to the sensor does not change during the period corresponding to the shutter time. The foreground component F01 / v corresponding to, the foreground component F01 / v corresponding to the second shutter time / v after the shutter opens, and the third foreground corresponding to the shutter time / v corresponding to the shutter time / v. And the foreground component F01 / v corresponding to the fourth shutter time / v after the shutter is opened have the same value. F02 / v to F04 / v have the same relationship as F01 / v.
[0072]
When the object corresponding to the background is stationary, the light corresponding to the background object input to the sensor does not change during the period corresponding to the shutter time, so it corresponds to the first shutter time / v after the shutter opens. Background component B01 / v, the second background component B01 / v corresponding to the shutter time / v after the shutter opens, and the third background component corresponding to the shutter time / v corresponding to the shutter time / v B01 / v and the fourth background component B01 / v corresponding to the shutter time / v after the shutter is opened have the same value. B02 / v to B04 / v have the same relationship.
[0073]
Next, a case where the object corresponding to the foreground moves and the object corresponding to the background is stationary will be described.
[0074]
FIG. 14 is a model diagram in which pixel values of pixels on one line including the covered background area are expanded in the time direction when the object corresponding to the foreground moves toward the right side in the drawing. In FIG. 14, the foreground motion amount v is 4. Since one frame is a short time, it can be assumed that the object corresponding to the foreground is a rigid body and is moving at a constant speed. In FIG. 14, the image of the object corresponding to the foreground moves so as to be displayed on the right side by four pixels in the next frame with reference to a certain frame.
[0075]
In FIG. 14, the leftmost pixel through the fourth pixel from the left belong to the foreground area. In FIG. 14, the fifth through seventh pixels from the left belong to the mixed area, which is a covered background area. In FIG. 14, the rightmost pixel belongs to the background area.
[0076]
Since the object corresponding to the foreground is moving so as to cover the object corresponding to the background with the passage of time, the component included in the pixel value of the pixel belonging to the covered background area has a period corresponding to the shutter time. At this point, the background component is replaced by the foreground component.
[0077]
For example, the pixel value M with a thick line frame in FIG. 14 is expressed by Expression (1).
[0078]
M = B02 / v + B02 / v + F07 / v + F06 / v (1)
[0079]
For example, since the fifth pixel from the left includes a background component corresponding to one shutter time / v and includes a foreground component corresponding to three shutter times / v, the mixture ratio of the fifth pixel from the left α is 1/4. The sixth pixel from the left includes a background component corresponding to two shutter times / v and includes a foreground component corresponding to two shutter times / v. Therefore, the mixture ratio α of the sixth pixel from the left is 1/2. The seventh pixel from the left includes a background component corresponding to three shutter times / v, and includes a foreground component corresponding to one shutter time / v. Therefore, the mixture ratio α of the seventh pixel from the left is 3/4.
[0080]
Since it can be assumed that the object corresponding to the foreground is a rigid body and moves at a constant speed so that the foreground image is displayed on the right side of four pixels in the next frame, for example, the fourth pixel from the left in FIG. The foreground component F07 / v of the first shutter time / v after the shutter opens is the foreground component corresponding to the second shutter time / v of the fifth pixel from the left in FIG. be equivalent to. Similarly, the foreground component F07 / v corresponds to the foreground component of the sixth pixel from the left in FIG. 14 corresponding to the third shutter time / v from when the shutter has opened, and the seventh pixel from the left in FIG. And the foreground component corresponding to the fourth shutter time / v after the shutter is opened.
[0081]
Since it can be assumed that the object corresponding to the foreground is a rigid body and moves at a constant speed so that the foreground image is displayed on the right side of four pixels in the next frame, for example, the third pixel from the left in FIG. The foreground component F06 / v of the first shutter time / v after the shutter is opened is the foreground component corresponding to the second shutter time / v of the fourth pixel from the left in FIG. equal. Similarly, the foreground component F06 / v is the sixth pixel from the left in FIG. 14 and the foreground component of the fifth pixel from the left in FIG. 14 corresponding to the third shutter time / v from when the shutter has opened. And the foreground component corresponding to the fourth shutter time / v after the shutter is opened.
[0082]
Since it can be assumed that the object corresponding to the foreground is a rigid body and moves at a constant speed so that the foreground image is displayed on the right side of four pixels in the next frame, for example, the second pixel from the left in FIG. The foreground component F05 / v of the first shutter time / v after the shutter is opened is the foreground component corresponding to the second shutter time / v of the third pixel from the left in FIG. be equivalent to. Similarly, the foreground component F05 / v is the fourth pixel from the left in FIG. 14 and the foreground component corresponding to the third shutter time / v after the shutter is opened, and the fifth pixel from the left in FIG. And the foreground component corresponding to the fourth shutter time / v after the shutter is opened.
[0083]
Since it can be assumed that the object corresponding to the foreground is a rigid body and moves at a constant speed so that the foreground image is displayed on the right side of four pixels in the next frame, for example, the shutter of the leftmost pixel in FIG. The foreground component F04 / v of the first shutter time / v after opening is equal to the foreground component of the second pixel from the left in FIG. 14 corresponding to the second shutter time / v after the shutter is opened. Similarly, the foreground component F04 / v corresponds to the foreground component of the third pixel from the left in FIG. 14 corresponding to the third shutter time / v from when the shutter has opened, and the fourth pixel from the left in FIG. And the foreground component corresponding to the fourth shutter time / v after the shutter is opened.
[0084]
Since the foreground area corresponding to the moving object includes motion blur as described above, it can be said to be a distortion area.
[0085]
FIG. 15 is a model diagram in which pixel values of pixels on one line including the uncovered background area are expanded in the time direction when the foreground moves toward the right side in the drawing. In FIG. 15, the foreground motion amount v is 4. Since one frame is a short time, it can be assumed that the object corresponding to the foreground is a rigid body and is moving at a constant speed. In FIG. 15, the image of the object corresponding to the foreground moves to the right by four pixels in the next frame with reference to a certain frame.
[0086]
In FIG. 15, the leftmost pixel through the fourth pixel from the left belong to the background area. In FIG. 15, the fifth through seventh pixels from the left belong to the mixed area that is an uncovered background. In FIG. 15, the rightmost pixel belongs to the foreground area.
[0087]
Since the object corresponding to the foreground that covered the object corresponding to the background is moved so as to be removed from the front of the object corresponding to the background over time, it is included in the pixel value of the pixel belonging to the uncovered background area The component to be changed from the foreground component to the background component at a certain point in time corresponding to the shutter time.
[0088]
For example, the pixel value M ′ with a thick frame in FIG. 15 is expressed by Expression (2).
[0089]
M '= F02 / v + F01 / v + B26 / v + B26 / v (2)
[0090]
For example, the fifth pixel from the left includes a background component corresponding to three shutter times / v, and includes a foreground component corresponding to one shutter time / v, so the mixing ratio of the fifth pixel from the left α is 3/4. The sixth pixel from the left includes a background component corresponding to two shutter times / v and includes a foreground component corresponding to two shutter times / v. Therefore, the mixture ratio α of the sixth pixel from the left is 1/2. Since the seventh pixel from the left includes a background component corresponding to one shutter time / v and includes a foreground component corresponding to three shutter times / v, the mixture ratio α of the seventh pixel from the left is 1/4.
[0091]
When the expressions (1) and (2) are generalized, the pixel value M is expressed by the expression (3).
[0092]
[Expression 1]
... (3)
Here, α is a mixing ratio. B is a background pixel value, and Fi / v is a foreground component.
[0093]
Since the object corresponding to the foreground is a rigid body and can be assumed to move at a constant speed, and the amount of movement v is 4, for example, the first pixel from the left in FIG. The foreground component F01 / v of the shutter time / v is equal to the foreground component of the sixth pixel from the left in FIG. 15 corresponding to the second shutter time / v after the shutter is opened. Similarly, F01 / v represents the foreground component of the seventh pixel from the left in FIG. 15 corresponding to the third shutter time / v from when the shutter has opened, and the eighth pixel from the left in FIG. , And the foreground component corresponding to the fourth shutter time / v after the shutter is opened.
[0094]
Since it can be assumed that the object corresponding to the foreground is a rigid body and moves at a constant speed, and the number of virtual divisions is 4, for example, the first pixel from the left in FIG. The foreground component F02 / v of the shutter time / v is equal to the foreground component of the seventh pixel from the left in FIG. 15 corresponding to the second shutter time / v after the shutter is opened. Similarly, the foreground component F02 / v is equal to the foreground component of the eighth pixel from the left in FIG. 15 corresponding to the third shutter time / v from when the shutter has opened.
[0095]
Since the object corresponding to the foreground is a rigid body and can be assumed to move at a constant speed and the amount of movement v is 4, for example, the seventh pixel from the left in FIG. The foreground component F03 / v of the shutter time / v is equal to the foreground component of the eighth pixel from the left in FIG. 15 corresponding to the second shutter time / v after the shutter is opened.
[0096]
In the description of FIGS. 13 to 15, it has been described that the virtual division number is 4, but the virtual division number corresponds to the motion amount v. The amount of movement v generally corresponds to the moving speed of the object corresponding to the foreground. For example, when the object corresponding to the foreground is moving so as to be displayed to the right by four pixels in the next frame with reference to a certain frame, the amount of movement v is 4. Corresponding to the motion amount v, the number of virtual divisions is 4. Similarly, for example, when the object corresponding to the foreground is moving so that it is displayed on the left by 6 pixels in the next frame with reference to a certain frame, the motion amount v is set to 6, and the number of virtual divisions is , 6.
[0097]
FIG. 16 and FIG. 17 show the above-described mixed area composed of the foreground area, the background area, the covered background area, or the uncovered background area, and the foreground components and the background components corresponding to the divided shutter times. The relationship is shown.
[0098]
FIG. 16 shows an example in which pixels in the foreground area, background area, and mixed area are extracted from an image including a foreground corresponding to an object moving in front of a stationary background. In the example shown in FIG. 16, the object corresponding to the foreground is moving horizontally with respect to the screen.
[0099]
Frame # n + 1 is the next frame after frame #n, and frame # n + 2 is the next frame after frame # n + 1.
[0100]
Extract the pixels in the foreground area, background area, and mixed area extracted from any of frame #n to frame # n + 2, set the amount of motion v to 4, and set the pixel values of the extracted pixels in the time direction The developed model is shown in FIG.
[0101]
Since the object corresponding to the foreground moves, the pixel value in the foreground area is composed of four different foreground components corresponding to the shutter time / v period. For example, the leftmost pixel among the pixels in the foreground area shown in FIG. 17 is composed of F01 / v, F02 / v, F03 / v, and F04 / v. That is, the pixels in the foreground area include motion blur.
[0102]
Since the object corresponding to the background is stationary, the light corresponding to the background input to the sensor does not change during the period corresponding to the shutter time. In this case, the pixel value in the background area does not include motion blur.
[0103]
The pixel value of the pixel belonging to the mixed area composed of the covered background area or the uncovered background area is composed of a foreground component and a background component.
[0104]
Next, when the image corresponding to the object is moving, the pixel values of the pixels at the same position on the frame that are adjacent to each other in a plurality of frames are developed in the time direction. The model will be described. For example, when the image corresponding to the object moves horizontally with respect to the screen, the pixels arranged on one line of the screen can be selected as the pixels arranged in a row adjacent to each other.
[0105]
FIG. 18 shows pixels arranged in a row adjacent to three frames of an image obtained by capturing an object corresponding to a stationary background, and the pixel values of the pixels at the same position on the frame are represented by time. It is the model figure developed in the direction. Frame #n is the next frame after frame # n-1, and frame # n + 1 is the next frame after frame #n. Other frames are also referred to in the same manner.
[0106]
The pixel values B01 to B12 shown in FIG. 18 are pixel values corresponding to the stationary background object. Since the object corresponding to the background is stationary, the pixel value of the corresponding pixel does not change in frame # n−1 to frame
[0107]
FIG. 19 shows pixels arranged in a row adjacent to each other in three frames of an image obtained by imaging an object corresponding to the foreground moving to the right side in the drawing together with an object corresponding to the stationary background, FIG. 5 is a model diagram in which pixel values of pixels at the same position on a frame are developed in the time direction. The model shown in FIG. 19 includes a covered background area.
[0108]
In FIG. 19, it can be assumed that the object corresponding to the foreground is a rigid body and moves at a constant speed, and the foreground image is moved so that it is displayed on the right side by four pixels in the next frame. 4 and the number of virtual divisions is 4.
[0109]
For example, the foreground component of the leftmost pixel of frame # n-1 in FIG. 19 for the first shutter time / v after the shutter opens is F12 / v, and the second pixel from the left in FIG. The foreground component of the second shutter time / v after the shutter is opened is also F12 / v. The foreground component of the third pixel from the left in FIG. 19 corresponding to the third shutter time / v from when the shutter has opened, and the fourth shutter time from the shutter opening of the fourth pixel from the left in FIG. The foreground component of / v is F12 / v.
[0110]
The foreground component of the leftmost pixel in frame # n−1 in FIG. 19 corresponding to the second shutter time / v from when the shutter has opened is F11 / v, and the second pixel from the left in FIG. The foreground component of the third shutter time / v after the shutter is opened is also F11 / v. The foreground component of the third pixel from the left in FIG. 19 corresponding to the fourth portion of the shutter time / v from when the shutter has opened is F11 / v.
[0111]
The foreground component of the leftmost pixel of frame # n-1 in FIG. 19 corresponding to the third shutter time / v from when the shutter has opened is F10 / v, and the second pixel from the left in FIG. The foreground component of the fourth shutter time / v after the shutter is opened is also F10 / v. The foreground component of the leftmost pixel of frame # n−1 in FIG. 19 corresponding to the fourth shutter time / v from when the shutter has opened is F09 / v.
[0112]
Since the object corresponding to the background is stationary, the background component of the second pixel from the left of frame # n-1 in FIG. 19 corresponding to the first shutter time / v after the shutter is opened is B01 / v Become. The background component of the third pixel from the left of frame # n−1 in FIG. 19 corresponding to the first and second shutter time / v from when the shutter has opened is B02 / v. The background component of the fourth pixel from the left of frame # n−1 in FIG. 19 corresponding to the first through third shutter time / v from when the shutter has opened is B03 / v.
[0113]
In frame # n−1 in FIG. 19, the leftmost pixel belongs to the foreground area, and the second through fourth pixels from the left belong to the mixed area, which is a covered background area.
[0114]
The fifth through twelfth pixels from the left of frame # n−1 in FIG. 19 belong to the background area, and the pixel values thereof are B04 through B11, respectively.
[0115]
The first through fifth pixels from the left of frame #n in FIG. 19 belong to the foreground area. The foreground component of the shutter time / v in the foreground area of frame #n is any one of F05 / v to F12 / v.
[0116]
It can be assumed that the object corresponding to the foreground is a rigid body and moves at a constant speed, and the foreground image moves so as to be displayed on the right side of four pixels in the next frame, so from the left of frame #n in FIG. The foreground component of the fifth pixel of the first shutter time / v after the shutter opens is F12 / v, and the sixth pixel from the left in FIG. The foreground component is also F12 / v. The foreground component of the seventh pixel from the left in FIG. 19 corresponding to the third shutter time / v from when the shutter has opened, and the fourth shutter time from the shutter opening of the eighth pixel from the left in FIG. The foreground component of / v is F12 / v.
[0117]
The foreground component of the fifth pixel from the left in frame #n in FIG. 19 corresponding to the second shutter time / v from when the shutter has opened is F11 / v, and the sixth pixel from the left in FIG. The foreground component of the third shutter time / v after the shutter is opened is also F11 / v. The foreground component of the seventh pixel from the left in FIG. 19 corresponding to the fourth portion of the shutter time / v from when the shutter has opened is F11 / v.
[0118]
The foreground component of the fifth pixel from the left in frame #n in FIG. 19 corresponding to the third shutter time / v from when the shutter has opened is F10 / v, and the sixth pixel from the left in FIG. The foreground component of the fourth shutter time / v after the shutter is opened is also F10 / v. The foreground component of the fifth pixel from the left of frame #n in FIG. 19 corresponding to the fourth portion of the shutter time / v from when the shutter has opened is F09 / v.
[0119]
Since the object corresponding to the background is stationary, the background component of the sixth pixel from the left in frame #n in FIG. 19 corresponding to the first shutter time / v after the shutter is opened is B05 / v. The background component of the seventh pixel from the left of frame #n in FIG. 19 corresponding to the first and second shutter time / v from when the shutter has opened is B06 / v. The background component of the eighth pixel from the left of frame #n in FIG. 19 corresponding to the first through third shutter time / v from when the shutter has opened is B07 / v.
[0120]
In frame #n in FIG. 19, the sixth through eighth pixels from the left belong to the mixed area, which is a covered background area.
[0121]
The ninth through twelfth pixels from the left of frame #n in FIG. 19 belong to the background area, and the pixel values thereof are B08 through B11, respectively.
[0122]
The first through ninth pixels from the left of frame # n + 1 in FIG. 19 belong to the foreground area. The foreground component of the shutter time / v in the foreground area of frame # n + 1 is any one of F01 / v to F12 / v.
[0123]
It can be assumed that the object corresponding to the foreground is a rigid body and moves at a constant speed, and moves so that the foreground image is displayed on the right side by four pixels in the next frame. The foreground component of the ninth pixel from the left when the shutter opens is the first shutter time / v is F12 / v, and the tenth pixel from the left in FIG. 19 is the second shutter time after the shutter is opened. The foreground component of / v is also F12 / v. The foreground component of the eleventh pixel from the left in FIG. 19 corresponding to the third shutter time / v from when the shutter has opened, and the fourth shutter time from the shutter opening of the twelfth pixel from the left in FIG. The foreground component of / v is F12 / v.
[0124]
The foreground component of the ninth pixel from the left in frame # n + 1 in FIG. 19 corresponding to the second shutter time / v from when the shutter has opened is F11 / v, which is the tenth from the left in FIG. The foreground component of the third shutter time / v after the shutter opens is also F11 / v. The foreground component of the eleventh pixel from the left in FIG. 19 corresponding to the fourth portion of the shutter time / v from when the shutter has opened is F11 / v.
[0125]
The foreground component of the ninth pixel from the left of frame # n + 1 in FIG. 19 corresponding to the third shutter time / v from when the shutter has opened is F10 / v, which is the tenth pixel from the left in FIG. The foreground component of the fourth shutter time / v after the shutter is opened is also F10 / v. The foreground component of the ninth pixel from the left of frame # n + 1 in FIG. 19 corresponding to the fourth portion of the shutter time / v from when the shutter has opened is F09 / v.
[0126]
Since the object corresponding to the background is stationary, the background component of the tenth pixel from the left of frame # n + 1 in FIG. 19 corresponding to the first shutter time / v after the shutter is opened is B09 / v Become. The background component of the eleventh pixel from the left of frame # n + 1 in FIG. 19 corresponding to the first and second shutter time / v from when the shutter has opened is B10 / v. The background component of the twelfth pixel from the left of frame # n + 1 in FIG. 19 corresponding to the first through third shutter time / v from when the shutter has opened is B11 / v.
[0127]
In frame # n + 1 in FIG. 19, the tenth through twelfth pixels from the left correspond to the mixed region, which is a covered background region.
[0128]
FIG. 20 is a model diagram of an image obtained by extracting foreground components from the pixel values shown in FIG.
[0129]
FIG. 21 shows pixels arranged in a row adjacent to each other in three frames of an image obtained by capturing a foreground corresponding to an object moving to the right side in the figure together with a stationary background. It is the model figure which expand | deployed the pixel value of the pixel of the position of the time direction. In FIG. 21, an uncovered background area is included.
[0130]
In FIG. 21, it can be assumed that the object corresponding to the foreground is a rigid body and is moving at a constant speed. Since the object corresponding to the foreground is moved so as to be displayed on the right side by four pixels in the next frame, the motion amount v is 4.
[0131]
For example, the foreground component of the leftmost pixel of frame # n-1 in FIG. 21 that is the first shutter time / v after the shutter is opened is F13 / v, and is the second pixel from the left in FIG. The foreground component of the second shutter time / v after the shutter is opened is also F13 / v. The foreground component of the third pixel from the left in FIG. 21 corresponding to the third shutter time / v from when the shutter has opened, and the fourth shutter time from the shutter opening of the fourth pixel from the left in FIG. The foreground component of / v is F13 / v.
[0132]
The foreground component of the second pixel from the left of frame # n-1 in FIG. 21 corresponding to the first shutter time / v after the shutter opens is F14 / v, and the third pixel from the left in FIG. The foreground component of the second shutter time / v after the shutter is opened is also F14 / v. The foreground component of the third pixel from the left in FIG. 21 corresponding to the first shutter time / v from when the shutter has opened is F15 / v.
[0133]
Since the object corresponding to the background is stationary, the background component of the leftmost pixel of frame # n−1 in FIG. 21 corresponding to the second to fourth shutter time / v from the shutter opening is B25. / v. The background components of the second pixel from the left of frame # n−1 in FIG. 21 corresponding to the third and fourth shutter time / v from when the shutter has opened are B26 / v. The background component of the third pixel from the left of frame # n−1 in FIG. 21 corresponding to the fourth portion of the shutter time / v from when the shutter has opened is B27 / v.
[0134]
In frame # n−1 in FIG. 21, the leftmost pixel through the third pixel belong to the mixed area, which is an uncovered background area.
[0135]
The fourth through twelfth pixels from the left of frame # n−1 in FIG. 21 belong to the foreground area. The foreground component of the frame is any one of F13 / v to F24 / v.
[0136]
The leftmost pixel through the fourth pixel from the left in frame #n in FIG. 21 belong to the background area, and the pixel values thereof are B25 through B28, respectively.
[0137]
It can be assumed that the object corresponding to the foreground is a rigid body and moves at a constant speed, and moves so that the foreground image is displayed on the right side of four pixels in the next frame. The foreground component of the fifth pixel at the first shutter time / v after the shutter opens is F13 / v, and the sixth shutter pixel from the left in FIG. The foreground component is also F13 / v. The foreground component of the seventh pixel from the left in FIG. 21 corresponding to the third shutter time / v from when the shutter has opened, and the fourth shutter time from the shutter opening of the eighth pixel from the left in FIG. The foreground component of / v is F13 / v.
[0138]
The foreground component of the sixth pixel from the left of frame #n in FIG. 21 corresponding to the first shutter time / v from when the shutter has opened is F14 / v, and the seventh pixel from the left in FIG. The foreground component of the second shutter time / v after opening is also F14 / v. The foreground component of the eighth pixel from the left in FIG. 21 corresponding to the first portion of the shutter time / v from when the shutter has opened is F15 / v.
[0139]
Since the object corresponding to the background is stationary, the background component of the fifth pixel from the left of frame #n in FIG. 21 corresponding to the second through fourth shutter time / v from when the shutter has opened is B29 / v. The background component of the sixth pixel from the left of frame #n in FIG. 21 corresponding to the third and fourth shutter time / v from when the shutter has opened is B30 / v. The background component of the seventh pixel from the left of frame #n in FIG. 21 corresponding to the fourth portion of the shutter time / v from when the shutter has opened is B31 / v.
[0140]
In frame #n in FIG. 21, the fifth through seventh pixels from the left belong to the mixed area, which is an uncovered background area.
[0141]
The eighth through twelfth pixels from the left of frame #n in FIG. 21 belong to the foreground area. The value corresponding to the period of the shutter time / v in the foreground area of frame #n is any one of F13 / v to F20 / v.
[0142]
The leftmost pixel through the eighth pixel from the left of frame # n + 1 in FIG. 21 belong to the background area, and the pixel values thereof are B25 through B32, respectively.
[0143]
It can be assumed that the object corresponding to the foreground is a rigid body and moves at a constant speed, and the foreground image moves so as to be displayed on the right side by four pixels in the next frame, so that the frame # n + 1 in FIG. The foreground component of the ninth pixel from the left when the shutter opens is the first shutter time / v is F13 / v, and the tenth pixel from the left in FIG. The foreground component of / v is also F13 / v. The foreground component of the eleventh pixel from the left in FIG. 21 corresponding to the third shutter time / v from when the shutter has opened, and the fourth shutter time from the shutter in the twelfth pixel from the left in FIG. The foreground component of / v is F13 / v.
[0144]
The foreground component of the tenth pixel from the left of frame # n + 1 in FIG. 21 corresponding to the first shutter time / v from when the shutter has opened is F14 / v, and the eleventh pixel from the left in FIG. The foreground component of the second shutter time / v after the shutter is opened is also F14 / v. The foreground component of the twelfth pixel from the left in FIG. 21 corresponding to the first shutter time / v from when the shutter has opened is F15 / v.
[0145]
Since the object corresponding to the background is stationary, the background component of the ninth pixel from the left of frame # n + 1 in FIG. , B33 / v. The background component of the tenth pixel from the left of frame # n + 1 in FIG. 21 corresponding to the third and fourth shutter time / v from when the shutter has opened is B34 / v. The background component of the eleventh pixel from the left of frame # n + 1 in FIG. 21 corresponding to the fourth portion of the shutter time / v from when the shutter has opened is B35 / v.
[0146]
In frame # n + 1 in FIG. 21, the ninth through eleventh pixels from the left belong to the mixed area, which is an uncovered background area.
[0147]
The twelfth pixel from the left of frame # n + 1 in FIG. 21 belongs to the foreground area. The foreground component of the shutter time / v in the foreground area of frame # n + 1 is any one of F13 / v to F16 / v.
[0148]
FIG. 22 is a model diagram of an image obtained by extracting foreground components from the pixel values shown in FIG.
[0149]
Returning to FIG. 6, the
[0150]
The mixture
[0151]
The foreground /
[0152]
The motion
[0153]
With reference to the flowchart of FIG. 23, the composite image generation processing by the image processing unit will be described. In step S11, the
[0154]
In step S11, the
[0155]
In step S12, the mixture
[0156]
In step S13, the foreground /
[0157]
In step S14, the motion
[0158]
In step S15, the image processing unit determines whether or not the process has been completed for the entire screen. If it is determined that the process has not been completed for the entire screen, the process proceeds to step S14, and the foreground corresponding to the processing unit is determined. The motion blur removal process for the component is repeated.
[0159]
If it is determined in step S15 that the processing has been completed for the entire screen, in step S16, the combining
[0160]
In this manner, the image processing unit can separate the foreground and the background, remove the motion blur included in the foreground, and synthesize it with an arbitrary background image.
[0161]
Hereinafter, the configurations of the
[0162]
FIG. 24 is a block diagram illustrating a configuration of the
[0163]
The static motion determination unit 202-1 determines the pixel value of the pixel of frame # n + 2 at the same position on the image of the pixel that is the target of region specification of frame #n, and the region specification of frame #n. The pixel value of the pixel of frame # n + 1 at the same position as the position of the target pixel on the image is read from the
[0164]
The static motion determination unit 202-2 is the target of the pixel value of the frame # n + 1 at the same position on the image of the pixel that is the target of region identification of the frame #n, and the target of the frame #n. The pixel value of the pixel is read from the
[0165]
The static motion determination unit 202-3 determines the frame #n at the same position as the pixel value of the pixel that is the region specification target of the frame #n and the position of the pixel that is the region specification target of the frame #n. The pixel value of −1 pixel is read from the
[0166]
The static motion determination unit 202-4 determines the pixel value of the pixel of frame # n-1 at the same position on the image of the pixel that is the target of region specification of frame #n, and the region specification of frame #n. The pixel value of the pixel of frame # n-2 located at the same position on the image of the target pixel is read from the
[0167]
The region determination unit 203-1 is configured such that the static motion determination supplied from the static motion determination unit 202-1 indicates stillness and the static motion determination supplied from the static motion determination unit 202-2 indicates movement. The pixel that is the target of region identification in frame #n is determined to belong to the uncovered background region, and the uncovered background region determination flag corresponding to the pixel that is determined to belong to the region belongs to the uncovered background region. “1” indicating “” is set.
[0168]
The area determination unit 203-1 indicates that the static motion determination supplied from the static motion determination unit 202-1 indicates movement, or the static motion determination supplied from the static motion determination unit 202-2 indicates stillness. When determining that the pixel that is the target of region identification in frame #n does not belong to the uncovered background region, the uncovered background region determination flag corresponding to the pixel to be determined for the region is set to the uncovered background region. “0” is set to indicate that it does not belong.
[0169]
The area determination unit 203-1 supplies the uncovered background area determination flag in which “1” or “0” is set as described above to the determination flag storage frame memory 204.
[0170]
The region determination unit 203-2 is configured such that the static motion determination supplied from the static motion determination unit 202-2 indicates static and the static motion determination supplied from the static motion determination unit 202-3 indicates static. Then, it is determined that the pixel that is the target of region identification in frame #n belongs to the still region, and “1” indicating that it belongs to the still region is set in the still region determination flag corresponding to the pixel to be determined for the region.
[0171]
In the area determination unit 203-2, the static motion determination supplied from the static motion determination unit 202-2 indicates a motion, or the static motion determination supplied from the static motion determination unit 202-3 indicates a motion. At this time, it is determined that the pixel that is the region identification target in frame #n does not belong to the still region, and “0” indicating that it does not belong to the still region is set in the still region determination flag corresponding to the pixel to be determined for the region Set.
[0172]
The region determination unit 203-2 supplies the still region determination flag in which “1” or “0” is set as described above to the determination flag storage frame memory 204.
[0173]
The region determination unit 203-2 is configured such that the static motion determination supplied from the static motion determination unit 202-2 indicates movement and the static motion determination supplied from the static motion determination unit 202-3 indicates movement. Then, it is determined that the pixel that is the target of region identification in frame #n belongs to the motion region, and “1” indicating that it belongs to the motion region is set in the motion region determination flag corresponding to the pixel determined for the region.
[0174]
The region determination unit 203-2 indicates that the static motion determination supplied from the static motion determination unit 202-2 indicates static or the static motion determination supplied from the static motion determination unit 202-3 indicates static. At this time, it is determined that the pixel that is the region identification target in frame #n does not belong to the motion region, and “0” indicating that it does not belong to the motion region is set in the motion region determination flag corresponding to the pixel that is determined to be the region. Set.
[0175]
The region determination unit 203-2 supplies the motion region determination flag set to “1” or “0” to the determination flag storage frame memory 204 in this way.
[0176]
The region determination unit 203-3 is configured such that the static motion determination supplied from the static motion determination unit 202-3 indicates movement and the static motion determination supplied from the static motion determination unit 202-4 indicates stillness. , It is determined that the pixel that is the target of region identification in frame #n belongs to the covered background region, and the covered background region determination flag corresponding to the pixel to be determined of the region indicates that it belongs to the covered background region. 1 ”is set.
[0177]
In the area determination unit 203-3, the static motion determination supplied from the static motion determination unit 202-3 indicates stillness, or the static motion determination supplied from the static motion determination unit 202-4 indicates movement. When determining that the pixel that is the target of region identification in frame #n does not belong to the covered background region, the covered background region determination flag corresponding to the pixel to be determined for the region does not belong to the covered background region. “0” is set to indicate.
[0178]
The area determination unit 203-3 supplies the covered background area determination flag set to “1” or “0” to the determination flag storage frame memory 204 in this way.
[0179]
The determination flag storage frame memory 204 is supplied from the uncovered background region determination flag supplied from the region determination unit 203-1, the still region determination flag supplied from the region determination unit 203-2, and the region determination unit 203-2. The movement area determination flag and the covered background area determination flag supplied from the area determination unit 203-3 are stored.
[0180]
The determination flag storage frame memory 204 supplies the stored uncovered background area determination flag, still area determination flag, motion area determination flag, and covered background area determination flag to the
[0181]
The determination flag
[0182]
Next, an example of processing of the
[0183]
When the object corresponding to the foreground is moving, the position on the screen of the image corresponding to the object changes for each frame. As shown in FIG. 25, in frame #n, an image corresponding to an object located at a position indicated by Yn (x, y) is Yn + 1 (x, y in frame # n + 1 which is the next frame. Located in y).
[0184]
FIG. 26 shows a model diagram in which pixel values of pixels arranged in a row adjacent to the moving direction of the image corresponding to the foreground object are developed in the time direction. For example, when the moving direction of the image corresponding to the foreground object is horizontal with respect to the screen, the model diagram in FIG. 26 shows a model in which pixel values of adjacent pixels on one line are expanded in the time direction.
[0185]
In FIG. 26, the line in frame #n is the same as the line in frame # n + 1.
[0186]
Foreground components corresponding to the objects included in the second through thirteenth pixels from the left in frame #n are included in the sixth through seventeenth pixels from the left in frame # n + 1.
[0187]
In frame #n, the pixels belonging to the covered background area are the 11th to 13th pixels from the left, and the pixels belonging to the uncovered background area are the 2nd to 4th pixels from the left. In frame # n + 1, the pixels belonging to the covered background area are the 15th to 17th pixels from the left, and the pixels belonging to the uncovered background area are the 6th to 8th pixels from the left.
[0188]
In the example shown in FIG. 26, the foreground component included in frame #n has moved four pixels in frame # n + 1, so the amount of motion v is four. The virtual division number corresponds to the motion amount v and is 4.
[0189]
Next, changes in pixel values of pixels belonging to the mixed region before and after the frame of interest will be described.
[0190]
In frame #n shown in FIG. 27 where the background is stationary and the foreground motion amount v is 4, the pixels belonging to the covered background area are the fifteenth through seventeenth pixels from the left. Since the motion amount v is 4, in the previous frame # n−1, the fifteenth through seventeenth pixels from the left include only background components and belong to the background area. In frame # n-2, the fifteenth through seventeenth pixels from the left include only background components and belong to the background area.
[0191]
Here, since the object corresponding to the background is stationary, the pixel value of the fifteenth pixel from the left in frame # n-1 does not change from the pixel value of the fifteenth pixel from the left in frame # n-2. . Similarly, the pixel value of the 16th pixel from the left of frame # n-1 does not change from the pixel value of the 16th pixel from the left of frame # n-2, and the 17th pixel from the left of frame # n-1 The pixel value of this pixel does not change from the pixel value of the 17th pixel from the left in frame # n-2.
[0192]
That is, the pixels of frame # n-1 and frame # n-2 corresponding to the pixels belonging to the covered background area in frame #n are composed of only background components, and the pixel value does not change. The value is almost zero. Therefore, the static motion determination for the pixels in frame # n-1 and frame # n-2 corresponding to the pixels belonging to the mixed region in frame #n is determined as static by the static motion determination unit 202-4.
[0193]
Since the pixels belonging to the covered background area in frame #n include the foreground components, the pixel values are different from the case of only the background components in frame # n-1. Therefore, the static motion determination for the pixels belonging to the mixed region in frame #n and the corresponding pixels in frame # n-1 is determined as motion by the static motion determination unit 202-3.
[0194]
As described above, the region determination unit 203-3 is supplied with the result of the static motion determination indicating the motion from the static motion determination unit 202-3, and is supplied with the result of the static motion determination indicating the static motion from the static motion determination unit 202-4. When it is done, it is determined that the corresponding pixel belongs to the covered background area.
[0195]
In frame #n shown in FIG. 28 where the background is stationary and the foreground motion amount v is 4, the pixels included in the uncovered background area are the second through fourth pixels from the left. Since the motion amount v is 4, in the next frame # n + 1, the second through fourth pixels from the left include only background components and belong to the background area. Further, in the next frame # n + 2, the second through fourth pixels from the left include only background components and belong to the background area.
[0196]
Here, since the object corresponding to the background is stationary, the pixel value of the second pixel from the left of frame # n + 2 does not change from the pixel value of the second pixel from the left of frame # n + 1. . Similarly, the pixel value of the third pixel from the left of frame # n + 2 does not change from the pixel value of the third pixel from the left of frame # n + 1, and is the fourth from the left of frame # n + 2. The pixel value of this pixel does not change from the pixel value of the fourth pixel from the left in frame # n + 1.
[0197]
That is, the pixels of frame # n + 1 and frame # n + 2, which correspond to the pixels belonging to the uncovered background area in frame #n, consist only of background components, and the pixel value does not change. The absolute value is almost zero. Therefore, the static motion determination for the pixels in frame # n + 1 and frame # n + 2 corresponding to the pixels belonging to the mixed region in frame #n is determined as static by the static motion determination unit 202-1.
[0198]
Since the pixels belonging to the uncovered background area in frame #n include the foreground components, the pixel values are different from the case of only the background components in frame # n + 1. Therefore, the static motion determination for the pixels belonging to the mixed region in frame #n and the corresponding pixels in frame # n + 1 is determined as motion by the static motion determination unit 202-2.
[0199]
As described above, the region determination unit 203-1 is supplied with the result of the static motion determination indicating the motion from the static motion determination unit 202-2, and is supplied with the result of the static motion determination indicating the static motion from the static motion determination unit 202-1. Is determined to belong to the uncovered background area.
[0200]
FIG. 29 is a diagram illustrating determination conditions of the
[0201]
The pixel in frame # n-1 and the pixel in frame #n at the same position on the image of the pixel to be determined in frame #n are determined to be stationary, and the pixel in frame #n When it is determined that the pixel of frame # n + 1 at the same position on the image of the pixel to be determined as #n is still, the
[0202]
The pixel in frame # n-1 and the pixel in frame #n at the same position on the image of the pixel to be determined in frame #n are determined to move, and the pixel in frame #n When it is determined that a pixel in frame # n + 1 located at the same position on the image of a pixel to be determined as #n is a motion, the
[0203]
The pixel in frame #n and the pixel in frame # n + 1 at the same position on the image of the pixel to be determined in frame #n are determined as motion, and the determination target in frame #n The pixel of frame # n + 1 at the same position as the position of the pixel on the image and the pixel of frame # n + 2 at the same position as the position of the pixel to be determined at frame #n on the image Are determined to be stationary, the
[0204]
FIG. 26 is a diagram illustrating an example of the result of specifying the area of the
[0205]
In FIG. 30C, pixels that are determined to belong to the motion region are displayed in white. In FIG. 30D, the pixels determined to belong to the still region are displayed in white.
[0206]
FIG. 31 is a diagram showing, as an image, region information indicating a mixed region among region information output from the determination flag
[0207]
Next, the area specifying process of the
[0208]
In step S202, the static motion determination unit 202-3 determines whether or not the pixel in frame # n-1 and the pixel at the same position in frame #n are stationary. Then, the static motion determination unit 202-2 determines whether or not the frame #n and the pixel at the same position in the frame # n + 1 are still.
[0209]
In step S203, if it is determined that the pixel in frame #n and the pixel in the same position in frame # n + 1 are determined to be stationary, the process proceeds to step S204, and the region determination unit 203-2 determines that the region is determined. A corresponding still area determination flag is set to “1” indicating that it belongs to a still area. The region determination unit 203-2 supplies the still region determination flag to the determination flag storage frame memory 204, and the procedure proceeds to step S205.
[0210]
When it is determined in step S202 that the pixel in frame # n-1 and the pixel at the same position in frame #n are in motion, or in step S203, the pixel in frame #n and the same position in frame # n + 1 If the pixel is determined to be moving, the pixel in frame #n does not belong to the still region, so the process of step S204 is skipped, and the procedure proceeds to step S205.
[0211]
In step S205, the static motion determination unit 202-3 determines whether or not the pixel in frame # n-1 and the pixel at the same position in frame #n are in motion, and if it is determined as motion, the process proceeds to step S206. Then, the static motion determination unit 202-2 determines whether or not there is motion between the pixel of frame #n and the pixel at the same position of frame # n + 1.
[0212]
If it is determined in step S206 that the pixel in frame #n and the pixel in the same position in frame # n + 1 are in motion, the process proceeds to step S207, and the region determination unit 203-2 determines that the region is determined. “1” indicating that it belongs to a motion region is set in the corresponding motion region determination flag. The region determination unit 203-2 supplies the motion region determination flag to the determination flag storage frame memory 204, and the procedure proceeds to step S208.
[0213]
If it is determined in step S205 that the pixel in frame # n-1 and the pixel in the same position in frame #n are still, or in step S206, the pixel in frame #n and the same position in frame # n + 1 If the current pixel is determined to be still, the pixel of frame #n does not belong to the motion region, so the process of step S207 is skipped, and the procedure proceeds to step S208.
[0214]
In step S208, the static motion determination unit 202-4 determines whether or not the pixel in frame # n-2 and the pixel in the same position in frame # n-1 are stationary. In step S209, the static motion determination unit 202-3 determines whether or not there is motion between the pixel in frame # n-1 and the pixel at the same position in frame #n.
[0215]
If it is determined in step S209 that the motion of the pixel in frame # n-1 and the pixel at the same position in frame #n is determined as moving, the process proceeds to step S210, and the region determination unit 203-3 determines that the region is to be determined. The corresponding covered background area determination flag is set to “1” indicating that it belongs to the covered background area. The area determination unit 203-3 supplies the covered background area determination flag to the determination flag storage frame memory 204, and the procedure proceeds to step S211.
[0216]
If it is determined in step S208 that the pixel in frame # n-2 and the pixel in the same position in frame # n-1 are in motion, or in step S209, the pixel in frame # n-1 and the pixel in frame #n If it is determined that the pixel at the same position is still, the pixel of frame #n does not belong to the covered background area, so the process of step S210 is skipped, and the procedure proceeds to step S211.
[0217]
In step S211, the static motion determination unit 202-2 determines whether or not the pixel in the frame #n and the pixel in the same position in the frame # n + 1 are in motion, and if it is determined to be in motion, the process proceeds to step S212. Then, the static motion determination unit 202-1 determines whether or not the pixel of frame # n + 1 and the pixel at the same position of frame # n + 2 are still.
[0218]
If it is determined in step S212 that the pixel in frame # n + 1 and the pixel in the same position in frame # n + 2 are stationary, the process proceeds to step S213, and the region determination unit 203-1 determines the region. In the uncovered background area determination flag corresponding to the pixel, “1” indicating that the pixel belongs to the uncovered background area is set. The area determination unit 203-1 supplies the uncovered background area determination flag to the determination flag storage frame memory 204, and the procedure proceeds to step S214.
[0219]
If it is determined in step S211 that the pixel in frame #n and the pixel in the same position in frame # n + 1 are stationary, or in step S212, the pixel in frame # n + 1 and the frame # n + 2 If it is determined that the motion is the same pixel, the pixel of frame #n does not belong to the uncovered background area, so the process of step S213 is skipped, and the procedure proceeds to step S214.
[0220]
In step S214, the
[0221]
If it is determined in step S214 that the area has been specified for all the pixels of frame #n, the process proceeds to step S215, where the
[0222]
As described above, the
[0223]
The
[0224]
When the object corresponding to the foreground has a texture, the
[0225]
The
[0226]
In addition, although the object corresponding to the background has been described as stationary, the above-described processing for specifying the region can be applied even if the image corresponding to the background region includes a motion. For example, when the image corresponding to the background area is moving uniformly, the
[0227]
FIG. 33 is a block diagram illustrating a configuration of the
[0228]
FIG. 34 shows an example of a model diagram in which pixel values of pixels arranged in a line adjacent to the moving direction of the image corresponding to the foreground object are developed in the time direction. For example, when the motion direction of the image corresponding to the foreground object is horizontal with respect to the screen, the model diagram in FIG. 34 shows a model in which pixel values of adjacent pixels on one line are expanded in the time direction.
[0229]
In FIG. 34, the line in frame #n is the same as the line in frame # n−1 and frame # n + 1.
[0230]
In frame #n, the foreground components corresponding to the objects included in the sixth through seventeenth pixels from the left are included in the second through thirteenth pixels from the left in frame # n-1. In frame # n + 1, they are included in the 10th to 21st pixels from the left.
[0231]
In frame # n−1, the pixels belonging to the covered background area are the 11th to 13th pixels from the left, and the pixels belonging to the uncovered background area are the 2nd to 4th pixels from the left. In frame #n, the pixels belonging to the covered background area are the 15th to 17th pixels from the left, and the pixels belonging to the uncovered background area are the 6th to 8th pixels from the left. In frame # n + 1, the pixels belonging to the covered background area are the 19th to 21st pixels from the left, and the pixels belonging to the uncovered background area are the 10th to 12th pixels from the left.
[0232]
In frame # n−1, the pixels belonging to the background area are the first pixel from the left and the fourteenth through twenty-first pixels from the left. In frame #n, the pixels belonging to the background area are the first through fifth pixels from the left, and the eighteenth through twenty-first pixels from the left. In frame # n + 1, the pixels belonging to the background area are the first through ninth pixels from the left.
[0233]
An example of a background image corresponding to the example of FIG. 34 generated by the background
[0234]
The binary object
[0235]
FIG. 36 is a block diagram illustrating a configuration of the binary object
[0236]
The correlation
[0237]
[Expression 2]
... (4)
[0238]
[Equation 3]
... (5)
[0239]
[Expression 4]
... (6)
[0240]
The correlation
[0241]
Further, for example, the correlation
[0242]
[Equation 5]
... (7)
[0243]
The correlation
[0244]
The threshold
[0245]
FIG. 39 is a diagram showing an example of a binary object image corresponding to the model of the input image shown in FIG. In the binary object image, the pixel value is set to 0 for a pixel having a high correlation with the background image.
[0246]
FIG. 40 is a block diagram illustrating a configuration of the time
[0247]
The
[0248]
FIG. 41 is a diagram for explaining the determination by the
[0249]
The pixel of interest of the binary object image of frame #n is 1, the corresponding pixel of the binary object image of frame # n-1 is 1, and the correspondence of the binary object image of frame # n + 1 When the pixel to be processed is 1, the
[0250]
When the pixel of interest of the binary object image of frame #n is 1 and the corresponding pixel of the binary object image of frame # n-1 is 0, the
[0251]
When the pixel of interest of the binary object image of frame #n is 1 and the corresponding pixel of the binary object image of frame # n + 1 is 0, the
[0252]
FIG. 42 is a diagram illustrating an example in which the time
[0253]
The temporal
[0254]
The temporal
[0255]
Since the pixel of frame #n of the binary object image is 1 and the corresponding pixel of frame # n−1 is 0, the time
[0256]
The time
[0257]
Next, the area specifying process of the
[0258]
In step S302, the binary object
[0259]
In step S304, the time
[0260]
Details of the area determination process corresponding to step S304 will be described with reference to the flowchart of FIG. In step S321, the
[0261]
If it is determined in step S321 that the pixel of interest is 1 in frame #n, the process proceeds to step S323, where the
[0262]
If it is determined in step S323 that the pixel of interest is 0 in frame #n or the corresponding pixel is 1 in frame # n-1, the process proceeds to step S325, and the time
[0263]
If it is determined in step S325 that the pixel of interest is 0 in frame #n or the corresponding pixel is 1 in frame # n + 1, the process proceeds to step S327, and the time
[0264]
As described above, the
[0265]
FIG. 45 is a block diagram showing another configuration of the
[0266]
The
[0267]
FIG. 46 is a block diagram illustrating the configuration of the
[0268]
With reference to the example of FIG. 47 and FIG. 48, the motion compensation of the
[0269]
The
[0270]
The frame memory 383-1 stores the binary object image for which motion compensation has been performed for the first frame, and outputs the stored binary object image to the weighting unit 384-1. The frame memory 383-2 stores the binary object image with motion compensation of the second frame, and outputs the stored binary object image to the weighting unit 384-2.
[0271]
Similarly, each of the frame memories 383-3 to 383- (N-1) stores and stores any of the motion compensated binary object images of the third frame to the (N-1) th frame. The binary object image thus output is output to any one of the weighting unit 384-3 to the weighting unit 384- (N-1). The frame memory 383-N stores the binary object image with motion compensation of the Nth frame, and outputs the stored binary object image to the weighting unit 384-N.
[0272]
The weighting unit 384-1 multiplies the pixel value of the motion-compensated binary object image of the first frame supplied from the frame memory 383-1 by a predetermined weight w1 and supplies the result to the integrating
[0273]
Similarly, each of the weighting units 384-3 to 384- (N-1) is the third to N-1 supplied from any one of the frame memories 383-3 to 383- (N-1). The pixel value of the motion-compensated binary object image of any one of the frames is multiplied by one of the predetermined weights w3 to w (N−1) and supplied to the accumulating
[0274]
The accumulating
[0275]
In this way, the
[0276]
Next, the area specifying process of the
[0277]
In step S344, the
[0278]
In step S345, the time
[0279]
Next, details of the robust processing corresponding to the processing in step S344 in FIG. 49 will be described with reference to the flowchart in FIG. In step S361, the
[0280]
In step S363, the
[0281]
If it is determined in step S363 that N binary object images have been stored, the process proceeds to step S364, and each of the weighting units 384-1 to 384-N adds w1 to w in each of the N binary object images. Multiply by one of the weights of wN.
[0282]
In step S365, the
[0283]
In step S366, the integrating
[0284]
As described above, the
[0285]
As described above, the
[0286]
FIG. 51 is a block diagram illustrating an example of the configuration of the mixture
[0287]
Based on the input image, the estimated mixture
[0288]
Since it can be assumed that the object corresponding to the foreground is moving at a constant speed within the shutter time, the mixture ratio α of the pixels belonging to the mixed area has the following properties. That is, the mixture ratio α changes linearly in response to changes in the pixel position. If the change in the pixel position is one-dimensional, the change in the mixture ratio α can be expressed by a straight line. If the change in the pixel position is two-dimensional, the change in the mixture ratio α is expressed by a plane. be able to.
[0289]
Since the period of one frame is short, it is assumed that the object corresponding to the foreground is a rigid body and moves at a constant speed.
[0290]
In this case, the gradient of the mixture ratio α is the inverse ratio of the motion amount v within the foreground shutter time.
[0291]
An example of an ideal mixing ratio α is shown in FIG. The gradient l in the mixing region of the ideal mixing ratio α can be expressed as the reciprocal of the motion amount v.
[0292]
As shown in FIG. 52, the ideal mixture ratio α has a value of 1 in the background region, a value of 0 in the foreground region, and a value greater than 0 and less than 1 in the mixed region. .
[0293]
In the example of FIG. 53, the pixel value C06 of the seventh pixel from the left of frame #n can be expressed by Expression (8) using the pixel value P06 of the seventh pixel from the left of frame # n-1. it can.
[0294]
[Formula 6]
... (8)
[0295]
In Expression (8), the pixel value C06 is expressed as the pixel value M of the pixel in the mixed region, and the pixel value P06 is expressed as the pixel value B of the pixel in the background region. That is, the pixel value M of the pixel in the mixed region and the pixel value B of the pixel in the background region can be expressed as Equation (9) and Equation (10), respectively.
[0296]
M = C06 (9)
B = P06 (10)
[0297]
2 / v in equation (8) corresponds to the mixing ratio α. Since the motion amount v is 4, the mixture ratio α of the seventh pixel from the left of the frame #n is 0.5.
[0298]
As described above, the pixel value C of the focused frame #n is regarded as the pixel value of the mixed region, and the pixel value P of the frame # n-1 before the frame #n is regarded as the pixel value of the background region. Equation (3) indicating the mixing ratio α can be rewritten as Equation (11).
[0299]
C = α · P + f (11)
F in Expression (11) is the sum ΣiFi / v of the foreground components included in the pixel of interest. There are two variables included in equation (11): the mixture ratio α and the sum f of the foreground components.
[0300]
Similarly, FIG. 54 shows a model in which pixel values are expanded in the time direction, in which the amount of motion v is 4 and the number of virtual divisions in the time direction is 4, in the uncovered background area.
[0301]
In the uncovered background area, similarly to the above-described expression in the covered background area, the pixel value C of the frame #n of interest is regarded as the pixel value of the mixed area, and the frame # n + 1 after the frame #n Eq. (3) indicating the mixture ratio α can be expressed as Eq. (12) by regarding the pixel value N of と as the pixel value of the background region.
[0302]
C = α ・ N + f (12)
[0303]
Although it has been described that the background object is stationary, even when the background object is moving, by using the pixel value of the pixel at the position corresponding to the background motion amount v, the expression (8 ) To (12) can be applied. For example, in FIG. 53, when the motion amount v of the object corresponding to the background is 2 and the number of virtual divisions is 2, when the object corresponding to the background is moving to the right side in the figure, The pixel value B of the pixel in the background area is set to a pixel value P04.
[0304]
Since Expression (11) and Expression (12) each include two variables, the mixture ratio α cannot be obtained as it is. Here, since an image generally has a strong spatial correlation, adjacent pixels have almost the same pixel value.
[0305]
Therefore, since the foreground components have a strong spatial correlation, the formula is modified so that the sum f of the foreground components can be derived from the previous or subsequent frame to obtain the mixture ratio α.
[0306]
The pixel value Mc of the seventh pixel from the left in frame #n in FIG. 55 can be expressed by Expression (13).
[0307]
[Expression 7]
(13)
2 / v in the first term on the right side of Equation (13) corresponds to the mixing ratio α. The second term on the right side of Expression (13) is expressed as Expression (14) using the pixel value of the subsequent frame # n + 1.
[0308]
[Equation 8]
(14)
[0309]
Here, Equation (15) is established using the spatial correlation of the foreground components.
[0310]
F = F05 = F06 = F07 = F08 = F09 = F10 = F11 = F12 (15)
Expression (14) can be replaced with Expression (16) using Expression (15).
[0311]
[Equation 9]
... (16)
[0312]
As a result, β can be expressed by equation (17).
[0313]
β = 2/4 (17)
[0314]
In general, assuming that the foreground components related to the mixed region are equal as shown in Equation (15), Equation (18) is established from the relationship of the internal ratio for all the pixels in the mixed region.
[0315]
β = 1-α (18)
[0316]
If Expression (18) is established, Expression (11) can be expanded as shown in Expression (19).
[0317]
[Expression 10]
... (19)
[0318]
Similarly, if equation (18) holds, equation (12) can be expanded as shown in equation (20).
[0319]
[Expression 11]
... (20)
[0320]
In Expression (19) and Expression (20), C, N, and P are known pixel values, and therefore the variable included in Expression (19) and Expression (20) is only the mixture ratio α. FIG. 56 shows the relationship among C, N, and P in the equations (19) and (20). C is the pixel value of the pixel of interest in frame #n for calculating the mixture ratio α. N is a pixel value of a pixel in frame # n + 1 corresponding to a pixel of interest corresponding to a position in the spatial direction. P is a pixel value of a pixel in frame # n−1 in which the pixel of interest corresponds to the position in the spatial direction.
[0321]
Accordingly, since one variable is included in each of the equations (19) and (20), the mixture ratio α can be calculated using the pixel values of the pixels of the three frames. The condition for calculating the correct mixture ratio α by solving the equations (19) and (20) is that the foreground components related to the mixed region are equal, that is, the imaging is performed when the foreground object is stationary. In the foreground image object thus obtained, the pixel values of the pixels located at the boundary of the image object corresponding to the direction of the motion of the foreground object, which are twice as many as the movement amount v, are continuous. It is constant.
[0322]
As described above, the mixing ratio α of the pixels belonging to the covered background area is calculated by Expression (21), and the mixing ratio α of the pixels belonging to the uncovered background area is calculated by Expression (22).
[0323]
α = (CN) / (PN) (21)
α = (CP) / (NP) (22)
[0324]
FIG. 57 is a block diagram illustrating a configuration of the estimated mixture
[0325]
The
[0326]
Therefore, when the frame # n + 1 is input to the mixing
[0327]
The mixture
[0328]
As described above, the estimated mixture
[0329]
The estimated mixture
[0330]
FIG. 58 is a diagram illustrating an example of the estimated mixture ratio calculated by the estimated mixture
[0331]
It can be seen that the estimated mixture ratio changes almost linearly in the mixed region as shown in FIG.
[0332]
Returning to FIG. 51, the mixture
[0333]
FIG. 59 is a block diagram showing another configuration of the mixture
[0334]
Based on the pixel value input from the
[0335]
Based on the pixel value input from the
[0336]
When the target pixel belongs to the foreground area based on the area information supplied from the
[0337]
As described above, the mixture
[0338]
With reference to the flowchart of FIG. 60, the process of calculating the mixture ratio α of the
[0339]
In step S <b> 403, the estimated mixture
[0340]
In step S404, the mixture
[0341]
If it is determined in step S404 that the mixture ratio α has been estimated for the entire frame, the process proceeds to step S405, where the mixture
[0342]
As described above, the mixture
[0343]
59 is the same as the processing described with reference to the flowchart of FIG. 60, and thus the description thereof is omitted.
[0344]
Next, the mixing ratio estimation process using the model corresponding to the covered background area corresponding to step S402 in FIG. 60 will be described with reference to the flowchart in FIG.
[0345]
In step S421, the mixture
[0346]
In step S422, the mixture
[0347]
In step S423, the mixture
[0348]
In step S424, the mixture
[0349]
In step S425, the mixture
[0350]
If it is determined in step S425 that the process of calculating the estimated mixture ratio has been completed for the entire frame, the process ends.
[0351]
Thus, the estimated mixture
[0352]
The processing of the mixture ratio estimation by the model corresponding to the uncovered background area in step S403 of FIG. 60 is the same as the process shown in the flowchart of FIG. 61 using the formula corresponding to the model of the uncovered background area. Description is omitted.
[0353]
Note that the estimated mixture
[0354]
In addition, although it has been described that the object corresponding to the background is stationary, the above-described processing for obtaining the mixture ratio α can be applied even if the image corresponding to the background region includes a motion. For example, when the image corresponding to the background region is moving uniformly, the estimated mixture
[0355]
Further, the mixture
[0356]
Similarly, the mixture
[0357]
Next, the mixing
[0358]
As described above, since the equations (11) and (12) each include two variables, the mixture ratio α cannot be obtained as it is.
[0359]
Therefore, using the property that the mixing ratio α changes linearly in response to changes in the pixel position due to the object corresponding to the foreground moving at a constant speed within the shutter time, mixing is performed in the spatial direction. An expression that approximates the ratio α and the sum f of the foreground components is established. By using a plurality of sets of pixel values of pixels belonging to the mixed area and pixel values belonging to the background area, an equation that approximates the mixing ratio α and the sum f of the foreground components is solved.
[0360]
When the change in the mixing ratio α is approximated as a straight line, the mixing ratio α is expressed by Expression (23).
[0361]
α = il + p (23)
In Expression (23), i is an index in the spatial direction where the position of the pixel of interest is 0. l is the slope of the straight line of the mixing ratio α. p is a straight line intercept of the mixing ratio α and is the mixing ratio α of the pixel of interest. In equation (23), the index i is known, but the slope l and the intercept p are unknown.
[0362]
FIG. 62 shows the relationship between the index i, the slope l, and the intercept p.
[0363]
By approximating the mixture ratio α as shown in Expression (23), a plurality of different mixture ratios α for a plurality of pixels can be expressed by two variables. In the example shown in FIG. 62, the five mixing ratios for the five pixels are expressed by two variables, the gradient l and the intercept p.
[0364]
Approximating the mixture ratio α in the plane shown in FIG. 63, when considering the motion v corresponding to two directions of the horizontal direction and the vertical direction of the image, the formula (23) is expanded to a plane, and the mixture ratio α is It is represented by Formula (24).
[0365]
α = jm + kq + p (24)
In Expression (24), j is a horizontal index with the position of the pixel of interest being 0, and k is a vertical index. m is the horizontal inclination of the surface of the mixing ratio α, and q is the vertical inclination of the surface of the mixing ratio α. p is an intercept of the surface of the mixing ratio α.
[0366]
For example, in frame #n shown in FIG. 53, equations (25) to (27) are established for C05 to C07, respectively.
[0367]
C05 = α05 ・ B05 / v + f05 (25)
C06 = α06 ・ B06 / v + f06 (26)
C07 = α07 ・ B07 / v + f07 (27)
[0368]
When the foreground components match in the vicinity, that is, F01 to F03 are equal, and F01 to F03 are replaced with Fc, Expression (28) is established.
[0369]
f (x) = (1-α (x)) · Fc (28)
In Expression (28), x represents a position in the spatial direction.
[0370]
When α (x) is replaced with Expression (24), Expression (28) can be expressed as Expression (29).
[0371]
f (x) = (1- (jm + kq + p)) ・ Fc
= j ・ (-m ・ Fc) + k ・ (-q ・ Fc) + ((1-p) ・ Fc)
= js + kt + u (29)
[0372]
In the equation (29), (−m · Fc), (−q · Fc), and (1-p) · Fc are replaced as shown in the equations (30) to (32).
[0373]
s = -m · Fc (30)
t = -q · Fc (31)
u = (1-p) · Fc (32)
[0374]
In Expression (29), j is an index in the horizontal direction with the position of the pixel of interest set to 0, and k is an index in the vertical direction.
[0375]
In this way, since it is assumed that the object corresponding to the foreground moves at a constant speed within the shutter time and the component corresponding to the foreground is constant in the vicinity, the sum of the foreground components is expressed by Equation (29). Approximated.
[0376]
When the mixture ratio α is approximated by a straight line, the sum of the foreground components can be expressed by Expression (33).
[0377]
f (x) = is + u (33)
[0378]
When the sum of the mixture ratio α and the foreground component in Expression (13) is replaced using Expression (24) and Expression (29), the pixel value M is expressed by Expression (34).
[0379]
M = (jm + kq + p) ・ B + js + kt + u
= jB ・ m + kB ・ q + B ・ p + j ・ s + k ・ t + u (34)
[0380]
In equation (34), the unknown variables are the horizontal gradient m of the surface of the mixing ratio α, the vertical inclination q of the surface of the mixing ratio α, the intercepts p, s, t, and u of the surface of the mixing ratio α. These are six.
[0381]
A plurality of normal equations in which the pixel value M or the pixel value B is set in the normal equation shown in the equation (34) in correspondence with the pixel in the vicinity of the pixel of interest, and the pixel value M or the pixel value B is set. Is calculated by the method of least squares to calculate the mixture ratio α.
[0382]
For example, the horizontal index j of the pixel of interest is set to 0, the index k of the vertical direction is set to 0, and a 3 × 3 pixel in the vicinity of the pixel of interest is expressed by the normal equation shown in Expression (34). When the pixel value M or the pixel value B is set, Expressions (35) to (43) are obtained.
[0383]
M-1, -1 = (-1) ・ B-1, -1 ・ m + (-1) ・ B-1, -1 ・ q + B-1, -1 ・ p + (-1) ・ s + (- 1) ・ t + u
... (35)
M0, -1 = (0) ・ B0, -1 ・ m + (-1) ・ B0, -1 ・ q + B0, -1 ・ p + (0) ・ s + (-1) ・ t + u
... (36)
M + 1, -1 = (+ 1) ・ B + 1, -1 ・ m + (-1) ・ B + 1, -1 ・ q + B + 1, -1 ・ p + (+ 1) ・ s + (- 1) ・ t + u
... (37)
M-1,0 = (-1) ・ B-1,0 ・ m + (0) ・ B-1,0 ・ q + B-1,0 ・ p + (-1) ・ s + (0) ・ t + u
... (38)
M0,0 = (0) ・ B0,0 ・ m + (0) ・ B0,0 ・ q + B0,0 ・ p + (0) ・ s + (0) ・ t + u
... (39)
M + 1,0 = (+ 1) ・ B + 1,0 ・ m + (0) ・ B + 1,0 ・ q + B + 1,0 ・ p + (+ 1) ・ s + (0) ・ t + u
... (40)
M-1, + 1 = (-1) ・ B-1, + 1 ・ m + (+ 1) ・ B-1, + 1 ・ q + B-1, + 1 ・ p + (-1) ・ s + (+ 1) ・ t + u
... (41)
M0, + 1 = (0) ・ B0, + 1 ・ m + (+ 1) ・ B0, + 1 ・ q + B0, + 1 ・ p + (0) ・ s + (+ 1) ・ t + u
... (42)
M + 1, + 1 = (+ 1) ・ B + 1, + 1 ・ m + (+ 1) ・ B + 1, + 1 ・ q + B + 1, + 1 ・ p + (+ 1) ・ s + (+ 1) ・ t + u
... (43)
[0384]
Since the index j in the horizontal direction of the pixel of interest is 0 and the index k in the vertical direction is 0, the mixture ratio α of the pixel of interest is expressed by j = 0 and k = It is equal to the value at 0, that is, the intercept p.
[0385]
Therefore, based on the nine equations (35) to (43), the values of the horizontal gradient m, the vertical gradient q, the intercepts p, s, t, and u are calculated by the method of least squares. The intercept p may be output as the mixing ratio α.
[0386]
Next, a more specific procedure for calculating the mixture ratio α by applying the least square method will be described.
[0387]
When the index i and the index k are expressed by one index x, the relationship between the index i, the index k, and the index x is expressed by Expression (44).
[0388]
x = (j + 1) ・ 3+ (k + 1) (44)
[0389]
Express horizontal slope m, vertical slope q, intercepts p, s, t, and u as variables w0, w1, w2, w3, w4, and W5, respectively, jB, kB, B, j, k, And 1 are expressed as a0, a1, a2, a3, a4, and a5, respectively. In consideration of the error ex, Expressions (35) to (43) can be rewritten into Expression (45).
[0390]
[Expression 12]
... (45)
In the formula (45), x is any value in the range of 0 to 8.
[0390]
From equation (45), equation (46) can be derived.
[0392]
[Formula 13]
... (46)
[0393]
Here, in order to apply the method of least squares, an error sum of squares E is defined as shown in equation (47).
[0394]
[Expression 14]
... (47)
[0395]
In order to minimize the error, it is only necessary that the partial differentiation of the variable Wv with respect to the square sum E of the error becomes zero. Here, v is one of integers from 0 to 5. Therefore, wy is obtained so as to satisfy the equation (48).
[0396]
[Expression 15]
... (48)
[0397]
Substituting equation (46) into equation (48) yields equation (49).
[0398]
[Expression 16]
... (49)
[0399]
For example, a sweep method (Gauss-Jordan elimination method) is applied to six formulas obtained by substituting any one of
[0400]
As described above, horizontal slope m, vertical slope q, intercepts p, s, t, and u are obtained by applying the method of least squares to the equation in which pixel value M and pixel value B are set. be able to.
[0401]
In the description corresponding to the expressions (35) to (43), the pixel value of the pixel included in the mixed area has been described as M, and the pixel value of the pixel included in the background area has been described as B. Therefore, it is necessary to establish a normal equation for each of the cases where they are included in the covered background region or the uncovered background region.
[0402]
For example, when obtaining the mixture ratio α of pixels included in the covered background area of frame #n shown in FIG. 53, the pixel values P04 to C08 of the pixels of frame #n and the pixel values P04 to P08 of the pixels of frame # n−1 P08 is set as a normal equation.
[0403]
When obtaining the mixture ratio α of pixels included in the uncovered background area of frame #n shown in FIG. 53, pixel values N28 to N32 of pixels C28 to C32 of frame #n and pixels of frame # n + 1 Is set to a normal equation.
[0404]
Further, for example, when calculating the mixture ratio α of the pixels included in the covered background region shown in FIG. 64, the following equations (50) to (58) are established. The pixel value of the pixel for calculating the mixture ratio α is Mc5.
[0405]
Mc1 = (-1) ・ Bc1 ・ m + (-1) ・ Bc1 ・ q + Bc1 ・ p + (-1) ・ s + (-1) ・ t + u (50)
Mc2 = (0) ・ Bc2 ・ m + (-1) ・ Bc2 ・ q + Bc2 ・ p + (0) ・ s + (-1) ・ t + u (51)
Mc3 = (+ 1) ・ Bc3 ・ m + (-1) ・ Bc3 ・ q + Bc3 ・ p + (+ 1) ・ s + (-1) ・ t + u (52)
Mc4 = (-1) ・ Bc4 ・ m + (0) ・ Bc4 ・ q + Bc4 ・ p + (-1) ・ s + (0) ・ t + u (53)
Mc5 = (0) ・ Bc5 ・ m + (0) ・ Bc5 ・ q + Bc5 ・ p + (0) ・ s + (0) ・ t + u (54)
Mc6 = (+ 1) ・ Bc6 ・ m + (0) ・ Bc6 ・ q + Bc6 ・ p + (+ 1) ・ s + (0) ・ t + u (55)
Mc7 = (-1) ・ Bc7 ・ m + (+ 1) ・ Bc7 ・ q + Bc7 ・ p + (-1) ・ s + (+ 1) ・ t + u (56)
Mc8 = (0) ・ Bc8 ・ m + (+ 1) ・ Bc8 ・ q + Bc8 ・ p + (0) ・ s + (+ 1) ・ t + u (57)
Mc9 = (+ 1) ・ Bc9 ・ m + (+ 1) ・ Bc9 ・ q + Bc9 ・ p + (+ 1) ・ s + (+ 1) ・ t + u (58)
[0406]
When calculating the mixture ratio α of the pixels included in the covered background area of frame #n, the background of the pixel of frame # n−1 corresponding to the pixel of frame #n in equations (50) to (58) Pixel values Bc1 to Bc9 of the pixels in the area are used.
[0407]
When calculating the mixture ratio α of the pixels included in the uncovered background area shown in FIG. 64, the following equations (59) to (67) are established. The pixel value of the pixel for calculating the mixture ratio α is Mu5.
[0408]
Mu1 = (-1) ・ Bu1 ・ m + (-1) ・ Bu1 ・ q + Bu1 ・ p + (-1) ・ s + (-1) ・ t + u (59)
Mu2 = (0) ・ Bu2 ・ m + (-1) ・ Bu2 ・ q + Bu2 ・ p + (0) ・ s + (-1) ・ t + u (60)
Mu3 = (+ 1) ・ Bu3 ・ m + (-1) ・ Bu3 ・ q + Bu3 ・ p + (+ 1) ・ s + (-1) ・ t + u (61)
Mu4 = (-1) ・ Bu4 ・ m + (0) ・ Bu4 ・ q + Bu4 ・ p + (-1) ・ s + (0) ・ t + u (62)
Mu5 = (0) ・ Bu5 ・ m + (0) ・ Bu5 ・ q + Bu5 ・ p + (0) ・ s + (0) ・ t + u (63)
Mu6 = (+ 1) ・ Bu6 ・ m + (0) ・ Bu6 ・ q + Bu6 ・ p + (+ 1) ・ s + (0) ・ t + u (64)
Mu7 = (-1) ・ Bu7 ・ m + (+ 1) ・ Bu7 ・ q + Bu7 ・ p + (-1) ・ s + (+ 1) ・ t + u ・ ・ ・ (65)
Mu8 = (0) ・ Bu8 ・ m + (+ 1) ・ Bu8 ・ q + Bu8 ・ p + (0) ・ s + (+ 1) ・ t + u (66)
Mu9 = (+ 1) ・ Bu9 ・ m + (+ 1) ・ Bu9 ・ q + Bu9 ・ p + (+ 1) ・ s + (+ 1) ・ t + u (67)
[0409]
When calculating the mixture ratio α of the pixels included in the uncovered background area of frame #n, in the equations (59) to (67), the pixels of the frame # n + 1 corresponding to the pixels of the frame #n are calculated. The pixel values Bu1 to Bu9 of the pixels in the background area are used.
[0410]
FIG. 65 is a block diagram illustrating a configuration of the estimated mixture
[0411]
The delay circuit 221 delays the input image by one frame and supplies it to the adding
[0412]
The adding
[0413]
The
[0414]
As described above, the estimated mixture
[0415]
Note that the estimated mixture
[0416]
FIG. 66 is a diagram illustrating an example of the estimated mixture ratio calculated by the estimated mixture
[0417]
It can be seen that the estimated mixture ratio changes substantially linearly in the mixed region as shown in FIG.
[0418]
Next, the mixing ratio estimation processing by the model corresponding to the covered background area by the estimated mixing
[0419]
In step S521, the adding
[0420]
In step S522, the estimated mixture
[0421]
If it is determined in step S522 that the pixel value setting for the target pixel has been completed, the process proceeds to step S523, and the calculation unit 173 calculates the estimated mixture ratio based on the normal equation in which the pixel value is set. Then, the obtained estimated mixture ratio is output.
[0422]
As described above, the estimated mixture
[0423]
The process of estimating the mixture ratio using the model corresponding to the uncovered background area is the same as the process shown in the flowchart of FIG. 67 using the normal equation corresponding to the model of the uncovered background area.
[0424]
Note that although the object corresponding to the background has been described as stationary, the above-described processing for obtaining the mixture ratio can be applied even if the image corresponding to the background area includes movement. For example, when the image corresponding to the background region is moving uniformly, the estimated mixture
[0425]
As described above, the mixture ratio calculation unit 102 can calculate the mixture ratio α, which is a feature amount corresponding to each pixel, based on the region information supplied from the
[0426]
By using the mixing ratio α, it becomes possible to separate the foreground component and the background component included in the pixel value while leaving the motion blur information included in the image corresponding to the moving object. .
[0427]
Also, by compositing images based on the mixture ratio α, it is possible to create an image including correct motion blur that matches the speed of a moving object as if the real world was actually recaptured.
[0428]
Next, the foreground /
[0429]
The mixing ratio α supplied from the mixing
[0430]
The
[0431]
The
[0432]
The
[0433]
The combining
[0434]
In the initialization process executed at the beginning of the foreground component image synthesis process, the
[0435]
The combining
[0436]
In the initialization process executed at the beginning of the background component image synthesis process, the
[0437]
FIG. 69 is a diagram illustrating an input image input to the foreground /
[0438]
69 is a schematic diagram of an image to be displayed. FIG. 70 illustrates a time direction of pixels in one line including pixels belonging to the foreground area, pixels belonging to the background area, and pixels belonging to the mixed area corresponding to FIG. Figure 1 shows the developed model diagram.
[0439]
As shown in FIGS. 69 and 70, the background component image output from the foreground /
[0440]
As shown in FIGS. 69 and 70, the foreground component image output from the foreground /
[0441]
The pixel values of the pixels in the mixed region are separated into a background component and a foreground component by the foreground /
[0442]
Thus, in the foreground component image, the pixel value of the pixel corresponding to the background area is set to 0, and a meaningful pixel value is set to the pixel corresponding to the foreground area and the pixel corresponding to the mixed area. Similarly, in the background component image, the pixel value of the pixel corresponding to the foreground area is set to 0, and a meaningful pixel value is set to the pixel corresponding to the background area and the pixel corresponding to the mixed area.
[0443]
Next, a process performed by the
[0444]
FIG. 71 is an image model showing foreground components and background components of two frames including a foreground corresponding to an object moving from left to right in the drawing. In the image model shown in FIG. 71, the foreground motion amount v is 4, and the number of virtual divisions is 4.
[0445]
In frame #n, the leftmost pixel and the fourteenth through eighteenth pixels from the left consist only of background components and belong to the background area. In frame #n, the second through fourth pixels from the left include a background component and a foreground component, and belong to the uncovered background area. In frame #n, the eleventh through thirteenth pixels from the left include a background component and a foreground component, and belong to the covered background area. In frame #n, the fifth through tenth pixels from the left consist of only the foreground components and belong to the foreground area.
[0446]
In frame # n + 1, the first through fifth pixels from the left and the eighteenth pixel from the left consist of only the background components, and belong to the background area. In frame # n + 1, the sixth through eighth pixels from the left include a background component and a foreground component, and belong to the uncovered background area. In frame # n + 1, the fifteenth through seventeenth pixels from the left include a background component and a foreground component, and belong to the covered background area. In frame # n + 1, the ninth through fourteenth pixels from the left consist of only the foreground components, and belong to the foreground area.
[0447]
FIG. 72 is a diagram illustrating processing for separating foreground components from pixels belonging to the covered background area. In FIG. 72, α1 to α18 are mixing ratios corresponding to the respective pixels in frame #n. In FIG. 72, the fifteenth through seventeenth pixels from the left belong to the covered background area.
[0448]
The pixel value C15 of the fifteenth pixel from the left in frame #n is expressed by equation (68).
[0449]
C15 = B15 / v + F09 / v + F08 / v + F07 / v
= α15 ・ B15 + F09 / v + F08 / v + F07 / v
= α15 ・ P15 + F09 / v + F08 / v + F07 / v (68)
[0450]
Here, α15 is the mixture ratio of the fifteenth pixel from the left in frame #n. P15 is the pixel value of the fifteenth pixel from the left in frame # n-1.
[0451]
Based on Expression (68), the sum f15 of the foreground components of the fifteenth pixel from the left in frame #n is expressed by Expression (69).
[0452]
f15 = F09 / v + F08 / v + F07 / v
= C15-α15 ・ P15 (69)
[0453]
Similarly, the foreground component sum f16 of the 16th pixel from the left in frame #n is expressed by Equation (70), and the foreground component sum f17 of the 17th pixel from the left in frame #n is expressed by Equation (70). (71)
[0454]
f16 = C16-α16 · P16 (70)
f17 = C17-α17 · P17 (71)
[0455]
In this way, the foreground component fc included in the pixel value C of the pixel belonging to the covered background area is calculated by Expression (72).
[0456]
fc = C-α · P (72)
[0457]
P is the pixel value of the corresponding pixel in the previous frame.
[0458]
FIG. 73 is a diagram illustrating processing for separating foreground components from pixels belonging to the uncovered background area. In FIG. 73, α1 to α18 are mixing ratios corresponding to the respective pixels in frame #n. In FIG. 73, the second through fourth pixels from the left belong to the uncovered background area.
[0459]
The pixel value C02 of the second pixel from the left in frame #n is expressed by Expression (73).
[0460]
C02 = B02 / v + B02 / v + B02 / v + F01 / v
= α2 ・ B02 + F01 / v
= α2 ・ N02 + F01 / v (73)
[0461]
Here, α2 is the mixture ratio of the second pixel from the left in frame #n. N02 is the pixel value of the second pixel from the left in frame # n + 1.
[0462]
Based on Expression (73), the sum f02 of the foreground components of the second pixel from the left in frame #n is expressed by Expression (74).
[0463]
f02 = F01 / v
= C02-α2 ・ N02 (74)
[0464]
Similarly, the sum f03 of the foreground components of the third pixel from the left in frame #n is expressed by Expression (75), and the sum f04 of the foreground components of the fourth pixel from the left of frame #n is expressed by Expression (75). (76)
[0465]
f03 = C03-α3 ・ N03 (75)
f04 = C04-α4 ・ N04 (76)
[0466]
In this way, the foreground component fu included in the pixel value C of the pixel belonging to the uncovered background area is calculated by Expression (77).
[0467]
fu = C-α ・ N (77)
[0468]
N is the pixel value of the corresponding pixel in the next frame.
[0469]
As described above, the
[0470]
FIG. 74 is a block diagram illustrating an example of the configuration of the
[0471]
The
[0472]
The
[0473]
The
[0474]
The
[0475]
The
[0476]
The
[0477]
The
[0478]
The
[0479]
The
[0480]
The combining
[0481]
The
[0482]
The
[0483]
By using the mixture ratio α, which is a feature amount, it is possible to completely separate the foreground component and the background component included in the pixel value.
[0484]
FIG. 75 is a diagram illustrating an example of a foreground component image and an example of a background component image corresponding to frame #n in FIG.
[0485]
FIG. 75A shows an example of a foreground component image corresponding to frame #n in FIG. Since the leftmost pixel and the fourteenth pixel from the left consist of only background components before the foreground and the background are separated, the pixel value is set to zero.
[0486]
The second through fourth pixels from the left belong to the uncovered background area before the foreground and the background are separated, the background component is 0, and the foreground component is left as it is. The eleventh to thirteenth pixels from the left belong to the covered background area before the foreground and the background are separated, the background component is 0, and the foreground component is left as it is. The fifth through tenth pixels from the left are composed of only the foreground components and are left as they are.
[0487]
FIG. 75B shows an example of the background component image corresponding to frame #n in FIG. The leftmost pixel and the fourteenth pixel from the left are left as they are because they consisted only of the background components before the foreground and the background were separated.
[0488]
The second through fourth pixels from the left belong to the uncovered background area before the foreground and the background are separated, the foreground components are set to 0, and the background components are left as they are. The eleventh to thirteenth pixels from the left belong to the covered background area before the foreground and the background are separated, and the foreground components are set to 0 and the background components are left as they are. Since the fifth through tenth pixels from the left consist of only the foreground components before the foreground and the background are separated, the pixel value is set to zero.
[0489]
Next, foreground / background separation processing by the foreground /
[0490]
In step S <b> 602, the
[0491]
In step S604, the uncovered
[0492]
In step S605, the uncovered
[0493]
In step S606, the covered
[0494]
In step S607, the covered
[0495]
In step S608, the
[0496]
In step S609, the
[0497]
In step S610, the
[0498]
As described above, the foreground /
[0499]
Next, the removal of motion blur from the foreground component image will be described.
[0500]
FIG. 77 is a block diagram illustrating an example of the configuration of the motion
[0501]
The processing
[0502]
As shown in FIG. 78, the processing unit generated by the processing
[0503]
The
[0504]
For example, when the number of pixels corresponding to the processing unit is 12 and the amount of motion v within the shutter time is 5, the
[0505]
Note that the
[0506]
The
[0507]
The
[0508]
When the foreground components corresponding to the shutter time / v included in the foreground component image are F01 / v to F08 / v, the relationship between F01 / v to F08 / v and the pixel values C01 to C12 is expressed by Equations (78) to (78). It is represented by Formula (89).
[0509]
C01 = F01 / v (78)
C02 = F02 / v + F01 / v (79)
C03 = F03 / v + F02 / v + F01 / v (80)
C04 = F04 / v + F03 / v + F02 / v + F01 / v (81)
C05 = F05 / v + F04 / v + F03 / v + F02 / v + F01 / v (82)
C06 = F06 / v + F05 / v + F04 / v + F03 / v + F02 / v (83)
C07 = F07 / v + F06 / v + F05 / v + F04 / v + F03 / v (84)
C08 = F08 / v + F07 / v + F06 / v + F05 / v + F04 / v (85)
C09 = F08 / v + F07 / v + F06 / v + F05 / v (86)
C10 = F08 / v + F07 / v + F06 / v (87)
C11 = F08 / v + F07 / v (88)
C12 = F08 / v ・ ・ ・ (89)
[0510]
The
[0511]
C01 = 1 ・ F01 /
+0 ・ F06 /
C02 = 1 ・ F01 /
+0 ・ F06 /
C03 = 1 ・ F01 /
+0 ・ F06 /
C04 = 1 ・ F01 /
+0 ・ F06 /
C05 = 1 ・ F01 /
+0 ・ F06 /
C06 = 0 ・ F01 /
+1 ・ F06 /
C07 = 0 ・ F01 /
+1 ・ F06 /
C08 = 0 ・ F01 /
+1 ・ F06 /
C09 = 0 ・ F01 /
+1 ・ F06 /
C10 = 0 ・ F01 /
+1 ・ F06 /
C11 = 0 ・ F01 /
+0 ・ F06 /
C12 = 0 ・ F01 /
+0 ・ F06 /
[0512]
Expressions (90) to (101) can also be expressed as Expression (102).
[0513]
[Expression 17]
... (102)
[0514]
In Expression (102), j indicates the position of the pixel. In this example, j has any one value of 1 to 12. I indicates the position of the foreground value. In this example, i has any one value of 1 to 8. aij has a value of 0 or 1 corresponding to the values of i and j.
[0515]
When expressed in consideration of the error, Expression (102) can be expressed as Expression (103).
[0516]
[Formula 18]
... (103)
[0517]
In Expression (103), ej is an error included in the target pixel Cj.
[0518]
Expression (103) can be rewritten as Expression (104).
[0519]
[Equation 19]
... (104)
[0520]
Here, in order to apply the method of least squares, an error sum of squares E is defined as shown in Expression (105).
[0521]
[Expression 20]
... (105)
[0522]
In order to minimize the error, the partial differential value of the variable Fk with respect to the square sum E of the error may be zero. Fk is obtained so as to satisfy Expression (106).
[0523]
[Expression 21]
... (106)
[0524]
In Expression (106), since the motion amount v is a fixed value, Expression (107) can be derived.
[0525]
[Expression 22]
... (107)
[0526]
When equation (107) is expanded and transferred, equation (108) is obtained.
[0527]
[Expression 23]
... (108)
[0528]
This is expanded into eight equations obtained by substituting any one of
[0529]
An example of a normal equation generated by the
[0530]
[Expression 24]
... (109)
[0531]
When Expression (109) is expressed as A · F = v · C, C, A, v are known, and F is unknown. A and v are known at the time of modeling, but C is known by inputting a pixel value in the adding operation.
[0532]
By calculating the foreground component using a normal equation based on the method of least squares, the error included in the pixel C can be dispersed.
[0533]
The
[0534]
The
[0535]
The
[0536]
In the foreground component image from which the motion blur shown in FIG. 80 is removed, each of F03 to F08 is set to each of C03 to C10, because the position of the foreground component image with respect to the screen is not changed. It can correspond to an arbitrary position.
[0537]
Thus, the motion
[0538]
Next, a process for adjusting the amount of motion blur included in the foreground component image by the motion
[0539]
In step S801, the processing
[0540]
In step S802, the
[0541]
In step S804, the adding
[0542]
If it is determined in step S805 that the pixel values of all the pixels in the processing unit have been set, the process advances to step S806, and the
[0543]
As described above, the motion
[0544]
That is, it is possible to adjust the amount of motion blur included in the pixel value that is the sample data.
[0545]
FIG. 82 is a block diagram illustrating another example of the configuration of the motion
[0546]
The processing
[0547]
The
[0548]
For example, when the number of pixels corresponding to the processing unit is 12 and the amount of motion v is 5, the
[0549]
Note that the
[0550]
The
[0551]
Referring to the foreground component image model shown in FIGS. 83 to 85, when the number of foreground components is 8, the number of pixels corresponding to the processing unit is 12, and the amount of motion v is 5, An example of an equation generated by the
[0552]
When the foreground components corresponding to the shutter time / v included in the foreground component image are F01 / v to F08 / v, the relationship between F01 / v to F08 / v and the pixel values C01 to C12 is as described above. It represents with Formula (78) thru | or Formula (89).
[0553]
Paying attention to the pixel values C12 and C11, the pixel value C12 includes only the foreground component F08 / v as shown in the equation (110), and the pixel value C11 includes the foreground component F08 / v and the foreground component F07 / v. Consists of product sums of v. Therefore, the foreground component F07 / v can be obtained by Expression (111).
[0554]
F08 / v = C12 ・ ・ ・ (110)
F07 / v = C11-C12 ・ ・ ・ (111)
[0555]
Similarly, in consideration of the foreground components included in the pixel values C10 to C01, the foreground components F06 / v to F01 / v can be obtained by Expressions (112) to (117).
[0556]
F06 / v = C10-C11 (112)
F05 / v = C09-C10 (113)
F04 / v = C08-C09 ・ ・ ・ (114)
F03 / v = C07-C08 + C12 ・ ・ ・ (115)
F02 / v = C06-C07 + C11-C12 (116)
F01 / v = C05-C06 + C10-C11 (117)
[0557]
The
[0558]
The
[0559]
The
[0560]
The
[0561]
The
[0562]
Thus, the motion
[0563]
Next, foreground motion blur removal processing by the motion
[0564]
In step S901, the processing
[0565]
In step S902, the
[0566]
In step S904, the
[0567]
If it is determined in step S905 that all foreground components corresponding to the processing unit have been extracted, the process advances to step S906, and the
[0568]
In step S907, the
[0569]
As described above, the motion
[0570]
Conventional methods such as the Wiener filter that partially eliminates motion blur are effective in the ideal state, but they are quantized and not effective enough for actual images containing noise. In the motion
[0571]
Next, the configuration of the
[0572]
The
[0573]
The contour smoothing unit 1002 supplies the pixel value of the pixel in the contour portion based on the information on the pixel in the contour portion (pixel forming the contour) of the foreground component image from which the motion blur supplied from the
[0574]
That is, the foreground component image from which motion blur has been removed is an image with a mixing ratio of 1. The contour portion of the foreground component image having a mixing ratio of 1 has a stepped shape in units of pixels as shown by the solid line (thick line) in FIG.
[0575]
Therefore, the contour smoothing unit 1002 passes through each point of the central portion of one side as an end (for example, points B1 to B6 in the drawing) for each pixel of the stepped contour portion. A straight line is obtained by a regression method, and the contour portion is linearly approximated. For example, the contour is smoothed by a line segment shown by a dotted line in FIG.
[0576]
In other words, in FIG. 88, a straight line passing through each of the points B1 to B6 at the center of one side of the (contour) end of each pixel forming the contour of the foreground component image is set, and the slope of the straight line is regressed. The contour of the foreground component image is smoothed by the method (least square method). In FIG. 88, line segments OP, PQ, QR, RS, ST, and TU corresponding to the points B1 to B6 are indicated by dotted lines. As a result, the contour of the foreground component image changes from a step-like cross section to a smooth cross section (a surface having an obtuse angle of 90 degrees or more).
[0577]
Note that the smoothing by the contour smoothing unit 1002 is not only obtained using the straight line obtained by the regression method as described above, but the contour may be smoothed by, for example, spline approximation or polynomial approximation.
[0578]
The spatial mixing
[0579]
For example, as shown in FIG. 89, assuming that the bold solid line is the original outline and the square surrounded by the thin line is a pixel near the outline, the left part of the original outline in the figure is the foreground component image. If there is, the conventional foreground component image spatially has a spatial mixing ratio of pixels around the contour indicated by the thick line in the figure, the pixel that becomes the contour of the foreground component image is 1, in this case The spatial mixing ratio of the pixel existing on the right side of the pixel serving as the contour of the foreground component image should be zero. In FIG. 89, the foreground component image region is indicated by a hatched portion, and other portions, that is, the background component image region is indicated by a solid color.
[0580]
The spatial mixing
[0581]
However, the region of the foreground component image is smoothed as indicated by the dotted line shown in FIG. 89 (FIG. 88 is the same). Therefore, the spatial mixing
[0582]
That is, assuming that the area of each pixel is 1, as shown in FIG. 90, the pixel on the upper left side in the drawing (the pixel having the center point B1 on one side of the edge portion to be the outline) is represented by a dotted line. With the contour shown, the area of the forward tilt component image indicated by the hatched portion is approximately 0.7, so the spatial mixing ratio is 0.7. Similarly, the pixel on the upper right side in the drawing (the pixel sharing the center point B1 of one side of the edge serving as the contour) becomes a forward tilt component image indicated by the hatched portion by the contour indicated by the dotted line. Since the area of the region is approximately 0.3, the spatial mixing ratio is 0.3. Similarly, the spatial mixing ratio of the two pixels sharing the second point B2 from the top in the figure is 0.9 and 0.1 from the left, depending on the area of each shaded portion. The spatial mixing ratio of the two pixels sharing the third point B3 from the left is 0.8 and 0.2 from the left, and the spatial mixing ratio of the two pixels sharing the fourth stage point B4 from the top is , 0.9 and 0.1 from the left, and the spatial mixing ratio of the two pixels sharing the fifth point B5 from the top is 0.7 and 0.3 from the left. The spatial mixing ratios of the two pixels sharing the sixth point B6 from the top and the three pixels including the left pixel are 0.95, 0.65, and 0.3 from the left.
[0583]
The foreground component
[0584]
Thus, by using the smoothed contour, the mixing ratio of each pixel becomes a value in which the spatial mixing ratio is considered in accordance with the smoothed contour from the binary expression of 1 and 0 so far. A value corresponding to the ratio of the area occupied by the foreground component image is set. As a result, the foreground component image is smoothed according to this spatial mixing ratio, so that the processing of the foreground component image that has been able to be expressed only in units of pixels up to the size of the pixel or smaller is performed. It becomes possible to execute.
[0585]
Note that, by smoothing the outline of the foreground component image, the area of the foreground component image (the area of the pixel where the spatial mixing ratio of the foreground component image is other than 0) is increased by several pixels in the horizontal direction or the vertical direction. It will be. Similarly, the pixel area including the background component image may be increased.
[0586]
The motion
[0587]
That is, the motion
[0588]
For example, as shown in FIG. 92, when the number of pixels corresponding to the processing unit is 8 and the motion amount v is 4, the motion
[0589]
[Expression 25]
... (118)
[0590]
The motion
[0591]
The area
[0592]
The time mixture
[0593]
The background
[0594]
The mixed region
[0595]
Based on the region information supplied from the region
[0596]
Next, with reference to the flowchart in FIG. 93, the image composition processing by the
[0597]
In step S <b> 921, the
[0598]
In step S922, the contour smoothing lower part 1002 smoothes the contour part based on the pixel information of the contour part of the foreground component image from which the motion blur supplied from the
[0599]
More specifically, the contour smoothing lower part 1002 defines, for example, a straight line corresponding to each of the points B1 to B6 as a function as represented by the following equation (119), and the slope is set to the regression method (minimum self Multiplicative).
[0600]
y = Ax
... (119)
[0601]
Here, (x, y) is the coordinates of the points B1 to B6, and A is the inclination. In addition, the origin of the above equation (119) is the position of the above points B1 to B6 along which the straight line to be obtained passes. Therefore, for example, when the straight line to be obtained corresponds to the line segment OP passing through the point B1, the origin is the position of the point B1, and similarly, the straight line corresponds to the line segment PQ passing through the point B2. If it is, the origin is point B2. Accordingly, the coordinates of the points B1 to B6 vary depending on the position of the point through which the desired straight line passes.
[0602]
The least square method is a method for obtaining a slope A that minimizes the sum of squared differences Q between y ′ obtained by a set slope A and an actual y, which is defined by the following equation (120).
[0603]
[Equation 26]
... (120)
[0604]
Since the sum of squared differences Q expressed by the equation (120) is a quadratic function, the variable A (slope A) has a downwardly convex curve, and therefore, Amin with the minimum slope A is the solution of the least squares method. Become.
[0605]
The differential sum of squares Q expressed by the equation (120) is differentiated by the variable A to be (Roud dQ) / (Roud dA) expressed by the following equation (121).
[0606]
[Expression 27]
... (121)
[0607]
In Formula (121), since A that becomes 0 is Amin that takes the minimum value of the sum of squared differences Q, by expanding the formula when Formula (121) becomes 0, the slope of the following Formula (122) is obtained. A will be required.
[0608]
[Expression 28]
... (122)
[0609]
The above equation (122) is a so-called one-variable (gradient A) normal equation.
[0610]
In this way, a straight line (each line segment indicated by a dotted line in FIG. 89) that is a line segment of each point is obtained by the obtained slope A, and the line segment corresponding to each point smoothes the contour of the foreground component image. Turn into. As a smoothing method, not only a line segment corresponding to each point is obtained by a regression method (least square method), but also a curve obtained by spline approximation using each point may be used, or a polynomial approximation may be used. You may make it obtain | require the curve used as an outline.
[0611]
In step S923, the spatial mixing
[0612]
In step S924, the foreground component
[0613]
In step S925, the motion
[0614]
In step S926, the region
[0615]
In step S927, the time mixture
[0616]
In step S928, the background
[0617]
In step S929, the mixed region
[0618]
Based on the region information supplied from the region
[0619]
With the above processing, the contour portion of the foreground component image is not the contour formed in units of pixels, but the smoothed foreground component image is synthesized in consideration of the spatial mixture ratio, so that the mixture ratio shown in FIG. In addition, it is possible to generate a composite image with no sense of incongruity in consideration of the continuity of the space of the stepped foreground component image. In FIG. 94, white indicates a foreground component image mixing ratio of 1, and black indicates a foreground component image mixing ratio of 0, that is, an area other than the foreground component image (for example, a background component image area). Accordingly, the intermediate colors of white and black indicate that the region is a mixed region, and the portion closer to black indicates that the mixing ratio is higher.
[0620]
FIG. 95 shows the distribution of pixel values of the synthesized image based on the mixing ratio of the pixels of the foreground component image and the background component image in FIG. The distribution of pixel values on the coordinate position is shown. The higher the value, the higher the pixel value.
[0621]
As shown in FIG. 95, the pixel values smoothly change near the boundary between the foreground component image and the background component image by the above processing. For this reason, it is shown that a synthesized image that is natural in appearance is generated in the synthesized image without causing breakdown in the mixed region.
[0622]
As a result, it is possible to generate a composite image in which the foreground component image and the background component image as shown in FIG. 96 are combined in a more natural state. In FIG. 96, as shown in the lower part of the figure, the substantially left part is the foreground component image and the substantially right part is the background component image.
[0623]
In the above, the spatial mixing ratio of the pixels forming the outline of the foreground component image is smoothed by obtaining the spatial mixing ratio according to the ratio of the area on the pixels of the outline by smoothing the outline of the foreground component image, Although an example in which the foreground component image and the background component image are naturally synthesized has been described, the foreground component image and the background component image are spatially mixed as described above for the edge pixels that form the outline of the foreground component image. Often doing. Therefore, for the pixels forming the contour of the foreground component image, it is assumed that the foreground component image and the background component image are spatially mixed, and the spatial mixing ratio is obtained by extrapolation from pixels other than the end portions. Also good.
[0624]
In FIG. 97, for the pixels forming the contour of the foreground component image, the foreground component image and the background component image are spatially mixed, and the spatial mixing ratio is obtained by extrapolation from pixels other than the end portions. The configuration of the combining
[0625]
Note that the same components as those shown in FIG. 87 are denoted by the same reference numerals, and description thereof will be omitted as appropriate.
[0626]
The synthesizing
[0627]
The contour neighboring
[0628]
The
[0629]
That is, when the pixel value of the foreground component image and the pixel value of the background component image are shown in the left part of FIG. 98, the corresponding spatial mixing ratio is as shown in the right part of FIG. The area where the component image pixels exist is 1, and the area of the background component image is 0. This is based on the premise that there is no spatial mixing in the pixels that form the contour of the foreground component image, and the pixels that form the contour of the foreground component image shown in the right part of FIG. It is assumed that the background component image component is not included (no mixing occurs). In the left part of FIG. 98, the third vertical bar from the left indicates the pixel value level of the foreground component image pixel, and the second vertical bar from the right indicates the pixel of the background component image pixel. Indicates the level of the value. Therefore, the third vertical bar from the left is an end pixel that forms the outline of the foreground component image.
[0630]
However, as shown in FIG. 88, the pixels that form the contour of the foreground component image often have a contour (edge) in the pixel, and the foreground component image and the background component image are actually mixed. It is considered a thing.
[0631]
The
[0632]
At this time, the level of the pixel indicated by the vertical bar corresponding to the third pixel from the left in the left part of FIG. 99 is a pixel value in which the foreground component image and the background component image are spatially mixed. Since the level of the second pixel is only the level of the foreground component image, the original pixel value (the foreground component image) of the pixel forming the contour of the foreground component image (third pixel from the left in the right part of FIG. 99) Only pixel values) are values extrapolated based on the pixel values from the left in the upper right part in FIG. 99 (values estimated by extrapolation).
[0633]
More specifically, the
[0634]
Note that the neighboring pixels of the pixels forming the contour of the foreground component image used for extrapolation are adjacent to the direction of the motion to be added in the process of adding motion blur described later, as viewed from the pixels forming the contour. Pixels are used. In this way, continuity between the pixels constituting the foreground component image is maintained, so that natural motion blur can be added to the foreground component image, and further, it can be combined with an arbitrary background image. Thus, a more natural composite image can be generated. In addition, when obtaining a function required for extrapolation, the
[0635]
The spatial mixing
[0636]
That is, the spatial mixing
[0637]
More specifically, the pixel value (pixel value obtained by extrapolation) indicated by the black and gray portions of the pixel value of the third pixel from the left in the upper right part of FIG. 99 is Pp. When the pixel value (pixel value of the input foreground component image) indicated by the portion painted only in black is Pr, the spatial mixture
[0638]
By such processing, the spatial mixing ratio in which spatial mixing is considered becomes a distribution as shown in the lower right part of FIG. That is, the spatial mixing ratio of the pixels from the left to the second is 1, the mixing ratio of the third pixel from the left is Pr / Pp, and the spatial mixing ratio of the fourth and fifth pixels from the left is 0. It becomes.
[0639]
Next, image combining processing by the combining
[0640]
In step S <b> 941, the contour neighboring
[0641]
That is, the contour neighboring
[0642]
In step S <b> 942, the
[0643]
That is, the
[0644]
In step S943, the spatial mixture
[0645]
That is, as described above, the spatial mixing
[0646]
As a result of such processing, the spatial mixing ratio in which spatial mixing is considered, as shown in the lower right part of FIG. 99, the spatial mixing ratio of the second pixel from the left becomes 1, and the third pixel from the left The mixing ratio is Pr / Pp, and the spatial mixing ratio of the fourth and fifth pixels from the left is zero.
[0647]
According to the above, the staircase-like failure phenomenon that has occurred by expressing the contour of the foreground component image in units of pixels takes into account the spatial mixing ratio, and thus accurately represents the pixel values of the pixels forming the contour. Even if the foreground component image and an arbitrary background component image are combined, a visually natural combined image can be generated.
[0648]
The sensor is not limited to the CCD, and may be a solid-state image sensor, for example, a sensor such as BBD (Bucket Brigade Device), CID (Charge Injection Device), or CPD (Charge Priming Device). The sensor is not limited to a sensor arranged in a matrix, and may be a sensor in which detection elements are arranged in a line.
[0649]
The series of processes described above can be executed by hardware, but can also be executed by software. When a series of processes is executed by software, a program constituting the software may execute various functions by installing a computer incorporated in dedicated hardware or various programs. For example, it is installed from a recording medium in a general-purpose personal computer or the like.
[0650]
FIG. 101 shows a configuration of an embodiment of a personal computer when the electrical internal configuration of the image processing unit in FIG. 6 is realized by software. A
[0651]
As shown in FIG. 101, the recording medium on which the program is recorded is distributed to provide the program to the user separately from the computer. The magnetic disk 2021 (including the flexible disk) on which the program is recorded is distributed. By a package medium composed of an optical disk 2022 (including compact disc-read only memory (CD-ROM), DVD (digital versatile disk)), a magneto-optical disk 2023 (including MD (mini-disc)), or a
[0652]
In this specification, the step of describing the program recorded on the recording medium is not limited to the processing performed in time series in the order described, but of course, it is not necessarily performed in time series. Or the process performed separately is included.
[0653]
【The invention's effect】
According to the present invention, it is possible to synthesize a foreground component image and an arbitrary background component image as a natural image.
[Brief description of the drawings]
FIG. 1 is a diagram showing a conventional composite image.
FIG. 2 is a diagram showing a distribution of pixel values of a conventional composite image.
FIG. 3 is a diagram illustrating a mixing ratio of a conventional composite image.
FIG. 4 is a diagram illustrating a pixel unit relationship between a foreground component image and a background component image of a conventional composite image.
FIG. 5 is a diagram illustrating a relationship between a foreground component image and a background component image of an original composite image in units of pixels.
FIG. 6 is a block diagram illustrating a configuration example of an image processing unit.
FIG. 7 is a diagram illustrating imaging by a sensor.
FIG. 8 is a diagram illustrating an arrangement of pixels.
FIG. 9 is a diagram illustrating the operation of a detection element.
FIG. 10 is a diagram illustrating an image obtained by imaging an object corresponding to a moving foreground and an object corresponding to a stationary background.
FIG. 11 is a diagram illustrating a background area, a foreground area, a mixed area, a covered background area, and an uncovered background area.
FIG. 12 is a model diagram in which pixel values of pixels arranged in a row adjacent to each other in an image obtained by capturing an object corresponding to a stationary foreground and an object corresponding to a stationary background are developed in the time direction; It is.
FIG. 13 is a model diagram in which pixel values are developed in a time direction and a period corresponding to a shutter time is divided.
FIG. 14 is a model diagram in which pixel values are developed in a time direction and a period corresponding to a shutter time is divided.
FIG. 15 is a model diagram in which pixel values are developed in a time direction and a period corresponding to a shutter time is divided.
FIG. 16 is a diagram illustrating an example in which pixels in a foreground area, a background area, and a mixed area are extracted.
FIG. 17 is a diagram illustrating a correspondence between a pixel and a model in which pixel values are expanded in the time direction.
FIG. 18 is a model diagram in which pixel values are developed in the time direction and a period corresponding to a shutter time is divided.
FIG. 19 is a model diagram in which pixel values are developed in a time direction and a period corresponding to a shutter time is divided.
FIG. 20 is a model diagram in which pixel values are developed in a time direction and a period corresponding to a shutter time is divided.
FIG. 21 is a model diagram in which pixel values are developed in a time direction and a period corresponding to a shutter time is divided.
FIG. 22 is a model diagram in which pixel values are developed in a time direction and a period corresponding to a shutter time is divided.
FIG. 23 is a flowchart illustrating a composite image generation process.
24 is a block diagram showing a configuration of a
FIG. 25 is a diagram illustrating an image when an object corresponding to the foreground is moving.
FIG. 26 is a model diagram in which pixel values are developed in a time direction and a period corresponding to a shutter time is divided.
FIG. 27 is a model diagram in which pixel values are developed in a time direction and a period corresponding to a shutter time is divided.
FIG. 28 is a model diagram in which pixel values are developed in a time direction and a period corresponding to a shutter time is divided.
FIG. 29 is a diagram illustrating region determination conditions.
30 is a diagram showing an example of the result of specifying a region by the
FIG. 31 is a diagram illustrating an example of a result of specifying a region by the
FIG. 32 is a flowchart illustrating an area specifying process.
33 is a block diagram illustrating another configuration of the
FIG. 34 is a model diagram in which pixel values are developed in the time direction and a period corresponding to a shutter time is divided.
FIG. 35 is a diagram illustrating an example of a background image.
36 is a block diagram showing a configuration of a binary object
FIG. 37 is a diagram illustrating calculation of a correlation value.
FIG. 38 is a diagram illustrating calculation of a correlation value.
FIG. 39 is a diagram illustrating an example of a binary object image.
40 is a block diagram showing a configuration of a time
41 is a diagram for describing determination by an
FIG. 42 is a diagram illustrating an example of determination by the time
FIG. 43 is a flowchart for describing region specifying processing by the
FIG. 44 is a flowchart illustrating details of a region determination process.
45 is a block diagram showing still another configuration of the
46 is a block diagram illustrating a configuration of a
47 is a diagram for explaining motion compensation by a
48 is a diagram for explaining motion compensation of a
FIG. 49 is a flowchart illustrating an area specifying process.
FIG. 50 is a flowchart illustrating details of robust processing.
51 is a block diagram showing a configuration of a mixture
52 is a block diagram showing a configuration of an estimated mixture
FIG. 53 is a model diagram in which pixel values are developed in the time direction and a period corresponding to a shutter time is divided.
FIG. 54 is a model diagram illustrating weighted differences.
FIG. 55 is a model diagram illustrating weighted differences.
FIG. 56 is a model diagram illustrating the relationship between a weighted difference and a motion vector.
FIG. 57 is a model diagram illustrating calculation of a correlation value.
FIG. 58 is a diagram illustrating an example of a block of pixels that are targets of correlation value calculation;
59 is a block diagram showing another configuration of the mixture
FIG. 60 is a flowchart illustrating processing for calculating a mixture ratio.
[Fig. 61] Fig. 61 is a flowchart for describing mixing ratio estimation processing corresponding to a covered background region.
FIG. 62 is a diagram illustrating a straight line approximating the mixture ratio α.
FIG. 63 is a diagram illustrating a plane that approximates the mixture ratio α.
FIG. 64 is a diagram for explaining the correspondence between pixels of a plurality of frames when calculating the mixture ratio α.
65 is a block diagram showing another configuration of the mixture ratio
FIG. 66 is a diagram illustrating an example of an estimated mixture ratio.
[Fig. 67] Fig. 67 is a flowchart for describing processing of mixture ratio estimation using a model corresponding to a covered background region.
68 is a block diagram illustrating an example of a configuration of a foreground /
FIG. 69 is a diagram illustrating an input image, a foreground component image, and a background component image.
FIG. 70 is a diagram illustrating an input image, a foreground component image, and a background component image.
FIG. 71 is a model diagram in which pixel values are developed in a time direction and a period corresponding to a shutter time is divided.
FIG. 72 is a model diagram in which pixel values are developed in the time direction and a period corresponding to a shutter time is divided.
FIG. 73 is a model diagram in which pixel values are developed in the time direction and a period corresponding to a shutter time is divided.
74 is a block diagram illustrating an example of a configuration of a
FIG. 75 is a diagram illustrating an example of a separated foreground component image and background component image.
FIG. 76 is a flowchart for describing foreground and background separation processing;
77 is a block diagram illustrating an example of a configuration of a motion
FIG. 78 is a diagram illustrating a processing unit.
FIG. 79 is a model diagram in which pixel values of a foreground component image are developed in a time direction and a period corresponding to a shutter time is divided.
FIG. 80 is a model diagram in which pixel values of a foreground component image are developed in the time direction and a period corresponding to a shutter time is divided.
FIG. 81 is a flowchart illustrating processing for removing motion blur included in the foreground component image by the motion
82 is a diagram showing another configuration of the motion
FIG. 83 is a diagram illustrating an example of a model that designates correspondence between pixel values and foreground components.
FIG. 84 is a diagram illustrating calculation of foreground components.
FIG. 85 is a diagram illustrating calculation of foreground components.
FIG. 86 is a flowchart for describing foreground motion blur removal processing;
87 is a block diagram illustrating an exemplary configuration of a combining
[Fig. 88] Fig. 88 is a diagram for describing a smoothing process for a contour portion of a foreground component image.
[Fig. 89] Fig. 89 is a diagram for describing smoothing processing for a contour portion of a foreground component image.
FIG. 90 is a diagram for describing smoothing processing for a contour portion of a foreground component image.
FIG. 91 is a model diagram in which pixel values of a foreground component image are expanded in a time direction and a period corresponding to a shutter time is divided.
FIG. 92 is a model diagram in which pixel values of a foreground component image are developed in the time direction and a period corresponding to a shutter time is divided.
FIG. 93 is a flowchart for describing image composition processing;
FIG. 94 is a diagram illustrating a mixing ratio of synthesized images.
FIG. 95 is a diagram illustrating a distribution of pixel values of a combined image.
FIG. 96 is a diagram showing a synthesized image.
97 is a block diagram illustrating another example of the configuration of the combining
FIG. 98 is a diagram illustrating a correspondence between a pixel value level of a foreground component image and a mixing ratio.
FIG. 99 is obtained by extrapolating the pixel value level of the pixels forming the contour of the foreground component image, and obtaining the mixture ratio based on the pixel value obtained by extrapolation and the pixel value of the input image. It is a figure explaining a method.
FIG. 100 is a flowchart for describing image composition processing;
Fig. 101 is a diagram illustrating a recording medium.
[Explanation of symbols]
21 CPU, 22 ROM, 23 RAM, 26 input section, 27 output section, 28 storage section, 29 communication section, 51 magnetic disk, 52 optical disk, 53 magneto-optical disk, 54 semiconductor memory, 101 object extraction section, 102 motion detection section , 103 area specifying unit, 104 mixing ratio calculation unit, 105 foreground / background separation unit, 106 motion blur removal unit, 107 synthesis unit, 201 frame memory, 202-1 to 202-4 static motion determination unit, 203-1 to 203- 3 area determination unit, 204 determination flag storage frame memory, 205 composition unit, 206 determination flag storage frame memory, 301 background image generation unit, 302 binary object image extraction unit, 303 time change detection unit, 321 correlation value calculation unit, 322 Threshold processing unit, 341 frame memory, 342 region determination unit, 3 1 Robust Unit, 381 Motion Compensator, 382 Switch, 383-1 to 383-N Frame Memory, 384-1 to 384-N Weight Unit, 385 Accumulator, 401 Estimated Mixture Ratio Processor, 402 Estimated Mixture Ratio Processor , 403 mixing ratio determination unit, 421 frame memory, 422 weight generation unit, 423 weighted frame difference calculation unit, 424 motion compensation unit, 425 frame memory, 426 correlation value calculation unit, 427 maximum value determination unit, 441 selection unit, 442 selection , 601 separating unit, 602 switch, 603 combining unit, 604 switch, 605 combining unit, 621 frame memory, 622 separation processing block, 623 frame memory, 631 uncovered region processing unit, 632 covered region processing unit, 633 combining unit, 634 Synthesizer, 801 Unit determination unit, 802 modeling unit, 803 equation generation unit, 804 addition unit, 805 calculation unit, 901 processing unit determination unit, 902 modeling unit, 903 equation generation unit, 904 calculation unit, 905 correction unit, 1001 contour extraction , 1002 contour smoothing unit, 1003 spatial mixing ratio generation unit, 1004 foreground component image smoothing unit, 1005 motion blur addition unit, 1006 region information adjustment unit, 1007 time mixing ratio calculation unit, 1008 background component generation unit, 1009 mixing region Image composition unit, 1010 Image composition unit, 1101 Contour neighborhood pixel extraction unit, 1102 Extrapolation interpolation unit, 1103 Spatial mixing ratio generation unit
Claims (4)
前記輪郭部内の注目画素に対応する複数の画素の画素位置を回帰して回帰直線を検出する回帰直線検出手段と、
前記回帰直線近傍の各画素における前景画像の成分の面積に応じて、各画素の空間混合比を求める空間混合比生成手段と、
前記画素検出手段により検出された輪郭部を形成する画素の画素値に前記空間混合比生成手段によって求められた空間混合比を乗じることにより、前記輪郭部をスムージングするスムージング手段と、
前記前景画像の輪郭部内の各注目画素に対応する前記回帰直線検出手段により検出された回帰直線を結ぶことにより前記輪郭部がスムージングされた前景画像に対して所定の方向に動きボケを付加した動きボケ付加前景画像を生成する動きボケ付加手段と、
前記動きボケ付加前景画像と背景画像を合成する合成手段と
を備える画像処理装置。Pixel detection means for detecting a contour portion of the foreground image without motion blur;
Regression line detecting means for detecting a regression line by regressing the pixel positions of a plurality of pixels corresponding to the target pixel in the contour portion;
A spatial mixing ratio generating means for determining a spatial mixing ratio of each pixel according to an area of a foreground image component in each pixel near the regression line;
Smoothing means for smoothing the contour portion by multiplying the pixel value of the pixel forming the contour portion detected by the pixel detection means by the spatial mixing ratio determined by the spatial mixing ratio generation means ;
A motion in which motion blur is added in a predetermined direction to the foreground image in which the contour portion is smoothed by connecting the regression lines detected by the regression line detection means corresponding to each pixel of interest in the contour portion of the foreground image Motion blur adding means for generating a blur added foreground image;
Combining means for combining the motion blur added foreground image and the background image;
An image processing apparatus comprising:
前記輪郭部内の注目画素に対応する複数の画素の画素位置を回帰して回帰直線を検出する回帰直線検出ステップと、
前記回帰直線近傍の各画素における前景画像の成分の面積に応じて、各画素の空間混合比を求める空間混合比生成ステップと、
前記画素検出ステップの処理で検出された輪郭部を形成する画素の画素値に前記空間混合比生成ステップの処理によって求められた空間混合比を乗じることにより、前記輪郭部をスムージングするスムージングステップと、
前記前景画像の輪郭部内の各注目画素に対応する前記回帰直線検出ステップの処理により検出された回帰直線を結ぶことにより前記輪郭部がスムージングされた前景画像に対して所定の方向に動きボケを付加した動きボケ付加前景画像を生成する動きボケ付加ステップと、
前記動きボケ付加前景画像と背景画像を合成する合成ステップと
を含む画像処理方法。A pixel detection step for detecting a contour portion of the foreground image without motion blur;
A regression line detection step for detecting a regression line by regressing the pixel positions of a plurality of pixels corresponding to the target pixel in the contour portion;
A spatial mixing ratio generating step for determining a spatial mixing ratio of each pixel according to an area of a foreground image component in each pixel near the regression line;
A smoothing step of smoothing the contour portion by multiplying a pixel value of a pixel forming the contour portion detected in the processing of the pixel detection step by a spatial mixture ratio obtained by the processing of the spatial mixture ratio generation step ;
A motion blur is added in a predetermined direction to the foreground image in which the contour portion is smoothed by connecting the regression lines detected by the processing of the regression line detection step corresponding to each target pixel in the contour portion of the foreground image. A motion blur adding step for generating the motion blur added foreground image,
A synthesis step of synthesizing the motion blur added foreground image and a background image;
An image processing method including :
前記輪郭部内の注目画素に対応する複数の画素の画素位置を回帰して回帰直線を検出する回帰直線検出ステップと、
前記回帰直線近傍の各画素における前景画像の成分の面積に応じて、各画素の空間混合比を求める空間混合比生成ステップと、
前記画素検出ステップの処理で検出された輪郭部を形成する画素の画素値に前記空間混合比生成ステップの処理によって求められた空間混合比を乗じることにより、前記輪郭部をスムージングするスムージングステップと、
前記前景画像の輪郭部内の各注目画素に対応する前記回帰直線検出ステップの処理により検出された回帰直線を結ぶことにより前記輪郭部がスムージングされた前景画像に対して所定の方向に動きボケを付加した動きボケ付加前景画像を生成する動きボケ付加ステップと、
前記動きボケ付加前景画像と背景画像を合成する合成ステップと
を含むコンピュータが読み取り可能なプログラムが記録されている記録媒体。A pixel detection step for detecting a contour portion of the foreground image without motion blur;
A regression line detection step for detecting a regression line by regressing the pixel positions of a plurality of pixels corresponding to the target pixel in the contour portion;
A spatial mixing ratio generating step for determining a spatial mixing ratio of each pixel according to an area of a foreground image component in each pixel near the regression line;
A smoothing step of smoothing the contour portion by multiplying a pixel value of a pixel forming the contour portion detected in the processing of the pixel detection step by a spatial mixture ratio obtained by the processing of the spatial mixture ratio generation step ;
A motion blur is added in a predetermined direction to the foreground image in which the contour portion is smoothed by connecting the regression lines detected by the processing of the regression line detection step corresponding to each target pixel in the contour portion of the foreground image. A motion blur adding step for generating the motion blur added foreground image,
A synthesis step of synthesizing the motion blur added foreground image and a background image;
A computer-readable recording medium on which a computer-readable program is recorded.
前記輪郭部内の注目画素に対応する複数の画素の画素位置を回帰して回帰直線を検出する回帰直線検出ステップと、
前記回帰直線近傍の各画素における前景画像の成分の面積に応じて、各画素の空間混合比を求める空間混合比生成ステップと、
前記画素検出ステップの処理で検出された輪郭部を形成する画素の画素値に前記空間混合比生成ステップの処理によって求められた空間混合比を乗じることにより、前記輪郭部をスムージングするスムージングステップと、
前記前景画像の輪郭部内の各注目画素に対応する前記回帰直線検出ステップの処理により検出された回帰直線を結ぶことにより前記輪郭部がスムージングされた前景画像に対して所定の方向に動きボケを付加した動きボケ付加前景画像を生成する動きボケ付加ステップと、
前記動きボケ付加前景画像と背景画像を合成する合成ステップと
をコンピュータに実行させることを特徴とするプログラム。A pixel detection step for detecting a contour portion of the foreground image without motion blur;
A regression line detection step for detecting a regression line by regressing the pixel positions of a plurality of pixels corresponding to the target pixel in the contour portion;
A spatial mixing ratio generating step for determining a spatial mixing ratio of each pixel according to an area of a foreground image component in each pixel near the regression line;
A smoothing step of smoothing the contour portion by multiplying a pixel value of a pixel forming the contour portion detected in the processing of the pixel detection step by a spatial mixture ratio obtained by the processing of the spatial mixture ratio generation step ;
A motion blur is added in a predetermined direction to the foreground image in which the contour portion is smoothed by connecting the regression lines detected by the processing of the regression line detection step corresponding to each target pixel in the contour portion of the foreground image. A motion blur adding step for generating the motion blur added foreground image,
A program causing a computer to execute a synthesis step of synthesizing the motion blur added foreground image and a background image.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003094659A JP4325252B2 (en) | 2003-03-31 | 2003-03-31 | Image processing apparatus and method, recording medium, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003094659A JP4325252B2 (en) | 2003-03-31 | 2003-03-31 | Image processing apparatus and method, recording medium, and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2004302822A JP2004302822A (en) | 2004-10-28 |
JP4325252B2 true JP4325252B2 (en) | 2009-09-02 |
Family
ID=33407175
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2003094659A Expired - Fee Related JP4325252B2 (en) | 2003-03-31 | 2003-03-31 | Image processing apparatus and method, recording medium, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4325252B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2016081423A (en) * | 2014-10-21 | 2016-05-16 | ギズモモバイル株式会社 | Information processing system, information processing device and method, and program |
-
2003
- 2003-03-31 JP JP2003094659A patent/JP4325252B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2004302822A (en) | 2004-10-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4596202B2 (en) | Image processing apparatus and method, and recording medium | |
JP4729812B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4596216B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4596220B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4596222B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4596221B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4596224B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4106874B2 (en) | Image processing apparatus and method, and recording medium | |
JP4596226B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4596203B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4674408B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4596223B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4596219B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4840630B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4596214B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4596215B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4150949B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4596217B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4596211B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4596209B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4325252B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4333183B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4596218B2 (en) | Image processing apparatus and method, recording medium, and program | |
JP4596205B2 (en) | Image processing apparatus and method, and program | |
JP4596225B2 (en) | Image processing apparatus and method, recording medium, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20060222 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20090122 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20090217 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20090417 |
|
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: 20090519 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20090601 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120619 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120619 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120619 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130619 Year of fee payment: 4 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees |