JP4697923B2 - Counting system and counting method for moving object in water or water surface - Google Patents

Counting system and counting method for moving object in water or water surface Download PDF

Info

Publication number
JP4697923B2
JP4697923B2 JP2004121530A JP2004121530A JP4697923B2 JP 4697923 B2 JP4697923 B2 JP 4697923B2 JP 2004121530 A JP2004121530 A JP 2004121530A JP 2004121530 A JP2004121530 A JP 2004121530A JP 4697923 B2 JP4697923 B2 JP 4697923B2
Authority
JP
Japan
Prior art keywords
image
counting
moving object
pixels
base 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.)
Expired - Fee Related
Application number
JP2004121530A
Other languages
Japanese (ja)
Other versions
JP2005309485A (en
Inventor
富士雄 堤
憲彦 伊藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Central Research Institute of Electric Power Industry
Original Assignee
Central Research Institute of Electric Power Industry
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 Central Research Institute of Electric Power Industry filed Critical Central Research Institute of Electric Power Industry
Priority to JP2004121530A priority Critical patent/JP4697923B2/en
Publication of JP2005309485A publication Critical patent/JP2005309485A/en
Application granted granted Critical
Publication of JP4697923B2 publication Critical patent/JP4697923B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Description

本発明は、水中または水面における移動体の計数システムおよび計数方法に関する。さらに詳述すると、本発明は水中を泳いで移動する魚類あるいは水流に乗って移動する川面の落ち葉といった移動体の数量を画像処理することにより自動的に計数するためのシステムと方法の改良に関する。   The present invention relates to a counting system and a counting method for moving objects in water or on the surface of water. More specifically, the present invention relates to an improved system and method for automatically counting quantities of moving objects such as fish swimming underwater or moving leaves on a river, by image processing.

ダム建設に伴う電力会社によるダムの立地対策として、河川に魚道を設け、この魚道を遡上するアユ(鮎)などの魚類を計数して漁協等に報告するという業務が行われている。ところが、現在のアユ遡上数の計測は、撮影した魚道の映像を目で見て魚数をカウントするというように目視によって行われており、労力を要する割には精度に劣ることから計測精度および計測効率の点で改善が望まれている。   As a dam location measure by the electric power company accompanying the construction of the dam, there is a work to set up a fishway in the river, count fish such as ayu (fish) going up the fishway, and report it to the fishery cooperative. However, the current measurement of the number of sweetfish is carried out by visual observation, such as counting the number of fish by visually observing the captured fishway images. Improvements are also desired in terms of measurement efficiency.

そこで、このような問題点を改善すべく、魚道を遡上するアユ等の魚の数を計測する手法として例えば超音波を利用するなどの複数の手法が提案されている。魚数を計測するための従来技術、さらには魚以外を対象としているが本願に関係があると考えられる従来技術は以下のとおりである。   Therefore, in order to improve such a problem, a plurality of methods such as using ultrasonic waves have been proposed as a method for measuring the number of fish such as sweetfish going up the fishway. The conventional techniques for measuring the number of fish and the conventional techniques that are intended for other than fish but are considered to be related to the present application are as follows.

(1) 背景差分を使って魚の有無を判定する手法、さらには記録した映像、決定木やニューロ、人の目などで魚種を判定する手法が提案されている(例えば、特許文献1参照)。   (1) A method for determining the presence / absence of fish using background differences, and a method for determining fish species using recorded images, decision trees, neuros, human eyes, and the like have been proposed (for example, see Patent Document 1). .

(2) ブロック毎に平滑化した画像と平滑化前の画像の差分で局所的な明るい領域を取り出し、魚の腹や着水時の水しぶきを検出し、魚の数を数える手法が提案されている(例えば、特許文献2参照)。   (2) A method has been proposed in which a local bright area is extracted based on the difference between the image smoothed for each block and the image before smoothing, and the number of fish is counted by detecting the belly of the fish and the splashing at the time of landing ( For example, see Patent Document 2).

(3) 移動物体と直行する幅dの領域を通過する対象を背景差分で取り出し、時間方向に積算して通過する物体の数を計数する手法が提案されている(例えば、特許文献3参照)。   (3) A method has been proposed in which a target passing through a region having a width d perpendicular to a moving object is extracted by background difference, and the number of passing objects is counted in the time direction (see, for example, Patent Document 3). .

(4) 背景差分もしくはフレーム間差分によって変化領域を取り出し、背景と変化領域の相関を計算し、相関が低い場合に移動対象物体であると判定し、領域統合、追跡を行って人物など移動物体を監視する手法が提案されている(例えば、特許文献4参照)。背景データの更新方法として、部分的な更新と全体の更新という二種類の方法が提案されている。   (4) Extract the change area by background difference or inter-frame difference, calculate the correlation between the background and the change area, determine that it is a moving target object when the correlation is low, perform area integration and tracking, and move objects such as people Has been proposed (see, for example, Patent Document 4). As a method for updating the background data, two types of methods, partial update and total update, have been proposed.

(5) 画面を升目状のブロックに分け、それぞれのブロックのフレーム間移動方向を推定し、その移動方向と量を統計処理することで、人物など移動物を検出する手法も提案されている(例えば、特許文献5参照)。   (5) A method to detect moving objects such as people by dividing the screen into square blocks, estimating the inter-frame movement direction of each block, and statistically processing the movement direction and amount has been proposed ( For example, see Patent Document 5).

特公平8−7069号公報Japanese Patent Publication No. 8-7069 特開2001−323445号公報JP 2001-323445 A 特開平8−123935号公報JP-A-8-123935 特開2001−8189号公報JP 2001-8189 A 特開平9−252467号公報JP-A-9-252467

しかしながら、アユなどの遡上数を計測する従来手法の場合、特殊な装置を必要とするため設置費用や手間が多くかかるという問題があり、低コスト化が一つの課題となっている。さらに、従来手法によると計測精度が70%程度の低さでしかないというように実用上の課題もある。また、これらの問題の加え、上述した(1)〜(5)の従来技術にはそれぞれ以下のような問題がある。   However, in the case of the conventional method for measuring the number of run-ups such as sweetfish, a special device is required, so there is a problem that it takes a lot of installation cost and labor, and cost reduction is an issue. Furthermore, there is a practical problem that the measurement accuracy is as low as about 70% according to the conventional method. In addition to these problems, the conventional techniques (1) to (5) described above have the following problems.

まず、(1) として示した従来手法は、そもそも自然計数というよりは人間が目視して計数する際の補助をすることを主目的とした手法であり、計測対象物の移動方向や速度に関する特徴を活用していないこともあり、自動的に計数を行うことは困難である。また、ノイズ対策がほとんどなされていないためその点で自動処理に適さない。さらに、背景データの作成が積算型になっていることから、多量の魚影が一斉に通過する場合などに誤差が大きくなってしまう。   First, the conventional method shown in (1) is primarily a method that is intended to assist humans in counting rather than using natural counting, and features related to the moving direction and speed of the measurement object. May not be used, and it is difficult to automatically count. In addition, since noise countermeasures are hardly taken, it is not suitable for automatic processing in that respect. Furthermore, since the background data creation is an integration type, an error becomes large when a large number of fish shadows pass all at once.

また(2) の場合には、多数のノイズを検出してしまい正確な計数が困難であるという問題がある。また、この差分手法は明るい部分を抽出する手法であるため、水面の反射等をノイズとしてひろってしまうことがある。さらに魚の追跡処理等が一切ないため、複数フレームにわたって魚が見えていると実際の数よりも過剰に計数してしまう場合があるという問題がある。加えて、水中を移動する魚数は推測で計算しており、実測ではないために計数精度が悪いという問題もある。   In the case of (2), there is a problem that many noises are detected and accurate counting is difficult. Moreover, since this difference method is a method of extracting a bright part, reflection of the water surface or the like may be spread as noise. Furthermore, since there is no fish tracking process, there is a problem that if the fish is seen over a plurality of frames, it may be counted more than the actual number. In addition, the number of fish moving in the water is calculated by estimation, and there is a problem that the counting accuracy is poor because it is not an actual measurement.

さらに(3) の場合には、例えば水中や水面で反射があった場合における対策が施されていないために計測誤差が生じることがあるという問題がある。また、速い移動対象に対しては幅dを大きくする必要があるのに対し、小さな対象に対しては幅dを小さくする必要があることから、例えばアユの稚魚のように小さく速い計数対象に関しては適度な大きさのdを見出すことが困難であり、このような移動体を正確に検出するのが困難である。さらに、背景データの作成方法および更新方法に関しての工夫がないため、背景に変化が生じたり影やゆらぎが生じたりした場合、このままでは正確な計数ができない。また細い領域だけで対象を検出して計測しているため、対象のサイズや速度が推測値となってしまい、移動体の速度や方向によっては誤差が大きくなるおそれがある。   Furthermore, in the case of (3), for example, there is a problem that a measurement error may occur because no countermeasure is taken when there is reflection in water or on the water surface. Moreover, since it is necessary to increase the width d for a fast moving object, while it is necessary to reduce the width d for a small object, for example, a small and fast counting object such as a fry of sweetfish. It is difficult to find d having an appropriate size, and it is difficult to accurately detect such a moving body. Furthermore, since there is no idea about the method for creating and updating the background data, if the background changes or shadows or fluctuations occur, accurate counting cannot be performed as it is. Further, since the object is detected and measured only in a thin area, the size and speed of the object become an estimated value, and there is a possibility that the error may increase depending on the speed and direction of the moving body.

また(4) の場合、上述したとおり部分的な更新と全体の更新という2種類の背景データ更新方法が提案されてはいるが、前者(背景データの部分的更新)は水面のゆらぎなどを吸収できないため誤計測に結びつきやすく、後者(背景データの全体更新)は変化領域が例えば7割以上など一定量となった時にはじめて更新を行うものであるため更新前に誤計数を起こしてしまうおそれがあるというようにそれぞれに固有の問題がある。つまり、前者(背景データの部分的更新)においては変化のほとんどない領域を背景に加える、という処理を行うが、水面のようにゆらいでいる領域内では背景的変化が生じているためにこの条件で背景に加えられることがなく、有効な背景データ更新がなされない。また、後者(背景データの全体更新)においては変化領域が例えば7割を越えるなど、変化が領域の一定量を超えたかどうかを背景データ更新のトリガとしているが、そうすると、領域としては小さいが変化が継続している領域があったとしてもトリガにはかからず更新がなされない。この場合には、古い背景データが用いられることになり、変化が継続している領域で過剰計測をすることになるという問題がある。加えて、この(4) のように背景との相関をとる手法は移動領域の正確な計測には向いているが、計測対象が増えると大きな計算量を必要とするので多量の移動物体を迅速に計測するのには向かない。さらに、魚を追跡処理する際には前フレームの候補領域と重ならない最も近い領域を選択しているが、このような手法の場合だと、高フレームレート時の低速移動物や低フレームレート時の高速移動物を追跡できないという問題がある。   In the case of (4), two types of background data update methods, partial update and overall update, have been proposed as described above, but the former (partial update of background data) absorbs fluctuations in the water surface. Since it is not possible, it is easy to lead to erroneous measurement, and the latter (overall update of background data) is updated only when the change area becomes a certain amount, for example, 70% or more. Each has its own problems. In other words, in the former (partial update of background data), a process is performed in which an area with little change is added to the background. However, this condition occurs because a background change occurs in an area that fluctuates like the water surface. Is not added to the background, and valid background data is not updated. In the latter (overall background data update), the background data update is triggered by whether the change area exceeds a certain amount, for example, more than 70% of the change area. Even if there is an area that continues, the trigger is not triggered and the update is not performed. In this case, old background data is used, and there is a problem that over-measurement is performed in an area where the change continues. In addition, the method of correlating with the background as in (4) is suitable for accurate measurement of the moving area, but as the number of measurement objects increases, a large amount of calculation is required. It is not suitable for measurement. Furthermore, when tracking fish, the closest area that does not overlap with the candidate area of the previous frame is selected, but with this method, low-speed moving objects at high frame rates and low frame rates There is a problem that the high-speed moving object cannot be tracked.

さらに(5) の場合には、既存の手法に依存しつつブロックの移動方向を推定していることから、この点に関する推定精度が必ずしも高くない。また、人物のような比較的大きな対象を計測するのには向いているが小さな対象物を計測するには向かず、魚道を移動する魚や水面を浮遊する物体などの計数に使用した場合には正確性に欠けるため精度に劣るという問題がある。つまり、この従来手法においては、画面をブロックに分け、複数のブロック同士を前後のフレームで比較し、同一の対象物であるか否かを判定するといういわゆるブロックマッチングを行って移動速度を計算しているため、小さな対象物の移動速度を計算するにはブロックを細かくする必要がある。しかし、そうするとブロックマッチングに膨大な計算量が必要になってしまうという問題が生じる。また、高速移動する小物体を計測するためには広い計測対象領域を扱う必要があるが、このように広い計測対象を扱うこともマッチングの計算量を大きくする一因となっている。さらには、このようにブロックマッチングを前提としている場合には計測対象物が一定の特徴的な色や模様である必要があり、したがって、例えば画面中ではうっすらとした影状の領域となるアユなどのように色や模様の同一性が保証できない小さな対象物を扱う場合に不利となる。   Furthermore, in the case of (5), since the movement direction of the block is estimated while relying on the existing method, the estimation accuracy regarding this point is not necessarily high. Also, it is suitable for measuring relatively large objects such as people, but not for measuring small objects, and when used for counting fish moving on the fishway or objects floating on the water surface. There is a problem that accuracy is inferior due to lack of accuracy. In other words, in this conventional method, the screen is divided into blocks, a plurality of blocks are compared with the previous and next frames, and the movement speed is calculated by so-called block matching in which it is determined whether or not they are the same object. Therefore, it is necessary to make the block fine to calculate the moving speed of the small object. However, this causes a problem that a huge amount of calculation is required for block matching. Further, in order to measure a small object that moves at high speed, it is necessary to handle a wide measurement target region, and handling such a wide measurement target also contributes to increase the amount of calculation for matching. Furthermore, when block matching is assumed as described above, the measurement object needs to have a certain characteristic color or pattern. Therefore, for example, ayu, which is a light shadow area on the screen. This is disadvantageous when dealing with small objects that cannot guarantee the same color and pattern.

そこで、本発明は、魚類などを高精度でより正確に自動計測でき、尚かつ設置費用や手間を抑えることもできる水中または水面における移動体の計数システムおよび計数方法を提供することを目的とする。   SUMMARY OF THE INVENTION Accordingly, an object of the present invention is to provide a counting system and a counting method for moving objects in water or on the water surface, which can automatically measure fish and the like with high accuracy and more accurately, and can also reduce installation costs and labor. .

かかる目的を達成するため、本発明者は種々の検討を行った。単純に計測精度を向上させるだけであれば例えば単に精度の高い計測機器や環境を準備するという方策もあるが、設置費用と手間を抑えることも加味すると既存の計測装置を流用して計測を行うことが望ましい。そこで本発明者は従来用いられているフレーム画像の画像データに対して特有の画像処理を施すことによりコストを抑えつつ高精度で計数するという技術に着目し、種々の検討の結果、特徴的な画像処理法を知見するに至った。   In order to achieve this object, the present inventor has conducted various studies. If the measurement accuracy is simply improved, for example, there is a measure of simply preparing a high-precision measurement device or environment, but taking into account the installation cost and labor, measurement is carried out using existing measurement devices. It is desirable. In view of this, the present inventor paid attention to a technique of performing counting with high accuracy while performing cost reduction by performing specific image processing on image data of a frame image that has been conventionally used. I came to know the image processing method.

本発明はかかる知見に基づくもので、請求項1に記載の発明は、計数対象である移動体が通過する一定の計測対象領域を一定時間連続して撮影して得られたカメラ映像を得、当該カメラ映像を画像処理し、当該画像処理して得られたフレーム画像から当該一定時間内に計測対象領域を通過した移動体を計数する水中または水面における移動体の計数システムにおいて、連続する複数枚のフレーム画像中における同一座標の各画素中から輝度が最明値であるものまたは最暗値であるものを抽出し、当該最明画素の集合からなる最明画像または最暗画素の集合からなる最暗画像を作成してこの最明画像または最暗画像を計数処理の基礎であるベースデータにするとともに、その後も画面全体の変化に対して輝度分布の変化を定期的に計測し一定の閾値を超える変化があった場合には当該ベースデータを作成し直すベースデータ作成部と、カメラ映像とベースデータの画像との背景差分である2値画像を順次作成する移動体候補画素抽出部と、該移動体候補画素抽出部により作成された2値画像中において互いの距離が一定距離内にある値が1の画素の集まりを選び出し、当該選び出された画素の集まりを連接領域として抽出するラベリング部と、該ラベリング部により抽出された最新のフレーム画像中の連接領域群とその一段階前の時点におけるフレーム画像中の連接領域群とを比較し、その比較結果から当該フレーム画像中で移動体を抽出し、実際に移動している移動体の影を検出して当該移動体を計数する追跡・計数部とを有することを特徴とするものである。   The present invention is based on such knowledge, and the invention according to claim 1 obtains a camera image obtained by continuously photographing a certain measurement target region through which a moving object that is a counting object passes, In the counting system for moving objects on the water or on the water surface, the camera images are processed and the moving objects that have passed through the measurement target area within the predetermined time are counted from the frame image obtained by the image processing. The pixel having the brightest value or the darkest value is extracted from each pixel having the same coordinate in the frame image of the frame image, and the brightest image or the darkest pixel set including the set of the brightest pixels is extracted. Create the darkest image and use this brightest image or darkest image as the base data that is the basis of the counting process. A base data creation unit that re-creates the base data when there is a change exceeding the value, and a moving object candidate pixel extraction unit that sequentially creates a binary image that is a background difference between the camera image and the base data image; In the binary image created by the moving object candidate pixel extraction unit, a set of pixels whose values are within a certain distance from each other is selected, and the selected set of pixels is extracted as a connected region. Compare the labeling unit, the group of connected regions in the latest frame image extracted by the labeling unit, and the group of connected regions in the frame image at the previous stage, and move from the comparison result in the frame image A tracking / counting unit that extracts a body, detects a shadow of a moving body that is actually moving, and counts the moving body is provided.

また、請求項2に記載の発明は、計数対象である移動体が通過する一定の計測対象領域を一定時間連続して撮影して得られたカメラ映像を得、当該カメラ映像を画像処理し、当該画像処理して得られたフレーム画像から当該一定時間内に計測対象領域を通過した移動体を計数する水中または水面における移動体の計数方法において、連続する複数枚のフレーム画像中における同一座標の各画素中から輝度が最明値であるものまたは最暗値であるものを抽出するステップと、当該最明画素の集合からなる最明画像または最暗画素の集合からなる最暗画像を作成してこの最明画像または最暗画像を計数処理の基礎であるベースデータにするステップと、画面全体の変化に対して輝度分布の変化を定期的に計測し一定の閾値を超える変化があった場合には当該ベースデータを作成し直すステップと、カメラ映像とベースデータの画像との背景差分である2値画像を順次作成するステップと、順次作成された該2値画像中において互いの距離が一定距離内にある値が1の画素の集まりを選び出すステップと、当該選び出された画素の集まりを連接領域として抽出するステップと、該抽出された最新のフレーム画像中の連接領域群とその一段階前の時点におけるフレーム画像中の連接領域群とを比較するステップと、その比較結果から当該フレーム画像中で移動体を抽出し、実際に移動している移動体の影を検出して当該移動体を計数するステップとからなることを特徴とするものである。   Further, the invention according to claim 2 is to obtain a camera image obtained by continuously capturing a certain measurement target region through which a moving object to be counted passes for a certain period of time, image-processing the camera image, In the method of counting moving objects in water or on the water surface that counts moving objects that have passed through the measurement target area within the predetermined time from the frame image obtained by the image processing, the same coordinates in a plurality of consecutive frame images A step of extracting a pixel having the brightest value or the darkest value from each pixel, and creating a darkest image including a set of the brightest pixels or a darkest image including a set of the darkest pixels. When the brightest image or darkest image is used as the base data that is the basis of the counting process, and changes in the luminance distribution are periodically measured with respect to changes in the entire screen, and there is a change that exceeds a certain threshold Includes a step of re-creating the base data, a step of sequentially creating a binary image that is a background difference between the camera video and the image of the base data, and a constant mutual distance in the sequentially created binary image. A step of selecting a group of pixels having a value of 1 within the distance, a step of extracting the selected group of pixels as a connected region, a group of connected regions in the extracted latest frame image, and one stage thereof The step of comparing the connected region group in the frame image at the previous time point, and the moving object is extracted from the frame image from the comparison result, and the shadow of the moving object actually moving is detected to detect the moving object And a step of counting.

上述の計数システムまたは計数方法においては、処理対象とするフレーム画像が従来と同様のものである場合にもこのフレーム画像に対して以下のように特有の処理が行われる(図1、図2参照)。すなわち、連続する複数枚のフレーム画像(一例を挙げれば15枚のフレーム画像だが、図1と図2においては連続する8枚のフレーム画像を示している)を取り出し、まず1枚目のフレーム画像I1中の座標(x,y)における画素の輝度i1(x,y)を抽出し、これをグラフ上にとる(図1中に示すi1)。続いて、フレーム画像I2中の同一座標(x,y)における画素の輝度i2(x,y)を抽出し、i2としてこれもグラフ上にとる。同様にして、連続する各フレーム(I1,I2,…,In)につき串刺し状に一列に位置する同一座標の輝度ik(x,y)を抽出してグラフ上にとる。また、画像に映し出される移動体(つまり計数対象)の色や濃さに基づき、フレーム画像中で移動体であると識別される輝度範囲を設定する。例えば移動体が背景画像よりも暗い魚類である場合にはそれに対応した低い輝度例えばiy〜ixの範囲に移動体検出範囲となる輝度帯Aを設定する(図1参照)。さらに、移動体を検出する基準となる輝度を設定するが、従来であれば図中に2点鎖線で示すようにi1〜i8の平均輝度iavを算出しこれを基準とすることが一般的であったのに対し、本発明においてはi1〜i8のうちの最暗画素imin(図1であればi4が相当)を抽出してこれを基準となる輝度としている(図1)。従来は基準となる輝度と輝度帯Aとの差が図1中に示すB幅であったのに対し、このような基準を設ける本発明では差がこれよりもきわめて狭いC幅となる。これらB幅やC幅は、検出対象である移動体の輝度の値などに応じ適宜調整することが可能な任意設定値であり、例えばB幅をより小さな値に設定した場合にはi4程度の輝度、つまり背景中の最暗画素程度の輝度であっても移動体であると誤認するおそれがある。しかし、本発明のように基準となる輝度を最暗のiminとしている場合には、これを基準としてC幅を設定している以上、i4程度の輝度、つまり背景中の最暗画素程度の輝度を移動体の輝度であると誤認するおそれがきわめて少ない。連続するフレーム画像中の全画素に関してこのように最暗画素を抽出して背景データを作成するという合成演算により形成された最暗の背景画像は、本発明における計数処理の基礎であるベースデータとなる。なお、上述の場合とは逆に移動体が背景画像よりも明るい場合には、同一座標のうち最明である座標の輝度に基づき基準となる輝度を設定し、最明画像と対比することにより移動体を抽出することになる。 In the counting system or counting method described above, even when the frame image to be processed is the same as the conventional one, the following specific processing is performed on the frame image (see FIGS. 1 and 2). ). That is, a plurality of continuous frame images (for example, 15 frame images, but 8 continuous frame images are shown in FIGS. 1 and 2) are extracted, and the first frame image is first extracted. The luminance i 1 (x, y) of the pixel at the coordinates (x, y) in I 1 is extracted and taken on the graph (i 1 shown in FIG. 1 ). Subsequently, the luminance i 2 (x, y) of the pixel at the same coordinate (x, y) in the frame image I 2 is extracted, and this is also taken as i 2 on the graph. Similarly, the luminance i k (x, y) of the same coordinates located in a row in a skewered manner for each successive frame (I 1 , I 2 ,..., I n ) is extracted and taken on the graph. In addition, a luminance range that is identified as a moving object in the frame image is set based on the color and darkness of the moving object (that is, the counting target) displayed in the image. For example, when the moving object is a fish that is darker than the background image, a luminance band A that is a moving object detection range is set in a range corresponding to the lower luminance, for example, i y to i x (see FIG. 1). Furthermore, although setting the luminance to be a reference for detecting a moving object, it calculates the average brightness i av of i 1 through i 8 as indicated by the two-dot chain line in FIG. If the prior referenced to this In contrast to the general case, in the present invention, the darkest pixel i min (i 4 in FIG. 1 corresponds to i 4 ) is extracted from i 1 to i 8 and used as a reference luminance ( FIG. 1). Conventionally, the difference between the reference luminance and the luminance band A is the B width shown in FIG. 1, whereas in the present invention in which such a reference is provided, the difference is an extremely narrow C width. These B width and C width are arbitrarily set values that can be appropriately adjusted according to the brightness value of the moving body that is the detection target. For example, when the B width is set to a smaller value, about i 4 May be misidentified as a moving object, even if the luminance is about the darkest pixel in the background. However, when the reference luminance is the darkest i min as in the present invention, the luminance is about i 4 , that is, the darkest pixel in the background, as long as the C width is set based on this. There is very little risk of mistaking that the brightness is the brightness of a moving object. The darkest background image formed by the synthesis operation of extracting the darkest pixel and creating the background data in this way for all the pixels in the continuous frame image is the base data that is the basis of the counting process in the present invention. Become. Contrary to the above case, when the moving body is brighter than the background image, the reference brightness is set based on the brightness of the brightest coordinate among the same coordinates, and compared with the brightest image. A moving object will be extracted.

