REGION特徴量:3次モーメント
Namespace: fvalgcliAssembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)
Syntax
C# |
---|
public static int fnFIE_region_calc_moment3( FHANDLE hreg, ref double m30, ref double m03, ref double m21, ref double m12 ) |
Visual Basic |
---|
Public Shared Function fnFIE_region_calc_moment3 ( hreg As FHANDLE, ByRef m30 As Double, ByRef m03 As Double, ByRef m21 As Double, ByRef m12 As Double ) As Integer |
Parameters
- hreg
- Type: fvalgcli..::..FHANDLE
REGIONハンドル
- m30
- Type: System..::..Double%
3次モーメントM30
- m03
- Type: System..::..Double%
3次モーメントM03
- m21
- Type: System..::..Double%
3次モーメントM21
- m12
- Type: System..::..Double%
3次モーメントM12
Return Value
Type: Int32以下のエラーコードを返します。
エラーコード:
f_err | 内容 |
---|---|
F_ERR_NONE | 正常終了 |
F_ERR_INVALID_PARAM | 不正なパラメータが指定された
|
F_ERR_INVALID_OBJECT | 不正なハンドル |
F_ERR_CALC_IMPOSSIBLE | 計算不能 |
F_ERR_NO_LICENCE | ライセンスエラー、または未初期化エラー |
Remarks
Examples
C# | Copy |
---|---|
// $Revision: 1.1 $ using System; using System.Collections.Generic; using System.Text; using fvalgcli; namespace TC { public partial class FIE { [FvPluginExecute] public void fnFIE_region_calc_moment3() { FHANDLE himage = FHANDLE.Zero; FHANDLE hreg = FHANDLE.Zero; try { // 2値画像を読み込む. api.fnFIE_load_img_file(TestImageDir + "/TC/SampleCode/blob_BIN.png", ref himage, f_color_img_type.F_COLOR_IMG_TYPE_UC8); Assert.IsTrue(himage != FHANDLE.Zero, "himage が異常です."); // 画像からリージョンを作成する. // --- オフセット. PNT_T offset = new PNT_T(); offset.x = 0; offset.y = 0; // --- 作成. hreg = api.fnFIE_region_encode(himage, offset); // リージョン特徴量:3次モーメント. double m30 = 0; double m03 = 0; double m21 = 0; double m12 = 0; int status = api.fnFIE_region_calc_moment3(hreg, ref m30, ref m03, ref m21, ref m12); Assert.IsTrue(status == (int)f_err.F_ERR_NONE, "calc_moment3でエラーが発生しました。({0})", (f_err)status); // 値の確認. Console.WriteLine("m30={0},m03={1},m21={2},m12={3}", m30, m03, m21, m12); } finally { himage.Dispose(); hreg.Dispose(); } } } } |
Visual Basic | Copy |
---|---|
' $Revision: 1.1 $ Imports System.Collections.Generic Imports System.Text Imports fvalgcli Public Partial Class FIE <FvPluginExecute> _ Public Sub fnFIE_region_calc_moment3() Dim himage As FHANDLE = FHANDLE.Zero Dim hreg As FHANDLE = FHANDLE.Zero Try ' 2値画像を読み込む. api.fnFIE_load_img_file(TestImageDir & "/TC/SampleCode/blob_BIN.png", himage, f_color_img_type.F_COLOR_IMG_TYPE_UC8) Assert.IsTrue(himage <> FHANDLE.Zero, "himage が異常です.") ' 画像からリージョンを作成する. ' --- オフセット. Dim offset As New PNT_T() offset.x = 0 offset.y = 0 ' --- 作成. hreg = api.fnFIE_region_encode(himage, offset) ' リージョン特徴量:3次モーメント. Dim m30 As Double = 0 Dim m03 As Double = 0 Dim m21 As Double = 0 Dim m12 As Double = 0 Dim status As Integer = api.fnFIE_region_calc_moment3(hreg, m30, m03, m21, m12) Assert.IsTrue(status = CInt(f_err.F_ERR_NONE), "calc_moment3でエラーが発生しました。({0})", CType(status, f_err)) ' 値の確認. Console.WriteLine("m30={0},m03={1},m21={2},m12={3}", m30, m03, m21, m12) Finally himage.Dispose() hreg.Dispose() End Try End Sub End Class |