構造要素取得
Namespace: fvalgcliAssembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)
Syntax
C# |
---|
public static int fnFIE_morphology_get_mask(
FHANDLE hse,
UCHAR_PTR mask,
int step_x
) |
Visual Basic |
---|
Public Shared Function fnFIE_morphology_get_mask (
hse As FHANDLE,
mask As UCHAR_PTR,
step_x As Integer
) As Integer |
Return Value
Type:
Int32
以下のエラーコードを返します。
エラーコード:f_err | 内容 |
---|
F_ERR_NONE | 正常終了 |
F_ERR_INVALID_OBJECT | 不正なハンドルが渡されたため異常終了 |
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_morphology_get_mask()
{
int status = (int)f_err.F_ERR_NONE;
FHANDLE hse = FHANDLE.Zero;
UCHAR_PTR ptrn = UCHAR_PTR.Zero;
UCHAR_PTR mask = UCHAR_PTR.Zero;
try
{
ptrn = UCHAR_PTR.alloc(9);
for (int i = 0; i < 9; i++)
{
if (i == 4)
ptrn[i] = 1;
else
ptrn[i] = 0;
}
hse = api.fnFIE_morphology_se_alloc(ptrn, 3, 3, 3, 1, 1);
int size_x = 0;
int size_y = 0;
int anchor_x = 0;
int anchor_y = 0;
api.fnFIE_morphology_get_params(hse, ref size_x, ref size_y, ref anchor_x, ref anchor_y);
mask = UCHAR_PTR.alloc(size_x * size_y);
status = api.fnFIE_morphology_get_mask(hse, mask, 3);
Assert.IsTrue(status == (int)f_err.F_ERR_NONE, "エラーが発生しました。({0})", (f_err)status);
}
finally
{
hse.Dispose();
ptrn.Dispose();
mask.Dispose();
}
}
}
} |
Visual Basic | Copy |
---|
Imports System.Collections.Generic
Imports System.Text
Imports fvalgcli
Public Partial Class FIE
<FvPluginExecute> _
Public Sub fnFIE_morphology_get_mask()
Dim status As Integer = CInt(f_err.F_ERR_NONE)
Dim hse As FHANDLE = FHANDLE.Zero
Dim ptrn As UCHAR_PTR = UCHAR_PTR.Zero
Dim mask As UCHAR_PTR = UCHAR_PTR.Zero
Try
ptrn = UCHAR_PTR.alloc(9)
For i As Integer = 0 To 8
If i = 4 Then
ptrn(i) = 1
Else
ptrn(i) = 0
End If
Next
hse = api.fnFIE_morphology_se_alloc(ptrn, 3, 3, 3, 1, 1)
Dim size_x As Integer = 0
Dim size_y As Integer = 0
Dim anchor_x As Integer = 0
Dim anchor_y As Integer = 0
api.fnFIE_morphology_get_params(hse, size_x, size_y, anchor_x, anchor_y)
mask = UCHAR_PTR.alloc(size_x * size_y)
status = api.fnFIE_morphology_get_mask(hse, mask, 3)
Assert.IsTrue(status = CInt(f_err.F_ERR_NONE), "エラーが発生しました。({0})", CType(status, f_err))
Finally
hse.Dispose()
ptrn.Dispose()
mask.Dispose()
End Try
End Sub
End Class |
See Also