近似ガウシアン フィルタ
Namespace: fvalgcliAssembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)
Syntax
C# |
---|
public static int fnFIE_gaussian_approximation( FHANDLE hsrc, FHANDLE hdst, double sigma, int derivative_x, int derivative_y, f_border_mode border_mode, double border_value ) |
Visual Basic |
---|
Public Shared Function fnFIE_gaussian_approximation ( hsrc As FHANDLE, hdst As FHANDLE, sigma As Double, derivative_x As Integer, derivative_y As Integer, border_mode As f_border_mode, border_value As Double ) As Integer |
Parameters
- hsrc
- Type: fvalgcli..::..FHANDLE
入力画像 ( type: uc8, s16, us16, double )
- hdst
- Type: fvalgcli..::..FHANDLE
出力画像 ( type: uc8, s16, us16, double )
- sigma
- Type: System..::..Double
ガウシアン関数の標準偏差 (単位 : pixel, 1.0 ≦ sigma)
- derivative_x
- Type: System..::..Int32
X 方向処理時の微分次数 (0, 1, 2)
- derivative_y
- Type: System..::..Int32
Y 方向処理時の微分次数 (0, 1, 2)
- border_mode
- Type: fvalgcli..::..f_border_mode
ボーダー処理モード。- F_BORDER_NONE ボーダー拡張しない
- F_BORDER_ZERO 0埋めモード
- F_BORDER_VALUE 一定値モード
- F_BORDER_CONTINUOUS 端延長モード
- F_BORDER_REPEAT 繰り返しモード
- F_BORDER_MIRROR1 反転モード1
- F_BORDER_MIRROR2 反転モード2
- border_value
- Type: System..::..Double
ボーダー濃度値。border_mode が F_BORDER_VALUE の場合のみ使用されます。その他のモードの場合、この値は無視されます。
Return Value
Type: Int32以下のエラーコードを返します。
エラーコード:
f_err | 内容 |
---|---|
F_ERR_NONE | 正常終了 |
F_ERR_INVALID_IMAGE | 不正な画像オブジェクトが渡された |
F_ERR_INVALID_PARAM | パラメータ異常 |
F_ERR_NOMEMORY | メモリ不足エラー |
F_ERR_NO_LICENCE | ライセンスエラー |
Examples
C# | Copy |
---|---|
using System; using System.Collections.Generic; using System.Text; using fvalgcli; namespace TC { public partial class FIE { [FvPluginExecute] public void fnFIE_gaussian_approximation() { int status = (int)f_err.F_ERR_NONE; FHANDLE hsrc1 = FHANDLE.Zero; // 処理画像. FHANDLE hdst = FHANDLE.Zero; // 出力画像. try { // 入力画像ファイルのロード. api.fnFIE_load_img_file(TestImageDir + "/testdata/gray_04.bmp", ref hsrc1, f_color_img_type.F_COLOR_IMG_TYPE_UC8); // 入力画像の情報取得. int width = api.fnFIE_img_get_width(hsrc1); int height = api.fnFIE_img_get_height(hsrc1); int channels = api.fnFIE_img_get_channels(hsrc1); int type = api.fnFIE_img_get_type(hsrc1); // 出力画像の生成. hdst = api.fnFIE_img_root_alloc(type, channels, width, height); // 処理の実行. status = api.fnFIE_gaussian_approximation(hsrc1, hdst, 3, 0, 0, f_border_mode.F_BORDER_NONE, 0); // エラー判定. Assert.IsTrue(status == (int)f_err.F_ERR_NONE, "エラーが発生しました。({0})", (f_err)status); // 出力画像の保存. api.fnFIE_save_png(ResultDir + "/fnFIE_gaussian_approximation.png", hdst, -1); } finally { // オブジェクトの開放. hsrc1.Dispose(); hdst.Dispose(); } } } } |
Visual Basic | Copy |
---|---|
Imports System.Collections.Generic Imports System.Text Imports fvalgcli Public Partial Class FIE <FvPluginExecute> _ Public Sub fnFIE_gaussian_approximation() Dim status As Integer = CInt(f_err.F_ERR_NONE) Dim hsrc1 As FHANDLE = FHANDLE.Zero ' 処理画像. Dim hdst As FHANDLE = FHANDLE.Zero ' 出力画像. Try ' 入力画像ファイルのロード. api.fnFIE_load_img_file(TestImageDir & "/testdata/gray_04.bmp", hsrc1, f_color_img_type.F_COLOR_IMG_TYPE_UC8) ' 入力画像の情報取得. Dim width As Integer = api.fnFIE_img_get_width(hsrc1) Dim height As Integer = api.fnFIE_img_get_height(hsrc1) Dim channels As Integer = api.fnFIE_img_get_channels(hsrc1) Dim type As Integer = api.fnFIE_img_get_type(hsrc1) ' 出力画像の生成. hdst = api.fnFIE_img_root_alloc(type, channels, width, height) ' 処理の実行. status = api.fnFIE_gaussian_approximation(hsrc1, hdst, 3, 0, 0, f_border_mode.F_BORDER_NONE, _ 0) ' エラー判定. Assert.IsTrue(status = CInt(f_err.F_ERR_NONE), "エラーが発生しました。({0})", CType(status, f_err)) ' 出力画像の保存. api.fnFIE_save_png(ResultDir & "/fnFIE_gaussian_approximation.png", hdst, -1) Finally ' オブジェクトの開放. hsrc1.Dispose() hdst.Dispose() End Try End Sub End Class |