Aspose.OCR Cloud Family

Aspose.OCR Cloud enables you to perform Optical Characters Recognition and document scanning in the Cloud. It supports reading and recognition of text from most commonly used raster image formats (BMP, JPG, GIF, PNG, TIFF). Perform character recognition on images with fewer code lines. Simply pass a specific image to the Aspose.OCR Cloud API, and will return a response with recognized text. The API is capable of recognizing English, French, Spanish text and returns the response in XML or JSON formats. In this article, we are going to discuss the steps to perform OCR on images using Java SDK.

During the recognition process, you can read characters as well as the associated font information. You can perform OCR on the whole image or provide X and Y coordinates to perform it on a specific portion of the raster image. It is also capable to perform an automatic skew correction, plus automatic and manual document layout detection operations at a high speed, as it has no hardware resources dependency.

Platform Independent

The Cloud API is completely independent of your operating system, database system, or development language and you may use any language and platform that supports HTTP to interact with our API. However, manually writing client code can be difficult, error-prone, and time-consuming. Therefore, in order to facilitate our customers using Java language, a language-specific Aspose.OCR Cloud Java SDK is published. When using SDK, it takes care of a lot of low-level details while making requests and handling responses and enables you to focus on writing code specific to your particular project needs.

Recognize Text from URL Image

The Cloud OCR API provides an option to directly perform text recognition operations on image files available over web URLs. You do not need to exclusively upload it to particular cloud storage.

Java Code snippet

Recognize Text from Image in Storage

Java Code snippet

cURL command

The Cloud APIs can also be accessed via cURL commands and similarly, Aspose.OCR Cloud can also be accessed via the cURL command. However, please note that in order to access the APIs, we need to generate a JWT access token based on our personalized client credentials. Please execute the following command for JWT access token generation.

curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=4ccf1790-accc-41e9-8d18-a78dbb2ed1aa&client_secret=caac6e3d4a4724b2feb53f4e460eade3" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"

Once the JWT token is generated, please use the following command to perform OCR on images.

curl "https://api.aspose.cloud/v3.0/ocr/MyImage.png/recognize?language=1" \
-X GET \
-H  "accept: application/json" \
-H  "authorization: Bearer <jwt token>"

Request URL

https://api.aspose.cloud/v3.0/ocr/MyImage.png/recognize?language=1

Response Body

{
  "text": "MOORE STEPHENS",
  "code": 200
}

Conclusion

In this article, we have discussed the details on how to perform OCR on images. Also, we have explored the options to perform Optical Characters Recognition operations on images using cURL commands. Please note that the complete source code of SDK is available on GitHub. Similarly, we also recommend learning more about API by exploring product Documentation.