Improved, adaptive background algorithm