iOS: line detection (LSD) optimisation