JP2009245172A - Counting device for moving object, and program - Google Patents

Counting device for moving object, and program Download PDF

Info

Publication number
JP2009245172A
JP2009245172A JP2008091163A JP2008091163A JP2009245172A JP 2009245172 A JP2009245172 A JP 2009245172A JP 2008091163 A JP2008091163 A JP 2008091163A JP 2008091163 A JP2008091163 A JP 2008091163A JP 2009245172 A JP2009245172 A JP 2009245172A
Authority
JP
Japan
Prior art keywords
moving body
counting
detection point
detection
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2008091163A
Other languages
Japanese (ja)
Inventor
Akira Teratani
章 寺谷
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.)
Saxa Inc
Original Assignee
Saxa Inc
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 Saxa Inc filed Critical Saxa Inc
Priority to JP2008091163A priority Critical patent/JP2009245172A/en
Publication of JP2009245172A publication Critical patent/JP2009245172A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Closed-Circuit Television Systems (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To reduce a processing load by counting moving objects passing through a counting target area with a simple configuration and reducing computational complexity during counting the moving objects. <P>SOLUTION: A camera 2 is installed at the upper part of the counting target area R of moving objects T, the image of the counting target area R including moving objects T is photographed, and the photographed image is output to a counting processor 10. The counting processor 10 sets a plurality of detection point lines for the moving objects T composed of a plurality of detection points arranged in the direction crossing the passing direction of the moving objects T in the photographed image of the counting target area R along the passing direction over the entire photographed image. The counting processor 10 processes the photographed image, detects the moving objects T at each detection point, compares respective detection points, on the basis of detection results at each detection point of the plurality of detection point lines, determines presence/no presence of the moving objects T passing through the counting target area R, and counts the number of passing of the moving objects T in each passing direction, respectively. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、移動体の計数対象領域を上方からカメラで撮影して、計数対象領域を所定方向に向かって通過する移動体を計数する移動体の計数装置及びプログラムに関する。   The present invention relates to a moving body counting apparatus and a program for photographing a counting target area of a moving body with a camera from above and counting the moving body passing through the counting target area in a predetermined direction.

従来、例えば店舗等の建物や特定の施設に入退出する人の数を把握するため、その出入り口や通路等の所定領域を通過する移動体を検出し、その通過数を計数することが行われている。また、このような計数装置として、計数対象領域を上方からカメラで撮影し、カメラの各撮影画像を画像処理して解析等し、計数対象領域を所定方向に通過する移動体を判別して計数する装置も知られている(特許文献1、2参照)。   Conventionally, in order to grasp the number of people entering and leaving a building or a specific facility such as a store, for example, a moving body passing through a predetermined area such as an entrance or a passage is detected and the number of passages is counted. ing. In addition, as such a counting device, a counting target area is photographed from above by a camera, each captured image of the camera is subjected to image processing, analysis, etc., and a moving object passing through the counting target area in a predetermined direction is discriminated and counted. An apparatus is also known (see Patent Documents 1 and 2).

ところが、このようなカメラを使用した従来の計数装置では、カメラの性能に応じて、VGA(Video Graphics Array)の画像(640×480ドット)やQVGA(Quarter VGA)の画像(320×240ドット)等、比較的画素数の多い画像を使用し、その全体に対して画像処理や解析を行うのが一般的である。これに伴い、取得した画像も、複雑なアルゴリズムにより計算して解析する必要があり、移動体の計数に複雑かつ面倒な処理や計算を要する。その結果、従来の計数装置では、必要な計算量が非常に多くなり、処理負荷が増加する傾向があり、これに対処するためには、高性能なCPU(Central Processing Unit)等の演算処理装置と大容量のメモリとを必要とし、装置全体のコストが増加する、という問題が生じる。   However, in a conventional counting device using such a camera, a VGA (Video Graphics Array) image (640 × 480 dots) or a QVGA (Quarter VGA) image (320 × 240 dots) is used depending on the performance of the camera. In general, an image having a relatively large number of pixels is used, and image processing and analysis are performed on the entire image. Along with this, the acquired image also needs to be calculated and analyzed by a complicated algorithm, and complicated and troublesome processing and calculation are required for counting moving objects. As a result, in the conventional counting device, the amount of calculation required is very large and the processing load tends to increase. To cope with this, an arithmetic processing device such as a high-performance CPU (Central Processing Unit) And a large-capacity memory are required, which increases the cost of the entire apparatus.

特開2006−285409号公報JP 2006-285409 A 特開昭63−85890号公報JP-A-63-85890

本発明は、前記従来の問題に鑑みなされたものであって、その目的は、簡易な構成で計数対象領域を通過する移動体を計数できるようにし、移動体の計数時の計算量を減少させて処理負荷を軽減するとともに、計数装置のコストを低減させることである。   The present invention has been made in view of the above-described conventional problems, and an object of the present invention is to make it possible to count moving objects passing through the counting target area with a simple configuration, and to reduce the amount of calculation when counting moving objects. Thus, the processing load is reduced and the cost of the counting device is reduced.

本発明は、計数対象領域を上方からカメラで撮影して通過する移動体を計数する移動体の計数装置であって、計数対象領域の撮影画像に、移動体の通過方向と交差する方向に配列された複数の検出ポイントからなる移動体の検出ポイント列を、前記通過方向に沿って複数設定する設定手段と、計数対象領域の撮影画像から各検出ポイント列の検出ポイント毎に移動体を検出する検出手段と、複数の検出ポイント列の各検出ポイントでの移動体の検出結果に基づき、計数対象領域を通過する移動体の有無を判定する通過判定手段と、計数対象領域を前記通過方向に通過する移動体数をカウントするカウント手段と、を備えたことを特徴とする。
また、本発明は、コンピュータを請求項1ないし8のいずれかに記載された移動体の計数装置の各手段として機能させるためのプログラムである。
The present invention is a moving body counting device that counts a moving body that is photographed by a camera from above and that passes through the counting target area, and is arranged in a direction that intersects the passing direction of the moving body on a captured image of the counting target area A detecting unit for setting a plurality of detection point sequences of the moving body composed of a plurality of detection points along the passing direction, and detecting the moving body for each detection point of each detection point sequence from the captured image of the counting target region. Detection means, passage determination means for determining the presence or absence of a moving body that passes the counting target area based on the detection result of the moving body at each detection point of the plurality of detection point sequences, and passing the counting target area in the passing direction And a counting means for counting the number of moving bodies to be operated.
Further, the present invention is a program for causing a computer to function as each unit of the moving body counting device according to any one of claims 1 to 8.

本発明によれば、簡易な構成で計数対象領域を通過する移動体を計数でき、移動体の計数時の計算量を減少させて処理負荷を軽減できるとともに、計数装置のコストを低減させることができる。   According to the present invention, it is possible to count moving bodies that pass through the counting target region with a simple configuration, reduce the calculation amount when counting moving bodies, reduce the processing load, and reduce the cost of the counting device. it can.

以下、本発明の一実施形態について、図面を参照して説明する。
本実施形態の移動体の計数装置(以下、計数装置という)は、計数対象領域を上方からカメラで撮影して通過する移動体の数を計数する装置であり、例えば店舗等の建物や施設のドア近傍や通路等に設置され、その領域を所定方向に通過する人等の移動体の計数に使用される。以下では、建物への出入り口であるドアの内側で、ドアを通って移動する移動体を計数する場合を例に採り説明する。その際、この計数装置では、低画素の画像を撮影するカメラを使用し、ドアを通って内外方向に移動して建物に入退出する移動体の数を通過方向毎に計数する。
Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
The moving body counting device (hereinafter referred to as a counting device) of the present embodiment is a device that counts the number of moving bodies that pass through the counting target region by photographing with a camera from above, for example, a building or facility such as a store. It is installed in the vicinity of a door, a passage, etc., and used for counting moving objects such as people passing through the area in a predetermined direction. Below, the case where the moving body which moves through a door is counted inside the door which is the doorway to a building is taken and demonstrated as an example. In this case, the counting device uses a camera that captures a low-pixel image, and counts the number of moving bodies that move in and out through the door and enter and leave the building for each passing direction.

図1は、本実施形態の計数装置の概略構成を示す模式図であり、建物90のドア91(例えばスライド式の自動ドア)の内側(計数対象領域R)への設置状態も、側方から見て模式的に示している。
この計数装置1は、図示のように、制御装置を兼ねる計数処理装置10と、計数処理装置10に接続されたカメラ2とを備え、計数処理装置10により、カメラ2による撮影画像から移動体T(ここでは人)を検出して、その通過数(図の矢印方向毎の数)を計数する。
FIG. 1 is a schematic diagram showing a schematic configuration of the counting device of the present embodiment, and the installation state of the building 90 inside the door 91 (for example, a sliding automatic door) (counting target region R) is also from the side. This is shown schematically.
As shown in the figure, the counting device 1 includes a counting processing device 10 that also serves as a control device, and a camera 2 connected to the counting processing device 10. (In this case, a person) is detected, and the number of passages (the number for each arrow direction in the figure) is counted.

カメラ2は、建物90内の所定範囲に設定された計数対象領域Rの撮影手段(カメラモジュール)であり、建物90の通路の上方に下方に向けて設置され、計数対象領域Rの全体を、その上を移動する移動体Tとともに上方から撮影する。ここでは、計数対象領域Rは、ドア91の付近で建物90の通路を横断して略矩形状をなすように設定されており、カメラ2は、計数対象領域Rの中央部上方に、かつ光軸を略垂直方向下側に向けた状態で、建物90の天井部に取り付けられている。また、カメラ2は、市販のデジタルカメラ、デジタルビデオカメラ、又はCMOS(Complementary Metal Oxide Semiconductor)イメージセンサ等からなり、計数処理装置10により制御されて、計数対象領域Rの画像を連続して、又は所定の間隔やタイミングで撮影し、撮影画像を計数処理装置10に出力する。   The camera 2 is a photographing means (camera module) of the counting target region R set in a predetermined range in the building 90, and is installed downward above the passage of the building 90, and the entire counting target region R is The image is taken from above with the moving body T moving above. Here, the counting target region R is set so as to form a substantially rectangular shape in the vicinity of the door 91 so as to cross the passage of the building 90, and the camera 2 is positioned above the center of the counting target region R and is light The shaft 90 is attached to the ceiling of the building 90 with the axis directed substantially downward in the vertical direction. The camera 2 includes a commercially available digital camera, a digital video camera, a CMOS (Complementary Metal Oxide Semiconductor) image sensor, or the like, and is controlled by the counting processing device 10 so that images in the counting target region R are continuously or Photographs are taken at predetermined intervals and timing, and the photographed images are output to the counting processing device 10.

なお、この計数装置1では、比較的低画素(ここでは横40×縦30ドット)のカラー画像を撮影するカメラ2を使用し、これにより、計数対象領域Rや移動体Tを撮影してカラー画像を出力する。その際、カメラ2は、撮影素子上に結像した画像を電気信号に変換してA/D変換し、内蔵の画像信号処理回路により各種補正の処理等を行って、撮影画像の画像データを計数処理装置10に出力する。   The counting apparatus 1 uses a camera 2 that captures a color image of relatively low pixels (40 × 30 dots in this case), thereby capturing the counting target region R and the moving body T to obtain a color. Output an image. At that time, the camera 2 converts the image formed on the imaging element into an electrical signal and performs A / D conversion, performs various correction processes by the built-in image signal processing circuit, and converts the image data of the captured image. The data is output to the counting processing device 10.

計数処理装置10は、中央演算処理装置(CPU)11と、各種の制御や計数処理のための手順をCPU11に実行させるプログラム等を格納するROM(Read Only Memory)12と、CPUの処理用データやプログラム等を一時的に格納するRAM(Random Access Memory)13を備えた、例えばコンピュータから構成されている。また、計数処理装置10は、設定用ディップスイッチ等からなる設定入力部と、カメラ2等が接続される入出力ポートを有する入出力部(それぞれ図示せず)とを有し、接続された各装置との間で各種データや制御信号を送受信する。これにより、計数処理装置10は、所定のプログラムや予め設定された条件等に基づいて、カメラ2を制御して撮影させ、かつ取得した撮影画像を画像処理や解析し、以下説明する移動体Tの計数のための各処理を実行する。   The count processing device 10 includes a central processing unit (CPU) 11, a ROM (Read Only Memory) 12 that stores programs for causing the CPU 11 to execute various control and counting procedures, and CPU processing data. And a RAM (Random Access Memory) 13 for temporarily storing programs and programs. Further, the counting processing device 10 includes a setting input unit including a setting dip switch and the like, and an input / output unit (not shown) having an input / output port to which the camera 2 and the like are connected, and each connected Various data and control signals are transmitted to and received from the device. As a result, the counting processing device 10 controls the camera 2 to shoot based on a predetermined program, preset conditions, and the like, and performs image processing and analysis on the acquired captured image. Each process for counting is executed.

図2は、この計数処理装置10の概略構成を示す機能ブロック図である。
計数処理装置10は、図示のように、装置全体の制御や計数処理を制御する制御部14や、カメラ2による撮影画像から取得したデータや処理中のデータ等の各種データを記憶する記憶部15に加えて、設定部16、カウント部17、及び画像処理部(解析部)20を備えている。また、計数処理装置10は、上記した設定入力部18及び、カメラ2や計数結果の出力先が接続された入出力部19を備え、これら各部(手段)14〜20を、バスK等を介して互いに接続している。
FIG. 2 is a functional block diagram showing a schematic configuration of the counting processing device 10.
As shown in the figure, the counting processing device 10 includes a control unit 14 that controls the entire device and counting processing, and a storage unit 15 that stores various data such as data acquired from images taken by the camera 2 and data being processed. In addition, a setting unit 16, a counting unit 17, and an image processing unit (analysis unit) 20 are provided. The counting processing device 10 includes the setting input unit 18 and the input / output unit 19 to which the output destination of the camera 2 and the counting result is connected. These units (means) 14 to 20 are connected via the bus K or the like. Connected to each other.

設定入力部18は、カメラ2の設置条件や計数処理装置10の処理条件等の設定に使用され、ユーザから入力された内容を、制御部14へ出力し、又は記憶部15に記憶させる。この設定入力部18からは、例えばカメラ2の設置高さや撮影条件が入力されて設定され、その情報から、制御部14が、予め設定された条件に基づき、後述する設定部16による設定内容を含む、移動体Tの検出や計数処理に関する各種条件を設定する。   The setting input unit 18 is used for setting the installation conditions of the camera 2, the processing conditions of the counting processing device 10, etc., and outputs the contents input from the user to the control unit 14 or stores them in the storage unit 15. From the setting input unit 18, for example, the installation height of the camera 2 and shooting conditions are input and set, and based on the information, the control unit 14 sets the setting contents by the setting unit 16 to be described later based on preset conditions. Various conditions relating to the detection of the moving body T and the counting process are set.

設定部16は、入出力部19を介してカメラ2から取得した撮影画像に対し、移動体Tを検出するための特定の検出ポイント(抽出点)を設定する手段であり、その画像内で計数処理に使用する画素の位置を、各条件等に応じて複数設定する。計数処理装置10は、各撮影画像から、この設定部16により設定された移動体Tの検出ポイントのデータを抽出し、そのデータを使用して移動体Tの検出や計数処理を実行する。   The setting unit 16 is a means for setting a specific detection point (extraction point) for detecting the moving object T with respect to the captured image acquired from the camera 2 via the input / output unit 19. A plurality of pixel positions to be used for processing are set according to each condition. The count processing device 10 extracts the detection point data of the moving body T set by the setting unit 16 from each captured image, and executes the detection of the moving body T and the counting process using the data.

図3は、この設定部16による検出ポイントの設定について説明するための模式図であり、図3Aはカメラ2による計数対象領域Rの撮影画像Gの例を示している。また、図3Aでは、上下方向が移動体Tの通過方向(図1参照)であり、その方向(図3A右側の2つの矢印参照)に沿って、移動体Tは撮影画像G(計数対象領域R)内を移動する。   FIG. 3 is a schematic diagram for explaining setting of detection points by the setting unit 16, and FIG. 3A shows an example of a captured image G of the counting target region R by the camera 2. In FIG. 3A, the vertical direction is the passing direction of the moving body T (see FIG. 1), and along that direction (see the two arrows on the right side of FIG. 3A), the moving body T captures the captured image G (count target area). Move in R).

設定部16は、図3Aに示すように、カメラ2から取得する計数対象領域Rの撮影画像Gに、移動体Tの通過方向と交差する方向に、複数(図では左右方向に5つ)の検出ポイントP(図では、それぞれ矩形で示す)を互いに離間して配列させ、これら複数の検出ポイントPからなる移動体Tの検出ポイント列を設定する。併せて、この検出ポイント列を、移動体Tの通過方向(図では上下方向)に沿って、互いに離間して複数設定(図に示すA列、B列、C列)して、撮影画像Gの全体に亘って、検出ポイントPを互いに離間した状態で略均等に設定する。   As shown in FIG. 3A, the setting unit 16 includes a plurality of (five in the left and right directions in the figure) directions in which the captured image G of the counting target region R acquired from the camera 2 intersects the passing direction of the moving body T. The detection points P (shown by rectangles in the figure) are arranged apart from each other, and a detection point sequence of the moving body T including the plurality of detection points P is set. In addition, a plurality of detection point rows are set apart from each other along the passing direction (vertical direction in the drawing) of the moving body T (rows A, B, and C shown in the drawing), and the captured image G The detection points P are set substantially evenly in a state of being separated from each other.

この設定時に、本実施形態では、複数の検出ポイントPを、移動体Tの通過方向及び、それに直行する方向に沿って、それぞれ略等間隔で整列させて配置する。また、各検出ポイントPを、1つの移動体Tのみが検出される大きさ、例えば、それぞれ縦横1〜数ピクセル(ここでは1〜2ピクセル)となるように、かつ、撮影画像Gのサイズやドット数等に応じて、移動体Tの検出漏れがない所定ドット間隔(ここでは縦横6ドット程度の間隔)で配置する。その際、この計数装置1では、各検出ポイント列で、隣り合う検出ポイントP同士を大人の肩幅に合わせて配置し、大人一人が1つの検出ポイントP、又は隣り合う2つの検出ポイントPで検出されるようにしている。また、設定部16により、移動体Tの通過方向に沿って順に配置された第1、第2、第3検出ポイント列(例えば、図3で通過方向が下方向のときには、それぞれA列、B列、C列に対応)を少なくとも設定(ここでは、これら3列のみ設定)する。計数処理装置10は、これら各列の各検出ポイントPでの移動体Tの検出結果やその変化等に基づき、移動体Tの移動(通過)方向の判別や、通過する移動体Tの有無を判定等する。   At the time of this setting, in the present embodiment, the plurality of detection points P are arranged at substantially equal intervals along the passing direction of the moving body T and the direction orthogonal thereto. Further, each detection point P has a size such that only one moving body T is detected, for example, 1 to several pixels in length and width (here, 1 to 2 pixels in this case), and the size of the captured image G Depending on the number of dots and the like, they are arranged at a predetermined dot interval (here, an interval of about 6 dots in length and width) that does not cause detection of the moving body T. At this time, in this counting device 1, in each detection point row, adjacent detection points P are arranged according to the shoulder width of an adult, and one adult detects at one detection point P or two adjacent detection points P. To be. In addition, the setting unit 16 sequentially arranges first, second, and third detection point rows arranged along the passing direction of the moving body T (for example, when the passing direction is a downward direction in FIG. Column (corresponding to column C) is set at least (here, only these three columns are set). The counting processing device 10 determines the moving (passing) direction of the moving body T based on the detection result of the moving body T at each detection point P in each row, its change, and the like, and the presence or absence of the moving body T passing through. Judgment etc.

このようにして、計数処理装置10は、設定部16により、撮影画像Gに、それぞれ5つの検出ポイントPからなる3列(A列、B列、C列)の検出ポイント列を設定し、各検出ポイントPのデータを抽出(図3B参照)して画像処理部20により処理する。
なお、図3Bは、検出ポイントPのみを抽出した状態(画像)を模式的に示しており、以下では、主に、これと同様のブロック状の図を用いて、移動体Tの計数処理等について説明する。また、各検出ポイント列を特に区別するときには、それぞれA列、B列、C列(図3Bの左側参照)とのみ表し、それらの5つの各検出ポイントPは、左から順に1〜5の番号(図3Bの上側参照)を付して区別し、例えばA列では左から順にA列1、A列2、A列3、A列4、A列5(B列、C列も同様)と表す。更に、以下では、A列からC列へ向かう方向をダウン方向、その逆方向をアップ方向として説明する。
In this way, the count processing device 10 sets the detection point sequence of three columns (A column, B column, C column) each including five detection points P to the captured image G by the setting unit 16, Data of the detection point P is extracted (see FIG. 3B) and processed by the image processing unit 20.
Note that FIG. 3B schematically shows a state (image) in which only the detection point P is extracted. In the following, mainly using the same block diagram, the counting process of the moving object T, etc. Will be described. Further, when particularly distinguishing each detection point column, it is represented only as column A, column B, and column C (see the left side in FIG. 3B), and these five detection points P are numbers 1 to 5 in order from the left. (See the upper side of FIG. 3B) for distinction. For example, in the A column, from the left, the A column 1, the A column 2, the A column 3, the A column 4, the A column 5 (the same applies to the B column and the C column). To express. Further, in the following description, the direction from the A row to the C row is the down direction, and the opposite direction is the up direction.

画像処理部20(図2参照)は、これら各検出ポイントPの画像データを、撮影画像Gから取得して画像処理や解析処理を行う手段であり、検出部21、数判定部22及び、比較部24と移動体判別部25とを有する通過判定部23から構成されている。   The image processing unit 20 (see FIG. 2) is means for acquiring image data of each detection point P from the captured image G and performing image processing and analysis processing. The detection unit 21, the number determination unit 22, and the comparison The passage determination unit 23 includes a unit 24 and a moving body determination unit 25.

検出部21は、計数対象領域Rの撮影画像Gから、各検出ポイント列の検出ポイントP毎に移動体Tを検出する手段であり、例えばカメラ2が連続して撮影するフレーム画像の各検出ポイントP同士を比較し、そのフレーム間差分を算出して検出ポイントP毎に画像変化を抽出する。この結果から、検出部21は、各差分量を所定の閾値と比較する等して、各検出ポイントPの位置に移動体Tがあるか否かを判断し、検出ポイント列の各検出ポイントPで移動体Tを検出する。   The detection unit 21 is a means for detecting the moving body T for each detection point P in each detection point sequence from the captured image G in the counting target region R. For example, each detection point of the frame image continuously captured by the camera 2 is detected. The Ps are compared, the difference between the frames is calculated, and the image change is extracted for each detection point P. From this result, the detecting unit 21 compares each difference amount with a predetermined threshold value to determine whether or not there is a moving body T at the position of each detection point P, and each detection point P in the detection point sequence. To detect the moving object T.

数判定部22は、これら各検出ポイント列の複数の検出ポイントPでの各検出結果に基づき、移動体Tを検出した検出ポイントPの数や、それらの位置関係等から、その検出ポイント列で検出した移動体の数を判定する。その際、ここでは、予め設定された数変換テーブルを使用し、テーブルと移動体Tを検出した検出ポイントPとを対応させて検出した移動体Tの数を判定する。   Based on the detection results at the plurality of detection points P of each detection point sequence, the number determination unit 22 uses the detection point sequence based on the number of detection points P that have detected the moving object T, their positional relationship, and the like. The number of detected moving objects is determined. At this time, the number conversion table set in advance is used here, and the number of the moving bodies T detected by associating the table with the detection point P where the moving body T is detected is determined.

図4は、この数変換テーブルの一部を示す模式図であり、各段に、検出ポイント列の各検出ポイントP(図3Bの検出ポイント1〜5に対応)での検出結果と、その結果に対応する移動体Tの数を示す。また、図4では、移動体Tを検出した検出ポイントPは1で、非検出の検出ポイントPは0でそれぞれ示している。
図5は、数判定部22による判定について説明するための模式図であり、それぞれ図3Aと同様の計数対象領域Rの撮影画像Gと、その撮影画像Gにおける各検出ポイントPでの移動体Tの検出結果とを横に並べて、4つの例を示している。また、図5では、移動体Tの検出結果を図3Bと同様のブロック状の図で示し、その中で移動体Tを検出した検出ポイントPには1を表記する。一方、撮影画像Gには、各移動体Tを楕円形で模式的に示し、その移動方向を矢印で併記する。
FIG. 4 is a schematic diagram showing a part of this number conversion table. In each stage, detection results at detection points P (corresponding to detection points 1 to 5 in FIG. 3B) and the results are shown in each stage. The number of the moving bodies T corresponding to is shown. In FIG. 4, the detection point P where the moving body T is detected is 1 and the non-detection detection point P is 0.
FIG. 5 is a schematic diagram for explaining the determination by the number determination unit 22. The captured image G of the count target region R similar to that in FIG. 3A and the moving body T at each detection point P in the captured image G are shown. The four detection examples are shown side by side. Further, in FIG. 5, the detection result of the moving body T is shown by a block diagram similar to FIG. 3B, and 1 is written in the detection point P in which the moving body T is detected. On the other hand, in the captured image G, each moving body T is schematically shown as an ellipse, and the moving direction is also indicated by an arrow.

本実施形態では、図4に示すように、移動体Tの検出が無い状態(図5A参照)に対し、各検出ポイント列内で、1つ又は隣接する2つの検出ポイントPで移動体Tを検出したときには(図5B、図5D参照)、移動体Tの数を1とする。また、それらが1以上の検出ポイントPを挟んで、2及び3箇所に現れたときには(図5C参照)、それぞれ移動体Tの数を2及び3と判定する。これに対し、連続する3つ又は4つの検出ポイントPで移動体Tを検出したときには2と、5つ全てで検出したときには3と、各々移動体Tの数を判定し、これらを組み合わせて、その検出ポイント列で検出した移動体Tの数を判定する。画像処理部20は、数判定部22により、このように設定された数変換テーブルに基づき、複数の検出ポイントPでの検出結果を変換することで、移動体Tの数を判定する。   In the present embodiment, as shown in FIG. 4, with respect to the state where the moving body T is not detected (see FIG. 5A), the moving body T is moved at one or two adjacent detection points P in each detection point row. When it is detected (see FIGS. 5B and 5D), the number of moving bodies T is set to 1. Further, when they appear at two and three positions with one or more detection points P interposed therebetween (see FIG. 5C), the numbers of the moving bodies T are determined to be 2 and 3, respectively. On the other hand, when the moving body T is detected at three or four consecutive detection points P, the number of the moving bodies T is determined as 2 when detected at all 5 and 3 when detected at all five, and these are combined, The number of moving bodies T detected in the detection point sequence is determined. The image processing unit 20 determines the number of moving bodies T by converting the detection results at a plurality of detection points P based on the number conversion table set in this way by the number determination unit 22.

通過判定部23(図2参照)は、複数の検出ポイント列の各検出ポイントPでの移動体Tの検出結果に基づき、例えば全ての又は一部の検出ポイント列同士を比較し、或いは取得する撮影画像G間の検出位置の変化等から、計数対象領域Rを通過する移動体Tの有無を判定する。この判定時に、通過判定部23は、現在のフレームや、それよりも前のフレームの撮影画像Gに対する移動体Tの検出結果を取得し、比較部24により、予め設定された条件に応じて、検出ポイント列間の移動体Tを検出した検出ポイントPの位置(図3Bの1〜5)を比較する。また、通過判定部23は、この位置の比較結果に基づき、移動体判別部25により、例えば所定の検出ポイント列同士の比較結果を互いに対比する等して、計数対象領域Rを、上記したダウン方向又はアップ方向のいずれかの通過方向へ移動する移動体Tを判別する。この判別結果に基づいて、通過判定部23は、計数対象領域Rを両方向に通過する移動体Tの有無をそれぞれ判定する。   The passage determination unit 23 (see FIG. 2) compares or acquires, for example, all or some of the detection point sequences based on the detection result of the moving body T at each detection point P of the plurality of detection point sequences. The presence or absence of the moving body T that passes through the counting target region R is determined from the change in the detection position between the captured images G or the like. At the time of this determination, the passage determination unit 23 acquires the detection result of the moving body T with respect to the captured image G of the current frame or the previous frame, and the comparison unit 24 according to a preset condition, The positions (1 to 5 in FIG. 3B) of the detection points P that detect the moving body T between the detection point sequences are compared. In addition, the passage determination unit 23 reduces the count target region R to the above-described down state by, for example, comparing the comparison results of predetermined detection point sequences with each other by the moving body determination unit 25 based on the comparison result of the positions. The moving body T that moves in either the direction or the passing direction is discriminated. Based on the determination result, the passage determination unit 23 determines the presence or absence of the moving body T that passes through the counting target region R in both directions.

その際、通過判定部23は、検出ポイント列間の移動体Tを検出した検出ポイントPの各通過方向に沿う位置の変化に基づき、移動体判別部25により、それぞれの通過方向に移動する移動体Tを判別し、移動体Tが計数対象領域Rを通過したか否かを判定する。ただし、ここでは、計数対象領域R内で斜行や蛇行等する移動体Tを把握して、通過したか否かを確実に判定するため、各検出ポイント列間の対応する位置の検出ポイントPに加えて、その1つ隣りの両側の検出ポイントPも併せて比較して移動体Tを判別する。   At that time, the passage determining unit 23 moves the respective moving directions in the respective passing directions by the moving body discriminating unit 25 based on the change in the position along each passing direction of the detection point P that has detected the moving body T between the detection point sequences. The body T is discriminated, and it is determined whether or not the moving body T has passed the counting target region R. However, here, in order to ascertain whether or not the moving object T that has been skewed or meandered in the counting target region R has passed and has been reliably determined, the detection points P at corresponding positions between the respective detection point sequences. In addition, the detection point P on both sides of the adjacent one is also compared to determine the moving body T.

また、この計数装置1では、通過判定部23は、上記した移動体Tの通過方向上流側に位置する第1検出ポイント列と、通過方向下流側に位置する第3検出ポイント列(それぞれA列又はC列)の、それぞれの検出ポイントP毎の移動体Tの検出結果に基づき、各検出ポイント列で新たに検出した移動体Tを各々把握する。これにより、それぞれ、計数対象領域Rに入った移動体Tの位置や数、及び計数対象領域R外へ向かって移動する移動体Tの位置や数をそれぞれ判別する。更に、通過判定部23は、この第3検出ポイント列と、通過方向の中間に位置する第2検出ポイント列(B列)の移動体Tを検出した検出ポイントP同士の位置や数等を比較し、各通過方向へ移動する移動体Tを判別するとともに、これら各判別結果を比較する。通過判定部23は、第3検出ポイント列での判別により、計数対象領域R外へ向かう移動体Tを検出したときに、判定処理を実行して上記した各判別結果を比較し、その比較結果に基づき、計数対象領域Rを通過する移動体Tの有無や通過方向を判定する。   Further, in the counting device 1, the passage determination unit 23 includes the first detection point row located on the upstream side in the passage direction of the moving body T and the third detection point row located on the downstream side in the passage direction (each A row). Or the C column), the mobile body T newly detected in each detection point sequence is grasped based on the detection result of the mobile body T for each detection point P. As a result, the position and number of the moving body T entering the counting target region R and the position and number of the moving body T moving out of the counting target region R are determined. Furthermore, the passage determination unit 23 compares the position and number of the detection points P that detect the moving body T in the third detection point row and the second detection point row (B row) located in the middle of the passage direction. Then, the moving body T moving in each passing direction is discriminated, and these discrimination results are compared. When the passage determination unit 23 detects the moving body T that goes out of the counting target region R by the determination in the third detection point sequence, the passage determination unit 23 executes a determination process and compares the above determination results, and the comparison result Based on the above, the presence or absence of the moving body T passing through the counting target region R and the passing direction are determined.

