Calculate string median only when necessary;  Text Line regional similarity vector