Text this: Dynamic programming and graph algorithms in computer vision