計数処理装置10は、このようにして、移動体Tの通過等を判定し、その判定結果に基づいて、カウント部17により、計数対象領域Rを各通過方向に通過する移動体Tの数(通過数)を、通過する度に順次カウントして計数する。その際、カウント部17は、計数対象領域Rを互いに逆方向に通過する移動体Tをそれぞれカウントし、通過方向毎に移動体Tを計数する。また、この計数処理装置10は、後述するように、制御部14により検出ポイントP毎の検出結果を監視し、予め設定された数(フレーム)の撮影画像Gで、連続して全ての検出ポイントPで移動体Tが検出されないことを条件に、通過判定部23で使用中の判定に関する変動データをクリアする。これにより、通過判定部23をリセットして、そのデータ等を判定処理開始時の初期状態に戻し、判定を新たに開始させて、通過する移動体Tの有無の判定を再開させる処理を行う。   In this way, the counting processing device 10 determines the passage of the moving body T and the like, and based on the determination result, the counting unit 17 causes the number of moving bodies T that pass through the counting target region R in each passing direction ( The number of passes) is counted and counted sequentially each time it passes. At that time, the counting unit 17 counts the moving bodies T that pass through the counting target region R in opposite directions, and counts the moving bodies T for each passing direction. In addition, as will be described later, the counting processing device 10 monitors the detection result for each detection point P by the control unit 14, and continuously detects all the detection points with a predetermined number (frames) of the captured images G. On the condition that the moving body T is not detected in P, the passage determination unit 23 clears the fluctuation data regarding the determination in use. Thereby, the passage determination unit 23 is reset, the data and the like are returned to the initial state at the start of the determination process, the determination is newly started, and the determination of the presence / absence of the moving mobile body T is restarted.

