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

Document Text Detection Google Vision API English Language Only

Hi All,

I am using Google Vision API Document Text Detection for OCR to extract serial Numbers from an Image. The Serial Number contains only numbers and english alphabets. I have already set language Hint as English. However the extracted texts sometimes contains texts from other langugages such as "BKO" in Turkish or Cyrril language.  The Code snippet is given below:

 

            success, encoded_image = cv2.imencode('.jpg', crop_img1)
            content = encoded_image.tobytes()
            image = vision_v1.types.Image(content=content)
            image_context = vision_v1.ImageContext(language_hints=["en"])
            status_label.config(text="Extracting Texts")
            response = client.document_text_detection(image=image)
            texts = response.text_annotations
 
Is there a way I can tell Google Vision API that the text you are extracting is from English, You should not look for other languages. 

 

 

1 1 3,953
1 REPLY 1