Floor stack area inference pro

Updated at:

1. Product overview

An area analysis product for floor stacks, built on product recognition, an SKU asset knowledge base, and a proprietary area inference model. The product first locates products within a floor stack, then retrieves the actual dimensions (length, width, and height) and reference images for each corresponding SKU. It then infers the two edge lengths and the area of the floor stack's bounding rectangle. It is designed for evaluating the scale of in-store floor stack displays and for inspection and verification.

2. Use cases

  1. Floor stack area evaluation: Infer the area of a floor stack's bounding rectangle based on an image of the entire display and the products' actual dimensions.

  2. Mixed-SKU display analysis: Incorporate the dimensions of each distinct SKU into the edge length inference.

  3. Area result verification: Verify the results by cross-referencing the original image, product asset data, and the returned edge lengths and area.

3. Features

  1. SKU asset-driven: Specify an asset knowledge base by using ragId. Each participating product must have a name, positive values for length, width, and height, and at least one HTTPS reference image.

  2. Staged area inference: The calculation proceeds in stages: determining the decision edge, projecting SKU dimensions, accumulating sizes, and calculating the final area.

  3. Unit consistency: SKU asset dimensions are stored in centimeters (cm). The service returns edge lengths in meters (m) and area in square meters (m²).

  4. Integrity and numerical validation: The request fails if any assets are missing, no valid boxes are detected, or the calculated area does not meet product consistency checks.

4. Development

The request and response fields in this document follow the exact case and structure defined in the corresponding setup documentation. The examples show direct input and output for the business workflow and exclude platform gateway encapsulation. The actual endpoint URL, authentication method, and gateway encapsulation depend on the final published API.

Before you begin, you must have a queryable SKU asset knowledge base. Ensure that all recognized SKU codes can be matched to a complete asset in the knowledge base.

4.1 Request parameters

Parameter

Type

Required

Description

imageUrl

String

Yes

The publicly accessible HTTPS URL of the original image. The URL cannot contain spaces or user credentials.

ragId

String

Yes

The ID of the SKU asset knowledge base, which contains product names, dimensions, and reference images.

4.2 Request example

{
  "imageUrl": "https://example.com/images/api-10.jpg",
  "ragId": "cust_8001_sku_assets"
}

The example image URL and knowledge base ID are placeholders. Replace them with your actual resources in your API calls.

4.3 Response parameters

Common fields:

Field path

Type

Description

success

Boolean

Indicates whether the API call was successful. A successful call does not guarantee that the business logic passed all validation checks.

errorCode

String

An empty string on success, or an error code on failure.

errorMessage

String

An empty string on success, or a detailed error message on failure.

usageMap

Object

Returns {"ProcessingCount":1} on success or an empty object {} on failure.

usageMap.ProcessingCount

Integer

A count of 1 for a successfully processed request. This field is not returned on failure.

Business fields:

Field path

Type

Description

result

Object

The area inference result. This is an empty object on failure.

result.stage4_area_label

Object

The final edge lengths and area. This object must be valid on success.

result.stage4_area_label.left_edge_m

Number

The length of the left decision edge, in meters. A finite, positive number.

result.stage4_area_label.right_edge_m

Number

The length of the right decision edge, in meters. A finite, positive number.

result.stage4_area_label.area_m2

Number

The area of the bounding rectangle, in square meters. A finite, positive number.

totalCount

Number

The total number of product locations found in the original image. Returns 0 on failure.

recognizedCount

Number

The number of valid product boxes used for analysis. Returns 0 on failure.

filteredCount

Number

The number of filtered boxes, which includes pending boxes, empty boxes, caps, and other invalid boxes. Returns 0 on failure.

pendingCount

Number

The number of pending boxes. This is a subset of filteredCount. Returns 0 on failure.

The area represents the bounding rectangle of the union of all target SKU projections, not the pixel area of the product boxes. Up to two reference images can be used per SKU. The total number of images in a request, including the original image and all reference images, cannot exceed 28. The request fails if the service cannot retain at least one reference image for any given SKU. Edge lengths and the area are rounded to four decimal places according to model rules. The difference between the returned area and the product of the two edge lengths must not exceed max(0.0002, product_of_edges × 0.001). Do not add pendingCount and filteredCount together, as pendingCount is a subset of filteredCount.

The external result contains only stage4_area_label and does not return the intermediate inference process. The system returns InvalidParameter if there are no valid SKU boxes, SKU assets are missing, or asset information is incomplete. It returns DownstreamUnavailable if the asset query service fails, the model call fails, or the area value is invalid.

4.4 Response examples

The following examples show the response structure and do not contain actual measured data.

1) Successful response

{
  "success": true,
  "errorCode": "",
  "errorMessage": "",
  "result": {
    "stage4_area_label": {
      "left_edge_m": 1.35,
      "right_edge_m": 0.7,
      "area_m2": 0.945
    }
  },
  "totalCount": 6,
  "recognizedCount": 4,
  "filteredCount": 2,
  "pendingCount": 1,
  "usageMap": {
    "ProcessingCount": 1
  }
}

Parameter error response

{
  "success": false,
  "errorCode": "InvalidParameter",
  "errorMessage": "ragId cannot be empty",
  "usageMap": {},
  "result": {},
  "totalCount": 0,
  "recognizedCount": 0,
  "filteredCount": 0,
  "pendingCount": 0
}

Missing SKU asset response

{
  "success": false,
  "errorCode": "InvalidParameter",
  "errorMessage": "SKU assets are missing, cannot complete area inference",
  "usageMap": {},
  "result": {},
  "totalCount": 0,
  "recognizedCount": 0,
  "filteredCount": 0,
  "pendingCount": 0
}

4.5 Error codes

Error code

Description

Recommended action

InvalidParameter

The input is invalid, or the recognition service returned an explicit business error.

Correct the parameters or business input based on the errorMessage and retry the call.

DownstreamUnavailable

A downstream processing error occurred, such as an authentication failure, throttling, a timeout, an empty response, missing fields, or a parsing error.

Check your resource and service status based on the errorMessage. If the issue is temporary, retry the call after a short wait.

Evaluate the result by checking the success, errorCode, and errorMessage fields together. The source setup documentation does not specify HTTP status codes for each type of business error. For common platform error codes, see Error codes. For errors specific to this API workflow, refer to the table above.