ここで、本実施形態では、各検出ポイント列の検出結果に関するデータを1バイト(8ビット)で処理し、5つの検出ポイントP(図3参照)のデータを、それぞれ1バイト中の各ビットに対応させてデータ処理する。また、3列の検出ポイント列(A列、B列、C列)のデータ等をレジスタに保持し、それらを比較する等して、上記した通過判定部23の処理を含む計数処理を実行する。   Here, in the present embodiment, data relating to the detection result of each detection point sequence is processed in 1 byte (8 bits), and data of 5 detection points P (see FIG. 3) is converted into each bit in 1 byte. Data is processed correspondingly. In addition, the data of the three detection point columns (A column, B column, C column) is held in a register and compared, and the counting process including the process of the passage determination unit 23 is executed. .

図6は、このデータ処理について説明するための模式図であり、図3Bに対応する3列(3×5)のデータの例をブロックで示している。
本実施形態では、図示のように、A列、B列、C列毎に8ビット中の5ビット(図の実線で示す部分)を使用し、それ以外の3ビット(図の破線で示す部分)は0で固定してデータを処理する。このように、検出ポイント列の各検出ポイントPのデータを1ビットで表し、移動体Tを検出した検出ポイントPに対応するビットは1に、他のビットは0にする等してビット演算する。以下、検出ポイントPの移動体Tの検出に関するデータ(0又は1)を、このように各ビットに割り当てて行う、上記した画像処理部20等による処理例について具体的に説明するが、以下の各図では使用する5ビットの部分のみ示し、他の3ビットは省略する。また、各図では、移動体Tを検出したビット(データが1になるビット)には斜線でハッチングを付し、空白の他のビット(データが0になるビット)と区別する。
FIG. 6 is a schematic diagram for explaining the data processing, and shows an example of data in three columns (3 × 5) corresponding to FIG. 3B.
In this embodiment, as shown in the figure, 5 bits (portion indicated by a solid line in the figure) of 8 bits are used for each of the A column, the B column, and the C column, and the other 3 bits (portion indicated by a broken line in the drawing). ) Is fixed at 0 to process data. In this way, the data of each detection point P in the detection point sequence is represented by 1 bit, and the bit operation is performed by setting the bit corresponding to the detection point P that detected the moving body T to 1 and the other bits to 0. . Hereinafter, a specific example of processing by the above-described image processing unit 20 and the like in which data (0 or 1) relating to detection of the moving body T at the detection point P is assigned to each bit in this way will be described in detail. In each figure, only the 5-bit portion used is shown, and the other 3 bits are omitted. Also, in each figure, the bit (the bit at which data is 1) in which the mobile object T is detected is hatched with a diagonal line to distinguish it from other blank bits (the bit at which data becomes 0).

図7は、検出ポイント列で移動体Tを検出したときの処理について説明するための模式図であり、図7Aは現フレームの撮影画像Gから、図7Bは前フレームの撮影画像Gから、それぞれ取得した移動体Tの検出結果を示している。
画像処理部20(通過判定部23)は、図示のように、現在の所定の検出ポイント列(ここでは、A列とC列)を監視し、各検出ポイント列での移動体Tの検出に関するデータ(以下、検出データという)と、それぞれ対応する過去の同一検出ポイント列の検出データとから、その検出ポイント列で移動体Tを検出した検出ポイントPの変化や、検出位置等を把握するためのデータを演算処理して算出及び記憶する。
FIG. 7 is a schematic diagram for explaining processing when the moving object T is detected in the detection point sequence. FIG. 7A is from the captured image G of the current frame, and FIG. 7B is from the captured image G of the previous frame. The detection result of the acquired moving body T is shown.
As shown in the figure, the image processing unit 20 (passage determination unit 23) monitors a current predetermined detection point sequence (here, A column and C column) and relates to detection of the moving object T at each detection point sequence. From the data (hereinafter referred to as detection data) and the corresponding detection data of the same detection point sequence in the past, in order to grasp the change of the detection point P where the moving body T is detected in the detection point sequence, the detection position, etc. Is calculated and stored.

その際、ここでは、まず、検出ポイント列の現在と過去(前)の検出データ(以下、それぞれ現データ、前データという)との間で排他的論理和(以下、XORと記す)を演算する。続いて、演算後のデータと現データとの論理積(以下、ANDと記す)を演算((現データ XOR 前データ) AND 現データ)して、前データと比べて、現データの検出ポイント列で、移動体Tを新たに検出して変化した検出ポイントPに関するデータ(以下、変化データという)を算出する。次に、この変化データから、各検出ポイント列に入った移動体Tに関するイン(In)データ(以下、インデータという)を、検出ポイント列毎に演算して記憶する。このインデータは、変化データの演算時に、インデータが無いときには演算した変化データであり、過去にインデータがあるときには、そのインデータと演算した変化データの論理和(以下、ORと記す)を演算(インデータ OR 変化データ)して算出される。   In this case, first, an exclusive OR (hereinafter referred to as XOR) is calculated between the present and previous (previous) detection data (hereinafter referred to as current data and previous data, respectively) in the detection point sequence. . Subsequently, a logical product (hereinafter referred to as AND) of the calculated data and the current data is calculated ((current data XOR previous data) AND current data), and compared to the previous data, the detection point sequence of the current data Then, the data (hereinafter referred to as change data) relating to the detection point P that has been changed by newly detecting the moving body T is calculated. Next, in (in) data (hereinafter referred to as in-data) relating to the moving body T that has entered each detection point sequence is calculated and stored for each detection point sequence from the change data. This in-data is the change data calculated when there is no in-data when calculating the change data. When there is in-data in the past, the in-data is the logical sum (hereinafter referred to as OR) of the calculated change data. Calculated by calculation (in-data OR change data).

具体的には、A列の変化データとインデータ(以下、それぞれA列変化データ、A列インデータという)は、現データ(10100)と前データ(00000)とから(10100)となる。これに対し、C列の変化データとインデータ(以下、それぞれC列変化データ、C列インデータという)は、現データ(00100)と前データ(00000)とから(00100)となる。   Specifically, the change data and in data of the A column (hereinafter referred to as A column change data and A column in data, respectively) are (10100) from the current data (10100) and the previous data (00000). On the other hand, change data and in data of the C column (hereinafter referred to as C column change data and C column in data, respectively) are (00100) from the current data (00100) and the previous data (00000).

また、図8は、各検出ポイント列間やインデータの検出ポイントPの比較処理について説明するための模式図であり、移動体TがA列からC列に向かってダウン方向に移動するときの例を示している。
ここでは、画像処理部20は、C列(図8A参照)の検出ポイントP(C列3)で新たに移動体Tを検出して変化が生じたときに、このC列の上記したC列変化データ(変化した検出ポイントP)と過去のB列(前データ)とを比較して、B列からC列へ移動した移動体Tの有無を判別する。その際、B列(前データ)の同一位置の検出ポイントP(B列3)(図8B参照)で移動体Tを検出していたときには、B列からC列に移動した移動体Tがあると判定する。また、上記したように、B列(前データ)において、1つ隣の検出ポイントP(B列2又はB列4)(図8C、D参照)で移動体Tを検出していたときにも、B列からC列に移動体Tが斜行等して移動したと判定する。一方、それら以外の離れた位置の検出ポイントP(例えばB列1)(図8E参照)で移動体Tを検出していたときには、B列からC列に移動した移動体Tは無いと判定する。
FIG. 8 is a schematic diagram for explaining the comparison process between the detection point rows and the in-data detection point P. When the moving body T moves from the A row toward the C row in the down direction, FIG. An example is shown.
Here, the image processing unit 20 detects the moving object T at the detection point P (C column 3) of the C column (see FIG. 8A) and changes the C object. The change data (changed detection point P) and the past B column (previous data) are compared to determine the presence or absence of the moving body T that has moved from the B column to the C column. At this time, when the moving body T is detected at the detection point P (B row 3) (see FIG. 8B) at the same position in the B row (previous data), there is a moving body T that has moved from the B row to the C row. Is determined. In addition, as described above, when the moving object T is detected at the detection point P (B column 2 or B column 4) (see FIG. 8C and FIG. 8D) adjacent to the column B (previous data). , It is determined that the moving body T has moved from the B column to the C column in a skewed manner. On the other hand, when the moving body T is detected at the detection point P (for example, B row 1) (see FIG. 8E) at a position apart from these, it is determined that there is no moving body T that has moved from the B row to the C row. .

その後、画像処理部20は、B列からC列に移動した移動体Tがあると判定したときには、その移動体Tに関する移動データ(図8Aと同じデータ)と、A列インデータ(図示せず)とを同様に比較し、対応する検出ポイントP(A列2、A列3、A列4)で移動体Tを検出していたときに、A列からC列に移動した移動体Tがあると判定する。このようにして、計数対象領域Rを通過する移動体Tの有無を判定し、移動データと数変換テーブル(図4参照)から、ダウン方向に通過する移動体Tの数を判定する。また、この数を、A列インデータと数変換テーブルから判定した計数対象領域R内に入った移動体Tの数と比較し、それ以下のときには通過数としてカウントし、それよりも多いときには、検出ミスとして、A列インデータから判定した数を通過数としてカウントする。更に、画像処理部20は、カウント処理中である(通過数のカウントを既に行った)か否かを示すフラグ(以下、カウントフラグという)をオン(ON)する処理や、A列インデータから、カウント済みの移動体Tに対応する位置の検出ポイントPを、その移動体Tは既に通過したとしてクリアする処理を併せて実行する。   Thereafter, when the image processing unit 20 determines that there is a moving body T that has moved from the B row to the C row, the moving data related to the moving body T (the same data as FIG. 8A) and the A row in data (not shown). ) In the same manner, and when the moving body T is detected at the corresponding detection point P (A row 2, A row 3, A row 4), the moving body T that has moved from the A row to the C row is Judge that there is. In this way, the presence or absence of the moving body T passing through the counting target region R is determined, and the number of moving bodies T passing in the down direction is determined from the movement data and the number conversion table (see FIG. 4). Further, this number is compared with the number of moving bodies T that have entered the counting target region R determined from the A-column in data and the number conversion table, and when the number is less than that, the number is counted as a passing number. As a detection error, the number determined from the in-column A data is counted as a passing number. Further, the image processing unit 20 turns on a flag (hereinafter referred to as a count flag) indicating whether the count process is being performed (the number of passages has already been counted) or the A column in-data. Then, a process of clearing the detection point P at the position corresponding to the counted moving body T as the moving body T has already passed is also executed.

以上のように、計数装置1は、計数処理装置10により計数に関する各処理を実行する各手段を構成し、所定のプログラムや条件等に基づき、計数処理装置10により制御や処理して、カメラ2から順次取得する計数対象領域Rの撮影画像Gから、後述する移動体Tの通過数の計数処理を実行する。また、計数処理装置10は、移動体Tが以上と逆方向、即ち、C列からA列に向かってアップ方向(図3B参照)に移動するときには、以上の演算処理を、A列とC列に関する各データを入れ替えて同様に行い、それぞれ通過数を順次カウントして、両方向に通過する移動体Tの数を各々計数する。   As described above, the counting device 1 constitutes each means for executing each processing related to counting by the counting processing device 10 and is controlled and processed by the counting processing device 10 based on a predetermined program, conditions, etc. From the captured image G of the counting target region R acquired sequentially from the above, a counting process of the number of passes of the moving body T described later is executed. Further, when the moving body T moves in the opposite direction, that is, in the upward direction from the C row toward the A row (see FIG. 3B), the counting processing device 10 performs the above arithmetic processing in the A row and the C row. The data relating to the above are exchanged in the same manner, the number of passages is sequentially counted, and the number of moving bodies T passing in both directions is counted.

