パターン画像を取得する

Namespace: fvalgcli
Assembly: fvalgcli_fga (in fvalgcli_fga.dll) Version: 3.1.0.0 (3.1.0.3)

Syntax

C#
public static int fnFGA_gs2_pattern_get_image(
	FHANDLE hpattern,
	ref FHANDLE himage
)
Visual Basic
Public Shared Function fnFGA_gs2_pattern_get_image ( 
	hpattern As FHANDLE,
	ByRef himage As FHANDLE
) As Integer

Parameters

hpattern
Type: fvalgcli..::..FHANDLE
グレイサーチパターンオブジェクト
himage
Type: fvalgcli..::..FHANDLE%
パタン画像 ( type: uc8 ) 。himage はNULLで初期化してから引数に渡してください。

Return Value

Type: Int32
以下のエラーコードを返します。

エラーコード:
f_err内容
F_ERR_NONE正常終了
F_ERR_INVALID_PARAM引数異常
F_ERR_INVALID_OBJECTパタンでないオブジェクトが渡された
F_ERR_NO_LICENCEライセンスエラー、または未初期化エラー

Remarks

Examples

C# Copy imageCopy
//    $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_get_image(FHANDLE hPattern)
        {
            Console.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name);

            FHANDLE hfga_img = IntPtr.Zero;
            FHANDLE hfie_img = IntPtr.Zero;

            try
            {
                int status = fga.fnFGA_gs2_pattern_get_image(hPattern, 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_get_image.bmp", hfie_img);
            }
            finally
            {
                hfga_img.Dispose();
                hfie_img.Dispose();
            }
        }
    }
}

Exceptions

ExceptionCondition
System.IO..::..FileNotFoundException 実行環境に NVIDIA CUDA Runtime が存在しない場合、FGA ライブラリのロードが失敗し、この例外が発行されます。
必要な環境については FGA ライブラリ説明書 をご参照ください。
例外メッセージの例 (32bit 日本語 O/S の場合):
DLL 'fgamt.x86.3.0.0.dll' を読み込めません: 指定されたモジュールが見つかりません。 (HRESULT からの例外: 0x8007007E)

See Also