public double Profile(double x) { #if DEBUG if (x < 0) throw new Exception(); #endif // Equation 7 in (Comaniciu & Meer) // https://courses.csail.mit.edu/6.869/handouts/PAMIMeanshift.pdf if (x <= 1) return 1 - x; return 0; }