Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.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/3/apache-spark/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
Python 3.x 如何实时检测文本?_Python 3.x_Text_Webcam_Live - Fatal编程技术网

Python 3.x 如何实时检测文本?

Python 3.x 如何实时检测文本?,python-3.x,text,webcam,live,Python 3.x,Text,Webcam,Live,目前这是我的代码: import pytesseract from PIL import Image img = Image.open('test.jpg') text = pytesseract.image_to_string(img) print(text) 该代码从图像中读取文本并打印出字母。我想学习如何在运行时从网络摄像头获取文本。考虑从摄像头获取单个帧,作为一个图像,并在该单帧图像中检测文本。@ GAMMANOK OK,如果我使用这个方法,它会采取框架然后运行摄像头吗?考虑从摄像头

目前这是我的代码:

import pytesseract
from PIL import Image

img = Image.open('test.jpg')
text = pytesseract.image_to_string(img)
print(text)

该代码从图像中读取文本并打印出字母。我想学习如何在运行时从网络摄像头获取文本。

考虑从摄像头获取单个帧,作为一个图像,并在该单帧图像中检测文本。@ GAMMANOK OK,如果我使用这个方法,它会采取框架然后运行摄像头吗?考虑从摄像头获取单个帧,作为一个图像,检测单帧图像中的文本。@gammazero好的,如果我使用这种方法,它会在运行网络摄像头时使用该帧吗?