さらに本発明では、上記した手順により最暗画素に基づき好適なベースデータを作成することに加え、その後に天候の変化などで背景画像の輝度に変化が生じることも考慮し、画面全体の変化に対して輝度分布の変化を定期的に計測し一定の閾値を超える変化があった場合には当該ベースデータを作成し直すこととしている。また、最新フレーム画像とベースデータとの差分をとることによって順次作成される2値画像に関しては、その差分データの中で一定範囲内に密集する複数画素を選び出し、この集まりを一の連接領域として抽出する。さらに、属する画素数が一定数以下の小さな独立した領域については移動体ではないいわゆるノイズデータであるとして削除してノイズ除去する。以上のようにして作成された連接領域群は一段階前のフレーム画像中の連接領域群と対比され、両者の差異に基づき移動体が抽出された場合には計数対象であるとしてカウントされる。   Furthermore, in the present invention, in addition to creating suitable base data based on the darkest pixel by the above-described procedure, it is also considered that the brightness of the background image changes afterwards due to changes in the weather, etc. On the other hand, the change in luminance distribution is periodically measured, and when there is a change exceeding a certain threshold, the base data is recreated. Also, for binary images that are sequentially created by taking the difference between the latest frame image and the base data, a plurality of pixels that are densely packed within a certain range are selected from the difference data, and this collection is used as one connected region. Extract. Further, a small independent area having a certain number of pixels or less belongs to so-called noise data that is not a moving body and is deleted to remove noise. The connected region group created as described above is compared with the connected region group in the previous frame image, and when a moving object is extracted based on the difference between the two, it is counted as a counting target.

さらに、本発明者は検討を重ね、上述の技術に基づき、同一座標(x,y)における画素の輝度の平均値と標準偏差を求めてベースとなるデータを得るという技術を知見するに至った。請求項3および請求項4に記載の発明はかかる知見に基づくもので、請求項3に記載の発明は、計数対象である移動体が通過する一定の計測対象領域を一定時間連続して撮影して得られたカメラ映像を得、当該カメラ映像を画像処理し、当該画像処理して得られたフレーム画像から当該一定時間内に計測対象領域を通過した移動体を計数する水中または水面における移動体の計数システムにおいて、連続する複数枚のフレーム画像中における同一座標の各画素の輝度i1(x,y),i2(x,y),…,in(x,y)の平均v(x,y)と標準偏差をσ(x,y)を求め、数式
b(x,y)=v(x,y)+kσ(x,y) (ただしkは任意の数値)
のx,y座標値b(x,y)で表される画素の集合からなる画像を作成して計数処理の基礎であるベースデータにするとともに、その後も画面全体の変化に対して輝度分布の変化を定期的に計測し一定の閾値を超える変化があった場合には当該ベースデータを作成し直すベースデータ作成部と、カメラ映像とベースデータの画像との背景差分である2値画像を順次作成する移動体候補画素抽出部と、該移動体候補画素抽出部により作成された2値画像中において互いの距離が一定距離内にある値が1の画素の集まりを選び出し、当該選び出された画素の集まりを連接領域として抽出するラベリング部と、該ラベリング部により抽出された最新のフレーム画像中の連接領域群とその一段階前の時点におけるフレーム画像中の連接領域群とを比較し、その比較結果から当該フレーム画像中で移動体を抽出し、実際に移動している移動体の影を検出して当該移動体を計数する追跡・計数部とを有することを特徴とするものである。
Furthermore, the present inventor has repeatedly studied and, based on the above-described technique, has come to know the technique of obtaining the base data by obtaining the average value and standard deviation of the luminance of the pixels at the same coordinates (x, y). . The inventions according to claims 3 and 4 are based on such knowledge, and the invention according to claim 3 continuously photographs a certain measurement target region through which a moving object as a counting target passes for a certain period of time. A moving body in water or on the water surface that obtains a camera image obtained by performing image processing on the camera image and counts the moving body that has passed through the measurement target area within the predetermined time from the frame image obtained by the image processing. in the counting system, the luminance i 1 for each pixel in the same coordinates in the plurality of consecutive frame images (x, y), i 2 (x, y), ..., i n (x, y) of the average v ( x, y) and standard deviation σ (x, y)
b (x, y) = v (x, y) + kσ (x, y) (where k is any number)
An image consisting of a set of pixels represented by x, y coordinate values b (x, y) of the image is created and used as the base data that is the basis of the counting process. When the change is periodically measured and there is a change that exceeds a certain threshold, a base data creation unit that re-creates the base data and a binary image that is a background difference between the camera video and the base data image are sequentially In the binary image created by the moving object candidate pixel extraction unit and the moving object candidate pixel extraction unit to be created, a set of pixels whose values are within a certain distance from each other is selected and selected. Compare the labeling unit that extracts a collection of pixels as a connected region, the connected region group in the latest frame image extracted by the labeling unit, and the connected region group in the frame image at the previous stage. Comparison Extracting mobile from fruit in the frame image, and characterized by having an actually detects the shadow of the moving body is moving track-counting unit for counting the moving object.

また、請求項4に記載の発明は、計数対象である移動体が通過する一定の計測対象領域を一定時間連続して撮影して得られたカメラ映像を得、当該カメラ映像を画像処理し、当該画像処理して得られたフレーム画像から当該一定時間内に計測対象領域を通過した移動体を計数する水中または水面における移動体の計数方法において、連続する複数枚のフレーム画像中における同一座標の各画素の輝度i1(x,y),i2(x,y),…,in(x,y)の平均v(x,y)と標準偏差をσ(x,y)を求めるステップと、数式
b(x,y)=v(x,y)+kσ(x,y) (ただしkは任意の数値)
のx,y座標値b(x,y)で表される画素の集合からなる画像を作成して計数処理の基礎であるベースデータにするステップと、画面全体の変化に対して輝度分布の変化を定期的に計測し一定の閾値を超える変化があった場合には当該ベースデータを作成し直すステップと、カメラ映像とベースデータの画像との背景差分である2値画像を順次作成するステップと、順次作成された該2値画像中において互いの距離が一定距離内にある値が1の画素の集まりを選び出すステップと、当該選び出された画素の集まりを連接領域として抽出するステップと、該抽出された最新のフレーム画像中の連接領域群とその一段階前の時点におけるフレーム画像中の連接領域群とを比較するステップと、その比較結果から当該フレーム画像中で移動体を抽出し、実際に移動している移動体の影を検出して当該移動体を計数するステップとからなることを特徴とするものである。
Further, the invention according to claim 4 obtains a camera image obtained by continuously capturing a certain measurement target region through which a moving object to be counted passes for a certain period of time, performs image processing on the camera image, In the method of counting moving objects in water or on the water surface that counts moving objects that have passed through the measurement target area within the predetermined time from the frame image obtained by the image processing, the same coordinates in a plurality of consecutive frame images Step of obtaining σ (x, y) as an average v (x, y) and standard deviation of luminance i 1 (x, y), i 2 (x, y), ..., i n (x, y) of each pixel And the formula
b (x, y) = v (x, y) + kσ (x, y) (where k is any number)
A step of creating an image consisting of a set of pixels represented by x, y coordinate values b (x, y) and making it the base data that is the basis of the counting process, and changes in the luminance distribution with respect to changes in the entire screen The base data is periodically measured and when there is a change exceeding a certain threshold, the base data is recreated, and the binary image that is the background difference between the camera image and the base data image is sequentially created; Selecting a group of pixels having a value of 1 that are within a certain distance from each other in the sequentially created binary image, extracting the selected group of pixels as a connected region, The step of comparing the connected region group in the latest extracted frame image and the connected region group in the frame image at the previous stage is extracted, and the moving object is extracted in the frame image from the comparison result. In By detecting the shadow of the moving body is moving and is characterized in that comprising the step of counting the mobile.

請求項3の計数システムまたは請求項4の計数方法においては、連続する複数枚のフレーム画像(一例を挙げれば15枚のフレーム画像だが、図1と図2においては連続する8枚のフレーム画像を示している)を取り出し、まず1枚目のフレーム画像I1中の座標(x,y)における画素の輝度i1(x,y)を抽出し、これをグラフ上にとる(図1中に示すi1)。続いて、フレーム画像I2中の同一座標(x,y)における画素の輝度i2(x,y)を抽出し、i2としてこれもグラフ上にとる。同様にして、連続する各フレーム(I1,I2,…,In)につき串刺し状に一列に位置する同一座標の輝度ik(x,y)を抽出してグラフ上にとる。また、画像に映し出される移動体(つまり計数対象)の色や濃さに基づき、フレーム画像中で移動体であると識別される輝度範囲を設定する。例えば移動体が背景画像よりも暗い魚類である場合にはそれに対応した低い輝度例えばiy〜ixの範囲に移動体検出範囲となる輝度帯Aを設定する(図1参照)。ここまでは請求項1あるいは請求項2の場合と同様である。さらに、移動体を検出する基準となる輝度を設定するが、ここでは同一座標の各画素の輝度i1(x,y),i2(x,y),…,in(x,y)の平均v(x,y)を求める。また、標準偏差をσ(x,y)を求めてこれに任意の数値であるkをかけ算し、最後にこれらを加え合わせてb(x,y)を得る。請求項1や請求項2では抽出した最暗画素imin(または最明画素imax)をそのまま基準となる輝度としていたが、請求項3や請求項4では、検出対象である移動体の輝度の値などに応じて基準値を適宜調整することが可能であるため、請求項1や請求項2の場合と同様、背景中の最暗画素(あるいは最明画素)程度の輝度を移動体の輝度であると誤認するおそれがきわめて少ないものとなる。 In the counting system according to claim 3 or the counting method according to claim 4, a plurality of continuous frame images (for example, 15 frame images, but in FIG. 1 and FIG. First, the luminance i 1 (x, y) of the pixel at the coordinate (x, y) in the first frame image I 1 is extracted and taken on the graph (in FIG. 1). I 1 ). Subsequently, the luminance i 2 (x, y) of the pixel at the same coordinate (x, y) in the frame image I 2 is extracted, and this is also taken as i 2 on the graph. Similarly, the luminance i k (x, y) of the same coordinates located in a row in a skewered manner for each successive frame (I 1 , I 2 ,..., I n ) is extracted and taken on the graph. In addition, a luminance range that is identified as a moving object in the frame image is set based on the color and darkness of the moving object (that is, the counting target) displayed in the image. For example, when the moving object is a fish that is darker than the background image, a luminance band A that is a moving object detection range is set in a range corresponding to the lower luminance, for example, i y to i x (see FIG. 1). The process up to this point is the same as in the first or second aspect. Furthermore, the reference luminance for detecting the moving body is set. Here, the luminance i 1 (x, y), i 2 (x, y),..., I n (x, y) of each pixel having the same coordinates is set. The average v (x, y) of is obtained. Further, σ (x, y) is obtained as the standard deviation, and this is multiplied by an arbitrary numerical value k, and finally added to obtain b (x, y). In the first and second aspects, the darkest pixel i min (or the brightest pixel i max ) extracted is used as the reference luminance as it is, but in the third and fourth aspects, the luminance of the moving object to be detected is determined. Since the reference value can be appropriately adjusted according to the value of the image, the luminance of the darkest pixel (or the brightest pixel) in the background is set to be the same as in the case of the first or second aspect. There is very little risk of being mistaken for brightness.

上述の請求項1記載の計測システムによると、背景差分用の背景データを、複数枚のフレーム画像の合成演算による最暗画像または最明画像に基づき生成することで、撮影環境での影や水面のゆらぎなどの影響を押さえ、かつ計数対象である移動体の移動速度や方向の特徴的部分を最優先に活用して、高速な処理でありながら正確な自動計数を実現することができる。しかもこの計測システムは画像処理の手順に特徴を有し、既存の計測装置をそのまま流用して計測を行うことを可能とするものであるため設置費用と手間を抑えることができる。   According to the measurement system of claim 1 described above, the background data for background difference is generated based on the darkest image or the brightest image obtained by combining the plurality of frame images, so that shadows and water surfaces in the shooting environment are generated. It is possible to realize accurate automatic counting while performing high-speed processing by suppressing the influence of fluctuations and the like, and making the highest priority on the characteristic part of the moving speed and direction of the moving object to be counted. In addition, this measurement system has a feature in the procedure of image processing, and can perform measurement by diverting an existing measurement device as it is, so that installation cost and labor can be reduced.

同様に、請求項2記載の計測方法によっても、背景差分用の背景データを、複数枚のフレーム画像の合成演算による最暗画像または最明画像に基づき生成することで、撮影環境での影や水面のゆらぎなどの影響を押さえ、かつ計数対象である移動体の移動速度や方向の特徴的部分を最優先に活用して、高速な処理でありながら正確な自動計数を実現することができる。また、この計測方法は画像処理の手順に特徴を有し、既存の計測装置をそのまま流用して計測を行うことを可能とするものであるため設置費用と手間を抑えることができる。   Similarly, according to the measurement method of claim 2, the background data for background difference is generated based on the darkest image or the brightest image obtained by the composition calculation of a plurality of frame images. It is possible to realize accurate automatic counting while performing high-speed processing by suppressing the influence of fluctuation of the water surface and the like, and making the highest priority on the characteristic part of the moving speed and direction of the moving object to be counted. In addition, this measurement method has a feature in the procedure of image processing, and can make use of an existing measurement device as it is, thereby making it possible to reduce installation costs and labor.

さらに、請求項3記載の計測システムによると、背景差分用の背景データを、複数枚のフレーム画像の輝度の平均v(x,y)と標準偏差をσ(x,y)とを利用して生成することで、撮影環境での影や水面のゆらぎなどの影響を押さえ、かつ計数対象である移動体の移動速度や方向の特徴的部分を最優先に活用して、高速な処理でありながら正確な自動計数を実現することができる。しかもこの計測システムは画像処理の手順に特徴を有し、既存の計測装置をそのまま流用して計測を行うことを可能とするものであるため設置費用と手間を抑えることができる。   Furthermore, according to the measurement system of claim 3, the background data for background difference is obtained by using the average v (x, y) of the luminance of the frame images and the standard deviation σ (x, y). By generating, while suppressing the influence of shadows and water surface fluctuations in the shooting environment, and using the characteristic part of the moving speed and direction of the moving object to be counted as the highest priority, while being high-speed processing Accurate automatic counting can be realized. In addition, this measurement system has a feature in the procedure of image processing, and can perform measurement by diverting an existing measurement device as it is, so that installation cost and labor can be reduced.

同様に、請求項4記載の計測方法によっても、背景差分用の背景データを、複数枚のフレーム画像の輝度の平均v(x,y)と標準偏差をσ(x,y)とを利用して生成することで、撮影環境での影や水面のゆらぎなどの影響を押さえ、かつ計数対象である移動体の移動速度や方向の特徴的部分を最優先に活用して、高速な処理でありながら正確な自動計数を実現することができる。また、この計測方法は画像処理の手順に特徴を有し、既存の計測装置をそのまま流用して計測を行うことを可能とするものであるため設置費用と手間を抑えることができる。   Similarly, according to the measurement method of claim 4, the background data for background difference is obtained by using the average v (x, y) of the luminance of the frame images and the standard deviation σ (x, y). It is a high-speed process that suppresses the influence of shadows and water surface fluctuations in the shooting environment, and uses the characteristic part of the moving speed and direction of the moving object to be counted with the highest priority. However, accurate automatic counting can be realized. In addition, this measurement method has a feature in the procedure of image processing, and can make use of an existing measurement device as it is, thereby making it possible to reduce installation costs and labor.

また、以上の計測システムあるいは計測方法によれば、上記(1) の従来手法の課題に対しては、計数対象物の移動方向や速度に関する特徴点を活用することにより自動的な計測を可能とし、背景データの画像処理と生成の手順を工夫することによりノイズ対策を行い、さらに背景データの生成を積算型ではなく不連続に更新する方法をとることにより多量の計数対象にも対応できるようにしていることから、かかる課題を解決することができる。例えば、上記(1) の従来手法においてはそれまでの背景データを利用して新しい背景データを作っている(積算型)が、本願においてはそれまでの背景データを使わず毎回新しく作り直すこととしている(不連続更新型)。例えばアユが多量に遡上した場合を考えると、積算型の場合、アユは背景でないにもかかわらずこれらアユも含めた背景を作ってしまい、その影響がその後ずっと残るのに対し、不連続更新型の場合には、アユがいなくなれば新しい背景が作り直されるためにそのような問題が生じることがない。   In addition, according to the above measurement system or measurement method, automatic measurement is possible by utilizing the feature points related to the moving direction and speed of the counting target object to the problem of the conventional method (1). Measures against noise by devising the procedure of image processing and generation of background data, and moreover, it is possible to cope with a large number of counting objects by adopting a method of updating background data generation discontinuously rather than integrating type. Therefore, this problem can be solved. For example, in the conventional method of (1) above, new background data is created using the previous background data (accumulation type), but in this application, new background data is used each time without using the previous background data. (Discontinuous update type). For example, considering a large amount of sweetfish going up, in the accumulation type, sweetfish creates a background that includes these sweetfish even though it is not a background. In the case of molds, such problems do not occur because the new background is recreated when the sweetfish is gone.

また上記(2) の課題に対しては、水中の魚類等を直接に計測し、さらに追跡処理をも行うことにより不必要に過剰計数することを避けていることから、正確な計数が困難であったというかかる課題を解決することができる。   In addition, for the above problem (2), it is difficult to count accurately because it avoids unnecessary over-counting by directly measuring fish in the water and also performing tracking processing. It can solve such a problem.

上記(3) の課題に対しては、フレーム画像の全画素について合成演算を行い作成した背景データに基づき移動体を計測することにより、背景に変化が生じたり影やゆらぎが生じたりした場合にも正確な計数を行うことを可能としていることから、正確な計数が困難であったというかかる課題を解決することができる。   To solve the problem (3) above, when the moving object is measured based on the background data created by performing the synthesis operation for all the pixels in the frame image, the background changes or shadows or fluctuations occur. However, since it is possible to perform accurate counting, it is possible to solve such a problem that accurate counting is difficult.

上記(4) の課題に対しては、合成演算により生成した背景データに基づき移動体を計数することにより、移動体候補画素を抽出する前に反射やゆらぎなどの影響を除去し、また輝度分布変化を定期的に計測して背景データを作成し直すことにより更新前の誤計数を回避し、さらに、移動体の移動速度や移動方向といった動作の特徴的部分を重視することにより高フレームレート時の低速移動物や低フレームレート時の高速移動物をも計測可能としていることから、かかる課題を解決することができる。   To solve the problem (4) above, the moving object is counted based on the background data generated by the synthesis operation to eliminate the influence of reflection and fluctuation before extracting the moving object candidate pixel, and the luminance distribution. Periodic changes are measured and background data is recreated to avoid miscounting before updating, and at the high frame rate, emphasis is placed on characteristic features of movement such as the moving speed and direction of moving objects. Such a low-speed moving object and a high-speed moving object at a low frame rate can be measured, so that this problem can be solved.

さらに上記(5) の課題に対しては、正確な計算が困難なブロック移動速度やブロック移動方向には依存しない計数手法により正確な計数を可能としていることから、かかる課題を解決することができる。   Furthermore, the above problem (5) can be solved because accurate counting is possible by a counting method that does not depend on the block movement speed and the block movement direction, which are difficult to calculate accurately. .

以下、本発明の構成を図面に示す実施の形態に基づいて詳細に説明する。   Hereinafter, the configuration of the present invention will be described in detail based on embodiments shown in the drawings.

図3〜図11に本発明の一実施形態を示す。本発明にかかる水中または水面における移動体の計数システムは、計数対象である移動体が通過する一定の計測対象領域を一定時間連続して撮影して得られたカメラ映像を得、当該カメラ映像を画像処理し、当該画像処理して得られたフレーム画像から当該一定時間内に計測対象領域を通過した移動体を計数するというものである。本実施形態の計数システムは、フレーム画像の全画素について合成演算を行いベースとなる背景データを作成し尚かつ当該データを定期的に作成し直すベースデータ作成部と、カメラ映像とベースデータ画像との背景差分を用いて2値画像を作成する移動体候補画素抽出部と、2値画像中において値が1の画素の集まりを選び出して抽出するラベリング部と、該ラベリング部により抽出された最新のフレーム画像中の連接領域群とその一段階前の時点におけるフレーム画像中の連接領域群とを比較して移動体を抽出する追跡・計数部とを有するものである。本実施形態では、河川を遡るアユの稚魚を計数対象の移動体とし、河川に魚道6を設けて計測対象領域とした上で、かかる魚道6を通過するアユの数を計測する(図10参照)。以下では、かかる計測の際に上述のような構成の移動体計数システムを適用した実施形態について説明する。本実施形態の計数システムにおいては、少なくとも水中を泳ぐアユよりも明るい色彩のシート状のもの(以下単に「シート」という)7を水中に設置して魚道6を設け、このシート7上をアユが通過した時に当該アユを示す像が画像中において暗色となるようにしている。もちろん、この水中のシート7の形状や模様などはアユの遡上を妨げるものであってはならない。このように水中シート7が設けられた魚道6に対し、少なくとも魚道6中の計測対象範囲が含まれるように固定カメラ(図示省略)がこの魚道6の近辺に設置される。   3 to 11 show an embodiment of the present invention. The counting system for a moving object in water or on the surface of water according to the present invention obtains a camera image obtained by continuously capturing a certain measurement target region through which a moving object as a counting target passes for a certain period of time. Image processing is performed, and moving objects that have passed through the measurement target region within the predetermined time are counted from the frame image obtained by the image processing. The counting system according to the present embodiment includes a base data creation unit that performs synthesis calculation on all pixels of a frame image to create background data as a base and periodically creates the data, a camera video, a base data image, A moving object candidate pixel extraction unit that creates a binary image using the background difference of the image, a labeling unit that selects and extracts a set of pixels having a value of 1 in the binary image, and the latest extracted by the labeling unit A tracking / counting unit that extracts a moving body by comparing a group of connected regions in a frame image with a group of connected regions in a frame image at a point before that one stage. In this embodiment, fry of sweetfish going back to the river is used as a moving object to be counted, and the number of sweetfish passing through the fishway 6 is measured after a fishway 6 is provided in the river as a measurement target region (see FIG. 10). ). Hereinafter, an embodiment in which the moving body counting system having the above-described configuration is applied in the measurement will be described. In the counting system of the present embodiment, a sheet-like object 7 (hereinafter simply referred to as “seat”) having a color brighter than at least a sweetfish swimming in water is installed in the water to provide a fishway 6, and the sweetfish is placed on the sheet 7. When passing, the image showing the sweetfish is made dark in the image. Of course, the shape, pattern, etc. of the underwater sheet 7 must not prevent the sweetfish from going up. A fixed camera (not shown) is installed in the vicinity of the fishway 6 so that at least the measurement target range in the fishway 6 is included in the fishway 6 provided with the underwater sheet 7 in this way.

以下、本実施形態における画像処理によるアユ遡上数自動計数の手法について述べる。まず処理全体のフローを概説し、その後に各処理ブロックの内容を詳細に説明する。   Hereinafter, a method for automatically counting the number of sweetfish going up by image processing according to the present embodiment will be described. First, the overall flow of the processing is outlined, and then the contents of each processing block are described in detail.

まず、全体の処理フローについて以下に説明する(図3参照)。本実施形態ではビデオカメラと計算機を用いて計測を行うこととしている。実際に計測を行うにあたっては、映像を一旦テープ等に記録しておき再生を行いながら計算機で計測処理するオフライン処理を行ってもよいし、あるいは計測の現場でリアルタイムに実測するオンライン処理を行ってもよい。画像処理は、このビデオカメラで撮影された映像データに対して行うことになる。   First, the entire processing flow will be described below (see FIG. 3). In the present embodiment, measurement is performed using a video camera and a computer. In actual measurement, the video may be recorded on a tape or the like and played off-line with a computer while playing it, or on-line processing measured in real time at the measurement site. Also good. Image processing is performed on video data captured by the video camera.

