The code would depend on the particular detection model you use. Unfortunately, I can’t share our code as it contains private information. Essentially, you can use just use numpy indexing for cropping as the image is represented by a matrix. The output you get from indexing the array is a cropped portion of the original image and can be passed directly to the OCR model.

AI researcher, avid reader, fantasy and Sci-Fi geek, and fan of the Oxford comma. www.linkedin.com/in/t-rajapakse/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store