Replace verticals with general line detection step