Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pytesseract

pip install pytesseract
Comment

pytesseract.image_to

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import pytesseract
import cv2
img = cv2.imread('test.jpg')
img = cv2.resize(img, (600, 360))
hImg, wImg, _ = img.shape

boxes = pytesseract.image_to_boxes(img)
for b in boxes.splitlines():
  b = b.split(' ')
print(b)
x, y, w, h = int(b[1]), int(b[2]), int(b[3]), int(b[4])
cv2.rectangle(img, (x, hImg - y), (w, hImg - h), (50, 50, 255), 1)
cv2.putText(img, b[0], (x, hImg - y + 13), cv2.FONT_HERSHEY_SIMPLEX, 0.4, (50, 205, 50), 1)

cv2.imshow('Detected text', img)
cv2.waitKey(0)
Comment

PREVIOUS NEXT
Code Example
Python :: how to measure how much your of cpu your program is using in python 
Python :: split long list into chunks of 100 
Python :: flask socketio send 
Python :: id() python 
Python :: round down decimal python 
Python :: python libraries 
Python :: flask app.route 
Python :: python re 
Python :: jupyter notebook set password 
Python :: how to convert lower case to upper case in python 
Python :: resampling data python 
Python :: python bot 
Python :: export an excel table to image with python 
Python :: characters python 
Python :: np minimum of array 
Python :: python list max value 
Python :: pip for python 
Python :: lstm pytorch documentation 
Python :: copy multiple files from one folder to another folder 
Python :: raspbian run a python script at startup 
Python :: how to use prettify function in python 
Python :: pynput keyboard backspace 
Python :: find max value in 2d array python 
Python :: how to make a do while in python 
Python :: opencv rgb to gray custom 
Python :: Python NumPy column_stack Function Syntax 
Python :: csv to pdf python 
Python :: flask_jinja structure 
Python :: extract all file in zip in python 
Python :: propositional logic python 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =