指定角度外接長方形の頂点座標の取得
Namespace: fvalgcliAssembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)
Syntax
C# |
---|
public static int fnFIE_measure_get_bounding_rotated_rect_pos(
FHANDLE hresult,
uint blobno,
double theta,
DPNT_T_PTR points
) |
Visual Basic |
---|
Public Shared Function fnFIE_measure_get_bounding_rotated_rect_pos (
hresult As FHANDLE,
blobno As UInteger,
theta As Double,
points As DPNT_T_PTR
) As Integer |
Parameters
- hresult
- Type: fvalgcli..::..FHANDLE
ブローブ解析結果ハンドル
- blobno
- Type: System..::..UInt32
対象ブローブのブローブ番号
- theta
- Type: System..::..Double
外接長方形の角度(外接長方形のある一辺とx軸がなす角度)単位:ラジアン
- points
- Type: fvalgcli..::..DPNT_T_PTR
外接長方形の4頂点の点列の出力先配列。要素数 4 の配列を予め確保してください。
Return Value
Type:
Int32
以下のエラーコードを返します。
エラーコード:f_err | 内容 |
---|
F_ERR_NONE | 正常終了 |
F_ERR_INVALID_OBJECT | hresult に指定されたオブジェクトハンドルが不正 |
F_ERR_INVALID_PARAM | blobno に指定されたブローブ番号が不正, パラメータに NULL pointer が渡された |
F_ERR_NO_LICENCE | ライセンスエラー、または未初期化エラー |
Examples
C# | Copy |
---|
using System;
using System.Collections.Generic;
using System.Text;
using fvalgcli;
namespace TC
{
public partial class FIE
{
public void fnFIE_measure_get_bounding_rotated_rect_pos(FHANDLE result, uint blobno)
{
var points = DPNT_T_PTR.Zero;
try
{
points = DPNT_T_PTR.alloc(4);
Assert.IsTrue(points != IntPtr.Zero, "points が異常です.");
double theta = 90 * defs.PI / 180;
int status = api.fnFIE_measure_get_bounding_rotated_rect_pos(result, blobno, theta, points);
Assert.IsTrue(status == (int)f_err.F_ERR_NONE, "fnFIE_measure_get_bounding_rotated_rect_pos でエラーが発生しました。({0})", (f_err)status);
Console.WriteLine("fnFIE_measure_get_bounding_rotated_rect_pos");
for (int i = 0; i < 4; i++)
{
Console.WriteLine("points[{0}]={1},{2}", i, points[i].x, points[i].y);
}
}
finally
{
points.Dispose();
}
}
}
} |
Visual Basic | Copy |
---|
Imports System.Collections.Generic
Imports System.Text
Imports fvalgcli
Public Partial Class FIE
Public Sub fnFIE_measure_get_bounding_rotated_rect_pos(result As FHANDLE, blobno As UInteger)
Dim points As DPNT_T_PTR = DPNT_T_PTR.Zero
Try
points = DPNT_T_PTR.alloc(4)
Assert.IsTrue(points <> DPNT_T_PTR.Zero, "points が異常です.")
Dim theta As Double = 90 * defs.PI / 180
Dim status As Integer = api.fnFIE_measure_get_bounding_rotated_rect_pos(result, blobno, theta, points)
Assert.IsTrue(status = CInt(f_err.F_ERR_NONE), "fnFIE_measure_get_bounding_rotated_rect_pos でエラーが発生しました。({0})", CType(status, f_err))
Console.WriteLine("fnFIE_measure_get_bounding_rotated_rect_pos")
For i As Integer = 0 To 3
Console.WriteLine("points[{0}]={1},{2}", i, points(i).x, points(i).y)
Next
Finally
points.Dispose()
End Try
End Sub
End Class |
See Also