You are here: Start » Program Examples » OCR Read Number
OCR Read Number
Aim
The aim of the program is to recognize characters in an image.
Input
Several images of numbers.
Output
Detected numbers in the image and recognized characters.
Hints
In this variant of the example OCR Read Number the simplest approach to perform Optical Character Recognition (OCR) is demonstrated. In FabImage Studio there are a few ways to do it, but the fastest way is by applying filters: ExtractText and ReadText.
Solution (FIS)
-
Add the images into your program by using the EnumerateImages filter.
-
Add the ExtractText filter. Connect outImage from the previous filter to inImage of the current one.
-
Click on the ExtractText filter and in the Properties window select inRoi to specify the area where characters should be extracted from:
-
Now choose the inSegmentationModel input and create a proper segmentation model to correctly extract characters:
-
If you successfully extracted characters, add ReadText. Connect the outCharacters output from the previous filter to the inCharacters input of the current one.
-
Click on the ReadText filter and choose inOcrModel. In the OCR Model Trainer you need to specify the value of each extracted character. When you are done, click Add Samples and Train:
-
Go to the Details tab where for each character you can create variants by opening Variation Toolbox. Please note that you need to select a character first:
-
You can adjust parameters of your training as well as shown in the picture below. If you are ready, you can train your model by clicking on the Train button. When it is over, the training accuracy will be computed:
-
Now you can leave the editor and go back to your program. Your OCR application is ready and if some improvements are necessary, it is possible to add new samples or make suitable changes.
Macrofilter Main
Used Filters
Icon | Name | Description |
---|---|---|
![]() |
ReadText | Ready-to-use tool for reading text from images using the OCR technique. |
![]() |
EnumerateImages | Emulates image acquisition with images stored on disk. |
![]() |
ExtractText | Ready-to-use tool for extracting and splitting character to single characters. |
Further Readings
- Optical Character Recognition - Detailed article explaining Optical Character Recognition technique.