Moving Object Tracking Demo

<< Click to Display Table of Contents >>

Navigation:  STM32F4 Target > Demos > Standard Peripherals Demos > DCMI >

Moving Object Tracking Demo

Previous pageReturn to chapter overviewNext page

demo File:

1.ex04_target_fio2_acquire_image_demo.mdl
2.ex04_host_track_target_demo.mdl
3.ex05_target_fio2_track_object_demo.mdl
4.ex05_host_disp_image_demo.mdl

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:

1.Hardware in the Loop Test
2.Stand-alone Application Test

Hardware in the Loop Test

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.

camera_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.

ex04_target_fio2_acquire_image_demo

 

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/

ex04_host_track_target_demo

Stand-alone Application Test

 

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.

camera_running_in_realtime

The following figure shows Simulink model for the target. The moving object tracking algorithm runs in FiO 2 in real-time.

ex05_target_fio2_track_object_demo

 

The following figure shows the Simulink model running on the host PC. This model only receive image data and display on screen.

ex05_host_disp_image_demo

 

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.