Added txt2matrix_scratch and im2text