TWI505707B - Abnormal object detecting method and electric device using the same - Google Patents

Abnormal object detecting method and electric device using the same Download PDF

Info

Publication number
TWI505707B
TWI505707B TW102102989A TW102102989A TWI505707B TW I505707 B TWI505707 B TW I505707B TW 102102989 A TW102102989 A TW 102102989A TW 102102989 A TW102102989 A TW 102102989A TW I505707 B TWI505707 B TW I505707B
Authority
TW
Taiwan
Prior art keywords
foreground
foreground object
distance
abnormal
picture
Prior art date
Application number
TW102102989A
Other languages
Chinese (zh)
Other versions
TW201431369A (en
Inventor
Chin Shyurng Fahn
Hsien Chou Liao
Houg Wei Huang
Original Assignee
Univ Nat Taiwan Science Tech
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 Univ Nat Taiwan Science Tech filed Critical Univ Nat Taiwan Science Tech
Priority to TW102102989A priority Critical patent/TWI505707B/en
Publication of TW201431369A publication Critical patent/TW201431369A/en
Application granted granted Critical
Publication of TWI505707B publication Critical patent/TWI505707B/en

Links

Description

異常物體偵測方法與電子裝置Abnormal object detection method and electronic device

本發明係與一種異常物體偵測方法有關,特別是與視訊資料的異常物體偵測方法與使用此方法的電子裝置有關。The invention relates to an abnormal object detecting method, in particular to an abnormal object detecting method for video data and to an electronic device using the same.

智能監控系統是用於代替人力以監控資料量龐大之視訊資料內容的監控系統。在其之一種應用中,智能監控系統需要判斷出在一個場景內是否出現有異常的現象。例如,在一停車場中是否有小偷想要偷取車輛,或是在車站中是否有人想要行搶等等情形。一般來說,智能監控系統需要追蹤這些視訊資料中的物體(例如為人或車輛)。然而,若這些物體發生了重疊的現象,則將會難以成功地追蹤到這些物體。並且,即使追蹤到這些物體,如何利用這些所追蹤到的軌跡來判斷一個物體是否為異常物體也是一個難題。因此,如何提出一個有效的異常物體偵測方法,為此領域技術人員所關心的課題。The intelligent monitoring system is a monitoring system used to replace human resources to monitor the content of video data with a large amount of data. In one of its applications, the intelligent monitoring system needs to determine whether an abnormality has occurred in a scene. For example, if there is a thief in a parking lot who wants to steal the vehicle, or if someone in the station wants to grab it, etc. In general, intelligent surveillance systems need to track objects (such as people or vehicles) in these video materials. However, if these objects overlap, it will be difficult to successfully track these objects. Moreover, even if these objects are tracked, how to use these tracked trajectories to determine whether an object is an abnormal object is also a problem. Therefore, how to propose an effective abnormal object detection method is a subject of interest to those skilled in the art.

本發明的實施例提供一種異常物體偵測方法與使用此方 法的電子裝置,可以準確地追蹤多個前景物體並且判斷出哪些前景物體為異常物體。Embodiments of the present invention provide an abnormal object detecting method and using the same The electronic device of the method can accurately track a plurality of foreground objects and determine which foreground objects are abnormal objects.

本發明一實施例提出一種異常物體偵測方法,適用於一電子裝置。此異常物體偵測方法包括:取得一視訊資料與從此視訊資料中分出多個前景物體;追蹤這些前景物體以產生多個軌跡;根據這些軌跡判斷在視訊資料的一個第一畫面中,第一前景物體與其他的前景物體是否發生一重疊現象;若發生重疊現象,根據一卡爾曼濾波器計算第一前景物體的第一預測位置;對第一預測位置執行平均位移演算法以取得第一偵測位置;根據卡爾曼濾波器修正第一偵測位置以取得一個第一修正位置,並且根據第一修正位置更新對應於第一前景物體的軌跡;以及,根據所述的軌跡判斷前景物體是否為異常物體。An embodiment of the invention provides an abnormal object detecting method suitable for an electronic device. The abnormal object detecting method includes: acquiring a video data and separating a plurality of foreground objects from the video data; tracking the foreground objects to generate a plurality of tracks; determining, according to the tracks, a first picture in the video data, first Whether the foreground object and another foreground object overlap; if an overlap occurs, calculating a first predicted position of the first foreground object according to a Kalman filter; performing an average displacement algorithm on the first predicted position to obtain the first detect Measuring the position; correcting the first detection position according to the Kalman filter to obtain a first correction position, and updating the trajectory corresponding to the first foreground object according to the first correction position; and determining whether the foreground object is based on the trajectory Anomalous object.

在一實施例中,上述對第一預測位置執行平均位移演算法以取得第一偵測位置的步驟包括:取得第一影像的前景影像;以及,以第一預測位置為起始點在前景影像上執行平均位移演算法以取得第一偵測位置。In an embodiment, the step of performing an average displacement algorithm on the first predicted position to obtain the first detected position comprises: obtaining a foreground image of the first image; and, starting from the first predicted position, in the foreground image An average displacement algorithm is performed on the top to obtain the first detection position.

在一實施例中,上述追蹤前景物體以產生多個軌跡的步驟是根據一斑點式追蹤演算法所執行。此異常物體偵測方法還包括:若沒有發生重疊現象,根據斑點式追蹤演算法追蹤在第一畫面中的前景物體。In an embodiment, the step of tracking the foreground object to generate a plurality of trajectories is performed according to a speckle tracking algorithm. The abnormal object detecting method further includes: if there is no overlap phenomenon, tracking the foreground object in the first picture according to the speckle tracking algorithm.

在一實施例中,上述判斷是否發生重疊現象的步驟包括:取得第一畫面中的一新前景物體;配對所述的前景物體與與 新前景物體;若前景物體的至少其中之二配對於新前景物體,判斷前景物體的該至少其中之二發生重疊現象。In an embodiment, the step of determining whether an overlap phenomenon occurs comprises: obtaining a new foreground object in the first picture; pairing the foreground object with a new foreground object; if at least two of the foreground objects are paired with the new foreground object, it is determined that at least two of the foreground objects overlap.

在一實施例中,上述的異常物體偵測方法更包括:根據所述的軌跡判斷在第一畫面中,一個第二前景物體是否發生一消失現象;若發生消失現象,根據卡爾曼濾波器計算第二前景物體的一速度,其中一個第二畫面在第一畫面之後,第二畫面與第一畫面相差n個畫面,並且n為正整數;根據正整數n與速度的相乘,計算第二前景物體在第二畫面的一個第二預測位置;以及若在第二預測位置偵測到第二前景物體,根據第二預測位置更新對應於第二前景物體的軌跡。In an embodiment, the abnormal object detecting method further includes: determining, according to the trajectory, whether a second foreground object has a disappearing phenomenon in the first picture; and if a disappearing phenomenon occurs, calculating according to a Kalman filter a speed of the second foreground object, wherein a second picture is after the first picture, the second picture is different from the first picture by n pictures, and n is a positive integer; and the second is calculated according to the multiplication of the positive integer n and the velocity The foreground object is at a second predicted position of the second picture; and if the second foreground object is detected at the second predicted position, the trajectory corresponding to the second foreground object is updated according to the second predicted position.

在一實施例中,上述的異常物體偵測方法更包括;取得一訓練資料庫;對訓練資料庫執行一自我組織增量神經網路以取得一訓練模型。上述根據軌跡判斷前景物體是否為異常物體的步驟是根據此訓練模型所執行。In an embodiment, the abnormal object detecting method further includes: obtaining a training database; and performing a self-organizing incremental neural network on the training database to obtain a training model. The above step of determining whether the foreground object is an abnormal object based on the trajectory is performed according to the training model.

在一實施例中,上述的訓練模型包括多個節點,對應於一第三前景物體的軌跡包括多個軌跡資訊向量。其中判斷第三前景物體是否為異常物體的步驟包括:取得節點中最靠近每一個軌跡資訊向量的一個第一節點;取得每一個軌跡資訊向量與對應的第一節點之間的一軌跡距離;取得每一個第一節點的一最遠鄰居,並且取得每一個節點與對應的最遠鄰居之間的一鄰居距離;累加這些軌跡距離以產生一累加距離,並且累加這些鄰居距離以產生一累加鄰居距離;以及,比較此累加距離與此累加鄰居距離 以判斷第三前景物體是否為異常物體。In an embodiment, the training model includes a plurality of nodes, and the trajectory corresponding to a third foreground object includes a plurality of trajectory information vectors. The step of determining whether the third foreground object is an abnormal object comprises: obtaining a first node of the node closest to each track information vector; obtaining a track distance between each track information vector and the corresponding first node; a farthest neighbor of each first node, and obtaining a neighbor distance between each node and the corresponding farthest neighbor; accumulating the track distances to generate an accumulated distance, and accumulating the neighbor distances to generate an accumulated neighbor distance ; and, compare this accumulated distance with this accumulated neighbor distance To determine whether the third foreground object is an abnormal object.

在一實施例中,上述比較累加距離與累加鄰居距離以判斷第三前景物體是否為異常物體的步驟包括:將累加距離與累加鄰居距離的相減除以累加距離與累加鄰居距離的相加以產生一正規化距離;根據正規化距離是否大於一個第一臨界值以計算第三前景物體的一異常次數;判斷異常次數是否大於一個第二臨界值;以及,若異常次數大於第二臨界值,判斷第三前景物體為異常物體。In an embodiment, the step of comparing the accumulated distance with the accumulated neighbor distance to determine whether the third foreground object is an abnormal object comprises: dividing the subtraction of the accumulated distance from the accumulated neighbor distance by the sum of the accumulated distance and the accumulated neighbor distance to generate a normalized distance; whether the normalized distance is greater than a first critical value to calculate an abnormal number of the third foreground object; determining whether the abnormal number is greater than a second critical value; and, if the abnormal number is greater than the second critical value, determining The third foreground object is an abnormal object.

以另外一個角度來說,本發明一實施例提出一種電子裝置,包括一記憶體與一處理器。記憶體儲存了多個指令。處理器用以執行這些指令以執行多個步驟:取得一視訊資料並從此視訊資料中分出多個前景物體;追蹤這些前景物體以產生多個軌跡;根據這些軌跡判斷在視訊資料的一個第一畫面中,第一前景物體與其他的前景物體是否發生一重疊現象;若發生重疊現象,根據一卡爾曼濾波器計算第一前景物體的第一預測位置;對第一預測位置執行平均位移演算法以取得第一偵測位置;根據卡爾曼濾波器修正第一偵測位置以取得一個第一修正位置,並且根據第一修正位置更新對應於第一前景物體的軌跡;以及,根據所述的軌跡判斷前景物體是否為異常物體。In another aspect, an embodiment of the invention provides an electronic device including a memory and a processor. The memory stores multiple instructions. The processor is configured to execute the instructions to perform a plurality of steps: acquiring a video data and separating a plurality of foreground objects from the video data; tracking the foreground objects to generate a plurality of tracks; and determining a first picture of the video data according to the tracks Whether the first foreground object overlaps with other foreground objects; if an overlap occurs, calculating a first predicted position of the first foreground object according to a Kalman filter; performing an average displacement algorithm on the first predicted position Obtaining a first detection position; correcting the first detection position according to the Kalman filter to obtain a first correction position, and updating a trajectory corresponding to the first foreground object according to the first correction position; and determining, according to the trajectory Whether the foreground object is an abnormal object.

基於上述,本發明實施例提出的異常物體偵測方法與使用此方法的電子裝置,可以結合卡爾曼濾波器與平均位移演算法來準確地追蹤前景物體。Based on the above, the abnormal object detecting method and the electronic device using the method provided by the embodiment of the present invention can accurately track the foreground object by combining the Kalman filter and the average displacement algorithm.

為讓本發明的上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。The above described features and advantages of the invention will be apparent from the following description.

110‧‧‧電子裝置110‧‧‧Electronic devices

120‧‧‧視訊資料120‧‧‧Video Information

130‧‧‧判斷結果130‧‧‧Results

140‧‧‧處理器140‧‧‧ processor

150‧‧‧記憶體150‧‧‧ memory

210、220、230、240、410、420、430、440、510a、510b、520a、520b、810‧‧‧影像210, 220, 230, 240, 410, 420, 430, 440, 510a, 510b, 520a, 520b, 810 ‧ ‧ images

242、244、324、332、342、344、352、522、524‧‧‧前景物體242, 244, 324, 332, 342, 344, 352, 522, 524‧ ‧ foreground objects

310、320、330、340、350‧‧‧示意圖Schematic diagram of 310, 320, 330, 340, 350‧‧

312、322、346、354、356、702‧‧‧新前景物體312, 322, 346, 354, 356, 702 ‧ ‧ new foreground objects

610、620‧‧‧軌跡610, 620‧‧ Track

704‧‧‧串列704‧‧‧Listing

S706、S708、S710、S712、S714、S1102、S1104、S1106、S1108、S1110、S1112、S1114、S1116‧‧‧步驟Steps S706, S708, S710, S712, S714, S1102, S1104, S1106, S1108, S1110, S1112, S1114, S1116‧‧

716‧‧‧目前影像716‧‧‧ current image

718‧‧‧前景遮罩718‧‧‧ foreground mask

820‧‧‧節點820‧‧‧ nodes

910、920‧‧‧圖示910, 920‧‧‧ icon

1001~1010‧‧‧節點1001~1010‧‧‧ nodes

1031~1033‧‧‧軌跡資訊向量1031~1033‧‧‧Track information vector

1041~1043‧‧‧軌跡距離1041~1043‧‧‧Track distance

圖1是根據一實施例繪示電子裝置的方塊圖。1 is a block diagram of an electronic device in accordance with an embodiment.

圖2是根據一實施例繪示取得前景物體的示意圖。2 is a schematic diagram showing the acquisition of a foreground object, according to an embodiment.

圖3是根據一實施例繪示判斷前景物體是否發生重疊現象的示意圖。FIG. 3 is a schematic diagram of determining whether a foreground object overlaps according to an embodiment.

圖4是根據一實施例繪示執行平均位移演算法的示意圖。4 is a schematic diagram showing the execution of an average displacement algorithm, in accordance with an embodiment.

圖5是根據一實施例繪示處理重疊現象的示意圖。FIG. 5 is a schematic diagram showing a process overlap phenomenon according to an embodiment.

圖6是根據一實施例繪示平滑軌跡的示意圖。FIG. 6 is a schematic diagram showing a smooth trajectory according to an embodiment.

圖7是根據一實施例繪示追蹤前景物體的流程圖。7 is a flow chart showing tracking of foreground objects in accordance with an embodiment.

圖8是根據一實施例繪示訓練軌跡資訊向量的示意圖。FIG. 8 is a schematic diagram showing a training trajectory information vector according to an embodiment.

圖9是根據一實施例繪示訓練模型的示意圖。9 is a schematic diagram showing a training model in accordance with an embodiment.

圖10是根據一實施例繪示軌跡資訊向量與訓練模型中節點的示意圖。10 is a schematic diagram showing nodes in a trajectory information vector and a training model, according to an embodiment.

圖11是根據一實施例繪示異常物體偵測方法的流程圖。FIG. 11 is a flow chart showing a method for detecting an abnormal object according to an embodiment.

圖1是根據一本發明之實施例所繪示之電子裝置的方塊圖。1 is a block diagram of an electronic device according to an embodiment of the invention.

請參照圖1,電子裝置110是用以接收視訊資料120,並判斷在視訊資料120中的一或多個物體是否為異常物體,以產生判斷結果130。電子裝置110可以被實作為電腦、伺服器、分散式系統、智慧型手機、平板電腦、任何形式的嵌入式系統或電子裝置,本發明並不侷限於此等實作態樣。Referring to FIG. 1 , the electronic device 110 is configured to receive the video data 120 and determine whether one or more objects in the video data 120 are abnormal objects to generate a determination result 130 . The electronic device 110 can be implemented as a computer, a server, a distributed system, a smart phone, a tablet, any form of embedded system, or an electronic device, and the present invention is not limited to such implementations.

電子裝置110至少包括一處理器140與一記憶體150。記憶體150中係儲存有多個指令,並且處理器140係用以執行這些指令以產生判斷結果130。處理器140可以例如是中央處理單元(Central Processing Unit,CPU)、微處理器(Microprocessor)或數位訊號處理器(Digital Signal Processor,DSP)。記憶體150可以例如是隨機存取記憶體或是快閃記憶體。The electronic device 110 includes at least a processor 140 and a memory 150. A plurality of instructions are stored in the memory 150, and the processor 140 is configured to execute the instructions to generate the determination result 130. The processor 140 can be, for example, a central processing unit (CPU), a microprocessor (Microprocessor), or a digital signal processor (DSP). The memory 150 can be, for example, a random access memory or a flash memory.

首先,處理器140會接收視訊資料120並且從視訊資料120中分出多個前景物體。例如,處理器140可以使用高斯混合模型(Gaussian mixture model,GMM)來建立視訊資料120中背景影像,並根據此一背景影像來取得視訊資料中之每一張影像的前景影像。處理器140也可以去除前景影像中的影子部分。然而,處理器140可以採用任意的演算法來取得前景影像或是去除影子部分,本發明並不侷限於此等處理演算法。如圖2所示,影像210為背景影像,影像220為目前影像,影像230為前景影像,而影像240為去除影子部份後的前景影像。在取得影像240以後,處理器140會根據一個連結元件標定(connected component labeling)演算法,來取得影像240中的前景物體242與244。處理器140 會紀錄前景物體242與244的識別碼、定界框(bounding box)、大小、用於表示是否為移動物體的變數、以及用於表示是否發生重疊現象的變數。First, the processor 140 receives the video material 120 and separates a plurality of foreground objects from the video material 120. For example, the processor 140 may use a Gaussian mixture model (GMM) to create a background image in the video material 120, and obtain a foreground image of each image in the video material according to the background image. The processor 140 can also remove shadow portions from the foreground image. However, the processor 140 may employ any algorithm to obtain foreground images or remove shadow portions, and the present invention is not limited to such processing algorithms. As shown in FIG. 2, the image 210 is a background image, the image 220 is a current image, the image 230 is a foreground image, and the image 240 is a foreground image after the shadow portion is removed. After the image 240 is acquired, the processor 140 retrieves the foreground objects 242 and 244 in the image 240 based on a connected component labeling algorithm. Processor 140 The identification code of the foreground objects 242 and 244, the bounding box, the size, the variable for indicating whether it is a moving object, and the variable for indicating whether or not an overlap phenomenon occurs are recorded.

接下來,處理器140會追蹤視訊資料120中所有的前景物體以產生多個軌跡。例如,處理器140會根據一個斑點式追蹤(blob tracking)演算法來追蹤這些前景物體。更具體來說,所有已被追蹤的前景物體會被記錄在一個串列BlobList中。當處理器140接收到視訊資料120中的一個新影像以後,會偵測此新影像中的一或多個新前景物體,並將其表示為變數BlobsNew。處理器140會將這些新前景物體與串列BlobList中的前景物體進行配對。例如,若一個新前景物體的定界框係與一個前景物體的定界框重疊,則表示此一新前景物體係與此前景物體配對。或者,若一個新前景物體的影像內容係與一個前景物體的影像內容類似,則其也代表此一新前景物體係與此前景物體配對,本發明並不侷限於此等配對方法。Next, the processor 140 tracks all foreground objects in the video material 120 to generate a plurality of tracks. For example, processor 140 tracks these foreground objects according to a blob tracking algorithm. More specifically, all foreground objects that have been tracked are recorded in a list of BlobLists. After the processor 140 receives a new image in the video material 120, one or more new foreground objects in the new image are detected and represented as a variable BlobsNew. The processor 140 will pair these new foreground objects with the foreground objects in the list BlobList. For example, if a bounding frame of a new foreground object overlaps with a bounding box of a foreground object, it indicates that the new foreground system is paired with the foreground object. Alternatively, if the image content of a new foreground object is similar to the image content of a foreground object, it also represents that the new foreground system is paired with the foreground object, and the present invention is not limited to such pairing methods.

圖3是根據一實施例來繪示判斷前景物體是否發生重疊現象的示意圖。FIG. 3 is a schematic diagram illustrating determining whether a foreground object overlaps, according to an embodiment.

請參照圖3,在示意圖310中,處理器140偵測到一個新前景物體312,並且此一新前景物體312並沒有與串列BlobList中的前景物體形成配對。此時,處理器140會將新前景物體312加入至串列BlobList中。Referring to FIG. 3, in diagram 310, processor 140 detects a new foreground object 312, and the new foreground object 312 does not form a pair with the foreground object in the tandem BlobList. At this point, processor 140 will add the new foreground object 312 to the list BlobList.

在示意圖320中,處理器140所偵測到新前景物體322, 係只配對於串列BlobList中的一個前景影像324。此時,處理器140會根據新前景物體324,來更新對應於前景物體324的軌跡。In diagram 320, processor 140 detects a new foreground object 322, Only one foreground image 324 in the list BlobList is assigned. At this time, the processor 140 updates the trajectory corresponding to the foreground object 324 according to the new foreground object 324.

在示意圖330中,處理器140所偵測到前景物體332,並沒有配對於任意一個新前景物體。此時,處理器140會從串列BlobList中移除對應於前景物體332的軌跡。並且,處理器140會判斷前景物體332發生了消失現象(即,消失於新影像當中)。以下會再說明如何處理消失現象。In diagram 330, foreground object 332 is detected by processor 140 and is not assigned to any of the new foreground objects. At this point, the processor 140 removes the trajectory corresponding to the foreground object 332 from the tandem BlobList. Moreover, the processor 140 determines that the foreground object 332 has disappeared (ie, disappeared into the new image). The following will explain how to deal with the disappearance.

在示意圖340中,處理器140偵測到兩個前景物體342與344,其等係配對於新前景物體346。此時,處理器140會判斷前景物體342與344發生了重疊現象。以下會再詳細說明如何處理此重疊現象。In diagram 340, processor 140 detects two foreground objects 342 and 344 that are tied to new foreground object 346. At this time, the processor 140 determines that the foreground objects 342 and 344 overlap. The following will explain in detail how to handle this overlap.

在示意圖350中,處理器140偵測到一個前景物體352,其係配對於兩個新前景物體354、356。此時,處理器140會判斷新前景物體354與356發生了重疊現象。In diagram 350, processor 140 detects a foreground object 352 that is paired with two new foreground objects 354, 356. At this time, the processor 140 determines that the new foreground objects 354 and 356 overlap.

另一方面,如果一個前景物體連續地在n張畫面中被追蹤到(即,沒有發生重疊現象或是消失現象),則此前景物體會被標記為移動物體。其中n為正整數,但本發明並不限制n的數值。On the other hand, if a foreground object is continuously tracked in n pictures (ie, no overlap or disappearance occurs), the foreground object is marked as a moving object. Where n is a positive integer, but the invention does not limit the value of n.

以下說明如何處理重疊現象。假設在一第一畫面中,一個第一前景物體(例如,前景物體342、344、354、或356)與其他前景物體發生了重疊現象。處理器140會紀錄此第一前景物體的影像內容,並且根據已紀錄的軌跡以及卡爾曼濾波器(Kalman filter),來計算出此第一前景物體的一個第一預測位置。接下來, 處理器140會對此第一預測位置執行一個平均位移(mean-shift)演算法,以取得一個第一偵測位置。更具體來說,處理器140會取得此第一影像的前景影像(例如,利用高斯混合模型)。處理器140會根據第一前景物體的影像內容,並以第一預測位置為起始點,在此前景影像上執行平均位移演算法,以取得第一偵測位置。舉例來說,如圖4所示,影像410為處理器140所取得的一張影像。影像420為在影像410上執行平均位移演算法的結果。由於受到背景影像的干擾,因此影像420中包含了許多雜訊。影像430為影像410的前景影像,而影像440為在影像430上執行平均位移演算法的結果。可以看到的是,在影像440中因為已去除掉了背景的部分,因此可以較準確的偵測到前景物體的位置。The following explains how to handle overlap. It is assumed that in a first picture, a first foreground object (e.g., foreground object 342, 344, 354, or 356) overlaps with other foreground objects. The processor 140 records the image content of the first foreground object, and calculates a first predicted position of the first foreground object based on the recorded trajectory and a Kalman filter. Next, The processor 140 performs a mean-shift algorithm on the first predicted position to obtain a first detected position. More specifically, the processor 140 may obtain a foreground image of the first image (eg, using a Gaussian mixture model). The processor 140 performs an average displacement algorithm on the foreground image according to the image content of the first foreground object and starting from the first predicted position to obtain the first detection position. For example, as shown in FIG. 4, the image 410 is an image obtained by the processor 140. Image 420 is the result of performing an average displacement algorithm on image 410. The image 420 contains a lot of noise due to interference from the background image. Image 430 is the foreground image of image 410 and image 440 is the result of performing an average displacement algorithm on image 430. It can be seen that in the image 440, since the background portion has been removed, the position of the foreground object can be detected more accurately.

在取得第一偵測位置以後,處理器140還會根據卡爾曼濾波器來修正此第一偵測位置,以產生一個第一修正位置。處理器140會根據此第一修正位置,來更新對應於第一前景物體的軌跡。如圖5所示,影像510a、510b為發生重疊現象之前的影像,而影像520a、520b為發生重疊現象之後的影像(例如,圖520a為上述的第一影像)。從圖5可以發現的是,由於處理器140結合了卡爾曼濾波器與平均位移演算法,因此在發生了重疊現象以後仍然能夠分別地追蹤到前景物體522與524。After obtaining the first detection position, the processor 140 also corrects the first detection position according to the Kalman filter to generate a first correction position. The processor 140 updates the trajectory corresponding to the first foreground object according to the first modified position. As shown in FIG. 5, the images 510a and 510b are images before the overlap phenomenon, and the images 520a and 520b are images after the overlap phenomenon (for example, the image 520a is the first image described above). It can be seen from FIG. 5 that since the processor 140 incorporates a Kalman filter and an average displacement algorithm, the foreground objects 522 and 524 can still be tracked separately after the occurrence of the overlap phenomenon.

值得說明的是,卡爾曼濾波器是假設在線性的基礎上,用以預測一個物體的狀態。平均位移演算法則是用一個核心(kernel)來計算出一個數值,並且會逐漸地移動此核心以找到一個 極值位置。影像440的每一個像素便是此核心在影像430上每一個位置所計算出的數值。然而,本領域具有通常知識者可得知卡爾曼濾波器與平均位移演算法的計算過程,在此並不贅述。It is worth noting that the Kalman filter is assumed to predict the state of an object on a linear basis. The average displacement algorithm uses a kernel to calculate a value and gradually moves the core to find a Extreme position. Each pixel of image 440 is the value calculated by the core at each location on image 430. However, those skilled in the art can understand the calculation process of the Kalman filter and the average displacement algorithm, and will not be described here.

以下將說明如何處理消失現象。處理器140會根據已被追蹤到的軌跡,判斷一個前景物體是否發生了消失現象(如示意圖330所示)。發生此消失現象的原因可能是前景物體移動的太快,因此處理器140並沒有辦法成功地追蹤到此前景物體。若第一畫面中的一個第二前景物體發生了消失現象,處理器140會根據卡爾曼濾波器來計算此第二前景物體的速度,並且用此一速度來預測第二前景物體,在接下來幾張畫面中的位置。具體來說,處理器140會取得第二前景物體在第t-1張畫面中的位置,並根據卡爾曼濾波器預測在第t張畫面(即,第一畫面)的位置,其中t為正整數。第二前景物體在第t張畫面的位置減去在第t-1張畫面的位置會等於上述的速度。當處理器140要預測第二前景物體在第t+n張畫面(亦稱第二畫面)的位置時,會將上述的速度乘上正整數n並且加上第二前景物體在第t張畫面的位置,藉此得到第二前景物體在第t+n張畫面上的一個第二預測位置。如果處理器140在第t+n張畫面的第二預測位置上,偵測到第二前景物體(即,在第二預測位置上所偵測到的前景物體,可配對於上述串列BlobList中的第二前景物體),則處理器140會根據第二預測位置來更新對應於第二前景物體的軌跡。在此一實施例中,正整數n會小於等於5,但本發明並不限制正整數n的數值。The following explains how to handle the disappearance. The processor 140 determines whether a foreground object has disappeared based on the trajectory that has been tracked (as shown in diagram 330). The reason for this disappearance may be that the foreground object moves too fast, so the processor 140 has no way to successfully track the foreground object. If a second foreground object in the first picture has disappeared, the processor 140 calculates the velocity of the second foreground object according to the Kalman filter, and uses the speed to predict the second foreground object. The position in several pictures. Specifically, the processor 140 obtains the position of the second foreground object in the t-1th picture, and predicts the position of the tth picture (ie, the first picture) according to the Kalman filter, where t is positive Integer. The position of the second foreground object at the position of the tth picture minus the position of the t-1th picture will be equal to the above speed. When the processor 140 is to predict the position of the second foreground object on the t+nth picture (also referred to as the second picture), the above speed is multiplied by a positive integer n and the second foreground object is added to the tth picture. Position, thereby obtaining a second predicted position of the second foreground object on the t+nth picture. If the processor 140 detects the second foreground object (ie, the foreground object detected at the second predicted position) in the second predicted position of the t+nth picture, it may be configured in the above-mentioned serial BlobList. The second foreground object, the processor 140 updates the trajectory corresponding to the second foreground object according to the second predicted position. In this embodiment, the positive integer n will be less than or equal to 5, but the present invention does not limit the value of the positive integer n.

如上所述,處理器140會處理重疊現象與消失現象以正確地更新多個軌跡。在此範例實施例中,處理器140還會再使用卡爾曼濾波器來平滑這些軌跡,如圖6所示,軌跡610為平滑前的軌跡,而軌跡620為平滑後的軌跡。As described above, the processor 140 processes the overlap and disappearance to correctly update the multiple tracks. In this exemplary embodiment, processor 140 will again use Kalman filters to smooth the trajectories. As shown in FIG. 6, trajectory 610 is the trajectory before smoothing, and trajectory 620 is the smoothed trajectory.

圖7是根據一實施例來繪示追蹤前景物體的流程圖。7 is a flow chart showing tracking of foreground objects, in accordance with an embodiment.

請參照圖7,在步驟S706中,處理器140會將串列704中已紀錄的前景物體以及新前景物體702加以配對。在步驟S708中,處理器140會判斷是否發生重疊現象。若步驟S708的判斷結果為否,則處理器140會根據斑點式追蹤演算法來追蹤前景物體。若步驟S708的判斷結果為是,則處理器140會執行卡爾曼濾波器,並且根據執行的結果來執行平均位移演算法(步驟S714)。並且,在步驟S714中,處理器140是根據前景遮罩718(例如,執行高斯混合模型的結果)來過濾目前影像716,以取得前景影像,並且在此前景影像上執行平均位移演算法。不論是否發生重疊現象,最後處理器140都會根據卡爾曼濾波器來平滑這些軌跡,藉此更新串列704。圖7中各步驟已詳細說明如上,在此便不再贅述。Referring to FIG. 7, in step S706, the processor 140 pairs the recorded foreground objects in the series 704 with the new foreground objects 702. In step S708, the processor 140 determines whether an overlap phenomenon has occurred. If the result of the determination in step S708 is no, the processor 140 tracks the foreground object according to the speckle-based tracking algorithm. If the decision result in the step S708 is YES, the processor 140 executes the Kalman filter, and performs an average displacement algorithm based on the result of the execution (step S714). Moreover, in step S714, the processor 140 filters the current image 716 according to the foreground mask 718 (eg, the result of performing the Gaussian mixture model) to obtain the foreground image, and performs an average displacement algorithm on the foreground image. The final processor 140 smoothes the trajectories according to the Kalman filter, regardless of whether or not an overlap occurs, thereby updating the series 704. The steps in Fig. 7 have been described in detail above, and will not be described again here.

接下來,處理器140會根據平滑後的軌跡來判斷前景物體是否為異常物體。具體來說,處理器140會先取得一個訓練資料庫,其中會包括一或多個視訊資料,每一個視訊資料會包括一或多個前景物體。此訓練資料庫中的前景物體屬於正常的前景物體。處理器140會根據上述取得軌跡的方法來取得此訓練資料庫中所有前景物體的軌跡。處理器140會把訓練資料庫中的每一個 軌跡分成多個訓練軌跡資訊向量,其中包括了一個前景物體在不同時間(畫面)的x座標、y座標、x方向速度、y方向速度或其組合。換言之,若一個前景物體出現在n個畫面中,則處理器140會取得n個訓練軌跡資訊向量。在此範例實施例中,一個訓練軌跡資訊向量的維度為4,但本發明並不侷限於此。如圖8所示,每一個訓練軌跡的資訊向量都可以投影在影像810上的一個節點(例如,節點820)。Next, the processor 140 determines whether the foreground object is an abnormal object based on the smoothed trajectory. Specifically, the processor 140 first obtains a training database, which may include one or more video materials, each of which includes one or more foreground objects. The foreground objects in this training database belong to normal foreground objects. The processor 140 obtains the trajectories of all foreground objects in the training database according to the method of acquiring the trajectory described above. The processor 140 will put each of the training databases The trajectory is divided into a plurality of training trajectory information vectors including an x coordinate, a y coordinate, an x-direction velocity, a y-direction velocity, or a combination thereof of a foreground object at different times (pictures). In other words, if a foreground object appears in n pictures, the processor 140 obtains n training track information vectors. In this exemplary embodiment, the dimension of one training track information vector is 4, but the invention is not limited thereto. As shown in FIG. 8, the information vector for each training trajectory can be projected onto a node (eg, node 820) on image 810.

處理器140還會將每一個訓練軌跡資訊向量正規化。在此實施例中,處理器140會將x座標除以畫面的寬度,將y座標除以畫面的高度。處理器140也會計算所有訓練軌跡資訊向量的速度大小的標準差,並且將速度大小除以此標準差與一個常數的相乘,其可以表示為以下之方程式(1)與(2)。The processor 140 also normalizes each training trajectory information vector. In this embodiment, processor 140 divides the x coordinate by the width of the picture and divides the y coordinate by the height of the picture. The processor 140 also calculates the standard deviation of the velocity magnitudes of all of the training trajectory information vectors, and divides the velocity magnitude by the standard deviation multiplied by a constant, which can be expressed as equations (1) and (2) below.

dx為一個訓練軌跡資訊向量的x方向速度,dy為y方向速度,S為速度大小,σ為速度大小的標準差。c為常數,在此實施例中為2.5至3.5之間的數值,但本發明並不侷限於此。Snorm 為正規化後的速度大小。Dx is the x-direction velocity of a training trajectory information vector, dy is the y-direction velocity, S is the velocity magnitude, and σ is the standard deviation of the velocity magnitude. c is a constant, which is a value between 2.5 and 3.5 in this embodiment, but the invention is not limited thereto. S norm is the speed after normalization.

此外,每一個速度方向也會根據以下方程式(3)來加以正規化。In addition, each speed direction is also normalized according to the following equation (3).

d norm =(d +π )/2π ………(3) d norm =( d + π )/2 π .........(3)

d為速度方向,dnorm 為正規化後的速度方向。d is the speed direction, and d norm is the normalized speed direction.

處理器140會根據正規化後的速度大小與速度方向產生正規化後的x方向速度與y方向速度。The processor 140 generates a normalized x-direction velocity and a y-direction velocity according to the normalized velocity magnitude and velocity direction.

處理器140會對此一訓練資料庫執行一個自我組織增量神經網路(self organizing incremental neural networks,SOINN),以取得一個訓練模型。具體來說,處理器140會將所有正規化後的訓練軌跡資訊向量,當作自我組織增量神經網路的輸入值,而自我組織增量神經網路會去除掉其中的一些雜訊,並且自動的將這些訓練軌資訊向量分類為一或多個群組,最後產生訓練模型。訓練模型會包括多個節點,而每一個節點是對應於一個訓練軌跡資訊向量。每一個節點可能會包括一或多個邊,並且透過一個邊連接的兩個節點是屬於同一個群組。如圖9所示,若僅考慮x座標與y座標,則訓練模型可以投影成二維的圖示910。若僅考慮x方向速度與y方向速度,則訓練模型可以投影成二維的圖示920。The processor 140 performs a self organizing incremental neural networks (SOINN) on the training database to obtain a training model. Specifically, the processor 140 treats all the normalized training track information vectors as input values of the self-organizing incremental neural network, and the self-organizing incremental neural network removes some of the noises, and These training track information vectors are automatically classified into one or more groups, and finally a training model is generated. The training model will include multiple nodes, and each node corresponds to a training trajectory information vector. Each node may include one or more edges, and two nodes connected by one edge belong to the same group. As shown in FIG. 9, if only the x coordinate and the y coordinate are considered, the training model can be projected into a two-dimensional representation 910. If only the x-direction velocity and the y-direction velocity are considered, the training model can be projected into a two-dimensional representation 920.

接下來,處理器140會根據訓練模型判斷前景物體是否為異常物體。具體來說,若處理器140要判斷一個第三前景物體是否為異常物體,則處理器140會取得第三前景物體的軌跡,並且取得此軌跡中的多個軌跡資訊向量。在此實施例中,每一個軌跡資訊向量的維度是4,其包括第三前景物體在某一時間(畫面)的x座標、y座標、x方向速度與y方向速度。因此,若第三前景物體出現在視訊資料中的n張畫面,則處理器140會取得n個軌跡資訊向量。Next, the processor 140 determines whether the foreground object is an abnormal object according to the training model. Specifically, if the processor 140 determines whether a third foreground object is an abnormal object, the processor 140 obtains a trajectory of the third foreground object and obtains a plurality of trajectory information vectors in the trajectory. In this embodiment, the dimension of each trajectory information vector is 4, which includes the x-coordinate, y-coordinate, x-direction velocity, and y-direction velocity of the third foreground object at a certain time (picture). Therefore, if the third foreground object appears in n pictures in the video material, the processor 140 obtains n track information vectors.

圖10是根據一實施例繪示軌跡資訊向量與訓練模型中節 點的示意圖。10 is a diagram showing a trajectory information vector and a section in a training model according to an embodiment. A schematic diagram of the point.

請參照圖10,在此假設訓練模型中至少包括了節點1001~1010,而第三前景物體的軌跡則包括了軌跡資訊向量1031~1033。處理器140會從訓練模型的節點中取得最靠近軌跡資訊向量1031~1033的節點(亦稱第一節點)。在此實施例中,處理器140是根據尤拉距離(Euclidean distance)來判斷節點與軌跡資訊向量之間的距離。例如,軌跡資訊向量1031是最靠近於節點1004,軌跡資訊向量1032是最靠近於節點1004,軌跡資訊向量1033是最靠近於節點1009。值得注意的是,節點1001~1010與軌跡資訊向量1031~1033都是四維的向量,為了方便說明起見,在此是用二維的圖形來說明尤拉距離。此外,處理器140會取得每一個軌跡資訊向量1031~1033與對應的節點之間的軌跡距離(即,軌跡距離1041~1043,在此也是用尤拉距離來計算)。Referring to FIG. 10, it is assumed that the training model includes at least nodes 1001 to 1010, and the trajectory of the third foreground object includes the trajectory information vectors 1031 to 1033. The processor 140 retrieves the node (also referred to as the first node) closest to the trajectory information vectors 1031 to 1033 from the nodes of the training model. In this embodiment, the processor 140 determines the distance between the node and the trajectory information vector based on the Euclidean distance. For example, track information vector 1031 is closest to node 1004, track information vector 1032 is closest to node 1004, and track information vector 1033 is closest to node 1009. It is worth noting that the nodes 1001~1010 and the track information vectors 1031~1033 are four-dimensional vectors. For convenience of explanation, the two-dimensional figure is used to illustrate the Euler distance. In addition, the processor 140 obtains the trajectory distance between each trajectory information vector 1031~1033 and the corresponding node (ie, the trajectory distances 1041~1043, which are also calculated by the 尤拉 distance).

處理器140還會取得節點1004的一個最遠鄰居。在此,最遠鄰居表示的是與節點1004相連,但與節點距離最遠的節點。例如,節點1003是節點1004的最遠鄰居。處理器140也會取得節點1003與節點1004之間的鄰居距離(即,節點1003與節點1004之間的尤拉距離)。同樣的,處理器140也會取得節點1009的最遠鄰居(即,節點1010),並且取得節點1009與節點1010之間的鄰居距離。Processor 140 also retrieves one of the farthest neighbors of node 1004. Here, the farthest neighbor represents the node that is connected to node 1004 but farthest from the node. For example, node 1003 is the farthest neighbor of node 1004. Processor 140 also takes the neighbor distance between node 1003 and node 1004 (i.e., the Euler distance between node 1003 and node 1004). Similarly, processor 140 will also take the farthest neighbor of node 1009 (ie, node 1010) and take the neighbor distance between node 1009 and node 1010.

處理器140會將這些軌跡距離1041~1043累加以產生一個累加距離。處理器140也會累加上述三個鄰居距離(對應節點 1004的鄰居距離會被累加兩次)以產生一累加鄰居距離。處理器140會比較此累加距離與此累加鄰居距離,以判斷第三前景物體是否為異常物體。The processor 140 will accumulate these track distances 1041~1043 to generate an accumulated distance. The processor 140 also accumulates the above three neighbor distances (corresponding nodes) The neighbor distance of 1004 will be added twice to generate a cumulative neighbor distance. The processor 140 compares the accumulated distance with the accumulated neighbor distance to determine whether the third foreground object is an abnormal object.

舉例來說,處理器140會將累加距離與累加鄰居距離的相減值,除以累加距離與累加鄰居距離的相加值,以產生一正規化距離,表示為以下方程式(4)。For example, the processor 140 divides the subtraction value of the accumulated distance from the accumulated neighbor distance by the added value of the accumulated distance and the accumulated neighbor distance to generate a normalized distance, expressed as the following equation (4).

R d =(D sum -T sum )/(D sum +T sum )………(4) R d =( D sum - T sum )/( D sum + T sum ).........(4)

Rd 為正規化距離,Dsum 為累加距離,並且Tsum 為累加鄰居距離。處理器140會根據正規化距離Rd 是否大於一個第一臨界值,來計算第三前景物體的一個異常次數,並且判斷此一異常次數是否大於一個第二臨界值。若異常次數大於第二臨界值,則處理器140會判斷第三前景物體為異常物體。這些步驟可以以下方程式(5)與(6)來表示。R d is the normalized distance, D sum is the accumulated distance, and T sum is the accumulated neighbor distance. The processor 140 calculates an abnormal number of times of the third foreground object according to whether the normalized distance R d is greater than a first threshold, and determines whether the number of abnormal times is greater than a second threshold. If the number of abnormalities is greater than the second critical value, the processor 140 determines that the third foreground object is an abnormal object. These steps can be expressed by the following equations (5) and (6).

C為異常次數,RT 為第一臨界值,CT 為第二臨界值,而變數AO係用以表示第三前景物體是否為異常物體。在此實施例中,第一臨界值RT 是介於0.6至0.8之間,但本發明並不侷限於此。C is the number of abnormalities, R T is the first critical value, C T is the second critical value, and variable AO is used to indicate whether the third foreground object is an abnormal object. In this embodiment, the first critical value R T is between 0.6 and 0.8, but the invention is not limited thereto.

圖11是根據一實施例所繪示異常物體偵測方法的流程圖。FIG. 11 is a flow chart showing a method for detecting an abnormal object according to an embodiment.

請參照圖11,在步驟S1102中,取得一視訊資料並從此視訊資料中分出多個前景物體。在步驟S1104中,追蹤這些前景物體以產生多個軌跡。在步驟S1106中,根據軌跡來判斷在第一畫面中,第一前景物體與其他的前景物體是否發生一重疊現象。Referring to FIG. 11, in step S1102, a video data is acquired and a plurality of foreground objects are separated from the video data. In step S1104, these foreground objects are tracked to generate a plurality of trajectories. In step S1106, it is determined according to the trajectory whether or not the first foreground object overlaps with other foreground objects in the first picture.

若步驟S1106的判斷結果為是,則在步驟S1108中,根據卡爾曼濾波器計算第一前景物體的預測位置。在步驟S1110中,對預測位置執行平均位移演算法以取得一偵測位置。在步驟S1112中,根據卡爾曼濾波器修正此偵測位置以取得一修正位置,並且根據修正位置更新對應於第一前景物體的軌跡。If the result of the determination in step S1106 is YES, then in step S1108, the predicted position of the first foreground object is calculated based on the Kalman filter. In step S1110, an average displacement algorithm is performed on the predicted position to obtain a detected position. In step S1112, the detected position is corrected according to the Kalman filter to obtain a corrected position, and the trajectory corresponding to the first foreground object is updated according to the corrected position.

若步驟S1106的判斷結果為否,則在步驟S1114中,根據斑點式追蹤演算法追蹤在第一畫面中的前景物體。If the result of the determination in step S1106 is NO, then in step S1114, the foreground object in the first screen is tracked according to the speckle-type tracking algorithm.

在步驟S1116中,根據這些軌跡來判斷前景物體是否為異常物體。In step S1116, it is judged based on these trajectories whether or not the foreground object is an abnormal object.

圖11中各步驟已詳細說明如上,在此便不再贅述。值得注意的是,圖11中的各個步驟可以實作為程式碼或是電路,本發明並不侷限於此。並且,圖11的流程可以單獨的實施,也可以配上述實施例來實施,本發明也不侷限於此。The steps in Fig. 11 have been described in detail above, and will not be described again here. It should be noted that the various steps in FIG. 11 may be implemented as a code or a circuit, and the present invention is not limited thereto. Further, the flow of FIG. 11 may be implemented alone or in combination with the above embodiments, and the present invention is not limited thereto.

綜上所述,本發明實施例所提出的異常物體偵測方法與使用此方法的電子裝置,可以利用卡爾曼濾波器與平均位移演算法來處理重疊現象,以準確地追蹤各個前景物體。並且,透過自我組織增量神經網路,可以準確地判斷一個前景物體是否為異常物體。In summary, the abnormal object detecting method and the electronic device using the method provided by the embodiment of the present invention can utilize the Kalman filter and the average displacement algorithm to process the overlapping phenomenon to accurately track each foreground object. Moreover, through the self-organizing incremental neural network, it is possible to accurately determine whether a foreground object is an abnormal object.

雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍當視後附的申請專利範圍所界定者為準。Although the present invention has been disclosed in the above embodiments, it is not intended to limit the present invention, and any one of ordinary skill in the art can make some changes and refinements without departing from the spirit and scope of the present invention. The scope of the invention is defined by the scope of the appended claims.

S1102、S1104、S1106、S1108、S1110、S1112、S1114、S1116‧‧‧步驟S1102, S1104, S1106, S1108, S1110, S1112, S1114, S1116‧‧ steps

Claims (16)

一種異常物體偵測方法,適用於一電子裝置,該異常物體偵測方法包括:取得一視訊資料並自該視訊資料區分出多個前景物體;追蹤該些前景物體以產生多個軌跡;根據該些軌跡來判斷在該視訊資料的一第一畫面中,該些前景物體中的一第一前景物體與其他該些前景物體的其中之一者,是否發生一重疊現象;若發生該重疊現象,則根據一卡爾曼濾波器計算該第一前景物體的一第一預測位置;對該第一預測位置執行一平均位移演算法,以取得一第一偵測位置;根據該卡爾曼濾波器來修正該第一偵測位置,以取得一第一修正位置,並且根據該第一修正位置來更新該些軌跡中對應於該第一前景物體的該軌跡;以及根據該些軌跡來判斷該些前景物體是否為異常物體。 An abnormal object detecting method is applicable to an electronic device, wherein the abnormal object detecting method comprises: acquiring a video data and distinguishing a plurality of foreground objects from the video data; and tracking the foreground objects to generate a plurality of tracks; The trajectory is used to determine whether an overlap between a first foreground object and one of the other foreground objects in a first picture of the video material occurs; if the overlap occurs, Calculating a first predicted position of the first foreground object according to a Kalman filter; performing an average displacement algorithm on the first predicted position to obtain a first detected position; and correcting according to the Kalman filter The first detecting position is used to obtain a first correcting position, and the trajectory corresponding to the first foreground object among the trajectories is updated according to the first modified position; and the foreground objects are determined according to the trajectories Whether it is an abnormal object. 如申請專利範圍第1項所述的異常物體偵測方法,其中對該第一預測位置執行該平均位移演算法以取得該第一偵測位置的步驟包括:取得該第一影像的一前景影像;以及以該第一預測位置為一起始點在該前景影像上執行該平均位移演算法,以取得該第一偵測位置。 The method for detecting an abnormal object according to claim 1, wherein the step of performing the average displacement algorithm on the first predicted position to obtain the first detected position comprises: obtaining a foreground image of the first image And performing the average displacement algorithm on the foreground image with the first predicted position as a starting point to obtain the first detected position. 如申請專利範圍第1項所述的異常物體偵測方法,其中追蹤該些前景物體以產生多個軌跡的步驟是根據一斑點式追蹤演算法來執行,該異常物體偵測方法還包括:若沒有發生該重疊現象,則根據該斑點式追蹤演算法追蹤在該第一畫面中的該些前景物體。 The method for detecting an abnormal object according to claim 1, wherein the step of tracking the foreground objects to generate a plurality of trajectories is performed according to a speckle tracking algorithm, and the abnormal object detecting method further includes: If the overlap does not occur, the foreground objects in the first picture are tracked according to the speckle tracking algorithm. 如申請專利範圍第1項所述的異常物體偵測方法,其中判斷是否發生該重疊現象的步驟包括:取得該第一畫面中的單一新前景物體;將該些前景物體與該新前景物體進行配對;若該些前景物體的至少其中之二者係配對於該單一新前景物體,則判斷該些前景物體的該至少其中之二發生該重疊現象。 The method for detecting an abnormal object according to claim 1, wherein the step of determining whether the overlapping phenomenon occurs comprises: obtaining a single new foreground object in the first picture; and performing the foreground object with the new foreground object Pairing; if at least two of the foreground objects are matched to the single new foreground object, determining that at least two of the foreground objects overlap. 如申請專利範圍第1項所述的異常物體偵測方法,其更包括:根據該些軌跡判斷在該第一畫面中,該些前景物體的一第二前景物體是否發生一消失現象;若發生該消失現象,則根據該卡爾曼濾波器來計算該第二前景物體的一速度,其中該視訊資料的一第二畫面係在該第一畫面之後,該第二畫面與該第一畫面相差n個畫面,並且n為正整數;將該正整數n與該速度相乘,來計算該第二前景物體在該第二畫面的一第二預測位置;以及若在該第二預測位置偵測到該第二前景物體,根據該第二預測位置來更新該些軌跡中對應於該第二前景物體的該軌跡。 The method for detecting an abnormal object according to claim 1, further comprising: determining, according to the trajectories, whether a second foreground object of the foreground objects has disappeared in the first picture; And the disappearing phenomenon, the speed of the second foreground object is calculated according to the Kalman filter, wherein a second picture of the video data is after the first picture, and the second picture is different from the first picture. a picture, and n is a positive integer; multiplying the positive integer n by the speed to calculate a second predicted position of the second foreground object in the second picture; and if the second predicted position is detected at the second predicted position The second foreground object updates the trajectory corresponding to the second foreground object among the trajectories according to the second predicted position. 如申請專利範圍第1項所述的異常物體偵測方法,其更包括;取得一訓練資料庫;對該訓練資料庫執行一自我組織增量神經網路,以取得一訓練模型,其中根據該些軌跡來判斷該些前景物體是否為異常物體的步驟,是根據該訓練模型所執行。 The method for detecting an abnormal object according to claim 1, further comprising: obtaining a training database; performing a self-organizing incremental neural network on the training database to obtain a training model, wherein The trajectory to determine whether the foreground objects are abnormal objects is performed according to the training model. 如申請專利範圍第6項所述的異常物體偵測方法,其中該訓練模型包括多個節點,該些前景物體包括一第三前景物體,對應於該第三前景物體的該軌跡係包括多個軌跡資訊向量,其中判斷該第三前景物體是否為異常物體的步驟包括:取得該些節點中最靠近每一該些軌跡資訊向量的一第一節點;取得每一該些軌跡資訊向量與對應的該第一節點之間的一軌跡距離;取得每一該些第一節點的一最遠鄰居,並且取得每一該些節點與對應的該最遠鄰居之間的一鄰居距離;累加該些軌跡距離以產生一累加距離,並且累加該些鄰居距離以產生一累加鄰居距離;以及比較該累加距離與該累加鄰居距離以判斷該第三前景物體是否為異常物體。 The abnormal object detecting method according to claim 6, wherein the training model includes a plurality of nodes, the foreground objects include a third foreground object, and the trajectory corresponding to the third foreground object includes a plurality of a trajectory information vector, wherein the step of determining whether the third foreground object is an abnormal object comprises: obtaining a first node of the nodes closest to each of the trajectory information vectors; obtaining each of the trajectory information vectors and corresponding a track distance between the first nodes; obtaining a farthest neighbor of each of the first nodes, and obtaining a neighbor distance between each of the nodes and the corresponding farthest neighbor; accumulating the tracks The distance is generated to generate an accumulated distance, and the neighbor distances are accumulated to generate an accumulated neighbor distance; and the accumulated distance is compared with the accumulated neighbor distance to determine whether the third foreground object is an abnormal object. 如申請專利範圍第7項所述的異常物體偵測方法,其中比 較該累加距離與該累加鄰居距離以判斷該第三前景物體是否為異常物體的步驟包括:將該累加距離與該累加鄰居距離的相減值,除以該累加距離與該累加鄰居距離的相加值以產生一正規化距離;根據該正規化距離是否大於一第一臨界值來計算該第三前景物體的一異常次數;判斷該異常次數是否大於一第二臨界值;以及若該異常次數大於該第二臨界值,則判斷該第三前景物體為異常物體。 Such as the method for detecting an abnormal object described in claim 7 of the patent scope, wherein The step of determining the third foreground object as an abnormal object by comparing the accumulated distance with the accumulated neighbor distance includes: subtracting the subtraction distance from the accumulated distance from the accumulated neighbor distance by dividing the accumulated distance and the accumulated neighbor distance Adding a value to generate a normalized distance; calculating an abnormal number of times of the third foreground object according to whether the normalized distance is greater than a first critical value; determining whether the abnormal number of times is greater than a second critical value; and if the abnormal number of times If the second threshold is greater than the second threshold, the third foreground object is determined to be an abnormal object. 一種電子裝置,包括:一記憶體,其係儲存多個指令;以及一處理器,其係用以執行該些指令以執行多個步驟:取得一視訊資料並自該視訊資料中區分出的多個前景物體;追蹤該些前景物體以產生多個軌跡;根據該些軌跡來判斷在該視訊資料的一第一畫面中,該些前景物體中的一第一前景物體,與其他該些前景物體的其中之一者是否發生一重疊現象;若發生該重疊現象,則根據一卡爾曼濾波器來計算該第一前景物體的一第一預測位置;對該第一預測位置執行一平均位移演算法以取得一第一偵測位置;根據該卡爾曼濾波器修正該第一偵測位置以取得一第一修正 位置,並且根據該第一修正位置來更新該些軌跡中對應於該第一前景物體的該軌跡;以及根據該些軌跡來判斷該些前景物體是否為異常物體。 An electronic device comprising: a memory for storing a plurality of instructions; and a processor for executing the instructions to perform a plurality of steps: obtaining a video data and distinguishing from the video data Tracking the foreground objects to generate a plurality of trajectories; determining, according to the trajectories, a first foreground object of the foreground objects in a first picture of the video material, and other foreground objects Whether one of the overlapping phenomena occurs; if the overlapping phenomenon occurs, calculating a first predicted position of the first foreground object according to a Kalman filter; performing an average displacement algorithm on the first predicted position Obtaining a first detection position; correcting the first detection position according to the Kalman filter to obtain a first correction Positioning, and updating the trajectory corresponding to the first foreground object among the trajectories according to the first modified position; and determining whether the foreground objects are abnormal objects according to the trajectories. 如申請專利範圍第9項所述的電子裝置,其中對該第一預測位置執行該平均位移演算法以取得該第一偵測位置的步驟包括:取得該第一影像的一前景影像;以及以該第一預測位置為一起始點在該前景影像上執行該平均位移演算法,以取得該第一偵測位置。 The electronic device of claim 9, wherein the step of performing the average displacement algorithm on the first predicted position to obtain the first detected position comprises: obtaining a foreground image of the first image; The first predicted position is a starting point to perform the average displacement algorithm on the foreground image to obtain the first detected position. 如申請專利範圍第9項所述的電子裝置,其中追蹤該些前景物體以產生多個軌跡的步驟,是根據一斑點式追蹤演算法所執行,該些步驟還包括:若沒有發生該重疊現象,則根據該斑點式追蹤演算法追蹤在該第一畫面中的該些前景物體。 The electronic device of claim 9, wherein the step of tracking the foreground objects to generate a plurality of trajectories is performed according to a speckle tracking algorithm, the steps further comprising: if the overlapping phenomenon does not occur And tracking the foreground objects in the first picture according to the speckle tracking algorithm. 如申請專利範圍第9項所述的電子裝置,其中判斷是否發生該重疊現象的步驟包括:取得該第一畫面中的一新前景物體;將該些前景物體與該新前景物體進行配對;若該些前景物體的至少其中之二者配對於該新前景物體,則判斷該些前景物體的該至少其中之二發生該重疊現象。 The electronic device of claim 9, wherein the step of determining whether the overlapping phenomenon occurs comprises: acquiring a new foreground object in the first picture; pairing the foreground objects with the new foreground object; And at least two of the foreground objects are associated with the new foreground object, and then the at least two of the foreground objects are determined to have the overlapping phenomenon. 如申請專利範圍第9項所述的電子裝置,其中該些步驟更包括: 根據該些軌跡判斷在該第一畫面中,該些前景物體的一第二前景物體是否發生一消失現象;若發生該消失現象,則根據該卡爾曼濾波器來計算該第二前景物體的一速度,其中該視訊資料的一第二畫面係在該第一畫面之後,該第二畫面與該第一畫面相差n個畫面,並且n為正整數;將該正整數n與該速度相乘,來計算該第二前景物體在該第二畫面的一第二預測位置;以及若在該第二預測位置偵測到該第二前景物體,則根據該第二預測位置來更新該些軌跡中對應於該第二前景物體的該軌跡。 The electronic device of claim 9, wherein the steps further comprise: Determining, according to the trajectories, whether a second foreground object of the foreground objects has a disappearing phenomenon in the first picture; if the disappearing phenomenon occurs, calculating a second foreground object according to the Kalman filter Speed, wherein a second picture of the video material is after the first picture, the second picture is different from the first picture by n pictures, and n is a positive integer; the positive integer n is multiplied by the speed, Calculating a second predicted position of the second foreground object in the second picture; and if the second foreground object is detected at the second predicted position, updating the corresponding one of the tracks according to the second predicted position The trajectory of the second foreground object. 如申請專利範圍第9項所述的電子裝置,其中該些步驟更包括;取得一訓練資料庫;對該訓練資料庫執行一自我組織增量神經網路以取得一訓練模型,其中根據該些軌跡判斷該些前景物體是否為異常物體的步驟,是根據該訓練模型所執行。 The electronic device of claim 9, wherein the steps further comprise: obtaining a training database; performing a self-organizing incremental neural network on the training database to obtain a training model, wherein The step of determining whether the foreground objects are abnormal objects is performed according to the training model. 如申請專利範圍第14項所述的電子裝置,其中該訓練模型包括多個節點,該些前景物體包括一第三前景物體,對應於該第三前景物體的該軌跡包括多個軌跡資訊向量,其中判斷該第三前景物體是否為異常物體的步驟包括:取得該些節點中最靠近每一該些軌跡資訊向量的一第一節點; 取得每一該些軌跡資訊向量與對應的該第一節點之間的一軌跡距離;取得每一該些第一節點的一最遠鄰居,並且取得每一該些節點與對應的該最遠鄰居之間的一鄰居距離;累加該些軌跡距離以產生一累加距離,並且累加該些鄰居距離以產生一累加鄰居距離;以及比較該累加距離與該累加鄰居距離以判斷該第三前景物體是否為異常物體。 The electronic device of claim 14, wherein the training model comprises a plurality of nodes, the foreground objects comprise a third foreground object, and the trajectory corresponding to the third foreground object comprises a plurality of trajectory information vectors, The step of determining whether the third foreground object is an abnormal object comprises: obtaining a first node of the nodes that is closest to each of the track information vectors; Obtaining a trajectory distance between each of the trajectory information vectors and the corresponding first node; obtaining a farthest neighbor of each of the first nodes, and obtaining each of the nodes and the corresponding farthest neighbor a neighbor distance between the two; accumulating the track distances to generate an accumulated distance, and accumulating the neighbor distances to generate an accumulated neighbor distance; and comparing the accumulated distance with the accumulated neighbor distance to determine whether the third foreground object is Anomalous object. 如申請專利範圍第15項所述的電子裝置,其中比較該累加距離與該累加鄰居距離,以判斷該第三前景物體是否為異常物體的步驟包括:將該累加距離與該累加鄰居距離的相減值,除以該累加距離與該累加鄰居距離的相加值,以產生一正規化距離;根據該正規化距離是否大於一第一臨界值,來計算該第三前景物體的一異常次數;判斷該異常次數是否大於一第二臨界值;以及若該異常次數大於該第二臨界值,則判斷該第三前景物體為異常物體。 The electronic device of claim 15, wherein comparing the accumulated distance with the accumulated neighbor distance to determine whether the third foreground object is an abnormal object comprises: adding the accumulated distance to the accumulated neighbor distance Offset, divided by the added value of the accumulated distance and the accumulated neighbor distance to generate a normalized distance; and based on whether the normalized distance is greater than a first critical value, an abnormal number of times of the third foreground object is calculated; Determining whether the abnormal number is greater than a second threshold; and if the abnormal number is greater than the second threshold, determining that the third foreground object is an abnormal object.
TW102102989A 2013-01-25 2013-01-25 Abnormal object detecting method and electric device using the same TWI505707B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW102102989A TWI505707B (en) 2013-01-25 2013-01-25 Abnormal object detecting method and electric device using the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW102102989A TWI505707B (en) 2013-01-25 2013-01-25 Abnormal object detecting method and electric device using the same

Publications (2)

Publication Number Publication Date
TW201431369A TW201431369A (en) 2014-08-01
TWI505707B true TWI505707B (en) 2015-10-21

Family

ID=51797117

Family Applications (1)

Application Number Title Priority Date Filing Date
TW102102989A TWI505707B (en) 2013-01-25 2013-01-25 Abnormal object detecting method and electric device using the same

Country Status (1)

Country Link
TW (1) TWI505707B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200333777A1 (en) * 2016-09-27 2020-10-22 Tokyo Electron Limited Abnormality detection method and abnormality detection apparatus
TWI737318B (en) * 2020-05-27 2021-08-21 禾瑞亞科技股份有限公司 Touch sensitive processing method, apparatus and touch system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI297660B (en) * 2004-11-29 2008-06-11 Compact Automation Products Llc Integrated pneumatic actuator and pump for dispensing controlled amounts of a fluid
US7929730B2 (en) * 2007-10-29 2011-04-19 Industrial Technology Research Institute Method and system for object detection and tracking
TWI351001B (en) * 2007-11-21 2011-10-21 Ind Tech Res Inst Method and apparatus for adaptive object detection
TWI353778B (en) * 2007-12-21 2011-12-01 Ind Tech Res Inst Moving object detection apparatus and method
TWI355615B (en) * 2007-05-11 2012-01-01 Ind Tech Res Inst Moving object detection apparatus and method by us

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI297660B (en) * 2004-11-29 2008-06-11 Compact Automation Products Llc Integrated pneumatic actuator and pump for dispensing controlled amounts of a fluid
TWI355615B (en) * 2007-05-11 2012-01-01 Ind Tech Res Inst Moving object detection apparatus and method by us
US7929730B2 (en) * 2007-10-29 2011-04-19 Industrial Technology Research Institute Method and system for object detection and tracking
TWI351001B (en) * 2007-11-21 2011-10-21 Ind Tech Res Inst Method and apparatus for adaptive object detection
TWI353778B (en) * 2007-12-21 2011-12-01 Ind Tech Res Inst Moving object detection apparatus and method

Also Published As

Publication number Publication date
TW201431369A (en) 2014-08-01

Similar Documents

Publication Publication Date Title
US10572736B2 (en) Image processing apparatus, image processing system, method for image processing, and computer program
JP5656567B2 (en) Video processing apparatus and method
US8995714B2 (en) Information creation device for estimating object position and information creation method and program for estimating object position
JP5701005B2 (en) Object detection apparatus, object detection method, surveillance camera system, and program
US20100322475A1 (en) Object area detecting device, object area detecting system, object area detecting method and program
WO2014156733A1 (en) People counting device, and people counting method
JP5921329B2 (en) Image processing apparatus, tracking object management method, and program
WO2014136623A1 (en) Method for detecting and tracking objects in sequence of images of scene acquired by stationary camera
KR20160020498A (en) Tracker assisted image capture
JP2015100066A5 (en) Imaging apparatus, image processing apparatus, image processing method, and program
JP2011170684A (en) Object tracking device, object tracking method and object tracking program
US9280703B2 (en) Apparatus and method for tracking hand
US20220028107A1 (en) Analysis apparatus, analysis method, and storage medium
CN109740416B (en) Target tracking method and related product
JP2007272436A (en) Object tracking device, abnormal state detector and object tracking method
EP2309454A2 (en) Apparatus and method for detecting motion
CN111798487A (en) Target tracking method, device and computer readable storage medium
JP7330708B2 (en) Image processing device, image processing method, and program
TWI505707B (en) Abnormal object detecting method and electric device using the same
JP2014110020A (en) Image processor, image processing method and image processing program
JP6799325B2 (en) Image correction device, image correction method, attention point recognition device, attention point recognition method and abnormality detection system
US11461597B2 (en) Object likelihood estimation device, method, and program
JP6558831B2 (en) Object tracking apparatus, method and program
JP5412984B2 (en) Follow target detection device, follow target detection method, and follow target detection program
TW201530495A (en) Method for tracking moving object and electronic apparatus using the same

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees