cloudmersive-ocr-api-client 1.4.7 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +7 -7
- data/cloudmersive-ocr-api-client.gemspec +3 -3
- data/docs/FormFieldDefinition.md +1 -0
- data/docs/ImageOcrApi.md +39 -33
- data/docs/PdfOcrApi.md +11 -9
- data/docs/PreprocessingApi.md +6 -6
- data/docs/ReceiptsApi.md +1 -1
- data/lib/cloudmersive-ocr-api-client.rb +1 -1
- data/lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb +49 -49
- data/lib/cloudmersive-ocr-api-client/api/pdf_ocr_api.rb +17 -19
- data/lib/cloudmersive-ocr-api-client/api/preprocessing_api.rb +26 -32
- data/lib/cloudmersive-ocr-api-client/api/receipts_api.rb +6 -7
- data/lib/cloudmersive-ocr-api-client/api_client.rb +11 -9
- data/lib/cloudmersive-ocr-api-client/api_error.rb +1 -1
- data/lib/cloudmersive-ocr-api-client/configuration.rb +2 -2
- data/lib/cloudmersive-ocr-api-client/models/business_card_recognition_result.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/field_result.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/form_definition_template.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/form_field_definition.rb +18 -11
- data/lib/cloudmersive-ocr-api-client/models/form_recognition_result.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/form_table_column_definition.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/form_table_definition.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/get_page_angle_result.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/image_to_lines_with_location_result.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/image_to_text_response.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/image_to_words_with_location_result.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/ocr_line_element.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/ocr_page_result.rb +7 -11
- data/lib/cloudmersive-ocr-api-client/models/ocr_page_result_with_lines_with_location.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/ocr_page_result_with_words_with_location.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/ocr_photo_text_element.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/ocr_word_element.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/pdf_to_lines_with_location_result.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/pdf_to_text_response.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/pdf_to_words_with_location_result.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/photo_to_words_with_location_result.rb +9 -13
- data/lib/cloudmersive-ocr-api-client/models/point.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/receipt_line_item.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/receipt_recognition_result.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/table_cell_result.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/table_result.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/models/table_row_result.rb +7 -10
- data/lib/cloudmersive-ocr-api-client/version.rb +2 -2
- data/spec/api/image_ocr_api_spec.rb +14 -11
- data/spec/api/pdf_ocr_api_spec.rb +5 -5
- data/spec/api/preprocessing_api_spec.rb +7 -7
- data/spec/api/receipts_api_spec.rb +2 -2
- data/spec/api_client_spec.rb +52 -35
- data/spec/configuration_spec.rb +9 -9
- data/spec/models/business_card_recognition_result_spec.rb +9 -10
- data/spec/models/field_result_spec.rb +3 -4
- data/spec/models/form_definition_template_spec.rb +3 -4
- data/spec/models/form_field_definition_spec.rb +24 -19
- data/spec/models/form_recognition_result_spec.rb +6 -7
- data/spec/models/form_table_column_definition_spec.rb +7 -8
- data/spec/models/form_table_definition_spec.rb +5 -6
- data/spec/models/get_page_angle_result_spec.rb +3 -4
- data/spec/models/image_to_lines_with_location_result_spec.rb +3 -4
- data/spec/models/image_to_text_response_spec.rb +3 -4
- data/spec/models/image_to_words_with_location_result_spec.rb +3 -4
- data/spec/models/ocr_line_element_spec.rb +3 -4
- data/spec/models/ocr_page_result_spec.rb +4 -5
- data/spec/models/ocr_page_result_with_lines_with_location_spec.rb +4 -5
- data/spec/models/ocr_page_result_with_words_with_location_spec.rb +4 -5
- data/spec/models/ocr_photo_text_element_spec.rb +8 -9
- data/spec/models/ocr_word_element_spec.rb +12 -13
- data/spec/models/pdf_to_lines_with_location_result_spec.rb +3 -4
- data/spec/models/pdf_to_text_response_spec.rb +3 -4
- data/spec/models/pdf_to_words_with_location_result_spec.rb +3 -4
- data/spec/models/photo_to_words_with_location_result_spec.rb +4 -5
- data/spec/models/point_spec.rb +3 -4
- data/spec/models/receipt_line_item_spec.rb +3 -4
- data/spec/models/receipt_recognition_result_spec.rb +10 -11
- data/spec/models/table_cell_result_spec.rb +3 -4
- data/spec/models/table_result_spec.rb +3 -4
- data/spec/models/table_row_result_spec.rb +2 -3
- data/spec/spec_helper.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2d61f2a0afbce56a20c9a5494488e01e97a8fc7b70d2bc3ba7c7ad9380d8e20
|
4
|
+
data.tar.gz: 89af648ebbb008d9124fb8c187b0a19d491d0161630968eb6f404e6ae3ada06d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bba1bc1f40a43fe7617957830610f5c1c76acdb21dcd8f2866e839a915be7ec66c4e013ad2cb4ee46c60c7f22ccfbab2f175118faf80fc488a95d362f53c672
|
7
|
+
data.tar.gz: 3e491b712a586afb7d29d6d7a89661719d6b5252422d6408155945b964d40c86e5d772c085468e9962ec23cd49beb3303fa66415d30ec00248eb2afe400acffb
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -7,7 +7,7 @@ The powerful Optical Character Recognition (OCR) APIs let you convert scanned im
|
|
7
7
|
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
8
8
|
|
9
9
|
- API version: v1
|
10
|
-
- Package version:
|
10
|
+
- Package version: 2.0.2
|
11
11
|
- Build package: io.swagger.codegen.languages.RubyClientCodegen
|
12
12
|
|
13
13
|
## Installation
|
@@ -23,15 +23,15 @@ gem build cloudmersive-ocr-api-client.gemspec
|
|
23
23
|
Then either install the gem locally:
|
24
24
|
|
25
25
|
```shell
|
26
|
-
gem install ./cloudmersive-ocr-api-client-
|
26
|
+
gem install ./cloudmersive-ocr-api-client-2.0.2.gem
|
27
27
|
```
|
28
|
-
(for development, run `gem install --dev ./cloudmersive-ocr-api-client-
|
28
|
+
(for development, run `gem install --dev ./cloudmersive-ocr-api-client-2.0.2.gem` to install the development dependencies)
|
29
29
|
|
30
30
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
31
31
|
|
32
32
|
Finally add this to the Gemfile:
|
33
33
|
|
34
|
-
gem 'cloudmersive-ocr-api-client', '~>
|
34
|
+
gem 'cloudmersive-ocr-api-client', '~> 2.0.2'
|
35
35
|
|
36
36
|
### Install from Git
|
37
37
|
|
@@ -64,11 +64,11 @@ end
|
|
64
64
|
|
65
65
|
api_instance = CloudmersiveOcrApiClient::ImageOcrApi.new
|
66
66
|
|
67
|
-
image_file = File.new(
|
67
|
+
image_file = File.new('/path/to/file.txt') # File | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
68
68
|
|
69
69
|
opts = {
|
70
|
-
language:
|
71
|
-
preprocessing:
|
70
|
+
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)
|
71
|
+
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).
|
72
72
|
}
|
73
73
|
|
74
74
|
begin
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
|
2
|
+
|
3
3
|
=begin
|
4
4
|
#ocrapi
|
5
5
|
|
@@ -8,7 +8,7 @@
|
|
8
8
|
OpenAPI spec version: v1
|
9
9
|
|
10
10
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
11
|
-
Swagger Codegen version: 2.
|
11
|
+
Swagger Codegen version: 2.4.14
|
12
12
|
|
13
13
|
=end
|
14
14
|
|
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.homepage = "https://www.cloudmersive.com/ocr-api"
|
25
25
|
s.summary = "Convert scanned documents and images to text."
|
26
26
|
s.description = "Convert scanned images of documents into rich text."
|
27
|
-
s.license =
|
27
|
+
s.license = 'Apache 2.0'
|
28
28
|
s.required_ruby_version = ">= 1.9"
|
29
29
|
|
30
30
|
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
|
data/docs/FormFieldDefinition.md
CHANGED
@@ -7,6 +7,7 @@ Name | Type | Description | Notes
|
|
7
7
|
**left_anchor** | **String** | Optional - the left-hand anchor of the field | [optional]
|
8
8
|
**top_anchor** | **String** | Optional - the top anchor of the field | [optional]
|
9
9
|
**bottom_anchor** | **String** | Optional - the bottom anchor of the field | [optional]
|
10
|
+
**alternate_anchor** | **String** | Optional - alterate match text for the specified anchor | [optional]
|
10
11
|
**anchor_mode** | **String** | Optional - the matching mode for the anchor. Possible values are Complete (requires the entire anchor to match) and Partial (allows only part of the anchor to match) and Horizontal (anchor must be laid out horizontally). Default is Partial. | [optional]
|
11
12
|
**data_type** | **String** | The data type of the field; possible values are INTEGER (Integer value), STRING (Arbitrary string value, spaces are permitted), DATE (Date in a structured format), DECIMAL (Decimal number), ALPHANUMERIC (Continuous alphanumeric string with no spaces), STRINGNOWHITESPACE (A string that contains no whitespace characters), SERIALNUMBER (A serial-number style string that contains letters and numbers, and certain symbols; must contain at least one number), ALPHAONLY (Alphabet characters only, no numbers or symbols or whitespace) | [optional]
|
12
13
|
**target_digit_count** | **Integer** | Optional - the target number of digits in the field; useful for fixed-length fields | [optional]
|
data/docs/ImageOcrApi.md
CHANGED
@@ -36,11 +36,11 @@ end
|
|
36
36
|
|
37
37
|
api_instance = CloudmersiveOcrApiClient::ImageOcrApi.new
|
38
38
|
|
39
|
-
image_file = File.new(
|
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
40
|
|
41
41
|
opts = {
|
42
|
-
language:
|
43
|
-
preprocessing:
|
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
44
|
}
|
45
45
|
|
46
46
|
begin
|
@@ -96,11 +96,11 @@ end
|
|
96
96
|
|
97
97
|
api_instance = CloudmersiveOcrApiClient::ImageOcrApi.new
|
98
98
|
|
99
|
-
image_file = File.new(
|
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
100
|
|
101
101
|
opts = {
|
102
|
-
language:
|
103
|
-
preprocessing:
|
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
104
|
}
|
105
105
|
|
106
106
|
begin
|
@@ -156,7 +156,7 @@ end
|
|
156
156
|
|
157
157
|
api_instance = CloudmersiveOcrApiClient::ImageOcrApi.new
|
158
158
|
|
159
|
-
image_file = File.new(
|
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
160
|
|
161
161
|
|
162
162
|
begin
|
@@ -210,14 +210,14 @@ end
|
|
210
210
|
|
211
211
|
api_instance = CloudmersiveOcrApiClient::ImageOcrApi.new
|
212
212
|
|
213
|
-
image_file = File.new(
|
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
214
|
|
215
215
|
opts = {
|
216
|
-
form_template_definition:
|
217
|
-
recognition_mode:
|
218
|
-
preprocessing:
|
219
|
-
diagnostics:
|
220
|
-
language:
|
216
|
+
form_template_definition: nil, # Object | 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
221
|
}
|
222
222
|
|
223
223
|
begin
|
@@ -234,7 +234,7 @@ end
|
|
234
234
|
Name | Type | Description | Notes
|
235
235
|
------------- | ------------- | ------------- | -------------
|
236
236
|
**image_file** | **File**| Image file to perform OCR on. Common file formats such as PNG, JPEG are supported. |
|
237
|
-
**form_template_definition** | **
|
237
|
+
**form_template_definition** | [**Object**](.md)| Form field definitions | [optional]
|
238
238
|
**recognition_mode** | **String**| Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled. | [optional]
|
239
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
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]
|
@@ -276,14 +276,14 @@ end
|
|
276
276
|
|
277
277
|
api_instance = CloudmersiveOcrApiClient::ImageOcrApi.new
|
278
278
|
|
279
|
-
image_file = File.new(
|
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
280
|
|
281
281
|
opts = {
|
282
|
-
bucket_id:
|
283
|
-
bucket_secret_key:
|
284
|
-
recognition_mode:
|
285
|
-
preprocessing:
|
286
|
-
diagnostics:
|
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
287
|
}
|
288
288
|
|
289
289
|
begin
|
@@ -342,12 +342,12 @@ end
|
|
342
342
|
|
343
343
|
api_instance = CloudmersiveOcrApiClient::ImageOcrApi.new
|
344
344
|
|
345
|
-
image_file = File.new(
|
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
346
|
|
347
347
|
opts = {
|
348
|
-
recognition_mode:
|
349
|
-
language:
|
350
|
-
preprocessing:
|
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
351
|
}
|
352
352
|
|
353
353
|
begin
|
@@ -404,10 +404,11 @@ end
|
|
404
404
|
|
405
405
|
api_instance = CloudmersiveOcrApiClient::ImageOcrApi.new
|
406
406
|
|
407
|
-
image_file = File.new(
|
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
408
|
|
409
409
|
opts = {
|
410
|
-
|
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 26-30 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)
|
411
412
|
}
|
412
413
|
|
413
414
|
begin
|
@@ -424,6 +425,7 @@ end
|
|
424
425
|
Name | Type | Description | Notes
|
425
426
|
------------- | ------------- | ------------- | -------------
|
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 26-30 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]
|
427
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]
|
428
430
|
|
429
431
|
### Return type
|
@@ -462,12 +464,13 @@ end
|
|
462
464
|
|
463
465
|
api_instance = CloudmersiveOcrApiClient::ImageOcrApi.new
|
464
466
|
|
465
|
-
image_file = File.new(
|
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.
|
466
468
|
|
467
469
|
opts = {
|
468
|
-
|
469
|
-
|
470
|
-
|
470
|
+
recognition_mode: 'recognition_mode_example', # String | Optional; possible values are 'Normal' which provides highly fault tolerant OCR recognition uses 26-30 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).
|
471
474
|
}
|
472
475
|
|
473
476
|
begin
|
@@ -484,6 +487,7 @@ end
|
|
484
487
|
Name | Type | Description | Notes
|
485
488
|
------------- | ------------- | ------------- | -------------
|
486
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 26-30 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]
|
487
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]
|
488
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]
|
489
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]
|
@@ -524,11 +528,12 @@ end
|
|
524
528
|
|
525
529
|
api_instance = CloudmersiveOcrApiClient::ImageOcrApi.new
|
526
530
|
|
527
|
-
image_file = File.new(
|
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.
|
528
532
|
|
529
533
|
opts = {
|
530
|
-
|
531
|
-
|
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 26-30 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).
|
532
537
|
}
|
533
538
|
|
534
539
|
begin
|
@@ -545,6 +550,7 @@ end
|
|
545
550
|
Name | Type | Description | Notes
|
546
551
|
------------- | ------------- | ------------- | -------------
|
547
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 26-30 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]
|
548
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]
|
549
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]
|
550
556
|
|
data/docs/PdfOcrApi.md
CHANGED
@@ -30,11 +30,11 @@ end
|
|
30
30
|
|
31
31
|
api_instance = CloudmersiveOcrApiClient::PdfOcrApi.new
|
32
32
|
|
33
|
-
image_file = File.new(
|
33
|
+
image_file = File.new('/path/to/file.txt') # File | PDF file to perform OCR on.
|
34
34
|
|
35
35
|
opts = {
|
36
|
-
language:
|
37
|
-
preprocessing:
|
36
|
+
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)
|
37
|
+
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).
|
38
38
|
}
|
39
39
|
|
40
40
|
begin
|
@@ -90,11 +90,11 @@ end
|
|
90
90
|
|
91
91
|
api_instance = CloudmersiveOcrApiClient::PdfOcrApi.new
|
92
92
|
|
93
|
-
image_file = File.new(
|
93
|
+
image_file = File.new('/path/to/file.txt') # File | PDF file to perform OCR on.
|
94
94
|
|
95
95
|
opts = {
|
96
|
-
language:
|
97
|
-
preprocessing:
|
96
|
+
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)
|
97
|
+
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).
|
98
98
|
}
|
99
99
|
|
100
100
|
begin
|
@@ -148,11 +148,12 @@ end
|
|
148
148
|
|
149
149
|
api_instance = CloudmersiveOcrApiClient::PdfOcrApi.new
|
150
150
|
|
151
|
-
image_file = File.new(
|
151
|
+
image_file = File.new('/path/to/file.txt') # File | PDF file to perform OCR on.
|
152
152
|
|
153
153
|
opts = {
|
154
|
-
|
155
|
-
|
154
|
+
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 per page; 'Normal' which provides highly fault tolerant OCR recognition uses 26-30 API calls per page; and 'Advanced' which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls per page. Default recognition mode is 'Basic'
|
155
|
+
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)
|
156
|
+
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).
|
156
157
|
}
|
157
158
|
|
158
159
|
begin
|
@@ -169,6 +170,7 @@ end
|
|
169
170
|
Name | Type | Description | Notes
|
170
171
|
------------- | ------------- | ------------- | -------------
|
171
172
|
**image_file** | **File**| PDF file to perform OCR on. |
|
173
|
+
**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 per page; 'Normal' which provides highly fault tolerant OCR recognition uses 26-30 API calls per page; and 'Advanced' which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls per page. Default recognition mode is 'Basic' | [optional]
|
172
174
|
**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]
|
173
175
|
**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]
|
174
176
|
|
data/docs/PreprocessingApi.md
CHANGED
@@ -33,7 +33,7 @@ end
|
|
33
33
|
|
34
34
|
api_instance = CloudmersiveOcrApiClient::PreprocessingApi.new
|
35
35
|
|
36
|
-
image_file = File.new(
|
36
|
+
image_file = File.new('/path/to/file.txt') # File | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
37
37
|
|
38
38
|
|
39
39
|
begin
|
@@ -87,7 +87,7 @@ end
|
|
87
87
|
|
88
88
|
api_instance = CloudmersiveOcrApiClient::PreprocessingApi.new
|
89
89
|
|
90
|
-
image_file = File.new(
|
90
|
+
image_file = File.new('/path/to/file.txt') # File | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
91
91
|
|
92
92
|
|
93
93
|
begin
|
@@ -141,7 +141,7 @@ end
|
|
141
141
|
|
142
142
|
api_instance = CloudmersiveOcrApiClient::PreprocessingApi.new
|
143
143
|
|
144
|
-
image_file = File.new(
|
144
|
+
image_file = File.new('/path/to/file.txt') # File | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
145
145
|
|
146
146
|
|
147
147
|
begin
|
@@ -195,7 +195,7 @@ end
|
|
195
195
|
|
196
196
|
api_instance = CloudmersiveOcrApiClient::PreprocessingApi.new
|
197
197
|
|
198
|
-
image_file = File.new(
|
198
|
+
image_file = File.new('/path/to/file.txt') # File | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
199
199
|
|
200
200
|
|
201
201
|
begin
|
@@ -249,7 +249,7 @@ end
|
|
249
249
|
|
250
250
|
api_instance = CloudmersiveOcrApiClient::PreprocessingApi.new
|
251
251
|
|
252
|
-
image_file = File.new(
|
252
|
+
image_file = File.new('/path/to/file.txt') # File | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
253
253
|
|
254
254
|
|
255
255
|
begin
|
@@ -303,7 +303,7 @@ end
|
|
303
303
|
|
304
304
|
api_instance = CloudmersiveOcrApiClient::PreprocessingApi.new
|
305
305
|
|
306
|
-
image_file = File.new(
|
306
|
+
image_file = File.new('/path/to/file.txt') # File | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
307
307
|
|
308
308
|
|
309
309
|
begin
|
data/docs/ReceiptsApi.md
CHANGED
@@ -28,7 +28,7 @@ end
|
|
28
28
|
|
29
29
|
api_instance = CloudmersiveOcrApiClient::ReceiptsApi.new
|
30
30
|
|
31
|
-
image_file = File.new(
|
31
|
+
image_file = File.new('/path/to/file.txt') # File | Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
32
32
|
|
33
33
|
|
34
34
|
begin
|
@@ -6,11 +6,11 @@
|
|
6
6
|
OpenAPI spec version: v1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.
|
9
|
+
Swagger Codegen version: 2.4.14
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
|
-
require
|
13
|
+
require 'uri'
|
14
14
|
|
15
15
|
module CloudmersiveOcrApiClient
|
16
16
|
class ImageOcrApi
|
@@ -19,7 +19,6 @@ module CloudmersiveOcrApiClient
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
-
|
23
22
|
# Convert a scanned image into words with location
|
24
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.
|
25
24
|
# @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
@@ -29,7 +28,7 @@ module CloudmersiveOcrApiClient
|
|
29
28
|
# @return [ImageToLinesWithLocationResult]
|
30
29
|
def image_ocr_image_lines_with_location(image_file, opts = {})
|
31
30
|
data, _status_code, _headers = image_ocr_image_lines_with_location_with_http_info(image_file, opts)
|
32
|
-
|
31
|
+
data
|
33
32
|
end
|
34
33
|
|
35
34
|
# Convert a scanned image into words with location
|
@@ -41,14 +40,14 @@ module CloudmersiveOcrApiClient
|
|
41
40
|
# @return [Array<(ImageToLinesWithLocationResult, Fixnum, Hash)>] ImageToLinesWithLocationResult data, response status code and response headers
|
42
41
|
def image_ocr_image_lines_with_location_with_http_info(image_file, opts = {})
|
43
42
|
if @api_client.config.debugging
|
44
|
-
@api_client.config.logger.debug
|
43
|
+
@api_client.config.logger.debug 'Calling API: ImageOcrApi.image_ocr_image_lines_with_location ...'
|
45
44
|
end
|
46
45
|
# verify the required parameter 'image_file' is set
|
47
46
|
if @api_client.config.client_side_validation && image_file.nil?
|
48
47
|
fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_image_lines_with_location"
|
49
48
|
end
|
50
49
|
# resource path
|
51
|
-
local_var_path =
|
50
|
+
local_var_path = '/ocr/image/to/lines-with-location'
|
52
51
|
|
53
52
|
# query parameters
|
54
53
|
query_params = {}
|
@@ -64,7 +63,7 @@ module CloudmersiveOcrApiClient
|
|
64
63
|
|
65
64
|
# form parameters
|
66
65
|
form_params = {}
|
67
|
-
form_params[
|
66
|
+
form_params['imageFile'] = image_file
|
68
67
|
|
69
68
|
# http body (model)
|
70
69
|
post_body = nil
|
@@ -81,7 +80,6 @@ module CloudmersiveOcrApiClient
|
|
81
80
|
end
|
82
81
|
return data, status_code, headers
|
83
82
|
end
|
84
|
-
|
85
83
|
# Convert a scanned image into words with location
|
86
84
|
# 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.
|
87
85
|
# @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
@@ -91,7 +89,7 @@ module CloudmersiveOcrApiClient
|
|
91
89
|
# @return [ImageToWordsWithLocationResult]
|
92
90
|
def image_ocr_image_words_with_location(image_file, opts = {})
|
93
91
|
data, _status_code, _headers = image_ocr_image_words_with_location_with_http_info(image_file, opts)
|
94
|
-
|
92
|
+
data
|
95
93
|
end
|
96
94
|
|
97
95
|
# Convert a scanned image into words with location
|
@@ -103,14 +101,14 @@ module CloudmersiveOcrApiClient
|
|
103
101
|
# @return [Array<(ImageToWordsWithLocationResult, Fixnum, Hash)>] ImageToWordsWithLocationResult data, response status code and response headers
|
104
102
|
def image_ocr_image_words_with_location_with_http_info(image_file, opts = {})
|
105
103
|
if @api_client.config.debugging
|
106
|
-
@api_client.config.logger.debug
|
104
|
+
@api_client.config.logger.debug 'Calling API: ImageOcrApi.image_ocr_image_words_with_location ...'
|
107
105
|
end
|
108
106
|
# verify the required parameter 'image_file' is set
|
109
107
|
if @api_client.config.client_side_validation && image_file.nil?
|
110
108
|
fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_image_words_with_location"
|
111
109
|
end
|
112
110
|
# resource path
|
113
|
-
local_var_path =
|
111
|
+
local_var_path = '/ocr/image/to/words-with-location'
|
114
112
|
|
115
113
|
# query parameters
|
116
114
|
query_params = {}
|
@@ -126,7 +124,7 @@ module CloudmersiveOcrApiClient
|
|
126
124
|
|
127
125
|
# form parameters
|
128
126
|
form_params = {}
|
129
|
-
form_params[
|
127
|
+
form_params['imageFile'] = image_file
|
130
128
|
|
131
129
|
# http body (model)
|
132
130
|
post_body = nil
|
@@ -143,7 +141,6 @@ module CloudmersiveOcrApiClient
|
|
143
141
|
end
|
144
142
|
return data, status_code, headers
|
145
143
|
end
|
146
|
-
|
147
144
|
# Recognize a photo of a business card, extract key business information
|
148
145
|
# 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.
|
149
146
|
# @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
@@ -151,7 +148,7 @@ module CloudmersiveOcrApiClient
|
|
151
148
|
# @return [BusinessCardRecognitionResult]
|
152
149
|
def image_ocr_photo_recognize_business_card(image_file, opts = {})
|
153
150
|
data, _status_code, _headers = image_ocr_photo_recognize_business_card_with_http_info(image_file, opts)
|
154
|
-
|
151
|
+
data
|
155
152
|
end
|
156
153
|
|
157
154
|
# Recognize a photo of a business card, extract key business information
|
@@ -161,14 +158,14 @@ module CloudmersiveOcrApiClient
|
|
161
158
|
# @return [Array<(BusinessCardRecognitionResult, Fixnum, Hash)>] BusinessCardRecognitionResult data, response status code and response headers
|
162
159
|
def image_ocr_photo_recognize_business_card_with_http_info(image_file, opts = {})
|
163
160
|
if @api_client.config.debugging
|
164
|
-
@api_client.config.logger.debug
|
161
|
+
@api_client.config.logger.debug 'Calling API: ImageOcrApi.image_ocr_photo_recognize_business_card ...'
|
165
162
|
end
|
166
163
|
# verify the required parameter 'image_file' is set
|
167
164
|
if @api_client.config.client_side_validation && image_file.nil?
|
168
165
|
fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_photo_recognize_business_card"
|
169
166
|
end
|
170
167
|
# resource path
|
171
|
-
local_var_path =
|
168
|
+
local_var_path = '/ocr/photo/recognize/business-card'
|
172
169
|
|
173
170
|
# query parameters
|
174
171
|
query_params = {}
|
@@ -182,7 +179,7 @@ module CloudmersiveOcrApiClient
|
|
182
179
|
|
183
180
|
# form parameters
|
184
181
|
form_params = {}
|
185
|
-
form_params[
|
182
|
+
form_params['imageFile'] = image_file
|
186
183
|
|
187
184
|
# http body (model)
|
188
185
|
post_body = nil
|
@@ -199,12 +196,11 @@ module CloudmersiveOcrApiClient
|
|
199
196
|
end
|
200
197
|
return data, status_code, headers
|
201
198
|
end
|
202
|
-
|
203
199
|
# Recognize a photo of a form, extract key fields and business information
|
204
200
|
# 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.
|
205
201
|
# @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
206
202
|
# @param [Hash] opts the optional parameters
|
207
|
-
# @option opts [
|
203
|
+
# @option opts [Object] :form_template_definition Form field definitions
|
208
204
|
# @option opts [String] :recognition_mode Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled.
|
209
205
|
# @option opts [String] :preprocessing 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.
|
210
206
|
# @option opts [String] :diagnostics 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).
|
@@ -212,14 +208,14 @@ module CloudmersiveOcrApiClient
|
|
212
208
|
# @return [FormRecognitionResult]
|
213
209
|
def image_ocr_photo_recognize_form(image_file, opts = {})
|
214
210
|
data, _status_code, _headers = image_ocr_photo_recognize_form_with_http_info(image_file, opts)
|
215
|
-
|
211
|
+
data
|
216
212
|
end
|
217
213
|
|
218
214
|
# Recognize a photo of a form, extract key fields and business information
|
219
215
|
# 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.
|
220
216
|
# @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
221
217
|
# @param [Hash] opts the optional parameters
|
222
|
-
# @option opts [
|
218
|
+
# @option opts [Object] :form_template_definition Form field definitions
|
223
219
|
# @option opts [String] :recognition_mode Optional, enable advanced recognition mode by specifying 'Advanced', enable handwriting recognition by specifying 'EnableHandwriting'. Default is disabled.
|
224
220
|
# @option opts [String] :preprocessing 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.
|
225
221
|
# @option opts [String] :diagnostics 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).
|
@@ -227,14 +223,14 @@ module CloudmersiveOcrApiClient
|
|
227
223
|
# @return [Array<(FormRecognitionResult, Fixnum, Hash)>] FormRecognitionResult data, response status code and response headers
|
228
224
|
def image_ocr_photo_recognize_form_with_http_info(image_file, opts = {})
|
229
225
|
if @api_client.config.debugging
|
230
|
-
@api_client.config.logger.debug
|
226
|
+
@api_client.config.logger.debug 'Calling API: ImageOcrApi.image_ocr_photo_recognize_form ...'
|
231
227
|
end
|
232
228
|
# verify the required parameter 'image_file' is set
|
233
229
|
if @api_client.config.client_side_validation && image_file.nil?
|
234
230
|
fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_photo_recognize_form"
|
235
231
|
end
|
236
232
|
# resource path
|
237
|
-
local_var_path =
|
233
|
+
local_var_path = '/ocr/photo/recognize/form'
|
238
234
|
|
239
235
|
# query parameters
|
240
236
|
query_params = {}
|
@@ -253,7 +249,7 @@ module CloudmersiveOcrApiClient
|
|
253
249
|
|
254
250
|
# form parameters
|
255
251
|
form_params = {}
|
256
|
-
form_params[
|
252
|
+
form_params['imageFile'] = image_file
|
257
253
|
|
258
254
|
# http body (model)
|
259
255
|
post_body = nil
|
@@ -270,7 +266,6 @@ module CloudmersiveOcrApiClient
|
|
270
266
|
end
|
271
267
|
return data, status_code, headers
|
272
268
|
end
|
273
|
-
|
274
269
|
# Recognize a photo of a form, extract key fields using stored templates
|
275
270
|
# 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
|
276
271
|
# @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
@@ -283,7 +278,7 @@ module CloudmersiveOcrApiClient
|
|
283
278
|
# @return [FormRecognitionResult]
|
284
279
|
def image_ocr_photo_recognize_form_advanced(image_file, opts = {})
|
285
280
|
data, _status_code, _headers = image_ocr_photo_recognize_form_advanced_with_http_info(image_file, opts)
|
286
|
-
|
281
|
+
data
|
287
282
|
end
|
288
283
|
|
289
284
|
# Recognize a photo of a form, extract key fields using stored templates
|
@@ -298,14 +293,14 @@ module CloudmersiveOcrApiClient
|
|
298
293
|
# @return [Array<(FormRecognitionResult, Fixnum, Hash)>] FormRecognitionResult data, response status code and response headers
|
299
294
|
def image_ocr_photo_recognize_form_advanced_with_http_info(image_file, opts = {})
|
300
295
|
if @api_client.config.debugging
|
301
|
-
@api_client.config.logger.debug
|
296
|
+
@api_client.config.logger.debug 'Calling API: ImageOcrApi.image_ocr_photo_recognize_form_advanced ...'
|
302
297
|
end
|
303
298
|
# verify the required parameter 'image_file' is set
|
304
299
|
if @api_client.config.client_side_validation && image_file.nil?
|
305
300
|
fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_photo_recognize_form_advanced"
|
306
301
|
end
|
307
302
|
# resource path
|
308
|
-
local_var_path =
|
303
|
+
local_var_path = '/ocr/photo/recognize/form/advanced'
|
309
304
|
|
310
305
|
# query parameters
|
311
306
|
query_params = {}
|
@@ -324,7 +319,7 @@ module CloudmersiveOcrApiClient
|
|
324
319
|
|
325
320
|
# form parameters
|
326
321
|
form_params = {}
|
327
|
-
form_params[
|
322
|
+
form_params['imageFile'] = image_file
|
328
323
|
|
329
324
|
# http body (model)
|
330
325
|
post_body = nil
|
@@ -341,7 +336,6 @@ module CloudmersiveOcrApiClient
|
|
341
336
|
end
|
342
337
|
return data, status_code, headers
|
343
338
|
end
|
344
|
-
|
345
339
|
# Recognize a photo of a receipt, extract key business information
|
346
340
|
# 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.
|
347
341
|
# @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
@@ -352,7 +346,7 @@ module CloudmersiveOcrApiClient
|
|
352
346
|
# @return [ReceiptRecognitionResult]
|
353
347
|
def image_ocr_photo_recognize_receipt(image_file, opts = {})
|
354
348
|
data, _status_code, _headers = image_ocr_photo_recognize_receipt_with_http_info(image_file, opts)
|
355
|
-
|
349
|
+
data
|
356
350
|
end
|
357
351
|
|
358
352
|
# Recognize a photo of a receipt, extract key business information
|
@@ -365,14 +359,14 @@ module CloudmersiveOcrApiClient
|
|
365
359
|
# @return [Array<(ReceiptRecognitionResult, Fixnum, Hash)>] ReceiptRecognitionResult data, response status code and response headers
|
366
360
|
def image_ocr_photo_recognize_receipt_with_http_info(image_file, opts = {})
|
367
361
|
if @api_client.config.debugging
|
368
|
-
@api_client.config.logger.debug
|
362
|
+
@api_client.config.logger.debug 'Calling API: ImageOcrApi.image_ocr_photo_recognize_receipt ...'
|
369
363
|
end
|
370
364
|
# verify the required parameter 'image_file' is set
|
371
365
|
if @api_client.config.client_side_validation && image_file.nil?
|
372
366
|
fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_photo_recognize_receipt"
|
373
367
|
end
|
374
368
|
# resource path
|
375
|
-
local_var_path =
|
369
|
+
local_var_path = '/ocr/photo/recognize/receipt'
|
376
370
|
|
377
371
|
# query parameters
|
378
372
|
query_params = {}
|
@@ -389,7 +383,7 @@ module CloudmersiveOcrApiClient
|
|
389
383
|
|
390
384
|
# form parameters
|
391
385
|
form_params = {}
|
392
|
-
form_params[
|
386
|
+
form_params['imageFile'] = image_file
|
393
387
|
|
394
388
|
# http body (model)
|
395
389
|
post_body = nil
|
@@ -406,34 +400,35 @@ module CloudmersiveOcrApiClient
|
|
406
400
|
end
|
407
401
|
return data, status_code, headers
|
408
402
|
end
|
409
|
-
|
410
403
|
# Convert a photo of a document into text
|
411
404
|
# 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.
|
412
405
|
# @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
413
406
|
# @param [Hash] opts the optional parameters
|
407
|
+
# @option opts [String] :recognition_mode 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 26-30 API calls; and 'Advanced' which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls. Default recognition mode is 'Advanced'
|
414
408
|
# @option opts [String] :language 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)
|
415
409
|
# @return [ImageToTextResponse]
|
416
410
|
def image_ocr_photo_to_text(image_file, opts = {})
|
417
411
|
data, _status_code, _headers = image_ocr_photo_to_text_with_http_info(image_file, opts)
|
418
|
-
|
412
|
+
data
|
419
413
|
end
|
420
414
|
|
421
415
|
# Convert a photo of a document into text
|
422
416
|
# 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.
|
423
417
|
# @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
424
418
|
# @param [Hash] opts the optional parameters
|
419
|
+
# @option opts [String] :recognition_mode 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 26-30 API calls; and 'Advanced' which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls. Default recognition mode is 'Advanced'
|
425
420
|
# @option opts [String] :language 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)
|
426
421
|
# @return [Array<(ImageToTextResponse, Fixnum, Hash)>] ImageToTextResponse data, response status code and response headers
|
427
422
|
def image_ocr_photo_to_text_with_http_info(image_file, opts = {})
|
428
423
|
if @api_client.config.debugging
|
429
|
-
@api_client.config.logger.debug
|
424
|
+
@api_client.config.logger.debug 'Calling API: ImageOcrApi.image_ocr_photo_to_text ...'
|
430
425
|
end
|
431
426
|
# verify the required parameter 'image_file' is set
|
432
427
|
if @api_client.config.client_side_validation && image_file.nil?
|
433
428
|
fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_photo_to_text"
|
434
429
|
end
|
435
430
|
# resource path
|
436
|
-
local_var_path =
|
431
|
+
local_var_path = '/ocr/photo/toText'
|
437
432
|
|
438
433
|
# query parameters
|
439
434
|
query_params = {}
|
@@ -444,11 +439,12 @@ module CloudmersiveOcrApiClient
|
|
444
439
|
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
|
445
440
|
# HTTP header 'Content-Type'
|
446
441
|
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
442
|
+
header_params[:'recognitionMode'] = opts[:'recognition_mode'] if !opts[:'recognition_mode'].nil?
|
447
443
|
header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
|
448
444
|
|
449
445
|
# form parameters
|
450
446
|
form_params = {}
|
451
|
-
form_params[
|
447
|
+
form_params['imageFile'] = image_file
|
452
448
|
|
453
449
|
# http body (model)
|
454
450
|
post_body = nil
|
@@ -465,38 +461,39 @@ module CloudmersiveOcrApiClient
|
|
465
461
|
end
|
466
462
|
return data, status_code, headers
|
467
463
|
end
|
468
|
-
|
469
464
|
# Convert a photo of a document or receipt into words with location
|
470
465
|
# 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.
|
471
466
|
# @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
472
467
|
# @param [Hash] opts the optional parameters
|
468
|
+
# @option opts [String] :recognition_mode Optional; possible values are 'Normal' which provides highly fault tolerant OCR recognition uses 26-30 API calls; and 'Advanced' which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls. Default recognition mode is 'Advanced'
|
473
469
|
# @option opts [String] :language 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)
|
474
470
|
# @option opts [String] :preprocessing 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).
|
475
471
|
# @option opts [String] :diagnostics 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).
|
476
472
|
# @return [PhotoToWordsWithLocationResult]
|
477
473
|
def image_ocr_photo_words_with_location(image_file, opts = {})
|
478
474
|
data, _status_code, _headers = image_ocr_photo_words_with_location_with_http_info(image_file, opts)
|
479
|
-
|
475
|
+
data
|
480
476
|
end
|
481
477
|
|
482
478
|
# Convert a photo of a document or receipt into words with location
|
483
479
|
# 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.
|
484
480
|
# @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
485
481
|
# @param [Hash] opts the optional parameters
|
482
|
+
# @option opts [String] :recognition_mode Optional; possible values are 'Normal' which provides highly fault tolerant OCR recognition uses 26-30 API calls; and 'Advanced' which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls. Default recognition mode is 'Advanced'
|
486
483
|
# @option opts [String] :language 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)
|
487
484
|
# @option opts [String] :preprocessing 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).
|
488
485
|
# @option opts [String] :diagnostics 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).
|
489
486
|
# @return [Array<(PhotoToWordsWithLocationResult, Fixnum, Hash)>] PhotoToWordsWithLocationResult data, response status code and response headers
|
490
487
|
def image_ocr_photo_words_with_location_with_http_info(image_file, opts = {})
|
491
488
|
if @api_client.config.debugging
|
492
|
-
@api_client.config.logger.debug
|
489
|
+
@api_client.config.logger.debug 'Calling API: ImageOcrApi.image_ocr_photo_words_with_location ...'
|
493
490
|
end
|
494
491
|
# verify the required parameter 'image_file' is set
|
495
492
|
if @api_client.config.client_side_validation && image_file.nil?
|
496
493
|
fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_photo_words_with_location"
|
497
494
|
end
|
498
495
|
# resource path
|
499
|
-
local_var_path =
|
496
|
+
local_var_path = '/ocr/photo/to/words-with-location'
|
500
497
|
|
501
498
|
# query parameters
|
502
499
|
query_params = {}
|
@@ -507,13 +504,14 @@ module CloudmersiveOcrApiClient
|
|
507
504
|
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
|
508
505
|
# HTTP header 'Content-Type'
|
509
506
|
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
507
|
+
header_params[:'recognitionMode'] = opts[:'recognition_mode'] if !opts[:'recognition_mode'].nil?
|
510
508
|
header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
|
511
509
|
header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil?
|
512
510
|
header_params[:'diagnostics'] = opts[:'diagnostics'] if !opts[:'diagnostics'].nil?
|
513
511
|
|
514
512
|
# form parameters
|
515
513
|
form_params = {}
|
516
|
-
form_params[
|
514
|
+
form_params['imageFile'] = image_file
|
517
515
|
|
518
516
|
# http body (model)
|
519
517
|
post_body = nil
|
@@ -530,36 +528,37 @@ module CloudmersiveOcrApiClient
|
|
530
528
|
end
|
531
529
|
return data, status_code, headers
|
532
530
|
end
|
533
|
-
|
534
531
|
# Convert a scanned image into text
|
535
532
|
# 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.
|
536
533
|
# @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
537
534
|
# @param [Hash] opts the optional parameters
|
535
|
+
# @option opts [String] :recognition_mode 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 26-30 API calls; and 'Advanced' which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls. Default recognition mode is 'Advanced'
|
538
536
|
# @option opts [String] :language 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)
|
539
537
|
# @option opts [String] :preprocessing 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).
|
540
538
|
# @return [ImageToTextResponse]
|
541
539
|
def image_ocr_post(image_file, opts = {})
|
542
540
|
data, _status_code, _headers = image_ocr_post_with_http_info(image_file, opts)
|
543
|
-
|
541
|
+
data
|
544
542
|
end
|
545
543
|
|
546
544
|
# Convert a scanned image into text
|
547
545
|
# 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.
|
548
546
|
# @param image_file Image file to perform OCR on. Common file formats such as PNG, JPEG are supported.
|
549
547
|
# @param [Hash] opts the optional parameters
|
548
|
+
# @option opts [String] :recognition_mode 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 26-30 API calls; and 'Advanced' which provides the highest quality and most fault-tolerant recognition uses 28-30 API calls. Default recognition mode is 'Advanced'
|
550
549
|
# @option opts [String] :language 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)
|
551
550
|
# @option opts [String] :preprocessing 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).
|
552
551
|
# @return [Array<(ImageToTextResponse, Fixnum, Hash)>] ImageToTextResponse data, response status code and response headers
|
553
552
|
def image_ocr_post_with_http_info(image_file, opts = {})
|
554
553
|
if @api_client.config.debugging
|
555
|
-
@api_client.config.logger.debug
|
554
|
+
@api_client.config.logger.debug 'Calling API: ImageOcrApi.image_ocr_post ...'
|
556
555
|
end
|
557
556
|
# verify the required parameter 'image_file' is set
|
558
557
|
if @api_client.config.client_side_validation && image_file.nil?
|
559
558
|
fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_post"
|
560
559
|
end
|
561
560
|
# resource path
|
562
|
-
local_var_path =
|
561
|
+
local_var_path = '/ocr/image/toText'
|
563
562
|
|
564
563
|
# query parameters
|
565
564
|
query_params = {}
|
@@ -570,12 +569,13 @@ module CloudmersiveOcrApiClient
|
|
570
569
|
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
|
571
570
|
# HTTP header 'Content-Type'
|
572
571
|
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
572
|
+
header_params[:'recognitionMode'] = opts[:'recognition_mode'] if !opts[:'recognition_mode'].nil?
|
573
573
|
header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
|
574
574
|
header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil?
|
575
575
|
|
576
576
|
# form parameters
|
577
577
|
form_params = {}
|
578
|
-
form_params[
|
578
|
+
form_params['imageFile'] = image_file
|
579
579
|
|
580
580
|
# http body (model)
|
581
581
|
post_body = nil
|