JP3036349B2 - Background image generation method and apparatus - Google Patents

Background image generation method and apparatus

Info

Publication number
JP3036349B2
JP3036349B2 JP6695094A JP6695094A JP3036349B2 JP 3036349 B2 JP3036349 B2 JP 3036349B2 JP 6695094 A JP6695094 A JP 6695094A JP 6695094 A JP6695094 A JP 6695094A JP 3036349 B2 JP3036349 B2 JP 3036349B2
Authority
JP
Japan
Prior art keywords
background
image
mask
input
storage means
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP6695094A
Other languages
Japanese (ja)
Other versions
JPH07284086A (en
Inventor
徹 池田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP6695094A priority Critical patent/JP3036349B2/en
Publication of JPH07284086A publication Critical patent/JPH07284086A/en
Application granted granted Critical
Publication of JP3036349B2 publication Critical patent/JP3036349B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Closed-Circuit Television Systems (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、移動物体と背景とから
構成されている動画像から移動物体を取り除き、背景画
像を自動生成する方法および装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method and apparatus for automatically generating a background image by removing a moving object from a moving image composed of a moving object and a background.

【0002】[0002]

【従来の技術】背景画像の生成については、移動物体の
通過による画像の変動に対して安定性が高く、照明条件
などによる背景自体の変動に素早く追従できる方法が要
望されている。
2. Description of the Related Art With respect to generation of a background image, there is a demand for a method which has high stability against image fluctuation due to the passage of a moving object and can quickly follow fluctuation of the background itself due to lighting conditions and the like.

【0003】三菱電機技報Vol.67,No.7(1
993)記載の「動き情報を用いた高信頼型侵入監視装
置」に提案手法として述べられている背景画像生成方法
では、各画素について1フレーム前の背景画像と現在の
入力画像との差をとり、差の小さな領域を背景に近い領
域、差の大きな領域を背景から遠い領域と判断し、差に
応じた値で背景の更新をする。この方法では、時刻によ
る背景の緩やかな変動には素早く適応できるが、日照条
件の急激な変化による背景の急激な変動には全く適応で
きない。また、予め背景画像を用意しなければならない
という欠点もある。
[0003] Mitsubishi Electric Technical Report Vol. 67, no. 7 (1
In the background image generation method described as a proposed method in “Highly Reliable Intrusion Monitoring Device Using Motion Information” described in 993), the difference between the background image one frame before and the current input image is calculated for each pixel. The region having a small difference is determined as a region close to the background, and the region having a large difference is determined as a region far from the background, and the background is updated with a value corresponding to the difference. This method can quickly adapt to a gradual change in the background due to time, but cannot adapt to a sudden change in the background due to a sudden change in the sunshine condition. There is also a disadvantage that a background image must be prepared in advance.

【0004】特開平3−112282号公報に記載の背
景画像生成方法およびその装置では、各画素について時
系列の入力画像と一定時間の遅延のある参照画像との間
の差分をとり、差分の値により移動物体領域に所属する
画素と背景領域に所属する画素とを識別し、背景領域の
みを差分の値に応じて更新する。この方法では図5のよ
うに移動物体の速度が遅く、入力画像と参照画像とで移
動物体に含まれる同じ画素値の領域が重複してしまう場
合に、重複部分を背景領域と誤判断して背景に取り込ん
でしまうという問題点がある。ただし、図5では黒が移
動領域、白が背景領域を示している。
In the background image generation method and apparatus described in Japanese Patent Application Laid-Open No. 3-112282, a difference between a time-series input image and a reference image with a certain time delay is obtained for each pixel, and the difference value is calculated. Then, the pixel belonging to the moving object region and the pixel belonging to the background region are identified, and only the background region is updated according to the difference value. In this method, when the speed of the moving object is slow as shown in FIG. 5 and the regions of the same pixel value included in the moving object overlap in the input image and the reference image, the overlapping portion is erroneously determined as the background region. There is a problem of taking in the background. However, in FIG. 5, black indicates the moving area and white indicates the background area.

【0005】[0005]

【発明が解決しようとする課題】背景画像を生成する
際、移動物体の通過による画像の変動に対して安定性が
高く、照明条件などによる背景自体の変動に素早く追従
できるという2条件を同時に満たす必要がある。また、
実際に背景画像の生成の対象とされる動画像は屋外を撮
影した場合や、様々な速度の移動物体を撮影している場
合が非常に多い。
When a background image is generated, the two conditions that the stability of the image is high with respect to the fluctuation of the image due to the passage of a moving object and that it can quickly follow the fluctuation of the background itself due to lighting conditions and the like are simultaneously satisfied. There is a need. Also,
In many cases, a moving image to be actually generated as a background image is taken outdoors or when moving objects at various speeds are taken.

【0006】しかしながら、従来の手法では、背景領域
および移動物体領域の判定を行わない場合には、背景自
体の変動への追従が遅く予め背景画像を必要とする問題
があったり、判定を行う場合には、低速の移動物体に対
して誤判定する可能性が高く、これらの手法だけでは十
分な対応ができない。
However, in the conventional method, when the background area and the moving object area are not determined, there is a problem that the following of the fluctuation of the background itself is slow and a background image is required in advance. Is highly likely to be erroneously determined for a low-speed moving object, and these methods alone cannot sufficiently cope.

【0007】本発明は撮影環境の変動による背景の変動
に素早く追従し、様々な速度で進入する移動物体に対し
て安定な背景画像生成方法および装置を提供することを
目的とする。
SUMMARY OF THE INVENTION It is an object of the present invention to provide a method and an apparatus for generating a background image which can quickly follow a change in the background caused by a change in a photographing environment and which is stable against a moving object entering at various speeds.

【0008】[0008]

【課題を解決するための手段】[Means for Solving the Problems]

【0009】[0009]

【0010】本願発明の背景画像生成装置は、背景と移
動物体とから構成されている動画像を入力する画像入力
手段と、当該時刻の入力画像を格納する第1の入力画像
記憶手段と、当該時刻の1フレーム前の入力画像を格納
する第2の入力画像記憶手段と、第1の入力画像記憶手
段に格納されている画像を第2の入力画像記憶手段にコ
ピーし前記画像入力手段により入力された入力画像を第
1の入力画像記憶手段に格納する入力画像更新手段と、
前記第1および第2の入力画像記憶手段に格納されてい
る2画像間の差分を2値化し、変動のあった画素の値を
0、変動のなかった画素の値を1とする背景マスクを生
成する背景マスク生成手段と、2以上の値をとるフレー
ム数nを予め用意し、1≦i≦nに対して当該時刻のi
−1フレーム前の背景マスクを格納する第iの背景マス
ク記憶手段と、前記第iの背景マスク記憶手段に格納さ
れている背景マスクを前記第i+1の背景マスク記憶手
段にコピーして格納する操作を1≦i≦n−1について
降べきの順に行い、背景マスク生成手段で生成された背
景マスクを第1の背景マスク記憶手段に格納する背景マ
スク更新手段と、前記第1〜nの背景マスク記憶手段に
格納されているn枚の背景マスクの論理積を算出し値が
1となった画素からなる領域を背景領域、0となった画
素からなる領域を移動物体領域と判断し、後記の背景画
像記憶手段に格納されている背景画像を、背景領域に対
応する画素については前記第1の入力画像との差分の値
に応じて更新し、その他の画素については不変とするこ
とによって新たに背景画像を生成する背景更新手段と、
前記背景更新手段で生成された背景画像を格納する背景
画像記憶手段と、前記背景画像記憶手段に格納されてい
る背景画像を出力する画像出力手段とを備えていること
を特徴としている。
The background image generating apparatus according to the present invention comprises: an image input means for inputting a moving image composed of a background and a moving object; a first input image storage means for storing an input image at the time; A second input image storage unit for storing an input image one frame before the time, and an image stored in the first input image storage unit copied to the second input image storage unit and input by the image input unit Input image updating means for storing the input image obtained in the first input image storage means,
A background mask in which the difference between the two images stored in the first and second input image storage means is binarized, and the value of a pixel that has changed is 0 and the value of a pixel that has not changed is 1 is set as a background mask. The background mask generating means to be generated and the number of frames n having a value of 2 or more are prepared in advance, and for 1 ≦ i ≦ n, i
An i-th background mask storing means for storing a background mask one frame before, and an operation of copying and storing the background mask stored in the i-th background mask storing means in the (i + 1) -th background mask storing means Is performed in descending power order for 1 ≦ i ≦ n−1, and the background mask generated by the background mask generating means is stored in the first background mask storage means; The logical product of n background masks stored in the storage means is calculated, and an area composed of pixels having a value of 1 is determined as a background area, and an area composed of pixels having a value of 0 is determined as a moving object area. The background image stored in the background image storage unit is updated by updating the pixels corresponding to the background area according to the difference value from the first input image and making the other pixels unchanged. And the background update means for generating a scene image,
The image processing apparatus further includes a background image storage unit that stores the background image generated by the background update unit, and an image output unit that outputs the background image stored in the background image storage unit.

【0011】また、本願発明の背景画像生成装置は、背
景と移動物体とから構成されている動画像を入力する画
像入力手段と、当該時刻の入力画像を格納する第1の入
力画像記憶手段と、当該時刻の1フレーム前の入力画像
を格納する第2の入力画像記憶手段と、前記第1の入力
画像記憶手段に格納されている画像を前記第2の入力画
像記憶手段にコピーし前記画像入力手段により入力され
た入力画像を第1の入力画像記憶手段に格納する入力画
像更新手段と、前記第1および第2の入力画像記憶手段
に格納されている2画像間の差分を2値化し、変動のあ
った画素の値を0、変動のなかった画素の値を1とする
背景マスクを生成する背景マスク生成手段と、2以上の
値をとるフレーム数nを予め用意し、1≦k≦nに対し
て当該時刻のk−1フレーム前の背景マスクを第kの背
景マスクとしたとき、2≦i≦nに対しては第1〜iの
背景マスクの論理積である第iの累積マスクを格納し且
つi=1に対しては第1の背景マスクを格納する第iの
累積マスク記憶手段と、前記第iの累積マスク記憶手段
に格納されている累積マスクと前記背景マスク生成手段
で得られる背景マスクとの論理積を求めて前記第i+1
の累積マスク記憶手段に格納する操作を1≦i≦n−1
について降べきの順に行い、背景マスク生成手段で生成
された背景マスクを第1の累積マスク記憶手段に格納す
る累積マスク更新手段と、前記第nの累積マスク記憶手
段に格納されている累積マスクの値が1である画素から
なる領域を背景領域、0である画素からなる領域を移動
物体領域と判断し、後記の背景画像記憶手段に格納され
ている背景画像を、背景領域に対応する画素については
前記第1の入力画像との差分の値に応じて更新し、その
他の画素については不変とすることによって新たに背景
画像を生成する背景更新手段と、前記背景更新手段で生
成された背景画像を格納する背景画像記憶手段と、前記
背景画像記憶手段に格納されている背景画像を出力する
画像出力手段とを備えていることを特徴としている。
Further , the background image generating apparatus of the present invention comprises an image input means for inputting a moving image composed of a background and a moving object, and a first input image storage means for storing the input image at the time. Second input image storage means for storing an input image one frame before the time, and copying the image stored in the first input image storage means to the second input image storage means. Input image updating means for storing the input image input by the input means in the first input image storage means, and binarizing the difference between the two images stored in the first and second input image storage means A background mask generating means for generating a background mask in which the value of a pixel that has changed is 0 and a value of a pixel that has not changed is 1; and the number of frames n having a value of 2 or more are prepared in advance, and 1 ≦ k ≤n
The background mask k-1 frames before the current time to the k-th background
When the scenery mask is used, for 2 ≦ i ≦ n, the first to i-th
The i-th cumulative mask, which is the logical product of the background masks, is stored and
For the i = 1, the i-th storing the first background mask
An accumulative mask storage unit, and a logical product of the accumulative mask stored in the i-th accumulative mask storage unit and the background mask obtained by the background mask generating unit is calculated.
1 ≦ i ≦ n−1
The cumulative mask updating means for storing the background mask generated by the background mask generating means in the first cumulative mask storage means, and the cumulative mask stored in the n-th cumulative mask storage means. A region consisting of pixels having a value of 1 is determined to be a background region, a region consisting of pixels having a value of 0 is determined to be a moving object region, and a background image stored in a background image storage means described below is determined for a pixel corresponding to the background region. A background update unit for generating a new background image by updating according to the value of the difference from the first input image and making the other pixels unchanged, a background image generated by the background update unit , And image output means for outputting the background image stored in the background image storage means.

【0012】[0012]

【作用】本発明では、隣接フレーム間の差分で得られる
各画素の変動情報を一定時間蓄積し、これらの情報から
各画素が移動物体領域に属するのか背景領域に属するの
かを判断し、低速の移動物体へ対処する。すなわち、一
瞬でも変動のあった場合には移動物体領域に所属する画
素であると判断している。従って、移動物体の移動量が
少なくて同色部分が微小な時間内に同じ画素に入力され
やすい場合でも背景領域と誤判定しないことが期待でき
るので、低速物体が存在する場合にも安定した背景画像
が得られる。
According to the present invention, the variation information of each pixel obtained from the difference between adjacent frames is accumulated for a certain period of time, and from this information, it is determined whether each pixel belongs to the moving object area or the background area. Deal with moving objects. That is, when there is a change even for a moment, it is determined that the pixel belongs to the moving object area. Therefore, even when the moving amount of the moving object is small and the same color portion is likely to be input to the same pixel within a very short time, it can be expected that it will not be erroneously determined as the background area. Is obtained.

【0013】また、背景画像の更新は毎フレーム行うこ
とができるので、日照などによる背景の変動に素早く追
従することが可能である。
Further, since the background image can be updated every frame, it is possible to quickly follow a change in the background due to sunshine or the like.

【0014】[0014]

【実施例】第1の発明の背景画像生成方法の一実施例に
ついて、図1を用いて説明する。図1は時刻tにおける
1フレームあたりの流れ図を示しており、実際には本処
理が繰り返し実行される。また、図中の時刻tの背景マ
スク106−1から時刻t−n+1の背景マスク106
−nまでのn枚の画像は全て2値画像である。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS One embodiment of a background image generating method according to the first invention will be described with reference to FIG. FIG. 1 shows a flow chart for one frame at time t. In practice, this processing is repeatedly executed. Further, the background mask 106-1 at time t to the background mask 106 at time t-n + 1 in the figure are shown.
All n images up to -n are binary images.

【0015】まず、背景と移動物体からなる動画像が入
力されたら、背景マスクの生成101において、前記入
力された動画像のうち、時刻tの入力画像105−2と
時刻t−1の入力画像105−1との間の差分を求め、
各画素について差分の値がしきい値以上ならば0、しき
い値未満ならば1となるように2値画像を生成する。上
記背景マスクの生成101で得られた2値画像を時刻t
の背景マスク106−1とする。即ち、時刻tの背景マ
スクの0が与えられた画素は、入力画像の対応する画素
が時刻tと時刻t−1の間に変動があったことを示し、
1が与えられた画素は変動が生じなかったことを示す。
次に、論理積102において、時刻tの背景マスク10
6−1から時刻t−n+1の背景マスク106−nまで
のn枚の2値画像の論理積をとり論理積画像を生成し、
背景領域の識別103において上記論理積画像の各画素
について論理積の値が1の場合には背景領域に所属する
画素、0の場合には移動物体領域に所属する画素と判断
する。背景画像の更新204において、時刻t−1の背
景画像107−1と時刻tの入力画像105−2を参照
し、一例として以下に述べるような方法により背景画像
の更新を行い、時刻tの背景画像107−2を生成す
る。まず、背景領域に所属すると判断された画素の場合
には、時刻t−1の背景画像107−1の対応する画素
値と、時刻tの入力画像105−2の対応する画素値と
の一定の割合での加重平均を求めて時刻tの背景画像1
07−2の対応する画素値とする。また、移動物体領域
に所属すると判断された画素の場合には時刻t−1の背
景画像107−1の対応する画素値をそのまま時刻tの
背景画像の対応する画素値とする。以上により、時刻t
の背景画像107−2は、時刻t−1の背景画像107
−1から背景領域だけ更新された新しい背景画像とな
る。
First, when a moving image including a background and a moving object is input, in a background mask generation 101, an input image 105-2 at time t and an input image at time t-1 among the input moving images. Find the difference between 105-1 and
A binary image is generated so that the difference value of each pixel is 0 if the difference value is equal to or greater than the threshold value and 1 if the difference value is less than the threshold value. At time t, the binary image obtained in
Of the background mask 106-1. That is, a pixel to which 0 is given in the background mask at time t indicates that the corresponding pixel of the input image has changed between time t and time t−1,
Pixels given a 1 indicate that no variation has occurred.
Next, in the logical product 102, the background mask 10
A logical product image is generated by taking the logical product of n binary images from 6-1 to the background mask 106-n at time t-n + 1 .
In the background region identification 103, if the value of the logical product of each pixel of the logical product image is 1, it is determined that the pixel belongs to the background region, and if it is 0, it is determined that the pixel belongs to the moving object region. In the background image update 204, the background image is updated by a method described below as an example by referring to the background image 107-1 at the time t-1 and the input image 105-2 at the time t. The image 107-2 is generated. First, in the case of a pixel determined to belong to the background area, a fixed pixel value between the corresponding pixel value of the background image 107-1 at time t-1 and the corresponding pixel value of the input image 105-2 at time t is determined. Background image 1 at time t by calculating a weighted average in percentage
The corresponding pixel value is 07-2. In the case of a pixel determined to belong to the moving object area, the corresponding pixel value of the background image 107-1 at time t-1 is directly used as the corresponding pixel value of the background image at time t. As described above, the time t
Is the background image 107-2 at time t-1.
The new background image is updated from −1 only in the background area.

【0016】第2の発明の背景画像生成方法の一実施例
について、図2を用いて説明する。図2は時刻tにおけ
る1フレームあたりの流れ図を示しており、実際には本
処理が繰り返し実行される。また、図中の時刻tの累積
マスク206−1から時刻t−n+1の累積マスク20
6−nまでのn枚の画像は全て2値画像である。
An embodiment of the background image generating method according to the second invention will be described with reference to FIG. FIG. 2 shows a flow chart for one frame at time t. In practice, this process is repeatedly performed. Further, the cumulative mask 206-1 at time t to the cumulative mask 20 at time t-n + 1 in FIG.
All n images up to 6-n are binary images.

【0017】まず、背景と移動物体からなる動画像が入
力されたら、累積マスクの生成201において、前記入
力された動画像のうち、時刻tの入力画像205−2と
時刻t−1の入力画像205−1との間の差分を求め、
各画素について差分の値がしきい値以上ならば0、しき
い値未満ならば1となるように2値画像を生成する。上
記累積マスクの生成201で得られた2値画像を時刻t
の累積マスク206−1とする。次に、累積マスクの更
新202において、i=2,3,4,・・・,nに対し
て、時刻t−i+1の累積マスク206−iと前記時刻
tの累積マスク206−1との論理和をとり、新たに時
刻t−i+1の累積マスク206−iとする。即ち、時
刻t−n+1の累積マスク206−nの0が与えられた
画素は、入力画像の対応する画素が過去nフレーム間に
変動があったことを示し、1が与えられた画素は変動が
生じなかったことを示す。次に、背景領域の識別203
において、前記時刻t−n+1の累積マスク206−n
を参照し、各画素について値が1の場合には背景領域に
所属する画素、0の場合には移動物体領域に所属する画
素と判断する。背景画像の更新204において、t−1
の背景画像207−1と時刻tの入力画像205−2を
参照し、一例として第1の発明の背景画像生成方法に対
する実施例で述べた背景画像の更新104と同様の方法
により背景画像の更新を行い、時刻tの背景画像207
−2を生成する。以上により、時刻tの背景画像207
−2は、時刻t−1の背景画像から背景領域だけ更新さ
れた新しい背景画像となる。
First, when a moving image including a background and a moving object is input, a cumulative mask generation 201 generates, among the input moving images, an input image 205-2 at time t and an input image at time t-1. 205-1 and the difference between
A binary image is generated so that the difference value of each pixel is 0 if the difference value is equal to or greater than the threshold value and 1 if the difference value is less than the threshold value. The binary image obtained in the generation 201 of the cumulative mask is converted to a time t.
Is a cumulative mask 206-1. Next, in the cumulative mask update 202, for i = 2, 3, 4,..., N, the logic of the cumulative mask 206-i at time ti + 1 and the cumulative mask 206-1 at time t is calculated. The sum is obtained and a new cumulative mask 206-i at time t-i + 1 is set. That is, a pixel given 0 in the cumulative mask 206-n at time t-n + 1 indicates that the corresponding pixel of the input image has changed during the past n frames, and a pixel given 1 has changed. Indicates that it did not occur. Next, identification 203 of the background area
At the time t-n + 1, the cumulative mask 206-n
It is determined that the pixel belongs to the background area when the value is 1 and the pixel belongs to the moving object area when the value is 0 for each pixel. In the background image update 204, t-1
The background image 207-1 and the input image 205-2 at time t are referred to, and as an example, the background image is updated by the same method as the background image update 104 described in the embodiment for the background image generation method of the first invention. And the background image 207 at time t
-2 is generated. As described above, the background image 207 at the time t
-2 is a new background image obtained by updating only the background area from the background image at time t-1.

【0018】第3の発明の背景画像生成装置の一実施例
について、図3を用いて説明する。図3において第1の
背景マスク記憶手段306−1から第nの背景マスク記
憶手段306−nまでに格納されているn枚の画像は2
値画像である。
An embodiment of the background image generating apparatus according to the third invention will be described with reference to FIG. In FIG. 3, the n images stored in the first background mask storage unit 306-1 to the n-th background mask storage unit 306-n are 2
It is a value image.

【0019】まず、画像入力手段300により、背景と
移動物体からなる動画像を入力する。次に、入力画像更
新手段301が以下の2通りの動作を行う。第1に、第
1の入力画像記憶手段302の内容を第2の入力画像記
憶手段303にコピーして格納する。第2に、前記画像
入力手段300により当該時刻において入力された画像
を第1の入力画像記憶手段302に格納する。従って、
常に第1の入力画像記憶手段302には当該時刻の入力
画像、第2の入力画像記憶手段303には当該時刻の1
フレーム前の入力画像が格納される。背景マスク生成手
段304は前記第1の入力画像記憶手段302および第
2の入力画像記憶手段303に格納されている画像間の
差分を求め、各画素について差分の値がしきい値以上な
らば0、しきい値未満ならば1となるように2値画像を
生成する。即ち、0が与えられた画素は当該時刻とその
1フレーム前の間に変動があったことを示し、1が与え
られた画素は変動が生じなかったことを示す。次に、背
景マスク更新手段305が以下のn通りの動作を行う。
まず、第i−1の背景マスク記憶手段306−(i−
1)の内容を第iの背景マスク記憶手段306−iにコ
ピーするという操作をi=n,n−1,n−2,・・
・,2についての降べきの順に行う。次に、前記背景マ
スク生成手段304で生成された2値画像を第1の背景
マスク記憶手段306−1に格納する。この操作によ
り、1≦i≦nについて、第iの背景マスク記憶手段3
06−iには、常に当該時刻のi−1フレーム前の背景
マスクが格納される。背景更新手段307は、第1の背
景マスク記憶手段306−1から第nの背景マスク記憶
手段306−nに格納されているn枚の2値画像の論理
積をとり、各画素について論理積の値が1の場合には背
景領域に所属する画素、0の場合には移動物体領域に所
属する画素と判断し、背景画像記憶手段308に格納さ
れている背景画像を参照し、一例として第1の発明の背
景画像生成方法に対する実施例で述べた背景画像の更新
104と同様の方法により更新する。そして、画像出力
手段309が前記背景画像記憶手段に格納されている背
景画像を読み取り出力する。
First, a moving image composed of a background and a moving object is input by the image input means 300. Next, the input image updating means 301 performs the following two operations. First, the contents of the first input image storage means 302 are copied and stored in the second input image storage means 303. Second, the image input by the image input means 300 at the time is stored in the first input image storage means 302. Therefore,
The first input image storage means 302 always stores the input image at the time, and the second input image storage means 303 stores the input image at the time.
The input image before the frame is stored. The background mask generating means 304 calculates a difference between the images stored in the first input image storing means 302 and the second input image storing means 303. , A binary image is generated so as to be 1 if the value is less than the threshold value. That is, a pixel to which 0 is given indicates that there is a change between the time and one frame before that, and a pixel to which 1 is given indicates that there is no change. Next, the background mask updating means 305 performs the following n operations.
First, the (i-1) th background mask storage means 306- (i-
The operation of copying the contents of 1) to the i-th background mask storage means 306-i is described as i = n, n-1, n-2,.
・ In order of descending power for 2, Next, the binary image generated by the background mask generation means 304 is stored in the first background mask storage means 306-1. By this operation, for 1 ≦ i ≦ n, the ith background mask storage unit 3
06-i always stores the background mask i-1 frame before the current time. The background updating means 307 calculates the logical product of the n binary images stored in the first background mask storing means 306-1 to the n-th background mask storing means 306-n, and calculates the logical product of each pixel. If the value is 1, it is determined that the pixel belongs to the background area, and if the value is 0, it is determined that the pixel belongs to the moving object area, and the background image stored in the background image storage unit 308 is referred to. The background image generation method of the invention is updated by the same method as the background image update 104 described in the embodiment. Then, the image output unit 309 reads and outputs the background image stored in the background image storage unit.

【0020】第4の発明の背景画像生成装置の一実施例
について、図4を用いて説明する。図4において第1の
累積マスク記憶手段406−1から第nの累積マスク記
憶手段406−nまでに格納されているn枚の画像は2
値画像である。
An embodiment of the background image generating apparatus according to the fourth invention will be described with reference to FIG. In FIG. 4, n images stored in the first cumulative mask storage unit 406-1 to the n-th cumulative mask storage unit 406-n are 2
It is a value image.

【0021】まず、画像入力手段400により、背景と
移動物体からなる動画像を入力する。次に、入力画像更
新手段401が以下の2通りの動作を行う。第1に、第
1の入力画像記憶手段402の内容を第2の入力画像記
憶手段403にコピーして格納する。第2に、前記画像
入力手段400により当該時刻において入力された画像
を第1の入力画像記憶手段402に格納する。従って、
常に第1の入力画像記憶手段402には当該時刻の入力
画像、第2の入力画像記憶手段403には当該時刻の1
フレーム前の入力画像が格納される。背景マスク生成手
段404は前記第1の入力画像記憶手段402および第
2の入力画像記憶手段403に格納されている画像間の
差分を求め、各画素について差分の値がしきい値以上な
らば0、しきい値未満ならば1となるように2値画像を
生成する。即ち、0が与えられた画素は当該時刻とその
1フレーム前の間に変動があったことを示し、1が与え
られた画素は変動が生じなかったことを示す。次に、累
積マスク更新手段405が以下のn通りの動作を行う。
まず、第i−1の累積マスク記憶手段406−(i−
1)の内容を読み取り前記背景マスク生成手段404で
生成された2値画像との論理積として得られた2値画像
を第iの累積マスク記憶手段406−iに格納するとい
う操作をi=n,n−1,n−2,・・・,2について
降べきの順に行う。次に、前記背景マスク生成手段40
4で生成された2値画像を第1の累積マスク記憶手段4
06−1に格納する。この操作により、2≦i≦nにつ
いて、第iの累積マスク記憶手段406−iには、常に
当該時刻から当該時刻のi−1フレーム前の背景マスク
の論理積である累積マスクが格納される。背景更新手段
407は、第nの累積マスク記憶手段406−nに格納
されている2値画像を読み取り、各画素について画素値
が1の場合には背景領域に所属する画素、0の場合には
移動物体領域に所属する画素と判断し、背景画像記憶手
段408に格納されている背景画像を参照し、一例とし
て第1の発明の背景画像生成方法に対する実施例で述べ
た背景画像の更新104と同様の方法により更新する。
そして、画像出力手段409が前記背景画像記憶手段に
格納されている背景画像を読み取り出力する。
First, a moving image including a background and a moving object is input by the image input means 400. Next, the input image updating means 401 performs the following two operations. First, the contents of the first input image storage means 402 are copied and stored in the second input image storage means 403. Second, the image input by the image input unit 400 at the time is stored in the first input image storage unit 402. Therefore,
The first input image storage means 402 always stores the input image at the time, and the second input image storage means 403 stores the input image at the time.
The input image before the frame is stored. The background mask generation unit 404 obtains a difference between the images stored in the first input image storage unit 402 and the second input image storage unit 403. If the difference value is equal to or larger than a threshold value for each pixel, 0 is set. , A binary image is generated so as to be 1 if the value is less than the threshold value. That is, a pixel to which 0 is given indicates that there is a change between the time and one frame before that, and a pixel to which 1 is given indicates that there is no change. Next, the cumulative mask updating means 405 performs the following n operations.
First, the (i-1) th cumulative mask storage means 406- (i-
The operation of reading the contents of 1) and storing the binary image obtained as a logical product with the binary image generated by the background mask generation unit 404 in the i-th cumulative mask storage unit 406-i is i = n. , N-1, n-2,..., 2 in descending power order. Next, the background mask generating means 40
Storing the binary image generated in step 4 in the first cumulative mask storage means 4
06-1. By this operation, 2 ≦ i ≦ n
And the i-th cumulative mask storage means 406-i always has
Background mask at i-1 frame before the time from the time
Is stored . The background update unit 407 reads the binary image stored in the n-th cumulative mask storage unit 406-n, and when the pixel value of each pixel is 1, the pixel belongs to the background area. determines that the pixel belongs to the moving object area, with reference to the background image stored in the background image storage unit 408, an update 104 of the background image as described in example to the background image generation method of the first aspect of the invention by way of example Update in the same way.
Then, the image output unit 409 reads and outputs the background image stored in the background image storage unit.

【0022】[0022]

【発明の効果】本発明を適用すると、各画素値の変動情
報を過去nフレーム間にわたり蓄積することにより、従
来よりもはるかに背景領域の誤判定を減らすことが可能
である。従って、背景画像を更新するときに、誤判定に
より移動物体が足し込まれることがなく、移動物体の進
入に対する背景画像の安定性が飛躍的に高くなる。ま
た、更新を毎フレーム行うことができるので、背景の変
動に対して素早く追従することが可能である。
According to the present invention, by accumulating the fluctuation information of each pixel value over the past n frames, it is possible to reduce the number of erroneous determinations of the background region much more than in the past. Therefore, when updating the background image, the moving object is not added due to the erroneous determination, and the stability of the background image against the approach of the moving object is dramatically improved. In addition, since the update can be performed every frame, it is possible to quickly follow the fluctuation of the background.

【図面の簡単な説明】[Brief description of the drawings]

【図1】第1の発明の背景画像生成方法の一実施例を示
す流れ図
FIG. 1 is a flowchart showing one embodiment of a background image generation method according to the first invention;

【図2】第2の発明の背景画像生成方法の一実施例を示
す流れ図
FIG. 2 is a flowchart showing an embodiment of a background image generating method according to the second invention;

【図3】第3の発明の背景画像生成装置の一実施例を示
すブロック図
FIG. 3 is a block diagram showing an embodiment of a background image generation device according to the third invention;

【図4】第4の発明の背景画像生成装置の一実施例を示
すブロック図
FIG. 4 is a block diagram showing an embodiment of a background image generation device according to the fourth invention.

【図5】従来技術の問題点を示す説明図である。FIG. 5 is an explanatory diagram showing a problem of the related art.

【符号の説明】[Explanation of symbols]

101 背景マスクの生成 102 論理積 103 背景領域の識別 104 背景画像の更新 105−i(i=1,2) 時刻t+i−2の入力画像 106−i(1≦i≦n) 時刻t−i+1の背景マス
ク 107−i(i=1,2) 時刻t+i−2の背景画像 201 累積マスクの生成 202 累積マスクの更新 203 背景領域の識別 204 背景画像の更新 205−i(i=1,2) 時刻t+i−2の入力画像 206−i(1≦i≦n) 時刻t−i+1の背景マス
ク 207−i(i=1,2) 時刻t+i−2の背景画像 300 画像入力手段 301 入力画像更新手段 302 第1の入力画像記憶手段 303 第2の入力画像記憶手段 304 背景マスク生成手段 305 背景マスク更新手段 306−i(1≦i≦n) 第iの背景マスク記憶手段 307 背景更新手段 308 背景画像記憶手段 309 画像出力手段 400 画像入力手段 401 入力画像更新手段 402 第1の入力画像記憶手段 403 第2の入力画像記憶手段 404 背景マスク生成手段 405 累積マスク更新手段 406−i(1≦i≦n) 第iの累積マスク記憶手段 407 背景更新手段 408 背景画像記憶手段 409 画像出力手段
101 Background mask generation 102 Logical product 103 Identification of background area 104 Update of background image 105-i (i = 1, 2) Input image at time t + i-2 106-i (1 ≦ i ≦ n) Time t-i + 1 Background mask 107-i (i = 1, 2) Background image at time t + i-2 201 Cumulative mask generation 202 Cumulative mask update 203 Background region identification 204 Background image update 205-i (i = 1, 2) Time t + i-2 input image 206-i (1 ≦ i ≦ n) Background mask at time t−i + 1 207-i (i = 1, 2) Background image at time t + i−2 300 Image input means 301 Input image update means 302 First input image storage means 303 Second input image storage means 304 Background mask generation means 305 Background mask update means 306-i (1 ≦ i ≦ n) i-th background mask storage Stage 307 Background update means 308 Background image storage means 309 Image output means 400 Image input means 401 Input image update means 402 First input image storage means 403 Second input image storage means 404 Background mask generation means 405 Cumulative mask update means 406 −i (1 ≦ i ≦ n) i-th cumulative mask storage unit 407 background update unit 408 background image storage unit 409 image output unit

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】背景と移動物体とから構成されている動画
像を入力する画像入力手段と、当該時刻の入力画像を格
納する第1の入力画像記憶手段と、当該時刻の1フレー
ム前の入力画像を格納する第2の入力画像記憶手段と、
第1の入力画像記憶手段に格納されている画像を第2の
入力画像記憶手段にコピーし前記画像入力手段により入
力された入力画像を第1の入力画像記憶手段に格納する
入力画像更新手段と、前記第1および第2の入力画像記
憶手段に格納されている2画像間の差分を2値化し、変
動のあった画素の値を0、変動のなかった画素の値を1
とする背景マスクを生成する背景マスク生成手段と、2
以上の値をとるフレーム数nを予め用意し、1≦i≦n
に対して当該時刻のi−1フレーム前の背景マスクを格
納する第iの背景マスク記憶手段と、前記第iの背景マ
スク記憶手段に格納されている背景マスクを前記第i+
1の背景マスク記憶手段にコピーして格納する操作を1
≦i≦n−1について降べきの順に行い、背景マスク生
成手段で生成された背景マスクを第1の背景マスク記憶
手段に格納する背景マスク更新手段と、前記第1〜nの
背景マスク記憶手段に格納されているn枚の背景マスク
の論理積を算出し値が1となった画素からなる領域を背
景領域、0となった画素からなる領域を移動物体領域と
判断し、後記の背景画像記憶手段に格納されている背景
画像を、背景領域に対応する画素については前記第1の
入力画像との差分の値に応じて更新し、その他の画素に
ついては不変とすることによって新たに背景画像を生成
する背景更新手段と、前記背景更新手段で生成された背
景画像を格納する背景画像記憶手段と、前記背景画像記
憶手段に格納されている背景画像を出力する画像出力手
段とを備えていることを特徴とする背景画像生成装置。
An image input means for inputting a moving image composed of a background and a moving object; a first input image storage means for storing an input image at the time; and an input one frame before the time. Second input image storage means for storing an image,
Input image updating means for copying an image stored in the first input image storage means to the second input image storage means and storing the input image input by the image input means in the first input image storage means; The difference between the two images stored in the first and second input image storage means is binarized, and the value of the pixel having changed is set to 0, and the value of the pixel not changed is set to 1
Background mask generating means for generating a background mask
The number n of frames having the above values is prepared in advance, and 1 ≦ i ≦ n
The i-th background mask storage means for storing the background mask of the (i-1) -th frame before the time, and the background mask stored in the i-th background mask storage means for the i-th background mask.
The operation of copying and storing in the background mask storage means 1 is
.Ltoreq.i.ltoreq.n-1 in descending power order, a background mask updating means for storing the background mask generated by the background mask generating means in the first background mask storing means, and the first to n background mask storing means. Is calculated as a logical product of n background masks stored in the region, a region formed of pixels having a value of 1 is determined as a background region, and a region formed of pixels having a value of 0 is determined as a moving object region. The background image stored in the storage unit is updated by updating pixels corresponding to the background area in accordance with the value of the difference from the first input image and making the other pixels unchanged to newly add the background image. , A background image storage means for storing the background image generated by the background update means, and an image output means for outputting the background image stored in the background image storage means. Background image generation apparatus according to claim and.
【請求項2】背景と移動物体とから構成されている動画
像を入力する画像入力手段と、当該時刻の入力画像を格
納する第1の入力画像記憶手段と、当該時刻の1フレー
ム前の入力画像を格納する第2の入力画像記憶手段と、
前記第1の入力画像記憶手段に格納されている画像を前
記第2の入力画像記憶手段にコピーし前記画像入力手段
により入力された入力画像を第1の入力画像記憶手段に
格納する入力画像更新手段と、前記第1および第2の入
力画像記憶手段に格納されている2画像間の差分を2値
化し、変動のあった画素の値を0、変動のなかった画素
の値を1とする背景マスクを生成する背景マスク生成手
段と、2以上の値をとるフレーム数nを予め用意し、
≦k≦nに対して当該時刻のk−1フレーム前の背景マ
スクを第kの背景マスクとしたとき、2≦i≦nに対し
ては第1〜iの背景マスクの論理積である第iの累積マ
スクを格納し且つi=1に対しては第1の背景マスクを
格納する第iの累積マスク記憶手段と、前記第iの累積
マスク記憶手段に格納されている累積マスクと前記背景
マスク生成手段で得られる背景マスクとの論理積を求め
て前記第i+1の累積マスク記憶手段に格納する操作を
1≦i≦n−1について降べきの順に行い、背景マスク
生成手段で生成された背景マスクを第1の累積マスク記
憶手段に格納する累積マスク更新手段と、前記第nの累
積マスク記憶手段に格納されている累積マスクの値が1
である画素からなる領域を背景領域、0である画素から
なる領域を移動物体領域と判断し、後記の背景画像記憶
手段に格納されている背景画像を、背景領域に対応する
画素については前記第1の入力画像との差分の値に応じ
て更新し、その他の画素については不変とすることによ
って新たに背景画像を生成する背景更新手段と、前記背
景更新手段で生成された背景画像を格納する背景画像記
憶手段と、前記背景画像記憶手段に格納されている背景
画像を出力する画像出力手段とを備えていることを特徴
とする背景画像生成装置。
2. An image input means for inputting a moving image composed of a background and a moving object; a first input image storage means for storing an input image at the time; and an input one frame before the time. Second input image storage means for storing an image,
An input image update for copying an image stored in the first input image storage means to the second input image storage means and storing the input image input by the image input means in the first input image storage means Means, and the difference between the two images stored in the first and second input image storage means is binarized, and the value of a pixel that has changed is set to 0, and the value of a pixel that does not change is set to 1. a background mask generating means for generating a background mask, prepared in advance the number of frames n to take two or more values, 1
For ≤k≤n, the background map k-1 frames before the current time is
When the mask is the k-th background mask, for 2 ≦ i ≦ n
I-th cumulative mask that is the logical product of the first to i-th background masks.
And store the first background mask for i = 1
An i- th cumulative mask storing means for storing a logical product of a cumulative mask stored in the i-th cumulative mask storing means and a background mask obtained by the background mask generating means; The operation of storing in the storage means is performed in descending power order for 1 ≦ i ≦ n−1, and the cumulative mask updating means for storing the background mask generated by the background mask generating means in the first cumulative mask storage means; The value of the cumulative mask stored in the cumulative mask storage means of n is 1
Is determined as a background region, and a region including 0 pixels is determined as a moving object region.A background image stored in a background image storage unit described later is referred to as a moving object region. A background updating unit that generates a new background image by updating in accordance with a difference value from the first input image and making the other pixels unchanged, and stores the background image generated by the background updating unit; A background image generating apparatus comprising: a background image storage unit; and an image output unit that outputs a background image stored in the background image storage unit.
JP6695094A 1994-04-05 1994-04-05 Background image generation method and apparatus Expired - Fee Related JP3036349B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6695094A JP3036349B2 (en) 1994-04-05 1994-04-05 Background image generation method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6695094A JP3036349B2 (en) 1994-04-05 1994-04-05 Background image generation method and apparatus

Publications (2)

Publication Number Publication Date
JPH07284086A JPH07284086A (en) 1995-10-27
JP3036349B2 true JP3036349B2 (en) 2000-04-24

Family

ID=13330811

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6695094A Expired - Fee Related JP3036349B2 (en) 1994-04-05 1994-04-05 Background image generation method and apparatus

Country Status (1)

Country Link
JP (1) JP3036349B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000295623A (en) * 1999-04-06 2000-10-20 Sharp Corp Image transmission device
JP3874778B2 (en) 2003-03-28 2007-01-31 富士通株式会社 Imaging device
US7982774B2 (en) * 2004-09-13 2011-07-19 Sony Corporation Image processing apparatus and image processing method
JP7067023B2 (en) * 2017-11-10 2022-05-16 富士通株式会社 Information processing device, background update method and background update program
JP7221092B2 (en) * 2019-03-12 2023-02-13 セコム株式会社 Image processing device and image processing program

Also Published As

Publication number Publication date
JPH07284086A (en) 1995-10-27

Similar Documents

Publication Publication Date Title
US5642294A (en) Method and apparatus for video cut detection
US7405756B2 (en) Image pickup apparatus
US7440613B2 (en) Binary mask interpolation
CN101170708A (en) Display device and method for improving image flashing
JPH10145779A (en) Field detection device and method, image encoding device and method, and recording medium and its recording method
US20040247179A1 (en) Image processing apparatus, image processing method, and image processing program
US5497338A (en) Motion vector detecting circuit
CN111462149A (en) Example human body analysis method based on visual saliency
EP1042919B1 (en) Static image generation method and device
JP3036349B2 (en) Background image generation method and apparatus
US5623310A (en) Apparatus for encoding a video signal employing a hierarchical image segmentation technique
CN112385208A (en) Image recognition device and image recognition method
JP2007228156A (en) Movement detection processing apparatus and method thereof
JP2001119683A (en) Image sensor device
US7076098B2 (en) Adaptive image processing unit for extracting characteristic portion from image
CN111325075B (en) Video sequence target detection method
FI110743B (en) Method and system for performing motion estimation
JP2825821B2 (en) Video encoding processing method
JP2614574B2 (en) Motion vector detection circuit
JP3179475B2 (en) Signal processing device and signal processing method
JP2980810B2 (en) Motion vector search method and apparatus
JPH10290446A (en) Method and device for generating background image
JP2837969B2 (en) Image processing method
CN117641122A (en) Image monitoring method, device, electronic equipment and storage medium
CN113962964A (en) Specified object erasing method and device based on time sequence image data

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20000125

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080225

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090225

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100225

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100225

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110225

Year of fee payment: 11

LAPS Cancellation because of no payment of annual fees