2値画像ノイズ除去フィルタ
Namespace: fvalgcliAssembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)
Syntax
C# |
---|
public static int fnFIE_bfilter(
FHANDLE hsrc,
FHANDLE hdst,
int color,
int xdot,
int ydot,
f_direction direct
) |
Visual Basic |
---|
Public Shared Function fnFIE_bfilter (
hsrc As FHANDLE,
hdst As FHANDLE,
color As Integer,
xdot As Integer,
ydot As Integer,
direct As f_direction
) As Integer |
Parameters
- hsrc
- Type: fvalgcli..::..FHANDLE
入力画像( type : bin / ch : 1 )
- hdst
- Type: fvalgcli..::..FHANDLE
出力画像( type : bin / ch : 1 )
- color
- Type: System..::..Int32
対象色
- xdot
- Type: System..::..Int32
水平除去画素数(1以上)
- ydot
- Type: System..::..Int32
垂直除去画素数(1以上)
- direct
- Type: fvalgcli..::..f_direction
方向
- F_DIRECT_VERT_HORIZ :(垂直→水平)
- F_DIRECT_HORIZ_VERT :(水平→垂直)
- F_DIRECT_VERT :(垂直)
- F_DIRECT_HORIZ :(水平)
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_bfilter()
{
int status = (int)f_err.F_ERR_NONE;
FHANDLE hsrc1 = FHANDLE.Zero;
FHANDLE hdst = FHANDLE.Zero;
try
{
api.fnFIE_load_img_file(TestImageDir + "/testdata/bin_from_gray_01.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_bfilter(hsrc1, hdst, 2, 1, 1, 0);
Assert.IsTrue(status == (int)f_err.F_ERR_NONE, "エラーが発生しました。({0})", (f_err)status);
api.fnFIE_save_png(ResultDir + "/fnFIE_bfilter.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_bfilter()
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/bin_from_gray_01.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_bfilter(hsrc1, hdst, 2, 1, 1, 0)
Assert.IsTrue(status = CInt(f_err.F_ERR_NONE), "エラーが発生しました。({0})", CType(status, f_err))
api.fnFIE_save_png(ResultDir & "/fnFIE_bfilter.png", hdst, -1)
Finally
hsrc1.Dispose()
hdst.Dispose()
End Try
End Sub
End Class |
See Also