{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudmersive/json-schema/cloudmersive-photo-to-words-with-location-result-schema.json",
  "title": "PhotoToWordsWithLocationResult",
  "description": "Result of an photo to words-with-location OCR operation",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudmersive-imageocr-api-openapi.yml#/components/schemas/PhotoToWordsWithLocationResult",
  "type": "object",
  "properties": {
    "Successful": {
      "description": "True if successful, false otherwise",
      "type": "boolean"
    },
    "TextElements": {
      "description": "Word elements in the image",
      "type": "array",
      "items": {
        "$ref": "#/$defs/OcrPhotoTextElement"
      }
    },
    "DiagnosticImage": {
      "format": "byte",
      "description": "Typically null.  To analyze OCR performance, enable diagnostic mode by adding the HTTP header \"DiagnosticMode\" with the value \"true\".  When this is true, a diagnostic image showing the details of the OCR result will be set in PNG format into DiagnosticImage.",
      "type": "string"
    }
  },
  "$defs": {
    "OcrPhotoTextElement": {
      "description": "A single text in an OCR document",
      "type": "object",
      "properties": {
        "Text": {
          "description": "Text of the word",
          "type": "string"
        },
        "XLeft": {
          "format": "int32",
          "description": "X location of the left edge of the word in pixels",
          "type": "integer"
        },
        "YTop": {
          "format": "int32",
          "description": "Y location of the top edge of the word in pixels",
          "type": "integer"
        },
        "Width": {
          "format": "int32",
          "description": "Width of the word in pixels",
          "type": "integer"
        },
        "Height": {
          "format": "int32",
          "description": "Height of the word in pixels",
          "type": "integer"
        },
        "BoundingPoints": {
          "description": "Points that form the bounding polygon around the text",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Point"
          }
        },
        "ConfidenceLevel": {
          "format": "double",
          "description": "Confidence level of the machine learning result; possible values are 0.0 (lowest accuracy) - 1.0 (highest accuracy)",
          "type": "number"
        }
      }
    },
    "Point": {
      "description": "Point location in 2D in an image, where 0, 0 represents the top/left corner of the image",
      "type": "object",
      "properties": {
        "X": {
          "format": "int32",
          "description": "X location in 2D in the image, where 0 represents the left edge of the image",
          "type": "integer"
        },
        "Y": {
          "format": "int32",
          "description": "Y location in 2D in the image, where 0 represents the top edge of the image",
          "type": "integer"
        }
      }
    }
  }
}