Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

OCR Detect Text .Net does not return score

Hello All,

I am trying to use the c# .Net nuget package to run OCR on images. I can get it to work fine and process images and returns data by following the examples in here: https://cloud.google.com/dotnet/docs/reference/Google.Cloud.Vision.V1/latest#detect-text-in-a-single... but I don't seem to be able to retrieve information on the "Score" of the text read. Both confidence and score are always 0 for all text returned. I am using the "DetectText" method specifically and also tried to set the parameter "EnableTextDetectionConfidenceScore" to true and pass it via ImageContext, but still no success. Would anybody be able to help or advice what can be investigated further please?

This is my first experience with Google cloud in general so apologies if I am posting in the wrong channel, please advice otherwise if this is the case.

Kind Regards,

Silvio 

 

0 1 765
1 REPLY 1

Hi @silviop 

Welcome to Google Cloud Community.

It looks like that you are attempting to use the Google Cloud Vision API and the C#.NET NuGet package to acquire the confidence score of the text recognized in your photos. The likelihood that the OCR engine correctly identified the text in the image is represented by the confidence score.

You can change the TextAnnotation.DetectedText property in the example you provided to extract the confidence score of the detected text.
You've attempted to enable the EnableTextDetectionConfidenceScore argument in the ImageContext object, as was previously described, however this parameter only affects the answer for DocumentTextDetection and TextDetection requests, not TextAnnotation.

After making the mentioned changes to the code, if you are still unable to access the confidence score, you might want to check the OCR outcomes using the Cloud Vision API.