本実施形態にて行う画像処理は、固定カメラに映った物体の画像(あるいは物体を表す画像データ)を取り出すという古典的な背景差分法を基礎としており、事前に背景となるデータを記憶しておき、現在のカメラ映像と背景データとの差を計算して背景に映っていない部分を取り出すという処理を行うが、このような古典的手法のみならず、以下の2点を加えているところが特徴的である。すなわち、一つは、水面の反射や屈折などノイズ要素への対処のために従来の背景差分法を改善している点であり、もう一つは、一定の速度で移動するアユという対象を検出するために移動速度など動作の特徴的な部分を活用して追跡および計数を行う点である。これら特徴的な処理を行うことにより、画面内を高速に移動するうっすらとした影のような遡上アユを、水面のゆらぎがある中で高精度かつリアルタイムに計数できる手法が構築されている。これら特徴点については、後に各処理ブロックの内容について詳細に説明する際に説明する。   The image processing performed in this embodiment is based on the classic background subtraction method of taking out an image of an object (or image data representing an object) reflected on a fixed camera, and storing background data in advance. In addition, the difference between the current camera image and the background data is calculated and the part that is not reflected in the background is extracted. Not only this classic method but also the following two points are added. Is. In other words, one is the improvement of the conventional background subtraction method to deal with noise elements such as reflection and refraction of the water surface, and the other is detection of the target of ayu moving at a constant speed. Therefore, tracking and counting are performed by utilizing characteristic parts of the operation such as the moving speed. By performing these characteristic processes, a technique has been constructed that can count up the ayu like a light shadow moving at high speed in the screen with high accuracy and in real time in the presence of fluctuations in the water surface. These feature points will be described later when the contents of each processing block are described in detail.

まず図3に示す処理フローにより処理の手順を説明する。最初の処理を行うベースデータ作成部1は、背景となるデータの作成および更新を行う(ステップ100)。次に、移動体候補画素抽出部(以下、本実施形態においては「魚影候補画素抽出部」という)2でアユの魚影の候補画素を取り出す。ここでは背景と異なる画像特徴を持つ画素を検出する。ただし単に背景と異なる画素を取り出すだけなのでかかる画像には様々なノイズが含まれている。続いて、ラベリング部3で数画素程度の明らかなノイズを除去し、背景差分処理でかすれてしまい複数に分かれてしまった領域を結合し、それぞれの領域に識別番号を付与する。本明細書ではラベリング部3によるこれらの処理を「ラベリング」と呼ぶ。そして最後の追跡・計数部4で、直前に撮影した画像のラベリング結果と比較し、移動速度や移動方向といったアユの特性を考慮しつつ魚影の移動を調べ、実際に移動している魚影を検出して魚数を数える。この追跡・計数部4での最後の処理(最初のベースデータ作成部1から数えて4番目の処理)を終えると、ループを辿って最初の処理を行うベースデータ作成部1に戻る(図3参照)。   First, the processing procedure will be described with reference to the processing flow shown in FIG. The base data creation unit 1 that performs the first process creates and updates the background data (step 100). Next, a moving fish candidate pixel extraction unit (hereinafter referred to as “fish shadow candidate pixel extraction unit” in this embodiment) 2 takes out ayu fish shadow candidate pixels. Here, pixels having image features different from the background are detected. However, since only a pixel different from the background is taken out, such an image contains various noises. Subsequently, apparent noise of about several pixels is removed by the labeling unit 3, the areas that have been blurred by the background difference processing and divided into a plurality of areas are combined, and an identification number is assigned to each area. In the present specification, these processes by the labeling unit 3 are referred to as “labeling”. Then, the last tracking / counting unit 4 compares the result of labeling of the image taken immediately before and examines the movement of the fish shadow while considering the sweetfish characteristics such as the moving speed and the moving direction. Detect and count the number of fish. When the last processing (fourth processing counted from the first base data creation unit 1) in the tracking / counting unit 4 is finished, the process returns to the base data creation unit 1 that performs the first processing by tracing the loop (FIG. 3). reference).

本実施形態では、ビデオカメラで撮影された映像データの毎フレームに上述した4つの処理を行い続け、計数結果を計測時刻とともにファイルに記録する。フレームレートは、NTSCの映像の場合であれば例えば29.97fps(枚/秒)である。   In the present embodiment, the above-described four processes are continuously performed on each frame of video data captured by the video camera, and the count result is recorded in a file together with the measurement time. For example, in the case of NTSC video, the frame rate is 29.97 fps (frames / second).

[ベースデータ作成部1について]
続いて、各処理ブロックの内容について詳細に説明する。まず、ベースデータ作成部1について説明する。このベースデータ作成部1は上述したように背景となるベースデータ(図5において符号Bで示す)の作成および更新を行うが、このような画像処理を行う場合における処理対象はビデオ映像の全体である必要はなく、計数対象であるアユが通過し尚かつ外乱の加わりにくい限定的な部分、例えば不要な部分にマスク処理して得られた当該部分で足りる。本明細書ではこの部分を計測対象領域と称し、図15等に符号Sで示している。このようなマスク処理を前提とすることで、計算量を減らしかつノイズの混入を制限できるため、高速かつ高精度な処理が可能となる。例えば、DV−NTSCの場合であれば映像の画素数は720×480ピクセルであるが、マスク処理をすることによって計測対象領域Sを限定している。
[Base data creation unit 1]
Next, the contents of each processing block will be described in detail. First, the base data creation unit 1 will be described. As described above, the base data creation unit 1 creates and updates the base data (indicated by reference symbol B in FIG. 5) as a background. The processing target when performing such image processing is the entire video image. There is no need, and a limited portion where the sweetfish to be counted passes and is not easily disturbed, for example, the portion obtained by masking an unnecessary portion is sufficient. In this specification, this portion is referred to as a measurement target region, and is indicated by a symbol S in FIG. By presuming such mask processing, the amount of calculation can be reduced and the mixing of noise can be restricted, so that high-speed and high-precision processing is possible. For example, in the case of DV-NTSC, the number of pixels of the video is 720 × 480 pixels, but the measurement target region S is limited by performing mask processing.

ここで、本実施形態のベースデータ作成部1における背景データ作成方法と従来型の背景データ作成方法とを比較してみる。ビデオカメラの映像から任意の1フレーム分の画像を抜き出しそれをベースデータBにするという単純な背景データ作成を行う従来型の場合には、ベースデータB作成後の背景に変化が生じると、計数時の背景とベースデータBが異なってしまい正確な計測が妨げられてしまうことがある。ちなみに、ここでいう背景の変化には2種類あり、一つは計測環境全体の照明変化、ビデオカメラのホワイトバランスや露出変化などによる画面全体の変化であり、もう一つは水面の揺らぎや木々の揺らぎなどによる部分的な変化である。   Here, the background data creation method in the base data creation unit 1 of this embodiment will be compared with the conventional background data creation method. In the case of the conventional type in which a simple background data is created by extracting an image of an arbitrary frame from the video of the video camera and using it as the base data B, if the background after the base data B is created changes The background of time and the base data B may be different, and accurate measurement may be hindered. By the way, there are two types of background changes here, one is the change in lighting of the entire measurement environment, the change in the entire screen due to the white balance and exposure change of the video camera, and the other is the fluctuation of the water surface and the trees. It is a partial change due to fluctuations in the image.

これに対し本実施形態では、画面全体の変化に関し、輝度や輝度分布を定期的にあるいは常時計測しておき、それらに一定の閾値を超えた変化があった場合にはベースデータBを作り直すという対策を施すこととしている(図4として示す処理フロー参照)。すなわち、ベースデータ作成部1の処理開始(ステップ101)の後で計測対象領域Sの平均輝度を計算し(ステップ102)、前回ベースデータBを記録した時の平均輝度との差を計算し(ステップ103)、この差が一定値を越えているかどうか判断した結果(ステップ104)、一定値を越えていればベースデータBを作成し直して更新し(ステップ105)、越えていなければベースデータBを更新せずにベースデータ作成部1の処理を終了することとしている(ステップ106)。   On the other hand, in this embodiment, regarding the change of the entire screen, the luminance and the luminance distribution are measured regularly or constantly, and the base data B is recreated when there is a change exceeding a certain threshold. Measures are taken (see the processing flow shown in FIG. 4). That is, after the base data creation unit 1 starts processing (step 101), the average brightness of the measurement target region S is calculated (step 102), and the difference from the average brightness when the previous base data B is recorded is calculated (step 102). Step 103) As a result of determining whether or not this difference exceeds a certain value (Step 104), if it exceeds the certain value, the base data B is re-created and updated (Step 105). The process of the base data creation unit 1 is terminated without updating B (step 106).

その一方で、水面の揺らぎや木々の揺らぎなどによる計測対象領域Sの部分的な変化に対しては、複数枚の画像を合成演算してベースデータBを作成するという方法で対処をしている。このように合成演算をすることで、単一の画像では扱えない時間方向の揺らぎ(経時に伴う変化)を考慮したベースデータBを作成することが可能となる。本実施形態では、装置起動時、ユーザにより指示された時、および上記の変化により再度ベースデータBを作り直す指示が下った時にベースデータBを作成することとしている。   On the other hand, partial changes in the measurement target region S due to fluctuations in the water surface, fluctuations in the trees, and the like are dealt with by creating a base data B by synthesizing a plurality of images. . By performing the synthesis operation in this way, it is possible to create the base data B in consideration of fluctuations in the time direction (changes with time) that cannot be handled by a single image. In the present embodiment, the base data B is created when the apparatus is activated, when instructed by the user, and when an instruction to regenerate the base data B is given due to the above change.

次に、ベースデータ作成方法の概念について説明する(図5参照)。連続するフレーム画像(I1,I2,…,In)からベースとなる画像を作成する。I1はベースデータ作成開始時のフレーム画像であり、I2はその次のフレーム画像、InはI1の(n−1)フレーム後の画像である。この場合、nを大きくすれば長時間の変化を吸収できるようになるが、低頻度に発生する極端な変化をも含んでしまい検出精度を低下させる可能性があるため、このnの値は計測環境でテストして決定されることが望ましい。本実施形態におけるプログラムではn=15として0.5秒の間に15のフレームを取り込むこととし、15枚のフレーム画像(I1,I2,…,I15)からベースデータBを作成している。 Next, the concept of the base data creation method will be described (see FIG. 5). A base image is created from successive frame images (I 1 , I 2 ,..., I n ). I 1 is a frame image at the start creation based data, I 2 is the next frame image, the I n an image after (n-1) frame of I 1. In this case, if n is increased, a long-term change can be absorbed. However, since the extreme change that occurs infrequently is included and the detection accuracy may be lowered, the value of n is measured. It should be determined by testing in the environment. In the program in this embodiment, n = 15 and 15 frames are taken in 0.5 seconds, and base data B is created from 15 frame images (I 1 , I 2 ,..., I 15 ).

ベースデータB作成の具体例は以下のとおりである(図5参照)。すなわち、まずフレーム画像Ikのx,y座標の輝度値をik(x,y)とする。アユを計数対象とする本実施形態のごとく、計数対象よりも背景の方が明るい場合は、数式1のように、各x,y座標に対して、i1(x,y),i2(x,y),…,ik(x,y)の中で最も暗い値をベースデータBのx,y座標値b(x,y)とする。
(数式1)
b(x,y)=min(i1(x,y),i2(x,y),…,in(x,y))
例えば本実施形態であれば、15枚の各フレーム画像中における同位置の15個の座標のうち最も低い輝度値であるものを最暗値とし、このような最暗値算出をフレーム画像中の全座標について同様に行う。なお、本実施形態の場合とは逆に背景が暗く、計数対象が明るい場合には
(数式2)
b(x,y)=max(i1(x,y),i2(x,y),…,in(x,y))
のようにし、最も暗い値をベースデータBのx,y座標値 b(x,y)とする。例えば後で説明する実験映像のように魚道6が明るく魚影がそれに対して暗い場合は、全座標がそれぞれの最暗値である最暗画像を数式1によって求める。一方、河川に設けた魚道6とその周辺の状況および計数対象とする魚の種類によっては逆に魚道6が暗くそこを通過する魚影の方が明るい色の場合があり、このような場合には全座標がそれぞれの最明値である最明画像を数式2によって求める必要がある(図5参照)。
A specific example of creating the base data B is as follows (see FIG. 5). That is, first, let the luminance value of the x, y coordinates of the frame image I k be i k (x, y). When the background is brighter than the counting target as in the present embodiment where the sweetfish is counted, i 1 (x, y), i 2 ( The darkest value among x, y),..., i k (x, y) is set as the x, y coordinate value b (x, y) of the base data B.
(Formula 1)
b (x, y) = min (i 1 (x, y), i 2 (x, y),…, i n (x, y))
For example, in the present embodiment, the lowest luminance value among the 15 coordinates at the same position in each of the 15 frame images is set as the darkest value, and such darkest value calculation is performed in the frame image. Repeat for all coordinates. In contrast to the case of the present embodiment, when the background is dark and the counting target is bright (Equation 2)
b (x, y) = max (i 1 (x, y), i 2 (x, y),…, i n (x, y))
As described above, the darkest value is the x, y coordinate value b (x, y) of the base data B. For example, when the fishway 6 is bright and the fish shadow is darker than that as in the experimental video described later, the darkest image in which all coordinates are the darkest values is obtained by Equation 1. On the other hand, depending on the situation of the fishway 6 provided in the river and its surroundings and the type of fish to be counted, the fishway 6 is dark and the fish shadow passing there may be brighter. It is necessary to obtain the brightest image in which all coordinates are the brightest values according to Equation 2 (see FIG. 5).

なお、ここまで説明したのは最大または最小の輝度値に基づき最明値または最暗値を算出するという手法であるが、このように単純に最大もしくは最小を算出するのではなく、平均と標準偏差を計算し、標準偏差のk倍などの値を設定することでベース画像作成時の瞬間的なノイズへの頑健さを保つこともできる。平均と標準偏差を使う手法の一例を示せば、例えば、i1(x,y),i2(x,y),…,in(x,y)の平均をv(x,y)、標準偏差をσ(x,y)とした場合に、ベースデータBのx,y座標値b(x,y)を以下の数式3を用いて計算するものを挙げることができる。
(数式3)
b(x,y)=v(x,y)+kσ(x,y)
例えばkを1とすると、1σの変動範囲での明るい画像を作成することになる。当然ながら、背景が明るく計数対象が暗い場合にはk<0とし、これとは逆に背景が暗く計数対象が明るい場合にはk>0とする。
The method described so far is the method of calculating the brightest value or the darkest value based on the maximum or minimum luminance value, but instead of simply calculating the maximum or minimum value in this way, the average and standard are calculated. By calculating the deviation and setting a value such as k times the standard deviation, it is possible to maintain robustness against instantaneous noise when creating the base image. An example of a method using the mean and standard deviation is, for example, the average of i 1 (x, y), i 2 (x, y), ..., i n (x, y) is v (x, y), When the standard deviation is σ (x, y), the x, y coordinate value b (x, y) of the base data B can be calculated using the following Equation 3.
(Formula 3)
b (x, y) = v (x, y) + kσ (x, y)
For example, if k is 1, a bright image in a fluctuation range of 1σ is created. Of course, if the background is bright and the counting target is dark, k <0. Conversely, if the background is dark and the counting target is bright, k> 0.

また、上述のようにしてベースデータBを作成する際には、例えば水面が変化した時のような揺らぎのある部分領域を誤って魚影と識別してしまわないようにこれらの変化をも考慮することが望ましい。「変化も考慮すること」には、例えば閾値となる差分量を変化させることなどが該当する。一例を示せば、ユーザインタフェース画面中において閾値に引っ掛かっている部分が赤く染まって表示されるようにし、これを見たユーザが、水面の揺らぎが赤くならないようにスライダで閾値を上下させて赤くならないように再設定できるようにソフトウェアを設計することなどが該当する。ただし、このように「変化」を考慮した場合、変化の大きな部分領域をアユが通過する場合に差分量が小さくなり、一つの魚影が複数に分割されてしまったり、小さな魚影が隠れてしまったりする場合があるので、本実施形態では、前者の魚影分割に対してはラベリング処理を施すことで魚影が複数になることを回避している。一方、後者の魚影が隠れることに対しては、アユの移動速度が比較的速いこと、また、揺らぎのある領域を狭い範囲に限定できることから、隠れが発生する頻度は低いといえるため本実施形態においては特段の対策を施さないこととしている。   In addition, when creating the base data B as described above, these changes are also taken into consideration so that a partial area with fluctuations such as when the water surface changes is not mistakenly identified as a fish shadow. It is desirable to do. “Considering change” corresponds to, for example, changing a difference amount serving as a threshold. For example, the part that is caught by the threshold value is displayed in red on the user interface screen, and the user who sees it does not turn red by moving the threshold value up and down with a slider so that the fluctuation of the water surface does not turn red. For example, designing software so that it can be reconfigured. However, when “change” is considered in this way, the difference amount decreases when ayu passes through a partial area with large changes, and one fish shadow is divided into multiple parts, or a small fish shadow is hidden. In this embodiment, the fish shadow division is prevented from having a plurality of fish shadows by performing a labeling process. On the other hand, since the fish shadow is hidden, the movement of sweetfish is relatively fast, and the region with fluctuations can be limited to a narrow range, so it can be said that the frequency of hiding is low. In the form, no special measures are taken.

[魚影候補画素抽出部2について]
続いて、魚影候補画素抽出部2における魚影候補画素抽出過程について詳細に説明する。
[About Fish Shadow Candidate Pixel Extraction Unit 2]
Next, the fish shadow candidate pixel extraction process in the fish shadow candidate pixel extraction unit 2 will be described in detail.

この魚影候補画素抽出部2では、ベースデータBの生成時以外は、常に現在のフレーム画像と生成したベースデータBとの比較をしてアユ検出のための材料となる画像を作成する(図6参照。なお図6中において、背景差分により抽出されたアユの魚影を符号5を付して示している)。具体的には、アユの候補画素を抽出するにあたり、現在のフレーム画像の輝度画像をIとおいたとして以下の条件式を満たす画素を抽出する。ただし、ここではベースデータBが上述した数式1に基づき最暗画像として生成されている場合について説明している。
(数式4)
b(x,y)−i(x,y) > tb
この数式4中のtbは検出対象の輝度とベースデータBの最暗画素の値との差を表す閾値であり、ユーザインタフェースを介して人間(オペレータ)により設定される。この場合において、サンプル映像が事前に得られている場合には当該サンプル映像中の検出対象の輝度を計測して閾値tbを設定してもよい。このようにして、条件を満たす画素を1、満たさない画素を0とした2値画像を計算し、この2値画像を候補画素抽出画像Sとする。この場合、候補画素抽出画像Sの画素を表記するとs(x,y)= 1 または 0 となる。なお、一般的には、ベース画像群B1u,B1l,B2u,B2l,…,Bmu,Bmlと、対象となる画像特徴の組(I1,I2,…,Im)を考えることができ、この場合は、すべての k=l,…,m に対して
(数式5)
bku(x,y)−ik(x,y)>tku ∧ ik(x,y)−bkl(x,y)>tkl
を満たす画素を抽出するという処理として一般化できる。なお、添字のuはupper(上限)を表し、lはlower(下限)を表している。具体的には、upper(上限)が示すのは数式2により得られるmax値であり、lower(下限)が示すのは数式1により得られるmin値である。
The fish shadow candidate pixel extraction unit 2 always compares the current frame image with the generated base data B except when the base data B is generated, and creates an image as a material for detecting sweetfish (see FIG. 6) In addition, in FIG. 6, the fish shadow of the sweetfish extracted by the background difference is shown with the code | symbol 5). Specifically, when extracting the sweetfish candidate pixels, assuming that the luminance image of the current frame image is I, pixels that satisfy the following conditional expression are extracted. However, the case where the base data B is generated as the darkest image based on the above-described Equation 1 is described here.
(Formula 4)
b (x, y) -i (x, y)> t b
T b in Equation 4 is a threshold value representing the difference between the brightness of the detection target and the darkest pixel value of the base data B, and is set by a human (operator) via the user interface. In this case, when the sample video is obtained in advance, the threshold t b may be set by measuring the luminance of the detection target in the sample video. In this way, a binary image is calculated with 1 as the pixel that satisfies the condition and 0 as the pixel that does not satisfy the condition. In this case, when a pixel of the candidate pixel extraction image S is expressed, s (x, y) = 1 or 0. In general, base image groups B 1u , B 1l , B 2u , B 2l ,..., B mu , B ml and a set of target image features (I 1 , I 2 ,..., Im ) In this case, for all k = l, ..., m (Equation 5)
b ku (x, y) −i k (x, y)> t ku ∧ i k (x, y) −b kl (x, y)> t kl
It can be generalized as a process of extracting pixels satisfying the above. Note that the subscript u represents upper (upper limit), and l represents lower (lower limit). Specifically, the upper (upper limit) indicates the max value obtained by Equation 2, and the lower (lower limit) indicates the min value obtained by Equation 1.

[ラベリング部3について]
続いて、ラベリング部3におけるラベリング処理について詳細に説明する。
[About labeling unit 3]
Next, the labeling process in the labeling unit 3 will be described in detail.

魚影候補画素抽出部2で作成した2値画像Sにおいてs(x,y)=1となっている画素の多くはアユの影だが(図6参照)、以下の二つの原因からアユを完全に反映していない可能性がある。一つの原因は、例えば増水時に生じた揺らぎのように、計数対象ではないが明るさが計数対象に類似した他のもの(計数対象類似物)が画面に現れた場合である。もう一つの原因は、計数対象が何らかの不鮮明要因により部分的にしか反映されない場合である。不鮮明要因の例としては、霧や雨、曇りなど照明環境に変化が生じること、計数対象に類似した画像特徴を持つ部分が背景に存在すること、さらに水中物を計数対象とする場合であれば水の透明度が低下する濁りや浮遊物が発生すること、等が挙げられる。   In the binary image S created by the fish shadow candidate pixel extraction unit 2, most of the pixels with s (x, y) = 1 are shadows of sweetfish (see Fig. 6). It may not be reflected in One cause is when, for example, a fluctuation that is not a target of counting but similar in brightness to the target of counting (similar to the target of counting) appears on the screen, such as a fluctuation that occurs when water increases. Another cause is when the counting object is only partially reflected by some blurring factor. Examples of blurring factors include changes in the lighting environment such as fog, rain, and cloudiness, the presence of a part with an image feature similar to the counting target, and the case of counting underwater objects For example, turbidity that lowers the transparency of water and generation of suspended matters are generated.

これに対し、ラベリング部3では、二つの画像処理を行ってこれら問題への対策を行う。すなわち、一つは小さな独立した連接領域の削除によるノイズ除去であり、もう一つは近接した領域の結合による計数対象の確実な抽出である。以下に具体的に説明する。   On the other hand, the labeling unit 3 performs two image processes to take measures against these problems. That is, one is noise removal by deleting small independent connected areas, and the other is reliable extraction of the counting object by combining adjacent areas. This will be specifically described below.

ここで、まず、連接領域Cを以下のように定義する。すなわち、連接領域Cとは、複数の半径dp (なお、ここでいう半径(距離)はユークリッド距離である)の円の重なり合いによって構成される領域である。この場合、一つの円は、少なくとも一つの他の円の中心をその領域内(円周内)に含んでいる必要がある。ある画素が連接領域Cに含まれるとは、その画素が連接領域Cを構成するいずれかの円の内部にあることをいう。例えば本実施形態において2値画像(候補画素抽出画像)Sから連接領域Cを作成する場合であれば、2値画像Sで画素の値が1のすべての点を中心に半径dp の円を描き、上述した連接領域Cの定義を満たすものを取り出すという処理が行われることになる。 Here, first, the connection region C is defined as follows. That is, the connected region C is a region formed by overlapping circles having a plurality of radii d p (here, the radius (distance) is the Euclidean distance). In this case, one circle needs to include the center of at least one other circle within the region (circumference). “A pixel is included in the connected region C” means that the pixel is inside any of the circles that form the connected region C. For example, in the present embodiment, when creating a concatenation region C from a binary image (candidate pixel extraction image) S, a circle with a radius d p is formed around all points having a pixel value of 1 in the binary image S. The process of drawing and taking out what satisfies the definition of the connected region C described above is performed.

なお、ここでユークリッド距離の定義について補足説明しておく。ある座標(a, b)と座標(c, d)の距離はこれら両画素の座標の距離であり、「ユークリッド距離」、つまり (a-c)2+(b-d)2 の平方根として表される。次に、ある画素(以下、便宜的にsを付して示す)と連接領域Cとの距離を、この画素sと、連接領域Cに含まれる他のすべての画素(構成するすべての円の中心)との距離のうちの最小の値とする。また、連接領域C同士の距離は、二つの連接領域C1,C2に対して、それぞれに含まれるすべての画素(構成するすべての円の中心)の組 (c1,c2)∀c1∈C1,∀c2∈C2 に対して距離を計算し、その最小値と定義する。 Here, a supplementary explanation will be given for the definition of the Euclidean distance. The distance between the coordinates (a, b) and the coordinates (c, d) is the distance between the coordinates of these two pixels and is expressed as the “Euclidean distance”, that is, the square root of (ac) 2 + (bd) 2 . Next, the distance between a certain pixel (hereinafter referred to as “s” for convenience) and the connected region C is set as the distance between the pixel s and all other pixels included in the connected region C (all the circles constituting the same). The minimum value of the distance to the center). Further, the distance between the connected regions C is a set (c 1 , c 2 ) ∀c of all pixels (centers of all the circles) included in each of the two connected regions C 1 and C 2 . The distance is calculated for 1 ∈ C 1 and ∀c 2 ∈ C 2 and defined as the minimum value.

ラベリング部3では、2値画像Sから、相互の距離が半径dp より大きな、複数の連接領域(C1,C2,…)を作成する。2値画像Sのすべての画素(値が1)は作成されたいずれかの連接領域に含まれるようにする。ここで、連接領域群を作成する際の最も単純な作成方法を示すと、ある画素一つのみを含む連接領域Cから始めて、その連接領域Cに対して距離がdp 以下となる画素を結合し続け、一つもdp 以下の画素がなくなったら結合を終了し、今度は残りの画素を種として同じ処理を続ける方法がある。例えば、2値画像S中で値が1の画素数が少ない場合や、計算機がきわめて高速である場合は、この方法で連接領域Cを作成することができる。この場合、計算量は多いが、重心距離や、画素群を包含する長方形領域同士の距離を使うことで、連接領域Cの作成精度は多少低下させながらも計算量を大幅に削減することができる。一例を挙げると、連接領域Cを、画素群を包含する長方形領域で単純化して表現し、画素sと連接領域Cの距離は画素sと四辺の距離の最小値、また連接領域C同士の距離は辺同士の距離の最小値を使うというものがある。 The labeling unit 3 creates a plurality of connected regions (C 1 , C 2 ,...) Having a mutual distance larger than the radius d p from the binary image S. All the pixels (value 1) of the binary image S are included in any of the created connected regions. Here, the simplest creation method for creating a connected region group is shown. Starting from a connected region C including only one pixel, pixels having a distance of d p or less are connected to the connected region C. There is a method in which the combination is terminated when there is no pixel less than d p , and the same processing is continued using the remaining pixels as seeds. For example, when the number of pixels having a value of 1 in the binary image S is small, or when the computer is extremely fast, the connected region C can be created by this method. In this case, although the calculation amount is large, the calculation amount can be greatly reduced by using the distance between the center of gravity and the distance between the rectangular regions including the pixel group while slightly reducing the accuracy of creating the connected region C. . For example, the connected region C is expressed by simplifying with a rectangular region including a pixel group, and the distance between the pixel s and the connected region C is the minimum value of the distance between the pixel s and the four sides, and the distance between the connected regions C. Uses the minimum distance between edges.

ここで、本実施形態におけるラベリング部3では、[画素登録ステップ]と[連接領域の統合ステップ]とからなる2段階の連接領域作成を行うこととしているのでこれについて示す(図7、図8参照)。なお、特に図示はしていないが、本実施形態の連接領域Cは画素群を包含する長方形領域として表現され、画素と連接領域Cとの距離は画素と四辺の距離の最小値で表され、連接領域C同士の距離は辺同士の距離の最小値で表される。   Here, in the labeling unit 3 in the present embodiment, a two-stage connected region creation including a [pixel registration step] and a [connected region integration step] is performed, which is shown (see FIGS. 7 and 8). ). Although not particularly illustrated, the connection region C of the present embodiment is expressed as a rectangular region including a pixel group, and the distance between the pixel and the connection region C is expressed by the minimum value of the distance between the pixel and the four sides, The distance between the connected regions C is represented by the minimum distance between the sides.

[画素登録ステップ]
画素登録処理を開始し(ステップ301)、連接領域Cのリストを初期化する(ステップ302)。ここで2値画像Sに属する値が1の画素を一つ選択し(ステップ303)、さらに登録済みの連接領域Cを一つ選択した上で(ステップ304)、画像S中における値が1の画素すべてに対して以下を実施する。すなわち、連接領域Cと対象の画素との距離を計算し(ステップ305)、当該距離がdp1以内かどうか判断する(ステップ306)。dp1以内であるならば、当該画素を連接領域Cに加える処理を行い、当該画素に対する処理を終了する(ステップ307、ステップ309)。一方、距離がdp1を超えている場合には、すべての連接領域Cとの比較を終えていない限り(ステップ308)、別の連接領域Cを選択した上で対象画素との距離を計算するステップを繰り返す(ステップ304、ステップ305)。当該画素がいずれの連接領域Cにも属さない場合は、新たな連接領域を作成し、この画素はそれに属するとする(ステップ308a)。すべての画素に対する処理を終えたら(ステップ309)、画素登録処理を終了する(ステップ310)。なお、この例からわかるように「dp1」は画素同士をくっつける時に使用する距離であり、計数対象の画面でのサイズよりも小さく、かつ、同じ対象を表す画素が画面上で分離してしまう距離よりも大きな値とする必要がある。
[Pixel registration step]
The pixel registration process is started (step 301), and the list of connected regions C is initialized (step 302). Here, one pixel having a value of 1 belonging to the binary image S is selected (step 303), one registered connection region C is further selected (step 304), and the value in the image S is 1. The following is performed for all pixels. That is, the distance between the connected region C and the target pixel is calculated (step 305), and it is determined whether the distance is within d p1 (step 306). If it is within d p1 , the process of adding the pixel to the connected region C is performed, and the process for the pixel is terminated (steps 307 and 309). On the other hand, if the distance exceeds d p1 , the distance to the target pixel is calculated after selecting another connected region C unless the comparison with all the connected regions C is completed (step 308). Steps are repeated (step 304, step 305). If the pixel does not belong to any connected region C, a new connected region is created, and this pixel belongs to it (step 308a). When the processing for all the pixels is finished (step 309), the pixel registration processing is finished (step 310). As can be seen from this example, “d p1 ” is the distance used when pixels are attached to each other, and is smaller than the size on the screen to be counted, and pixels representing the same target are separated on the screen. The value needs to be larger than the distance.

[連接領域の統合ステップ]
続いて連接領域Cの統合処理を開始する(ステップ311)。すべての連接領域Cに対して以下を実施する。すなわち、二つの連接領域(例えばC1,C2)を選択し(ステップ312)、当該連接領域C1,C2同士の距離を計算する(ステップ313、ステップ314)。この距離がdp2以内であるならば、これら二つの連接領域C1,C2を統合して新たな連接領域C3として登録する(ステップ315)。この際、もとの二つの連接領域C1,C2はリストから削除する。一方、距離がdp2を超えている場合にはこれら二つの連接領域Cの統合・削除は行わない。すべての連接領域Cの組の距離について計算をし終えたら(ステップ316)、連接領域Cの統合処理を終了する(ステップ318)。その一方で、すべての連接領域Cの組について距離計算し終えていなければ、別の連接領域Cの組を選択し(ステップ317)、当該二つの連接領域Cの距離の計算(ステップ313)をするステップを繰り返す。
[Integration step of connected area]
Subsequently, the integration process of the connected area C is started (step 311). The following is performed for all connected regions C. That is, two connected regions (for example, C 1 and C 2 ) are selected (step 312), and the distance between the connected regions C 1 and C 2 is calculated (steps 313 and 314). If this distance is within d p2 , these two connected regions C 1 and C 2 are integrated and registered as a new connected region C 3 (step 315). At this time, the original two connected regions C 1 and C 2 are deleted from the list. On the other hand, when the distance exceeds d p2 , the two connected regions C are not integrated / deleted. When the calculation is completed for the distances of all the connected regions C (step 316), the integrated processing of the connected regions C is ended (step 318). On the other hand, if the distance calculation has not been completed for all the connected regions C, another set of connected regions C is selected (step 317), and the distance between the two connected regions C is calculated (step 313). Repeat the steps.

最後に、ノイズ除去を目的として、すべての連接領域Cのうち、属する画素数が一定数以下の連接領域を削除する。この場合の一定値は画面内の計数対象のサイズに依存する閾値となる。以上でラベリング処理を終了する。   Finally, for the purpose of noise removal, a connected region having a certain number of pixels or less is deleted from all the connected regions C. The constant value in this case is a threshold value that depends on the size of the counting target in the screen. This completes the labeling process.

[追跡・計数部4について]
続いて、追跡・計数部4における追跡処理および計数処理について詳細に説明する。
[About the tracking / counting unit 4]
Next, the tracking process and the counting process in the tracking / counting unit 4 will be described in detail.

追跡・計数部4では、ラベリング部3により抽出された現在のフレームの連接領域群と一つ前のフレームの連接領域群との比較を行い、移動している対象を検出する。ここで、アユを計数対象とした場合の特徴について簡単に説明しておくと、アユの場合には、うっすらとした魚影の形を変えつつしかもフレーム間で画面にとびとびに撮影されるほど高速に移動するという特徴があるため、このようなアユの様子を、画像の特徴に多くの共通性があることが前提で尚かつゆっくり移動する対象(例えば建物への侵入者など)を検出するために用いられる従来の移動体検出手法で処理しようとすると多数の処理漏れや過剰検出が発生してしまうおそれがある。これに対し、本実施形態においては、高速だがほぼ同じ速度で移動するというアユの性質を生かし、画像特徴の比較などを行わずに移動体を検出することで、精度が高く尚かつ高速な検出を実現している。以下に、本実施形態における追跡および計数の内容について説明する。   The tracking / counting unit 4 compares the connected region group of the current frame extracted by the labeling unit 3 with the connected region group of the previous frame, and detects a moving object. Here is a brief description of the characteristics of Ayu being counted. In the case of Ayu, the speed of the fish is so fast that it can be shot on the screen while changing the shape of the slight fish shadow. In order to detect objects that move slowly (for example, intruders in a building) on the premise that there are many common features in the image characteristics. If the conventional moving body detection method used for the processing is attempted, many processing omissions and excessive detection may occur. On the other hand, in the present embodiment, the high-speed but high-speed detection is performed by detecting the moving object without performing comparison of image features by taking advantage of the nature of ayu that moves at almost the same speed. Is realized. Hereinafter, the contents of tracking and counting in the present embodiment will be described.

まず、現在の画像の連接領域をCc1,Cc2,…,Ccn、前フレームの連接領域をCp1,Cp2,…,Cpmとする。Cck(k=1,2,…,n)と、Cpj(j=1,2,…,m)の距離を、すべての組み合わせ(Cck,Cpj)に対して比較する。この距離がある下限値以上、ある上限値以下の場合に、二つの領域は移動した同じ領域であると判定する。つまり距離をdとし、上限をdmax、下限をdminとすると、 dmin≦d≦dmax となるCckとCpjの組があった場合に、CckはCpjが動くことによって生じた同じ対象についての連接領域であると判定する。ここで下限dminを設定するのは、移動量の少ないノイズ状の領域を削除するのが目的である。ノイズ状の領域としては、主に水面の反射や屈折、あるいは揺れ動く影などが該当する。一方、上限dmaxを設定するのは当該連接領域Cを別の対象と混同しないようにするためであり、この値をある程度大きくとった場合にはフレーム間で大きく移動する対象も漏れなく検出することが可能となるが、複数の対象が同時に画面に現れた場合にそれらを混同する場合があるので、上限dmaxをあまり大きくとることはせず、計数対象の移動速度に関する事前知識に基づき適切に設定することが望ましい。例えば、1/30秒間における画像中での平均移動距離が10画素で、標準偏差σが3画素であれば、1σとして7画素をdmin、13画素をdmaxとする。条件を満たす組が複数存在する場合は、より近い方を選択する。 First, the articulation region of the current image C c1, C c2, ..., C cn, the articulation region of the previous frame C p1, C p2, ..., and C pm. The distance between C ck (k = 1, 2,..., N) and C pj (j = 1, 2,..., M ) is compared for all combinations (C ck , C pj ). When this distance is not less than a certain lower limit value and not more than a certain upper limit value, the two areas are determined to be the same area that has moved. In other words, when the distance is d, the upper limit is d max , and the lower limit is d min , C ck is generated by the movement of C pj when there is a pair of C ck and C pj that satisfies d min ≦ d ≦ d max. It is determined that these are connected areas for the same object. The purpose of setting the lower limit d min here is to delete a noise-like region with a small amount of movement. The noise-like area mainly includes reflection and refraction of the water surface or a shaking shadow. On the other hand, the upper limit d max is set so as not to confuse the connected region C with another target. When this value is set to be large to some extent, a target that moves greatly between frames is detected without omission. However, when multiple objects appear on the screen at the same time, they may be confused. Therefore, the upper limit d max is not set too large, and it is appropriate based on prior knowledge about the moving speed of the counting object. It is desirable to set to. For example, if the average moving distance in the image in 1/30 seconds is 10 pixels and the standard deviation σ is 3 pixels, 7 pixels are set to d min and 13 pixels are set to d max as 1σ. If there are multiple pairs that satisfy the condition, select the closest one.

なお、魚道6を遡上する魚や、川面を流れる物体のように移動方向がほぼ一定の場合は、移動方向に関しての当該移動物の特徴点を加味することによって動作の制約事項と考えることができ、このような制約を設けることにより、迅速にかつ精度よく検出することが可能となる。例えば画面の上から下に川が流れていて、この川を遡上する魚を検出する場合においては、画面を縦長の領域に区切り、当該領域内においてCckとCpjの組について判定すれば足りる。この場合には、Cck(k=1,2,…,n)と、Cpj(j=1,2,…,m)の距離をすべての組み合わせ(Cck,Cpj)に対して比較する必要がないのでより迅速にかつ精度よく検出できる。 In addition, when the moving direction is almost constant, such as a fish going up the fishway 6 or an object flowing on the river surface, it can be considered as a restriction of operation by adding the feature points of the moving object with respect to the moving direction. By providing such a restriction, it becomes possible to detect quickly and accurately. For example it has river flows down from the top of the screen, in a case of detecting the fish swim upstream the river divides the screen vertically long area, if it is determined for the set of C ck and C pj in the region It ’s enough. In this case, the distance between C ck (k = 1, 2,..., N) and C pj (j = 1, 2,..., M ) is compared for all combinations (C ck , C pj ). Therefore, it is possible to detect more quickly and accurately.

さらには、色やテクスチャ(ここでいうテクスチャとは表面上の「きめ」や模様などのこと)など、画像の特徴にフレーム間で一貫性がある対象の場合には、ヒストグラムや相関などを利用した類似性判定を行って組み合わせの対象を限定することで精度を向上させるといった工夫も可能である。ただしこのような類似性判定を実施すると一般的に計算量が増えるため、計数・計測の目的に合わせて類似性判定を実施するかどうか適宜取捨選択することが好ましい。   Furthermore, if the features of the image are consistent between frames, such as colors and textures (the textures here are "textures" and patterns on the surface), use histograms and correlations. It is possible to improve the accuracy by performing the similarity determination and limiting the combination targets. However, since such a similarity determination generally increases the amount of calculation, it is preferable to appropriately select whether or not the similarity determination is performed in accordance with the purpose of counting / measurement.

上記手法により、現在の画像における連接領域Cと前フレームの連接領域Cとが同一のアユの影を表していると判定できた場合には、計数対象の計測数に1をカウントして増やす。このカウント済みの対象に関しては、カウント以降も計測対象領域Sから消えるまで追跡を継続するが再度のカウントは行わない。なお、本明細書でいう「追跡」とは、連続するフレーム(例えばIkとIk+1)間において上述した距離に関する条件 dmin≦d≦dmax を満たすdを有するものを同一の計数対象(この場合、アユ)であるとみなし、さらに、その次の連続するフレーム(Ik+1とIk+2)間において同一の計数対象(アユ)とみなす、というように2フレーム以上連続するフレームで計数対象を同定し続けることを意味する。また、本実施形態ではこのように判定時にカウントすることとしているが、この代わりに、画像中の計測可能限界まで追跡し、画像中から消滅した時にカウントする方法を採用することもできる。要は、計数対象となる連接領域一つに対し確実に1のカウントを実施できればよい。 When it is determined by the above method that the connected region C in the current image and the connected region C in the previous frame represent the same shadow of the sweetfish, 1 is added to the number of measurements to be counted. With respect to the counted object, the tracking is continued after the counting until it disappears from the measurement target area S, but the counting is not performed again. Note that “tracking” as used in this specification means that the same count is applied to those having d satisfying the above-mentioned distance condition d min ≦ d ≦ d max between consecutive frames (for example, I k and I k + 1 ). Consecutive two or more frames, such as the target (in this case, Ayu), and the next consecutive frame (I k + 1 and I k + 2 ) are considered to be the same counting target (Ayu) This means that the object to be counted is continuously identified in the frame to be performed. In this embodiment, counting is performed at the time of determination as described above, but instead, a method of tracking to the measurable limit in the image and counting when it disappears from the image can be employed. In short, it suffices if one count can be reliably performed for one connected region to be counted.

また、魚影が重なった場合あるいは重なっている場合にどのように処理するかについて図9〜図11を用いて説明する。魚影が途中で重なったり分離したりすると、魚影を表す連接領域(この説明を終えるまで以下単に「領域」という)は移動体として何であるかを確定することが困難であるが、本実施形態ではこのような場合に一定の処理を施すことによってより正確な計数ができるようにしている。図9〜図11においては、移動体として未確定の領域を白抜きの矩形枠、移動体として確定した領域を黒塗りの矩形枠でそれぞれ表している。   Further, how to process when fish shadows overlap or overlap will be described with reference to FIGS. If the fish shadow overlaps or separates in the middle, it is difficult to determine what the articulated area representing the fish shadow (hereinafter simply referred to as “area” until the end of this explanation) is a moving object. According to the embodiment, in such a case, more accurate counting can be performed by performing a certain process. In FIGS. 9 to 11, a region that has not been determined as a moving body is represented by a white rectangular frame, and a region that has been determined as a moving body is represented by a black rectangular frame.

まず、画像中に領域が出現してすぐに分離した場合には(図9参照)、分離後の領域のそれぞれを+1とし、計2匹としてカウントする。またこれとは逆に、画像中に出現してからすぐに重なりその後は分離しない場合には(図10参照)、1匹としてカウントする。さらに、画像中に出現してすぐ重なり、その後二つに分離した場合には(図11参照)、分離した方が未確定の領域となるが、その領域が動いたことが確認された時点でさらにカウントを増やす。これらの方法により、画面内に類似の対象が同時に複数撮影され、さらには対象数が増減した場合にも安定かつ迅速に計数することができる。なお、領域が分離した場合、いずれが分離した方なのかを判断する必要はなく、いずれか一方を分離した方とし、もう一方を元から泳いでいた方とするだけで足りる。この場合、いずれが分離した方になるかは処理の順番により決まり、尚かつ、いずれを先にしても計数結果に変わりはない。   First, when an area appears in an image and is separated immediately (see FIG. 9), each of the areas after separation is incremented by +1 and counted as a total of two animals. On the contrary, if they overlap immediately after appearing in the image and do not separate thereafter (see FIG. 10), they are counted as one animal. Furthermore, when the image overlaps immediately after appearing in the image and then is separated into two (see FIG. 11), the separated region becomes an undetermined region, but when it is confirmed that the region has moved. Further increase the count. By these methods, a plurality of similar objects can be simultaneously photographed on the screen, and even when the number of objects is increased or decreased, it is possible to count stably and quickly. When the areas are separated, it is not necessary to determine which one is separated. It is only necessary that one of them is separated and the other one is swimming from the beginning. In this case, which one is to be separated is determined by the order of processing, and whichever comes first, the counting result does not change.

ここまで説明したような処理を実施した後、追跡・計数部4は、計数結果および移動対象物の現時点での存在数等を出力装置の画面に表示する。また、移動物体の出現時刻、連接領域の画素数、移動速度、経路等を画面表示し、もしくはファイルに保存する。   After performing the processing described so far, the tracking / counting unit 4 displays the counting result and the current number of moving objects on the screen of the output device. Also, the appearance time of the moving object, the number of pixels in the connected area, the moving speed, the route, etc. are displayed on the screen or stored in a file.

以上のように、本実施形態の計数システムを用いた自動計数は、魚道6を固定したビデオカメラで撮影した映像のみから、画像処理技術によりアユ遡上数を高精度に自動計測することを可能とするものである。しかも、計測装置が市販ないし既存のビデオカメラとPC(パーソナルコンピュータ)のみで構成することも可能であるため導入が簡便であり、設置費用や設置の際の手間を抑えることが可能である。   As described above, the automatic counting using the counting system of the present embodiment can automatically measure the number of fly-ups with high accuracy by using image processing technology only from the video taken by the video camera with the fishway 6 fixed. It is what. In addition, since the measuring device can be configured only with a commercially available or existing video camera and a PC (personal computer), the introduction is simple, and the installation cost and the time and effort during installation can be reduced.

なお、上述の実施形態は本発明の好適な実施の一例ではあるがこれに限定されるものではなく本発明の要旨を逸脱しない範囲において種々変形実施可能である。例えば上述した実施形態においては遡上するアユの稚魚を計数対象とした場合について説明したが、アユ以外の魚類を対象とすることができることはもちろんのこと、魚類以外の生物、さらには例えば水面を流れる落ち葉など魚類等以外のものをも対象とし、上述した計測手順により一定時間内に計測対象領域S内を通過する数を自動計測することが可能である。   The above-described embodiment is an example of a preferred embodiment of the present invention, but is not limited thereto, and various modifications can be made without departing from the scope of the present invention. For example, in the above-described embodiment, the case where the fry of ayu that goes up is targeted for counting has been described, but it is possible to target fish other than ayu, as well as organisms other than fish, and for example, the surface of water. It is also possible to automatically measure the number of passing through the measurement target region S within a certain time by using the above-described measurement procedure for objects other than fish such as flowing fallen leaves.

