fullseye

labels_to_indices — REPRCONV index op

使い方

labels → 非背景の添字 (N,)。:func:indices_to_labels の逆向き。

2-D 以上のラベル画像も受ける —— その場合の添字は labels.ravel() への添字(C 順)である。np.unravel_index で 座標へ戻せるが、戻すには元の shape が要るので、この向きは shape を捨てている(不可逆)。

Args: labels: 任意次元の整数/実ラベル配列。 Returns: (N,) int64。ラベルが 0 でない位置の平坦添字(昇順)。 Raises: ValueError: 空 / 非有限 / 非背景が 1 つも無い。

参考(サンプルデータ・文献)

実行できる例(この op を実際に呼ぶ検証済みサンプル)

型が繋がる次の op(indices を入力に取れる)

indices_to_labels · select_points

同カテゴリ(index)

indices_to_labels · select_points


Provenance: reprconv.py — REPRCONV operator registry. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.