200810558 九、發明說明: 【發明所屬之技術領域】 . 核明侧於影像触裝置追絲動物體之系統及方法,特別 ‘ 是_於種以具有全^向旋轉及魏(Pan-Tilt-Z_,PTZ)功能之攝影機 追縱移動物體之系統及方法。 【先前技術】 在銀行、大樓、商店及停車場等較高風險地區常可看見許多監視器針 對各種角度或位置進行監視錄影,在意外發生後往往需要藉助該些監視錄 影帶’從晝面巾尋找可能的蛛絲馬跡。然而—般監視器由於不具有追縱功 能’只能短暫拍攝到可疑人物經過時的晝面,可提供的資訊量少,因此具 有即時追蹤功能之監視系統遂因應而生。 即時追縱系統可大略分為使賴定式攝影機或非目定式攝影機兩類, 如J· Steffens所提出之期刊論文” pers〇nSp〇tter_fast and⑺⑹以 system for human detection,tracking and recognition” 即屬於使用 固定式攝影機之追蹤系統,其係使用固定之立體電荷耦合元件(stere〇 CCD) 一 攝影機擷取影像以進行人臉偵測、追蹤及辨認;J· Yang在期刊論文” a real-time face tracker”中使用PTZ攝影機進行人臉辨識則為另一類型 的例子。PTZ攝影機雖然具有全方向旋轉及變焦的功能,但目前仍未發展出 可同時具備上述功能之監視系統,多數使用PTZ攝影機之監視系統不是只 使用其旋轉功能就是只是使用變焦功能;而Β· Tunloff所提出 之 Reactive zoom control while tracking using an affine camera” 5 200810558 則是利用仿射投影(affine即咖出⑽)的轉換以達成變焦之目的,與ρτζ 攝影機的變焦原理基本上並不相同。 • 冑鑑於此,本發明係針對上述問題,提出-種使用ΡΤΖ攝影機之旋轉 與變焦功能以追蹤移動物體之系統及方法。 【發明内容】 本發明之主要目的係在提供一種使用ΡΤΖ影像娜裝置追縱移動物體 之系統及方法,使影像操取裝置可自動追縱畫面中的移動物體,並調整焦 距使移動物體在擷取的影像中具有適當大小。 本發明之另-目的係在提供一種使用ΡΤΖ影像操取裝置之監視系統及 方法’其中影像棘裝置可有效辨認畫面中的移動物體是否為人,並對移 射的人物進行追縱,當人臉影像過小或過大時,影像掏取裝置更可自動 調整焦距’提供清晰且解析度高之人臉影像。 為了達到上述目的,本發明係以一處理器比對一 ρτζ影像擷取裝置所 娜之目前影像與—先前影像,以狀出畫面中的移動物體,並依移動物 體之位置旋轉影像操取裳置,以追縱移動物體,在移動物體進入影像娜 裝置之變紐_,且軸碰在畫面巾過錢過大時,處理器 可調整影軸取裝置之紐,使雜浦在影像巾所佩例適當。 底下藉由具體實_配合所_圖式詳加·,#更容嫌解本發明 之目的、技術内容、特點及其所達成之功效。 【實施方式】 本發明主要可分為伽极魏㊉部分,ρτζ^_取裝置所娜之畫面 6 200810558 傳运至追她組後,由追轉組中之處理器制畫面中是否出現移動物 體,並控制影像擷取裝置進行相應之旋轉以追縱移動物體,且當移動物體 位於衫像擷取裝置的變焦範圍内時,處理器更可依需求,例如移動物體的 拍攝影像過小f要放A,或是影像社需要縮小,輕影細取裝置的焦 距,以獲得移動物體的清晰影像。 因此本《明之使用pTZ影像擷取裝置追縱移動物體之系統係包括一可 王方向疑轉及fef、之影像擷取裝置以及—追賴組,第m统一實施 例之結構方顧,其中影像操取裝置健用一 PTZ攝影機1G,而攝影機10 斤娜之〜像係透過一放大器22傳輸至一顯示器以,顯示於顯示器24之 螢幕上明同日可參考第二圖之一實施例流程圖,在步驟训巾,追縱模組 32中之解碼器12將攝影機1〇所擷取影像之複合影像廣播訊號(⑽幻解碼 並傳送至處理器14,由處理器1娜卿像進行降頻取樣(dQWn sampl ing) 、降低貝料里’如第二圖所示,解析度·261之影像經過取樣後解析度 降為120x87,接著步驟S12中,處理器14比較取樣後之目前影像與同樣經 過取樣且贿於記憶體16中之—先細象,得出—灰階(謂之差 異影像,第四(a)圖至第四(c)圖係顯示經過步驟犯之處理後,得到目前 〜像與先别影像之差異影像的結果,其中第四(a)為目前影像,第四(_ 為先前影像,第四⑹_差異影像;再將差異影像輸人—濾波器,如步驟 幻4所不將差異影像中每一像素(pixel)值與一臨界值比較,高於該臨界 值之像素即視為移_,其餘則為靜止點,因此濾波器之輸出為—二元 (inary)&像μ 〇代表靜止點,’丨’代表移動點,如第四⑷圖所示。 7 200810558 步驟S16依據在步驟S14中判斷出之移動點座標,界定出移動物體, 更了如第五圖所示,於目前影像巾擷取出移動物體的影像,其中處理器Μ • 係找出移動點在影像X軸之最小«(xstart)、最大座標(XstQp)、在γ軸 ^ 之最小座軚(Ystop)及最大座標(Ystart),定義出以(红姐,、 (Xstart,Ystart)、(xstop,Ystart)及(Xst〇p,Yst〇p)為端點之長方形區 域,對應至目前影像,該長方形區域即為移動物體之位置。 本發明可用於追縱任何出現於晝面中之移動物體,或是只追縱特定之 移動物體,當追縱模組32 +已預設有欲追縱物體之模型時,處理器Μ會 進v比對初夕動物體與預設於記憶體12中之欲追縱物體模型,如步驟Mg 所不’以判斷_動物體是否為欲追蹤物體;以追蹤人縣例,由於人的 下半身主要由腿部構成,而腿部影像常因走動等動作而魏,不易以固定 狀辨識□此本發明係採用頭部及上身部作為比對辨識之依據,並以擴 圓模擬,如第六圖所示,且由於人體結構中,頭部、上身部及下身部之比 例、力為1 · 3 · 4,故處理器μ係依比例擷取移動物體對應於頭部及上身部 之細’與模擬頭部及上身部之橢圓比對,計算與橢圓之差值,計算之公 式係如式(1)所示: B-\ B-\ 5释,少)=Σ Σ k(叫,少+y) - w)| (η 7=0 /=0 1 、’ 其中Kx,y)為移動物體影像,T(i,〕·)為欲追縱物體模型,於本實施例中為 第,、圖所不之影像,模型影像之大小為BxB ;若差值(即SAD(x,y)值)小於 一臨界值關_移動物體為人,其幅擬頭部之姻可由式⑵表示,模 擬上身部之橢圓可以式(3)表示: 8 200810558 -~Η〇-〇〇)ί (y^d\2 X — ίίί <4 + 1.44 1.44 (2) 2200810558 IX. Description of the invention: [Technical field of invention] The system and method for verifying the side of the image-touching device to trace the animal body, especially 'is _ to have a full-rotation and Wei (Pan-Tilt-Z_ , PTZ) function camera tracking system and method of moving objects. [Prior Art] Many monitors are often seen in high-risk areas such as banks, buildings, shops, and parking lots for surveillance and video recording at various angles or locations. After the accident, it is often necessary to use these surveillance videos to find out from the face towel. The clues. However, the general monitor has no tracking function. It can only take a short shot of the suspicious person passing through, and the amount of information that can be provided is small. Therefore, the monitoring system with instant tracking function is born. The instant tracking system can be roughly divided into two types, the Lai Ding camera or the non-target camera. For example, the journal paper by J. Steffens "pers〇nSp〇tter_fast and (7) (6) is used for system for human detection, tracking and recognition" Camera tracking system that uses a fixed stereo charge coupled device (stere CCD) to capture images for face detection, tracking and recognition; J. Yang in the journal paper "a real-time face tracker" The use of a PTZ camera for face recognition is another type of example. Although the PTZ camera has the function of omnidirectional rotation and zooming, it has not yet developed a monitoring system that can simultaneously have the above functions. Most monitoring systems using PTZ cameras do not use only their rotation function or just use the zoom function; and Tun· Tunloff The proposed Reactive zoom control while tracking using an affine camera” 5 200810558 uses the affine projection (affine (10)) conversion to achieve the purpose of zooming, which is basically the same as the zoom principle of the ρτζ camera. In view of the above, the present invention has been made in view of the above problems, and proposes a system and method for tracking a moving object using a rotation and zoom function of a camera. SUMMARY OF THE INVENTION The main object of the present invention is to provide a device for tracking images using a video camera. The system and method for moving an object enables the image manipulation device to automatically track the moving object in the picture and adjust the focal length so that the moving object has an appropriate size in the captured image. Another object of the present invention is to provide a use ΡΤΖ Surveillance system and method for image manipulation device The spine-like device can effectively recognize whether the moving object in the picture is a human being, and track the moving person. When the face image is too small or too large, the image capturing device can automatically adjust the focal length to provide clear and high resolution. In order to achieve the above object, the present invention compares the current image and the previous image of a ρτζ image capturing device with a processor to shape the moving object in the picture and according to the position of the moving object. Rotating the image to capture the skirt, to track the moving object, when the moving object enters the image of the device, and the axis touches the screen towel too much money, the processor can adjust the button to take the device to make the pump Appropriately in the image towel. The purpose of the present invention, the technical content, the features and the effects achieved by the present invention are more ambiguous. Mainly can be divided into gamma Wei ten parts, ρτζ^_ take the device of the screen 6 200810558 After being transported to chase her group, whether there is a moving object in the processor system in the chasing group, and control the image The device rotates to track the moving object, and when the moving object is located within the zoom range of the shirt image capturing device, the processor can further display the image according to the demand, for example, the moving image is too small, or the image is displayed. The society needs to zoom out, and take a close look at the focal length of the device to obtain a clear image of the moving object. Therefore, the system of using the pTZ image capturing device to track the moving object includes a video of the suspicion of the king and the image of the fef. Taking the device and the tracking group, the structure of the m-th unified embodiment, wherein the image capturing device uses a PTZ camera 1G, and the camera 10 is transferred to a display through an amplifier 22 to display On the screen of the display 24, reference may be made to the flowchart of the embodiment of the second figure. In the step of training, the decoder 12 in the tracking module 32 will capture the composite image broadcast signal of the image captured by the camera ((10) The magic decoding is transmitted to the processor 14, and the processor 1 Naqing image is subjected to down-sampling (dQWn sampling), and the image is reduced. As shown in the second figure, the image of the resolution 261 is sampled and solved. The degree is reduced to 120x87. Then, in step S12, the processor 14 compares the sampled current image with the same sampled and bribed in the memory 16 to obtain the gray scale (that is, the difference image, the fourth (a ) Figure 4 to Figure 4 (c) shows the result of the difference between the current image and the image of the first and second images after the process of the step, where the fourth (a) is the current image and the fourth (_ is the previous image, The fourth (6)_difference image; then the difference image input-filter, such as step magic 4 does not compare the pixel value of the difference image with a threshold value, the pixel above the threshold value is regarded as Shift_, the rest is a stationary point, so the output of the filter is - binary (inary) & like μ 〇 represents the stationary point, and '丨' represents the moving point, as shown in the fourth (4). 7 200810558 Step S16 defines a moving object according to the coordinates of the moving point determined in step S14, and as shown in the fifth figure, the image of the moving object is taken out in the current image frame, wherein the processor detects the movement The minimum «(xstart), the maximum coordinate (XstQp), the minimum coordinate (Ystop) and the maximum coordinate (Ystart) of the X axis of the image are defined as (Red sister, (Xstart, Ystart), (xstop, Ystart) and (Xst〇p, Yst〇p) are rectangular regions of the end point corresponding to the current image, and the rectangular region is the position of the moving object. The present invention can be used to trace any occurrences in the kneading surface. Moving an object, or only tracking a specific moving object, when the tracking module 32+ has a model for the object to be traced, the processor will enter the v-matching of the early-night animal body and preset to the memory. In the 12th, the object model is to be traced, such as the step Mg does not determine whether the animal body is the object to be tracked; to track the case of the county, since the lower body of the person is mainly composed of the leg, and the leg image is often caused by walking, etc. Action and Wei, it is not easy to identify with a fixed shape The invention adopts the head and the upper body as the basis for the comparison identification, and simulates the expansion, as shown in the sixth figure, and because of the proportion of the head, the upper body and the lower body, the force is 1 · 3 · 4, so the processor μ is proportional to the ellipse of the moving object corresponding to the head and upper body and the ellipse of the simulated head and upper body, and the difference between the ellipse and the ellipse is calculated. 1) shown: B-\ B-\ 5 release, less) = Σ Σ k (called, less + y) - w)| (η 7 = 0 / = 0 1 , 'where Kx, y) is a moving object The image, T(i,]·) is the model of the object to be traced. In this embodiment, the image of the image is not the image of BxB; if the difference is (the value of SAD(x, y)) ) is less than a critical value off _ moving object is a person, the marriage of the head can be expressed by the formula (2), the ellipse simulating the upper body can be expressed by the formula (3): 8 200810558 -~Η〇-〇〇) ί (y^ d\2 X — ίίί <4 + 1.44 1.44 (2) 2
Add Vy γή dds - + - 2.56 dd: τ <4 dd + 2.56 dd\ (3) 其中W為上身部之寬,(〇_〇〇)為頭部之寬,d為頭部之直徑,此為上身 部之直徑。 右移動物體經處理器14判斷為欲追縱物體,則進入下一步驟s2〇,控 制PTZ攝影機10的旋轉以對移動物體進行追縱,其中處理器μ係透過其 内部之通用非同步收發埠(_及《介面18連結至-驅動馬達20, 以驅動馬達2__丨_轉。在—實施财,攝影機Μ之擷取畫 面係區分為16區塊’如第七_示,區塊大小則可由制者自訂,當欲追 縱物體出現於某些區塊,例如區塊,〇,、區塊,Γ、_ 2,、e L3往^處理器14發送控制訊號至驅動馬修以適當的速度將攝影 :轉,細__軸賴w糊 ㈣目嶋與輸像,賴細 " 制攝影㈣進行相應之旋轉,其係對二_進行掃描,=向,《控 之畫素時,代表該畫素為-移動點,如第八(_所:,此:=到等於> ,峨前謝以 對基準,與第八咖之目前影綱移動._ 對’在該心㈣晰細叫物第:、 200810558 矩陣最級3x3 _,接恤聽最符合⑽轉之中心座 “與該移動點座標,即可得出該移動點之移動方向移動方向可能是上、 右、左上、右上、咖㈣術向;在輸統計二元影 像中母一移動點之軸方向後,最多的軸方向㈣斷為鶴物體之移動 方向,而處理器u即依照此判斷之移動方向控制攝影機iq旋轉,以追縱 移動物體,例如當錄移動點為向左移動時,攝影機iq之相應旋轉方向即 為向左旋轉,以維持移動物體於監視範圍内。 在移動物體進人攝則G之魏(咖)_,轉缝體於影像中 所佔比例小於或大於使用者設定之範圍時,處理器14可控麵影㈣自 動調整焦距使移動物體在揭取影像中所佔比例適當如步驟微所示。表 -為以四階段調整攝影機10焦距之一實施例,處理器首先依第一階段之預 設值調整攝織H)之驗,並_整完紐触確認移祕·影像中所 佔之比例是否符合設定範圍,若是則停止機,若㈣進人下—階段,以 第二階段預設值再次調整攝影機1G之焦距,以此類推,直到移動物體所伯 比例適當為止。因此當本㈣使祕—監視系猶,可有效辨認影像中的 移動物體是轉人,並可對移射的人物進行親,且#人臉影像過小或 過大時’更可自動調整焦距’提供清晰且解析度高之人臉影像。 表一 拉近(zoom-in)時之 焦距(mm) 拉遠(zoom-out)時之 焦距(mm) 第一階段 4. 65 3.1 10 200810558Add Vy γή dds - + - 2.56 dd: τ <4 dd + 2.56 dd\ (3) where W is the width of the upper body, (〇_〇〇) is the width of the head, and d is the diameter of the head. It is the diameter of the upper body. When the right moving object is determined by the processor 14 to track the object, the process proceeds to the next step s2, and the rotation of the PTZ camera 10 is controlled to track the moving object, wherein the processor μ is transmitted through the internal non-synchronous transceiver. (_ and "Interface 18 is connected to - drive motor 20 to drive motor 2__丨_ turn. In the implementation of the money, the camera captures the picture is divided into 16 blocks" as shown in the seventh, the block size is Can be customized by the manufacturer, when the object to be traced appears in certain blocks, such as block, 〇, block, Γ, _ 2, e L3 to ^ processor 14 to send control signals to drive Matthew to appropriate The speed will be photography: turn, fine __ axis w w paste (four) witness and lose image, rely on " system photography (four) to carry out the corresponding rotation, the system is to scan the second _, = direction, "control of the prime time , representing the pixel as a moving point, such as the eighth (_::, this: = to equal to >, 峨 谢 以 对 对 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准 基准Clearly called the first:, 200810558 matrix level 3x3 _, the best listening to the (10) turn center block "with the moving point coordinates, you can get this The moving direction of the moving point may be the upper, right, upper left, upper right, and coffee (4) directions; after the axis of the moving point in the binary image, the most axis direction (4) is the moving direction of the crane object. The processor u controls the camera iq to rotate according to the determined moving direction to track the moving object. For example, when the moving point is moved to the left, the corresponding rotating direction of the camera iq is rotated to the left to maintain the moving object. Within the scope of monitoring. When the moving object enters the camera, G is Wei (coffee) _, when the proportion of the swivel body in the image is smaller or larger than the range set by the user, the processor 14 can control the face shadow (4) to automatically adjust the focal length. The proportion of the moving object in the uncovered image is as shown in the step. Table - is an embodiment in which the focal length of the camera 10 is adjusted in four stages, and the processor first adjusts the woven fabric H) according to the preset value of the first stage. Check, and _ complete the touch to confirm whether the proportion of the secret and image in the image meets the set range, if it is, then stop the machine, if (4) enter the next stage, adjust the focal length of the camera 1G again with the preset value of the second stage, This kind of push, until the proportion of the moving object is appropriate. Therefore, when the (4) secret-monitoring system is used, it can effectively recognize that the moving object in the image is a transfer person, and can perform the kiss on the transferred person, and #人脸影像When the size is too small or too large, 'Automatically adjust the focus' to provide a clear and high-resolution face image. Table 1 Zoom-in focal length (mm) Zoom-out focal length (mm) The first stage 4. 65 3.1 10 200810558
此外’如第一圖所不,追縱模組32具有一重置(reset)電路26,在處 理器14 +正鍵作或因老化等因素使設定狀態可能改變時,重置電路邡 可重新啟動處理器14使系統得以恢復正常運作,並附有調整按紐28,使用 者可經由調整胁28機臨界值之設定,關整追賴靈敏度 ,而為了防 止系統軟體被破解或峨遭盜改,—加密(·γρΐί〇η)·3()係連接至處 理器14對處理☆ 14的訊號進行加密。其巾追蹤模組32可直接整合於攝 汾機ίο中’或内建於-電腦’亦可獨立作為一裝置’外接於攝影機1〇上。 第九圖至第十圖係顯示本發明之追縱效能,從第九圖可以看出,ρτζ攝 影機10跟隨著出現於畫面中的移動人物旋轉其拍攝角度,並自動調整焦距 將臉部影像放大’如圖片中紅框部分所示;而第十圖中,移動物體為一張 椅子,經處職難對她^符合式⑵及式⑶之麵,因此攝影機1〇 並不會跟隨賴巾賴子_或變焦。@此本判經過實紐明可有效進 行侧及追蹤’使麟監„鱗,更可自動提供清概騎度高之人臉 影像以供辨認。 以上所述係藉由實施例說明本發明之絲处 之H其目的在使熟習該技術者 能暸解本發明之内容並據以實施,而非限定太 X月之專利範圍,故,凡其 他未脫離本發剩齡之精制完成之粒修料修改,減包含在以下 200810558 所述之申請專利範圍中。 【圖式簡單說明】 第一圖為本發明系統一實施例之結構方塊圖。 第一圖為本發明一貫施例之流程圖。 第二圖為本發明對掏取影像進行降頻取樣之示意圖。 第四(a)圖至第四⑷圖為本發簡由比對先前影像 a 、引衫m仔出一移動 點與靜止點之二元影像之示意圖。 第五圖為本發明藉由躺移動點座標娜移動物體影像之示音圖 第六圖為本發明以橢圓模擬人型之頭部與上身部之示音固· 第七圖為本發明影像擷取裝置之擷取晝面以區塊分割之示意圖。 第八⑷圖至第八⑹圖為本發明判斷移動點之移動方向的過程示意圖。 取移動人物臉部之影像。 第九圖為監視範圍内出現移動人物時,本發明之ρτζ攝影機自動2並操 第十圖為以椅子作為移動物體時【主要元件符號說明】 10 ΡΤΖ攝影機 12解碼器 本發明之ΡΤΖ攝影機的拍攝影像。 14處理器 16記憶體 18 RS-485 介面 20驅動馬達 12 200810558 22放大器 24顯不裔 26重置電路 28調整按鈕 30加密電路 32追蹤模組In addition, as shown in the first figure, the tracking module 32 has a reset circuit 26, and the reset circuit can be restarted when the processor 14+ is being pressed or the setting state may be changed due to aging or the like. The processor 14 is activated to resume normal operation, and an adjustment button 28 is attached. The user can adjust the threshold of the alarm to adjust the tracking sensitivity, and to prevent the system software from being cracked or stolen. - Encryption (·γρΐί〇η)·3() is connected to the processor 14 to encrypt the signal processed ☆ 14. The towel tracking module 32 can be directly integrated into the camera ’ or built into the computer or can be used as a device to externally connect to the camera. The ninth to tenth views show the tracking performance of the present invention. As can be seen from the ninth figure, the ρτζ camera 10 rotates its shooting angle following the moving person appearing in the picture, and automatically adjusts the focal length to enlarge the facial image. 'As shown in the red box in the picture; and in the tenth picture, the moving object is a chair, and it is difficult for her to meet the faces of (2) and (3). Therefore, the camera does not follow the towel. _ or zoom. @本本判经实纽明 can effectively carry out the side and track the 'Linshijian' scales, and can automatically provide a high-capacity human face image for identification. The above description illustrates the invention by way of examples. The purpose of the yarn is to enable the person skilled in the art to understand the contents of the present invention and implement it according to the scope of the patent of the X-month. Therefore, other refined materials which have not been removed from the remaining age of the present invention. The following is a block diagram of an embodiment of the system of the present invention. The first figure is a flow chart of a consistent embodiment of the present invention. The second figure is a schematic diagram of the down-sampling of the captured image according to the present invention. The fourth (a) to fourth (4) diagrams of the present invention are compared with the previous image a, and the drawing point is a moving point and a stationary point. The fifth figure is a sound diagram of the moving object image by the lying point of the present invention. The sixth figure is the elliptical simulation of the head and upper body of the human body. The selection of the image capturing device of the present invention The figure is divided into blocks. The eighth (4) to eighth (6) drawings are schematic diagrams of the process of judging the moving direction of the moving point according to the invention. The image of the moving person's face is taken. The ninth picture shows the moving person in the monitoring range. The ρτζ camera of the invention automatically performs the tenth figure when the chair is used as a moving object [Description of main component symbols] 10 ΡΤΖ Camera 12 decoder The captured image of the camera of the present invention. 14 Processor 16 Memory 18 RS-485 interface 20 drive motor 12 200810558 22 amplifier 24 display 26 reset circuit 28 adjustment button 30 encryption circuit 32 tracking module