cloudmersive-ocr-api-client 1.5.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- metadata +3 -109
- data/Gemfile +0 -7
- data/README.md +0 -150
- data/Rakefile +0 -8
- data/cloudmersive-ocr-api-client.gemspec +0 -45
- data/docs/BusinessCardRecognitionResult.md +0 -15
- data/docs/FieldResult.md +0 -9
- data/docs/FormDefinitionTemplate.md +0 -9
- data/docs/FormFieldDefinition.md +0 -25
- data/docs/FormRecognitionResult.md +0 -12
- data/docs/FormTableColumnDefinition.md +0 -13
- data/docs/FormTableDefinition.md +0 -11
- data/docs/GetPageAngleResult.md +0 -9
- data/docs/ImageOcrApi.md +0 -571
- data/docs/ImageToLinesWithLocationResult.md +0 -9
- data/docs/ImageToTextResponse.md +0 -9
- data/docs/ImageToWordsWithLocationResult.md +0 -9
- data/docs/OcrLineElement.md +0 -9
- data/docs/OcrPageResult.md +0 -10
- data/docs/OcrPageResultWithLinesWithLocation.md +0 -10
- data/docs/OcrPageResultWithWordsWithLocation.md +0 -10
- data/docs/OcrPhotoTextElement.md +0 -14
- data/docs/OcrWordElement.md +0 -18
- data/docs/PdfOcrApi.md +0 -191
- data/docs/PdfToLinesWithLocationResult.md +0 -9
- data/docs/PdfToTextResponse.md +0 -9
- data/docs/PdfToWordsWithLocationResult.md +0 -9
- data/docs/PhotoToWordsWithLocationResult.md +0 -10
- data/docs/Point.md +0 -9
- data/docs/PreprocessingApi.md +0 -338
- data/docs/ReceiptLineItem.md +0 -9
- data/docs/ReceiptRecognitionResult.md +0 -16
- data/docs/ReceiptsApi.md +0 -63
- data/docs/TableCellResult.md +0 -9
- data/docs/TableResult.md +0 -9
- data/docs/TableRowResult.md +0 -8
- data/git_push.sh +0 -55
- data/lib/cloudmersive-ocr-api-client.rb +0 -70
- data/lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb +0 -605
- data/lib/cloudmersive-ocr-api-client/api/pdf_ocr_api.rb +0 -212
- data/lib/cloudmersive-ocr-api-client/api/preprocessing_api.rb +0 -359
- data/lib/cloudmersive-ocr-api-client/api/receipts_api.rb +0 -79
- data/lib/cloudmersive-ocr-api-client/api_client.rb +0 -389
- data/lib/cloudmersive-ocr-api-client/api_error.rb +0 -38
- data/lib/cloudmersive-ocr-api-client/configuration.rb +0 -209
- data/lib/cloudmersive-ocr-api-client/models/business_card_recognition_result.rb +0 -259
- data/lib/cloudmersive-ocr-api-client/models/field_result.rb +0 -201
- data/lib/cloudmersive-ocr-api-client/models/form_definition_template.rb +0 -203
- data/lib/cloudmersive-ocr-api-client/models/form_field_definition.rb +0 -361
- data/lib/cloudmersive-ocr-api-client/models/form_recognition_result.rb +0 -235
- data/lib/cloudmersive-ocr-api-client/models/form_table_column_definition.rb +0 -239
- data/lib/cloudmersive-ocr-api-client/models/form_table_definition.rb +0 -221
- data/lib/cloudmersive-ocr-api-client/models/get_page_angle_result.rb +0 -199
- data/lib/cloudmersive-ocr-api-client/models/image_to_lines_with_location_result.rb +0 -201
- data/lib/cloudmersive-ocr-api-client/models/image_to_text_response.rb +0 -199
- data/lib/cloudmersive-ocr-api-client/models/image_to_words_with_location_result.rb +0 -201
- data/lib/cloudmersive-ocr-api-client/models/ocr_line_element.rb +0 -201
- data/lib/cloudmersive-ocr-api-client/models/ocr_page_result.rb +0 -209
- data/lib/cloudmersive-ocr-api-client/models/ocr_page_result_with_lines_with_location.rb +0 -211
- data/lib/cloudmersive-ocr-api-client/models/ocr_page_result_with_words_with_location.rb +0 -211
- data/lib/cloudmersive-ocr-api-client/models/ocr_photo_text_element.rb +0 -251
- data/lib/cloudmersive-ocr-api-client/models/ocr_word_element.rb +0 -289
- data/lib/cloudmersive-ocr-api-client/models/pdf_to_lines_with_location_result.rb +0 -201
- data/lib/cloudmersive-ocr-api-client/models/pdf_to_text_response.rb +0 -201
- data/lib/cloudmersive-ocr-api-client/models/pdf_to_words_with_location_result.rb +0 -201
- data/lib/cloudmersive-ocr-api-client/models/photo_to_words_with_location_result.rb +0 -227
- data/lib/cloudmersive-ocr-api-client/models/point.rb +0 -199
- data/lib/cloudmersive-ocr-api-client/models/receipt_line_item.rb +0 -199
- data/lib/cloudmersive-ocr-api-client/models/receipt_recognition_result.rb +0 -271
- data/lib/cloudmersive-ocr-api-client/models/table_cell_result.rb +0 -201
- data/lib/cloudmersive-ocr-api-client/models/table_result.rb +0 -201
- data/lib/cloudmersive-ocr-api-client/models/table_row_result.rb +0 -191
- data/lib/cloudmersive-ocr-api-client/version.rb +0 -15
- data/spec/api/image_ocr_api_spec.rb +0 -169
- data/spec/api/pdf_ocr_api_spec.rb +0 -78
- data/spec/api/preprocessing_api_spec.rb +0 -107
- data/spec/api/receipts_api_spec.rb +0 -47
- data/spec/api_client_spec.rb +0 -226
- data/spec/configuration_spec.rb +0 -42
- data/spec/models/business_card_recognition_result_spec.rb +0 -84
- data/spec/models/field_result_spec.rb +0 -48
- data/spec/models/form_definition_template_spec.rb +0 -48
- data/spec/models/form_field_definition_spec.rb +0 -144
- data/spec/models/form_recognition_result_spec.rb +0 -66
- data/spec/models/form_table_column_definition_spec.rb +0 -72
- data/spec/models/form_table_definition_spec.rb +0 -60
- data/spec/models/get_page_angle_result_spec.rb +0 -48
- data/spec/models/image_to_lines_with_location_result_spec.rb +0 -48
- data/spec/models/image_to_text_response_spec.rb +0 -48
- data/spec/models/image_to_words_with_location_result_spec.rb +0 -48
- data/spec/models/ocr_line_element_spec.rb +0 -48
- data/spec/models/ocr_page_result_spec.rb +0 -54
- data/spec/models/ocr_page_result_with_lines_with_location_spec.rb +0 -54
- data/spec/models/ocr_page_result_with_words_with_location_spec.rb +0 -54
- data/spec/models/ocr_photo_text_element_spec.rb +0 -78
- data/spec/models/ocr_word_element_spec.rb +0 -102
- data/spec/models/pdf_to_lines_with_location_result_spec.rb +0 -48
- data/spec/models/pdf_to_text_response_spec.rb +0 -48
- data/spec/models/pdf_to_words_with_location_result_spec.rb +0 -48
- data/spec/models/photo_to_words_with_location_result_spec.rb +0 -54
- data/spec/models/point_spec.rb +0 -48
- data/spec/models/receipt_line_item_spec.rb +0 -48
- data/spec/models/receipt_recognition_result_spec.rb +0 -90
- data/spec/models/table_cell_result_spec.rb +0 -48
- data/spec/models/table_result_spec.rb +0 -48
- data/spec/models/table_row_result_spec.rb +0 -42
- data/spec/spec_helper.rb +0 -111
data/docs/FormTableDefinition.md
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
# CloudmersiveOcrApiClient::FormTableDefinition
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
Name | Type | Description | Notes
|
5
|
-
------------ | ------------- | ------------- | -------------
|
6
|
-
**table_id** | **String** | Optional; the ID of the table | [optional]
|
7
|
-
**column_definitions** | [**Array<FormTableColumnDefinition>**](FormTableColumnDefinition.md) | Definition of the columns in the table | [optional]
|
8
|
-
**target_table_height_relative** | **Float** | Optional - scale factor for target table height - relative to maximum height of headers of columns | [optional]
|
9
|
-
**target_row_height_relative** | **Float** | Optional - scale factor for target row height - relative to height of column header | [optional]
|
10
|
-
|
11
|
-
|
data/docs/GetPageAngleResult.md
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
# CloudmersiveOcrApiClient::GetPageAngleResult
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
Name | Type | Description | Notes
|
5
|
-
------------ | ------------- | ------------- | -------------
|
6
|
-
**successful** | **BOOLEAN** | True if the operation was successful, false otherwise | [optional]
|
7
|
-
**angle** | **Float** | Angle of the page in radians; 0 represents perfectly horizontal | [optional]
|
8
|
-
|
9
|
-
|
data/docs/ImageOcrApi.md
DELETED
@@ -1,571 +0,0 @@
|
|
1
|
-
# CloudmersiveOcrApiClient::ImageOcrApi
|
2
|
-
|
3
|
-
All URIs are relative to *https://api.cloudmersive.com*
|
4
|
-
|
5
|
-
Method | HTTP request | Description
|
6
|
-
------------- | ------------- | -------------
|
7
|
-
[**image_ocr_image_lines_with_location**](ImageOcrApi.md#image_ocr_image_lines_with_location) | **POST** /ocr/image/to/lines-with-location | Convert a scanned image into words with location
|
8
|
-
[**image_ocr_image_words_with_location**](ImageOcrApi.md#image_ocr_image_words_with_location) | **POST** /ocr/image/to/words-with-location | Convert a scanned image into words with location
|
9
|
-
[**image_ocr_photo_recognize_business_card**](ImageOcrApi.md#image_ocr_photo_recognize_business_card) | **POST** /ocr/photo/recognize/business-card | Recognize a photo of a business card, extract key business information
|
10
|
-
[**image_ocr_photo_recognize_form**](ImageOcrApi.md#image_ocr_photo_recognize_form) | **POST** /ocr/photo/recognize/form | Recognize a photo of a form, extract key fields and business information
|
11
|
-
[**image_ocr_photo_recognize_form_advanced**](ImageOcrApi.md#image_ocr_photo_recognize_form_advanced) | **POST** /ocr/photo/recognize/form/advanced | Recognize a photo of a form, extract key fields using stored templates
|
12
|
-
[**image_ocr_photo_recognize_receipt**](ImageOcrApi.md#image_ocr_photo_recognize_receipt) | **POST** /ocr/photo/recognize/receipt | Recognize a photo of a receipt, extract key business information
|
13
|
-
[**image_ocr_photo_to_text**](ImageOcrApi.md#image_ocr_photo_to_text) | **POST** /ocr/photo/toText | Convert a photo of a document into text
|
14
|
-
[**image_ocr_photo_words_with_location**](ImageOcrApi.md#image_ocr_photo_words_with_location) | **POST** /ocr/photo/to/words-with-location | Convert a photo of a document or receipt into words with location
|
15
|
-
[**image_ocr_post**](ImageOcrApi.md#image_ocr_post) | **POST** /ocr/image/toText | Convert a scanned image into text
|
16
|
-
|
17
|
-
|
18
|
-
# **image_ocr_image_lines_with_location**
|
19
|
-
> ImageToLinesWithLocationResult image_ocr_image_lines_with_location(image_file, opts)
|
20
|
-
|
21
|
-
Convert a scanned image into words with location
|
22
|
-
|
23
|
-
Converts an uploaded image in common formats such as JPEG, PNG into lines/text with location information and other metdata via Optical Character Recognition. This API is intended to be run on scanned documents. If you want to OCR photos (e.g. taken with a smart phone camera), be sure to use the photo/toText API instead, as it is designed to unskew the image first.
|
24
|
-
|
25
|
-
### Example
|
26
|
-
```ruby
|
27
|
-
# load the gem
|
28
|
-
require 'cloudmersive-ocr-api-client'
|
29
|
-
# setup authorization
|
30
|
-
CloudmersiveOcrApiClient.configure do |config|
|
31
|
-
# Configure API key authorization: Apikey
|
32
|
-
config.api_key['Apikey'] = 'YOUR API KEY'
|
33
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
34
|
-
#config.api_key_prefix['Apikey'] = 'Bearer'
|
35
|
-
end
|
36
|
-
|
37
|
-
api_instance = CloudmersiveOcrApiClient::ImageOcrApi.new
|
38
|
-
|
39
|
-
image_file = File.new("/path/to/file.txt") # File | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
40
|
-
|
41
|
-
opts = {
|
42
|
-
language: "language_example", # String | Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
|
43
|
-
preprocessing: "preprocessing_example" # String | Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended).
|
44
|
-
}
|
45
|
-
|
46
|
-
begin
|
47
|
-
#Convert a scanned image into words with location
|
48
|
-
result = api_instance.image_ocr_image_lines_with_location(image_file, opts)
|
49
|
-
p result
|
50
|
-
rescue CloudmersiveOcrApiClient::ApiError => e
|
51
|
-
puts "Exception when calling ImageOcrApi->image_ocr_image_lines_with_location: #{e}"
|
52
|
-
end
|
53
|
-
```
|
54
|
-
|
55
|
-
### Parameters
|
56
|
-
|
57
|
-
Name | Type | Description | Notes
|
58
|
-
------------- | ------------- | ------------- | -------------
|
59
|
-
**image_file** | **File**| Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. |
|
60
|
-
**language** | **String**| Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish) | [optional]
|
61
|
-
**preprocessing** | **String**| Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended). | [optional]
|
62
|
-
|
63
|
-
### Return type
|
64
|
-
|
65
|
-
[**ImageToLinesWithLocationResult**](ImageToLinesWithLocationResult.md)
|
66
|
-
|
67
|
-
### Authorization
|
68
|
-
|
69
|
-
[Apikey](../README.md#Apikey)
|
70
|
-
|
71
|
-
### HTTP request headers
|
72
|
-
|
73
|
-
- **Content-Type**: multipart/form-data
|
74
|
-
- **Accept**: application/json, text/json, application/xml, text/xml
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
# **image_ocr_image_words_with_location**
|
79
|
-
> ImageToWordsWithLocationResult image_ocr_image_words_with_location(image_file, opts)
|
80
|
-
|
81
|
-
Convert a scanned image into words with location
|
82
|
-
|
83
|
-
Converts an uploaded image in common formats such as JPEG, PNG into words/text with location information and other metdata via Optical Character Recognition. This API is intended to be run on scanned documents. If you want to OCR photos (e.g. taken with a smart phone camera), be sure to use the photo/toText API instead, as it is designed to unskew the image first.
|
84
|
-
|
85
|
-
### Example
|
86
|
-
```ruby
|
87
|
-
# load the gem
|
88
|
-
require 'cloudmersive-ocr-api-client'
|
89
|
-
# setup authorization
|
90
|
-
CloudmersiveOcrApiClient.configure do |config|
|
91
|
-
# Configure API key authorization: Apikey
|
92
|
-
config.api_key['Apikey'] = 'YOUR API KEY'
|
93
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
94
|
-
#config.api_key_prefix['Apikey'] = 'Bearer'
|
95
|
-
end
|
96
|
-
|
97
|
-
api_instance = CloudmersiveOcrApiClient::ImageOcrApi.new
|
98
|
-
|
99
|
-
image_file = File.new("/path/to/file.txt") # File | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
100
|
-
|
101
|
-
opts = {
|
102
|
-
language: "language_example", # String | Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
|
103
|
-
preprocessing: "preprocessing_example" # String | Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended).
|
104
|
-
}
|
105
|
-
|
106
|
-
begin
|
107
|
-
#Convert a scanned image into words with location
|
108
|
-
result = api_instance.image_ocr_image_words_with_location(image_file, opts)
|
109
|
-
p result
|
110
|
-
rescue CloudmersiveOcrApiClient::ApiError => e
|
111
|
-
puts "Exception when calling ImageOcrApi->image_ocr_image_words_with_location: #{e}"
|
112
|
-
end
|
113
|
-
```
|
114
|
-
|
115
|
-
### Parameters
|
116
|
-
|
117
|
-
Name | Type | Description | Notes
|
118
|
-
------------- | ------------- | ------------- | -------------
|
119
|
-
**image_file** | **File**| Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. |
|
120
|
-
**language** | **String**| Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish) | [optional]
|
121
|
-
**preprocessing** | **String**| Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended). | [optional]
|
122
|
-
|
123
|
-
### Return type
|
124
|
-
|
125
|
-
[**ImageToWordsWithLocationResult**](ImageToWordsWithLocationResult.md)
|
126
|
-
|
127
|
-
### Authorization
|
128
|
-
|
129
|
-
[Apikey](../README.md#Apikey)
|
130
|
-
|
131
|
-
### HTTP request headers
|
132
|
-
|
133
|
-
- **Content-Type**: multipart/form-data
|
134
|
-
- **Accept**: application/json, text/json, application/xml, text/xml
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
# **image_ocr_photo_recognize_business_card**
|
139
|
-
> BusinessCardRecognitionResult image_ocr_photo_recognize_business_card(image_file)
|
140
|
-
|
141
|
-
Recognize a photo of a business card, extract key business information
|
142
|
-
|
143
|
-
Analyzes a photograph of a business card as input, and outputs key business information such as the name of the person, name of the business, the address of the business, the phone number, the email address and more.
|
144
|
-
|
145
|
-
### Example
|
146
|
-
```ruby
|
147
|
-
# load the gem
|
148
|
-
require 'cloudmersive-ocr-api-client'
|
149
|
-
# setup authorization
|
150
|
-
CloudmersiveOcrApiClient.configure do |config|
|
151
|
-
# Configure API key authorization: Apikey
|
152
|
-
config.api_key['Apikey'] = 'YOUR API KEY'
|
153
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
154
|
-
#config.api_key_prefix['Apikey'] = 'Bearer'
|
155
|
-
end
|
156
|
-
|
157
|
-
api_instance = CloudmersiveOcrApiClient::ImageOcrApi.new
|
158
|
-
|
159
|
-
image_file = File.new("/path/to/file.txt") # File | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
160
|
-
|
161
|
-
|
162
|
-
begin
|
163
|
-
#Recognize a photo of a business card, extract key business information
|
164
|
-
result = api_instance.image_ocr_photo_recognize_business_card(image_file)
|
165
|
-
p result
|
166
|
-
rescue CloudmersiveOcrApiClient::ApiError => e
|
167
|
-
puts "Exception when calling ImageOcrApi->image_ocr_photo_recognize_business_card: #{e}"
|
168
|
-
end
|
169
|
-
```
|
170
|
-
|
171
|
-
### Parameters
|
172
|
-
|
173
|
-
Name | Type | Description | Notes
|
174
|
-
------------- | ------------- | ------------- | -------------
|
175
|
-
**image_file** | **File**| Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. |
|
176
|
-
|
177
|
-
### Return type
|
178
|
-
|
179
|
-
[**BusinessCardRecognitionResult**](BusinessCardRecognitionResult.md)
|
180
|
-
|
181
|
-
### Authorization
|
182
|
-
|
183
|
-
[Apikey](../README.md#Apikey)
|
184
|
-
|
185
|
-
### HTTP request headers
|
186
|
-
|
187
|
-
- **Content-Type**: multipart/form-data
|
188
|
-
- **Accept**: application/json, text/json, application/xml, text/xml
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
# **image_ocr_photo_recognize_form**
|
193
|
-
> FormRecognitionResult image_ocr_photo_recognize_form(image_file, opts)
|
194
|
-
|
195
|
-
Recognize a photo of a form, extract key fields and business information
|
196
|
-
|
197
|
-
Analyzes a photograph of a form as input, and outputs key business fields and information. Customzie data to be extracted by defining fields for the form.
|
198
|
-
|
199
|
-
### Example
|
200
|
-
```ruby
|
201
|
-
# load the gem
|
202
|
-
require 'cloudmersive-ocr-api-client'
|
203
|
-
# setup authorization
|
204
|
-
CloudmersiveOcrApiClient.configure do |config|
|
205
|
-
# Configure API key authorization: Apikey
|
206
|
-
config.api_key['Apikey'] = 'YOUR API KEY'
|
207
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
208
|
-
#config.api_key_prefix['Apikey'] = 'Bearer'
|
209
|
-
end
|
210
|
-
|
211
|
-
api_instance = CloudmersiveOcrApiClient::ImageOcrApi.new
|
212
|
-
|
213
|
-
image_file = File.new("/path/to/file.txt") # File | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
214
|
-
|
215
|
-
opts = {
|
216
|
-
form_template_definition: "form_template_definition_example", # String | Form field definitions
|
217
|
-
recognition_mode: "recognition_mode_example", # String | Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled.
|
218
|
-
preprocessing: "preprocessing_example", # String | Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement.
|
219
|
-
diagnostics: "diagnostics_example", # String | Optional, diagnostics mode, default is 'false'. Possible values are 'true' (will set DiagnosticImage to a diagnostic PNG image in the result), and 'false' (no diagnostics are enabled; this is recommended for best performance).
|
220
|
-
language: "language_example" # String | Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
|
221
|
-
}
|
222
|
-
|
223
|
-
begin
|
224
|
-
#Recognize a photo of a form, extract key fields and business information
|
225
|
-
result = api_instance.image_ocr_photo_recognize_form(image_file, opts)
|
226
|
-
p result
|
227
|
-
rescue CloudmersiveOcrApiClient::ApiError => e
|
228
|
-
puts "Exception when calling ImageOcrApi->image_ocr_photo_recognize_form: #{e}"
|
229
|
-
end
|
230
|
-
```
|
231
|
-
|
232
|
-
### Parameters
|
233
|
-
|
234
|
-
Name | Type | Description | Notes
|
235
|
-
------------- | ------------- | ------------- | -------------
|
236
|
-
**image_file** | **File**| Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. |
|
237
|
-
**form_template_definition** | **String**| Form field definitions | [optional]
|
238
|
-
**recognition_mode** | **String**| Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled. | [optional]
|
239
|
-
**preprocessing** | **String**| Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement. | [optional]
|
240
|
-
**diagnostics** | **String**| Optional, diagnostics mode, default is 'false'. Possible values are 'true' (will set DiagnosticImage to a diagnostic PNG image in the result), and 'false' (no diagnostics are enabled; this is recommended for best performance). | [optional]
|
241
|
-
**language** | **String**| Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish) | [optional]
|
242
|
-
|
243
|
-
### Return type
|
244
|
-
|
245
|
-
[**FormRecognitionResult**](FormRecognitionResult.md)
|
246
|
-
|
247
|
-
### Authorization
|
248
|
-
|
249
|
-
[Apikey](../README.md#Apikey)
|
250
|
-
|
251
|
-
### HTTP request headers
|
252
|
-
|
253
|
-
- **Content-Type**: multipart/form-data
|
254
|
-
- **Accept**: application/json, text/json, application/xml, text/xml
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
# **image_ocr_photo_recognize_form_advanced**
|
259
|
-
> FormRecognitionResult image_ocr_photo_recognize_form_advanced(image_file, opts)
|
260
|
-
|
261
|
-
Recognize a photo of a form, extract key fields using stored templates
|
262
|
-
|
263
|
-
Analyzes a photograph of a form as input, and outputs key business fields and information. Customzie data to be extracted by defining fields for the form. Uses template definitions stored in Cloudmersive Configuration; to configure stored templates in a configuration bucket, log into Cloudmersive Management Portal and navigate to Settings > API Configuration > Create Bucket
|
264
|
-
|
265
|
-
### Example
|
266
|
-
```ruby
|
267
|
-
# load the gem
|
268
|
-
require 'cloudmersive-ocr-api-client'
|
269
|
-
# setup authorization
|
270
|
-
CloudmersiveOcrApiClient.configure do |config|
|
271
|
-
# Configure API key authorization: Apikey
|
272
|
-
config.api_key['Apikey'] = 'YOUR API KEY'
|
273
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
274
|
-
#config.api_key_prefix['Apikey'] = 'Bearer'
|
275
|
-
end
|
276
|
-
|
277
|
-
api_instance = CloudmersiveOcrApiClient::ImageOcrApi.new
|
278
|
-
|
279
|
-
image_file = File.new("/path/to/file.txt") # File | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
280
|
-
|
281
|
-
opts = {
|
282
|
-
bucket_id: "bucket_id_example", # String | Bucket ID of the Configuration Bucket storing the form templates
|
283
|
-
bucket_secret_key: "bucket_secret_key_example", # String | Bucket Secret Key of the Configuration Bucket storing the form templates
|
284
|
-
recognition_mode: "recognition_mode_example", # String | Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled.
|
285
|
-
preprocessing: "preprocessing_example", # String | Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement.
|
286
|
-
diagnostics: "diagnostics_example" # String | Optional, diagnostics mode, default is 'false'. Possible values are 'true' (will set DiagnosticImage to a diagnostic PNG image in the result), and 'false' (no diagnostics are enabled; this is recommended for best performance).
|
287
|
-
}
|
288
|
-
|
289
|
-
begin
|
290
|
-
#Recognize a photo of a form, extract key fields using stored templates
|
291
|
-
result = api_instance.image_ocr_photo_recognize_form_advanced(image_file, opts)
|
292
|
-
p result
|
293
|
-
rescue CloudmersiveOcrApiClient::ApiError => e
|
294
|
-
puts "Exception when calling ImageOcrApi->image_ocr_photo_recognize_form_advanced: #{e}"
|
295
|
-
end
|
296
|
-
```
|
297
|
-
|
298
|
-
### Parameters
|
299
|
-
|
300
|
-
Name | Type | Description | Notes
|
301
|
-
------------- | ------------- | ------------- | -------------
|
302
|
-
**image_file** | **File**| Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. |
|
303
|
-
**bucket_id** | **String**| Bucket ID of the Configuration Bucket storing the form templates | [optional]
|
304
|
-
**bucket_secret_key** | **String**| Bucket Secret Key of the Configuration Bucket storing the form templates | [optional]
|
305
|
-
**recognition_mode** | **String**| Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled. | [optional]
|
306
|
-
**preprocessing** | **String**| Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image - including automatic unrotation of the image - before OCR is applied; this is recommended). Set this to 'None' if you do not want to use automatic image unrotation and enhancement. | [optional]
|
307
|
-
**diagnostics** | **String**| Optional, diagnostics mode, default is 'false'. Possible values are 'true' (will set DiagnosticImage to a diagnostic PNG image in the result), and 'false' (no diagnostics are enabled; this is recommended for best performance). | [optional]
|
308
|
-
|
309
|
-
### Return type
|
310
|
-
|
311
|
-
[**FormRecognitionResult**](FormRecognitionResult.md)
|
312
|
-
|
313
|
-
### Authorization
|
314
|
-
|
315
|
-
[Apikey](../README.md#Apikey)
|
316
|
-
|
317
|
-
### HTTP request headers
|
318
|
-
|
319
|
-
- **Content-Type**: multipart/form-data
|
320
|
-
- **Accept**: application/json, text/json, application/xml, text/xml
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
# **image_ocr_photo_recognize_receipt**
|
325
|
-
> ReceiptRecognitionResult image_ocr_photo_recognize_receipt(image_file, opts)
|
326
|
-
|
327
|
-
Recognize a photo of a receipt, extract key business information
|
328
|
-
|
329
|
-
Analyzes a photograph of a receipt as input, and outputs key business information such as the name of the business, the address of the business, the phone number of the business, the total of the receipt, the date of the receipt, and more.
|
330
|
-
|
331
|
-
### Example
|
332
|
-
```ruby
|
333
|
-
# load the gem
|
334
|
-
require 'cloudmersive-ocr-api-client'
|
335
|
-
# setup authorization
|
336
|
-
CloudmersiveOcrApiClient.configure do |config|
|
337
|
-
# Configure API key authorization: Apikey
|
338
|
-
config.api_key['Apikey'] = 'YOUR API KEY'
|
339
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
340
|
-
#config.api_key_prefix['Apikey'] = 'Bearer'
|
341
|
-
end
|
342
|
-
|
343
|
-
api_instance = CloudmersiveOcrApiClient::ImageOcrApi.new
|
344
|
-
|
345
|
-
image_file = File.new("/path/to/file.txt") # File | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
346
|
-
|
347
|
-
opts = {
|
348
|
-
recognition_mode: "recognition_mode_example", # String | Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled.
|
349
|
-
language: "language_example", # String | Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
|
350
|
-
preprocessing: "preprocessing_example" # String | Optional, preprocessing mode, default is 'None'. Possible values are None (no preprocessing of the image), and 'Advanced' (automatic image enhancement of the image before OCR is applied; this is recommended and needed to handle rotated receipts).
|
351
|
-
}
|
352
|
-
|
353
|
-
begin
|
354
|
-
#Recognize a photo of a receipt, extract key business information
|
355
|
-
result = api_instance.image_ocr_photo_recognize_receipt(image_file, opts)
|
356
|
-
p result
|
357
|
-
rescue CloudmersiveOcrApiClient::ApiError => e
|
358
|
-
puts "Exception when calling ImageOcrApi->image_ocr_photo_recognize_receipt: #{e}"
|
359
|
-
end
|
360
|
-
```
|
361
|
-
|
362
|
-
### Parameters
|
363
|
-
|
364
|
-
Name | Type | Description | Notes
|
365
|
-
------------- | ------------- | ------------- | -------------
|
366
|
-
**image_file** | **File**| Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. |
|
367
|
-
**recognition_mode** | **String**| Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled. | [optional]
|
368
|
-
**language** | **String**| Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish) | [optional]
|
369
|
-
**preprocessing** | **String**| Optional, preprocessing mode, default is 'None'. Possible values are None (no preprocessing of the image), and 'Advanced' (automatic image enhancement of the image before OCR is applied; this is recommended and needed to handle rotated receipts). | [optional]
|
370
|
-
|
371
|
-
### Return type
|
372
|
-
|
373
|
-
[**ReceiptRecognitionResult**](ReceiptRecognitionResult.md)
|
374
|
-
|
375
|
-
### Authorization
|
376
|
-
|
377
|
-
[Apikey](../README.md#Apikey)
|
378
|
-
|
379
|
-
### HTTP request headers
|
380
|
-
|
381
|
-
- **Content-Type**: multipart/form-data
|
382
|
-
- **Accept**: application/json, text/json, application/xml, text/xml
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
# **image_ocr_photo_to_text**
|
387
|
-
> ImageToTextResponse image_ocr_photo_to_text(image_file, opts)
|
388
|
-
|
389
|
-
Convert a photo of a document into text
|
390
|
-
|
391
|
-
Converts an uploaded photo of a document in common formats such as JPEG, PNG into text via Optical Character Recognition. This API is intended to be run on photos of documents, e.g. taken with a smartphone and supports cases where other content, such as a desk, are in the frame and the camera is crooked. If you want to OCR a scanned image, use the image/toText API call instead as it is designed for scanned images.
|
392
|
-
|
393
|
-
### Example
|
394
|
-
```ruby
|
395
|
-
# load the gem
|
396
|
-
require 'cloudmersive-ocr-api-client'
|
397
|
-
# setup authorization
|
398
|
-
CloudmersiveOcrApiClient.configure do |config|
|
399
|
-
# Configure API key authorization: Apikey
|
400
|
-
config.api_key['Apikey'] = 'YOUR API KEY'
|
401
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
402
|
-
#config.api_key_prefix['Apikey'] = 'Bearer'
|
403
|
-
end
|
404
|
-
|
405
|
-
api_instance = CloudmersiveOcrApiClient::ImageOcrApi.new
|
406
|
-
|
407
|
-
image_file = File.new("/path/to/file.txt") # File | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
408
|
-
|
409
|
-
opts = {
|
410
|
-
recognition_mode: "recognition_mode_example", # String | Optional; possible values are 'Basic' which provides basic recognition and is not resillient to page rotation, skew or low quality images uses 1-2 API calls; 'Normal' which provides highly fault tolerant OCR recognition uses 14-16 API calls; and 'Advanced' which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls. Default recognition mode is 'Advanced'
|
411
|
-
language: "language_example" # String | Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
|
412
|
-
}
|
413
|
-
|
414
|
-
begin
|
415
|
-
#Convert a photo of a document into text
|
416
|
-
result = api_instance.image_ocr_photo_to_text(image_file, opts)
|
417
|
-
p result
|
418
|
-
rescue CloudmersiveOcrApiClient::ApiError => e
|
419
|
-
puts "Exception when calling ImageOcrApi->image_ocr_photo_to_text: #{e}"
|
420
|
-
end
|
421
|
-
```
|
422
|
-
|
423
|
-
### Parameters
|
424
|
-
|
425
|
-
Name | Type | Description | Notes
|
426
|
-
------------- | ------------- | ------------- | -------------
|
427
|
-
**image_file** | **File**| Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. |
|
428
|
-
**recognition_mode** | **String**| Optional; possible values are 'Basic' which provides basic recognition and is not resillient to page rotation, skew or low quality images uses 1-2 API calls; 'Normal' which provides highly fault tolerant OCR recognition uses 14-16 API calls; and 'Advanced' which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls. Default recognition mode is 'Advanced' | [optional]
|
429
|
-
**language** | **String**| Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish) | [optional]
|
430
|
-
|
431
|
-
### Return type
|
432
|
-
|
433
|
-
[**ImageToTextResponse**](ImageToTextResponse.md)
|
434
|
-
|
435
|
-
### Authorization
|
436
|
-
|
437
|
-
[Apikey](../README.md#Apikey)
|
438
|
-
|
439
|
-
### HTTP request headers
|
440
|
-
|
441
|
-
- **Content-Type**: multipart/form-data
|
442
|
-
- **Accept**: application/json, text/json, application/xml, text/xml
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
# **image_ocr_photo_words_with_location**
|
447
|
-
> PhotoToWordsWithLocationResult image_ocr_photo_words_with_location(image_file, opts)
|
448
|
-
|
449
|
-
Convert a photo of a document or receipt into words with location
|
450
|
-
|
451
|
-
Converts a photo of a document or receipt in common formats such as JPEG, PNG into words/text with location information and other metdata via Optical Character Recognition. This API is intended to be run on photographs of documents. If you want to OCR scanned documents (e.g. taken with a scanner), be sure to use the image/toText API instead, as it is designed for that use case.
|
452
|
-
|
453
|
-
### Example
|
454
|
-
```ruby
|
455
|
-
# load the gem
|
456
|
-
require 'cloudmersive-ocr-api-client'
|
457
|
-
# setup authorization
|
458
|
-
CloudmersiveOcrApiClient.configure do |config|
|
459
|
-
# Configure API key authorization: Apikey
|
460
|
-
config.api_key['Apikey'] = 'YOUR API KEY'
|
461
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
462
|
-
#config.api_key_prefix['Apikey'] = 'Bearer'
|
463
|
-
end
|
464
|
-
|
465
|
-
api_instance = CloudmersiveOcrApiClient::ImageOcrApi.new
|
466
|
-
|
467
|
-
image_file = File.new("/path/to/file.txt") # File | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
468
|
-
|
469
|
-
opts = {
|
470
|
-
recognition_mode: "recognition_mode_example", # String | Optional; possible values are 'Normal' which provides highly fault tolerant OCR recognition uses 14-16 API calls; and 'Advanced' which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls. Default recognition mode is 'Advanced'
|
471
|
-
language: "language_example", # String | Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
|
472
|
-
preprocessing: "preprocessing_example", # String | Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended).
|
473
|
-
diagnostics: "diagnostics_example" # String | Optional, diagnostics mode, default is 'false'. Possible values are 'true' (will set DiagnosticImage to a diagnostic PNG image in the result), and 'false' (no diagnostics are enabled; this is recommended for best performance).
|
474
|
-
}
|
475
|
-
|
476
|
-
begin
|
477
|
-
#Convert a photo of a document or receipt into words with location
|
478
|
-
result = api_instance.image_ocr_photo_words_with_location(image_file, opts)
|
479
|
-
p result
|
480
|
-
rescue CloudmersiveOcrApiClient::ApiError => e
|
481
|
-
puts "Exception when calling ImageOcrApi->image_ocr_photo_words_with_location: #{e}"
|
482
|
-
end
|
483
|
-
```
|
484
|
-
|
485
|
-
### Parameters
|
486
|
-
|
487
|
-
Name | Type | Description | Notes
|
488
|
-
------------- | ------------- | ------------- | -------------
|
489
|
-
**image_file** | **File**| Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. |
|
490
|
-
**recognition_mode** | **String**| Optional; possible values are 'Normal' which provides highly fault tolerant OCR recognition uses 14-16 API calls; and 'Advanced' which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls. Default recognition mode is 'Advanced' | [optional]
|
491
|
-
**language** | **String**| Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish) | [optional]
|
492
|
-
**preprocessing** | **String**| Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended). | [optional]
|
493
|
-
**diagnostics** | **String**| Optional, diagnostics mode, default is 'false'. Possible values are 'true' (will set DiagnosticImage to a diagnostic PNG image in the result), and 'false' (no diagnostics are enabled; this is recommended for best performance). | [optional]
|
494
|
-
|
495
|
-
### Return type
|
496
|
-
|
497
|
-
[**PhotoToWordsWithLocationResult**](PhotoToWordsWithLocationResult.md)
|
498
|
-
|
499
|
-
### Authorization
|
500
|
-
|
501
|
-
[Apikey](../README.md#Apikey)
|
502
|
-
|
503
|
-
### HTTP request headers
|
504
|
-
|
505
|
-
- **Content-Type**: multipart/form-data
|
506
|
-
- **Accept**: application/json, text/json, application/xml, text/xml
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
# **image_ocr_post**
|
511
|
-
> ImageToTextResponse image_ocr_post(image_file, opts)
|
512
|
-
|
513
|
-
Convert a scanned image into text
|
514
|
-
|
515
|
-
Converts an uploaded image in common formats such as JPEG, PNG into text via Optical Character Recognition. This API is intended to be run on scanned documents. If you want to OCR photos (e.g. taken with a smart phone camera), be sure to use the photo/toText API instead, as it is designed to unskew the image first.
|
516
|
-
|
517
|
-
### Example
|
518
|
-
```ruby
|
519
|
-
# load the gem
|
520
|
-
require 'cloudmersive-ocr-api-client'
|
521
|
-
# setup authorization
|
522
|
-
CloudmersiveOcrApiClient.configure do |config|
|
523
|
-
# Configure API key authorization: Apikey
|
524
|
-
config.api_key['Apikey'] = 'YOUR API KEY'
|
525
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
526
|
-
#config.api_key_prefix['Apikey'] = 'Bearer'
|
527
|
-
end
|
528
|
-
|
529
|
-
api_instance = CloudmersiveOcrApiClient::ImageOcrApi.new
|
530
|
-
|
531
|
-
image_file = File.new("/path/to/file.txt") # File | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
532
|
-
|
533
|
-
opts = {
|
534
|
-
recognition_mode: "recognition_mode_example", # String | Optional; possible values are 'Basic' which provides basic recognition and is not resillient to page rotation, skew or low quality images uses 1-2 API calls; 'Normal' which provides highly fault tolerant OCR recognition uses 14-16 API calls; and 'Advanced' which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls. Default recognition mode is 'Advanced'
|
535
|
-
language: "language_example", # String | Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
|
536
|
-
preprocessing: "preprocessing_example" # String | Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended).
|
537
|
-
}
|
538
|
-
|
539
|
-
begin
|
540
|
-
#Convert a scanned image into text
|
541
|
-
result = api_instance.image_ocr_post(image_file, opts)
|
542
|
-
p result
|
543
|
-
rescue CloudmersiveOcrApiClient::ApiError => e
|
544
|
-
puts "Exception when calling ImageOcrApi->image_ocr_post: #{e}"
|
545
|
-
end
|
546
|
-
```
|
547
|
-
|
548
|
-
### Parameters
|
549
|
-
|
550
|
-
Name | Type | Description | Notes
|
551
|
-
------------- | ------------- | ------------- | -------------
|
552
|
-
**image_file** | **File**| Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. |
|
553
|
-
**recognition_mode** | **String**| Optional; possible values are 'Basic' which provides basic recognition and is not resillient to page rotation, skew or low quality images uses 1-2 API calls; 'Normal' which provides highly fault tolerant OCR recognition uses 14-16 API calls; and 'Advanced' which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls. Default recognition mode is 'Advanced' | [optional]
|
554
|
-
**language** | **String**| Optional, language of the input document, default is English (ENG). Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish) | [optional]
|
555
|
-
**preprocessing** | **String**| Optional, preprocessing mode, default is 'Auto'. Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended). | [optional]
|
556
|
-
|
557
|
-
### Return type
|
558
|
-
|
559
|
-
[**ImageToTextResponse**](ImageToTextResponse.md)
|
560
|
-
|
561
|
-
### Authorization
|
562
|
-
|
563
|
-
[Apikey](../README.md#Apikey)
|
564
|
-
|
565
|
-
### HTTP request headers
|
566
|
-
|
567
|
-
- **Content-Type**: multipart/form-data
|
568
|
-
- **Accept**: application/json, text/json, application/xml, text/xml
|
569
|
-
|
570
|
-
|
571
|
-
|