isConfident method

bool isConfident({
  1. double threshold = confidenceThreshold,
})

true if there is confidence in this recognition, false otherwise.

There are two separate ways for there to be confidence, the first is if the confidence is missing, which is indicated by a value of -1. The second is if the confidence is greater than or equal threshold. If threshold is not provided it defaults to 0.8.

Implementation

bool isConfident({double threshold = confidenceThreshold}) =>
    confidence == missingConfidence || confidence >= threshold;