<jupyter_start><jupyter_text><jupyter_code>!pip install easyocr
import matplotlib.pyplot as plt
import cv2
import easyocr
from pylab import rcParams
from IPython.display import Image
rcParams['figure.figsize'] = 8, 16
reader = easyocr.Reader(['en'])
Image("Image2.jpeg")

output = reader.readtext('Image2.jpeg')
output
print(output[0][1])
print(output[-1][1])


cord = output[-1][0]
x_min, y_min = [int(min(idx)) for idx in zip(*cord)]

x_max, y_max = [int(max(idx)) for idx in zip(*cord)]

image = cv2.imread('Image2.jpeg')
cv2.rectangle(image,(x_min,y_min),(x_max,y_max),(0,0,255),2)
plt.imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))
Image("Image1.jpeg")
output = reader.readtext('Image1.jpeg')
output


output[-1][0]
cord = output[-1][0]
x_min, y_min = [int(min(idx)) for idx in zip(*cord)]
x_max, y_max = [int(max(idx)) for idx in zip(*cord)]

image = cv2.imread('Image1.jpeg')
cv2.rectangle(image,(x_min,y_min),(x_max,y_max),(0,0,255),2)
plt.imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.185546875, 'fraction_numerical': 0.041015625, 'mean_word_length': 7.333333333333333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '527779', 'license': 'Apache-2.0', 'n_tokens_mistral': 451, 'n_tokens_neox': 428, 'n_words': 77, 'path': 'text_reco_in_image.ipynb', 'repo_name': 'dev-2k/opencv', 'size': '1024'}