Background estimation by mode calculation