Difference of Median filter

Namespace: fvalgcli
Assembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)

Syntax

C#
public static int fnFIE_DoM_2Dfilter(
	FHANDLE hsrc,
	FHANDLE hdst,
	int size_m0,
	int size_n0,
	int size_m1,
	int size_n1,
	f_border_mode border_mode,
	double value
)
Visual Basic
Public Shared Function fnFIE_DoM_2Dfilter ( 
	hsrc As FHANDLE,
	hdst As FHANDLE,
	size_m0 As Integer,
	size_n0 As Integer,
	size_m1 As Integer,
	size_n1 As Integer,
	border_mode As f_border_mode,
	value As Double
) As Integer

Parameters

hsrc
Type: fvalgcli..::..FHANDLE
入力画像 ( type: uc8, s16, us16, double )
hdst
Type: fvalgcli..::..FHANDLE
出力画像 ( type: uc8, s16, us16, double )
size_m0
Type: System..::..Int32
フィルタ幅( 水平方向 1以上で253,画像幅以下の奇数 )
size_n0
Type: System..::..Int32
フィルタ高さ ( 垂直方向 1以上で253,画像幅以下の奇数 )
size_m1
Type: System..::..Int32
フィルタ幅( 水平方向 1以上で253,画像幅以下の奇数 )
size_n1
Type: System..::..Int32
フィルタ高さ ( 垂直方向 1以上で253,画像幅以下の奇数 )
border_mode
Type: fvalgcli..::..f_border_mode
ボーダー処理モード
value
Type: System..::..Double
ボーダー濃度値

Return Value

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

エラーコード:
f_err内容
F_ERR_NONE正常終了
F_ERR_NOMEMORYメモリ不足
F_ERR_INVALID_IMAGE不正な画像オブジェクト
F_ERR_INVALID_PARAMパラメータ異常
F_ERR_NO_LICENCEライセンスエラー、または未初期化エラー

Examples

C# Copy imageCopy
using System;
using System.Collections.Generic;
using System.Text;
using fvalgcli;

namespace TC
{
    public partial class FIE
    {
        [FvPluginExecute]
        public void fnFIE_DoM_2Dfilter()
        {
            int status = (int)f_err.F_ERR_NONE;

            FHANDLE hsrc = FHANDLE.Zero;
            FHANDLE hdst = FHANDLE.Zero;

            try
            {
                // 入力画像: (ファイル読み込み)
                api.fnFIE_load_img_file(TestImageDir + "/testdata/gray_04.bmp", 
                    ref hsrc, f_color_img_type.F_COLOR_IMG_TYPE_UC8);

                // 入力画像の情報取得.
                int width = api.fnFIE_img_get_width(hsrc);
                int height = api.fnFIE_img_get_height(hsrc);
                int channels = api.fnFIE_img_get_channels(hsrc);
                int type = api.fnFIE_img_get_type(hsrc);

                // 出力画像の生成.
                hdst = api.fnFIE_img_root_alloc(type, channels, width, height);

                // 処理の実行.
                status = api.fnFIE_DoM_2Dfilter(hsrc, hdst, 11, 11, 25, 25, f_border_mode.F_BORDER_CONTINUOUS, 0);
                if (status != 0)
                    throw new FvException(status);

                // 出力画像の保存.
                api.fnFIE_save_png(ResultDir + "/fnFIE_DoM_2Dfilter.png", hdst, -1);
            }
            finally
            {
                hsrc.Dispose();
                hdst.Dispose();
            }
        }
    }
}


Visual Basic Copy imageCopy
Imports System.Collections.Generic
Imports System.Text
Imports fvalgcli

Public Partial Class FIE
    <FvPluginExecute> _
    Public Sub fnFIE_DoM_2Dfilter()
        Dim status As Integer = CInt(f_err.F_ERR_NONE)

        Dim hsrc As FHANDLE = FHANDLE.Zero
        Dim hdst As FHANDLE = FHANDLE.Zero

        Try
            ' 入力画像: (ファイル読み込み)
            api.fnFIE_load_img_file(TestImageDir & "/testdata/gray_04.bmp", _
                                    hsrc, f_color_img_type.F_COLOR_IMG_TYPE_UC8)

            ' 入力画像の情報取得.
            Dim width As Integer = api.fnFIE_img_get_width(hsrc)
            Dim height As Integer = api.fnFIE_img_get_height(hsrc)
            Dim channels As Integer = api.fnFIE_img_get_channels(hsrc)
            Dim type As Integer = api.fnFIE_img_get_type(hsrc)

            ' 出力画像の生成.
            hdst = api.fnFIE_img_root_alloc(type, channels, width, height)

            ' 処理の実行.
            status = api.fnFIE_DoM_2Dfilter(hsrc, hdst, 11, 11, 25, 25, f_border_mode.F_BORDER_CONTINUOUS, 0)
            If status <> 0 Then
                Throw New FvException(status)
            End If

            ' 出力画像の保存.
            api.fnFIE_save_png(ResultDir & "/fnFIE_DoM_2Dfilter.png", hdst, -1)
        Finally
            hsrc.Dispose()
            hdst.Dispose()
        End Try
    End Sub
End Class

See Also