> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# TrainingImage オブジェクト (ITrainingImage インターフェイス)

> ABBYY FineReader Engine API の TrainingImage オブジェクト (ITrainingImage インターフェイス) — ユーザーパターン学習用の文字画像を含む単一の学習用画像を表します。SetImageData または SetBitmapBits (Windows) を使用して設定できます。

このオブジェクトは、単一の学習用画像を表します。ユーザーパターン学習時に使用できる文字画像が含まれます。

学習用画像は、SetImageData メソッドを使用して画像ドキュメント内の領域を学習用画像として読み込むことで設定できます。Windows では、SetBitmapBits メソッドを使用してメモリから画像を読み込んで設定することもできます。

<Warning>
  SmallCharsHeight プロパティと BaseLine プロパティには正しい値を設定してください。正しい値が設定されていないと、学習済みパターンは正常に機能しません。
</Warning>

ほとんどの文字では、下端 (p、g、Q などのようにディセンダを持つ文字を除く) がベースラインになります。

SmallCharsHeight プロパティは、パターンを大文字やアセンダ／ディセンダ／ダイアクリティカルマークを持つ文字 (A、b、y、é など) に対して学習させる場合でも、その行にあるアセンダやディセンダを持たない小文字 (c、a、o など) の高さと同じである必要があります。

BaseLine プロパティは、外接矩形の上端からベースラインまでの距離と同じである必要があります。したがって、アセンダやダイアクリティカルマークを持たない小文字 (m、e、u など) では、SmallCharsHeight = BaseLine になります。ディセンダを持たない文字では、BaseLine は文字の高さと同じです。

<Accordion title="図を表示">
  この図では、文字 o の SmallCharsHeight と BaseLine は、どちらも文字の高さと同じ値に設定します。文字 ý の場合、SmallCharsHeight は o と同じで、BaseLine は図のとおり、文字の矩形の上端からベースラインまでの距離になります。

  <img src="https://mintcdn.com/abbyy/i-EfCQVmseNiPQcp/images/fine-reader/engine/smallcharsheight_and_baseline.png?fit=max&auto=format&n=i-EfCQVmseNiPQcp&q=85&s=b0dfc61d0b64d6761418b8292b13fdf6" alt="SmallCharsHeight_and_BaseLine" width="478" height="307" data-path="images/fine-reader/engine/smallcharsheight_and_baseline.png" />
</Accordion>

<div id="properties">
  ## プロパティ
</div>

| Name             | Type                                                                                                                                                                                                             | Description                                                                                                               |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| Application      | [Engine](/ja/fine-reader/engine/api-reference/engine-object-iengine-interface), [読み取り専用](/ja/fine-reader/engine/guided-tour/advanced-techniques/programming-aspects/working-with-properties#readonly_properties) | [Engine](/ja/fine-reader/engine/api-reference/engine-object-iengine-interface) オブジェクトを返します。                               |
| BaseLine         | [int](/ja/fine-reader/engine/guided-tour/advanced-techniques/programming-aspects/working-with-properties)                                                                                                        | 文字の切り抜き画像のベースラインから上端までの距離を、ピクセル単位で保持します。ベースラインは、文字が配置される線です。画像の上端は、文字の向きによって決まります。既定では、このプロパティの値は 0 ですが、正しい値を指定する必要があります。 |
| SmallCharsHeight | [int](/ja/fine-reader/engine/guided-tour/advanced-techniques/programming-aspects/working-with-properties)                                                                                                        | 原画像上の小さい文字の高さを、ピクセル単位で指定します。既定では、このプロパティの値は 0 ですが、正しい値を指定する必要があります。                                                       |

<div id="methods">
  ## メソッド
</div>

| 名前                                                                                                             | 説明                                                                                                                                                 |
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| [SetBitmapBits](/ja/fine-reader/engine/api-reference/image-related-objects/trainingimage/setbitmapbits-method) | メモリ内のバッファから学習用画像データを設定します。画像は等方性である必要があります (つまり、水平解像度と垂直解像度が同じである必要があります) 。また、1 ピクセルあたり 1 ビットでエンコードされた白黒画像である必要があります。 <Note> *Windows のみ。* </Note> |
| [SetImageData](/ja/fine-reader/engine/api-reference/image-related-objects/trainingimage/setimagedata-method)   | 画像ドキュメント内の領域から学習用画像データを設定します。                                                                                                                      |

<div id="related-objects">
  ## 関連オブジェクト
</div>

<img src="https://mintcdn.com/abbyy/i-EfCQVmseNiPQcp/images/fine-reader/engine/trainingimage.gif?s=5bbdf09ebfa745651f795b42b0c196d5" alt="TrainingImage" width="152" height="60" data-path="images/fine-reader/engine/trainingimage.gif" />[](/ja/fine-reader/engine/visual-components-reference/supplementary-objects/spellwordcollection/element-property)[](/ja/fine-reader/engine/api-reference/image-related-objects/trainingimagescollection)

[オブジェクト図](/ja/fine-reader/engine/api-reference/object-diagram)

<div id="output-parameter">
  ## 出力パラメーター
</div>

このオブジェクトは、次のメソッドの出力パラメーターです。

* [Engine](/ja/fine-reader/engine/api-reference/engine-object-iengine-interface) オブジェクトの [CreateTrainingImage](/ja/fine-reader/engine/api-reference/engine-object-iengine-interface/creation-methods/createlessobjectgreater-methods) メソッド
* [TrainingImagesCollection](/ja/fine-reader/engine/api-reference/image-related-objects/trainingimagescollection) オブジェクトの [Item](/ja/fine-reader/engine/visual-components-reference/supplementary-objects/spellwordcollection/item-method) メソッド

<div id="input-parameter">
  ## 入力パラメーター
</div>

このオブジェクトは、[TrainingImagesCollection](/ja/fine-reader/engine/api-reference/image-related-objects/trainingimagescollection) オブジェクトの [InsertAt](/ja/fine-reader/engine/visual-components-reference/supplementary-objects/spellwordcollection/insertat-method) メソッドおよび [Add](/ja/fine-reader/engine/visual-components-reference/supplementary-objects/spellwordcollection/add-method) メソッドに、入力パラメーターとして渡されます。

<div id="see-also">
  ## 関連項目
</div>

[TrainingImagesCollection](/ja/fine-reader/engine/api-reference/image-related-objects/trainingimagescollection)

[トレーニングを使用した認識](/ja/fine-reader/engine/guided-tour/advanced-techniques/using-gui-elements/recognizing-with-training) (Win)

[ユーザーパターンのトレーニング](/ja/fine-reader/engine/guided-tour/advanced-techniques/using-gui-elements/training-user-patterns) (Win)

[プロパティの操作](/ja/fine-reader/engine/guided-tour/advanced-techniques/programming-aspects/working-with-properties)
