計測ライン(線分)上の濃度投影の作成
Namespace: fvalgcliAssembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)
Syntax
C# |
---|
public static int fnFIE_edge1d_projection_line(
FHANDLE hsrc,
DSGMT_T line,
int prj_width,
DOUBLE_PTR pprj,
int prj_len,
ref F_ARRAY_INDEX valid_reg
) |
Visual Basic |
---|
Public Shared Function fnFIE_edge1d_projection_line (
hsrc As FHANDLE,
line As DSGMT_T,
prj_width As Integer,
pprj As DOUBLE_PTR,
prj_len As Integer,
ByRef valid_reg As F_ARRAY_INDEX
) As Integer |
Return Value
Type:
Int32
以下のエラーコードを返します。
エラーコード:f_err | 内容 |
---|
F_ERR_NONE | 正常終了 |
F_ERR_INVALID_IMAGE | 不正な画像が渡された |
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_edge1d_projection_line()
{
string filepath = TestImageDir + "/testdata/image_file_8bpp.bmp";
int status = (int)f_err.F_ERR_NONE;
FHANDLE hImage = FHANDLE.Zero;
DOUBLE_PTR pprj = DOUBLE_PTR.Zero;
try
{
api.fnFIE_load_bmp(filepath, ref hImage, f_color_img_type.F_COLOR_IMG_TYPE_UC8);
int prj_width = 5;
int prj_len = 0;
int length = 0;
DSGMT_T line;
line.st.x = 50;
line.st.y = 250;
line.ed.x = 450;
line.ed.y = 250;
api.fnFIE_edge1d_calc_projection_line_length(line, ref length);
prj_len = (int)(length + 0.5);
pprj = DOUBLE_PTR.alloc(prj_len);
F_ARRAY_INDEX valid_reg = new F_ARRAY_INDEX();
status = api.fnFIE_edge1d_projection_line(hImage, line, prj_width, pprj, prj_len, ref valid_reg);
Assert.IsTrue(status == (int)f_err.F_ERR_NONE, "fnFIE_edge1d_projection_line: エラーが発生しました。({0})", (f_err)status);
Console.WriteLine("fnFIE_edge1d_projection_line");
}
finally
{
hImage.Dispose();
pprj.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_edge1d_projection_line()
Dim filepath As String = TestImageDir & "/testdata/image_file_8bpp.bmp"
Dim status As Integer = CInt(f_err.F_ERR_NONE)
Dim hImage As FHANDLE = FHANDLE.Zero
Dim pprj As DOUBLE_PTR = DOUBLE_PTR.Zero
Try
api.fnFIE_load_bmp(filepath, hImage, f_color_img_type.F_COLOR_IMG_TYPE_UC8)
Dim prj_width As Integer = 5
Dim prj_len As Integer = 0
Dim length As Integer = 0
Dim line As DSGMT_T
line.st.x = 50
line.st.y = 250
line.ed.x = 450
line.ed.y = 250
api.fnFIE_edge1d_calc_projection_line_length(line, length)
prj_len = CInt(Math.Truncate(length + 0.5))
pprj = DOUBLE_PTR.alloc(prj_len)
Dim valid_reg As New F_ARRAY_INDEX()
status = api.fnFIE_edge1d_projection_line(hImage, line, prj_width, pprj, prj_len, valid_reg)
Assert.IsTrue(status = CInt(f_err.F_ERR_NONE), "fnFIE_edge1d_projection_line: エラーが発生しました。({0})", CType(status, f_err))
Console.WriteLine("fnFIE_edge1d_projection_line")
Finally
hImage.Dispose()
pprj.Dispose()
End Try
End Sub
End Class |
See Also