Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Detects text in the input image and converts it into machine-readable text.
Pass the input image as base64-encoded image bytes or as a reference to an image in an Amazon S3 bucket. If you use the AWS CLI to call Amazon Rekognition operations, you must pass it as a reference to an image in an Amazon S3 bucket. For the AWS CLI, passing image bytes is not supported. The image must be either a .png or .jpeg formatted file.
The DetectText
operation returns text in an array of TextDetection
elements, TextDetections
. Each TextDetection
element provides
information about a single word or line of text that was detected in the
image.
A word is one or more ISO basic latin script characters that are not
separated by spaces. DetectText
can detect up to 100 words in an
image.
A line is a string of equally spaced words. A line isn't necessarily a
complete sentence. For example, a driver's license number is detected
as a line. A line ends when there is no aligned text after it. Also, a
line ends when there is a large gap between words, relative to the
length of the words. This means, depending on the gap between words,
Amazon Rekognition may detect multiple lines in text aligned in the same
direction. Periods don't represent the end of a line. If a sentence
spans multiple lines, the DetectText
operation returns multiple lines.
To determine whether a TextDetection
element is a line of text or a
word, use the TextDetection
object Type
field.
To be detected, text must be within +/- 90 degrees orientation of the horizontal axis.
For more information, see DetectText in the Amazon Rekognition Developer Guide.
Synopsis
- data DetectText = DetectText' {}
- newDetectText :: Image -> DetectText
- detectText_filters :: Lens' DetectText (Maybe DetectTextFilters)
- detectText_image :: Lens' DetectText Image
- data DetectTextResponse = DetectTextResponse' {}
- newDetectTextResponse :: Int -> DetectTextResponse
- detectTextResponse_textDetections :: Lens' DetectTextResponse (Maybe [TextDetection])
- detectTextResponse_textModelVersion :: Lens' DetectTextResponse (Maybe Text)
- detectTextResponse_httpStatus :: Lens' DetectTextResponse Int
Creating a Request
data DetectText Source #
See: newDetectText
smart constructor.
DetectText' | |
|
Instances
Create a value of DetectText
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:filters:DetectText'
, detectText_filters
- Optional parameters that let you set the criteria that the text must
meet to be included in your response.
$sel:image:DetectText'
, detectText_image
- The input image as base64-encoded bytes or an Amazon S3 object. If you
use the AWS CLI to call Amazon Rekognition operations, you can't pass
image bytes.
If you are using an AWS SDK to call Amazon Rekognition, you might not
need to base64-encode image bytes passed using the Bytes
field. For
more information, see Images in the Amazon Rekognition developer guide.
Request Lenses
detectText_filters :: Lens' DetectText (Maybe DetectTextFilters) Source #
Optional parameters that let you set the criteria that the text must meet to be included in your response.
detectText_image :: Lens' DetectText Image Source #
The input image as base64-encoded bytes or an Amazon S3 object. If you use the AWS CLI to call Amazon Rekognition operations, you can't pass image bytes.
If you are using an AWS SDK to call Amazon Rekognition, you might not
need to base64-encode image bytes passed using the Bytes
field. For
more information, see Images in the Amazon Rekognition developer guide.
Destructuring the Response
data DetectTextResponse Source #
See: newDetectTextResponse
smart constructor.
DetectTextResponse' | |
|
Instances
newDetectTextResponse Source #
Create a value of DetectTextResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:textDetections:DetectTextResponse'
, detectTextResponse_textDetections
- An array of text that was detected in the input image.
$sel:textModelVersion:DetectTextResponse'
, detectTextResponse_textModelVersion
- The model version used to detect text.
$sel:httpStatus:DetectTextResponse'
, detectTextResponse_httpStatus
- The response's http status code.
Response Lenses
detectTextResponse_textDetections :: Lens' DetectTextResponse (Maybe [TextDetection]) Source #
An array of text that was detected in the input image.
detectTextResponse_textModelVersion :: Lens' DetectTextResponse (Maybe Text) Source #
The model version used to detect text.
detectTextResponse_httpStatus :: Lens' DetectTextResponse Int Source #
The response's http status code.