加藤美悠
加藤美悠

Reputation: 11

GoogleCloudVision API I want to improve the accuracy of numbers [GAS]

I am doing OCR with CloudVision API, but the accurary does not rise from 87%. I tried two [type] of [features], [TEXT_DETECTION] and [DOCUMENT_TEXT_DETECTION]. [language Hints] tried [la-u-nu-handwrit], [la-u-kr-latn-digit-handwrite], etc., but the result was the same as [en-t-i0-handwrite]. How can I improve the accuracy?

requests:[
      {
        image:{
          content: b64
        },
        features:{
          type: "DOCUMENT_TEXT_DETECTION",
        },
        imageContext:{
          languageHints:"la-u-nu-handwrit",
        }
      }
    ]

requests:[
      {
        image:{
          content: b64
        },
        features:{
          type: "TEXT_DETECTION",
        },
        imageContext:{
          languageHints:"la-u-kr-latn-digit-handwrite",
        }
      }
    ]

Upvotes: 1

Views: 374

Answers (1)

Malaman
Malaman

Reputation: 184

In order to improve you accuracy, I would suggest that you also focus on the quality of the images and doing some pre-processing.

Some good practices would be to:

  • Make sure that the image quality and format is good.I would suggest that you used either png or tiff formats.
  • Crop the image if necessary, removing the parts without any text may increase the OCR accuracy.
  • Use perspective transform. There are many tools that can help you with the geometric transformation, so the image is seen from the front. I would suggest that you used get perspective and warp perspective in Opencv library.
  • Binarize the image and use black and white images instead of color RGB images. Also increasing the contrast and sharpness of the image may help. In case you are scanning text, try to increase the image resolution to at least 300 DPI.

Hope that this helps!

Manu

Upvotes: 2

Related Questions