ガンマ変換用ルックアップテーブルの作成
Namespace: FVIL.EnhanceAssembly: FVILbasic (in FVILbasic.dll) Version: 3.1.0.0 (3.1.0.17)
Syntax
C# |
---|
public virtual void CreateGamma( ImageType in_type, ImageType out_type, double gamma ) |
Visual Basic |
---|
Public Overridable Sub CreateGamma ( in_type As ImageType, out_type As ImageType, gamma As Double ) |
Parameters
- in_type
- Type: FVIL..::..ImageType
入力画像種別
- out_type
- Type: FVIL..::..ImageType
出力画像種別
- gamma
- Type: System..::..Double
ガンマ値 (0より大きい値)
Remarks
ユーザが任意に設定したガンマ値でルックアップテーブルを生成し、 このクラスが保有するルックアップテーブルを更新します。
確保されるテーブルの要素数は、入力画像種別(in_type)に依存します。
テーブルの内容は、下式の通り、ガンマ変換をした後に出力画像型の最大値でスケーリングし、四捨五入しています。
入力画像種別(in_type) | 要素数 | 変換式 |
---|---|---|
UC8 | 256 | table[index] = (index / 255)1/γ * (out_type の最大値) |
US16 | 65536 | table[index] = (index / 65535)1/γ * (out_type の最大値) |
S16 | 65536 |
|
処理に失敗した場合は例外を発行します。 例外の原因と発生位置を特定するには、発行された例外クラスの ErrorCode メンバと Function メンバを参照してください。
エラーコード:
値 | ErrorCode メンバ | 内容 |
---|---|---|
51 | FVIL.ErrorCode.LICENSE_ERROR | ライセンスキーが見つからない為、実行できません。 または、FVIL._SetUp.InitVisionLibrary が実行されていません。 |
1 | FVIL.ErrorCode.FAILED_TO_ALLOCATE | 領域の確保に失敗しました。 |
11 | FVIL.ErrorCode.INVALID_PARAMETER | 引数に指定された値が不正です。 |
関連する FIE 関数:
fnFIE_lut_set_gamma
Exceptions
Exception | Condition |
---|---|
FVIL..::..CFviException | この例外の原因については、上記のエラーコード表をご参照ください。 |