Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP5630298B2 - Moving object detection device - Google Patents
[go: Go Back, main page]

JP5630298B2 - Moving object detection device - Google Patents

Moving object detection device Download PDF

Info

Publication number
JP5630298B2
JP5630298B2 JP2011020228A JP2011020228A JP5630298B2 JP 5630298 B2 JP5630298 B2 JP 5630298B2 JP 2011020228 A JP2011020228 A JP 2011020228A JP 2011020228 A JP2011020228 A JP 2011020228A JP 5630298 B2 JP5630298 B2 JP 5630298B2
Authority
JP
Japan
Prior art keywords
image
pixel
pixel value
determination
value
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.)
Active
Application number
JP2011020228A
Other languages
Japanese (ja)
Other versions
JP2012160977A (en
Inventor
龍 李
龍 李
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing 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 Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP2011020228A priority Critical patent/JP5630298B2/en
Publication of JP2012160977A publication Critical patent/JP2012160977A/en
Application granted granted Critical
Publication of JP5630298B2 publication Critical patent/JP5630298B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Studio Devices (AREA)
  • Image Processing (AREA)

Description

本発明は、動画画像に基づいて、画像内の移動物体を検出する移動物体検出装置に関する。   The present invention relates to a moving object detection device that detects a moving object in an image based on a moving image.

ビデオカメラを用いた監視システムなどでは、監視領域内に存在する移動物体を自動的に検出する技術が重要になってきている。移動物体の自動検出が可能になれば、当該物体が車両であるのか、人間であるのか、といった識別を行う処理に利用することができる。更に、車両の場合であれば、ナンバーを読み取って車両を特定することができ、人間の場合であれば、個人を特定する処理にも応用することができる。また、検出した不審者を自動的にズームアップして追尾することも可能になる。   In a surveillance system using a video camera or the like, a technique for automatically detecting a moving object existing in a surveillance area has become important. If automatic detection of a moving object becomes possible, it can be used for processing for identifying whether the object is a vehicle or a human. Further, in the case of a vehicle, the number can be read to identify the vehicle, and in the case of a human, the present invention can be applied to a process for identifying an individual. It is also possible to automatically zoom in and track the detected suspicious person.

移動物体を検出する基本原理は、時系列で連続的に与えられるフレーム単位の入力画像を予め用意した背景画像と比較し、両者の差分を求めることにより、時間的に変化している領域を認識することにある。ただ、屋外の監視システムなどに利用する場合、時刻や天候などによる照明変動が生じるため、必ずしも正確な物体検出を行うことができない。そこで、たとえば、下記の特許文献1には、フレーム単位の入力画像を小領域に分割し、各小領域単位で画素値の統計処理を施して照明変動を推定する手法が開示されている。また、下記の特許文献2には、フレーム単位の入力画像をブロックに分割し、個々のブロックごとに画素値の平均値を求め、背景画像の画素値平均と比較することにより、当該ブロックが移動物体を含むか否かを判定する手法が開示されている。   The basic principle of detecting a moving object is to recognize a time-varying region by comparing a frame-unit input image given in time series with a background image prepared in advance and obtaining the difference between them. There is to do. However, when it is used for an outdoor monitoring system or the like, illumination fluctuations occur due to time or weather, so that accurate object detection cannot always be performed. Thus, for example, Patent Document 1 below discloses a technique of dividing an input image in units of frames into small regions and performing pixel value statistical processing in units of each small region to estimate illumination variation. In Patent Document 2 below, an input image in units of frames is divided into blocks, an average value of pixel values is obtained for each block, and the block is moved by comparing with an average of pixel values of a background image. A method for determining whether or not an object is included is disclosed.

一方、下記の非特許文献1には、入力画像と背景画像とを画素単位で比較して、当該画素が移動物体を構成する画素であるか否かを判定する手法が開示されている。具体的には、比較対象となる両画素の画素値が類似している場合、当該画素は背景を構成する画素であるとし、類似していない場合、当該画素は移動物体を構成する画素であるとする判定が行われる。このとき、画素の類否判定は、三次元の色空間上で、双方の画素値に対応する座標点をプロットし、一方の座標点が他方の座標点の近傍領域に入っているか否かを調べることにより行われる。   On the other hand, Non-Patent Document 1 below discloses a method of comparing an input image and a background image in units of pixels and determining whether or not the pixel is a pixel constituting a moving object. Specifically, when the pixel values of both pixels to be compared are similar, the pixel is a pixel constituting the background, and when the pixel values are not similar, the pixel is a pixel constituting a moving object. Is determined. At this time, the pixel similarity determination is performed by plotting coordinate points corresponding to both pixel values in a three-dimensional color space, and determining whether one coordinate point is in the vicinity region of the other coordinate point. It is done by examining.

特開平7−302328号公報JP-A-7-302328 特開2009−048240号公報JP 2009-048240 A

Kim K, Chalidabhongse T H, Harwood D, Davis L S. "Background Modeling and Subtraction by Codebook Construction" Proceedings of International Conference on Image Processing, Singapore. IEEE, 2004. 5: 3061-3064Kim K, Chalidabhongse T H, Harwood D, Davis L S. "Background Modeling and Subtraction by Codebook Construction" Proceedings of International Conference on Image Processing, Singapore. IEEE, 2004. 5: 3061-3064

上述したように、移動物体を検出する基本原理は、新たな入力画像を背景画像と比較し、時間的に変化している領域を認識することにある。しかしながら、画像の時間変化は、必ずしも移動物体に起因するものではなく、雲の動きによる日照変化、風の作用による樹木の揺れ、波の動きによる海面の変化など、様々な自然現象にも起因する。このため、特に、屋外の監視システムなどから取り込まれた動画画像に基づいて、移動物体の検出を行う場合、このような自然現象による画像変化を移動物体による画像変化と混同した誤検出が生じやすい。   As described above, the basic principle of detecting a moving object is to compare a new input image with a background image and recognize a temporally changing region. However, temporal changes in images are not necessarily caused by moving objects, but are also caused by various natural phenomena such as sunshine changes due to cloud movement, tree swaying due to wind action, and sea level changes due to wave movement. . For this reason, in particular, when detecting a moving object based on a moving image captured from an outdoor monitoring system or the like, an erroneous detection in which an image change caused by such a natural phenomenon is confused with an image change caused by the moving object is likely to occur. .

前掲の特許文献1,2には、このような問題を解決するための一手法が開示されているが、入力画像に対して、小領域もしくはブロック単位で画素値のヒストグラムをとるなどの統計処理を施し、当該統計処理によって得られた特徴量を複雑なモデルに当てはめて移動物体の領域を推定する必要があるため、演算処理が極めて複雑になるという問題がある。このため、一般的なプロセッサでは処理時間が長くかかり、リアルタイムでの処理を行うことが困難である。また、より正確な検出を行うためには、多数のフレームにわたって入力画像を格納しておく必要があり、大容量の画像バッファメモリが必要になる。このため、リアルタイムでの監視を目的とした安価な監視システムに利用するには不適当である。   The above-mentioned Patent Documents 1 and 2 disclose a method for solving such a problem, but statistical processing such as taking a histogram of pixel values in small regions or block units for an input image. Therefore, it is necessary to estimate the area of the moving object by applying the characteristic amount obtained by the statistical processing to a complicated model, and there is a problem that the arithmetic processing becomes extremely complicated. For this reason, a general processor takes a long processing time, and it is difficult to perform processing in real time. Further, in order to perform more accurate detection, it is necessary to store an input image over many frames, and a large-capacity image buffer memory is required. For this reason, it is unsuitable for use in an inexpensive monitoring system for real-time monitoring.

一方、上述した非特許文献1に開示されている手法では、画素単位での比較を行えばよいので、複雑な統計処理を行ったり、複雑なモデルを構築したりする必要はない。しかしながら、領域単位での統計処理を省き、画素単位での比較結果のみによって検出を行うため、上述したように、日照変化などの自然現象に起因した誤検出が生じやすい。   On the other hand, in the method disclosed in Non-Patent Document 1 described above, since it is only necessary to perform comparison in units of pixels, it is not necessary to perform complicated statistical processing or build a complicated model. However, since the statistical processing in units of regions is omitted and detection is performed only by the comparison result in units of pixels, as described above, erroneous detection due to natural phenomena such as changes in sunlight is likely to occur.

そこで本発明は、演算処理の負担を軽減しつつ、日照変化などの自然現象に起因した誤検出を排除し、より正確な検出を行うことが可能な移動物体検出装置を提供することを目的とする。   Accordingly, an object of the present invention is to provide a moving object detection device capable of performing more accurate detection while reducing the burden of calculation processing, eliminating erroneous detection caused by natural phenomena such as changes in sunlight. To do.

(1) 本発明の第1の態様は、動画画像について移動物体を検出する移動物体検出装置において、
時系列で連続的に与えられるフレーム単位のカラー原画像を、三原色の各画素値を有する画素の集合体データとして入力する画像入力部と、
入力された原画像を逐次格納する原画像格納部と、
新たな原画像が入力されるたびに、当該新たな原画像と直前に作成した平均画像とに基づいて、新たな平均画像を作成する平均画像作成部と、
作成された平均画像を逐次格納する平均画像格納部と、
新たな原画像が入力されるたびに、直前に作成した参照画像に基づいて新たな参照画像を作成する参照画像作成部と、
作成された参照画像を逐次格納する参照画像格納部と、
原画像格納部に格納された原画像と、平均画像格納部に格納された平均画像と、参照画像格納部に格納された参照画像と、を用いた比較処理により、前景領域と背景領域とを区別するマスク画像を作成する画像比較部と、
マスク画像を格納するマスク画像格納部と、
マスク画像を出力する画像出力部と、
を設け、
画像比較部は、
原画像格納部に格納された第i番目の原画像、平均画像格納部に格納された第(i−1)番目の平均画像、参照画像格納部に格納された第(i−1)番目の参照画像から、それぞれ対応する所定位置にある画素の三原色の各画素値を読み出す画素値読出部と、
画素値読出部によって読み出された画素値に基づいて、第i番目の原画像の所定位置にある画素が前景画素か背景画素かを判定する前背判定部と、
第i番目のマスク画像を構成する所定位置の画素の画素値として、前背判定部が背景画素と判定した場合には背景領域を示す画素値を、前背判定部が前景画素と判定した場合には前景領域を示す画素値を、それぞれマスク画像格納部に書き込む画素値書込部と、
を有し、
前背判定部は、第i番目の原画像を構成する画素の画素値p(i)と第(i−1)番目の平均画像を構成する画素の画素値a(i−1)とを比較して類似するか否かを判定する第1判定部と、第i番目の原画像を構成する画素の画素値p(i)と第(i−1)番目の参照画像を構成する画素の画素値u(i−1)とを比較して類似するか否かを判定する第2判定部と、第1判定部による判定結果および第2判定部による判定結果の少なくとも一方が類似を示す場合には背景画素、双方とも非類似を示す場合には前景画素との判定を行う総合判定部と、を有し、
平均画像作成部は、第1番目の原画像をそのまま第1番目の平均画像とし、第i番目の原画像と第(i−1)番目の平均画像とについて、互いに対応する位置にある画素の三原色の各画素値の重みつき平均値をそれぞれ求め、得られた各平均値を各画素値とする画素の集合からなる画像を第i番目(i≧2)の平均画像とし、
参照画像作成部は、第1番目の原画像をそのまま第1番目の参照画像とし、第(i−1)番目の参照画像を構成する個々の画素のうち、前背判定部によって第i番目の原画像の対応画素が前景画素と判定された画素については、更新せずに、もとの画素値をそのまま維持し、前背判定部によって第i番目の原画像の対応画素が背景画素と判定された画素については、当該画素と第(i−1)番目の平均画像の対応する位置にある画素とについて、三原色の各画素値の重みつき平均値をそれぞれ求め、得られた各平均値を新画素値として更新することにより、第i番目(i≧2)の参照画像を作成するようにしたものである。
(1) A first aspect of the present invention provides a moving object detection device that detects a moving object for a moving image.
An image input unit for inputting a color original image in units of frames continuously given in time series as aggregate data of pixels having pixel values of three primary colors;
An original image storage unit for sequentially storing the input original images;
Each time a new original image is input, an average image creation unit that creates a new average image based on the new original image and the average image created immediately before,
An average image storage unit for sequentially storing the created average images;
A reference image creation unit that creates a new reference image based on the reference image created immediately before a new original image is input;
A reference image storage unit that sequentially stores the created reference images;
The foreground region and the background region are compared by using a comparison process using the original image stored in the original image storage unit, the average image stored in the average image storage unit, and the reference image stored in the reference image storage unit. An image comparison unit for creating a mask image to be distinguished;
A mask image storage for storing the mask image;
An image output unit for outputting a mask image;
Provided,
The image comparison unit
The i-th original image stored in the original image storage unit, the (i-1) -th average image stored in the average image storage unit, and the (i-1) -th image stored in the reference image storage unit A pixel value reading unit that reads out the pixel values of the three primary colors of the pixels at the corresponding predetermined positions from the reference image;
A foreground determination unit that determines whether a pixel at a predetermined position of the i-th original image is a foreground pixel or a background pixel based on the pixel value read by the pixel value reading unit;
When the foreground determination unit determines the background pixel as the pixel value of the pixel at the predetermined position constituting the i-th mask image, the pixel value indicating the background area is determined as the foreground pixel A pixel value writing unit for writing a pixel value indicating the foreground region into the mask image storage unit,
Have
The foreground determination unit compares the pixel value p (i) of the pixel constituting the i-th original image with the pixel value a (i-1) of the pixel constituting the (i-1) -th average image. A first determination unit that determines whether or not they are similar to each other, and a pixel value p (i) of a pixel constituting the i-th original image and a pixel of a pixel constituting the (i−1) -th reference image When the second determination unit that determines whether or not they are similar by comparing the value u (i-1), and at least one of the determination result by the first determination unit and the determination result by the second determination unit shows similarity Has a general determination unit that determines a background pixel and a foreground pixel when both are dissimilar,
The average image creation unit uses the first original image as it is as the first average image, and the i-th original image and the (i−1) -th average image are the pixels at positions corresponding to each other. A weighted average value of each pixel value of the three primary colors is obtained, and an image composed of a set of pixels each having the obtained average value as each pixel value is defined as an i-th (i ≧ 2) average image,
The reference image creation unit directly uses the first original image as the first reference image, and among the individual pixels constituting the (i-1) th reference image, the foreground determination unit performs the i th For pixels for which the corresponding pixel of the original image is determined to be a foreground pixel, the original pixel value is maintained as it is without being updated, and the corresponding pixel of the i-th original image is determined to be a background pixel without being updated. For each pixel, a weighted average value of each pixel value of the three primary colors is obtained for the pixel and a pixel at a corresponding position of the (i−1) -th average image, and the obtained average values are obtained. By updating as a new pixel value, the i-th (i ≧ 2) reference image is created.

(2) 本発明の第2の態様は、上述した第1の態様に係る移動物体検出装置において、
平均画像作成部が、
最初の原画像P(1)が入力されたときに、当該原画像P(1)をそのまま最初の平均画像A(1)として平均画像格納部へ格納する処理を行い、
以後、第i番目の原画像P(i)が入力されるたびに(i=2,3,...)、第i番目の平均画像A(i)を、
a(i)=(1−w)・a(i−1)+w・p(i)
(但し、a(i)は、平均画像A(i)の
所定位置の画素の所定色の画素値、
a(i−1)は、平均画像A(i−1)の
所定位置の画素の所定色の画素値、
p(i)は、原画像P(i)の
所定位置の画素の所定色の画素値、
wは、所定の重みを示すパラメータ(w<1))
なる演算式を用いて作成するようにしたものである。
(2) According to a second aspect of the present invention, in the moving object detection device according to the first aspect described above,
The average image creation unit
When the first original image P (1) is input, the original image P (1) is stored in the average image storage unit as the first average image A (1) as it is,
Thereafter, every time the i-th original image P (i) is input (i = 2, 3,...), The i-th average image A (i) is
a (i) = (1-w) .a (i-1) + w.p (i)
(However, a (i) is the average image A (i)
A pixel value of a predetermined color of a pixel at a predetermined position,
a (i-1) is the average image A (i-1)
A pixel value of a predetermined color of a pixel at a predetermined position,
p (i) is the original image P (i)
A pixel value of a predetermined color of a pixel at a predetermined position,
w is a parameter indicating a predetermined weight (w <1))
It is made using the following arithmetic expression.

(3) 本発明の第3の態様は、上述した第2の態様に係る移動物体検出装置において、
参照画像作成部が、
最初の原画像P(1)が入力されたときに、当該原画像P(1)をそのまま最初の参照画像U(1)として参照画像格納部へ格納する処理を行い、
以後、第i番目の原画像P(i)が入力されるたびに(i=2,3,...)、第i番目の参照画像U(i)の各画素値を、
背景画素と判定された画素については、
u(i)=(1−v)・u(i−1)+v・a(i−1)
(但し、u(i)は、平均画像U(i)の
所定位置の画素の所定色の画素値、
u(i−1)は、平均画像U(i−1)の
所定位置の画素の所定色の画素値、
a(i−1)は、平均画像A(i−1)の
所定位置の画素の所定色の画素値、
vは、所定の重みを示すパラメータ(v<1))
なる演算式を用いて求められた画素値u(i)に更新し、
前景画素と判定された画素については、
u(i)=u(i−1)
として、更新せずに、もとの画素値をそのまま維持することにより決定するようにしたものである。
(3) According to a third aspect of the present invention, in the moving object detection device according to the second aspect described above,
The reference image creation unit
When the first original image P (1) is input, the original image P (1) is directly stored in the reference image storage unit as the first reference image U (1).
Thereafter, each time the i-th original image P (i) is input (i = 2, 3,...), The pixel values of the i-th reference image U (i) are
For pixels determined to be background pixels,
u (i) = (1-v) .u (i-1) + v.a (i-1)
(However, u (i) is the average image U (i)
A pixel value of a predetermined color of a pixel at a predetermined position,
u (i-1) is the average image U (i-1)
A pixel value of a predetermined color of a pixel at a predetermined position,
a (i-1) is the average image A (i-1)
A pixel value of a predetermined color of a pixel at a predetermined position,
v is a parameter indicating a predetermined weight (v <1))
Updated to the pixel value u (i) obtained using the following equation:
For pixels determined to be foreground pixels,
u (i) = u (i-1)
In this case, the original pixel value is maintained as it is without being updated.

(4) 本発明の第4の態様は、上述した第3の態様に係る移動物体検出装置において、
重みを示すパラメータw,vを、w>vとなるように設定したものである。
(4) According to a fourth aspect of the present invention, in the moving object detection device according to the third aspect described above,
Parameters w and v indicating weights are set so that w> v.

(5) 本発明の第5の態様は、上述した第2〜第4の態様に係る移動物体検出装置において、
パラメータ「w」もしくは「v」またはこれら双方を、ユーザの操作入力によって任意の値に設定するパラメータ設定部を更に備えるようにしたものである。
(5) According to a fifth aspect of the present invention, in the moving object detection device according to the second to fourth aspects described above,
The apparatus further includes a parameter setting unit that sets the parameter “w” or “v” or both to an arbitrary value by a user operation input.

(6) 本発明の第6の態様は、上述した第1〜第5の態様に係る移動物体検出装置において、
第1判定部および第2判定部が、比較対象となる一方の画素の画素値を基準画素値、他方の画素の画素値を比較画素値として、三原色の各画素値を各座標軸にとった三次元座標系において、基準画素値に対応する座標に位置する基準点Qと比較画素値に対応する座標に位置する比較点qをとり、基準点Qを中心とする所定サイズの基準立体と比較点qとの位置関係を調べ、比較点qが基準立体の外部に位置すると判定できる場合に非類似との判定を行い、内部に位置すると判定できる場合には類似との判定を行うようにしたものである。
(6) According to a sixth aspect of the present invention, in the moving object detection device according to the first to fifth aspects described above,
The first determination unit and the second determination unit use the pixel value of one pixel to be compared as a reference pixel value, the pixel value of the other pixel as a comparison pixel value, and a cubic that takes each pixel value of the three primary colors on each coordinate axis. In the original coordinate system, a reference point Q located at the coordinate corresponding to the reference pixel value and a comparison point q located at the coordinate corresponding to the comparison pixel value are taken, and a reference solid and a comparison point of a predetermined size centered on the reference point Q The positional relationship with q is examined, and when it can be determined that the comparison point q is located outside the reference solid, it is determined as dissimilar, and when it can be determined that it is located inside, it is determined as similar. It is.

(7) 本発明の第7の態様は、上述した第6の態様に係る移動物体検出装置において、
第1判定部が、原画像の画素の画素値を基準画素値、平均画像の画素の画素値を比較画素値として判定を行い、
第2判定部が、原画像の画素の画素値を基準画素値、参照画像の画素の画素値を比較画素値として判定を行うようにしたものである。
(7) According to a seventh aspect of the present invention, in the moving object detection device according to the sixth aspect described above,
The first determination unit determines the pixel value of the pixel of the original image as the reference pixel value, the pixel value of the pixel of the average image as the comparison pixel value,
The second determination unit performs determination using the pixel value of the pixel of the original image as the standard pixel value and the pixel value of the pixel of the reference image as the comparison pixel value.

(8) 本発明の第8の態様は、上述した第6または第7の態様に係る移動物体検出装置において、
第1判定部および第2判定部が、三次元座標系の原点Oと基準点Qとの距離Dに、所定のパラメータh(但し、h<1)を乗じて求まる値α=h・Dを長軸半径とし、所定のパラメータk(但し、k<h)を乗じて求まる値β=k・Dを短軸半径とする楕円を、原点Oと基準点Qとを結ぶ基準軸Z上に長軸が重なるように、かつ、基準点Qが中心点となるように配置し、この楕円を基準軸Zを中心に回転させることにより得られる同一の回転楕円体Eもしくはその近似体を基準立体として用いるようにしたものである。
(8) According to an eighth aspect of the present invention, in the moving object detection device according to the sixth or seventh aspect described above,
The first determination unit and the second determination unit obtain a value α = h · D obtained by multiplying the distance D between the origin O of the three-dimensional coordinate system and the reference point Q by a predetermined parameter h (where h <1). An ellipse having a long axis radius and a value β = k · D obtained by multiplying a predetermined parameter k (where k <h) as a short axis radius is long on the reference axis Z connecting the origin O and the reference point Q. The same spheroid E or its approximation obtained by rotating the ellipse around the reference axis Z as a reference solid is arranged so that the axes overlap and the reference point Q is the center point. It is intended to be used.

(9) 本発明の第9の態様は、上述した第8の態様に係る移動物体検出装置において、
第1判定部および第2判定部が、
「原点Oを中心とし半径(D−α)の球C1の内側に比較点qが位置する」もしくは「原点Oを中心とし半径(D+α)の球C2の外側に比較点qが位置する」という第1の条件を満足するか否かを判定する第1の条件判定部と、
第1の条件判定部が否定的判定を行った場合に「原点Oを頂点、基準軸Zを中心軸とし、回転楕円体Eと円で接する円錐ξもしくはその近似体の外側に比較点qが位置する」という第2の条件を満足するか否かを判定する第2の条件判定部と、
第2の条件判定部が否定的判定を行った場合に「回転楕円体Eの外側に比較点qが位置する」という第3の条件を満足するか否かを判定する第3の条件判定部と、
第1の条件判定部、第2の条件判定部、第3の条件判定部のいずれかが肯定的判定を行った場合に、非類似との判定結果を示す判定値を出力し、第1の条件判定部、第2の条件判定部、第3の条件判定部のすべてが否定的判定を行った場合に、類似との判定結果を示す判定値を出力する判定値出力部と、
を有するようにしたものである。
(9) According to a ninth aspect of the present invention, in the moving object detection device according to the eighth aspect described above,
The first determination unit and the second determination unit are
“The comparison point q is located inside the sphere C1 with the origin O as the center and the radius (D−α)” or “the comparison point q is located outside the sphere C2 with the origin O as the center and the radius (D + α)”. A first condition determining unit that determines whether or not the first condition is satisfied;
When the first condition determination unit makes a negative determination, “the comparison point q is outside the cone ξ or its approximated body that is in contact with the spheroid E with the origin O as the vertex and the reference axis Z as the central axis. A second condition determining unit that determines whether or not the second condition “located” is satisfied;
The third condition determining unit that determines whether or not the third condition “the comparison point q is located outside the spheroid E” is satisfied when the second condition determining unit makes a negative determination. When,
When any one of the first condition determination unit, the second condition determination unit, and the third condition determination unit makes a positive determination, a determination value indicating a determination result of dissimilarity is output, and the first A determination value output unit that outputs a determination value indicating a determination result of similarity when all of the condition determination unit, the second condition determination unit, and the third condition determination unit make a negative determination;
It is made to have.

(10) 本発明の第10の態様は、上述した第8の態様に係る移動物体検出装置において、
第1判定部および第2判定部が、
パラメータhおよびkの値を保持するパラメータ保持部と、
画素値読出部が読み出した基準画素値(R,G,B)および比較画素値(r,g,b)に基づいて、
=R+G+B および
=r+g+b
なる演算を行い、値Dおよび値dを算出する基本演算部と、
基本演算部が算出した値Dおよび値dとパラメータ保持部に保持されているパラメータhの値とを用いて、
(1−h)・D>d もしくは
(1+h)・D<d
という条件を満足するか否かを判定するための演算を行う第1の条件判定部と、
第1の条件判定部が否定的判定を行った場合に、画素値読出部が読み出した基準画素値(R,G,B)および比較画素値(r,g,b)に基づいて、
γ=R・r+G・g+B・b
なる演算を行い、値γを算出し、基本演算部が算出した値Dおよび値dとパラメータ保持部に保持されているパラメータkの値と値γとを用いて、
γ/(D・d)<(1−k/2)
という条件を満足するか否かを判定するための演算を行う第2の条件判定部と、
第2の条件判定部が否定的判定を行った場合に、基本演算部が算出した値Dおよび値dとパラメータ保持部に保持されているパラメータhおよびkの値と第2の条件判定部が算出した値γとを用いて、
α=h・D
β=k・D
=D+γ/D−2γ
=d−γ/D
なる演算を行い、当該演算結果を用いて、
β・x+α・y−α・β>0
という条件を満足するか否かを判定するための演算を行う第3の条件判定部と、
第1の条件判定部、第2の条件判定部、第3の条件判定部のいずれかが肯定的判定を行った場合に、非類似との判定結果を示す判定値を出力し、第1の条件判定部、第2の条件判定部、第3の条件判定部のすべてが否定的判定を行った場合に、類似との判定結果を示す判定値を出力する判定値出力部と、
を有するようにしたものである。
(10) According to a tenth aspect of the present invention, in the moving object detection device according to the eighth aspect described above,
The first determination unit and the second determination unit are
A parameter holding unit for holding values of parameters h and k;
Based on the reference pixel value (R, G, B) and the comparison pixel value (r, g, b) read by the pixel value reading unit,
D 2 = R 2 + G 2 + B 2 and
d 2 = r 2 + g 2 + b 2
A basic calculation unit for calculating the value D 2 and the value d 2 ,
By using the value of the parameter h to the basic computation unit is held at the value D 2 and the value d 2 and the parameter holding section calculated,
(1-h) 2 · D 2 > d 2 or
(1 + h) 2 · D 2 <d 2
A first condition determination unit that performs an operation for determining whether or not the condition is satisfied;
Based on the reference pixel value (R, G, B) and the comparison pixel value (r, g, b) read by the pixel value reading unit when the first condition determining unit makes a negative determination,
γ = R · r + G · g + B · b
To calculate the value γ, using the value D 2 and the value d 2 calculated by the basic calculation unit, the value of the parameter k held in the parameter holding unit, and the value γ,
γ 2 / (D 2 · d 2) <(1-k 2/2) 2
A second condition determination unit that performs an operation for determining whether or not the condition is satisfied,
If the second condition determination unit makes a negative determination, values and determining a second condition of parameters h and k basic operation unit is held at the value D 2 and the value d 2 and the parameter holding unit calculated Using the value γ calculated by the
α 2 = h 2 · D 2
β 2 = k 2 · D 2
x 2 = D 2 + γ 2 / D 2 -2γ
y 2 = d 2 −γ 2 / D 2
And using the calculation result,
β 2 · x 2 + α 2 · y 22 · β 2 > 0
A third condition determination unit that performs an operation for determining whether or not the condition is satisfied,
When any one of the first condition determination unit, the second condition determination unit, and the third condition determination unit makes a positive determination, a determination value indicating a determination result of dissimilarity is output, and the first A determination value output unit that outputs a determination value indicating a determination result of similarity when all of the condition determination unit, the second condition determination unit, and the third condition determination unit make a negative determination;
It is made to have.

(11) 本発明の第11の態様は、上述した第8〜第10の態様に係る移動物体検出装置において、
パラメータ「h」および「k」を、ユーザの操作入力によって任意の値に設定するパラメータ設定部を更に設けたものである。
(11) According to an eleventh aspect of the present invention, in the moving object detection device according to the eighth to tenth aspects described above,
A parameter setting unit is further provided for setting the parameters “h” and “k” to arbitrary values by a user operation input.

(12) 本発明の第12の態様は、上述した第1〜第11の態様に係る移動物体検出装置を、コンピュータにプログラムを組み込むことにより構成したものである。   (12) According to a twelfth aspect of the present invention, the moving object detection apparatus according to the first to eleventh aspects described above is configured by incorporating a program into a computer.

(13) 本発明の第13の態様は、上述した第1〜第11の態様に係る移動物体検出装置を、半導体集積回路によって構成したものである。   (13) In a thirteenth aspect of the present invention, the moving object detection device according to the first to eleventh aspects described above is configured by a semiconductor integrated circuit.

(14) 本発明の第14の態様は、動画画像について移動物体を検出する移動物体検出方法において、
コンピュータが、時系列で連続的に与えられるフレーム単位のカラー原画像を、三原色の各画素値を有する画素の集合体データとして入力する画像入力段階と、
コンピュータが、新たな原画像が入力されるたびに、当該新たな原画像と直前に作成した平均画像とに基づいて、新たな平均画像を作成する平均画像作成段階と、
コンピュータが、新たな原画像が入力されるたびに、当該新たな原画像と直前に作成した参照画像とに基づいて、新たな参照画像を作成する参照画像作成段階と、
コンピュータが、原画像と平均画像と参照画像とを用いた比較処理により、前景領域と背景領域とを区別するマスク画像を作成する画像比較段階と、
コンピュータが、マスク画像を出力する画像出力段階と、
を行い、
画像比較段階を、
第i番目の原画像、第(i−1)番目の平均画像、第(i−1)番目の参照画像から、それぞれ対応する所定位置にある画素の三原色の各画素値を読み出す画素値読出ステップと、
第i番目の原画像を構成する画素の画素値p(i)と第(i−1)番目の平均画像を構成する画素の画素値a(i−1)とが類似するか否かを判定する第1判定処理と、第i番目の原画像を構成する画素の画素値p(i)と第(i−1)番目の参照画像を構成する画素の画素値u(i−1)とが類似するか否かを判定する第2判定処理と、を行い、第i番目の原画像の所定位置にある画素について、第1判定処理による判定結果と第2判定処理による判定結果との少なくとも一方が類似を示す場合には背景画素、双方とも非類似を示す場合には前景画素との判定を行う前背判定ステップと、
第i番目のマスク画像を構成する所定位置の画素の画素値として、前背判定ステップにより背景画素と判定された場合には背景領域を示す画素値を、前背判定ステップにより前景画素と判定された場合には前景領域を示す画素値を、それぞれ与えることにより、第i番目のマスク画像を作成するマスク画像作成ステップと、
によって構成し、
平均画像作成段階では、第1番目の原画像をそのまま第1番目の平均画像とし、第i番目(i≧2)の平均画像を作成する際には、第i番目の原画像と第(i−1)番目の平均画像とについて、互いに対応する位置にある画素の三原色の各画素値の重みつき平均値をそれぞれ求め、得られた各平均値を各画素値とする画素の集合からなる画像を第i番目の平均画像とし、
参照画像作成段階では、第1番目の原画像をそのまま第1番目の参照画像とし、第i番目(i≧2)の参照画像を作成する際には、第(i−1)番目の参照画像を構成する個々の画素のうち、前背判定ステップにおいて第i番目の原画像の対応画素が前景画素と判定された画素については、更新せずに、もとの画素値をそのまま維持し、前背判定ステップにおいて第i番目の原画像の対応画素が背景画素と判定された画素については、第(i−1)番目の平均画像の対応する位置にある画素との間で、三原色の各画素値の重みつき平均値をそれぞれ求め、得られた各平均値を新画素値として更新することにより、第i番目の参照画像を作成するようにしたものである。
(14) According to a fourteenth aspect of the present invention, in the moving object detection method for detecting a moving object for a moving image,
An image input stage in which a computer inputs a color original image in units of frames continuously given in time series as aggregate data of pixels having pixel values of three primary colors;
An average image creation stage for creating a new average image based on the new original image and the average image just created each time a new original image is input;
A reference image creation stage in which a computer creates a new reference image based on the new original image and the reference image created immediately before each new original image is input;
An image comparison stage in which a computer creates a mask image that distinguishes a foreground area and a background area by a comparison process using an original image, an average image, and a reference image;
An image output stage in which a computer outputs a mask image;
And
The image comparison stage
A pixel value reading step of reading out pixel values of the three primary colors of the pixels at the corresponding predetermined positions from the i-th original image, the (i-1) -th average image, and the (i-1) -th reference image, respectively. When,
It is determined whether the pixel value p (i) of the pixels constituting the i-th original image is similar to the pixel value a (i-1) of the pixels constituting the (i-1) -th average image. And the pixel value p (i) of the pixel constituting the i-th original image and the pixel value u (i-1) of the pixel constituting the (i-1) -th reference image. And a second determination process for determining whether or not they are similar, and at least one of a determination result by the first determination process and a determination result by the second determination process for a pixel at a predetermined position of the i-th original image A foreground determination step of determining a background pixel when both indicate dissimilarity and a foreground pixel when both indicate dissimilarity;
As a pixel value of a pixel at a predetermined position constituting the i-th mask image, when it is determined as a background pixel by the foreground determination step, a pixel value indicating a background region is determined as a foreground pixel by the foreground determination step. A mask image creating step for creating an i-th mask image by giving a pixel value indicating a foreground area in each case,
Composed by
In the average image creation stage, the first original image is directly used as the first average image, and when the i-th (i ≧ 2) average image is created, the i-th original image and the (i -1) An image composed of a set of pixels each having a weighted average value of each pixel value of the three primary colors of pixels located at positions corresponding to each other with respect to the first average image, and each obtained average value being each pixel value Is the i-th average image,
In the reference image creation stage, the first original image is used as it is as the first reference image, and when the i-th (i ≧ 2) reference image is created, the (i−1) -th reference image is created. Among the individual pixels constituting the pixel, the pixel for which the corresponding pixel of the i-th original image is determined to be the foreground pixel in the foreground determination step is not updated and the original pixel value is maintained as it is. With respect to the pixel for which the corresponding pixel of the i-th original image is determined as the background pixel in the spine determination step, each pixel of the three primary colors with the pixel at the corresponding position of the (i-1) -th average image. The i-th reference image is created by obtaining each weighted average value and updating each obtained average value as a new pixel value.

(15) 本発明の第15の態様は、上述した第14の態様に係る移動物体検出方法において、
平均画像作成段階では、
最初の原画像P(1)が入力されたときに、当該原画像P(1)をそのまま最初の平均画像A(1)とする処理を行い、
以後、第i番目の原画像P(i)が入力されるたびに(i=2,3,...)、第i番目の平均画像A(i)を、
a(i)=(1−w)・a(i−1)+w・p(i)
(但し、a(i)は、平均画像A(i)の
所定位置の画素の所定色の画素値、
a(i−1)は、平均画像A(i−1)の
所定位置の画素の所定色の画素値、
p(i)は、原画像P(i)の
所定位置の画素の所定色の画素値、
wは、所定の重みを示すパラメータ(w<1))
なる演算式を用いて作成し、
参照画像作成段階では、
最初の原画像P(1)が入力されたときに、当該原画像P(1)をそのまま最初の参照画像U(1)とする処理を行い、
以後、第i番目の原画像P(i)が入力されるたびに(i=2,3,...)、第i番目の参照画像U(i)の各画素値を、
背景画素と判定された画素については、
u(i)=(1−v)・u(i−1)+v・a(i−1)
(但し、u(i)は、平均画像U(i)の
所定位置の画素の所定色の画素値、
u(i−1)は、平均画像U(i−1)の
所定位置の画素の所定色の画素値、
a(i−1)は、平均画像A(i−1)の
所定位置の画素の所定色の画素値、
vは、所定の重みを示すパラメータ(v<1、かつw>v))
なる演算式を用いて求められた画素値u(i)に更新し、
前景画素と判定された画素については、
u(i)=u(i−1)
として、更新せずに、もとの画素値をそのまま維持することにより、参照画像U(i)を作成するようにしたものである。
(15) According to a fifteenth aspect of the present invention, in the moving object detection method according to the fourteenth aspect described above,
In the average image creation stage,
When the first original image P (1) is input, the original image P (1) is processed as it is as the first average image A (1).
Thereafter, every time the i-th original image P (i) is input (i = 2, 3,...), The i-th average image A (i) is
a (i) = (1-w) .a (i-1) + w.p (i)
(However, a (i) is the average image A (i)
A pixel value of a predetermined color of a pixel at a predetermined position,
a (i-1) is the average image A (i-1)
A pixel value of a predetermined color of a pixel at a predetermined position,
p (i) is the original image P (i)
A pixel value of a predetermined color of a pixel at a predetermined position,
w is a parameter indicating a predetermined weight (w <1))
Created using the following formula:
In the reference image creation stage,
When the first original image P (1) is input, the original image P (1) is processed as the first reference image U (1) as it is,
Thereafter, each time the i-th original image P (i) is input (i = 2, 3,...), The pixel values of the i-th reference image U (i) are
For pixels determined to be background pixels,
u (i) = (1-v) .u (i-1) + v.a (i-1)
(However, u (i) is the average image U (i)
A pixel value of a predetermined color of a pixel at a predetermined position,
u (i-1) is the average image U (i-1)
A pixel value of a predetermined color of a pixel at a predetermined position,
a (i-1) is the average image A (i-1)
A pixel value of a predetermined color of a pixel at a predetermined position,
v is a parameter indicating a predetermined weight (v <1, and w> v))
Updated to the pixel value u (i) obtained using the following equation:
For pixels determined to be foreground pixels,
u (i) = u (i-1)
As described above, the reference image U (i) is created by maintaining the original pixel value as it is without updating.

本発明に係る移動物体検出装置では、過去に入力された複数の原画像の平均的な特徴を有する平均画像が逐次作成され、更に、この平均画像に基づいて参照画像が逐次作成される。そして、新たに入力された原画像は、平均画像と比較されるとともに参照画像とも比較され、両方の比較結果がともに非類似とされた領域が前景領域(移動物体の領域)、それ以外の領域が背景領域と判定される。ここで、平均画像は、新たな原画像が入力されるたびに更新されるため、原画像の変化に追随して変化を遂げる動的画像になる。これに対して、参照画像は、背景領域と判定された部分に対しては平均画像を利用した更新が行われるが、前景領域と判定された部分に対しては更新が行われない。このため、原画像の変化に追随した参照画像の変化は緩慢になる。   In the moving object detection device according to the present invention, an average image having an average characteristic of a plurality of original images input in the past is sequentially created, and further, a reference image is sequentially created based on the average image. The newly input original image is compared with the average image and also with the reference image, the region where both comparison results are dissimilar is the foreground region (moving object region), and the other regions Is determined to be the background area. Here, since the average image is updated every time a new original image is input, the average image becomes a dynamic image that changes following the change of the original image. In contrast, the reference image is updated using the average image for the portion determined to be the background region, but is not updated for the portion determined to be the foreground region. For this reason, the change of the reference image following the change of the original image becomes slow.

このように、平均画像と参照画像とは、原画像の変化に対する追随態様が互いに異なっており、しかも、新たに入力された原画像のうち、平均画像および参照画像の少なくとも一方に類似している領域は背景領域と判定されることになる。したがって、日照変化などの自然現象に起因して変化した背景領域が前景領域(移動物体の領域)として誤検出される可能性を低減することができ、より正確な検出を行うことができるようになる。しかも、実質的には、新たな原画像が入力されるたびに、新たな平均画像および参照画像を作成する処理と、上述した各比較処理と、を行えばよいため、演算処理の負担も比較的軽いものになる。   As described above, the average image and the reference image have different tracking modes with respect to the change in the original image, and are similar to at least one of the average image and the reference image among the newly input original images. The area is determined as the background area. Therefore, it is possible to reduce the possibility that a background area changed due to a natural phenomenon such as sunshine change is erroneously detected as a foreground area (moving object area), and to perform more accurate detection. Become. In addition, each time a new original image is input, the process of creating a new average image and reference image and the above-described comparison processes need only be performed. Lighter.

また、回転楕円体を用いて画素の類否判定を行う実施形態の場合、三次元色空間上において、一方の画素値をプロットした座標点を中心とする回転楕円体内に、他方の画素値をプロットした座標点が入るか否かに基づいて、比較対象となるカラー画素の類否判定を行うようにしたため、演算処理の負担を大幅に軽減することが可能になる。   Further, in the embodiment in which the similarity of pixels is determined using a spheroid, in the three-dimensional color space, the other pixel value is placed in a spheroid centered on a coordinate point where one pixel value is plotted. Since the similarity determination of the color pixel to be compared is performed based on whether or not the plotted coordinate points are included, it is possible to greatly reduce the burden of calculation processing.

動画画像についての移動物体の検出例を示す平面図である。It is a top view which shows the example of a detection of the moving object about a moving image. 一般的な移動物体検出の基本原理を示す図である。It is a figure which shows the basic principle of a general moving object detection. 背景を示す画像として用いられる平均画像の作成方法の一例を示す図である。It is a figure which shows an example of the production method of the average image used as an image which shows a background. 図3に示す方法に基づいて作成される平均画像上の1画素の画素値変遷プロセスを示す図である。It is a figure which shows the pixel value transition process of 1 pixel on the average image produced based on the method shown in FIG. 一般的なマスク画像の画素値決定プロセスを示す図である。It is a figure which shows the pixel value determination process of a general mask image. 画素の類否判定方法の一般例を示す三次元色空間図である。It is a three-dimensional color space figure which shows the general example of the similarity determination method of a pixel. 画素の類否判定方法の別な一般例を示す三次元色空間図である。It is a three-dimensional color space figure which shows another general example of the similarity determination method of a pixel. 従来提案されている移動物体検出装置の基本構成を示すブロック図である。It is a block diagram which shows the basic composition of the moving object detection apparatus proposed conventionally. 本発明に係る移動物体検出装置の基本構成を示すブロック図である。It is a block diagram which shows the basic composition of the moving object detection apparatus which concerns on this invention. 図9に示す移動物体検出装置の各構成要素で実行される演算内容を示す図である。It is a figure which shows the content of the calculation performed by each component of the moving object detection apparatus shown in FIG. 図9に示す移動物体検出装置における各画像の変遷を示す第1の図である。FIG. 10 is a first diagram illustrating transition of each image in the moving object detection device illustrated in FIG. 9. 図9に示す移動物体検出装置における各画像の変遷を示す第2の図である。FIG. 10 is a second diagram illustrating the transition of each image in the moving object detection device illustrated in FIG. 9. 本発明の一実施形態に係る移動物体検出に利用するための画素の類否判定方法の第1の適用例を示す三次元色空間図である。It is a three-dimensional color space diagram showing a first application example of a pixel similarity determination method for use in moving object detection according to an embodiment of the present invention. 本発明の一実施形態に係る移動物体検出に利用するための画素の類否判定方法の第2の適用例を示す三次元色空間図である。It is a three-dimensional color space diagram showing a second application example of a pixel similarity determination method for use in moving object detection according to an embodiment of the present invention. 本発明の一実施形態に係る画素の類否判定方法を示す三次元色空間図である。FIG. 3 is a three-dimensional color space diagram illustrating a pixel similarity determination method according to an embodiment of the present invention. 従来の円柱モデルに対する回転楕円体モデルの利点を示す断面図である。It is sectional drawing which shows the advantage of the spheroid model with respect to the conventional cylinder model. 回転楕円体モデルを用いた場合の第1の条件判定原理を示す断面図である。It is sectional drawing which shows the 1st condition determination principle at the time of using a spheroid model. 図17に示す第1の条件判定原理に基づく判定式を示す図である。It is a figure which shows the determination formula based on the 1st condition determination principle shown in FIG. 回転楕円体モデルを用いた場合の第2の条件判定原理を示す断面図である。It is sectional drawing which shows the 2nd condition determination principle at the time of using a spheroid model. 図19に示す第2の条件判定原理に基づく判定式を導く第1のプロセスを示す図である。FIG. 20 is a diagram illustrating a first process for deriving a determination formula based on the second condition determination principle illustrated in FIG. 19. 図19に示す第2の条件判定原理に基づく判定式を導く第2のプロセスを示す図である。FIG. 20 is a diagram showing a second process for deriving a determination formula based on the second condition determination principle shown in FIG. 19. 図19に示す第2の条件判定原理に基づく判定式を示す図である。It is a figure which shows the determination type | formula based on the 2nd condition determination principle shown in FIG. 回転楕円体モデルを用いた場合の第3の条件判定原理を示す断面図である。It is sectional drawing which shows the 3rd condition determination principle at the time of using a spheroid model. 図23に示す第3の条件判定原理に基づく判定式を示す図である。It is a figure which shows the determination formula based on the 3rd condition determination principle shown in FIG. 本発明の一実施形態に係る画素の類否判定方法の実用的な手順を示す流れ図である。It is a flowchart which shows the practical procedure of the similarity determination method of the pixel which concerns on one Embodiment of this invention. 図9に示す移動物体検出装置における前背判定部450の構成を示すブロック図である。It is a block diagram which shows the structure of the forefront determination part 450 in the moving object detection apparatus shown in FIG. 図26に示す第1判定部420の詳細構成を示すブロック図である。It is a block diagram which shows the detailed structure of the 1st determination part 420 shown in FIG.

以下、本発明を図示する実施形態に基づいて説明する。   Hereinafter, the present invention will be described based on the illustrated embodiments.

<<< §1.一般的な移動物体検出の基本原理 >>>
はじめに、一般的な移動物体検出の基本原理を説明する。この基本原理は、動画画像について移動物体を検出するためのものであり、三原色の各画素値を有する画素の集合体として、時系列で連続的にフレーム単位のカラー画像が与えられることを前提としている。
<<< §1. Basic principle of general moving object detection >>
First, the basic principle of general moving object detection will be described. This basic principle is for detecting a moving object in a moving image, and it is assumed that a color image in units of frames is given continuously in time series as a collection of pixels having pixel values of three primary colors. Yes.

たとえば、図1の左側に示すように、フレーム単位の画像P10,P20,P30,P40がこの順番で与えられたものとしよう。図示の例は、街頭に設置された定点ビデオカメラによる撮影画像を示すものであり、右から左へと1台の車両(移動物体)が通過する状態が示されている。なお、一般的なビデオカメラの場合、1秒間に30フレーム程度の周期で連続して撮影画像が出力されるので、実際には、より細かな時間間隔で多数のフレーム画像が得られることになるが、ここでは、説明の便宜上、図示のとおり、4枚のフレーム画像P10,P20,P30,P40が順番に与えられたものとしよう。   For example, assume that images P10, P20, P30, and P40 in units of frames are given in this order as shown on the left side of FIG. The illustrated example shows a photographed image by a fixed-point video camera installed on the street, and shows a state in which one vehicle (moving object) passes from right to left. Note that in the case of a general video camera, captured images are output continuously at a cycle of about 30 frames per second, so in practice, a large number of frame images can be obtained at finer time intervals. However, for convenience of explanation, it is assumed that four frame images P10, P20, P30, and P40 are given in order as shown in the figure.

これら4枚の画像を見ると、画像P10は街の背景のみであるが、画像P20では、右側に車両の一部が侵入したため、背景上に車両の一部が重なった画像になっている。同様に、画像P30,P40も、背景上に車両が重なった画像になっている。背景は静止しているため、画像P10〜P40について共通になるが、車両は移動物体であるため、画像P10〜P40では異なる。ここでは、各画像上において、背景を構成する領域を背景領域B、車両(移動物体)を構成する領域を前景領域Fと呼ぶことにする。   Looking at these four images, the image P10 is only the background of the city, but in the image P20, since a part of the vehicle has entered the right side, the image is a part of the vehicle overlapped on the background. Similarly, the images P30 and P40 are images in which vehicles overlap on the background. Since the background is stationary, it is common for the images P10 to P40. However, since the vehicle is a moving object, the images P10 to P40 are different. Here, on each image, the area constituting the background is referred to as the background area B, and the area constituting the vehicle (moving object) is referred to as the foreground area F.

本発明における移動物体検出の目的は、与えられた各画像P10〜P40について、それぞれ背景領域Bと前景領域Fとを区別することにある。図1の右側に示す各画像M10〜M40は、それぞれ左側に示す各画像P10〜P40について、背景領域Bと前景領域Fとの区別を示す画像である。図にハッチングを施した領域が背景領域Bであり、白地の領域が前景領域Fである。いずれの領域かを識別できればよいので、これらの画像M10〜M40は、二値画像として与えられる。たとえば、背景領域Bに所属する画素には画素値「1」を与え、前景領域Fに所属する画素には画素値「0」を与えることにすれば、画像M10〜M40は、1ビットの画素値をもった画素の集合体からなる画像データとして用意することができる。   The object of the moving object detection in the present invention is to distinguish the background area B and the foreground area F from each of the given images P10 to P40. The images M10 to M40 shown on the right side of FIG. 1 are images showing the distinction between the background region B and the foreground region F with respect to the images P10 to P40 shown on the left side, respectively. The hatched area in the figure is the background area B, and the white area is the foreground area F. Since it is only necessary to identify which region, these images M10 to M40 are given as binary images. For example, if the pixel value “1” is given to the pixels belonging to the background area B and the pixel value “0” is given to the pixels belonging to the foreground area F, the images M10 to M40 are 1-bit pixels. It can be prepared as image data consisting of a collection of pixels having values.

本発明によれば、与えられた個々のフレーム画像のそれぞれについて、対応する二値画像を作成することができる。結局、本発明に係る移動物体検出処理の本質は、時系列で連続的に与えられた個々のカラー画像について、それぞれ背景領域Bと前景領域Fとの区別を示す二値画像を作成する処理ということができる。そこで、以下、便宜上、時系列で連続的に与えられるカラー画像を「原画像」と呼び、この「原画像」に基づいて作成される二値画像を「マスク画像」と呼ぶことにする。   According to the present invention, a corresponding binary image can be created for each given frame image. After all, the essence of the moving object detection process according to the present invention is a process of creating a binary image indicating the distinction between the background area B and the foreground area F for each color image continuously given in time series. be able to. Therefore, hereinafter, for convenience, a color image continuously given in time series is referred to as an “original image”, and a binary image created based on the “original image” is referred to as a “mask image”.

図1に示す例では、各原画像P10〜P40のそれぞれについて、マスク画像M10〜M40が作成された例が示されている。これらマスク画像を利用すれば、原画像上のどの領域が移動物体であるかを認識できるので、移動物体の形状やサイズを把握したり、移動物体の部分をズームアップして、車両のナンバーを確認したり、人物を特定したりする処理を行うことが可能になる。また、画面上で移動物体をズームアップしたまま追跡したり、移動経路を把握したりすることも可能になる。   In the example shown in FIG. 1, an example in which mask images M10 to M40 are created for each of the original images P10 to P40 is shown. By using these mask images, it is possible to recognize which area on the original image is a moving object, so you can grasp the shape and size of the moving object, zoom up the moving object part, and set the vehicle number. It is possible to perform processing for confirming or specifying a person. In addition, it is possible to track a moving object on the screen while zooming up, or to grasp a moving path.

もちろん、このようなマスク画像の作成を、1枚の原画像のみから行うことは困難である。たとえば、図示の原画像P20のみが静止画像として与えられた場合、人間の脳は様々な情報から車両の存在を認識することができるが、この1枚の静止画像のみから、コンピュータに車両の存在を認識させるには、複雑なアルゴリズムに基づく処理が必要となる。そこで、一般的な移動物体検出アルゴリズムでは、既に述べたとおり、入力画像と背景画像との差を求めることにより、当該差の領域を移動物体の領域(前景領域F)と判断する手法が採られる。   Of course, it is difficult to create such a mask image from only one original image. For example, when only the illustrated original image P20 is given as a still image, the human brain can recognize the presence of the vehicle from various information, but the presence of the vehicle is detected by the computer from only this one still image. In order to recognize this, processing based on a complicated algorithm is required. Therefore, as described above, a general moving object detection algorithm employs a method of determining a difference area between the input image and the background image and determining the difference area as a moving object area (foreground area F). .

たとえば、予め原画像P10を背景画像として指定しておけば、原画像P20が入力された時点で両者を比較することにより、差の領域(異なる領域)を前景領域Fと認識し、図示のようなマスク画像M20を作成することが可能になる。差の領域の認識手法としては、前述したとおり、小領域単位で画素値の統計処理を施す方法も知られているが、入力画像と背景画像とを画素単位で比較して、両画素の画素値が類似している場合、当該画素は背景領域Bを構成する画素であるとし、類似していない場合、当該画素は移動物体を構成する前景領域Fを構成する画素であるとする方法が最も簡便な方法である。本発明も、このような画素単位での比較手法を採用することを前提としている。   For example, if the original image P10 is designated as a background image in advance, the difference area (different area) is recognized as the foreground area F by comparing the two when the original image P20 is input, as shown in the figure. A mask image M20 can be created. As described above, as a method for recognizing a difference region, a method of performing statistical processing of pixel values in units of small regions is also known. However, by comparing the input image and the background image in units of pixels, the pixels of both pixels are compared. When the values are similar, it is assumed that the pixel is a pixel constituting the background region B, and when the values are not similar, it is most preferable that the pixel is a pixel constituting the foreground region F constituting the moving object. It is a simple method. The present invention is also premised on adopting such a pixel-by-pixel comparison method.

背景画像としては、予め移動物体が存在しない状態(たとえば、画像P10に示す状態)で撮影した静止画像を利用することも可能であるが、天候や時刻などの要因により、照明環境は時々刻々と変化してゆくものであり、ある特定の時点で撮影した静止画像をそのまま背景画像として継続して利用するのは不適切である。そこで、通常は、過去に入力された複数の原画像に基づいて、これら原画像の平均的な特徴を有する平均画像を作成し、この平均画像を背景画像として利用する手法が採られる。本発明でも、基本的には、このような手法で得られた平均画像を、背景画像として利用することになる。平均画像は新たな画像が入力されるたびに逐次更新されるので、天候や時刻などの要因により、照明環境が変化したとしても、当該変化に追随した適切な背景画像として機能する。   As a background image, it is possible to use a still image that has been captured in a state in which no moving object exists in advance (for example, the state shown in the image P10). However, due to factors such as weather and time, the lighting environment is constantly changing. Since it changes, it is inappropriate to continue to use a still image taken at a specific time point as a background image. Therefore, usually, a method is employed in which an average image having an average characteristic of these original images is created based on a plurality of original images input in the past, and this average image is used as a background image. In the present invention, basically, an average image obtained by such a method is used as a background image. Since the average image is sequentially updated each time a new image is input, even if the lighting environment changes due to factors such as weather and time, the average image functions as an appropriate background image following the change.

図2は、一般的な移動物体検出の基本原理を示す図である。ここで、図の上段に示す画像P(1),P(2),... ,P(i−2),P(i−1)は、時系列で連続的に与えられるフレーム単位の原画像であり、これまでに第1番目の原画像P(1)から第(i−1)番目の原画像P(i−1)まで、(i−1)フレーム分の画像が与えられた状態が示されている。一方、図の中段左に示す画像P(i)は、新たに与えられた第i番目の原画像であり、図の中段右に示す画像A(i−1)は、図の上段に示す過去に与えられた(i−1)フレーム分の原画像P(1)〜P(i−1)の平均的な特徴を有する平均画像である。   FIG. 2 is a diagram showing the basic principle of general moving object detection. Here, the images P (1), P (2),..., P (i-2), P (i-1) shown in the upper part of the figure are frame-unit originals that are continuously given in time series. A state in which images for (i-1) frames from the first original image P (1) to the (i-1) th original image P (i-1) have been given so far It is shown. On the other hand, the image P (i) shown on the left in the middle of the figure is the i-th original image newly given, and the image A (i-1) shown on the right in the middle of the figure is the past shown in the upper part of the figure. Is an average image having average characteristics of the original images P (1) to P (i-1) for (i-1) frames.

新たに入力された原画像P(i)についてのマスク画像M(i)は、当該原画像P(i)と平均画像A(i−1)とを比較することによって作成される。図2の下段は、このようにして作成されたマスク画像M(i)を示すものである。具体的には、原画像P(i)上の各画素の画素値を、平均画像A(i−1)上の対応する画素の画素値と比較し、類似範囲内と判定された画素については背景領域Bを示す画素値(たとえば、「1」)を与え、類似範囲外と判定された画素については前景領域Fを示す画素値(たとえば、「0」)を与えることにより、二値画像からなるマスク画像M(i)を作成すればよい。   The mask image M (i) for the newly input original image P (i) is created by comparing the original image P (i) with the average image A (i-1). The lower part of FIG. 2 shows the mask image M (i) created in this way. Specifically, the pixel value of each pixel on the original image P (i) is compared with the pixel value of the corresponding pixel on the average image A (i−1). A pixel value (for example, “1”) indicating the background region B is given, and a pixel value (for example, “0”) showing the foreground region F is given to the pixels determined to be out of the similar range, thereby obtaining a binary image. A mask image M (i) that is

続いて、第(i+1)番目の原画像P(i+1)が入力されたときには、過去に入力された第i番目の原画像P(i)までの平均的な特徴を有する平均画像A(i)が新たに作成され、原画像P(i+1)と平均画像A(i)とを比較することにより、マスク画像M(i+1)が作成される。このように、平均画像は逐次更新されてゆくため、天候や時刻などの要因により、照明環境が変化した場合でも、各時点に適した背景画像としての機能を果たすことができる。   Subsequently, when the (i + 1) -th original image P (i + 1) is input, the average image A (i) having an average feature up to the i-th original image P (i) input in the past. Are newly created, and the mask image M (i + 1) is created by comparing the original image P (i + 1) and the average image A (i). In this way, since the average image is sequentially updated, even if the lighting environment changes due to factors such as weather and time, it can function as a background image suitable for each time point.

なお、平均画像を作成する際には、時系列に沿った重みづけを行うようにし、最新の原画像の情報に重みをおいた加重平均を求めるようにするのが好ましい。たとえば、過去10分間に入力された原画像について重み1、それ以前に入力された原画像について重み0を与えて平均を求めれば、常に、最新10分間に得られた原画像についての平均画像を得ることができ、照明環境が変化した場合にも対応することができる。もちろん、常に最新の原画像ほど重みづけが大きくなるように、重みづけをきめ細かく設定することもできる。   Note that when creating an average image, it is preferable to perform weighting along a time series, and obtain a weighted average with the latest original image information weighted. For example, if an average is obtained by giving a weight of 1 for an original image input in the past 10 minutes and a weight of 0 for an original image input before that, an average image for the original image obtained in the latest 10 minutes is always obtained. It can be obtained and can cope with a change in the lighting environment. Of course, the weights can be set finely so that the latest original image always has a higher weight.

結局、この図2に示す例の場合、平均画像を作成する際には、第i番目の原画像P(i)が入力されたときに(i=1,2,...)、当該原画像P(i)を含めた過去の原画像について、それぞれ対応する位置の画素の各色別の画素値の重みづけ平均値を算出し、当該平均値をもつ画素の集合体からなる第i番目の平均画像A(i)を作成すればよい。そして、第(i+1)番目の原画像P(i+1)が入力されたときには、第(i+1)番目のマスク画像M(i+1)を作成するために、原画像P(i+1)と、第i番目の平均画像A(i)とを比較すればよい。   After all, in the case of the example shown in FIG. 2, when creating the average image, when the i-th original image P (i) is input (i = 1, 2,...), For the past original image including the image P (i), the weighted average value of the pixel values for each color of the pixels at the corresponding positions is calculated, and the i-th pixel composed of a collection of pixels having the average value. An average image A (i) may be created. Then, when the (i + 1) th original image P (i + 1) is input, in order to create the (i + 1) th mask image M (i + 1), the original image P (i + 1) and the i th The average image A (i) may be compared.

ただ、1秒間に30フレームという一般的なフレームレートで動画画像が入力された場合、過去10分間の原画像であっても、その画像データをすべて蓄積しておくには、画像データのバッファにかなりの記憶容量が必要になる。そこで、実用上は、第i番目の原画像P(i)が与えられたときに、第(i−1)番目の平均画像A(i−1)と、当該第i番目の原画像P(i)との2枚の画像に基づいて、第i番目の平均画像A(i)を作成する手法が採られる。図3は、このような手法に基づく平均画像の作成方法の一例を示す図である。   However, if a moving image is input at a general frame rate of 30 frames per second, even if it is an original image for the past 10 minutes, in order to store all the image data, the image data buffer Considerable storage capacity is required. Therefore, practically, when the i-th original image P (i) is given, the (i−1) -th average image A (i−1) and the i-th original image P ( Based on the two images i), a method of creating the i-th average image A (i) is adopted. FIG. 3 is a diagram illustrating an example of an average image creation method based on such a method.

まず、最初の原画像P(1)が与えられたときには、当該原画像P(1)をそのまま最初の平均画像A(1)とする処理を行う。そして、以後、図3の上段右に示す第i番目の原画像P(i)が入力されるたびに(i=2,3,...)、図3の上段左に示す第(i−1)番目の平均画像A(i−1)を利用して、図3の中段に示す第i番目の平均画像A(i)を、図3の下段に示す
a(i)=(1−w)・a(i−1)+w・p(i) 式(1)
なる演算式を用いて作成すればよい。ここで、a(i)は、平均画像A(i)の所定位置の画素の所定色の画素値、a(i−1)は、平均画像A(i−1)の前記所定位置の画素の前記所定色の画素値、p(i)は、原画像P(i)の前記所定位置の画素の前記所定色の画素値、wは、所定の重みを示すパラメータ(w<1)である。
First, when the first original image P (1) is given, the original image P (1) is processed as it is as the first average image A (1). Then, every time the i-th original image P (i) shown in the upper right of FIG. 3 is inputted (i = 2, 3,...), The (i−) shown in the upper left of FIG. 1) The i-th average image A (i) shown in the middle part of FIG. 3 is shown in the lower part of FIG.
a (i) = (1-w) .a (i-1) + w.p (i) Formula (1)
It may be created using the following arithmetic expression. Here, a (i) is a pixel value of a predetermined color of a pixel at a predetermined position of the average image A (i), and a (i-1) is a pixel value of the pixel at the predetermined position of the average image A (i-1). The pixel value of the predetermined color, p (i) is the pixel value of the predetermined color of the pixel at the predetermined position of the original image P (i), and w is a parameter (w <1) indicating a predetermined weight.

要するに、直前に与えられた原画像P(i−1)までの原画像について算出された第(i−1)番目の平均画像A(i−1)の画素値a(i−1)と、新たに与えられた第i番目の原画像P(i)の画素値p(i)とについて、重みwを考慮した平均値が算出され、当該算出値を第i番目の平均画像A(i)の画素値a(i)とする処理が行われることになる。このように、新たな原画像P(i)が入力されるたびに、平均画像A(i)を更新してゆき、しかも更新には直前の平均画像A(i−1)のみを用いるようにすれば、過去の原画像データを何フレーム分にもわたって蓄積保持しておく必要がないので、処理を行うために必要なバッファの容量を大幅に節約することができる。   In short, the pixel value a (i−1) of the (i−1) -th average image A (i−1) calculated for the original image up to the original image P (i−1) given immediately before, For the pixel value p (i) of the i-th original image P (i) that is newly given, an average value considering the weight w is calculated, and the calculated value is used as the i-th average image A (i). The process of setting the pixel value a (i) is performed. Thus, every time a new original image P (i) is input, the average image A (i) is updated, and only the immediately preceding average image A (i-1) is used for the update. By doing so, it is not necessary to store and hold past original image data for several frames, so that it is possible to greatly save the capacity of the buffer necessary for processing.

図3に示すとおり、重みwの値を大きくすればするほど、最新の原画像P(i)の画素値が平均画像A(i)の画素値に大きな影響を与えることになる。図4は、図3に示す方法に基づいて作成される平均画像上の1画素の画素値変遷プロセスを示す図である。この例では、重みw=0.01に設定した具体例が示されている。   As shown in FIG. 3, as the value of the weight w is increased, the pixel value of the latest original image P (i) greatly affects the pixel value of the average image A (i). FIG. 4 is a diagram showing a pixel value transition process of one pixel on the average image created based on the method shown in FIG. In this example, a specific example in which the weight w = 0.01 is shown.

たとえば、第1番目(i=1)の原画像P(1)の特定位置の画素の画素値がp(1)=100であったとすると、第1番目の平均画像A(1)の当該特定位置の画素の画素値a(1)は、そのままa(1)=100となる。続いて、第2番目の原画像P(2)の当該特定位置の画素の画素値がp(2)=100であったとすると、第2番目の平均画像A(2)の当該特定位置の画素の画素値a(2)は、a(1)とp(2)との重みつき平均「0.99×100+0.01×100」を計算することにより、a(2)=100になる。   For example, if the pixel value of the pixel at the specific position of the first (i = 1) original image P (1) is p (1) = 100, the specific of the first average image A (1) is specified. The pixel value a (1) of the pixel at the position is a (1) = 100 as it is. Subsequently, assuming that the pixel value of the pixel at the specific position of the second original image P (2) is p (2) = 100, the pixel at the specific position of the second average image A (2). The pixel value a (2) is calculated as a weighted average “0.99 × 100 + 0.01 × 100” between a (1) and p (2), so that a (2) = 100.

図示の例では、原画像の当該特定位置の画素値は、p(1)〜p(4)まで100のまま変化しないため、平均画像の当該特定位置の画素値も、a(1)〜a(4)まで100を維持する。ところが、第5番目の原画像P(5)では、画素値p(5)=200に急変したため、第5番目の平均画像A(5)の画素値a(5)は、図4の下段の式に示すとおり、a(4)とp(5)との重みつき平均「0.99×100+0.01×200」を計算することにより、a(5)=101になる。更に、第6番目の原画像P(6)および第7番目の原画像P(7)では、画素値p(6)=p(7)=200が維持されているため、図4の下段の式に示すとおり、第6番目の平均画像A(6)および第7番目の平均画像A(7)では、画素値a(6)=102、画素値a(7)=103、と徐々に増加している。   In the illustrated example, since the pixel value at the specific position of the original image remains 100 from p (1) to p (4), the pixel value at the specific position of the average image is also a (1) to a Maintain 100 until (4). However, in the fifth original image P (5), the pixel value a (5) of the fifth average image A (5) is changed in the lower part of FIG. As shown in the equation, a (5) = 101 is obtained by calculating the weighted average “0.99 × 100 + 0.01 × 200” of a (4) and p (5). Further, since the pixel value p (6) = p (7) = 200 is maintained in the sixth original image P (6) and the seventh original image P (7), the lower part of FIG. As shown in the equation, in the sixth average image A (6) and the seventh average image A (7), the pixel value a (6) = 102 and the pixel value a (7) = 103 gradually increase. doing.

この例のように、重みwを0.01程度の値に設定すると、原画像の画素値が急激に変化しても、平均画像の画素値は直ちに変化することはなく、原画像の画素値にゆっくりと近づいてゆくことになる。したがって、図1に示す例のように、車両が通過する動画が与えられたとしても、一過性の画素値変化は、平均画像の画素値に大きな変化をもたらすことはなく、平均画像は背景画像としての機能を果たすことができる。一方、時刻が日中から夕暮れに変わった場合など、照明環境に変化が生じた場合、当該変化は多数のフレーム画像にわたって持続するため、平均画像の画素値も当該変化に追従して変化することになる。したがって、日中には日中の背景画像に適した平均画像が得られ、夕暮れには夕暮れの背景画像に適した平均画像が得られることになる。   As in this example, when the weight w is set to a value of about 0.01, even if the pixel value of the original image changes abruptly, the pixel value of the average image does not change immediately, and the pixel value of the original image It will approach you slowly. Therefore, as in the example shown in FIG. 1, even if a moving image through which the vehicle passes is given, the transient pixel value change does not cause a large change in the pixel value of the average image, and the average image It can serve as an image. On the other hand, if the lighting environment changes, such as when the time changes from daytime to dusk, the change persists across many frame images, so the average image pixel value also changes following the change. become. Therefore, an average image suitable for a daytime background image is obtained during the daytime, and an average image suitable for a sunset background image is obtained at dusk.

移動物体の領域を示すマスク画像Mは、このような方法で作成された平均画像を背景画像として、個々の原画像を比較することによって作成することができる。図5は、このようにして作成されるマスク画像Mの画素値決定プロセスを示す図である。第i番目の原画像P(i)についてのマスク画像M(i)は、次のような方法で決定される画素値をもつ画素の集合体からなる二値画像である。すなわち、マスク画像M(i)の特定位置の画素の画素値m(i)は、原画像P(i)の当該特定位置の画素の画素値p(i)と、平均画像A(i−1)の当該特定位置の画素の画素値a(i−1)との比較によって決定され、両画素値が類似範囲内であれば、背景領域B内の画素であることを示す画素値(たとえば、「1」)が与えられ、両画素値が類似範囲外であれば、前景領域F内の画素であることを示す画素値(たとえば、「0」)が与えられる。   The mask image M indicating the area of the moving object can be created by comparing individual original images with the average image created by such a method as a background image. FIG. 5 is a diagram showing a pixel value determination process of the mask image M created in this way. The mask image M (i) for the i-th original image P (i) is a binary image composed of a collection of pixels having pixel values determined by the following method. That is, the pixel value m (i) of the pixel at the specific position of the mask image M (i) is equal to the pixel value p (i) of the pixel at the specific position of the original image P (i) and the average image A (i−1). ) Is compared with the pixel value a (i-1) of the pixel at the specific position, and if both pixel values are within the similar range, a pixel value indicating that the pixel is in the background region B (for example, If both pixel values are outside the similar range, a pixel value (for example, “0”) indicating that the pixel is in the foreground area F is given.

なお、実際には、原画像は三原色の各画素値(たとえば、RGB表色系の場合、R,G,Bの3色の画素値)をもったカラー画像であるので、原画像P(i)を構成する各画素の画素値p(i)や、平均画像A(i)を構成する各画素の画素値a(i)は、いずれも色ごとに独立した3つの値から構成されていることになる。そして、式(1)の演算は、個々の色ごとにそれぞれ独立して実行されることになる。たとえば、平均画像A(i)上の特定位置の画素の画素値a(i)は、R色の画素値、G色の画素値、B色の画素値という3組の画素値によって構成され、R色の画素値は、過去の原画像のR色の画素値の重みつき平均として得られた値になる。   Actually, since the original image is a color image having pixel values of three primary colors (for example, in the case of the RGB color system, pixel values of three colors R, G, and B), the original image P (i ) And the pixel value a (i) of each pixel constituting the average image A (i) are each composed of three independent values for each color. It will be. Then, the calculation of Expression (1) is executed independently for each color. For example, the pixel value a (i) of a pixel at a specific position on the average image A (i) is composed of three sets of pixel values, an R color pixel value, a G color pixel value, and a B color pixel value. The R pixel value is a value obtained as a weighted average of the R pixel values of the past original image.

したがって、図5における画素値p(i)と画素値a(i−1)との比較は、単なる2つの値の比較ではなく、3組の画素値と3組の画素値との比較ということになる。当然ながら、画素の類否判定は、この3組の画素値の組み合わせからなる色同士が類似するか否かを判定する処理ということになる。以下、この類否判定を行うための一般的な方法を、§2において詳述する。   Therefore, the comparison between the pixel value p (i) and the pixel value a (i−1) in FIG. 5 is not a simple comparison between two values, but a comparison between three sets of pixel values and three sets of pixel values. become. Naturally, the pixel similarity determination is a process for determining whether or not colors composed of combinations of these three pixel values are similar. Hereinafter, a general method for performing the similarity determination will be described in detail in Section 2.

<<< §2.画素の一般的な類否判定方法 >>>
さて、§1で述べた移動物体検出方法では、原画像(入力画像)と平均画像(背景画像)とを画素単位で比較して、両画素が類似している場合は背景領域Bの画素、非類似の場合は前景領域Fの画素という判定を行う。このように画素単位での類否判定を行う方法は、領域単位で特徴量を求める方法に比べて処理が単純になり、演算負担は比較的軽くなる。しかしながら、画素の類否判定が移動物体の検出精度を左右するファクターになるため、どのような方法で、どの程度の範囲までを「類似範囲」と判定するかが非常に重要である。
<<< §2. General similarity determination method for pixels >>
Now, in the moving object detection method described in §1, the original image (input image) and the average image (background image) are compared in pixel units. In the case of dissimilarity, it is determined that the pixel is in the foreground area F. As described above, the method for determining similarity in units of pixels is simpler than the method of obtaining feature amounts in units of regions, and the calculation burden is relatively light. However, since the pixel similarity determination is a factor that affects the detection accuracy of the moving object, it is very important to determine how much the range is determined as the “similar range”.

たとえば、§1では、図1の画像P10を平均画像(背景画像)とし、画像P20を原画像(入力画像)とした場合、両者の比較により、画像M20のようなマスク画像が得られることを述べた。ここで、マスク画像M20の前景領域Fは、両画像P10,P20を比較した結果、画素が類似範囲外と判定された領域であり、背景画像Bは、画素が類似範囲内と判定された領域である。この場合、類似範囲を適切に設定しないと、正しいマスク画像を得ることはできない。   For example, in §1, when the image P10 in FIG. 1 is an average image (background image) and the image P20 is an original image (input image), a mask image like the image M20 is obtained by comparing the two images. Stated. Here, the foreground area F of the mask image M20 is an area in which the pixels are determined to be out of the similar range as a result of comparing the images P10 and P20, and the background image B is an area in which the pixels are determined to be in the similar range. It is. In this case, a correct mask image cannot be obtained unless the similar range is set appropriately.

カラー画像の場合、画素の類否は、両画素の色が近似しているか否かに基づいて判定する必要がある。そのためには、一方の画素の3組の画素値と他方の画素の3組の画素値との総合的な比較を行う必要がある。たとえば、RGB表色系の場合、カラー画像を構成する個々の画素には、R,G,Bの3種類の画素値が与えられるが、たとえ、画素値Rが同一であっても、それだけでは両画素の色が類似していることにならない。通常、このようなカラー画像の画素の比較は、三次元の色空間上で、双方の画素値に対応する座標点をプロットし、両座標点の空間的な位置関係を調べることによって行われる。以下、各画素がRGB表色系の画素値をもっている場合について、色空間上での類否判定を行う代表的な方法をいくつか説明しよう。   In the case of a color image, the similarity of pixels needs to be determined based on whether or not the colors of both pixels are approximate. For this purpose, it is necessary to comprehensively compare the three pixel values of one pixel and the three pixel values of the other pixel. For example, in the case of the RGB color system, each pixel constituting a color image is given three types of pixel values R, G, and B. Even if the pixel values R are the same, this is not enough. The colors of both pixels are not similar. Usually, such pixel comparison of color images is performed by plotting coordinate points corresponding to both pixel values in a three-dimensional color space and examining the spatial positional relationship between the two coordinate points. Hereinafter, some typical methods for determining similarity in the color space when each pixel has an RGB color system pixel value will be described.

図6は、画素の類否判定の最も単純な方法を示す三次元色空間図である。図示のとおり、三原色R,G,Bの画素値を各座標軸にとったRGB三次元直交座標系に、座標点AおよびPがプロットされている。ここで、座標点A(Ra,Ga,Ba)は、背景を示す平均画像A上の画素の画素値(Ra,Ga,Ba)をプロットした点であり、座標点P(Rp,Gp,Bp)は、判定対象となる原画像P上の画素の画素値(Rp,Gp,Bp)をプロットした点である。   FIG. 6 is a three-dimensional color space diagram showing the simplest method for determining similarity of pixels. As illustrated, coordinate points A and P are plotted in an RGB three-dimensional orthogonal coordinate system in which the pixel values of the three primary colors R, G, and B are taken as coordinate axes. Here, the coordinate point A (Ra, Ga, Ba) is a point obtained by plotting pixel values (Ra, Ga, Ba) of pixels on the average image A indicating the background, and the coordinate point P (Rp, Gp, Bp). ) Is a point in which pixel values (Rp, Gp, Bp) of pixels on the original image P to be determined are plotted.

ここで、この三次元色空間上での2点A,Pの距離をδとすれば、当該距離δは、両画素の類似度を示す1つの指標になる。δ=0であれば、両画素は全く同一の画素値をもった画素になり、δが大きくなればなるほど、3つの画素値の総合的な類似度は低下する。したがって、予め所定の閾値δthを設定しておき、δ<δthであれば類似範囲内、δ≧δthであれば類似範囲外と判定するようにすれば、一応の判定基準を設定することができる。   Here, if the distance between the two points A and P in the three-dimensional color space is δ, the distance δ is an index indicating the similarity between the two pixels. If δ = 0, both pixels have exactly the same pixel value, and the overall similarity of the three pixel values decreases as δ increases. Therefore, if a predetermined threshold value δth is set in advance and it is determined that δ <δth is within the similar range and δ ≧ δth is out of the similar range, a temporary determination criterion can be set. .

あるいは、原点Oを起点として、座標点Aへ向かうベクトルVaと座標点Pへ向かうベクトルVpとを定義し、両ベクトルVa,Vpのなす角θを、両画素の類似度を示す指標として用いることもできる。θ=0の場合、2点A,Pは必ずしも同一の点にはならないが、原点Oを通る同一直線上の点になるため、少なくとも三原色R,G,Bの配合割合で決まる両画素の色相は類似したものになる。結局、θが小さければ、色相の類似性は高まることになるので、指標δを用いた判定基準と同様に、予め所定の閾値θthを設定しておき、θ<θthであれば類似範囲内、θ≧θthであれば類似範囲外と判定するようにすれば、一応の判定基準を設定することができる。   Alternatively, starting from the origin O, a vector Va going to the coordinate point A and a vector Vp going to the coordinate point P are defined, and an angle θ formed by both vectors Va and Vp is used as an index indicating the similarity between both pixels. You can also. When θ = 0, the two points A and P are not necessarily the same point, but are points on the same straight line passing through the origin O. Therefore, the hues of both pixels determined by at least the blend ratio of the three primary colors R, G, and B are used. Will be similar. Eventually, if θ is small, the similarity of hue will increase. Therefore, like the criterion using index δ, a predetermined threshold θth is set in advance, and if θ <θth, If it is determined that θ ≧ θth is outside the similar range, a temporary determination criterion can be set.

一方、より正確な判定を行う方法として、三原色の各画素値を各座標軸にとった三次元座標系において、一方の画素値に対応する座標に位置する基準点を中心として所定サイズの基準立体を配置し、他方の画素値に対応する座標点との位置関係を調べ、当該座標点が基準立体の外部に位置すると判定できる場合に非類似との判定を行い、内部に位置すると判定できる場合には類似との判定を行う方法が知られている。   On the other hand, as a more accurate determination method, in a three-dimensional coordinate system in which each pixel value of the three primary colors is taken as each coordinate axis, a reference solid having a predetermined size is centered on a reference point located at a coordinate corresponding to one pixel value. If the position of the coordinate point corresponding to the other pixel value is determined and the coordinate point can be determined to be located outside the reference solid, it is determined that the coordinate point is not similar, and the coordinate point corresponding to the other pixel value is determined to be located inside. There is known a method for determining whether or not is similar.

たとえば、前掲の非特許文献1には、適切な判定基準を設定するために、基準立体として円柱を用いる類否判定方法が提案されている。図7は、この円柱モデルを用いる方法の基本原理を示す三次元色空間図である。この図7においても、図6と同様に、背景を示す平均画像A上の画素の画素値(Ra,Ga,Ba)が座標点Aとしてプロットされ、判定対象となる原画像P上の画素の画素値(Rp,Gp,Bp)が座標点Pとしてプロットされている。ここでも、ベクトルVa,Vpは、原点Oを起点として、各点A,Pへ向かうベクトルである。   For example, the above-mentioned Non-Patent Document 1 proposes a similarity determination method using a cylinder as a reference solid in order to set an appropriate determination criterion. FIG. 7 is a three-dimensional color space diagram showing the basic principle of the method using this cylindrical model. In FIG. 7, as in FIG. 6, the pixel values (Ra, Ga, Ba) of the pixels on the average image A indicating the background are plotted as the coordinate point A, and the pixels on the original image P to be determined are plotted. Pixel values (Rp, Gp, Bp) are plotted as coordinate points P. Here again, the vectors Va and Vp are vectors from the origin O toward the points A and P.

このモデルでは、図示のとおり、座標点Aを中心として所定半径をもった長さLの円柱Cが定義されている。別言すれば、円柱Cは、ベクトルVa上に定義された基準軸Zを中心軸とし、その中心点が座標点Aにくるように配置された円柱ということになる。そして、この円柱Cの内部の空間領域を、背景を示す平均画像Aを構成する画素の類似範囲と定める。したがって、図示の例のように、座標点Pに対応する画素値をもった画素は、円柱Cの外側に位置するため類似範囲外と判定され、前掲領域Fを構成する画素と認定されることになる。逆に、座標点Pが円柱Cの内部に位置していれば、類似範囲内と判定され、背景領域Bを構成する画素と認定される。   In this model, a cylinder C having a length L with a predetermined radius around a coordinate point A is defined as shown in the figure. In other words, the cylinder C is a cylinder arranged such that the reference axis Z defined on the vector Va is the central axis and the center point is at the coordinate point A. Then, the space area inside the cylinder C is defined as a similar range of pixels constituting the average image A indicating the background. Therefore, as shown in the example in the figure, a pixel having a pixel value corresponding to the coordinate point P is determined to be outside the similar range because it is located outside the cylinder C, and recognized as a pixel constituting the above-described region F. become. On the contrary, if the coordinate point P is located inside the cylinder C, it is determined to be within the similar range and is recognized as a pixel constituting the background region B.

ここに示す円柱モデルの特徴は、ベクトルVaの方向を向いた基準軸Zを長手方向とする円柱領域が設定される点である。この円柱Cの半径は、色相の類似範囲を決めるパラメータとして機能し、長さLは明度の類似範囲を決めるパラメータとして機能する。実際の景色では、太陽光による照明環境の変化、風による樹木等の明暗の変化などによって、背景領域Bの画素値に時間的変動が生じることになるが、このような変動は、色相よりも明度に大きな影響を及ぼすと考えられる。したがって、このモデルのように、基準軸Zを長手方向とする円柱Cに基づいて類似範囲を設定することは理にかなっている。   A feature of the cylindrical model shown here is that a cylindrical region having a reference axis Z facing the direction of the vector Va as a longitudinal direction is set. The radius of the cylinder C functions as a parameter for determining the hue similarity range, and the length L functions as a parameter for determining the brightness similarity range. In actual scenery, the pixel values in the background region B will vary temporally due to changes in the lighting environment due to sunlight, changes in light and darkness of trees etc. due to the wind, etc. It is thought to have a great influence on the brightness. Therefore, as in this model, it makes sense to set the similarity range based on the cylinder C having the reference axis Z as the longitudinal direction.

<<< §3.従来提案されている移動物体検出装置 >>>
ここでは、§1および§2で述べた原理に基づいて移動物体の検出を行う装置の基本構成を、図8のブロック図を参照しながら説明する。この装置は、特願2009−226146号明細書に開示された装置であり、与えられた動画画像について移動物体を検出する機能をもった移動物体検出装置である。図示のとおり、この装置は、画像入力部110、原画像格納部120、平均画像作成部130、平均画像格納部140、画像比較部200、マスク画像格納部310、画像出力部320、パラメータ設定部330によって構成される。
<<< §3. Conventionally proposed moving object detection device >>>
Here, the basic configuration of an apparatus for detecting a moving object based on the principle described in §1 and §2 will be described with reference to the block diagram of FIG. This apparatus is an apparatus disclosed in Japanese Patent Application No. 2009-226146, and is a moving object detection apparatus having a function of detecting a moving object for a given moving image. As illustrated, the apparatus includes an image input unit 110, an original image storage unit 120, an average image creation unit 130, an average image storage unit 140, an image comparison unit 200, a mask image storage unit 310, an image output unit 320, and a parameter setting unit. 330.

画像入力部110は、時系列で連続的に与えられるフレーム単位のカラー原画像Pを、三原色の各画素値を有する画素の集合体データとして入力する構成要素であり、原画像格納部120は、こうして入力された原画像を逐次格納する構成要素である。一方、平均画像作成部130は、過去に入力された複数の原画像Pに基づいて、これら原画像の平均的な特徴を有する平均画像Aを逐次作成する構成要素であり、平均画像格納部140は、作成された平均画像Aを逐次格納する構成要素である。   The image input unit 110 is a component that inputs a frame-unit color original image P continuously given in time series as pixel aggregate data having pixel values of the three primary colors. The original image storage unit 120 This is a component that sequentially stores the input original image. On the other hand, the average image creation unit 130 is a component that sequentially creates an average image A having an average characteristic of these original images based on a plurality of original images P input in the past. Is a component that sequentially stores the created average image A.

この平均画像Aを作成する具体的な処理機能については、図3を参照して§1で述べたとおりである。すなわち、平均画像作成部130は、最初の原画像P(1)が与えられたときには、当該原画像P(1)をそのまま最初の平均画像A(1)として平均画像格納部140に格納する処理を行う。そして、以後、第i番目の原画像P(i)が入力されるたびに(i=2,3,...)、この原画像P(i)と平均画像格納部140に格納されていた第(i−1)番目の平均画像A(i−1)を利用して、第i番目の平均画像A(i)を作成し、これを平均画像格納部140に格納する。   The specific processing function for creating the average image A is as described in section 1 with reference to FIG. That is, when the first original image P (1) is given, the average image creation unit 130 stores the original image P (1) as it is in the average image storage unit 140 as the first average image A (1). I do. Thereafter, every time the i-th original image P (i) is input (i = 2, 3,...), The original image P (i) and the average image storage unit 140 are stored. The i-th average image A (i) is created using the (i−1) -th average image A (i−1), and is stored in the average image storage unit 140.

このとき、平均画像A(i)の所定位置の画素の所定色の画素値をa(i)とすれば、画素値a(i)は、既に述べたとおり、
a(i)=(1−w)・a(i−1)+w・p(i) 式(1)
なる演算式を用いて算出される。ここで、a(i−1)は、平均画像A(i−1)の前記所定位置の画素の前記所定色の画素値、p(i)は、原画像P(i)の前記所定位置の画素の前記所定色の画素値、wは、所定の重みを示すパラメータ(w<1)である。なお、各画素値は、実際には、§2で述べたとおり、たとえば、RGB表色系の場合、R,G,Bの3種類の画素値から構成され、上記演算は、個々の色ごとの画素値についてそれぞれ別個に行われる。
At this time, if the pixel value of the predetermined color of the pixel at the predetermined position of the average image A (i) is a (i), the pixel value a (i) is as described above.
a (i) = (1-w) .a (i-1) + w.p (i) Formula (1)
It is calculated using the following arithmetic expression. Here, a (i-1) is the pixel value of the predetermined color of the pixel at the predetermined position of the average image A (i-1), and p (i) is the predetermined position of the original image P (i). The pixel value, w, of the predetermined color of the pixel is a parameter (w <1) indicating a predetermined weight. Each pixel value is actually composed of three types of pixel values of R, G, and B, for example, in the case of the RGB color system, as described in §2, and the above calculation is performed for each color. Are separately performed for each of the pixel values.

図8に示す原画像格納部120や平均画像格納部140は、バッファメモリによって構成することができる。平均画像作成部130が、図3に示す方法で重みwをパラメータとして平均画像を逐次作成し、これを平均画像格納部140に格納してゆくようにすれば、原画像格納部120には、常に処理に必要な最新の原画像のみが格納されるようにし、平均画像格納部140には、常に処理に必要な最新の平均画像Aのみが格納されるようにすればよいので、バッファメモリの容量を節約することができる。   The original image storage unit 120 and the average image storage unit 140 illustrated in FIG. 8 can be configured by a buffer memory. If the average image creation unit 130 sequentially creates an average image using the weight w as a parameter by the method shown in FIG. 3 and stores it in the average image storage unit 140, the original image storage unit 120 includes Since only the latest original image necessary for processing is always stored, and only the latest average image A necessary for processing is always stored in the average image storage unit 140. Capacity can be saved.

画像比較部200は、原画像格納部120に格納された原画像Pと、平均画像格納部140に格納された平均画像Aとを比較し、前景領域Fと背景領域Bとを区別するマスク画像Mを作成する機能を果たす構成要素であり、図示のとおり、画素値読出部210、類否判定部220、画素値書込部230によって構成されている。   The image comparison unit 200 compares the original image P stored in the original image storage unit 120 with the average image A stored in the average image storage unit 140, and distinguishes the foreground region F from the background region B. It is a component that fulfills the function of creating M, and is composed of a pixel value reading unit 210, an similarity determination unit 220, and a pixel value writing unit 230, as shown.

画素値読出部210は、比較対象となる一対の画像(すなわち、原画像格納部120に格納されている原画像Pと、平均画像格納部140に格納されている平均画像A)のうち、いずれか一方の画像の所定位置の画素の画素値を基準画素値(R,G,B)として読み出し、他方の画像の対応位置の画素の画素値を比較画素値(r,g,b)として読み出す処理を行う。   The pixel value reading unit 210 selects one of a pair of images to be compared (that is, the original image P stored in the original image storage unit 120 and the average image A stored in the average image storage unit 140). The pixel value of a pixel at a predetermined position in one image is read as a reference pixel value (R, G, B), and the pixel value of a pixel at a corresponding position in the other image is read as a comparison pixel value (r, g, b). Process.

類否判定部220は、比較画素値(r,g,b)が、基準画素値(R,G,B)について設定された所定の類似範囲に入っているか否かを判定する処理を行う。具体的には、図7に示す円柱モデルを利用する場合、三原色の各画素値を各座標軸にとった三次元座標系において、基準画素値(R,G,B)に対応する座標に位置する基準点A(R,G,B)と比較画素値(r,g,b)に対応する座標に位置する比較点P(r,g,b)をとり、基準点Aを中心とする所定サイズの円柱Cと比較点Pとの位置関係を調べ、比較点Pが円柱Cの外部に位置する場合には非類似との判定を行い、内部に位置する場合には類似との判定を行う。このとき、円柱Cのサイズは、所定の判定パラメータによって決定される。   The similarity determination unit 220 performs a process of determining whether or not the comparison pixel value (r, g, b) is within a predetermined similar range set for the reference pixel value (R, G, B). Specifically, when the cylindrical model shown in FIG. 7 is used, it is located at the coordinates corresponding to the reference pixel value (R, G, B) in the three-dimensional coordinate system in which the pixel values of the three primary colors are taken as the coordinate axes. A reference point A (R, G, B) and a comparison point P (r, g, b) located at coordinates corresponding to the comparison pixel value (r, g, b) are taken, and a predetermined size centered on the reference point A The positional relationship between the cylinder C and the comparison point P is examined, and when the comparison point P is located outside the cylinder C, it is judged as dissimilar, and when it is located inside, it is judged as similar. At this time, the size of the cylinder C is determined by a predetermined determination parameter.

そして、画素値書込部230は、マスク画像Mを構成する所定位置(画素値読出部210の読出対象となった位置)の画素の画素値として、類否判定部220の判定結果に応じた値を定め、マスク画像格納部310に書き込む処理を行う。すなわち、類否判定部220が類似と判定した場合には背景領域Bを示す画素値(たとえば、「1」)を、類否判定部220が非類似と判定した場合には前景領域Fを示す画素値(たとえば、「0」)を、それぞれマスク画像格納部310に書き込む処理を行う。   Then, the pixel value writing unit 230 responds to the determination result of the similarity determination unit 220 as the pixel value of a pixel at a predetermined position (position to be read by the pixel value reading unit 210) constituting the mask image M. A value is set and written into the mask image storage unit 310. That is, when the similarity determination unit 220 determines that the similarity is similar, the pixel value indicating the background region B (for example, “1”) is indicated, and when the similarity determination unit 220 determines that the similarity is not similar, the foreground region F is indicated. A process of writing pixel values (for example, “0”) to the mask image storage unit 310 is performed.

マスク画像格納部310は、こうして作成されたマスク画像Mを格納する構成要素であり、画像出力部320は、このマスク画像Mを出力する構成要素である。   The mask image storage unit 310 is a component that stores the mask image M created in this way, and the image output unit 320 is a component that outputs the mask image M.

一方、パラメータ設定部330は、平均画像作成部130による平均画像作成処理に利用されるパラメータw(図3に示す重みw)と、類否判定部220の類否判定処理に利用される判定パラメータ(図7に示す円柱Cの半径と長さL)とを、ユーザの操作入力によって任意の値に設定する機能を有する。ユーザは、必要に応じて、これらパラメータの値を調整することにより、より精度の高い検出結果を得ることができる。もっとも、これらのパラメータの一部もしくは全部は、固定値にしておくことも可能である。全部のパラメータ値を固定値にする実施例では、パラメータ設定部330を設ける必要はない。   On the other hand, the parameter setting unit 330 is a parameter w (weight w shown in FIG. 3) used for the average image creation process by the average image creation unit 130 and a determination parameter used for the similarity determination process of the similarity determination unit 220 (A radius and a length L of the cylinder C shown in FIG. 7) are set to arbitrary values by a user operation input. The user can obtain a detection result with higher accuracy by adjusting the values of these parameters as necessary. However, some or all of these parameters can be fixed values. In an embodiment in which all parameter values are fixed values, the parameter setting unit 330 need not be provided.

なお、実用上、この図8に示す移動物体検出装置は、コンピュータに専用のプログラムを組み込むことにより構築することができ、図8に各ブロックで示す構成要素は、コンピュータのハードウエアとソフトウエアとの組み合わせによって実現することができる。もちろん、この移動物体検出装置を半導体集積回路として構成することも可能である。   In practice, the moving object detection apparatus shown in FIG. 8 can be constructed by incorporating a dedicated program into the computer. The components shown in each block in FIG. 8 are the hardware and software of the computer. It can be realized by a combination of Of course, this moving object detection device can also be configured as a semiconductor integrated circuit.

この移動物体検出装置による検出精度を向上させるには、各パラメータの値を利用環境に合致した最適値に設定することが重要である。また、類否判定部220において適切な判定アルゴリズムを用いることも重要である。ここでは、図7に示す円柱モデルを利用した例を述べたが、たとえば、§7で述べる回転楕円体モデルを利用すると、一般的に検出精度の向上を図ることができる。   In order to improve the detection accuracy of the moving object detection device, it is important to set the values of the parameters to optimum values that match the usage environment. It is also important to use an appropriate determination algorithm in the similarity determination unit 220. Although the example using the cylindrical model shown in FIG. 7 has been described here, for example, the detection accuracy can generally be improved by using the spheroid model described in §7.

このように、図8に示す移動物体検出装置の検出精度を向上させるために、様々な工夫を施すことが可能であるが、本願発明者が行った実験によると、時刻や天候などによる照明変動の影響を完全に排除することは困難であり、依然として、誤検出が生じる問題がある。   Thus, various improvements can be made to improve the detection accuracy of the moving object detection device shown in FIG. 8, but according to experiments conducted by the inventors of the present application, illumination fluctuations due to time, weather, etc. It is difficult to completely eliminate the influence of the above, and there is still a problem that false detection occurs.

図1に示す各原画像P10〜P40には、背景部分に全く同じ画像が描かれているが、実際の風景では、雲の動きで太陽光による照明環境が変化し、風により樹木の葉の位置や向きが微妙に変化する。したがって、類否判定部220における画素の類否判定基準を厳しくすると(たとえば、図7に示す円柱モデルの場合、円柱Cのサイズを小さくすると)、実際には背景部分であるのに、非類似との誤判定が生じ、前景領域F内の画素との認定がなされてしまう。逆に、画素の類否判定基準を緩めると、実際には前景部分であるのに、類似との誤判定が生じ、背景領域B内の画素との認定がなされてしまう。   In each of the original images P10 to P40 shown in FIG. 1, the same image is drawn in the background portion. However, in an actual landscape, the lighting environment due to sunlight changes due to the movement of clouds, and the position of the leaves of the trees due to the wind The direction changes slightly. Therefore, if the similarity determination criteria of the pixels in the similarity determination unit 220 are tightened (for example, in the case of the cylindrical model shown in FIG. And a pixel in the foreground area F is recognized. On the other hand, if the pixel similarity determination criterion is relaxed, an erroneous determination of similarity occurs even though it is actually the foreground part, and the pixel in the background region B is recognized.

もちろん、過去に入力された多数の原画像に対して、より複雑な統計処理を施して背景画像を決定するようにすれば、検出精度の向上を図ることが可能であるが、そのためには演算処理が極めて複雑になり、一般的なプロセッサによるリアルタイム処理を行うことが困難になる。また、多数のフレームにわたって入力画像を格納しておく必要があるため、大容量の画像バッファメモリが必要になる。   Of course, it is possible to improve the detection accuracy if a background image is determined by performing more complicated statistical processing on a large number of original images input in the past. Processing becomes extremely complicated, making it difficult to perform real-time processing by a general processor. Further, since it is necessary to store the input image over a large number of frames, a large-capacity image buffer memory is required.

本発明は、このような問題を解決するための提案であり、その目的は、演算処理の負担を軽減しつつ、日照変化などの自然現象に起因した誤検出を排除し、より正確な検出を行うことが可能な移動物体検出装置を提供することにある。以下、本発明に係る移動物体検出装置の構成および動作を説明する。   The present invention is a proposal for solving such a problem, and its purpose is to reduce the burden of arithmetic processing while eliminating false detections caused by natural phenomena such as changes in sunshine, and more accurate detection. It is an object of the present invention to provide a moving object detection device that can be performed. Hereinafter, the configuration and operation of the moving object detection device according to the present invention will be described.

<<< §4.本発明に係る移動物体検出装置 >>>
本発明に係る移動物体検出装置は、図8に示した従来提案されている移動物体検出装置を改良したものであり、その基本構成を図9に示す。図示のとおり、この装置は、画像入力部110、原画像格納部120、平均画像作成部130、参照画像作成部135、平均画像格納部140、参照画像格納部145、画像比較部400、マスク画像格納部310、画像出力部320、パラメータ設定部340によって構成され、動画画像について移動物体を検出する移動物体検出装置として機能する。
<<< §4. Moving object detection device according to the present invention >>
The moving object detection apparatus according to the present invention is an improvement of the conventionally proposed moving object detection apparatus shown in FIG. 8, and its basic configuration is shown in FIG. As illustrated, the apparatus includes an image input unit 110, an original image storage unit 120, an average image creation unit 130, a reference image creation unit 135, an average image storage unit 140, a reference image storage unit 145, an image comparison unit 400, a mask image. The storage unit 310, the image output unit 320, and the parameter setting unit 340 function as a moving object detection device that detects a moving object for a moving image.

この図9に示す各構成要素のうち、画像入力部110、原画像格納部120、平均画像作成部130、平均画像格納部140の機能は、図8に同符号で示す各構成要素の機能と全く同じである。すなわち、画像入力部110は、時系列で連続的に与えられるフレーム単位のカラー原画像を、三原色の各画素値を有する画素の集合体データとして入力する機能を果たし、原画像格納部120は、入力された原画像を逐次格納する機能を果たす。   Among the components shown in FIG. 9, the functions of the image input unit 110, the original image storage unit 120, the average image creation unit 130, and the average image storage unit 140 are the functions of the components indicated by the same reference numerals in FIG. 8. Exactly the same. That is, the image input unit 110 performs a function of inputting a color-unit color original image continuously given in time series as aggregate data of pixels having pixel values of the three primary colors, and the original image storage unit 120 It fulfills the function of sequentially storing the input original image.

また、平均画像作成部130は、新たな原画像が入力されるたびに、当該新たな原画像と直前に作成した平均画像とに基づいて、新たな平均画像を作成する機能を果たし、平均画像格納部140は、作成された平均画像を逐次格納する機能を果たす。たとえば、画像入力部110によって第i番目の原画像P(i)が入力され、原画像格納部120に格納された場合、平均画像作成部130は、平均画像格納部140から直前に作成した平均画像A(i−1)を読み出し、原画像格納部120から新たな原画像P(i)を読み出し、これらの画像に基づいて、新たな平均画像A(i)を作成し、これを平均画像格納部140に格納する。   In addition, every time a new original image is input, the average image creation unit 130 performs a function of creating a new average image based on the new original image and the average image created immediately before. The storage unit 140 has a function of sequentially storing the created average image. For example, when the i-th original image P (i) is input by the image input unit 110 and stored in the original image storage unit 120, the average image creation unit 130 calculates the average created immediately before from the average image storage unit 140. The image A (i-1) is read out, a new original image P (i) is read out from the original image storage unit 120, and a new average image A (i) is created based on these images. Store in the storage unit 140.

より具体的には、平均画像作成部130は、第1番目の原画像P(1)をそのまま第1番目の平均画像A(1)として平均画像格納部140に格納し、第i番目(i≧2)の原画像P(i)が入力された場合、この第i番目の原画像P(i)と第(i−1)番目の平均画像A(i−1)とについて、互いに対応する位置にある画素の三原色の各画素値の重みつき平均値をそれぞれ求め、得られた各平均値を各画素値とする画素の集合からなる画像を第i番目(i≧2)の平均画像A(i)として平均画像格納部140に格納する。   More specifically, the average image creation unit 130 stores the first original image P (1) as it is as the first average image A (1) in the average image storage unit 140, and the i th (i When an original image P (i) of ≧ 2) is input, the i-th original image P (i) and the (i−1) -th average image A (i−1) correspond to each other. A weighted average value of each pixel value of the three primary colors of the pixel at the position is obtained, and an image composed of a set of pixels each having the obtained average value as each pixel value is an i-th (i ≧ 2) average image A. (I) is stored in the average image storage unit 140.

一方、参照画像作成部135および参照画像格納部145は、本発明に係る移動物体検出装置において新たに付加された構成要素である。参照画像作成部135は、画像入力部110によって新たな原画像が入力されるたびに、直前に作成した参照画像に基づいて新たな参照画像を作成する機能を果たし、参照画像格納部145は、作成された参照画像を逐次格納する機能を果たす。これらの具体的な機能については、後に詳述する。   On the other hand, the reference image creation unit 135 and the reference image storage unit 145 are components newly added in the moving object detection device according to the present invention. The reference image creation unit 135 performs a function of creating a new reference image based on the reference image created immediately before a new original image is input by the image input unit 110. The reference image storage unit 145 The function of sequentially storing the created reference images is achieved. These specific functions will be described in detail later.

また、画像比較部400は、図8に示す画像比較部200と同様に、画像を個々の画素単位で比較し、類否判定を行う機能をもった構成要素であるが、その比較対象には、新たに参照画像が加わることになる。すなわち、画像比較部400は、原画像格納部120に格納された原画像Pと、平均画像格納部140に格納された平均画像Aと、参照画像格納部145に格納された参照画像Uと、を用いた比較処理により、前景領域Fと背景領域Bとを区別するマスク画像Mを作成する機能を果たす。図示のとおり、画像比較部400は、画素値読出部410、前背判定部450、画素値書込部460によって構成されているが、これら各構成要素の機能については後に詳述する。   In addition, the image comparison unit 400 is a component having a function of comparing images in units of individual pixels and performing similarity determination, similar to the image comparison unit 200 shown in FIG. A reference image is newly added. That is, the image comparison unit 400 includes the original image P stored in the original image storage unit 120, the average image A stored in the average image storage unit 140, the reference image U stored in the reference image storage unit 145, A function of creating a mask image M for distinguishing between the foreground area F and the background area B is achieved by the comparison process using. As illustrated, the image comparison unit 400 includes a pixel value reading unit 410, a foreground determination unit 450, and a pixel value writing unit 460. The functions of these components will be described in detail later.

図9に示すマスク画像格納部310および画像出力部320の機能も、図8に同符号で示す各構成要素の機能と全く同じである。すなわち、マスク画像格納部310は、画像比較部400によって作成されたマスク画像Mを格納する機能を果たし、画像出力部320は、当該マスク画像Mを出力する機能を果たす。   The functions of the mask image storage unit 310 and the image output unit 320 shown in FIG. 9 are also exactly the same as the functions of the constituent elements indicated by the same reference numerals in FIG. That is, the mask image storage unit 310 functions to store the mask image M created by the image comparison unit 400, and the image output unit 320 functions to output the mask image M.

パラメータ設定部340は、この装置で利用されるパラメータを設定する構成要素である。この装置の場合、平均画像作成部130で用いられる重みw、参照画像作成部135で用いられる重みv、前背判定部450で用いられる判定パラメータ(たとえば、図7に示す円柱モデルを利用した類否判定を行う場合は、円柱Cの半径と長さL)を、パラメータ設定部340によって設定することができる。ユーザは、必要に応じて、パラメータ設定部340に対して操作入力を行い、これらパラメータの値を調整し、より精度の高い検出結果を得ることができる。もちろん、これらのパラメータの一部もしくは全部は、固定値にしておくことも可能であり、全部のパラメータ値を固定値にする実施例では、パラメータ設定部340を設ける必要はない。   The parameter setting unit 340 is a component that sets parameters used in this apparatus. In the case of this apparatus, the weight w used in the average image creation unit 130, the weight v used in the reference image creation unit 135, and the judgment parameter used in the foreground judgment unit 450 (for example, a class using a cylindrical model shown in FIG. 7). When the determination is negative, the parameter setting unit 340 can set the radius and length L) of the cylinder C. The user can input an operation to the parameter setting unit 340 as necessary, adjust the values of these parameters, and obtain a more accurate detection result. Of course, some or all of these parameters can be fixed values, and in the embodiment in which all the parameter values are fixed values, the parameter setting unit 340 need not be provided.

図9に示す本発明に係る移動物体検出装置が、図8に示す従来の移動物体検出装置と大きく異なる点は、参照画像作成部135および参照画像格納部145を新たに付加した点と、画像比較部200の代わりに画像比較部400を設けた点である。そこで、まず、画像比較部400の処理機能について説明する。図示のとおり、画像比較部400は、画素値読出部410、前背判定部450、画素値書込部460によって構成されており、前背判定部450は、第1判定部420、第2判定部430、総合判定部440によって構成されている。   The moving object detection device according to the present invention shown in FIG. 9 is significantly different from the conventional moving object detection device shown in FIG. 8 in that a reference image creation unit 135 and a reference image storage unit 145 are newly added, and an image An image comparison unit 400 is provided instead of the comparison unit 200. First, the processing function of the image comparison unit 400 will be described. As illustrated, the image comparison unit 400 includes a pixel value reading unit 410, a foreground determination unit 450, and a pixel value writing unit 460. The foreground determination unit 450 includes the first determination unit 420 and the second determination unit. The unit 430 and the comprehensive determination unit 440 are configured.

画素値読出部410は、画像入力部110が第i番目の原画像P(i)を入力し、これを原画像格納部120に格納するたびに、この原画像格納部120に格納されている第i番目の原画像P(i)、平均画像格納部140に格納されている第(i−1)番目の平均画像A(i−1)、参照画像格納部145に格納されている第(i−1)番目の参照画像U(i−1)から、それぞれ対応する所定位置にある画素の画素値を読み出す処理を行う。ここでは、対応する所定位置にある各画素の画素値をそれぞれp(i),a(i−1),u(i−1)で表すことにする。原画像P,平均画像A,参照画像Uは、いずれも同じ二次元画素配列をもった画像であり、対応する所定位置にある各画素とは、この二次元画素配列において同一座標(x,y)に位置する画素ということになる。   Each time the image input unit 110 inputs the i-th original image P (i) and stores it in the original image storage unit 120, the pixel value reading unit 410 is stored in the original image storage unit 120. The i-th original image P (i), the (i−1) -th average image A (i−1) stored in the average image storage unit 140, and the (th) stored in the reference image storage unit 145 ( The process of reading the pixel value of the pixel at the corresponding predetermined position from the i-1) th reference image U (i-1) is performed. Here, the pixel value of each pixel at the corresponding predetermined position is represented by p (i), a (i-1), and u (i-1), respectively. The original image P, the average image A, and the reference image U are all images having the same two-dimensional pixel array, and each pixel at a corresponding predetermined position is the same coordinate (x, y) in the two-dimensional pixel array. ).

こうして画素値読出部410が読み出した、同一座標(x,y)に位置する画素の画素値p(i),a(i−1),u(i−1)は、前背判定部450に与えられる。なお、前述したとおり、実際には、各画素は、三原色R,G,Bの成分を有しているので、画素値p(i),a(i−1),u(i−1)は、それぞれ三原色R,G,Bの成分ごとに独立した値をもつことになる。たとえば、画素値p(i)は、実際には、R色成分p(i)r,G色成分p(i)g,B色成分p(i)bという3通りの画素値の集合体であるが、ここでは便宜上、単に画素値p(i)と呼ぶことにする。   The pixel values p (i), a (i−1), u (i−1) of the pixels located at the same coordinates (x, y) read by the pixel value reading unit 410 in this way are sent to the foreground determination unit 450. Given. Note that, as described above, each pixel actually has components of the three primary colors R, G, and B, so that the pixel values p (i), a (i−1), and u (i−1) are , Each of the three primary colors R, G, and B has an independent value. For example, the pixel value p (i) is actually an aggregate of three pixel values: an R color component p (i) r, a G color component p (i) g, and a B color component p (i) b. However, for the sake of convenience, the pixel value p (i) is simply referred to here.

前背判定部450は、画素値読出部410によって読み出された画素値p(i),a(i−1),u(i−1)に基づいて、第i番目の原画像P(i)の所定位置(座標(x,y)の位置)にある画素が前景画素か背景画素かを判定する処理を行う。ここでは、判定結果をJなる論理値で表す。具体的には、判定結果がJ=0であれば前景画素、J=1であれば背景画素であることを示す。   The foreground determination unit 450 is based on the pixel values p (i), a (i−1), u (i−1) read by the pixel value reading unit 410, and the i th original image P (i ) Is performed to determine whether a pixel at a predetermined position (position of coordinates (x, y)) is a foreground pixel or a background pixel. Here, the determination result is represented by a logical value J. Specifically, if the determination result is J = 0, it indicates a foreground pixel, and if J = 1, it indicates a background pixel.

前背判定部450は、第1判定部420、第2判定部430、総合判定部440によって構成されており、座標(x,y)に位置する画素についての判定を次のようなプロセスで実行する。まず、第1判定部420は、第i番目の原画像P(i)を構成する画素の画素値p(i)と第(i−1)番目の平均画像A(i−1)を構成する画素の画素値a(i−1)とを比較して類似するか否かを判定する。一方、第2判定部430は、第i番目の原画像P(i)を構成する画素の画素値p(i)と第(i−1)番目の参照画像U(i−1)を構成する画素の画素値u(i−1)とを比較して類似するか否かを判定する。そして、総合判定部440は、第1判定部420による判定結果および第2判定部430による判定結果の少なくとも一方が類似を示す場合には背景画素との判定を行い判定結果J=1を出力し、双方とも非類似を示す場合には前景画素との判定を行い判定結果J=0を出力する。   The foreground determination unit 450 includes a first determination unit 420, a second determination unit 430, and an overall determination unit 440, and performs a determination on a pixel located at coordinates (x, y) by the following process. To do. First, the first determination unit 420 configures the pixel value p (i) of the pixels constituting the i-th original image P (i) and the (i−1) -th average image A (i−1). The pixel value a (i-1) of the pixel is compared to determine whether or not they are similar. On the other hand, the second determination unit 430 configures the pixel value p (i) of the pixels constituting the i-th original image P (i) and the (i−1) -th reference image U (i−1). The pixel value u (i-1) of the pixel is compared to determine whether or not they are similar. Then, when at least one of the determination result by the first determination unit 420 and the determination result by the second determination unit 430 shows similarity, the comprehensive determination unit 440 determines the background pixel and outputs the determination result J = 1. If both are dissimilar, the foreground pixel is determined and a determination result J = 0 is output.

第1判定部420および第2判定部430は、2つの画素間の類否判定を行うことになるが、その具体的な方法は§2で例示したとおりである。たとえば、図7に示す円柱モデルを利用する場合、第1判定部420は、次のような方法で、画素値p(i)と画素値a(i−1)との類否判定を行うことができる。まず、画素値a(i−1)を構成する三原色の各画素値に基づいて、RGB三次元座標系に基準点Aをプロットし、この基準点Aを中心とする所定サイズの基準立体として円柱Cを配置する。次に、画素値p(i)を構成する三原色の各画素値に基づいて、RGB三次元座標系に比較点Pをプロットする。そして、円柱Cと比較点Pとの位置関係を調べ、比較点Pが円柱Cの外部に位置する場合には非類似との判定を行い、内部に位置する場合には類似との判定を行えばよい。第2判定部430も、同様の方法で、画素値p(i)と画素値u(i−1)との類否判定を行うことができる。   The first determination unit 420 and the second determination unit 430 perform similarity determination between two pixels, and the specific method is as illustrated in §2. For example, when the cylindrical model shown in FIG. 7 is used, the first determination unit 420 performs similarity determination between the pixel value p (i) and the pixel value a (i−1) by the following method. Can do. First, based on the pixel values of the three primary colors constituting the pixel value a (i-1), a reference point A is plotted on the RGB three-dimensional coordinate system, and a cylinder is formed as a reference solid having a predetermined size centered on the reference point A. Place C. Next, the comparison point P is plotted on the RGB three-dimensional coordinate system based on the pixel values of the three primary colors constituting the pixel value p (i). Then, the positional relationship between the cylinder C and the comparison point P is examined. When the comparison point P is located outside the cylinder C, it is judged as dissimilar, and when it is located inside, it is judged as similar. Just do it. The second determination unit 430 can also determine the similarity between the pixel value p (i) and the pixel value u (i−1) using the same method.

総合判定部440は、これら2通りの判定結果に基づき、少なくとも一方が類似を示す場合には判定結果J=1(背景画素との判定結果)を出力し、双方とも非類似を示す場合には判定結果J=0(前景画素との判定結果)を出力する。このような判定結果の出力は、第1判定部420および第2判定部430の判定結果の論理和として得ることができる。すなわち、第1判定部420および第2判定部430が、類似との判定結果を論理値「1」として出力し、非類似との判定結果を論理値「0」として出力するようにしておけば、総合判定部440は、これらの各判定結果の論理和として、最終的な判定結果Jを出力することができる。   Based on these two determination results, the comprehensive determination unit 440 outputs a determination result J = 1 (determination result with the background pixel) when at least one shows similarity, and when both indicate dissimilarity. Determination result J = 0 (determination result with foreground pixels) is output. Such an output of the determination result can be obtained as a logical sum of the determination results of the first determination unit 420 and the second determination unit 430. That is, if the first determination unit 420 and the second determination unit 430 output the determination result of similarity as a logical value “1” and the determination result of dissimilarity as a logical value “0”. The comprehensive determination unit 440 can output the final determination result J as a logical sum of these determination results.

画素値書込部460は、第i番目のマスク画像M(i)を構成する所定位置(座標(x,y)の位置)の画素の画素値として、前背判定部450が背景画素と判定した場合には背景領域を示す画素値(この例では、判定結果Jと同じ論理値「1」)を、前背判定部450が前景画素と判定した場合には前景領域を示す画素値(この例では、判定結果Jと同じ論理値「0」)を、それぞれマスク画像格納部310に書き込む処理を行う。   The pixel value writing unit 460 determines that the foreground determination unit 450 determines the background pixel as the pixel value of a pixel at a predetermined position (coordinate (x, y) position) constituting the i-th mask image M (i). In this case, the pixel value indicating the background area (in this example, the same logical value “1” as the determination result J) is used. When the foreground determination unit 450 determines that the pixel is the foreground pixel, In the example, the same logical value “0” as the determination result J) is written in the mask image storage unit 310.

以上、画像比較部400が、特定の座標(x,y)に位置する1画素について実行する具体的な処理を述べたが、このような処理が、1枚の画像を構成する全画素について繰り返し実行される。こうして、原画像格納部120に格納された第i番目の原画像P(i)を構成する全画素について、それぞれ背景画素か前景画素かの判定が行われることになり、その判定結果に基づいて、マスク画像格納部310内に第i番目(i≧2)のマスク画像M(i)が得られることになる。こうして得られたマスク画像M(i)において、前景画素からなる領域(上例の場合、画素値「0」をもった領域)は、前景領域、すなわち、「移動物体が存在する」と判断できる領域ということになる。   The specific processing executed by the image comparison unit 400 for one pixel located at a specific coordinate (x, y) has been described above. Such processing is repeated for all the pixels constituting one image. Executed. In this way, all pixels constituting the i-th original image P (i) stored in the original image storage unit 120 are determined as background pixels or foreground pixels, and based on the determination result. Thus, the i-th (i ≧ 2) mask image M (i) is obtained in the mask image storage unit 310. In the mask image M (i) obtained in this way, an area composed of foreground pixels (in the above example, an area having a pixel value “0”) can be determined as a foreground area, that is, “a moving object exists”. It will be an area.

続いて、参照画像作成部135および参照画像格納部145の処理機能について説明する。参照画像作成部135および参照画像格納部145の役割は、平均画像作成部130および平均画像格納部140の役割と対比して考えることができる。後者は、平均画像Aを作成しこれを逐次格納する役割を果たすのに対して、前者は、参照画像Uを作成しこれを逐次格納する役割を果たす。そして、平均画像Aも参照画像Uも、画像比較部400において、原画像Pと比較されることになる。この比較処理では、平均画像Aも参照画像Uも、原画像Pに対する背景としての意味合いをもつ。ただ、平均画像Aと参照画像Uとは、その作成プロセスが異なるため、原画像に動的変化が生じた場合、その追従性に差が生じることになる。   Next, processing functions of the reference image creation unit 135 and the reference image storage unit 145 will be described. The roles of the reference image creation unit 135 and the reference image storage unit 145 can be considered in contrast to the roles of the average image creation unit 130 and the average image storage unit 140. The latter plays the role of creating the average image A and storing it sequentially, while the former plays the role of creating the reference image U and storing it sequentially. Then, both the average image A and the reference image U are compared with the original image P in the image comparison unit 400. In this comparison processing, both the average image A and the reference image U have a meaning as a background with respect to the original image P. However, since the average image A and the reference image U have different creation processes, a difference occurs in the followability when a dynamic change occurs in the original image.

平均画像作成部130による平均画像Aの作成処理は、既に§3で述べたとおりである。すなわち、平均画像作成部130は、まず、初期設定として、第1番目の原画像P(1)をそのまま第1番目の平均画像A(1)として、平均画像格納部140に格納する処理を行う。続いて、第2番目以降の原画像が入力されると、第i番目の原画像P(i)と第(i−1)番目の平均画像A(i−1)とについて、互いに対応する位置にある画素の三原色の各画素値の重みつき平均値をそれぞれ求め、得られた各平均値を各画素値とする画素の集合からなる画像を第i番目(i≧2)の平均画像A(i)として、平均画像格納部140に格納する処理を行う。   The process of creating the average image A by the average image creating unit 130 is as described in section 3 above. That is, the average image creation unit 130 first performs a process of storing the first original image P (1) as it is as the first average image A (1) in the average image storage unit 140 as an initial setting. . Subsequently, when the second and subsequent original images are input, the i-th original image P (i) and the (i−1) -th average image A (i−1) correspond to each other. The weighted average values of the pixel values of the three primary colors of the pixels in the pixel are respectively obtained, and an image composed of a set of pixels each having the obtained average value as each pixel value is defined as an i-th (i ≧ 2) average image A ( As i), a process of storing in the average image storage unit 140 is performed.

図10は、図9に示す移動物体検出装置の各構成要素で実行される演算内容を示す図である。図の上段には、平均画像作成部130で実行される演算内容が式(1A)として示されている。この式(1A)は、図3に示す式(1)と同じものである。要するに、平均画像作成部130は、
最初の原画像P(1)が入力されたときに、当該原画像P(1)をそのまま最初の平均画像A(1)として平均画像格納部140へ格納する処理を行い(図10上段の但し書)、以後、第i番目の原画像P(i)が入力されるたびに(i=2,3,...)、第i番目の平均画像A(i)を、
a(i)=(1−w)・a(i−1)+w・p(i) 式(1A)
(但し、a(i)は、平均画像A(i)の
所定位置の画素の所定色の画素値、
a(i−1)は、平均画像A(i−1)の
前記所定位置の画素の前記所定色の画素値、
p(i)は、原画像P(i)の
前記所定位置の画素の前記所定色の画素値、
wは、所定の重みを示すパラメータ(w<1))
なる演算式を用いて作成することになる。
FIG. 10 is a diagram showing calculation contents executed by each component of the moving object detection device shown in FIG. 9. In the upper part of the figure, the calculation content executed by the average image creation unit 130 is shown as an expression (1A). This formula (1A) is the same as the formula (1) shown in FIG. In short, the average image creation unit 130
When the first original image P (1) is input, the original image P (1) is stored in the average image storage unit 140 as the first average image A (1) as it is (in the upper row of FIG. 10). Thereafter, every time the i-th original image P (i) is input (i = 2, 3,...), The i-th average image A (i) is
a (i) = (1-w) .a (i-1) + w.p (i) Formula (1A)
(However, a (i) is the average image A (i)
A pixel value of a predetermined color of a pixel at a predetermined position,
a (i-1) is the average image A (i-1)
A pixel value of the predetermined color of the pixel at the predetermined position;
p (i) is the original image P (i)
A pixel value of the predetermined color of the pixel at the predetermined position;
w is a parameter indicating a predetermined weight (w <1))
It will be created using the following equation.

これに対して、参照画像作成部135による参照画像Uの作成処理は、次のようなプロセスによって行われる。すなわち、参照画像作成部135は、まず、初期設定として、第1番目の原画像P(1)をそのまま第1番目の参照画像U(1)として、参照画像格納部145に格納する処理を行う。続いて、第2番目以降の原画像が入力されると、直前の参照画像に基づいて、次のような方法で新たな参照画像を作成する処理を行う。すなわち、第i番目(i≧2)の原画像P(i)が入力され、この原画像P(i)を構成する個々の画素について、前背判定部450において前景画素か背景画素かの判定が行われたら、参照画像作成部135は、参照画像格納部145に格納されている第(i−1)番目の参照画像U(i−1)を構成する個々の画素のうち、前背判定部450によって第i番目の原画像P(i)の対応画素が前景画素と判定された画素については、更新せずに、もとの画素値u(i−1)をそのまま維持し、前背判定部450によって第i番目の原画像P(i)の対応画素が背景画素と判定された画素については、当該画素と第(i−1)番目の平均画像A(i−1)の対応する位置にある画素とについて、三原色の各画素値の重みつき平均値をそれぞれ求め、得られた各平均値を新画素値として更新することにより、第i番目(i≧2)の参照画像U(i)を作成する処理を行う。   On the other hand, the reference image U creating process by the reference image creating unit 135 is performed by the following process. That is, the reference image creation unit 135 first performs a process of storing the first original image P (1) as it is as the first reference image U (1) in the reference image storage unit 145 as an initial setting. . Subsequently, when the second and subsequent original images are input, processing for creating a new reference image is performed by the following method based on the immediately preceding reference image. In other words, the i-th (i ≧ 2) original image P (i) is input, and the individual pixels constituting the original image P (i) are determined by the foreground determination unit 450 as foreground pixels or background pixels. Is performed, the reference image creation unit 135 determines the front of the individual pixels constituting the (i-1) th reference image U (i-1) stored in the reference image storage unit 145. For the pixel for which the corresponding pixel of the i-th original image P (i) is determined to be the foreground pixel by the unit 450, the original pixel value u (i-1) is maintained as it is without being updated. For the pixel for which the corresponding pixel of the i-th original image P (i) is determined to be the background pixel by the determination unit 450, the pixel corresponds to the (i−1) -th average image A (i−1). For the pixel at the position, the weighted average value of each pixel value of the three primary colors Because, by updating the respective average values obtained as a new pixel value, the process of creating the i-th and (i ≧ 2) of the reference image U (i) performing.

図10の中段には、参照画像作成部135で実行される演算内容が示されている。すなわち、参照画像作成部135は、最初の原画像P(1)が入力されたときに、当該原画像P(1)をそのまま最初の参照画像U(1)として参照画像格納部へ格納する処理を行い(図10中段の最下行)、以後、第i番目の原画像P(i)が入力されるたびに(i=2,3,...)、第i番目の参照画像U(i)の各画素値を、次のような方法で決定する処理を行う。   The middle part of FIG. 10 shows the calculation contents executed by the reference image creation unit 135. That is, when the first original image P (1) is input, the reference image creation unit 135 stores the original image P (1) as it is as the first reference image U (1) in the reference image storage unit. (The bottom row in the middle of FIG. 10), and thereafter, every time the i-th original image P (i) is input (i = 2, 3,...), The i-th reference image U (i ) Is determined by the following method.

この決定処理では、前背判定部450による判定結果が利用される。すなわち、前背判定部450によって背景画素と判定された画素(判定結果J=1が得られた画素)については、
u(i)=(1−v)・u(i−1)+v・a(i−1) 式(1B)
(但し、u(i)は、平均画像U(i)の
所定位置の画素の所定色の画素値、
u(i−1)は、平均画像U(i−1)の
前記所定位置の画素の前記所定色の画素値、
a(i−1)は、平均画像A(i−1)の
前記所定位置の画素の前記所定色の画素値、
vは、所定の重みを示すパラメータ(v<1))
なる演算式を用いて求められた画素値u(i)に更新し、
前景画素と判定された画素(判定結果J=0が得られた画素)については、
u(i)=u(i−1) 式(1C)
として、更新せずに、もとの画素値をそのまま維持する。
In this determination process, the determination result by the foreground determination unit 450 is used. That is, for a pixel determined as a background pixel by the foreground determination unit 450 (a pixel for which a determination result J = 1 is obtained),
u (i) = (1-v) .u (i-1) + v.a (i-1) Formula (1B)
(However, u (i) is the average image U (i)
A pixel value of a predetermined color of a pixel at a predetermined position,
u (i-1) is the average image U (i-1)
A pixel value of the predetermined color of the pixel at the predetermined position;
a (i-1) is the average image A (i-1)
A pixel value of the predetermined color of the pixel at the predetermined position;
v is a parameter indicating a predetermined weight (v <1))
Updated to the pixel value u (i) obtained using the following equation:
For pixels determined to be foreground pixels (pixels for which the determination result J = 0 is obtained)
u (i) = u (i-1) Formula (1C)
The original pixel value is maintained as it is without updating.

図10の下段には、前背判定部450で実行される判定処理の概念が表として示されている。前述したとおり、前背判定部450における判定処理は、第1判定部420で行われる画素値p(i)とa(i−1)との類否判定処理(表の横欄)と、第2判定部430で行われる画素値p(i)とu(i−1)との類否判定処理(表の縦欄)と、これらの判定結果に基づいて総合判定部440で行われる総合判定処理と、によって構成される。図10下段の表の横欄は、第1判定部420による判定結果の別(類似○/非類似×)を示し、縦欄は、第2判定部430による判定結果の別(類似○/非類似×)を示している。総合判定部440は、少なくとも一方が「類似○」を示す場合には背景画素(J=1)、双方とも「非類似×」を示す場合には前景画素(J=0)との判定を行うことになる。参照画像作成部135は、この判定結果Jを利用して、図10の中段に示す処理を実行する。   In the lower part of FIG. 10, the concept of determination processing executed by the foreground determination unit 450 is shown as a table. As described above, the determination process in the foreground determination unit 450 includes the similarity determination process (the column in the table) between the pixel values p (i) and a (i−1) performed in the first determination unit 420, 2 determination unit 430 performs similarity determination processing (columns in the table) of pixel values p (i) and u (i-1), and comprehensive determination performed by the comprehensive determination unit 440 based on these determination results And processing. The horizontal column in the lower table of FIG. 10 indicates the determination result by the first determination unit 420 (similar ○ / non-similar ×), and the vertical column indicates the determination result by the second determination unit 430 (similar Similarity x). The overall determination unit 440 determines that the background pixel (J = 1) if at least one indicates “similar ○”, and the foreground pixel (J = 0) if both indicate “similar x”. It will be. The reference image creation unit 135 uses the determination result J to execute the process shown in the middle part of FIG.

なお、実用上、この図9に示す移動物体検出装置も、コンピュータに専用のプログラムを組み込むことにより構築することができ、図9に各ブロックで示す構成要素は、コンピュータのハードウエアとソフトウエアとの組み合わせによって実現することができる。もちろん、この移動物体検出装置を半導体集積回路として構成することも可能である。   In practice, the moving object detection device shown in FIG. 9 can also be constructed by incorporating a dedicated program into the computer. The components shown in the blocks in FIG. 9 are the hardware and software of the computer. It can be realized by a combination of Of course, this moving object detection device can also be configured as a semiconductor integrated circuit.

<<< §5.画像変遷の実例 >>>
図11および図12は、図9に示す移動物体検出装置における各画像の変遷の一例を示す図である。前述したとおり、本発明を監視システムなどに利用する場合、実際には、原画像Pは1秒間に30フレーム程度の周期で入力されることになるが、ここでは、便宜上、平均画像Aと参照画像Uとの変遷態様の相違を説明するのに都合が良い非現実的なモデルを用いた変遷例を示すことにする。図11および図12に股がって示されている縦方向軸は、時間軸に対応しており、t1〜t15は時間軸上の各時点を示す。また、横方向に並べた3つの画像は、それぞれ各時点における原画像P,平均画像A,参照画像Uを示している。
<<< §5. Examples of image transition >>>
11 and 12 are diagrams illustrating an example of transition of each image in the moving object detection device illustrated in FIG. 9. As described above, when the present invention is used for a monitoring system or the like, the original image P is actually input at a cycle of about 30 frames per second. Here, for convenience, the average image A is referred to. An example of transition using an unrealistic model that is convenient for explaining the difference in transition mode from the image U will be shown. 11 and 12 correspond to the time axis, and t1 to t15 indicate each time point on the time axis. The three images arranged in the horizontal direction indicate the original image P, the average image A, and the reference image U at each time point, respectively.

<第1の時点t1>
まず、第1の時点t1において、図示のような原画像P(1)が与えられたものとしよう。ここでは、便宜上、原画像P(1)を真っ白な画像として示しているが、この真っ白な画像は、街頭に設置された監視カメラから見た背景を示す画像であるものとする。
<First time point t1>
First, assume that an original image P (1) as shown in the figure is given at a first time point t1. Here, for the sake of convenience, the original image P (1) is shown as a pure white image, but this pure white image is an image showing the background viewed from a surveillance camera installed on the street.

このような第1番目の原画像P(1)が与えられると、平均画像作成部130は、当該原画像P(1)をそのまま第1番目の平均画像A(1)として平均画像格納部140に格納する。同様に、参照画像作成部135は、当該原画像P(1)をそのまま第1番目の参照画像U(1)として参照画像格納部145に格納する。したがって、図11の最上段に示すとおり、第1の時点t1では、図示のような画像P(1),A(1),U(1)が得られることになる。   When such a first original image P (1) is given, the average image creating unit 130 uses the original image P (1) as the first average image A (1) as it is, and the average image storage unit 140. To store. Similarly, the reference image creation unit 135 stores the original image P (1) as it is in the reference image storage unit 145 as the first reference image U (1). Therefore, as shown in the uppermost part of FIG. 11, images P (1), A (1), and U (1) as illustrated are obtained at the first time point t1.

なお、原画像P(1),平均画像A(1),参照画像U(1)内に示された小さな正方形は、それぞれ同一位置(x,y)の画素p(1),a(1),u(1)を示している。以下、個々の画像について、この特定位置(x,y)に配置された特定の画素を代表画素として、この代表画素についてのみ、その画素値の変遷を追ってゆくことにする。ここで、各画素p(1),a(1),u(1)の画素値も画素と同じ符号で示すことにすれば、時点t1では、当然ながら、p(1)=a(1)=u(1)である。   The small squares shown in the original image P (1), average image A (1), and reference image U (1) are pixels p (1) and a (1) at the same position (x, y), respectively. , U (1). Hereinafter, for each image, a specific pixel arranged at the specific position (x, y) is used as a representative pixel, and the transition of the pixel value is followed only for this representative pixel. Here, if the pixel values of the pixels p (1), a (1), and u (1) are also denoted by the same reference numerals as the pixels, of course, at the time t1, p (1) = a (1) = U (1).

<第2の時点t2>
続いて、第2の時点t2において、図示のような原画像P(2)が与えられたものとしよう。ここで、原画像P(2)は原画像P(1)と全く同じ画像であり、監視カメラから見た背景に何ら変わりがなかった例を示している。したがって、画素値p(2)=p(1)である。次に、特定位置(x,y)に配置された画素についての前背判定部450による判定処理を考えると、第1判定部420では、画素p(2)と、1つ前の時点の画素a(1)との類否判定が行われ、第2判定部430では、画素p(2)と、1つ前の時点の画素u(1)との類否判定が行われる。図に実線で示す矢印は、この類否判定の相手先を示しており、矢印上の記号「○/×」は判定結果(○は類似/×は非類似)を示している。図示のとおり、p(2)=a(1)であり、p(2)=u(1)であるから、いずれも類似「○」との判定結果が得られ、前背判定部450は、J=1なる判定結果を出す。これは、画素p(2)が背景画素と判定されたことを意味する。
<Second time point t2>
Subsequently, it is assumed that an original image P (2) as illustrated is given at the second time point t2. Here, the original image P (2) is the same image as the original image P (1), and shows an example in which the background viewed from the surveillance camera is not changed at all. Therefore, the pixel value p (2) = p (1). Next, considering the determination processing by the foreground determination unit 450 for the pixel arranged at the specific position (x, y), the first determination unit 420 uses the pixel p (2) and the pixel at the previous time point. Similarity determination with a (1) is performed, and the second determination unit 430 performs similarity determination between the pixel p (2) and the pixel u (1) at the previous time point. An arrow indicated by a solid line in the figure indicates the other party of the similarity determination, and a symbol “◯ / ×” on the arrow indicates a determination result (◯ is similar / × is dissimilar). As shown in the figure, since p (2) = a (1) and p (2) = u (1), a determination result of similarity “O” is obtained, and the forefront determination unit 450 A determination result of J = 1 is obtained. This means that the pixel p (2) is determined as the background pixel.

さて、平均画像作成部130は、このような判定結果に依存することなしに、常に、図10に示す式(1A)に従って、平均画像Aの画素値aを更新する処理を行う。すなわち、時点t2における平均画像A(2)の特定位置(x,y)に配置されたの画素の画素値a(2)は、式(1A)に従って、a(2)=(1−w)・a(1)+w・p(2)なる演算によって求められ、画素値a(1)はa(2)に更新される。図の画素a(1)から画素a(2)に向かう破線および画素p(2)から画素a(2)に向かう破線は、式(1A)に従って、画素値a(1)および画素値p(2)に基づいて画素値a(2)が決定されることを示している。もっとも、実際には、a(1)=p(2)であるから、a(2)=a(1)となり、画素値自身に変動は生じない。   Now, the average image creation unit 130 always performs a process of updating the pixel value a of the average image A according to the equation (1A) shown in FIG. 10 without depending on such a determination result. That is, the pixel value a (2) of the pixel arranged at the specific position (x, y) of the average image A (2) at the time point t2 is expressed as a (2) = (1-w) according to the equation (1A). The pixel value a (1) is updated to a (2) by calculating a (1) + w · p (2). The broken line from the pixel a (1) to the pixel a (2) and the broken line from the pixel p (2) to the pixel a (2) are represented by the pixel value a (1) and the pixel value p ( It shows that the pixel value a (2) is determined based on 2). However, in actuality, since a (1) = p (2), a (2) = a (1), and the pixel value itself does not vary.

これに対して、参照画像作成部135は、図10に示すとおり、判定結果Jに依存して異なる処理を行うことになる。ここに示す例の場合、時点t2についての判定結果は、上述したとおり、J=1になるので、参照画像作成部135は、図10に示す式(1B)に従って、参照画像Uの画素値uを更新する処理を行う。すなわち、時点t2における参照画像U(2)の特定位置(x,y)に配置されたの画素の画素値u(2)は、式(1B)に従って、u(2)=(1−v)・u(1)+v・a(1)なる演算によって求められ、画素値u(1)はu(2)に更新される。図の画素u(1)から画素u(2)に向かう破線および画素a(1)から画素u(2)に向かう破線は、式(1B)に従って、画素値a(1)および画素値u(1)に基づいて画素値u(2)が決定されることを示している。もっとも、実際には、a(1)=u(1)であるから、u(2)=u(1)となり、画素値自身に変動は生じない。   On the other hand, the reference image creation unit 135 performs different processing depending on the determination result J as shown in FIG. In the example shown here, the determination result for the time point t2 is J = 1 as described above. Therefore, the reference image creation unit 135 performs the pixel value u of the reference image U according to the equation (1B) illustrated in FIG. Process to update. That is, the pixel value u (2) of the pixel arranged at the specific position (x, y) of the reference image U (2) at the time point t2 is u (2) = (1-v) according to the equation (1B). The pixel value u (1) is updated to u (2) by calculating u (1) + v · a (1). The broken line from the pixel u (1) to the pixel u (2) and the broken line from the pixel a (1) to the pixel u (2) in the figure are represented by the pixel value a (1) and the pixel value u ( It shows that the pixel value u (2) is determined based on 1). Of course, since a (1) = u (1), u (2) = u (1), and the pixel value itself does not vary.

<第3の時点t3>
続いて、第3の時点t3において、図示のような原画像P(3)が与えられたものとしよう。ここで、原画像P(3)は、視界に車両Vが侵入してきたため、背景上に車両V(移動物体)が重なった状態の画像になっている。したがって、画素値p(3)≠p(2)である。図では、画素p(3)を含む車両Vの部分を二重斜線ハッチング領域として示してある。
<Third time point t3>
Subsequently, it is assumed that an original image P (3) as illustrated is given at a third time point t3. Here, since the vehicle V has entered the field of view, the original image P (3) is an image in a state where the vehicle V (moving object) overlaps the background. Therefore, the pixel value p (3) ≠ p (2). In the figure, the portion of the vehicle V including the pixel p (3) is shown as a double hatched hatching region.

この時点t3における特定位置(x,y)に配置された画素についての前背判定部450による判定処理を考えると、第1判定部420では、画素p(3)と、1つ前の時点の画素a(2)との類否判定が行われ、第2判定部430では、画素p(3)と、1つ前の時点の画素u(2)との類否判定が行われる。ここでは、説明の便宜上、車両Vの部分(図の二重斜線ハッチング部分)の色が背景部分(図の白地部分)と大きく異なっているものとしよう。そうすると、p(3)≠a(2)であり、p(3)≠u(2)であるから、いずれも非類似「×」との判定結果が得られ、前背判定部450は、J=0なる判定結果を出す。これは、画素p(3)が前景画素と判定されたことを意味する。したがって、第3のマスク画像M3において、特定位置(x,y)の画素は前景領域(移動物体の領域)に含まれる。   Considering the determination processing by the foreground determination unit 450 for the pixel arranged at the specific position (x, y) at the time point t3, the first determination unit 420 determines that the pixel p (3) and the previous time point Similarity determination with the pixel a (2) is performed, and the second determination unit 430 performs similarity determination between the pixel p (3) and the pixel u (2) at the previous time point. Here, for convenience of explanation, it is assumed that the color of the portion of the vehicle V (double hatched hatching portion in the figure) is significantly different from the background portion (white background portion in the figure). Then, since p (3) ≠ a (2) and p (3) ≠ u (2), determination results of dissimilarity “x” are obtained, and the forefront determination unit 450 A determination result of = 0 is output. This means that the pixel p (3) is determined to be a foreground pixel. Accordingly, in the third mask image M3, the pixel at the specific position (x, y) is included in the foreground region (moving object region).

さて、平均画像作成部130は、このような判定結果に依存することなしに、常に、図10に示す式(1A)に従って、平均画像Aの画素値aを更新する処理を行う。すなわち、時点t3における平均画像A(3)の特定位置(x,y)に配置されたの画素の画素値a(3)は、式(1A)に従って、a(3)=(1−w)・a(2)+w・p(3)なる演算によって求められ、画素値a(2)はa(3)に更新される。ここで、画素値a(3)は、画素値p(3)の影響を受けるため、画素値a(2)から変動することになる。図では、このようにして画素値が変動した画素a(3)に中濃ハッチングを施して示すことにする。   Now, the average image creation unit 130 always performs a process of updating the pixel value a of the average image A according to the equation (1A) shown in FIG. 10 without depending on such a determination result. That is, the pixel value a (3) of the pixel arranged at the specific position (x, y) of the average image A (3) at the time point t3 is expressed as a (3) = (1-w) according to the equation (1A). The pixel value a (2) is updated to a (3) by a calculation of a (2) + w · p (3). Here, since the pixel value a (3) is affected by the pixel value p (3), the pixel value a (3) varies from the pixel value a (2). In the figure, the pixel a (3) whose pixel value has changed in this way is shown by being shaded with medium density.

一方、参照画像作成部135は、図10に示すとおり、判定結果J=0の場合は、値を更新しない。したがって、1つ前の時点の画素値u(2)をそのまま画素値u(3)として維持することになる。図の画素u(2)から画素u(3)に向かう破線は、更新が行われずに、元の画素値がそのまま維持されることを示している。   On the other hand, as shown in FIG. 10, the reference image creation unit 135 does not update the value when the determination result J = 0. Therefore, the pixel value u (2) at the previous time point is maintained as the pixel value u (3) as it is. The broken line from pixel u (2) to pixel u (3) in the figure indicates that the original pixel value is maintained as it is without being updated.

<第4の時点t4>
続いて、第4の時点t4において、図示のような原画像P(4)が与えられたものとしよう。この原画像P(4)では、車両Vが視界から消え、元の原画像P(1),P(2)と同じ状態に戻っている。したがって、画素値p(4)≠p(3)である。
<Fourth time point t4>
Subsequently, it is assumed that an original image P (4) as illustrated is given at the fourth time point t4. In this original image P (4), the vehicle V disappears from the field of view and returns to the same state as the original images P (1) and P (2). Therefore, the pixel value p (4) ≠ p (3).

この時点t4における前背判定部450による判定処理を考えると、第1判定部420では、画素p(4)と、1つ前の時点の画素a(3)との類否判定が行われ、第2判定部430では、画素p(4)と、1つ前の時点の画素u(3)との類否判定が行われる。ここでは、説明の便宜上、図の中濃ハッチング部分で示す色が、白地部分で示す色の類似範囲内にギリギリ入っていたものとしよう。実際、重みwの値を0.01程度に設定すると、車両Vが視界を通り過ぎた程度では、平均画像Aの画素値変動はそれほど大きくなく、画素値p(4)とa(3)とが類似範囲に入るケースは現実的である。また、画素値u(3)は更新されずに画素値u(2)を維持しているので、当然、画素値p(4)=u(3)である。よって、いずれの判定においても類似「○」との判定結果が得られ、前背判定部450は、J=1なる判定結果を出す。これは、画素p(4)が背景画素と判定されたことを意味する。   Considering the determination process by the foreground determination unit 450 at this time point t4, the first determination unit 420 performs similarity determination between the pixel p (4) and the pixel a (3) at the previous time point. The second determination unit 430 performs similarity determination between the pixel p (4) and the previous pixel u (3). Here, for convenience of explanation, it is assumed that the color indicated by the dark hatched portion in the figure is within the similar range of the color indicated by the white background portion. Actually, when the value of the weight w is set to about 0.01, the pixel value variation of the average image A is not so large when the vehicle V passes the field of view, and the pixel values p (4) and a (3) are different. Cases that fall within the similar range are realistic. Further, since the pixel value u (3) is maintained without being updated, the pixel value p (4) = u (3) is naturally satisfied. Therefore, a determination result of similarity “◯” is obtained in any determination, and the foreground determination unit 450 outputs a determination result of J = 1. This means that the pixel p (4) is determined as the background pixel.

平均画像作成部130は、このような判定結果に依存することなしに、式(1A)に従って、a(4)=(1−w)・a(3)+w・p(4)なる演算によって求められ、画素値a(3)はa(4)に更新される。ここで、画素値a(4)は、画素値p(4)の影響を受けるため、画素値a(3)から変動する。図では、このようにして画素値が変動した画素a(4)を白地の画素として示してある。   The average image creation unit 130 does not depend on such a determination result and obtains it by an operation of a (4) = (1−w) · a (3) + w · p (4) according to the equation (1A). The pixel value a (3) is updated to a (4). Here, since the pixel value a (4) is affected by the pixel value p (4), it varies from the pixel value a (3). In the figure, the pixel a (4) whose pixel value has changed in this way is shown as a white background pixel.

これに対して、参照画像作成部135は、判定結果がJ=1になるので、式(1B)に従って、u(4)=(1−v)・u(3)+v・a(3)なる演算によって求められ、画素値u(3)はu(4)に更新される。図では、このようにして画素値が変動した画素u(4)に薄いハッチングを施して示すことにする。   On the other hand, since the determination result is J = 1, the reference image creation unit 135 becomes u (4) = (1−v) · u (3) + v · a (3) according to the equation (1B). The pixel value u (3) is updated to u (4). In the figure, the pixel u (4) whose pixel value has changed in this way is shown by being thinly hatched.

<第5の時点t5>
続いて、第5の時点t5において、図示のような原画像P(5)が与えられたものとしよう。この原画像P(5)では、再び視界に車両Vが侵入してきたため、背景上に車両V(移動物体)が重なった状態の画像になっている。したがって、画素値p(5)≠p(4)である。図では、画素p(5)を含む車両Vの部分を二重斜線ハッチング領域として示してある。
<5th time t5>
Subsequently, it is assumed that an original image P (5) as illustrated is given at a fifth time point t5. In the original image P (5), since the vehicle V has entered the field of view again, the image is a state in which the vehicle V (moving object) is superimposed on the background. Therefore, the pixel value p (5) ≠ p (4). In the figure, the portion of the vehicle V including the pixel p (5) is shown as a double hatched hatching region.

この時点t5における前背判定部450による判定処理を考えると、第1判定部420では、画素p(5)と、1つ前の時点の画素a(4)との類否判定が行われ、第2判定部430では、画素p(5)と、1つ前の時点の画素u(4)との類否判定が行われる。図示の例では、いずれも非類似「×」との判定結果が得られ、前背判定部450は、J=0なる判定結果を出している。これは、画素p(5)が前景画素と判定されたことを意味する。したがって、第5のマスク画像M5において、特定位置(x,y)の画素は前景領域(移動物体の領域)に含まれる。   Considering the determination processing by the foreground determination unit 450 at this time t5, the first determination unit 420 performs similarity determination between the pixel p (5) and the pixel a (4) at the previous time point. The second determination unit 430 performs similarity determination between the pixel p (5) and the pixel u (4) at the previous time point. In the illustrated example, a determination result of dissimilarity “x” is obtained in all cases, and the foreground determination unit 450 outputs a determination result that J = 0. This means that the pixel p (5) is determined to be a foreground pixel. Accordingly, in the fifth mask image M5, the pixel at the specific position (x, y) is included in the foreground area (the area of the moving object).

平均画像作成部130は、このような判定結果に依存することなしに、式(1A)に従って、a(5)=(1−w)・a(4)+w・p(5)なる演算を行い、画素値a(4)はa(5)に更新される。図では、このようにして画素値が変動した画素a(5)に中濃ハッチングを施して示してある。一方、参照画像作成部135は、判定結果J=0を受けて、値を更新しない。したがって、1つ前の時点の画素値u(4)をそのまま画素値u(5)として維持することになる。   The average image creation unit 130 performs an operation of a (5) = (1−w) · a (4) + w · p (5) according to the equation (1A) without depending on such a determination result. The pixel value a (4) is updated to a (5). In the figure, the pixel a (5) whose pixel value has changed in this way is shown by being shaded with medium density. On the other hand, the reference image creation unit 135 receives the determination result J = 0 and does not update the value. Accordingly, the pixel value u (4) at the previous time point is maintained as the pixel value u (5) as it is.

<第6の時点t6>
続いて、第6の時点t6において、図示のような原画像P(6)が与えられたものとしよう。ここでは、時点t5で侵入してきた車両Vが、そのままの位置で駐車してしまった場合を考えてみよう。この場合、原画像P(6)は原画像P(5)と全く同じになる。
<Sixth time point t6>
Subsequently, it is assumed that an original image P (6) as illustrated is given at a sixth time point t6. Here, let us consider a case where the vehicle V that has entered at time t5 is parked at the same position. In this case, the original image P (6) is exactly the same as the original image P (5).

この時点t6における前背判定部450による判定処理を考えると、第1判定部420では、画素p(6)と、1つ前の時点の画素a(5)との類否判定が行われ、第2判定部430では、画素p(6)と、1つ前の時点の画素u(5)との類否判定が行われる。図示の例では、いずれも非類似「×」との判定結果が得られ、前背判定部450は、J=0なる判定結果を出している。これは、画素p(6)が前景画素と判定されたことを意味する。したがって、第6のマスク画像M6において、特定位置(x,y)の画素は前景領域(移動物体の領域)に含まれる。   Considering the determination processing by the foreground determination unit 450 at this time point t6, the first determination unit 420 performs similarity determination between the pixel p (6) and the pixel a (5) at the previous time point. The second determination unit 430 performs similarity determination between the pixel p (6) and the previous pixel u (5). In the illustrated example, a determination result of dissimilarity “x” is obtained in all cases, and the foreground determination unit 450 outputs a determination result that J = 0. This means that the pixel p (6) is determined to be a foreground pixel. Therefore, in the sixth mask image M6, the pixel at the specific position (x, y) is included in the foreground region (moving object region).

一般に、重みw,vを小さく設定しておけば、原画像Pに対する平均画像Aや参照画像Uの追随速度は小さくなるので、車両Vが駐車していた場合でも、当該車両Vが背景に溶け込み、背景の一部として認識されるまでには時間がかかることになる。したがって、図示の例では、車両Vは時点t6ではまだ移動物体として認識されることになる。   In general, if the weights w and v are set to be small, the follow-up speed of the average image A and the reference image U with respect to the original image P becomes small. Therefore, even when the vehicle V is parked, the vehicle V blends into the background. It takes time to be recognized as part of the background. Therefore, in the illustrated example, the vehicle V is still recognized as a moving object at time t6.

平均画像作成部130は、このような判定結果に依存することなしに、式(1A)に従って、a(6)=(1−w)・a(5)+w・p(6)なる演算を行い、画素値a(5)はa(6)に更新される。図では、このようにして画素値が変動した画素a(5)に斜線ハッチングを施して示してある。一方、参照画像作成部135は、判定結果J=0を受けて、値を更新しない。したがって、1つ前の時点の画素値u(5)をそのまま画素値u(6)として維持することになる。結果的に、時刻t4の画素値u(4)が時刻t6においても画素値u(6)として維持されることになる。   The average image creation unit 130 performs an operation of a (6) = (1−w) · a (5) + w · p (6) according to the equation (1A) without depending on such a determination result. The pixel value a (5) is updated to a (6). In the figure, the pixel a (5) whose pixel value has changed in this way is indicated by hatching. On the other hand, the reference image creation unit 135 receives the determination result J = 0 and does not update the value. Accordingly, the pixel value u (5) at the previous time point is maintained as the pixel value u (6) as it is. As a result, the pixel value u (4) at time t4 is maintained as the pixel value u (6) at time t6.

<第7の時点t7>
続いて、第7の時点t7において、図示のような原画像P(7)が与えられたものとしよう。この例では、時点t5で侵入してきた車両Vが駐車状態にあり、原画像P(7)は原画像P(6)と全く同じ状態である。
<Seventh time point t7>
Subsequently, it is assumed that an original image P (7) as illustrated is given at a seventh time point t7. In this example, the vehicle V that has entered at time t5 is in a parked state, and the original image P (7) is exactly the same as the original image P (6).

この時点t7における前背判定部450による判定処理を考えると、第1判定部420では、画素p(7)と、1つ前の時点の画素a(6)との類否判定が行われ、第2判定部430では、画素p(7)と、1つ前の時点の画素u(6)との類否判定が行われる。ここでは、第1判定部420では類似「○」との判定結果が得られ、第2判定部430では非類似「×」との判定結果が得られたものとしよう。平均画像Aは新たな原画像Pにより常に更新されるのに対して、参照画像Uは条件付き更新が行われるので、原画像Pの変化に対する追随速度は両者で異なる。このため、2つの判定部による判定結果に差が生じることになる。   Considering the determination process by the foreground determination unit 450 at this time t7, the first determination unit 420 performs similarity determination between the pixel p (7) and the pixel a (6) at the previous time point, The second determination unit 430 performs similarity determination between the pixel p (7) and the pixel u (6) at the previous time point. Here, it is assumed that the first determination unit 420 obtains a determination result of similarity “◯” and the second determination unit 430 obtains a determination result of dissimilarity “x”. While the average image A is constantly updated with a new original image P, the reference image U is conditionally updated, so that the following speed with respect to the change in the original image P is different. For this reason, a difference arises in the determination result by two determination parts.

図示の例では、画素a(6)の色は画素p(7)の色にかなり近くなってきているため類似「○」との判定結果が得られたが、画素u(6)の色は、まだ画素p(7)の色に対して差があるため非類似「×」との判定結果が得られている。図10の前背判定部450の判定表に示すとおり、一方が類似「○」、他方が非類似「×」との判定結果が得られた場合、前背判定部450は、当該画素を背景画素と判定し、J=1なる判定結果を出力する。したがって、第7のマスク画像M7において、特定位置(x,y)の画素は背景領域に含まれる。すなわち、時点t7において、駐車中の車両Vは背景に溶け込んだものと認識されることになる。   In the illustrated example, since the color of the pixel a (6) is much closer to the color of the pixel p (7), a similar determination result “◯” is obtained, but the color of the pixel u (6) is Since there is still a difference with respect to the color of the pixel p (7), a determination result of dissimilarity “x” is obtained. As shown in the determination table of the foreground determination unit 450 in FIG. 10, when a determination result that one is similar “O” and the other is dissimilar “x” is obtained, the foreground determination unit 450 sets the pixel as the background The pixel is determined, and a determination result of J = 1 is output. Therefore, in the seventh mask image M7, the pixel at the specific position (x, y) is included in the background area. That is, at time t7, the parked vehicle V is recognized as having melted into the background.

平均画像作成部130は、このような判定結果に依存することなしに、式(1A)に従って、a(7)=(1−w)・a(6)+w・p(7)なる演算を行い、画素値a(6)はa(7)に更新される。図では、このようにして画素値が変動した画素a(6)に斜線ハッチングを施して示してある(実際には、画素値a(6)とa(7)とは若干異なるが、図では便宜上、同一ハッチングを施して示す)。一方、参照画像作成部135は、判定結果がJ=1になるので、式(1B)に従って、u(7)=(1−v)・u(6)+v・a(6)なる演算を行い、画素値u(6)をu(7)に更新する。図では、このようにして画素値が変動した画素u(7)に中濃ハッチングを施して示してある。   The average image creation unit 130 performs an operation of a (7) = (1−w) · a (6) + w · p (7) according to the equation (1A) without depending on such a determination result. The pixel value a (6) is updated to a (7). In the figure, the pixel a (6) whose pixel value has changed in this way is shown by hatching (actually, the pixel values a (6) and a (7) are slightly different. For convenience, it is shown with the same hatching). On the other hand, since the determination result is J = 1, the reference image creation unit 135 performs an operation of u (7) = (1−v) · u (6) + v · a (6) according to the equation (1B). , The pixel value u (6) is updated to u (7). In the figure, the pixel u (7) whose pixel value has been changed in this way is shown with medium-dark hatching.

<第8の時点t8>
続いて、第8の時点t8において、図示のような原画像P(8)が与えられたものとしよう。この例では、時点t5で侵入してきた車両Vが駐車状態にあり、原画像P(8)は原画像P(7)と全く同じ状態である。
<Eighth time point t8>
Subsequently, it is assumed that an original image P (8) as illustrated is given at an eighth time point t8. In this example, the vehicle V that has entered at time t5 is in a parked state, and the original image P (8) is exactly the same as the original image P (7).

この時点t8における前背判定部450による判定処理を考えると、第1判定部420では、画素p(8)と、1つ前の時点の画素a(7)との類否判定が行われ、第2判定部430では、画素p(8)と、1つ前の時点の画素u(7)との類否判定が行われる。ここでは、第1判定部420では類似「○」との判定結果が得られ、第2判定部430では非類似「×」との判定結果が得られたものとしよう。   Considering the determination process by the foreground determination unit 450 at this time point t8, the first determination unit 420 performs similarity determination between the pixel p (8) and the pixel a (7) at the previous time point. The second determination unit 430 performs similarity determination between the pixel p (8) and the previous pixel u (7). Here, it is assumed that the first determination unit 420 obtains a determination result of similarity “◯” and the second determination unit 430 obtains a determination result of dissimilarity “x”.

図示の例では、画素a(7)の色は画素p(8)の色にかなり近くなってきているため類似「○」との判定結果が得られたが、画素u(7)の色は、まだ画素p(8)の色に対して差があるため非類似「×」との判定結果が得られている。その結果、前背判定部450は、当該画素を背景画素と判定し、J=1なる判定結果を出力する。したがって、第8のマスク画像M8において、特定位置(x,y)の画素は背景領域に含まれる。   In the illustrated example, since the color of the pixel a (7) is much closer to the color of the pixel p (8), a similar determination result “◯” is obtained, but the color of the pixel u (7) is Since there is still a difference with respect to the color of the pixel p (8), a determination result of dissimilarity “x” is obtained. As a result, the foreground determination unit 450 determines that the pixel is a background pixel and outputs a determination result of J = 1. Therefore, in the eighth mask image M8, the pixel at the specific position (x, y) is included in the background area.

平均画像作成部130は、このような判定結果に依存することなしに、式(1A)に従って、a(8)=(1−w)・a(7)+w・p(8)なる演算を行い、画素値a(7)はa(8)に更新される。図では、このようにして画素値が変動した画素a(8)に斜線ハッチングを施して示してある(実際には、画素値a(7)とa(8)とは若干異なるが、図では便宜上、同一ハッチングを施して示す)。一方、参照画像作成部135は、判定結果がJ=1になるので、式(1B)に従って、u(8)=(1−v)・u(7)+v・a(7)なる演算を行い、画素値u(7)をu(8)に更新する。図では、このようにして画素値が変動した画素u(8)に斜線ハッチングを施して示してある。   The average image creation unit 130 performs an operation of a (8) = (1−w) · a (7) + w · p (8) according to the equation (1A) without depending on such a determination result. The pixel value a (7) is updated to a (8). In the figure, the pixel a (8) whose pixel value has changed in this way is shown by hatching (in practice, the pixel values a (7) and a (8) are slightly different, For convenience, it is shown with the same hatching). On the other hand, since the determination result is J = 1, the reference image creation unit 135 performs an operation of u (8) = (1−v) · u (7) + v · a (7) according to the equation (1B). The pixel value u (7) is updated to u (8). In the figure, the pixel u (8) whose pixel value has changed in this way is indicated by hatching.

<第9の時点t9>
続いて、図12に示す第9の時点t9について説明する(図12の最上段に示す第8の時点t8の各画像は、図11の最下段に示す第8の時点t8の各画像と同じものである)。ここでは、第9の時点t9において、図示のような原画像P(9)が与えられたものとしよう。この例では、時点t5で侵入してきた車両Vが依然として駐車状態にあり、原画像P(9)は原画像P(8)と全く同じ状態である。
<9th time point t9>
Next, the ninth time point t9 shown in FIG. 12 will be described (the images at the eighth time point t8 shown in the uppermost part of FIG. 12 are the same as the images at the eighth time point t8 shown in the lowermost part of FIG. 11). ). Here, it is assumed that the original image P (9) as illustrated is given at the ninth time point t9. In this example, the vehicle V that has entered at time t5 is still parked, and the original image P (9) is exactly the same as the original image P (8).

この時点t9における前背判定部450による判定処理を考えると、第1判定部420では、画素p(9)と、1つ前の時点の画素a(8)との類否判定が行われ、第2判定部430では、画素p(9)と、1つ前の時点の画素u(8)との類否判定が行われる。ここでは、いずれの判定結果も類似「○」との判定結果が得られたものとしよう。すなわち、車両Vが長時間駐車していたため、平均画像Aにおいても参照画像Uにおいても、この車両Vの領域が背景に溶け込んだ状態になり、画素p(9)は、いずれの判定部においても背景画素と判定されるに至ったことになる。したがって、第9のマスク画像M9において、特定位置(x,y)の画素は背景領域に含まれる。   Considering the determination processing by the foreground determination unit 450 at this time point t9, the first determination unit 420 performs similarity determination between the pixel p (9) and the pixel a (8) at the previous time point. The second determination unit 430 performs similarity determination between the pixel p (9) and the previous pixel u (8). Here, it is assumed that a determination result of similar “◯” is obtained for any of the determination results. That is, since the vehicle V has been parked for a long time, both the average image A and the reference image U are in a state in which the area of the vehicle V has melted into the background, and the pixel p (9) is in any determination unit. It is determined that the pixel is a background pixel. Accordingly, in the ninth mask image M9, the pixel at the specific position (x, y) is included in the background area.

平均画像作成部130は、このような判定結果に依存することなしに、式(1A)に従って、a(9)=(1−w)・a(8)+w・p(9)なる演算を行い、画素値a(8)はa(9)に更新される。図では、このようにして画素値が変動した画素a(9)に斜線ハッチングを施して示してある(実際には、画素値a(8)とa(9)とは若干異なるが、図では便宜上、同一ハッチングを施して示す)。一方、参照画像作成部135は、判定結果がJ=1になるので、式(1B)に従って、u(9)=(1−v)・u(8)+v・a(8)なる演算を行い、画素値u(8)をu(9)に更新する。図では、このようにして画素値が変動した画素u(9)に斜線ハッチングを施して示してある(実際には、画素値u(8)とu(9)とは若干異なるが、図では便宜上、同一ハッチングを施して示す)。   The average image creation unit 130 performs an operation of a (9) = (1−w) · a (8) + w · p (9) according to the equation (1A) without depending on such a determination result. The pixel value a (8) is updated to a (9). In the figure, the pixel a (9) whose pixel value has changed in this way is shown by hatching (in practice, the pixel values a (8) and a (9) are slightly different, For convenience, it is shown with the same hatching). On the other hand, since the determination result is J = 1, the reference image creation unit 135 performs an operation of u (9) = (1−v) · u (8) + v · a (8) according to the equation (1B). , The pixel value u (8) is updated to u (9). In the figure, the pixel u (9) whose pixel value has been changed in this way is shown by hatching (actually, the pixel values u (8) and u (9) are slightly different. For convenience, it is shown with the same hatching).

<第10の時点t10>
続いて、第10の時点t10において、図示のような原画像P(10)が与えられたものとしよう。この原画像P(10)では、これまで駐車していた車両Vが視界から消え、第1番目の原画像P(1)と同じ状態に戻っている。したがって、画素値p(10)≠p(9)である。
<Tenth time point t10>
Subsequently, it is assumed that an original image P (10) as illustrated is given at a tenth time point t10. In the original image P (10), the vehicle V that has been parked so far disappears from the field of view and returns to the same state as the first original image P (1). Therefore, the pixel value p (10) ≠ p (9).

この時点t10における前背判定部450による判定処理を考えると、第1判定部420では、画素p(10)と、1つ前の時点の画素a(9)との類否判定が行われ、第2判定部430では、画素p(10)と、1つ前の時点の画素u(9)との類否判定が行われる。画素a(9)および画素u(9)の色は、いずれも車両Vの色にかなり近づいていたため、図示の例では、いずれも非類似「×」との判定結果が得られ、前背判定部450は、J=0なる判定結果を出している。これは、画素p(10)が前景画素と判定されたことを意味する。したがって、第10のマスク画像M10において、特定位置(x,y)の画素は前景領域(移動物体の領域)に含まれる。   Considering the determination processing by the foreground determination unit 450 at this time t10, the first determination unit 420 performs similarity determination between the pixel p (10) and the pixel a (9) at the previous time point, The second determination unit 430 performs similarity determination between the pixel p (10) and the pixel u (9) at the previous time point. Since the colors of the pixel a (9) and the pixel u (9) are both very close to the color of the vehicle V, in the example shown in the figure, a determination result of dissimilar “x” is obtained, and the front determination The unit 450 outputs a determination result that J = 0. This means that the pixel p (10) is determined to be a foreground pixel. Accordingly, in the tenth mask image M10, the pixel at the specific position (x, y) is included in the foreground region (moving object region).

結局、この例の場合、第10の原画像P(10)上には車両Vは存在していないが、第10のマスク画像M10上では、車両Vがかつて存在していた領域が前景領域Fとして検出されることになる。もちろん、現実的な監視カメラの撮影画像の場合は、時点t9から時点t10に至るときに車両Vが忽然と消えることはなく、車両Vは画面上を徐々に移動して去ってゆくことになるので、実際には、徐々に移動中の車両Vの占有領域がマスク画像M上に前景領域Fとして現れることになる。   After all, in this example, the vehicle V does not exist on the tenth original image P (10), but on the tenth mask image M10, the region where the vehicle V once existed is the foreground region F. Will be detected. Of course, in the case of an image captured by a realistic surveillance camera, the vehicle V does not disappear suddenly from the time t9 to the time t10, and the vehicle V gradually moves on the screen and leaves. Actually, the occupied area of the moving vehicle V gradually appears as a foreground area F on the mask image M.

平均画像作成部130は、このような判定結果に依存することなしに、式(1A)に従って、a(10)=(1−w)・a(9)+w・p(10)なる演算を行い、画素値a(9)はa(10)に更新される。図では、このようにして画素値が変動した画素a(10)に中濃ハッチングを施して示してある。一方、参照画像作成部135は、判定結果J=0を受けて、値を更新しない。したがって、1つ前の時点の画素値u(9)をそのまま画素値u(10)として維持することになる。   The average image creation unit 130 performs an operation of a (10) = (1−w) · a (9) + w · p (10) according to the equation (1A) without depending on such a determination result. The pixel value a (9) is updated to a (10). In the figure, the pixel a (10) whose pixel value has changed in this way is shown by being shaded with medium density. On the other hand, the reference image creation unit 135 receives the determination result J = 0 and does not update the value. Accordingly, the pixel value u (9) at the previous time point is maintained as the pixel value u (10) as it is.

<第11の時点t11>
続いて、第11の時点t11において、図示のような原画像P(11)が与えられたものとしよう。この例では、原画像P(11)は、視界に車両Vが再び侵入してきたため、背景上に車両V(移動物体)が重なった状態の画像になっている。したがって、画素値p(11)≠p(10)である。
<Eleventh time point t11>
Subsequently, it is assumed that an original image P (11) as illustrated is given at an eleventh time point t11. In this example, the original image P (11) is an image in a state where the vehicle V (moving object) overlaps the background because the vehicle V has entered the field of view again. Therefore, the pixel value p (11) ≠ p (10).

この時点t11における特定位置(x,y)に配置された画素についての前背判定部450による判定処理を考えると、第1判定部420では、画素p(11)と、1つ前の時点の画素a(10)との類否判定が行われ、第2判定部430では、画素p(11)と、1つ前の時点の画素u(10)との類否判定が行われる。ここでは、第1判定部420では非類似「×」との判定結果が得られ、第2判定部430では類似「○」との判定結果が得られたものとしよう。   Considering the determination processing by the foreground determination unit 450 for the pixel arranged at the specific position (x, y) at the time t11, the first determination unit 420 determines that the pixel p (11) and the previous time point Similarity determination with the pixel a (10) is performed, and the second determination unit 430 performs similarity determination between the pixel p (11) and the pixel u (10) at the previous time point. Here, it is assumed that the first determination unit 420 obtains a determination result of dissimilarity “x” and the second determination unit 430 obtains a determination result of similarity “◯”.

図示の例では、画素a(10)の色は画素p(10)の影響を受けて背景の色に近づいていたため、車両の一部を構成する画素p(11)に対しては非類似「×」との判定結果が得られたが、画素u(10)は更新されなかったため、画素p(11)に対して類似「○」との判定結果が得られたことになる。図10の前背判定部450の判定表に示すとおり、一方が類似「○」、他方が非類似「×」との判定結果が得られた場合、前背判定部450は、当該画素を背景画素と判定し、J=1なる判定結果を出力する。したがって、第11のマスク画像M11において、特定位置(x,y)の画素は背景領域に含まれる。すなわち、ここに示す非現実的なモデルの場合、時点t11に出現した車両Vは、マスク画像M11上では移動物体として検出されない。ただ、後述するように、マスク画像M12上で検出されることになる。   In the example shown in the figure, the color of the pixel a (10) is close to the background color due to the influence of the pixel p (10), and thus the pixel p (11) constituting a part of the vehicle is not similar. A determination result of “×” was obtained, but the pixel u (10) was not updated, and thus a determination result of similarity “◯” was obtained for the pixel p (11). As shown in the determination table of the foreground determination unit 450 in FIG. 10, when a determination result that one is similar “O” and the other is dissimilar “x” is obtained, the foreground determination unit 450 sets the pixel as the background The pixel is determined, and a determination result of J = 1 is output. Accordingly, in the eleventh mask image M11, the pixel at the specific position (x, y) is included in the background area. That is, in the case of the unreal model shown here, the vehicle V that appears at time t11 is not detected as a moving object on the mask image M11. However, as will be described later, it is detected on the mask image M12.

平均画像作成部130は、このような判定結果に依存することなしに、式(1A)に従って、a(11)=(1−w)・a(10)+w・p(11)なる演算を行い、画素値a(10)はa(11)に更新される。図では、このようにして画素値が変動した画素a(11)に斜線ハッチングを施して示してある。一方、参照画像作成部135は、判定結果がJ=1になるので、式(1B)に従って、u(11)=(1−v)・u(10)+v・a(10)なる演算を行い、画素値u(10)をu(11)に更新する。図では、このようにして画素値が変動した画素u(11)に斜線ハッチングを施して示してある(実際には、画素値u(10)とu(11)とは若干異なるが、図では便宜上、同一ハッチングを施して示す)。   The average image creation unit 130 performs an operation of a (11) = (1−w) · a (10) + w · p (11) according to the equation (1A) without depending on such a determination result. The pixel value a (10) is updated to a (11). In the figure, the pixel a (11) whose pixel value has changed in this way is indicated by hatching. On the other hand, since the determination result is J = 1, the reference image creation unit 135 performs an operation of u (11) = (1−v) · u (10) + v · a (10) according to the equation (1B). The pixel value u (10) is updated to u (11). In the figure, the pixel u (11) whose pixel value has changed in this way is shown by hatching (actually, the pixel values u (10) and u (11) are slightly different, but in the figure, For convenience, it is shown with the same hatching).

<第12の時点t12>
続いて、第12の時点t12について説明する。ここでは、第12の時点t12において、図示のような原画像P(12)が与えられたものとしよう。この例では、車両Vが視界から消え、第1番目の原画像P(1)と同じ状態に戻っている。したがって、画素値p(12)≠p(11)である。
<Twelfth time point t12>
Subsequently, the twelfth time point t12 will be described. Here, it is assumed that the original image P (12) as illustrated is given at the twelfth time point t12. In this example, the vehicle V disappears from the field of view and returns to the same state as the first original image P (1). Therefore, the pixel value p (12) ≠ p (11).

この時点t12における前背判定部450による判定処理を考えると、第1判定部420では、画素p(12)と、1つ前の時点の画素a(11)との類否判定が行われ、第2判定部430では、画素p(12)と、1つ前の時点の画素u(11)との類否判定が行われる。画素a(11)および画素u(11)の色は、いずれも車両Vの色にかなり近いため、図示の例では、いずれも非類似「×」との判定結果が得られ、前背判定部450は、J=0なる判定結果を出している。これは、画素p(12)が前景画素と判定されたことを意味する。したがって、第12のマスク画像M12において、特定位置(x,y)の画素は前景領域(移動物体の領域)に含まれる。   Considering the determination process by the foreground determination unit 450 at this time t12, the first determination unit 420 performs similarity determination between the pixel p (12) and the pixel a (11) at the previous time point. The second determination unit 430 performs similarity determination between the pixel p (12) and the pixel u (11) at the previous time point. Since the colors of the pixel a (11) and the pixel u (11) are both very close to the color of the vehicle V, in the illustrated example, a determination result of dissimilarity “x” is obtained, and the foreground determination unit 450 outputs a determination result of J = 0. This means that the pixel p (12) is determined to be a foreground pixel. Accordingly, in the twelfth mask image M12, the pixel at the specific position (x, y) is included in the foreground region (moving object region).

平均画像作成部130は、このような判定結果に依存することなしに、式(1A)に従って、a(12)=(1−w)・a(11)+w・p(12)なる演算を行い、画素値a(11)はa(12)に更新される。図では、このようにして画素値が変動した画素a(12)に中濃ハッチングを施して示してある。一方、参照画像作成部135は、判定結果J=0を受けて、値を更新しない。したがって、1つ前の時点の画素値u(11)をそのまま画素値u(12)として維持することになる。   The average image creation unit 130 performs an operation of a (12) = (1−w) · a (11) + w · p (12) according to the equation (1A) without depending on such a determination result. The pixel value a (11) is updated to a (12). In the figure, the pixel a (12) whose pixel value has changed in this way is shown by being shaded with medium density. On the other hand, the reference image creation unit 135 receives the determination result J = 0 and does not update the value. Accordingly, the pixel value u (11) at the previous time point is maintained as the pixel value u (12) as it is.

<第13の時点t13>
続いて、第13の時点t13において、図示のような原画像P(13)が与えられたものとしよう。この例では、画像内に新たな車両の侵入はなく、原画像P(13)は第1番目の原画像P(1)と全く同じ状態である。
<13th time point t13>
Subsequently, it is assumed that an original image P (13) as illustrated is given at a thirteenth time point t13. In this example, there is no new vehicle intrusion in the image, and the original image P (13) is exactly the same as the first original image P (1).

この時点t13における前背判定部450による判定処理を考えると、第1判定部420では、画素p(13)と、1つ前の時点の画素a(12)との類否判定が行われ、第2判定部430では、画素p(13)と、1つ前の時点の画素u(12)との類否判定が行われる。ここでは、第1判定部420では類似「○」との判定結果が得られ、第2判定部430では非類似「×」との判定結果が得られたものとしよう。前背判定部450は、この判定結果に基づいて当該画素を背景画素と判定し、J=1なる判定結果を出力する。したがって、第13のマスク画像M13において、特定位置(x,y)の画素は背景領域に含まれる。   Considering the determination processing by the foreground determination unit 450 at this time point t13, the first determination unit 420 performs similarity determination between the pixel p (13) and the pixel a (12) at the previous time point. The second determination unit 430 performs similarity determination between the pixel p (13) and the pixel u (12) at the previous time point. Here, it is assumed that the first determination unit 420 obtains a determination result of similarity “◯” and the second determination unit 430 obtains a determination result of dissimilarity “x”. The foreground determination unit 450 determines that the pixel is a background pixel based on the determination result, and outputs a determination result of J = 1. Therefore, in the thirteenth mask image M13, the pixel at the specific position (x, y) is included in the background area.

平均画像作成部130は、このような判定結果に依存することなしに、式(1A)に従って、a(13)=(1−w)・a(12)+w・p(13)なる演算を行い、画素値a(12)はa(13)に更新される。図では、このようにして画素値が変動した画素a(13)に薄いハッチングを施して示してある。一方、参照画像作成部135は、判定結果がJ=1になるので、式(1B)に従って、u(13)=(1−v)・u(12)+v・a(12)なる演算を行い、画素値u(12)をu(13)に更新する。図では、このようにして画素値が変動した画素u(13)に中濃ハッチングを施して示してある。   The average image creation unit 130 performs an operation of a (13) = (1−w) · a (12) + w · p (13) according to the equation (1A) without depending on such a determination result. The pixel value a (12) is updated to a (13). In the figure, the pixel a (13) whose pixel value has changed in this way is shown with a thin hatching. On the other hand, since the determination result is J = 1, the reference image creation unit 135 performs an operation of u (13) = (1−v) · u (12) + v · a (12) according to the equation (1B). The pixel value u (12) is updated to u (13). In the drawing, the pixel u (13) whose pixel value has changed in this way is shown by being shaded with medium density.

<第14の時点t14>
続いて、第14の時点t14について説明する。ここでは、第14の時点t14において、図示のような原画像P(14)が与えられたものとしよう。この例では、依然として画像内に車両の侵入はなく、原画像P(14)は第1番目の原画像P(1)と全く同じ状態である。
<14th time point t14>
Subsequently, the fourteenth time point t14 will be described. Here, it is assumed that an original image P (14) as illustrated is given at the fourteenth time point t14. In this example, there is still no vehicle intrusion in the image, and the original image P (14) is exactly the same as the first original image P (1).

この時点t14における前背判定部450による判定処理を考えると、第1判定部420では、画素p(14)と、1つ前の時点の画素a(13)との類否判定が行われ、第2判定部430では、画素p(14)と、1つ前の時点の画素u(13)との類否判定が行われる。ここでは、いずれも類似「○」との判定結果が得られたものとしよう。前背判定部450は、この判定結果に基づいて当該画素を背景画素と判定し、J=1なる判定結果を出力する。したがって、第14のマスク画像M14において、特定位置(x,y)の画素は背景領域に含まれる。   Considering the determination processing by the foreground determination unit 450 at this time t14, the first determination unit 420 performs similarity determination between the pixel p (14) and the pixel a (13) at the previous time point. The second determination unit 430 performs similarity determination between the pixel p (14) and the previous pixel u (13). Here, it is assumed that a determination result of similar “◯” is obtained in both cases. The foreground determination unit 450 determines that the pixel is a background pixel based on the determination result, and outputs a determination result of J = 1. Therefore, in the fourteenth mask image M14, the pixel at the specific position (x, y) is included in the background area.

平均画像作成部130は、このような判定結果に依存することなしに、式(1A)に従って、a(14)=(1−w)・a(13)+w・p(14)なる演算を行い、画素値a(13)はa(14)に更新される。図では、このようにして画素値が変動した画素a(14)を白地で示してある。一方、参照画像作成部135は、判定結果がJ=1になるので、式(1B)に従って、u(14)=(1−v)・u(13)+v・a(13)なる演算を行い、画素値u(13)をu(14)に更新する。図では、このようにして画素値が変動した画素u(9)に薄いハッチングを施して示してある。   The average image creation unit 130 performs an operation of a (14) = (1−w) · a (13) + w · p (14) according to the equation (1A) without depending on such a determination result. The pixel value a (13) is updated to a (14). In the figure, the pixel a (14) whose pixel value has changed in this way is shown in white. On the other hand, since the determination result is J = 1, the reference image creating unit 135 performs an operation of u (14) = (1−v) · u (13) + v · a (13) according to the equation (1B). The pixel value u (13) is updated to u (14). In the figure, the pixel u (9) whose pixel value has changed in this way is shown with thin hatching.

<第15の時点t15>
最後に、第15の時点t15について説明する。ここでは、第15の時点t15において、図示のような原画像P(15)が与えられたものとしよう。この例では、依然として画像内に車両の侵入はなく、原画像P(15)は第1番目の原画像P(1)と全く同じ状態である。
<15th time point t15>
Finally, the fifteenth time point t15 will be described. Here, it is assumed that an original image P (15) as illustrated is given at the fifteenth time point t15. In this example, there is still no vehicle intrusion in the image, and the original image P (15) is exactly the same as the first original image P (1).

この時点t15における前背判定部450による判定処理を考えると、第1判定部420では、画素p(15)と、1つ前の時点の画素a(14)との類否判定が行われ、第2判定部430では、画素p(15)と、1つ前の時点の画素u(14)との類否判定が行われる。ここでは、いずれも類似「○」との判定結果が得られたものとしよう。前背判定部450は、この判定結果に基づいて当該画素を背景画素と判定し、J=1なる判定結果を出力する。したがって、第15のマスク画像M15において、特定位置(x,y)の画素は背景領域に含まれる。   Considering the determination processing by the foreground determination unit 450 at this time t15, the first determination unit 420 performs similarity determination between the pixel p (15) and the pixel a (14) at the previous time point. The second determination unit 430 performs similarity determination between the pixel p (15) and the pixel u (14) at the previous time point. Here, it is assumed that a determination result of similar “◯” is obtained in both cases. The foreground determination unit 450 determines that the pixel is a background pixel based on the determination result, and outputs a determination result of J = 1. Accordingly, in the fifteenth mask image M15, the pixel at the specific position (x, y) is included in the background area.

平均画像作成部130は、このような判定結果に依存することなしに、式(1A)に従って、a(15)=(1−w)・a(14)+w・p(15)なる演算を行い、画素値a(14)はa(15)に更新される。一方、参照画像作成部135は、判定結果がJ=1になるので、式(1B)に従って、u(15)=(1−v)・u(14)+v・a(14)なる演算を行い、画素値u(14)をu(15)に更新する。   The average image creation unit 130 performs an operation of a (15) = (1−w) · a (14) + w · p (15) according to the equation (1A) without depending on such a determination result. The pixel value a (14) is updated to a (15). On the other hand, since the determination result is J = 1, the reference image creation unit 135 performs an operation of u (15) = (1−v) · u (14) + v · a (14) according to the equation (1B). The pixel value u (14) is updated to u (15).

<<< §6.平均画像と参照画像との双方を用いる利点 >>>
これまで、§3において、従来提案されている移動物体検出装置の構成(図8)を説明し、§4において、これを改良した本発明に係る移動物体検出装置の構成(図9)を説明した。いずれの装置を用いた場合も、新たに入力された原画像Pについて、背景領域Bと前景領域Fとを区別するマスク画像Mを得ることができ、前景領域Fは、移動物体が占めると推定される領域ということになる。
<<< §6. Advantages of using both average and reference images >>
Up to now, in §3, the configuration of a conventionally proposed moving object detection device (FIG. 8) will be described, and in §4, the configuration of the moving object detection device according to the present invention (FIG. 9) improved from this will be described. did. Regardless of which device is used, a mask image M for distinguishing the background region B and the foreground region F can be obtained for the newly input original image P, and it is estimated that the moving object occupies the foreground region F. It will be an area to be done.

ただ、図8に示す従来装置の場合、マスク画像Mは、画像比較部200における第i番目の原画像P(i)と第(i−1)番目の平均画像A(i−1)との比較結果に基づいて得られるのに対して、図9に示す本発明に係る装置の場合、マスク画像Mは、画像比較部400における第i番目の原画像P(i)と第(i−1)番目の平均画像A(i−1)との比較結果(第1判定部420の判定結果)と、第i番目の原画像P(i)と第(i−1)番目の参照画像U(i−1)との比較結果(第2判定部430の判定結果)と、の双方に基づいて得られることになる。別言すれば、図8に示す従来装置の場合、原画像Pと平均画像Aとの比較により移動物体の検出を行っていたのに対し、図9に示す本発明に係る装置の場合、原画像Pを平均画像Aと参照画像Uとの双方と比較することにより移動物体の検出を行うことになる。そこで、ここでは、平均画像Aと参照画像Uとの双方を用いた移動物体検出の利点を説明する。   However, in the case of the conventional apparatus shown in FIG. 8, the mask image M is an image of the i-th original image P (i) and the (i−1) -th average image A (i−1) in the image comparison unit 200. Whereas the mask image M is obtained based on the comparison result, in the case of the apparatus according to the present invention shown in FIG. ) Comparison result with the average image A (i-1) th (determination result of the first determination unit 420), the i-th original image P (i), and the (i-1) -th reference image U ( i-1) and the comparison result (determination result of the second determination unit 430). In other words, in the case of the conventional apparatus shown in FIG. 8, the moving object is detected by comparing the original image P and the average image A, whereas in the case of the apparatus according to the present invention shown in FIG. The moving object is detected by comparing the image P with both the average image A and the reference image U. Therefore, here, advantages of moving object detection using both the average image A and the reference image U will be described.

平均画像Aと参照画像Uとの大きな相違点は、§5に画像変遷の実例を示したように、平均画像Aの各画素は、新たな原画像Pが入力されるたびに毎回必ず更新されるのに対して、参照画像Uの各画素は、必ずしも毎回更新されるわけではない、という点である。なお、ここで言う「更新」とは、必ずしも「画素値の変動」を指すものではなく、「前回の画素値をそのまま維持するのではなく、新たな画素値を与える」ことを意味する。したがって、たとえば、図10上段に示す式(1A)において、p(i)=a(i−1)であった場合、結果的にa(i)=a(i−1)になるが、第i番目の平均画像A(i)の画素値として新たな画素値a(i)が与えられているので、値が更新されていることになる。同様に、図10中段に示す式(1B)において、a(i−1)=u(i−1)であった場合、結果的にu(i)=u(i−1)になるが、第i番目の参照画像U(i)の画素値として新たな画素値u(i)が与えられているので、値が更新されていることになる。これに対して、図10中段の式(1C)「u(i)=u(i−1)」は、「前回の画素値をそのまま維持すること」を意味しており、値は更新されていないことになる。   The major difference between the average image A and the reference image U is that each pixel of the average image A is always updated each time a new original image P is input, as shown in §5. In contrast, each pixel of the reference image U is not necessarily updated every time. Note that “update” here does not necessarily indicate “a change in pixel value”, but means “a new pixel value is given instead of maintaining the previous pixel value”. Therefore, for example, in the formula (1A) shown in the upper part of FIG. 10, if p (i) = a (i−1), the result is a (i) = a (i−1). Since a new pixel value a (i) is given as the pixel value of the i-th average image A (i), the value is updated. Similarly, in the formula (1B) shown in the middle stage of FIG. 10, when a (i-1) = u (i-1), u (i) = u (i-1) results, Since a new pixel value u (i) is given as the pixel value of the i-th reference image U (i), the value is updated. On the other hand, the expression (1C) “u (i) = u (i−1)” in the middle of FIG. 10 means “maintain the previous pixel value as it is”, and the value is updated. There will be no.

上述したとおり、平均画像Aの各画素は、新たな原画像Pが入力されるたびに必ず更新されるため、原画像Pの変化に追随して変化を遂げる動的画像になる。もちろん、平均画像Aを構成する各画素の画素値は、重みwを考慮した重みつき平均として算出されるため、原画像Pの画素値が急激に変動しても、平均画像Aの画素値がこれに追随して急激に変動することはない。これは、図4に示す画素値p(i)とa(i)との変動を比べれば容易に理解できよう。しかしながら、平均画像Aは、新たな原画像Pの影響を受けて、必ず変化する画像であるので、たとえば、図1に示すような原画像P10〜P40が与えられた場合、通過した車両の影響が平均画像Aにも及ぶことになる。より具体的には、赤色の車両が通過した場合、平均画像Aの一部も若干赤みを帯びるように変化する。   As described above, each pixel of the average image A is updated every time a new original image P is input, so that it becomes a dynamic image that changes following the change of the original image P. Of course, since the pixel value of each pixel constituting the average image A is calculated as a weighted average considering the weight w, even if the pixel value of the original image P fluctuates rapidly, the pixel value of the average image A There is no sudden fluctuation following this. This can be easily understood by comparing the fluctuations of the pixel values p (i) and a (i) shown in FIG. However, since the average image A is an image that always changes under the influence of the new original image P, for example, when the original images P10 to P40 as shown in FIG. Extends to the average image A as well. More specifically, when a red vehicle passes, a part of the average image A also changes so as to be slightly reddish.

これに対して、参照画像Uの各画素は、新たな原画像Pが入力されるたびに必ずしも更新されるものではない。すなわち、前背判定部450において、背景領域(J=1)と判定された部分に対しては平均画像Aを利用した更新が行われるが(図10の式(1B))、前景領域(J=0)と判定された部分に対しては更新は行われない(図10の式(1C))。このため、原画像Pの変化に追随した参照画像Uの変化は、平均画像Aに比べて緩慢になる。   On the other hand, each pixel of the reference image U is not necessarily updated every time a new original image P is input. That is, the foreground determination unit 450 updates the portion determined to be the background region (J = 1) using the average image A (equation (1B) in FIG. 10), but the foreground region (J = 0) is not updated for the portion determined (equation (1C) in FIG. 10). For this reason, the change of the reference image U following the change of the original image P becomes slower than the average image A.

実際、図11および図12に示す実例を見ると、時点t3において車両Vが通過すると、平均画像A(3)の画素a(3)は、これに追随して若干変化しているが、参照画像U(3)の画素u(3)は、更新されないため、画素u(2)のまま変化していない。同様に、時点t10,t12を見ても、平均画像Aは原画像Pの変動に追随して変化しているのに対して、参照画像Uは変化していない。要するに、図11および図12に示す時点t1〜t15の画像変遷を見ればわかるとおり、平均画像Aは、原画像Pの変動に追随して逐次変化するのに対して、参照画像Uの変化は緩慢であり、原画像Pが急激に変動しても、直ちに追随することはない。   Actually, in the examples shown in FIGS. 11 and 12, when the vehicle V passes at the time point t3, the pixel a (3) of the average image A (3) slightly changes following this, but see Since the pixel u (3) of the image U (3) is not updated, the pixel u (2) remains unchanged. Similarly, when the time points t10 and t12 are viewed, the average image A changes following the fluctuation of the original image P, while the reference image U does not change. In short, as can be seen from the image transitions at the time points t1 to t15 shown in FIGS. 11 and 12, the average image A sequentially changes following the fluctuation of the original image P, whereas the change of the reference image U does not change. It is slow and does not follow immediately even if the original image P fluctuates rapidly.

本発明に係る移動物体検出装置では、新たに入力された原画像Pは、上述したように追随態様が互いに異なっている平均画像Aおよび参照画像Uの双方と比較され、少なくとも一方に類似している領域は背景領域と判定されることになる。したがって、たとえば、雲の動きなどによって原画像Pの背景部分に短期的な日照変化が生じた場合でも、平均画像Aおよび参照画像Uの少なくとも一方に類似している領域は、背景領域Bと判定されることになる。その結果、日照変化などの自然現象に起因して変化した背景領域が前景領域F(移動物体の領域)として誤検出される可能性を低減することができ、より正確な検出を行うことができるようになる。これが、平均画像Aと参照画像Uとの双方を用いて移動物体検出を行う利点である。   In the moving object detection device according to the present invention, the newly input original image P is compared with both the average image A and the reference image U having different tracking modes as described above, and is similar to at least one of them. This area is determined as the background area. Therefore, for example, even when a short-term sunshine change occurs in the background portion of the original image P due to the movement of the cloud or the like, the region similar to at least one of the average image A and the reference image U is determined as the background region B. Will be. As a result, it is possible to reduce the possibility that a background area that has changed due to a natural phenomenon such as a change in sunshine is erroneously detected as a foreground area F (a moving object area), and more accurate detection can be performed. It becomes like this. This is an advantage of performing moving object detection using both the average image A and the reference image U.

なお、図9に示す移動物体検出装置には、パラメータ設定部340が設けられており、ユーザは、パラメータ設定部340に対する操作入力によって、各構成要素で用いられるパラメータを任意の値に設定することができる。既に述べたとおり、この装置で設定可能なパラメータは、第1判定部420および第2判定部430の類否判定の基準となる判定パラメータ(たとえば、図7の円柱モデルを利用した判定を行う場合は、円柱Cの半径および長さL)と、平均画像作成部130で用いる重みwと、参照画像作成部135で用いる重みvである。最適なパラメータ値は、装置の実際の使用環境に基づいて変わるので、実用上は、個々の使用環境ごとに試行錯誤によって最適なパラメータ値を設定するようにすればよい。   The moving object detection apparatus shown in FIG. 9 is provided with a parameter setting unit 340, and the user sets parameters used in each component to arbitrary values by an operation input to the parameter setting unit 340. Can do. As already described, the parameters that can be set by this apparatus are the determination parameters that are the criteria for similarity determination of the first determination unit 420 and the second determination unit 430 (for example, when determination is performed using the cylindrical model of FIG. 7). Are the radius C and the length L) of the cylinder C, the weight w used in the average image creation unit 130, and the weight v used in the reference image creation unit 135. Since the optimum parameter value varies based on the actual use environment of the apparatus, in practice, the optimum parameter value may be set by trial and error for each use environment.

ところで、本願発明者が行った実験によると、平均画像作成部130で用いる重みwと、参照画像作成部135で用いる重みvとについて、w>vなる関係が得られるような設定を行うと、より良好な検出結果が得られることが判明した。上述したとおり、参照画像Uは平均画像Aに比べて、原画像Pの変動に対して緩慢な追従を行うが、参照画像Uを作成する際に用いる重みvを、平均画像Aを作成する際に用いる重みwに比べて小さく設定することにより、参照画像Uの追従の緩慢度を更に上げることができる。その結果、より良好な検出結果が得られるようになるものと考えられる。   By the way, according to an experiment conducted by the inventor of the present application, when the weight w used in the average image creating unit 130 and the weight v used in the reference image creating unit 135 are set so as to obtain a relationship of w> v, It has been found that better detection results can be obtained. As described above, the reference image U follows the fluctuation of the original image P more slowly than the average image A. However, when creating the average image A, the weight v used when creating the reference image U is used. By setting it smaller than the weight w used for the reference image U, the follow-up slowness of the reference image U can be further increased. As a result, it is considered that a better detection result can be obtained.

なお、パラメータ設定部340を設けた場合には、w>vなる関係が得られるように、ユーザの操作入力に制限を課する機能を付加しておくのが好ましい。たとえば、w>vなる条件に反するようなパラメータ設定を行う操作入力が行われた場合には、エラー表示を行い、当該操作入力を受け付けないような機能を設けておけばよい。あるいは、たとえば、「v=0.1×w」というような式により、vとwとの関係を固定しておき、ユーザの操作入力によって、パラメータwのみが設定できるようにしておいてもよい。   In the case where the parameter setting unit 340 is provided, it is preferable to add a function that imposes restrictions on user operation inputs so that a relationship of w> v is obtained. For example, when an operation input for setting a parameter that violates the condition of w> v is made, a function may be provided that displays an error and does not accept the operation input. Alternatively, for example, the relationship between v and w may be fixed by an expression such as “v = 0.1 × w”, and only the parameter w may be set by a user operation input. .

実際、本願発明者は、屋外に設置した監視カメラから毎秒30フレームの原画像を取り込んで、重みw=0.01、重みv=0.001なる設定で実験を行ったところ、日照変化による誤検出を実用的なレベルまで低減させた良好な検出結果を得ることができた。   In fact, the inventor of the present application took an original image of 30 frames per second from a surveillance camera installed outdoors and conducted an experiment with a weight w = 0.01 and a weight v = 0.001. Good detection results with reduced detection to a practical level could be obtained.

<<< §7.回転楕円体モデルを用いた類否判定 >>>
図9に示す移動物体検出装置における第1判定部420および第2判定部430では、2つの画素についての類否判定が行われる。このような類否判定の一般的な方法は、既に§2においていくつかの例を紹介したとおりである。ただ、本願発明者は、本発明を実施するにあたって特に有効な類否判定方法を着想したので、以下、この方法を述べておく(この方法は、特願2009−226146号明細書に開示されている方法である)。
<<< §7. Similarity determination using spheroid model >>>
In the first determination unit 420 and the second determination unit 430 in the moving object detection device illustrated in FIG. 9, similarity determination for two pixels is performed. Such a general method for determining similarity is as already described in some examples in Section 2. However, since the inventor of the present application has conceived a method of determining similarity that is particularly effective in carrying out the present invention, this method will be described below (this method is disclosed in Japanese Patent Application No. 2009-226146). Is the method).

ここに示す類否判定方法は、基本的には、比較対象となる一方の画素の画素値を基準画素値、他方の画素の画素値を比較画素値として、三原色の各画素値を各座標軸にとった三次元座標系において、基準画素値に対応する座標に位置する基準点Qと比較画素値に対応する座標に位置する比較点qをとり、基準点Qを中心とする所定サイズの基準立体と比較点qとの位置関係を調べ、比較点qが基準立体の外部に位置すると判定できる場合に非類似との判定を行い、内部に位置すると判定できる場合には類似との判定を行うものである。   The similarity determination method shown here basically uses the pixel value of one pixel to be compared as a reference pixel value, the pixel value of the other pixel as a comparison pixel value, and the pixel values of the three primary colors as coordinate axes. In the three-dimensional coordinate system taken, a reference point Q positioned at coordinates corresponding to the reference pixel value and a comparison point q positioned at coordinates corresponding to the comparison pixel value are taken, and a reference solid of a predetermined size centered on the reference point Q And the comparison point q are examined, and if it can be determined that the comparison point q is located outside the reference solid, it is determined that it is dissimilar, and if it can be determined that it is located inside, it is determined that it is similar. It is.

§2で述べた図7に示す例は、基準立体として円柱Cを用いる例であるが、ここで述べる例は、基準立体として回転楕円体を用いるようにした点に特徴がある。ここでは、第1判定部420による類否判定に、この回転楕円体モデルを用いた場合を説明するが、この回転楕円体モデルは、第2判定部430による類否判定にも同様に利用することができる。   The example shown in FIG. 7 described in §2 is an example using a cylinder C as a reference solid, but the example described here is characterized in that a spheroid is used as the reference solid. Here, the case where this spheroid model is used for similarity determination by the first determination unit 420 will be described, but this spheroid model is also used for similarity determination by the second determination unit 430. be able to.

図13は、図7に示す円柱Cを回転楕円体Eaに置き換えた回転楕円体モデルを示す三次元色空間図である。ここで、類似範囲を示す回転楕円体Eaは、平均画像Aの画素値を示す座標点Aを中心点とし、ベクトルVa上に定義された基準軸Zaを長軸方向とする楕円を、基準軸Zaを回転軸として回転させることにより得られる回転体である。この回転楕円体Eaのサイズは、長軸方向の長さLa1と短軸方向の長さLa2によって規定される。   FIG. 13 is a three-dimensional color space diagram showing a spheroid model obtained by replacing the cylinder C shown in FIG. 7 with a spheroid Ea. Here, the spheroid Ea indicating the similar range is an ellipse having the coordinate point A indicating the pixel value of the average image A as the center point and the reference axis Za defined on the vector Va as the major axis direction. It is a rotating body obtained by rotating using Za as a rotation axis. The size of the spheroid Ea is defined by the length La1 in the major axis direction and the length La2 in the minor axis direction.

この回転楕円体モデルを用いた場合でも、類否判定の方法は、前述の円柱モデルを用いた場合の判定方法と同様であり、回転楕円体Eaの内部領域にプロットされる画素は、座標点Aに対応する画素値をもった画素に対して類似する画素と判定されることになる。具体的には、図示の例の場合、座標点Pに対応する画素値をもった画素は、回転楕円体Eaの外側に位置するため類似範囲外と判定され、両画素は非類似と判定される。逆に、座標点Pが回転楕円体Eaの内部に位置していれば、両画素は類似と判定される。   Even when this spheroid model is used, the similarity determination method is the same as the above-described determination method using the cylindrical model, and the pixels plotted in the inner area of the spheroid Ea are coordinate points. A pixel having a pixel value corresponding to A is determined as a similar pixel. Specifically, in the illustrated example, a pixel having a pixel value corresponding to the coordinate point P is determined to be outside the similar range because it is located outside the spheroid Ea, and both pixels are determined to be dissimilar. The Conversely, if the coordinate point P is located inside the spheroid Ea, both pixels are determined to be similar.

一方、図14は、図13に示す回転楕円体モデルのバリエーションを示す三次元色空間図である。図示のとおり、このモデルにおける類似範囲を示す回転楕円体Epは、判定対象となる原画像Pの画素値を示す座標点Pを中心点とし、ベクトルVp上に定義された基準軸Zpを長軸方向とする楕円を、基準軸Zpを回転軸として回転させることにより得られる回転体である。この回転楕円体Epのサイズは、長軸方向の長さLp1と短軸方向の長さLp2によって規定される。   On the other hand, FIG. 14 is a three-dimensional color space diagram showing variations of the spheroid model shown in FIG. As shown in the figure, a spheroid Ep indicating a similar range in this model has a coordinate point P indicating a pixel value of the original image P to be determined as a center point, and a reference axis Zp defined on the vector Vp as a major axis It is a rotating body obtained by rotating an ellipse as a direction around a reference axis Zp as a rotation axis. The size of the spheroid Ep is defined by the length Lp1 in the major axis direction and the length Lp2 in the minor axis direction.

図13に示すモデルの場合、背景を示す平均画像Aの画素値(Ra,Ga,Ba)をプロットした座標点Aを基準として、類似範囲を示す回転楕円体Eaが定義され、比較対象となる原画像Pの画素値(Rp,Gp,Bp)をプロットした座標点Pが、回転楕円体Eaの内側にあるか外側にあるかを判定していたのに対して、図14に示すモデルの場合、比較対象となる原画像Pの画素値(Rp,Gp,Bp)をプロットした座標点Pをプロットした座標点Pを基準として、類似範囲を示す回転楕円体Epが定義され、背景を示す平均画像Aの画素値(Ra,Ga,Ba)をプロットした座標点Aが、回転楕円体Epの内側にあるか外側にあるかを判定することになる。   In the case of the model shown in FIG. 13, a spheroid Ea indicating a similar range is defined on the basis of the coordinate point A on which the pixel values (Ra, Ga, Ba) of the average image A indicating the background are plotted, and is a comparison target. While it was determined whether the coordinate point P on which the pixel values (Rp, Gp, Bp) of the original image P are plotted is inside or outside the spheroid Ea, the model shown in FIG. In this case, a spheroid Ep indicating a similar range is defined with reference to the coordinate point P on which the pixel value (Rp, Gp, Bp) of the original image P to be compared is plotted, and shows the background. It is determined whether the coordinate point A on which the pixel values (Ra, Ga, Ba) of the average image A are plotted is inside or outside the spheroid Ep.

要するに、前者では、新たに入力された原画像Pの画素が、背景を示す過去の平均画像Aの画素の類似範囲に入っているか否かを判定する手法をとるのに対して、後者では、背景を示す過去の平均画像Aの画素が、新たに入力された原画像Pの画素の類似範囲に入っているか否かを判定する手法をとることになる。結局、両者の相違は、比較対象となる2つの画素のどちらを基準にして回転楕円体を定義するかという点だけである。   In short, the former takes a method of determining whether or not the pixel of the newly input original image P is in the similar range of the pixels of the past average image A indicating the background, whereas the latter is A method of determining whether or not the pixels of the past average image A indicating the background are within the similar range of the pixels of the newly input original image P is taken. After all, the only difference between the two is in which of the two pixels to be compared is used as a reference to define the spheroid.

そこで、以下の説明では、比較対象となる2つの画像のうち、一方の画像の画素値を基準画素値(R,G,B)と表記し、他方の画像の画素値を比較画素値(r,g,b)と表記することにする。また、三次元色空間上で基準画素値(R,G,B)をプロットした座標点Q(R,G,B)を基準点Qと呼び、比較画素値(r,g,b)をプロットした座標点q(r,g,b)を比較点qと呼ぶことにする。類否判定は、基準点Qを中心として定義された回転楕円体と比較点qとの位置関係に基づいてなされることになる。   Therefore, in the following description, of the two images to be compared, the pixel value of one image is expressed as a reference pixel value (R, G, B), and the pixel value of the other image is expressed as a comparison pixel value (r , G, b). Also, the coordinate point Q (R, G, B) on which the reference pixel value (R, G, B) is plotted in the three-dimensional color space is called the reference point Q, and the comparison pixel value (r, g, b) is plotted. The coordinate point q (r, g, b) is referred to as a comparison point q. The similarity determination is made based on the positional relationship between the spheroid defined around the reference point Q and the comparison point q.

図15は、このような一般的な表記にしたがって、回転楕円体モデルを図示した三次元色空間図である。原点Oを起点として基準点Qへ向かうベクトルをベクトルVとすれば、基準軸Zは、このベクトルV上の軸になる。そして、回転楕円体Eは、基準点Qを中心点とし、ベクトルV上に定義された基準軸Zを長軸方向とする楕円を、基準軸Zを回転軸として回転させることにより得られる回転体である。ここで、比較点q(r,g,b)が回転楕円体Eの内部に位置すれば、両画素は類似と判定され、回転楕円体Eの外部に位置すれば、両画素は非類似と判定される。   FIG. 15 is a three-dimensional color space diagram illustrating a spheroid model according to such general notation. If the vector V starting from the origin O and going to the reference point Q is a vector V, the reference axis Z is an axis on the vector V. The spheroid E is a rotator obtained by rotating an ellipse having the reference point Q as the center point and the reference axis Z defined on the vector V as the major axis direction with the reference axis Z as the rotation axis. It is. Here, if the comparison point q (r, g, b) is located inside the spheroid E, both pixels are determined to be similar, and if located outside the spheroid E, both pixels are regarded as dissimilar. Determined.

図13に示すモデルは、類否判定を行う際に、平均画像A(i−1)上の画素a(i−1)の画素値を基準画素値(R,G,B)として基準点Q(R,G,B)をプロットし、原画像P(i)上の画素p(i)の画素値を比較画素値(r,g,b)として比較点q(r,g,b)をプロットしたものである。これに対して、図14に示すモデルは、類否判定を行う際に、原画像P(i)上の画素p(i)の画素値を基準画素値(R,G,B)として基準点Q(R,G,B)をプロットし、平均画像A(i−1)上の画素a(i−1)の画素値を比較画素値(r,g,b)として比較点q(r,g,b)をプロットしたものである。   In the model illustrated in FIG. 13, when the similarity determination is performed, the pixel value of the pixel a (i−1) on the average image A (i−1) is set as the reference pixel value (R, G, B) as the reference point Q. (R, G, B) is plotted, and the comparison point q (r, g, b) is set with the pixel value of the pixel p (i) on the original image P (i) as the comparison pixel value (r, g, b). It is a plot. In contrast, the model shown in FIG. 14 uses the pixel value of the pixel p (i) on the original image P (i) as the reference pixel value (R, G, B) when performing similarity determination. Q (R, G, B) is plotted, and the pixel value of the pixel a (i-1) on the average image A (i-1) is set as the comparison pixel value (r, g, b), and the comparison point q (r, g, b) are plotted.

図7に示す円柱モデルに比べて、図15に示す回転楕円体モデルは、次の2つの利点を有している。第1の利点は、時刻や天候などによる照明変動の影響を排除した、より正確な移動物体の検出が可能になる点である。本願発明者は、ビデオカメラで撮影した様々な実写画像について、図7に示す円柱モデルに基づく類否判定処理を採り入れた移動物体の検出と、図15に示す回転楕円体モデルに基づく類否判定処理を採り入れた移動物体の検出とを試みたところ、後者の検出の方がより正確である実験結果が得られた。これは、円柱モデルの場合、円柱の長手方向の端部周縁領域において、誤検出が行われる可能性が高くなるためと考えられる。   Compared to the cylindrical model shown in FIG. 7, the spheroid model shown in FIG. 15 has the following two advantages. The first advantage is that a more accurate moving object can be detected without the influence of illumination fluctuations due to time of day or weather. The inventor of the present application detects a moving object that adopts an analogy determination process based on a cylindrical model shown in FIG. 7 and various analogy determinations based on a spheroid model shown in FIG. Attempts were made to detect moving objects using processing, and experimental results were obtained in which the latter detection was more accurate. This is considered because in the case of a cylindrical model, there is a high possibility that erroneous detection is performed in the peripheral edge region in the longitudinal direction of the cylinder.

図16は、円柱モデルに対する回転楕円体モデルの利点を示す断面図である。図示の例において、円柱Cの断面と回転楕円体Eの断面とを比較すると、いずれも基準点Qを中心として、基準軸Zの方向を長手方向とする図形であるが、図にハッチングを施す領域が、円柱Cでは内部領域と判定されるのに対して、回転楕円体Eでは外部領域と判定されることがわかる。したがって、比較点qが、このハッチング領域に位置する場合、一方では類似範囲内と判定され、他方では類似範囲外と判定される。もちろん、いずれの判定結果が正しいものであるかは、一概には決定できないが、少なくとも実写画像を用いた移動物体の検出処理に利用する限りにおいて、後者の判定結果が正しい結果となる可能性が高いことになる。   FIG. 16 is a cross-sectional view showing the advantages of a spheroid model over a cylindrical model. In the example shown in the figure, when the cross section of the cylinder C and the cross section of the spheroid E are compared, all of them are figures having the reference point Q as the center and the direction of the reference axis Z as the longitudinal direction, but the figure is hatched. It can be seen that the area is determined to be the inner area in the cylinder C, whereas it is determined to be the outer area in the spheroid E. Therefore, when the comparison point q is located in the hatched area, it is determined that the comparison point q is within the similar range on the one hand and is outside the similar range on the other hand. Of course, which judgment result is correct cannot be generally determined, but at least as long as it is used for detection processing of a moving object using a real image, the latter judgment result may be a correct result. It will be expensive.

すなわち、円柱モデルの場合、比較点qが図のハッチング領域内に位置する場合、判定対象となる画素は背景画像に類似しているため背景領域B内の画素とされることになるが、実際には、背景画像に対して非類似であり、前景領域F内の画素とすべきであった、というケースが比較的高い確率で生じてしまうものと考えられる。図16に示すとおり、断面形状で比較すると、回転楕円体Eの断面は曲面からなる楕円であるのに対して、円柱Cの断面は直線からなる矩形であり、実写画像を対象物とした類否判定の境界線としては、断面が曲面からなる楕円の方が適していることは、直感的にも理解できよう。   That is, in the case of a cylindrical model, when the comparison point q is located in the hatched area in the figure, the pixel to be determined is similar to the background image, and thus is a pixel in the background area B. It is considered that there is a relatively high probability that a pixel that is dissimilar to the background image and should have been a pixel in the foreground area F. As shown in FIG. 16, when compared with cross-sectional shapes, the cross section of the spheroid E is an ellipse made of a curved surface, whereas the cross section of the cylinder C is a rectangle made of a straight line. It can be understood intuitively that an ellipse having a curved cross section is more suitable as the boundary line for the determination.

このように、少なくとも、実写画像に基づく移動物体の検出処理に利用する場合、円柱モデルよりも回転楕円体モデルの方が検出精度が向上するという第1の利点が得られる。一方、回転楕円体モデルを採用することにより得られる第2の利点は、演算負担の軽減を図ることができる点である。この第2の利点の詳細については、§8で述べることにするが、ここでは、演算負担の軽減に寄与する工夫のひとつを簡単に述べておく。   In this way, at least when used for detection processing of a moving object based on a live-action image, the first advantage is obtained that the detection accuracy of the spheroid model is improved compared to the cylindrical model. On the other hand, the second advantage obtained by adopting the spheroid model is that the calculation burden can be reduced. The details of the second advantage will be described in §8. Here, one of the ideas that contribute to the reduction of the calculation burden will be briefly described.

この工夫は、回転楕円体Eのサイズを、三次元座標系の原点Oと基準点Qとの距離Dに比例した値に設定することである。具体的には、図15に示すとおり、距離Dに、所定のパラメータh(但し、h<1)を乗じて求まる値α=h・Dを長軸半径とし、所定のパラメータk(但し、k<h)を乗じて求まる値β=k・Dを短軸半径とする楕円を、原点Oと基準点Qとを結ぶ基準軸Z上に長軸が重なるように、かつ、基準点Qが中心点となるように配置し、基準軸Zを中心に回転させることにより回転楕円体Eを定義すればよい。   This contrivance is to set the size of the spheroid E to a value proportional to the distance D between the origin O of the three-dimensional coordinate system and the reference point Q. Specifically, as shown in FIG. 15, a value α = h · D obtained by multiplying the distance D by a predetermined parameter h (where h <1) is a major axis radius, and a predetermined parameter k (where k An ellipse having a minor axis radius of β = k · D obtained by multiplying <h) so that the major axis overlaps the reference axis Z connecting the origin O and the reference point Q, and the reference point Q is the center The spheroid E may be defined by arranging it to be a point and rotating it around the reference axis Z.

このような条件で回転楕円体Eのサイズを決定すると、基準点Qが原点Oから離れれば離れるほど、回転楕円体Eのサイズは大きくなり、それだけ類似範囲が広くなる。これは、より明度の高い部分、すなわち、画像のハイライト部ほど、類似範囲が広くなることを意味するが、実用上、そのような類似範囲設定がなされても支障は生じない。一方、類似範囲内か否か、すなわち、回転楕円体Eの内部か外部かを判定するための演算負担は、長軸半径をα=h・D、短軸半径をβ=k・Dと設定することにより(すなわち、楕円のサイズを、距離Dに比例した値に設定することにより)、大幅に軽減することができる。その詳細は§8で述べることにする。   When the size of the spheroid E is determined under such conditions, the size of the spheroid E increases as the reference point Q moves away from the origin O, and the similarity range increases accordingly. This means that the higher the lightness, that is, the highlight portion of the image, the wider the similar range. However, in practice, there is no problem even if such a similar range is set. On the other hand, the calculation burden for determining whether or not it is within the similar range, that is, whether it is inside or outside of the spheroid E, is set such that the long axis radius is α = h · D and the short axis radius is β = k · D. (That is, by setting the size of the ellipse to a value proportional to the distance D), it can be greatly reduced. Details will be described in §8.

ところで、本願発明者が行った実験によると、回転楕円体Eのサイズを、距離Dに比例した値に設定する場合は、図13のモデルよりも、図14のモデルを用いた方が、検出精度が向上することが判明した。図14のモデルを採用した場合、図15において、基準点Q(R,G,B)は、判定対象となる原画像Pの画素の画素値を基準画素値としてプロットした点になり、比較点q(r,g,b)は、背景となる平均画像A(第2判定部430に適用する場合は、参照画像U)の画素の画素値を比較画素値としてプロットした点になる。   By the way, according to an experiment conducted by the inventor of the present application, when the size of the spheroid E is set to a value proportional to the distance D, it is detected by using the model of FIG. 14 rather than the model of FIG. It was found that the accuracy was improved. When the model of FIG. 14 is adopted, the reference point Q (R, G, B) in FIG. 15 is a point plotted with the pixel value of the pixel of the original image P to be determined as the reference pixel value, and is a comparison point. q (r, g, b) is a point obtained by plotting the pixel value of the pixel of the average image A (background image U when applied to the second determination unit 430) as a comparison pixel value.

上述したとおり、図13のモデルと図14のモデルは、原画像Pの画素と平均画像A(参照画像U)の画素とのいずれを基準にして回転楕円体を定義するか、という点において異なる。しかも、回転楕円体のサイズを、距離Dに比例した値に設定すれば、定義される回転楕円体のサイズが、両者では異なることになる。すなわち、図13に示すモデルにおける回転楕円体Eaの長軸方向の長さLa1および短軸方向の長さLa2は、ベクトルVaの長さに、それぞれパラメータ2hおよび2kを乗じることにより得られるのに対して、図14に示すモデルにおける回転楕円体Epの長軸方向の長さLp1および短軸方向の長さLp2は、ベクトルVpの長さに、それぞれパラメータ2hおよび2kを乗じることにより得られる。したがって、図示の例の場合、回転楕円体Eaのサイズよりも、回転楕円体Epのサイズの方が大きくなっており、より広い類似範囲が設定されている。   As described above, the model in FIG. 13 and the model in FIG. 14 are different in that the spheroid is defined based on the pixel of the original image P or the pixel of the average image A (reference image U). . Moreover, if the size of the spheroid is set to a value proportional to the distance D, the size of the defined spheroid will be different. That is, the length La1 in the major axis direction and the length La2 in the minor axis direction of the spheroid Ea in the model shown in FIG. 13 are obtained by multiplying the length of the vector Va by the parameters 2h and 2k, respectively. On the other hand, the length Lp1 in the major axis direction and the length Lp2 in the minor axis direction of the spheroid Ep in the model shown in FIG. 14 are obtained by multiplying the length of the vector Vp by parameters 2h and 2k, respectively. Accordingly, in the case of the illustrated example, the size of the spheroid Ep is larger than the size of the spheroid Ea, and a wider similarity range is set.

もちろん、常識的には、図14に示すモデルよりも図13に示すモデルを採用するのが一般的であろう。すなわち、予め背景とみなすことができる類似範囲を回転楕円体Eaとして定義しておき、新たに入力された画像の画素を示す点Pが、この類似範囲内に入るか否かを判定することにより、当該画素が移動物体上の点であるか否かを認識する、という方針を採るのが、一般的な考え方である。これに対して、図14に示すモデルは、新たに入力された画像の画素の類似範囲を回転楕円体Ebとして定め、その中に、背景画素を示す点Aが入るか否かを判定する手法を採るものであり、一般常識に基づく手法とは逆の手法と言うことができる。   Of course, from a common sense, the model shown in FIG. 13 will generally be adopted rather than the model shown in FIG. That is, a similar range that can be regarded as a background is defined in advance as a spheroid Ea, and it is determined whether or not a point P indicating a pixel of a newly input image falls within this similar range. The general idea is to recognize whether or not the pixel is a point on a moving object. On the other hand, the model shown in FIG. 14 determines a similar range of pixels of a newly input image as a spheroid Eb and determines whether or not a point A indicating a background pixel is included therein. It can be said to be the opposite of the method based on general common sense.

しかしながら、本願発明者が行った実験によると、少なくとも実写画像を用いた移動物体の検出処理に利用する限りにおいて、図13に示すモデルを採用するよりも、図14に示すモデルを採用した方が、より正しい判定結果が得られた。これは、これまで述べた方法で、平均画像Aの画素値a(i)(第2判定部430に適用する場合は、参照画像Uの画素値u(i))を決定すると、様々な要因により、新たに入力されてくる原画像Pの画素値p(i)が大きく変動しても、画素値a(i),u(i)の値が当該変動に追従するまでにはある程度の時間がかかるため、類似範囲の広狭を、原画像Pの画素値p(i)に応じて定めた方が、正しい判定が可能になるためと考えられる。   However, according to an experiment conducted by the inventors of the present application, it is preferable to adopt the model shown in FIG. 14 rather than adopting the model shown in FIG. More correct judgment results were obtained. When the pixel value a (i) of the average image A (the pixel value u (i) of the reference image U when applied to the second determination unit 430) is determined by the above-described method, various factors are determined. Thus, even if the pixel value p (i) of the newly input original image P greatly fluctuates, a certain amount of time is required until the pixel values a (i) and u (i) follow the fluctuation. Therefore, it is considered that it is possible to make a correct determination if the width of the similar range is determined according to the pixel value p (i) of the original image P.

結局、本発明における画素の類否判定を、基準立体モデル(円柱モデルや回転楕円体モデル)を利用して行う場合、第1判定部420は、原画像Pの画素の画素値を基準画素値、平均画像Aの画素の画素値を比較画素値として判定を行い、第2判定部430は、原画像Pの画素の画素値を基準画素値、参照画像Uの画素の画素値を比較画素値として判定を行うようにするのが好ましい。   After all, when the similarity determination of pixels in the present invention is performed using a reference solid model (a cylindrical model or a spheroid model), the first determination unit 420 determines the pixel value of the pixel of the original image P as the reference pixel value. Then, the pixel value of the pixel of the average image A is determined as the comparison pixel value, and the second determination unit 430 uses the pixel value of the pixel of the original image P as the reference pixel value and the pixel value of the pixel of the reference image U as the comparison pixel value. It is preferable to make a determination as follows.

以上、移動物体の検出に利用する画素の類否判定処理方法において、円柱モデルを採用する方法に比べて、回転楕円体モデルを採用する利点として、より正確な移動物体の検出が可能になる、という第1の利点を述べるとともに、演算負担を軽減することができるという第2の利点についても簡単に説明した。続く§8では、この第2の利点についての詳細を述べることにする。   As described above, in the pixel similarity determination processing method used for detecting the moving object, as compared with the method using the cylindrical model, as an advantage of adopting the spheroid model, it becomes possible to detect the moving object more accurately. In addition to the first advantage, the second advantage that the calculation burden can be reduced was also briefly described. In the following §8, details on this second advantage will be described.

<<< §8.回転楕円体モデルを利用した実用的な類否判定手順 >>>
一般に、三次元空間上において、ある1点が、円柱の内側にあるか外側にあるかを判定する場合も、回転楕円体の内側にあるか外側にあるかを判定する場合も、座標値を用いた幾何学演算が必要になる。しかしながら、回転楕円体の内側にあるか外側にあるかを判定する場合は、演算式を工夫し、また、一部に近似演算を取り込むことにより、演算負担を大幅に軽減することが可能である。ここでは、図15に示す回転楕円体モデルにおいて、比較点q(r,g,b)が、基準点Q(R,G,B)を中心として定義された回転楕円体Eの内側にあるか外側にあるかを判定する実用的な手順を述べる。
<<< §8. Practical similarity determination procedure using spheroid model >>>
In general, in determining whether a point is inside or outside a cylinder in a three-dimensional space, or when determining whether it is inside or outside a spheroid, the coordinate value is The geometric operation used is required. However, when determining whether it is inside or outside the spheroid, it is possible to greatly reduce the calculation burden by devising the calculation formula and incorporating approximate calculation in part. . Here, in the spheroid model shown in FIG. 15, is the comparison point q (r, g, b) inside the spheroid E defined around the reference point Q (R, G, B)? A practical procedure to determine whether it is outside is described.

ここで述べる手順は、3つの条件判定段階によって構成される。図17は、そのうちの第1の条件判定段階の原理を示す断面図である。図において、下方に示す原点Oは、図15の三次元色空間図に示されているRGB三次元直交座標系の原点Oであり、当該座標系上に、基準点Q(R,G,B)と比較点q(r,g,b)とがプロットされている(座標軸は図示省略)。基準軸Zは、原点Oと基準点Qとを結ぶ線であり、回転楕円体Eは、この基準軸Zを長軸方向とし、基準点Qを中心とする楕円を、基準軸Zを回転軸として回転させることによって得られる回転体である。図に断面を示す楕円は、長軸半径をα、短軸半径をβとする楕円であるが、§7で述べたとおり、原点Oと基準点Qとの距離をDとしたときに、所定のパラメータh,kについて、α=h・D(但し、h<1)、β=k・D(但し、k<h)となるように設定されている。   The procedure described here is composed of three condition determination stages. FIG. 17 is a cross-sectional view showing the principle of the first condition determination stage. In the figure, the origin O shown below is the origin O of the RGB three-dimensional orthogonal coordinate system shown in the three-dimensional color space diagram of FIG. 15, and the reference point Q (R, G, B is on the coordinate system. ) And a comparison point q (r, g, b) are plotted (coordinate axes are not shown). The reference axis Z is a line connecting the origin O and the reference point Q, and the spheroid E is an ellipse centered on the reference point Q with the reference axis Z as the major axis direction and the reference axis Z as the rotation axis. It is a rotating body obtained by rotating as. An ellipse having a cross section in the figure is an ellipse having a major axis radius α and a minor axis radius β. As described in §7, when the distance between the origin O and the reference point Q is D, the ellipse is predetermined. Are set such that α = h · D (where h <1) and β = k · D (where k <h).

第1の条件判定段階では、比較点qが、図のハッチング領域内にあるかどうかの判定が行われる。すなわち、図の下方のハッチング領域は、「原点Oを中心とし半径(D−α)の球C1の内側領域」であるから、原点Oと比較点qとの距離をdとすれば、「D−α>d」なる条件が満足されれば、比較点qは、球C1の内側に位置することになる。球C1は、回転楕円体Eの原点Oに対する最近接点E1において、回転楕円体Eに接する球であり、球C1の内側領域は、当然、回転楕円体Eの外側領域になる。一方、図の上方のハッチング領域は、「原点Oを中心とし半径(D+α)の球C2の外側領域」であるから、原点Oと比較点qとの距離をdとすれば、「D+α<d」なる条件が満足されれば、比較点qは、球C2の外側に位置することになる。球C2は、回転楕円体Eの原点Oに対する最遠接点E2において、回転楕円体Eに接する球であり、球C2の外側領域は、当然、回転楕円体Eの外側領域になる。   In the first condition determination stage, it is determined whether or not the comparison point q is within the hatched area in the figure. That is, since the hatched area in the lower part of the figure is “the inner area of the sphere C1 having the radius (D−α) centered on the origin O”, if the distance between the origin O and the comparison point q is d, “D If the condition of “−α> d” is satisfied, the comparison point q is located inside the sphere C1. The sphere C1 is a sphere that is in contact with the spheroid E at the closest point E1 with respect to the origin O of the spheroid E, and the inner area of the sphere C1 is naturally the outer area of the spheroid E. On the other hand, since the hatched area in the upper part of the figure is “the outer area of the sphere C2 having the radius (D + α) centered on the origin O” and the distance between the origin O and the comparison point q is d, “D + α <d If the condition “is satisfied, the comparison point q is located outside the sphere C2. The sphere C2 is a sphere in contact with the spheroid E at the farthest contact point E2 with respect to the origin O of the spheroid E, and the outer region of the sphere C2 is naturally the outer region of the spheroid E.

図18は、図17に示す第1の条件判定原理に基づく判定式を示す図である。図18(a) は、比較点qが球C1の内側領域にあるための条件式「D−α>d」の変形プロセスを示す。すなわち、α=h・Dを代入すると、条件式は「(1−h)・D>d」となり、両辺を2乗すると、
(1−h)・D>d 式(2)
が得られる。一方、図18(b) は、比較点qが球C2の外側領域にあるための条件式「D+α<d」の変形プロセスを示す。すなわち、α=h・Dを代入すると、条件式は「(1+h)・D<d」となり、両辺を2乗すると、
(1+h)・D<d 式(3)
が得られる。
FIG. 18 is a diagram showing a determination formula based on the first condition determination principle shown in FIG. FIG. 18A shows a deformation process of the conditional expression “D−α> d” for the comparison point q to be in the inner region of the sphere C1. That is, if α = h · D is substituted, the conditional expression becomes “(1−h) · D> d”, and if both sides are squared,
(1-h) 2 · D 2 > d 2 Formula (2)
Is obtained. On the other hand, FIG. 18B shows a deformation process of the conditional expression “D + α <d” for the comparison point q being in the outer region of the sphere C2. That is, if α = h · D is substituted, the conditional expression becomes “(1 + h) · D <d”, and if both sides are squared,
(1 + h) 2 · D 2 <d 2 formula (3)
Is obtained.

ここで、基準点Qの座標値が(R,G,B)、比較点qの座標値が(r,g,b)であるから、図18(c) に示すように、
D=√(R+G+B
d=√(r+g+b
であり、両辺を2乗すると、
=(R+G+B
=(r+g+b
となる。したがって、式(2),式(3)を書き直せば、図18(c) に示すように、
(1−h)・(R+G+B
>(r+g+b) 式(2′)
(1+h)・(R+G+B
<(r+g+b) 式(3′)
なる条件式が得られる。ここで、hは予め設定された所定のパラメータであり、(R,G,B)および(r,g,b)は、基準点Qおよび比較点qの座標値(すなわち、比較対象となる2つの画素の三原色の画素値)である。式(2′)および式(3′)は、2乗演算と和差演算のみで構成される演算式であるから、演算負担は非常に軽いものになる。
Here, since the coordinate value of the reference point Q is (R, G, B) and the coordinate value of the comparison point q is (r, g, b), as shown in FIG.
D = √ (R 2 + G 2 + B 2 )
d = √ (r 2 + g 2 + b 2 )
And if both sides are squared,
D 2 = (R 2 + G 2 + B 2 )
d 2 = (r 2 + g 2 + b 2 )
It becomes. Therefore, if Equation (2) and Equation (3) are rewritten, as shown in FIG.
(1-h) 2 · (R 2 + G 2 + B 2 )
> (R 2 + g 2 + b 2 ) Formula (2 ′)
(1 + h) 2 · (R 2 + G 2 + B 2 )
<(R 2 + g 2 + b 2 ) Formula (3 ′)
The following conditional expression is obtained. Here, h is a predetermined parameter set in advance, and (R, G, B) and (r, g, b) are coordinate values of the reference point Q and the comparison point q (that is, 2 to be compared). The pixel values of the three primary colors of one pixel). Since the expressions (2 ′) and (3 ′) are arithmetic expressions composed only of a square operation and a sum / difference operation, the calculation burden is very light.

こうして、式(2′)もしくは式(3′)のいずれかの条件を満足する結果が得られた場合、比較点qは、回転楕円体Eの外側に位置すると判断できるので、基準点Qの類似範囲外との判定を行うことができる。   Thus, when a result satisfying either of the conditions of the formula (2 ′) or the formula (3 ′) is obtained, it can be determined that the comparison point q is located outside the spheroid E. It can be determined that it is outside the similar range.

一方、式(2′)および式(3′)のいずれの条件も満足しない場合は、図17において、比較点qは、球C1の外側かつ球C2の内側の領域に位置することになる。したがって、その場合には、以下に述べる第2の条件判定段階が引き続き行われる。   On the other hand, when neither of the conditions of the expressions (2 ′) and (3 ′) is satisfied, the comparison point q is located in a region outside the sphere C1 and inside the sphere C2 in FIG. Therefore, in that case, the second condition determination step described below is continued.

図19は、この第2の条件判定段階の原理を示す断面図である。第2の条件判定段階では、比較点qが、図19のハッチング領域内にあるかどうかの判定が行われる。このハッチング領域は、「原点Oを頂点、基準軸Zを中心軸とし、回転楕円体Eと円で接する円錐ξの外側領域」として定義される領域である。円錐ξの半頂角は、図示のとおり角φになる。図示の断面図では、円錐ξが接点Tにおいて楕円Eに接している状態が示されているが、実際には、円錐ξと回転楕円体Eとは、接線円Tで線接触することになる。三次元空間上での円錐ξと回転楕円体Eとの関係は、コーンに卵を挿入した状態を考えれば容易に理解できよう。   FIG. 19 is a sectional view showing the principle of the second condition determination stage. In the second condition determination stage, it is determined whether or not the comparison point q is within the hatched area of FIG. This hatching area is an area defined as "the outer area of the cone ξ with the origin O as the apex and the reference axis Z as the central axis and in contact with the spheroid E with a circle". The half apex angle of the cone ξ is the angle φ as shown in the figure. In the illustrated cross-sectional view, a state where the cone ξ is in contact with the ellipse E at the contact point T is shown, but in actuality, the cone ξ and the spheroid E are in line contact with a tangent circle T. . The relationship between the cone ξ and the spheroid E in the three-dimensional space can be easily understood by considering the state in which the egg is inserted into the cone.

結局、この第2の条件判定段階では、比較点qが、円錐ξの内側にあるか、外側にあるかを判定することになる。円錐ξと回転楕円体Eとが接する接線円Tの位置は、幾何学的な演算によって求めることができ、そのような接線円Tを通る円錐ξを示す幾何学的な方程式を求めることも可能である。しかしながら、そのような方程式は比較的複雑な式になる。そこで、ここでは、円錐ξの代わりに、図19に破線で示す円錐ξ′を利用した近似的な判定を行うことにより、演算負担の軽減を図ることにする。   Eventually, in this second condition determination stage, it is determined whether the comparison point q is inside or outside the cone ξ. The position of the tangent circle T where the cone ξ and the spheroid E contact each other can be obtained by geometric calculation, and a geometric equation indicating the cone ξ passing through the tangent circle T can also be obtained. It is. However, such an equation becomes a relatively complex expression. Therefore, here, instead of the cone ξ, an approximate determination using a cone ξ ′ indicated by a broken line in FIG. 19 is performed to reduce the calculation burden.

図19に実線で描いた円錐ξは、接線円Tで回転楕円体Eに接する図形であるが、破線で描いた円錐ξ′は、交線円Sで回転楕円体Eと交差する図形である。ここで、交線円Sは、原点Oを中心とする半径Dの球面C3と回転楕円体Eとの交線を構成する円であり、基準点Qと交線円S上の任意の点との距離は図示のとおりfである。結局、この近似的な判定では、「原点Oを頂点、基準軸Zを中心軸とし、交線円Sを通る円錐ξ′の外側に比較点qが位置するか否か」という判定が行われることになる。   A cone ξ drawn with a solid line in FIG. 19 is a figure that touches the spheroid E with a tangent circle T, whereas a cone ξ ′ drawn with a broken line is a figure that intersects the spheroid E with an intersection line S . Here, the intersecting circle S is a circle constituting an intersecting line between the spheroid E3 and the spherical surface C3 having a radius D centered on the origin O, and an arbitrary point on the intersecting circle S with the reference point Q. Is f as shown in the figure. After all, in this approximate determination, a determination is made as to whether or not the comparison point q is located outside the cone ξ ′ passing through the intersection circle S with the origin O as the apex and the reference axis Z as the central axis. It will be.

図示のとおり、円錐ξ′の半頂角φ′は、円錐ξの半頂角φよりも若干小さくなり、円錐ξ′は、円錐ξよりも若干小さな円錐になる。このため、「円錐ξ′の外側」かつ「円錐ξの内側」の点の場合、実際は回転楕円体Eの内部の点であるにもかかわらず、円錐ξ′を代用する近似的な判定方法では、回転楕円体Eの外部の点と判定されてしまうことになる。したがって、「回転楕円体Eの内外を厳密に判定する」という観点では、円錐ξ′を代用する判定方法は不正確である。ただ、そもそも回転楕円体E自体が、移動物体を厳密に検出する機能をもつ立体であるわけではなく、あくまでも1つの指標を提供するものであるから、円錐ξ′を代用する近似的な判定方法を用いたとしても、大きな支障は生じない。   As shown in the figure, the half apex angle φ ′ of the cone ξ ′ is slightly smaller than the half apex angle φ of the cone ξ, and the cone ξ ′ becomes a slightly smaller cone than the cone ξ. For this reason, in the case of the points “outside the cone ξ ′” and “inside the cone ξ”, although it is actually a point inside the spheroid E, the approximate determination method substituting the cone ξ ′ Therefore, it is determined that the point is outside the spheroid E. Therefore, from the viewpoint of “strictly determining the inside and outside of the spheroid E”, the determination method substituting the cone ξ ′ is inaccurate. However, since the spheroid E itself is not a solid having a function of detecting a moving object strictly, it provides only one index, so an approximate determination method that substitutes the cone ξ ′. Even if is used, there will be no major hindrance.

そこで、比較点qが、この円錐ξ′の内側にあるのか外側にあるのかを幾何学的に判定するための具体的な方法を考えてみる。いま、図20(a) に示すように、三辺の長さがそれぞれa,b,cである一般的な三角形を考える。ここで、2辺b,cの挟角をφとすると、余弦定理により、
cos φ=(b+c−a)/2bc 式(4)
が成り立つ。
Consider a specific method for geometrically determining whether the comparison point q is inside or outside the cone ξ ′. Now, as shown in FIG. 20 (a), a general triangle having three sides of a, b, and c is considered. Here, if the angle between the two sides b and c is φ, according to the cosine theorem,
cos φ = (b 2 + c 2 −a 2 ) / 2bc Equation (4)
Holds.

続いて、図20(b) に示す三角形OQSを考える。この図20(b) は、図19に示す三角形OQSをそのまま抜き出して示したものである。交線円Sは、前述したとおり、原点Oを中心とする半径Dの球面C3と回転楕円体Eとの交線であるから、2点OSの距離は、2点OQの距離に等しくDになる。したがって、三角形OQSは二等辺三角形になり、2つの等辺の挟角はφ′、第3の辺の長さはfである。この三角形OQSに、式(4)に示す余弦定理を適用すると、
cos φ′=(D+D−f)/2D 式(5)
が成り立つ。
Next, consider the triangle OQS shown in FIG. FIG. 20B shows the triangle OQS shown in FIG. 19 as extracted. Since the intersection line circle S is the intersection line of the spheroid E3 and the spherical surface C3 having the radius D centered on the origin O as described above, the distance between the two points OS is equal to the distance between the two points OQ and becomes D. Become. Therefore, the triangle OQS is an isosceles triangle, the included angle between the two equal sides is φ ′, and the length of the third side is f. Applying the cosine theorem shown in Equation (4) to this triangle OQS,
cos φ ′ = (D 2 + D 2 −f 2 ) / 2D 2 formula (5)
Holds.

ここで、図19を見ると、長さfは、回転楕円体Eの短軸半径βに近い値になることがわかる。そこで、近似的に、f≒βとすると、β=k・Dなので、f≒k・Dになり、図20の下段右に示すとおり、
cos φ′≒1−k/2 式(6)
なる式が得られる。
Here, it can be seen from FIG. 19 that the length f is close to the minor axis radius β of the spheroid E. Therefore, approximately, if f≈β, then β = k · D, so f≈k · D, and as shown in the lower right of FIG.
cos φ '≒ 1-k 2 /2 Equation (6)
The following formula is obtained.

次に、図21に示す三角形OQqを考える。この図21は、図19に示す4点O,Q,S,qをそのまま抜き出してプロットしたものである。2点OQ間の距離はDであり、2点Oq間の距離はdである。ここで、この長さD,dをもった2辺の挟角をθとし、第3の辺の長さをtとする。また、線分OQと線分OSとのなす角φ′は、前述した円錐ξ′の半頂角である。   Next, consider the triangle OQq shown in FIG. FIG. 21 shows the four points O, Q, S, and q shown in FIG. The distance between the two points OQ is D, and the distance between the two points Oq is d. Here, an angle between two sides having the lengths D and d is θ, and a length of the third side is t. Further, the angle φ ′ formed by the line segment OQ and the line segment OS is the half apex angle of the cone ξ ′ described above.

さて、図19において、円錐ξの代わりに円錐ξ′を用いて、比較点qがハッチング領域にあるための条件を求めると、θ>φ′であればよいことがわかる。ここで、座標値(画素値)R,G,B,r,g,bが正の値をとるものとすれば、角度θおよびφ′はいずれも鋭角になる。図21の右側にも記載したとおり、一般に、θ,φ′を正の鋭角とすれば、θ>φ′の場合、「cos θ<cos φ′」であり、「cos θ<cos φ′」である。式(6)より、cos φ′≒(1−k/2)であるから、結局、
cos θ<(1−k/2) 式(7)
が成り立てば、比較点qは、円錐ξ′の外側領域にあると近似的に判断できる。
Now, in FIG. 19, using the cone ξ ′ instead of the cone ξ and obtaining the condition for the comparison point q to be in the hatched region, it can be seen that θ> φ ′. Here, if the coordinate values (pixel values) R, G, B, r, g, b are positive values, the angles θ and φ ′ are both acute angles. As described on the right side of FIG. 21, generally, if θ and φ ′ are positive acute angles, when θ> φ ′, “cos θ <cos φ ′” and “cos 2 θ <cos 2 φ”. ''. The equation (6), cos 2 φ ' ≒ (1-k 2/2) because it is 2, after all,
cos 2 θ <(1-k 2/2) 2 Equation (7)
Can be approximately determined that the comparison point q is in the outer region of the cone ξ ′.

続いて、図21に示す三角形OQqについて、式(4)の余弦定理を適用すれば、図21の下段に示すように、
cos θ=(D+d−t)/(2・D・d) 式(8)
が成り立つ。このとき、図22にも記載したとおり、
=(R+G+B
=(r+g+b
=(R−r)+(G−g)+(B−b)
だから、これを式(8)に代入して整理すると、
cos θ=γ/(D・d) 式(9)
(但し、γ=R・r+G・g+B・b)
が得られる。式(9)の両辺を2乗すれば、
cos θ=γ/(D・d) 式(10)
である。よって、式(7)より、
γ/(D・d)<(1−k/2) 式(11)
が成り立てば、比較点qは、円錐ξ′の外側領域にあると近似的に判断できる。ここで、γ,D,dを画素値を用いて書き直せば、図22の下段に示すように、
(R・r+G・g+B・b)
((R+G+B)・(r+g+b))
<(1−k/2) 式(11′)
が成り立てば、比較点qは、円錐ξ′の外側領域にあると近似的に判断できる。
Subsequently, if the cosine theorem of Equation (4) is applied to the triangle OQq shown in FIG. 21, as shown in the lower part of FIG.
cos θ = (D 2 + d 2 −t 2 ) / (2 · D · d) Equation (8)
Holds. At this time, as described in FIG.
D 2 = (R 2 + G 2 + B 2 )
d 2 = (r 2 + g 2 + b 2 )
t 2 = (R−r) 2 + (G−g) 2 + (B−b) 2
So, substituting this into equation (8)
cos θ = γ / (D · d) Equation (9)
(However, γ = R ・ r + G ・ g + B ・ b)
Is obtained. If both sides of equation (9) are squared,
cos 2 θ = γ 2 / (D 2 · d 2 ) Formula (10)
It is. Therefore, from equation (7),
γ 2 / (D 2 · d 2) <(1-k 2/2) 2 Equation (11)
Can be approximately determined that the comparison point q is in the outer region of the cone ξ ′. Here, if γ, D, and d are rewritten using pixel values, as shown in the lower part of FIG.
(R · r + G · g + B · b) 2 /
((R 2 + G 2 + B 2 ) · (r 2 + g 2 + b 2 ))
<(1-k 2/2 ) 2 formula (11 ')
Can be approximately determined that the comparison point q is in the outer region of the cone ξ ′.

既に述べたとおり、図19において、円錐ξ′は、円錐ξに近似的に代用することができるので、上記式(11′)が成り立てば、比較点qは、回転楕円体Eの外側領域にある、との近似的判定を行うことができる。もちろん、この近似的な判定結果は、円錐ξ′を円錐ξに代用し、かつ、f≒βとの近似を行うことによって得られる判定結果であるので、厳密な判定結果ではない。しかしながら、そもそも回転楕円体E自体が、移動物体を厳密に検出する機能をもつ立体であるわけではないので、このような近似的な判定を行っても、大きな支障は生じない。別言すれば、上述した近似的な判定手法は、比較点qが回転楕円体Eの外部にあるかどうかを判定する代わりに、その近似体の外部に位置するかどうかを判定する手法ということになる。   As already described, in FIG. 19, the cone ξ ′ can be approximately substituted for the cone ξ. Therefore, if the above equation (11 ′) is established, the comparison point q is in the outer region of the spheroid E. It is possible to make an approximate determination that there is. Of course, this approximate determination result is not a strict determination result because it is a determination result obtained by substituting the cone ξ ′ for the cone ξ and approximating f≈β. However, since the spheroid E itself is not a solid having a function of detecting a moving object strictly, even if such an approximate determination is performed, no major trouble occurs. In other words, the approximate determination method described above is a method for determining whether or not the comparison point q is located outside the approximate ellipsoid E instead of determining whether or not the comparison point q is outside the spheroid E. become.

このようにして、式(11′)を満足する結果が得られた場合、比較点qは、回転楕円体Eの近似体の外側に位置すると判断できるので、基準点Qの類似範囲外との判定を行うことができる。   When a result satisfying the expression (11 ′) is obtained in this way, it can be determined that the comparison point q is located outside the approximated body of the spheroid E, so Judgment can be made.

一方、式(11′)を満足しない場合は、比較点qは、図19においてハッチングが施されていない円錐ξの内側に位置すると近似的に判断されたことになるので、最終的に、第3の条件判定段階が行われる。   On the other hand, if the expression (11 ′) is not satisfied, the comparison point q is approximately determined to be located inside the non-hatched cone ξ in FIG. Three condition determination steps are performed.

図23は、この第3の条件判定段階の原理を示す断面図である。第3の条件判定段階では、比較点qが、図23のハッチング領域内にあるかどうかの判定が行われる。このハッチング領域は、回転楕円体Eの外側領域であり、いわば第3の条件判定段階は、§7で述べた回転楕円体モデルを用いた類否判定として行うべき本来の判定段階ということになる。このため、条件判定に用いられる式は、楕円の方程式を用いた式になり、これまでの条件判定式に比べると、若干複雑にならざるを得ない。   FIG. 23 is a sectional view showing the principle of the third condition determination stage. In the third condition determination stage, it is determined whether or not the comparison point q is within the hatched area of FIG. This hatching area is an outer area of the spheroid E, and so the third condition determination stage is an original determination stage that should be performed as the similarity determination using the spheroid model described in §7. . For this reason, the expression used for the condition determination is an expression using an elliptical equation, which is inevitably slightly more complicated than the conventional condition determination expression.

いま、図23に示すように、基準点Qの位置に原点をもち、紙面上に定義されたローカルなXY二次元直交座標系をとり、この二次元座標系上において、楕円Eと比較点qとの位置関係を考えることにしよう。ここで、X軸は回転楕円体Eの長軸方向の座標軸であり、Y軸は回転楕円体Eの短軸方向の座標軸である。もちろん、基準点QのXY座標系での座標は(0,0)になる。したがって、比較点qは、RGB三次元直交座標系ではq(r,g,b)なる三次元の座標値をもち、XYローカル座標系ではq(x,y)なる二次元の座標値をもつ。   As shown in FIG. 23, a local XY two-dimensional orthogonal coordinate system having an origin at the position of the reference point Q and defined on the paper surface is taken. On this two-dimensional coordinate system, an ellipse E and a comparison point q are taken. Let's consider the positional relationship with. Here, the X axis is a coordinate axis in the major axis direction of the spheroid E, and the Y axis is a coordinate axis in the minor axis direction of the spheroid E. Of course, the coordinates of the reference point Q in the XY coordinate system are (0, 0). Therefore, the comparison point q has a three-dimensional coordinate value q (r, g, b) in the RGB three-dimensional orthogonal coordinate system, and a two-dimensional coordinate value q (x, y) in the XY local coordinate system. .

ここで、比較点qの座標値(x,y)を、2点OQ間の距離D、2点Oq間の距離d、そして挟角θを用いて表すと、図23の右下にも記載したとおり、
x=D−d・cos θ、 y=d・sin θ 式(12)
が成り立つ。一方、図24に示すとおり、楕円の公式からは、
/α+y/β=1 式(13)
が得られるので、
f(x,y)=β・x+α・y−α・β 式(14)
なる判定式を定義すれば、比較点qは、
f(x,y)<0なら楕円内部の点
f(x,y)=0なら楕円上の点
f(x,y)>0なら楕円外部の点
ということになる。したがって、
β・x+α・y−α・β>0 式(15)
であれば、比較点qは、楕円外部の点ということになる。ここで、XYローカル座標系を、基準軸Zを中心軸として回転しても、上式が成り立つことに変わりはないので、式(15)は、三次元立体にも拡張することができる。すなわち、式(15)の条件が満足されていれば、比較点qは、回転楕円体Eの外側領域の点ということになる。
Here, when the coordinate value (x, y) of the comparison point q is expressed using the distance D between the two points OQ, the distance d between the two points Oq, and the included angle θ, it is also shown in the lower right of FIG. As you did
x = D−d · cos θ, y = d · sin θ Equation (12)
Holds. On the other hand, as shown in FIG.
x 2 / α 2 + y 2 / β 2 = 1 Formula (13)
So that
f (x, y) = β 2 · x 2 + α 2 · y 2 −α 2 · β 2 Formula (14)
If the following judgment formula is defined, the comparison point q is
If f (x, y) <0, the point inside the ellipse
If f (x, y) = 0, the point on the ellipse
If f (x, y)> 0, it is a point outside the ellipse. Therefore,
β 2 · x 2 + α 2 · y 22 · β 2 > 0 Formula (15)
Then, the comparison point q is a point outside the ellipse. Here, even if the XY local coordinate system is rotated about the reference axis Z as the central axis, the above equation is still true, and therefore the equation (15) can be extended to a three-dimensional solid. That is, if the condition of Expression (15) is satisfied, the comparison point q is a point in the outer region of the spheroid E.

なお、式(15)において、各変数の値は、図24の下半分に示すように、次のようにして求めることができる。まず、α=h・D、β=k・Dであるから、
α=h・D、 β=k・D 式(16)
である。一方、式(12)より、x=D−d・cos θだから、両辺を2乗すると、
=D+d・cos θ−2Dd・cos θ
となり、これに式(9)および式(10)を代入すれば、
=D+γ/D−2γ 式(17)
が得られる(但し、γ=R・r+G・g+B・b)。また、式(12)より、y=d・sin θだから、両辺を2乗すると、
=d・sin θ=d・(1−cos θ)
となり、これに式(10)を代入すれば、
=d−γ/D 式(18)
が得られる(但し、γ=R・r+G・g+B・b)。
In equation (15), the value of each variable can be obtained as follows, as shown in the lower half of FIG. First, since α = h · D and β = k · D,
α 2 = h 2 · D 2 , β 2 = k 2 · D 2 (16)
It is. On the other hand, since x = D−d · cos θ from equation (12), if both sides are squared,
x 2 = D 2 + d 2 · cos 2 θ-2Dd · cos θ
And substituting Equation (9) and Equation (10) into this,
x 2 = D 2 + γ 2 / D 2 −2γ Formula (17)
(Where γ = R · r + G · g + B · b). Also, from equation (12), y = d · sin θ, so if both sides are squared,
y 2 = d 2 · sin 2 θ = d 2 · (1-cos 2 θ)
And substituting equation (10) into this,
y 2 = d 2 −γ 2 / D 2 formula (18)
(Where γ = R · r + G · g + B · b).

かくして、式(16)〜式(18)によって、α,β,x,yの各値を求めた後に、式(15)の条件判定式を演算すれば、比較点qが、回転楕円体Eの内側領域の点か、外側領域の点かを判定することができる。 Thus, after calculating the values of α 2 , β 2 , x 2 , and y 2 according to Equations (16) to (18), if the condition determination equation of Equation (15) is calculated, the comparison point q is Whether the point is in the inner region or the outer region of the spheroid E can be determined.

図25は、これまで述べてきた類否判定方法の手順を示す流れ図である。この類否判定方法によれば、三原色の各画素値(R,G,B)を有する第1のカラー画素と、三原色の各画素値(r,g,b)を有する第2のカラー画素と、の類否判定を行うことができる。なお、実際には、この図25に示す各手順は、コンピュータによって実行されることになる。   FIG. 25 is a flowchart showing the procedure of the similarity determination method described so far. According to this similarity determination method, the first color pixel having each pixel value (R, G, B) of the three primary colors, and the second color pixel having each pixel value (r, g, b) of the three primary colors, Similarity determination can be performed. In practice, each procedure shown in FIG. 25 is executed by a computer.

まず、ステップS11では、回転楕円体Eのサイズを決めるパラメータh,kを設定する。前述したとおり、パラメータhは、回転楕円体Eの長軸半径αを決定する値(h<1)であり、長軸半径はα=h・Dなる式で定められる。また、パラメータkは、回転楕円体Eの短軸半径βを決定する値(k<h)であり、短軸半径はβ=k・Dなる式で定められる。これらパラメータh,kの値は、背景画像の特徴(たとえば、屋外か屋内か、街中か郊外か、といった種別)や、移動物体として侵入してくる前景画像の特徴(たとえば、車両か人間か、といった種別)を考慮して、できるだけ高い検出精度が得られるような値に適宜設定することになる。本願発明者が行った実験によれば、一般的な用途の場合、h=0.45〜0.20、k=0.15〜0.05程度の値に設定すれば、比較的高い検出精度が得られる。図9に示す移動物体検出装置の場合、パラメータ設定部340に対する操作入力により、パラメータh,kの値を任意に設定することができる。   First, in step S11, parameters h and k for determining the size of the spheroid E are set. As described above, the parameter h is a value (h <1) that determines the major axis radius α of the spheroid E, and the major axis radius is determined by the equation α = h · D. The parameter k is a value (k <h) that determines the minor axis radius β of the spheroid E, and the minor axis radius is determined by the equation β = k · D. The values of these parameters h and k are the characteristics of the background image (for example, the type of outdoor or indoor, city or suburb), and the characteristics of the foreground image that enters as a moving object (for example, whether it is a vehicle or a human, Therefore, the value is set as appropriate so that the highest possible detection accuracy can be obtained. According to experiments conducted by the present inventor, in the case of general applications, relatively high detection accuracy can be achieved by setting h = 0.45 to 0.20 and k = 0.15 to 0.05. Is obtained. In the case of the moving object detection device shown in FIG. 9, the values of the parameters h and k can be arbitrarily set by an operation input to the parameter setting unit 340.

続く、ステップS12では、基準点Q(R,G,B)と比較点q(r,g,b)の座標値(R,G,B)および(r,g,b)が取り込まれる。これらの座標値は、それぞれ2つのカラー画像の三原色の画素値として与えられた値である。これら座標値が取り込まれたら、準備段階は完了である。すなわち、コンピュータには、パラメータh(h<1)およびk(k<h)、画素値(R,G,B)および(r,g,b)の値が取り込まれた状態となり、これらの値を用いて、以下の演算処理を実行する準備が整ったことになる。   In step S12, the coordinate values (R, G, B) and (r, g, b) of the reference point Q (R, G, B) and the comparison point q (r, g, b) are captured. These coordinate values are values given as pixel values of the three primary colors of the two color images. Once these coordinate values are captured, the preparation stage is complete. That is, the parameters h (h <1) and k (k <h) and the pixel values (R, G, B) and (r, g, b) are taken into the computer, and these values are obtained. This completes the preparation for executing the following arithmetic processing.

以下、ステップS13〜S18に示す手順は、図15に示すように、三原色の各画素値を各座標軸にとった三次元座標系において、画素値(R,G,B)に対応する座標をもつ基準点Qを中心とする所定サイズの回転楕円体Eと、画素値(r,g,b)に対応する座標をもつ比較点qとについて、後者が前者の内部にあるか外部にあるかを調べる位置関係判定段階の手順である。   Hereinafter, the procedures shown in steps S13 to S18 have coordinates corresponding to the pixel values (R, G, B) in a three-dimensional coordinate system in which the pixel values of the three primary colors are taken as the coordinate axes, as shown in FIG. For the spheroid E of a predetermined size centered on the reference point Q and the comparison point q having coordinates corresponding to the pixel value (r, g, b), whether the latter is inside or outside the former This is the procedure of the positional relationship determination stage to be examined.

具体的には、既に述べたとおり、三次元座標系の原点Oと基準点Qとの距離Dに、所定のパラメータh(但し、h<1)を乗じて求まる値α=h・Dを長軸半径とし、所定のパラメータk(但し、k<h)を乗じて求まる値β=k・Dを短軸半径とする楕円を、原点Oと基準点Qとを結ぶ基準軸Z上に長軸が重なるように、かつ、基準点Qが中心点となるように配置し、この基準軸Zを中心に回転させることにより得られる回転楕円体Eを定義する。そして、比較点qがこの回転楕円体Eの内部にあるか外部にあるかを判定することになる。なお、実際には、前述したような近似を行うため、論理的には、回転楕円体Eの代わりに、その近似体について、内部にあるか外部にあるかの判定が行われることになる。この位置関係判定段階は、3つの条件判定段階によって構成される。   Specifically, as described above, the value α = h · D obtained by multiplying the distance D between the origin O of the three-dimensional coordinate system and the reference point Q by a predetermined parameter h (where h <1) is long. An ellipse having a short axis radius of β = k · D, which is obtained by multiplying a predetermined parameter k (where k <h), is a long axis on a reference axis Z connecting the origin O and the reference point Q. Are arranged so that the reference points Q are the center points, and a spheroid E obtained by rotating around the reference axis Z is defined. Then, it is determined whether the comparison point q is inside or outside the spheroid E. Actually, since the approximation as described above is performed, instead of the spheroid E, it is logically determined whether the approximate body is inside or outside. This positional relationship determination stage includes three condition determination stages.

まず、ステップS13に示す第1の条件判定段階では、図17に示すように、「原点Oを中心とし半径(D−α)の球C1の内側に比較点qが位置する」もしくは「原点Oを中心とし半径(D+α)の球C2の外側に比較点qが位置する」という条件を満足するか否かの判定が行われる。そのためには、図18で説明したとおり、
(1−h)・D>d 式(2)
もしくは
(1+h)・D<d 式(3)
という条件を満足するか否かを判定するための演算を行えばよい。ここで、
=(R+G+B
=(r+g+b
であるから、結局、ステップS13のブロック内に記載したように、
(1−h)・(R+G+B)>(r+g+b) 式(2′)
もしくは
(1+h)・(R+G+B)<(r+g+b) 式(3′)
という条件を満足するか否かを判定する演算を行えばよい。
First, in the first condition determination stage shown in step S13, as shown in FIG. 17, “the comparison point q is located inside the sphere C1 having the radius (D−α) around the origin O” or “the origin O It is determined whether or not the condition that the comparison point q is located outside the sphere C2 having the radius (D + α) as the center ”is satisfied. For that purpose, as explained in FIG.
(1-h) 2 · D 2 > d 2 Formula (2)
Or
(1 + h) 2 · D 2 <d 2 formula (3)
An operation for determining whether or not the above condition is satisfied may be performed. here,
D 2 = (R 2 + G 2 + B 2 )
d 2 = (r 2 + g 2 + b 2 )
Therefore, after all, as described in the block of step S13,
(1-h) 2 · (R 2 + G 2 + B 2 )> (r 2 + g 2 + b 2 ) Formula (2 ′)
Or (1 + h) 2 · (R 2 + G 2 + B 2 ) <(r 2 + g 2 + b 2 ) Formula (3 ′)
An operation for determining whether or not the above condition is satisfied may be performed.

このステップS13に示す第1の条件判定段階において、肯定的な判定がなされた場合(式(2′)もしくは式(3′)の条件を満足する場合)は、ステップS14からステップS19へと進み、位置関係判定段階は終結する。一方、否定的判定がなされた場合には、ステップS14からステップS15へと進む。   If a positive determination is made in the first condition determination stage shown in step S13 (when the condition of expression (2 ′) or expression (3 ′) is satisfied), the process proceeds from step S14 to step S19. The positional relationship determination step ends. On the other hand, if a negative determination is made, the process proceeds from step S14 to step S15.

ステップS15に示す第2の条件判定段階では、図19に示すように、「原点Oを頂点、基準軸Zを中心軸とし、回転楕円体Eと円で接する円錐ξの外側に比較点qが位置する」という第2の条件を満足するか否かの判定が行われる。ただ、前述したとおり、実用上は、円錐ξの代わりに円錐ξ′を用い、しかもf≒βと近似する式が用いられる。このような近似的な判定手法を採る場合は、第2の条件は「回転楕円体Eの近似体の外側に比較点qが位置する」という条件になる。   In the second condition determination stage shown in step S15, as shown in FIG. 19, “the comparison point q is outside the cone ξ with the origin O as the apex and the reference axis Z as the center axis and in contact with the spheroid E with a circle. It is determined whether or not the second condition “located” is satisfied. However, as described above, in practice, an expression that uses a cone ξ ′ instead of the cone ξ and approximates f≈β is used. When such an approximate determination method is employed, the second condition is that the comparison point q is located outside the approximated body of the spheroid E.

この近似的な判定手法を採るのであれば、図22に示すとおり、
γ/(D・d)<(1−k/2) 式(11)
という条件を満足するか否かを判定するための演算を行えばよい。ここで、
=(R+G+B
=(r+g+b)、
γ=(R・r+G・g+B・b)
であるから、結局、ステップS15のブロック内に記載したように、
(R・r+G・g+B・b)
((R+G+B)・(r+g+b))
<(1−k/2)式(11′)
という条件を満足するか否かを判定する演算を行えばよい。
If this approximate determination method is adopted, as shown in FIG.
γ 2 / (D 2 · d 2) <(1-k 2/2) 2 Equation (11)
An operation for determining whether or not the above condition is satisfied may be performed. here,
D 2 = (R 2 + G 2 + B 2 )
d 2 = (r 2 + g 2 + b 2 ),
γ = (R · r + G · g + B · b)
Therefore, after all, as described in the block of step S15,
(R · r + G · g + B · b) 2 /
((R 2 + G 2 + B 2 ) · (r 2 + g 2 + b 2 ))
<(1-k 2/2 ) 2 formula (11 ')
An operation for determining whether or not the above condition is satisfied may be performed.

このステップS15に示す第2の条件判定段階において、肯定的な判定がなされた場合(式(11′)の条件を満足する場合)は、ステップS16からステップS19へと進み、位置関係判定段階は終結する。一方、否定的判定がなされた場合には、ステップS16からステップS17へと進む。   If an affirmative determination is made in the second condition determination step shown in step S15 (when the condition of expression (11 ′) is satisfied), the process proceeds from step S16 to step S19, and the positional relationship determination step is performed. End. On the other hand, if a negative determination is made, the process proceeds from step S16 to step S17.

ステップS17に示す第3の条件判定段階では、図23に示すように、「回転楕円体Eの外側に比較点qが位置する」という第3の条件を満足するか否かの判定が行われる。そのためには、ステップS17のブロック内に記載したように、
β・x+α・y−α・β>0 式(15)
という条件を満足するか否かを判定するための演算を行えばよい。ここで、各変数は、図24で説明したとおり、
α=h・D、 β=k・D 式(16)
=D+γ/D−2γ 式(17)
=d−γ/D式(18)
であり、また、既に述べたとおり、
=(R+G+B
=(r+g+b
γ=(R・r+G・g+B・b)
である。
In the third condition determination stage shown in step S17, as shown in FIG. 23, it is determined whether or not the third condition “the comparison point q is located outside the spheroid E” is satisfied. . To do so, as described in the block of step S17,
β 2 · x 2 + α 2 · y 22 · β 2 > 0 Formula (15)
An operation for determining whether or not the above condition is satisfied may be performed. Here, as described in FIG.
α 2 = h 2 · D 2 , β 2 = k 2 · D 2 (16)
x 2 = D 2 + γ 2 / D 2 -2γ Formula (17)
y 2 = d 2 −γ 2 / D 2 formula (18)
And as already mentioned,
D 2 = (R 2 + G 2 + B 2 )
d 2 = (r 2 + g 2 + b 2 )
γ = (R · r + G · g + B · b)
It is.

このステップS17に示す第3の条件判定段階において、肯定的な判定がなされた場合(式(15)の条件を満足する場合)は、ステップS18からステップS19へと進み、位置関係判定段階は終結する。一方、否定的判定がなされた場合には、ステップS18からステップS20へと進み、やはり位置関係判定段階は終結する。   If a positive determination is made in the third condition determination stage shown in step S17 (when the condition of expression (15) is satisfied), the process proceeds from step S18 to step S19, and the positional relationship determination stage is terminated. To do. On the other hand, if a negative determination is made, the process proceeds from step S18 to step S20, and the positional relationship determination stage is also terminated.

ここで注目すべき点は、以上の第1〜第3の条件判定段階で行われる条件判定式には、加減乗除演算のみしか含まれていない点である。すなわち、一般的な幾何学演算に含まれている開平演算や三角関数演算は一切含まれていない。したがって、演算装置の負担は比較的軽いものになり、安価なプロセッサを用いた場合でも、リアルタイム処理が可能になる。   What should be noted here is that the condition determination formulas performed in the first to third condition determination stages described above include only addition / subtraction / multiplication / division calculations. In other words, it does not include any square root or trigonometric function operations that are included in general geometric operations. Therefore, the burden on the arithmetic unit is relatively light, and real-time processing is possible even when an inexpensive processor is used.

最後に、ステップS19もしくはステップS20に示す判定結果出力段階が行われる。すなわち、上述したとおり、第1の条件判定段階(ステップS13)、第2の条件判定段階(ステップS15)、第3の条件判定段階(ステップS17)のいずれかにおいて肯定的判定がなされた場合には、ステップS19へと進み、第1のカラー画素と第2のカラー画素とが非類似との判定結果が出力される。一方、第1の条件判定段階(ステップS13)、前記第2の条件判定段階(ステップS15)、前記第3の条件判定段階(ステップS17)のすべてにおいて否定的判定がなされた場合には、ステップS20へ進み、第1のカラー画素と第2のカラー画素とが類似するとの判定結果が出力される。   Finally, the determination result output stage shown in step S19 or step S20 is performed. That is, as described above, when a positive determination is made in any of the first condition determination stage (step S13), the second condition determination stage (step S15), and the third condition determination stage (step S17). Advances to step S19, and a determination result that the first color pixel and the second color pixel are dissimilar is output. On the other hand, if a negative determination is made in all of the first condition determination stage (step S13), the second condition determination stage (step S15), and the third condition determination stage (step S17), The process proceeds to S20, and a determination result that the first color pixel and the second color pixel are similar is output.

要するに、この図25の流れ図に示す手順によれば、回転楕円体Eもしくはその近似体の外部に比較点qがあると判断された場合には、第1のカラー画素と第2のカラー画素とが非類似との判定結果が出力され、回転楕円体Eもしくはその近似体の内部に比較点qがあると判断された場合には、第1のカラー画素と第2のカラー画素とが類似するとの判定結果が出力されることになる。ステップS15の第2の条件判定段階は、ステップS13の第1の条件判定段階において否定的判定がなされた場合にのみ実行され、同様に、ステップS17の第3の条件判定段階は、ステップS15の第2の条件判定段階において否定的判定がなされた場合にのみ実行されることになるので、無駄な演算を省くことが可能になり、演算負担の軽減を図ることができる。   In short, according to the procedure shown in the flowchart of FIG. 25, when it is determined that the comparison point q is outside the spheroid E or its approximate body, the first color pixel and the second color pixel Is output as a non-similar determination result, and it is determined that the comparison point q is inside the spheroid E or its approximated body, the first color pixel is similar to the second color pixel. Will be output. The second condition determination stage in step S15 is executed only when a negative determination is made in the first condition determination stage in step S13. Similarly, the third condition determination stage in step S17 is performed in step S15. Since this process is executed only when a negative determination is made in the second condition determination stage, it is possible to omit a useless calculation and to reduce the calculation burden.

特に、パラメータh,kの値を固定値にした運用を行う場合、ステップS13の演算式(2′),(3′)に用いる(1−h)および(1+h)の値、ステップS15の演算式(11′)に用いる(1−k/2)の値は、予め決められた定数として用意しておくことができるので、演算負担を更に軽減することができる。実際には、まず、(R+G+B)の値および(r+g+b)の値を計算してしまえば、ステップS13の演算式(2′),(3′)に係る演算は、上記定数を利用した極めて単純な演算になる。同様に、ステップS15の演算式(11′)に係る演算も、(R・r+G・g+B・b)の値を計算してしまえば、既に計算済みの(R+G+B)の値および(r+g+b)の値と、上記定数を利用することにより、極めて単純な演算になる。 In particular, when an operation is performed in which the values of the parameters h and k are fixed values, the values of (1−h) 2 and (1 + h) 2 used in the arithmetic expressions (2 ′) and (3 ′) in step S13, step S15 the value of using the arithmetic expression (11 ') (1-k 2/2) 2 of, it is possible to be prepared as a predetermined constant, it is possible to further reduce the computation load. Actually, if the value of (R 2 + G 2 + B 2 ) and the value of (r 2 + g 2 + b 2 ) are calculated first, the calculation formulas (2 ′) and (3 ′) in step S13 are related. The calculation is a very simple calculation using the above constants. Similarly, in the calculation related to the calculation formula (11 ′) in step S15, if the value of (R · r + G · g + B · b) is calculated, the already calculated value (R 2 + G 2 + B 2 ) and By using the value of (r 2 + g 2 + b 2 ) and the above constant, the calculation becomes extremely simple.

<<< §9.前背判定部の実用的な構成 >>>
ここでは、図9に示す前背判定部450において、画素の類否判定に、§8で述べた実用的な類否判定手順を採用する場合の構成を説明する。図26は、この前背判定部450の構成を示すブロック図である。既に述べたとおり、前背判定部450は、第1判定部420、第2判定部430、総合判定部440によって構成されている。
<<< §9. Practical configuration of foreground judgment unit >>>
Here, the configuration in the case where the practical similarity determination procedure described in §8 is adopted for the similarity determination of the pixels in the foreground determination unit 450 illustrated in FIG. 9 will be described. FIG. 26 is a block diagram showing a configuration of this foreground determination unit 450. As described above, the foreground determination unit 450 includes the first determination unit 420, the second determination unit 430, and the comprehensive determination unit 440.

ここで、第1判定部420は、第i番目の原画像P(i)を構成する画素の画素値p(i)と第(i−1)番目の平均画像A(i−1)を構成する画素の画素値a(i−1)とを比較して類似するか否かを判定する処理を行い、第2判定部430は、第i番目の原画像P(i)を構成する画素の画素値p(i)と第(i−1)番目の参照画像U(i−1)を構成する画素の画素値u(i−1)とを比較して類似するか否かを判定する処理を行う。一方、総合判定部440は、図示の表に示すとおり、第1判定部420による判定結果および第2判定部430による判定結果の少なくとも一方が類似を示す場合には背景画素との判定を行い判定結果J=1を出力し、双方とも非類似を示す場合には前景画素との判定を行い判定結果J=0を出力する。   Here, the first determination unit 420 configures the pixel value p (i) of the pixels constituting the i-th original image P (i) and the (i−1) -th average image A (i−1). The pixel value a (i-1) of the pixel to be compared is compared to determine whether or not they are similar to each other, and the second determination unit 430 determines whether the pixel constituting the i-th original image P (i) A process of comparing the pixel value p (i) with the pixel value u (i-1) of the pixels constituting the (i-1) th reference image U (i-1) to determine whether or not they are similar. I do. On the other hand, as shown in the table, the overall determination unit 440 determines that the background pixel is determined when at least one of the determination result by the first determination unit 420 and the determination result by the second determination unit 430 is similar. When the result J = 1 is output and both are dissimilar, the foreground pixel is determined and the determination result J = 0 is output.

第1判定部420および第2判定部430が、類似との判定結果を論理1、非類似との判定結果を論理0として出力するようにしておけば、総合判定部440は、これらの論理値の論理和を判定結果Jとして出力することができるので、総合判定部440を論理和回路によって構成することができる。   If the first determination unit 420 and the second determination unit 430 output the determination result of similarity as logic 1 and the determination result of dissimilarity as logic 0, the comprehensive determination unit 440 outputs these logical values. Can be output as the determination result J, so that the comprehensive determination unit 440 can be configured by an OR circuit.

図27は、図26に示す第1判定部420の詳細構成を示すブロック図である。この第1判定部420は、§8で述べた回転楕円体モデルを利用した実用的な類否判定手順を採用し、図示のとおり、基本演算部421、第1の条件判定部422、第2の条件判定部423、第3の条件判定部424、判定値出力部425、パラメータ保持部426によって構成されている。   FIG. 27 is a block diagram showing a detailed configuration of the first determination unit 420 shown in FIG. The first determination unit 420 adopts a practical similarity determination procedure using the spheroid model described in §8, and as illustrated, a basic calculation unit 421, a first condition determination unit 422, a second The condition determination unit 423, the third condition determination unit 424, the determination value output unit 425, and the parameter holding unit 426 are configured.

パラメータ保持部426は、パラメータhおよびkの値を保持する構成要素であり、図9に示すパラメータ設定部340を設けた場合には、このパラメータ設定部340によって設定されたパラメータhおよびkの値がパラメータ保持部426に書き込まれることになる。パラメータhおよびkの値を固定にする場合には、当該固定値がパラメータ保持部426に保持される。   The parameter holding unit 426 is a component that holds the values of the parameters h and k. When the parameter setting unit 340 shown in FIG. 9 is provided, the parameter h and k values set by the parameter setting unit 340 are provided. Is written in the parameter holding unit 426. When the values of the parameters h and k are fixed, the fixed values are held in the parameter holding unit 426.

基本演算部421は、図9に示す画素値読出部410が読み出した基準画素値(R,G,B)(画素p(i)の画素値)と比較画素値(r,g,b)(画素a(i−1)の画素値)とに基づいて、
=R+G+B および
=r+g+b
なる演算を行い、値Dおよび値dを算出する構成要素である。ここで算出された値Dおよび値dは、第1の条件判定部422、第2の条件判定部423、第3の条件判定部424における演算で利用される。
The basic calculation unit 421 uses the reference pixel value (R, G, B) (pixel value of the pixel p (i)) read by the pixel value reading unit 410 shown in FIG. 9 and the comparison pixel value (r, g, b) ( Pixel a (i−1))),
D 2 = R 2 + G 2 + B 2 and
d 2 = r 2 + g 2 + b 2
Performed becomes operational, a component that calculates a value D 2 and the value d 2. The value D 2 and the value d 2 calculated here are used in calculations in the first condition determination unit 422, the second condition determination unit 423, and the third condition determination unit 424.

第1の条件判定部422は、図17に示すように、「原点Oを中心とし半径(D−α)の球C1の内側に比較点qが位置する」もしくは「原点Oを中心とし半径(D+α)の球C2の外側に比較点qが位置する」という第1の条件を満足するか否かを判定する構成要素である。そのために、基本演算部421が算出した値Dおよび値dとパラメータ保持部426に保持されているパラメータhの値とを用いて、
(1−h)・D>d 式(2)
もしくは
(1+h)・D<d 式(3)
という条件を満足するか否かを判定するための演算を行う。そして、「条件満足」との肯定的判定が行われた場合、当該判定結果は、判定値出力部425に報知される。一方、「条件満足せず」との否定的判定が行われた場合、当該判定結果は、第2の条件判定部423に報知される。
As shown in FIG. 17, the first condition determination unit 422 “the comparison point q is located inside the sphere C1 with the origin O as the center and the radius (D−α)” or “the radius with the origin O as the center ( It is a component that determines whether or not the first condition that the comparison point q is located outside the sphere C2 of D + α) is satisfied. Therefore, using the value D 2 and the value d 2 calculated by the basic calculation unit 421 and the value of the parameter h held in the parameter holding unit 426,
(1-h) 2 · D 2 > d 2 Formula (2)
Or
(1 + h) 2 · D 2 <d 2 formula (3)
An operation for determining whether or not the condition is satisfied is performed. Then, when an affirmative determination that “condition is satisfied” is made, the determination result is notified to the determination value output unit 425. On the other hand, when a negative determination is made that “the condition is not satisfied”, the determination result is notified to the second condition determination unit 423.

第2の条件判定部423は、第1の条件判定部422から、「条件満足せず」との否定的判定結果が報知された場合に限り、条件判定処理を実行する構成要素である。ここで行われる処理の目的は、図19に示すように、「原点Oを頂点、基準軸Zを中心軸とし、回転楕円体Eと円で接する円錐ξの外側に比較点qが位置する」という第2の条件を満足するか否かを判定することにある。ただ、実用上は、演算負担を軽減するために、円錐ξの代わりに円錐ξ′を用いた判定を行うようにするのが好ましい。   The second condition determination unit 423 is a component that executes the condition determination process only when a negative determination result “not satisfied” is notified from the first condition determination unit 422. The purpose of the processing performed here is, as shown in FIG. 19, “the comparison point q is located outside the cone ξ with the origin O as the apex and the reference axis Z as the central axis and in contact with the spheroid E with a circle” It is to determine whether or not the second condition is satisfied. However, in practice, in order to reduce the calculation burden, it is preferable to perform the determination using the cone ξ ′ instead of the cone ξ.

すなわち、原点Oを中心とする半径Dの球面C3と回転楕円体Eとの交線を構成する円を交線円Sとしたときに、「原点Oを頂点、基準軸Zを中心軸とし、交線円Sを通る円錐ξ′の外側に比較点qが位置する」という第2の条件を満足するか否かを判定すればよい。このとき、演算負担を更に軽減するために、交線円S上の任意の点と基準点Qとの距離fが短軸半径βに等しいとおいた近似式を用いて近似的な判定を行うようにするのが好ましい。   That is, when a circle constituting an intersection line of the spherical surface C3 having a radius D centered on the origin O and the spheroid E is defined as an intersection circle S, “the origin O is the vertex and the reference axis Z is the central axis It may be determined whether or not the second condition that the comparison point q is located outside the cone ξ ′ passing through the intersection circle S is satisfied. At this time, in order to further reduce the calculation burden, an approximate determination is performed using an approximate expression in which the distance f between an arbitrary point on the intersection circle S and the reference point Q is equal to the minor axis radius β. Is preferable.

このような近似的な判定を行う場合、第2の条件判定部423は、画素値読出部410が読み出した基準画素値(R,G,B)および比較画素値(r,g,b)に基づいて、
γ=R・r+G・g+B・b
なる演算を行い、値γを算出し、更に、基本演算部421が算出した値Dおよび値dとパラメータ保持部426に保持されているパラメータkの値と、算出した値γとを用いて、
γ/(D・d)<(1−k/2) 式(11)
という条件を満足するか否かを判定するための演算を行えばよい。結局、この式(11)の演算式で示される条件は、「原点Oを頂点、基準軸Zを中心軸とし、回転楕円体Eと円で接する円錐ξの近似体の外側に比較点qが位置する」という条件になる。
When performing such approximate determination, the second condition determination unit 423 uses the reference pixel value (R, G, B) and the comparison pixel value (r, g, b) read by the pixel value reading unit 410. On the basis of,
γ = R · r + G · g + B · b
And the value γ is calculated, and the value D 2 and the value d 2 calculated by the basic calculation unit 421, the value of the parameter k held in the parameter holding unit 426, and the calculated value γ are used. And
γ 2 / (D 2 · d 2) <(1-k 2/2) 2 Equation (11)
An operation for determining whether or not the above condition is satisfied may be performed. After all, the condition indicated by the arithmetic expression of the equation (11) is that “the comparison point q is outside the approximated body of the cone ξ that is in contact with the spheroid E and the circle with the origin O as the apex and the reference axis Z as the central axis. It is a condition of “position”.

そして、この第2の条件判定部423において、「条件満足」との肯定的判定が行われた場合、当該判定結果は、判定値出力部425に報知される。一方、「条件満足せず」との否定的判定が行われた場合、当該判定結果は、γの値とともに、第3の条件判定部424に報知される。   When the second condition determination unit 423 makes an affirmative determination that “condition is satisfied”, the determination result is notified to the determination value output unit 425. On the other hand, when a negative determination is made that “the condition is not satisfied”, the determination result is notified to the third condition determination unit 424 together with the value of γ.

第3の条件判定部424は、第2の条件判定部423から、「条件満足せず」との否定的判定結果が報知された場合に限り、条件判定処理を実行する構成要素である。ここで行われる処理の目的は、図23に示すように、「回転楕円体Eの外側に比較点qが位置する」という第3の条件を満足するか否かを判定することにある。そのため、第3の条件判定部424は、基本演算部421が算出した値Dおよび値dと、パラメータ保持部426に保持されているパラメータhおよびkの値と、第2の条件判定部423が算出した値γとを用いて、
α=h・D、 β=k・D式(16)
=D+γ/D−2γ 式(17)
=d−γ/D式(18)
なる演算を行い、当該演算結果を用いて、
β・x+α・y−α・β>0 式(15)
という条件を満足するか否かを判定するための演算を行う。
The third condition determination unit 424 is a component that executes the condition determination process only when the second condition determination unit 423 reports a negative determination result “not satisfied”. The purpose of the processing performed here is to determine whether or not the third condition “the comparison point q is located outside the spheroid E” is satisfied, as shown in FIG. Therefore, the third condition determination unit 424 includes the value D 2 and the value d 2 calculated by the basic calculation unit 421, the values of the parameters h and k held in the parameter holding unit 426, and the second condition determination unit. Using the value γ calculated by 423,
α 2 = h 2 · D 2 , β 2 = k 2 · D 2 (16)
x 2 = D 2 + γ 2 / D 2 -2γ Formula (17)
y 2 = d 2 −γ 2 / D 2 formula (18)
And using the calculation result,
β 2 · x 2 + α 2 · y 22 · β 2 > 0 Formula (15)
An operation for determining whether or not the condition is satisfied is performed.

そして、この第3の条件判定部424における「条件満足」との肯定的判定結果もしくは「条件満足せず」との否定的判定結果は、判定値出力部425に報知される。   Then, a positive determination result of “condition satisfaction” or a negative determination result of “condition not satisfied” in the third condition determination unit 424 is notified to the determination value output unit 425.

判定値出力部425は、第1の条件判定部422、第2の条件判定部423、第3の条件判定部424のいずれかが「条件満足」との肯定的判定を行った場合に、非類似との判定結果(論理値「0」)を出力し、第1の条件判定部422、第2の条件判定部423、第3の条件判定部424のすべてが「条件満足せず」との否定的判定を行った場合に、類似との判定結果(論理値「1」)を出力する。   The determination value output unit 425 is not used when any of the first condition determination unit 422, the second condition determination unit 423, and the third condition determination unit 424 makes a positive determination that “condition is satisfied”. A similar determination result (logical value “0”) is output, and all of the first condition determination unit 422, the second condition determination unit 423, and the third condition determination unit 424 indicate that “the condition is not satisfied”. When a negative determination is made, a determination result (logical value “1”) that is similar is output.

以上、図27を参照して、第1判定部420の詳細構成を述べたが、第2判定部430の構成もこれと全く同様である。なお、第1判定部420による類否判定に用いられる回転楕円体と第2判定部430による類否判定に用いられる回転楕円体とは、両判定部における判定基準を統一するために、同一サイズの回転楕円体とし、三次元座標系上の同一位置に配置するのが好ましい。   The detailed configuration of the first determination unit 420 has been described above with reference to FIG. 27, but the configuration of the second determination unit 430 is exactly the same as this. Note that the spheroid used for similarity determination by the first determination unit 420 and the spheroid used for similarity determination by the second determination unit 430 are the same size in order to unify the determination criteria in both determination units. And are preferably arranged at the same position on the three-dimensional coordinate system.

既に述べたとおり、上記条件判定式には、加減乗除演算のみしか含まれていないため、一般的な幾何学演算に必要とされる開平演算や三角関数演算を行う必要はない。したがって、演算装置の負担は比較的軽いものになり、前背判定部450を安価なプロセッサを用いて構成した場合でも、リアルタイム処理が可能になる。   As described above, the condition determination formula includes only addition / subtraction / division / division operations, and therefore, it is not necessary to perform square root extraction operations or trigonometric function operations necessary for general geometric operations. Therefore, the burden on the arithmetic unit is relatively light, and real-time processing is possible even when the foreground determination unit 450 is configured using an inexpensive processor.

なお、これまで述べた条件判定式には、「不等号>」や「不等号<」を含む演算式が含まれているが、これらの演算式の一部もしくは全部について、「不等号>」の代わりに「不等号≧」を用いた演算式、もしくは「不等号<」の代わりに「不等号≦」を用いた演算式を用いてもかまわない。すなわち、各条件判定式は、比較点qが何らかの図形の内側領域にあるか外側領域にあるかを示すものであるが、当該図形の境界面上の点は、当該図形の内側領域に含ませても、外側領域に含ませてもかまわない。   Note that the conditional judgment expressions described so far include arithmetic expressions including “inequality sign>” and “inequal sign <”. For some or all of these arithmetic expressions, instead of “inequality sign>”. An arithmetic expression using “inequality sign ≧” or an arithmetic expression using “inequality sign ≦” instead of “inequality sign <” may be used. That is, each condition determination expression indicates whether the comparison point q is in the inner region or the outer region of some graphic, but the point on the boundary surface of the graphic is included in the inner region of the graphic. However, it may be included in the outer region.

また、これまで述べた実施形態では、三原色を示す符号として、便宜上、(R,G,B)もしくは(r,g,b)という符号を用いているが、これらの符号は、必ずしも(赤,緑,青)なる三原色を意味するものではない。一般的には、ビデオカメラで撮影した画像は、(赤,緑,青)なる三原色の各画素値をもった画素の集合からなるデータとして与えられるが、本発明は、(赤,緑,青)なる三原色を用いた表色系に限定されるものではなく、他の色からなる三原色を用いた別な表色系にも適用可能である。その場合、各演算式に用いられている(R,G,B)もしくは(r,g,b)という符号は、当該別な表色系の三原色の画素値を示すことになる。   In the embodiments described so far, for the sake of convenience, symbols (R, G, B) or (r, g, b) are used as symbols indicating the three primary colors, but these symbols are not necessarily (red, It does not mean the three primary colors (green, blue). In general, an image captured by a video camera is given as data consisting of a set of pixels having pixel values of the three primary colors (red, green, and blue). The present invention is not limited to the color system using the three primary colors, but can be applied to other color systems using the three primary colors composed of other colors. In this case, the symbols (R, G, B) or (r, g, b) used in each arithmetic expression indicate the pixel values of the three primary colors of the other color systems.

<<< §10.本発明に係る移動物体検出方法 >>>
最後に、本発明を方法の発明として捉えた場合に、当該方法を構成する個々の手順を説明する。この方法は、動画画像について移動物体を検出する移動物体検出方法であり、実用上、この方法を構成する各手順はコンピュータによって実行される。
<<< §10. Moving object detection method according to the present invention >>
Finally, when the present invention is regarded as a method invention, individual procedures constituting the method will be described. This method is a moving object detection method for detecting a moving object for a moving image, and practically, each procedure constituting this method is executed by a computer.

すなわち、本発明に係る移動物体検出方法は、コンピュータが、時系列で連続的に与えられるフレーム単位のカラー原画像を、三原色の各画素値を有する画素の集合体データとして入力する画像入力段階と、コンピュータが、新たな原画像が入力されるたびに、当該新たな原画像と直前に作成した平均画像とに基づいて、新たな平均画像を作成する平均画像作成段階と、コンピュータが、新たな原画像が入力されるたびに、当該新たな原画像と直前に作成した参照画像とに基づいて、新たな参照画像を作成する参照画像作成段階と、コンピュータが、原画像と平均画像と参照画像とを用いた比較処理により、前景領域と背景領域とを区別するマスク画像を作成する画像比較段階と、コンピュータが、作成されたマスク画像を出力する画像出力段階と、によって構成される。   That is, the moving object detection method according to the present invention includes an image input stage in which a computer inputs a frame-unit color original image continuously given in time series as pixel aggregate data having pixel values of three primary colors. Each time a new original image is input, the computer creates an average image creation stage for creating a new average image based on the new original image and the average image created immediately before. Each time an original image is input, a reference image creation stage for creating a new reference image based on the new original image and the reference image created immediately before, and the computer, the original image, the average image, and the reference image The image comparison stage that creates a mask image that distinguishes the foreground area from the background area by comparison processing using and the image output that the computer outputs the created mask image And floor, composed by.

ここで、画像比較段階は、第i番目の原画像、第(i−1)番目の平均画像、第(i−1)番目の参照画像から、それぞれ対応する所定位置にある画素の三原色の各画素値を読み出す画素値読出ステップと、第i番目の原画像を構成する画素の画素値p(i)と第(i−1)番目の平均画像を構成する画素の画素値a(i−1)とが類似するか否かを判定する第1判定処理と、第i番目の原画像を構成する画素の画素値p(i)と第(i−1)番目の参照画像を構成する画素の画素値u(i−1)とが類似するか否かを判定する第2判定処理と、を行い、第i番目の原画像の所定位置にある画素について、第1判定処理による判定結果と第2判定処理による判定結果との少なくとも一方が類似を示す場合には背景画素、双方とも非類似を示す場合には前景画素との判定を行う前背判定ステップと、第i番目のマスク画像を構成する所定位置の画素の画素値として、前背判定ステップにより背景画素と判定された場合には背景領域を示す画素値を、前背判定ステップにより前景画素と判定された場合には前景領域を示す画素値を、それぞれ与えることにより、第i番目のマスク画像を作成するマスク画像作成ステップと、によって構成される。   Here, in the image comparison stage, each of the three primary colors of the pixels at the corresponding predetermined positions from the i-th original image, the (i-1) -th average image, and the (i-1) -th reference image, respectively. A pixel value reading step for reading a pixel value; a pixel value p (i) of a pixel constituting the i-th original image; and a pixel value a (i-1) of a pixel constituting the (i-1) -th average image. ) And the pixel value p (i) of the pixel constituting the i-th original image and the pixel constituting the (i−1) -th reference image. And a second determination process for determining whether or not the pixel value u (i−1) is similar to the determination result obtained by the first determination process for the pixel at a predetermined position of the i-th original image. 2 If at least one of the determination results by the determination process is similar, the background pixels are both dissimilar The foreground determination step for determining the foreground pixel, and the pixel value of the pixel at the predetermined position constituting the i-th mask image as the background pixel when the background pixel is determined by the foreground determination step. And a mask image creation step for creating an i-th mask image by giving a pixel value indicating a foreground area when the pixel value indicating Is done.

また、平均画像作成段階では、第1番目の原画像をそのまま第1番目の平均画像とし、第i番目(i≧2)の平均画像を作成する際には、第i番目の原画像と第(i−1)番目の平均画像とについて、互いに対応する位置にある画素の三原色の各画素値の重みつき平均値をそれぞれ求め、得られた各平均値を各画素値とする画素の集合からなる画像を第i番目の平均画像とする処理が行われる。   Further, in the average image creation stage, the first original image is used as it is as the first average image, and when creating the i-th (i ≧ 2) average image, the i-th original image and the For the (i-1) -th average image, a weighted average value of each pixel value of the three primary colors of the pixels at the corresponding positions is obtained, and from the set of pixels having each obtained average value as each pixel value. Then, the process of setting the image to be the i-th average image is performed.

より具体的には、平均画像作成段階では、最初の原画像P(1)が入力されたときに、当該原画像P(1)をそのまま最初の平均画像A(1)とする処理を行い、以後、第i番目の原画像P(i)が入力されるたびに(i=2,3,...)、第i番目の平均画像A(i)を、
a(i)=(1−w)・a(i−1)+w・p(i)
(但し、a(i)は、平均画像A(i)の
所定位置の画素の所定色の画素値、
a(i−1)は、平均画像A(i−1)の
所定位置の画素の所定色の画素値、
p(i)は、原画像P(i)の
所定位置の画素の所定色の画素値、
wは、所定の重みを示すパラメータ(w<1))
なる演算式を用いて作成する処理が行われる。
More specifically, in the average image creation stage, when the first original image P (1) is input, the original image P (1) is processed as it is as the first average image A (1). Thereafter, every time the i-th original image P (i) is input (i = 2, 3,...), The i-th average image A (i) is
a (i) = (1-w) .a (i-1) + w.p (i)
(However, a (i) is the average image A (i)
A pixel value of a predetermined color of a pixel at a predetermined position,
a (i-1) is the average image A (i-1)
A pixel value of a predetermined color of a pixel at a predetermined position,
p (i) is the original image P (i)
A pixel value of a predetermined color of a pixel at a predetermined position,
w is a parameter indicating a predetermined weight (w <1))
A process of creating using the following arithmetic expression is performed.

一方、参照画像作成段階では、第1番目の原画像をそのまま第1番目の参照画像とし、第i番目(i≧2)の参照画像を作成する際には、第(i−1)番目の参照画像を構成する個々の画素のうち、前背判定ステップにおいて第i番目の原画像の対応画素が前景画素と判定された画素については、更新せずに、もとの画素値をそのまま維持し、前背判定ステップにおいて第i番目の原画像の対応画素が背景画素と判定された画素については、第(i−1)番目の平均画像の対応する位置にある画素との間で、三原色の各画素値の重みつき平均値をそれぞれ求め、得られた各平均値を新画素値として更新することにより、第i番目の参照画像を作成する処理が行われる。   On the other hand, in the reference image creation stage, the first original image is used as the first reference image as it is, and when the i-th (i ≧ 2) reference image is created, the (i−1) -th reference image is created. Of the individual pixels constituting the reference image, the pixel for which the corresponding pixel of the i-th original image is determined to be the foreground pixel in the foreground determination step is not updated and the original pixel value is maintained as it is. The pixels for which the corresponding pixel of the i-th original image is determined to be the background pixel in the foreground determination step are compared with the pixels at the corresponding position of the (i-1) -th average image. A process of creating the i-th reference image is performed by obtaining a weighted average value of each pixel value and updating each obtained average value as a new pixel value.

より具体的には、参照画像作成段階では、最初の原画像P(1)が入力されたときに、当該原画像P(1)をそのまま最初の参照画像U(1)とする処理を行い、以後、第i番目の原画像P(i)が入力されるたびに(i=2,3,...)、第i番目の参照画像U(i)の各画素値を、
背景画素と判定された画素については、
u(i)=(1−v)・u(i−1)+v・a(i−1)
(但し、u(i)は、平均画像U(i)の
所定位置の画素の所定色の画素値、
u(i−1)は、平均画像U(i−1)の
所定位置の画素の所定色の画素値、
a(i−1)は、平均画像A(i−1)の
所定位置の画素の所定色の画素値、
vは、所定の重みを示すパラメータ(v<1、かつw>v))
なる演算式を用いて求められた画素値u(i)に更新し、
前景画素と判定された画素については、
u(i)=u(i−1)
として、更新せずに、もとの画素値をそのまま維持することにより、参照画像U(i)を作成する処理が行われる。
More specifically, in the reference image creation stage, when the first original image P (1) is input, the original image P (1) is used as it is as the first reference image U (1). Thereafter, each time the i-th original image P (i) is input (i = 2, 3,...), The pixel values of the i-th reference image U (i) are
For pixels determined to be background pixels,
u (i) = (1-v) .u (i-1) + v.a (i-1)
(However, u (i) is the average image U (i)
A pixel value of a predetermined color of a pixel at a predetermined position,
u (i-1) is the average image U (i-1)
A pixel value of a predetermined color of a pixel at a predetermined position,
a (i-1) is the average image A (i-1)
A pixel value of a predetermined color of a pixel at a predetermined position,
v is a parameter indicating a predetermined weight (v <1, and w> v))
Updated to the pixel value u (i) obtained using the following equation:
For pixels determined to be foreground pixels,
u (i) = u (i-1)
As described above, the process of creating the reference image U (i) is performed by maintaining the original pixel value as it is without updating.

110:画像入力部
120:原画像格納部
130:平均画像作成部
135:参照画像作成部
140:平均画像格納部
145:参照画像格納部
200:画像比較部
210:画素値読出部
220:類否判定部
230:画素値書込部
310:マスク画像格納部
320:画像出力部
330:パラメータ設定部
340:パラメータ設定部
400:画像比較部
410:画素値読出部
420:第1判定部
421:基本演算部
422:第1の条件判定部
423:第2の条件判定部
424:第3の条件判定部
425:判定値出力部
426:パラメータ保持部
430:第2判定部
440:総合判定部
450:前背判定部
460:画素値書込部
A(1)〜A(i):平均画像
A,A(Ra,Ga,Ba):平均画像の画素値を示す座標点
a:三角形の一辺
a(i−1),a(i):平均画像を構成する1つの画素もしくはその画素値
B:背景領域/三原色の画素値(基準画素値)
b:三原色の画素値(比較画素値)/三角形の一辺
C:円柱モデルの円柱
C1,C2:球
C3:球面
c:三角形の一辺
D:原点Oと基準点Qとの距離
d:原点Oと比較点qとの距離
E,Ea,Ep:回転楕円体
E1:回転楕円体Eの最近接点
E2:回転楕円体Eの最遠隔点
F:前景領域
f:交線円S上の任意の点と基準点Qとの距離
G:三原色の画素値(基準画素値)
g:三原色の画素値(比較画素値)
h:回転楕円体Eの長軸半径αを定めるパラメータ
i:時系列の番号
J:判定結果を示す論理値(0:前景/1:背景)
k:回転楕円体Eの短軸半径βを定めるパラメータ
L:円柱Cの長さ
La1:回転楕円体Eaの長軸方向の長さ
La2:回転楕円体Eaの短軸方向の長さ
Lp1:回転楕円体Epの長軸方向の長さ
Lp2:回転楕円体Epの短軸方向の長さ
M:マスク画像
M(1)〜M(i),M(i+1),M10〜M40:マスク画像
m(i):マスク画像を構成する1つの画素の画素値
O:三次元色空間を構成するRGB座標系の原点
P:原画像/原画像の画素値を示す座標点
P(1)〜P(i),P(i+1),P10〜P40:原画像(入力画像)
P(Rp,Gp,Bp):原画像の画素値を示す座標点
p(i):原画像を構成する1つの画素もしくはその画素値
Q:基準点(画素値(R,G,B)をもった座標点)
q:比較点(画素値(r,g,b)をもった座標点)
R:三原色の画素値(基準画素値)
r:三原色の画素値(比較画素値)
S:交線円(球面C3と回転楕円体Eとの交線)
S11〜S20:流れ図の各ステップ
T:接線円(円錐ξと回転楕円体Eとの接線)
t:基準点Qと比較点qとの距離
t1〜t15:時系列の各時点
U(1)〜U(i):参照画像
u(i−1),u(i):参照画像を構成する1つの画素もしくはその画素値
V:基準画素値を示すベクトル/車両
Va:平均画像の画素値を示すベクトル
Vp:原画像の画素値を示すベクトル
v:重みを示すパラメータ
w:重みを示すパラメータ
X:座標軸
x:楕円方程式の変数
Y:座標軸
y:楕円方程式の変数
Z,Za,Zp:基準軸
α:回転楕円体Eの長軸半径
β:回転楕円体Eの短軸半径
γ:演算値
δ:座標点間の距離
θ:角度
ξ,ξ′:円錐
φ,φ′:円錐の半頂角
110: Image input unit 120: Original image storage unit 130: Average image creation unit 135: Reference image creation unit 140: Average image storage unit 145: Reference image storage unit 200: Image comparison unit 210: Pixel value reading unit 220: Similarity Determination unit 230: Pixel value writing unit 310: Mask image storage unit 320: Image output unit 330: Parameter setting unit 340: Parameter setting unit 400: Image comparison unit 410: Pixel value reading unit 420: First determination unit 421: Basic Calculation unit 422: first condition determination unit 423: second condition determination unit 424: third condition determination unit 425: determination value output unit 426: parameter holding unit 430: second determination unit 440: comprehensive determination unit 450: Foreground determination unit 460: pixel value writing units A (1) to A (i): average image A, A (Ra, Ga, Ba): coordinate point a indicating the pixel value of the average image a: side a of the triangle a ( i-1 , A (i): 1 single pixel constituting the average image or a pixel value B: the background region / the three primary colors of the pixel value (the reference pixel value)
b: Pixel value of three primary colors (comparison pixel value) / one side of triangle C: cylinder C1, C2 of cylinder model: sphere C3: spherical surface c: one side of triangle D: distance between origin O and reference point Q d: origin O Distances E, Ea, Ep with comparison point q: spheroid E1: closest point of spheroid E2: farthest point of spheroid E: foreground area f: any point on intersection circle S Distance G with reference point Q: Pixel value of three primary colors (reference pixel value)
g: Three primary color pixel values (comparison pixel values)
h: Parameter for determining the major axis radius α of the spheroid E: i: time-series number J: logical value indicating determination result (0: foreground / 1: background)
k: parameter L that determines the minor axis radius β of the spheroid E: length La1 of the cylinder C1: length La2 of the spheroid Ea in the major axis direction L2: length Lp1 of the spheroid Ea in the minor axis direction Length Lp2 in the major axis direction of the ellipsoid Ep: Length in the minor axis direction of the spheroid Ep: Mask images M (1) to M (i), M (i + 1), M10 to M40: Mask image m ( i): Pixel value of one pixel constituting the mask image O: Origin point of RGB coordinate system constituting the three-dimensional color space P: Coordinate points P (1) to P (i) indicating pixel values of the original image / original image ), P (i + 1), P10 to P40: Original image (input image)
P (Rp, Gp, Bp): coordinate point p (i) indicating the pixel value of the original image: one pixel constituting the original image or its pixel value Q: reference point (pixel value (R, G, B) Coordinate point)
q: Comparison point (coordinate point with pixel values (r, g, b))
R: Pixel value of three primary colors (reference pixel value)
r: Pixel value of three primary colors (comparison pixel value)
S: Circle of intersection (intersection line of spherical surface C3 and spheroid E)
S11 to S20: Steps T in the flowchart: Tangent circle (tangent between cone ξ and spheroid E)
t: distances between the reference point Q and the comparison point q t1 to t15: time points U (1) to U (i): reference image u (i-1), u (i): a reference image is formed. One pixel or its pixel value V: vector indicating the reference pixel value / vehicle Va: vector indicating the pixel value of the average image Vp: vector indicating the pixel value of the original image v: parameter indicating the weight w: parameter X indicating the weight : Coordinate axis x: variable of elliptic equation Y: coordinate axis y: variables of elliptic equation Z, Za, Zp: reference axis α: major axis radius of spheroid E β: minor axis radius γ of spheroid E: calculated value δ : Distance between coordinate points θ: angle ξ, ξ ': cone φ, φ': half apex angle of cone

Claims (15)

動画画像について移動物体を検出する移動物体検出装置であって、
時系列で連続的に与えられるフレーム単位のカラー原画像を、三原色の各画素値を有する画素の集合体データとして入力する画像入力部と、
入力された原画像を逐次格納する原画像格納部と、
新たな原画像が入力されるたびに、当該新たな原画像と直前に作成した平均画像とに基づいて、新たな平均画像を作成する平均画像作成部と、
作成された平均画像を逐次格納する平均画像格納部と、
新たな原画像が入力されるたびに、直前に作成した参照画像に基づいて新たな参照画像を作成する参照画像作成部と、
作成された参照画像を逐次格納する参照画像格納部と、
前記原画像格納部に格納された原画像と、前記平均画像格納部に格納された平均画像と、前記参照画像格納部に格納された参照画像と、を用いた比較処理により、前景領域と背景領域とを区別するマスク画像を作成する画像比較部と、
前記マスク画像を格納するマスク画像格納部と、
前記マスク画像を出力する画像出力部と、
を備え、
前記画像比較部は、
前記原画像格納部に格納された第i番目の原画像、前記平均画像格納部に格納された第(i−1)番目の平均画像、前記参照画像格納部に格納された第(i−1)番目の参照画像から、それぞれ対応する所定位置にある画素の三原色の各画素値を読み出す画素値読出部と、
前記画素値読出部によって読み出された画素値に基づいて、前記第i番目の原画像の前記所定位置にある画素が前景画素か背景画素かを判定する前背判定部と、
第i番目のマスク画像を構成する前記所定位置の画素の画素値として、前記前背判定部が背景画素と判定した場合には背景領域を示す画素値を、前記前背判定部が前景画素と判定した場合には前景領域を示す画素値を、それぞれ前記マスク画像格納部に書き込む画素値書込部と、
を有し、
前記前背判定部は、第i番目の原画像を構成する画素の画素値p(i)と第(i−1)番目の平均画像を構成する画素の画素値a(i−1)とを比較して類似するか否かを判定する第1判定部と、第i番目の原画像を構成する画素の画素値p(i)と第(i−1)番目の参照画像を構成する画素の画素値u(i−1)とを比較して類似するか否かを判定する第2判定部と、前記第1判定部による判定結果および前記第2判定部による判定結果の少なくとも一方が類似を示す場合には背景画素、双方とも非類似を示す場合には前景画素との判定を行う総合判定部と、を有し、
前記平均画像作成部は、第1番目の原画像をそのまま第1番目の平均画像とし、第i番目の原画像と第(i−1)番目の平均画像とについて、互いに対応する位置にある画素の三原色の各画素値の重みつき平均値をそれぞれ求め、得られた各平均値を各画素値とする画素の集合からなる画像を第i番目(i≧2)の平均画像とし、
前記参照画像作成部は、第1番目の原画像をそのまま第1番目の参照画像とし、第(i−1)番目の参照画像を構成する個々の画素のうち、前記前背判定部によって第i番目の原画像の対応画素が前景画素と判定された画素については、更新せずに、もとの画素値をそのまま維持し、前記前背判定部によって第i番目の原画像の対応画素が背景画素と判定された画素については、当該画素と第(i−1)番目の平均画像の対応する位置にある画素とについて、三原色の各画素値の重みつき平均値をそれぞれ求め、得られた各平均値を新画素値として更新することにより、第i番目(i≧2)の参照画像を作成することを特徴とする移動物体検出装置。
A moving object detection device for detecting a moving object for a moving image,
An image input unit for inputting a color original image in units of frames continuously given in time series as aggregate data of pixels having pixel values of three primary colors;
An original image storage unit for sequentially storing the input original images;
Each time a new original image is input, an average image creation unit that creates a new average image based on the new original image and the average image created immediately before,
An average image storage unit for sequentially storing the created average images;
A reference image creation unit that creates a new reference image based on the reference image created immediately before a new original image is input;
A reference image storage unit that sequentially stores the created reference images;
A foreground region and a background are compared by a comparison process using the original image stored in the original image storage unit, the average image stored in the average image storage unit, and the reference image stored in the reference image storage unit. An image comparison unit that creates a mask image that distinguishes the region;
A mask image storage for storing the mask image;
An image output unit for outputting the mask image;
With
The image comparison unit
The i-th original image stored in the original image storage unit, the (i−1) -th average image stored in the average image storage unit, and the (i−1) -th image stored in the reference image storage unit. A pixel value reading unit that reads out the pixel values of the three primary colors of the pixels at the corresponding predetermined positions from the second reference image;
A foreground determination unit for determining whether a pixel at the predetermined position of the i-th original image is a foreground pixel or a background pixel based on the pixel value read by the pixel value reading unit;
As the pixel value of the pixel at the predetermined position constituting the i-th mask image, when the foreground determination unit determines that it is a background pixel, a pixel value indicating a background region is used. A pixel value writing unit that writes a pixel value indicating a foreground region to the mask image storage unit when it is determined;
Have
The foreground determination unit calculates a pixel value p (i) of a pixel constituting the i-th original image and a pixel value a (i-1) of a pixel constituting the (i-1) -th average image. A first determination unit that determines whether or not they are similar to each other; a pixel value p (i) of a pixel that forms the i-th original image; and a pixel that forms the (i−1) -th reference image. A second determination unit that determines whether or not the pixel value u (i-1) is similar to each other, and at least one of the determination result by the first determination unit and the determination result by the second determination unit is similar to each other. A general determination unit that determines a background pixel in the case of showing, and a foreground pixel in the case of both showing dissimilarity,
The average image creation unit uses the first original image as it is as the first average image, and the pixels at positions corresponding to each other with respect to the i-th original image and the (i−1) -th average image. The weighted average values of the pixel values of the three primary colors are respectively determined, and an image composed of a set of pixels having the obtained average values as the pixel values is defined as an i-th (i ≧ 2) average image,
The reference image creation unit uses the first original image as the first reference image as it is, and among the individual pixels constituting the (i-1) th reference image, the front-side determination unit performs the i th The pixels for which the corresponding pixel of the original image is determined to be the foreground pixel are not updated and the original pixel values are maintained as they are, and the corresponding pixel of the i-th original image is set to the background by the foreground determination unit. For the pixel determined to be a pixel, the weighted average value of each pixel value of the three primary colors is obtained for the pixel and the pixel at the corresponding position of the (i−1) -th average image, and each obtained A moving object detection device that creates an i-th (i ≧ 2) reference image by updating an average value as a new pixel value.
請求項1に記載の移動物体検出装置において、
平均画像作成部が、
最初の原画像P(1)が入力されたときに、当該原画像P(1)をそのまま最初の平均画像A(1)として平均画像格納部へ格納する処理を行い、
以後、第i番目の原画像P(i)が入力されるたびに(i=2,3,...)、第i番目の平均画像A(i)を、
a(i)=(1−w)・a(i−1)+w・p(i)
(但し、a(i)は、平均画像A(i)の
所定位置の画素の所定色の画素値、
a(i−1)は、平均画像A(i−1)の
前記所定位置の画素の前記所定色の画素値、
p(i)は、原画像P(i)の
前記所定位置の画素の前記所定色の画素値、
wは、所定の重みを示すパラメータ(w<1))
なる演算式を用いて作成することを特徴とする移動物体検出装置。
The moving object detection device according to claim 1,
The average image creation unit
When the first original image P (1) is input, the original image P (1) is stored in the average image storage unit as the first average image A (1) as it is,
Thereafter, every time the i-th original image P (i) is input (i = 2, 3,...), The i-th average image A (i) is
a (i) = (1-w) .a (i-1) + w.p (i)
(However, a (i) is the average image A (i)
A pixel value of a predetermined color of a pixel at a predetermined position,
a (i-1) is the average image A (i-1)
A pixel value of the predetermined color of the pixel at the predetermined position;
p (i) is the original image P (i)
A pixel value of the predetermined color of the pixel at the predetermined position;
w is a parameter indicating a predetermined weight (w <1))
A moving object detection device, which is created using an arithmetic expression
請求項2に記載の移動物体検出装置において、
参照画像作成部が、
最初の原画像P(1)が入力されたときに、当該原画像P(1)をそのまま最初の参照画像U(1)として参照画像格納部へ格納する処理を行い、
以後、第i番目の原画像P(i)が入力されるたびに(i=2,3,...)、第i番目の参照画像U(i)の各画素値を、
背景画素と判定された画素については、
u(i)=(1−v)・u(i−1)+v・a(i−1)
(但し、u(i)は、平均画像U(i)の
所定位置の画素の所定色の画素値、
u(i−1)は、平均画像U(i−1)の
前記所定位置の画素の前記所定色の画素値、
a(i−1)は、平均画像A(i−1)の
前記所定位置の画素の前記所定色の画素値、
vは、所定の重みを示すパラメータ(v<1))
なる演算式を用いて求められた画素値u(i)に更新し、
前景画素と判定された画素については、
u(i)=u(i−1)
として、更新せずに、もとの画素値をそのまま維持することにより決定することを特徴とする移動物体検出装置。
The moving object detection device according to claim 2,
The reference image creation unit
When the first original image P (1) is input, the original image P (1) is directly stored in the reference image storage unit as the first reference image U (1).
Thereafter, each time the i-th original image P (i) is input (i = 2, 3,...), The pixel values of the i-th reference image U (i) are
For pixels determined to be background pixels,
u (i) = (1-v) .u (i-1) + v.a (i-1)
(However, u (i) is the average image U (i)
A pixel value of a predetermined color of a pixel at a predetermined position,
u (i-1) is the average image U (i-1)
A pixel value of the predetermined color of the pixel at the predetermined position;
a (i-1) is the average image A (i-1)
A pixel value of the predetermined color of the pixel at the predetermined position;
v is a parameter indicating a predetermined weight (v <1))
Updated to the pixel value u (i) obtained using the following equation:
For pixels determined to be foreground pixels,
u (i) = u (i-1)
As described above, the moving object detection apparatus is characterized in that the determination is made by maintaining the original pixel value as it is without updating.
請求項3に記載の移動物体検出装置において、
重みを示すパラメータw,vを、w>vとなるように設定することを特徴とする移動物体検出装置。
The moving object detection device according to claim 3,
A moving object detection apparatus characterized in that parameters w and v indicating weights are set so that w> v.
請求項2〜4のいずれかに記載の移動物体検出装置において、
パラメータ「w」もしくは「v」またはこれら双方を、ユーザの操作入力によって任意の値に設定するパラメータ設定部を更に備えることを特徴とする移動物体検出装置。
In the moving object detection apparatus in any one of Claims 2-4,
A moving object detection device further comprising a parameter setting unit that sets a parameter “w” or “v” or both to an arbitrary value by a user operation input.
請求項1〜5のいずれかに記載の移動物体検出装置において、
第1判定部および第2判定部が、比較対象となる一方の画素の画素値を基準画素値、他方の画素の画素値を比較画素値として、三原色の各画素値を各座標軸にとった三次元座標系において、前記基準画素値に対応する座標に位置する基準点Qと前記比較画素値に対応する座標に位置する比較点qをとり、前記基準点Qを中心とする所定サイズの基準立体と前記比較点qとの位置関係を調べ、前記比較点qが前記基準立体の外部に位置すると判定できる場合に非類似との判定を行い、内部に位置すると判定できる場合には類似との判定を行うことを特徴とする移動物体検出装置。
In the moving object detection apparatus in any one of Claims 1-5,
The first determination unit and the second determination unit use the pixel value of one pixel to be compared as a reference pixel value, the pixel value of the other pixel as a comparison pixel value, and a cubic that takes each pixel value of the three primary colors on each coordinate axis. In the original coordinate system, a reference point Q located at the coordinate corresponding to the reference pixel value and a comparison point q located at the coordinate corresponding to the comparison pixel value are taken, and a reference solid of a predetermined size centered on the reference point Q When the comparison point q can be determined to be located outside the reference solid, it is determined that the comparison point q is located outside the reference solid. A moving object detection device characterized by:
請求項6に記載の移動物体検出装置において、
第1判定部が、原画像の画素の画素値を基準画素値、平均画像の画素の画素値を比較画素値として判定を行い、
第2判定部が、原画像の画素の画素値を基準画素値、参照画像の画素の画素値を比較画素値として判定を行うことを特徴とする移動物体検出装置。
The moving object detection device according to claim 6,
The first determination unit determines the pixel value of the pixel of the original image as the reference pixel value, the pixel value of the pixel of the average image as the comparison pixel value,
The moving object detection apparatus, wherein the second determination unit performs determination using a pixel value of a pixel of an original image as a standard pixel value and a pixel value of a pixel of a reference image as a comparison pixel value.
請求項6または7に記載の移動物体検出装置において、
第1判定部および第2判定部が、三次元座標系の原点Oと基準点Qとの距離Dに、所定のパラメータh(但し、h<1)を乗じて求まる値α=h・Dを長軸半径とし、所定のパラメータk(但し、k<h)を乗じて求まる値β=k・Dを短軸半径とする楕円を、原点Oと基準点Qとを結ぶ基準軸Z上に長軸が重なるように、かつ、基準点Qが中心点となるように配置し、この楕円を前記基準軸Zを中心に回転させることにより得られる同一の回転楕円体Eもしくはその近似体を基準立体として用いることを特徴とする移動物体検出装置。
The moving object detection device according to claim 6 or 7,
The first determination unit and the second determination unit obtain a value α = h · D obtained by multiplying the distance D between the origin O of the three-dimensional coordinate system and the reference point Q by a predetermined parameter h (where h <1). An ellipse having a long axis radius and a value β = k · D obtained by multiplying a predetermined parameter k (where k <h) as a short axis radius is long on the reference axis Z connecting the origin O and the reference point Q. The same spheroid E or its approximation obtained by rotating the ellipse around the reference axis Z is arranged so that the axes are overlapped and the reference point Q is the center point. A moving object detection device characterized by being used as:
請求項8に記載の移動物体検出装置において、
第1判定部および第2判定部が、
「原点Oを中心とし半径(D−α)の球C1の内側に比較点qが位置する」もしくは「原点Oを中心とし半径(D+α)の球C2の外側に比較点qが位置する」という第1の条件を満足するか否かを判定する第1の条件判定部と、
前記第1の条件判定部が否定的判定を行った場合に「原点Oを頂点、基準軸Zを中心軸とし、回転楕円体Eと円で接する円錐ξもしくはその近似体の外側に比較点qが位置する」という第2の条件を満足するか否かを判定する第2の条件判定部と、
前記第2の条件判定部が否定的判定を行った場合に「回転楕円体Eの外側に比較点qが位置する」という第3の条件を満足するか否かを判定する第3の条件判定部と、
前記第1の条件判定部、前記第2の条件判定部、前記第3の条件判定部のいずれかが肯定的判定を行った場合に、非類似との判定結果を示す判定値を出力し、前記第1の条件判定部、前記第2の条件判定部、前記第3の条件判定部のすべてが否定的判定を行った場合に、類似との判定結果を示す判定値を出力する判定値出力部と、
を有することを特徴とする移動物体検出装置。
The moving object detection device according to claim 8,
The first determination unit and the second determination unit are
“The comparison point q is located inside the sphere C1 with the origin O as the center and the radius (D−α)” or “the comparison point q is located outside the sphere C2 with the origin O as the center and the radius (D + α)”. A first condition determining unit that determines whether or not the first condition is satisfied;
If the first condition determination unit makes a negative determination, “the comparison point q is located outside the cone ξ or its approximate body that is in contact with the spheroid E with a circle with the origin O as the vertex and the reference axis Z as the central axis. A second condition determining unit that determines whether or not the second condition that “is located” is satisfied;
Third condition determination for determining whether or not the third condition “the comparison point q is located outside the spheroid E” is satisfied when the second condition determination unit makes a negative determination. And
When any one of the first condition determination unit, the second condition determination unit, and the third condition determination unit makes a positive determination, a determination value indicating a determination result of dissimilarity is output, Determination value output that outputs a determination value indicating a determination result of similarity when all of the first condition determination unit, the second condition determination unit, and the third condition determination unit make a negative determination And
A moving object detection apparatus comprising:
請求項8に記載の移動物体検出装置において、
第1判定部および第2判定部が、
パラメータhおよびkの値を保持するパラメータ保持部と、
画素値読出部が読み出した基準画素値(R,G,B)および比較画素値(r,g,b)に基づいて、
=R+G+B および
=r+g+b
なる演算を行い、値Dおよび値dを算出する基本演算部と、
前記基本演算部が算出した値Dおよび値dと前記パラメータ保持部に保持されているパラメータhの値とを用いて、
(1−h)・D>d もしくは
(1+h)・D<d
という条件を満足するか否かを判定するための演算を行う第1の条件判定部と、
前記第1の条件判定部が否定的判定を行った場合に、画素値読出部が読み出した基準画素値(R,G,B)および比較画素値(r,g,b)に基づいて、
γ=R・r+G・g+B・b
なる演算を行い、値γを算出し、前記基本演算部が算出した値Dおよび値dと前記パラメータ保持部に保持されているパラメータkの値と前記値γとを用いて、
γ/(D・d)<(1−k/2)
という条件を満足するか否かを判定するための演算を行う第2の条件判定部と、
前記第2の条件判定部が否定的判定を行った場合に、前記基本演算部が算出した値Dおよび値dと前記パラメータ保持部に保持されているパラメータhおよびkの値と前記第2の条件判定部が算出した前記値γとを用いて、
α=h・D
β=k・D
=D+γ/D−2γ
=d−γ/D
なる演算を行い、当該演算結果を用いて、
β・x+α・y−α・β>0
という条件を満足するか否かを判定するための演算を行う第3の条件判定部と、
前記第1の条件判定部、前記第2の条件判定部、前記第3の条件判定部のいずれかが肯定的判定を行った場合に、非類似との判定結果を示す判定値を出力し、前記第1の条件判定部、前記第2の条件判定部、前記第3の条件判定部のすべてが否定的判定を行った場合に、類似との判定結果を示す判定値を出力する判定値出力部と、
を有することを特徴とする移動物体検出装置。
The moving object detection device according to claim 8,
The first determination unit and the second determination unit are
A parameter holding unit for holding values of parameters h and k;
Based on the reference pixel value (R, G, B) and the comparison pixel value (r, g, b) read by the pixel value reading unit,
D 2 = R 2 + G 2 + B 2 and
d 2 = r 2 + g 2 + b 2
A basic calculation unit for calculating the value D 2 and the value d 2 ,
By using the value of the parameter h to the basic computation unit is held to the value D 2 and the value d 2 calculated in the parameter holding unit,
(1-h) 2 · D 2 > d 2 or
(1 + h) 2 · D 2 <d 2
A first condition determination unit that performs an operation for determining whether or not the condition is satisfied;
Based on the reference pixel value (R, G, B) and the comparison pixel value (r, g, b) read by the pixel value reading unit when the first condition determining unit makes a negative determination,
γ = R · r + G · g + B · b
To calculate the value γ, using the value D 2 and the value d 2 calculated by the basic calculation unit, the value of the parameter k held in the parameter holding unit, and the value γ,
γ 2 / (D 2 · d 2) <(1-k 2/2) 2
A second condition determination unit that performs an operation for determining whether or not the condition is satisfied,
When the second condition determination unit makes a negative determination, the value D 2 and the value d 2 calculated by the basic calculation unit, the values of the parameters h and k held in the parameter holding unit, and the first Using the value γ calculated by the condition determining unit 2,
α 2 = h 2 · D 2
β 2 = k 2 · D 2
x 2 = D 2 + γ 2 / D 2 -2γ
y 2 = d 2 −γ 2 / D 2
And using the calculation result,
β 2 · x 2 + α 2 · y 22 · β 2 > 0
A third condition determination unit that performs an operation for determining whether or not the condition is satisfied,
When any one of the first condition determination unit, the second condition determination unit, and the third condition determination unit makes a positive determination, a determination value indicating a determination result of dissimilarity is output, Determination value output that outputs a determination value indicating a determination result of similarity when all of the first condition determination unit, the second condition determination unit, and the third condition determination unit make a negative determination And
A moving object detection apparatus comprising:
請求項8〜10のいずれかに記載の移動物体検出装置において、
パラメータ「h」および「k」を、ユーザの操作入力によって任意の値に設定するパラメータ設定部を更に備えることを特徴とする移動物体検出装置。
In the moving object detection apparatus in any one of Claims 8-10,
A moving object detection apparatus, further comprising a parameter setting unit that sets parameters “h” and “k” to arbitrary values by a user operation input.
請求項1〜11のいずれかに記載の移動物体検出装置としてコンピュータを動作させるプログラム。   The program which operates a computer as a moving object detection apparatus in any one of Claims 1-11. 請求項1〜11のいずれかに記載の移動物体検出装置として機能する半導体集積回路。   A semiconductor integrated circuit that functions as the moving object detection device according to claim 1. 動画画像について移動物体を検出する移動物体検出方法であって、
コンピュータが、時系列で連続的に与えられるフレーム単位のカラー原画像を、三原色の各画素値を有する画素の集合体データとして入力する画像入力段階と、
コンピュータが、新たな原画像が入力されるたびに、当該新たな原画像と直前に作成した平均画像とに基づいて、新たな平均画像を作成する平均画像作成段階と、
コンピュータが、新たな原画像が入力されるたびに、当該新たな原画像と直前に作成した参照画像とに基づいて、新たな参照画像を作成する参照画像作成段階と、
コンピュータが、原画像と平均画像と参照画像とを用いた比較処理により、前景領域と背景領域とを区別するマスク画像を作成する画像比較段階と、
コンピュータが、前記マスク画像を出力する画像出力段階と、
を有し、
前記画像比較段階は、
第i番目の原画像、第(i−1)番目の平均画像、第(i−1)番目の参照画像から、それぞれ対応する所定位置にある画素の三原色の各画素値を読み出す画素値読出ステップと、
第i番目の原画像を構成する画素の画素値p(i)と第(i−1)番目の平均画像を構成する画素の画素値a(i−1)とが類似するか否かを判定する第1判定処理と、第i番目の原画像を構成する画素の画素値p(i)と第(i−1)番目の参照画像を構成する画素の画素値u(i−1)とが類似するか否かを判定する第2判定処理と、を行い、第i番目の原画像の前記所定位置にある画素について、前記第1判定処理による判定結果と前記第2判定処理による判定結果との少なくとも一方が類似を示す場合には背景画素、双方とも非類似を示す場合には前景画素との判定を行う前背判定ステップと、
第i番目のマスク画像を構成する前記所定位置の画素の画素値として、前記前背判定ステップにより背景画素と判定された場合には背景領域を示す画素値を、前記前背判定ステップにより前景画素と判定された場合には前景領域を示す画素値を、それぞれ与えることにより、第i番目のマスク画像を作成するマスク画像作成ステップと、
を有し、
前記平均画像作成段階では、第1番目の原画像をそのまま第1番目の平均画像とし、第i番目(i≧2)の平均画像を作成する際には、第i番目の原画像と第(i−1)番目の平均画像とについて、互いに対応する位置にある画素の三原色の各画素値の重みつき平均値をそれぞれ求め、得られた各平均値を各画素値とする画素の集合からなる画像を第i番目の平均画像とし、
前記参照画像作成段階では、第1番目の原画像をそのまま第1番目の参照画像とし、第i番目(i≧2)の参照画像を作成する際には、第(i−1)番目の参照画像を構成する個々の画素のうち、前記前背判定ステップにおいて第i番目の原画像の対応画素が前景画素と判定された画素については、更新せずに、もとの画素値をそのまま維持し、前記前背判定ステップにおいて第i番目の原画像の対応画素が背景画素と判定された画素については、第(i−1)番目の平均画像の対応する位置にある画素との間で、三原色の各画素値の重みつき平均値をそれぞれ求め、得られた各平均値を新画素値として更新することにより、第i番目の参照画像を作成することを特徴とする移動物体検出方法。
A moving object detection method for detecting a moving object for a moving image,
An image input stage in which a computer inputs a color original image in units of frames continuously given in time series as aggregate data of pixels having pixel values of three primary colors;
An average image creation stage for creating a new average image based on the new original image and the average image just created each time a new original image is input;
A reference image creation stage in which a computer creates a new reference image based on the new original image and the reference image created immediately before each new original image is input;
An image comparison stage in which a computer creates a mask image that distinguishes a foreground area and a background area by a comparison process using an original image, an average image, and a reference image;
An image output step of outputting the mask image by a computer;
Have
The image comparison step includes
A pixel value reading step of reading out pixel values of the three primary colors of the pixels at the corresponding predetermined positions from the i-th original image, the (i-1) -th average image, and the (i-1) -th reference image, respectively. When,
It is determined whether the pixel value p (i) of the pixels constituting the i-th original image is similar to the pixel value a (i-1) of the pixels constituting the (i-1) -th average image. And the pixel value p (i) of the pixel constituting the i-th original image and the pixel value u (i-1) of the pixel constituting the (i-1) -th reference image. A second determination process for determining whether or not they are similar to each other, and for a pixel at the predetermined position of the i-th original image, a determination result by the first determination process and a determination result by the second determination process A foreground determination step for determining a background pixel when at least one of the two is similar, and a foreground pixel when both are dissimilar,
As a pixel value of the pixel at the predetermined position constituting the i-th mask image, a pixel value indicating a background area is determined by the foreground determination step when it is determined to be a background pixel by the foreground determination step. A mask image creating step for creating an i-th mask image by giving a pixel value indicating a foreground region, respectively,
Have
In the average image creation stage, the first original image is used as the first average image as it is, and when the i-th (i ≧ 2) average image is created, the i-th original image and the ( For the i-1) th average image, a weighted average value is obtained for each pixel value of the three primary colors of the pixels at positions corresponding to each other, and a set of pixels each having the obtained average value as each pixel value. Let the image be the i-th average image,
In the reference image creation stage, the first original image is used as the first reference image as it is, and when the i-th (i ≧ 2) reference image is created, the (i−1) -th reference image is created. Among the individual pixels constituting the image, the original pixel value is maintained as it is without updating the pixel in which the corresponding pixel of the i-th original image is determined to be the foreground pixel in the foreground determination step. For the pixels for which the corresponding pixel of the i-th original image is determined to be the background pixel in the foreground determination step, the three primary colors between the pixels at the corresponding position of the (i-1) -th average image A moving object detection method comprising: obtaining an i-th reference image by obtaining a weighted average value of each pixel value and updating each obtained average value as a new pixel value.
請求項14に記載の移動物体検出方法において、
平均画像作成段階では、
最初の原画像P(1)が入力されたときに、当該原画像P(1)をそのまま最初の平均画像A(1)とする処理を行い、
以後、第i番目の原画像P(i)が入力されるたびに(i=2,3,...)、第i番目の平均画像A(i)を、
a(i)=(1−w)・a(i−1)+w・p(i)
(但し、a(i)は、平均画像A(i)の
所定位置の画素の所定色の画素値、
a(i−1)は、平均画像A(i−1)の
前記所定位置の画素の前記所定色の画素値、
p(i)は、原画像P(i)の
前記所定位置の画素の前記所定色の画素値、
wは、所定の重みを示すパラメータ(w<1))
なる演算式を用いて作成し、
参照画像作成段階では、
最初の原画像P(1)が入力されたときに、当該原画像P(1)をそのまま最初の参照画像U(1)とする処理を行い、
以後、第i番目の原画像P(i)が入力されるたびに(i=2,3,...)、第i番目の参照画像U(i)の各画素値を、
背景画素と判定された画素については、
u(i)=(1−v)・u(i−1)+v・a(i−1)
(但し、u(i)は、平均画像U(i)の
所定位置の画素の所定色の画素値、
u(i−1)は、平均画像U(i−1)の
前記所定位置の画素の前記所定色の画素値、
a(i−1)は、平均画像A(i−1)の
前記所定位置の画素の前記所定色の画素値、
vは、所定の重みを示すパラメータ(v<1、かつw>v))
なる演算式を用いて求められた画素値u(i)に更新し、
前景画素と判定された画素については、
u(i)=u(i−1)
として、更新せずに、もとの画素値をそのまま維持することにより、参照画像U(i)を作成することを特徴とする移動物体検出方法。
The moving object detection method according to claim 14,
In the average image creation stage,
When the first original image P (1) is input, the original image P (1) is processed as it is as the first average image A (1).
Thereafter, every time the i-th original image P (i) is input (i = 2, 3,...), The i-th average image A (i) is
a (i) = (1-w) .a (i-1) + w.p (i)
(However, a (i) is the average image A (i)
A pixel value of a predetermined color of a pixel at a predetermined position,
a (i-1) is the average image A (i-1)
A pixel value of the predetermined color of the pixel at the predetermined position;
p (i) is the original image P (i)
A pixel value of the predetermined color of the pixel at the predetermined position;
w is a parameter indicating a predetermined weight (w <1))
Created using the following formula:
In the reference image creation stage,
When the first original image P (1) is input, the original image P (1) is processed as the first reference image U (1) as it is,
Thereafter, each time the i-th original image P (i) is input (i = 2, 3,...), The pixel values of the i-th reference image U (i) are
For pixels determined to be background pixels,
u (i) = (1-v) .u (i-1) + v.a (i-1)
(However, u (i) is the average image U (i)
A pixel value of a predetermined color of a pixel at a predetermined position,
u (i-1) is the average image U (i-1)
A pixel value of the predetermined color of the pixel at the predetermined position;
a (i-1) is the average image A (i-1)
A pixel value of the predetermined color of the pixel at the predetermined position;
v is a parameter indicating a predetermined weight (v <1, and w> v))
Updated to the pixel value u (i) obtained using the following equation:
For pixels determined to be foreground pixels,
u (i) = u (i-1)
As a moving object detection method, the reference image U (i) is generated by maintaining the original pixel value as it is without updating.
JP2011020228A 2011-02-01 2011-02-01 Moving object detection device Active JP5630298B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011020228A JP5630298B2 (en) 2011-02-01 2011-02-01 Moving object detection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011020228A JP5630298B2 (en) 2011-02-01 2011-02-01 Moving object detection device

Publications (2)

Publication Number Publication Date
JP2012160977A JP2012160977A (en) 2012-08-23
JP5630298B2 true JP5630298B2 (en) 2014-11-26

Family

ID=46841135

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011020228A Active JP5630298B2 (en) 2011-02-01 2011-02-01 Moving object detection device

Country Status (1)

Country Link
JP (1) JP5630298B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7606894B2 (en) * 2021-03-12 2024-12-26 本田技研工業株式会社 Image processing device, image processing method, and program

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3423886B2 (en) * 1998-06-30 2003-07-07 株式会社日立製作所 Moving object monitoring device
JP4117073B2 (en) * 1998-11-18 2008-07-09 株式会社日立製作所 Monitoring device
JP3848918B2 (en) * 2002-12-26 2006-11-22 三菱電機株式会社 MOBILE BODY MONITORING DEVICE AND MOBILE BODY MONITORING METHOD

Also Published As

Publication number Publication date
JP2012160977A (en) 2012-08-23

Similar Documents

Publication Publication Date Title
CN114782412B (en) Image detection method, training method and device of target detection model
Prasad et al. Challenges in video based object detection in maritime scenario using computer vision
CN113286194A (en) Video processing method and device, electronic equipment and readable storage medium
CN112348815A (en) Image processing method, image processing apparatus, and non-transitory storage medium
CN103578083B (en) Single image defogging method based on associating average drifting
CN112364865A (en) Method for detecting small moving target in complex scene
CN110688925A (en) Cascade target recognition method and system based on deep learning
CN104063885A (en) Improved movement target detecting and tracking method
US12374045B2 (en) Efficient texture mapping of a 3-D mesh
CN110647836B (en) Robust single-target tracking method based on deep learning
CN110516514A (en) A kind of modeling method and device of target detection model
CN109658453B (en) Circle center determining method, device, equipment and storage medium
Spampinato et al. Covariance based Fish Tracking in Real-life Underwater Environment.
CN111242026A (en) Remote sensing image target detection method based on spatial hierarchy perception module and metric learning
CN108491857B (en) Multi-camera target matching method with overlapped vision fields
CN107025672A (en) A kind of conspicuousness detection method based on improvement convex closure
JP5391970B2 (en) Moving object detection device and pixel similarity determination method
JP5736831B2 (en) Sunlight change region detection device and moving object detection device
CN118379696A (en) Ship target detection method, device and readable storage medium
CN104539942B (en) Video shot switching detection method and device based on frame difference clustering
CN112419231B (en) Visibility determination method, apparatus, computer device, and storage medium
CN110517291A (en) A road vehicle tracking method based on multi-feature space fusion
CN104700384B (en) Display systems and methods of exhibiting based on augmented reality
CN107452019B (en) Target detection method, device and system based on model switching and storage medium
JP5630298B2 (en) Moving object detection device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20131216

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140904

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20140909

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140922

R150 Certificate of patent or registration of utility model

Ref document number: 5630298

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150