Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2020-028
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2020-028
2020-028
Commits
1dc3de3b
Commit
1dc3de3b
authored
Nov 12, 2020
by
Diliru Chamika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete image_proccesing_code.py
parent
1b195784
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
39 deletions
+0
-39
image_proccesing_code.py
image_proccesing_code.py
+0
-39
No files found.
image_proccesing_code.py
deleted
100644 → 0
View file @
1b195784
from
PIL
import
Image
import
pytesseract
import
cv2
import
os
pytesseract
.
pytesseract
.
tesseract_cmd
=
'C://Program Files/Tesseract-OCR/tesseract.exe'
image
=
cv2
.
imread
(
'3.jpg'
)
gray
=
cv2
.
cvtColor
(
image
,
cv2
.
COLOR_BGR2GRAY
)
thresh
=
cv2
.
threshold
(
gray
,
128
,
255
,
cv2
.
THRESH_BINARY
)[
1
]
#thresh = cv2.threshold(gray, 0, 255,cv2.THRESH_BINARY | cv2.THRESH_OTSU)[1]
text
=
pytesseract
.
image_to_string
(
thresh
)
print
(
text
)
print
(
'========================================'
)
import
re
numbers
=
re
.
findall
(
r"[-+]?\d*\.\d+|\d+"
,
text
)
print
(
numbers
)
print
(
'========================================'
)
himo
=
numbers
[
0
]
rbc
=
numbers
[
2
]
wbc
=
numbers
[
3
]
lym
=
numbers
[
4
]
neut
=
numbers
[
5
]
# show the output images
cv2
.
imshow
(
"Image"
,
cv2
.
resize
(
image
,(
500
,
500
))
)
cv2
.
imshow
(
"gray"
,
cv2
.
resize
(
gray
,(
500
,
500
))
)
cv2
.
imshow
(
"Output"
,
cv2
.
resize
(
thresh
,(
500
,
500
))
)
cv2
.
waitKey
(
0
)
cv2
.
destroyAllWindows
()
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment