Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从python中的图像读取文本_Python_Image - Fatal编程技术网

从python中的图像读取文本

从python中的图像读取文本,python,image,Python,Image,有没有一种从图像中读取文本的方法,某种使用python的文本识别方法 我需要读一些图片,并把文字写在上面 我一直在搜索诸如pytesser、PIL和pillow之类的图书馆,但有人知道其他的吗 适用于windows和python 3.6.1 谢谢, Marcus谷歌视觉API可能会有所帮助。它能够提取图像中存在的对象以及其他信息(品牌、颜色、人脸检测等)。它还可以非常可靠地提取文本 下面是他们网站上使用Python客户端库的一些示例代码: import io import os # Impo

有没有一种从图像中读取文本的方法,某种使用python的文本识别方法

我需要读一些图片,并把文字写在上面

我一直在搜索诸如pytesser、PIL和pillow之类的图书馆,但有人知道其他的吗

适用于windows和python 3.6.1

谢谢,


Marcus

谷歌视觉API可能会有所帮助。它能够提取图像中存在的对象以及其他信息(品牌、颜色、人脸检测等)。它还可以非常可靠地提取文本

下面是他们网站上使用Python客户端库的一些示例代码:

import io
import os

# Imports the Google Cloud client library
from google.cloud import vision

# Instantiates a client
vision_client = vision.Client()

# The name of the image file to annotate
file_name = os.path.join(
    os.path.dirname(__file__),
    'resources/wakeupcat.jpg')

# Loads the image into memory
with io.open(file_name, 'rb') as image_file:
    content = image_file.read()
    image = vision_client.image(
        content=content)

# Performs label detection on the image file
labels = image.detect_labels()

print('Labels:')
for label in labels:
    print(label.description)
也许你能在这里找到帮助:它被称为OCR(光学字符识别)。有许多OCR程序和图书馆,其中大多数是商业性的。是Google Tesseract的Python包装,一个免费的OCR。