detect_text_blocks
Find text-like blocks in an image revision and report if the text stays legible after preview downscale, with recommended crop bands for readable previews.
Instructions
Find the text-like blocks (headline, paragraphs, table, caption) of a revision with
a binarize + run-length smearing + connected-components pass, and report whether the
text will survive a preview downscale. Read-only: it never modifies the image.
Blocks come back in reading order (top to bottom, then left to right) in
post-EXIF-orientation pixel coordinates, each with its line_count,
median_line_height_px and ink_ratio. legibility.line_height_at_1568_px is the
median line height once the whole image is shrunk to long edge 1568 (below ~16 the
text is usually unreadable), and legibility.recommended_bands splits the image into
crops that clear that bar - each entry is already a crop operation, so paste one into
a recipe before render_preview long_edge: 1568 and read them in order.
legibility.strategy says how it split: "whole" (no split needed), "bands"
(full-width horizontal bands) or "blocks" (per-block crops, used when the image is too
wide for full-width bands to help). Optional max_blocks (1..=128, default 32) and min_block_area_ratio
(0.0..=1.0, default 0.00005) bound how many and how small the blocks may be.
No block found means the image has no text-like structure, not an error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_blocks | No | 返すブロック数の上限(1..=128)。省略時は 32。 | |
| revision_id | Yes | 対象 revision ID("rev_...")。 | |
| min_block_area_ratio | No | 作業画像面積に対する 1 ブロックの最小面積比(0.0..=1.0)。 これ未満の成分はノイズとして捨てる。省略時は 0.00005。 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| detection | Yes | 検出結果。ブロックが無ければ `blocks` は空で `warnings` に理由が入る。 | |
| revision_id | Yes |