0

I want to track moving people in real-time by an SoC, so I use simple frame differencing(Image(n)-Image(n-1)) for extracting the foreground objects because of its low computational overhead. After extracting the foreground, matching is used to find the object. The approach works well in the most cases. However, there are two conditions which cause discontinuous edges and fail the matching:

  1. when people move slowly,
  2. when people have the color(or intensity, in more accurate way) similar to the background.

I have tried to lower the threshold of frame differencing, but it induces other unwanted edges and thickens edges too much. I also tried dilation and closing. Edges were more continuous, but still not continuous enough for getting the successful matching.

So I am wondering if there is a way of low computational overhead to overcome these discontinuous edges so that the matching can work smoothly? Any suggestions or comments would be immensely appreciated.

williamCV
  • 41
  • 5
  • I guess you do image difference such as `abs(I1 - I2) < threshold`. This threshold penalizes linearly color differences. You can try applying a [gaussian kernel](https://en.wikipedia.org/wiki/Radial_basis_function_kernel) to your distance functions: `exp(- ||I1 - I2|| / sigma^2) > threshold`. This penalizes non-linearly the differences, making it exponentially more expensive the more they differ. – Imanol Luengo Aug 07 '15 at 15:35
  • @imaluengo I do use `abs(I1 - I2) < threshold`. Also I have tried gaussian kernel as you suggest, but it seems no help. Actually, I don't quite follow your logic why to use gaussian kernel can improve the problem of discontinuous edges. Could you expand on it a little bit? – williamCV Aug 11 '15 at 08:02
  • This depends in some factors (including if your image is floating point or integer), but, as an example... the cost of the `abs` differences is linear, from `0..N` where N is your maximum intensity. Thus, is quite hard to pick a hard threshold there.. The RBF kernel however calculates the similarity between 2 sampels, in the range `[0, 1]` and makes it decrease exponentially. This means, 2 identical objects will have a score of 1, if they are sightly similar the cost will slowly decrease to `0.9` and then, the more different they are, the fastest the score turns to 0 (making a gaussian curve) – Imanol Luengo Aug 11 '15 at 09:17
  • Thus, is safer to pick a hard threshold there (such as similarity `>0.8`), for example. This however requires sightly more tuning, and maybe in your case (since we don't have much information) is not that useful, but as an example, it allows to remove small noise when calculating image gradients for denoising as very different objects have an score of `0` instead of having a very large linearly increasing value. In general, non-linear kernels offer more flexibility, see [this example](http://sebastianraschka.com/Images/2014_kernel_pca/linear_vs_nonlinear.png) for classification. – Imanol Luengo Aug 11 '15 at 09:21

1 Answers1

0

Frame differencing accumulation should improve this.

For example, if I_Diff(n)= [abs(I(n)-I(n-1))>threshold], thenI_Acc(n)=(I_Diff(n) || I_Diff(n-1) ).

Of course, you can accumulate three or more I_Diff to see if the results are better for your application.

williamCV
  • 41
  • 5