JP2005078195A - Background image generator - Google Patents

Background image generator Download PDF

Info

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
Application number
JP2003305106A
Other languages
Japanese (ja)
Inventor
Akihiro Okumura
晃弘 奥村
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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry Co Ltd
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 Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP2003305106A priority Critical patent/JP2005078195A/en
Publication of JP2005078195A publication Critical patent/JP2005078195A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a background image generator for generating background images rendered less vulnerable to noises. <P>SOLUTION: The background image generator includes a data accumulation means for generating background images based on the representative data of each pixel of an inputted animation resulting from the statistical processing of the input data of each pixel and for accumulating the data of each pixel of the inputted animation's frame for each pixel; a data deleting means for determining and deleting data not used in the extraction of the representative data from the accumulated input data of each pixel if the number of the process frames of the inputted animation exceeds a specified value; a representative data extraction means for extracting representative data from the data of each pixel accumulated in the data accumulation means, after the data have been deleted by the data deleting means; and an image generation means for generating images based on the representative data of each pixel. <P>COPYRIGHT: (C)2005,JPO&NCIPI

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 Patent Document 1 below.

特許文献1には、入力画像を一定時間蓄積し、その蓄積したフレーム画像の各画素の輝度から、各画素の輝度値に相当する階級の出現頻度ヒストグラムを作成する。そして、その出現頻度ヒストグラムに基づいて、最大頻度となった輝度値を輝度の代表値として抽出し、その輝度の代表値を使用して画像を再構成することで、移動物体を排斥した背景画像を作成するという技術が記載されている。
特開2000−348184号公報
In Patent Document 1, an input image is accumulated for a certain period of time, and a class appearance frequency histogram corresponding to the luminance value of each pixel is created from the luminance of each pixel of the accumulated frame image. Then, based on the appearance frequency histogram, the luminance value having the highest frequency is extracted as a representative value of luminance, and the image is reconstructed using the representative value of luminance, thereby eliminating the background image that excludes the moving object. The technology of creating is described.
JP 2000-348184 A

しかしながら、上述した特許文献1の背景画像生成装置は、各画素の輝度の出現頻度ヒストグラムに基づいて、頻度(度数)が最大となった輝度値(階級)を代表値として単純に統計的に求めて背景画像を生成しているため、例えば背景画像の更新頻度を上げようとする場合には入力画像の蓄積期間が短くなり、統計的な代表値にばらつきが生じてしまい、背景画像にノイズの影響が生じてしまうおそれがある。   However, the above-described background image generation apparatus of Patent Document 1 simply and statistically obtains a luminance value (class) having the highest frequency (frequency) as a representative value based on the appearance frequency histogram of the luminance of each pixel. For example, if the background image update frequency is to be increased, the accumulation period of the input image is shortened, resulting in variations in the statistical representative value, and noise in the background image. There is a risk of impact.

また、背景画像の更新頻度を上げるためには、各画素の輝度の出現頻度ヒストグラムからの代表値の抽出処理の高速化が求められる。   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 image generation apparatus 1 includes an A / D conversion unit 101, a storage unit 102, a rejection unit 103, a counter unit 14, and a representative value extraction unit 105.

A/D変換部101は、入力した画像(アナログ信号)をフレーム毎の画像データに変換するものである。本実施例では、A/D変換部101が入力する画像は、例えばカメラ等が撮影した映像であり、その映像をグレースケール画像に変換するものとする。A/D変換部101は、変換したフレーム毎の画像を蓄積部102とカウンタ部104とに与える。   The A / D conversion unit 101 converts an input image (analog signal) into image data for each frame. In the present embodiment, the image input by the A / D conversion unit 101 is, for example, a video taken by a camera or the like, and the video is converted into a grayscale image. The A / D conversion unit 101 gives the converted image for each frame to the storage unit 102 and the counter unit 104.

蓄積部102は、A/D変換部101からのフレーム毎の画像を受け取り、1フレームの画像の各画素毎の輝度に基づいて出現頻度ヒストグラムを作成して記憶するものである。蓄積部102が記憶する出現頻度ヒストグラムは、各画素毎に設けられており、階級を輝度値としたものである。従って、例えば、1フレームの画像サイズが320×240画素であり、量子化段階数が256段階である場合、蓄積部102は、320×240個の出現頻度ヒストグラムを有することとなり、又各ヒストグラムの階級数は256となる。   The accumulation unit 102 receives the image for each frame from the A / D conversion unit 101 and creates and stores an appearance frequency histogram based on the luminance for each pixel of the image of one frame. The appearance frequency histogram stored in the storage unit 102 is provided for each pixel, and the class is a luminance value. Therefore, for example, when the image size of one frame is 320 × 240 pixels and the number of quantization steps is 256, the storage unit 102 has 320 × 240 appearance frequency histograms, and each histogram has The number of classes is 256.

排斥部103は、後述するカウンタ部104のカウント値が総度数を超えた場合に、蓄積部102が記憶する各出現頻度ヒストグラムから排斥すべき階級を各画素毎に決定し、その決定した階級の度数を1つ排斥するものである。   The exclusion unit 103 determines, for each pixel, a class to be excluded from each appearance frequency histogram stored in the storage unit 102 when the count value of the counter unit 104 described later exceeds the total frequency, and the determined class One frequency is rejected.

カウンタ部104は、A/D変換部101が生成したグレースケール画像のフレーム数をカウントするものである。カウント部104は、出現頻度ヒストグラムの総度数が予め設定されており、カウント値が総度数を超えた場合には、排斥部103に排斥処理を行なわせるものである。なお、本実施例では、総度数を奇数値として設定した場合を説明する。   The counter unit 104 counts the number of frames of the grayscale image generated by the A / D conversion unit 101. The count unit 104 is configured so that the total frequency of the appearance frequency histogram is set in advance, and when the count value exceeds the total frequency, the rejection unit 103 performs the rejection process. In this embodiment, a case where the total frequency is set as an odd number will be described.

代表値抽出部105は、蓄積部102から各画素の出現頻度ヒストグラムを取り出し、総度数の中央度数(中央データという)が属する階級に対応する輝度値(これを中央値という)を代表値として抽出し、その代表値を図示しない背景画像生成手段に与えて背景画像を生成させるものである。上述したように、本実施例では、総度数を奇数値として設定するので、その中央値は常に一意に決定することができる。   The representative value extraction unit 105 extracts the appearance frequency histogram of each pixel from the storage unit 102, and extracts the luminance value (this is called the median value) corresponding to the class to which the central frequency of the total frequency (called the median data) belongs as a representative value. Then, the representative value is given to background image generation means (not shown) to generate a background image. As described above, in the present embodiment, since the total frequency is set as an odd value, the median value can always be determined uniquely.

(2)実施例1の動作
次に、実施例1に係る背景画像生成装置1の動作について図2を参照して説明する。
(2) Operation of Embodiment 1 Next, the operation of the background image generation apparatus 1 according to Embodiment 1 will be described with reference to FIG.

まず、カウンタ部104及び蓄積部102の初期化が行われ、カウンタ部104のカウンタ値が0にリセットされると共に、蓄積部102の各画素の出現頻度ヒストグラムがリセットされる(S101)。   First, the counter unit 104 and the storage unit 102 are initialized, the counter value of the counter unit 104 is reset to 0, and the appearance frequency histogram of each pixel of the storage unit 102 is reset (S101).

カウンタ部104及び蓄積部102の初期化が終了すると、例えばカメラ等が撮影した映像(アナログ信号)が、A/D変換部101に入力し、デジタル変換されて、フレーム毎の画像が蓄積部102及びカウンタ部104に与えられる(S102)。   When the initialization of the counter unit 104 and the storage unit 102 is completed, for example, a video (analog signal) captured by a camera or the like is input to the A / D conversion unit 101 and digitally converted, and an image for each frame is stored in the storage unit 102. And provided to the counter unit 104 (S102).

蓄積部102において、A/D変換部101からのフレームの画像の全画素について、各画素毎の輝度の出現頻度ヒストグラムが作成され記憶される(S102)。   In the storage unit 102, a luminance frequency histogram for each pixel is created and stored for all the pixels of the frame image from the A / D conversion unit 101 (S102).

この各画素の輝度の出現頻度ヒストグラムの作成は、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 / D conversion unit 101, and the appearance frequency histogram of each pixel having a class corresponding to the luminance value. , The frequency of the class corresponding to the detected luminance value of each pixel is incremented by 1, thereby creating an appearance frequency histogram for each pixel.

また、カウンタ部104では、A/D変換部101から与えられる画像のフレーム数がカウントされる(S102)。   Further, the counter unit 104 counts the number of frames of the image given from the A / D conversion unit 101 (S102).

カウンタ部104では、カウント値が総度数以下である場合にはS102に戻り、カウント値が総度数を超えた場合に次のステップに移り、排斥部103に排斥処理を行なわせる(S103)。   When the count value is less than or equal to the total frequency, the counter unit 104 returns to S102, and when the count value exceeds the total frequency, the counter unit 104 proceeds to the next step and causes the rejection unit 103 to perform the rejection process (S103).

カウント値が総度数を超えた場合、排斥部103は、蓄積部102が記憶している各画素の出現頻度ヒストグラムを参照し、カウンタ部104のカウンタ値に応じて、各出現頻度ヒストグラムの中から排斥する輝度値(すなわち階級)を決定し、その決定した輝度値に出現している度数を1つ減少する(S104)。   When the count value exceeds the total frequency, the rejection unit 103 refers to the appearance frequency histogram of each pixel stored in the storage unit 102, and selects from the appearance frequency histograms according to the counter value of the counter unit 104. The luminance value (namely, class) to be excluded is determined, and the frequency appearing in the determined luminance value is decreased by one (S104).

これにより、各出現頻度ヒストグラム上の総度数が設定された総度数と等しくすることができる。   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 exclusion unit 103 determines the luminance value to be excluded according to the counter value of the counter unit 104. For example, when the counter value is an odd value, the minimum appearance frequency histogram of each pixel is determined. The frequency of the class is examined in order from the class, and the class having the frequency of 1 or more is found for the first time, and the found class is determined as the class to be excluded. If the counter value is an even number, the frequency of the class is examined in order from the largest class, and the class with the frequency of 1 or more is searched for and rejected only in the same manner as described above. Of course, the counter value may be searched from the maximum class when the counter value is an odd value, and may be searched from the minimum class when the counter value is an even value.

上述のように、排斥部103による排斥処理が行われると、各画素の出現頻度ヒストグラムの総度数は、予め設定された設定値にすることができる。   As described above, when the exclusion process by the exclusion unit 103 is performed, the total frequency of the appearance frequency histogram of each pixel can be set to a preset setting value.

代表値抽出部105は、蓄積部102が蓄積する排斥処理後の各画素の出現頻度ヒストグラムを参照し、設定された総度数の中央度数が属する輝度値(中央値)を割り出し、その中央値を代表値として抽出する(S105)。   The representative value extraction unit 105 refers to the appearance frequency histogram of each pixel after the exclusion process accumulated by the accumulation unit 102, calculates the luminance value (median value) to which the central frequency of the set total frequency belongs, and calculates the median value Extracted as a representative value (S105).

この中央値の検出は、例えば、出現頻度ヒストグラムの最大又は最小の階級から、それぞれの階級の度数を加算していき、設定された総度数の半分の値を初めて超えた時の値を中央度数とし、その中央度数の輝度値を中央値として検出する。本実施例では、総度数を奇数値としたので、中央値は必ず一意に決定することができる。   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 value extraction unit 105 detects the representative value of each pixel for all the pixels.

代表値抽出部105は、抽出された全ての画素についての代表値を、後段の図示しない画像生成手段に与え、その代表値に基づき背景画像を生成させる。また、代表値抽出部105から各画素の代表値が出力されると、更にS102に戻り、A/D変換部101から入力フレーム画像を受け取り、上述した処理を繰り返すことができる。   The representative value extraction unit 105 gives representative values for all the extracted pixels to an image generation unit (not shown) in the subsequent stage, and generates a background image based on the representative values. When the representative value of each pixel is output from the representative value extraction unit 105, the process returns to S102, an input frame image is received from the A / D conversion unit 101, and the above-described processing can be repeated.

(3)実施例1の効果
以上、本実施例によれば、代表値から外れたデータを優先的に排斥する排斥部103を備えることにより、従来技術のように出現頻度ヒストグラムに基づいて単純に統計的に求めた代表値を抽出する場合よりも、背景画像がノイズの影響を受けにくくすることができる。
(3) Effects of Embodiment 1 As described above, according to the present embodiment, by including the rejection unit 103 that preferentially rejects data deviating from the representative value, it is simply based on the appearance frequency histogram as in the prior art. The background image can be made less susceptible to noise than when a statistically determined representative value is extracted.

また、本実施例によれば、排斥部103が排斥する階級の度数は、カウンタ値に応じて2方向から交互に決定するため、各出現頻度ヒストグラムの同じ輝度値が継続的に入力される場合は代表値から外れた値であっても全てをノイズとして排斥してしまうことがなく、撮影画像の変化に追従することができる。   Further, according to the present embodiment, the frequency of the class rejected by the rejecting unit 103 is alternately determined from two directions according to the counter value, and therefore the same luminance value of each appearance frequency histogram is continuously input. Even if the value deviates from the representative value, it is not rejected as noise and can follow the change of the captured image.

また、本実施例によれば、カウンタ値が総度数を超えた後であっても、蓄積部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 accumulation unit 102.

次に、本発明の背景画像生成装置の実施例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 Embodiment 2 FIG. 3 shows the internal configuration of the background image generation apparatus of this embodiment. As illustrated in FIG. 3, the background image generation apparatus 2 according to the present exemplary embodiment includes an A / D conversion unit 101, a buffer unit 201, a storage unit 102, a rejection unit 103, a counter unit 104, a median value conversion detection unit 202, and parameter storage. Unit 203 and parameter extraction unit 204.

なお、図3におけるA/D変換部101、蓄積部102、排斥部103及びカウンタ部104は、実施例1で説明した図1に示す各構成要素に対応するものであるため対応する番号を付しここでの詳細な説明は省略する。   Note that the A / D conversion unit 101, the storage unit 102, the rejection unit 103, and the counter unit 104 in FIG. 3 correspond to the respective components shown in FIG. A detailed description thereof is omitted here.

バッファ部201は、A/D変換部101のデジタル変換により得られた各画素の輝度値を一時的に記憶するものである。   The buffer unit 201 temporarily stores the luminance value of each pixel obtained by digital conversion of the A / D conversion unit 101.

パラメータ抽出部204は、蓄積部102が蓄積している各画素の出現頻度ヒストグラムを参照して、中央データが属する階級に対応する輝度値(中央値B)、その中央値の度数S、及び、その中央値における中央データの位置Mを3つのパラメータとして抽出するものである。   The parameter extraction unit 204 refers to the appearance frequency histogram of each pixel accumulated in the accumulation unit 102, and the luminance value (median value B) corresponding to the class to which the central data belongs, the frequency S of the median value, and The position M of the central data at the median is extracted as three parameters.

ここで、パラメータ抽出部202が抽出するパラメータについて図4を参照して説明する。   Here, the parameters extracted by the parameter extraction unit 202 will be described with reference to FIG.

図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 parameter extraction unit 204 obtains a class corresponding to the luminance value to which the central data (the tenth frequency in this embodiment) belongs based on the appearance frequency histogram of each pixel, and obtains the class B (the class in the present example). “4”). Next, the parameter extraction unit 204 extracts all frequencies belonging to the median value B as the median frequency S (in this embodiment, “5”), and the central data of the median frequency S A position M (corresponding to “4” in this embodiment) is obtained (see FIG. 4C).

このようにして、パラメータ抽出部204は、中央値B、中央値の度数S、及び、中央データの位置Mを各画素毎に求める。   In this way, the parameter extraction unit 204 obtains the median value B, the median frequency S, and the median position M for each pixel.

パラメータ記憶部203は、パラメータ抽出部204が抽出した3つのパラメータを各画素毎に記憶するものである。   The parameter storage unit 203 stores the three parameters extracted by the parameter extraction unit 204 for each pixel.

中央値変化検出部202は、カウンタ値が設定された総度数を超えた場合に、全ての画素について、各画素の中央値が変化したか否かを検出するものである。中央値変化検出部202は、各画素について、バッファ部202に記憶されている当該画素の輝度値が属する階級(これを蓄積値Iという)と、排斥部103が排斥する度数が属する階級(これを排斥値Rという)とを、後述するパラメータ記憶部203が記憶する中央値と比較することにより得た結果に基づいて中央値が変化したか否かを検出するものである。   The median value change detection unit 202 detects whether or not the median value of each pixel has changed for all the pixels when the counter value exceeds the set total frequency. For each pixel, the median value change detection unit 202 includes a class to which the luminance value of the pixel stored in the buffer unit 202 belongs (this is referred to as an accumulated value I) and a class to which the frequency excluded by the rejection unit 103 belongs (this). Is referred to as a rejection value R), and it is detected whether the median value has changed based on the result obtained by comparing the median value stored in the parameter storage unit 203 described later.

(2)実施例2の動作
次に、実施例2に係る背景画像生成装置2の動作について図面を参照して説明する。
(2) Operation of Second Embodiment Next, the operation of the background image generating apparatus 2 according to the second embodiment will be described with reference to the drawings.

まず、カウンタ部104及び蓄積部102の初期化が行われ、カウンタ部104のカウンタ値が0にリセットされると共に、蓄積部102の各画素の出現頻度ヒストグラムがリセットされる(S201)。   First, the counter unit 104 and the storage unit 102 are initialized, the counter value of the counter unit 104 is reset to 0, and the appearance frequency histogram of each pixel of the storage unit 102 is reset (S201).

カウンタ部104及び蓄積部102の初期化が終了すると、例えばカメラ等により撮影された入力映像(アナログ信号)が、A/D変換部101によりデジタル変換されて、フレーム毎の画像がバッファ部201、蓄積部102及びカウンタ部104に与えられる(S202)。   When the initialization of the counter unit 104 and the storage unit 102 is completed, for example, an input video (analog signal) photographed by a camera or the like is digitally converted by the A / D conversion unit 101, and an image for each frame is stored in the buffer unit 201. The data is given to the storage unit 102 and the counter unit 104 (S202).

バッファ部201は、A/D変換部101から入力したフレーム毎の各画素の輝度値を一時的に記憶する。   The buffer unit 201 temporarily stores the luminance value of each pixel for each frame input from the A / D conversion unit 101.

また、蓄積部102は、A/D変換部101から入力したフレーム毎の画像の各画素の輝度値に基づいて、各画素の各出現頻度ヒストグラムを作成して記憶する。   Further, the accumulation unit 102 creates and stores each appearance frequency histogram of each pixel based on the luminance value of each pixel of the image for each frame input from the A / D conversion unit 101.

また、カウンタ部104では、A/D変換部104からフレーム毎の画像が入力し、そのフレーム数をカウントする。   The counter unit 104 receives an image for each frame from the A / D conversion unit 104 and counts the number of frames.

カウンタ部104において、そのカウント値が総度数未満である場合には、S202に戻り繰り返し動作が行われる(S203)。   In the counter unit 104, when the count value is less than the total frequency, the process returns to S202 and is repeated (S203).

また、カウンタ部104において、カウント値が総度数と等しくなった場合には、S204に進み、パラメータ抽出部204は、全ての画素について、各画素の3つのパラメータ(中央値B、中央値の度数S、中央データの位置M)を抽出すると共に、それら抽出した3つのパラメータをパラメータ記憶部203に設定させる(S204)。   In the counter unit 104, if the count value is equal to the total frequency, the process proceeds to S204, and the parameter extraction unit 204 sets three parameters (median value B, frequency of median value) for each pixel for all pixels. S, the position M of the central data) is extracted, and the extracted three parameters are set in the parameter storage unit 203 (S204).

具体的には、S205では、パラメータ抽出部204は、蓄積部102に蓄積されている各画素の各出現頻度ヒストグラムに基づいて中央データを求め、その中央データが属する輝度値に相当する階級を中央値Bとして求める。そして、パラメータ抽出部204が求めた中央値Bに出現している度数S及び中央データの位置Mを求める(S205)。   Specifically, in S205, the parameter extraction unit 204 obtains central data based on each appearance frequency histogram of each pixel accumulated in the accumulation unit 102, and the class corresponding to the luminance value to which the central data belongs is Obtained as value B. Then, the frequency S appearing in the median value B obtained by the parameter extraction unit 204 and the position M of the central data are obtained (S205).

パラメータ抽出部204が、各画素の3つのパラメータを抽出した後、パラメータ抽出部204は、その抽出した各画素の3つのパラメータを、パラメータ記憶部203の各画素毎の記憶領域に記憶させることでパラメータの設定をおこなう(S206)。   After the parameter extraction unit 204 extracts the three parameters of each pixel, the parameter extraction unit 204 stores the extracted three parameters of each pixel in the storage area for each pixel of the parameter storage unit 203. Parameters are set (S206).

パラメータ抽出部204は、この3つのパラメータの抽出及びパラメータの設定を全ての画素に対して行われているかを確認し、全ての画素について行われていない場合には、全ての画素について各パラメータを求めるようにS204に戻り、繰り返し行ない、全ての画素のパラメータ設定を行なう(S207)。   The parameter extraction unit 204 confirms whether these three parameters are extracted and set for all the pixels. If not, all the parameters are set for all the pixels. It returns to S204 so that it calculates | requires, and it repeats and sets the parameter of all the pixels (S207).

S203に戻り、カウンタ値が総度数を超えた場合には、排斥部103は、蓄積部102から各画素の出現頻度ヒストグラムを取り出し、カウンタ値に応じて排斥する階級を決定し、出願頻度ヒストグラムの総度数が設定値と等しくなるように、決定された階級の度数を1つ排斥する(S209)。なお、この排斥部103により排斥処理の対象が決定された階級を排斥値Rとする。   Returning to S203, if the counter value exceeds the total frequency, the rejection unit 103 extracts the appearance frequency histogram of each pixel from the storage unit 102, determines the class to be excluded according to the counter value, and determines the application frequency histogram. One frequency of the determined class is rejected so that the total frequency becomes equal to the set value (S209). The class for which the object of the exclusion process is determined by the exclusion unit 103 is defined as an exclusion value R.

排斥部103による排斥処理がなされると、中央値変化検出部202は、各画素の上述したパラメータ(中央値B、中央値の度数S、中央データの位置M)の更新を行なう(S210)。   When the rejection process by the rejection unit 103 is performed, the median value change detection unit 202 updates the above-described parameters (median value B, frequency of median value S, position M of the central data) of each pixel (S210).

具体的には、中央値変化検出部202は、今回入力した画像の全ての画素のうちある画素について、バッファ部201が一時的に記憶している当該画素の輝度値を取り出し、その画素の輝度値が蓄積部102の出現頻度ヒストグラムのうちのどの階級に属すかを判定する。この当該画素の輝度値が属する階級を蓄積値Iとする。   Specifically, the median value change detection unit 202 extracts the luminance value of the pixel temporarily stored in the buffer unit 201 for a certain pixel among all the pixels of the image input this time, and calculates the luminance of the pixel. The class to which the value belongs in the appearance frequency histogram of the storage unit 102 is determined. The class to which the luminance value of the pixel belongs is defined as an accumulated value I.

次に、中央値変化検出部202は、パラメータ記憶部203に記憶されている3つのパラメータ(中央値B、中央値の度数S、中央データの位置M)を取り出す。このパラメータ記憶部203から取り出される各パラメータは、今回入力された画像の直前にパラメータ記憶部203に設定されている各パラメータである。   Next, the median value change detection unit 202 extracts three parameters (median value B, median frequency S, and median data position M) stored in the parameter storage unit 203. Each parameter extracted from the parameter storage unit 203 is a parameter set in the parameter storage unit 203 immediately before the image input this time.

次に、中央値変化検出部202は、排斥部103が排斥した排斥値R及びパラメータ記憶部203から取り出された中央値Bの関係と、蓄積値I及び中央値Bの関係との組み合せでなる所定の規則に従って、中央値の度数Sの値及び中央データの位置Mの値をパラメータ記憶部203に記憶させて更新する。   Next, the median value change detection unit 202 is a combination of the relationship between the rejection value R rejected by the rejection unit 103 and the median value B extracted from the parameter storage unit 203 and the relationship between the accumulated value I and the median value B. According to a predetermined rule, the value of the median frequency S and the value of the position M of the central data are stored in the parameter storage unit 203 and updated.

ここで、中央値変化検出部202による各パラメータの更新に係る所定の規則は、図5に示すものである。   Here, the predetermined rule regarding the update of each parameter by the median value change detection unit 202 is shown in FIG.

図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 change detection unit 202 is updated. When the rejection value R is less than the median value B, the frequency S of the median value and the position M of the median data are not updated. When the reject value R is equal to the median value B, the frequency S of the median value is decreased by 1, and the position M of the central data is decreased by 1. When the rejection value R exceeds the median value B, the median frequency S is not changed, and the position M of the median data is decreased by one.

また、蓄積値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 change detection unit 202 updates the median frequency S and the median data position M as follows. When the rejection value R is less than the median value B, the median frequency S is increased by 1, and the median position M is increased by 1. When the rejection value R is equal to the median value B, the median frequency S and the central data position M are not updated. When the rejection value R exceeds the median value B, the median frequency S is increased by 1, and the position M of the median data is not changed.

また、蓄積値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 change detection unit 202 updates the median frequency S and the median data position M as follows. When the rejection value R is less than the median value B, the median frequency S is not changed, and the position M of the median data is increased by one. When the rejection value R is equal to the median value B, the median frequency S is decreased by 1, and the position M of the median data is not changed. When the rejection value R exceeds the median value B, the frequency S of the median value and the position M of the median data are not updated.

中央値変化検出部202は、上記の手順により、当該画素の各パラメータをパラメータ記憶部203の記憶領域に記憶させて更新を行なう。   The median value change detection unit 202 performs updating by storing each parameter of the pixel in the storage area of the parameter storage unit 203 according to the above procedure.

中央値変化検出部202において、当該画素についての各パラメータの更新が行われると、中央値変化検出部202は、中央データの位置Mと中央値の度数Sとの関係が1≦M≦Sの条件を満たしているか否かを判断し、この条件を満たしている場合を中央値Bの変化がなかったとし、この条件を満たしていない場合を中央値が変化したとする(S211)。   When the median value change detection unit 202 updates each parameter for the pixel, the median value change detection unit 202 indicates that the relationship between the position M of the median data and the frequency S of the median value is 1 ≦ M ≦ S. It is determined whether or not the condition is satisfied, and it is assumed that the median value B does not change when the condition is satisfied, and the median value changes when the condition is not satisfied (S211).

S211において、中央値変化検出部203が中央値Bの変化がないと判断した場合、S214に進み、中央値変化検出部203は、全ての画素について中央値Bの変化があるか否かの検出を行なう(S214)。   When the median value change detection unit 203 determines in S211 that there is no change in the median value B, the process proceeds to S214, and the median value change detection unit 203 detects whether there is a change in the median value B for all pixels. (S214).

中央値変化検出部203は、各画素の中央値に変化がないとした場合、その画素の中央値は、パラメータ記憶部203に記憶されているパラメータ(すなわち前フレームの中央値)をその画素の中央値として出力させる(S215)。   When the median value change detection unit 203 determines that there is no change in the median value of each pixel, the median value of the pixel is obtained by using the parameter stored in the parameter storage unit 203 (that is, the median value of the previous frame). The median value is output (S215).

勿論、すべての画素の中央値に変化がない場合には、そのまま前フレームについての全ての画素の中央値が出力され、全ての画素のうち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 parameter extraction unit 204 obtains a median value for the pixel and extracts a new median value.

S211に戻り、中央値変化検出部203がある画素の中央値Bの変化を検出した場合、パラメータ抽出部204は、蓄積部102の当該画素の出現頻度ヒストグラムに基づいて中央値B、中央値の度数S及び中央データの位置Mを抽出する(S212)。   Returning to S211, when the median value change detection unit 203 detects a change in the median value B of the pixel, the parameter extraction unit 204 determines the median value B and median value based on the appearance frequency histogram of the pixel in the storage unit 102. The frequency S and the position M of the central data are extracted (S212).

パラメータ抽出部204が3つのパラメータを抽出すると、パラメータ抽出部204は、その抽出した3つのパラメータをパラメータ記憶部203の当該画素の記憶領域に設定させる(S213)。   When the parameter extraction unit 204 extracts three parameters, the parameter extraction unit 204 sets the extracted three parameters in the storage area of the pixel in the parameter storage unit 203 (S213).

中央値変化検出部202は、当該画素のパラメータの設定がなされると、S214に進み、全ての画素について終了しているか否かを確認し、全ての画素について終了していない場合にはS208に戻り全ての画素について終了するまで繰り返し動作が行われる(S214)。   The median value change detection unit 202 proceeds to S214 when the parameters of the pixel are set, and checks whether or not the process is completed for all the pixels. If the process is not completed for all the pixels, the process proceeds to S208. The operation is repeated until all the pixels are returned (S214).

全ての画素についての中央値が抽出されると、パラメータ記憶部203に記憶されている各画素の中央値Bが出力し、図示しない画像生成手段に与えられて画像が生成される(S215)。   When the median values for all the pixels are extracted, the median value B of each pixel stored in the parameter storage unit 203 is output, and is supplied to image generation means (not shown) to generate an image (S215).

以上のようにして、背景画像生成装置2は、各画素の中央値の変化しているか否かを検出し、中央値の変化を検出した画素については、新たに中央値を抽出してその中央値を代表値として出力し、中央値の変化を検出しなった画素については前フレームで出力した当該画素の中央値を代表値として出力することで、代表値検出処理の高速化を図ることができる。   As described above, the background image generation device 2 detects whether or not the median value of each pixel has changed, and for the pixel from which the median value has been detected, a new median value is extracted and its center value is extracted. A value is output as a representative value, and for a pixel for which a change in the median value has not been detected, the median value of the pixel output in the previous frame is output as a representative value, thereby speeding up the representative value detection process. it can.

