檢測圖像中的垂直文本欲檢測容器文本如本 container with vertical texts方法使用的OpenCV
我試圖OpenCV的例子如textdetection.cpp
那些能夠僅檢測水平文字。除了cloud vision ocr之外,還有其他解決方案來解決這種情況。
檢測圖像中的垂直文本欲檢測容器文本如本 container with vertical texts方法使用的OpenCV
我試圖OpenCV的例子如textdetection.cpp
那些能夠僅檢測水平文字。除了cloud vision ocr之外,還有其他解決方案來解決這種情況。
您可以使用正方體代替,因爲它具有讀取文本功能垂直對齊,以及: 這裏是一個示例代碼:
import Image
import pytesseract
# provide the cropped area with text
def GetOCR(tempFilepath,languages ='eng'):
img = Image.open(tempFilepath)
#img= img.convert('L')
# filters can be applied optionally for reading the proper text from the image
img.load()
# -psm 5 will assume the text allinged vertically
text = pytesseract.image_to_string(img,lang = languages,config='-psm 6')
print "text :{0}".format(text)
注:上述樣品將工作,前提是你要有pytesseract模塊安裝和tesseract-ocr exe安裝在您的機器上。 希望這有助於:)
我想我必須培養正方體,以確定那些文字,是有可能做到這一點在樹莓派 – cms
是的,你可以有你自己的訓練數據 - 這是一個耗時的過程,但這可能不適用於您的場景,如果您可以在圖像上應用一些過濾器,您可以輕鬆獲得結果。因爲在這種情況下,你已經獲得了90 +%的準確度 – csharpcoder
您可以旋轉圖像,尋找橫排文字 – JLev