次に、この計数装置1による移動体Tの計数処理について詳細に説明する。
図9は、計数装置1による計数処理手順の一部を示すフローチャートであり、A列からC列に向かってダウン方向に通過する移動体Tの計数処理の流れを示している。一方、図10は、計数処理の具体例を、図6〜図8と同様にブロックで示す模式図であり、順次撮影した撮影画像G(フレーム画像)からの各データを、上から下に向かって順に示している。また、図10では、左から順に、A〜C列の検出データ、A列変化データ(上段)とA列インデータ(下段)、及びC列変化データ(上段)とC列インデータ(下段)を、撮影画像G毎に示している。
Next, the counting process of the moving body T by the counting device 1 will be described in detail.
FIG. 9 is a flowchart showing a part of the counting process procedure by the counting device 1, and shows the flow of the counting process of the moving body T passing in the down direction from the A column toward the C column. On the other hand, FIG. 10 is a schematic diagram showing a specific example of the counting process in the same manner as in FIGS. 6 to 8, and each data from the photographed images G (frame images) taken sequentially is directed from the top to the bottom. Are shown in order. In addition, in FIG. 10, the detection data of columns A to C, column A change data (upper) and column A in data (lower), and column C change data (upper) and column C in data (lower) are sequentially displayed from the left. Is shown for each captured image G.

計数処理時に、本実施形態では、図9に示すように、A列の検出データから計数対象領域R内に入ってくる移動体Tを監視するため、計数処理装置10により、上記したA列変化データとA列インデータを、既に説明した各演算式により順次算出し、レジスタ等に記憶する(S101)。図10に示す例では、2フレーム目(図10B)のA列3で初めに移動体Tを検出し、次に、4フレーム目(図10D)のA列2で新たに移動体Tを検出して7フレーム目(図10G)まで維持され、それに合わせてA列変化データとA列インデータが変化(図10A〜図10G参照)する。   In the present embodiment, in the present embodiment, as shown in FIG. 9, in order to monitor the moving body T that enters the counting target region R from the detection data of the A column, the above-described A column change is performed by the counting processing device 10. The data and the A-column in data are sequentially calculated by the above-described arithmetic expressions and stored in a register or the like (S101). In the example shown in FIG. 10, the moving object T is first detected in the A column 3 of the second frame (FIG. 10B), and then the moving object T is newly detected in the A column 2 of the fourth frame (FIG. 10D). Thus, the seventh frame (FIG. 10G) is maintained, and the A column change data and the A column in data change accordingly (see FIGS. 10A to 10G).

また、計数装置1は、A列、B列、C列の全てで移動体Tの検出が無いか否かを判別し(S102)、移動体Tを検出したときには(S102、NO)、B列とC列で検出データに変化があるか否かを、それぞれ現データと1つ前のフレームの前データとを比較して判別する(S103)。その結果、少なくとも一方の列で変化がある(現データ≠前データ)ときには(S103、YES)、以上の処理と併せて順次演算したC列変化データから、C列で増加があるか否かを判別する(S104)。図10に示す例では、B列は、7フレーム目(図10G)で移動体Tを検出してB列2、B列3が変化し、C列は、10フレーム目(図10J)のC列2で移動体Tを検出し、その位置のC列変化データとC列インデータも変化してC列で増加が生じる。   Further, the counting device 1 determines whether or not the moving object T is detected in all of the A column, the B column, and the C column (S102), and when the moving object T is detected (S102, NO), the B column Whether or not there is a change in the detected data in column C is determined by comparing the current data with the previous data of the previous frame (S103). As a result, when there is a change in at least one column (current data ≠ previous data) (S103, YES), it is determined whether there is an increase in the C column from the C column change data sequentially calculated in conjunction with the above processing. A determination is made (S104). In the example shown in FIG. 10, the B column detects the moving body T in the seventh frame (FIG. 10G), the B column 2 and the B column 3 change, and the C column is the C frame in the tenth frame (FIG. 10J). The moving body T is detected in the column 2, and the C column change data and the C column in data at the position are also changed to cause an increase in the C column.

このように、C列が変化したときには(S104、YES)、計数装置1は、移動体TのB列からC列への移動があるか否かを判別する(S105)。この判別は、上記(図8参照)したように、現在のC列変化データと、過去のB列の検出データ(B列前データ)とを比較し、ここでは、B列前データの移動体Tの検出位置又は、その両側位置のいずれかと、C列変化データの変化位置が一致するときに、移動体Tが移動したと判別する。具体的には、B列前データと、その移動体Tの検出位置を1つ隣りにそれぞれシフトさせた2つの前データとの論理和(OR)を演算し、その結果とC列変化データとの論理積(AND)を演算(C列変化データ AND (B列前データ OR B列前データ>>1 OR B列前データ<<1))する。その演算結果(以下、移動データという)が0でないときに移動ありと判別する(S105、YES)。図10に示す例では、10フレーム目(図10J)のC列変化データと、9フレーム目(図10I)のB列の検出データとを比較し、B列の算出位置(B列1、B列2、B列3、B列4)にC列の変化位置(C列2)が含まれるので、移動データが0にならず移動体Tありと判別される。   Thus, when the C column has changed (S104, YES), the counting device 1 determines whether or not there is a movement of the moving body T from the B column to the C column (S105). For this determination, as described above (see FIG. 8), the current C column change data is compared with the past B column detection data (B column previous data). When either the detection position of T or the position on both sides thereof matches the change position of the C column change data, it is determined that the moving body T has moved. Specifically, the logical sum (OR) of the B-column previous data and the two previous data obtained by shifting the detection position of the moving body T one by one is calculated, and the result and the C-column change data are calculated. AND (C column change data AND (B column previous data OR B column previous data >> 1 OR B column previous data << 1)). When the calculation result (hereinafter referred to as movement data) is not 0, it is determined that there is movement (S105, YES). In the example shown in FIG. 10, the C column change data of the 10th frame (FIG. 10J) is compared with the detection data of the B column of the 9th frame (FIG. 10I), and the calculated position of the B column (B column 1, B Since the change position of the C column (C column 2) is included in the column 2, the B column 3, and the B column 4), the moving data is not 0, and it is determined that the moving body T is present.

続いて、この移動データと現在のA列インデータとを同様に比較(図8参照)して演算(移動データ AND (A列インデータ OR A列インデータ>>1 OR A列インデータ<<1))し、A列インデータに対応する検出があるか否かを判別する(S106)。その結果、対応する検出があるときには(S106、YES)、計数対象領域Rをダウン方向に移動して通過する移動体Tがあると判定し、そのカウント処理を開始する(S107)。図10に示す例では、移動データの検出位置(C列2)と、A列インデータ(図10J)の算出位置(A列1、A列2、A列3、A列4)とを比較し、A列インデータに対応する位置の検出があるため、通過する移動体Tありと判定されてカウント処理が開始される。   Subsequently, the movement data is compared with the current A column in data in the same manner (see FIG. 8) and operated (movement data AND (A column in data OR A column in data >> 1 OR A column in data << 1)), and it is determined whether or not there is a detection corresponding to the A column in-data (S106). As a result, when there is a corresponding detection (S106, YES), it is determined that there is a moving body T that moves through the counting target region R in the down direction, and the counting process is started (S107). In the example shown in FIG. 10, the detection position of the movement data (C column 2) and the calculation position (A column 1, A column 2, A column 3, A column 4) of the A column in data (FIG. 10J) are compared. Since the position corresponding to the A-line in data is detected, it is determined that there is a moving moving body T and the counting process is started.

図11は、計数装置1によるカウント処理の手順を示すフローチャートである。
カウント処理では、図示のように、まず、上記したカウントフラグがオフ(OFF)か否かを確認して(S201)、初めてのカウントでオフのときには(S201、YES)、A列インデータから、数変換テーブル(図4参照)をサーチして、通過予定の移動体Tの数(以下、数Aという)を判定する(S202)。次に、移動データから、同様に数変換テーブルをサーチして、通過する移動体Tの数(以下、数Bという)を判定し(S203)、それらを比較する(S204)。その結果、数Bが数Aよりも大きい(数B>数A)ときには(S204、YES)、移動データから判定した数Bは採用せずに、A列インデータから判定した数Aをカウントする(S205)。一方、数Bが数A以下(数B≦数A)のときには(S204、NO)、移動データから判定した数Bをカウントする(S206)。図10に示す例では、移動データ(図10J参照)から判定した数Bは1であるのに対し、A列インデータから判定した数Aも1であり、数Bの1がカウントされる。
FIG. 11 is a flowchart showing the procedure of the counting process performed by the counting device 1.
In the count process, as shown in the figure, first, it is confirmed whether or not the count flag is off (OFF) (S201). When the count is off for the first time (S201, YES), The number conversion table (see FIG. 4) is searched to determine the number of moving bodies T scheduled to pass (hereinafter referred to as number A) (S202). Next, the number conversion table is similarly searched from the movement data to determine the number of moving bodies T (hereinafter referred to as number B) that pass through (S203), and these are compared (S204). As a result, when the number B is larger than the number A (number B> number A) (S204, YES), the number A determined from the in-column A data is counted without adopting the number B determined from the moving data. (S205). On the other hand, when the number B is equal to or less than the number A (number B ≦ number A) (S204, NO), the number B determined from the movement data is counted (S206). In the example shown in FIG. 10, the number B determined from the movement data (see FIG. 10J) is 1, whereas the number A determined from the A column in data is also 1, and 1 of the number B is counted.

次に、計数装置1は、カウントフラグをオンにして(S207)、カウントした移動体Tの数(累計)(以下、カウント数という)と、その際のカウント処理した移動データ(以下、カウントデータという)を保存する(S208)。また、A列インデータの、カウントした移動体Tに対応する位置のデータをクリアして0にし(S209)、続いて、アップ方向に移動する移動体Tの計数処理へ進む(S210)。ここでは、このクリアの処理を、移動データの補数(NOT)とA列インデータとの論理積(AND)を演算(A列インデータ AND (NOT 移動データ))して行い、その結果を新たなA列インデータとして以後使用する。図10に示す例では、クリア前のA列インデータ(図10J)から、移動データに対応する位置のA列2がクリアされて、A列3のみが検出位置である新たなA列インデータ(図10K)が演算される。   Next, the counting device 1 turns on the count flag (S207), and counts the number of moving bodies T (cumulative) (hereinafter referred to as count number) and the movement data (hereinafter referred to as count data) subjected to count processing at that time. Is saved (S208). Further, the data in the position corresponding to the counted moving body T in the A-line in data is cleared to 0 (S209), and then the process proceeds to the counting process of the moving body T moving in the up direction (S210). Here, this clearing process is performed by calculating the logical product (AND) of the complement (NOT) of the moving data and the A column in data (A column in data AND (NOT moving data)). It will be used later as a long A-in data. In the example shown in FIG. 10, A column 2 at the position corresponding to the movement data is cleared from the A column in data before clearing (FIG. 10J), and new A column in data in which only A column 3 is the detection position. (FIG. 10K) is calculated.