また、ビデオカメラにより撮影されるのがカラー映像であり、計数対象に色の特徴があるような状況(例えば川面を流れる落ち葉を計測する場合において、川面が灰色なのに対し落ち葉が赤茶けているという状況)であれば、R,G,B色空間を考慮し、背景が暗く計数対象が明るい場合であればそれぞれの最大値、逆に背景が明るく計数対象が暗い場合であればそれぞれの最小値を計測し、ベースデータBをBr,Bg,Bbの3つとすることもできる。あるいは、HSV(hue, saturation, value)等の別の色空間を用いることもできる。 In addition, color video is captured by the video camera, and there is a color feature in the counting target (for example, when measuring the fallen leaves flowing on the river surface, the river surface is gray while the fallen leaves are reddish. If the background is dark and the object to be counted is bright, the respective maximum values are taken into consideration. Conversely, if the background is bright and the object to be counted is dark, the respective minimum values are taken into consideration. It is also possible to measure and to make the base data B three, B r , B g , B b . Alternatively, another color space such as HSV (hue, saturation, value) can be used.

なお、計測対象領域Sにおいて、計数対象が背景に対し中間的な輝度の場合(背景に明るい部分と暗い部分が混在しており、計数対象がその中間程度の輝度の場合。例えば川面の落ち葉を計測する場合に、川面が暗い色で、太陽光の水面での反射により明るい部分があり、計数対象の落ち葉がその二つの中間の明るさである場合など)は、上の閾値用および下の閾値用として二つのベースデータBを作成し、閾値を上下それぞれに設定してこれらに挟まれた一定の範囲を検出条件とすることもできる。この場合、閾値を変化させることにより異なる検出範囲を設定することができる。   In addition, in the measurement target region S, when the counting target has an intermediate brightness with respect to the background (when the background includes a bright portion and a dark portion, and the counting target has an intermediate brightness. When measuring, the river surface is a dark color, there is a bright part due to the reflection of sunlight on the water surface, and the fallen leaves to be counted are between the two) It is also possible to create two base data B for the threshold value, set the threshold values to the upper and lower sides, and set a certain range between them as the detection condition. In this case, different detection ranges can be set by changing the threshold value.

ここで、輝度に関する上下の閾値を使う場合の計測手法の一例を簡単に示しておく。まず、上下の閾値を表すベース画像をそれぞれBu,Blとする。現在のフレーム画像の輝度画像をIとした場合、上述した数式5に基づき
(数式6)
bu(x,y)−i(x,y)>tbu ∧ i(x,y)−bl(x,y)>tbl
を満たす画素を抽出する。ここで、tbu, tbl はそれぞれオペレータが任意に設定する閾値である。また、例えば映像がカラー映像である場合であれば、赤、緑、青それぞれの上下閾値を表すベース画像をそれぞれBru,Brl,Bgu,Bgl,Bbu,Bblとする。現在のフレーム画像のR,G,B分解画像をそれぞれIr,Ig,Ibとすると、以下の条件式を満たす画素を抽出して移動体を検出する。
(数式7)
bru(x,y)−ir(x,y)>tru ∧ ir(x,y)−brl(x,y)>trl
bgu(x,y)−ig(x,y)>tgu ∧ ig(x,y)−bgl(x,y)>tgl
bbu(x,y)−ib(x,y)>tbu ∧ ib(x,y)−bbl(x,y)>tbl
Here, an example of a measurement technique when using upper and lower threshold values relating to luminance will be briefly shown. First, base images representing upper and lower threshold values are denoted as B u and B l , respectively. When the luminance image of the current frame image is I, based on Equation 5 described above (Equation 6)
b u (x, y) −i (x, y)> t bu ∧ i (x, y) −b l (x, y)> t bl
Pixels that satisfy are extracted. Here, t bu and t bl are thresholds arbitrarily set by the operator. For example, if the video is a color video, base images representing the upper and lower threshold values of red, green, and blue are B ru , B rl , B gu , B gl , B bu , and B bl , respectively. Assuming that the R, G, and B decomposition images of the current frame image are I r , I g , and I b , pixels that satisfy the following conditional expression are extracted to detect the moving object.
(Formula 7)
b ru (x, y) −i r (x, y)> t ru ∧ i r (x, y) −b rl (x, y)> t rl
b gu (x, y) −i g (x, y)> t gu ∧ i g (x, y) −b gl (x, y)> t gl
b bu (x, y) −i b (x, y)> t bu ∧i b (x, y) −b bl (x, y)> t bl

本実施形態にて説明したアユの計数システムの効果を確認するための評価実験を行った。ここでは、実際の魚道6を撮影した映像を用い、本発明にかかる計数システムの計測(計数)精度の評価を行うこと、計測誤差が発生した場合の原因を探ることを目的として実験を行った。   An evaluation experiment for confirming the effect of the sweetfish counting system described in this embodiment was performed. Here, an experiment was conducted for the purpose of evaluating the measurement (counting) accuracy of the counting system according to the present invention and searching for the cause of the occurrence of a measurement error, using an image of the actual fishway 6 taken. .

実験の対象としたのは、2002年4月26日の午前8時15分から9時15分までの1時間の魚道6の映像である(図12参照)。この映像は、SONY(登録商標)製のビデオカメラDCR-PC3で撮影したものである。図12は、魚道6の中央上方から下流側に向かって左半分の部分を見下ろす形で撮影した映像を表したものである。川は画面手前から奥に向かって流れており、画面下半分に見える台状のシート7の上を下流から遡上するアユが画面下方つまり上流側に向かって遡上する。また、図13には遡上している4匹のアユがシート7上に位置している時の魚道6の映像を示す。魚道6の底面のシート7を明るい色としていたので判別することができたが、サイズが小さく、水中を通過するためおぼろげな魚影となったことから検出が難しいものとなった。   The subject of the experiment was an image of the fishway 6 for 1 hour from 8:15 am to 9:15 am on April 26, 2002 (see FIG. 12). This video was taken with a Sony (registered trademark) video camera DCR-PC3. FIG. 12 shows an image taken in a form of looking down at the left half portion from the upper center of the fishway 6 toward the downstream side. The river flows from the front of the screen to the back, and the sweetfish that goes up from the downstream on the plate-like sheet 7 visible in the lower half of the screen goes up to the lower side of the screen, that is, toward the upstream side. Further, FIG. 13 shows an image of the fishway 6 when four ayus that are going up are located on the seat 7. The sheet 7 on the bottom surface of the fishway 6 was brightly colored so that it could be distinguished. However, it was difficult to detect because it was small in size and became a shabby fish shadow because it passed underwater.

評価用の計算機には動作周波数2.4GHzのPentium(登録商標)4を搭載したWindows(登録商標)パソコンを用いた。また、この評価に用いたプログラム(以下「アユ遡上数画像計測ソフトウェア」と呼ぶ)は、Microsoft(登録商標)Visual(登録商標)C++(6.0および.Net)を開発環境とし、ビデオ映像のキャプチャにはDirect(登録商標)X のライブラリであるDirect Showを用いて開発した。ユーザインタフェース画面の例を図14に示す。また、計測対象領域Sは図15中に細長い枠で示すような台形領域とした。これは画面内にてアユの遡上が確認できる領域であり、かつ水面のゆらぎなどにより左端の黒い壁面が枠内に映り込まない領域として設定したものである。ただしこの計測対象領域Sは、アユが通過する領域をカバーするように設定されている必要がある。なお、ここで台形状としたのは一例に過ぎず、画面内の領域が指定されていれば多角形であろうと曲線領域であろうと、さらには複数の領域であろうと同じ手法で計数することができる。   As a computer for evaluation, a Windows (registered trademark) personal computer equipped with Pentium (registered trademark) 4 having an operating frequency of 2.4 GHz was used. In addition, the program used for this evaluation (hereinafter referred to as “Ayu run-up image measurement software”) captures video images using Microsoft (registered trademark) Visual (registered trademark) C ++ (6.0 and .Net) as the development environment. Developed using Direct Show, a Direct (registered trademark) X library. An example of the user interface screen is shown in FIG. Further, the measurement target region S is a trapezoidal region as indicated by a long and narrow frame in FIG. This is an area in which the sweetfish can be confirmed on the screen, and the black wall at the left end is not reflected in the frame due to fluctuations in the water surface. However, the measurement target region S needs to be set so as to cover the region through which the sweetfish passes. Note that the trapezoidal shape here is only an example, and if the area in the screen is specified, it is counted by the same method whether it is a polygonal area, a curved area, or even multiple areas. Can do.

また、準備作業として、ビデオ映像の撮影者より提供を受けたDVDに収録された映像ファイルをリッピング処理、つまりデジタル形式の音声データを抽出してパソコンで処理できるようなファイル形式に変換して保存するという作業を行い、DVテープに書き戻す処理を行った。これは開発した計測プログラムが、現場でアユの遡上を実測できるように、計算機にIEEE1394で直接接続したビデオの映像を処理するように作られているためである。   Also, as a preparatory work, the video file recorded on the DVD provided by the video image photographer is ripped, that is, the digital audio data is extracted and converted into a file format that can be processed by a personal computer and saved. Was performed, and the process of writing back to the DV tape was performed. This is because the developed measurement program is designed to process video images that are directly connected to a computer via IEEE 1394 so that it can actually measure the upstream of the sweetfish.

また、検出精度の評価基準には人間が目視により計測したデータを用いた。これは1分毎に通過したアユの数を集計したものであり、魚道6の監督者よりDVDと共に提供を受けた。目視による計測は、正確を期すためにスロー再生された映像を基にして複数の人間により行われており、計測の基準とするのに十分なものと考えられるものである。   In addition, data measured by human eyes was used as an evaluation standard for detection accuracy. This is the total number of sweetfish that passed every minute and was provided with the DVD by the director of Fishway 6. The visual measurement is performed by a plurality of people based on the slow-played video for the sake of accuracy, and is considered sufficient as a measurement standard.

実験で使用した各種設定を表1に示す。なお輝度関連の閾値(1-A,2-A)は0を最小値、65,535を最大とする範囲での値を意味する。また画素関連の閾値(3-A,3-B,3-C,4-A,4-B)およびフレーム数に関する設定値(1-B)は、NTSC−DV(720×480画素、29.97fps)での画素数およびフレーム数を意味する。   Various settings used in the experiment are shown in Table 1. The luminance-related threshold values (1-A, 2-A) mean values in a range where 0 is the minimum value and 65,535 is the maximum. The pixel-related threshold values (3-A, 3-B, 3-C, 4-A, 4-B) and the setting value (1-B) related to the number of frames are NTSC-DV (720 × 480 pixels, 29.97 fps). ) Means the number of pixels and the number of frames.

1時間の対象映像全体での人間の目視による計数結果は225匹であった。これに対し本発明にかかる計数システムは226匹と計数した。誤差は0.4%であった(=(226−225)/225)。しかし実際にはこの計数結果に計測漏れや過剰計測が含まれており、結果的に誤差が相殺されて総計として近い値になったということも考えられた。そこで、再現率と精度を計算するために5分毎と1分毎に集計し、その計数値を比較することとした。結果をそれぞれ図16、図17に示す。   The number of human visual counts over the entire target video for 1 hour was 225. In contrast, the counting system according to the present invention counted 226 animals. The error was 0.4% (= (226-225) / 225). However, in actuality, this counting result includes measurement omissions and over-measurements, and as a result, it was considered that the error was offset and the total value was close. Therefore, in order to calculate the recall and accuracy, the data is counted every 5 minutes and every minute, and the count values are compared. The results are shown in FIGS. 16 and 17, respectively.

横軸はサンプル映像の開始時点からの時区間である。図16に示す5分毎に集計したグラフでの「0〜5」はビデオ撮影開始から5分後までの5分間の時間を意味する。縦軸はその時区間の間に通過したアユの数である。図から、20〜35分の時区間にプログラムが比較的多く過剰計数していること、45〜50分の時区間にプログラムが計測漏れを起こしていることがわかる。この5分毎の集計でのプログラムによる過剰計数は24匹、不足計数は23匹であり、再現率は90%(=(226−24)/225)、精度は89%(=(226−24)/226)となった。   The horizontal axis is the time interval from the start time of the sample video. “0 to 5” in the graph totaled every 5 minutes shown in FIG. 16 means a time of 5 minutes from the start of video shooting to 5 minutes later. The vertical axis is the number of sweetfish that passed during that time interval. From the figure, it can be seen that the program overcounts a relatively large amount in the time interval of 20 to 35 minutes, and that the program causes measurement omission in the time interval of 45 to 50 minutes. The number of excess counts by the program in this 5 minute count is 24, the shortage is 23, the recall is 90% (= (226-24) / 225), and the accuracy is 89% (= (226-24) ) / 226).

図17に示す1分毎に集計したグラフでは、より細かく自動計測の測定特性を見ることができる。横軸はサンプル映像の開始時点から1分毎に区切った時区間を意味する。例えば横軸の「10」は映像の開始時点の10分後から11分後までの間を意味する。31分と33分の時区間においては自動計測で比較的多く過剰計数していること、47分の時区間において大量の遡上に対する計測漏れがあることがわかる。この1分毎の集計でのプログラムによる過剰計数は37匹、不足計数は36匹であり、再現率は84%(=(226−37)/225)、精度は84%(=(226−37)/226)となった。   In the graph totaled every minute shown in FIG. 17, the measurement characteristics of automatic measurement can be seen more finely. The horizontal axis means a time interval divided every minute from the start time of the sample video. For example, “10” on the horizontal axis means a period from 10 minutes to 11 minutes after the start of the video. It can be seen that a relatively large number of overcounting is performed in the 31 minute and 33 minute time intervals, and that there is a measurement omission for a large amount of run-up in the 47 minute time interval. The number of excess counts by the program in this one minute count is 37, the shortage count is 36, the recall is 84% (= (226-37) / 225), and the accuracy is 84% (= (226-37). ) / 226).

実験結果が示すように、本実施例にて用いた計測プログラムは、実際のアユ遡上映像に対しリアルタイムで高精度な計数が行えることがわかった。ただし上述したように、計測基準となる数に対して1割ほどの過剰計数および不足計数があったことに関しては、これまでの調査から誤計測の要因のいくつかが明らかになっている。すなわち、過剰計数の原因として、魚道6左端の黒い壁面が水面のゆらぎにより魚影状になりこれを魚影と認識することによって過剰計数する場合があったことが挙げられる。魚道6側面の塗装など別の対策が必要と考えられた。   As the experimental results show, it has been found that the measurement program used in this example can perform high-precision counting in real time on the actual fly-up video. However, as described above, with respect to the fact that there were about 10% overcounting and undercounting with respect to the number serving as the measurement standard, some of the causes of erroneous measurement have been clarified from the investigations so far. That is, as a cause of overcounting, there is a case where the black wall surface at the left end of the fishway 6 becomes a fish shadow shape due to the fluctuation of the water surface, and it is recognized that this is regarded as a fish shadow. It was thought that other measures such as painting the sides of the fishway were necessary.

また、図17中、最も多い13匹の不足計数をした47分の時区間における当該不足の原因は、アユが多量に遡上している途中でベースデータBの更新がなされたことである。実験ではベースデータ更新を0.5秒としたが、この時区間ではきわめて短い時間に多量のアユが遡上しており、0.5秒で13匹の計数不足を生じたものである。これに対しては、移動体が確認されている間は更新を待つ方法や、更新の間は前のベースデータBを用いて計数を継続する方法によって改善が可能になると考えられる。   Further, in FIG. 17, the cause of the shortage in the 47-minute time interval in which the most deficient counts of 13 were counted is that the base data B was updated while Ayu was going up in large quantities. In the experiment, the base data was updated for 0.5 seconds, but during this time period, a large amount of sweetfish went up in a very short time, resulting in 13 count deficiencies in 0.5 seconds. On the other hand, it is considered that improvement can be achieved by a method of waiting for the update while the moving body is confirmed or a method of continuing the counting using the previous base data B during the update.

ここまで説明したように、本実施例では、魚道6を遡上するアユをビデオカメラで撮影し、リアルタイムに遡上数を計数した。この水中または水面における移動体の計数システムは、水面の揺らぎなどによる誤計測を回避するために背景差分法を改良し、かつ一定の速度で移動するという計数対象の性質を生かして移動体を高精度に追跡・計数することによって迅速かつ高精度な計数を実現している。魚道6を撮影した1時間のサンプル映像に対し評価実験を行い、実際の遡上数225匹に対し226匹と自動計数し、1分毎の集計でも再現率、精度共に84%を達成するなど高い計数精度を有することが確認できた。   As explained so far, in the present embodiment, the sweetfish that goes up the fishway 6 was photographed with a video camera, and the number of going up was counted in real time. This counting system for moving objects in water or on the surface of water improves the background subtraction method to avoid erroneous measurement due to fluctuations in the water surface, etc., and takes advantage of the property of the counting object to move at a constant speed. By tracking and counting with precision, quick and highly accurate counting is realized. An evaluation experiment was conducted on a 1 hour sample image of the fishway 6, and 226 animals were automatically counted against the actual run-up number of 225 animals, achieving a recall and accuracy of 84% even when counting every minute. It was confirmed that it had high counting accuracy.

本発明にかかる移動体の計数システムによる計数処理の特徴的な概念を説明するためのグラフで、フレーム数1〜8の各フレーム画像中の同一座標(x,y)における画素の輝度ik(x,y)を表したものである。FIG. 6 is a graph for explaining a characteristic concept of the counting process by the moving body counting system according to the present invention, in which pixel luminances i k (in the same coordinates (x, y) in each frame image having 1 to 8 frames); x, y). 連続する複数枚のフレーム画像を概念的に理解しやすく示す図である。It is a figure which shows a continuous several frame image notionally easy to understand. 本発明の一実施形態を示すフローチャートで、移動体計数システムによりアユ遡上数を自動計数する際の全体の処理手順を表したものである。In the flowchart which shows one Embodiment of this invention, the whole process sequence at the time of automatically counting the number of sweetfish going up by a moving body counting system is represented. ベースデータ作成部の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of a base data preparation part. 連続するフレーム画像からベースデータを作成する際の処理内容を簡単に示す図である。It is a figure which shows simply the processing content at the time of creating base data from a continuous frame image. 背景差分により魚影を抽出する方法を簡単に示す模式図である。It is a schematic diagram which shows simply the method of extracting a fish shadow by background difference. ラベリング部による画素登録ステップの処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of the pixel registration step by a labeling part. ラベリング部による画素統合ステップの処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of the pixel integration step by a labeling part. 移動体が重なる場合の処理例を説明するための図で、移動体が出現してすぐ離れる場合を示したものである。It is a figure for demonstrating the example of a process when a mobile body overlaps, and the case where a mobile body appears and leaves | separates immediately is shown. 移動体が重なる場合の処理例を説明するための図で、移動体が出現してすぐ重なる場合を示したものである。It is a figure for demonstrating the example of a process when a mobile body overlaps, and the case where a mobile body appears and overlaps immediately is shown. 移動体が重なる場合の処理例を説明するための図で、移動体が出現してすぐ重なり、その後離れる場合を示したものである。It is a figure for demonstrating the example of a process when a mobile body overlaps, and the case where a mobile body overlaps immediately after appearing, and shows the case where it leaves | separates after that. 本実施例にて使用した魚道の撮影映像を示したものである。A photographed image of the fishway used in this example is shown. アユが通過する際の魚道の撮影映像を示したものである。This is a picture of the fishway taken when Ayu passes. 本発明を適用した移動体計数システムのユーザインタフェース画面の一例を示す図である。It is a figure which shows an example of the user interface screen of the moving body counting system to which this invention is applied. 魚道に設定した計測対象領域の一例を示す図である。It is a figure which shows an example of the measurement object area | region set to the fishway. 本発明を適用した計数プログラムによる自動計測と目視による自動計測との比較結果を5分毎の時区間で示すグラフである。It is a graph which shows the comparison result of the automatic measurement by the counting program to which this invention is applied, and the automatic measurement by visual observation in the time interval for every 5 minutes. 本発明を適用した計数プログラムによる自動計測と目視による自動計測との比較結果を1分毎の時区間で示すグラフである。It is a graph which shows the comparison result of the automatic measurement by the counting program to which this invention is applied, and the automatic measurement by visual observation in the time interval for every minute.

符号の説明Explanation of symbols

