VRun 方法
描述
运行当前项目中的视觉序列。
语法
Sub VRun (Sequence As String)
参数
- Sequence
含有当前项目中序列名称的字符串。
备注
VRun 会与采用任意类型摄像机校准或无校准的序列协同工作。
若要显示图形,需要使用 SPELVideo 控制并将 Spel 类实例的 SpelVideoControl 属性设为 SPELVideo 控制。
执行 VRun 后,使用 VGet 检索结果。
VRun 示例
VB 例:
Function FindPart(x As Single, y As Single, angle As Single)As Boolean
Dim found As Boolean
Dim x, y, angle As Single
With m_spel
.VRun("seq01")
.VGet("seq01", "corr01", "found", found)
If found Then
.VGet("seq01", "corr01", "cameraX", x)
.VGet("seq01", "corr01", "cameraY", y)
.VGet("seq01", "corr01", "angle", angle)
FindPart = True
End If
End With
End Function
C# 例:
bool FindPart(float x, float y, float angle)
{
bool found;
m_spel.VRun("seq01");
m_spel.VGet("seq01", "corr01", "found", found);
if (found) {
m_spel.VGet("seq01", "corr01", "cameraX", out x);
m_spel.VGet("seq01", "corr01", "cameraY", out y);
m_spel.VGet("seq01", "corr01", "angle", out angle);
}
return found;
}