Bar code voting

Bar code voting is required if the following criteria are met.

  1. You are using both the OmniPage and the Enhanced Bar Code recognition engines to extract bar codes.

  2. Both engines find a bar code at the exact same location.

When both of these criteria are met, it is necessary to specify how the final result is determined.

For the best results, test the bar code recognition results using each recognition engine. Your test results should help you decide which voting behavior to use.

There are three voting methods when bar codes are found at the same location.

Use the OmniPage result instead of the Enhanced Bar Code result

In this situation the OmniPage result is given a 100% confidence and the Enhanced Bar Code result confidence is lowered to a maximum of 50% if the text of the two bar codes does not match.

If the extracted text of both engines does match, the OmniPage result has 100% confidence and is the only result returned.

All results are displayed in the Document Viewer during testing and Validation.

Use this method if you find that more bar codes are successfully extracted using the OmniPage recognition engine during testing.

Use the Enhanced Bar Code result instead of the OmniPage result

In this situation, the Enhanced Bar Code result is given a 100% confidence and the OmniPage result confidence is lowered to a maximum of 50% if the text of the two bar codes does not match.

If the extracted text of both engines does match, the Enhanced Bar Code result has 100% confidence and is the only result returned.

All results, including confidences of all bar codes are displayed in the Document Viewer during testing and Validation.

Use this method if you find that more bar codes are successfully extracted using the Enhanced Bar Code recognition engine during testing.

Use both results

In this situation, both recognition engine results are extracted, all results are given 50% confidence, and then voting is done via script. Create a script that votes between the two alternatives as required by your project.

The following code sample shows how to choose between the OmniPage and Enhanced Bar Code results when they both have the same confidence of 50%. In this case, the user wants to increase the confidence for the Enhanced Bar Code result to 100% for a specific type of documents.

Private Sub Document_AfterLocate(ByVal pXDoc As CASCADELib.CscXDocument, ByVal LocatorName As String)
   If(LocatorName = "BarcodeLocator") Then
      If (pXDoc.Locators.ItemByName(LocatorName).Alternatives.Count > 1) Then
         Dim Index As Integer
         For Index = 0 To pXDoc.Locators.ItemByName(LocatorName).Alternatives.Count
            Dim alternative As CscXDocFieldAlternative
            Set alternative = pXDoc.Locators.ItemByName(LocatorName).Alternatives(Index)
            If UCase(pXDoc.ExtractionClass) = "INVOICES" Then
               If(alternative.BarcodeSource = "EnhancedBarCode") Then
                 alternative.Confidence = 1.0
                  Exit For
               End If
            Else
               If(alternative.BarcodeSource = "OmniPage") Then
                  alternative.Confidence = 1.0
                  Exit For
               End If
            End If
         Next
      End If
   End If
End Sub

Here BarcodeSource is a string property exposed on the Alternative object which may have the value of "EnhancedBarCode", "OmniPage", or "" (empty string).