How to configure TemplateFinder3 to do OCR?

Reading Number Plate 7420

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.

OCR Template for character 4

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

  1. 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.
  2. Rematch area is set to 67 – default is 100%. Is speed is needed 67 % will normally work ok. 100% is a safer value.
  3. 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
  4. Template Scaling is activated. Two scales are performed 100% and 120%.
  5. Note: With a quad-core CPU there rotation and scaling is processed on the four core and has a low speed penalty
  6. The Match description is set to Template Name only
  7. The results are sorted by x-position – to be able to sort the characters into a result AllNames
  8. Result strings Template names are activated – This means that Allname result is produces and contains Number plate number.

Advanced Setup when using TemplateFinder3 for OCR

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.

OCR Contraints - Accept closer matches than default

4. Setup page

The following is configured on the Setup Page

  1. Search Area – conveniant to activate “Use whole picture” – this is slower that a selected region of interest
  2. 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
  3. 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
  4. The Threshold is used in the second pass – values from 100 – 200 are typical
  5. 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
  6. 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

Setup Page TemplateFinder3

5. Use Allnames result

When properly configured the Allnames results contains the OCR value = 7420.

Tf3.Allnames result contains OCR value

More information “Can Scorpion do OCR?” . Download the sample and read more about TemplateFinder3  in Scorpion Online Help.

2 Responses

  1. […] How to configure TemplateFinder3 to do OCR? […]

  2. […] How to configure TemplateFinder3 to do OCR? December 2009 1 comment 2 […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: