Difference of Average filter
Namespace: fvalgcliAssembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)
Syntax
C# |
---|
public static int fnFIE_DoA_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_DoA_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, rgbq )
- hdst
- Type: fvalgcli..::..FHANDLE
出力画像 ( type: uc8, s16, us16, double, rgbq )
- size_m0
- Type: System..::..Int32
フィルタ幅( 水平方向 1以上画像幅以下の奇数 )
- size_n0
- Type: System..::..Int32
フィルタ高さ ( 垂直方向 1以上画像幅以下の奇数 )
- size_m1
- Type: System..::..Int32
フィルタ幅( 水平方向 1以上画像幅以下の奇数 )
- size_n1
- Type: System..::..Int32
フィルタ高さ ( 垂直方向 1以上画像幅以下の奇数 )
- 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 |
---|
using System;
using System.Collections.Generic;
using System.Text;
using fvalgcli;
namespace TC
{
public partial class FIE
{
[FvPluginExecute]
public void fnFIE_DoA_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_DoA_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_DoA_2Dfilter.png", hdst, -1);
}
finally
{
hsrc.Dispose();
hdst.Dispose();
}
}
}
} |
Visual Basic | Copy |
---|
Imports System.Collections.Generic
Imports System.Text
Imports fvalgcli
Public Partial Class FIE
<FvPluginExecute> _
Public Sub fnFIE_DoA_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_DoA_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_DoA_2Dfilter.png", hdst, -1)
Finally
hsrc.Dispose()
hdst.Dispose()
End Try
End Sub
End Class |
See Also