1
votes

One objective of my project is to detect text from the streaming video using AWS Rekognition.

I have been trying to search the AWS documentation. It seems that the AWS allows the developer to extract text from the stored Images only.

See this AWS documentation - detect text in a Image The AWS documentation provides the following code to detect text in Image. This code basically has detect_text API that takes an stored Image from S3 as an input and outputs the detected text from Image.

My question is -- Is there any method to extract text from a streaming video using AWs Rekognition? OR Can I say that it is not possible to extract text from a streaming video using AWS Rekognition currently?

Let me know any methods to address this objective.

import boto3

if __name__ == "__main__":

    bucket='bucket'
    photo='text.png'

    client=boto3.client('rekognition')


    response=client.detect_text(Image={'S3Object':{'Bucket':bucket,'Name':photo}})

    textDetections=response['TextDetections']
    print ('Detected text')
    for text in textDetections:
            print ('Detected text:' + text['DetectedText'])
            print ('Confidence: ' + "{:.2f}".format(text['Confidence']) + "%")
            print ('Id: {}'.format(text['Id']))
            if 'ParentId' in text:
                print ('Parent Id: {}'.format(text['ParentId']))
            print ('Type:' + text['Type'])
            print
1

1 Answers

2
votes

text detection is only available for JPG and PNG images. One solution is to extract frames from the video, and then pass them to Rekognition of for processing.

Here's an end to end example that achieves this, with a combination of Kinesis, Lambda and Rekognition: https://github.com/aws-samples/amazon-rekognition-video-analyzer