1 ベースデータ作成部
2 魚影候補画素抽出部(移動体候補画素抽出部)
3 ラベリング部
4 追跡・計数部
B ベースデータ
C 連接領域
I フレーム画像
S 計測対象領域
1 Base data creation unit 2 Fish shadow candidate pixel extraction unit (moving object candidate pixel extraction unit)
3 Labeling unit 4 Tracking / counting unit B Base data C Concatenated area I Frame image S Measurement target area

Claims (4)

計数対象である移動体が通過する一定の計測対象領域を一定時間連続して撮影して得られたカメラ映像を得、当該カメラ映像を画像処理し、当該画像処理して得られたフレーム画像から当該一定時間内に前記計測対象領域を通過した前記移動体を計数する水中または水面における移動体の計数システムにおいて、連続する複数枚の前記フレーム画像中における同一座標の各画素中から輝度が最明値であるものまたは最暗値であるものを抽出し、当該最明画素の集合からなる最明画像または最暗画素の集合からなる最暗画像を作成してこの最明画像または最暗画像を計数処理の基礎であるベースデータにするとともに、その後も画面全体の変化に対して輝度分布の変化を定期的に計測し一定の閾値を超える変化があった場合には当該ベースデータを作成し直すベースデータ作成部と、前記カメラ映像と前記ベースデータの画像との背景差分である2値画像を順次作成する移動体候補画素抽出部と、該移動体候補画素抽出部により作成された2値画像中において互いの距離が一定距離内にある値が1の画素の集まりを選び出し、当該選び出された画素の集まりを連接領域として抽出するラベリング部と、該ラベリング部により抽出された最新のフレーム画像中の連接領域群とその一段階前の時点におけるフレーム画像中の連接領域群とを比較し、その比較結果から当該フレーム画像中で前記移動体を抽出し、実際に移動している移動体の影を検出して当該移動体を計数する追跡・計数部とを有することを特徴とする水中または水面における移動体の計数システム。   Obtain a camera image obtained by continuously capturing a certain measurement target region through which a moving object to be counted passes for a certain time, perform image processing on the camera image, and from a frame image obtained by performing the image processing In an underwater or water surface counting system that counts the moving body that has passed through the measurement target area within the predetermined time, the brightness is the brightest among the pixels at the same coordinate in a plurality of consecutive frame images. Value or the darkest value is extracted, and the brightest image consisting of the set of the brightest pixels or the darkest image consisting of the set of the darkest pixels is created. In addition to the base data that is the basis of the counting process, the brightness distribution changes are periodically measured with respect to changes in the entire screen, and if there is a change that exceeds a certain threshold, the base data A base data creation unit, a moving object candidate pixel extraction unit that sequentially creates a binary image that is a background difference between the camera image and the base data image, and the moving object candidate pixel extraction unit. In the binary image, a group of pixels having a value of 1 that is within a certain distance from each other is selected, a labeling unit that extracts the selected group of pixels as a concatenated region, and the labeling unit Compare the connected region group in the latest frame image with the connected region group in the frame image at the previous stage, extract the moving body from the comparison result in the frame image, and actually move And a tracking / counting unit for detecting a shadow of the moving object and counting the moving object. 計数対象である移動体が通過する一定の計測対象領域を一定時間連続して撮影して得られたカメラ映像を得、当該カメラ映像を画像処理し、当該画像処理して得られたフレーム画像から当該一定時間内に前記計測対象領域を通過した前記移動体を計数する水中または水面における移動体の計数方法において、連続する複数枚の前記フレーム画像中における同一座標の各画素中から輝度が最明値であるものまたは最暗値であるものを抽出するステップと、当該最明画素の集合からなる最明画像または最暗画素の集合からなる最暗画像を作成してこの最明画像または最暗画像を計数処理の基礎であるベースデータにするステップと、画面全体の変化に対して輝度分布の変化を定期的に計測し一定の閾値を超える変化があった場合には当該ベースデータを作成し直すステップと、前記カメラ映像と前記ベースデータの画像との背景差分である2値画像を順次作成するステップと、順次作成された該2値画像中において互いの距離が一定距離内にある値が1の画素の集まりを選び出すステップと、当該選び出された画素の集まりを連接領域として抽出するステップと、該抽出された最新のフレーム画像中の連接領域群とその一段階前の時点におけるフレーム画像中の連接領域群とを比較するステップと、その比較結果から当該フレーム画像中で前記移動体を抽出し、実際に移動している移動体の影を検出して当該移動体を計数するステップとからなることを特徴とする水中または水面における移動体の計数方法。   Obtain a camera image obtained by continuously capturing a certain measurement target region through which a moving object to be counted passes for a certain time, perform image processing on the camera image, and from a frame image obtained by performing the image processing In the method of counting the moving object in water or on the water surface that counts the moving object that has passed through the measurement target area within the predetermined time, the brightness is the brightest among the pixels at the same coordinate in the plurality of consecutive frame images. A value or a darkest value, and a brightest image consisting of a set of the brightest pixels or a darkest image consisting of a set of the darkest pixels is created and the brightest image or darkest The step of making the image into base data that is the basis of the counting process, and the change in the luminance distribution with respect to the change in the entire screen are regularly measured. A step of re-creating a data, a step of sequentially creating a binary image that is a background difference between the camera image and the image of the base data, and a distance between each other within a certain distance in the sequentially created binary image Selecting a set of pixels having a value of 1 in the above, a step of extracting the selected set of pixels as a connected region, a group of connected regions in the extracted latest frame image, and a step before that The step of comparing the connected region group in the frame image at the time point, and extracting the moving body from the frame image from the comparison result, detecting the shadow of the moving body actually moving, A counting method of a moving body in water or on the water surface. 計数対象である移動体が通過する一定の計測対象領域を一定時間連続して撮影して得られたカメラ映像を得、当該カメラ映像を画像処理し、当該画像処理して得られたフレーム画像から当該一定時間内に前記計測対象領域を通過した前記移動体を計数する水中または水面における移動体の計数システムにおいて、連続する複数枚の前記フレーム画像中における同一座標の各画素の輝度i1(x,y),i2(x,y),…,in(x,y)の平均v(x,y)と標準偏差をσ(x,y)を求め、数式
b(x,y)=v(x,y)+kσ(x,y) (ただしkは任意の数値)
のx,y座標値b(x,y)で表される画素の集合からなる画像を作成して計数処理の基礎であるベースデータにするとともに、その後も画面全体の変化に対して輝度分布の変化を定期的に計測し一定の閾値を超える変化があった場合には当該ベースデータを作成し直すベースデータ作成部と、前記カメラ映像と前記ベースデータの画像との背景差分である2値画像を順次作成する移動体候補画素抽出部と、該移動体候補画素抽出部により作成された2値画像中において互いの距離が一定距離内にある値が1の画素の集まりを選び出し、当該選び出された画素の集まりを連接領域として抽出するラベリング部と、該ラベリング部により抽出された最新のフレーム画像中の連接領域群とその一段階前の時点におけるフレーム画像中の連接領域群とを比較し、その比較結果から当該フレーム画像中で前記移動体を抽出し、実際に移動している移動体の影を検出して当該移動体を計数する追跡・計数部とを有することを特徴とする水中または水面における移動体の計数システム。
Obtain a camera image obtained by continuously capturing a certain measurement target region through which a moving object to be counted passes for a certain time, perform image processing on the camera image, and from a frame image obtained by performing the image processing In an underwater or water surface counting system that counts the moving object that has passed through the measurement target area within the predetermined time, the luminance i 1 (x of each pixel at the same coordinate in a plurality of consecutive frame images , y), i 2 (x, y), ..., i n (x, y) mean v (x, y) and standard deviation σ (x, y)
b (x, y) = v (x, y) + kσ (x, y) (where k is any number)
An image consisting of a set of pixels represented by x, y coordinate values b (x, y) of the image is created and used as the base data that is the basis of the counting process. A base data creation unit that re-creates the base data when the change is periodically measured and exceeds a certain threshold, and a binary image that is a background difference between the camera video and the base data image A moving object candidate pixel extraction unit that sequentially generates a pixel, and a binary image generated by the moving object candidate pixel extraction unit. A labeling unit that extracts a group of the extracted pixels as a connected region, a connected region group in the latest frame image extracted by the labeling unit, and a connected region group in the frame image at the previous stage , Or a tracking / counting unit for extracting the moving object from the frame image from the comparison result, detecting a shadow of the moving object that is actually moving, and counting the moving object. A moving object counting system on the surface of the water.
計数対象である移動体が通過する一定の計測対象領域を一定時間連続して撮影して得られたカメラ映像を得、当該カメラ映像を画像処理し、当該画像処理して得られたフレーム画像から当該一定時間内に前記計測対象領域を通過した前記移動体を計数する水中または水面における移動体の計数方法において、連続する複数枚の前記フレーム画像中における同一座標の各画素の輝度i1(x,y),i2(x,y),…,in(x,y)の平均v(x,y)と標準偏差をσ(x,y)を求めるステップと、数式
b(x,y)=v(x,y)+kσ(x,y) (ただしkは任意の数値)
のx,y座標値b(x,y)で表される画素の集合からなる画像を作成して計数処理の基礎であるベースデータにするステップと、画面全体の変化に対して輝度分布の変化を定期的に計測し一定の閾値を超える変化があった場合には当該ベースデータを作成し直すステップと、前記カメラ映像と前記ベースデータの画像との背景差分である2値画像を順次作成するステップと、順次作成された該2値画像中において互いの距離が一定距離内にある値が1の画素の集まりを選び出すステップと、当該選び出された画素の集まりを連接領域として抽出するステップと、該抽出された最新のフレーム画像中の連接領域群とその一段階前の時点におけるフレーム画像中の連接領域群とを比較するステップと、その比較結果から当該フレーム画像中で前記移動体を抽出し、実際に移動している移動体の影を検出して当該移動体を計数するステップとからなることを特徴とする水中または水面における移動体の計数方法。


Obtain a camera image obtained by continuously capturing a certain measurement target region through which a moving object to be counted passes for a certain time, perform image processing on the camera image, and from a frame image obtained by performing the image processing In the method of counting the moving object in water or on the water surface that counts the moving object that has passed through the measurement target region within the predetermined time, the luminance i 1 (x of each pixel at the same coordinate in a plurality of successive frame images , y), i 2 (x, y), ..., i n (x, y) mean v (x, y) and standard deviation to obtain σ (x, y),
b (x, y) = v (x, y) + kσ (x, y) (where k is any number)
A step of creating an image consisting of a set of pixels represented by x, y coordinate values b (x, y) and making it the base data that is the basis of the counting process, and changes in the luminance distribution with respect to changes in the entire screen Is periodically measured, and when there is a change exceeding a certain threshold, the step of re-creating the base data and the binary image that is the background difference between the camera image and the image of the base data are sequentially created A step of selecting a group of pixels having a value of 1 that is within a certain distance from each other in the sequentially generated binary image, and a step of extracting the selected group of pixels as a connected region A step of comparing the extracted connected region group in the latest frame image with the connected region group in the frame image at the previous stage, and extracting the moving body in the frame image from the comparison result. And counting method for a mobile body in the water or the water surface, characterized by comprising a step of counting the detected and the mobile shadows of a moving body that is actually moving.


JP2004121530A 2004-04-16 2004-04-16 Counting system and counting method for moving object in water or water surface Expired - Fee Related JP4697923B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004121530A JP4697923B2 (en) 2004-04-16 2004-04-16 Counting system and counting method for moving object in water or water surface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004121530A JP4697923B2 (en) 2004-04-16 2004-04-16 Counting system and counting method for moving object in water or water surface

Publications (2)

Publication Number Publication Date
JP2005309485A JP2005309485A (en) 2005-11-04
JP4697923B2 true JP4697923B2 (en) 2011-06-08

Family

ID=35438257

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004121530A Expired - Fee Related JP4697923B2 (en) 2004-04-16 2004-04-16 Counting system and counting method for moving object in water or water surface

Country Status (1)

Country Link
JP (1) JP4697923B2 (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007206843A (en) * 2006-01-31 2007-08-16 Central Res Inst Of Electric Power Ind Method and device for counting moving body underwater or on water surface and its program
KR100813577B1 (en) * 2006-05-19 2008-03-17 한국기계연구원 Method and apparatus for pre-processing an underwater image, and an apparatus for compressing and decompressing an image using the same
JP2010039868A (en) * 2008-08-06 2010-02-18 Sharp Corp Position coordinate processing apparatus and position coordinate processing method
US7941281B2 (en) * 2008-12-22 2011-05-10 General Electric Company System and method for rotor blade health monitoring
JP5362456B2 (en) * 2009-06-18 2013-12-11 一般財団法人電力中央研究所 Method of measuring litter flow in river, measuring device and measuring program
JP4841652B2 (en) * 2009-07-10 2011-12-21 日本電信電話株式会社 Apparatus and method for detecting motion of translucent object
US9256956B2 (en) 2010-05-28 2016-02-09 Qualcomm Incorporated Dataset creation for tracking targets with dynamically changing portions
JP6429272B2 (en) * 2014-12-05 2018-11-28 古野電気株式会社 Object number measuring device, program, and object number measuring method
JP6702535B2 (en) * 2015-03-09 2020-06-03 Necソリューションイノベータ株式会社 Same fish judging device, fish counting device, portable terminal for fish counting, same fish judging method, fish counting method, fish number predicting device, fish number predicting method, same fish judging system, fish counting system and fish number predicting system
JP6519707B1 (en) * 2018-11-30 2019-05-29 富士通クライアントコンピューティング株式会社 Information processing apparatus and program
JP6561194B1 (en) * 2018-12-27 2019-08-14 Scsk株式会社 Tracking system and tracking program

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002123833A (en) * 2000-10-18 2002-04-26 Victor Co Of Japan Ltd Image processor
JP2002312786A (en) * 2001-04-13 2002-10-25 Sony Corp Image processor, image processing method, recording medium and program
JP2003337931A (en) * 2002-05-21 2003-11-28 Hiroyuki Takahashi Aquatic animal counting processor

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6385890A (en) * 1986-09-30 1988-04-16 Mitsubishi Electric Corp Counter for the number of persons
JP2585080B2 (en) * 1988-10-21 1997-02-26 情報制御システム株式会社 Underwater suspended matter detection device
JPH087069A (en) * 1994-06-15 1996-01-12 Hitachi Ltd Measuring instrument for number of fishes classified by fish kind through the use of image processing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002123833A (en) * 2000-10-18 2002-04-26 Victor Co Of Japan Ltd Image processor
JP2002312786A (en) * 2001-04-13 2002-10-25 Sony Corp Image processor, image processing method, recording medium and program
JP2003337931A (en) * 2002-05-21 2003-11-28 Hiroyuki Takahashi Aquatic animal counting processor

Also Published As

Publication number Publication date
JP2005309485A (en) 2005-11-04

Similar Documents

Publication Publication Date Title
TWI362016B (en) Method for detecting desired objects in a highly dynamic environment by a monitoring system and the monitoring system thereof
Crabb et al. Real-time foreground segmentation via range and color imaging
Chiu et al. A robust object segmentation system using a probability-based background extraction algorithm
CN105745687B (en) Context aware Moving target detection
JP4477221B2 (en) How to determine the orientation of an image containing a blue sky
JP6312714B2 (en) Multispectral imaging system for shadow detection and attenuation
US20080181507A1 (en) Image manipulation for videos and still images
CN101794406B (en) Automatic counting system for density of Bemisia tabaci adults
Karaman et al. Comparison of static background segmentation methods
CN111062293B (en) Unmanned aerial vehicle forest flame identification method based on deep learning
JP2009031939A (en) Image processing apparatus, method and program
JP2008523454A (en) How to model background and foreground regions
JP2009533778A (en) Video segmentation using statistical pixel modeling
CN102567727A (en) Method and device for replacing background target
JP4697923B2 (en) Counting system and counting method for moving object in water or water surface
CN109951635A (en) It takes pictures processing method, device, mobile terminal and storage medium
WO2023273011A1 (en) Method, apparatus and device for detecting object thrown from height, and computer storage medium
CN103577875A (en) CAD (computer-aided design) people counting method based on FAST (features from accelerated segment test)
CN110807759A (en) Method and device for evaluating photo quality, electronic equipment and readable storage medium
CN111654643B (en) Exposure parameter determination method and device, unmanned aerial vehicle and computer readable storage medium
CN113409360A (en) High altitude parabolic detection method and device, equipment and computer storage medium
CN112200035A (en) Image acquisition method and device for simulating crowded scene and visual processing method
TW201032180A (en) Method and device for keeping image background by multiple gauss models
JP2007065878A (en) Moving object counting method on water surface or underwater, and counting device and counting program
CN113628202B (en) Determination method, cleaning robot and computer storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070122

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100308

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100331

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110223

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110228

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees