> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/workflows/ja/burokku/blocks/visualize-predictions/text-display.md).

# テキスト表示

スタイルと位置のオプションを使って、画像上にカスタマイズ可能なテキストを表示します。

この **テキスト表示** ブロックは、スタイルと位置を完全に制御して画像上にテキストを描画します。

### 動的テキストコンテンツ

テキスト内容は、Email および SMS 通知ブロックと同じテンプレート構文を使用して、ワークフロー実行結果でパラメータ化できます:

```
text = "検出された {{ $parameters.count }} 個の {{ $parameters.class_name }} クラスのオブジェクト"
```

パラメータは次を介して提供されます `text_parameters` フィールド:

```
text_parameters = {
    "count": "$steps.model.predictions",
    "class_name": "$inputs.target_class"
}
```

パラメータには次を使用して変換を適用できます `text_parameters_operations`:

```
text_parameters_operations = {
    "count": [{"type": "SequenceLength"}]
}
```

### スタイルオプション

* **text\_color**: テキストの色。サポートされる形式:
  * Supervision の色名（大文字）: "WHITE", "BLACK", "RED", "GREEN", "BLUE", "YELLOW", "ROBOFLOW" など。
  * 16進形式: "#RRGGBB"（例: 赤の場合は "#FF0000"）
  * RGB形式: "rgb(R, G, B)"（例: 赤の場合は "rgb(255, 0, 0)"）
  * BGR形式: "bgr(B, G, R)"（例: 赤の場合は "bgr(0, 0, 255)"）
* **background\_color**: テキストの背後の背景色。次と同じ色形式をサポートします `text_color`. 背景をなしにするには "transparent" を使用します。
* **background\_opacity**: 背景の透明度（0.0 = 完全に透明、1.0 = 完全に不透明）
* **font\_scale**: フォントサイズの倍率
* **font\_thickness**: テキストの線の太さ
* **パディング**: ピクセル単位のテキスト周囲の余白
* **text\_align**: テキストの水平方向の配置（"left", "center", "right"）
* **border\_radius**: 背景の角丸の半径

### 位置指定オプション

このブロックは絶対位置指定と相対位置指定の両方をサポートします:

**絶対位置指定** (`position_mode = "absolute"`):

* `position_x`: 左端からのピクセル単位のX座標
* `position_y`: 上端からのピクセル単位のY座標

**相対位置指定** (`position_mode = "relative"`):

* `anchor`: テキストの基準点（"center", "top\_left", "top\_center", "top\_right", "bottom\_left", "bottom\_center", "bottom\_right", "center\_left", "center\_right"）
* `offset_x`: 基準点からの水平方向オフセット（正の値 = 右）
* `offset_y`: 基準点からの垂直方向オフセット（正の値 = 下）

### タイプ識別子

ステップで次の識別子を使用してください `"type"` フィールド: `roboflow_core/text_display@v1` を、ワークフローにステップとして追加します。

### プロパティ

| **名前**                       | **型**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | **説明**                                                                                                                             | 参照 |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -- |
| `name`                       | `str`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | このステップの一意の識別子を入力してください。                                                                                                            | ❌  |
| `text`                       | `str`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | 表示するテキスト内容。次を使用したパラメータ補間をサポートします `{{ $parameters.name }}` 構文..                                                                     | ❌  |
| `text_parameters`            | `Dict[str, Union[bool, float, int, str]]`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | テキストに補間するパラメータ..                                                                                                                   | ✅  |
| `text_parameters_operations` | `Dict[str, List[Union[ClassificationPropertyExtract, ConvertDictionaryToJSON, ConvertImageToBase64, ConvertImageToJPEG, DetectionsFilter, DetectionsOffset, DetectionsPropertyExtract, DetectionsRename, DetectionsSelection, DetectionsShift, DetectionsToDictionary, Divide, ExtractDetectionProperty, ExtractFrameMetadata, ExtractImageProperty, LookupTable, Multiply, NumberRound, NumericSequenceAggregate, PickDetectionsByParentClass, RandomNumber, SequenceAggregate, SequenceApply, SequenceElementsCount, SequenceJoin, SequenceLength, SequenceMap, SortDetections, StringMatches, StringSubSequence, StringToLowerCase, StringToUpperCase, TimestampToISOFormat, ToBoolean, ToNumber, ToString]]]` | 補間前にテキストパラメータに適用する操作..                                                                                                             | ❌  |
| `text_color`                 | `str`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | テキストの色。Supervision の色名（WHITE, BLACK, RED, GREEN, BLUE, YELLOW, ROBOFLOW など）、16進形式（#RRGGBB）、rgb(R,G,B)形式、または bgr(B,G,R)形式をサポートします.. | ✅  |
| `background_color`           | `str`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | テキストの背後の背景色。text\_color と同じ色形式をサポートします。背景をなしにするには 'transparent' を使用します..                                                           | ✅  |
| `background_opacity`         | `float`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | 背景の透明度（0.0 = 完全に透明、1.0 = 完全に不透明）..                                                                                                 | ✅  |
| `font_scale`                 | `float`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | フォントサイズの倍率..                                                                                                                       | ✅  |
| `font_thickness`             | `int`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | テキストの線の太さ..                                                                                                                        | ✅  |
| `パディング`                      | `int`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | ピクセル単位のテキスト周囲の余白..                                                                                                                 | ✅  |
| `text_align`                 | `str`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | テキストのバウンディングボックス内での水平方向の配置..                                                                                                       | ✅  |
| `border_radius`              | `int`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | 背景の角丸長方形の半径..                                                                                                                      | ✅  |
| `position_mode`              | `str`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | 位置指定モード: 'absolute' は正確なピクセル座標を使用し、'relative' はオフセット付きの基準点を使用します..                                                                 | ✅  |
| `position_x`                 | `int`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | 絶対位置指定を使用する場合のX座標（左端からのピクセル）..                                                                                                     | ✅  |
| `position_y`                 | `int`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | 絶対位置指定を使用する場合のY座標（上端からのピクセル）..                                                                                                     | ✅  |
| `anchor`                     | `str`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | 相対位置指定の基準点..                                                                                                                       | ✅  |
| `offset_x`                   | `int`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | 基準点からの水平方向オフセット（正の値 = 右）..                                                                                                         | ✅  |
| `offset_y`                   | `int`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | 基準点からの垂直方向オフセット（正の値 = 下）..                                                                                                         | ✅  |
| `copy_image`                 | `bool`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | 描画前に入力画像をコピーするかどうか（元画像を保持します）..                                                                                                    | ✅  |

この **参照** この列は、 `workflow` の実行時に利用可能な動的値でプロパティをパラメータ化できる可能性を示します。 *バインディング* の詳細を参照してください。

### 入力および出力バインディング

利用可能な接続は、そのバインディング種別に依存します。 `テキスト表示` バージョン `v1` に、どのバインディング種別があるか確認してください。

<details>

<summary>入力と出力のバインディング</summary>

* input
  * `image` ([*`image`*](https://docs.roboflow.com/workflows/ja/gaido/developer-guide/kinds/image.md)テキストを表示する画像..
  * `text_parameters` ([*`*`*](https://docs.roboflow.com/workflows/ja/gaido/developer-guide/kinds/wildcard.md)テキストに補間するパラメータ..
  * `text_color` ([*`string`*](https://docs.roboflow.com/workflows/ja/gaido/developer-guide/kinds/string.md)テキストの色。Supervision の色名（WHITE, BLACK, RED, GREEN, BLUE, YELLOW, ROBOFLOW など）、16進形式（#RRGGBB）、rgb(R,G,B)形式、または bgr(B,G,R)形式をサポートします..
  * `background_color` ([*`string`*](https://docs.roboflow.com/workflows/ja/gaido/developer-guide/kinds/string.md)テキストの背後の背景色。text\_color と同じ色形式をサポートします。背景をなしにするには 'transparent' を使用します..
  * `background_opacity` ([*`0から1の浮動小数`*](https://docs.roboflow.com/workflows/ja/gaido/developer-guide/kinds/float-zero-to-one.md)背景の透明度（0.0 = 完全に透明、1.0 = 完全に不透明）..
  * `font_scale` ([*`float`*](https://docs.roboflow.com/workflows/ja/gaido/developer-guide/kinds/float.md)フォントサイズの倍率..
  * `font_thickness` ([*`integer`*](https://docs.roboflow.com/workflows/ja/gaido/developer-guide/kinds/integer.md)テキストの線の太さ..
  * `パディング` ([*`integer`*](https://docs.roboflow.com/workflows/ja/gaido/developer-guide/kinds/integer.md)ピクセル単位のテキスト周囲の余白..
  * `text_align` ([*`string`*](https://docs.roboflow.com/workflows/ja/gaido/developer-guide/kinds/string.md)テキストのバウンディングボックス内での水平方向の配置..
  * `border_radius` ([*`integer`*](https://docs.roboflow.com/workflows/ja/gaido/developer-guide/kinds/integer.md)背景の角丸長方形の半径..
  * `position_mode` ([*`string`*](https://docs.roboflow.com/workflows/ja/gaido/developer-guide/kinds/string.md)位置指定モード: 'absolute' は正確なピクセル座標を使用し、'relative' はオフセット付きの基準点を使用します..
  * `position_x` ([*`integer`*](https://docs.roboflow.com/workflows/ja/gaido/developer-guide/kinds/integer.md)絶対位置指定を使用する場合のX座標（左端からのピクセル）..
  * `position_y` ([*`integer`*](https://docs.roboflow.com/workflows/ja/gaido/developer-guide/kinds/integer.md)絶対位置指定を使用する場合のY座標（上端からのピクセル）..
  * `anchor` ([*`string`*](https://docs.roboflow.com/workflows/ja/gaido/developer-guide/kinds/string.md)相対位置指定の基準点..
  * `offset_x` ([*`integer`*](https://docs.roboflow.com/workflows/ja/gaido/developer-guide/kinds/integer.md)基準点からの水平方向オフセット（正の値 = 右）..
  * `offset_y` ([*`integer`*](https://docs.roboflow.com/workflows/ja/gaido/developer-guide/kinds/integer.md)基準点からの垂直方向オフセット（正の値 = 下）..
  * `copy_image` ([*`boolean`*](https://docs.roboflow.com/workflows/ja/gaido/developer-guide/kinds/boolean.md)描画前に入力画像をコピーするかどうか（元画像を保持します）..
* output
  * `image` ([`image`](https://docs.roboflow.com/workflows/ja/gaido/developer-guide/kinds/image.md)）：ワークフロー内の画像。

</details>

<details>

<summary>JSON定義の例</summary>

```json
{
	    "name": "<your_step_name_here>",
	    "type": "roboflow_core/text_display@v1",
	    "image": "$inputs.image",
	    "text": "検出数: {{ $parameters.count }}",
	    "text_parameters": {
	        "class_name": "$inputs.target_class",
	        "count": "$steps.model.predictions"
	    },
	    "text_parameters_operations": {
	        "count": [
	            {
	                "type": "SequenceLength"
	            }
	        ]
	    },
	    "text_color": "WHITE",
	    "background_color": "BLACK",
	    "background_opacity": 1.0,
	    "font_scale": 1.0,
	    "font_thickness": 1,
	    "padding": 5,
	    "text_align": "left",
	    "border_radius": 0,
	    "position_mode": "absolute",
	    "position_x": 10,
	    "position_y": 10,
	    "anchor": "center",
	    "offset_x": 0,
	    "offset_y": 0,
	    "copy_image": true
	}
```

</details>
