1package computervision 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "encoding/json" 22 "github.com/Azure/go-autorest/autorest" 23 "io" 24) 25 26// The package's fully qualified name. 27const fqdn = "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/computervision" 28 29// Details enumerates the values for details. 30type Details string 31 32const ( 33 // Celebrities ... 34 Celebrities Details = "Celebrities" 35 // Landmarks ... 36 Landmarks Details = "Landmarks" 37) 38 39// PossibleDetailsValues returns an array of possible values for the Details const type. 40func PossibleDetailsValues() []Details { 41 return []Details{Celebrities, Landmarks} 42} 43 44// Gender enumerates the values for gender. 45type Gender string 46 47const ( 48 // Female ... 49 Female Gender = "Female" 50 // Male ... 51 Male Gender = "Male" 52) 53 54// PossibleGenderValues returns an array of possible values for the Gender const type. 55func PossibleGenderValues() []Gender { 56 return []Gender{Female, Male} 57} 58 59// OcrLanguages enumerates the values for ocr languages. 60type OcrLanguages string 61 62const ( 63 // Ar ... 64 Ar OcrLanguages = "ar" 65 // Cs ... 66 Cs OcrLanguages = "cs" 67 // Da ... 68 Da OcrLanguages = "da" 69 // De ... 70 De OcrLanguages = "de" 71 // El ... 72 El OcrLanguages = "el" 73 // En ... 74 En OcrLanguages = "en" 75 // Es ... 76 Es OcrLanguages = "es" 77 // Fi ... 78 Fi OcrLanguages = "fi" 79 // Fr ... 80 Fr OcrLanguages = "fr" 81 // Hu ... 82 Hu OcrLanguages = "hu" 83 // It ... 84 It OcrLanguages = "it" 85 // Ja ... 86 Ja OcrLanguages = "ja" 87 // Ko ... 88 Ko OcrLanguages = "ko" 89 // Nb ... 90 Nb OcrLanguages = "nb" 91 // Nl ... 92 Nl OcrLanguages = "nl" 93 // Pl ... 94 Pl OcrLanguages = "pl" 95 // Pt ... 96 Pt OcrLanguages = "pt" 97 // Ro ... 98 Ro OcrLanguages = "ro" 99 // Ru ... 100 Ru OcrLanguages = "ru" 101 // Sk ... 102 Sk OcrLanguages = "sk" 103 // SrCyrl ... 104 SrCyrl OcrLanguages = "sr-Cyrl" 105 // SrLatn ... 106 SrLatn OcrLanguages = "sr-Latn" 107 // Sv ... 108 Sv OcrLanguages = "sv" 109 // Tr ... 110 Tr OcrLanguages = "tr" 111 // Unk ... 112 Unk OcrLanguages = "unk" 113 // ZhHans ... 114 ZhHans OcrLanguages = "zh-Hans" 115 // ZhHant ... 116 ZhHant OcrLanguages = "zh-Hant" 117) 118 119// PossibleOcrLanguagesValues returns an array of possible values for the OcrLanguages const type. 120func PossibleOcrLanguagesValues() []OcrLanguages { 121 return []OcrLanguages{Ar, Cs, Da, De, El, En, Es, Fi, Fr, Hu, It, Ja, Ko, Nb, Nl, Pl, Pt, Ro, Ru, Sk, SrCyrl, SrLatn, Sv, Tr, Unk, ZhHans, ZhHant} 122} 123 124// TextOperationStatusCodes enumerates the values for text operation status codes. 125type TextOperationStatusCodes string 126 127const ( 128 // Failed ... 129 Failed TextOperationStatusCodes = "Failed" 130 // NotStarted ... 131 NotStarted TextOperationStatusCodes = "NotStarted" 132 // Running ... 133 Running TextOperationStatusCodes = "Running" 134 // Succeeded ... 135 Succeeded TextOperationStatusCodes = "Succeeded" 136) 137 138// PossibleTextOperationStatusCodesValues returns an array of possible values for the TextOperationStatusCodes const type. 139func PossibleTextOperationStatusCodesValues() []TextOperationStatusCodes { 140 return []TextOperationStatusCodes{Failed, NotStarted, Running, Succeeded} 141} 142 143// TextRecognitionMode enumerates the values for text recognition mode. 144type TextRecognitionMode string 145 146const ( 147 // Handwritten ... 148 Handwritten TextRecognitionMode = "Handwritten" 149 // Printed ... 150 Printed TextRecognitionMode = "Printed" 151) 152 153// PossibleTextRecognitionModeValues returns an array of possible values for the TextRecognitionMode const type. 154func PossibleTextRecognitionModeValues() []TextRecognitionMode { 155 return []TextRecognitionMode{Handwritten, Printed} 156} 157 158// TextRecognitionResultConfidenceClass enumerates the values for text recognition result confidence class. 159type TextRecognitionResultConfidenceClass string 160 161const ( 162 // High ... 163 High TextRecognitionResultConfidenceClass = "High" 164 // Low ... 165 Low TextRecognitionResultConfidenceClass = "Low" 166) 167 168// PossibleTextRecognitionResultConfidenceClassValues returns an array of possible values for the TextRecognitionResultConfidenceClass const type. 169func PossibleTextRecognitionResultConfidenceClassValues() []TextRecognitionResultConfidenceClass { 170 return []TextRecognitionResultConfidenceClass{High, Low} 171} 172 173// TextRecognitionResultDimensionUnit enumerates the values for text recognition result dimension unit. 174type TextRecognitionResultDimensionUnit string 175 176const ( 177 // Inch ... 178 Inch TextRecognitionResultDimensionUnit = "inch" 179 // Pixel ... 180 Pixel TextRecognitionResultDimensionUnit = "pixel" 181) 182 183// PossibleTextRecognitionResultDimensionUnitValues returns an array of possible values for the TextRecognitionResultDimensionUnit const type. 184func PossibleTextRecognitionResultDimensionUnitValues() []TextRecognitionResultDimensionUnit { 185 return []TextRecognitionResultDimensionUnit{Inch, Pixel} 186} 187 188// VisualFeatureTypes enumerates the values for visual feature types. 189type VisualFeatureTypes string 190 191const ( 192 // VisualFeatureTypesAdult ... 193 VisualFeatureTypesAdult VisualFeatureTypes = "Adult" 194 // VisualFeatureTypesBrands ... 195 VisualFeatureTypesBrands VisualFeatureTypes = "Brands" 196 // VisualFeatureTypesCategories ... 197 VisualFeatureTypesCategories VisualFeatureTypes = "Categories" 198 // VisualFeatureTypesColor ... 199 VisualFeatureTypesColor VisualFeatureTypes = "Color" 200 // VisualFeatureTypesDescription ... 201 VisualFeatureTypesDescription VisualFeatureTypes = "Description" 202 // VisualFeatureTypesFaces ... 203 VisualFeatureTypesFaces VisualFeatureTypes = "Faces" 204 // VisualFeatureTypesImageType ... 205 VisualFeatureTypesImageType VisualFeatureTypes = "ImageType" 206 // VisualFeatureTypesObjects ... 207 VisualFeatureTypesObjects VisualFeatureTypes = "Objects" 208 // VisualFeatureTypesTags ... 209 VisualFeatureTypesTags VisualFeatureTypes = "Tags" 210) 211 212// PossibleVisualFeatureTypesValues returns an array of possible values for the VisualFeatureTypes const type. 213func PossibleVisualFeatureTypesValues() []VisualFeatureTypes { 214 return []VisualFeatureTypes{VisualFeatureTypesAdult, VisualFeatureTypesBrands, VisualFeatureTypesCategories, VisualFeatureTypesColor, VisualFeatureTypesDescription, VisualFeatureTypesFaces, VisualFeatureTypesImageType, VisualFeatureTypesObjects, VisualFeatureTypesTags} 215} 216 217// AdultInfo an object describing whether the image contains adult-oriented content and/or is racy. 218type AdultInfo struct { 219 // IsAdultContent - A value indicating if the image contains adult-oriented content. 220 IsAdultContent *bool `json:"isAdultContent,omitempty"` 221 // IsRacyContent - A value indicating if the image is racy. 222 IsRacyContent *bool `json:"isRacyContent,omitempty"` 223 // AdultScore - Score from 0 to 1 that indicates how much the content is considered adult-oriented within the image. 224 AdultScore *float64 `json:"adultScore,omitempty"` 225 // RacyScore - Score from 0 to 1 that indicates how suggestive is the image. 226 RacyScore *float64 `json:"racyScore,omitempty"` 227} 228 229// AreaOfInterestResult result of AreaOfInterest operation. 230type AreaOfInterestResult struct { 231 autorest.Response `json:"-"` 232 // AreaOfInterest - READ-ONLY; A bounding box for an area of interest inside an image. 233 AreaOfInterest *BoundingRect `json:"areaOfInterest,omitempty"` 234 // RequestID - Id of the REST API request. 235 RequestID *string `json:"requestId,omitempty"` 236 Metadata *ImageMetadata `json:"metadata,omitempty"` 237} 238 239// BoundingRect a bounding box for an area inside an image. 240type BoundingRect struct { 241 // X - X-coordinate of the top left point of the area, in pixels. 242 X *int32 `json:"x,omitempty"` 243 // Y - Y-coordinate of the top left point of the area, in pixels. 244 Y *int32 `json:"y,omitempty"` 245 // W - Width measured from the top-left point of the area, in pixels. 246 W *int32 `json:"w,omitempty"` 247 // H - Height measured from the top-left point of the area, in pixels. 248 H *int32 `json:"h,omitempty"` 249} 250 251// Category an object describing identified category. 252type Category struct { 253 // Name - Name of the category. 254 Name *string `json:"name,omitempty"` 255 // Score - Scoring of the category. 256 Score *float64 `json:"score,omitempty"` 257 // Detail - Details of the identified category. 258 Detail *CategoryDetail `json:"detail,omitempty"` 259} 260 261// CategoryDetail an object describing additional category details. 262type CategoryDetail struct { 263 // Celebrities - An array of celebrities if any identified. 264 Celebrities *[]CelebritiesModel `json:"celebrities,omitempty"` 265 // Landmarks - An array of landmarks if any identified. 266 Landmarks *[]LandmarksModel `json:"landmarks,omitempty"` 267} 268 269// CelebritiesModel an object describing possible celebrity identification. 270type CelebritiesModel struct { 271 // Name - Name of the celebrity. 272 Name *string `json:"name,omitempty"` 273 // Confidence - Confidence level for the celebrity recognition as a value ranging from 0 to 1. 274 Confidence *float64 `json:"confidence,omitempty"` 275 // FaceRectangle - Location of the identified face in the image. 276 FaceRectangle *FaceRectangle `json:"faceRectangle,omitempty"` 277} 278 279// CelebrityResults result of domain-specific classifications for the domain of celebrities. 280type CelebrityResults struct { 281 // Celebrities - List of celebrities recognized in the image. 282 Celebrities *[]CelebritiesModel `json:"celebrities,omitempty"` 283 // RequestID - Id of the REST API request. 284 RequestID *string `json:"requestId,omitempty"` 285 Metadata *ImageMetadata `json:"metadata,omitempty"` 286} 287 288// ColorInfo an object providing additional metadata describing color attributes. 289type ColorInfo struct { 290 // DominantColorForeground - Possible dominant foreground color. 291 DominantColorForeground *string `json:"dominantColorForeground,omitempty"` 292 // DominantColorBackground - Possible dominant background color. 293 DominantColorBackground *string `json:"dominantColorBackground,omitempty"` 294 // DominantColors - An array of possible dominant colors. 295 DominantColors *[]string `json:"dominantColors,omitempty"` 296 // AccentColor - Possible accent color. 297 AccentColor *string `json:"accentColor,omitempty"` 298 // IsBWImg - A value indicating if the image is black and white. 299 IsBWImg *bool `json:"isBWImg,omitempty"` 300} 301 302// DetectedBrand a brand detected in an image. 303type DetectedBrand struct { 304 // Name - READ-ONLY; Label for the brand. 305 Name *string `json:"name,omitempty"` 306 // Confidence - READ-ONLY; Confidence score of having observed the brand in the image, as a value ranging from 0 to 1. 307 Confidence *float64 `json:"confidence,omitempty"` 308 // Rectangle - READ-ONLY; Approximate location of the detected brand. 309 Rectangle *BoundingRect `json:"rectangle,omitempty"` 310} 311 312// DetectedObject an object detected in an image. 313type DetectedObject struct { 314 // Rectangle - READ-ONLY; Approximate location of the detected object. 315 Rectangle *BoundingRect `json:"rectangle,omitempty"` 316 // Object - Label for the object. 317 Object *string `json:"object,omitempty"` 318 // Confidence - Confidence score of having observed the object in the image, as a value ranging from 0 to 1. 319 Confidence *float64 `json:"confidence,omitempty"` 320 // Parent - The parent object, from a taxonomy perspective. 321 // The parent object is a more generic form of this object. For example, a 'bulldog' would have a parent of 'dog'. 322 Parent *ObjectHierarchy `json:"parent,omitempty"` 323} 324 325// DetectResult result of a DetectImage call. 326type DetectResult struct { 327 autorest.Response `json:"-"` 328 // Objects - READ-ONLY; An array of detected objects. 329 Objects *[]DetectedObject `json:"objects,omitempty"` 330 // RequestID - Id of the REST API request. 331 RequestID *string `json:"requestId,omitempty"` 332 Metadata *ImageMetadata `json:"metadata,omitempty"` 333} 334 335// DomainModelResults result of image analysis using a specific domain model including additional metadata. 336type DomainModelResults struct { 337 autorest.Response `json:"-"` 338 // Result - Model-specific response. 339 Result interface{} `json:"result,omitempty"` 340 // RequestID - Id of the REST API request. 341 RequestID *string `json:"requestId,omitempty"` 342 Metadata *ImageMetadata `json:"metadata,omitempty"` 343} 344 345// Error details about the API request error. 346type Error struct { 347 // Code - The error code. 348 Code interface{} `json:"code,omitempty"` 349 // Message - A message explaining the error reported by the service. 350 Message *string `json:"message,omitempty"` 351 // RequestID - A unique request identifier. 352 RequestID *string `json:"requestId,omitempty"` 353} 354 355// FaceDescription an object describing a face identified in the image. 356type FaceDescription struct { 357 // Age - Possible age of the face. 358 Age *int32 `json:"age,omitempty"` 359 // Gender - Possible gender of the face. Possible values include: 'Male', 'Female' 360 Gender Gender `json:"gender,omitempty"` 361 // FaceRectangle - Rectangle in the image containing the identified face. 362 FaceRectangle *FaceRectangle `json:"faceRectangle,omitempty"` 363} 364 365// FaceRectangle an object describing face rectangle. 366type FaceRectangle struct { 367 // Left - X-coordinate of the top left point of the face, in pixels. 368 Left *int32 `json:"left,omitempty"` 369 // Top - Y-coordinate of the top left point of the face, in pixels. 370 Top *int32 `json:"top,omitempty"` 371 // Width - Width measured from the top-left point of the face, in pixels. 372 Width *int32 `json:"width,omitempty"` 373 // Height - Height measured from the top-left point of the face, in pixels. 374 Height *int32 `json:"height,omitempty"` 375} 376 377// ImageAnalysis result of AnalyzeImage operation. 378type ImageAnalysis struct { 379 autorest.Response `json:"-"` 380 // Categories - An array indicating identified categories. 381 Categories *[]Category `json:"categories,omitempty"` 382 // Adult - An object describing whether the image contains adult-oriented content and/or is racy. 383 Adult *AdultInfo `json:"adult,omitempty"` 384 // Color - An object providing additional metadata describing color attributes. 385 Color *ColorInfo `json:"color,omitempty"` 386 // ImageType - An object providing possible image types and matching confidence levels. 387 ImageType *ImageType `json:"imageType,omitempty"` 388 // Tags - A list of tags with confidence level. 389 Tags *[]ImageTag `json:"tags,omitempty"` 390 // Description - A collection of content tags, along with a list of captions sorted by confidence level, and image metadata. 391 Description *ImageDescriptionDetails `json:"description,omitempty"` 392 // Faces - An array of possible faces within the image. 393 Faces *[]FaceDescription `json:"faces,omitempty"` 394 // Objects - Array of objects describing what was detected in the image. 395 Objects *[]DetectedObject `json:"objects,omitempty"` 396 // Brands - Array of brands detected in the image. 397 Brands *[]DetectedBrand `json:"brands,omitempty"` 398 // RequestID - Id of the REST API request. 399 RequestID *string `json:"requestId,omitempty"` 400 Metadata *ImageMetadata `json:"metadata,omitempty"` 401} 402 403// ImageCaption an image caption, i.e. a brief description of what the image depicts. 404type ImageCaption struct { 405 // Text - The text of the caption. 406 Text *string `json:"text,omitempty"` 407 // Confidence - The level of confidence the service has in the caption. 408 Confidence *float64 `json:"confidence,omitempty"` 409} 410 411// ImageDescription a collection of content tags, along with a list of captions sorted by confidence level, 412// and image metadata. 413type ImageDescription struct { 414 autorest.Response `json:"-"` 415 // ImageDescriptionDetails - A collection of content tags, along with a list of captions sorted by confidence level, and image metadata. 416 *ImageDescriptionDetails `json:"description,omitempty"` 417 // RequestID - Id of the REST API request. 418 RequestID *string `json:"requestId,omitempty"` 419 Metadata *ImageMetadata `json:"metadata,omitempty"` 420} 421 422// MarshalJSON is the custom marshaler for ImageDescription. 423func (ID ImageDescription) MarshalJSON() ([]byte, error) { 424 objectMap := make(map[string]interface{}) 425 if ID.ImageDescriptionDetails != nil { 426 objectMap["description"] = ID.ImageDescriptionDetails 427 } 428 if ID.RequestID != nil { 429 objectMap["requestId"] = ID.RequestID 430 } 431 if ID.Metadata != nil { 432 objectMap["metadata"] = ID.Metadata 433 } 434 return json.Marshal(objectMap) 435} 436 437// UnmarshalJSON is the custom unmarshaler for ImageDescription struct. 438func (ID *ImageDescription) UnmarshalJSON(body []byte) error { 439 var m map[string]*json.RawMessage 440 err := json.Unmarshal(body, &m) 441 if err != nil { 442 return err 443 } 444 for k, v := range m { 445 switch k { 446 case "description": 447 if v != nil { 448 var imageDescriptionDetails ImageDescriptionDetails 449 err = json.Unmarshal(*v, &imageDescriptionDetails) 450 if err != nil { 451 return err 452 } 453 ID.ImageDescriptionDetails = &imageDescriptionDetails 454 } 455 case "requestId": 456 if v != nil { 457 var requestID string 458 err = json.Unmarshal(*v, &requestID) 459 if err != nil { 460 return err 461 } 462 ID.RequestID = &requestID 463 } 464 case "metadata": 465 if v != nil { 466 var metadata ImageMetadata 467 err = json.Unmarshal(*v, &metadata) 468 if err != nil { 469 return err 470 } 471 ID.Metadata = &metadata 472 } 473 } 474 } 475 476 return nil 477} 478 479// ImageDescriptionDetails a collection of content tags, along with a list of captions sorted by confidence 480// level, and image metadata. 481type ImageDescriptionDetails struct { 482 // Tags - A collection of image tags. 483 Tags *[]string `json:"tags,omitempty"` 484 // Captions - A list of captions, sorted by confidence level. 485 Captions *[]ImageCaption `json:"captions,omitempty"` 486} 487 488// ImageMetadata image metadata. 489type ImageMetadata struct { 490 // Width - Image width, in pixels. 491 Width *int32 `json:"width,omitempty"` 492 // Height - Image height, in pixels. 493 Height *int32 `json:"height,omitempty"` 494 // Format - Image format. 495 Format *string `json:"format,omitempty"` 496} 497 498// ImageTag an entity observation in the image, along with the confidence score. 499type ImageTag struct { 500 // Name - Name of the entity. 501 Name *string `json:"name,omitempty"` 502 // Confidence - The level of confidence that the entity was observed. 503 Confidence *float64 `json:"confidence,omitempty"` 504 // Hint - Optional hint/details for this tag. 505 Hint *string `json:"hint,omitempty"` 506} 507 508// ImageType an object providing possible image types and matching confidence levels. 509type ImageType struct { 510 // ClipArtType - Confidence level that the image is a clip art. 511 ClipArtType *int32 `json:"clipArtType,omitempty"` 512 // LineDrawingType - Confidence level that the image is a line drawing. 513 LineDrawingType *int32 `json:"lineDrawingType,omitempty"` 514} 515 516// ImageURL ... 517type ImageURL struct { 518 // URL - Publicly reachable URL of an image. 519 URL *string `json:"url,omitempty"` 520} 521 522// LandmarkResults result of domain-specific classifications for the domain of landmarks. 523type LandmarkResults struct { 524 // Landmarks - List of landmarks recognized in the image. 525 Landmarks *[]LandmarksModel `json:"landmarks,omitempty"` 526 // RequestID - Id of the REST API request. 527 RequestID *string `json:"requestId,omitempty"` 528 Metadata *ImageMetadata `json:"metadata,omitempty"` 529} 530 531// LandmarksModel a landmark recognized in the image. 532type LandmarksModel struct { 533 // Name - Name of the landmark. 534 Name *string `json:"name,omitempty"` 535 // Confidence - Confidence level for the landmark recognition as a value ranging from 0 to 1. 536 Confidence *float64 `json:"confidence,omitempty"` 537} 538 539// Line an object representing a recognized text line. 540type Line struct { 541 // BoundingBox - Bounding box of a recognized line. 542 BoundingBox *[]float64 `json:"boundingBox,omitempty"` 543 // Text - The text content of the line. 544 Text *string `json:"text,omitempty"` 545 // Words - List of words in the text line. 546 Words *[]Word `json:"words,omitempty"` 547} 548 549// ListModelsResult result of the List Domain Models operation. 550type ListModelsResult struct { 551 autorest.Response `json:"-"` 552 // ModelsProperty - READ-ONLY; An array of supported models. 553 ModelsProperty *[]ModelDescription `json:"models,omitempty"` 554} 555 556// ModelDescription an object describing supported model by name and categories. 557type ModelDescription struct { 558 // Name - The name of the model. 559 Name *string `json:"name,omitempty"` 560 // Categories - Categories of the model. 561 Categories *[]string `json:"categories,omitempty"` 562} 563 564// ObjectHierarchy an object detected inside an image. 565type ObjectHierarchy struct { 566 // Object - Label for the object. 567 Object *string `json:"object,omitempty"` 568 // Confidence - Confidence score of having observed the object in the image, as a value ranging from 0 to 1. 569 Confidence *float64 `json:"confidence,omitempty"` 570 // Parent - The parent object, from a taxonomy perspective. 571 // The parent object is a more generic form of this object. For example, a 'bulldog' would have a parent of 'dog'. 572 Parent *ObjectHierarchy `json:"parent,omitempty"` 573} 574 575// OcrLine an object describing a single recognized line of text. 576type OcrLine struct { 577 // BoundingBox - Bounding box of a recognized line. The four integers represent the x-coordinate of the left edge, the y-coordinate of the top edge, width, and height of the bounding box, in the coordinate system of the input image, after it has been rotated around its center according to the detected text angle (see textAngle property), with the origin at the top-left corner, and the y-axis pointing down. 578 BoundingBox *string `json:"boundingBox,omitempty"` 579 // Words - An array of objects, where each object represents a recognized word. 580 Words *[]OcrWord `json:"words,omitempty"` 581} 582 583// OcrRegion a region consists of multiple lines (e.g. a column of text in a multi-column document). 584type OcrRegion struct { 585 // BoundingBox - Bounding box of a recognized region. The four integers represent the x-coordinate of the left edge, the y-coordinate of the top edge, width, and height of the bounding box, in the coordinate system of the input image, after it has been rotated around its center according to the detected text angle (see textAngle property), with the origin at the top-left corner, and the y-axis pointing down. 586 BoundingBox *string `json:"boundingBox,omitempty"` 587 // Lines - An array of recognized lines of text. 588 Lines *[]OcrLine `json:"lines,omitempty"` 589} 590 591// OcrResult ... 592type OcrResult struct { 593 autorest.Response `json:"-"` 594 // Language - The BCP-47 language code of the text in the image. 595 Language *string `json:"language,omitempty"` 596 // TextAngle - The angle, in degrees, of the detected text with respect to the closest horizontal or vertical direction. After rotating the input image clockwise by this angle, the recognized text lines become horizontal or vertical. In combination with the orientation property it can be used to overlay recognition results correctly on the original image, by rotating either the original image or recognition results by a suitable angle around the center of the original image. If the angle cannot be confidently detected, this property is not present. If the image contains text at different angles, only part of the text will be recognized correctly. 597 TextAngle *float64 `json:"textAngle,omitempty"` 598 // Orientation - Orientation of the text recognized in the image. The value (up, down, left, or right) refers to the direction that the top of the recognized text is facing, after the image has been rotated around its center according to the detected text angle (see textAngle property). 599 Orientation *string `json:"orientation,omitempty"` 600 // Regions - An array of objects, where each object represents a region of recognized text. 601 Regions *[]OcrRegion `json:"regions,omitempty"` 602} 603 604// OcrWord information on a recognized word. 605type OcrWord struct { 606 // BoundingBox - Bounding box of a recognized word. The four integers represent the x-coordinate of the left edge, the y-coordinate of the top edge, width, and height of the bounding box, in the coordinate system of the input image, after it has been rotated around its center according to the detected text angle (see textAngle property), with the origin at the top-left corner, and the y-axis pointing down. 607 BoundingBox *string `json:"boundingBox,omitempty"` 608 // Text - String value of a recognized word. 609 Text *string `json:"text,omitempty"` 610} 611 612// ReadCloser ... 613type ReadCloser struct { 614 autorest.Response `json:"-"` 615 Value *io.ReadCloser `json:"value,omitempty"` 616} 617 618// ReadOperationResult OCR result of the read operation. 619type ReadOperationResult struct { 620 autorest.Response `json:"-"` 621 // Status - Status of the read operation. Possible values include: 'NotStarted', 'Running', 'Failed', 'Succeeded' 622 Status TextOperationStatusCodes `json:"status,omitempty"` 623 // RecognitionResults - An array of text recognition result of the read operation. 624 RecognitionResults *[]TextRecognitionResult `json:"recognitionResults,omitempty"` 625} 626 627// TagResult the results of a image tag operation, including any tags and image metadata. 628type TagResult struct { 629 autorest.Response `json:"-"` 630 // Tags - A list of tags with confidence level. 631 Tags *[]ImageTag `json:"tags,omitempty"` 632 // RequestID - Id of the REST API request. 633 RequestID *string `json:"requestId,omitempty"` 634 Metadata *ImageMetadata `json:"metadata,omitempty"` 635} 636 637// TextOperationResult result of recognition text operation. 638type TextOperationResult struct { 639 autorest.Response `json:"-"` 640 // Status - Status of the text operation. Possible values include: 'NotStarted', 'Running', 'Failed', 'Succeeded' 641 Status TextOperationStatusCodes `json:"status,omitempty"` 642 // RecognitionResult - Text recognition result of the text operation. 643 RecognitionResult *TextRecognitionResult `json:"recognitionResult,omitempty"` 644} 645 646// TextRecognitionResult an object representing a recognized text region 647type TextRecognitionResult struct { 648 // Page - The 1-based page number of the recognition result. 649 Page *int32 `json:"page,omitempty"` 650 // ClockwiseOrientation - The orientation of the image in degrees in the clockwise direction. Range between [0, 360). 651 ClockwiseOrientation *float64 `json:"clockwiseOrientation,omitempty"` 652 // Width - The width of the image in pixels or the PDF in inches. 653 Width *float64 `json:"width,omitempty"` 654 // Height - The height of the image in pixels or the PDF in inches. 655 Height *float64 `json:"height,omitempty"` 656 // Unit - The unit used in the Width, Height and BoundingBox. For images, the unit is 'pixel'. For PDF, the unit is 'inch'. Possible values include: 'Pixel', 'Inch' 657 Unit TextRecognitionResultDimensionUnit `json:"unit,omitempty"` 658 // Lines - A list of recognized text lines. 659 Lines *[]Line `json:"lines,omitempty"` 660} 661 662// Word an object representing a recognized word. 663type Word struct { 664 // BoundingBox - Bounding box of a recognized word. 665 BoundingBox *[]float64 `json:"boundingBox,omitempty"` 666 // Text - The text content of the word. 667 Text *string `json:"text,omitempty"` 668 // Confidence - Qualitative confidence measure. Possible values include: 'High', 'Low' 669 Confidence TextRecognitionResultConfidenceClass `json:"confidence,omitempty"` 670} 671