Refactoring: extract the function image2text_recognizeshape() .