# Pattern Polarity

Each of the boundary points that describes a pattern feature has a polarity. The polarity of a boundary point indicates whether the boundary can be characterized as light-to-dark or dark-to-light. You can configure PatMax to find only objects in which every boundary point has the same polarity as the trained pattern, or you can configure PatMax to find objects with mismatched polarity.

Ignoring pattern polarity increases the variety of patterns that PatMax finds. Figure 8 shows some examples of matched and mismatched pattern polarities. If you configure PatMax to ignore pattern polarity, it finds all of the patterns shown in Figure 8. If you configure PatMax to consider pattern polarity, it might not find the patterns in the right-hand column, or it might find them but assign them lower scores than the patterns in the left-hand column.

If the run-time images encountered by your application can undergo polarity or other non-uniform changes in brightness, and you want to locate objects that have experienced these kinds of brightness changes, you should configure PatMax to ignore pattern polarity. If you want PatMax to find only patterns with matching polarity, you should configure PatMax to consider pattern polarity.

If you are using shape training, the polarity of all of the shapes being trained must be defined in order to consider pattern polarity; if any shapes have indeterminate polarity, you must ignore pattern polarity

Note: Ignoring pattern polarity causes PatMax pattern location to be approximately 10% slower than considering pattern polarity.