简体   繁体   中英

How to print the handwritten text inside the bounding boxes using open CV

I am trying to recognize handwritten text(capital letters and alphanumeric) and print it.

I have used the code mentioned in this link. handwriiten word recognition

I am also able to get different alphabets seperately in bounding boxes and it gives such results. 在此处输入图片说明

I have two issues-

1 - I want to print out the text inside the bounding boxes

2- while writting continuously it considers the whole word as shown in the

output in github link but here it considers alphabets only.

here is the output for small letters continuous writting

在此处输入图片说明

can anyone provide me direction as to how I can do that with capital

letters and also how to print the text inside bounding boxes with good

accuracy so that it works good for capital letters alphanumeric.

Please anyone who could guide me regarding this and tell about how to do this.

Any help on handwritting recognition and text .

Before finding the bounding box you will have to do some pre-processing.

I obtained a binary image using threshold from the image provided. After that I made a custom kernel such that it has more number of columns than rows to perform morphological operations. In this way, letters close to each other will be paired up.

Code:

custom_kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (30, 10))
threshed = cv2.morphologyEx(binary_image, cv2.MORPH_CLOSE, custom_kernel)
cv2.imshow('Connected letters', threshed)

在此处输入图片说明

After obtaining this you can find the bounding boxes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM