如何使用pytesseract捕获这些图像中的文本?

时间:2019-07-16 13:48:30

标签: python image-processing ocr python-tesseract

我需要获取以下形式的数据:图片标题,纬度,经度

我尝试了pytesseract,但结果文本不正确。我在文字中找到字母,而不是经纬度。

我需要获取以下形式的数据:图片标题,纬度,经度 [![Lat_Image] [2]] [2]

path = 'C:/BackUp/PhD/Data_from_Core_AP/Python/GeoTaggingWellsImages/filtered_images/Chittoor/'+file
img = cv2.imread(path)
crop_img = img[365:385,10:395]
gray = cv2.cvtColor(crop_img, cv2.COLOR_BGR2GRAY)
ret, thresh = cv2.threshold(crop_img,245 ,255, cv2.THRESH_TRUNC)
cv2.imwrite("C:/BackUp/PhD/Data_from_Core_AP/Python/GeoTaggingWellsImages/filtered_images/temp.jpeg", gray)
text = pytesseract.image_to_string(Image.open("C:/BackUp/PhD/Data_from_Core_AP/Python/GeoTaggingWellsImages/filtered_images/temp.jpeg"), config='outputbase digits')


  [1]: https://i.stack.imgur.com/aoc3I.jpg
  [2]: https://i.stack.imgur.com/pMgER.jpg

0 个答案:

没有答案