これに対し、カウントフラグがオンであり、続けてカウントを行うときには(S201、NO)、まず、上記と同様に数変換テーブルをサーチして、A列インデータから数Aを判定する(S211)。また、今回の移動データと、前回のカウント時に保存(S208)したカウントデータの論理和(移動データ OR カウントデータ)から、新たなカウントデータを演算し、このカウントデータからも数(以下、数Cという)を判定する(S212)。次に、数Cと現在のカウント数とを比較し(S213)、数Cがカウント数以下(数C≦カウント数)のときには(S213、NO)、新たなカウントは行わずにS208へ進む。一方、数Cがカウント数よりも大きい(数C>カウント数)ときには(S213、YES)、数Cからカウント数を引いて差分を算出し(S214)、この差分と数Aを比較する(S215)。その結果、この差分が数Aよりも大きい(差分>数A)ときには(S215、YES)、差分を採用せずにA列インデータから判定した数Aをカウントし(S216)、差分が数A以下(差分≦数A)のときには(S215、NO)、差分を新たにカウントする(S217)。その後、S208に進んで、上記と同様に各ステップを実行してアップ方向の計数処理へ進む(S208〜S210)。   On the other hand, when the count flag is on and counting is continued (S201, NO), first, the number conversion table is searched in the same manner as described above, and the number A is determined from the A column in-data (S211). . In addition, new count data is calculated from the logical sum of the current movement data and the count data stored at the previous count (S208) (movement data OR count data). (S212). Next, the number C is compared with the current count number (S213). When the number C is equal to or less than the count number (number C ≦ count number) (S213, NO), the process proceeds to S208 without performing a new count. On the other hand, when the number C is larger than the count number (number C> count number) (S213, YES), a difference is calculated by subtracting the count number from the number C (S214), and the difference is compared with the number A (S215). ). As a result, when the difference is larger than the number A (difference> number A) (S215, YES), the number A determined from the A column in-data without using the difference is counted (S216). Below (difference ≦ number A) (S215, NO), the difference is newly counted (S217). Thereafter, the process proceeds to S208, and the respective steps are executed in the same manner as described above to proceed to the counting process in the up direction (S208 to S210).

図12は、このようにカウントフラグがオンのときの計数処理の例を、図10と同様にブロックで示す模式図である。
ここでは、図示のように、まず、1フレーム目(図12A)のA列3、A列4で初めに移動体Tを検出し、次に、2フレーム目(図12B)のA列1で新たに、かつ離れた位置に移動体Tを検出して、それらが6フレーム目(図12F)で全て消滅する。その間、A列変化データとA列インデータは、上記と同様に順次演算され、移動体Tの検出位置の変化に合わせて変化する(図12A〜図12F参照)。また、B列では、A列に入った移動体Tがダウン方向へ移動するのに伴い、3フレーム目(図12C)で初めて移動体Tを検出(B列4)した後、その検出位置が次第に増加する(図12C〜図12G参照)。
FIG. 12 is a schematic diagram showing an example of the counting process when the count flag is turned on as shown in FIG.
Here, as shown in the figure, first, the moving body T is detected first in the A column 3 and A column 4 of the first frame (FIG. 12A), and then in the A column 1 of the second frame (FIG. 12B). The moving body T is newly detected at a distant position, and all of them disappear at the sixth frame (FIG. 12F). Meanwhile, the A column change data and the A column in data are sequentially calculated in the same manner as described above, and change in accordance with the change in the detection position of the moving body T (see FIGS. 12A to 12F). Further, in the B row, as the moving body T entering the A row moves in the down direction, after the moving body T is detected for the first time in the third frame (FIG. 12C) (B row 4), the detection position is It gradually increases (see FIGS. 12C to 12G).

一方、C列では、8フレーム目(図12H)で初めて移動体Tを検出(C列3)し、同位置のC列変化データとC列インデータも変化する。この変化を受けて、計数装置1は、上記と同様に移動体Tの計数処理を行い、移動体Tの数を判定する。ここでは、前フレームのB列(図12G)に、C列での検出位置C列3に対応する位置の検出(B列3)があり、かつA列インデータ(図12H)にも対応する検出(A列3)があるため、カウントフラグがオフのときのカウント処理が開始(S202)する。その際、A列インデータから判定される数Aが2であるのに対し、C列の移動データから判定される数Bは1であるため、より小さい数Bの1がカウントされて、カウントフラグもオンになる。また、A列インデータの、カウントした移動体Tに対応する位置(A列3)のデータがクリア(図12I)されてなくなる。   On the other hand, in the C column, the moving body T is detected for the first time in the eighth frame (FIG. 12H) (C column 3), and the C column change data and C column in data at the same position also change. In response to this change, the counting device 1 performs the counting process of the moving bodies T in the same manner as described above, and determines the number of moving bodies T. Here, the B column (FIG. 12G) of the previous frame has a position detection (B column 3) corresponding to the detection position C column 3 in the C column, and also corresponds to the A column in-data (FIG. 12H). Since there is a detection (A column 3), the counting process when the count flag is off is started (S202). At this time, the number A determined from the A column in data is 2, whereas the number B determined from the moving data in the C column is 1. Therefore, a smaller number B of 1 is counted and counted. The flag is also turned on. Further, the data in the position (A column 3) corresponding to the counted moving body T in the A column in data is not cleared (FIG. 12I).

続いて、11フレーム目(図12K)におけるC列での新たな移動体Tの検出(C列1)に伴い、同様に移動体Tの計数処理が行われ、上記したカウントフラグがオンのときのカウント処理が開始(S211)する。その際、ここでは、今回の移動データ(C列1)と前回保存したカウントデータ(C列3)とをOR処理した新たなカウントデータ(C列1、C列3)から、数Cは2と判定される。この数Cは、既にカウントしたカウント数の1よりも大きく、かつ、その差分1が、A列インデータから判定される数Aの2よりも小さいため、差分1が新たにカウントされてカウント数が2になる。その後は、A列インデータのクリアや、カウント数と新たなカウントデータの保存等、上記と同様の各処理が実行される。   Subsequently, when the new moving body T is detected in the C row in the 11th frame (FIG. 12K) (C row 1), the counting process of the moving body T is performed in the same manner, and the count flag is on. Count processing starts (S211). At this time, here, the number C is 2 from the new count data (C column 1, C column 3) obtained by ORing the current movement data (C column 1) and the previously stored count data (C column 3). It is determined. This number C is larger than 1 of the already counted count number and the difference 1 is smaller than 2 of the number A determined from the A column in-data, so that the difference 1 is newly counted and the count number Becomes 2. Thereafter, the same processing as described above is executed, such as clearing the A-column in data and saving the count number and new count data.

なお、本実施形態では、A列〜C列(図9参照)の全てで移動体Tの検出が無いときに(S102、YES)、この検出無しの状態が3フレーム連続した場合には、カウントフラグをクリアしてオフにするとともに、保存したカウントデータ等の所定のデータをクリアして(S108)、アップ方向の計数処理へ進む(S109)。これにより、それまでの条件をクリアして初期状態に戻し、次に移動体Tを検出したときに、新たに検出処理を再開する。また、上記した各ステップ(S103、S104、S105、S106)で、それぞれNOと判定されたときには、アップ方向の計数処理へ進み(S109)、各検出ポイント列での同一の検出データに基づき、アップ方向に通過する移動体Tの判定やカウント処理を行う。   In the present embodiment, when there is no detection of the moving object T in all of the columns A to C (see FIG. 9) (S102, YES), the counting is performed when this non-detection state continues for three frames. The flag is cleared and turned off, and predetermined data such as stored count data is cleared (S108), and the process proceeds to the counting process in the up direction (S109). Thereby, the conditions up to that time are cleared and returned to the initial state, and when the moving object T is next detected, the detection process is newly resumed. If it is determined NO in each of the above steps (S103, S104, S105, S106), the process proceeds to the counting process in the up direction (S109), and based on the same detection data in each detection point sequence The moving body T passing in the direction is determined and counted.

ただし、C列で増加がないと判定されたときには(S104、NO)、その前に移動体Tをカウントしたときに比べて、B列、C列で検出位置が減少したか否かを判定する(S110)。この判定は、カウント処理時に保存(S208)したカウントデータ及び、現在のB列、C列の検出データ(B列現データ、C列現データ)に基づき、カウントデータと、B列現データとC列現データの論理和(OR)との論理積(AND)を演算(カウントデータ AND (B列現データ OR C列現データ))して判定する。その結果、演算結果がカウントデータと一致しない(演算結果≠カウントデータ)ときには、B列、C列で減少が生じたと判定して(S110、YES)、カウントフラグやカウントデータ等を上記と同様にクリア(S111)してから、アップ方向の計数処理へ進む(S109)。一方、減少がないとき(演算結果=カウントデータ)には(S110、NO)、アップ方向の計数処理へ進み(S109)、C列からA列に向かって移動(図3B参照)して通過する移動体Tの計数処理を行う。   However, when it is determined that there is no increase in the C column (S104, NO), it is determined whether or not the detection position is decreased in the B column and the C column, compared to when the moving object T is counted before that. (S110). This determination is based on the count data saved at the time of the count processing (S208) and the detection data (B column current data, C column current data) of the current B column and C column. A logical product (AND) with the logical sum (OR) of the column current data is calculated (count data AND (B column current data OR C column current data)) and determined. As a result, if the calculation result does not match the count data (calculation result ≠ count data), it is determined that a decrease has occurred in the B and C columns (S110, YES), and the count flag, count data, etc. are set in the same manner as described above. After clearing (S111), the process proceeds to the counting process in the up direction (S109). On the other hand, when there is no decrease (calculation result = count data) (S110, NO), the process proceeds to the counting process in the up direction (S109), moves from the C column toward the A column (see FIG. 3B) and passes. The counting process of the moving body T is performed.

図13、図14は、この計数装置1によるアップ方向の計数処理手順の一部を示すフローチャートであり、図13はカウント処理前の手順を、図14はカウント処理の手順を、それぞれ示している。
このアップ方向の計数処理は、既に説明したダウン方向の処理(図9、図11参照)に対し、A列とC列に関する各データを入れ替えて同様の処理や演算により順次実行され、その後、再びダウン方向の処理へ進む。従って、これら図13、図14では、図9、図11の各ステップに対応するステップには、その末尾に「’」を付して例えばS101’、S201’等と示し、その説明は省略する。
FIGS. 13 and 14 are flowcharts showing a part of the counting process procedure in the up direction by the counting device 1, FIG. 13 shows the procedure before the counting process, and FIG. 14 shows the procedure of the counting process. .
The counting process in the up direction is sequentially executed by the same process or calculation by replacing each data related to the A column and the C column with respect to the down direction process (see FIGS. 9 and 11) described above, and then again. Proceed to processing in the down direction. Accordingly, in FIGS. 13 and 14, steps corresponding to the steps in FIGS. 9 and 11 are denoted by “′” at the end thereof, for example, S 101 ′, S 201 ′, etc., and description thereof is omitted. .

