The following steps provide a basic methodology for using the MIL Bead module:
Allocate a bead context to hold your bead templates, using MbeadAlloc().
Allocate a bead result buffer to hold the results of the verification operation, using MbeadAllocResult().
Add a bead template to the bead context, using MbeadTemplate().
You can repeat this step to add multiple templates.
Specify training settings, using MbeadControl().
Train the templates, using MbeadTrain().
If necessary, you can perform certain drawing operations based on the trained templates, using MbeadDraw().
Verify the training status of the templates in the context, using MbeadInquire() with M_STATUS.
If the templates are not completely trained, you can use MbeadTemplate() and MbeadControl() to modify the templates and then re-call MbeadTrain().
Specify verification settings, using MbeadControl().
Verify beads in a target image against the bead templates, using MbeadVerify().
If necessary, you can perform certain drawing operations based on bead results, using MbeadDraw().
Retrieve the required bead results from the result buffer, using MbeadGetResult().
If necessary, you can use MbeadControl() to modify verification settings and then re-call MbeadVerify().
If necessary, save your bead context, using MbeadSave() or MbeadStream().
Once you save a bead context, you can later restore it, using MbeadRestore() or MbeadStream(). Restoring a bead context instead of creating it again can be more efficient, especially if the restored context requires no further modifications. You can save or restore a bead context to/from a file or memory stream.
Free all your allocated bead objects, using MbeadFree().