def word_column_split(word): # 对单个字符在进行一次垂直分割,取出不必要的左右的空间 v, groups, widths = preprocess.column_shadow(word, color=255) if len(widths) == 0: return None # 取占比最宽的groups maxIndex = np.argmax(widths) # 宽度最大的占比,作为最终的字符位置 return groups[maxIndex]
def _get_col(timg): v, groups, widths = preprocess.column_shadow(timg) index = np.argmax(widths) return groups[index]