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

When extracting text OCR from images, 'loca'l vs 'Try it page' shows different results

Original image:

original imageoriginal image

Local result:

annotated_image.jpg

Try it sample page result:

Try it sample pageTry it sample page

The result is bad because it shows a cropped image in addition to the target image. How can I make sure that only the target image is shown as in the sample case?
Do I need to change anything in my source code?


    client = vision.ImageAnnotatorClient()

    with open(path, "rb") as image_file:
        content = image_file.read()

    image = vision.Image(content=content)

    response1 = vision.AnnotateImageRequest(image=image, features=[{'type_': vision.Feature.Type.DOCUMENT_TEXT_DETECTION}], image_context={"text_detection_params": {"advanced_ocr_options": ["legacy_layout"]}})

    response = client.annotate_image(response1)

    document = response.full_text_annotation

 

0 1 166
1 REPLY 1