Smart Line line detection on metal and glass