本文主要研究如何利用簡單的影像處理技術,在軟硬體協同設計的概念下,以FPGA實現一個動態物體的偵測及追蹤系統。為了實現大範圍區域中的影像偵測與追蹤,本系統架設一台可做水平及俯仰移動之攝影機,設法控制此機構在環境中移動搜尋,以各種視角記錄環境的影像資訊。接著比較已記錄的環境影像與目前拍攝的影像,藉此計算出影像差異,偵測是否有物體入侵。當偵測到物體入侵時,再進行移動偵測(Motion Detection),方法為對連續兩張影像使用影像相減,求出物體在影像中最可能的移動區域;同時,彩色影像也由RGB轉換為HSV格式,再計算出區域內面積最大的顏色當作目標特徵。如此即可將目標色彩與其它色彩分離出來,並控制水平俯仰機構追蹤該目標。 本研究使用DE2-70發展板做為硬體平台,其配置有Altera Cyclone II 2C70的FPGA晶片,並以Verilog硬體描述語言進行硬體電路設計,來實現上述方法。系統主要的電路為影像處理電路、硬體周邊電路及影像分流電路。影像分流電路,會先將攝影機拍攝到的影像儲存到SDRAM的資料緩衝區,再由影像處理電路及SD卡分別從資料緩衝區讀取影像資料。另外,當系統鎖定追蹤目標時,會啟動系統的安全機制,如播放警報聲、將影像儲存至SD卡及透過GSM模組發送簡訊給預設的手機。完成之系統經實際測試證實,能達到偵測與追蹤移動物體的設計目標。
This thesis focuses on how to use simple image processing techniques to realize a dynamic object detecting and tracking system on a FPGA, by following the hardware and software co-design concept. In order to realize a large area of image detection and object tracking, we try to mount a camera on a 2-dimentional rotation machinery first and then to do mobile search in the environment by controlling the rotation machinery. The image information is recorded by every angle of view; then, comparing record images and present shoot images for calculating image differences and detecting any intrusion objects. When any intrusion objects are detected, the system will process motion detection. We apply two continuous images to do image differencing and figure out the most possible moving area of objects in the images. At the same time, color images are transformed from RGB to HSV format. Afterward, the biggest color area can be counted as the characteristic of target. In this way, the target color is separated from other colors and to control the 2-dimentional rotation machinery for tracking the target. This research utilizes DE2-70 development board as the hardware platform. The board is equipped with a FPGA chip (Altera Cyclone II 2C70) in which hardware circuits are designed by using verilog HDL to carry out the motion detection and object tracking. The system includes an image processing circuit, a peripheral circuit, and an image shunt circuit. The image shunt circuit stores the image shot by the camera to the data buffer of SDRAM first. Then, the image processing circuit and SD card image data read from the data buffer individually. In addition, when the system locking the tracking target, the security mechanism would be started, like sounding the alarm, storing the images to SD card and sending the message to assigned mobile phones through GSM module. The resulting system has been experimentally proven that it satisfies the goal of detecting and tracking objects.