Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HUST-2019-ncov-submit-fucker
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
recolic-hust
HUST-2019-ncov-submit-fucker
Commits
0d228b85
There was an error fetching the commit references. Please try again later.
Commit
0d228b85
authored
4 years ago
by
Recolic Keghart
Browse files
Options
Downloads
Patches
Plain Diff
Add hust_code OCR
parent
30e6c197
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+3
-1
3 additions, 1 deletion
README.md
example.png
+0
-0
0 additions, 0 deletions
example.png
hust_code.py
+26
-0
26 additions, 0 deletions
hust_code.py
with
29 additions
and
1 deletion
README.md
+
3
−
1
View file @
0d228b85
...
...
@@ -9,11 +9,13 @@ Just modify config.py and enjoy!
## requirements
```
bash
sudo
pacman
-S
python-selenium geckodriver
sudo
pacman
-S
python-selenium geckodriver
python-pillow tesseract tesseract-data-eng
```
Any linux with GUI support. it launches your firefox.
**NOTE:**
Run
`tesseract example.png out.txt`
and MAKE SURE it works! The result MUST be
`8518`
.
### WARNING: While making this script, I assume that your system language is ENGLISH
一个不必要的提示:如果你在墙内,用recolic.org代替recolic.net。不然CCP会阻止你的访问。
...
...
This diff is collapsed.
Click to expand it.
example.png
0 → 100644
+
0
−
0
View file @
0d228b85
239 B
This diff is collapsed.
Click to expand it.
hust_code.py
0 → 100644
+
26
−
0
View file @
0d228b85
from
PIL
import
Image
import
sys
i
,
o
=
sys
.
argv
[
1
:]
im
=
Image
.
open
(
i
)
# In pass.hust.edu.cn verification code, the second frame is COMPLETE!
# let's get the second frame.
im
.
seek
(
im
.
tell
()
+
1
)
im
.
save
(
o
)
im
=
Image
.
open
(
o
)
# To white-black
im
=
im
.
convert
(
'
L
'
)
im
=
im
.
point
(
lambda
x
:
0
if
x
<
254
else
255
,
'
1
'
)
# Try to crop
w
,
h
=
im
.
size
if
w
==
90
and
h
==
58
:
im
=
im
.
crop
((
0
,
18
,
w
,
39
))
else
:
print
(
'
WARNING: Expected image w=90, h=58, Got image w={}, h={}.
'
.
format
(
w
,
h
))
# Save for OCR
im
.
save
(
o
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment