JP2005078195A - Background image generator - Google Patents
Background image generator Download PDFInfo
- Publication number
- JP2005078195A JP2005078195A JP2003305106A JP2003305106A JP2005078195A JP 2005078195 A JP2005078195 A JP 2005078195A JP 2003305106 A JP2003305106 A JP 2003305106A JP 2003305106 A JP2003305106 A JP 2003305106A JP 2005078195 A JP2005078195 A JP 2005078195A
- Authority
- JP
- Japan
- Prior art keywords
- data
- pixel
- value
- background image
- 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.)
- Pending
Links
Images
Abstract
Description
本発明は、背景画像形成装置に関し、例えば、カメラが撮影した映像に基づいて、移動動体を取り除いた背景画像を生成する装置に適用することができる。 The present invention relates to a background image forming apparatus, and can be applied to, for example, an apparatus that generates a background image from which a moving moving object is removed based on video captured by a camera.
例えば交通流を測定する監視カメラ等が撮影した入力画像の各画素のデータ値を蓄積し、その各画素の蓄積データの中から代表値を選出して、移動物体が存在しない状態の画像(背景画像)を生成する技術として下記の特許文献1に示す技術がある。
For example, the data value of each pixel of the input image taken by a monitoring camera or the like that measures traffic flow is accumulated, and a representative value is selected from the accumulated data of each pixel, and an image in which no moving object exists (background As a technique for generating (image), there is a technique shown in
特許文献1には、入力画像を一定時間蓄積し、その蓄積したフレーム画像の各画素の輝度から、各画素の輝度値に相当する階級の出現頻度ヒストグラムを作成する。そして、その出現頻度ヒストグラムに基づいて、最大頻度となった輝度値を輝度の代表値として抽出し、その輝度の代表値を使用して画像を再構成することで、移動物体を排斥した背景画像を作成するという技術が記載されている。
しかしながら、上述した特許文献1の背景画像生成装置は、各画素の輝度の出現頻度ヒストグラムに基づいて、頻度(度数)が最大となった輝度値(階級)を代表値として単純に統計的に求めて背景画像を生成しているため、例えば背景画像の更新頻度を上げようとする場合には入力画像の蓄積期間が短くなり、統計的な代表値にばらつきが生じてしまい、背景画像にノイズの影響が生じてしまうおそれがある。
However, the above-described background image generation apparatus of
また、背景画像の更新頻度を上げるためには、各画素の輝度の出現頻度ヒストグラムからの代表値の抽出処理の高速化が求められる。 Further, in order to increase the update frequency of the background image, it is required to speed up the process of extracting the representative value from the appearance frequency histogram of the luminance of each pixel.
さらに、精度の高いカラーの背景画像を生成することが望まれている。 Furthermore, it is desired to generate a color background image with high accuracy.
そのため、本発明は、かかる問題のうち少なくとも1つを解決する背景画像生成装置を提供することを目的とする。 Therefore, an object of the present invention is to provide a background image generation apparatus that solves at least one of such problems.
かかる課題を解決するために、本発明の背景画像生成装置は、入力動画像の各画素の入力データから統計的に処理して得た各画素の代表データに基づいて背景画像を生成する背景画像生成装置において、(1)入力動画像フレームの各画素の入力データを画素毎に蓄積するデータ蓄積手段と、(2)入力動画像の処理フレーム数が規定値を超えた場合に、蓄積された各画素の入力データの中から代表データの抽出に利用しないデータを決定して、そのデータを除去するデータ除去手段と、(3)データ除去手段のデータ除去後に、データ蓄積手段が蓄積している各画素のデータの中から代表データを抽出する代表データ抽出手段と、(4)各画素の代表データに基づいて画像を生成する画像生成手段とを備えることを特徴とする。 In order to solve this problem, the background image generation apparatus of the present invention generates a background image based on representative data of each pixel obtained by statistically processing from input data of each pixel of the input moving image. In the generation apparatus, (1) data storage means for storing the input data of each pixel of the input moving image frame for each pixel, and (2) stored when the number of processing frames of the input moving image exceeds a specified value Data removal means for deciding data not used for extraction of representative data from input data of each pixel and removing the data; and (3) data accumulation means accumulated after data removal by the data removal means. It is characterized by comprising representative data extracting means for extracting representative data from the data of each pixel, and (4) image generating means for generating an image based on the representative data of each pixel.
本発明の背景画像生成装置によれば、各画素のデータの中から1個のデータを除去した蓄積データに基づいて代表値を抽出しているので、単純に統計的に求める場合よりも、生成する背景画像がノイズの影響を受けにくくすることができる。 According to the background image generating apparatus of the present invention, the representative value is extracted based on the accumulated data obtained by removing one data from the data of each pixel. The background image can be made less susceptible to noise.
また、本発明の背景画像生成装置によれば、代表値の抽出処理を高速化することができる。 Further, according to the background image generation apparatus of the present invention, the representative value extraction process can be speeded up.
また、本発明の背景画像生成装置によれば、精度の高いカラーの背景画像を生成することができる。 Further, according to the background image generation apparatus of the present invention, it is possible to generate a color background image with high accuracy.
以下では、本発明に係る背景画像生成装置を実施するための最良の形態として、次の実施例1〜実施例4を示す。 In the following, the following first to fourth embodiments are shown as the best mode for carrying out the background image generating apparatus according to the present invention.
以下では、本発明に係る背景画像生成装置の実施例1について図面を参照して説明する。 Hereinafter, a background image generating apparatus according to a first embodiment of the present invention will be described with reference to the drawings.
(1)実施例1の構成
図1は、実施例1に係る背景画像生成装置の内部構成を示したブロック図である。
(1) Configuration of First Embodiment FIG. 1 is a block diagram illustrating an internal configuration of a background image generation apparatus according to the first embodiment.
図1に示すように、背景画像生成装置1は、A/D変換部101、蓄積部102、排斥部103、カウンタ部14、代表値抽出部105を有する。
As illustrated in FIG. 1, the background
A/D変換部101は、入力した画像(アナログ信号)をフレーム毎の画像データに変換するものである。本実施例では、A/D変換部101が入力する画像は、例えばカメラ等が撮影した映像であり、その映像をグレースケール画像に変換するものとする。A/D変換部101は、変換したフレーム毎の画像を蓄積部102とカウンタ部104とに与える。
The A /
蓄積部102は、A/D変換部101からのフレーム毎の画像を受け取り、1フレームの画像の各画素毎の輝度に基づいて出現頻度ヒストグラムを作成して記憶するものである。蓄積部102が記憶する出現頻度ヒストグラムは、各画素毎に設けられており、階級を輝度値としたものである。従って、例えば、1フレームの画像サイズが320×240画素であり、量子化段階数が256段階である場合、蓄積部102は、320×240個の出現頻度ヒストグラムを有することとなり、又各ヒストグラムの階級数は256となる。
The
排斥部103は、後述するカウンタ部104のカウント値が総度数を超えた場合に、蓄積部102が記憶する各出現頻度ヒストグラムから排斥すべき階級を各画素毎に決定し、その決定した階級の度数を1つ排斥するものである。
The
カウンタ部104は、A/D変換部101が生成したグレースケール画像のフレーム数をカウントするものである。カウント部104は、出現頻度ヒストグラムの総度数が予め設定されており、カウント値が総度数を超えた場合には、排斥部103に排斥処理を行なわせるものである。なお、本実施例では、総度数を奇数値として設定した場合を説明する。
The
代表値抽出部105は、蓄積部102から各画素の出現頻度ヒストグラムを取り出し、総度数の中央度数(中央データという)が属する階級に対応する輝度値(これを中央値という)を代表値として抽出し、その代表値を図示しない背景画像生成手段に与えて背景画像を生成させるものである。上述したように、本実施例では、総度数を奇数値として設定するので、その中央値は常に一意に決定することができる。
The representative
(2)実施例1の動作
次に、実施例1に係る背景画像生成装置1の動作について図2を参照して説明する。
(2) Operation of
まず、カウンタ部104及び蓄積部102の初期化が行われ、カウンタ部104のカウンタ値が0にリセットされると共に、蓄積部102の各画素の出現頻度ヒストグラムがリセットされる(S101)。
First, the
カウンタ部104及び蓄積部102の初期化が終了すると、例えばカメラ等が撮影した映像(アナログ信号)が、A/D変換部101に入力し、デジタル変換されて、フレーム毎の画像が蓄積部102及びカウンタ部104に与えられる(S102)。
When the initialization of the
蓄積部102において、A/D変換部101からのフレームの画像の全画素について、各画素毎の輝度の出現頻度ヒストグラムが作成され記憶される(S102)。
In the
この各画素の輝度の出現頻度ヒストグラムの作成は、A/D変換部101から1フレームの画像が入力すると、各画素の輝度が検出され、輝度値に相当する階級をもつ各画素の出現頻度ヒストグラムにおいて、上記検出された各画素の輝度値に相当する階級の度数が1つ増加されることで各画素毎の出現頻度ヒストグラムが作成される。
The appearance frequency histogram of the luminance of each pixel is created by detecting the luminance of each pixel when an image of one frame is input from the A /
また、カウンタ部104では、A/D変換部101から与えられる画像のフレーム数がカウントされる(S102)。
Further, the
カウンタ部104では、カウント値が総度数以下である場合にはS102に戻り、カウント値が総度数を超えた場合に次のステップに移り、排斥部103に排斥処理を行なわせる(S103)。
When the count value is less than or equal to the total frequency, the
カウント値が総度数を超えた場合、排斥部103は、蓄積部102が記憶している各画素の出現頻度ヒストグラムを参照し、カウンタ部104のカウンタ値に応じて、各出現頻度ヒストグラムの中から排斥する輝度値(すなわち階級)を決定し、その決定した輝度値に出現している度数を1つ減少する(S104)。
When the count value exceeds the total frequency, the
これにより、各出現頻度ヒストグラム上の総度数が設定された総度数と等しくすることができる。 Thereby, the total frequency on each appearance frequency histogram can be made equal to the set total frequency.
ここで、排斥部103による排斥処理は、カウンタ部104のカウンタ値に応じて排斥する輝度値を決定し、例えば、カウンタ値が奇数値である場合には、各画素の出現頻度ヒストグラムの最小の階級から順に階級の度数を調べていき、初めて度数が1以上となる階級を探し出し、その探し出した階級を排斥処理の対象となる階級として決定する。また、カウンタ値が偶数値の場合は、最大の階級から順に階級の度数を調べていき、上述した場合と同様にして初めて度数が1以上となる階級を探し出して排斥する階級を決定する。勿論、カウンタ値が、奇数値の場合に最大の階級から探し出し、偶数値の場合に最小の階級から探し出すようにしてもよい。
Here, the exclusion process by the
上述のように、排斥部103による排斥処理が行われると、各画素の出現頻度ヒストグラムの総度数は、予め設定された設定値にすることができる。
As described above, when the exclusion process by the
代表値抽出部105は、蓄積部102が蓄積する排斥処理後の各画素の出現頻度ヒストグラムを参照し、設定された総度数の中央度数が属する輝度値(中央値)を割り出し、その中央値を代表値として抽出する(S105)。
The representative
この中央値の検出は、例えば、出現頻度ヒストグラムの最大又は最小の階級から、それぞれの階級の度数を加算していき、設定された総度数の半分の値を初めて超えた時の値を中央度数とし、その中央度数の輝度値を中央値として検出する。本実施例では、総度数を奇数値としたので、中央値は必ず一意に決定することができる。 This median value is detected by, for example, adding the frequencies of each class from the maximum or minimum class of the appearance frequency histogram, and setting the median frequency to the value when the half of the set total frequency is exceeded for the first time. And the brightness value of the median power is detected as the median value. In this embodiment, since the total frequency is an odd value, the median value can always be determined uniquely.
また、代表値抽出部105は、各画素の代表値の検出を全ての画素に対して行なう。
The representative
代表値抽出部105は、抽出された全ての画素についての代表値を、後段の図示しない画像生成手段に与え、その代表値に基づき背景画像を生成させる。また、代表値抽出部105から各画素の代表値が出力されると、更にS102に戻り、A/D変換部101から入力フレーム画像を受け取り、上述した処理を繰り返すことができる。
The representative
(3)実施例1の効果
以上、本実施例によれば、代表値から外れたデータを優先的に排斥する排斥部103を備えることにより、従来技術のように出現頻度ヒストグラムに基づいて単純に統計的に求めた代表値を抽出する場合よりも、背景画像がノイズの影響を受けにくくすることができる。
(3) Effects of
また、本実施例によれば、排斥部103が排斥する階級の度数は、カウンタ値に応じて2方向から交互に決定するため、各出現頻度ヒストグラムの同じ輝度値が継続的に入力される場合は代表値から外れた値であっても全てをノイズとして排斥してしまうことがなく、撮影画像の変化に追従することができる。
Further, according to the present embodiment, the frequency of the class rejected by the rejecting
また、本実施例によれば、カウンタ値が総度数を超えた後であっても、蓄積部102が蓄積した全てのフレームを考慮した出現頻度ヒストグラムに基づいて背景画像を生成することできる。
Further, according to the present embodiment, even after the counter value exceeds the total frequency, the background image can be generated based on the appearance frequency histogram considering all the frames accumulated by the
次に、本発明の背景画像生成装置の実施例2について図面を参照して説明する。 Next, a background image generating apparatus according to a second embodiment of the present invention will be described with reference to the drawings.
(1)実施例2の構成
図3は、本実施例の背景画像生成装置の内部構成を示したものである。図3に示すように、本実施例の背景画像生成装置2は、A/D変換部101、バッファ部201、蓄積部102、排斥部103、カウンタ部104、中央値変換検出部202、パラメータ記憶部203、パラメータ抽出部204を備える。
(1) Configuration of
なお、図3におけるA/D変換部101、蓄積部102、排斥部103及びカウンタ部104は、実施例1で説明した図1に示す各構成要素に対応するものであるため対応する番号を付しここでの詳細な説明は省略する。
Note that the A /
バッファ部201は、A/D変換部101のデジタル変換により得られた各画素の輝度値を一時的に記憶するものである。
The
パラメータ抽出部204は、蓄積部102が蓄積している各画素の出現頻度ヒストグラムを参照して、中央データが属する階級に対応する輝度値(中央値B)、その中央値の度数S、及び、その中央値における中央データの位置Mを3つのパラメータとして抽出するものである。
The
ここで、パラメータ抽出部202が抽出するパラメータについて図4を参照して説明する。
Here, the parameters extracted by the
図4(A)は、階級とその階級の度数との関係を示す説明図であり、図4(B)は図4(A)に基づいて作成した出現頻度ヒストグラムである。なお、図4では、説明の便宜のために、階級を8とし総度数を19とした場合である。従って、この場合、10番目に相当するデータが中央データとなる。 FIG. 4A is an explanatory diagram showing a relationship between a class and the frequency of the class, and FIG. 4B is an appearance frequency histogram created based on FIG. In FIG. 4, for convenience of explanation, the class is 8 and the total frequency is 19. Therefore, in this case, the data corresponding to the tenth is the central data.
パラメータ抽出部204は、各画素の出現頻度ヒストグラムに基づいて、中央データ(本実施例では10番目の度数)が属する輝度値に相当する階級を求め、これを中央値B(本実施例では階級「4」に該当)として抽出する。次に、パラメータ抽出部204は、その中央値Bに属する全度数を、中央値の度数S(本実施例では「5」になる)として抽出すると共に、その中央値の度数Sにおける中央データの位置M(本実施例では「4」に該当)を求める(図4(C)参照)。
The
このようにして、パラメータ抽出部204は、中央値B、中央値の度数S、及び、中央データの位置Mを各画素毎に求める。
In this way, the
パラメータ記憶部203は、パラメータ抽出部204が抽出した3つのパラメータを各画素毎に記憶するものである。
The
中央値変化検出部202は、カウンタ値が設定された総度数を超えた場合に、全ての画素について、各画素の中央値が変化したか否かを検出するものである。中央値変化検出部202は、各画素について、バッファ部202に記憶されている当該画素の輝度値が属する階級(これを蓄積値Iという)と、排斥部103が排斥する度数が属する階級(これを排斥値Rという)とを、後述するパラメータ記憶部203が記憶する中央値と比較することにより得た結果に基づいて中央値が変化したか否かを検出するものである。
The median value
(2)実施例2の動作
次に、実施例2に係る背景画像生成装置2の動作について図面を参照して説明する。
(2) Operation of Second Embodiment Next, the operation of the background
まず、カウンタ部104及び蓄積部102の初期化が行われ、カウンタ部104のカウンタ値が0にリセットされると共に、蓄積部102の各画素の出現頻度ヒストグラムがリセットされる(S201)。
First, the
カウンタ部104及び蓄積部102の初期化が終了すると、例えばカメラ等により撮影された入力映像(アナログ信号)が、A/D変換部101によりデジタル変換されて、フレーム毎の画像がバッファ部201、蓄積部102及びカウンタ部104に与えられる(S202)。
When the initialization of the
バッファ部201は、A/D変換部101から入力したフレーム毎の各画素の輝度値を一時的に記憶する。
The
また、蓄積部102は、A/D変換部101から入力したフレーム毎の画像の各画素の輝度値に基づいて、各画素の各出現頻度ヒストグラムを作成して記憶する。
Further, the
また、カウンタ部104では、A/D変換部104からフレーム毎の画像が入力し、そのフレーム数をカウントする。
The
カウンタ部104において、そのカウント値が総度数未満である場合には、S202に戻り繰り返し動作が行われる(S203)。
In the
また、カウンタ部104において、カウント値が総度数と等しくなった場合には、S204に進み、パラメータ抽出部204は、全ての画素について、各画素の3つのパラメータ(中央値B、中央値の度数S、中央データの位置M)を抽出すると共に、それら抽出した3つのパラメータをパラメータ記憶部203に設定させる(S204)。
In the
具体的には、S205では、パラメータ抽出部204は、蓄積部102に蓄積されている各画素の各出現頻度ヒストグラムに基づいて中央データを求め、その中央データが属する輝度値に相当する階級を中央値Bとして求める。そして、パラメータ抽出部204が求めた中央値Bに出現している度数S及び中央データの位置Mを求める(S205)。
Specifically, in S205, the
パラメータ抽出部204が、各画素の3つのパラメータを抽出した後、パラメータ抽出部204は、その抽出した各画素の3つのパラメータを、パラメータ記憶部203の各画素毎の記憶領域に記憶させることでパラメータの設定をおこなう(S206)。
After the
パラメータ抽出部204は、この3つのパラメータの抽出及びパラメータの設定を全ての画素に対して行われているかを確認し、全ての画素について行われていない場合には、全ての画素について各パラメータを求めるようにS204に戻り、繰り返し行ない、全ての画素のパラメータ設定を行なう(S207)。
The
S203に戻り、カウンタ値が総度数を超えた場合には、排斥部103は、蓄積部102から各画素の出現頻度ヒストグラムを取り出し、カウンタ値に応じて排斥する階級を決定し、出願頻度ヒストグラムの総度数が設定値と等しくなるように、決定された階級の度数を1つ排斥する(S209)。なお、この排斥部103により排斥処理の対象が決定された階級を排斥値Rとする。
Returning to S203, if the counter value exceeds the total frequency, the
排斥部103による排斥処理がなされると、中央値変化検出部202は、各画素の上述したパラメータ(中央値B、中央値の度数S、中央データの位置M)の更新を行なう(S210)。
When the rejection process by the
具体的には、中央値変化検出部202は、今回入力した画像の全ての画素のうちある画素について、バッファ部201が一時的に記憶している当該画素の輝度値を取り出し、その画素の輝度値が蓄積部102の出現頻度ヒストグラムのうちのどの階級に属すかを判定する。この当該画素の輝度値が属する階級を蓄積値Iとする。
Specifically, the median value
次に、中央値変化検出部202は、パラメータ記憶部203に記憶されている3つのパラメータ(中央値B、中央値の度数S、中央データの位置M)を取り出す。このパラメータ記憶部203から取り出される各パラメータは、今回入力された画像の直前にパラメータ記憶部203に設定されている各パラメータである。
Next, the median value
次に、中央値変化検出部202は、排斥部103が排斥した排斥値R及びパラメータ記憶部203から取り出された中央値Bの関係と、蓄積値I及び中央値Bの関係との組み合せでなる所定の規則に従って、中央値の度数Sの値及び中央データの位置Mの値をパラメータ記憶部203に記憶させて更新する。
Next, the median value
ここで、中央値変化検出部202による各パラメータの更新に係る所定の規則は、図5に示すものである。
Here, the predetermined rule regarding the update of each parameter by the median value
図5に示すように、蓄積値Iが中央値B未満である場合、中央値B及び排斥値Rの関係に応じて、次のように中央値の度数S及び中央データの位置Mを、中央値変化検出部202は更新する。排斥値Rが中央値B未満である場合、中央値の度数S及び中央データの位置Mの更新させない。排斥値Rが中央値Bに等しい場合、中央値の度数Sを1つ減少させると共に、中央データの位置Mを1つ減少させる。排斥値Rが中央値Bを超える場合、中央値の度数Sを変更させず、中央データの位置Mを1つ減少させる。
As shown in FIG. 5, when the accumulated value I is less than the median value B, the median frequency S and the median data position M are set to the median according to the relationship between the median value B and the rejection value R as follows. The value
また、蓄積値Iが中央値Bに等しい場合、次のようにして中央値の度数S及び中央データの位置Mを中央値変化検出部202が更新する。排斥値Rが中央値B未満である場合、中央値の度数Sを1つ増加させると共に、中央データの位置Mを1つ増加させる。排斥値Rが中央値Bに等しい場合、中央値の度数S及び中央データの位置Mの更新させない。排斥値Rが中央値Bを超える場合、中央値の度数Sを1つ増加させ、中央データの位置Mを変更させない。
When the accumulated value I is equal to the median value B, the median value
また、蓄積値Iが中央値Bを超える場合、次のようにして中央値の度数S及び中央データの位置Mを中央値変化検出部202が更新する。排斥値Rが中央値B未満である場合、中央値の度数Sを変更させず、中央データの位置Mを1つ増加させる。排斥値Rが中央値Bに等しい場合、中央値の度数Sを1つ減少させ、中央データの位置Mを変更させない。排斥値Rが中央値Bを超える場合、中央値の度数S及び中央データの位置Mの更新させない。
When the accumulated value I exceeds the median value B, the median value
中央値変化検出部202は、上記の手順により、当該画素の各パラメータをパラメータ記憶部203の記憶領域に記憶させて更新を行なう。
The median value
中央値変化検出部202において、当該画素についての各パラメータの更新が行われると、中央値変化検出部202は、中央データの位置Mと中央値の度数Sとの関係が1≦M≦Sの条件を満たしているか否かを判断し、この条件を満たしている場合を中央値Bの変化がなかったとし、この条件を満たしていない場合を中央値が変化したとする(S211)。
When the median value
S211において、中央値変化検出部203が中央値Bの変化がないと判断した場合、S214に進み、中央値変化検出部203は、全ての画素について中央値Bの変化があるか否かの検出を行なう(S214)。
When the median value
中央値変化検出部203は、各画素の中央値に変化がないとした場合、その画素の中央値は、パラメータ記憶部203に記憶されているパラメータ(すなわち前フレームの中央値)をその画素の中央値として出力させる(S215)。
When the median value
勿論、すべての画素の中央値に変化がない場合には、そのまま前フレームについての全ての画素の中央値が出力され、全ての画素のうち1画素でも中央値が変化していると判断した場合には、S212に移行し、その画素についての中央値をパラメータ抽出部204に求めさせて新たな中央値を抽出させる。
Of course, when there is no change in the median value of all the pixels, the median value of all the pixels in the previous frame is output as it is, and it is determined that the median value of even one pixel among all the pixels has changed. In step S212, the
S211に戻り、中央値変化検出部203がある画素の中央値Bの変化を検出した場合、パラメータ抽出部204は、蓄積部102の当該画素の出現頻度ヒストグラムに基づいて中央値B、中央値の度数S及び中央データの位置Mを抽出する(S212)。
Returning to S211, when the median value
パラメータ抽出部204が3つのパラメータを抽出すると、パラメータ抽出部204は、その抽出した3つのパラメータをパラメータ記憶部203の当該画素の記憶領域に設定させる(S213)。
When the
中央値変化検出部202は、当該画素のパラメータの設定がなされると、S214に進み、全ての画素について終了しているか否かを確認し、全ての画素について終了していない場合にはS208に戻り全ての画素について終了するまで繰り返し動作が行われる(S214)。
The median value
全ての画素についての中央値が抽出されると、パラメータ記憶部203に記憶されている各画素の中央値Bが出力し、図示しない画像生成手段に与えられて画像が生成される(S215)。
When the median values for all the pixels are extracted, the median value B of each pixel stored in the
以上のようにして、背景画像生成装置2は、各画素の中央値の変化しているか否かを検出し、中央値の変化を検出した画素については、新たに中央値を抽出してその中央値を代表値として出力し、中央値の変化を検出しなった画素については前フレームで出力した当該画素の中央値を代表値として出力することで、代表値検出処理の高速化を図ることができる。
As described above, the background
(3)実施例2の効果
以上、本実施例によれば、実施例1で説明した同一の効果を奏する。
(3) Effect of
また、本実施例によれば、中央値変化検出部202が、バッファ部201の各画素の蓄積値Iと排斥部103の排斥値Rとをそれぞれ、パラメータ記憶部203に記憶されている中央値Bと比較することに基づいて、中央値Bが変化したか否かを容易に検出することができるので、代表値の抽出をより高速に処理することができる。
Further, according to the present embodiment, the median value
(1)実施例3の構成
次に、本発明の背景画像生成装置の実施例3について図面を参照して説明する。本実施例では、入力したカラー映像の赤信号、緑信号、青信号の3種類の濃度値を用いたRGB表色系のデータを用いた場合の背景画像生成装置について説明する。
(1) Configuration of
図7は、本実施例の背景画像生成装置の内部構成を示したブロック図である。図7に示すように、本実施例3の背景画像生成装置3は、カラー用A/D変換部301、カラー用蓄積部302、カラー用排斥部303、カウンタ部304、カラー用代表値抽出部305、重心算出部306、排斥データ記憶部307を備える。
FIG. 7 is a block diagram showing the internal configuration of the background image generation apparatus of this embodiment. As illustrated in FIG. 7, the background
カラー用A/D変換部301は、入力したカラー映像をフレーム毎のカラー画像にデジタル変換するものである。カラー用A/D変換部301は、各画素の赤緑青の3種類の濃度値をカラー用蓄積部302に与えるものである。なお、以下ではこの赤緑青の3種類の値をまとめてカラーデータという。カラー用A/D変換部301は、既存するカラー映像用のA/D変換器を適用することができる。
The color A /
カラー用蓄積部302は、各画素のカラーデータを蓄積するデータ表を画素毎に有しており、カラー用A/D変換部301からデジタル化された画像を受け取り、受け取った1フレームの画像について、各画素に対応するデータ表に各画素のカラーデータを記憶するものである。
The
カラー用排斥部303は、後述するカウンタ部304のカウンタ値が総度数を超えた場合に、カラー用蓄積部302で蓄積されているデータ表に基づいて排斥すべきカラーデータを決定し、その決定したカラーデータを対応するデータ表から取り除くものである。
The
カウンタ部304は、カラー用A/D変換部301からのカラー画像のフレーム数をカウントするものである。カウンタ部304は、予め総度数が設定されており、カウンタ値が総度数を超えた場合に、カラー用解析部303に排斥処理を行なわせるものである。
The
カラー用代表値抽出部305は、カラー用蓄積部302が蓄積している各画素のデータ表から、背景画像を生成するためのカーラーデータを代表値として抽出するものである。
The color representative
重心算出部306は、カラー用蓄積部302が蓄積する各画素のデータ表内のカラーデータを取り出し、そのカラーデータの3つの値を3次元ベクトルとみなして、全カラーデータの3次元座標中での距離に基づいて重心位置を算出するものである。
The center-of-
排斥データ記憶部307は、カラー用排斥部303が排斥した各画素のカラーデータを各画素毎で記憶するものである。なお排斥データ記憶部307が記憶する各画素のカラーデータは背景画像生成に係る前フレームのものである。
The rejection
(2)実施例3の動作
次に、本実施例の背景画像生成装置の動作について図8を参照して説明する。
(2) Operation of
まず、カウンタ部304及びカラー用蓄積部302の初期化が行われ、カウンタ部304のカウンタ値が0にリセットされると共に、蓄積部302の内容も初期化される(S301)。
First, the
カラー用A/D変換部301によりデジタル変換された画像について各画素のカラーデータは、カラー用蓄積部302に与えられ、カラー用蓄積部302の各画素のデータ表に追加されて記憶される(S302)。
The color data of each pixel of the image digitally converted by the color A /
また、カラー用A/D変換部301からの1フレームの画像のカラーデータがカウンタ部304に入力し、カウンタ部304のカウンタ値を1つ増加させる(S302)。
Further, the color data of one frame image from the color A /
カウンタ部304のカウンタ値が総度数以下である場合には、S302に戻り、S302の動作が繰り返される(S303)。
When the counter value of the
カウンタ部304のカウンタ値が総度数を超えた場合には、S304に進み、カラー用排斥部303が、カラー用蓄積部302のデータ表の中から排斥するカラーデータを決定し、そのカラーデータを削除し、予め設定したデータ総数と全ての総データ数とを等しくなるようにする(S304)。
When the counter value of the
ここで、カラー用排斥部303による排斥するカラーデータの決定方法について説明する。
Here, a method for determining color data to be rejected by the
カラー用排斥部303は、重心算出部306にカラー用蓄積部302の各画素の各データ表の全カラーデータに基づいて形成される3次元空間の重心位置(この重心をGとする)を算出させる。このカラーデータは、上述したように、色を分類するための3つの値でなり、これら3つの値で示される3次元ベクトルとする。重心算出部306は、これら全てのカラーデータの3次元座標中での距離に基づいてこれらの重心位置座標を算出する。
The
カラー用排斥部303は、排斥データ記憶部307に記憶されているカラーデータから前回排斥したカラーデータを排斥値Pとして取り出し、重心算出部306が算出した重心Gを通りベクトルGPを法線とする平面により、各画素のカラーデータにより形成される3次元空間を2つの領域に分割する。
The
カラー用排斥部303は、カラー用蓄積部302のデータ表内のカラーデータの中から、前回排斥値Pとは異なる領域に属し、かつ、重心位置座標Gから最も離れたカラーデータを排斥するカラーデータとして決定する。
The
但し、前回排斥値Pが存在しない場合は、単にデータ内で重心位置座標Gから最も離れた位置のカラーデータを選択すればよい。 However, when there is no previous exclusion value P, color data at a position farthest from the center-of-gravity position coordinates G in the data may be simply selected.
なお、前回排斥値Pと異なる領域に属すかどうかは、調べる座標をTとすればベクトルGPとベクトルGTの内積を使えば簡単に計算することができる。つまり、内積が0以下の場合は、座標Tは前回排斥値Pと異なる領域に存在する。 Whether or not it belongs to a region different from the previous rejection value P can be easily calculated by using the inner product of the vector GP and the vector GT if the coordinate to be examined is T. That is, when the inner product is 0 or less, the coordinate T exists in a region different from the previous rejection value P.
カラー用排斥部303によるカラーデータの排斥処理後、カラー用排斥部3030は、排斥したカラーデータを画素毎に排斥データ記憶部307に記憶させる(S304)。
After the color data rejecting process by the
カラー用排斥部303が排斥すべきカラーデータを排斥し、その排斥したカラーデータを記憶させた後、カラー用代表値抽出部305は、カラー用蓄積部302内の全てのデータ表から重心位置座標Gに最も近い位置のカラーデータを代表値として抽出する(S305)。
After the color data to be rejected by the
カラー用代表値抽出部305が抽出した代表値は、図示しない後段の画像生成手段に与えられ、背景画像を生成させる(S306)。そして、カラー用代表値抽出部305が代表値を抽出した後、S302に戻り繰り返し動作がなされる。
The representative value extracted by the color representative
(3)実施例3の効果
以上、本実施例によれば、実施例1で説明した同様な効果を奏すると共に、カラーの背景画像を作成することができる。
(3) Effects of
また、本実施例によれば、カラー用排斥部303が、3種類の色信号(赤緑青)を個別に排斥処理をするのではなく、各画素ごとのカラーデータを1つのデータとして排斥することにより、背景画像に表現される画像の色相が撮影時に近い色相で表現することができる。これは、3種類の色信号をそれぞれ個別に排斥しようとすると、それらを組み合せた値が異なってしまい撮影時の色相と異なることが考えられるが、本実施例ではこのような問題を回避することができる。
In addition, according to the present embodiment, the
また、本実施例3によれば、カラー用排斥部303が、排斥データ記憶部307の前回排斥した排斥値Pから離れた領域の中から決定するため、同じ値が継続的に入力される場合は外れた値であっても全てをノイズとして排斥してしまうことがなく、撮影画像の変化に追従することができる。
Further, according to the third embodiment, when the
次に、上述した実施例1〜実施例3以外の他の実施例について説明する。 Next, examples other than the above-described first to third embodiments will be described.
(1)上述した実施例1では、代表値として中央データが属する階級(中央値)を使用したが、これに限定されることはなく、代表値として、例えば、度数平均値や最頻値を使用しても良い。 (1) In the above-described first embodiment, the class (median value) to which the central data belongs is used as the representative value. However, the present invention is not limited to this. For example, the frequency average value or the mode value is used as the representative value. May be used.
(2)上述した実施例3では、色情報を「赤緑青」の3つの値として扱った、つまりRGB表色系を使用したが、これに限定されるものではない。例えば、XYZ表色系を用いても良いし、均等色空間を利用しても良い。均等色空間には、例えば、L*a*b*色空間や、L*u*v*色空間などを適用することができる。 (2) In the third embodiment described above, the color information is handled as three values of “red, green, and blue”, that is, the RGB color system is used. However, the present invention is not limited to this. For example, an XYZ color system may be used, or a uniform color space may be used. For example, an L * a * b * color space or an L * u * v * color space can be applied to the uniform color space.
(3)上述した実施例3では、カラーデータを3次元ベクトルとして、3次元座標中での距離を使用したが、これに限られることはなく、例えば、カラーデータの分散を考慮してマハラノビス距離を使うようにしてもよい。 (3) In the above-described third embodiment, the color data is a three-dimensional vector and the distance in the three-dimensional coordinates is used. However, the distance is not limited to this, and for example, the Mahalanobis distance in consideration of the dispersion of the color data May be used.
(4)また、実施例1及び実施例2では、排斥部103は、カウンタ値が総度数を超えた場合に、蓄積部102の各画素の出現頻度ヒストグラムの中から1個の度数を減少させる排斥処理を行なうこととした。
(4) Moreover, in Example 1 and Example 2, the
しかし、これに限られることはなく、例えば、設定した総度数の他に、総度数よりも大きい値の排斥実行値を設定し、カウンタ値がその排斥実行値に達した場合に、排斥部103が、排斥実行値と総度数との差分に相当する度数を一度に排斥するようにしてもよい。この場合、排斥するデータは、例えば、排斥に係る度数の半分の度数を最小の階級側から順に排斥し、残りの度数を最大の階級側から順に排斥するようにしてもよい。
However, the present invention is not limited to this. For example, in addition to the set total frequency, a rejection execution value greater than the total frequency is set, and when the counter value reaches the rejection execution value, the
(5)上述した実施例2では、中央値変化検出部202が、蓄積値Iと排斥値Rとを、それぞれ中央値Bと比較した結果を組み合せることで中央値の変化を検出することとして説明した。
(5) In the above-described second embodiment, the median value
しかし、これに限ることなく、例えば、中央値変化検出部202が、まず、蓄積値Iと中央値Bとが等しいか否かを判断し、これらが等しい場合には、その画素の中央値の更新を行なうことなく前フレームの当該画素の中央値を出力させ、蓄積値Iが中央値Bと異なる場合にのみ、実施例2で説明した中央値変化検出処理を行なわせるようにしてもよい。
However, without being limited thereto, for example, the median value
(6)更に、上述した実施例3では、ベクトルGPとベクトルGTの内積が0以下となる座標Tを選択することで、角TGPが90度以上となる領域の中からTGの長さが最大になるデータを排除するカラーデータと決定する構成となっているが、排除するデータを探す領域はこれに限定されるものではなく、前回排斥値Pから十分に離れた領域であればよい。例えば、角TGPが30度以上となる領域を使ってもよいし、TG間の距離がGP間の距離よりも長くなる領域を使ってもよい。 (6) Furthermore, in the above-described third embodiment, by selecting the coordinate T where the inner product of the vector GP and the vector GT is 0 or less, the length of the TG is maximized from the region where the angle TGP is 90 degrees or more. However, the area for searching for the data to be excluded is not limited to this, and may be an area sufficiently separated from the previous rejection value P. For example, a region where the angle TGP is 30 degrees or more may be used, or a region where the distance between TGs is longer than the distance between GPs may be used.
1、2、3…背景画像生成装置、102…蓄積部、103…排斥部、
104、304…カウンタ部、105…代表値抽出部、
302…カラー用蓄積部、303…カラー用排斥部、
305…カラー用代表値抽出部。
1, 2, 3 ... background image generating device, 102 ... accumulating unit, 103 ... rejecting unit,
104, 304 ... counter unit, 105 ... representative value extracting unit,
302 ... Color storage unit, 303 ... Color rejection unit,
305... Color representative value extraction unit.
Claims (9)
入力動画像フレームの各画素の入力データを画素毎に蓄積するデータ蓄積手段と、
上記入力動画像の処理フレーム数が規定値を超えた場合に、上記蓄積された各画素の入力データの中から代表データの抽出に利用しないデータを決定して、そのデータを除去するデータ除去手段と、
上記データ除去手段のデータ除去後に、上記データ蓄積手段が蓄積している各画素のデータの中から代表データを抽出する代表データ抽出手段と、
上記各画素の代表データに基づいて画像を生成する画像生成手段と
を備えることを特徴とする背景画像生成装置。 In a background image generation device that generates a background image based on representative data of each pixel obtained by statistical processing from input data of each pixel of an input moving image,
Data storage means for storing the input data of each pixel of the input moving image frame for each pixel;
Data removal means for determining data not used for extraction of representative data from the accumulated input data of each pixel and removing the data when the number of processing frames of the input moving image exceeds a specified value When,
Representative data extracting means for extracting representative data from the data of each pixel accumulated by the data accumulating means after data removal by the data removing means;
A background image generation apparatus comprising: image generation means for generating an image based on representative data of each pixel.
上記出現頻度ヒストグラムの総度数の中央度数が属する輝度値を中央値とし、前フレームの各画素の中央値と、当該フレームの各画素の中央値との変化を検出する中央値変化検出手段と
を備え、
上記中央値変化検出手段が中央値の変化を検出した場合、上記データ抽出手段は、上記データ蓄積手段の各画素のデータから代表データを抽出して画像を生成させ、
上記中央値変化検出手段が中央値の変化を検出しない場合、上記代表データ記憶手段に記憶されている前フレームの各画素の代表データに基づいて画像を生成させる
ことを特徴とする請求項2又は3に記載の背景画像生成装置。 Representative data storage means for storing the representative data of the previous frame extracted by the representative data extraction means for each pixel;
A median value change detecting means for detecting a change between the median value of each pixel of the previous frame and the median value of each pixel of the frame, with the luminance value to which the median frequency of the total frequency of the appearance frequency histogram belongs. Prepared,
When the median value change detection means detects a change in the median value, the data extraction means extracts representative data from the data of each pixel of the data storage means to generate an image,
3. The method according to claim 2, wherein when the median value change detecting means does not detect a median value change, an image is generated based on the representative data of each pixel of the previous frame stored in the representative data storage means. 4. The background image generation apparatus according to 3.
上記中央値検出手段が、上記データ蓄積手段が蓄積している当該フレームの各画素の輝度値と、上記データ除去手段が除去した各画素のデータの輝度値とを、上記代表データ記憶手段に記憶されている前フレームの中央値と比較し、それら比較結果の組み合せから中央値の変化を検出することを特徴とする請求項4に記載の背景画像生成装置。 The representative data extracted by the data extraction means is the median value,
The median value detection means stores the luminance value of each pixel of the frame stored by the data storage means and the luminance value of the data of each pixel removed by the data removal means in the representative data storage means. 5. The background image generation apparatus according to claim 4, wherein the background image generation device is compared with the median value of the previous frame, and a change in the median value is detected from a combination of the comparison results.
9. The background image generation apparatus according to claim 7, wherein the data extraction unit uses the color data closest to the gravity center position as the representative data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003305106A JP2005078195A (en) | 2003-08-28 | 2003-08-28 | Background image generator |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003305106A JP2005078195A (en) | 2003-08-28 | 2003-08-28 | Background image generator |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2005078195A true JP2005078195A (en) | 2005-03-24 |
Family
ID=34408607
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2003305106A Pending JP2005078195A (en) | 2003-08-28 | 2003-08-28 | Background image generator |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2005078195A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011248513A (en) * | 2010-05-25 | 2011-12-08 | Nomura Research Institute Ltd | Busyness detection system and busyness detection program |
US8379989B2 (en) | 2008-04-01 | 2013-02-19 | Toyota Jidosha Kabushiki Kaisha | Image search apparatus and image processing apparatus |
US11049256B2 (en) | 2017-12-27 | 2021-06-29 | Canon Kabushiki Kaisha | Image processing apparatus, image processing method, and storage medium |
-
2003
- 2003-08-28 JP JP2003305106A patent/JP2005078195A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8379989B2 (en) | 2008-04-01 | 2013-02-19 | Toyota Jidosha Kabushiki Kaisha | Image search apparatus and image processing apparatus |
JP2011248513A (en) * | 2010-05-25 | 2011-12-08 | Nomura Research Institute Ltd | Busyness detection system and busyness detection program |
US11049256B2 (en) | 2017-12-27 | 2021-06-29 | Canon Kabushiki Kaisha | Image processing apparatus, image processing method, and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6445775B2 (en) | Image processing apparatus and image processing method | |
JP2009110240A (en) | Apparatus, method and program for classifying pixel in moving image as foreground or background | |
JP6904346B2 (en) | Image processing equipment, image processing systems, and image processing methods, and programs | |
JP4811653B2 (en) | Object detection device | |
JP6020471B2 (en) | Image processing method, image processing apparatus, and image processing program | |
JP2016505186A (en) | Image processor with edge preservation and noise suppression functions | |
EP3016383B1 (en) | Method, device, and system for pre-processing a video stream for subsequent motion detection processing | |
JP2004310475A (en) | Image processor, cellular phone for performing image processing, and image processing program | |
JPWO2017221644A1 (en) | Image processing apparatus, image processing system, image processing method, and program | |
JP2010121945A (en) | Three-dimensional shape forming system | |
JP2008259161A (en) | Target tracing device | |
JP2011053951A (en) | Image processing apparatus | |
JP5264457B2 (en) | Object detection device | |
JP5247338B2 (en) | Image processing apparatus and image processing method | |
JP2004171490A (en) | Device and method for detecting image | |
CN113936252A (en) | Battery car intelligent management system and method based on video monitoring | |
KR20080079443A (en) | Method and apparatus for extracting object from image | |
JP4496005B2 (en) | Image processing method and image processing apparatus | |
JP5142416B2 (en) | Object detection device | |
CN112784854A (en) | Method, device and equipment for segmenting and extracting clothing color based on mathematical statistics | |
JP2000348173A (en) | Lip extraction method | |
JP2005078195A (en) | Background image generator | |
JP2009163498A (en) | Image processor, image processing method, and image processing program | |
JPH09284702A (en) | Method and device for detecting scene change frame | |
CN113256484B (en) | Method and device for performing stylization processing on image |