Improvement of background subtraction by mask constraints