Class: CloudmersiveOcrApiClient::ImageOcrApi
- Inherits:
-
Object
- Object
- CloudmersiveOcrApiClient::ImageOcrApi
- Defined in:
- lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#image_ocr_image_lines_with_location(image_file, opts = {}) ⇒ ImageToLinesWithLocationResult
Convert a scanned image into words with location Converts an uploaded image in common formats such as JPEG, PNG into lines/text with location information and other metdata via Optical Character Recognition.
-
#image_ocr_image_lines_with_location_with_http_info(image_file, opts = {}) ⇒ Array<(ImageToLinesWithLocationResult, Fixnum, Hash)>
Convert a scanned image into words with location Converts an uploaded image in common formats such as JPEG, PNG into lines/text with location information and other metdata via Optical Character Recognition.
-
#image_ocr_image_words_with_location(image_file, opts = {}) ⇒ ImageToWordsWithLocationResult
Convert a scanned image into words with location Converts an uploaded image in common formats such as JPEG, PNG into words/text with location information and other metdata via Optical Character Recognition.
-
#image_ocr_image_words_with_location_with_http_info(image_file, opts = {}) ⇒ Array<(ImageToWordsWithLocationResult, Fixnum, Hash)>
Convert a scanned image into words with location Converts an uploaded image in common formats such as JPEG, PNG into words/text with location information and other metdata via Optical Character Recognition.
-
#image_ocr_photo_recognize_receipt(image_file, opts = {}) ⇒ ReceiptRecognitionResult
Recognize a photo of a receipt, extract key business information 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.
-
#image_ocr_photo_recognize_receipt_with_http_info(image_file, opts = {}) ⇒ Array<(ReceiptRecognitionResult, Fixnum, Hash)>
Recognize a photo of a receipt, extract key business information 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.
-
#image_ocr_photo_to_text(image_file, opts = {}) ⇒ ImageToTextResponse
Convert a photo of a document into text Converts an uploaded photo of a document in common formats such as JPEG, PNG into text via Optical Character Recognition.
-
#image_ocr_photo_to_text_with_http_info(image_file, opts = {}) ⇒ Array<(ImageToTextResponse, Fixnum, Hash)>
Convert a photo of a document into text Converts an uploaded photo of a document in common formats such as JPEG, PNG into text via Optical Character Recognition.
-
#image_ocr_photo_words_with_location(image_file, opts = {}) ⇒ PhotoToWordsWithLocationResult
Convert a photo of a document or receipt into words with location 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.
-
#image_ocr_photo_words_with_location_with_http_info(image_file, opts = {}) ⇒ Array<(PhotoToWordsWithLocationResult, Fixnum, Hash)>
Convert a photo of a document or receipt into words with location 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.
-
#image_ocr_post(image_file, opts = {}) ⇒ ImageToTextResponse
Convert a scanned image into text Converts an uploaded image in common formats such as JPEG, PNG into text via Optical Character Recognition.
-
#image_ocr_post_with_http_info(image_file, opts = {}) ⇒ Array<(ImageToTextResponse, Fixnum, Hash)>
Convert a scanned image into text Converts an uploaded image in common formats such as JPEG, PNG into text via Optical Character Recognition.
-
#initialize(api_client = ApiClient.default) ⇒ ImageOcrApi
constructor
A new instance of ImageOcrApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ImageOcrApi
Returns a new instance of ImageOcrApi.
19 20 21 |
# File 'lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#image_ocr_image_lines_with_location(image_file, opts = {}) ⇒ ImageToLinesWithLocationResult
Convert a scanned image into words with location 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.
30 31 32 33 |
# File 'lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb', line 30 def image_ocr_image_lines_with_location(image_file, opts = {}) data, _status_code, _headers = image_ocr_image_lines_with_location_with_http_info(image_file, opts) return data end |
#image_ocr_image_lines_with_location_with_http_info(image_file, opts = {}) ⇒ Array<(ImageToLinesWithLocationResult, Fixnum, Hash)>
Convert a scanned image into words with location 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.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb', line 42 def image_ocr_image_lines_with_location_with_http_info(image_file, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ImageOcrApi.image_ocr_image_lines_with_location ..." end # verify the required parameter 'image_file' is set if @api_client.config.client_side_validation && image_file.nil? fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_image_lines_with_location" end # resource path local_var_path = "/ocr/image/to/lines-with-location" # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil? header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil? # form parameters form_params = {} form_params["imageFile"] = image_file # http body (model) post_body = nil auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ImageToLinesWithLocationResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: ImageOcrApi#image_ocr_image_lines_with_location\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#image_ocr_image_words_with_location(image_file, opts = {}) ⇒ ImageToWordsWithLocationResult
Convert a scanned image into words with location 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.
92 93 94 95 |
# File 'lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb', line 92 def image_ocr_image_words_with_location(image_file, opts = {}) data, _status_code, _headers = image_ocr_image_words_with_location_with_http_info(image_file, opts) return data end |
#image_ocr_image_words_with_location_with_http_info(image_file, opts = {}) ⇒ Array<(ImageToWordsWithLocationResult, Fixnum, Hash)>
Convert a scanned image into words with location 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.
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb', line 104 def image_ocr_image_words_with_location_with_http_info(image_file, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ImageOcrApi.image_ocr_image_words_with_location ..." end # verify the required parameter 'image_file' is set if @api_client.config.client_side_validation && image_file.nil? fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_image_words_with_location" end # resource path local_var_path = "/ocr/image/to/words-with-location" # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil? header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil? # form parameters form_params = {} form_params["imageFile"] = image_file # http body (model) post_body = nil auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ImageToWordsWithLocationResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: ImageOcrApi#image_ocr_image_words_with_location\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#image_ocr_photo_recognize_receipt(image_file, opts = {}) ⇒ ReceiptRecognitionResult
Recognize a photo of a receipt, extract key business information 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.
153 154 155 156 |
# File 'lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb', line 153 def image_ocr_photo_recognize_receipt(image_file, opts = {}) data, _status_code, _headers = image_ocr_photo_recognize_receipt_with_http_info(image_file, opts) return data end |
#image_ocr_photo_recognize_receipt_with_http_info(image_file, opts = {}) ⇒ Array<(ReceiptRecognitionResult, Fixnum, Hash)>
Recognize a photo of a receipt, extract key business information 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.
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb', line 164 def image_ocr_photo_recognize_receipt_with_http_info(image_file, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ImageOcrApi.image_ocr_photo_recognize_receipt ..." end # verify the required parameter 'image_file' is set if @api_client.config.client_side_validation && image_file.nil? fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_photo_recognize_receipt" end # resource path local_var_path = "/ocr/photo/recognize/receipt" # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil? # form parameters form_params = {} form_params["imageFile"] = image_file # http body (model) post_body = nil auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ReceiptRecognitionResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: ImageOcrApi#image_ocr_photo_recognize_receipt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#image_ocr_photo_to_text(image_file, opts = {}) ⇒ ImageToTextResponse
Convert a photo of a document into text 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.
212 213 214 215 |
# File 'lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb', line 212 def image_ocr_photo_to_text(image_file, opts = {}) data, _status_code, _headers = image_ocr_photo_to_text_with_http_info(image_file, opts) return data end |
#image_ocr_photo_to_text_with_http_info(image_file, opts = {}) ⇒ Array<(ImageToTextResponse, Fixnum, Hash)>
Convert a photo of a document into text 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.
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 |
# File 'lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb', line 223 def image_ocr_photo_to_text_with_http_info(image_file, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ImageOcrApi.image_ocr_photo_to_text ..." end # verify the required parameter 'image_file' is set if @api_client.config.client_side_validation && image_file.nil? fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_photo_to_text" end # resource path local_var_path = "/ocr/photo/toText" # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil? # form parameters form_params = {} form_params["imageFile"] = image_file # http body (model) post_body = nil auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ImageToTextResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ImageOcrApi#image_ocr_photo_to_text\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#image_ocr_photo_words_with_location(image_file, opts = {}) ⇒ PhotoToWordsWithLocationResult
Convert a photo of a document or receipt into words with location 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.
273 274 275 276 |
# File 'lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb', line 273 def image_ocr_photo_words_with_location(image_file, opts = {}) data, _status_code, _headers = image_ocr_photo_words_with_location_with_http_info(image_file, opts) return data end |
#image_ocr_photo_words_with_location_with_http_info(image_file, opts = {}) ⇒ Array<(PhotoToWordsWithLocationResult, Fixnum, Hash)>
Convert a photo of a document or receipt into words with location 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.
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |
# File 'lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb', line 286 def image_ocr_photo_words_with_location_with_http_info(image_file, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ImageOcrApi.image_ocr_photo_words_with_location ..." end # verify the required parameter 'image_file' is set if @api_client.config.client_side_validation && image_file.nil? fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_photo_words_with_location" end # resource path local_var_path = "/ocr/photo/to/words-with-location" # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil? header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil? header_params[:'diagnostics'] = opts[:'diagnostics'] if !opts[:'diagnostics'].nil? # form parameters form_params = {} form_params["imageFile"] = image_file # http body (model) post_body = nil auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PhotoToWordsWithLocationResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: ImageOcrApi#image_ocr_photo_words_with_location\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#image_ocr_post(image_file, opts = {}) ⇒ ImageToTextResponse
Convert a scanned image into text 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.
337 338 339 340 |
# File 'lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb', line 337 def image_ocr_post(image_file, opts = {}) data, _status_code, _headers = image_ocr_post_with_http_info(image_file, opts) return data end |
#image_ocr_post_with_http_info(image_file, opts = {}) ⇒ Array<(ImageToTextResponse, Fixnum, Hash)>
Convert a scanned image into text 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.
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 |
# File 'lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb', line 349 def image_ocr_post_with_http_info(image_file, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ImageOcrApi.image_ocr_post ..." end # verify the required parameter 'image_file' is set if @api_client.config.client_side_validation && image_file.nil? fail ArgumentError, "Missing the required parameter 'image_file' when calling ImageOcrApi.image_ocr_post" end # resource path local_var_path = "/ocr/image/toText" # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) header_params[:'language'] = opts[:'language'] if !opts[:'language'].nil? header_params[:'preprocessing'] = opts[:'preprocessing'] if !opts[:'preprocessing'].nil? # form parameters form_params = {} form_params["imageFile"] = image_file # http body (model) post_body = nil auth_names = ['Apikey'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ImageToTextResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ImageOcrApi#image_ocr_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |