End sequence detection using text recognition.