Sending label for recognition
To extract a text from a photographed label, send a POST request to the https://api.aspose.cloud/v5.0/ocr/RecognizeLabel
Aspose.OCR Cloud REST API endpoint. To authorize the request, pass the access token in Authorization header (Bearer authentication).
The photo and recognition parameters are provided in JSON format in the request body.
{
"image": "Base64 string",
"settings": {
"language": "English",
"makeSkewCorrect": true,
"makeUpsampling": false,
"resultType": "Text"
}
}
Providing an image
The photographed label is provided in a value of image
property as a Base64 encoded string.
getconf ARG_MAX
command to check the maximum length of the command arguments (in bytes).
Recognition settings
Property | Type | Default value | Description |
---|---|---|---|
language |
string | English |
Specify a language for recognition. At the moment, English is the only supported option. |
makeSkewCorrect |
boolean | true |
Automatically correct image tilt (deskew) before proceeding to recognition. |
makeUpsampling |
boolean | false |
Intellectually upscale image to improve small font recognition and detection of dense lines. |
resultType |
string | Text |
Recognition result format. |
Image preprocessing order
If image preprocessing filters are enabled, they are applied one after the other in the following order:
- Skew correction (
"makeSkewCorrect": true
) - Upsampling (
"makeUpsampling": true
)
If you want to apply preprocessing filters in another order, disable the corresponding recognition settings and use self-managed preprocessing.
Return value
If successful, this method returns a string with a unique identifier (GUID) of the label recognition request in the queue.
Otherwise, it returns a HTTP status code corresponding to the error.
What’s next
Recognition will take a few seconds, depending on the size of the photo and the current Aspose.Cloud load. See the article Fetching label recognition result for information on how to get a label recognition result from the server.