Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.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 Processing_Python Imaging Library - Fatal编程技术网

Python 是否可以使用枕头将文本写入图像,然后提取所述文本?

Python 是否可以使用枕头将文本写入图像,然后提取所述文本?,python,image-processing,python-imaging-library,Python,Image Processing,Python Imaging Library,基本上,我想使用Pillow Python3将文本写入图像。在将文本写入图像之前/之后,我是否可以做些什么或进行一些预处理,使我能够在不使用Tesseract之类的工具的情况下读回文本?为此,请使用pytesser: from pytesser import * from PIL import Image image = Image.open(filename) print(image_to_string(image)) 您的文件是什么格式的?JPEG、PNG或其他格式?我目前正在使用PNG

基本上,我想使用Pillow Python3将文本写入图像。在将文本写入图像之前/之后,我是否可以做些什么或进行一些预处理,使我能够在不使用Tesseract之类的工具的情况下读回文本?

为此,请使用
pytesser

from pytesser import * 
from PIL import Image
image = Image.open(filename)
print(image_to_string(image))

您的文件是什么格式的?JPEG、PNG或其他格式?我目前正在使用PNG,但我希望扩展到其他图像扩展。我想做隐写术。所以我在图像的每个像素上写一个字符,但是我很难找回这些字符。