3 ms·
It's a very good answer, and it worked very well in this case, but it's nothing revolutionary. Background modelling with a single Gaussian is a pretty standard
by Leszek 14y ago
It's a very good answer, and it worked very well in this case, but it's nothing revolutionary. Background modelling with a single Gaussian is a pretty standard computer vision technique, and he's essentially finding anomalies by backprojecting the model[1]. This is great for one image when you can grab a sand patch, but you'll need to recalculate the model if/when the lighting changes.
If you're interested, more advanced techniques will look at Gaussian Mixture Models, which essentially can model the background (i.e. the sand) as the sum of several Gaussians (thereby permitting multiple distributions, e.g. sand in light vs. sand in shade); for example, GrabCut[2] uses GMMs to model foreground and background distributions for background segmentation. This still won't work for changing lighting, for that you need something more advanced which changes the model over time.
[1] E.g. backprojecting a histogram in opencv: http://docs.opencv.org/modules/imgproc/doc/histograms.html#calcbackproject http://docs.opencv.org/modules/imgproc/doc/histograms.html#c...
[2] http://research.microsoft.com/en-us/um/cambridge/projects/visionimagevideoediting/segmentation/grabcut.htm http://research.microsoft.com/en-us/um/cambridge/projects/vi...
EDIT: I realised that I sound very negative in this reply, which was not my intention. The technique used is great for the problem they were trying to solve, and I'm glad to see people sharing these sorts of answers on the internet for free.