VTeach Method
Description
Teach a correlation, geometric, or polar model.
Syntax
Sub VTeach (Sequence As String, Object As String, ByRef Status as Integer)
Sub VTeach (Sequence As String, Object As String, AddSample as Boolean, KeepDontCares As Boolean, ByRef Status as Integer)
Parameters
- Sequence
The name of a vision sequence in the current project. - Object
The object name. Correlation, Geometric, or Polar objects can be taught. - AddSample
True to add a sample, False to add as a new model. - KeepDontCares
True to use the existing detection mask, False to discard it. - Status
Returns the status 0: Unsuccessful, 1: Successful
Remarks
Before you call VTeach, you must ensure that the model window is in the correct position.
For polar objects, the search window and thickness must be set properly. Set the search window location and thickness using VSet.
For correlation and geometric objects, the search window and the model window must be set properly. Set the search and model window locations using VSet for SearchWin and ModelWin. Or you can use the VTrain command so the operator can interactively change the windows.
After teaching the models, you can save them to a PC disk file using the VSaveModel method.
See Also
VTrain Method, VSaveModel Method
VTeach Example
VB Example:
Dim status As Integer
' First let the operator change the window position
m_spel.VTrain("seq01", "corr01", status)
' Now teach the model
m_spel.VTeach("seq01", "corr01", status)
C# Example:
int status;
// First let the operator change the window position
m_spel.VTrain("seq01", "corr01", status);
// Now teach the model
m_spel.VTeach("seq01", "corr01", out status);