Planogram Compliance - Match

Run the planogram matching operation against a planogram and a product understanding result.

POST /planogramcompliance:match?api-version=2023-04-01-preview

URI Parameters

Name In Required Type Description
api-version
query True

string

Requested API version.

Request Body

Media Types: "application/json-patch+json"

Name Required Type Description
detectedProducts True

ProductRecognitionResultApiModel

Results from the product understanding operation.

planogram True

PlanogramApiModel

Describes the planogram for planogram matching operations.

Responses

Name Type Description
200 OK

PlanogramMatchingResultApiModel

Success

Other Status Codes

ErrorResponse

Error

Headers

x-ms-error-code: string

Examples

PlanogramCompliance_Match

Sample request

POST /planogramcompliance:match?api-version=2023-04-01-preview

{
  "detectedProducts": {
    "imageMetadata": {
      "width": 660,
      "height": 495
    },
    "products": [
      {
        "id": "1",
        "boundingBox": {
          "x": 197,
          "y": 68,
          "w": 356,
          "h": 394
        },
        "tags": [
          {
            "name": "class1",
            "confidence": 0.92431640625
          }
        ]
      }
    ],
    "gaps": [
      {
        "id": "1",
        "boundingBox": {
          "x": 197,
          "y": 68,
          "w": 356,
          "h": 394
        },
        "tags": [
          {
            "name": "gap",
            "confidence": 0.92431640625
          }
        ]
      }
    ]
  },
  "planogram": {
    "width": 10,
    "height": 16,
    "products": [
      {
        "id": "1",
        "name": "product-1",
        "w": 8,
        "h": 25
      }
    ],
    "fixtures": [
      {
        "id": "1",
        "w": 20,
        "h": 4,
        "x": 0,
        "y": 0
      }
    ],
    "positions": [
      {
        "id": "1",
        "productId": "1",
        "fixtureId": "1",
        "x": 0,
        "y": 0
      }
    ]
  }
}

Sample response

{
  "matchingResultPerPosition": [
    {
      "positionId": "0",
      "detectedObject": {
        "id": "0",
        "boundingBox": {
          "x": 197,
          "y": 68,
          "w": 356,
          "h": 394
        },
        "tags": [
          {
            "name": "class1",
            "confidence": 0.92431640625
          }
        ]
      }
    }
  ]
}

Definitions

Name Description
BoundingBox

A bounding box for an area inside an image.

DetectedObject

Describes a detected object in an image.

ErrorResponse

Response returned when an error occurs.

ErrorResponseDetails

Error info.

ErrorResponseInnerError

Detailed error.

FixtureApiModel

Describes a fixture in a planogram.

ImageMetadataApiModel

The image metadata information such as height and width.

PlanogramApiModel

Describes the planogram for planogram matching operations.

PlanogramMatchingRequestApiModel

Input to pass into the planogram matching operation.

PlanogramMatchingResultApiModel

Results from the planogram matching operation.

PositionApiModel

Describes a product position in a planogram.

PositionMatchingResultApiModel

Paired planogram position ID and corresponding detected object from product understanding result.

ProductApiModel

Describes a product in the planogram.

ProductRecognitionResultApiModel

Results from the product understanding operation.

Tag

An entity observation in the image, along with the confidence score.

BoundingBox

A bounding box for an area inside an image.

Name Type Description
h

integer

Height measured from the top-left point of the area, in pixels.

w

integer

Width measured from the top-left point of the area, in pixels.

x

integer

Left-coordinate of the top left point of the area, in pixels.

y

integer

Top-coordinate of the top left point of the area, in pixels.

DetectedObject

Describes a detected object in an image.

Name Type Description
boundingBox

BoundingBox

A bounding box for an area inside an image.

id

string

Id of the detected object.

tags

Tag[]

Classification confidences of the detected object.

ErrorResponse

Response returned when an error occurs.

Name Type Description
error

ErrorResponseDetails

Error info.

ErrorResponseDetails

Error info.

Name Type Description
code

string

Error code.

details

ErrorResponseDetails[]

List of detailed errors.

innererror

ErrorResponseInnerError

Detailed error.

message

string

Error message.

target

string

Target of the error.

ErrorResponseInnerError

Detailed error.

Name Type Description
code

string

Error code.

innererror

ErrorResponseInnerError

Detailed error.

message

string

Error message.

FixtureApiModel

Describes a fixture in a planogram.

Name Type Description
h

number

Height of the fixture.

id

string

Id of the fixture.

w

number

Width of the fixture.

x

number

Left offset from the origin, in unit of in inches or centimeters.

y

number

Top offset from the origin, in unit of in inches or centimeters.

ImageMetadataApiModel

The image metadata information such as height and width.

Name Type Description
height

integer

The height of the image in pixels.

width

integer

The width of the image in pixels.

PlanogramApiModel

Describes the planogram for planogram matching operations.

Name Type Description
fixtures

FixtureApiModel[]

List of fixtures in the planogram.

height

number

Height of the planogram.

positions

PositionApiModel[]

List of positions in the planogram.

products

ProductApiModel[]

List of products in the planogram.

width

number

Width of the planogram.

PlanogramMatchingRequestApiModel

Input to pass into the planogram matching operation.

Name Type Description
detectedProducts

ProductRecognitionResultApiModel

Results from the product understanding operation.

planogram

PlanogramApiModel

Describes the planogram for planogram matching operations.

PlanogramMatchingResultApiModel

Results from the planogram matching operation.

Name Type Description
matchingResultPerPosition

PositionMatchingResultApiModel[]

The matched detected object information for each planogram position.

PositionApiModel

Describes a product position in a planogram.

Name Type Description
fixtureId

string

Id of the fixture that the product is on.

id

string

Id of the position.

productId

string

Id of the product.

x

number

Left offset from the origin, in unit of in inches or centimeters.

y

number

Top offset from the origin, in unit of in inches or centimeters.

PositionMatchingResultApiModel

Paired planogram position ID and corresponding detected object from product understanding result.

Name Type Description
detectedObject

DetectedObject

Describes a detected object in an image.

positionId

string

The position ID from the planogram matched to the corresponding detected object.

ProductApiModel

Describes a product in the planogram.

Name Type Description
h

number

Height of the fixture.

id

string

Id of the product.

name

string

Name of the product.

w

number

Width of the product.

ProductRecognitionResultApiModel

Results from the product understanding operation.

Name Type Description
gaps

DetectedObject[]

Gaps detected in the image.

imageMetadata

ImageMetadataApiModel

The image metadata information such as height and width.

products

DetectedObject[]

Products detected in the image.

Tag

An entity observation in the image, along with the confidence score.

Name Type Description
confidence

number

The level of confidence that the entity was observed.

name

string

Name of the entity.