Huモーメント不変量の取得

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

Syntax

C#
public static int fnFIE_measure_get_hu_moments(
	FHANDLE hresult,
	uint blobno,
	DOUBLE_PTR h
)
Visual Basic
Public Shared Function fnFIE_measure_get_hu_moments ( 
	hresult As FHANDLE,
	blobno As UInteger,
	h As DOUBLE_PTR
) As Integer

Parameters

hresult
Type: fvalgcli..::..FHANDLE
ブローブ解析結果ハンドル
blobno
Type: System..::..UInt32
対象ブローブのブローブ番号
h
Type: fvalgcli..::..DOUBLE_PTR
Huモーメント不変量の出力先配列。要素数 7 の配列を予め確保してください。

Return Value

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

エラーコード:
f_err内容
F_ERR_NONE正常終了
F_ERR_INVALID_OBJECThresult に指定されたオブジェクトハンドルが不正
F_ERR_INVALID_PARAMblobno に指定されたブローブ番号が不正, パラメータに NULL pointer が渡された
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
    {
        public void fnFIE_measure_get_hu_moments(FHANDLE result, uint blobno)
        {
            var phu = DOUBLE_PTR.Zero;

            try
            {
                // Huモーメント不変量の出力先配列.
                phu = DOUBLE_PTR.alloc(7);
                Assert.IsTrue(phu != DOUBLE_PTR.Zero, "phu が異常です.");

                int status = api.fnFIE_measure_get_hu_moments(result, blobno, phu);
                Assert.IsTrue(status == (int)f_err.F_ERR_NONE, "fnFIE_measure_get_hu_moments: エラーが発生しました。({0})", (f_err)status);

                // 値の確認.
                Console.WriteLine("fnFIE_measure_get_hu_moments");
                for (int i = 0; i < 7; i++)
                {
                    Console.WriteLine("phu[{0}]={1}", i, phu[i]);
                }
            }
            finally
            {
                phu.Dispose();
            }
        }
    }
}


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

Public Partial Class FIE
    Public Sub fnFIE_measure_get_hu_moments(result As FHANDLE, blobno As UInteger)
        Dim phu As DOUBLE_PTR = DOUBLE_PTR.Zero

        Try
            ' Huモーメント不変量の出力先配列.
            phu = DOUBLE_PTR.alloc(7)
            Assert.IsTrue(phu <> DOUBLE_PTR.Zero, "phu が異常です.")

            Dim status As Integer = api.fnFIE_measure_get_hu_moments(result, blobno, phu)
            Assert.IsTrue(status = CInt(f_err.F_ERR_NONE), "fnFIE_measure_get_hu_moments: エラーが発生しました。({0})", CType(status, f_err))

            ' 値の確認.
            Console.WriteLine("fnFIE_measure_get_hu_moments")
            For i As Integer = 0 To 6
                Console.WriteLine("phu[{0}]={1}", i, phu(i))
            Next
        Finally
            phu.Dispose()
        End Try
    End Sub
End Class

See Also