圖片OCR轉文字 驗證碼多了空白 #511
shushilin1
started this conversation in
General
Replies: 3 comments 2 replies
-
你好,这个需求可以简单地修改一下代码来实现。请参考以下步骤:
def run(self, textBlocks):
textBlocks = super().run(textBlocks)
for i in range(len(textBlocks)):
textBlocks[i]["text"] = textBlocks[i]["text"].replace(" ", "") # 去除句中空格
textBlocks[i]["end"] = "" # 去除句尾换行
return textBlocks (请保持格式复制代码,不要丢掉缩进)
|
Beta Was this translation helpful? Give feedback.
0 replies
-
谢谢~~ 免费的比花钱买的还给力 |
Beta Was this translation helpful? Give feedback.
1 reply
-
哦,抱歉,请再改一下: for i in range(len(textBlocks) - 1): 这一行,将 for i in range(len(textBlocks)): |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
如附檔:
圖片每個文字間隔不依 , 較寬的地方會被誤認為空白. 請問有選項可以解決?? 謝謝
Beta Was this translation helpful? Give feedback.
All reactions