Skip to main content

Pattern matching examples

The following example demonstrates how to configure a find operation to locate a model within a target image.

Code example: mpat.cpp

To run this example, use the Aurora Imaging Example Launcher in the Aurora Imaging Control Center.

The example mpat.cpp does the following:

  • Finds a CPU chip on a board, using a pattern matching context containing a model defined using MpatDefine withM_REGULAR_MODELthat has its accuracy and speed set to high (using MpatControl withM_ACCURACYand M_SPEED both set to M_HIGH). [Image: mpatcircuitsboard.png]
  • Finds the same chip within a range of angles, using a pattern matching context containing a model defined usingMpatDefine withM_REGULAR_MODEL+ M_CIRCULAR_OVERSCAN. [Image: mpatcircuitsboardrot.png]
  • Finds a rotated wafer model occurrence within a rotated target image, using a pattern matching context containing a model defined using MpatDefine withM_REGULAR_MODEL. In addition, the example usesMimRotate to rotate both the source and target image. [Image: mpatwafer.png]
  • Automatically defines a model within a target image, using a pattern matching context containing a model defined using MpatDefine withM_AUTO_MODEL. [Image: mpatwafer02.png]
Copyright © 2026 Zebra Technologies.