Commit 1dc3de3b authored by Diliru Chamika's avatar Diliru Chamika

Delete image_proccesing_code.py

parent 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment