Text this: An a contrario decision method for shape element recognition