回転パターンの生成
Namespace: fvalgcliAssembly: fvalgcli_fga (in fvalgcli_fga.dll) Version: 3.1.0.0 (3.1.0.3)
Syntax
C# |
---|
public static int fnFGA_gs2_pattern_rotate( FHANDLE hpattern, int rot_angle, int clip_width, int clip_height, int rotate_method, ref FHANDLE rotate_pattern ) |
Visual Basic |
---|
Public Shared Function fnFGA_gs2_pattern_rotate ( hpattern As FHANDLE, rot_angle As Integer, clip_width As Integer, clip_height As Integer, rotate_method As Integer, ByRef rotate_pattern As FHANDLE ) As Integer |
Parameters
- hpattern
- Type: fvalgcli..::..FHANDLE
参考にするパターン
- rot_angle
- Type: System..::..Int32
回転角 degreeの10倍値
- clip_width
- Type: System..::..Int32
回転パターン幅の上限
- clip_height
- Type: System..::..Int32
回転パターン高さの上限
- rotate_method
- Type: System..::..Int32
回転の方法- 0 または 1 NN法
- 2 bilinear法
- rotate_pattern
- Type: fvalgcli..::..FHANDLE%
新たに作成する回転済みパターンへのポインタ
Return Value
Type: Int32以下のエラーコードを返します。
エラーコード:
f_err | 内容 |
---|---|
F_ERR_NONE | 正常終了 |
F_ERR_NOMEMORY | メモリ不足 |
F_ERR_INVALID_PARAM | 引数異常 |
F_ERR_INVALID_OBJECT | 入力オブジェクト異常 |
F_ERR_INVALID_IMAGE | 入力したパターン内の画像が大きすぎる |
F_ERR_GS_NO_CONTRAST | パタン画像に情報が足りないため、パタンにならない。 (==画像の濃度分散が0.0になる) |
F_ERR_NO_LICENCE | ライセンスエラー、または未初期化エラー |
Remarks
Examples
C# | Copy |
---|---|
// $Revision: 1.2 $ using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; using fvalgcli; namespace TC { public partial class FIE { public void fnFGA_gs2_pattern_rotate(FHANDLE hPattern) { Console.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name); FHANDLE hfga_img = IntPtr.Zero; FHANDLE hfie_img = IntPtr.Zero; try { // 回転パターンの生成. int rot_angle = 10; int clip_width = 100; int clip_height = 100; int rotate_method = 1; int status = fga.fnFGA_gs2_pattern_rotate(hPattern, rot_angle, clip_width, clip_height, rotate_method, ref hfga_img); if (status != (int)f_err.F_ERR_NONE) throw new FvException(status, "エラーが発生しました。"); // 入力画像の情報取得. int width = fga.fnFGA_img_get_width(hfga_img); int height = fga.fnFGA_img_get_height(hfga_img); int channels = fga.fnFGA_img_get_channels(hfga_img); int type = fga.fnFGA_img_get_type(hfga_img); // 入出力画像の生成. hfie_img = api.fnFIE_img_root_alloc(type, channels, width, height); // FGA 画像オブジェクトから FIE 画像オブジェクトへコピー. fga.fnFGA_img_copy(hfga_img, hfie_img); api.fnFIE_save_bmp(Defs.ResultDir + "fnFGA_gs2_pattern_rotate.bmp", hfie_img); } finally { hfga_img.Dispose(); hfie_img.Dispose(); } } } } |
Exceptions
Exception | Condition |
---|---|
System.IO..::..FileNotFoundException |
実行環境に NVIDIA CUDA Runtime が存在しない場合、FGA ライブラリのロードが失敗し、この例外が発行されます。 必要な環境については FGA ライブラリ説明書 をご参照ください。 例外メッセージの例 (32bit 日本語 O/S の場合): DLL 'fgamt.x86.3.0.0.dll' を読み込めません: 指定されたモジュールが見つかりません。 (HRESULT からの例外: 0x8007007E) |