(3)実施例2の効果
以上、本実施例によれば、実施例1で説明した同一の効果を奏する。
(3) Effect of Embodiment 2 As described above, according to this embodiment, the same effect as described in Embodiment 1 can be obtained.

また、本実施例によれば、中央値変化検出部202が、バッファ部201の各画素の蓄積値Iと排斥部103の排斥値Rとをそれぞれ、パラメータ記憶部203に記憶されている中央値Bと比較することに基づいて、中央値Bが変化したか否かを容易に検出することができるので、代表値の抽出をより高速に処理することができる。   Further, according to the present embodiment, the median value change detection unit 202 stores the accumulated value I of each pixel of the buffer unit 201 and the exclusion value R of the exclusion unit 103, respectively, stored in the parameter storage unit 203. Since it is possible to easily detect whether or not the median value B has changed based on the comparison with B, the representative value can be extracted at a higher speed.

(1)実施例3の構成
次に、本発明の背景画像生成装置の実施例3について図面を参照して説明する。本実施例では、入力したカラー映像の赤信号、緑信号、青信号の3種類の濃度値を用いたRGB表色系のデータを用いた場合の背景画像生成装置について説明する。
(1) Configuration of Embodiment 3 Next, Embodiment 3 of the background image generation apparatus of the present invention will be described with reference to the drawings. In the present embodiment, a background image generation apparatus using RGB color system data using three types of density values of a red signal, a green signal, and a blue signal of an input color image will be described.

図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 image generation apparatus 3 according to the third embodiment includes a color A / D conversion unit 301, a color storage unit 302, a color rejection unit 303, a counter unit 304, and a color representative value extraction unit. 305, a gravity center calculation unit 306, and a rejection data storage unit 307.

カラー用A/D変換部301は、入力したカラー映像をフレーム毎のカラー画像にデジタル変換するものである。カラー用A/D変換部301は、各画素の赤緑青の3種類の濃度値をカラー用蓄積部302に与えるものである。なお、以下ではこの赤緑青の3種類の値をまとめてカラーデータという。カラー用A/D変換部301は、既存するカラー映像用のA/D変換器を適用することができる。   The color A / D converter 301 digitally converts an input color video into a color image for each frame. The color A / D converter 301 provides the color storage unit 302 with three types of density values of red, green, and blue for each pixel. In the following, these three types of red, green, and blue are collectively referred to as color data. The color A / D converter 301 can use an existing A / D converter for color video.

カラー用蓄積部302は、各画素のカラーデータを蓄積するデータ表を画素毎に有しており、カラー用A/D変換部301からデジタル化された画像を受け取り、受け取った1フレームの画像について、各画素に対応するデータ表に各画素のカラーデータを記憶するものである。   The color accumulating unit 302 has a data table for accumulating the color data of each pixel for each pixel, receives the digitized image from the color A / D converter 301, and receives the received image of one frame. The color data of each pixel is stored in the data table corresponding to each pixel.

カラー用排斥部303は、後述するカウンタ部304のカウンタ値が総度数を超えた場合に、カラー用蓄積部302で蓄積されているデータ表に基づいて排斥すべきカラーデータを決定し、その決定したカラーデータを対応するデータ表から取り除くものである。   The color rejection unit 303 determines the color data to be rejected based on the data table stored in the color storage unit 302 when the counter value of the counter unit 304 described later exceeds the total frequency, and the determination The removed color data is removed from the corresponding data table.

カウンタ部304は、カラー用A/D変換部301からのカラー画像のフレーム数をカウントするものである。カウンタ部304は、予め総度数が設定されており、カウンタ値が総度数を超えた場合に、カラー用解析部303に排斥処理を行なわせるものである。   The counter unit 304 counts the number of color image frames from the color A / D conversion unit 301. The counter unit 304 has a total frequency set in advance, and causes the color analysis unit 303 to perform a rejection process when the counter value exceeds the total frequency.

カラー用代表値抽出部305は、カラー用蓄積部302が蓄積している各画素のデータ表から、背景画像を生成するためのカーラーデータを代表値として抽出するものである。   The color representative value extracting unit 305 extracts curler data for generating a background image as a representative value from the data table of each pixel accumulated in the color accumulating unit 302.

重心算出部306は、カラー用蓄積部302が蓄積する各画素のデータ表内のカラーデータを取り出し、そのカラーデータの3つの値を3次元ベクトルとみなして、全カラーデータの3次元座標中での距離に基づいて重心位置を算出するものである。   The center-of-gravity calculation unit 306 takes out the color data in the data table of each pixel accumulated by the color accumulation unit 302, regards the three values of the color data as a three-dimensional vector, and in the three-dimensional coordinates of all the color data. The center of gravity position is calculated based on the distance.

排斥データ記憶部307は、カラー用排斥部303が排斥した各画素のカラーデータを各画素毎で記憶するものである。なお排斥データ記憶部307が記憶する各画素のカラーデータは背景画像生成に係る前フレームのものである。   The rejection data storage unit 307 stores the color data of each pixel that is rejected by the color rejection unit 303 for each pixel. Note that the color data of each pixel stored in the exclusion data storage unit 307 is that of the previous frame related to background image generation.

(2)実施例3の動作
次に、本実施例の背景画像生成装置の動作について図8を参照して説明する。
(2) Operation of Embodiment 3 Next, the operation of the background image generation apparatus of the present embodiment will be described with reference to FIG.

まず、カウンタ部304及びカラー用蓄積部302の初期化が行われ、カウンタ部304のカウンタ値が0にリセットされると共に、蓄積部302の内容も初期化される(S301)。   First, the counter unit 304 and the color storage unit 302 are initialized, the counter value of the counter unit 304 is reset to 0, and the contents of the storage unit 302 are also initialized (S301).

カラー用A/D変換部301によりデジタル変換された画像について各画素のカラーデータは、カラー用蓄積部302に与えられ、カラー用蓄積部302の各画素のデータ表に追加されて記憶される(S302)。   The color data of each pixel of the image digitally converted by the color A / D conversion unit 301 is given to the color storage unit 302 and added to the data table of each pixel of the color storage unit 302 and stored ( S302).

また、カラー用A/D変換部301からの1フレームの画像のカラーデータがカウンタ部304に入力し、カウンタ部304のカウンタ値を1つ増加させる(S302)。   Further, the color data of one frame image from the color A / D conversion unit 301 is input to the counter unit 304, and the counter value of the counter unit 304 is incremented by one (S302).

カウンタ部304のカウンタ値が総度数以下である場合には、S302に戻り、S302の動作が繰り返される(S303)。   When the counter value of the counter unit 304 is equal to or less than the total frequency, the process returns to S302 and the operation of S302 is repeated (S303).

カウンタ部304のカウンタ値が総度数を超えた場合には、S304に進み、カラー用排斥部303が、カラー用蓄積部302のデータ表の中から排斥するカラーデータを決定し、そのカラーデータを削除し、予め設定したデータ総数と全ての総データ数とを等しくなるようにする(S304)。   When the counter value of the counter unit 304 exceeds the total frequency, the process proceeds to S304, where the color rejection unit 303 determines color data to be excluded from the data table of the color storage unit 302, and the color data is determined. The total number of data set in advance is made equal to the total number of all data (S304).

ここで、カラー用排斥部303による排斥するカラーデータの決定方法について説明する。   Here, a method for determining color data to be rejected by the color rejecting unit 303 will be described.

カラー用排斥部303は、重心算出部306にカラー用蓄積部302の各画素の各データ表の全カラーデータに基づいて形成される3次元空間の重心位置(この重心をGとする)を算出させる。このカラーデータは、上述したように、色を分類するための3つの値でなり、これら3つの値で示される3次元ベクトルとする。重心算出部306は、これら全てのカラーデータの3次元座標中での距離に基づいてこれらの重心位置座標を算出する。   The color rejecting unit 303 calculates the center of gravity position of the three-dimensional space formed by the center of gravity calculating unit 306 based on all the color data of each data table of each pixel of the color storing unit 302 (this center of gravity is assumed to be G). Let As described above, the color data includes three values for classifying colors, and is a three-dimensional vector represented by these three values. The center-of-gravity calculation unit 306 calculates these center-of-gravity position coordinates based on the distance in the three-dimensional coordinates of all these color data.

カラー用排斥部303は、排斥データ記憶部307に記憶されているカラーデータから前回排斥したカラーデータを排斥値Pとして取り出し、重心算出部306が算出した重心Gを通りベクトルGPを法線とする平面により、各画素のカラーデータにより形成される3次元空間を2つの領域に分割する。   The color rejection unit 303 extracts color data previously rejected from the color data stored in the rejection data storage unit 307 as an exclusion value P, passes through the center of gravity G calculated by the center of gravity calculation unit 306, and uses the vector GP as a normal line. The three-dimensional space formed by the color data of each pixel is divided into two regions by the plane.

カラー用排斥部303は、カラー用蓄積部302のデータ表内のカラーデータの中から、前回排斥値Pとは異なる領域に属し、かつ、重心位置座標Gから最も離れたカラーデータを排斥するカラーデータとして決定する。   The color rejection unit 303 excludes color data belonging to an area different from the previous rejection value P and distant from the barycentric position coordinates G from among the color data in the data table of the color storage unit 302. Determine as data.

但し、前回排斥値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 color rejecting unit 303, the color rejecting unit 3030 stores the rejected color data in the rejecting data storage unit 307 for each pixel (S304).

カラー用排斥部303が排斥すべきカラーデータを排斥し、その排斥したカラーデータを記憶させた後、カラー用代表値抽出部305は、カラー用蓄積部302内の全てのデータ表から重心位置座標Gに最も近い位置のカラーデータを代表値として抽出する(S305)。   After the color data to be rejected by the color rejecting unit 303 is stored and the rejected color data is stored, the color representative value extracting unit 305 obtains the barycentric position coordinates from all the data tables in the color storing unit 302. Color data at a position closest to G is extracted as a representative value (S305).

カラー用代表値抽出部305が抽出した代表値は、図示しない後段の画像生成手段に与えられ、背景画像を生成させる(S306)。そして、カラー用代表値抽出部305が代表値を抽出した後、S302に戻り繰り返し動作がなされる。   The representative value extracted by the color representative value extraction unit 305 is given to a subsequent image generation unit (not shown) to generate a background image (S306). Then, after the color representative value extraction unit 305 extracts the representative value, the process returns to S302 and is repeated.

(3)実施例3の効果
以上、本実施例によれば、実施例1で説明した同様な効果を奏すると共に、カラーの背景画像を作成することができる。
(3) Effects of Embodiment 3 As described above, according to the present embodiment, the same effects as described in Embodiment 1 can be achieved and a color background image can be created.

また、本実施例によれば、カラー用排斥部303が、3種類の色信号(赤緑青)を個別に排斥処理をするのではなく、各画素ごとのカラーデータを1つのデータとして排斥することにより、背景画像に表現される画像の色相が撮影時に近い色相で表現することができる。これは、3種類の色信号をそれぞれ個別に排斥しようとすると、それらを組み合せた値が異なってしまい撮影時の色相と異なることが考えられるが、本実施例ではこのような問題を回避することができる。   In addition, according to the present embodiment, the color rejection unit 303 does not individually reject the three types of color signals (red, green, and blue), but rejects the color data for each pixel as one data. Thus, the hue of the image expressed in the background image can be expressed with a hue close to that at the time of shooting. This is because if the three types of color signals are individually rejected, the combined value of the color signals may be different from the hue at the time of shooting, but this embodiment avoids such a problem. Can do.

また、本実施例3によれば、カラー用排斥部303が、排斥データ記憶部307の前回排斥した排斥値Pから離れた領域の中から決定するため、同じ値が継続的に入力される場合は外れた値であっても全てをノイズとして排斥してしまうことがなく、撮影画像の変化に追従することができる。   Further, according to the third embodiment, when the color rejection unit 303 determines from the area away from the rejection value P previously rejected in the rejection data storage unit 307, the same value is continuously input. Even if the value is out of the range, the entire image is not rejected as noise, and can follow the change in the captured image.

次に、上述した実施例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 exclusion part 103 reduces one frequency from the appearance frequency histogram of each pixel of the accumulation | storage part 102, when a counter value exceeds total frequency. It was decided to perform a waste treatment.

しかし、これに限られることはなく、例えば、設定した総度数の他に、総度数よりも大きい値の排斥実行値を設定し、カウンタ値がその排斥実行値に達した場合に、排斥部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 rejection unit 103 However, the frequency corresponding to the difference between the rejection execution value and the total frequency may be rejected at a time. In this case, the data to be rejected may be, for example, rejecting frequencies that are half of the frequencies related to rejection in order from the lowest class side and rejecting the remaining frequencies in order from the maximum class side.

(5)上述した実施例2では、中央値変化検出部202が、蓄積値Iと排斥値Rとを、それぞれ中央値Bと比較した結果を組み合せることで中央値の変化を検出することとして説明した。 (5) In the above-described second embodiment, the median value change detection unit 202 detects a change in the median value by combining the results of comparing the accumulated value I and the rejection value R with the median value B, respectively. explained.

しかし、これに限ることなく、例えば、中央値変化検出部202が、まず、蓄積値Iと中央値Bとが等しいか否かを判断し、これらが等しい場合には、その画素の中央値の更新を行なうことなく前フレームの当該画素の中央値を出力させ、蓄積値Iが中央値Bと異なる場合にのみ、実施例2で説明した中央値変化検出処理を行なわせるようにしてもよい。   However, without being limited thereto, for example, the median value change detection unit 202 first determines whether or not the accumulated value I and the median value B are equal, and if they are equal, the median value of the pixel is determined. The median value change detection process described in the second embodiment may be performed only when the median value of the pixel in the previous frame is output without updating and the accumulated value I is different from the median value B.

(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の背景画像生成装置の内部構成を示したブロック図である。1 is a block diagram illustrating an internal configuration of a background image generation apparatus according to Embodiment 1. FIG. 実施例1の背景画像生成装置の動作を示したフローチャートである。3 is a flowchart illustrating the operation of the background image generation apparatus according to the first embodiment. 実施例2の背景画像生成装置の内部構成を示したブロック図である。FIG. 10 is a block diagram illustrating an internal configuration of a background image generation apparatus according to a second embodiment. 実施例2における3つのパラメータを説明するための説明図である。FIG. 9 is an explanatory diagram for explaining three parameters in the second embodiment. 実施例2における中央値変化検出部302がパラメータを更新するときの所定規則を説明するための説明図である。It is explanatory drawing for demonstrating the predetermined rule when the median value change detection part 302 in Example 2 updates a parameter. 実施例2の背景画像生成装置の動作を示したフローチャートである。10 is a flowchart illustrating the operation of the background image generation apparatus according to the second embodiment. 実施例3の背景画像生成装置の内部構成を示したブロック図である。FIG. 10 is a block diagram illustrating an internal configuration of a background image generation apparatus according to Embodiment 3. 実施例3の背景画像生成装置の動作を示したフローチャートである。10 is a flowchart illustrating the operation of the background image generation apparatus according to the third embodiment.

符号の説明Explanation of symbols

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.
上記データ蓄積手段は、上記入力動画像の各画素の輝度値を出現頻度ヒストグラムとして蓄積することを特徴とする請求項1に記載の背景画像生成装置。   The background image generation apparatus according to claim 1, wherein the data storage unit stores the luminance value of each pixel of the input moving image as an appearance frequency histogram. 上記データ除去手段は、上記各画素の出現頻度ヒストグラムから、最小の階級から最初に出現する階級のデータ又は最大の階級から最初に出現する階級のデータを除去するデータとして交互に除去することを特徴とする請求項2に記載の背景画像生成装置。   The data removing means alternately removes from the appearance frequency histogram of each pixel as data for removing the data of the class first appearing from the minimum class or the data of the class first appearing from the maximum class. The background image generation apparatus according to claim 2. 上記代表データ抽出手段が抽出した前フレームの代表データを画素毎に記憶する代表データ記憶手段と、
上記出現頻度ヒストグラムの総度数の中央度数が属する輝度値を中央値とし、前フレームの各画素の中央値と、当該フレームの各画素の中央値との変化を検出する中央値変化検出手段と
を備え、
上記中央値変化検出手段が中央値の変化を検出した場合、上記データ抽出手段は、上記データ蓄積手段の各画素のデータから代表データを抽出して画像を生成させ、
上記中央値変化検出手段が中央値の変化を検出しない場合、上記代表データ記憶手段に記憶されている前フレームの各画素の代表データに基づいて画像を生成させる
ことを特徴とする請求項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.
上記入力動画像がカラー画像であり、上記データ蓄積手段が、各画素の色を3分類した各値をカラーデータとして蓄積することを特徴とする請求項1に記載の背景画像生成装置。   2. The background image generation apparatus according to claim 1, wherein the input moving image is a color image, and the data storage unit stores each value obtained by classifying the color of each pixel into three as color data. 上記データ除去手段は、上記カラーデータを3次元ベクトルとして、上記データ蓄積手段に蓄積された各画素のカラーデータから重心位置を算出し、上記重心位置との距離が最大となるカラーデータを上記除去するデータとして決定することを特徴とする請求項6に記載の背景画像生成装置。   The data removal means calculates the centroid position from the color data of each pixel stored in the data storage means using the color data as a three-dimensional vector, and removes the color data having the maximum distance from the centroid position. The background image generation device according to claim 6, wherein the background image generation device is determined as data to be processed. 上記データ除去手段は、当該画素の処理において前回のデータ除去処理によって除去した前回除去データから十分離れた領域に存在して、かつ、上記重心位置との距離が最大となるカラーデータを上記除去するデータとして決定することを特徴とする請求項7に記載の背景画像生成装置。   The data removing unit removes the color data that exists in an area sufficiently away from the previous removal data removed by the previous data removal processing in the processing of the pixel and has the maximum distance from the barycentric position. The background image generation apparatus according to claim 7, wherein the background image generation apparatus is determined as data. 上記データ抽出手段は、上記重心位置から最も近い位置のカラーデータを上記代表データとすることを特徴とする請求項7又は8に記載の背景画像生成装置。

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.

JP2003305106A 2003-08-28 2003-08-28 Background image generator Pending JP2005078195A (en)

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)

* Cited by examiner, † Cited by third party
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

Cited By (3)

* Cited by examiner, † Cited by third party
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