Android Question TextRecognition scan just one line?

tsteward

Well-Known Member
Licensed User
Longtime User
I found TextRecognitionAndroid - OCR library which is excellent.
How can I narrow down the area that is recognised.
Perhaps show a rectangle on the image and ocr just what's in the rectangle.

The idea being I want to scan a vehicle VIN and ocr it like from the image attached.
 

Attachments

  • img_20201120_090638.jpg
    img_20201120_090638.jpg
    82.9 KB · Views: 167

Brian Dean

Well-Known Member
Licensed User
Longtime User
Perhaps show a rectangle on the image and ocr just what's in the rectangle.
That could be an answer, but it seems likely to add quite a bit of complexity. If the OCR is working well it might be easier to grab all of the text and then pick out the VIN using Regex. Is the VIN always a 17-character string? Are alpha and numeric characters always in the same relative positions? If that is the case then it would seem a good short-cut. Even if you managed to OCR just a single line presumably you would need to validity check the result.
 
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
That could be an answer, but it seems likely to add quite a bit of complexity. If the OCR is working well it might be easier to grab all of the text and then pick out the VIN using Regex. Is the VIN always a 17-character string? Are alpha and numeric characters always in the same relative positions? If that is the case then it would seem a good short-cut. Even if you managed to OCR just a single line presumably you would need to validity check the result.
Yeah that's the solution I came up with too.
Thank you
 
Upvote 0
Top