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_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_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_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.
153 154 155 156 |
# File 'lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb', line 153 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.
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_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_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.
213 214 215 216 |
# File 'lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb', line 213 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.
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 264 265 266 |
# File 'lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb', line 225 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 |