Moving Object Tracking Demo
This project shows how to design a real-time moving object tracking algorithm in Matlab / Simulink. It also shows how to use Waijung to generate source code and run the algorithm in STM32F4 MCU in real-time. Image data is transmitted to the host PC to visualize algorithm performance via UDP protocol.
The algorithm design is performed in two steps:
The first step we program FiO 2 board (STM32F417IG + external 8Mb SRAM) to acquire image data (resolution 120 x 160 pixels) and send to the host PC via LAN (UDP protocol). The following show hardware setup.
The following figure shows a Simulink model for the target. This model programs FiO 2 to acquire image data and send to the host PC via UDP protocol in real-time.
The following figure shows Simulink model for the host PC. This model perform object tracking algorithm. In this way, it is very simple to visualize results, analyze performance, and tune the algorithm.
For background information on the algorithm visit http://aimagin.com/blog/basic-image-processing-object-tracking/
In this step, the algorithm is moved to run in the FiO 2 board. The detected target XY positions are overlayed on the image using Simulation Computer Vision System Blockset. The resulting image is transmitted to the host PC to display in real-time (around 5Hz update rate). The following summarized necessary steps to make it work in real-time (compare with an ideal algorithm design running in pure Simulation simulation on the host PC).
|1.||The Gaussian filter was not implemented. Since it put heavy computation load on the MCU.|
|2.||The XY position determination was redesigned to reduce execution time.|
The following figure shows hardware setup.
The following figure shows Simulink model for the target. The moving object tracking algorithm runs in FiO 2 in real-time.
The following figure shows the Simulink model running on the host PC. This model only receive image data and display on screen.
The following video shows results from running the test. Notice that algorithm can run at around 5Hz frame rate. Not extremely impressive, but sufficient for introductory courses.