Text Line Segmentation by Adapted Water Flow Algorithm