Word spotting and recognition in images from heterogeneous sources