Background subtraction threshold (quadratic) -> linearize with two linear functions (near, far).