Computer experiment
In this problem, we use a particle filter to solve a nonlinear-tracking problem in computer vision An object that is made up of 5 X 5 pixels moves along a trajectory defined by the following pair of equations:
![2090_16aba7fc-d272-47dc-8370-da8310ac1615.png](https://secure.tutorsglobe.com/CMSImages/2090_16aba7fc-d272-47dc-8370-da8310ac1615.png)
where xn and yn are the image coordinates for step n and N is the total number of frames. The scene of size 300 X 300 pixels is visualized in Fig. P14.21. The white background area is divided by four equally spaced bars of height h = 10 pixels in black, which indicate the foreground areas. The object can be distinguished by its red color.
(a) Simulate the trajectory shown in light red as an image sequence using N = 150 frames. Make sure to show the object if it moves over background areas and to hide it if it is occluded by foreground areas.
![2388_f9de038e-7641-426b-93f8-22d0028a91e5.png](https://secure.tutorsglobe.com/CMSImages/2388_f9de038e-7641-426b-93f8-22d0028a91e5.png)
(b) Using the simulated data as input, implement a particle filter to track the object. In areas where the object is visible, you can use the color information to get a position measurement, but where it is occluded, you have to rely on the filter estimates. What assumptions do you need to make when setting up the state-space model? Visualize the true and estimated trajectory in the scene
(c) Now continually increase the height h of the foreground areas for different trials. Explain the trade-off necessary to keep track of the object throughout the image sequence. What influence do the frame rate and the number of particles have?
(d) The information gathered during this tracking process can be used to estimate foreground and background parts of the scene-that is, to get the depth of the object relative to the parts it interacts with. Discuss possible approaches to this task.