Text this: Class-based grouping in perspective images