Skip to content

API Reference parrot_pipelines.planogram.perception.rows

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_pipelines.planogram.perception.rows

View source

Row and shelf-edge structure from proposed shapes (FEAT-574). Pure and picklable.

Alias ShapeCandidate

Re-exported from parrot_pipelines.planogram.perception.profiles.ShapeCandidate.

Function detect_shelf_edges

Y coordinates of long horizontal edges, top→bottom. [] when none.

detect_shelf_edges(image: np.ndarray, *, min_length: float = 0.35) -> List[int]

Parameter Type Default Description
image np.ndarray BGR or gray uint8 source image.
min_length float 0.35 Minimum edge length as a fraction of the image width.

Returns: List[int] — Sorted, de-duplicated y coordinates (ints).

Raises:

  • ValueError — image is not a non-empty uint8 HxW / HxWx3 array.

Function group_rows

Group aligned, similarly sized candidates into visible rows.

Reference: plancheck/detection.py:68. Rows are visible rows, not planogram shelf identities.

group_rows(candidates: Sequence[ShapeCandidate], image_width: int, *, min_row_items: int = 4, max_slope: float = 0.12) -> List[List[ShapeCandidate]]

Parameter Type Default Description
candidates Sequence[ShapeCandidate] Proposed shapes of ONE image (any profile mix; callers usually pass one kind).
image_width int Source image width in pixels.
min_row_items int 4 Minimum members for a row.
max_slope float 0.12 Maximum |slope| of a row line (perspective tolerance).

Returns: List[List[ShapeCandidate]] — Rows ordered top→bottom, items left→right. Candidates that fit no row are omitted. [] when fewer than min_row_items candidates are given.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally