Adding a new dimension to the filters

Till here, you should have started realizing the importance of temporal information in videos. Further using it in deinterlacing tasks, temporal information can be combined with spatial information to filter video frames. Some of the spatial filters, which we have already seen in previous chapters, as well as in this one, can easily be expanded in more dimensions, so that we include temporal information as well. In this section, we will see some of them.

Spatiotemporal averaging filter

A really straightforward to implement, spatiotemporal filter, is the averaging one. Applying it to a video is not so complicated, provided that you have understood the basics of image filtering. To demonstrate the process, we will use grayscale video streams.

The algorithmic description of the process of performing spatiotemporal averaging to a grayscale video is given by these following steps:

  1. Define the neighborhood for filtering in terms of rows x columns x frames.
  2. Decide what will happen in borders (if you will be padding or not).
  3. Start the filtering process using three for loops (one for the rows, one for the columns, and one for the frames).

Let's see how we can implement this process.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset