当前位置:   article > 正文

python tesserocr图片识别,安装使用_"file \"tesserocr.pyx\", line 2555, in tesserocr._

"file \"tesserocr.pyx\", line 2555, in tesserocr._tesserocr.image_to_text"

python tesserocr安装教程

https://www.cnblogs.com/gl1573/p/9894401.html

print(tesserocr.image_to_text(image))报错File "tesserocr.pyx", line 2407, in tesserocr._tesserocr.imag

错误解决办法

https://www.cnblogs.com/111testing/p/12383290.html

先安装Tesseract-OCR 然后把

将F:\Tesseract-OCR里面的 tessdata 整个文件夹一起复制到python安装目录下面

 

测试代码:

  1. from PIL import Image
  2. import tesserocr
  3. # tesserocr识别图片的2种方法
  4. img = Image.open("Captcha_jocbdxjepz.jpg")
  5. verify_code1 = tesserocr.image_to_text(img)
  6. print(verify_code1)
  7. verify_code2 = tesserocr.file_to_text("Captcha_jocbdxjepz.jpg")
  8. print(verify_code2)

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/296019
推荐阅读
相关标签
  

闽ICP备14008679号