@ -0,0 +1,8 @@
|
||||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# 基于编辑器的 HTTP 客户端请求
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
@ -0,0 +1 @@
|
||||
scan.py
|
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.7 (Scaner)" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="TestRunnerService">
|
||||
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
|
||||
</component>
|
||||
</module>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.7 (python_project)" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (Scaner)" project-jdk-type="Python SDK" />
|
||||
</project>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/document-scanner.iml" filepath="$PROJECT_DIR$/.idea/document-scanner.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 99 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 2.0 MiB |
After Width: | Height: | Size: 2.0 MiB |
@ -0,0 +1,86 @@
|
||||
we owe owe owe oke ome owk sh ok who o c %K
|
||||
|
||||
WHOLE
|
||||
FOODS
|
||||
M __A R__K _E T}
|
||||
|
||||
WHOLE FOODS MARKET - WESTPORT,.CT 06880
|
||||
399 POST RD WEST - (203) 227-6858
|
||||
|
||||
364 BACON LS
|
||||
|
||||
365 BACON LS
|
||||
|
||||
3565 BACON LS
|
||||
|
||||
365 BACUN iS
|
||||
|
||||
BRO TH CHIC
|
||||
|
||||
FLOUR ALMUNL
|
||||
|
||||
CHKN BRST BNLSS SK
|
||||
|
||||
HEAVY CREAM
|
||||
|
||||
BALSMC REDUCT
|
||||
|
||||
BEEF - GRND - 85/15
|
||||
|
||||
JUICE COF CASHEW L
|
||||
|
||||
DOCS PINT ORGAx IC
|
||||
|
||||
HNY ALMOND Bul TiR
|
||||
% % ## TAX . 00 BAL
|
||||
|
||||
NP
|
||||
NP
|
||||
NP
|
||||
NP
|
||||
NP
|
||||
NP
|
||||
NP
|
||||
NP
|
||||
NP
|
||||
NP
|
||||
NP
|
||||
NP
|
||||
NP
|
||||
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
|
||||
11.
|
||||
|
||||
~ n o
|
||||
|
||||
14.
|
||||
|
||||
«
|
||||
|
||||
101
|
||||
|
||||
99
|
||||
. 99
|
||||
. 99
|
||||
29
|
||||
19
|
||||
99
|
||||
. 80
|
||||
|
||||
3.39
|
||||
|
||||
. 49
|
||||
04
|
||||
. 99
|
||||
49
|
||||
. 99
|
||||
. 33
|
||||
|
||||
|
||||
|
||||
m mom nom m ot ton n oto onmoy
|
||||
|
After Width: | Height: | Size: 340 KiB |
@ -0,0 +1,33 @@
|
||||
# https://digi.bib.uni-mannheim.de/tesseract/
|
||||
# 配置环境变量如E:\Program Files (x86)\Tesseract-OCR
|
||||
# tesseract -v进行测试
|
||||
# tesseract XXX.png 得到结果
|
||||
# pip install pytesseract
|
||||
# anaconda lib site-packges pytesseract pytesseract.py
|
||||
# tesseract_cmd 修改为绝对路径即可
|
||||
from PIL import Image
|
||||
import pytesseract
|
||||
import cv2
|
||||
import os
|
||||
|
||||
preprocess = 'blur' #thresh
|
||||
|
||||
image = cv2.imread('scan.jpg')
|
||||
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
|
||||
|
||||
if preprocess == "thresh":
|
||||
gray = cv2.threshold(gray, 0, 255,cv2.THRESH_BINARY | cv2.THRESH_OTSU)[1]
|
||||
|
||||
if preprocess == "blur":
|
||||
gray = cv2.medianBlur(gray, 3)
|
||||
|
||||
filename = "{}.png".format(os.getpid())
|
||||
cv2.imwrite(filename, gray)
|
||||
|
||||
text = pytesseract.image_to_string(Image.open(filename))
|
||||
print(text)
|
||||
os.remove(filename)
|
||||
|
||||
cv2.imshow("Image", image)
|
||||
cv2.imshow("Output", gray)
|
||||
cv2.waitKey(0)
|