The Forms API returns result classes that are primarily defined by the API itself, however result objects that are returned by processing engines are contained within the hierarchy of result objects returned. Results that are returned are specific to:
- form level processing,
- identification processing,
- field level processing, and
- timing.
The figure below shows the overall hierarchy of results.
Result classes in the Forms API
Form Results
Results that are specific to form level processing are contained in a FormResult object. This includes the aligned and identification image, and a cancellation flag. The FormResult class also has properties to hold objects that contain form timing results, identification results, and field results.
Identification Results
Results that are specific to identification processing are contained in an IdentificationResult object (Accusoft.Forms.IdentificationResult). Do not confuse this class with the Accusoft.FormFixSdk.IdentificationResult class; however, it does contain similar information.
The IdentificationResult class contains the following information:
- A state - indicating if the identification process was able to successfully match the input image with one form from the form set. Or, if a match could not be found because none of the forms were similar enough or multiple forms were too similar to the input image.
- The FormDefinition object - of the single form that best matched the identification input image.
- An affine transformation matrix - that maps the coordinate system of the identification input image into the coordinate system of the matching form’s template image.
- A sorted collection of forms - that matched the input image. Forms in this collection are sorted descending by the match confidence. The collection will contain the single best matching form, if one is found.
- A table indicating the confidence and orientation - at which the identification input image matched all forms in the form set. (AllFormComparisons Property)
The state is a very important value, it indicates if the Processor was able to continue processing the input form image after identification. Only a state of IdentificationState.MatchFound would indicate that processing could continue. Otherwise, with a value of IdentificationState.MultipleMatchesFound or IdentificationState.NoMatchesFound, the matching FormDefinition and affine transformation will not be available in the IdentificationResult and no field level results will be produced by the Processor.
The AllFormsComparisons collection is only filled if the Processor’s OutputAllFormComparisons property is true. If this property is set to its default value of false, then the AllFormComparisons collection will be empty.
The AlternateMatches collection will always be filled with up to the 10 most similar forms in the form set; this will occur even if one best matching form was found, and the one matching form will be first in the table. The AlternateMatches collection may contain less than 10 items, if there are less than 10 forms in the form set considered to be matching by the IdentificationProcessor.
Field Results
Results specific to field level processing are produced for each field on the form. These results are contained within the FieldResults collection of the FormResult class.
The FieldResult class holds the following values:
- Result - The value produced by the processing engine that analyzed the clip field image. When a clip field is being processed, the Result will be the field clip image, similarly, when an enhancements operation is specified for the field, the Result will be the enhanced field clip image.
- ClipImage - The clip image of the field is produced by one of three methods:
- clip,
- clip without scaling, or
- dropout.
Although this image is always created by the processor, it will only be contained in the FieldResult objects if the Processor.OutputIntermediateFieldImages is true.
- EnhancedImage - The enhanced field clip image is the result of applying ScanFix Xpress operations to the clip image. The enhanced image may not always be generated while processing a field, depending if there are ScanFix Xpress operations specified for the field. Besides, even if the enhanced image of the field does get produced, it will only be contained in the FieldResult objects if Processor.OutputIntermediateFieldImages is true.
- FieldException - If an exception occurred during processing of the field, that exception would be caught and put in this property.
- FieldName - The field name is specified by the FormDefinition object that represents this field.
- Timing - Field timing results are encapsulated in a separate class, FieldTimingResult.
Timing Results
The Processor has built in timers for its various operations, and it also tracks aggregate operation times. Two timing result objects are contained within the results hierarchy, FormTimingResult and FieldTimingResult.
Form Timing Results
- The FormTimingResult class holds values specific to form level processing and aggregate processing times for field level operations. The form level values it holds are:
- AlignmentTime - The alignment time is the time spent aligning the filled form image to the template image. This value does not include time spent identifying and registering the image.
- EnhancementTime - The form level enhancement time is the time spent applying ScanFix Xpress operations to the full form image.
- IdentificationTime - The identification time is the time the Accusoft.FormFixSdk.IdentificationProcessor spent performing identification.
- ElapsedTime - The elapsed time while processing the input image.
- The aggregate processing times for field level operations contained in the FormTimingResult class are:
- TotalFieldsTime - This is the total processor time spent processing fields on the image. This value includes all work done for each field on all threads. In cases where multithreaded processing is performed with more than one CPU, then the TotalFieldsTime may be greater than the elapsed time.
- TotalIcrTime - This is the total time spent reading handwriting in field images using SmartZone ICR.
- TotalOcrTime - This is the total time spent reading machine print in field images using SmartZone OCR.
- TotalOmrTime - This is the total time spend performing optical mark recognition in all fields, using an Accusoft.FormFixSdk.OmrProcessor.
Field Timing Results
The FieldTimingResult class holds values specific to field level processing. The values it holds include:
- AnalysisTime - This is the amount of time that a processing engine spent analyzing the image of the field. For example, this represents the time spend performing OCR or ICR, or in the case that the field is a clip field then this value will be 0.
- DropoutAndEnhancementTime - This is the amount of time spent creating the field clip image and applying ScanFix Xpress operations to it.