|
|
@ -1,8 +1,9 @@
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
print("starting the pruning process")
|
|
|
|
print("starting the pruning process")
|
|
|
|
scanning = "scanimage --resolution 300 --mode color --format png > image.png"
|
|
|
|
scanning = "scanimage --resolution 300 --mode gray --format png > image.png"
|
|
|
|
os.system(scanning)
|
|
|
|
os.system(scanning)
|
|
|
|
os.system("tesseract image.png image -l eng")
|
|
|
|
os.system("convert -contrast image.png output.png")
|
|
|
|
|
|
|
|
os.system("tesseract output.png image -l eng")
|
|
|
|
fantasyname = open("image.txt" , "r")
|
|
|
|
fantasyname = open("image.txt" , "r")
|
|
|
|
fantasyname = fantasyname.readlines()
|
|
|
|
fantasyname = fantasyname.readlines()
|
|
|
|
text = open("image.txt", "r").read()
|
|
|
|
text = open("image.txt", "r").read()
|
|
|
@ -10,7 +11,7 @@ print(text)
|
|
|
|
print("------")
|
|
|
|
print("------")
|
|
|
|
lines = text.split("\n")
|
|
|
|
lines = text.split("\n")
|
|
|
|
for line in lines:
|
|
|
|
for line in lines:
|
|
|
|
dotprint = f'echo "{line}" >/dev/usb/lp0'
|
|
|
|
dotprint = "echo "+line+" >/dev/usb/lp0"
|
|
|
|
os.system(dotprint)
|
|
|
|
os.system(dotprint)
|
|
|
|
#for line in fantasyname:
|
|
|
|
#for line in fantasyname:
|
|
|
|
#line = line.split(" ")
|
|
|
|
#line = line.split(" ")
|
|
|
|