JP2015008412A - Moving body image extraction method and moving body image extraction device - Google Patents

Moving body image extraction method and moving body image extraction device Download PDF

Info

Publication number
JP2015008412A
JP2015008412A JP2013132969A JP2013132969A JP2015008412A JP 2015008412 A JP2015008412 A JP 2015008412A JP 2013132969 A JP2013132969 A JP 2013132969A JP 2013132969 A JP2013132969 A JP 2013132969A JP 2015008412 A JP2015008412 A JP 2015008412A
Authority
JP
Japan
Prior art keywords
moving object
image
difference
background image
pixel
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.)
Granted
Application number
JP2013132969A
Other languages
Japanese (ja)
Other versions
JP6246508B2 (en
Inventor
亨 米澤
Toru Yonezawa
亨 米澤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Glory Ltd
Original Assignee
Glory Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Glory Ltd filed Critical Glory Ltd
Priority to JP2013132969A priority Critical patent/JP6246508B2/en
Publication of JP2015008412A publication Critical patent/JP2015008412A/en
Application granted granted Critical
Publication of JP6246508B2 publication Critical patent/JP6246508B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To automatically set a threshold for determining a background image required for moving body detection, and extraction of a moving body, from an image depending on a change in the imaging environment.SOLUTION: On the basis of a plurality of images capturing a monitored area, a background image having an average luminance value and the degree of variation of luminance is generated for each pixel, the luminance of each pixel of the background image is compared with the luminance of a pixel corresponding to the same position of the input image, and then a moving body is extracted with a predetermined multiple of a coefficient of variation, which each pixel of the background has, as a threshold. Since a background image sequentially and automatically reflecting a change of the background image due to environmental change, e.g., sunshine, is updated and set every time when an input image for extracting a moving body image is inputted, an appropriate threshold is set without requiring any human labor, even if the imaging environment changes, thereby extracting a moving body image efficiently.

Description

この発明は、公共交通機関、交差点又は建造物などに設置された監視カメラで撮像された監視カメラ映像データに含まれる動体を効率的に検出し、動体の画像データを抽出することができる動体画像抽出方法及び動体画像抽出装置に関する。   The present invention can efficiently detect a moving object included in surveillance camera video data captured by a monitoring camera installed in public transportation, an intersection, a building, or the like, and extract moving object image data. The present invention relates to an extraction method and a moving image extraction apparatus.

従来、公共交通機関、交差点又は建造物などに監視カメラを設置し、この監視カメラで撮像された画像に含まれる人物や車両等の動体を検出する技術が知られている。例えば、特許文献1には、あらかじめ正常時の背景画像を撮像しておき、この背景画像と入力画像の画素ごとの差分が所定の閾値を超える場合に、異常が発生したものと判定する技術が開示されている。このため、この特許文献1に係る技術を動体検知に適用すると、あらかじめ動体が存在しない背景画像を事前に登録しておき、監視カメラで撮像された入力画像と背景画像の差分となる画素の画素値が所定の閾値を超えている場合に、かかる差分を動体として抽出することができる。   2. Description of the Related Art Conventionally, a technique is known in which surveillance cameras are installed at public transportation, intersections, buildings, and the like, and moving objects such as persons and vehicles included in images captured by the surveillance cameras are detected. For example, Patent Document 1 discloses a technique for capturing a normal background image in advance and determining that an abnormality has occurred when the difference between the background image and the input image for each pixel exceeds a predetermined threshold. It is disclosed. For this reason, when the technique according to Patent Document 1 is applied to moving object detection, a background image that does not have a moving object is registered in advance, and a pixel that is a difference between the input image captured by the monitoring camera and the background image When the value exceeds a predetermined threshold, such a difference can be extracted as a moving object.

ところが、上記特許文献1のものは、撮像環境の照明状況等が不変である場合には有効であるが、撮像環境が時々刻々と変化する場合には適用することが難しい。時刻、天候、季節などの撮像環境ごとにそれぞれ背景画像を準備せねばならなくなるからである。このため、撮像環境の変動に追従して背景画像を更新する技術が知られている。   However, although the thing of the said patent document 1 is effective when the illumination condition etc. of an imaging environment are unchanged, it is difficult to apply when an imaging environment changes every moment. This is because a background image must be prepared for each imaging environment such as time, weather, and season. For this reason, a technique for updating a background image following changes in the imaging environment is known.

例えば、特許文献2には、上記特許文献1と同様に背景画像を準備しておき、入力画像と背景画像の画素ごとの差分を求め、この差分が所定の閾値を超えている場合に、かかる差分を動体として抽出するとともに、所定の条件を満たす場合に背景画像を随時更新する技術が開示されている。   For example, in Patent Document 2, a background image is prepared in the same manner as in Patent Document 1, and a difference for each pixel of the input image and the background image is obtained, and this difference is exceeded when the difference exceeds a predetermined threshold value. A technique for extracting a difference as a moving object and updating a background image as needed when a predetermined condition is satisfied is disclosed.

特開2005−143052号公報Japanese Patent Laying-Open No. 2005-143052 特開平8−63683号公報JP-A-8-63683 特開2009−10636号公報JP 2009-10636 A

しかしながら、かかる特許文献2を用いた場合には、撮像環境が変化する度に所定の閾値を更新しなければならないため、適切な閾値を設定するために多大の人的労力が必要になるという問題がある。   However, when such a patent document 2 is used, a predetermined threshold value must be updated every time the imaging environment changes, and thus a problem that a great amount of human labor is required to set an appropriate threshold value. There is.

この点について具体的に説明すると、例えば、昼間の時間帯では明暗のコントラストの差が大きいために、かかるコントラストの差を考慮して閾値が設定される反面で、夜間の時間帯では明暗のコントラストの差が小さいため、昼間と同様の閾値を用いたのでは誤検出を招く可能性が高い。このため、昼間と夜間で同じ閾値を利用することはできず、撮像環境に応じて閾値を変更する必要がある。適切な閾値を設定しなければ、入力画像と背景画像との微細な輝度の差を動体と誤判定したり、動体の影部分を動体の一部と誤判定してしまう状況が生ずるのである。   More specifically, for example, since the difference in contrast between light and dark is large in the daytime period, the threshold is set in consideration of the difference in contrast, while the contrast in light and darkness is set in the nighttime period. Since the difference is small, there is a high possibility of erroneous detection if the same threshold is used as in the daytime. For this reason, the same threshold cannot be used in the daytime and at night, and the threshold needs to be changed according to the imaging environment. Unless an appropriate threshold value is set, a situation may occur in which a minute luminance difference between the input image and the background image is erroneously determined as a moving object, or a shadow portion of the moving object is erroneously determined as a part of the moving object.

なお、従来のコントラスト強調技術(例えば、Retinex理論に基づく補正技術や特許文献3に記載される技術)を用いて、昼間と夜間のコントラストを同程度に補正して共通の閾値を利用する方策も考えられるが、コントラストの補正に伴って通常はノイズが増幅されることから、増幅されたノイズの影響で動体の誤検出や検出漏れの問題が発生する可能性があり望ましくない。   There is also a method of using a common threshold by correcting the contrast between daytime and nighttime to the same extent using conventional contrast enhancement technology (for example, correction technology based on Retinex theory or technology described in Patent Document 3). Although it is conceivable, noise is usually amplified with the correction of contrast, and this may cause problems such as false detection of moving objects and omission of detection under the influence of the amplified noise.

本発明は、上述した従来技術の課題を解消するためのものであって、撮像環境が変化しても人的労力を要することなく適切な閾値を設定し、もって動体画像を効率的に抽出することができる動体画像抽出方法及び動体画像抽出装置を提供することを目的とする。   The present invention is to solve the above-described problems of the prior art, and even if the imaging environment changes, an appropriate threshold value is set without requiring human labor, and a moving object image is efficiently extracted. It is an object of the present invention to provide a moving body image extraction method and a moving body image extraction apparatus.

上述した課題を解決し、目的を達成するため、本発明は、自然光又は照明光の光量と照射方向とのうち少なくともいずれかが変動する可能性のある環境下で撮像された時系列順に並んだ複数枚の撮像画像を用い、該撮像画像内に含まれる動体の像を動体画像として抽出する動体画像抽出方法であって、前記動体による影響が排除された背景画像を取得する背景画像取得ステップと、前記背景画像取得ステップにより取得された前記背景画像と前記撮像画像との差分である差分画像を生成する差分画像生成ステップと、前記背景画像と前記撮像画像から前記背景画像を更新する背景画像更新ステップと、前記差分画像生成ステップにより生成された前記差分画像から1つの動体である可能性のある部分画像を動体候補として抽出する動体候補抽出ステップと、前記動体候補抽出ステップにより複数の前記動体候補が抽出された場合に、複数の前記動体候補から適切な前記動体候補を絞り込む動体候補絞込ステップとを含んだことを特徴とする。   In order to solve the above-described problems and achieve the object, the present invention is arranged in chronological order in which images are taken in an environment in which at least one of the amount of natural light or illumination light and the irradiation direction may fluctuate. A moving body image extraction method that uses a plurality of captured images and extracts a moving body image included in the captured images as a moving body image, and obtains a background image from which the influence of the moving body is eliminated; and A difference image generation step for generating a difference image that is a difference between the background image acquired by the background image acquisition step and the captured image; and a background image update for updating the background image from the background image and the captured image A moving object candidate extraction that extracts a partial image that may be one moving object from the difference image generated by the step and the difference image generating step as a moving object candidate A step, when a plurality of the moving object candidate is extracted by the moving object candidate extraction step, characterized in that it includes a moving object candidate narrowing-down step to narrow down the appropriate the body candidates from a plurality of the moving object candidate.

また、本発明は、上記発明において、前記背景画像取得ステップは、撮像タイミングの異なる複数の撮像画像について、同一の位置に対応する画素ごとに前記複数の撮像画像の輝度値の分布を分析して、輝度値の分布に対して特異な値を示す輝度値を除外して、除外されずに残った輝度値を使用して背景画像の画素の輝度値を算出することを特徴とする。   Further, in the present invention according to the above invention, the background image acquisition step analyzes the distribution of luminance values of the plurality of captured images for each pixel corresponding to the same position with respect to the plurality of captured images having different imaging timings. In this case, the luminance value indicating a specific value for the distribution of luminance values is excluded, and the luminance value of the pixels of the background image is calculated using the luminance values remaining without being excluded.

また、本発明は、上記発明において、前記撮像画像と当該撮像画像の直前に撮像された撮像画像である直前撮像画像との画素ごとの差分である輝度差分値を算出し、前記輝度差分値が所定値以上の画素の画像全体における分布を評価し、前記輝度差分値並びに前記輝度差分値が所定値以上の画素の画像全体における分布の評価結果に応じて、前記撮像画像の前記背景画像への画素ごとの反映比率を算出する反映比率算出ステップをさらに含み、前記背景画像更新ステップは、前記反映比率算出ステップで算出された画素ごとの前記反映比率を使用して、画素ごとに前記撮像画像と前記背景画像とを前記反映比率と(1−前記反映比率)とで加重平均することにより更新後の前記背景画像を生成することを特徴とする。   Further, in the above invention, the present invention calculates a luminance difference value that is a difference for each pixel between the captured image and the immediately preceding captured image that is captured immediately before the captured image. The distribution of the entire image of pixels having a predetermined value or more is evaluated, and the background image of the captured image is evaluated according to the luminance difference value and the evaluation result of the distribution of the entire pixel image having the luminance difference value of the predetermined value or more. A reflection ratio calculating step of calculating a reflection ratio for each pixel, wherein the background image update step uses the reflection ratio for each pixel calculated in the reflection ratio calculation step, and the captured image for each pixel; The background image after update is generated by performing a weighted average of the background image with the reflection ratio and (1-the reflection ratio).

また、本発明は、上記発明において、前記背景画像取得ステップは、前記背景画像の画素ごとに輝度値と輝度値のバラツキの程度を示す変動係数を生成し、前記差分画像生成ステップは、各画素について前記背景画像と前記撮像画像との輝度差分値を算出し、算出した輝度差分値と前記変動係数を比較して、前記撮像画像の画素を前記差分画像に採用するか否かを決定することを特徴とする。   Further, the present invention is the above invention, wherein the background image acquisition step generates a variation coefficient indicating a luminance value and a variation degree of the luminance value for each pixel of the background image, and the difference image generation step includes: Calculating a luminance difference value between the background image and the captured image, comparing the calculated luminance difference value with the variation coefficient, and determining whether or not to adopt the pixel of the captured image as the difference image. It is characterized by.

また、本発明は、上記発明において、前記撮像画像と前記背景画像とを比較して撮像装置のゆれを補正するゆれ補正ステップをさらに含み、前記差分画像生成ステップは、前記ゆれ補正ステップにより補正した補正撮像画像と前記背景画像との差分である差分画像を生成することを特徴とする。   The present invention further includes a shake correction step of correcting the shake of the imaging apparatus by comparing the captured image and the background image, and the difference image generating step is corrected by the shake correction step. A difference image that is a difference between the corrected captured image and the background image is generated.

また、本発明は、上記発明において、前記撮像画像に対して前記差分画像の抽出対象外とするマスク領域を設定するマスク領域設定ステップをさらに含み、前記差分画像生成ステップは、前記マスク領域設定ステップで設定されたマスク領域内の画素については差分なしと判定する、あるいは前記差分画像生成ステップを実行しないことを特徴とする。   In the above invention, the present invention further includes a mask region setting step for setting a mask region to be excluded from extraction of the difference image with respect to the captured image, and the difference image generation step includes the mask region setting step. The pixels in the mask area set in step 1 are determined to have no difference, or the difference image generation step is not executed.

また、本発明は、上記発明において、前記差分画像生成ステップは、前記環境下においてコントラストが最も弱い状態に対応する閾値を使用して前記差分画像を生成することを特徴とする。   Further, the present invention is characterized in that, in the above-mentioned invention, the difference image generation step generates the difference image using a threshold value corresponding to a state having the weakest contrast under the environment.

また、本発明は、上記発明において、前記動体候補抽出ステップは、前記差分画像生成ステップで生成された前記差分画像から、連続する対象物の画素群を1つの動体候補として抽出し、抽出した動体候補の輝度値に関係する特性を評価し、当該特性の評価結果から前記動体候補に含まれる対象物の画素が影であるか否かを判定するための影判定閾値である輝度値を決定し、当該影判定閾値である輝度値によって前記動体候補から影の除去を行うことを特徴とする。   Further, in the present invention according to the above invention, in the moving object candidate extraction step, the moving object extracted by extracting a pixel group of continuous objects as one moving object candidate from the difference image generated in the difference image generation step. A characteristic related to the luminance value of the candidate is evaluated, and a luminance value that is a shadow determination threshold value for determining whether or not the pixel of the object included in the moving object candidate is a shadow is determined from the evaluation result of the characteristic. The shadow is removed from the moving object candidate according to the luminance value which is the shadow determination threshold.

また、本発明は、上記発明において、前記動体候補絞込ステップは、包含関係のある動体候補をグループとして、前記グループの中であり得る動体候補の組合せをパターンとして列挙して、列挙したパターンに含まれる動体候補と時系列上で隣接する撮像画像から抽出された動体候補とを類似性に基づいて比較することにより、適切なパターンを判定することにより前記動体候補を絞り込むことを特徴とする。   Further, the present invention is the above invention, wherein the moving object candidate narrowing-down step enumerates moving object candidates having an inclusion relationship as a group, enumerates combinations of moving object candidates that can be included in the group as patterns, The moving object candidates are narrowed down by determining an appropriate pattern by comparing the moving object candidates included with moving object candidates extracted from captured images adjacent in time series based on similarity.

また、本発明は、上記発明において、前記動体候補抽出ステップは、前記差分画像生成ステップで生成された前記差分画像から、連続する対象物の画素群を1つの動体候補として一旦抽出し、別の候補として抽出された動体候補の組合せの中で、同一動体候補の可能性があると判定される複数の動体候補を融合した融合動体候補を追加して前記包含関係のある動体候補のグループとすることを特徴とする。   Also, in the present invention according to the above invention, the moving object candidate extraction step may temporarily extract a pixel group of continuous objects as one moving object candidate from the difference image generated in the difference image generation step, Among the combinations of moving object candidates extracted as candidates, a fused moving object candidate obtained by fusing a plurality of moving object candidates determined to have the same moving object candidate is added to form a moving object candidate group having the inclusion relationship. It is characterized by that.

また、本発明は、自然光又は照明光の光量と照射方向とのうち少なくともいずれかが変動する可能性のある環境下で撮像された時系列順に並んだ複数枚の撮像画像を用い、該撮像画像内に含まれる動体の像を動体画像として抽出する動体画像抽出装置であって、前記動体による影響が排除された背景画像を取得する背景画像取得手段と、前記背景画像取得手段により取得された前記背景画像と前記撮像画像との差分である差分画像を生成する差分画像生成手段と、前記背景画像と前記撮像画像から前記背景画像を更新する背景画像更新手段と、前記差分画像生成手段により生成された前記差分画像から1つの動体である可能性のある部分画像を動体候補として抽出する動体候補抽出手段と、前記動体候補抽出手段により複数の前記動体候補が抽出された場合に、複数の前記動体候補から適切な前記動体候補を絞り込む動体候補絞込手段とを備えたことを特徴とする。   Further, the present invention uses a plurality of captured images arranged in time series in an environment where at least one of the amount of natural light or illumination light and the irradiation direction may fluctuate. A moving body image extracting apparatus for extracting a moving body image included therein as a moving body image, the background image acquiring means for acquiring a background image from which the influence of the moving body has been eliminated, and the background image acquiring means acquired by the background image acquiring means A difference image generation unit that generates a difference image that is a difference between a background image and the captured image, a background image update unit that updates the background image from the background image and the captured image, and the difference image generation unit. A moving object candidate extracting unit that extracts a partial image that may be one moving object from the difference image as a moving object candidate, and the moving object candidate extracting unit generates a plurality of moving object candidates. If issued, characterized in that a moving object candidate narrowing means Filter appropriate the body candidates from a plurality of the moving object candidate.

本発明によれば、動体の影響を排除した背景画像を取得し、該背景画像と撮像画像との差分である差分画像を生成し、該撮像画像を用いて背景画像を更新し、差分画像から1つの動体である可能性のある部分画像を動体候補として抽出し、複数の動体候補から適切な動体候補を絞り込むよう構成したので、撮像環境が変化しても人的労力を要することなく適切な閾値を設定し、もって動体画像を効率的に抽出することができる。   According to the present invention, a background image that excludes the influence of a moving object is acquired, a difference image that is a difference between the background image and a captured image is generated, the background image is updated using the captured image, and the difference image is A partial image that may be a single moving object is extracted as a moving object candidate, and an appropriate moving object candidate is narrowed down from a plurality of moving object candidates, so that even if the imaging environment changes, it is appropriate without requiring human labor. By setting a threshold value, it is possible to efficiently extract a moving object image.

図1は、本実施例に係る動体検出に係る背景画像の生成処理、更新処理及び差分検出閾値の設定処理の概要を説明するための説明図である。FIG. 1 is an explanatory diagram for explaining an overview of background image generation processing, update processing, and difference detection threshold setting processing according to moving object detection according to the present embodiment. 図2は、本実施例に係る動体検出処理全体の処理概要を説明するための説明図である。FIG. 2 is an explanatory diagram for explaining the processing outline of the entire moving object detection processing according to the present embodiment. 図3は、本実施例に係る動体画像抽出装置の内部構成を示すブロック図である。FIG. 3 is a block diagram illustrating an internal configuration of the moving object image extraction apparatus according to the present embodiment. 図4は、本実施例に係る差分画像生成の概要を説明するための説明図である。FIG. 4 is an explanatory diagram for explaining an outline of difference image generation according to the present embodiment. 図5は、図1に示した動体画像抽出装置による差分画像生成の処理手順を示すフローチャートである。FIG. 5 is a flowchart showing a difference image generation processing procedure performed by the moving object image extraction apparatus shown in FIG. 図6は、図5に示した動体画像抽出装置による背景画像更新の処理手順を示すフローチャートである。FIG. 6 is a flowchart of a background image update process performed by the moving object image extraction apparatus shown in FIG. 図7は、図2に示した動体画像抽出装置による動体候補抽出の処理手順を示すフローチャートである。FIG. 7 is a flowchart of a moving object candidate extraction process procedure performed by the moving object image extraction apparatus shown in FIG. 図8は、図7に示した動体融合処理の概念を説明するための説明図である。FIG. 8 is an explanatory diagram for explaining the concept of the moving object fusion processing shown in FIG. 図9は、図7に示す動体画像抽出装置による動体候補融合の処理手順を示すフローチャートである。FIG. 9 is a flowchart showing a processing procedure of moving object candidate fusion by the moving image extracting apparatus shown in FIG. 図10は、図2に示す動体画像抽出装置による動体候補絞込の処理手順を示すフローチャートである。FIG. 10 is a flowchart showing a moving object candidate narrowing-down process procedure performed by the moving object image extraction apparatus shown in FIG.

以下に、添付図面を参照して、本発明に係る動体画像抽出方法及び動体画像抽出装置の好適な実施例を詳細に説明する。   Exemplary embodiments of a moving object image extraction method and a moving object image extraction device according to the present invention will be described below in detail with reference to the accompanying drawings.

まず、本実施例に係る動体検出に係る背景画像の生成処理、更新処理及び差分検出閾値の設定処理の概要について説明する。図1は、本実施例に係る動体検出に係る背景画像の生成処理、更新処理及び差分検出閾値の設定処理の概要を説明するための説明図である。   First, an overview of background image generation processing, update processing, and difference detection threshold setting processing related to moving object detection according to the present embodiment will be described. FIG. 1 is an explanatory diagram for explaining an overview of background image generation processing, update processing, and difference detection threshold setting processing according to moving object detection according to the present embodiment.

公共交通機関、交差点又は建造物などに設置された監視カメラで撮像された監視対象領域の入力画像から動体を検出するために、動体の含まれない監視対象領域の画像(以下、「背景画像」と言う)と、背景画像と入力画像の差分から動体を検出する際の閾値とがあらかじめ設定される。日照等の撮像環境の変化によって画像全体の明暗やコントラストの強さが影響を受けるため、かかる背景画像と閾値は、日照等の撮像環境の変化にともなって逐次更新される。   In order to detect a moving object from an input image of a monitoring target area captured by a monitoring camera installed in public transportation, an intersection, or a building, an image of a monitoring target area that does not include a moving object (hereinafter, “background image”) And a threshold for detecting a moving object from the difference between the background image and the input image is set in advance. Since the brightness and contrast of the entire image and the intensity of contrast are affected by changes in the imaging environment such as sunshine, the background image and the threshold are sequentially updated as the imaging environment such as sunshine changes.

まず、動体の検出対象となる入力画像を受け付ける前に事前に準備する初期背景画像の生成処理について説明する。図1に示すように、この初期背景画像は、例えば、あらかじめ準備した10枚の画像(画像#1〜画像#10)を用いて生成される。かかる画像#1〜画像#10は、日照等の画像撮像に係る環境変化が比較的少ない期間(例えば10分間)に監視対象領域を撮像した任意の10枚の画像である。かかる画像#1〜画像#10には、動体が含まれていても良いが、もし10枚全ての同一位置に動体が含まれていると該動体は背景の一部であるものとみなされる。   First, an initial background image generation process prepared in advance before receiving an input image to be detected by a moving object will be described. As shown in FIG. 1, the initial background image is generated using, for example, ten images (image # 1 to image # 10) prepared in advance. The images # 1 to # 10 are arbitrary 10 images obtained by capturing the monitoring target area during a period (for example, 10 minutes) in which the environmental change related to image capturing such as sunshine is relatively small. Such image # 1 to image # 10 may include a moving object. However, if a moving object is included at the same position in all 10 sheets, the moving object is regarded as a part of the background.

具体的には、初期背景画像を生成する際には、画像#1〜画像#10の同一位置に所在する画素ごとに、輝度値のバラツキを調べ、バラツキの大きな画素は動体の写りこみによるものとして排除し、残った画素の輝度値の平均値及び輝度値のバラツキの程度を示す変動係数を算出し、算出した輝度値と輝度値の変動係数を画素値として持つ背景画像を生成する。   Specifically, when generating the initial background image, the variation in the luminance value is examined for each pixel located at the same position in the image # 1 to the image # 10, and the pixel with the large variation is due to the reflection of the moving object. And calculating a variation coefficient indicating the average value of the luminance values of the remaining pixels and the degree of variation of the luminance values, and generating a background image having the calculated luminance value and the variation coefficient of the luminance values as pixel values.

次に、差分画像の生成処理では、初期背景画像と、入力画像#1を用いて差分画像#1を生成する。具体的には、入力画像の各画素の輝度値と該入力画像の各画素の画素位置に対応する初期背景画像の画素の画素値に含まれる輝度値とを比較し、両輝度値の差が初期背景画像の画素の画素値に含まれる変動係数の所定の倍数未満である場合には、差分画像#1の対応する画素の画素値をゼロとし、輝度値の差が変動係数の所定の倍数以上である場合には、両輝度値の差の絶対値を該画素の画素値とする。この差分画像#1は、画素値がゼロでない部分が動体を形成する画素である可能性があるため、以降の動体画像抽出処理の入力情報となる。   Next, in the difference image generation process, the difference image # 1 is generated using the initial background image and the input image # 1. Specifically, the luminance value of each pixel of the input image is compared with the luminance value included in the pixel value of the pixel of the initial background image corresponding to the pixel position of each pixel of the input image. When it is less than a predetermined multiple of the variation coefficient included in the pixel value of the pixel of the initial background image, the pixel value of the corresponding pixel of the difference image # 1 is set to zero, and the difference in luminance value is the predetermined multiple of the variation coefficient In the case above, the absolute value of the difference between the two luminance values is set as the pixel value of the pixel. The difference image # 1 is input information for subsequent moving object image extraction processing because there is a possibility that a part having a non-zero pixel value is a pixel that forms a moving object.

次に、背景画像の更新処理について説明する。ここでは、初期背景画像と入力画像#1を用いて、次回に用いる背景画像(第二世代の背景画像)を生成する。かかる第二世代の背景画像の各画素の画素値は、初期背景画像の画素値である輝度値及び輝度値の変動係数と、入力画像#1の画素値と、画素ごとの反映比率(以下、「第一の反映比率」と言う)を用いて算出される。この反映比率とは、画素ごとに初期の背景画像に反映させる入力画像#1の割合を表すものである。具体的には、ある画素に対応する初期背景画像の輝度値をv1(t)、輝度値の変動係数をσ(t)、同じ画素に対応する入力画像#1の輝度値をv2(t)とした場合に、同じ画素に対応する第二世代の背景画像の輝度値をv1(t+1)、輝度値の変動係数をσ(t+1)とすると、第二世代の背景画像の輝度値v1(t+1)は、v1(t+1)=v1(t)×(1−(反映比率))+v2(t)×(反映比率)で算出し、第二世代の背景画像の輝度値の変動係数σ(t+1)は、σ(t+1)=σ(t)×(1−(反映比率))+abs(v1(t)−v2(t))×(反映比率)で算出する。なお、abs(x)はxの絶対値を返す関数を示す。   Next, background image update processing will be described. Here, a background image (second generation background image) to be used next time is generated using the initial background image and the input image # 1. The pixel value of each pixel of the second-generation background image includes the luminance value and the variation coefficient of the luminance value, which are the pixel values of the initial background image, the pixel value of the input image # 1, and the reflection ratio for each pixel (hereinafter, (Referred to as “first reflection ratio”). This reflection ratio represents the ratio of input image # 1 to be reflected in the initial background image for each pixel. Specifically, the luminance value of the initial background image corresponding to a certain pixel is v1 (t), the coefficient of variation of the luminance value is σ (t), and the luminance value of the input image # 1 corresponding to the same pixel is v2 (t). If the luminance value of the second generation background image corresponding to the same pixel is v1 (t + 1) and the variation coefficient of the luminance value is σ (t + 1), the luminance value v1 (t + 1) of the second generation background image ) Is calculated by v1 (t + 1) = v1 (t) × (1− (reflection ratio)) + v2 (t) × (reflection ratio), and the variation coefficient σ (t + 1) of the luminance value of the second generation background image Is calculated by σ (t + 1) = σ (t) × (1− (reflection ratio)) + abs (v1 (t) −v2 (t)) × (reflection ratio). Here, abs (x) indicates a function that returns the absolute value of x.

入力画像#1は、最新の監視対象領域を撮像した画像であることから背景の部分に関しては日照等の環境変化を反映した画像となっている反面、部分的に動体が含まれている可能性がある。このことを考慮して、入力画像#1の日照等の環境変化による影響は背景画像になるべく反映し、入力画像#1に写り込んだ動体の情報は背景画像になるべく反映させないようにする。   Since the input image # 1 is an image obtained by capturing the latest monitoring target area, the background portion is an image reflecting an environmental change such as sunshine, but there is a possibility that a moving object is partially included. There is. Considering this, the influence of the environmental change such as sunshine of the input image # 1 is reflected as much as possible in the background image, and the moving object information reflected in the input image # 1 is not reflected as much as possible in the background image.

具体的には、画素ごとに入力画像と直前画像との輝度値の差分を算出し、該差分を所定の正規化規則を用いて変換を行うことによって、差分が大きければ小さな、差分が小さければ大きな、0より大きく1未満の第二の反映比率を算出する。また、入力画像全体に対して入力画像の直前画像との差異が画像全体に広がっている程度(以下、「差異広がり値」と言う)を算出し、該差異広がり値を所定の正規化規則を用いて変換を行うことによって、差異広がり値が大きければ大きな、差異広がり値が小さければ小さな、0より大きく1未満の第三の反映比率を算出する。画素ごとに該第二の反映比率と該第三の反映比率を乗算して、画素ごとの第一の反映比率を算出し、このようにして算出された該第一の反映比率と背景画像と入力画像とを使って第二世代の背景画像を生成する。   Specifically, by calculating the difference in luminance value between the input image and the previous image for each pixel and converting the difference using a predetermined normalization rule, if the difference is large, if the difference is small A second reflection ratio greater than 0 and less than 1 is calculated. In addition, the extent to which the difference between the entire input image and the previous image of the input image spreads over the entire image (hereinafter referred to as “difference spread value”) is calculated, and the difference spread value is determined according to a predetermined normalization rule. By performing conversion using the third reflection ratio, a third reflection ratio that is larger if the difference spread value is larger, smaller if the difference spread value is smaller, and greater than 0 and less than 1 is calculated. The first reflection ratio for each pixel is calculated by multiplying the second reflection ratio and the third reflection ratio for each pixel, and the first reflection ratio and the background image thus calculated are calculated. A second generation background image is generated using the input image.

同様にして第二世代の背景画像と入力画像#2とから差分画像#2を生成し、第二世代の背景画像と入力画像#2とから第三世代の背景画像を生成する。以降についても、同様に、入力画像を入力の都度、背景画像の画素ごとの輝度値及び輝度値の変動係数が更新されることによって、日照等の環境の変化にともなう背景画像及び閾値の逐次更新が行われる。   Similarly, a difference image # 2 is generated from the second generation background image and the input image # 2, and a third generation background image is generated from the second generation background image and the input image # 2. Similarly, every time an input image is input, the luminance value for each pixel of the background image and the coefficient of variation of the luminance value are updated, so that the background image and the threshold value are sequentially updated with changes in the environment such as sunlight. Is done.

このように、監視対象の領域を撮像した複数枚の画像を基にして、画素ごとに平均輝度値及び輝度値のバラツキの程度を示す変動係数を有する背景画像を生成し、該背景画像の画素ごとの輝度値と、入力画像の同一位置に対応する画素の輝度値とを比較して、背景画像の画素ごとに有する変動係数の所定倍を閾値として動体を抽出する。また、動体画像を抽出する入力画像の入力の都度、日照等の環境変化による背景画像の変化を背景画像に対して逐次自動反映した背景画像を更新設定するようにしたことから、撮像環境が変化しても人的労力を要することなく適切な閾値を設定し、もって動体画像を効率的に抽出することができる。   In this way, based on a plurality of images obtained by imaging the monitoring target region, a background image having a variation coefficient indicating the average luminance value and the degree of variation of the luminance value is generated for each pixel, and the pixels of the background image The luminance value for each pixel is compared with the luminance value of the pixel corresponding to the same position of the input image, and a moving object is extracted using a predetermined multiple of the variation coefficient for each pixel of the background image as a threshold value. In addition, every time an input image is extracted to extract a moving body image, the background image that automatically reflects the background image changes due to environmental changes such as sunshine to the background image is updated and set, so the imaging environment changes. Even if human labor is not required, an appropriate threshold value can be set and a moving body image can be efficiently extracted.

次に、本実施例に係る動体検出処理全体の処理概要を説明する。図2は、本実施例に係る動体検出処理全体の処理概要を説明するための説明図である。   Next, an overview of the entire moving object detection process according to the present embodiment will be described. FIG. 2 is an explanatory diagram for explaining the processing outline of the entire moving object detection processing according to the present embodiment.

初期背景画像生成処理は、図1で示した通り、(a)に示す監視対象領域を撮像した画像10枚を入力として、(b)に示す初期の背景画像を生成する処理である。初期背景画像生成処理は、図2に示すように入力となる(a)の10枚の画像に動体が含まれていても、該動体の影響を排除して(b)に示す背景画像のデータを生成することが可能である。   As shown in FIG. 1, the initial background image generation process is a process of generating an initial background image shown in (b) with 10 images captured from the monitoring target area shown in (a) as input. In the initial background image generation process, even if moving images are included in the 10 images (a) that are input as shown in FIG. 2, the influence of the moving objects is eliminated and the background image data shown in (b) Can be generated.

差分画像生成処理は、(b)に示す背景画像と(c)に示す入力画像の輝度値を画素ごとに比較して、輝度値の差が背景画像の当該画素の変動係数の所定倍である閾値以上の差のある画素を抽出する処理である。この差分画像生成処理によって、動体ではない背景画像に対応する画素は除外され、背景画像と差異有と判定された画素で構成される動体候補が抽出される。また、本実施例では、同一の監視対象領域を時刻、天候、季節を問わず様々な条件で撮像した入力画像から動体候補の画像抽出を行うために、明暗のコントラストの弱い夜間などでも動体候補を抽出できるようにコントラストに敏感な閾値の設定をする。   In the difference image generation process, the luminance value of the background image shown in (b) and the input image shown in (c) are compared for each pixel, and the difference in luminance value is a predetermined multiple of the variation coefficient of the pixel of the background image. This is a process of extracting pixels having a difference equal to or greater than a threshold value. By this difference image generation processing, pixels corresponding to a background image that is not a moving object are excluded, and moving object candidates that are determined to be different from the background image are extracted. Further, in this embodiment, the moving object candidate is extracted even in the night where the contrast of the light and darkness is low in order to extract the moving object candidate from the input image obtained by capturing the same monitoring target area under various conditions regardless of the time, weather, and season. A threshold value sensitive to contrast is set so that can be extracted.

また、背景画像更新処理は、(b)に示す背景画像と(c)に示す入力画像を入力情報として(b)に示す背景画像を更新する処理である。背景画像は日照等の環境の変化の影響を受けることから、初期背景画像生成処理で一旦生成後も、環境の変化にともなう影響を逐次背景画像に反映する。背景画像更新処理は、(c)に示す入力画像に動体が含まれていても、その動体の影響を排除して(b)に示す背景画像の更新を行う。   The background image update process is a process for updating the background image shown in (b) using the background image shown in (b) and the input image shown in (c) as input information. Since the background image is affected by changes in the environment such as sunshine, the effect of the change in the environment is sequentially reflected in the background image even after being generated once by the initial background image generation processing. In the background image update process, even if a moving object is included in the input image shown in (c), the influence of the moving object is eliminated and the background image shown in (b) is updated.

差分画像生成処理で生成した差分画像が、図2の(d)の差分画像に示すように動体の影が差分として抽出されていることを考慮して、影除去処理では、(d)に示す差分画像から影の除去処理を実施して、(e)に示す影除去後差分画像の生成をする。これは、夜間などでも動体候補を抽出できるようにコントラストに敏感な閾値の設定をしたことにより、明暗のコントラストの強い日中の画像などでは影を差分として抽出してしまうからである。   In consideration of the fact that the shadow of the moving object is extracted as a difference from the difference image generated by the difference image generation process, as shown in the difference image of FIG. A shadow removal process is performed from the difference image to generate a shadow-removed difference image shown in (e). This is because, by setting a threshold sensitive to contrast so that moving object candidates can be extracted even at night, shadows are extracted as a difference in a daytime image with strong contrast between light and dark.

次に、動体候補抽出処理は、(e)に示す影除去後差分画像から、(f)に示す動体候補を抽出する処理である。具体的には、(e)に示す影除去後差分画像で隣接する差分画素を一つの動体として矩形で識別し、独立する別の動体候補として抽出された動体候補が、同一の動体である可能性を考慮して、複数の動体候補を融合した動体候補も含めて抽出し、所定サイズ以下の候補を排除する。(f)に示す動体候補は、(e)に示す影除去後差分画像から生成したもので、Obj1〜Obj4の4つの動体候補が抽出されたことを示している。また動体候補Obj1は、動体候補Obj2と動体候補Obj3との融合した動体候補であり、この段階では動体候補Obj1が1つの動体なのか、動体候補Obj2と動体候補Obj3が独立した別の動体なのかの判断ができないので、両方の候補を含めたものとなっている。   Next, the moving object candidate extraction process is a process for extracting the moving object candidate shown in (f) from the difference image after shadow removal shown in (e). Specifically, in the difference image after shadow removal shown in (e), adjacent difference pixels may be identified as a single moving object by a rectangle, and moving object candidates extracted as separate independent moving object candidates may be the same moving object. In consideration of the characteristics, a moving object candidate obtained by fusing a plurality of moving object candidates is extracted, and candidates having a predetermined size or less are excluded. The moving object candidate shown in (f) is generated from the difference image after shadow removal shown in (e), and indicates that four moving object candidates Obj1 to Obj4 have been extracted. The moving object candidate Obj1 is a moving object candidate obtained by fusing the moving object candidate Obj2 and the moving object candidate Obj3. At this stage, the moving object candidate Obj1 is one moving object or the moving object candidate Obj2 and the moving object candidate Obj3 are independent moving objects. Therefore, both candidates are included.

次に、動体候補絞込処理は、(f)に示す動体候補には、動体候補Obj2と動体候補Obj3とを融合した動体候補Obj1と、融合前の動体候補Obj2、動体候補Obj3とが含まれていることから、動体候補Obj1が1つの動体なのか、動体候補Obj2と動体候補Obj3が独立した別の動体なのかの判定を行うことによって、いずれかの不適切な動体候補を削除して、動体を決定する処理である。図2の動体候補絞込処理は、(f)に示す動体候補から、動体候補Obj2と動体候補Obj3は独立した別動体と判定して、動体候補Obj1を削除した(k)に示す絞込済動体候補を決定したことを示している。動体候補絞込処理は、動体候補抽出処理で抽出された(f)に示す動体候補の情報と、(g)及び(h)に示す直前の2枚の画像から抽出された動体候補の情報と、(i)及び(j)に示す直後の2枚の画像から抽出された動体候補の情報とを用いて、動体候補Obj2と動体候補Obj3が独立した動体なのか、動体候補Obj1が1つの動体なのかの判定を実施する。   Next, in the moving object candidate narrowing-down process, the moving object candidates shown in (f) include moving object candidates Obj1 obtained by fusing moving object candidates Obj2 and moving object candidates Obj3, moving object candidates Obj2 and moving object candidates Obj3 before fusion. Therefore, by determining whether the moving object candidate Obj1 is one moving object or whether the moving object candidate Obj2 and the moving object candidate Obj3 are separate independent moving objects, any inappropriate moving object candidates are deleted, This is a process for determining a moving object. In the moving object candidate narrowing-down process of FIG. 2, the moving object candidate Obj2 and the moving object candidate Obj3 are determined as independent separate moving objects from the moving object candidate shown in (f), and the moving object candidate Obj1 is deleted. This indicates that the moving object candidate has been determined. The moving object candidate narrowing-down process includes information on the moving object candidate shown in (f) extracted in the moving object candidate extraction process, and moving object candidate information extracted from the immediately preceding two images shown in (g) and (h). , (I) and (j) using the moving object candidate information extracted from the immediately following two images, the moving object candidate Obj2 and the moving object candidate Obj3 are independent moving objects, or the moving object candidate Obj1 is one moving object. Determine what is happening.

なお、(b)に示す背景画像、(d)に示す差分画像、(e)に示す影除去後差分画像、(f)に示す動体候補、(g)及び(h)に示す直前の2枚の画像の動体候補、(i)及び(j)に示す直後の2枚の画像の動体候補及び(k)に示す絞込済動体候補は、説明の便宜上、(a)に示す撮像した画像や(c)に示す入力画像の画像データと同様に表現しているが、データ形式やデータ保有項目は(a)に示す撮像した画像や(c)に示す入力画像とは異なる。(b)に示す背景画像は、画素ごとの輝度値と輝度値の変動係数を有している。(d)に示す差分画像は、差分が所定値未満の部分の画素値がゼロで、差分が所定値以上の部分の画素値は背景画像の輝度値と入力画像の輝度値の差の絶対値を有するデータである。(e)に示す影除去後差分画像のデータ形式は(d)に示す差分画像と同様である。(f)に示す動体候補、(g)及び(h)に示す直前の2枚の画像の動体候補、(i)及び(j)に示す直後の2枚の画像の動体候補及び(k)に示す絞込済動体候補は、矩形で囲われた動体候補ごとに入力画像上の矩形の位置、サイズ、矩形内の動体の画素情報などを有している。   The background image shown in (b), the difference image shown in (d), the difference image after shadow removal shown in (e), the moving object candidate shown in (f), and the two images immediately before shown in (g) and (h) For the convenience of explanation, the captured moving image candidate shown in (a), the moving image candidate of the two images immediately after shown in (i) and (j), and the narrowed moving object candidate shown in (k) Although it is expressed in the same manner as the image data of the input image shown in (c), the data format and data holding items are different from the captured image shown in (a) and the input image shown in (c). The background image shown in (b) has a luminance value for each pixel and a variation coefficient of the luminance value. In the difference image shown in (d), the pixel value of the portion where the difference is less than the predetermined value is zero, and the pixel value of the portion where the difference is the predetermined value or more is the absolute value of the difference between the luminance value of the background image and the luminance value of the input image It is data which has. The data format of the difference image after shadow removal shown in (e) is the same as that of the difference image shown in (d). The candidate moving object shown in (f), the candidate moving object of the immediately preceding two images shown in (g) and (h), the candidate moving object of the two immediately following images shown in (i) and (j), and (k) The narrowed moving object candidate to be shown has the position and size of a rectangle on the input image for each moving object candidate surrounded by a rectangle, pixel information of the moving object within the rectangle, and the like.

次に、本実施例に係る動体画像抽出装置30の内部構成を説明する。図3は、本実施例に係る動体画像抽出装置30の内部構成を示すブロック図である。図3に示すように、動体画像抽出装置30は、ネットワーク20を介して監視カメラ10に接続されている。なお、本実施例では、ネットワーク20を経由して監視カメラ10で撮像された画像を動体画像抽出装置30に入力させることとしたが、本発明はこれに限定するものではない。CD、DVD、USBメモリ、SDメモリ及びコンパクトフラッシュ(登録商標)メモリの外部メディアから読み出した画像や、PCの画面に表示された画像をキャプチャーボードで取り込んだ画像などを、動体画像抽出装置30に入力させることとしてもよい。   Next, the internal configuration of the moving object image extraction device 30 according to the present embodiment will be described. FIG. 3 is a block diagram illustrating an internal configuration of the moving object image extraction device 30 according to the present embodiment. As shown in FIG. 3, the moving object image extraction device 30 is connected to the monitoring camera 10 via the network 20. In the present embodiment, an image captured by the monitoring camera 10 via the network 20 is input to the moving object image extraction device 30, but the present invention is not limited to this. An image read from an external medium such as a CD, DVD, USB memory, SD memory, and Compact Flash (registered trademark) memory, an image obtained by capturing an image displayed on a PC screen with a capture board, and the like are stored in the moving object image extraction device 30. It may be input.

動体画像抽出装置30は、I/F部31、表示部32、入力部33、記憶部34及び制御部35を有する。I/F部31は、監視カメラ10により撮像された監視画像データをネットワーク20経由で受信するためのインタフェース部である。表示部32は、液晶パネルやディスプレイ装置等であり、入力部33は、キーボードやマウス等である。   The moving body image extraction device 30 includes an I / F unit 31, a display unit 32, an input unit 33, a storage unit 34, and a control unit 35. The I / F unit 31 is an interface unit for receiving monitoring image data captured by the monitoring camera 10 via the network 20. The display unit 32 is a liquid crystal panel, a display device, or the like, and the input unit 33 is a keyboard, a mouse, or the like.

記憶部34は、フラッシュメモリ又はハードディスク装置等からなる記憶デバイスであり、蓄積画像データ34a、背景画像データ34b、処理パラメータ34c、差分画像データ34d及び動体候補データ34eを有する。蓄積画像データ34aは、監視カメラ10により撮像された画像データであり、日付及び時間に対応付けて記録されている。   The storage unit 34 is a storage device including a flash memory or a hard disk device, and includes accumulated image data 34a, background image data 34b, processing parameters 34c, difference image data 34d, and moving object candidate data 34e. The accumulated image data 34a is image data captured by the monitoring camera 10, and is recorded in association with the date and time.

背景画像データ34bは、監視カメラ10で撮像する領域の動体を除外した背景の画像データであり、監視カメラ10で撮像した入力画像から差分画像を生成する時に使用する。背景画像データ34bは、後述する初期背景画像生成部35bによって生成され、後述する背景画像更新部35dによって逐次更新される。背景画像データ34bは、画像の幅、画像の高さ及び画素情報等を有している。画素情報は(画像の幅)×(画像の高さ)で算出される数の画素の情報を有し、各画素の情報はその画素の輝度値と輝度値のバラツキの程度を示す変動係数とを有している。   The background image data 34b is background image data excluding moving objects in the area captured by the monitoring camera 10, and is used when generating a differential image from the input image captured by the monitoring camera 10. The background image data 34b is generated by an initial background image generation unit 35b described later, and is sequentially updated by a background image update unit 35d described later. The background image data 34b includes an image width, an image height, pixel information, and the like. The pixel information includes information on the number of pixels calculated by (image width) × (image height), and the information on each pixel includes a variation coefficient indicating the degree of variation in the luminance value of the pixel and the luminance value. have.

処理パラメータ34cは、監視カメラ10で撮像した画像から動体候補の画像を抽出するための設定パラメータである。処理パラメータ34cは、例えば、マスク領域情報である。マスク領域情報は、入力画像の中で動体検知の対象外の領域の設定である。入力画像と背景画像の差分を算出時には、本マスク領域に対応する画素の輝度値の比較は実施せず、差分画像の画素値には固定的に差異なしを意味するゼロを設定する。若しくは本マスク領域に対する差分の算出処理を実行しないようにしても良い。   The processing parameter 34 c is a setting parameter for extracting a moving object candidate image from an image captured by the monitoring camera 10. The processing parameter 34c is, for example, mask area information. The mask area information is a setting of an area not subject to motion detection in the input image. When calculating the difference between the input image and the background image, the luminance values of the pixels corresponding to this mask area are not compared, and the pixel value of the difference image is fixedly set to zero meaning no difference. Alternatively, the difference calculation process for this mask area may not be executed.

差分画像データ34dは、監視カメラ10で撮像した入力画像と背景画像との差分のデータであり、図2の(d)差分画像に相当する。   The difference image data 34d is difference data between the input image captured by the monitoring camera 10 and the background image, and corresponds to the difference image (d) in FIG.

動体候補データ34eは、差分画像データ34dを基にして抽出した動体候補若しくは動体の情報である。動体候補データ34eは、入力画像から抽出した全ての動体候補に関する情報を有する。例えば、抽出された動体候補ごとに、動体候補の矩形の左上の画像上の位置、矩形の幅と高さなどを有する。   The moving object candidate data 34e is moving object candidates or moving object information extracted based on the difference image data 34d. The moving object candidate data 34e includes information on all moving object candidates extracted from the input image. For example, each extracted moving object candidate has a position on the upper left image of the rectangle of the moving object candidate, a width and a height of the rectangle, and the like.

制御部35は、動体画像抽出装置30を全体制御する制御部であり、画像取得部35a、初期背景画像生成部35b、差分画像生成部35c、背景画像更新部35d、影除去部35e、動体候補抽出部35f及び動体候補絞込部35gを有する。実際には、これらの機能部に対応するプログラムを図示しないROMや不揮発性メモリに記憶しておき、それぞれのプログラムをCPU(Central Processing Unit)が実行することにより、それぞれに対応するプロセスを実行させることになる。   The control unit 35 is a control unit that controls the moving image extracting apparatus 30 as a whole, and includes an image acquisition unit 35a, an initial background image generation unit 35b, a difference image generation unit 35c, a background image update unit 35d, a shadow removal unit 35e, and moving object candidates. It has the extraction part 35f and the moving body candidate narrowing-down part 35g. Actually, programs corresponding to these functional units are stored in a ROM or non-volatile memory (not shown), and each program is executed by a CPU (Central Processing Unit), thereby executing a process corresponding to each program. It will be.

画像取得部35aは、監視カメラ10の撮像した画像データをネットワーク20及びI/F部31を経由して入手して、蓄積画像データ34aに記憶する。または、ビデオレコーダなどの再生信号を入手する形態であってもよい。   The image acquisition unit 35a obtains the image data captured by the monitoring camera 10 via the network 20 and the I / F unit 31, and stores it in the accumulated image data 34a. Or the form which acquires reproduction signals, such as a video recorder, may be sufficient.

初期背景画像生成部35bは、図2を用いて説明した初期背景画像生成処理を行う。具体的には、日照等の画像撮像に係る環境変化が比較的少ない所定の期間(例えば10分)内に、本装置の起動時に監視カメラ10で撮像した複数枚の画像を入力情報として、背景画像データ34bを生成する。初期背景画像生成部35bは、所定の期間(例えば10分間)内に撮像した任意の10枚の画像に動体が写りこんでいても、動体の影響を排除した背景画像を生成する。具体的には、10枚の画像の画素ごとに、輝度値のバラツキを調べ、バラツキの大きな画素は動体の写りこみによるものとして、当該画素を排除して、残った画素を使って画素ごとの平均の輝度値及び輝度値のバラツキの程度を示す変動係数を算出して、該輝度値及び変動係数を画素値として有する背景画像を背景画像データ34bに記憶する。   The initial background image generation unit 35b performs the initial background image generation process described with reference to FIG. Specifically, a plurality of images captured by the monitoring camera 10 at the time of activation of the present apparatus within a predetermined period (for example, 10 minutes) in which environmental changes related to image capturing such as sunshine are relatively small are used as background information. Image data 34b is generated. The initial background image generation unit 35b generates a background image that excludes the influence of the moving object even if the moving object is reflected in any 10 images captured within a predetermined period (for example, 10 minutes). Specifically, the variation of the luminance value is examined for each pixel of the ten images, and the pixel having a large variation is considered to be a reflection of the moving object, and the pixel is excluded and the remaining pixel is used for each pixel. A variation coefficient indicating the average luminance value and the degree of variation of the luminance value is calculated, and a background image having the luminance value and the variation coefficient as a pixel value is stored in the background image data 34b.

差分画像生成部35cは、初期背景画像生成部35bが背景画像データ34bを生成後に、監視カメラ10で撮像された入力画像を受け付けて、背景画像データ34bと入力画像を比較することによって差分画像データ34dを生成する。詳細な処理手順は後述する。   The difference image generation unit 35c receives the input image captured by the monitoring camera 10 after the initial background image generation unit 35b generates the background image data 34b, and compares the background image data 34b with the input image to obtain the difference image data. 34d is generated. A detailed processing procedure will be described later.

背景画像更新部35dは、入力画像から得られる最新の背景画像の情報によって背景画像データ34bの更新処理を行う。ただし、入力画像には動体が写りこんでいる場合があるので、背景画像更新部35dは、写りこんでいる動体の影響を排除して背景画像データ34bの更新処理を行う。詳細な処理手順は後述する。   The background image update unit 35d updates the background image data 34b based on the latest background image information obtained from the input image. However, since the moving object may be reflected in the input image, the background image update unit 35d performs the update process of the background image data 34b by eliminating the influence of the moving object being reflected. A detailed processing procedure will be described later.

影除去部35eは、差分画像生成部35cの生成した差分画像データ34dから影の影響と判定される部分の差分値をゼロとすることによって影の除去を行う。具体的には隣接する差分画素のひとかたまりを動体候補として、該動体候補ごとに影を判定する閾値を所定の規則で算出して、画素ごとの差分値が該閾値以下の画素については影であると判定して、影と判定した差分画像の画素値にゼロを設定する。   The shadow removing unit 35e removes the shadow by setting the difference value of the portion determined to be the influence of the shadow from the difference image data 34d generated by the difference image generating unit 35c to zero. Specifically, a group of adjacent difference pixels is set as a moving object candidate, and a threshold value for determining a shadow for each moving object candidate is calculated according to a predetermined rule. A pixel whose difference value for each pixel is equal to or less than the threshold value is a shadow. And the pixel value of the difference image determined to be a shadow is set to zero.

動体候補抽出部35fは、差分画像生成部35cが生成した差分画像データ34dから、隣接する差分画素をまとめた差分画素群を一つの動体候補として抽出し、動体候補データ34eに登録する。また、動体候補抽出部35fは、影除去部35eが生成した影除去後の差分画像データ34dから、隣接する差分画素を一つの動体候補として抽出し、独立な別の動体候補として抽出された複数の動体候補が同一の動体であることの可能性を考慮して、複数の動体候補を融合した動体候補も併せて抽出し、その後所定サイズ以下の候補を排除する。詳細な処理手順は後述する。   The moving object candidate extraction unit 35f extracts a difference pixel group in which adjacent difference pixels are grouped as one moving object candidate from the difference image data 34d generated by the difference image generation unit 35c, and registers it in the moving object candidate data 34e. In addition, the moving object candidate extraction unit 35f extracts adjacent difference pixels as one moving object candidate from the difference image data 34d after shadow removal generated by the shadow removing unit 35e, and extracts a plurality of extracted independent moving object candidates. In consideration of the possibility that the moving object candidates are the same moving object, moving object candidates obtained by fusing a plurality of moving object candidates are also extracted, and then candidates having a predetermined size or less are excluded. A detailed processing procedure will be described later.

動体候補絞込部35gは、動体候補抽出部35fの登録した動体候補データ34eに含まれる不適切な動体候補を削除して、適切な動体候補を決定する処理である。動体候補絞込部35gは、入力画像の時系列的な前後の画像から抽出された動体候補の情報を用いて不適切な動体候補を判定し、動体候補データ34eから不適切な動体候補を削除する。詳細な処理手順は後述する。   The moving object candidate narrowing-down unit 35g is a process of deleting an inappropriate moving object candidate included in the moving object candidate data 34e registered by the moving object candidate extracting unit 35f and determining an appropriate moving object candidate. The moving object candidate narrowing-down unit 35g determines an improper moving object candidate using information on moving object candidates extracted from images before and after the time series of the input image, and deletes the improper moving object candidate from the moving object candidate data 34e. To do. A detailed processing procedure will be described later.

次に、本実施例に係る差分画像生成の概要を説明する。図4は、本実施例に係る差分画像生成の概要を説明するための説明図である。   Next, an outline of difference image generation according to the present embodiment will be described. FIG. 4 is an explanatory diagram for explaining an outline of difference image generation according to the present embodiment.

差分画像は、背景画像である背景画像データ34bと入力画像を用いて生成する。背景画像データ34bは画素ごとに輝度値と輝度値のバラツキの程度を示す変動係数とを有している。一方、入力画像は、画素ごとには輝度値のみを有している。背景画像データ34bの画素ごとの情報から、動体が入りこまなければ同一位置に対応する画素の輝度値は、背景画像データ34bの対応する画素の輝度値を平均として、変動係数をバラツキとする分布であると想定される。   The difference image is generated using the background image data 34b, which is the background image, and the input image. The background image data 34b has a luminance value and a variation coefficient indicating the degree of variation of the luminance value for each pixel. On the other hand, the input image has only a luminance value for each pixel. From the information for each pixel of the background image data 34b, the luminance value of the pixel corresponding to the same position if the moving object does not enter is a distribution in which the luminance value of the corresponding pixel of the background image data 34b is averaged and the variation coefficient varies. It is assumed that

これに対して、差分を検出する判定基準を、画素ごとの輝度値の差の絶対値が変動係数の2倍以上の差異のある画素とした場合、背景画像の画素の輝度値がv1変動係数がσで、入力画像の対応する画素の輝度値がv2の場合には、v1−2σ<v2<v1+2σの場合には動体による影響ではないと判定し、差分画像データ34dの画素ごとの差分値にはゼロを設定する。また、v2≧1+2σ又はv2≦v1−2σの場合には差異は動体による影響であると判定し、差分画像データ34dの画素値には(v1−v2)の絶対値を設定する。   On the other hand, if the determination criterion for detecting the difference is a pixel in which the absolute value of the luminance value difference for each pixel has a difference that is twice or more the variation coefficient, the luminance value of the pixel of the background image is the v1 variation coefficient. Is σ and the luminance value of the corresponding pixel of the input image is v2, if v1-2σ <v2 <v1 + 2σ, it is determined that there is no influence by the moving object, and the difference value for each pixel of the difference image data 34d Set to zero. Further, when v2 ≧ 1 + 2σ or v2 ≦ v1-2σ, it is determined that the difference is due to the moving object, and the absolute value of (v1−v2) is set as the pixel value of the difference image data 34d.

次に、図1に示した動体画像抽出装置30による差分画像生成の処理手順を説明する。図5は、動体画像抽出装置30による差分画像生成の処理手順を示すフローチャートである。   Next, a difference image generation processing procedure by the moving object image extraction device 30 shown in FIG. 1 will be described. FIG. 5 is a flowchart showing a processing procedure of difference image generation by the moving object image extraction device 30.

まず、差分画像生成部35cは、監視カメラ10の撮像した入力画像をグレーの多階調画像に変換する(ステップS201)。また、差分画像生成部35cは、入力画像に対して所定のガウシアンフィルターを適用することによって、ノイズカット処理を行う(ステップS202)。   First, the difference image generation unit 35c converts the input image captured by the monitoring camera 10 into a gray multi-tone image (step S201). Further, the difference image generation unit 35c performs noise cut processing by applying a predetermined Gaussian filter to the input image (step S202).

次に、差分画像生成部35cは、監視カメラ10のゆれによって背景画像に比較して入力画像が上下左右又は斜めのいずれかの方向に所定の画素数分以下のずれが発生しているか否かの判定を行い、ずれの発生が判定された場合には入力画像のずれの補正を行う(ステップS203)。   Next, the difference image generation unit 35c determines whether or not the input image has a deviation of a predetermined number of pixels or less in the vertical, horizontal, or diagonal directions compared to the background image due to the shaking of the monitoring camera 10. If the occurrence of deviation is determined, the deviation of the input image is corrected (step S203).

次に、入力画像の中の1つの画素を抽出し(ステップS204)、抽出した画素が処理パラメータ34cに規定されるマスク領域内か否かの判定を行う(ステップS205)。ステップS204で抽出した画素が処理パラメータ34cに規定されるマスク領域内の場合(ステップS205;Yes)には、差分画像データ34dの当該画素に対する画素差分値にゼロを書き込んで(ステップS209)、ステップS210に移行する。   Next, one pixel in the input image is extracted (step S204), and it is determined whether or not the extracted pixel is within the mask area defined by the processing parameter 34c (step S205). If the pixel extracted in step S204 is within the mask region defined by the processing parameter 34c (step S205; Yes), zero is written in the pixel difference value for the pixel in the difference image data 34d (step S209), and step The process proceeds to S210.

ステップS204で抽出した画素が処理パラメータ34cに規定されるマスク領域外の場合(ステップS205;No)には、入力画像の当該画素の輝度値と背景画像の当該画素の輝度値の差の絶対値を算出する(ステップS206)。算出した輝度値の差の絶対値が、背景画像データ34bの画素情報の当該画素に対応する変動係数の所定数倍とする閾値(以下、差分判定閾値と言う)未満の場合(ステップS207;Yes)には、差分画像データ34dの当該画素に対する画素差分値にゼロを書き込んで(ステップS209)、ステップS210に移行する。   If the pixel extracted in step S204 is outside the mask area defined by the processing parameter 34c (step S205; No), the absolute value of the difference between the luminance value of the pixel of the input image and the luminance value of the pixel of the background image Is calculated (step S206). When the absolute value of the calculated difference between the brightness values is less than a threshold value (hereinafter referred to as a difference determination threshold value) that is a predetermined number times the variation coefficient corresponding to the pixel of the pixel information of the background image data 34b (step S207; Yes ), Zero is written in the pixel difference value for the pixel in the difference image data 34d (step S209), and the process proceeds to step S210.

算出した輝度値の差の絶対値が、差分判定閾値以上の場合(ステップS207;No)には、差分画像データ34dの当該画素に対する画素差分値に算出した輝度値の差の絶対値を書き込んで(ステップS208)、ステップS210に移行する。   If the absolute value of the calculated difference in luminance value is equal to or greater than the difference determination threshold (step S207; No), the absolute value of the calculated difference in luminance value is written in the pixel difference value for the pixel in the difference image data 34d. (Step S208), the process proceeds to Step S210.

次に、ステップS204〜ステップS209までの処理を全ての画素に対して実施済みか否かの判定を行い(ステップS210)、ステップS204〜ステップS209までの処理を実施していない画素が存在する場合(ステップS210;No)には、ステップS204に移行する。また、全ての画素に対してステップS204〜ステップS209の処理を実施済の場合(ステップS210;Yes)には、背景画像更新部35dは、入力画像と背景画像データ34bとから背景画像データ34bを更新して(ステップS211)、処理を終了する。ステップS211の背景画像データ34bの詳細な更新手順は後述する。   Next, it is determined whether or not the processing from step S204 to step S209 has been performed for all the pixels (step S210), and there is a pixel for which the processing from step S204 to step S209 has not been performed. In (Step S210; No), the process proceeds to Step S204. Further, when the processing of step S204 to step S209 has been performed for all the pixels (step S210; Yes), the background image update unit 35d obtains the background image data 34b from the input image and the background image data 34b. Update (step S211), the process is terminated. The detailed update procedure of the background image data 34b in step S211 will be described later.

次に、図5に示した動体画像抽出装置30による背景画像更新の処理手順を説明する。図6は、動体画像抽出装置30による背景画像更新の処理手順を示すフローチャートである。   Next, a background image update processing procedure by the moving object image extraction device 30 shown in FIG. 5 will be described. FIG. 6 is a flowchart illustrating a processing procedure of background image update performed by the moving image extracting apparatus 30.

背景画像更新部35dは、直前の入力画像と現在の入力画像から処理を行う画素を1つ抽出して(ステップS301)、直前の入力画像と現在の入力画像の抽出された画素の輝度値の差の絶対値を算出する(ステップS302)。具体的には直前の入力画像の画素をf(i,j)(0≦i<x、0≦j<y)として現在の入力画像の画素をg(i,j)(0≦i<x、0≦j<y)、直前の入力画像と現在の入力画像の差分画像の画素をΔg(i,j)(0≦i<x、0≦j<y)とすると、g(i,j)−f(i,j)の絶対値を算出してΔg(i,j)に記憶する。こうして算出されるΔg(i,j)の値が大きい場合には、当該画素は動体の影響である可能性が高い。   The background image update unit 35d extracts one pixel to be processed from the previous input image and the current input image (step S301), and calculates the luminance values of the extracted pixels of the previous input image and the current input image. The absolute value of the difference is calculated (step S302). Specifically, the pixel of the previous input image is f (i, j) (0 ≦ i <x, 0 ≦ j <y), and the pixel of the current input image is g (i, j) (0 ≦ i <x , 0 ≦ j <y), and if the difference image pixel between the previous input image and the current input image is Δg (i, j) (0 ≦ i <x, 0 ≦ j <y), then g (i, j ) −f (i, j) is calculated and stored in Δg (i, j). When the value of Δg (i, j) calculated in this way is large, there is a high possibility that the pixel is affected by a moving object.

次に、背景画像更新部35dは、当該画素に対するΔg(i,j)の値から現在の入力画素値g(i,j)の背景画像データ34bへの反映比率であるα(i,j)を決定する(ステップS303)。具体的には、Δg(i,j)を所定の正規化規則を用いて変換を行うことによって、差分が大きければ小さな、差分が小さければ大きな、0より大きく1未満のα(i,j)を算出する。   Next, the background image update unit 35d has α (i, j) which is a reflection ratio of the current input pixel value g (i, j) to the background image data 34b from the value of Δg (i, j) for the pixel. Is determined (step S303). Specifically, by converting Δg (i, j) using a predetermined normalization rule, α (i, j) greater than 0 and less than 1 is smaller if the difference is large, large if the difference is small. Is calculated.

ステップS301〜ステップS303の処理が全ての画素に対して終了していない場合(ステップS304;No)には、ステップS301に移行する。ステップS301〜ステップS303の処理が全ての画素に対して終了済の場合(ステップS304;Yes)には、全ての画素に対応する反映比率α(i,j)が決定されたこととなるので、ステップS305に移行する。   If the processing in steps S301 to S303 has not been completed for all pixels (step S304; No), the process proceeds to step S301. When the processing of step S301 to step S303 has been completed for all the pixels (step S304; Yes), the reflection ratio α (i, j) corresponding to all the pixels has been determined. The process proceeds to step S305.

次に、背景画像更新部35dは、差分画像Δg(i,j)の中の各画素の輝度値の差分の絶対値が所定値以上の画素を抽出し(ステップS305)、抽出された差分の絶対値が所定値以上の画素群の重心位置を算出し(ステップS306)、該重心位置からステップS305で抽出した全ての画素までの平均距離ave_dを算出する(ステップS307)。更に、背景画像更新部35dは、ステップS305で抽出した差分の絶対値が所定値以上の画素数の入力画像の全体画素数に対する割合ρを算出する(ステップS308)。
重心からの平均距離ave_dや差分の絶対値が所定値以上の画素数の入力画像の全体画素に対する割合ρが大きい場合には、所定値以上の輝度値の差のある画素が広範囲に散らばっていることを意味することから、局所的な変化をもたらす動体の写り込みによる影響ではなく、日照等の全体的な背景画像の変化の影響であることが想定できる。
Next, the background image update unit 35d extracts pixels in which the absolute value of the difference in luminance value of each pixel in the difference image Δg (i, j) is equal to or greater than a predetermined value (step S305). A barycentric position of a pixel group having an absolute value equal to or larger than a predetermined value is calculated (step S306), and an average distance ave_d from the barycentric position to all the pixels extracted in step S305 is calculated (step S307). Furthermore, the background image update unit 35d calculates a ratio ρ of the number of pixels in which the absolute value of the difference extracted in step S305 is equal to or larger than a predetermined value to the total number of pixels of the input image (step S308).
When the average distance ave_d from the center of gravity and the ratio ρ of the total number of pixels of the input image whose absolute value of the difference is equal to or greater than a predetermined value are large, pixels having a difference in luminance value greater than or equal to the predetermined value are scattered over a wide range. Therefore, it can be assumed that it is not the influence of the moving object that causes local changes, but the influence of changes in the overall background image such as sunlight.

背景画像更新部35dは、ステップS307で算出した所定値以上の輝度値の差の画素の重心からの平均距離ave_dとステップS308で算出した差分の絶対値が所定値以上の画素数の入力画像の全体画素に対する割合ρとの積を求め、この値に基づいて、現在の入力画像全体の背景画像データ34bへの0より大きく1未満の反映比率βを決定する(ステップS309)。   The background image update unit 35d calculates the average distance ave_d from the center of gravity of the pixels having the difference in luminance value greater than or equal to the predetermined value calculated in step S307 and the input image having the number of pixels in which the absolute value of the difference calculated in step S308 is equal to or greater than the predetermined value. A product of the ratio ρ with respect to the entire pixels is obtained, and based on this value, a reflection ratio β of greater than 0 and less than 1 to the background image data 34b of the entire current input image is determined (step S309).

背景画像更新部35dは、ステップS301〜ステップS303で決定した画素ごとの入力画像の背景画像データ34bへの反映比率α(i,j)と、ステップS309で決定した入力画像全体の背景画像データ34bへの反映比率βとから、背景画像データ34bの画素ごとの輝度値h1(i,j)(0≦i<x、0≦j<y)と画素ごとの変動係数h2(i,j)(0≦i<x、0≦j<y)とを更新する(ステップS310)。具体的には、変更後の画素ごとの輝度値は、h1(i,j)=h1(i,j)×(1−α(i,j)×β)+g(i,j)×α(i,j)×βによって算出する。画素ごとの変動係数は、h2(i,j)=h2(i,j)×(1−α(i,j)×β)+abs(g(i,j)−h1(i,j))×α(i,j)×βによって算出する。なお、abs(x)はxの絶対値を返却する関数を示す。   The background image update unit 35d reflects the reflection ratio α (i, j) of the input image for each pixel determined in steps S301 to S303 to the background image data 34b and the background image data 34b for the entire input image determined in step S309. From the reflection ratio β, the luminance value h1 (i, j) (0 ≦ i <x, 0 ≦ j <y) for each pixel of the background image data 34b and the variation coefficient h2 (i, j) for each pixel ( 0 ≦ i <x, 0 ≦ j <y) is updated (step S310). Specifically, the luminance value for each pixel after the change is h1 (i, j) = h1 (i, j) × (1−α (i, j) × β) + g (i, j) × α ( i, j) × β. The variation coefficient for each pixel is h2 (i, j) = h2 (i, j) × (1−α (i, j) × β) + abs (g (i, j) −h1 (i, j)) × Calculated by α (i, j) × β. Note that abs (x) represents a function that returns the absolute value of x.

本実施例では、1枚の直前画像と入力画像とから画素ごとの反映比率α(i,j)及び画像全体の反映比率βを算出する例を示したが、より精度を高めるために、複数枚の直前画像と入力画像からそれぞれの直前画像に対する画素ごとの反映比率α(i,j)及び画像全体の反映比率βを算出して、複数の直前画像に対応する反映比率α(i,j)の最小値を画素ごとの反映比率とし、それぞれの直前画像に対応する反映比率βの最大値を画像全体の反映比率としても良い。   In the present embodiment, an example in which the reflection ratio α (i, j) for each pixel and the reflection ratio β for the entire image are calculated from one immediately preceding image and the input image has been described. The reflection ratio α (i, j) for each pixel with respect to each previous image and the reflection ratio β of the entire image are calculated from the immediately preceding image and the input image, and the reflection ratio α (i, j corresponding to a plurality of previous images is calculated. ) May be the reflection ratio for each pixel, and the maximum value of the reflection ratio β corresponding to each immediately preceding image may be the reflection ratio of the entire image.

次に、図2に示した動体画像抽出装置30による動体候補抽出の処理手順を説明する。図7は、動体画像抽出装置30による動体候補抽出の処理手順を示すフローチャートである。   Next, a processing procedure of moving object candidate extraction by the moving object image extraction device 30 shown in FIG. 2 will be described. FIG. 7 is a flowchart showing a processing procedure of moving object candidate extraction by the moving object image extraction device 30.

動体候補抽出部35fは、背景画像データ34bと入力画像から差分画像生成部35cが生成した(a)に示す差分画像である差分画像データ34dから、隣接する差分画素をまとめた差分画素群を1つの動体候補として、(b)に示す第一段階動体候補を抽出し、抽出した動体候補ごとに動体候補を構成する画素に係る情報を動体候補データ34eに登録する(ステップS401)。(b)に示す第一段階動体候補は、ステップS401の動体候補抽出処理(第一段階)によって、7個の動体候補Obj1〜Obj7が抽出された例を示している。   The moving object candidate extraction unit 35f sets a difference pixel group obtained by collecting adjacent difference pixels from the difference image data 34d, which is the difference image shown in (a), generated by the difference image generation unit 35c from the background image data 34b and the input image. The first stage moving body candidate shown in (b) is extracted as one moving body candidate, and information relating to the pixels constituting the moving body candidate is registered in the moving body candidate data 34e for each extracted moving body candidate (step S401). The first stage moving body candidate shown in (b) shows an example in which seven moving body candidates Obj1 to Obj7 are extracted by the moving body candidate extraction process (first stage) in step S401.

次に、影除去部35eは、(b)の第一段階動体候補に示す抽出された動体候補Obj1〜Obj7ごとに、影除去の処理を行い(ステップS402)、影と判定した差分画素を排除した影除去後の(c)に示す差分画像を生成して、差分画像データ34dの内容を更新する(ステップS403)。(c)に示す影除去後差分画像は、(b)に示す第一段階動体候補に図示した動体候補Obj2、Obj3及びObj5に含まれていた影が除去された例を示している。   Next, the shadow removal unit 35e performs shadow removal processing for each of the extracted moving object candidates Obj1 to Obj7 shown in the first-stage moving object candidate in (b) (step S402), and eliminates the difference pixels determined as shadows. The difference image shown in (c) after the shadow removal is generated, and the content of the difference image data 34d is updated (step S403). The difference image after shadow removal shown in (c) shows an example in which the shadow included in the moving object candidates Obj2, Obj3 and Obj5 shown in the first stage moving object candidate shown in (b) is removed.

次に、動体候補抽出部35fは、差分画像データ34dに記憶されている(c)に示す影除去後差分画像から、ステップS401と同様の処理を行うことによって、影除去された動体候補として、(d)に示す第三段階動体候補を抽出し、抽出した動体候補を動体候補データ34eに登録する(ステップS404)。(d)に示す第三段階動体候補は、ステップS404の動体候補再抽出処理(第三段階)によって、7個の動体候補Obj1、Obj12、Obj13、Obj4、Obj15、Obj6及びObj7が抽出された例を示している。また、(d)に示す第三段階動体候補は、(b)に示す第一段階動体候補と比較すると、(b)に示す第一段階動体候補で影を含んでいた動体候補Obj2、Obj3及びObj5が、ステップS402による影除去処理の結果、それぞれ影が除去された動体候補Obj12、Obj13及びObj15として抽出された例を示している。   Next, the moving object candidate extraction unit 35f performs a process similar to that in step S401 from the difference image after shadow removal illustrated in (c) stored in the difference image data 34d, thereby obtaining a moving object candidate from which shadow has been removed. The third stage moving object candidate shown in (d) is extracted, and the extracted moving object candidate is registered in the moving object candidate data 34e (step S404). The third stage moving body candidate shown in (d) is an example in which seven moving body candidates Obj1, Obj12, Obj13, Obj4, Obj15, Obj6 and Obj7 are extracted by the moving body candidate re-extraction process (third stage) in step S404. Is shown. In addition, the third stage moving body candidate shown in (d) is compared with the first stage moving body candidate shown in (b), and the moving body candidates Obj2, Obj3 and the first stage moving body candidate shown in (b) included shadows. An example is shown in which Obj5 is extracted as moving object candidates Obj12, Obj13, and Obj15 from which shadows have been removed as a result of the shadow removal processing in step S402.

ステップS404で抽出された(d)に示す第三段階動体候補は、現実には1つの動体が複数の動体候補として抽出されていることもある。このようなことを考慮して、動体候補抽出部35fは、同一の動体の可能性があると判定される動体候補を、所定のルールに従って抽出し、複数の動体候補を融合させた動体候補を含めた(e)に示す第四段階動体候補を生成し、動体候補データ34eに反映する(ステップS405)。本処理の詳細な処理手順は後述する。(e)に示す第四段階動体候補は、ステップS405の動体候補融合処理(第四段階)により、動体候補Obj12とObj13が同一の動体である可能性があると判定し、(d)に示す第三段階動体候補で示された動体候補に加えて動体候補Obj12とObj13とを融合させた動体候補Obj20が追加となった例を示している。   The third stage moving object candidate shown in (d) extracted in step S404 may actually have one moving object extracted as a plurality of moving object candidates. In consideration of this, the moving object candidate extraction unit 35f extracts moving object candidates that are determined to have the same moving object according to a predetermined rule, and selects moving object candidates obtained by fusing a plurality of moving object candidates. The fourth stage moving object candidate shown in the included (e) is generated and reflected in the moving object candidate data 34e (step S405). A detailed processing procedure of this processing will be described later. The fourth stage moving object candidate shown in (e) is determined by the moving object candidate fusion process (fourth stage) in step S405 to be likely to be the same moving object, and shown in (d). In this example, a moving object candidate Obj20 obtained by merging moving object candidates Obj12 and Obj13 is added to the moving object candidate indicated by the third stage moving object candidate.

次に、動体候補抽出部35fは、(e)に示す第四段階動体候補から、検出対象とする画像上の大きさの上限値及び下限値と比較して、大きさが該上限値を超えるか該下限値を下回るような動体候補の除外を行って、動体候補データ34eに反映する(ステップS406)。(f)に示す第五段階動体候補は、ステップS406の動体候補絞込処理(第五段階)により、(e)に示す第四段階動体候補に存在した動体候補Obj1、Obj4、Obj6及びObj7が検出対象動体の大きさの下限値を下回ったことによって削除された例を示している。   Next, the moving object candidate extraction unit 35f compares the upper limit value and the lower limit value of the size on the image to be detected from the fourth stage moving object candidate shown in (e), and the size exceeds the upper limit value. The moving object candidate that falls below the lower limit is excluded and reflected in the moving object candidate data 34e (step S406). The fifth stage moving object candidate shown in (f) is obtained by moving object candidates Obj1, Obj4, Obj6 and Obj7 existing in the fourth stage moving object candidate shown in (e) by the moving object candidate narrowing process (fifth stage) in step S406. An example in which the detection target moving object is deleted because it falls below the lower limit value of the size of the moving object to be detected is shown.

次に、図7に示した動体候補融合処理の概念を説明する。図8は、動体候補融合処理の概念を説明するための説明図である。図8による動体候補融合処理の概念の説明では便宜上、図7で示した動体候補再抽出処理(ステップS404)において、図8の(a)に示すようにObj1〜Obj3の3つの動体候補が抽出されたケースを想定して説明を行う。   Next, the concept of the moving object candidate fusion process shown in FIG. 7 will be described. FIG. 8 is an explanatory diagram for explaining the concept of moving object candidate fusion processing. In the description of the concept of the moving object candidate fusion process in FIG. 8, for the sake of convenience, in the moving object candidate re-extraction process (step S404) shown in FIG. 7, three moving object candidates Obj1 to Obj3 are extracted as shown in FIG. The explanation will be made assuming the case.

まず、(a)に示す全ての動体候補間の融合率を算出して、動体候補融合率表T1を生成する。2つの動体候補i、動体候補jについて、動体候補iに対する動体候補jの融合率とは、動体候補iの矩形の範囲内に、動体候補jの差分画素の含まれている割合を示す。動体候補融合率表は、動体候補数がn個であった場合にはn行n列の表であり、i行j列の要素は、動体候補iに対する動体候補jの融合率を示す。動体候補融合率表T1は、全ての動体候補の矩形が他の動体候補の差分画素に重なっていないことから、動体候補間の融合率の全ての要素は「0%」であることを示している。動体候補の融合は、融合率が所定値(例えば50%)以上の場合に実施することから、ここでは動体候補の融合処理は行わない。   First, a fusion rate between all moving object candidates shown in (a) is calculated, and a moving object candidate fusion rate table T1 is generated. Regarding the two moving object candidates i and moving object candidates j, the fusion rate of moving object candidates j with respect to moving object candidates i indicates the ratio of difference pixels of moving object candidates j within the rectangular range of moving object candidates i. The moving object candidate fusion rate table is a table of n rows and n columns when the number of moving object candidates is n, and an element of i row and j column indicates a fusion rate of moving object candidate j with respect to moving object candidate i. The moving object candidate fusion rate table T1 indicates that all elements of the fusion rate between moving object candidates are “0%” because the rectangles of all moving object candidates do not overlap the difference pixels of other moving object candidates. Yes. Since the fusion of moving object candidates is performed when the fusion rate is equal to or higher than a predetermined value (for example, 50%), the moving object candidate fusion process is not performed here.

次に、(b)に示すように動体候補ごとの矩形範囲を所定量(例えば上下左右方向にそれぞれ数画素分)拡大する。拡大した各動体候補の矩形範囲で、動体候補間の融合率を算出して、動体候補融合率表T2を生成する。動体候補融合率表T2は、動体候補Obj2の矩形範囲に動体候補Obj1の差分画素が「10%」含まれ、それ以外の組合せの動体候補間の融合率は「0%」であることを示している。動体候補の融合率が所定値(例えば50%)以上になっていないことから、動体候補の融合処理は行わない。   Next, as shown in (b), the rectangular range for each moving object candidate is enlarged by a predetermined amount (for example, several pixels in the vertical and horizontal directions). A fusion rate between moving object candidates is calculated within the expanded rectangular range of each moving object candidate, and a moving object candidate fusion rate table T2 is generated. The moving object candidate fusion rate table T2 indicates that the difference pixel of the moving object candidate Obj1 is included in the rectangular range of the moving object candidate Obj2, and the fusion rate between moving object candidates of other combinations is “0%”. ing. Since the fusion rate of the moving object candidates is not equal to or higher than a predetermined value (for example, 50%), the moving object candidate fusion process is not performed.

次に、(c)に示すように動体候補ごとの矩形範囲を所定量拡大して、拡大した各動体候補ごとの矩形範囲で、動体候補間の融合率を算出して、動体候補融合率表T3を生成する。動体候補融合率表T3は、動体候補Obj2の矩形範囲に動体候補Obj1の差分画素が「55%」、動体候補Obj3の差分画素が「5%」含まれ、それ以外の組合せの動体候補間の融合率は「0%」であることを示している。ここで、動体候補Obj2と動体候補Obj1の融合率が「55%」であり、動体候補の融合率が所定値(例えば50%)以上になっていることから、動体候補Obj1と動体候補Obj2を融合した動体候補であるObj4を追加する。   Next, as shown in (c), the rectangular range for each moving object candidate is enlarged by a predetermined amount, the fusion rate between moving object candidates is calculated in the expanded rectangular range for each moving object candidate, and the moving object candidate fusion rate table T3 is generated. In the moving object candidate fusion rate table T3, the difference pixel of the moving object candidate Obj1 is included in the rectangular range of the moving object candidate Obj2, and the difference pixel of the moving object candidate Obj3 is included in “5%”. The fusion rate is “0%”. Here, since the fusion rate of the moving object candidate Obj2 and the moving object candidate Obj1 is “55%” and the moving object candidate has a fusion rate equal to or higher than a predetermined value (for example, 50%), the moving object candidate Obj1 and the moving object candidate Obj2 are Add Obj4 which is a fused moving object candidate.

次に、(c)に示した動体候補に対して、融合された元の動体候補Obj1とObj2とを除外して、融合で生成した動体候補Obj4を追加した(d)に示す全ての動体候補に対して、動体候補間の融合率を算出して、動体候補融合率表T4を生成する。動体候補融合率表T4は、動体候補Obj4の矩形範囲に動体候補Obj3の差分画素が「5%」含まれ、それ以外の組合せの動体候補間の融合率は「0%」であることを示している。よって、動体候補の融合率が所定値(例えば50%)以上になっていないことから、動体候補の融合処理は行わない。   Next, the original moving object candidates Obj1 and Obj2 are excluded from the moving object candidates shown in (c) and the moving object candidate Obj4 generated by the fusion is added. All moving object candidates shown in (d) On the other hand, the fusion rate between moving object candidates is calculated to generate a moving object candidate fusion rate table T4. The moving object candidate fusion rate table T4 indicates that the difference pixel of the moving object candidate Obj3 is included in the rectangular range of the moving object candidate Obj4 and the fusion rate between moving object candidates of other combinations is “0%”. ing. Therefore, since the fusion rate of moving object candidates is not equal to or higher than a predetermined value (for example, 50%), the moving object candidate fusion process is not performed.

以降、所定の動体候補矩形拡大最大回数に至るまで動体候補の矩形範囲を拡大して、動体候補間の融合率を算出して、融合率が所定値(例えば50%)以上の場合に、動体候補の融合を行うということを繰り返すことによって、融合した動体候補を生成する。   Thereafter, the rectangular range of the moving object candidates is expanded up to a predetermined maximum number of moving object candidate rectangles, the fusion rate between moving object candidates is calculated, and when the fusion rate is a predetermined value (for example, 50%) or more, the moving object By repeating the candidate fusion, a fused moving object candidate is generated.

上記説明の動体候補の融合処理で、動体候補の融合を行ったならば動体候補融合率表からは融合された動体候補を除外したが、融合された動体候補は動体候補から除外したわけではない。ここで説明した動体候補の融合処理は、1つの動体の可能性のある動体候補を抽出する処理なので、動体候補の絞込はこのフェーズでは行わない。   If moving object candidates are merged in the moving object candidate fusion process described above, the fused moving object candidates are excluded from the moving object candidate fusion rate table, but the fused moving object candidates are not excluded from the moving object candidates. . Since the moving object candidate fusion process described here is a process for extracting a moving object candidate that may be one moving object, the moving object candidates are not narrowed down in this phase.

次に、図7に示す動体画像抽出装置30による動体候補融合の処理手順を説明する。図9は、動体画像抽出装置30による動体候補融合の処理手順を示すフローチャートである。   Next, a processing procedure for moving object candidate fusion by the moving object image extraction device 30 shown in FIG. 7 will be described. FIG. 9 is a flowchart illustrating a moving object candidate fusion processing procedure performed by the moving object image extraction device 30.

まず、動体候補抽出部35fは、動体候補矩形範囲の拡大回数をゼロに初期化を行い(ステップS501)、図7のステップS404の動体候補再抽出(第三段階)で影除去後差分画像から抽出した動体候補の、全ての動体候補間の融合率を算出して、動体候補融合率表を作成し(ステップS502)、作成された動体候補融合率表の中の最大の融合率を有する要素を特定する(ステップS503)。   First, the moving object candidate extraction unit 35f initializes the number of expansions of the moving object candidate rectangle range to zero (step S501), and re-extracts the moving object candidate from step S404 of FIG. Calculate the fusion rate between all the moving object candidates of the extracted moving object candidates, create a moving object candidate fusion rate table (step S502), and have the maximum fusion rate in the created moving object candidate fusion rate table Is specified (step S503).

ステップS503で抽出された動体候補融合率表の中の最大の融合率を有する要素の値を参照し、融合率の最大値が融合実施の基準値(例えば50%)以上か否かの判定を行う(ステップS504)。動体候補融合率表の融合率の最大値が基準値(例えば50%)以上の場合(ステップS504;Yes)には、動体候補融合率表の融合率の最大値の要素に対応する動体候補を融合して新たな動体候補を生成し、動体候補データ34eに追加する(ステップS505)。   With reference to the value of the element having the maximum fusion rate in the moving object candidate fusion rate table extracted in step S503, it is determined whether or not the maximum value of the fusion rate is equal to or greater than a fusion implementation reference value (for example, 50%). This is performed (step S504). If the maximum value of the fusion rate in the moving object candidate fusion rate table is greater than or equal to a reference value (for example, 50%) (step S504; Yes), the moving object candidate corresponding to the element of the maximum fusion rate in the moving object candidate fusion rate table is selected. A new moving object candidate is generated by merging and added to the moving object candidate data 34e (step S505).

また、動体候補抽出部35fは、融合率の算出対象から融合された動体候補を除外(ステップS506)し、動体候補に追加された融合してできた動体候補を追加した動体候補融合率表を作成して(ステップS507)、ステップS503に移行する。   In addition, the moving object candidate extraction unit 35f excludes the moving object candidates merged from the fusion rate calculation target (step S506), and adds the moving object candidates generated by the fusion added to the moving object candidates. Create (step S507), and proceed to step S503.

動体候補融合率表の融合率の最大値が基準値(例えば50%)未満の場合(ステップS504;No)には、動体候補矩形範囲の拡大回数が所定のの動体候補矩形拡大最大回数と等しいか否かを判断し(ステップS508)、動体候補矩形範囲の拡大回数が所定の動体候補矩形拡大最大回数と等しい場合(ステップS508;Yes)には、処理を終了する。動体候補矩形範囲の拡大回数が所定の動体候補矩形拡大最大回数と等しくない場合(ステップS508;No)には、動体候補融合率表に含まれる動体候補の矩形の範囲を所定の規則に従って拡大する(ステップS509)。   When the maximum value of the fusion rate in the moving object candidate fusion rate table is less than a reference value (for example, 50%) (step S504; No), the number of expansions of the moving object candidate rectangle range is equal to the predetermined maximum number of moving object candidate rectangles. If the number of expansions of the moving object candidate rectangle range is equal to the predetermined maximum number of moving object candidate rectangle expansions (step S508; Yes), the process is terminated. When the number of expansions of the moving object candidate rectangle range is not equal to the predetermined maximum number of moving object candidate rectangle expansions (step S508; No), the moving object candidate rectangle range included in the moving object candidate fusion rate table is expanded according to a predetermined rule. (Step S509).

また、動体候補抽出部35fは、動体候補の矩形範囲の変更に伴って動体候補融合率表の更新を行い(ステップS510)、動体候補矩形範囲の拡大回数をカウントアップして(ステップS511)、ステップS503に移行する。   Further, the moving object candidate extraction unit 35f updates the moving object candidate fusion rate table in accordance with the change of the moving object candidate rectangular range (step S510), counts up the number of expansions of the moving object candidate rectangular range (step S511), The process proceeds to step S503.

次に、図2に示す動体画像抽出装置30による動体候補絞込の処理手順を説明する。図10は、動体画像抽出装置30による動体候補絞込の処理手順を示すフローチャートである。   Next, a moving object candidate narrowing-down process procedure by the moving object image extraction device 30 shown in FIG. 2 will be described. FIG. 10 is a flowchart illustrating a moving object candidate narrowing-down process performed by the moving object image extraction device 30.

動体候補絞込部35gは、動体候補データ34eに抽出されている動体候補から、(a)に示すグループ1において動体候補Obj2及びObj3は動体候補Obj1に包含されているというような、動体候補の矩形範囲に包含関係のある動体候補群を1つのグループとして、同様な全てのグループの抽出を行う(ステップS601)。   The moving object candidate narrowing-down unit 35g selects moving object candidates such that moving object candidates Obj2 and Obj3 are included in the moving object candidate Obj1 in the group 1 shown in (a) from the moving object candidates extracted in the moving object candidate data 34e. All the similar groups are extracted with the moving object candidate group having the inclusion relation in the rectangular range as one group (step S601).

次に、動体候補絞込部35gは、ステップS601で抽出された未処理の1つのグループに対して、動体候補の包含関係から、独立した動体のあり得る組み合せ(以下、「パターン」と言う)を作成する(ステップS602)。(a)に示すグループ1には3つの動体候補Obj1〜Obj3が存在し、動体候補Obj2とObj3は、動体候補Obj1に含まれていることを示し、ステップS602のグループ毎のパターン作成処理によって、グループ1からは、(b)に示す動体候補Obj2とObj3とがそれぞれ独立した動体であるとするパターン1と、(c)に示す動体候補Obj2とObj3の融合によって生成された動体候補Obj1が1つの動体であるとするパターン2とが作成された例を示している。   Next, the moving object candidate narrowing-down unit 35g has a possible combination of independent moving objects (hereinafter referred to as “pattern”) from the inclusion relationship of moving object candidates for one unprocessed group extracted in step S601. Is created (step S602). In the group 1 shown in (a), there are three moving object candidates Obj1 to Obj3, and the moving object candidates Obj2 and Obj3 are included in the moving object candidate Obj1, and by the pattern creation process for each group in step S602, From group 1, pattern 1 in which moving object candidates Obj2 and Obj3 shown in (b) are independent moving objects, and moving object candidates Obj1 generated by the fusion of moving object candidates Obj2 and Obj3 shown in (c) are 1 An example in which a pattern 2 that is one moving object is created is shown.

次に、動体候補絞込部35gは、ステップS602で作成した未評価のパターンについて、該パターンに含まれる動体候補と入力画像の前後各2画像とに含まれる動体候補との類似性の評価を実施して、各動体候補の類似性の評価からパターンの評価を実施する(ステップS603)。図10のステップS603のパターン評価は、ステップS602で生成された1つのパターンと、(d)及び(e)に示す直前の2枚の入力画像の動体候補と、(f)と(g)に示す直後の2枚の入力画像の動体候補とを入力情報として、当該パターンの類似性の評価を実施する。例えば、距離と大きさ等に基づいて類似性は評価される。   Next, the moving object candidate narrowing down unit 35g evaluates the similarity between the moving object candidate included in the pattern and the moving object candidate included in each of the two images before and after the input image for the unevaluated pattern created in step S602. The pattern is evaluated from the similarity evaluation of each moving object candidate (step S603). The pattern evaluation in step S603 in FIG. 10 includes one pattern generated in step S602, moving object candidates for the immediately preceding two input images shown in (d) and (e), and (f) and (g). The similarity of the pattern is evaluated using the moving object candidates of the two input images immediately after the input as input information. For example, similarity is evaluated based on distance, size, and the like.

動体候補絞込部35gは、ステップS602で作成された全てのパターンについてステップS603のパターンの評価が終了しているか否かを判定し(ステップS604)、未評価のパターンが残っている場合(ステップS604;No)には、ステップS603に移行する。全てのパターンについて評価済の場合(ステップS604;Yes)には、ステップS602で作成したグループのパターンの中で評価の高いパターンを決定し、それ以外のパターンに属する動体候補を動体候補データ34eから削除する(ステップS605)。図10のステップS605のパターン決定の処理によって、(b)に示すパターン1の評価結果と、(c)に示すパターン2の評価結果を比較して、グループ1の動体候補は(h)に示すパターン1に決定したことを示している。   The moving object candidate narrowing-down unit 35g determines whether or not the evaluation of the pattern in step S603 has been completed for all the patterns created in step S602 (step S604), and if an unevaluated pattern remains (step S604). In step S604; No), the process proceeds to step S603. If all patterns have been evaluated (step S604; Yes), a pattern with high evaluation is determined among the patterns of the group created in step S602, and moving object candidates belonging to other patterns are determined from the moving object candidate data 34e. It deletes (step S605). The pattern determination process in step S605 of FIG. 10 compares the evaluation result of pattern 1 shown in (b) with the evaluation result of pattern 2 shown in (c), and moving object candidates of group 1 are shown in (h). This shows that the pattern 1 is determined.

次に、動体候補絞込部35gは、ステップS601で抽出した全てのグループに対する処理が終了したか否かの判定を行い(ステップS606)、まだ処理されていないグループが存在する場合(ステップS606;No)には、ステップS602に移行する。また、全てのグループに対する処理が終了している場合(ステップS606;Yes)には、動体候補データ34eの全ての動体候補に対して、相関演算によって動体候補の妥当性の評価を行い、動体ではないと判定された動体候補を動体候補データ34eから削除して(ステップS607)、処理を終了する。   Next, the moving object candidate narrowing-down unit 35g determines whether or not the processing for all the groups extracted in step S601 has been completed (step S606), and if there is a group that has not yet been processed (step S606; No), go to step S602. If the processing for all the groups has been completed (step S606; Yes), the validity of the moving object candidate is evaluated by correlation calculation for all moving object candidates in the moving object candidate data 34e. The moving object candidate determined not to be deleted from the moving object candidate data 34e (step S607), and the process ends.

上述してきたように、本実施例では、複数枚の画像から動体の写りこんでいる影響を排除して画素ごとに輝度値及びそのバラツキの程度を示す変動係数を有する背景画像を自動生成し、背景画像と入力画像との差分画像抽出は、画素ごとに輝度値の差が、画素ごとに有する変動係数の所定倍数を閾値として行い、入力画像入力の都度、該入力画像に写りこんだ動体の影響を排除しつつ、日照等の環境変化による背景画像の変化を逐次自動反映するよう構成したので、撮像環境が変化しても人的労力を要することなく適切な閾値を設定し、もって動体画像を効率的に抽出することができる。   As described above, in this embodiment, a background image having a variation coefficient indicating a luminance value and a degree of variation of each pixel is automatically generated by eliminating the influence of moving objects from a plurality of images, The difference image extraction between the background image and the input image is performed by using a predetermined multiple of the variation coefficient of each pixel as a threshold value for the difference in luminance value for each pixel, and each time the input image is input, the moving object reflected in the input image is extracted. Since it is configured to automatically reflect changes in the background image due to environmental changes such as sunshine while eliminating the influence, an appropriate threshold value can be set without requiring human labor even if the imaging environment changes, and moving image Can be extracted efficiently.

なお、上述の本実施例では背景画像の更新処理において、初期背景画像生成とは異なる手順で更新処理を実施したが、本発明はこれに限定されるものではなく、背景画像の更新時に初期背景画像と同じ手順で背景画像を生成してもよい。   In the above-described embodiment, the update process of the background image is performed according to a procedure different from the initial background image generation. However, the present invention is not limited to this, and the initial background is updated when the background image is updated. The background image may be generated in the same procedure as the image.

また、上述の本実施例で図示した各構成は機能概略的なものであり、必ずしも物理的に図示の構成をされていることを要しない。すなわち、各装置の分散・統合の形態は図示のものに限られず、その全部又は一部を各種の負荷や使用状況などに応じて、任意の単位で機能的又は物理的に分散・統合して構成することができる。   Each configuration illustrated in the above-described embodiment is functionally schematic and does not necessarily need to be physically configured as illustrated. That is, the form of distribution / integration of each device is not limited to that shown in the figure, and all or a part thereof may be functionally or physically distributed / integrated in an arbitrary unit according to various loads or usage conditions. Can be configured.

以上のように、本発明に係る動体画像抽出方法及び動体画像抽出装置は、撮像環境が変化しても人的労力を要することなく適切な閾値を設定し、もって動体画像を効率的に抽出することに適している。   As described above, the moving object image extraction method and the moving object image extraction device according to the present invention set an appropriate threshold without requiring human labor even when the imaging environment changes, and efficiently extract moving object images. Suitable for that.

10 監視カメラ
20 ネットワーク
30 動体画像抽出装置
31 I/F部
32 表示部
33 入力部
34 記憶部
34a 蓄積画像データ
34b 背景画像データ
34c 処理パラメータ
34d 差分画像データ
34e 動体候補データ
35 制御部
35a 画像取得部
35b 初期背景画像生成部
35c 差分画像生成部
35d 背景画像更新部
35e 影除去部
35f 動体候補抽出部
35g 動体候補絞込部
T1〜T4 動体候補融合率表
DESCRIPTION OF SYMBOLS 10 Surveillance camera 20 Network 30 Moving body image extraction apparatus 31 I / F part 32 Display part 33 Input part 34 Storage part 34a Accumulated image data 34b Background image data 34c Processing parameter 34d Difference image data 34e Moving body candidate data 35 Control part 35a Image acquisition part 35b initial background image generation unit 35c difference image generation unit 35d background image update unit 35e shadow removal unit 35f moving object candidate extraction unit 35g moving object candidate narrowing-down unit T1 to T4 moving object candidate fusion rate table

Claims (11)

自然光又は照明光の光量と照射方向とのうち少なくともいずれかが変動する可能性のある環境下で撮像された時系列順に並んだ複数枚の撮像画像を用い、該撮像画像内に含まれる動体の像を動体画像として抽出する動体画像抽出方法であって、
前記動体による影響が排除された背景画像を取得する背景画像取得ステップと、
前記背景画像取得ステップにより取得された前記背景画像と前記撮像画像との差分である差分画像を生成する差分画像生成ステップと、
前記背景画像と前記撮像画像から前記背景画像を更新する背景画像更新ステップと、
前記差分画像生成ステップにより生成された前記差分画像から1つの動体である可能性のある部分画像を動体候補として抽出する動体候補抽出ステップと、
前記動体候補抽出ステップにより複数の前記動体候補が抽出された場合に、複数の前記動体候補から適切な前記動体候補を絞り込む動体候補絞込ステップと
を含んだことを特徴とする動体画像抽出方法。
Using a plurality of captured images arranged in time series in an environment where at least one of the amount of natural light or illumination light and the irradiation direction may fluctuate, a moving object included in the captured image A moving image extraction method for extracting an image as a moving image,
A background image acquisition step of acquiring a background image in which the influence of the moving object is eliminated;
A difference image generation step for generating a difference image that is a difference between the background image acquired by the background image acquisition step and the captured image;
A background image update step of updating the background image from the background image and the captured image;
A moving object candidate extraction step of extracting a partial image that may be one moving object as a moving object candidate from the difference image generated by the difference image generating step;
A moving object image extracting method comprising: a moving object candidate narrowing-down step for narrowing down an appropriate moving object candidate from a plurality of moving object candidates when a plurality of moving object candidates are extracted in the moving object candidate extracting step.
前記背景画像取得ステップは、撮像タイミングの異なる複数の撮像画像について、同一の位置に対応する画素ごとに前記複数の撮像画像の輝度値の分布を分析して、輝度値の分布に対して特異な値を示す輝度値を除外して、除外されずに残った輝度値を使用して背景画像の画素の輝度値を算出することを特徴とする請求項1に記載の動体画像抽出方法。   The background image acquisition step analyzes the luminance value distribution of the plurality of captured images for each pixel corresponding to the same position for a plurality of captured images with different imaging timings, and is specific to the luminance value distribution. 2. The moving object image extraction method according to claim 1, wherein a luminance value of a pixel in the background image is calculated by excluding a luminance value indicating a value and using a luminance value remaining without being excluded. 前記撮像画像と当該撮像画像の直前に撮像された撮像画像である直前撮像画像との画素ごとの差分である輝度差分値を算出し、前記輝度差分値が所定値以上の画素の画像全体における分布を評価し、前記輝度差分値並びに前記輝度差分値が所定値以上の画素の画像全体における分布の評価結果に応じて、前記撮像画像の前記背景画像への画素ごとの反映比率を算出する反映比率算出ステップをさらに含み、
前記背景画像更新ステップは、前記反映比率算出ステップで算出された画素ごとの前記反映比率を使用して、画素ごとに前記撮像画像と前記背景画像とを前記反映比率と(1−前記反映比率)とで加重平均することにより更新後の前記背景画像を生成する
ことを特徴とする請求項1又は2に記載の動体画像抽出方法。
A luminance difference value that is a difference for each pixel between the captured image and the immediately preceding captured image that is the captured image captured immediately before the captured image is calculated, and a distribution of the pixels in which the luminance difference value is equal to or greater than a predetermined value in the entire image The reflection ratio for calculating the reflection ratio for each pixel in the background image of the captured image in accordance with the evaluation result of the distribution of the luminance difference value and the distribution of the entire pixels of the pixels having the luminance difference value equal to or greater than a predetermined value. A calculation step,
The background image update step uses the reflection ratio for each pixel calculated in the reflection ratio calculation step, and sets the captured image and the background image for each pixel as the reflection ratio (1-the reflection ratio). The moving body image extraction method according to claim 1, wherein the background image after update is generated by performing a weighted average with.
前記背景画像取得ステップは、前記背景画像の画素ごとに輝度値と輝度値のバラツキの程度を示す変動係数を生成し、
前記差分画像生成ステップは、各画素について前記背景画像と前記撮像画像との輝度差分値を算出し、算出した輝度差分値と前記変動係数を比較して、前記撮像画像の画素を前記差分画像に採用するか否かを決定する
ことを特徴とする請求項1、2又は3に記載の動体画像抽出方法。
The background image acquisition step generates a coefficient of variation indicating the degree of variation in luminance value and luminance value for each pixel of the background image,
The difference image generation step calculates a luminance difference value between the background image and the captured image for each pixel, compares the calculated luminance difference value with the variation coefficient, and converts the pixel of the captured image into the difference image. 4. The moving object image extraction method according to claim 1, wherein it is determined whether or not to employ the moving object image.
前記撮像画像と前記背景画像とを比較して撮像装置のゆれを補正するゆれ補正ステップをさらに含み、
前記差分画像生成ステップは、前記ゆれ補正ステップにより補正した補正撮像画像と前記背景画像との差分である差分画像を生成する
ことを特徴とする請求項1〜4のいずれか一つに記載の動体画像抽出方法。
Further comprising a shake correction step of correcting the shake of the imaging device by comparing the captured image and the background image;
The moving object according to claim 1, wherein the difference image generation step generates a difference image that is a difference between the corrected captured image corrected by the shake correction step and the background image. Image extraction method.
前記撮像画像に対して前記差分画像の抽出対象外とするマスク領域を設定するマスク領域設定ステップをさらに含み、
前記差分画像生成ステップは、前記マスク領域設定ステップで設定されたマスク領域内の画素については差分なしと判定する、あるいは前記差分画像生成ステップを実行しない
ことを特徴とする請求項1〜5のいずれか一つに記載の動体画像抽出方法。
A mask area setting step of setting a mask area to be excluded from extraction of the difference image with respect to the captured image;
The difference image generation step determines that there is no difference for the pixels in the mask area set in the mask area setting step, or does not execute the difference image generation step. The moving body image extraction method according to claim 1.
前記差分画像生成ステップは、前記環境下においてコントラストが最も弱い状態に対応する閾値を使用して前記差分画像を生成することを特徴とする請求項1〜6のいずれか一つに記載の動体画像抽出方法。   The moving image according to claim 1, wherein the difference image generation step generates the difference image using a threshold value corresponding to a state in which the contrast is weakest in the environment. Extraction method. 前記動体候補抽出ステップは、前記差分画像生成ステップで生成された前記差分画像から、連続する対象物の画素群を1つの動体候補として抽出し、抽出した動体候補の輝度値に関係する特性を評価し、当該特性の評価結果から前記動体候補に含まれる対象物の画素が影であるか否かを判定するための影判定閾値である輝度値を決定し、当該影判定閾値である輝度値によって前記動体候補から影の除去を行うことを特徴とする請求項1〜7のいずれか一つに記載の動体画像抽出方法。   In the moving object candidate extraction step, a pixel group of continuous objects is extracted as one moving object candidate from the difference image generated in the difference image generating step, and a characteristic related to the luminance value of the extracted moving object candidate is evaluated. Then, a luminance value that is a shadow determination threshold for determining whether or not the pixel of the object included in the moving object candidate is a shadow is determined from the evaluation result of the characteristic, and the luminance value that is the shadow determination threshold The moving object image extraction method according to claim 1, wherein a shadow is removed from the moving object candidate. 前記動体候補絞込ステップは、包含関係のある動体候補をグループとして、前記グループの中であり得る動体候補の組合せをパターンとして列挙して、列挙したパターンに含まれる動体候補と時系列上で隣接する撮像画像から抽出された動体候補とを類似性に基づいて比較することにより、適切なパターンを判定することにより前記動体候補を絞り込むことを特徴とする請求項1〜8のいずれか一つに記載の動体画像抽出方法。   The moving object candidate narrowing-down step enumerates moving object candidates having inclusion relations as a group, enumerates combinations of moving object candidates that can be in the group as patterns, and adjoins the moving object candidates included in the enumerated pattern in time series The moving object candidates are narrowed down by determining an appropriate pattern by comparing the moving object candidates extracted from the captured image to be based on the similarity. The moving body image extraction method described. 前記動体候補抽出ステップは、前記差分画像生成ステップで生成された前記差分画像から、連続する対象物の画素群を1つの動体候補として一旦抽出し、別の候補として抽出された動体候補の組合せの中で、同一動体候補の可能性があると判定される複数の動体候補を融合した融合動体候補を追加して前記包含関係のある動体候補のグループとすることを特徴とする請求項9に記載の動体画像抽出方法。   In the moving object candidate extraction step, a pixel group of continuous objects is once extracted as one moving object candidate from the difference image generated in the difference image generating step, and a combination of moving object candidates extracted as another candidate is extracted. 10. The group of moving object candidates having the inclusion relation is added by adding fused moving object candidates obtained by fusing a plurality of moving object candidates determined to be the same moving object candidates. Moving image extraction method. 自然光又は照明光の光量と照射方向とのうち少なくともいずれかが変動する可能性のある環境下で撮像された時系列順に並んだ複数枚の撮像画像を用い、該撮像画像内に含まれる動体の像を動体画像として抽出する動体画像抽出装置であって、
前記動体による影響が排除された背景画像を取得する背景画像取得手段と、
前記背景画像取得手段により取得された前記背景画像と前記撮像画像との差分である差分画像を生成する差分画像生成手段と、
前記背景画像と前記撮像画像から前記背景画像を更新する背景画像更新手段と、
前記差分画像生成手段により生成された前記差分画像から1つの動体である可能性のある部分画像を動体候補として抽出する動体候補抽出手段と、
前記動体候補抽出手段により複数の前記動体候補が抽出された場合に、複数の前記動体候補から適切な前記動体候補を絞り込む動体候補絞込手段と
を備えたことを特徴とする動体画像抽出装置。
Using a plurality of captured images arranged in time series in an environment where at least one of the amount of natural light or illumination light and the irradiation direction may fluctuate, a moving object included in the captured image A moving image extraction device for extracting an image as a moving image,
Background image acquisition means for acquiring a background image in which the influence of the moving object is eliminated;
Difference image generation means for generating a difference image that is a difference between the background image acquired by the background image acquisition means and the captured image;
Background image update means for updating the background image from the background image and the captured image;
Moving object candidate extraction means for extracting a partial image that may be one moving object as a moving object candidate from the difference image generated by the difference image generating means;
A moving object image extracting apparatus comprising: moving object candidate narrowing means for narrowing down an appropriate moving object candidate from a plurality of moving object candidates when a plurality of moving object candidates are extracted by the moving object candidate extracting means.
JP2013132969A 2013-06-25 2013-06-25 Moving body image extraction method and moving body image extraction apparatus Active JP6246508B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013132969A JP6246508B2 (en) 2013-06-25 2013-06-25 Moving body image extraction method and moving body image extraction apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013132969A JP6246508B2 (en) 2013-06-25 2013-06-25 Moving body image extraction method and moving body image extraction apparatus

Publications (2)

Publication Number Publication Date
JP2015008412A true JP2015008412A (en) 2015-01-15
JP6246508B2 JP6246508B2 (en) 2017-12-13

Family

ID=52338427

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013132969A Active JP6246508B2 (en) 2013-06-25 2013-06-25 Moving body image extraction method and moving body image extraction apparatus

Country Status (1)

Country Link
JP (1) JP6246508B2 (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101631023B1 (en) * 2015-04-03 2016-06-15 경희대학교 산학협력단 Neighbor-based intensity correction device, background acquisition device and method thereof
JP2017117300A (en) * 2015-12-25 2017-06-29 Kddi株式会社 Moving object detector, detection method, and program
WO2017203789A1 (en) * 2016-05-25 2017-11-30 株式会社Nexpoint Difference image generation method, image restoration method, difference detection device, image restoration device, and monitoring method
JP2019050593A (en) * 2018-10-31 2019-03-28 キヤノン株式会社 Image processing system, image processor, control method, and program
CN110798592A (en) * 2019-10-29 2020-02-14 普联技术有限公司 Object movement detection method, device and equipment based on video image and storage medium
US10848748B2 (en) 2016-05-25 2020-11-24 Canon Kabushiki Kaisha Method for generating virtual viewpoint image and image processing apparatus
JP2020197794A (en) * 2019-05-31 2020-12-10 株式会社日立ソリューションズ Image analysis device, image analysis method and program
WO2021261125A1 (en) * 2020-06-22 2021-12-30 オムロン株式会社 Movable body detection device and movable body detection method

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6807192B2 (en) 2016-08-31 2021-01-06 シチズン時計株式会社 Machine Tools

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06266841A (en) * 1993-03-12 1994-09-22 Matsushita Electric Ind Co Ltd Object recognizing device
JPH11120481A (en) * 1997-10-17 1999-04-30 Mitsubishi Heavy Ind Ltd Traffic flow measuring device
JPH11353486A (en) * 1998-06-10 1999-12-24 Nippon Telegr & Teleph Corp <Ntt> Moving area extraction method and device for moving image
JP2001155163A (en) * 1999-11-26 2001-06-08 Ntt Communications Kk Device for cutting out mobile object
JP2001351107A (en) * 2000-06-05 2001-12-21 Mitsubishi Electric Corp Device and method for monitoring traffic
JP2004046647A (en) * 2002-07-12 2004-02-12 Univ Waseda Method and device for tracking moving object based on dynamic image data
JP2004118558A (en) * 2002-09-26 2004-04-15 Hitachi Kokusai Electric Inc Object detection method and device
JP2007180932A (en) * 2005-12-28 2007-07-12 Secom Co Ltd Image sensor
JP2010204860A (en) * 2009-03-02 2010-09-16 Hitachi Ltd Video-monitoring system
JP2012230494A (en) * 2011-04-25 2012-11-22 Saxa Inc Pedestrian detection device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06266841A (en) * 1993-03-12 1994-09-22 Matsushita Electric Ind Co Ltd Object recognizing device
JPH11120481A (en) * 1997-10-17 1999-04-30 Mitsubishi Heavy Ind Ltd Traffic flow measuring device
JPH11353486A (en) * 1998-06-10 1999-12-24 Nippon Telegr & Teleph Corp <Ntt> Moving area extraction method and device for moving image
JP2001155163A (en) * 1999-11-26 2001-06-08 Ntt Communications Kk Device for cutting out mobile object
JP2001351107A (en) * 2000-06-05 2001-12-21 Mitsubishi Electric Corp Device and method for monitoring traffic
JP2004046647A (en) * 2002-07-12 2004-02-12 Univ Waseda Method and device for tracking moving object based on dynamic image data
JP2004118558A (en) * 2002-09-26 2004-04-15 Hitachi Kokusai Electric Inc Object detection method and device
JP2007180932A (en) * 2005-12-28 2007-07-12 Secom Co Ltd Image sensor
JP2010204860A (en) * 2009-03-02 2010-09-16 Hitachi Ltd Video-monitoring system
JP2012230494A (en) * 2011-04-25 2012-11-22 Saxa Inc Pedestrian detection device

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101631023B1 (en) * 2015-04-03 2016-06-15 경희대학교 산학협력단 Neighbor-based intensity correction device, background acquisition device and method thereof
JP2017117300A (en) * 2015-12-25 2017-06-29 Kddi株式会社 Moving object detector, detection method, and program
WO2017203789A1 (en) * 2016-05-25 2017-11-30 株式会社Nexpoint Difference image generation method, image restoration method, difference detection device, image restoration device, and monitoring method
JP2017212566A (en) * 2016-05-25 2017-11-30 株式会社Nexpoint Monitoring method in monitoring camera system, difference image generation method, image restoration method, and difference detector
US10848748B2 (en) 2016-05-25 2020-11-24 Canon Kabushiki Kaisha Method for generating virtual viewpoint image and image processing apparatus
US11689706B2 (en) 2016-05-25 2023-06-27 Canon Kabushiki Kaisha Method for generating virtual viewpoint image and image processing apparatus
JP2019050593A (en) * 2018-10-31 2019-03-28 キヤノン株式会社 Image processing system, image processor, control method, and program
JP2020197794A (en) * 2019-05-31 2020-12-10 株式会社日立ソリューションズ Image analysis device, image analysis method and program
CN110798592A (en) * 2019-10-29 2020-02-14 普联技术有限公司 Object movement detection method, device and equipment based on video image and storage medium
WO2021261125A1 (en) * 2020-06-22 2021-12-30 オムロン株式会社 Movable body detection device and movable body detection method

Also Published As

Publication number Publication date
JP6246508B2 (en) 2017-12-13

Similar Documents

Publication Publication Date Title
JP6246508B2 (en) Moving body image extraction method and moving body image extraction apparatus
JP6509275B2 (en) Method and apparatus for updating a background model used for image background subtraction
EP3531386A1 (en) Fire monitoring system
CN109145867B (en) Human body posture estimation method, device, system, electronic equipment and storage medium
KR101747216B1 (en) Apparatus and method for extracting target, and the recording media storing the program for performing the said method
JP4839183B2 (en) Image processing device
JP2007220124A (en) Signal classification method
JP2007156655A (en) Variable region detection apparatus and its method
JP4999794B2 (en) Still region detection method and apparatus, program and recording medium
JP6536567B2 (en) Detection apparatus, detection method, and computer program
JP2009140307A (en) Person detector
JP6105950B2 (en) Image processing apparatus and method
KR101799143B1 (en) System and method for estimating target size
JP2022000829A (en) Image comparing apparatus, image comparing program, and image comparing method
JP4751886B2 (en) Image judgment method
JP6882124B2 (en) Fire detection device and fire detection method
JP7078295B2 (en) Deformity detection device, deformation detection method, and program
US20170116697A1 (en) Digital watermark information detecting device and digital watermark information detecting method
KR101394473B1 (en) Method for detecting moving object and surveillance system thereof
KR102516172B1 (en) System, Method for Extracting Color of Foreground and Computer Readable Record Medium Thereof
CN115619924A (en) Method and apparatus for light estimation
JP7294678B2 (en) Learning model generation device, feature change determination device, learning model generation method, feature change determination method, and program
JP6897431B2 (en) Image processing device, setting support method, and setting support program
JPH0824350B2 (en) Background image extraction method
JP6618438B2 (en) Foreground region extraction apparatus, method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160525

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170329

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170411

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170515

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: 20171107

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20171115

R150 Certificate of patent or registration of utility model

Ref document number: 6246508

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150