cloudmersive-image-recognition-api-client 1.4.6 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- metadata +3 -145
- data/Gemfile +0 -7
- data/README.md +0 -184
- data/Rakefile +0 -8
- data/cloudmersive-image-recognition-api-client.gemspec +0 -45
- data/docs/AgeDetectionResult.md +0 -10
- data/docs/ArtisticApi.md +0 -66
- data/docs/ColorResult.md +0 -10
- data/docs/ConvertApi.md +0 -396
- data/docs/DetectedLicensePlate.md +0 -14
- data/docs/DetectedObject.md +0 -13
- data/docs/DominantColorResult.md +0 -9
- data/docs/DrawPolygonInstance.md +0 -11
- data/docs/DrawPolygonRequest.md +0 -10
- data/docs/DrawRectangleInstance.md +0 -14
- data/docs/DrawRectangleRequest.md +0 -10
- data/docs/DrawTextInstance.md +0 -15
- data/docs/DrawTextRequest.md +0 -10
- data/docs/EditApi.md +0 -704
- data/docs/Face.md +0 -11
- data/docs/FaceApi.md +0 -396
- data/docs/FaceCompareResponse.md +0 -11
- data/docs/FaceLocateResponse.md +0 -11
- data/docs/FaceLocateWithLandmarksResponse.md +0 -11
- data/docs/FaceMatch.md +0 -13
- data/docs/FacePoint.md +0 -9
- data/docs/FaceWithLandmarks.md +0 -20
- data/docs/FilterApi.md +0 -478
- data/docs/FindSymbolResult.md +0 -13
- data/docs/FineTextDetectionResult.md +0 -10
- data/docs/FineTextItem.md +0 -18
- data/docs/GenderDetectionResult.md +0 -10
- data/docs/ImageDescriptionResponse.md +0 -11
- data/docs/ImageMetadata.md +0 -17
- data/docs/ImageMetadataExifValue.md +0 -10
- data/docs/InfoApi.md +0 -118
- data/docs/NsfwApi.md +0 -63
- data/docs/NsfwResult.md +0 -10
- data/docs/ObjectDetectionResult.md +0 -10
- data/docs/PersonWithAge.md +0 -11
- data/docs/PersonWithGender.md +0 -10
- data/docs/PolygonPoint.md +0 -9
- data/docs/RecognitionOutcome.md +0 -9
- data/docs/RecognizeApi.md +0 -455
- data/docs/ResizeApi.md +0 -130
- data/docs/TextDetectionResult.md +0 -10
- data/docs/TextItem.md +0 -11
- data/docs/VehicleLicensePlateDetectionResult.md +0 -10
- data/git_push.sh +0 -55
- data/lib/cloudmersive-image-recognition-api-client.rb +0 -82
- data/lib/cloudmersive-image-recognition-api-client/api/artistic_api.rb +0 -85
- data/lib/cloudmersive-image-recognition-api-client/api/convert_api.rb +0 -421
- data/lib/cloudmersive-image-recognition-api-client/api/edit_api.rb +0 -765
- data/lib/cloudmersive-image-recognition-api-client/api/face_api.rb +0 -422
- data/lib/cloudmersive-image-recognition-api-client/api/filter_api.rb +0 -533
- data/lib/cloudmersive-image-recognition-api-client/api/info_api.rb +0 -135
- data/lib/cloudmersive-image-recognition-api-client/api/nsfw_api.rb +0 -79
- data/lib/cloudmersive-image-recognition-api-client/api/recognize_api.rb +0 -481
- data/lib/cloudmersive-image-recognition-api-client/api/resize_api.rb +0 -159
- data/lib/cloudmersive-image-recognition-api-client/api_client.rb +0 -389
- data/lib/cloudmersive-image-recognition-api-client/api_error.rb +0 -38
- data/lib/cloudmersive-image-recognition-api-client/configuration.rb +0 -209
- data/lib/cloudmersive-image-recognition-api-client/models/age_detection_result.rb +0 -211
- data/lib/cloudmersive-image-recognition-api-client/models/color_result.rb +0 -209
- data/lib/cloudmersive-image-recognition-api-client/models/detected_license_plate.rb +0 -249
- data/lib/cloudmersive-image-recognition-api-client/models/detected_object.rb +0 -239
- data/lib/cloudmersive-image-recognition-api-client/models/dominant_color_result.rb +0 -201
- data/lib/cloudmersive-image-recognition-api-client/models/draw_polygon_instance.rb +0 -221
- data/lib/cloudmersive-image-recognition-api-client/models/draw_polygon_request.rb +0 -227
- data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_instance.rb +0 -249
- data/lib/cloudmersive-image-recognition-api-client/models/draw_rectangle_request.rb +0 -227
- data/lib/cloudmersive-image-recognition-api-client/models/draw_text_instance.rb +0 -259
- data/lib/cloudmersive-image-recognition-api-client/models/draw_text_request.rb +0 -227
- data/lib/cloudmersive-image-recognition-api-client/models/face.rb +0 -219
- data/lib/cloudmersive-image-recognition-api-client/models/face_compare_response.rb +0 -221
- data/lib/cloudmersive-image-recognition-api-client/models/face_locate_response.rb +0 -221
- data/lib/cloudmersive-image-recognition-api-client/models/face_locate_with_landmarks_response.rb +0 -221
- data/lib/cloudmersive-image-recognition-api-client/models/face_match.rb +0 -239
- data/lib/cloudmersive-image-recognition-api-client/models/face_point.rb +0 -199
- data/lib/cloudmersive-image-recognition-api-client/models/face_with_landmarks.rb +0 -327
- data/lib/cloudmersive-image-recognition-api-client/models/find_symbol_result.rb +0 -239
- data/lib/cloudmersive-image-recognition-api-client/models/fine_text_detection_result.rb +0 -211
- data/lib/cloudmersive-image-recognition-api-client/models/fine_text_item.rb +0 -289
- data/lib/cloudmersive-image-recognition-api-client/models/gender_detection_result.rb +0 -211
- data/lib/cloudmersive-image-recognition-api-client/models/image_description_response.rb +0 -219
- data/lib/cloudmersive-image-recognition-api-client/models/image_metadata.rb +0 -281
- data/lib/cloudmersive-image-recognition-api-client/models/image_metadata_exif_value.rb +0 -209
- data/lib/cloudmersive-image-recognition-api-client/models/nsfw_result.rb +0 -209
- data/lib/cloudmersive-image-recognition-api-client/models/object_detection_result.rb +0 -211
- data/lib/cloudmersive-image-recognition-api-client/models/person_with_age.rb +0 -218
- data/lib/cloudmersive-image-recognition-api-client/models/person_with_gender.rb +0 -209
- data/lib/cloudmersive-image-recognition-api-client/models/polygon_point.rb +0 -199
- data/lib/cloudmersive-image-recognition-api-client/models/recognition_outcome.rb +0 -199
- data/lib/cloudmersive-image-recognition-api-client/models/text_detection_result.rb +0 -211
- data/lib/cloudmersive-image-recognition-api-client/models/text_item.rb +0 -219
- data/lib/cloudmersive-image-recognition-api-client/models/vehicle_license_plate_detection_result.rb +0 -211
- data/lib/cloudmersive-image-recognition-api-client/version.rb +0 -15
- data/spec/api/artistic_api_spec.rb +0 -48
- data/spec/api/convert_api_spec.rb +0 -120
- data/spec/api/edit_api_spec.rb +0 -191
- data/spec/api/face_api_spec.rb +0 -120
- data/spec/api/filter_api_spec.rb +0 -141
- data/spec/api/info_api_spec.rb +0 -59
- data/spec/api/nsfw_api_spec.rb +0 -47
- data/spec/api/recognize_api_spec.rb +0 -133
- data/spec/api/resize_api_spec.rb +0 -63
- data/spec/api_client_spec.rb +0 -226
- data/spec/configuration_spec.rb +0 -42
- data/spec/models/age_detection_result_spec.rb +0 -54
- data/spec/models/color_result_spec.rb +0 -54
- data/spec/models/detected_license_plate_spec.rb +0 -78
- data/spec/models/detected_object_spec.rb +0 -72
- data/spec/models/dominant_color_result_spec.rb +0 -48
- data/spec/models/draw_polygon_instance_spec.rb +0 -60
- data/spec/models/draw_polygon_request_spec.rb +0 -54
- data/spec/models/draw_rectangle_instance_spec.rb +0 -78
- data/spec/models/draw_rectangle_request_spec.rb +0 -54
- data/spec/models/draw_text_instance_spec.rb +0 -84
- data/spec/models/draw_text_request_spec.rb +0 -54
- data/spec/models/face_compare_response_spec.rb +0 -60
- data/spec/models/face_locate_response_spec.rb +0 -60
- data/spec/models/face_locate_with_landmarks_response_spec.rb +0 -60
- data/spec/models/face_match_spec.rb +0 -72
- data/spec/models/face_point_spec.rb +0 -48
- data/spec/models/face_spec.rb +0 -60
- data/spec/models/face_with_landmarks_spec.rb +0 -114
- data/spec/models/find_symbol_result_spec.rb +0 -72
- data/spec/models/fine_text_detection_result_spec.rb +0 -54
- data/spec/models/fine_text_item_spec.rb +0 -102
- data/spec/models/gender_detection_result_spec.rb +0 -54
- data/spec/models/image_description_response_spec.rb +0 -60
- data/spec/models/image_metadata_exif_value_spec.rb +0 -54
- data/spec/models/image_metadata_spec.rb +0 -96
- data/spec/models/nsfw_result_spec.rb +0 -54
- data/spec/models/object_detection_result_spec.rb +0 -54
- data/spec/models/person_with_age_spec.rb +0 -60
- data/spec/models/person_with_gender_spec.rb +0 -54
- data/spec/models/polygon_point_spec.rb +0 -48
- data/spec/models/recognition_outcome_spec.rb +0 -48
- data/spec/models/text_detection_result_spec.rb +0 -54
- data/spec/models/text_item_spec.rb +0 -60
- data/spec/models/vehicle_license_plate_detection_result_spec.rb +0 -54
- data/spec/spec_helper.rb +0 -111
@@ -1,422 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#imageapi
|
3
|
-
|
4
|
-
#Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
|
5
|
-
|
6
|
-
OpenAPI spec version: v1
|
7
|
-
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.3.1
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require "uri"
|
14
|
-
|
15
|
-
module CloudmersiveImageRecognitionApiClient
|
16
|
-
class FaceApi
|
17
|
-
attr_accessor :api_client
|
18
|
-
|
19
|
-
def initialize(api_client = ApiClient.default)
|
20
|
-
@api_client = api_client
|
21
|
-
end
|
22
|
-
|
23
|
-
# Compare and match faces
|
24
|
-
# Find the faces in an input image, and compare against a reference image to determine if there is a match against the face in the reference image. The reference image (second parameter) should contain exactly one face.
|
25
|
-
# @param input_image Image file to perform the operation on; this image can contain one or more faces which will be matched against face provided in the second image. Common file formats such as PNG, JPEG are supported.
|
26
|
-
# @param match_face Image of a single face to compare and match against.
|
27
|
-
# @param [Hash] opts the optional parameters
|
28
|
-
# @return [FaceCompareResponse]
|
29
|
-
def face_compare(input_image, match_face, opts = {})
|
30
|
-
data, _status_code, _headers = face_compare_with_http_info(input_image, match_face, opts)
|
31
|
-
return data
|
32
|
-
end
|
33
|
-
|
34
|
-
# Compare and match faces
|
35
|
-
# Find the faces in an input image, and compare against a reference image to determine if there is a match against the face in the reference image. The reference image (second parameter) should contain exactly one face.
|
36
|
-
# @param input_image Image file to perform the operation on; this image can contain one or more faces which will be matched against face provided in the second image. Common file formats such as PNG, JPEG are supported.
|
37
|
-
# @param match_face Image of a single face to compare and match against.
|
38
|
-
# @param [Hash] opts the optional parameters
|
39
|
-
# @return [Array<(FaceCompareResponse, Fixnum, Hash)>] FaceCompareResponse data, response status code and response headers
|
40
|
-
def face_compare_with_http_info(input_image, match_face, opts = {})
|
41
|
-
if @api_client.config.debugging
|
42
|
-
@api_client.config.logger.debug "Calling API: FaceApi.face_compare ..."
|
43
|
-
end
|
44
|
-
# verify the required parameter 'input_image' is set
|
45
|
-
if @api_client.config.client_side_validation && input_image.nil?
|
46
|
-
fail ArgumentError, "Missing the required parameter 'input_image' when calling FaceApi.face_compare"
|
47
|
-
end
|
48
|
-
# verify the required parameter 'match_face' is set
|
49
|
-
if @api_client.config.client_side_validation && match_face.nil?
|
50
|
-
fail ArgumentError, "Missing the required parameter 'match_face' when calling FaceApi.face_compare"
|
51
|
-
end
|
52
|
-
# resource path
|
53
|
-
local_var_path = "/image/face/compare-and-match"
|
54
|
-
|
55
|
-
# query parameters
|
56
|
-
query_params = {}
|
57
|
-
|
58
|
-
# header parameters
|
59
|
-
header_params = {}
|
60
|
-
# HTTP header 'Accept' (if needed)
|
61
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
|
62
|
-
# HTTP header 'Content-Type'
|
63
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
64
|
-
|
65
|
-
# form parameters
|
66
|
-
form_params = {}
|
67
|
-
form_params["inputImage"] = input_image
|
68
|
-
form_params["matchFace"] = match_face
|
69
|
-
|
70
|
-
# http body (model)
|
71
|
-
post_body = nil
|
72
|
-
auth_names = ['Apikey']
|
73
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
74
|
-
:header_params => header_params,
|
75
|
-
:query_params => query_params,
|
76
|
-
:form_params => form_params,
|
77
|
-
:body => post_body,
|
78
|
-
:auth_names => auth_names,
|
79
|
-
:return_type => 'FaceCompareResponse')
|
80
|
-
if @api_client.config.debugging
|
81
|
-
@api_client.config.logger.debug "API called: FaceApi#face_compare\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
82
|
-
end
|
83
|
-
return data, status_code, headers
|
84
|
-
end
|
85
|
-
|
86
|
-
# Crop image to face with square crop
|
87
|
-
# Crop an image to the face (rectangular crop). If there is more than one face present, choose the first one.
|
88
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
89
|
-
# @param [Hash] opts the optional parameters
|
90
|
-
# @return [String]
|
91
|
-
def face_crop_first(image_file, opts = {})
|
92
|
-
data, _status_code, _headers = face_crop_first_with_http_info(image_file, opts)
|
93
|
-
return data
|
94
|
-
end
|
95
|
-
|
96
|
-
# Crop image to face with square crop
|
97
|
-
# Crop an image to the face (rectangular crop). If there is more than one face present, choose the first one.
|
98
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
99
|
-
# @param [Hash] opts the optional parameters
|
100
|
-
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
101
|
-
def face_crop_first_with_http_info(image_file, opts = {})
|
102
|
-
if @api_client.config.debugging
|
103
|
-
@api_client.config.logger.debug "Calling API: FaceApi.face_crop_first ..."
|
104
|
-
end
|
105
|
-
# verify the required parameter 'image_file' is set
|
106
|
-
if @api_client.config.client_side_validation && image_file.nil?
|
107
|
-
fail ArgumentError, "Missing the required parameter 'image_file' when calling FaceApi.face_crop_first"
|
108
|
-
end
|
109
|
-
# resource path
|
110
|
-
local_var_path = "/image/face/crop/first"
|
111
|
-
|
112
|
-
# query parameters
|
113
|
-
query_params = {}
|
114
|
-
|
115
|
-
# header parameters
|
116
|
-
header_params = {}
|
117
|
-
# HTTP header 'Accept' (if needed)
|
118
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
119
|
-
# HTTP header 'Content-Type'
|
120
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
121
|
-
|
122
|
-
# form parameters
|
123
|
-
form_params = {}
|
124
|
-
form_params["imageFile"] = image_file
|
125
|
-
|
126
|
-
# http body (model)
|
127
|
-
post_body = nil
|
128
|
-
auth_names = ['Apikey']
|
129
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
130
|
-
:header_params => header_params,
|
131
|
-
:query_params => query_params,
|
132
|
-
:form_params => form_params,
|
133
|
-
:body => post_body,
|
134
|
-
:auth_names => auth_names,
|
135
|
-
:return_type => 'String')
|
136
|
-
if @api_client.config.debugging
|
137
|
-
@api_client.config.logger.debug "API called: FaceApi#face_crop_first\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
138
|
-
end
|
139
|
-
return data, status_code, headers
|
140
|
-
end
|
141
|
-
|
142
|
-
# Crop image to face with round crop
|
143
|
-
# Crop an image to the face (circular/round crop). If there is more than one face present, choose the first one.
|
144
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
145
|
-
# @param [Hash] opts the optional parameters
|
146
|
-
# @return [String]
|
147
|
-
def face_crop_first_round(image_file, opts = {})
|
148
|
-
data, _status_code, _headers = face_crop_first_round_with_http_info(image_file, opts)
|
149
|
-
return data
|
150
|
-
end
|
151
|
-
|
152
|
-
# Crop image to face with round crop
|
153
|
-
# Crop an image to the face (circular/round crop). If there is more than one face present, choose the first one.
|
154
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
155
|
-
# @param [Hash] opts the optional parameters
|
156
|
-
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
157
|
-
def face_crop_first_round_with_http_info(image_file, opts = {})
|
158
|
-
if @api_client.config.debugging
|
159
|
-
@api_client.config.logger.debug "Calling API: FaceApi.face_crop_first_round ..."
|
160
|
-
end
|
161
|
-
# verify the required parameter 'image_file' is set
|
162
|
-
if @api_client.config.client_side_validation && image_file.nil?
|
163
|
-
fail ArgumentError, "Missing the required parameter 'image_file' when calling FaceApi.face_crop_first_round"
|
164
|
-
end
|
165
|
-
# resource path
|
166
|
-
local_var_path = "/image/face/crop/first/round"
|
167
|
-
|
168
|
-
# query parameters
|
169
|
-
query_params = {}
|
170
|
-
|
171
|
-
# header parameters
|
172
|
-
header_params = {}
|
173
|
-
# HTTP header 'Accept' (if needed)
|
174
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
175
|
-
# HTTP header 'Content-Type'
|
176
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
177
|
-
|
178
|
-
# form parameters
|
179
|
-
form_params = {}
|
180
|
-
form_params["imageFile"] = image_file
|
181
|
-
|
182
|
-
# http body (model)
|
183
|
-
post_body = nil
|
184
|
-
auth_names = ['Apikey']
|
185
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
186
|
-
:header_params => header_params,
|
187
|
-
:query_params => query_params,
|
188
|
-
:form_params => form_params,
|
189
|
-
:body => post_body,
|
190
|
-
:auth_names => auth_names,
|
191
|
-
:return_type => 'String')
|
192
|
-
if @api_client.config.debugging
|
193
|
-
@api_client.config.logger.debug "API called: FaceApi#face_crop_first_round\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
194
|
-
end
|
195
|
-
return data, status_code, headers
|
196
|
-
end
|
197
|
-
|
198
|
-
# Detect the age of people in an image
|
199
|
-
# Identify the age, position, and size of human faces in an image, along with a recognition confidence level. People in the image do NOT need to be facing the camera; they can be facing away, edge-on, etc.
|
200
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
201
|
-
# @param [Hash] opts the optional parameters
|
202
|
-
# @return [AgeDetectionResult]
|
203
|
-
def face_detect_age(image_file, opts = {})
|
204
|
-
data, _status_code, _headers = face_detect_age_with_http_info(image_file, opts)
|
205
|
-
return data
|
206
|
-
end
|
207
|
-
|
208
|
-
# Detect the age of people in an image
|
209
|
-
# Identify the age, position, and size of human faces in an image, along with a recognition confidence level. People in the image do NOT need to be facing the camera; they can be facing away, edge-on, etc.
|
210
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
211
|
-
# @param [Hash] opts the optional parameters
|
212
|
-
# @return [Array<(AgeDetectionResult, Fixnum, Hash)>] AgeDetectionResult data, response status code and response headers
|
213
|
-
def face_detect_age_with_http_info(image_file, opts = {})
|
214
|
-
if @api_client.config.debugging
|
215
|
-
@api_client.config.logger.debug "Calling API: FaceApi.face_detect_age ..."
|
216
|
-
end
|
217
|
-
# verify the required parameter 'image_file' is set
|
218
|
-
if @api_client.config.client_side_validation && image_file.nil?
|
219
|
-
fail ArgumentError, "Missing the required parameter 'image_file' when calling FaceApi.face_detect_age"
|
220
|
-
end
|
221
|
-
# resource path
|
222
|
-
local_var_path = "/image/face/detect-age"
|
223
|
-
|
224
|
-
# query parameters
|
225
|
-
query_params = {}
|
226
|
-
|
227
|
-
# header parameters
|
228
|
-
header_params = {}
|
229
|
-
# HTTP header 'Accept' (if needed)
|
230
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
|
231
|
-
# HTTP header 'Content-Type'
|
232
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
233
|
-
|
234
|
-
# form parameters
|
235
|
-
form_params = {}
|
236
|
-
form_params["imageFile"] = image_file
|
237
|
-
|
238
|
-
# http body (model)
|
239
|
-
post_body = nil
|
240
|
-
auth_names = ['Apikey']
|
241
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
242
|
-
:header_params => header_params,
|
243
|
-
:query_params => query_params,
|
244
|
-
:form_params => form_params,
|
245
|
-
:body => post_body,
|
246
|
-
:auth_names => auth_names,
|
247
|
-
:return_type => 'AgeDetectionResult')
|
248
|
-
if @api_client.config.debugging
|
249
|
-
@api_client.config.logger.debug "API called: FaceApi#face_detect_age\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
250
|
-
end
|
251
|
-
return data, status_code, headers
|
252
|
-
end
|
253
|
-
|
254
|
-
# Detect the gender of people in an image
|
255
|
-
# Identify the gender, position, and size of human faces in an image, along with a recognition confidence level. People in the image should be facing the camera.
|
256
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
257
|
-
# @param [Hash] opts the optional parameters
|
258
|
-
# @return [GenderDetectionResult]
|
259
|
-
def face_detect_gender(image_file, opts = {})
|
260
|
-
data, _status_code, _headers = face_detect_gender_with_http_info(image_file, opts)
|
261
|
-
return data
|
262
|
-
end
|
263
|
-
|
264
|
-
# Detect the gender of people in an image
|
265
|
-
# Identify the gender, position, and size of human faces in an image, along with a recognition confidence level. People in the image should be facing the camera.
|
266
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
267
|
-
# @param [Hash] opts the optional parameters
|
268
|
-
# @return [Array<(GenderDetectionResult, Fixnum, Hash)>] GenderDetectionResult data, response status code and response headers
|
269
|
-
def face_detect_gender_with_http_info(image_file, opts = {})
|
270
|
-
if @api_client.config.debugging
|
271
|
-
@api_client.config.logger.debug "Calling API: FaceApi.face_detect_gender ..."
|
272
|
-
end
|
273
|
-
# verify the required parameter 'image_file' is set
|
274
|
-
if @api_client.config.client_side_validation && image_file.nil?
|
275
|
-
fail ArgumentError, "Missing the required parameter 'image_file' when calling FaceApi.face_detect_gender"
|
276
|
-
end
|
277
|
-
# resource path
|
278
|
-
local_var_path = "/image/face/detect-gender"
|
279
|
-
|
280
|
-
# query parameters
|
281
|
-
query_params = {}
|
282
|
-
|
283
|
-
# header parameters
|
284
|
-
header_params = {}
|
285
|
-
# HTTP header 'Accept' (if needed)
|
286
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
|
287
|
-
# HTTP header 'Content-Type'
|
288
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
289
|
-
|
290
|
-
# form parameters
|
291
|
-
form_params = {}
|
292
|
-
form_params["imageFile"] = image_file
|
293
|
-
|
294
|
-
# http body (model)
|
295
|
-
post_body = nil
|
296
|
-
auth_names = ['Apikey']
|
297
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
298
|
-
:header_params => header_params,
|
299
|
-
:query_params => query_params,
|
300
|
-
:form_params => form_params,
|
301
|
-
:body => post_body,
|
302
|
-
:auth_names => auth_names,
|
303
|
-
:return_type => 'GenderDetectionResult')
|
304
|
-
if @api_client.config.debugging
|
305
|
-
@api_client.config.logger.debug "API called: FaceApi#face_detect_gender\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
306
|
-
end
|
307
|
-
return data, status_code, headers
|
308
|
-
end
|
309
|
-
|
310
|
-
# Detect and find faces in an image
|
311
|
-
# Locate the positions of all faces in an image
|
312
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
313
|
-
# @param [Hash] opts the optional parameters
|
314
|
-
# @return [FaceLocateResponse]
|
315
|
-
def face_locate(image_file, opts = {})
|
316
|
-
data, _status_code, _headers = face_locate_with_http_info(image_file, opts)
|
317
|
-
return data
|
318
|
-
end
|
319
|
-
|
320
|
-
# Detect and find faces in an image
|
321
|
-
# Locate the positions of all faces in an image
|
322
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
323
|
-
# @param [Hash] opts the optional parameters
|
324
|
-
# @return [Array<(FaceLocateResponse, Fixnum, Hash)>] FaceLocateResponse data, response status code and response headers
|
325
|
-
def face_locate_with_http_info(image_file, opts = {})
|
326
|
-
if @api_client.config.debugging
|
327
|
-
@api_client.config.logger.debug "Calling API: FaceApi.face_locate ..."
|
328
|
-
end
|
329
|
-
# verify the required parameter 'image_file' is set
|
330
|
-
if @api_client.config.client_side_validation && image_file.nil?
|
331
|
-
fail ArgumentError, "Missing the required parameter 'image_file' when calling FaceApi.face_locate"
|
332
|
-
end
|
333
|
-
# resource path
|
334
|
-
local_var_path = "/image/face/locate"
|
335
|
-
|
336
|
-
# query parameters
|
337
|
-
query_params = {}
|
338
|
-
|
339
|
-
# header parameters
|
340
|
-
header_params = {}
|
341
|
-
# HTTP header 'Accept' (if needed)
|
342
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
|
343
|
-
# HTTP header 'Content-Type'
|
344
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
345
|
-
|
346
|
-
# form parameters
|
347
|
-
form_params = {}
|
348
|
-
form_params["imageFile"] = image_file
|
349
|
-
|
350
|
-
# http body (model)
|
351
|
-
post_body = nil
|
352
|
-
auth_names = ['Apikey']
|
353
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
354
|
-
:header_params => header_params,
|
355
|
-
:query_params => query_params,
|
356
|
-
:form_params => form_params,
|
357
|
-
:body => post_body,
|
358
|
-
:auth_names => auth_names,
|
359
|
-
:return_type => 'FaceLocateResponse')
|
360
|
-
if @api_client.config.debugging
|
361
|
-
@api_client.config.logger.debug "API called: FaceApi#face_locate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
362
|
-
end
|
363
|
-
return data, status_code, headers
|
364
|
-
end
|
365
|
-
|
366
|
-
# Detect and find faces and landmarks eyes and nose and mouth in image
|
367
|
-
# Locate the positions of all faces in an image, along with the eyes, eye brows, nose and mouth components of each
|
368
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
369
|
-
# @param [Hash] opts the optional parameters
|
370
|
-
# @return [FaceLocateWithLandmarksResponse]
|
371
|
-
def face_locate_with_landmarks(image_file, opts = {})
|
372
|
-
data, _status_code, _headers = face_locate_with_landmarks_with_http_info(image_file, opts)
|
373
|
-
return data
|
374
|
-
end
|
375
|
-
|
376
|
-
# Detect and find faces and landmarks eyes and nose and mouth in image
|
377
|
-
# Locate the positions of all faces in an image, along with the eyes, eye brows, nose and mouth components of each
|
378
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
379
|
-
# @param [Hash] opts the optional parameters
|
380
|
-
# @return [Array<(FaceLocateWithLandmarksResponse, Fixnum, Hash)>] FaceLocateWithLandmarksResponse data, response status code and response headers
|
381
|
-
def face_locate_with_landmarks_with_http_info(image_file, opts = {})
|
382
|
-
if @api_client.config.debugging
|
383
|
-
@api_client.config.logger.debug "Calling API: FaceApi.face_locate_with_landmarks ..."
|
384
|
-
end
|
385
|
-
# verify the required parameter 'image_file' is set
|
386
|
-
if @api_client.config.client_side_validation && image_file.nil?
|
387
|
-
fail ArgumentError, "Missing the required parameter 'image_file' when calling FaceApi.face_locate_with_landmarks"
|
388
|
-
end
|
389
|
-
# resource path
|
390
|
-
local_var_path = "/image/face/locate-with-landmarks"
|
391
|
-
|
392
|
-
# query parameters
|
393
|
-
query_params = {}
|
394
|
-
|
395
|
-
# header parameters
|
396
|
-
header_params = {}
|
397
|
-
# HTTP header 'Accept' (if needed)
|
398
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])
|
399
|
-
# HTTP header 'Content-Type'
|
400
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
401
|
-
|
402
|
-
# form parameters
|
403
|
-
form_params = {}
|
404
|
-
form_params["imageFile"] = image_file
|
405
|
-
|
406
|
-
# http body (model)
|
407
|
-
post_body = nil
|
408
|
-
auth_names = ['Apikey']
|
409
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
410
|
-
:header_params => header_params,
|
411
|
-
:query_params => query_params,
|
412
|
-
:form_params => form_params,
|
413
|
-
:body => post_body,
|
414
|
-
:auth_names => auth_names,
|
415
|
-
:return_type => 'FaceLocateWithLandmarksResponse')
|
416
|
-
if @api_client.config.debugging
|
417
|
-
@api_client.config.logger.debug "API called: FaceApi#face_locate_with_landmarks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
418
|
-
end
|
419
|
-
return data, status_code, headers
|
420
|
-
end
|
421
|
-
end
|
422
|
-
end
|
@@ -1,533 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#imageapi
|
3
|
-
|
4
|
-
#Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.
|
5
|
-
|
6
|
-
OpenAPI spec version: v1
|
7
|
-
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.3.1
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require "uri"
|
14
|
-
|
15
|
-
module CloudmersiveImageRecognitionApiClient
|
16
|
-
class FilterApi
|
17
|
-
attr_accessor :api_client
|
18
|
-
|
19
|
-
def initialize(api_client = ApiClient.default)
|
20
|
-
@api_client = api_client
|
21
|
-
end
|
22
|
-
|
23
|
-
# Convert image to black-and-white grayscale
|
24
|
-
# Remove color from the image by converting to a grayscale, black-and-white image
|
25
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
26
|
-
# @param [Hash] opts the optional parameters
|
27
|
-
# @return [String]
|
28
|
-
def filter_black_and_white(image_file, opts = {})
|
29
|
-
data, _status_code, _headers = filter_black_and_white_with_http_info(image_file, opts)
|
30
|
-
return data
|
31
|
-
end
|
32
|
-
|
33
|
-
# Convert image to black-and-white grayscale
|
34
|
-
# Remove color from the image by converting to a grayscale, black-and-white image
|
35
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
36
|
-
# @param [Hash] opts the optional parameters
|
37
|
-
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
38
|
-
def filter_black_and_white_with_http_info(image_file, opts = {})
|
39
|
-
if @api_client.config.debugging
|
40
|
-
@api_client.config.logger.debug "Calling API: FilterApi.filter_black_and_white ..."
|
41
|
-
end
|
42
|
-
# verify the required parameter 'image_file' is set
|
43
|
-
if @api_client.config.client_side_validation && image_file.nil?
|
44
|
-
fail ArgumentError, "Missing the required parameter 'image_file' when calling FilterApi.filter_black_and_white"
|
45
|
-
end
|
46
|
-
# resource path
|
47
|
-
local_var_path = "/image/filter/black-and-white"
|
48
|
-
|
49
|
-
# query parameters
|
50
|
-
query_params = {}
|
51
|
-
|
52
|
-
# header parameters
|
53
|
-
header_params = {}
|
54
|
-
# HTTP header 'Accept' (if needed)
|
55
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
56
|
-
# HTTP header 'Content-Type'
|
57
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
58
|
-
|
59
|
-
# form parameters
|
60
|
-
form_params = {}
|
61
|
-
form_params["imageFile"] = image_file
|
62
|
-
|
63
|
-
# http body (model)
|
64
|
-
post_body = nil
|
65
|
-
auth_names = ['Apikey']
|
66
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
67
|
-
:header_params => header_params,
|
68
|
-
:query_params => query_params,
|
69
|
-
:form_params => form_params,
|
70
|
-
:body => post_body,
|
71
|
-
:auth_names => auth_names,
|
72
|
-
:return_type => 'String')
|
73
|
-
if @api_client.config.debugging
|
74
|
-
@api_client.config.logger.debug "API called: FilterApi#filter_black_and_white\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
75
|
-
end
|
76
|
-
return data, status_code, headers
|
77
|
-
end
|
78
|
-
|
79
|
-
# Despeckle to remove point noise from the image
|
80
|
-
# Remove point noise / despeckle the input image
|
81
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
82
|
-
# @param [Hash] opts the optional parameters
|
83
|
-
# @return [String]
|
84
|
-
def filter_despeckle(image_file, opts = {})
|
85
|
-
data, _status_code, _headers = filter_despeckle_with_http_info(image_file, opts)
|
86
|
-
return data
|
87
|
-
end
|
88
|
-
|
89
|
-
# Despeckle to remove point noise from the image
|
90
|
-
# Remove point noise / despeckle the input image
|
91
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
92
|
-
# @param [Hash] opts the optional parameters
|
93
|
-
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
94
|
-
def filter_despeckle_with_http_info(image_file, opts = {})
|
95
|
-
if @api_client.config.debugging
|
96
|
-
@api_client.config.logger.debug "Calling API: FilterApi.filter_despeckle ..."
|
97
|
-
end
|
98
|
-
# verify the required parameter 'image_file' is set
|
99
|
-
if @api_client.config.client_side_validation && image_file.nil?
|
100
|
-
fail ArgumentError, "Missing the required parameter 'image_file' when calling FilterApi.filter_despeckle"
|
101
|
-
end
|
102
|
-
# resource path
|
103
|
-
local_var_path = "/image/filter/despeckle"
|
104
|
-
|
105
|
-
# query parameters
|
106
|
-
query_params = {}
|
107
|
-
|
108
|
-
# header parameters
|
109
|
-
header_params = {}
|
110
|
-
# HTTP header 'Accept' (if needed)
|
111
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
112
|
-
# HTTP header 'Content-Type'
|
113
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
114
|
-
|
115
|
-
# form parameters
|
116
|
-
form_params = {}
|
117
|
-
form_params["imageFile"] = image_file
|
118
|
-
|
119
|
-
# http body (model)
|
120
|
-
post_body = nil
|
121
|
-
auth_names = ['Apikey']
|
122
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
123
|
-
:header_params => header_params,
|
124
|
-
:query_params => query_params,
|
125
|
-
:form_params => form_params,
|
126
|
-
:body => post_body,
|
127
|
-
:auth_names => auth_names,
|
128
|
-
:return_type => 'String')
|
129
|
-
if @api_client.config.debugging
|
130
|
-
@api_client.config.logger.debug "API called: FilterApi#filter_despeckle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
131
|
-
end
|
132
|
-
return data, status_code, headers
|
133
|
-
end
|
134
|
-
|
135
|
-
# Detect and highlight edges in an image
|
136
|
-
# Perform an edge detection operation on the input image
|
137
|
-
# @param radius Radius in pixels of the edge detection operation; a larger radius will produce a greater effect
|
138
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
139
|
-
# @param [Hash] opts the optional parameters
|
140
|
-
# @return [String]
|
141
|
-
def filter_edge_detect(radius, image_file, opts = {})
|
142
|
-
data, _status_code, _headers = filter_edge_detect_with_http_info(radius, image_file, opts)
|
143
|
-
return data
|
144
|
-
end
|
145
|
-
|
146
|
-
# Detect and highlight edges in an image
|
147
|
-
# Perform an edge detection operation on the input image
|
148
|
-
# @param radius Radius in pixels of the edge detection operation; a larger radius will produce a greater effect
|
149
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
150
|
-
# @param [Hash] opts the optional parameters
|
151
|
-
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
152
|
-
def filter_edge_detect_with_http_info(radius, image_file, opts = {})
|
153
|
-
if @api_client.config.debugging
|
154
|
-
@api_client.config.logger.debug "Calling API: FilterApi.filter_edge_detect ..."
|
155
|
-
end
|
156
|
-
# verify the required parameter 'radius' is set
|
157
|
-
if @api_client.config.client_side_validation && radius.nil?
|
158
|
-
fail ArgumentError, "Missing the required parameter 'radius' when calling FilterApi.filter_edge_detect"
|
159
|
-
end
|
160
|
-
# verify the required parameter 'image_file' is set
|
161
|
-
if @api_client.config.client_side_validation && image_file.nil?
|
162
|
-
fail ArgumentError, "Missing the required parameter 'image_file' when calling FilterApi.filter_edge_detect"
|
163
|
-
end
|
164
|
-
# resource path
|
165
|
-
local_var_path = "/image/filter/edge-detect/{radius}".sub('{' + 'radius' + '}', radius.to_s)
|
166
|
-
|
167
|
-
# query parameters
|
168
|
-
query_params = {}
|
169
|
-
|
170
|
-
# header parameters
|
171
|
-
header_params = {}
|
172
|
-
# HTTP header 'Accept' (if needed)
|
173
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
174
|
-
# HTTP header 'Content-Type'
|
175
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
176
|
-
|
177
|
-
# form parameters
|
178
|
-
form_params = {}
|
179
|
-
form_params["imageFile"] = image_file
|
180
|
-
|
181
|
-
# http body (model)
|
182
|
-
post_body = nil
|
183
|
-
auth_names = ['Apikey']
|
184
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
185
|
-
:header_params => header_params,
|
186
|
-
:query_params => query_params,
|
187
|
-
:form_params => form_params,
|
188
|
-
:body => post_body,
|
189
|
-
:auth_names => auth_names,
|
190
|
-
:return_type => 'String')
|
191
|
-
if @api_client.config.debugging
|
192
|
-
@api_client.config.logger.debug "API called: FilterApi#filter_edge_detect\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
193
|
-
end
|
194
|
-
return data, status_code, headers
|
195
|
-
end
|
196
|
-
|
197
|
-
# Emboss an image
|
198
|
-
# Perform an emboss operation on the input image
|
199
|
-
# @param radius Radius in pixels of the emboss operation; a larger radius will produce a greater effect
|
200
|
-
# @param sigma Sigma, or variance, of the emboss operation
|
201
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
202
|
-
# @param [Hash] opts the optional parameters
|
203
|
-
# @return [String]
|
204
|
-
def filter_emboss(radius, sigma, image_file, opts = {})
|
205
|
-
data, _status_code, _headers = filter_emboss_with_http_info(radius, sigma, image_file, opts)
|
206
|
-
return data
|
207
|
-
end
|
208
|
-
|
209
|
-
# Emboss an image
|
210
|
-
# Perform an emboss operation on the input image
|
211
|
-
# @param radius Radius in pixels of the emboss operation; a larger radius will produce a greater effect
|
212
|
-
# @param sigma Sigma, or variance, of the emboss operation
|
213
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
214
|
-
# @param [Hash] opts the optional parameters
|
215
|
-
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
216
|
-
def filter_emboss_with_http_info(radius, sigma, image_file, opts = {})
|
217
|
-
if @api_client.config.debugging
|
218
|
-
@api_client.config.logger.debug "Calling API: FilterApi.filter_emboss ..."
|
219
|
-
end
|
220
|
-
# verify the required parameter 'radius' is set
|
221
|
-
if @api_client.config.client_side_validation && radius.nil?
|
222
|
-
fail ArgumentError, "Missing the required parameter 'radius' when calling FilterApi.filter_emboss"
|
223
|
-
end
|
224
|
-
# verify the required parameter 'sigma' is set
|
225
|
-
if @api_client.config.client_side_validation && sigma.nil?
|
226
|
-
fail ArgumentError, "Missing the required parameter 'sigma' when calling FilterApi.filter_emboss"
|
227
|
-
end
|
228
|
-
# verify the required parameter 'image_file' is set
|
229
|
-
if @api_client.config.client_side_validation && image_file.nil?
|
230
|
-
fail ArgumentError, "Missing the required parameter 'image_file' when calling FilterApi.filter_emboss"
|
231
|
-
end
|
232
|
-
# resource path
|
233
|
-
local_var_path = "/image/filter/emboss/{radius}/{sigma}".sub('{' + 'radius' + '}', radius.to_s).sub('{' + 'sigma' + '}', sigma.to_s)
|
234
|
-
|
235
|
-
# query parameters
|
236
|
-
query_params = {}
|
237
|
-
|
238
|
-
# header parameters
|
239
|
-
header_params = {}
|
240
|
-
# HTTP header 'Accept' (if needed)
|
241
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
242
|
-
# HTTP header 'Content-Type'
|
243
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
244
|
-
|
245
|
-
# form parameters
|
246
|
-
form_params = {}
|
247
|
-
form_params["imageFile"] = image_file
|
248
|
-
|
249
|
-
# http body (model)
|
250
|
-
post_body = nil
|
251
|
-
auth_names = ['Apikey']
|
252
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
253
|
-
:header_params => header_params,
|
254
|
-
:query_params => query_params,
|
255
|
-
:form_params => form_params,
|
256
|
-
:body => post_body,
|
257
|
-
:auth_names => auth_names,
|
258
|
-
:return_type => 'String')
|
259
|
-
if @api_client.config.debugging
|
260
|
-
@api_client.config.logger.debug "API called: FilterApi#filter_emboss\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
261
|
-
end
|
262
|
-
return data, status_code, headers
|
263
|
-
end
|
264
|
-
|
265
|
-
# Perform a guassian blur on the input image
|
266
|
-
# Perform a gaussian blur on the input image
|
267
|
-
# @param radius Radius in pixels of the blur operation; a larger radius will produce a greater blur effect
|
268
|
-
# @param sigma Sigma, or variance, of the gaussian blur operation
|
269
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
270
|
-
# @param [Hash] opts the optional parameters
|
271
|
-
# @return [String]
|
272
|
-
def filter_gaussian_blur(radius, sigma, image_file, opts = {})
|
273
|
-
data, _status_code, _headers = filter_gaussian_blur_with_http_info(radius, sigma, image_file, opts)
|
274
|
-
return data
|
275
|
-
end
|
276
|
-
|
277
|
-
# Perform a guassian blur on the input image
|
278
|
-
# Perform a gaussian blur on the input image
|
279
|
-
# @param radius Radius in pixels of the blur operation; a larger radius will produce a greater blur effect
|
280
|
-
# @param sigma Sigma, or variance, of the gaussian blur operation
|
281
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
282
|
-
# @param [Hash] opts the optional parameters
|
283
|
-
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
284
|
-
def filter_gaussian_blur_with_http_info(radius, sigma, image_file, opts = {})
|
285
|
-
if @api_client.config.debugging
|
286
|
-
@api_client.config.logger.debug "Calling API: FilterApi.filter_gaussian_blur ..."
|
287
|
-
end
|
288
|
-
# verify the required parameter 'radius' is set
|
289
|
-
if @api_client.config.client_side_validation && radius.nil?
|
290
|
-
fail ArgumentError, "Missing the required parameter 'radius' when calling FilterApi.filter_gaussian_blur"
|
291
|
-
end
|
292
|
-
# verify the required parameter 'sigma' is set
|
293
|
-
if @api_client.config.client_side_validation && sigma.nil?
|
294
|
-
fail ArgumentError, "Missing the required parameter 'sigma' when calling FilterApi.filter_gaussian_blur"
|
295
|
-
end
|
296
|
-
# verify the required parameter 'image_file' is set
|
297
|
-
if @api_client.config.client_side_validation && image_file.nil?
|
298
|
-
fail ArgumentError, "Missing the required parameter 'image_file' when calling FilterApi.filter_gaussian_blur"
|
299
|
-
end
|
300
|
-
# resource path
|
301
|
-
local_var_path = "/image/filter/blur/guassian/{radius}/{sigma}".sub('{' + 'radius' + '}', radius.to_s).sub('{' + 'sigma' + '}', sigma.to_s)
|
302
|
-
|
303
|
-
# query parameters
|
304
|
-
query_params = {}
|
305
|
-
|
306
|
-
# header parameters
|
307
|
-
header_params = {}
|
308
|
-
# HTTP header 'Accept' (if needed)
|
309
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
310
|
-
# HTTP header 'Content-Type'
|
311
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
312
|
-
|
313
|
-
# form parameters
|
314
|
-
form_params = {}
|
315
|
-
form_params["imageFile"] = image_file
|
316
|
-
|
317
|
-
# http body (model)
|
318
|
-
post_body = nil
|
319
|
-
auth_names = ['Apikey']
|
320
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
321
|
-
:header_params => header_params,
|
322
|
-
:query_params => query_params,
|
323
|
-
:form_params => form_params,
|
324
|
-
:body => post_body,
|
325
|
-
:auth_names => auth_names,
|
326
|
-
:return_type => 'String')
|
327
|
-
if @api_client.config.debugging
|
328
|
-
@api_client.config.logger.debug "API called: FilterApi#filter_gaussian_blur\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
329
|
-
end
|
330
|
-
return data, status_code, headers
|
331
|
-
end
|
332
|
-
|
333
|
-
# Perform a motion blur on the input image
|
334
|
-
# Perform a motion blur on the input image at a specific angle
|
335
|
-
# @param radius Radius in pixels of the blur operation; a larger radius will produce a greater blur effect
|
336
|
-
# @param sigma Sigma, or variance, of the motion blur operation
|
337
|
-
# @param angle Angle of the motion blur in degrees
|
338
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
339
|
-
# @param [Hash] opts the optional parameters
|
340
|
-
# @return [String]
|
341
|
-
def filter_motion_blur(radius, sigma, angle, image_file, opts = {})
|
342
|
-
data, _status_code, _headers = filter_motion_blur_with_http_info(radius, sigma, angle, image_file, opts)
|
343
|
-
return data
|
344
|
-
end
|
345
|
-
|
346
|
-
# Perform a motion blur on the input image
|
347
|
-
# Perform a motion blur on the input image at a specific angle
|
348
|
-
# @param radius Radius in pixels of the blur operation; a larger radius will produce a greater blur effect
|
349
|
-
# @param sigma Sigma, or variance, of the motion blur operation
|
350
|
-
# @param angle Angle of the motion blur in degrees
|
351
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
352
|
-
# @param [Hash] opts the optional parameters
|
353
|
-
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
354
|
-
def filter_motion_blur_with_http_info(radius, sigma, angle, image_file, opts = {})
|
355
|
-
if @api_client.config.debugging
|
356
|
-
@api_client.config.logger.debug "Calling API: FilterApi.filter_motion_blur ..."
|
357
|
-
end
|
358
|
-
# verify the required parameter 'radius' is set
|
359
|
-
if @api_client.config.client_side_validation && radius.nil?
|
360
|
-
fail ArgumentError, "Missing the required parameter 'radius' when calling FilterApi.filter_motion_blur"
|
361
|
-
end
|
362
|
-
# verify the required parameter 'sigma' is set
|
363
|
-
if @api_client.config.client_side_validation && sigma.nil?
|
364
|
-
fail ArgumentError, "Missing the required parameter 'sigma' when calling FilterApi.filter_motion_blur"
|
365
|
-
end
|
366
|
-
# verify the required parameter 'angle' is set
|
367
|
-
if @api_client.config.client_side_validation && angle.nil?
|
368
|
-
fail ArgumentError, "Missing the required parameter 'angle' when calling FilterApi.filter_motion_blur"
|
369
|
-
end
|
370
|
-
# verify the required parameter 'image_file' is set
|
371
|
-
if @api_client.config.client_side_validation && image_file.nil?
|
372
|
-
fail ArgumentError, "Missing the required parameter 'image_file' when calling FilterApi.filter_motion_blur"
|
373
|
-
end
|
374
|
-
# resource path
|
375
|
-
local_var_path = "/image/filter/blur/motion/{radius}/{sigma}/{angle}".sub('{' + 'radius' + '}', radius.to_s).sub('{' + 'sigma' + '}', sigma.to_s).sub('{' + 'angle' + '}', angle.to_s)
|
376
|
-
|
377
|
-
# query parameters
|
378
|
-
query_params = {}
|
379
|
-
|
380
|
-
# header parameters
|
381
|
-
header_params = {}
|
382
|
-
# HTTP header 'Accept' (if needed)
|
383
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
384
|
-
# HTTP header 'Content-Type'
|
385
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
386
|
-
|
387
|
-
# form parameters
|
388
|
-
form_params = {}
|
389
|
-
form_params["imageFile"] = image_file
|
390
|
-
|
391
|
-
# http body (model)
|
392
|
-
post_body = nil
|
393
|
-
auth_names = ['Apikey']
|
394
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
395
|
-
:header_params => header_params,
|
396
|
-
:query_params => query_params,
|
397
|
-
:form_params => form_params,
|
398
|
-
:body => post_body,
|
399
|
-
:auth_names => auth_names,
|
400
|
-
:return_type => 'String')
|
401
|
-
if @api_client.config.debugging
|
402
|
-
@api_client.config.logger.debug "API called: FilterApi#filter_motion_blur\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
403
|
-
end
|
404
|
-
return data, status_code, headers
|
405
|
-
end
|
406
|
-
|
407
|
-
# Posterize the image by reducing distinct colors
|
408
|
-
# Reduce the unique number of colors in the image to the specified level
|
409
|
-
# @param levels Number of unique colors to retain in the output image
|
410
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
411
|
-
# @param [Hash] opts the optional parameters
|
412
|
-
# @return [String]
|
413
|
-
def filter_posterize(levels, image_file, opts = {})
|
414
|
-
data, _status_code, _headers = filter_posterize_with_http_info(levels, image_file, opts)
|
415
|
-
return data
|
416
|
-
end
|
417
|
-
|
418
|
-
# Posterize the image by reducing distinct colors
|
419
|
-
# Reduce the unique number of colors in the image to the specified level
|
420
|
-
# @param levels Number of unique colors to retain in the output image
|
421
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
422
|
-
# @param [Hash] opts the optional parameters
|
423
|
-
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
424
|
-
def filter_posterize_with_http_info(levels, image_file, opts = {})
|
425
|
-
if @api_client.config.debugging
|
426
|
-
@api_client.config.logger.debug "Calling API: FilterApi.filter_posterize ..."
|
427
|
-
end
|
428
|
-
# verify the required parameter 'levels' is set
|
429
|
-
if @api_client.config.client_side_validation && levels.nil?
|
430
|
-
fail ArgumentError, "Missing the required parameter 'levels' when calling FilterApi.filter_posterize"
|
431
|
-
end
|
432
|
-
# verify the required parameter 'image_file' is set
|
433
|
-
if @api_client.config.client_side_validation && image_file.nil?
|
434
|
-
fail ArgumentError, "Missing the required parameter 'image_file' when calling FilterApi.filter_posterize"
|
435
|
-
end
|
436
|
-
# resource path
|
437
|
-
local_var_path = "/image/filter/posterize"
|
438
|
-
|
439
|
-
# query parameters
|
440
|
-
query_params = {}
|
441
|
-
query_params[:'levels'] = levels
|
442
|
-
|
443
|
-
# header parameters
|
444
|
-
header_params = {}
|
445
|
-
# HTTP header 'Accept' (if needed)
|
446
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
447
|
-
# HTTP header 'Content-Type'
|
448
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
449
|
-
|
450
|
-
# form parameters
|
451
|
-
form_params = {}
|
452
|
-
form_params["imageFile"] = image_file
|
453
|
-
|
454
|
-
# http body (model)
|
455
|
-
post_body = nil
|
456
|
-
auth_names = ['Apikey']
|
457
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
458
|
-
:header_params => header_params,
|
459
|
-
:query_params => query_params,
|
460
|
-
:form_params => form_params,
|
461
|
-
:body => post_body,
|
462
|
-
:auth_names => auth_names,
|
463
|
-
:return_type => 'String')
|
464
|
-
if @api_client.config.debugging
|
465
|
-
@api_client.config.logger.debug "API called: FilterApi#filter_posterize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
466
|
-
end
|
467
|
-
return data, status_code, headers
|
468
|
-
end
|
469
|
-
|
470
|
-
# Swirl distort the image
|
471
|
-
# Swirl distort the image by the specified number of degrees
|
472
|
-
# @param degrees Degrees of swirl
|
473
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
474
|
-
# @param [Hash] opts the optional parameters
|
475
|
-
# @return [String]
|
476
|
-
def filter_swirl(degrees, image_file, opts = {})
|
477
|
-
data, _status_code, _headers = filter_swirl_with_http_info(degrees, image_file, opts)
|
478
|
-
return data
|
479
|
-
end
|
480
|
-
|
481
|
-
# Swirl distort the image
|
482
|
-
# Swirl distort the image by the specified number of degrees
|
483
|
-
# @param degrees Degrees of swirl
|
484
|
-
# @param image_file Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
|
485
|
-
# @param [Hash] opts the optional parameters
|
486
|
-
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
487
|
-
def filter_swirl_with_http_info(degrees, image_file, opts = {})
|
488
|
-
if @api_client.config.debugging
|
489
|
-
@api_client.config.logger.debug "Calling API: FilterApi.filter_swirl ..."
|
490
|
-
end
|
491
|
-
# verify the required parameter 'degrees' is set
|
492
|
-
if @api_client.config.client_side_validation && degrees.nil?
|
493
|
-
fail ArgumentError, "Missing the required parameter 'degrees' when calling FilterApi.filter_swirl"
|
494
|
-
end
|
495
|
-
# verify the required parameter 'image_file' is set
|
496
|
-
if @api_client.config.client_side_validation && image_file.nil?
|
497
|
-
fail ArgumentError, "Missing the required parameter 'image_file' when calling FilterApi.filter_swirl"
|
498
|
-
end
|
499
|
-
# resource path
|
500
|
-
local_var_path = "/image/filter/swirl"
|
501
|
-
|
502
|
-
# query parameters
|
503
|
-
query_params = {}
|
504
|
-
query_params[:'degrees'] = degrees
|
505
|
-
|
506
|
-
# header parameters
|
507
|
-
header_params = {}
|
508
|
-
# HTTP header 'Accept' (if needed)
|
509
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
|
510
|
-
# HTTP header 'Content-Type'
|
511
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
512
|
-
|
513
|
-
# form parameters
|
514
|
-
form_params = {}
|
515
|
-
form_params["imageFile"] = image_file
|
516
|
-
|
517
|
-
# http body (model)
|
518
|
-
post_body = nil
|
519
|
-
auth_names = ['Apikey']
|
520
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
521
|
-
:header_params => header_params,
|
522
|
-
:query_params => query_params,
|
523
|
-
:form_params => form_params,
|
524
|
-
:body => post_body,
|
525
|
-
:auth_names => auth_names,
|
526
|
-
:return_type => 'String')
|
527
|
-
if @api_client.config.debugging
|
528
|
-
@api_client.config.logger.debug "API called: FilterApi#filter_swirl\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
529
|
-
end
|
530
|
-
return data, status_code, headers
|
531
|
-
end
|
532
|
-
end
|
533
|
-
end
|