JP5391970B2 - Moving object detection device and pixel similarity determination method - Google Patents
Moving object detection device and pixel similarity determination method Download PDFInfo
- Publication number
- JP5391970B2 JP5391970B2 JP2009226146A JP2009226146A JP5391970B2 JP 5391970 B2 JP5391970 B2 JP 5391970B2 JP 2009226146 A JP2009226146 A JP 2009226146A JP 2009226146 A JP2009226146 A JP 2009226146A JP 5391970 B2 JP5391970 B2 JP 5391970B2
- Authority
- JP
- Japan
- Prior art keywords
- pixel
- condition
- determination
- unit
- image
- 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
Links
Images
Landscapes
- Closed-Circuit Television Systems (AREA)
- Image Analysis (AREA)
Description
本発明は、カラーの動画画像に基づいて、画像内の移動物体を検出する移動物体検出装置およびこれに利用する画素の類否判定方法に関する。 The present invention relates to a moving object detection apparatus that detects a moving object in an image based on a color moving image, and a method for determining the similarity of pixels used in the moving object detection apparatus.
ビデオカメラを用いた監視システムなどでは、監視領域内に存在する移動物体を自動的に検出する技術が重要になってきている。移動物体の自動検出が可能になれば、当該物体が車両であるのか、人間であるのか、といった識別を行う処理に利用することができる。更に、車両の場合であれば、ナンバーを読み取って車両を特定することができ、人間の場合であれば、個人を特定する処理にも応用することができる。また、検出した不審者を自動的にズームアップして追尾することも可能になる。 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,
一方、下記の非特許文献1には、入力画像と背景画像とを画素単位で比較して、当該画素が移動物体を構成する画素であるか否かを判定する手法が開示されている。具体的には、比較対象となる両画素の画素値が類似している場合、当該画素は背景を構成する画素であるとし、類似していない場合、当該画素は移動物体を構成する画素であるとする判定が行われる。このとき、画素の類否判定は、三次元の色空間上で、双方の画素値に対応する座標点をプロットし、一方の座標点が他方の座標点の近傍領域に入っているか否かを調べることにより行われる。
On the other hand, Non-Patent
上述した特許文献1,2に開示されている手法では、入力画像に対して、小領域もしくはブロック単位で画素値のヒストグラムをとるなどの統計処理を施し、当該統計処理によって得られた特徴量を複雑なモデルに当てはめて移動物体の領域を推定する必要があるため、演算処理が極めて複雑になるという問題がある。このため、一般的なプロセッサでは処理時間が長くかかり、リアルタイムでの処理を行うことが困難である。また、より正確な検出を行うためには、多数のフレームにわたって入力画像を格納しておく必要があり、大容量の画像バッファメモリが必要になる。このため、リアルタイムでの監視を目的とした安価な監視システムに利用するには不適当である。
In the methods disclosed in
一方、上述した非特許文献1に開示されている手法では、画素単位での比較を行えばよいので、複雑な統計処理を行ったり、複雑なモデルを構築したりする必要はない。しかしながら、画素の類否判定を行うためには、三次元の色空間上での幾何学演算が必要になり、安価なプロセッサを用いてリアルタイムの処理を行うには、依然として演算処理の負担が重い。特に、三角関数を含む演算は、安価な汎用プロセッサにとって極めて負担の重い処理になる。また、領域単位での統計処理を省き、画素単位での比較結果のみによって検出を行うため、時刻や天候などによる照明変動の影響を受けやすく、誤検出が生じやすいという問題もある。
On the other hand, in the method disclosed in
そこで本発明は、演算処理の負担を軽減しつつ、より正確な検出を行うことが可能な移動物体検出装置を提供することを目的とする。また、そのような移動物体検出装置に利用可能な画素の類否判定方法を提供することを目的とする。 Therefore, an object of the present invention is to provide a moving object detection device that can perform more accurate detection while reducing the burden of calculation processing. It is another object of the present invention to provide a pixel similarity determination method that can be used in such a moving object detection device.
(1) 本発明の第1の態様は、動画画像について移動物体を検出する移動物体検出装置において、
時系列で連続的に与えられるフレーム単位のカラー原画像を、三原色の各画素値を有する画素の集合体データとして入力する画像入力部と、
入力された原画像を逐次格納する原画像格納部と、
過去に入力された複数の原画像に基づいて、これら原画像の平均的な特徴を有する平均画像を逐次作成する平均画像作成部と、
作成された平均画像を逐次格納する平均画像格納部と、
原画像格納部に格納された原画像と、平均画像格納部に格納された平均画像とを比較し、前景領域と背景領域とを区別するマスク画像を作成する画像比較部と、
マスク画像を格納するマスク画像格納部と、
マスク画像を出力する画像出力部と、
を設け、
画像比較部を、
比較対象となる一方の画像の所定位置の画素の画素値を基準画素値として読み出し、比較対象となる他方の画像の所定位置の画素の画素値を比較画素値として読み出す画素値読出部と、
比較画素値が、基準画素値について設定された所定の類似範囲に入っているか否かを判定する類否判定部と、
マスク画像を構成する所定位置の画素の画素値として、類否判定部が類似範囲内と判定した場合には背景領域を示す画素値を、類否判定部が類似範囲外と判定した場合には前景領域を示す画素値を、それぞれマスク画像格納部に書き込む画素値書込部と、
によって構成し、
類否判定部が、三原色の各画素値を各座標軸にとった三次元座標系において、基準画素値に対応する座標に位置する基準点Qと比較画素値に対応する座標に位置する比較点qをとり、基準点Qを中心とする所定サイズの回転楕円体Eと比較点qとの位置関係を調べ、比較点qが回転楕円体Eもしくはその近似体の外部に位置すると判定できる場合には類似範囲外との判定を行い、内部に位置すると判定できる場合には類似範囲内との判定を行うようにし、
かつ、類否判定部が、三次元座標系の原点Oと基準点Qとの距離Dに、所定のパラメータh(但し、h<1)を乗じて求まる値α=h・Dを長軸半径とし、所定のパラメータk(但し、k<h)を乗じて求まる値β=k・Dを短軸半径とする楕円を、原点Oと基準点Qとを結ぶ基準軸Z上に長軸が重なるように、かつ、基準点Qが中心点となるように配置し、基準軸Zを中心に回転させることにより回転楕円体Eを定義するようにしたものである。
(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;
Based on a plurality of original images input in the past, an average image creation unit that sequentially creates an average image having average characteristics of these original images;
An average image storage unit for sequentially storing the created average images;
An image comparison unit that compares the original image stored in the original image storage unit with the average image stored in the average image storage unit and creates a mask image that distinguishes the foreground region and the background region;
A mask image storage for storing the mask image;
An image output unit for outputting a mask image;
Provided,
The image comparison unit
A pixel value reading unit that reads a pixel value of a pixel at a predetermined position of one image to be compared as a reference pixel value, and reads a pixel value of a pixel at a predetermined position of the other image to be compared as a comparison pixel value;
A similarity determination unit that determines whether or not the comparison pixel value is within a predetermined similarity range set for the reference pixel value;
When the similarity determination unit determines that the pixel value of the pixel at the predetermined position constituting the mask image is within the similar range, the pixel value indicating the background area is determined. When the similarity determination unit determines that the pixel value is outside the similarity range, A pixel value writing unit for writing the pixel value indicating the foreground region into the mask image storage unit,
Composed by
In the three-dimensional coordinate system in which the similarity determination unit takes each pixel value of the three primary colors on each coordinate axis, the reference point Q located at the coordinate corresponding to the reference pixel value and the comparison point q located at the coordinate corresponding to the comparison pixel value When the positional relationship between the spheroid E having a predetermined size centered on the reference point Q and the comparison point q is examined, and it can be determined that the comparison point q is located outside the spheroid E or its approximate body, If it is determined that it is outside the similar range and it can be determined that it is located inside, it is determined that it is within the similar range ,
In addition, the similarity determination unit multiplies a 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) to obtain a value α = h · D as a major axis radius. And an ellipse having a minor axis radius of β = k · D obtained by multiplying a predetermined parameter k (where k <h), the major axis overlaps the reference axis Z connecting the origin O and the reference point Q. In this way, the spheroid E is defined by arranging the reference point Q to be the center point and rotating it around the reference axis Z.
(2) 本発明の第2の態様は、上述の第1の態様に係る移動物体検出装置において、
平均画像作成部が、
第i番目の原画像P(i)が入力されたときに(i=1,2,...)、当該原画像P(i)を含めた過去の原画像について、それぞれ対応する位置の画素の各色別の画素値の重みづけ平均値を算出し、当該平均値をもつ画素の集合体からなる第i番目の平均画像A(i)を作成し、
画像比較部が、第(i+1)番目の原画像P(i+1)が入力されたときに、当該原画像P(i+1)と、第i番目の平均画像A(i)とを比較し、第(i+1)番目のマスク画像M(i+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 i-th original image P (i) is input (i = 1, 2,...), Pixels at corresponding positions in the past original image including the original image P (i) To calculate a weighted average value of pixel values for each color, and create an i-th average image A (i) composed of a collection of pixels having the average value,
When the (i + 1) -th original image P (i + 1) is input, the image comparison unit compares the original image P (i + 1) with the i-th average image A (i), The (i + 1) th mask image M (i + 1) is created.
(3) 本発明の第3の態様は、上述の第2の態様に係る移動物体検出装置において、
平均画像作成部が、
最初の原画像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))
なる演算式を用いて作成するようにしたものである。
(3) According to a third aspect of the present invention, in the moving object detection device according to the second 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)
The pixel value of the predetermined color of the pixel at the predetermined position,
p (i) is the original image P (i)
The pixel value of the predetermined color of the pixel at the predetermined position,
w is a parameter indicating a predetermined weight (w <1))
It is made using the following arithmetic expression.
(4) 本発明の第4の態様は、上述の第1〜第3の態様に係る移動物体検出装置において、
類否判定部を、
「原点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の条件判定部のすべてが否定的判定を行った場合に、類似範囲内との判定結果を示す判定値を出力する判定値出力部と、
によって構成するようにしたものである。
(4) According to a fourth aspect of the present invention, in the moving object detection device according to the first to third aspects described above,
Similarity judgment part,
“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 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 that the similarity is out of the similar range is output. A determination value output unit that outputs a determination value indicating a determination result that is within the similar range when all of the condition determination unit, the second condition determination unit, and the third condition determination unit perform a negative determination;
It is made up by.
(5) 本発明の第5の態様は、上述の第4の態様に係る移動物体検出装置において、
原点Oと基準点Qとの距離をD、原点Oと比較点qとの距離をdとしたときに、
第1の条件判定部が、
(1−h)2・D2>d2 もしくは
(1+h)2・D2<d2
という条件を満足するか否かを判定するための演算を行うようにしたものである。
(5) According to a fifth aspect of the present invention, in the moving object detection device according to the fourth aspect described above,
When the distance between the origin O and the reference point Q is D, and the distance between the origin O and the comparison point q is d,
The first condition determination unit
(1-h) 2 · D 2 > d 2 or
(1 + h) 2 · D 2 <d 2
The calculation for determining whether or not the above condition is satisfied is performed.
(6) 本発明の第6の態様は、上述の第4の態様に係る移動物体検出装置において、
第2の条件判定部が、原点Oを中心とする半径Dの球面C3と回転楕円体Eとの交線を構成する円を交線円Sとしたときに、「原点Oを頂点、基準軸Zを中心軸とし、交線円Sを通る円錐ξ′の外側に比較点qが位置する」という第2の条件を満足するか否かを判定するようにしたものである。
(6) According to a sixth aspect of the present invention, in the moving object detection device according to the fourth aspect described above,
When the second condition determination unit determines that the circle constituting the intersection line of the spherical surface C3 having the radius D centered on the origin O and the spheroid E is the intersection line S, “the origin O is the vertex, the reference axis Whether or not the second condition that the comparison point q is located outside the cone ξ ′ passing through the circle of intersection S with Z as the central axis is satisfied is determined.
(7) 本発明の第7の態様は、上述の第6の態様に係る移動物体検出装置において、
第2の条件判定部が、交線円S上の任意の点と基準点Qとの距離fが短軸半径βに等しいとおいた近似式を用いて近似的な判定を行うようにしたものである。
(7) According to a seventh aspect of the present invention, in the moving object detection device according to the sixth aspect described above,
The second condition determination unit performs an approximate determination 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 there.
(8) 本発明の第8の態様は、上述の第7の態様に係る移動物体検出装置において、
基準点Qの座標を示す基準画素値を(R,G,B)、比較点qの座標を示す比較画素値を(r,g,b)、原点Oと基準点Qとの距離をD、原点Oと比較点qとの距離をdとしたときに、
第2の条件判定部が、
γ=(R・r+G・g+B・b)
として、
γ2/(D2・d2)<(1−k2/2)2
という条件を満足するか否かを判定するための演算を行うようにしたものである。
(8) According to an eighth aspect of the present invention, in the moving object detection device according to the seventh aspect described above,
The reference pixel value indicating the coordinates of the reference point Q is (R, G, B), the comparison pixel value indicating the coordinates of the comparison point q is (r, g, b), the distance between the origin O and the reference point Q is D, When the distance between the origin O and the comparison point q is d,
The second condition determination unit
γ = (R · r + G · g + B · b)
As
γ 2 / (D 2 · d 2) <(1-
The calculation for determining whether or not the above condition is satisfied is performed.
(9) 本発明の第9の態様は、上述の第4の態様に係る移動物体検出装置において、
基準点Qの座標を示す基準画素値を(R,G,B)、比較点qの座標を示す比較画素値を(r,g,b)、原点Oと基準点Qとの距離をD、原点Oと比較点qとの距離をdとしたときに、
第3の条件判定部が、
α2=h2・D2
β2=k2・D2
x2=D2+γ2/D2−2γ
y2=d2−γ2/D2
γ=(R・r+G・g+B・b)
として、
β2・x2+α2・y2−α2・β2>0
という条件を満足するか否かを判定するための演算を行うようにしたものである。
(9) According to a ninth aspect of the present invention, in the moving object detection device according to the fourth aspect described above,
The reference pixel value indicating the coordinates of the reference point Q is (R, G, B), the comparison pixel value indicating the coordinates of the comparison point q is (r, g, b), the distance between the origin O and the reference point Q is D, When the distance between the origin O and the comparison point q is d,
The third condition determination unit
α 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
γ = (R · r + G · g + B · b)
As
β 2 · x 2 + α 2 · y 2 -α 2 · β 2 > 0
The calculation for determining whether or not the above condition is satisfied is performed.
(10) 本発明の第10の態様は、上述の第1〜第3の態様に係る移動物体検出装置において、
類否判定部を、
パラメータhおよびkの値を保持するパラメータ保持部と、
画素値読出部が読み出した基準画素値(R,G,B)および比較画素値(r,g,b)に基づいて、
D2=R2+G2+B2 および
d2=r2+g2+b2
なる演算を行い、値D2および値d2を算出する基本演算部と、
基本演算部が算出した値D2および値d2とパラメータ保持部に保持されているパラメータhの値とを用いて、
(1−h)2・D2>d2 もしくは
(1+h)2・D2<d2
という条件を満足するか否かを判定するための演算を行う第1の条件判定部と、
第1の条件判定部が否定的判定を行った場合に、画素値読出部が読み出した基準画素値(R,G,B)および比較画素値(r,g,b)に基づいて、
γ=R・r+G・g+B・b
なる演算を行い、値γを算出し、基本演算部が算出した値D2および値d2とパラメータ保持部に保持されているパラメータkの値と値γとを用いて、
γ2/(D2・d2)<(1−k2/2)2
という条件を満足するか否かを判定するための演算を行う第2の条件判定部と、
第2の条件判定部が否定的判定を行った場合に、基本演算部が算出した値D2および値d2とパラメータ保持部に保持されているパラメータhおよびkの値と第2の条件判定部が算出した値γとを用いて、
α2=h2・D2
β2=k2・D2
x2=D2+γ2/D2−2γ
y2=d2−γ2/D2
なる演算を行い、当該演算結果を用いて、
β2・x2+α2・y2−α2・β2>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 first to third aspects described above,
Similarity judgment part,
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-
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 2 -α 2 · β 2 > 0
A third condition determination unit that performs an operation for determining whether or not the condition is satisfied,
When any 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 that the similarity is out of the similar range is output. A determination value output unit that outputs a determination value indicating a determination result that is within the similar range when all of the condition determination unit, the second condition determination unit, and the third condition determination unit perform a negative determination;
It is made up by.
(11) 本発明の第11の態様は、上述の第5,第8〜第10の態様に係る移動物体検出装置において、
不等号を含む演算式の一部もしくは全部について、「不等号>」の代わりに「不等号≧」を用いた演算式、もしくは「不等号<」の代わりに「不等号≦」を用いた演算式を用いるようにしたものである。
(11) An eleventh aspect of the present invention is the moving object detection apparatus according to the fifth, eighth to tenth aspects described above.
For some or all arithmetic expressions containing inequality signs, use arithmetic expressions that use “inequality sign ≧” instead of “inequality sign>”, or arithmetic expressions that use “inequality sign ≦” instead of “inequality sign <”. It is a thing.
(12) 本発明の第12の態様は、上述の第1〜第11の態様に係る移動物体検出装置において、
パラメータ「w」もしくは「hおよびk」またはこれら全てを、ユーザの操作入力によって任意の値に設定するパラメータ設定部を更に設けるようにしたものである。
(12) According to a twelfth aspect of the present invention, in the moving object detection device according to the first to eleventh aspects described above,
A parameter setting unit for setting the parameters “w” or “h and k” or all of them to an arbitrary value by a user operation input is further provided.
(13) 本発明の第13の態様は、上述の第1〜第12の態様に係る移動物体検出装置において、
画素値読出部が、原画像の画素の画素値を基準画素値として読み出し、平均画像の画素の画素値を比較画素値として読み出すようにしたものである。
(13) According to a thirteenth aspect of the present invention, in the moving object detection device according to the first to twelfth aspects described above,
The pixel value reading unit reads the pixel value of the pixel of the original image as the reference pixel value, and reads the pixel value of the pixel of the average image as the comparison pixel value.
(14) 本発明の第14の態様は、上述の第1〜第13の態様に係る移動物体検出装置を、コンピュータにプログラムを組み込むことにより構成したものである。 (14) In a fourteenth aspect of the present invention, the moving object detection device according to the first to thirteenth aspects is configured by incorporating a program into a computer.
(15) 本発明の第15の態様は、上述の第1〜第13の態様に係る移動物体検出装置を、半導体集積回路により構成したものである。 (15) According to a fifteenth aspect of the present invention, the moving object detection device according to the first to thirteenth aspects is configured by a semiconductor integrated circuit.
(16) 本発明の第16の態様は、三原色の各画素値(R,G,B)を有する第1のカラー画素と、三原色の各画素値(r,g,b)を有する第2のカラー画素と、の類否判定を行う画素の類否判定方法において、
コンピュータが、画素値(R,G,B)および(r,g,b)の値を取り込む準備段階と、
コンピュータが、三原色の各画素値を各座標軸にとった三次元座標系において、画素値(R,G,B)に対応する座標をもつ基準点Qを中心とする所定サイズの回転楕円体Eもしくはその近似体と、画素値(r,g,b)に対応する座標をもつ比較点qとについて、後者が前者の内部にあるか外部にあるかを調べる位置関係判定段階と、
コンピュータが、回転楕円体Eもしくはその近似体の外部に比較点qがあると判断した場合には、第1のカラー画素と第2のカラー画素とが非類似との判定結果を出力し、回転楕円体Eもしくはその近似体の内部に比較点qがあると判断した場合には、第1のカラー画素と第2のカラー画素とが類似するとの判定結果を出力する判定結果出力段階と、
を行うようにし、
位置関係判定段階では、三次元座標系の原点Oと基準点Qとの距離Dに、所定のパラメータh(但し、h<1)を乗じて求まる値α=h・Dを長軸半径とし、所定のパラメータk(但し、k<h)を乗じて求まる値β=k・Dを短軸半径とする楕円を、原点Oと基準点Qとを結ぶ基準軸Z上に長軸が重なるように、かつ、基準点Qが中心点となるように配置し、基準軸Zを中心に回転させることにより得られる回転楕円体Eを定義するようにしたものである。
(16) A sixteenth aspect of the present invention is a first color pixel having pixel values (R, G, B) of three primary colors and a second color having pixel values (r, g, b) of three primary colors. In the pixel similarity determination method for determining similarity with a color pixel,
A preparatory stage in which a computer captures values of pixel values (R, G, B) and (r, g, b);
In a three-dimensional coordinate system in which each pixel value of the three primary colors is taken as each coordinate axis, the computer has a spheroid E of a predetermined size centered on a reference point Q having coordinates corresponding to the pixel values (R, G, B) or A positional relationship determination step for examining whether the latter is inside or outside the former with respect to the approximation and the comparison point q having coordinates corresponding to the pixel value (r, g, b);
When the computer determines that the comparison point q is outside the spheroid E or its approximate body, the computer outputs a determination result that the first color pixel and the second color pixel are dissimilar, and rotates. A determination result output stage for outputting a determination result that the first color pixel and the second color pixel are similar when it is determined that the comparison point q is inside the ellipsoid E or its approximate body;
To carry out the,
In the positional relationship determination stage, 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) is set as the major axis radius, An ellipse whose minor axis radius is a value β = k · D obtained by multiplying a predetermined parameter k (where k <h) is set so that the major axis overlaps the reference axis Z connecting the origin O and the reference point Q. In addition, a spheroid E obtained by rotating around the reference axis Z is defined so that the reference point Q is the center point.
(17) 本発明の第17の態様は、上述の第16の態様に係る画素の類否判定方法において、
位置関係判定段階を、
「原点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のカラー画素とが非類似との判定結果を出力し、第1の条件判定段階、第2の条件判定段階、第3の条件判定段階のすべてにおいて否定的判定がなされた場合には、第1のカラー画素と第2のカラー画素とが類似するとの判定結果を出力するようにしたものである。
(17) According to a seventeenth aspect of the present invention, in the pixel similarity determination method according to the sixteenth aspect described above,
The positional relationship judgment stage
“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 determination stage for determining whether or not a first condition is satisfied;
When a negative determination is made in the first condition determination stage, “the comparison point q is outside the cone ξ or its approximated body that is in contact with the spheroid E with a circle with the origin O as the apex and the reference axis Z as the central axis. A second condition determination step for determining whether or not a second condition “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 a negative determination is made in the second condition determination stage. Stages,
Composed by
In the determination result output stage, when a positive determination is made in any of the first condition determination stage, the second condition determination stage, and the third condition determination stage, the first color pixel and the second color When the determination result that the pixel is dissimilar is output and negative determination is made in all of the first condition determination stage, the second condition determination stage, and the third condition determination stage, the first color A determination result indicating that the pixel and the second color pixel are similar is output.
(18) 本発明の第18の態様は、上述の第17の態様に係る画素の類否判定方法において、
第1の条件判定段階で、
D2=(R2+G2+B2)
d2=(r2+g2+b2)
としたときに、
(1−h)2・D2>d2 もしくは
(1+h)2・D2<d2
という条件を満足するか否かを判定するための演算を行うようにしたものである。
(18) According to an eighteenth aspect of the present invention, in the pixel similarity determination method according to the seventeenth aspect described above,
In the first condition determination stage,
D 2 = (R 2 + G 2 + B 2 )
d 2 = (r 2 + g 2 + b 2 )
And when
(1-h) 2 · D 2 > d 2 or
(1 + h) 2 · D 2 <d 2
The calculation for determining whether or not the above condition is satisfied is performed.
(19) 本発明の第19の態様は、上述の第17の態様に係る画素の類否判定方法において、
第2の条件判定段階で、
D2=(R2+G2+B2)
d2=(r2+g2+b2)、
γ=(R・r+G・g+B・b)
としたときに、
γ2/(D2・d2)<(1−k2/2)2
という条件を満足するか否かを判定するための演算を行うようにしたものである。
(19) According to a nineteenth aspect of the present invention, in the pixel similarity determination method according to the seventeenth aspect described above,
In the second condition determination stage,
D 2 = (R 2 + G 2 + B 2 )
d 2 = (r 2 + g 2 + b 2 ),
γ = (R · r + G · g + B · b)
And when
γ 2 / (D 2 · d 2) <(1-
The calculation for determining whether or not the above condition is satisfied is performed.
(20) 本発明の第20の態様は、上述の第17の態様に係る画素の類否判定方法において、
第3の条件判定段階で、
α2=h2・D2
β2=k2・D2
x2=D2+γ2/D2−2γ
y2=d2−γ2/D2
D2=(R2+G2+B2)
d2=(r2+g2+b2)
γ=(R・r+G・g+B・b)
としたときに、
β2・x2+α2・y2−α2・β2>0
という条件を満足するか否かを判定するための演算を行うようにしたものである。
(20) According to a twentieth aspect of the present invention, in the pixel similarity determination method according to the seventeenth aspect described above,
In the third condition determination stage,
α 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
D 2 = (R 2 + G 2 + B 2 )
d 2 = (r 2 + g 2 + b 2 )
γ = (R · r + G · g + B · b)
And when
β 2 · x 2 + α 2 · y 2 -α 2 · β 2 > 0
The calculation for determining whether or not the above condition is satisfied is performed.
(21) 本発明の第21の態様は、三原色の各画素値(R,G,B)を有する第1のカラー画素と、三原色の各画素値(r,g,b)を有する第2のカラー画素と、の類否判定を行う画素の類否判定方法において、
コンピュータが、パラメータh(h<1)およびk(k<h)、画素値(R,G,B)および(r,g,b)の値を取り込む準備段階と、
コンピュータが、
(1−h)2・(R2+G2+B2)>(r2+g2+b2) もしくは
(1+h)2・(R2+G2+B2)<(r2+g2+b2)
という条件を満足するか否かを判定する第1の条件判定段階と、
第1の条件判定段階において否定的判定がなされた場合に、コンピュータが、
(R・r+G・g+B・b)2/
((R2+G2+B2)・(r2+g2+b2))
<(1−k2/2)2
という条件を満足するか否かを判定する第2の条件判定段階と、
第2の条件判定段階において否定的判定がなされた場合に、コンピュータが、
β2・x2+α2・y2−α2・β2>0
但し、α2=h2・D2
β2=k2・D2
x2=D2+γ2/D2−2γ
y2=d2−γ2/D2
D2=(R2+G2+B2)
d2=(r2+g2+b2)
γ=(R・r+G・g+B・b)
という条件を満足するか否かを判定する第3の条件判定段階と、
コンピュータが、第1の条件判定段階、第2の条件判定段階、第3の条件判定段階のいずれかにおいて肯定的判定がなされた場合には、第1のカラー画素と第2のカラー画素とが非類似との判定結果を出力し、第1の条件判定段階、第2の条件判定段階、第3の条件判定段階のすべてにおいて否定的判定がなされた場合には、第1のカラー画素と第2のカラー画素とが類似するとの判定結果を出力する判定結果出力段階と、
を行うようにしたものである。
(21) In a twenty-first aspect of the present invention, a first color pixel having each pixel value (R, G, B) of the three primary colors and a second color having each pixel value (r, g, b) of the three primary colors In the pixel similarity determination method for determining similarity with a color pixel,
A preparatory stage in which a computer captures values of parameters h (h <1) and k (k <h), pixel values (R, G, B) and (r, g, b);
Computer
(1-h) 2 · (R 2 + G 2 + B 2 )> (r 2 + g 2 + b 2 ) or (1 + h) 2 · (R 2 + G 2 + B 2 ) <(r 2 + g 2 + b 2 )
A first condition determination stage for determining whether or not the condition is satisfied,
When a negative determination is made in the first condition determination stage, the computer
(R · r + G · g + B · b) 2 /
((R 2 + G 2 + B 2 ) · (r 2 + g 2 + b 2 ))
<(1-k 2/2 ) 2
A second condition determination stage for determining whether or not the condition is satisfied,
If a negative determination is made in the second condition determination stage, the computer
β 2 · x 2 + α 2 · y 2 -α 2 · β 2 > 0
However, α 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
D 2 = (R 2 + G 2 + B 2 )
d 2 = (r 2 + g 2 + b 2 )
γ = (R · r + G · g + B · b)
A third condition determination stage for determining whether or not the condition is satisfied;
If the computer makes a positive determination in any of the first condition determination stage, the second condition determination stage, and the third condition determination stage, the first color pixel and the second color pixel are A determination result of dissimilarity is output, and when negative determination is made in all of the first condition determination stage, the second condition determination stage, and the third condition determination stage, the first color pixel and the first color pixel A determination result output stage for outputting a determination result that the two color pixels are similar;
Is to do.
(22) 本発明の第22の態様は、上述の第18〜第21の態様に係る画素の類否判定方法において、
不等号を含む演算式の一部もしくは全部について、「不等号>」の代わりに「不等号≧」を用いた演算式、もしくは「不等号<」の代わりに「不等号≦」を用いた演算式を用いるようにしたものである。
(22) According to a twenty-second aspect of the present invention, in the pixel similarity determination method according to the eighteenth to twenty-first aspects described above,
For some or all arithmetic expressions containing inequality signs, use arithmetic expressions that use “inequality sign ≧” instead of “inequality sign>”, or arithmetic expressions that use “inequality sign ≦” instead of “inequality sign <”. It is a thing.
本発明に係る画素の類否判定方法によれば、三次元色空間上において、一方の画素値をプロットした座標点を中心とする回転楕円体内に、他方の画素値をプロットした座標点が入るか否かに基づいて、比較対象となるカラー画素の類否判定を行うようにしたため、演算処理の負担を軽減しつつ、移動物体の検出を行うのに適した類否判定を行うことが可能になる。また、本発明に係る移動物体検出装置では、上述した画素の類否判定方法を採り入れた検出手法を採用したため、演算処理の負担を軽減しつつ、移動物体の検出をより正確に行うことが可能になる。 According to the pixel similarity determination method according to the present invention, in the three-dimensional color space, a coordinate point plotting the other pixel value is placed in a spheroid centered on the coordinate point plotting one pixel value. Since the determination of the similarity of the color pixel to be compared is performed based on whether or not, it is possible to perform the similarity determination suitable for detecting the moving object while reducing the burden of the arithmetic processing become. In addition, since the moving object detection device according to the present invention employs a detection method that adopts the above-described pixel similarity determination method, it is possible to more accurately detect a moving object while reducing the burden of calculation processing. become.
以下、本発明を図示する実施形態に基づいて説明する。 Hereinafter, the present invention will be described based on the illustrated embodiments.
<<< §1.移動物体検出の基本原理 >>>
はじめに、本発明に係る移動物体検出の基本原理を説明する。この基本原理は、動画画像について移動物体を検出するためのものであり、三原色の各画素値を有する画素の集合体として、時系列で連続的にフレーム単位のカラー画像が与えられることを前提としている。
<<< §1. Basic principle of moving object detection >>
First, the basic principle of moving object detection according to the present invention 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に所属する画素には画素値「0」を与え、前景領域Fに所属する画素には画素値「1」を与えることにすれば、画像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 “0” is given to the pixels belonging to the background area B and the pixel value “1” 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 is recognized as the foreground area F by comparing the original image P20 when the original image P20 is input, and a mask image M20 as shown in the figure is obtained. 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, the 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, it always functions as an optimum background image at that time.
図2は、本発明における移動物体検出の基本原理を示す図である。ここで、図の上段に示す画像P(1),P(2),... ,P(i−2),P(i−1),P(i)は、時系列で連続的に与えられるフレーム単位の原画像であり、これまでに第1番目の原画像P(1)から第i番目の原画像P(i)まで、iフレーム分の画像が与えられた状態が示されている。一方、図の中段左に示す画像P(i+1)は、新たに与えられた第(i+1)番目の原画像であり、図の中段右に示す画像A(i)は、図の上段に示す過去に与えられたiフレーム分の原画像P(1)〜P(i)の平均的な特徴を有する平均画像である。 FIG. 2 is a diagram showing the basic principle of moving object detection in the present invention. Here, the images P (1), P (2),..., P (i-2), P (i-1), and P (i) shown in the upper part of the figure are given continuously in time series. A frame-unit original image is shown, and a state in which images for i frames from the first original image P (1) to the i-th original image P (i) have been given is shown. . On the other hand, the image P (i + 1) shown on the left in the middle of the figure is the (i + 1) th original image newly given, and the image A (i) shown on the right of the middle of the figure is the past shown in the upper part of the figure. Is an average image having an average characteristic of the original images P (1) to P (i) for i frames given to.
新たに入力された原画像P(i+1)についてのマスク画像M(i+1)は、当該原画像P(i+1)と平均画像A(i)とを比較することによって作成される。図2の下段は、このようにして作成されたマスク画像M(i+1)を示すものである。具体的には、原画像P(i+1)上の各画素の画素値を、平均画像A(i)上の対応する画素の画素値と比較し、類似範囲内と判定された画素については背景領域Bを示す画素値(たとえば、「0」)を与え、類似範囲外と判定された画素については前景領域Fを示す画素値(たとえば、「1」)を与えることにより、二値画像からなるマスク画像M(i+1)を作成すればよい。 The mask image M (i + 1) for the newly input original image P (i + 1) is created by comparing the original image P (i + 1) and the average image A (i). The lower part of FIG. 2 shows the mask image M (i + 1) created in this way. Specifically, the pixel value of each pixel on the original image P (i + 1) is compared with the pixel value of the corresponding pixel on the average image A (i). A pixel value indicating B (for example, “0”) is given, and a pixel value indicating the foreground area F (for example, “1”) is given to a pixel determined to be outside the similar range, thereby forming a mask made of a binary image An image M (i + 1) may be created.
続いて、第(i+2)番目の原画像P(i+2)が入力されたときには、過去に入力された第(i+1)番目の原画像P(i+1)までの平均的な特徴を有する平均画像A(i+1)が新たに作成され、原画像P(i+2)と平均画像A(i+1)とを比較することにより、マスク画像M(i+2)が作成される。このように、平均画像は逐次更新されてゆくため、天候や時刻などの要因により、照明環境が変化した場合でも、各時点に適した背景画像としての機能を果たすことができる。 Subsequently, when the (i + 2) th original image P (i + 2) is input, an average image A () having an average characteristic up to the (i + 1) th original image P (i + 1) input in the past. i + 1) is newly created, and the mask image M (i + 2) is created by comparing the original image P (i + 2) with the average image A (i + 1). 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. When the (i + 1) -th mask image M (i + 1) is created for the (i + 1) -th original image P (i + 1), the original image P (i + 1) and the i-th average image A What is necessary is just to compare (i).
ただ、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.
本発明におけるマスク画像は、このような方法で作成された平均画像を背景画像として、個々の原画像を比較することによって作成される。図5は、このようにして作成されるマスク画像の画素値決定プロセスを示す図である。第i番目の原画像P(i)についてのマスク画像M(i)は、次のような方法で決定される画素値をもつ画素の集合体からなる二値画像である。すなわち、マスク画像M(i)の特定位置の画素の画素値m(i)は、原画像P(i)の当該特定位置の画素の画素値p(i)と、平均画像A(i−1)の当該特定位置の画素の画素値a(i−1)との比較によって決定され、両画素値が類似範囲内であれば、背景領域B内の画素であることを示す画素値(たとえば、「0」)が与えられ、両画素値が類似範囲外であれば、前景領域F内の画素であることを示す画素値(たとえば、「1」)が与えられる。 The mask image in the present invention is created by comparing individual original images using 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 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, “1”) indicating a pixel 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組の画素値同士が類似するか否かを判定する処理ということになる。本発明の特徴は、この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 processing for determining whether or not the three sets of pixel values are similar to each other. A feature of the present invention resides in a method for determining similarity between these three sets of pixel values. Hereinafter, this similarity determination method will be described in detail in
<<< §2.画素の類否判定方法 >>>
さて、§1で述べたとおり、本発明では、原画像(入力画像)と平均画像(背景画像)とを画素単位で比較して、両画素が類似している場合は背景領域Bの画素、非類似の場合は前景領域Fの画素という判定を行う。このように画素単位での類否判定を行う方法は、領域単位で特徴量を求める方法に比べて処理が単純になり、演算負担は比較的軽くなる。しかしながら、画素の類否判定が移動物体の検出精度を左右するファクターになるため、どのような方法で、どの程度の範囲までを「類似範囲」と判定するかが非常に重要である。
<<< §2. Pixel similarity determination method >>>
Now, as described in §1, in the present invention, the original image (input image) and the average image (background image) are compared in pixel units, and if both pixels are similar, the pixels in the background region B, 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.
すなわち、図1では、背景部分に全く同じ画像が描かれているが、実際の風景では、雲の動きで太陽光による照明環境が変化し、風により樹木の葉の位置や向きが微妙に変化する。したがって、画素の類否判定基準を厳しくすると、実際には背景部分であるのに、類似範囲外との誤判定が生じ、前景領域F内の画素との認定がなされてしまう。逆に、画素の類否判定基準を緩めると、実際には前景部分であるのに、類似範囲内との誤判定が生じ、背景領域B内の画素との認定がなされてしまう。 That is, in FIG. 1, the exact same image is drawn in the background part, but in an actual landscape, the lighting environment due to sunlight changes due to the movement of the clouds, and the position and orientation of the leaves of the trees change slightly due to the wind. . Therefore, if the criteria for judging whether or not the pixels are similar is strict, an erroneous determination of being out of the similar range occurs even though it is actually the background portion, and the pixels in the foreground area F are recognized. On the other hand, if the criteria for judging whether or not a pixel is similar is relaxed, an erroneous determination that it is in the foreground portion but within the similar range occurs, and the pixel in the background region B is recognized.
しかも、カラー画像の場合、前述したように、画素の類否は、一方の画素の3組の画素値と他方の画素の3組の画素値との比較に基づいて行う必要があるため、様々な類否判定基準を設定することが可能である。そして、どのような類否判定基準を採用するかによって、判定精度も変わってくる。通常、このようなカラー画像の画素の比較は、三次元の色空間上で、双方の画素値に対応する座標点をプロットし、両座標点の空間的な位置関係を調べることによって行われる。以下、各画素がRGB表色系の画素値をもっている場合について、色空間上での類否判定を行ういくつかの方法を説明しよう。 In addition, in the case of a color image, as described above, the similarity of pixels needs to be performed based on a comparison between three pixel values of one pixel and three pixel values of the other pixel. It is possible to set a similar similarity criterion. The determination accuracy also varies depending on what kind of similarity determination criterion is adopted. 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, there will be described several methods for determining similarity in the color space when each pixel has a RGB color system pixel value.
図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.
ただ、このような距離δや角度θを基準とした単純な類否判定方法を、一般的な実写画像における移動物体検出処理に利用した場合、満足した検出結果を得ることが困難であることが知られている。これは、距離δや角度θという単純なパラメータの値だけでは、太陽光による照明環境の変化、風による樹木等の明暗の変化など、実際の撮影環境に対応した適切な判定基準を設定することが困難なためである。 However, when such a simple similarity determination method based on the distance δ and the angle θ is used for a moving object detection process in a general live-action image, it may be difficult to obtain a satisfactory detection result. Are known. This means that, with only simple parameter values such as distance δ and angle θ, appropriate judgment criteria corresponding to the actual shooting environment, such as changes in the lighting environment due to sunlight and changes in light and darkness due to wind, etc. should be set. This is because it is difficult.
このような問題に対処するために、前掲の非特許文献1には、より適切な判定基準を設定するために、円柱モデルを用いる類否判定方法が提案されている。図7は、この円柱モデルを用いる方法の基本原理を示す三次元色空間図である。この図7においても、図6と同様に、背景を示す平均画像A上の画素の画素値(Ra,Ga,Ba)が座標点Aとしてプロットされ、判定対象となる原画像P上の画素の画素値(Rp,Gp,Bp)が座標点Pとしてプロットされている。ここでも、ベクトルVa,Vpは、原点Oを起点として、各点A,Pへ向かうベクトルである。
In order to deal with such a problem, the aforementioned
このモデルでは、図示のとおり、座標点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 in the example shown 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 foreground 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 this cylindrical model 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. As described above, in an actual scene, the pixel value of the background region B will vary temporally due to changes in the lighting environment due to sunlight, changes in brightness such as trees due to the wind, and so on. , It is considered to have a greater effect on brightness than hue. 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.
しかしながら、この円柱モデルを用いても、時刻や天候などによる照明変動の影響を完全に排除することは困難であり、依然として、誤検出が生じる問題がある。また、座標点Pが円柱Cの内部に位置するのか外部に位置するのかを判定するためには、三次元の色空間上での幾何学演算が必要になり、安価なプロセッサを用いてリアルタイムの処理を行うには演算処理の負担が重い。特に、三角関数を含む演算は、安価な汎用プロセッサにとって極めて負担の重い処理になる。本発明は、このような問題に対処するために、新たなモデルを用いた画素の類否判定方法を提案するものである。 However, even if this cylindrical model is used, it is difficult to completely eliminate the influence of illumination fluctuation due to time, weather, etc., and there still remains a problem that erroneous detection occurs. Further, in order to determine whether the coordinate point P is located inside or outside the cylinder C, geometric calculation in a three-dimensional color space is required, and real-time operation is performed using an inexpensive processor. The processing load is heavy to perform the processing. In particular, operations including trigonometric functions are extremely heavy processing for an inexpensive general-purpose processor. In order to cope with such a problem, the present invention proposes a pixel similarity determination method using a new model.
本発明に係る画素の類否判定方法の最も重要な特徴は、図7に示す円柱モデルの円柱Cの代わりに、回転楕円体を用いるようにした点にある。図8は、図7に示す円柱Cを回転楕円体Eaに置き換えた回転楕円体モデルを示す三次元色空間図である。ここで、類似範囲を示す回転楕円体Eaは、平均画像Aの画素値を示す座標点Aを中心点とし、ベクトルVa上に定義された基準軸Zaを長軸方向とする楕円を、基準軸Zaを回転軸として回転させることにより得られる回転体である。この回転楕円体Eaのサイズは、長軸方向の長さLa1と短軸方向の長さLa2によって規定される。 The most important feature of the pixel similarity determination method according to the present invention is that a spheroid is used instead of the cylinder C of the cylinder model shown in FIG. FIG. 8 is a three-dimensional color space diagram showing a spheroid model in which the cylinder C shown in FIG. 7 is replaced 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の外側に位置するため類似範囲外と判定され、前景領域Fを構成する画素と認定される。逆に、座標点Pが回転楕円体Eaの内部に位置していれば、類似範囲内と判定され、背景領域Bを構成する画素と認定される。 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 case of 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 the pixels constituting the foreground region F are Certified. On the other hand, if the coordinate point P is located inside the spheroid Ea, it is determined to be within the similar range and recognized as a pixel constituting the background region B.
一方、図9は、図8に示す回転楕円体モデルのバリエーションを示す三次元色空間図である。図示のとおり、このモデルにおける類似範囲を示す回転楕円体Epは、判定対象となる原画像Pの画素値を示す座標点Pを中心点とし、ベクトルVp上に定義された基準軸Zpを長軸方向とする楕円を、基準軸Zpを回転軸として回転させることにより得られる回転体である。この回転楕円体Epのサイズは、長軸方向の長さLp1と短軸方向の長さLp2によって規定される。 On the other hand, FIG. 9 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.
図8に示すモデルの場合、背景を示す平均画像Aの画素値(Ra,Ga,Ba)をプロットした座標点Aを基準として、類似範囲を示す回転楕円体Eaが定義され、比較対象となる原画像Pの画素値(Rp,Gp,Bp)をプロットした座標点Pが、回転楕円体Eaの内側にあるか外側にあるかを判定していたのに対して、図9に示すモデルの場合、比較対象となる原画像Pの画素値(Rp,Gp,Bp)をプロットした座標点Pをプロットした座標点Pを基準として、類似範囲を示す回転楕円体Epが定義され、背景を示す平均画像Aの画素値(Ra,Ga,Ba)をプロットした座標点Aが、回転楕円体Epの内側にあるか外側にあるかを判定することになる。 In the case of the model shown in FIG. 8, 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 has been 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.
図10は、このような一般的な表記にしたがって、本発明に係る回転楕円体モデルを図示した三次元色空間図である。原点Oを起点として基準点Qへ向かうベクトルをベクトルVとすれば、基準軸Zは、このベクトルV上の軸になる。そして、回転楕円体Eは、基準点Qを中心点とし、ベクトルV上に定義された基準軸Zを長軸方向とする楕円を、基準軸Zを回転軸として回転させることにより得られる回転体である。ここで、比較点q(r,g,b)が回転楕円体Eの内部に位置すれば、両画素は類似範囲内と判定され、回転楕円体Eの外部に位置すれば、両画素は類似範囲外と判定される。 FIG. 10 is a three-dimensional color space diagram illustrating a spheroid model according to the present invention in accordance with 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 within the similar range, and if located outside the spheroid E, both pixels are similar. Determined to be out of range.
図8に示すモデルは、図5に示す類否判定を行う際に、平均画像A(i−1)上の画素a(i−1)の画素値を基準画素値(R,G,B)として基準点Q(R,G,B)をプロットし、原画像P(i)上の画素p(i)の画素値を比較画素値(r,g,b)として比較点q(r,g,b)をプロットしたものである。これに対して、図9に示すモデルは、図5に示す類否判定を行う際に、原画像P(i)上の画素p(i)の画素値を基準画素値(R,G,B)として基準点Q(R,G,B)をプロットし、平均画像A(i−1)上の画素a(i−1)の画素値を比較画素値(r,g,b)として比較点q(r,g,b)をプロットしたものである。 The model shown in FIG. 8 uses the pixel value of the pixel a (i-1) on the average image A (i-1) as the reference pixel value (R, G, B) when performing the similarity determination shown in FIG. The reference point Q (R, G, B) is plotted, and the pixel value of the pixel p (i) on the original image P (i) is set as the comparison pixel value (r, g, b). , B) are plotted. On the other hand, the model shown in FIG. 9 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 the similarity determination shown in FIG. ) Is plotted as a reference point Q (R, G, B), and the pixel value of the pixel a (i−1) on the average image A (i−1) is set as a comparison pixel value (r, g, b). q (r, g, b) is plotted.
図7に示す従来の円柱モデルに比べて、図10に示す本発明の回転楕円体モデルは、次の2つの利点を有している。第1の利点は、§1で述べた移動物体検出方法における画素の類否判定処理に利用した場合に、時刻や天候などによる照明変動の影響を排除した、より正確な移動物体の検出が可能になる点である。 Compared to the conventional cylindrical model shown in FIG. 7, the spheroid model of the present invention shown in FIG. 10 has the following two advantages. The first advantage is that, when used in the pixel similarity determination process in the moving object detection method described in §1, it is possible to detect a moving object more accurately without the influence of illumination fluctuations due to time or weather. It is a point to become.
実際、本願発明者は、ビデオカメラで撮影した様々な実写画像について、図7に示す円柱モデルに基づく類否判定処理を採り入れた移動物体の検出と、図10に示す回転楕円体モデルに基づく類否判定処理を採り入れた移動物体の検出とを試みたところ、後者の検出の方がより正確である実験結果が得られた。これは、円柱モデルの場合、円柱の長手方向の端部周縁領域において、誤検出が行われる可能性が高くなるためと考えられる。 Actually, the inventor of the present application has detected a moving object that adopts the similarity determination process based on the cylindrical model shown in FIG. 7 and various types based on the spheroid model shown in FIG. When an attempt was made to detect a moving object incorporating the rejection determination process, an experimental result in which the latter detection was more accurate was obtained. 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.
図11は、円柱モデルに対する回転楕円体モデルの利点を示す断面図である。図示の例において、円柱Cの断面と回転楕円体Eの断面とを比較すると、いずれも基準点Qを中心として、基準軸Zの方向を長手方向とする図形であるが、図にハッチングを施す領域が、円柱Cでは内部領域と判定されるのに対して、回転楕円体Eでは外部領域と判定されることがわかる。したがって、比較点qが、このハッチング領域に位置する場合、一方では類似範囲内と判定され、他方では類似範囲外と判定される。もちろん、いずれの判定結果が正しいものであるかは、一概には決定できないが、少なくとも実写画像を用いた移動物体の検出処理に利用する限りにおいて、後者の判定結果が正しい結果となる可能性が高いことになる。 FIG. 11 is a cross-sectional view showing the advantages of the spheroid model over the 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内の画素とすべきであった、というケースが比較的高い確率で生じてしまうものと考えられる。図11に示すとおり、断面形状で比較すると、回転楕円体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. 11, 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の利点の詳細については、§3で述べることにするが、ここでは、演算負担の軽減に寄与する工夫のひとつを簡単に述べておく。 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 §3. Here, one of the devices that contributes to the reduction of the calculation burden will be briefly described.
この工夫は、回転楕円体Eのサイズを、三次元座標系の原点Oと基準点Qとの距離Dに比例した値に設定することである。具体的には、図10に示すとおり、距離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. 10, 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に比例した値に設定することにより)、大幅に軽減することができる。その詳細は§3で述べることにする。 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 §3.
ところで、本願発明者が行った実験によると、回転楕円体Eのサイズを、距離Dに比例した値に設定する場合は、図8のモデルよりも、図9のモデルを用いた方が、検出精度が向上することが判明した。図9のモデルを採用した場合、図10において、基準点Q(R,G,B)は、判定対象となる原画像Pの画素の画素値を基準画素値としてプロットした点になり、比較点q(r,g,b)は、背景となる平均画像Aの画素の画素値を比較画素値としてプロットした点になる。 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. 9 rather than the model of FIG. It was found that the accuracy was improved. When the model of FIG. 9 is adopted, the reference point Q (R, G, B) in FIG. 10 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 where the pixel values of the pixels of the average image A serving as the background are plotted as comparison pixel values.
上述したとおり、図8のモデルと図9のモデルは、原画像Pの画素と平均画像Aの画素とのいずれを基準にして回転楕円体を定義するか、という点において異なる。しかも、回転楕円体のサイズを、距離Dに比例した値に設定すれば、定義される回転楕円体のサイズが、両者では異なることになる。すなわち、図8に示すモデルにおける回転楕円体Eaの長軸方向の長さLa1および短軸方向の長さLa2は、ベクトルVaの長さに、それぞれパラメータ2hおよび2kを乗じることにより得られるのに対して、図9に示すモデルにおける回転楕円体Epの長軸方向の長さLp1および短軸方向の長さLp2は、ベクトルVpの長さに、それぞれパラメータ2hおよび2kを乗じることにより得られる。したがって、図示の例の場合、回転楕円体Eaのサイズよりも、回転楕円体Epのサイズの方が大きくなっており、より広い類似範囲が設定されている。 As described above, the model in FIG. 8 and the model in FIG. 9 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. 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. 8 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. 9 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.
もちろん、常識的には、図9に示すモデルよりも図8に示すモデルを採用するのが一般的であろう。すなわち、予め背景とみなすことができる類似範囲を回転楕円体Eaとして定義しておき、新たに入力された画像の画素を示す点Pが、この類似範囲内に入るか否かを判定することにより、当該画素が移動物体上の点であるか否かを認識する、という方針を採るのが、一般的な考え方である。これに対して、図9に示すモデルは、新たに入力された画像の画素の類似範囲を回転楕円体Ebとして定め、その中に、背景画素を示す点Aが入るか否かを判定する手法を採るものであり、一般常識に基づく手法とは逆の手法と言うことができる。 Of course, from a common sense, the model shown in FIG. 8 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. 9 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.
しかしながら、本願発明者が行った実験によると、少なくとも実写画像を用いた移動物体の検出処理に利用する限りにおいて、図8に示すモデルを採用するよりも、図9に示すモデルを採用した方が、より正しい判定結果が得られた。これは、図3の式(1)に示すような方法で、平均画像Aの画素値a(i)を決定すると、太陽光や風などの要因により、新たに入力されてくる原画像Pの画素値p(i)が大きく変動しても、画素値a(i)の値が当該変動に追従するまでにはある程度の時間がかかるため(たとえば、図4の表を参照)、類似範囲の広狭を、背景を示す平均画像Aの画素値a(i)ではなく、原画像Pの画素値p(i)に応じて定めた方が、正しい判定が可能になるためと考えられる。 However, according to experiments conducted by the inventors of the present application, it is better to adopt the model shown in FIG. 9 than to adopt the model shown in FIG. 8 as long as it is used for detection processing of a moving object using at least a photographed image. More correct judgment results were obtained. This is because, when the pixel value a (i) of the average image A is determined by the method shown in the equation (1) of FIG. 3, the newly input original image P is caused by factors such as sunlight and wind. Even if the pixel value p (i) greatly fluctuates, it takes a certain amount of time for the pixel value a (i) to follow the fluctuation (for example, see the table in FIG. 4). It is considered that it is possible to make a correct determination if the width is determined according to the pixel value p (i) of the original image P instead of the pixel value a (i) of the average image A indicating the background.
以上、移動物体の検出に利用する画素の類否判定処理方法において、円柱モデルを採用する従来の方法に比べて、回転楕円体モデルを採用する本発明の利点として、時刻や天候などによる照明変動の影響を排除した、より正確な移動物体の検出が可能になる、という第1の利点を述べるとともに、演算負担を軽減することができるという第2の利点についても簡単に説明した。続く§3では、この第2の利点についての詳細を述べることにする。 As described above, in the pixel similarity determination processing method used for detecting a moving object, as compared to the conventional method using a cylindrical model, as an advantage of the present invention that uses a spheroid model, illumination variation due to time, weather, etc. The first advantage that a more accurate moving object can be detected without the influence of the above is described, and the second advantage that the calculation burden can be reduced is also briefly described. In the following §3, details on this second advantage will be described.
<<< §3.実用的な類否判定手順 >>>
一般に、三次元空間上において、ある1点が、円柱の内側にあるか外側にあるかを判定する場合も、回転楕円体の内側にあるか外側にあるかを判定する場合も、座標値を用いた幾何学演算が必要になる。しかしながら、回転楕円体の内側にあるか外側にあるかを判定する場合は、演算式を工夫し、また、一部に近似演算を取り込むことにより、演算負担を大幅に軽減することが可能である。ここでは、図10に示す回転楕円体モデルにおいて、比較点q(r,g,b)が、基準点Q(R,G,B)を中心として定義された回転楕円体Eの内側にあるか外側にあるかを判定する実用的な手順を述べる。
<<< §3. Practical similarity judgment procedure >>>
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. 10, is the comparison point q (r, g, b) inside the spheroid E defined with the reference point Q (R, G, B) as the center? A practical procedure to determine whether it is outside is described.
ここで述べる手順は、3つの条件判定段階によって構成される。図12は、そのうちの第1の条件判定段階の原理を示す断面図である。図において、下方に示す原点Oは、図10の三次元色空間図に示されているRGB三次元直交座標系の原点Oであり、当該座標系上に、基準点Q(R,G,B)と比較点q(r,g,b)とがプロットされている(座標軸は図示省略)。基準軸Zは、原点Oと基準点Qとを結ぶ線であり、回転楕円体Eは、この基準軸Zを長軸方向とし、基準点Qを中心とする楕円を、基準軸Zを回転軸として回転させることによって得られる回転体である。図に断面を示す楕円は、長軸半径をα、短軸半径をβとする楕円であるが、§2で述べたとおり、原点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. 12 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. 10, 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 §2, when the distance between the origin O and the reference point Q is D, a predetermined ellipse is shown. 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.
図13は、図12に示す第1の条件判定原理に基づく判定式を示す図である。図13(a) は、比較点qが球C1の内側領域にあるための条件式「D−α>d」の変形プロセスを示す。すなわち、α=h・Dを代入すると、条件式は「(1−h)・D>d」となり、両辺を2乗すると、
(1−h)2・D2>d2 式(2)
が得られる。一方、図13(b) は、比較点qが球C2の外側領域にあるための条件式「D+α<d」の変形プロセスを示す。すなわち、α=h・Dを代入すると、条件式は「(1+h)・D<d」となり、両辺を2乗すると、
(1+h)2・D2<d2 式(3)
が得られる。
FIG. 13 is a diagram showing a determination formula based on the first condition determination principle shown in FIG. FIG. 13A 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. 13B 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)であるから、図13(c) に示すように、
D=√(R2+G2+B2)
d=√(r2+g2+b2)
であり、両辺を2乗すると、
D2=(R2+G2+B2)
d2=(r2+g2+b2)
となる。したがって、式(2),式(3)を書き直せば、図13(c) に示すように、
(1−h)2・(R2+G2+B2)
>(r2+g2+b2) 式(2′)
(1+h)2・(R2+G2+B2)
<(r2+g2+b2) 式(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′)のいずれの条件も満足しない場合は、図12において、比較点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 the 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.
図14は、この第2の条件判定段階の原理を示す断面図である。第2の条件判定段階では、比較点qが、図14のハッチング領域内にあるかどうかの判定が行われる。このハッチング領域は、「原点Oを頂点、基準軸Zを中心軸とし、回転楕円体Eと円で接する円錐ξの外側領域」として定義される領域である。円錐ξの半頂角は、図示のとおり角φになる。図示の断面図では、円錐ξが接点Tにおいて楕円Eに接している状態が示されているが、実際には、円錐ξと回転楕円体Eとは、接線円Tで線接触することになる。三次元空間上での円錐ξと回転楕円体Eとの関係は、コーンに卵を挿入した状態を考えれば容易に理解できよう。 FIG. 14 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を通る円錐ξを示す幾何学的な方程式を求めることも可能である。しかしながら、そのような方程式は比較的複雑な式になる。そこで、ここでは、円錐ξの代わりに、図14に破線で示す円錐ξ′を利用した近似的な判定を行うことにより、演算負担の軽減を図ることにする。 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. 14 is performed to reduce the calculation burden.
図14に実線で描いた円錐ξは、接線円Tで回転楕円体Eに接する図形であるが、破線で描いた円錐ξ′は、交線円Sで回転楕円体Eと交差する図形である。ここで、交線円Sは、原点Oを中心とする半径Dの球面C3と回転楕円体Eとの交線を構成する円であり、基準点Qと交線円S上の任意の点との距離は図示のとおりfである。結局、この近似的な判定では、「原点Oを頂点、基準軸Zを中心軸とし、交線円Sを通る円錐ξ′の外側に比較点qが位置するか否か」という判定が行われることになる。 The cone ξ drawn with a solid line in FIG. 14 is a figure that touches the spheroid E with a tangent circle T, whereas the 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が、この円錐ξ′の内側にあるのか外側にあるのかを幾何学的に判定するための具体的な方法を考えてみる。いま、図15(a) に示すように、三辺の長さがそれぞれa,b,cである一般的な三角形を考える。ここで、2辺b,cの挟角をφとすると、余弦定理により、
cos φ=(b2+c2−a2)/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. 15 (a), consider a general triangle with three side lengths a, b, and c, respectively. 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.
続いて、図15(b) に示す三角形OQSを考える。この図15(b) は、図14に示す三角形OQSをそのまま抜き出して示したものである。交線円Sは、前述したとおり、原点Oを中心とする半径Dの球面C3と回転楕円体Eとの交線であるから、2点OSの距離は、2点OQの距離に等しくDになる。したがって、三角形OQSは二等辺三角形になり、2つの等辺の挟角はφ′、第3の辺の長さはfである。この三角形OQSに、式(4)に示す余弦定理を適用すると、
cos φ′=(D2+D2−f2)/2D2 式(5)
が成り立つ。
Next, consider the triangle OQS shown in FIG. FIG. 15B shows the triangle OQS shown in FIG. 14 as it is extracted. As described above, the intersecting circle S is an intersecting line between the spheroid E3 and the spherical surface C3 having the radius D centered on the origin O, so that 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.
ここで、図14を見ると、長さfは、回転楕円体Eの短軸半径βに近い値になることがわかる。そこで、近似的に、f≒βとすると、β=k・Dなので、f≒k・Dになり、図15の下段右に示すとおり、
cos φ′≒1−k2/2 式(6)
なる式が得られる。
Here, it can be seen from FIG. 14 that the length f is close to the minor axis radius β of the spheroid E. Thus, approximately, if f≈β, then β = k · D, so f≈k · D. As shown in the lower right of FIG.
cos φ '≒ 1-k 2 /2 Equation (6)
The following formula is obtained.
次に、図16に示す三角形OQqを考える。この図16は、図14に示す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. In FIG. 16, the four points O, Q, S, and q shown in FIG. 14 are extracted and plotted as they are. 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.
さて、図14において、円錐ξの代わりに円錐ξ′を用いて、比較点qがハッチング領域にあるための条件を求めると、θ>φ′であればよいことがわかる。ここで、座標値(画素値)R,G,B,r,g,bが正の値をとるものとすれば、角度θおよびφ′はいずれも鋭角になる。図16の右側にも記載したとおり、一般に、θ,φ′を正の鋭角とすれば、θ>φ′の場合、「cos θ<cos φ′」であり、「cos 2θ<cos 2φ′」である。式(6)より、cos 2φ′≒(1−k2/2)2であるから、結局、
cos 2θ<(1−k2/2)2 式(7)
が成り立てば、比較点qは、円錐ξ′の外側領域にあると近似的に判断できる。
続いて、図16に示す三角形OQqについて、式(4)の余弦定理を適用すれば、図16の下段に示すように、
cos θ=(D2+d2−t2)/(2・D・d) 式(8)
が成り立つ。このとき、図17にも記載したとおり、
D2=(R2+G2+B2)
d2=(r2+g2+b2)
t2=(R−r)2+(G−g)2+(B−b)2
だから、これを式(8)に代入して整理すると、
cos θ=γ/(D・d) 式(9)
(但し、γ=R・r+G・g+B・b)
が得られる。式(9)の両辺を2乗すれば、
cos 2θ=γ2/(D2・d2) 式(10)
である。よって、式(7)より、
γ2/(D2・d2)<(1−k2/2)2 式(11)
が成り立てば、比較点qは、円錐ξ′の外側領域にあると近似的に判断できる。ここで、γ,D,dを画素値を用いて書き直せば、図17の下段に示すように、
(R・r+G・g+B・b)2/
((R2+G2+B2)・(r2+g2+b2))
<(1−k2/2)2 式(11′)
が成り立てば、比較点qは、円錐ξ′の外側領域にあると近似的に判断できる。
Now, in FIG. 14, 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. 16, generally, if θ and φ ′ are positive acute angles, when θ> φ ′, “cos θ <cos φ ′” and “cos 2 θ <cos 2 φ”. ''. The equation (6), cos 2 φ ' ≒ (1-
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 ξ ′.
Subsequently, if the cosine theorem of Equation (4) is applied to the triangle OQq shown in FIG. 16, 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-
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 ξ ′.
既に述べたとおり、図14において、円錐ξ′は、円錐ξに近似的に代用することができるので、上記式(11′)が成り立てば、比較点qは、回転楕円体Eの外側領域にある、との近似的判定を行うことができる。もちろん、この近似的な判定結果は、円錐ξ′を円錐ξに代用し、かつ、f≒βとの近似を行うことによって得られる判定結果であるので、厳密な判定結果ではない。しかしながら、そもそも回転楕円体E自体が、移動物体を厳密に検出する機能をもつ立体であるわけではないので、このような近似的な判定を行っても、大きな支障は生じない。別言すれば、上述した近似的な判定手法は、比較点qが回転楕円体Eの外部にあるかどうかを判定する代わりに、その近似体の外部に位置するかどうかを判定する手法ということになる。 As described above, in FIG. 14, the cone ξ ′ can be approximately substituted for the cone ξ. Therefore, if the above equation (11 ′) is established, the comparison point q is located 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は、図14においてハッチングが施されていない円錐ξの内側に位置すると近似的に判断されたことになるので、最終的に、第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.
図18は、この第3の条件判定段階の原理を示す断面図である。第3の条件判定段階では、比較点qが、図18のハッチング領域内にあるかどうかの判定が行われる。このハッチング領域は、回転楕円体Eの外側領域であり、いわば第3の条件判定段階は、§2で述べた回転楕円体モデルを用いた類否判定として行うべき本来の判定段階ということになる。このため、条件判定に用いられる式は、楕円の方程式を用いた式になり、これまでの条件判定式に比べると、若干複雑にならざるを得ない。 FIG. 18 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 §2. . 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.
いま、図18に示すように、基準点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. 18, 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, and an ellipse E and a comparison point q are taken on this two-dimensional coordinate system. 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、そして挟角θを用いて表すと、図18の右下にも記載したとおり、
x=D−d・cos θ、 y=d・sin θ 式(12)
が成り立つ。一方、図19に示すとおり、楕円の公式からは、
x2/α2+y2/β2=1 式(13)
が得られるので、
f(x,y)=β2・x2+α2・y2−α2・β2 式(14)
なる判定式を定義すれば、比較点qは、
f(x,y)<0なら楕円内部の点
f(x,y)=0なら楕円上の点
f(x,y)>0なら楕円外部の点
ということになる。したがって、
β2・x2+α2・y2−α2・β2>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 2 -α 2 · β 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)において、各変数の値は、図19の下半分に示すように、次のようにして求めることができる。まず、α=h・D、β=k・Dであるから、
α2=h2・D2、 β2=k2・D2 式(16)
である。一方、式(12)より、x=D−d・cos θだから、両辺を2乗すると、
x2=D2+d2・cos2 θ−2Dd・cos θ
となり、これに式(9)および式(10)を代入すれば、
x2=D2+γ2/D2−2γ 式(17)
が得られる(但し、γ=R・r+G・g+B・b)。また、式(12)より、y=d・sin θだから、両辺を2乗すると、
y2=d2・sin2 θ=d2・(1−cos2 θ)
となり、これに式(10)を代入すれば、
y2=d2−γ2/D2 式(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)によって、α2,β2,x2,y2の各値を求めた後に、式(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.
図20は、これまで述べてきた本発明に係る実用的な類否判定方法の手順を示す流れ図である。この類否判定方法によれば、三原色の各画素値(R,G,B)を有する第1のカラー画素と、三原色の各画素値(r,g,b)を有する第2のカラー画素と、の類否判定を行うことができる。なお、実際には、この図20に示す各手順は、コンピュータによって実行されることになる。 FIG. 20 is a flowchart showing the procedure of the practical similarity determination method according to the present invention 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. 20 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程度の値に設定すれば、比較的高い検出精度が得られる。 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.
続く、ステップ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に示す手順は、図10に示すように、三原色の各画素値を各座標軸にとった三次元座標系において、画素値(R,G,B)に対応する座標をもつ基準点Qを中心とする所定サイズの回転楕円体Eと、画素値(r,g,b)に対応する座標をもつ比較点qとについて、後者が前者の内部にあるか外部にあるかを調べる位置関係判定段階の手順である。 Hereinafter, as shown in FIG. 10, the procedure shown in steps S13 to S18 has coordinates corresponding to pixel values (R, G, B) in a three-dimensional coordinate system in which the pixel values of the three primary colors are taken as coordinate axes. 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の条件判定段階では、図12に示すように、「原点Oを中心とし半径(D−α)の球C1の内側に比較点qが位置する」もしくは「原点Oを中心とし半径(D+α)の球C2の外側に比較点qが位置する」という条件を満足するか否かの判定が行われる。そのためには、図13で説明したとおり、
(1−h)2・D2>d2 式(2)
もしくは
(1+h)2・D2<d2 式(3)
という条件を満足するか否かを判定するための演算を行えばよい。ここで、
D2=(R2+G2+B2)
d2=(r2+g2+b2)
であるから、結局、ステップS13のブロック内に記載したように、
(1−h)2・(R2+G2+B2)>(r2+g2+b2) 式(2′)
もしくは
(1+h)2・(R2+G2+B2)<(r2+g2+b2) 式(3′)
という条件を満足するか否かを判定する演算を行えばよい。
First, in the first condition determination stage shown in step S13, as shown in FIG. 12, “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の条件判定段階では、図14に示すように、「原点Oを頂点、基準軸Zを中心軸とし、回転楕円体Eと円で接する円錐ξの外側に比較点qが位置する」という第2の条件を満足するか否かの判定が行われる。ただ、前述したとおり、実用上は、円錐ξの代わりに円錐ξ′を用い、しかもf≒βと近似する式が用いられる。このような近似的な判定手法を採る場合は、第2の条件は「回転楕円体Eの近似体の外側に比較点qが位置する」という条件になる。 In the second condition determination stage shown in step S15, as shown in FIG. 14, “the comparison point q is 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 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.
この近似的な判定手法を採るのであれば、図17に示すとおり、
γ2/(D2・d2)<(1−k2/2)2 式(11)
という条件を満足するか否かを判定するための演算を行えばよい。ここで、
D2=(R2+G2+B2)
d2=(r2+g2+b2)、
γ=(R・r+G・g+B・b)
であるから、結局、ステップS15のブロック内に記載したように、
(R・r+G・g+B・b)2/
((R2+G2+B2)・(r2+g2+b2))
<(1−k2/2)2 式(11′)
という条件を満足するか否かを判定する演算を行えばよい。
If this approximate determination method is adopted, as shown in FIG.
γ 2 / (D 2 · d 2) <(1-
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の条件判定段階では、図18に示すように、「回転楕円体Eの外側に比較点qが位置する」という第3の条件を満足するか否かの判定が行われる。そのためには、ステップS17のブロック内に記載したように、
β2・x2+α2・y2−α2・β2>0 式(15)
という条件を満足するか否かを判定するための演算を行えばよい。ここで、各変数は、図19で説明したとおり、
α2=h2・D2、 β2=k2・D2 式(16)
x2=D2+γ2/D2−2γ 式(17)
y2=d2−γ2/D2 式(18)
であり、また、既に述べたとおり、
D2=(R2+G2+B2)
d2=(r2+g2+b2)
γ=(R・r+G・g+B・b)
である。
In the third condition determination stage shown in step S17, as shown in FIG. 18, 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 2 -α 2 · β 2 > 0 Formula (15)
An operation for determining whether or not the above condition is satisfied may be performed. Here, as explained 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.
要するに、この図20の流れ図に示す手順によれば、回転楕円体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. 20, 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)2および(1+h)2の値、ステップS15の演算式(11′)に用いる(1−k2/2)2の値は、予め決められた定数として用意しておくことができるので、演算負担を更に軽減することができる。実際には、まず、(R2+G2+B2)の値および(r2+g2+b2)の値を計算してしまえば、ステップS13の演算式(2′),(3′)に係る演算は、上記定数を利用した極めて単純な演算になる。同様に、ステップS15の演算式(11′)に係る演算も、(R・r+G・g+B・b)の値を計算してしまえば、既に計算済みの(R2+G2+B2)の値および(r2+g2+b2)の値と、上記定数を利用することにより、極めて単純な演算になる。
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-
<<< §4.本発明に係る移動物体検出装置の構成 >>>
ここでは、本発明に係る移動物体検出装置の構成を、図21のブロック図を参照しながら説明する。この装置は、与えられた動画画像について移動物体を検出する機能をもっており、図示のとおり、画像入力部110、原画像格納部120、平均画像作成部130、平均画像格納部140、画像比較部200、マスク画像格納部310、画像出力部320、パラメータ設定部330によって構成される。
<<< §4. Configuration of Moving Object Detection Device According to the Present Invention >>
Here, the configuration of the moving object detection device according to the present invention will be described with reference to the block diagram of FIG. This apparatus has a function of detecting a moving object for a given moving image, and as illustrated, an
画像入力部110は、時系列で連続的に与えられるフレーム単位のカラー原画像Pを、三原色の各画素値を有する画素の集合体データとして入力する構成要素であり、原画像格納部120は、こうして入力された原画像を逐次格納する構成要素である。一方、平均画像作成部130は、過去に入力された複数の原画像Pに基づいて、これら原画像の平均的な特徴を有する平均画像Aを逐次作成する構成要素であり、平均画像格納部140は、作成された平均画像Aを逐次格納する構成要素である。
The
これら各構成要素の具体的な処理機能については、既に§1で述べたとおりである。原画像格納部120や平均画像格納部140は、バッファメモリによって構成することができる。平均画像作成部130が、図3に示す方法で重みwをパラメータとして平均画像を逐次作成し、これを平均画像格納部140に格納してゆくようにすれば、原画像格納部120には、常に処理に必要な最新の原画像のみが格納されるようにし、平均画像格納部140には、常に処理に必要な最新の平均画像Aのみが格納されるようにすればよいので、バッファメモリの容量を節約することができる。
Specific processing functions of these components are as already described in §1. The original
画像比較部200は、原画像格納部120に格納された原画像Pと、平均画像格納部140に格納された平均画像Aとを比較し、前景領域Fと背景領域Bとを区別するマスク画像Mを作成する機能を果たす構成要素であり、図示のとおり、画素値読出部210、類否判定部220、画素値書込部230によって構成されている。
The
画素値読出部210は、比較対象となる一対の画像(すなわち、原画像格納部120に格納されている原画像Pと、平均画像格納部140に格納されている平均画像A)のうち、いずれか一方の画像の所定位置の画素の画素値を基準画素値(R,G,B)として読み出し、他方の画像の対応位置の画素の画素値を比較画素値(r,g,b)として読み出す処理を行う。
The pixel
既に述べたとおり、図8に示すモデルを採用する場合は、平均画像Aの画素の画素値を基準画素値(R,G,B)として読み出し、原画像Pの画素の画素値を比較画素値(r,g,b)として読み出すことになる。これに対して、図9に示すモデルを採用する場合は、逆に、原画像Pの画素の画素値を基準画素値(R,G,B)として読み出し、平均画像Aの画素の画素値を比較画素値(r,g,b)として読み出すことになる。既に§2で述べたとおり、実用上は、図9に示すモデルを採用するのが好ましい。 As described above, when the model shown in FIG. 8 is adopted, the pixel value of the pixel of the average image A is read as the reference pixel value (R, G, B), and the pixel value of the pixel of the original image P is compared with the comparison pixel value. It will be read out as (r, g, b). On the other hand, when the model shown in FIG. 9 is adopted, on the contrary, the pixel value of the pixel of the original image P is read as the reference pixel value (R, G, B), and the pixel value of the pixel of the average image A is The comparison pixel value (r, g, b) is read out. As already described in §2, in practice, it is preferable to adopt the model shown in FIG.
類否判定部220は、比較画素値(r,g,b)が、基準画素値(R,G,B)について設定された所定の類似範囲に入っているか否かを判定する処理を行う。具体的には、図10に示すように、三原色の各画素値を各座標軸にとった三次元座標系において、基準画素値(R,G,B)に対応する座標に位置する基準点Q(R,G,B)と比較画素値(r,g,b)に対応する座標に位置する比較点q(r,g,b)をとり、基準点Qを中心とする所定サイズの回転楕円体Eと比較点qとの位置関係を調べ、比較点qが回転楕円体Eもしくはその近似体の外部に位置すると判定できる場合には類似範囲外との判定を行い、内部に位置すると判定できる場合には類似範囲内との判定を行う。このとき、回転楕円体Eのサイズは、パラメータh,kを参照して決定される。
The
そして、画素値書込部230は、マスク画像Mを構成する所定位置(画素値読出部210の読出対象となった位置)の画素の画素値として、類否判定部220の判定結果に応じた値を定め、マスク画像格納部310に書き込む処理を行う。すなわち、類否判定部220が類似範囲内と判定した場合には背景領域Bを示す画素値(たとえば、「0」)を、類否判定部220が類似範囲外と判定した場合には前景領域Fを示す画素値(たとえば、「1」)を、それぞれマスク画像格納部310に書き込む処理を行う。
Then, the pixel
マスク画像格納部310は、こうして作成されたマスク画像Mを格納する構成要素であり、画像出力部320は、このマスク画像Mを出力する構成要素である。
The mask
一方、パラメータ設定部330は、平均画像作成部130による平均画像作成処理に利用されるパラメータw(図3に示す重みw)と、類否判定部220の類否判定処理に利用されるパラメータh,k(図10に示す長軸半径αおよび短軸半径βを決定するための値)とを、ユーザの操作入力によって任意の値に設定する機能を有する。ユーザは、必要に応じて、これらパラメータw,h,kの値を調整することにより、より精度の高い検出結果を得ることができる。もっとも、これらのパラメータの一部もしくは全部は、固定値にしておくことも可能である。全部のパラメータ値を固定値にする実施例では、パラメータ設定部330を設ける必要はない。
On the other hand, the
なお、実用上、この図21に示す移動物体検出装置は、コンピュータに専用のプログラムを組み込むことにより構築することができ、図21に各ブロックで示す構成要素は、コンピュータのハードウエアとソフトウエアとの組み合わせによって実現することができる。もちろん、この移動物体検出装置を半導体集積回路として構成することも可能である。 In practice, the moving object detection apparatus shown in FIG. 21 can be constructed by incorporating a dedicated program into the computer. The components shown in the blocks in FIG. 21 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.
図22は、図21に示す装置における類否判定部220の詳細構成を示すブロック図である。図示のとおり、この類否判定部220は、基本演算部221、第1の条件判定部222、第2の条件判定部223、第3の条件判定部224、判定値出力部225、パラメータ保持部226によって構成されている。
FIG. 22 is a block diagram showing a detailed configuration of the
パラメータ保持部226は、パラメータhおよびkの値を保持する構成要素であり、図21に示すパラメータ設定部330を設けた場合には、このパラメータ設定部330によって設定されたパラメータhおよびkの値がパラメータ保持部226に書き込まれることになる。パラメータhおよびkの値を固定にする場合には、当該固定値がパラメータ保持部226に保持される。
The
基本演算部221は、図21に示す画素値読出部210が読み出した基準画素値(R,G,B)および比較画素値(r,g,b)に基づいて、
D2=R2+G2+B2 および
d2=r2+g2+b2
なる演算を行い、値D2および値d2を算出する構成要素である。ここで算出された値D2および値d2は、第1の条件判定部222、第2の条件判定部223、第3の条件判定部224における演算で利用される。
Based on the reference pixel value (R, G, B) and the comparison pixel value (r, g, b) read by the pixel
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 values D 2 and d 2 calculated here are used in calculations in the first
第1の条件判定部222は、図12に示すように、「原点Oを中心とし半径(D−α)の球C1の内側に比較点qが位置する」もしくは「原点Oを中心とし半径(D+α)の球C2の外側に比較点qが位置する」という第1の条件を満足するか否かを判定する構成要素である。そのために、基本演算部221が算出した値D2および値d2とパラメータ保持部226に保持されているパラメータhの値とを用いて、
(1−h)2・D2>d2 式(2)
もしくは
(1+h)2・D2<d2 式(3)
という条件を満足するか否かを判定するための演算を行う。そして、「条件満足」との肯定的判定が行われた場合、当該判定結果は、判定値出力部225に報知される。一方、「条件満足せず」との否定的判定が行われた場合、当該判定結果は、第2の条件判定部223に報知される。
As shown in FIG. 12, the first
(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 is made that “condition is satisfied”, the determination result is notified to the determination
第2の条件判定部223は、第1の条件判定部222から、「条件満足せず」との否定的判定結果が報知された場合に限り、条件判定処理を実行する構成要素である。ここで行われる処理の目的は、図14に示すように、「原点Oを頂点、基準軸Zを中心軸とし、回転楕円体Eと円で接する円錐ξの外側に比較点qが位置する」という第2の条件を満足するか否かを判定することにある。ただ、実用上は、演算負担を軽減するために、円錐ξの代わりに円錐ξ′を用いた判定を行うようにするのが好ましい。
The second
すなわち、原点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, 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の条件判定部223は、図21に示す画素値読出部210が読み出した基準画素値(R,G,B)および比較画素値(r,g,b)に基づいて、
γ=R・r+G・g+B・b
なる演算を行い、値γを算出し、更に、基本演算部221が算出した値D2および値d2とパラメータ保持部226に保持されているパラメータkの値と、算出した値γとを用いて、
γ2/(D2・d2)<(1−k2/2)2 式(11)
という条件を満足するか否かを判定するための演算を行えばよい。結局、この式(11)の演算式で示される条件は、「原点Oを頂点、基準軸Zを中心軸とし、回転楕円体Eと円で接する円錐ξの近似体の外側に比較点qが位置する」という条件になる。
When such an approximate determination is performed, the second
γ = R · r + G · g + B · b
And the value γ is calculated, and the value D 2 and the value d 2 calculated by the
γ 2 / (D 2 · d 2) <(1-
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の条件判定部223において、「条件満足」との肯定的判定が行われた場合、当該判定結果は、判定値出力部225に報知される。一方、「条件満足せず」との否定的判定が行われた場合、当該判定結果は、γの値とともに、第3の条件判定部224に報知される。
When the second
第3の条件判定部224は、第2の条件判定部223から、「条件満足せず」との否定的判定結果が報知された場合に限り、条件判定処理を実行する構成要素である。ここで行われる処理の目的は、図18に示すように、「回転楕円体Eの外側に比較点qが位置する」という第3の条件を満足するか否かを判定することにある。そのため、第3の条件判定部224は、基本演算部221が算出した値D2および値d2と、パラメータ保持部226に保持されているパラメータhおよびkの値と、第2の条件判定部223が算出した値γとを用いて、
α2=h2・D2、 β2=k2・D2 式(16)
x2=D2+γ2/D2−2γ 式(17)
y2=d2−γ2/D2 式(18)
なる演算を行い、当該演算結果を用いて、
β2・x2+α2・y2−α2・β2>0 式(15)
という条件を満足するか否かを判定するための演算を行う。
The third condition determination unit 224 is a component that executes the condition determination process only when the second
α 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 2 -α 2 · β 2 > 0 Formula (15)
An operation for determining whether or not the condition is satisfied is performed.
そして、この第3の条件判定部224における「条件満足」との肯定的判定結果もしくは「条件満足せず」との否定的判定結果は、判定値出力部225に報知される。
Then, an affirmative determination result of “condition satisfaction” or a negative determination result of “condition not satisfied” in the third condition determination unit 224 is notified to the determination
判定値出力部225は、第1の条件判定部222、第2の条件判定部223、第3の条件判定部224のいずれかが「条件満足」との肯定的判定を行った場合に、類似範囲外との判定結果を示す判定値(たとえば「1」)を出力し、第1の条件判定部222、第2の条件判定部223、第3の条件判定部224のすべてが「条件満足せず」との否定的判定を行った場合に、類似範囲内との判定結果を示す判定値(たとえば「0」)を出力する。これらの判定値は、図21に示すように、画素値書込部230によって、マスク画像格納部310内のマスク画像Mの画素値として書き込まれる。
The determination
既に述べたとおり、上記条件判定式には、加減乗除演算のみしか含まれていないため、一般的な幾何学演算に必要とされる開平演算や三角関数演算を行う必要はない。したがって、演算装置の負担は比較的軽いものになり、類似判定部220を安価なプロセッサを用いて構成した場合でも、リアルタイム処理が可能になる。
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
<<< §5.変形例 >>>
以上、本発明を基本的な実施形態に基づいて説明したが、最後に、本発明の変形例をいくつか述べておく。
<<< §5. Modified example >>>
Although the present invention has been described based on the basic embodiment, finally, some modifications of the present invention will be described.
まず、これまで述べた条件判定式には、「不等号>」や「不等号<」を含む演算式が含まれているが、これらの演算式の一部もしくは全部について、「不等号>」の代わりに「不等号≧」を用いた演算式、もしくは「不等号<」の代わりに「不等号≦」を用いた演算式を用いてもかまわない。すなわち、各条件判定式は、比較点qが何らかの図形の内側領域にあるか外側領域にあるかを示すものであるが、当該図形の境界面上の点は、当該図形の内側領域に含ませても、外側領域に含ませてもかまわない。 First of all, the condition judgment expressions described so far include arithmetic expressions including “inequality sign>” and “inequality 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.
110:画像入力部
120:原画像格納部
130:平均画像作成部
140:平均画像格納部
200:画像比較部
210:画素値読出部
220:類否判定部
221:基本演算部
222:第1の条件判定部
223:第2の条件判定部
224:第3の条件判定部
225:判定値出力部
226:パラメータ保持部
230:画素値書込部
310:マスク画像格納部
320:画像出力部
330:パラメータ設定部
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の長軸半径αを定めるパラメータ
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との距離
V:基準画素値を示すベクトル
Va:平均画像の画素値を示すベクトル
Vp:原画像の画素値を示すベクトル
w:重みを示すパラメータ
X:座標軸
x:楕円方程式の変数
Y:座標軸
y:楕円方程式の変数
Z,Za,Zp:基準軸
α:回転楕円体Eの長軸半径
β:回転楕円体Eの短軸半径
γ:演算値
δ:座標点間の距離
θ:角度
ξ,ξ′:円錐
φ,φ′:円錐の半頂角
110: Image input unit 120: Original image storage unit 130: Average image creation unit 140: Average image storage unit 200: Image comparison unit 210: Pixel value reading unit 220: Similarity determination unit 221: Basic calculation unit 222: First Condition determination unit 223: second condition determination unit 224: third condition determination unit 225: determination value output unit 226: parameter holding unit 230: pixel value writing unit 310: mask image storage unit 320: image output unit 330: Parameter setting unit A (1) to A (i): average image (background image)
A, A (Ra, Ga, Ba): A coordinate point indicating the pixel value of the average image a: One side a (i-1) of a triangle, a (i): Pixel value B of one pixel constituting the average image B: Background area / pixel values of the three primary colors (reference pixel values)
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 k: Parameter for determining the minor axis radius β of the spheroid E: Length La of the cylinder C La1: Length La2 of the spheroid Ea in the major axis direction: Length in the minor axis direction of the spheroid Ea Lp1: Length in the major axis direction of the spheroid Ep: Lp2: 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: Original image / original image Coordinate points P (1) to P (i), P (i + 1), P10 to P40 indicating pixel values: original image (input image)
P (Rp, Gp, Bp): Coordinate point p (i) indicating the pixel value of the original image Q: Pixel value of one pixel constituting the original image Q: Reference point (with 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: distance between reference point Q and comparison point q: vector Va indicating reference pixel value Va: vector Vp indicating average image pixel value Vp: vector indicating pixel value of original image w: parameter indicating weight X: coordinate axis x : Variable Y of elliptic equation Y: Coordinate axis y: Variable Z, Za, Zp of elliptic equation: Reference axis α: Long axis radius of spheroid E β: Short axis radius γ of spheroid E: Calculated value δ: Coordinate point Distance θ: Angle ξ, ξ ′: Cone φ, φ ′: Half apex angle of cone
Claims (22)
時系列で連続的に与えられるフレーム単位のカラー原画像を、三原色の各画素値を有する画素の集合体データとして入力する画像入力部と、
入力された原画像を逐次格納する原画像格納部と、
過去に入力された複数の原画像に基づいて、これら原画像の平均的な特徴を有する平均画像を逐次作成する平均画像作成部と、
作成された平均画像を逐次格納する平均画像格納部と、
前記原画像格納部に格納された原画像と、前記平均画像格納部に格納された平均画像とを比較し、前景領域と背景領域とを区別するマスク画像を作成する画像比較部と、
前記マスク画像を格納するマスク画像格納部と、
前記マスク画像を出力する画像出力部と、
を備え、
前記画像比較部は、
比較対象となる一方の画像の所定位置の画素の画素値を基準画素値として読み出し、比較対象となる他方の画像の前記所定位置の画素の画素値を比較画素値として読み出す画素値読出部と、
前記比較画素値が、前記基準画素値について設定された所定の類似範囲に入っているか否かを判定する類否判定部と、
前記マスク画像を構成する前記所定位置の画素の画素値として、前記類否判定部が類似範囲内と判定した場合には背景領域を示す画素値を、前記類否判定部が類似範囲外と判定した場合には前景領域を示す画素値を、それぞれ前記マスク画像格納部に書き込む画素値書込部と、
を有し、
前記類否判定部が、前記三原色の各画素値を各座標軸にとった三次元座標系において、前記基準画素値に対応する座標に位置する基準点Qと前記比較画素値に対応する座標に位置する比較点qをとり、前記基準点Qを中心とする所定サイズの回転楕円体Eと前記比較点qとの位置関係を調べ、前記比較点qが前記回転楕円体Eもしくはその近似体の外部に位置すると判定できる場合には類似範囲外との判定を行い、内部に位置すると判定できる場合には類似範囲内との判定を行い、
かつ、前記類否判定部が、前記三次元座標系の原点Oと前記基準点Qとの距離Dに、所定のパラメータh(但し、h<1)を乗じて求まる値α=h・Dを長軸半径とし、所定のパラメータk(但し、k<h)を乗じて求まる値β=k・Dを短軸半径とする楕円を、前記原点Oと前記基準点Qとを結ぶ基準軸Z上に長軸が重なるように、かつ、前記基準点Qが中心点となるように配置し、前記基準軸Zを中心に回転させることにより回転楕円体Eを定義することを特徴とする移動物体検出装置。 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;
Based on a plurality of original images input in the past, an average image creation unit that sequentially creates an average image having average characteristics of these original images;
An average image storage unit for sequentially storing the created average images;
An image comparison unit that compares the original image stored in the original image storage unit with the average image stored in the average image storage unit and creates a mask image that distinguishes a foreground region and a background region;
A mask image storage for storing the mask image;
An image output unit for outputting the mask image;
With
The image comparison unit
A pixel value reading unit that reads a pixel value of a pixel at a predetermined position of one image to be compared as a reference pixel value, and reads a pixel value of the pixel at the predetermined position of the other image to be compared as a comparison pixel value;
A similarity determination unit that determines whether or not the comparison pixel value is within a predetermined similar range set for the reference pixel value;
When the similarity determination unit determines that the pixel value of the pixel at the predetermined position constituting the mask image is within the similar range, the pixel value indicating the background area is determined to be out of the similarity range. A pixel value writing unit that writes a pixel value indicating a foreground region to the mask image storage unit, respectively,
Have
In the three-dimensional coordinate system in which the similarity determination unit takes each pixel value of the three primary colors on each coordinate axis, the reference point Q located at the coordinate corresponding to the reference pixel value and the coordinate corresponding to the comparison pixel value The comparison point q is taken, the positional relationship between the spheroid E having a predetermined size centered on the reference point Q and the comparison point q is examined, and the comparison point q is outside the spheroid E or its approximate body. If it can be determined that it is located in, it is determined that it is outside the similar range, and if it can be determined that it is located inside, it is determined that it is within the similar range ,
The similarity determination unit multiplies 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) to obtain a value α = h · D. On the reference axis Z connecting the origin O and the reference point Q, an ellipse having a long axis radius and a value β = k · D obtained by multiplying a predetermined parameter k (where k <h) is the short axis radius The moving object detection is characterized in that the ellipsoid E is defined by rotating around the reference axis Z so that the long axis and the reference point Q become the center point. apparatus.
平均画像作成部が、
第i番目の原画像P(i)が入力されたときに(i=1,2,...)、当該原画像P(i)を含めた過去の原画像について、それぞれ対応する位置の画素の各色別の画素値の重みづけ平均値を算出し、当該平均値をもつ画素の集合体からなる第i番目の平均画像A(i)を作成し、
画像比較部が、第(i+1)番目の原画像P(i+1)が入力されたときに、当該原画像P(i+1)と、第i番目の平均画像A(i)とを比較し、第(i+1)番目のマスク画像M(i+1)を作成することを特徴とする移動物体検出装置。 The moving object detection device according to claim 1,
The average image creation unit
When the i-th original image P (i) is input (i = 1, 2,...), Pixels at corresponding positions in the past original image including the original image P (i) To calculate a weighted average value of pixel values for each color, and create an i-th average image A (i) composed of a collection of pixels having the average value,
When the (i + 1) -th original image P (i + 1) is input, the image comparison unit compares the original image P (i + 1) with the i-th average image A (i), i + 1) A moving object detection apparatus for generating a mask image M (i + 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 2,
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
類否判定部が、
「原点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の条件判定部のすべてが否定的判定を行った場合に、類似範囲内との判定結果を示す判定値を出力する判定値出力部と、
を有することを特徴とする移動物体検出装置。 In the moving object detection apparatus in any one of Claims 1-3 ,
The similarity determination unit
“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 apex 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 that is not in the similar range is output. When a negative determination is made by all of the first condition determination unit, the second condition determination unit, and the third condition determination unit, a determination value indicating a determination result within the similar range is output. A judgment value output unit;
A moving object detection apparatus comprising:
原点Oと基準点Qとの距離をD、原点Oと比較点qとの距離をdとしたときに、
第1の条件判定部が、
(1−h)2・D2>d2 もしくは
(1+h)2・D2<d2
という条件を満足するか否かを判定するための演算を行うことを特徴とする移動物体検出装置。 The moving object detection device according to claim 4 ,
When the distance between the origin O and the reference point Q is D, and the distance between the origin O and the comparison point q is d,
The first condition determination unit
(1-h) 2 · D 2 > d 2 or
(1 + h) 2 · D 2 <d 2
A moving object detection device that performs an operation for determining whether or not the condition is satisfied.
第2の条件判定部が、原点Oを中心とする半径Dの球面C3と回転楕円体Eとの交線を構成する円を交線円Sとしたときに、「原点Oを頂点、基準軸Zを中心軸とし、前記交線円Sを通る円錐ξ′の外側に比較点qが位置する」という第2の条件を満足するか否かを判定することを特徴とする移動物体検出装置。 The moving object detection device according to claim 4 ,
When the second condition determination unit determines that the circle constituting the intersection line of the spherical surface C3 having the radius D centered on the origin O and the spheroid E is the intersection line S, “the origin O is the vertex, the reference axis A moving object detecting apparatus, wherein whether or not a second condition that a comparison point q is located outside a cone ξ ′ passing through the circle of intersection S with Z as a central axis is satisfied is determined.
第2の条件判定部が、交線円S上の任意の点と基準点Qとの距離fが短軸半径βに等しいとおいた近似式を用いて近似的な判定を行うことを特徴とする移動物体検出装置。 The moving object detection device according to claim 6 ,
The second condition determination unit performs an approximate determination using an approximate expression in which a distance f between an arbitrary point on the intersection circle S and the reference point Q is equal to the minor axis radius β. Moving object detection device.
基準点Qの座標を示す基準画素値を(R,G,B)、比較点qの座標を示す比較画素値を(r,g,b)、原点Oと基準点Qとの距離をD、原点Oと比較点qとの距離をdとしたときに、
第2の条件判定部が、
γ=(R・r+G・g+B・b)
として、
γ2/(D2・d2)<(1−k2/2)2
という条件を満足するか否かを判定するための演算を行うことを特徴とする移動物体検出装置。 The moving object detection device according to claim 7 ,
The reference pixel value indicating the coordinates of the reference point Q is (R, G, B), the comparison pixel value indicating the coordinates of the comparison point q is (r, g, b), the distance between the origin O and the reference point Q is D, When the distance between the origin O and the comparison point q is d,
The second condition determination unit
γ = (R · r + G · g + B · b)
As
γ 2 / (D 2 · d 2) <(1-k 2/2) 2
A moving object detection device that performs an operation for determining whether or not the condition is satisfied.
基準点Qの座標を示す基準画素値を(R,G,B)、比較点qの座標を示す比較画素値を(r,g,b)、原点Oと基準点Qとの距離をD、原点Oと比較点qとの距離をdとしたときに、
第3の条件判定部が、
α2=h2・D2
β2=k2・D2
x2=D2+γ2/D2−2γ
y2=d2−γ2/D2
γ=(R・r+G・g+B・b)
として、
β2・x2+α2・y2−α2・β2>0
という条件を満足するか否かを判定するための演算を行うことを特徴とする移動物体検出装置。 The moving object detection device according to claim 4 ,
The reference pixel value indicating the coordinates of the reference point Q is (R, G, B), the comparison pixel value indicating the coordinates of the comparison point q is (r, g, b), the distance between the origin O and the reference point Q is D, When the distance between the origin O and the comparison point q is d,
The third condition determination unit
α 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
γ = (R · r + G · g + B · b)
As
β 2 · x 2 + α 2 · y 2 -α 2 · β 2 > 0
A moving object detection device that performs an operation for determining whether or not the condition is satisfied.
類否判定部が、
パラメータhおよびkの値を保持するパラメータ保持部と、
画素値読出部が読み出した基準画素値(R,G,B)および比較画素値(r,g,b)に基づいて、
D2=R2+G2+B2 および
d2=r2+g2+b2
なる演算を行い、値D2および値d2を算出する基本演算部と、
前記基本演算部が算出した値D2および値d2と前記パラメータ保持部に保持されているパラメータhの値とを用いて、
(1−h)2・D2>d2 もしくは
(1+h)2・D2<d2
という条件を満足するか否かを判定するための演算を行う第1の条件判定部と、
前記第1の条件判定部が否定的判定を行った場合に、画素値読出部が読み出した基準画素値(R,G,B)および比較画素値(r,g,b)に基づいて、
γ=R・r+G・g+B・b
なる演算を行い、値γを算出し、前記基本演算部が算出した値D2および値d2と前記パラメータ保持部に保持されているパラメータkの値と前記値γとを用いて、
γ2/(D2・d2)<(1−k2/2)2
という条件を満足するか否かを判定するための演算を行う第2の条件判定部と、
前記第2の条件判定部が否定的判定を行った場合に、前記基本演算部が算出した値D2および値d2と前記パラメータ保持部に保持されているパラメータhおよびkの値と前記第2の条件判定部が算出した前記値γとを用いて、
α2=h2・D2
β2=k2・D2
x2=D2+γ2/D2−2γ
y2=d2−γ2/D2
なる演算を行い、当該演算結果を用いて、
β2・x2+α2・y2−α2・β2>0
という条件を満足するか否かを判定するための演算を行う第3の条件判定部と、
前記第1の条件判定部、前記第2の条件判定部、前記第3の条件判定部のいずれかが肯定的判定を行った場合に、類似範囲外との判定結果を示す判定値を出力し、前記第1の条件判定部、前記第2の条件判定部、前記第3の条件判定部のすべてが否定的判定を行った場合に、類似範囲内との判定結果を示す判定値を出力する判定値出力部と、
を有することを特徴とする移動物体検出装置。 In the moving object detection apparatus in any one of Claims 1-3 ,
The similarity determination unit
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 2 -α 2 · β 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 that is not in the similar range is output. When a negative determination is made by all of the first condition determination unit, the second condition determination unit, and the third condition determination unit, a determination value indicating a determination result within the similar range is output. A judgment value output unit;
A moving object detection apparatus comprising:
不等号を含む演算式の一部もしくは全部について、「不等号>」の代わりに「不等号≧」を用いた演算式、もしくは「不等号<」の代わりに「不等号≦」を用いた演算式を用いることを特徴とする移動物体検出装置。 In the moving object detection apparatus in any one of Claim 5, 8-10 ,
For some or all of the arithmetic expressions including the inequality sign, use an arithmetic expression using the inequality sign ≧ in place of the inequality sign>, or an arithmetic expression using the inequality sign ≦ in place of the inequality sign <. A moving object detection device.
パラメータ「w」もしくは「hおよびk」またはこれら全てを、ユーザの操作入力によって任意の値に設定するパラメータ設定部を更に備えることを特徴とする移動物体検出装置。 In the moving object detection apparatus in any one of Claims 1-11 ,
A moving object detection apparatus further comprising a parameter setting unit that sets parameters “w” or “h and k” or all of them to an arbitrary value by a user operation input.
画素値読出部が、原画像の画素の画素値を基準画素値として読み出し、平均画像の画素の画素値を比較画素値として読み出すことを特徴とする移動物体検出装置。 In the moving object detection apparatus in any one of Claims 1-12 ,
A moving object detection device, wherein a pixel value reading unit reads a pixel value of a pixel of an original image as a reference pixel value, and reads a pixel value of a pixel of an average image as a comparison pixel value.
コンピュータが、画素値(R,G,B)および(r,g,b)の値を取り込む準備段階と、
コンピュータが、三原色の各画素値を各座標軸にとった三次元座標系において、前記画素値(R,G,B)に対応する座標をもつ基準点Qを中心とする所定サイズの回転楕円体Eもしくはその近似体と、前記画素値(r,g,b)に対応する座標をもつ比較点qとについて、後者が前者の内部にあるか外部にあるかを調べる位置関係判定段階と、
コンピュータが、前記回転楕円体Eもしくはその近似体の外部に前記比較点qがあると判断した場合には、前記第1のカラー画素と前記第2のカラー画素とが非類似との判定結果を出力し、前記回転楕円体Eもしくはその近似体の内部に前記比較点qがあると判断した場合には、前記第1のカラー画素と前記第2のカラー画素とが類似するとの判定結果を出力する判定結果出力段階と、
を有し、
前記位置関係判定段階では、前記三次元座標系の原点Oと前記基準点Qとの距離Dに、所定のパラメータh(但し、h<1)を乗じて求まる値α=h・Dを長軸半径とし、所定のパラメータk(但し、k<h)を乗じて求まる値β=k・Dを短軸半径とする楕円を、前記原点Oと前記基準点Qとを結ぶ基準軸Z上に長軸が重なるように、かつ、前記基準点Qが中心点となるように配置し、前記基準軸Zを中心に回転させることにより得られる回転楕円体Eを定義することを特徴とする画素の類否判定方法。 A method for determining similarity between a first color pixel having each pixel value (R, G, B) of the three primary colors and a second color pixel having each pixel value (r, g, b) of the three primary colors. There,
A preparatory stage in which a computer captures values of pixel values (R, G, B) and (r, g, b);
In a three-dimensional coordinate system in which the computer takes the pixel values of the three primary colors as the coordinate axes, a spheroid E having a predetermined size centered on a reference point Q having coordinates corresponding to the pixel values (R, G, B). Alternatively, with respect to the approximate body and the comparison point q having coordinates corresponding to the pixel value (r, g, b), a positional relationship determination step for checking whether the latter is inside or outside the former,
When the computer determines that the comparison point q is outside the spheroid E or its approximate body, the determination result is that the first color pixel and the second color pixel are dissimilar. And when it is determined that the comparison point q is inside the spheroid E or its approximated body, a determination result that the first color pixel and the second color pixel are similar is output. A judgment result output stage to perform,
Have
In the positional relationship determination step, a value α = h · D obtained by multiplying a 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 a long axis. An ellipse having a radius β and a short axis radius of a value β = k · D obtained by multiplying by a predetermined parameter k (where k <h) is long on a reference axis Z connecting the origin O and the reference point Q. A class of pixels characterized by defining a spheroid E that is arranged such that the axes overlap and the reference point Q is the center point and is rotated about the reference axis Z. Negation method.
位置関係判定段階が、
「原点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のカラー画素とが非類似との判定結果を出力し、前記第1の条件判定段階、前記第2の条件判定段階、前記第3の条件判定段階のすべてにおいて否定的判定がなされた場合には、前記第1のカラー画素と前記第2のカラー画素とが類似するとの判定結果を出力することを特徴とする画素の類否判定方法。 The method of determining similarity of pixels according to claim 16 .
The positional relationship determination stage
“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 determination stage for determining whether or not a first condition is satisfied;
When a negative determination is made in the first condition determination step, “a comparison point outside the cone ξ or its approximated body that touches the spheroid E with a circle with the origin O as the apex and the reference axis Z as the central axis. a second condition determining step for determining whether or not a second condition that “q is located” is satisfied;
The third condition for determining whether or not the third condition “the comparison point q is located outside the spheroid E” is satisfied when a negative determination is made in the second condition determination step. A judgment stage;
Have
In the determination result output stage, when an affirmative determination is made in any of the first condition determination stage, the second condition determination stage, and the third condition determination stage, the first color pixel and A determination result that the second color pixel is dissimilar is output, and a negative determination is made in all of the first condition determination step, the second condition determination step, and the third condition determination step. In this case, the pixel similarity determination method outputs a determination result that the first color pixel and the second color pixel are similar.
第1の条件判定段階で、
D2=(R2+G2+B2)
d2=(r2+g2+b2)
としたときに、
(1−h)2・D2>d2 もしくは
(1+h)2・D2<d2
という条件を満足するか否かを判定するための演算を行うことを特徴とする画素の類否判定方法。 The pixel similarity determination method according to claim 17 ,
In the first condition determination stage,
D 2 = (R 2 + G 2 + B 2 )
d 2 = (r 2 + g 2 + b 2 )
And when
(1-h) 2 · D 2 > d 2 or
(1 + h) 2 · D 2 <d 2
A pixel similarity determination method characterized by performing an operation for determining whether or not the above condition is satisfied.
第2の条件判定段階で、
D2=(R2+G2+B2)
d2=(r2+g2+b2)、
γ=(R・r+G・g+B・b)
としたときに、
γ2/(D2・d2)<(1−k2/2)2
という条件を満足するか否かを判定するための演算を行うことを特徴とする画素の類否判定方法。 The pixel similarity determination method according to claim 17 ,
In the second condition determination stage,
D 2 = (R 2 + G 2 + B 2 )
d 2 = (r 2 + g 2 + b 2 ),
γ = (R · r + G · g + B · b)
And when
γ 2 / (D 2 · d 2) <(1-k 2/2) 2
A pixel similarity determination method characterized by performing an operation for determining whether or not the above condition is satisfied.
第3の条件判定段階で、
α2=h2・D2
β2=k2・D2
x2=D2+γ2/D2−2γ
y2=d2−γ2/D2
D2=(R2+G2+B2)
d2=(r2+g2+b2)
γ=(R・r+G・g+B・b)
としたときに、
β2・x2+α2・y2−α2・β2>0
という条件を満足するか否かを判定するための演算を行うことを特徴とする画素の類否判定方法。 The pixel similarity determination method according to claim 17 ,
In the third condition determination stage,
α 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
D 2 = (R 2 + G 2 + B 2 )
d 2 = (r 2 + g 2 + b 2 )
γ = (R · r + G · g + B · b)
And when
β 2 · x 2 + α 2 · y 2 -α 2 · β 2 > 0
A pixel similarity determination method characterized by performing an operation for determining whether or not the above condition is satisfied.
コンピュータが、パラメータh(h<1)およびk(k<h)、画素値(R,G,B)および(r,g,b)の値を取り込む準備段階と、
コンピュータが、
(1−h)2・(R2+G2+B2)>(r2+g2+b2) もしくは
(1+h)2・(R2+G2+B2)<(r2+g2+b2)
という条件を満足するか否かを判定する第1の条件判定段階と、
前記第1の条件判定段階において否定的判定がなされた場合に、コンピュータが、
(R・r+G・g+B・b)2/
((R2+G2+B2)・(r2+g2+b2))
<(1−k2/2)2
という条件を満足するか否かを判定する第2の条件判定段階と、
前記第2の条件判定段階において否定的判定がなされた場合に、コンピュータが、
β2・x2+α2・y2−α2・β2>0
但し、α2=h2・D2
β2=k2・D2
x2=D2+γ2/D2−2γ
y2=d2−γ2/D2
D2=(R2+G2+B2)
d2=(r2+g2+b2)
γ=(R・r+G・g+B・b)
という条件を満足するか否かを判定する第3の条件判定段階と、
コンピュータが、前記第1の条件判定段階、前記第2の条件判定段階、前記第3の条件判定段階のいずれかにおいて肯定的判定がなされた場合には、前記第1のカラー画素と前記第2のカラー画素とが非類似との判定結果を出力し、前記第1の条件判定段階、前記第2の条件判定段階、前記第3の条件判定段階のすべてにおいて否定的判定がなされた場合には、前記第1のカラー画素と前記第2のカラー画素とが類似するとの判定結果を出力する判定結果出力段階と、
を有することを特徴とする画素の類否判定方法。 A method for determining similarity between a first color pixel having each pixel value (R, G, B) of the three primary colors and a second color pixel having each pixel value (r, g, b) of the three primary colors. There,
A preparatory stage in which a computer captures values of parameters h (h <1) and k (k <h), pixel values (R, G, B) and (r, g, b);
Computer
(1-h) 2 · (R 2 + G 2 + B 2 )> (r 2 + g 2 + b 2 ) or (1 + h) 2 · (R 2 + G 2 + B 2 ) <(r 2 + g 2 + b 2 )
A first condition determination stage for determining whether or not the condition is satisfied,
When a negative determination is made in the first condition determination step, the computer
(R · r + G · g + B · b) 2 /
((R 2 + G 2 + B 2 ) · (r 2 + g 2 + b 2 ))
<(1-k 2/2 ) 2
A second condition determination stage for determining whether or not the condition is satisfied,
When a negative determination is made in the second condition determination step, the computer
β 2 · x 2 + α 2 · y 2 -α 2 · β 2 > 0
However, α 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
D 2 = (R 2 + G 2 + B 2 )
d 2 = (r 2 + g 2 + b 2 )
γ = (R · r + G · g + B · b)
A third condition determination stage for determining whether or not the condition is satisfied;
If the computer makes a positive determination in any of the first condition determination stage, the second condition determination stage, and the third condition determination stage, the first color pixel and the second color pixel When the determination result that the color pixel is dissimilar is output, and negative determination is made in all of the first condition determination stage, the second condition determination stage, and the third condition determination stage, A determination result output step for outputting a determination result that the first color pixel is similar to the second color pixel;
A method for determining similarity of pixels.
不等号を含む演算式の一部もしくは全部について、「不等号>」の代わりに「不等号≧」を用いた演算式、もしくは「不等号<」の代わりに「不等号≦」を用いた演算式を用いることを特徴とする画素の類否判定方法。 In the pixel similarity determination method according to any one of claims 18 to 21 ,
For some or all of the arithmetic expressions including the inequality sign, use an arithmetic expression using the inequality sign ≧ in place of the inequality sign>, or an arithmetic expression using the inequality sign ≦ in place of the inequality sign <. A feature similarity determination method.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2009226146A JP5391970B2 (en) | 2009-09-30 | 2009-09-30 | Moving object detection device and pixel similarity determination method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2009226146A JP5391970B2 (en) | 2009-09-30 | 2009-09-30 | Moving object detection device and pixel similarity determination method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2011076311A JP2011076311A (en) | 2011-04-14 |
| JP5391970B2 true JP5391970B2 (en) | 2014-01-15 |
Family
ID=44020235
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2009226146A Active JP5391970B2 (en) | 2009-09-30 | 2009-09-30 | Moving object detection device and pixel similarity determination method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP5391970B2 (en) |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP6076623B2 (en) * | 2012-06-06 | 2017-02-08 | 株式会社メガチップス | Moving body detection apparatus, moving body detection method, and program |
| JP5519085B1 (en) * | 2012-07-20 | 2014-06-11 | パナソニック株式会社 | Moving image generating apparatus and moving image generating method |
| JP5962297B2 (en) * | 2012-07-25 | 2016-08-03 | 大日本印刷株式会社 | Camera field of view detection device |
| JP7646466B2 (en) * | 2021-06-10 | 2025-03-17 | Eneos株式会社 | Monitoring device, monitoring system, and monitoring method |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS60217353A (en) * | 1984-04-13 | 1985-10-30 | Fuji Photo Film Co Ltd | Detection for flesh color |
| JP2001155163A (en) * | 1999-11-26 | 2001-06-08 | Ntt Communications Kk | Moving object extraction device |
| JP2009031939A (en) * | 2007-07-25 | 2009-02-12 | Advanced Telecommunication Research Institute International | Image processing apparatus, image processing method, and image processing program |
-
2009
- 2009-09-30 JP JP2009226146A patent/JP5391970B2/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| JP2011076311A (en) | 2011-04-14 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110688925B (en) | Cascade target identification method and system based on deep learning | |
| WO2022078041A1 (en) | Occlusion detection model training method and facial image beautification method | |
| Micusik et al. | Descriptor free visual indoor localization with line segments | |
| CN113901961A (en) | Parking space detection method, device, equipment and storage medium | |
| WO2020107326A1 (en) | Lane line detection method, device and computer readale storage medium | |
| EP1969562A1 (en) | Edge-guided morphological closing in segmentation of video sequences | |
| EP1969559A1 (en) | Contour finding in segmentation of video sequences | |
| US20230290061A1 (en) | Efficient texture mapping of a 3-d mesh | |
| CN109003307B (en) | Size design method of fishing nets based on underwater binocular vision measurement | |
| JP5391970B2 (en) | Moving object detection device and pixel similarity determination method | |
| CN102074000B (en) | Tracking method for adaptively adjusting window width by utilizing optimal solution of variance rate | |
| CN116721288A (en) | A safety helmet detection method and system based on YOLOv5 | |
| CN118379696A (en) | Ship target detection method, device and readable storage medium | |
| CN114677439A (en) | Camera pose determination method and device, electronic equipment and storage medium | |
| CN104539942B (en) | Video shot switching detection method and device based on frame difference clustering | |
| JP5736831B2 (en) | Sunlight change region detection device and moving object detection device | |
| Yang et al. | A light CNN based method for hand detection and orientation estimation | |
| CN114549825A (en) | Target detection method and device, electronic equipment and storage medium | |
| CN113033593B (en) | Text detection training method and device based on deep learning | |
| JP5630298B2 (en) | Moving object detection device | |
| KR20140138046A (en) | Method and device for processing a picture | |
| CN113435367A (en) | Social distance evaluation method and device and storage medium | |
| CN119151780A (en) | Multi-camera image stitching method and system | |
| CN117315287B (en) | Object edge detection method and device based on instance segmentation model | |
| CN112435280A (en) | Moving target detection and tracking method for unmanned aerial vehicle video |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20120727 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20130515 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20130521 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20130722 |
|
| 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: 20130917 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130930 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 5391970 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |