This section examines how the TemplateFinder3 – TF3 – is used to do OCR. It is based on the demo located in “Can Scorpion do OCR?”
The following steps are needed to configure TemplateFinder3:
1. Add templates for each character
The system is teached by adding template for each character you need to decode. Below the character 4 is shown.
Note the following:
- Name is to “4” – this is done to tell Scorpion the symbol the template represents
- Use subImage is activated with a threshold of 120 – this is doe to require that this area is present in the template
2. Setup Advanced
- Decimation is activated to speed up processing – normalised crosscorrelation – when comparing image with templates. The default value of the decimation is calculated by the system to 3. By experimentation 5 is found to be a good value. Five gives a template which for character for is 62 / 5 = 12 x 8 = 43 / 5. A template with 96 pixels contains a lot of information.
- Rematch area is set to 67 – default is 100%. Is speed is needed 67 % will normally work ok. 100% is a safer value.
- Template Rotation is activated to be able to handle a slight angle on the characters. If there is no angle this might leads to a poorer system performance
- Template Scaling is activated. Two scales are performed 100% and 120%.
- Note: With a quad-core CPU there rotation and scaling is processed on the four core and has a low speed penalty
- The Match description is set to Template Name only
- The results are sorted by x-position – to be able to sort the characters into a result AllNames
- Result strings Template names are activated – This means that Allname result is produces and contains Number plate number.
3. Setup Constraints
It might be needed to lower the accepted distance between matches. This is by default off. It this case this is set to 10.
4. Setup page
The following is configured on the Setup Page
- Search Area – conveniant to activate “Use whole picture” – this is slower that a selected region of interest
- If rotation is enabled “Optimized Rotation” will provide better and more consistent results
- Note that when rotation is only – + 10 degrees this can also be ticked off – with 360 degrees rotation important to activate
- The Raw threshold is used in the first decimated search for correlation peaks
- This value should not be lower than 60 – in this case 100 is a good value
- The Threshold is used in the second pass – values from 100 – 200 are typical
- Ignore matches with lower Std ratio is used to get rid of matches with another intensity level
- This option can be disable to handle intensity variation between template and image
- Thread count Auto will select a proper thread count based on CPU configuration
- Setting thread count to 1 – will show how fast TF3 is on a single-core
5. Use Allnames result
When properly configured the Allnames results contains the OCR value = 7420.
More information “Can Scorpion do OCR?” . Download the sample and read more about TemplateFinder3 in Scorpion Online Help.
Filed under: Profiles |
[…] How to configure TemplateFinder3 to do OCR? […]
[…] How to configure TemplateFinder3 to do OCR? December 2009 1 comment 2 […]