July 2015
Intermediate to advanced
174 pages
3h 45m
English
It should be straightforward to think of a simple background subtraction in order to retrieve foreground objects. A simple solution could look similar to the following line of code:
Core.absdiff(backgroundImage,inputImage , foregroundImage);
This function simply subtracts each pixel of backgroundImage from inputImage and writes its absolute value in foregroundImage. As long as we have initialized the background to backgroundImage and we have that clear from objects, this could work as a simple solution.
Here follows the background subtraction video processor code:
public class AbsDifferenceBackground implements VideoProcessor { private Mat backgroundImage; public AbsDifferenceBackground(Mat backgroundImage) { this.backgroundImage ...Read now
Unlock full access