All URIs are relative to https://api.cloudmersive.com
Method | HTTP request | Description |
---|---|---|
preprocessing_binarize | POST /ocr/preprocessing/image/binarize | Convert an image of text into a binarized (light and dark) view |
preprocessing_binarize_advanced | POST /ocr/preprocessing/image/binarize/advanced | Convert an image of text into a binary (light and dark) view with ML |
preprocessing_get_page_angle | POST /ocr/preprocessing/image/get-page-angle | Get the angle of the page / document / receipt |
preprocessing_unrotate | POST /ocr/preprocessing/image/unrotate | Detect and unrotate a document image |
preprocessing_unrotate_advanced | POST /ocr/preprocessing/image/unrotate/advanced | Detect and unrotate a document image (advanced) |
preprocessing_unskew | POST /ocr/preprocessing/image/unskew | Detect and unskew a photo of a document |
str preprocessing_binarize(image_file)
Convert an image of text into a binarized (light and dark) view
Perform an adaptive binarization algorithm on the input image to prepare it for further OCR operations.
from __future__ import print_function
import time
import cloudmersive_ocr_api_client
from cloudmersive_ocr_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: Apikey
configuration = cloudmersive_ocr_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Apikey'] = 'Bearer'
# create an instance of the API class
api_instance = cloudmersive_ocr_api_client.PreprocessingApi(cloudmersive_ocr_api_client.ApiClient(configuration))
image_file = '/path/to/file.txt' # file | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
try:
# Convert an image of text into a binarized (light and dark) view
api_response = api_instance.preprocessing_binarize(image_file)
pprint(api_response)
except ApiException as e:
print("Exception when calling PreprocessingApi->preprocessing_binarize: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
image_file | file | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. |
str
- Content-Type: multipart/form-data
- Accept: application/json, text/json, application/xml, text/xml
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str preprocessing_binarize_advanced(image_file)
Convert an image of text into a binary (light and dark) view with ML
Perform an advanced adaptive, Deep Learning-based binarization algorithm on the input image to prepare it for further OCR operations. Provides enhanced accuracy than adaptive binarization. Image will be upsampled to 300 DPI if it has a DPI below 300.
from __future__ import print_function
import time
import cloudmersive_ocr_api_client
from cloudmersive_ocr_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: Apikey
configuration = cloudmersive_ocr_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Apikey'] = 'Bearer'
# create an instance of the API class
api_instance = cloudmersive_ocr_api_client.PreprocessingApi(cloudmersive_ocr_api_client.ApiClient(configuration))
image_file = '/path/to/file.txt' # file | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
try:
# Convert an image of text into a binary (light and dark) view with ML
api_response = api_instance.preprocessing_binarize_advanced(image_file)
pprint(api_response)
except ApiException as e:
print("Exception when calling PreprocessingApi->preprocessing_binarize_advanced: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
image_file | file | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. |
str
- Content-Type: multipart/form-data
- Accept: application/json, text/json, application/xml, text/xml
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetPageAngleResult preprocessing_get_page_angle(image_file)
Get the angle of the page / document / receipt
Analyzes a photo or image of a document and identifies the rotation angle of the page.
from __future__ import print_function
import time
import cloudmersive_ocr_api_client
from cloudmersive_ocr_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: Apikey
configuration = cloudmersive_ocr_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Apikey'] = 'Bearer'
# create an instance of the API class
api_instance = cloudmersive_ocr_api_client.PreprocessingApi(cloudmersive_ocr_api_client.ApiClient(configuration))
image_file = '/path/to/file.txt' # file | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
try:
# Get the angle of the page / document / receipt
api_response = api_instance.preprocessing_get_page_angle(image_file)
pprint(api_response)
except ApiException as e:
print("Exception when calling PreprocessingApi->preprocessing_get_page_angle: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
image_file | file | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. |
- Content-Type: multipart/form-data
- Accept: application/json, text/json, application/xml, text/xml
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str preprocessing_unrotate(image_file)
Detect and unrotate a document image
Detect and unrotate an image of a document (e.g. that was scanned at an angle). Great for document scanning applications; once unskewed, this image is perfect for converting to PDF using the Convert API or optical character recognition using the OCR API.
from __future__ import print_function
import time
import cloudmersive_ocr_api_client
from cloudmersive_ocr_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: Apikey
configuration = cloudmersive_ocr_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Apikey'] = 'Bearer'
# create an instance of the API class
api_instance = cloudmersive_ocr_api_client.PreprocessingApi(cloudmersive_ocr_api_client.ApiClient(configuration))
image_file = '/path/to/file.txt' # file | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
try:
# Detect and unrotate a document image
api_response = api_instance.preprocessing_unrotate(image_file)
pprint(api_response)
except ApiException as e:
print("Exception when calling PreprocessingApi->preprocessing_unrotate: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
image_file | file | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. |
str
- Content-Type: multipart/form-data
- Accept: application/json, text/json, application/xml, text/xml
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str preprocessing_unrotate_advanced(image_file)
Detect and unrotate a document image (advanced)
Detect and unrotate an image of a document (e.g. that was scanned at an angle) using deep learning. Great for document scanning applications; once unskewed, this image is perfect for converting to PDF using the Convert API or optical character recognition using the OCR API.
from __future__ import print_function
import time
import cloudmersive_ocr_api_client
from cloudmersive_ocr_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: Apikey
configuration = cloudmersive_ocr_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Apikey'] = 'Bearer'
# create an instance of the API class
api_instance = cloudmersive_ocr_api_client.PreprocessingApi(cloudmersive_ocr_api_client.ApiClient(configuration))
image_file = '/path/to/file.txt' # file | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
try:
# Detect and unrotate a document image (advanced)
api_response = api_instance.preprocessing_unrotate_advanced(image_file)
pprint(api_response)
except ApiException as e:
print("Exception when calling PreprocessingApi->preprocessing_unrotate_advanced: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
image_file | file | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. |
str
- Content-Type: multipart/form-data
- Accept: application/json, text/json, application/xml, text/xml
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str preprocessing_unskew(image_file)
Detect and unskew a photo of a document
Detect and unskew a photo of a document (e.g. taken on a cell phone) into a perfectly square image. Great for document scanning applications; once unskewed, this image is perfect for converting to PDF using the Convert API or optical character recognition using the OCR API.
from __future__ import print_function
import time
import cloudmersive_ocr_api_client
from cloudmersive_ocr_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: Apikey
configuration = cloudmersive_ocr_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Apikey'] = 'Bearer'
# create an instance of the API class
api_instance = cloudmersive_ocr_api_client.PreprocessingApi(cloudmersive_ocr_api_client.ApiClient(configuration))
image_file = '/path/to/file.txt' # file | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
try:
# Detect and unskew a photo of a document
api_response = api_instance.preprocessing_unskew(image_file)
pprint(api_response)
except ApiException as e:
print("Exception when calling PreprocessingApi->preprocessing_unskew: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
image_file | file | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. |
str
- Content-Type: multipart/form-data
- Accept: application/json, text/json, application/xml, text/xml
[Back to top] [Back to API list] [Back to Model list] [Back to README]