evaluateOCR
Description
evaluates the optical character recognition (OCR) results metrics
= evaluateOCR(resultTxt
,groundTruthTxt
)resultTxt
against the ground truth groundTruthTxt
. The function evaluates the
quality of the OCR results by computing the character error rate and word error rate metrics
across images and the entire data set.
specifies options using one or more name-value arguments in addition to any combination of
arguments from previous syntaxes. For example, metrics
= evaluateOCR(___,Name=Value
)Metrics="word-error-rate"
specifies to evaluate results using only the word error rate metric.
Examples
Input Arguments
Output Arguments
Tips
Error rates are a percentage of characters (words) in the input
groundTruthTxt
that have been incorrectly predicted inresultTxt
.To compute the number of incorrect predictions to use in the error rate calculation, the function uses the Levenshtein distance, which is defined as the minimum number of edits (such as insertions, deletions, or substitutions) required to change one word (or sentence) into another one.
Error rate = (S + D + I)/N where,
S — Number of substitutions
D — Number of deletions
I — Number of insertions
N — Maximum number of characters (words) between
groundTruthTxt
orresultTxt
Version History
Introduced in R2023a