Refactored KernelFilter apply into evaluateAt.
Implemented gradient tracking for line direction.