1. A computer-implemented method comprising: detecting, by a processor, text components in an image, each of the text components comprising a different respective portion of the image identified as likely containing text; generating, by the processor, text lines between pairs of the text components; matching, by the processor, a first text line of the text lines with a set of the text components based on features of the text components of the set and based on reducing a total number of matched text lines; and recognizing, by the processor, text from the set of the text components based on the first text line.