領域の境界点列を利用したエッジ検出
Namespace: fvalgcliAssembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)
Syntax
C# |
---|
public static int fnFIE_edge_binary_boundary(
FHANDLE hsrc,
int smooth_size,
DPNT_T offset,
ref F_DEDGE_PTR edges,
ref int edge_num
) |
Visual Basic |
---|
Public Shared Function fnFIE_edge_binary_boundary (
hsrc As FHANDLE,
smooth_size As Integer,
offset As DPNT_T,
ByRef edges As F_DEDGE_PTR,
ByRef edge_num As Integer
) As Integer |
Return Value
Type:
Int32
以下のエラーコードを返します。
エラーコード:f_err | 内容 |
---|
F_ERR_NONE | 正常終了 |
F_ERR_NOMEMORY | メモリ不足 |
F_ERR_INVALID_IMAGE | 不正な画像が渡された |
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 System.Runtime.InteropServices;
using fvalgcli;
namespace TC
{
public partial class FIE
{
[FvPluginExecute]
public void fnFIE_edge_binary_boundary()
{
string filepath = TestImageDir + "/testdata/bin_ellipse30.bmp";
int status = (int)f_err.F_ERR_NONE;
var hsrc = FHANDLE.Zero;
var edges = F_DEDGE_PTR.Zero;
int edge_num = 0;
try
{
api.fnFIE_load_img_file(filepath, ref hsrc, f_color_img_type.F_COLOR_IMG_TYPE_UC8);
int smooth_size = 7;
var offset = DPNT_T.init(0, 0);
status = api.fnFIE_edge_binary_boundary(hsrc, smooth_size, offset, ref edges, ref edge_num);
Assert.IsTrue(status == (int)f_err.F_ERR_NONE, "fnFIE_edge_binary_boundary: エラーが発生しました。({0})", (f_err)status);
Console.WriteLine("fnFIE_edge_binary_boundary");
Console.WriteLine("edge_num = {0}", edge_num);
for (int i = 0; i < edge_num; i++)
{
if ((0 <= i && i < 5) || (edge_num - 5 <= i && i < edge_num))
Console.WriteLine("edges[{0}]={1},{2}", i, edges[i].x, edges[i].y);
}
}
finally
{
hsrc.Dispose();
edges.Dispose();
}
}
}
} |
Visual Basic | Copy |
---|
Imports System.Collections.Generic
Imports System.Text
Imports System.Runtime.InteropServices
Imports fvalgcli
Public Partial Class FIE
<FvPluginExecute> _
Public Sub fnFIE_edge_binary_boundary()
Dim filepath As String = TestImageDir & "/testdata/bin_ellipse30.bmp"
Dim status As Integer = CInt(f_err.F_ERR_NONE)
Dim hsrc As FHANDLE = FHANDLE.Zero
Dim edges As F_DEDGE_PTR = F_DEDGE_PTR.Zero
Dim edge_num As Integer = 0
Try
api.fnFIE_load_img_file(filepath, hsrc, f_color_img_type.F_COLOR_IMG_TYPE_UC8)
Dim smooth_size As Integer = 7
Dim offset As DPNT_T = DPNT_T.init(0, 0)
status = api.fnFIE_edge_binary_boundary(hsrc, smooth_size, offset, edges, edge_num)
Assert.IsTrue(status = CInt(f_err.F_ERR_NONE), "fnFIE_edge_binary_boundary: エラーが発生しました。({0})", CType(status, f_err))
Console.WriteLine("fnFIE_edge_binary_boundary")
Console.WriteLine("edge_num = {0}", edge_num)
For i As Integer = 0 To edge_num - 1
If (0 <= i AndAlso i < 5) OrElse (edge_num - 5 <= i AndAlso i < edge_num) Then
Console.WriteLine("edges[{0}]={1},{2}", i, edges(i).x, edges(i).y)
End If
Next
Finally
hsrc.Dispose()
edges.Dispose()
End Try
End Sub
End Class |
See Also