start_text_detection
(**kwargs)¶Starts asynchronous detection of text in a stored video.
Amazon Rekognition Video can detect text in a video stored in an Amazon S3 bucket. Use Video to specify the bucket name and the filename of the video. StartTextDetection
returns a job identifier ( JobId
) which you use to get the results of the operation. When text detection is finished, Amazon Rekognition Video publishes a completion status to the Amazon Simple Notification Service topic that you specify in NotificationChannel
.
To get the results of the text detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED
. if so, call GetTextDetection and pass the job identifier ( JobId
) from the initial call to StartTextDetection
.
See also: AWS API Documentation
Request Syntax
response = client.start_text_detection(
Video={
'S3Object': {
'Bucket': 'string',
'Name': 'string',
'Version': 'string'
}
},
ClientRequestToken='string',
NotificationChannel={
'SNSTopicArn': 'string',
'RoleArn': 'string'
},
JobTag='string',
Filters={
'WordFilter': {
'MinConfidence': ...,
'MinBoundingBoxHeight': ...,
'MinBoundingBoxWidth': ...
},
'RegionsOfInterest': [
{
'BoundingBox': {
'Width': ...,
'Height': ...,
'Left': ...,
'Top': ...
},
'Polygon': [
{
'X': ...,
'Y': ...
},
]
},
]
}
)
[REQUIRED]
Video file stored in an Amazon S3 bucket. Amazon Rekognition video start operations such as StartLabelDetection use Video
to specify a video for analysis. The supported file formats are .mp4, .mov and .avi.
The Amazon S3 bucket name and file name for the video.
Name of the S3 bucket.
S3 object key name.
If the bucket is versioning enabled, you can specify the object version.
StartTextDetection
requests, the same JobId
is returned. Use ClientRequestToken
to prevent the same job from being accidentaly started more than once.The Amazon Simple Notification Service topic to which Amazon Rekognition publishes the completion status of a video analysis operation. For more information, see Calling Amazon Rekognition Video operations. Note that the Amazon SNS topic must have a topic name that begins with AmazonRekognition if you are using the AmazonRekognitionServiceRole permissions policy to access the topic. For more information, see Giving access to multiple Amazon SNS topics.
The Amazon SNS topic to which Amazon Rekognition posts the completion status.
The ARN of an IAM role that gives Amazon Rekognition publishing permissions to the Amazon SNS topic.
JobTag
to group related jobs and identify them in the completion notification.Optional parameters that let you set criteria the text must meet to be included in your response.
Filters focusing on qualities of the text, such as confidence or size.
Sets the confidence of word detection. Words with detection confidence below this will be excluded from the result. Values should be between 0 and 100. The default MinConfidence is 80.
Sets the minimum height of the word bounding box. Words with bounding box heights lesser than this value will be excluded from the result. Value is relative to the video frame height.
Sets the minimum width of the word bounding box. Words with bounding boxes widths lesser than this value will be excluded from the result. Value is relative to the video frame width.
Filter focusing on a certain area of the frame. Uses a BoundingBox
object to set the region of the screen.
Specifies a location within the frame that Rekognition checks for objects of interest such as text, labels, or faces. It uses a BoundingBox
or Polygon
to set a region of the screen.
A word, face, or label is included in the region if it is more than half in that region. If there is more than one region, the word, face, or label is compared with all regions of the screen. Any object of interest that is more than half in a region is kept in the results.
The box representing a region of interest on screen.
Width of the bounding box as a ratio of the overall image width.
Height of the bounding box as a ratio of the overall image height.
Left coordinate of the bounding box as a ratio of overall image width.
Top coordinate of the bounding box as a ratio of overall image height.
Specifies a shape made up of up to 10 Point
objects to define a region of interest.
The X and Y coordinates of a point on an image or video frame. The X and Y values are ratios of the overall image size or video resolution. For example, if an input image is 700x200 and the values are X=0.5 and Y=0.25, then the point is at the (350,50) pixel coordinate on the image.
An array of Point
objects makes up a Polygon
. A Polygon
is returned by DetectText and by DetectCustomLabels Polygon
represents a fine-grained polygon around a detected item. For more information, see Geometry in the Amazon Rekognition Developer Guide.
The value of the X coordinate for a point on a Polygon
.
The value of the Y coordinate for a point on a Polygon
.
dict
Response Syntax
{
'JobId': 'string'
}
Response Structure
(dict) --
JobId (string) --
Identifier for the text detection job. Use JobId
to identify the job in a subsequent call to GetTextDetection
.
Exceptions
Rekognition.Client.exceptions.AccessDeniedException
Rekognition.Client.exceptions.IdempotentParameterMismatchException
Rekognition.Client.exceptions.InvalidParameterException
Rekognition.Client.exceptions.InvalidS3ObjectException
Rekognition.Client.exceptions.InternalServerError
Rekognition.Client.exceptions.VideoTooLargeException
Rekognition.Client.exceptions.ProvisionedThroughputExceededException
Rekognition.Client.exceptions.LimitExceededException
Rekognition.Client.exceptions.ThrottlingException