22 lines
364 B
Python
22 lines
364 B
Python
|
import tr
|
||
|
import cv2
|
||
|
|
||
|
def run_tr(image):
|
||
|
"""_summary_
|
||
|
|
||
|
Args:
|
||
|
image (np.ndarray): 像素矩阵
|
||
|
|
||
|
Returns:
|
||
|
list: 字组成的列表
|
||
|
"""
|
||
|
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
|
||
|
rst = tr.run(gray_image)
|
||
|
if len(rst) == 0:
|
||
|
return []
|
||
|
return [x[1] for x in rst]
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
pass
|
||
|
|