以上説明したように、本実施形態の計数装置1では、計数対象領域Rの撮影画像Gに、複数の検出ポイント列(検出ポイントP)を設定し、それらにより移動体Tを検出して、ビット演算により、移動体Tの通過の有無を判定して通過数をカウントする。そのため、画素数が少ない撮影画像Gでも充分正確に移動体Tの通過を判定してカウントでき、低画素の画像を撮影するカメラ2が使用可能で、かつ簡易に計数処理を行うことができる。また、撮影画像Gの全体を画像処理する必要がなく、その一部のみを使用して計数処理を行うため、そのアルゴリズムも比較的簡単になり、移動体Tの計数に要する計算量も減少して、処理負荷を軽減することもできる。これに伴い、処理速度が遅い低価格のCPUを使用でき、必要なメモリの容量も少なくてすむため、装置全体のコストを低減できる。   As described above, in the counting device 1 according to the present embodiment, a plurality of detection point sequences (detection points P) are set in the captured image G of the counting target region R, and the moving object T is detected by them, and the bit is detected. The number of passages is counted by determining the presence or absence of passage of the moving body T by calculation. Therefore, even the captured image G with a small number of pixels can be accurately counted by determining the passage of the moving body T, the camera 2 that captures a low-pixel image can be used, and the counting process can be performed easily. In addition, since it is not necessary to perform image processing on the entire captured image G, and only a part of the captured image G is used for counting, the algorithm is relatively simple, and the amount of calculation required for counting the moving object T is reduced. Thus, the processing load can be reduced. Accordingly, a low-priced CPU with a low processing speed can be used, and the required memory capacity can be reduced, so that the cost of the entire apparatus can be reduced.

また、移動体Tを検出した検出ポイントPの位置を検出ポイント列間で比較して、互いの対応する位置の検出ポイントPでの検出の有無等から移動する移動体Tを判別するため、移動体Tの移動方向や計数対象領域Rの通過を、正確、確実に判別して、その通過数のカウントを精度よく行うことができる。更に、この計数装置1では、所定の検出ポイント列間の移動体Tを検出した検出ポイントPを相互に比較し、対応する位置の検出ポイントPや両隣の検出ポイントPとの比較結果等から、その移動体Tの通過方向に沿う位置の変化を把握する。このようにして得た検出ポイント列間の位置の変化に基づき、通過方向に移動する移動体Tを判別するため、その判別精度を、比較的簡単な処理で効果的に高めることができる。併せて、検出ポイント列の各検出結果に基づき、その検出ポイント列で検出した移動体Tの数を判定して取得するため、移動体Tの通過数のカウントも正確に行うことができる。その際、ここでは、数変換テーブル(図4参照)を使用して、移動体Tの数を判定するため、その判定処理を容易に行うことができる。   Further, the position of the detection point P at which the moving body T is detected is compared between the detection point sequences, and the moving body T is determined based on the presence or absence of detection at the detection point P at the corresponding position. The movement direction of the body T and the passage of the counting target region R can be accurately and reliably discriminated, and the number of passages can be accurately counted. Furthermore, in this counting device 1, the detection points P that detect the moving body T between the predetermined detection point sequences are compared with each other, and from the comparison results with the detection points P at the corresponding positions and the detection points P on both sides, etc. The change of the position along the passing direction of the moving body T is grasped. Since the moving body T that moves in the passing direction is discriminated based on the change in the position between the detection point rows obtained in this way, the discrimination accuracy can be effectively increased by a relatively simple process. In addition, since the number of moving bodies T detected by the detection point sequence is determined and acquired based on the detection results of the detection point sequence, the number of passes of the moving body T can be accurately counted. At this time, since the number of the moving bodies T is determined using the number conversion table (see FIG. 4), the determination process can be easily performed.

従って、本実施形態によれば、簡易な構成で計数対象領域Rを通過する移動体Tを精度よく計数でき、移動体Tの計数時の計算量を減少させて処理負荷を軽減できるとともに、計数装置1のコストを低減させることができる。また、この計数装置1では、計数対象領域Rを互いに逆方向に通過する移動体Tをそれぞれカウントするため、両方向の通過数を把握でき、計数装置1の利便性を確保することができる。その際、ここでは、両方向のカウントを、それぞれ同様に検出や演算したデータを使用して同様に演算処理して行うため、計算量やデータ量の増加を抑制して、比較的簡易な処理により実施できる。加えて、この計数装置1では、所定数の撮影画像Gで連続して移動体Tが検出されないときには、カウントフラグ等をクリアし、初期状態に戻して移動体Tの通過の有無の判定等を再開するため、それ以前の不要なデータ等をクリアして、それらが計数処理に影響を及ぼすのを防止することができる。これに伴い、移動体Tの検出ミスの発生や、計数処理中の不要データの累積等に対処でき、計数精度の低下を抑制することができる。   Therefore, according to the present embodiment, it is possible to accurately count the moving body T passing through the counting target region R with a simple configuration, reduce the calculation amount when counting the moving body T, and reduce the processing load. The cost of the apparatus 1 can be reduced. In addition, since the counting device 1 counts the moving bodies T that pass through the counting target region R in opposite directions, the number of passages in both directions can be grasped, and the convenience of the counting device 1 can be ensured. At this time, since the counting in both directions is performed by the same calculation processing using the data detected and calculated in the same manner, the increase in the calculation amount and the data amount is suppressed, and the processing is relatively simple. Can be implemented. In addition, the counting device 1 clears the count flag and the like when the moving body T is not continuously detected in the predetermined number of captured images G, returns to the initial state, and determines whether or not the moving body T has passed. In order to resume, unnecessary data and the like before that can be cleared to prevent them from affecting the counting process. Along with this, it is possible to cope with the occurrence of a detection error of the moving body T, the accumulation of unnecessary data during the counting process, and the like, and it is possible to suppress a decrease in counting accuracy.

ここで、本実施形態では、少なくとも3つの検出ポイント列(A列、B列、C列)を設定するとともに、上記のように、各検出ポイント列の検出結果やその比較結果等から、移動体Tやその移動及び通過を判別するため、それらを漏れなく確実に把握して、所定方向への通過数を正確にカウントすることができる。ただし、検出ポイント列は、移動体Tの通過方向に沿って4つ又は5つ設定する等、他の数を設定し、それらの全て、又は任意の位置の検出ポイント列の検出結果を使用して、移動体Tの通過の判定やカウント処理を行うようにしてもよい。   Here, in the present embodiment, at least three detection point columns (A column, B column, C column) are set, and as described above, from the detection result of each detection point column and the comparison result thereof, the mobile object Since T and its movement and passage are discriminated, they can be surely grasped without omission and the number of passages in a predetermined direction can be accurately counted. However, the detection point sequence is set to other numbers such as 4 or 5 along the passing direction of the moving object T, and all of them or the detection result of the detection point sequence at an arbitrary position is used. Thus, the passage of the moving body T may be determined and count processing may be performed.

なお、各検出ポイント列の検出ポイントPは、計数対象領域Rや撮影画像Gの大きさやカメラ2の設置高さ、又は要求される計数精度等に応じて、適宜必要な数を必要な位置に設定すればよい。その際、8つ以内の数を設定する場合には、各検出ポイント列や演算した各データ(図6参照)を1バイト(8ビット)で処理可能で、各処理や演算を、8ビットのCPUを使用して容易に行えるため、各検出ポイント列の検出ポイントPは、8つ以内の数を設定するのが望ましい。また、各検出ポイント列の複数の検出ポイントPは、計数対象領域Rの状態や移動体Tの移動態様等に応じて、移動体Tの通過方向に直行する方向以外に、ある程度斜交する方向に設定し、又は湾曲するように配列させる等、通過方向に交差する他の方向に設定してもよい。   It should be noted that the detection points P of each detection point sequence are appropriately provided in necessary positions according to the size of the counting target region R, the size of the captured image G, the installation height of the camera 2, or the required counting accuracy. You only have to set it. At that time, when setting a number of 8 or less, each detection point sequence and each calculated data (see FIG. 6) can be processed by 1 byte (8 bits), and each process and calculation is performed by 8 bits. Since it can be easily performed using a CPU, it is desirable to set the number of detection points P in each detection point sequence within eight. Further, a plurality of detection points P in each detection point row are obliquely crossed to some extent in addition to the direction orthogonal to the passing direction of the moving body T, depending on the state of the counting target region R, the moving mode of the moving body T, and the like. Or may be set in another direction that intersects the passing direction, such as being arranged so as to be curved.

更に、本実施形態では、検出ポイント列の検出ポイントPの数を一定にして、移動体Tの検出や計数処理を行ったが、検出ポイントPの設定数は、各計数時における移動体Tの計数結果等に応じて、変更可能に構成してもよい。この場合には、例えば単位時間あたりのカウント数と、予め設定されたカウント数の閾値とを比較し、その比較結果から移動体Tの通過状況等を判断して、各状況に応じて、検出ポイント列の検出ポイントPの数を変化させて設定等する。   Further, in the present embodiment, the number of detection points P in the detection point row is fixed, and the mobile body T is detected and counted. However, the number of detection points P set is the number of mobile bodies T at each count. It may be configured to be changeable according to the counting result or the like. In this case, for example, the number of counts per unit time is compared with a preset threshold value of the number of counts, and the passing situation of the mobile unit T is judged from the comparison result, and detection is performed according to each situation. Setting is made by changing the number of detection points P in the point sequence.

以上、建物90のドア91付近にカメラ2を設置する場合を例に説明したが、この計数装置1は、例えば建物90の通路の途中を通過する移動体Tを計数したり、或いは、屋外の道路を通過する自動車や人を計数する等、他の位置にカメラ2を設置して、種々の計数対象領域Rを通過する移動体Tの計数に使用できる。また、本発明は、計数装置1のコンピュータを、計数装置1により実行する以上説明した各手段として機能させるためのプログラムとしても実現できる。   As described above, the case where the camera 2 is installed near the door 91 of the building 90 has been described as an example. However, the counting device 1 counts, for example, the moving body T passing through the passage of the building 90 or the outdoor The camera 2 can be installed at other positions such as counting cars and people passing through the road, and can be used for counting the moving bodies T passing through various count target regions R. The present invention can also be realized as a program for causing the computer of the counting device 1 to function as each means described above executed by the counting device 1.

本実施形態の移動体の計数装置の概略構成を示す模式図である。It is a schematic diagram which shows schematic structure of the counting device of the moving body of this embodiment. 本実施形態の計数処理装置の概略構成を示す機能ブロック図である。It is a functional block diagram which shows schematic structure of the count processing apparatus of this embodiment. 検出ポイントの設定について説明するための模式図である。It is a schematic diagram for demonstrating the setting of a detection point. 本実施形態の数変換テーブルの一部を示す模式図である。It is a schematic diagram which shows a part of number conversion table of this embodiment. 本実施形態の数判定部による判定について説明するための模式図である。It is a schematic diagram for demonstrating the determination by the number determination part of this embodiment. 本実施形態のデータ処理について説明するための模式図である。It is a schematic diagram for demonstrating the data processing of this embodiment. 検出ポイント列で移動体を検出したときの処理について説明するための模式図である。It is a schematic diagram for demonstrating a process when a moving body is detected by the detection point row | line | column. 各検出ポイント列間やインデータの検出ポイントの比較処理について説明するための模式図である。It is a schematic diagram for demonstrating the comparison process between each detection point row | line | column and the detection point of in data. 本実施形態の計数装置による計数処理手順の一部を示すフローチャートである。It is a flowchart which shows a part of counting process procedure by the counting device of this embodiment. 計数処理の具体例をブロックで示す模式図である。It is a schematic diagram which shows the specific example of a count process with a block. 本実施形態の計数装置によるカウント処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the count process by the counting device of this embodiment. カウントフラグがオンのときの計数処理の例を示す模式図である。It is a schematic diagram which shows the example of the count process when a count flag is ON. 本実施形態の計数装置による計数処理手順の一部を示すフローチャートである。It is a flowchart which shows a part of counting process procedure by the counting device of this embodiment. 本実施形態の計数装置による計数処理手順の一部を示すフローチャートである。It is a flowchart which shows a part of counting process procedure by the counting device of this embodiment.

符号の説明Explanation of symbols

1・・・計数装置、2・・・カメラ、10・・・計数処理装置、11・・・CPU、12・・・ROM、13・・・RAM、14・・・制御部、15・・・記憶部、16・・・設定部、17・・・カウント部、18・・・設定入力部、19・・・入出力部、20・・・画像処理部、21・・・検出部、22・・・数判定部、23・・・通過判定部、24・・・比較部、25・・・移動体判別部、90・・・建物、91・・・ドア、G・・・撮影画像、K・・・バス、P・・・検出ポイント、R・・・計数対象領域、T・・・移動体。   DESCRIPTION OF SYMBOLS 1 ... Counting device, 2 ... Camera, 10 ... Count processing device, 11 ... CPU, 12 ... ROM, 13 ... RAM, 14 ... Control part, 15 ... Storage unit, 16 ... setting unit, 17 ... counting unit, 18 ... setting input unit, 19 ... input / output unit, 20 ... image processing unit, 21 ... detection unit, 22. ··· Number determination unit, 23 ··· Passing determination unit, 24 ··· Comparison unit, 25 ··· moving object discrimination unit, 90 ··· building, 91 ··· door, G ··· shot image, K ... bus, P ... detection point, R ... counting target area, T ... moving body.

Claims (9)

計数対象領域を上方からカメラで撮影して通過する移動体を計数する移動体の計数装置であって、
計数対象領域の撮影画像に、移動体の通過方向と交差する方向に配列された複数の検出ポイントからなる移動体の検出ポイント列を、前記通過方向に沿って複数設定する設定手段と、
計数対象領域の撮影画像から各検出ポイント列の検出ポイント毎に移動体を検出する検出手段と、
複数の検出ポイント列の各検出ポイントでの移動体の検出結果に基づき、計数対象領域を通過する移動体の有無を判定する通過判定手段と、
計数対象領域を前記通過方向に通過する移動体数をカウントするカウント手段と、
を備えたことを特徴とする移動体の計数装置。
A moving body counting apparatus that counts a moving body that is photographed from above by a camera and counts a moving body,
Setting means for setting a plurality of detection point sequences of the moving body composed of a plurality of detection points arranged in the direction intersecting the passing direction of the moving body in the captured image of the counting target region, along the passing direction;
Detection means for detecting a moving body for each detection point of each detection point sequence from the captured image of the counting target region;
Based on the detection result of the moving body at each detection point of the plurality of detection point rows, passage determination means for determining the presence or absence of the moving body that passes through the counting target region;
Counting means for counting the number of moving objects that pass through the counting target area in the passing direction;
A moving body counting apparatus comprising:
請求項1に記載された移動体の計数装置において、
前記通過判定手段が、検出ポイント列間の移動体を検出した検出ポイントの位置を比較する比較手段と、該位置の比較結果に基づき、計数対象領域を前記通過方向へ移動する移動体を判別する判別手段とを有し、該判別結果に基づいて前記通過する移動体の有無を判定することを特徴とする移動体の計数装置。
In the moving body counting device according to claim 1,
The passage determination means compares the position of the detection point that detected the moving body between the detection point rows, and the moving body that moves the counting target area in the passing direction based on the comparison result of the position. A moving body counting apparatus comprising: a determination unit; and determining presence / absence of the passing moving body based on the determination result.
請求項2に記載された移動体の計数装置において、
前記判別手段が、検出ポイント列間の移動体を検出した検出ポイントの前記通過方向に沿う位置の変化に基づき、前記通過方向に移動する移動体を判別することを特徴とする移動体の計数装置。
The mobile counting device according to claim 2, wherein
The moving body counting device characterized in that the discrimination means discriminates a moving body that moves in the passing direction based on a change in a position along the passing direction of a detection point that detects the moving body between detection point rows. .
請求項1ないし3のいずれかに記載された移動体の計数装置において、
各検出ポイント列の複数の検出ポイントでの各検出結果に基づき、該検出ポイント列で検出した移動体の数を判定する数判定手段を備えたことを特徴とする移動体の計数装置。
The moving body counting device according to any one of claims 1 to 3,
A moving body counting apparatus comprising: a number determining means for determining the number of moving bodies detected in a detection point sequence based on detection results at a plurality of detection points in each detection point sequence.
請求項1ないし4のいずれかに記載された移動体の計数装置において、
前記設定手段が、前記通過方向に沿って順に配置された第1、第2、第3検出ポイント列を少なくとも設定する手段であり、
前記通過判定手段が、第1、第2、第3検出ポイント列の各検出ポイントでの移動体の検出結果に基づき、前記通過する移動体の有無を判定することを特徴とする移動体の計数装置。
In the counting device of the mobile object according to any one of claims 1 to 4,
The setting means is means for setting at least first, second, and third detection point sequences arranged in order along the passing direction;
The moving object count, wherein the passage determining means determines the presence or absence of the moving object passing based on the detection result of the moving object at each detection point of the first, second, and third detection point sequences. apparatus.
請求項5に記載された移動体の計数装置において、
第1検出ポイント列の検出ポイント毎の移動体の検出結果に基づき、計数対象領域内に入った移動体を判別する手段と、
第3検出ポイント列の検出ポイント毎の移動体の検出結果に基づき、計数対象領域外へ移動する移動体を判別する手段と、
第2及び第3検出ポイント列の移動体を検出した検出ポイント同士を比較して、前記通過方向へ移動する移動体を判別する手段と、
該移動体を判別する各手段の判別結果を比較する手段と、を備え、
該比較結果に基づき、前記通過判定手段が、前記通過する移動体の有無を判定することを特徴とする移動体の計数装置。
The mobile counting device according to claim 5,
Means for discriminating a moving body that has entered the counting target region based on the detection result of the moving body for each detection point of the first detection point sequence;
Means for discriminating a moving body moving out of the counting target region based on the detection result of the moving body for each detection point of the third detection point row;
Means for comparing the detection points where the moving bodies of the second and third detection point rows are detected and determining the moving body moving in the passing direction;
Means for comparing the determination results of each means for determining the moving body,
The moving body counting apparatus, wherein the passage determining means determines the presence or absence of the moving body passing through based on the comparison result.
請求項1ないし6のいずれかに記載された移動体の計数装置において、
前記カウント手段が、計数対象領域を互いに逆方向に通過する移動体をそれぞれカウントすることを特徴とする移動体の計数装置。
The mobile counting device according to any one of claims 1 to 6,
The counting device of the moving body, wherein the counting means counts each moving body that passes through the counting target region in opposite directions.
請求項1ないし7のいずれかに記載された移動体の計数装置において、
予め設定された数の撮影画像で連続して全ての検出ポイントで移動体が検出されないことを条件に、前記通過判定手段を判定処理開始時の初期状態に戻して判定を再開させる手段を備えたことを特徴とする移動体の計数装置。
The mobile counting device according to any one of claims 1 to 7,
Provided with means for returning the passage determination means to the initial state at the start of the determination process and restarting the determination on the condition that a moving body is not detected continuously at all detection points in a preset number of captured images. A moving body counting apparatus.
コンピュータを請求項1ないし8のいずれかに記載された移動体の計数装置の各手段として機能させるためのプログラム。   The program for functioning a computer as each means of the counting device of the moving body described in any one of Claim 1 thru | or 8.
JP2008091163A 2008-03-31 2008-03-31 Counting device for moving object, and program Pending JP2009245172A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008091163A JP2009245172A (en) 2008-03-31 2008-03-31 Counting device for moving object, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008091163A JP2009245172A (en) 2008-03-31 2008-03-31 Counting device for moving object, and program

Publications (1)

Publication Number Publication Date
JP2009245172A true JP2009245172A (en) 2009-10-22

Family

ID=41306977

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008091163A Pending JP2009245172A (en) 2008-03-31 2008-03-31 Counting device for moving object, and program

Country Status (1)

Country Link
JP (1) JP2009245172A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011219235A (en) * 2010-04-12 2011-11-04 Takeda Kankyo:Kk Waste recovery system and waste recovery vehicle
WO2023276477A1 (en) * 2021-06-29 2023-01-05 パナソニックIpマネジメント株式会社 Information processing device, information processing method, and program

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08123935A (en) * 1994-08-31 1996-05-17 Nippon Telegr & Teleph Corp <Ntt> Method and device for counting moving object by direction
JP2004199623A (en) * 2002-12-20 2004-07-15 Minolta Co Ltd Movable body counting method
JP2006302167A (en) * 2005-04-25 2006-11-02 Nabtesco Corp Passerby counting device and automatic door with counting function

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08123935A (en) * 1994-08-31 1996-05-17 Nippon Telegr & Teleph Corp <Ntt> Method and device for counting moving object by direction
JP2004199623A (en) * 2002-12-20 2004-07-15 Minolta Co Ltd Movable body counting method
JP2006302167A (en) * 2005-04-25 2006-11-02 Nabtesco Corp Passerby counting device and automatic door with counting function

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011219235A (en) * 2010-04-12 2011-11-04 Takeda Kankyo:Kk Waste recovery system and waste recovery vehicle
WO2023276477A1 (en) * 2021-06-29 2023-01-05 パナソニックIpマネジメント株式会社 Information processing device, information processing method, and program

Similar Documents

Publication Publication Date Title
US9390332B2 (en) Information processing system, information processing method and program
JP4992618B2 (en) Gesture recognition device and gesture recognition method
TWI363285B (en) Method and apparatus for detecting motion of image in optical navigator
US8437504B2 (en) Imaging system and imaging method
US10147287B2 (en) Image processing apparatus to set a detection line used to count the passing number of moving objects
US9934576B2 (en) Image processing system, image processing method, and recording medium
CN109508576B (en) Abnormal driving behavior detection method and device and electronic equipment
JP5278576B2 (en) Gesture recognition device, gesture recognition method and program thereof
JP4696991B2 (en) Motion detection method and motion detection apparatus
JP2008250746A (en) Mobile object tracking device
JP4801934B2 (en) Moving object detection device
JP4963297B2 (en) Person counting device and person counting method
JP6758834B2 (en) Display device, display method and program
KR20160037480A (en) Method for establishing region of interest in intelligent video analytics and video analysis apparatus using the same
JP4717445B2 (en) Image processing system, image processing device, game device, program, information storage medium, and image processing method
JP2009245172A (en) Counting device for moving object, and program
JP2007219603A (en) Person tracking device, person tracking method and person tracking program
JP6591349B2 (en) Motion detection system and motion detection method
KR101015646B1 (en) Face detecting apparatus and face detection using the same
JP5587068B2 (en) Driving support apparatus and method
JP4842301B2 (en) Pedestrian detection device and program
JPH04345396A (en) Traveling object tracing method
JP6304473B2 (en) Image processing system, image processing method, and program
JP2007004726A (en) Moving object detecting device using image
US10593045B2 (en) Information processing apparatus and method of controlling the same

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20101227

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120312

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120418

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120608

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120625

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20130207