Book a consultation

Cognex VisionPro: PC-Based Vision Software, Versions and Selection

Cognex PatMax: How Geometric Pattern Matching Works

Cognex PatMax and PatMax RedLine explained: geometric features instead of pixel grids, what they find well, how to tune them, and where they fall short.

Vladimir Romanov


Cognex PatMax is a geometric pattern matching tool: it finds a trained shape in a new image by comparing outline features, not by comparing grids of pixels. In a plant, that makes it the usual first tool in an inspection, the one that finds the part, reports where it is and how it is turned, and gives later tools a fixed reference. This page explains the mechanism as Cognex documents it, what to expect when you tune it, and where it stops being the right tool. It sits under VisionPro in the Cognex technology hub, and the tool also appears in In-Sight cameras. Facts are as of November 2026, and the primary source is Cognex’s PatMax RedLine documentation (VisionPro 9.5 help). That page covers RedLine in detail and refers readers elsewhere for PatMax’s internals, so we describe PatMax’s inner workings only as far as the sources allow.

How Cognex PatMax works

It trains on features, not pixels. Cognex describes PatMax RedLine as using “a feature-based representation that can be transformed quickly and accurately for pattern matching”, and says it is not based on pixel grid representations that cannot be efficiently and accurately rotated or scaled. Features come from brightness changes in the image, which in practice means edges and contours.

It searches a range of angles and scales. RedLine performs a multi-resolution search over a range of angles and scales that you define. The result is a pose (position, angle and scale) and a score.

The contrast with pixel-grid correlation. The older general approach, which we call normalized correlation here, slides a template image over the new image and compares pixel values at each position. To handle a rotated or larger part, it must resample the template for each angle and size and repeat the comparison. This is our general explanation of the method Cognex contrasts itself with, not a Cognex statement. Because a feature set is a list of geometric elements, turning or scaling it is arithmetic on the list, which is the efficiency Cognex’s wording points to.

Pixel-grid correlation compared with feature-based matching Two rows of four steps. The top row shows the general pixel-grid method: store a template of pixel values, slide it over the image, resample it for every angle and size, and compare pixel values each time. The bottom row shows the feature-based method as Cognex describes PatMax RedLine: train on features taken from brightness changes, find features in the new image, search a range of angles and scales at several resolutions, and return a pose with a score from zero to one. General pixel-grid correlation (our explanation) 1. Store template a grid of pixel values 2. Slide over image compare at every position 3. Resample grid for each angle and size 4. Repeat work grows with the search range Feature-based, as Cognex describes PatMax RedLine 1. Train features taken from brightness changes 2. Find features in the new image 3. Search ranges angle and scale, several resolutions 4. Pose, score score from zero to one Cognex states that RedLine's speed advantage over PatMax grows as the angle and scale ranges widen. Top row is a general method for contrast, not a statement about any Cognex product.
A feature set can be rotated and scaled by calculation, while a pixel grid must be resampled and compared again, which is why the search range matters so much to speed.

Cognex PatMax and PatMax RedLine compared

PatMaxPatMax RedLine
Cognex’s recommendationContinues to be supported for existing applicationsRecommended for new vision applications
SpeedBaselineFaster for most applications, with the gap growing as search ranges widen (Cognex)
Feature thresholdAbsolute “Edge Threshold” decides which features trainRelative FeatureThreshold
ScaleIndependent X and Y scale ranges supportedOne uniform scale range
Elasticity controlNot covered by the page we usedNot supported
Input and platformNot covered by the page we used8-bit greyscale, a 64-bit operating system for the speed benefit, an SSE4.1-capable processor
Fit errorNot covered by the page we usedNot returned, but a score is always returned

Source: Cognex RedLine documentation. The same page lists RedLine as not supporting synthetic models, multi-instance training, running multiple patterns, outside-region and high-sensitivity modes, and non-affine poses (PatFlex and Perspective PatMax). If your application needs one of those, RedLine is the wrong variant.

What PatMax is good and bad at

Good at: finding a part whose outline is clear and stable, when it arrives at different positions and angles, and reporting where it is. In our view this is why it is so often the first tool on a vision job: later measurements and reads then follow the part, which is the “fixture before inspect” pattern.

Weak at, in our view: parts whose appearance changes more than their shape, such as variable surface finish, soft packaging that deforms, or very low contrast against the background, where few strong features exist to train. It also does not judge surface quality. Cognex’s tool descriptions frame it as geometric pattern location, and our own notes on the In-Sight 3800 documentation say to use it as a fixture and not as a contamination detector. A tool built to find defects, such as blob analysis or the deep learning tools in the VisionPro Deep Learning section, does that job.

Tuning Cognex PatMax RedLine

The settings below are the ones the Cognex RedLine documentation emphasises. Names are VisionPro’s. In-Sight exposes comparable controls under its own labels, so check the manual for your product.

  1. Train on a clean example. FeatureThreshold sets how many features are trained: raising it trains fewer, lowering it trains more. Cognex advises against values of 0.7 or higher, which may leave too few features.
  2. Set the search range to reality. Nominal mode tries one angle or scale. Enabling the range searches between your Low and High limits, and results outside it are rejected unless ReturnAllResults is on. Cognex warns that the true angle or scale can fall outside a tight range even when the pattern scores well at nominal. Wider ranges cost speed.
  3. Place the accept threshold from data. The score is a value from zero to one that rises with coverage, the fraction of trained features found. AcceptThreshold keeps only instances at or above it, and Cognex advises setting it below the lowest score a true instance is expected to get.
  4. Turn on clutter scoring only if you need it. RedLine reports clutter only when ScoreUsingClutter is enabled. Otherwise it reports minus one.
  5. Leave granularity alone unless you have to. Cognex says a larger coarse granularity limit generally runs faster, but changing it can drastically affect whether patterns are found.
  6. Pick the accuracy mode. Fast, Standard and Accurate trade speed against accuracy.
Close-up of a red and black circuit board with fine traces and solder points
Fine, high-contrast geometry such as traces and fiducials is what a feature-based tool trains on well.

An illustrative tuning pass. Take a few hundred images of good parts across a shift, with the lighting and positions that really occur, run the tool, and note the lowest score a good part gets. Put the accept threshold below that, then bring in the rejects or near-misses you can collect and confirm they fall below it. If good and bad parts overlap in score, the fix is usually lighting or fixture, not a cleverer threshold.

Where PatMax appears

In In-Sight. Our research on the In-Sight Vision Suite lists PatMax and PatMax RedLine among its tool families, as geometric pattern location. They sit beside the edge, blob, text reading and Edge AI tools. See In-Sight smart cameras for the camera line.

In VisionPro. The RedLine page we used belongs to the VisionPro 9.5 documentation. The same tool concept appears on the PC route, where it is used in the same locate-first role.

Where it gets hard

  • Lighting moves the features. Changing lighting changes which brightness edges exist, so retrain and revalidate after any lighting change.
  • Searching too wide. An open angle and scale range slows the tool and raises the chance of a wrong match.
  • Searching too tight. A narrow range loses parts that arrive turned or sized unexpectedly.
  • Unverified items. We did not confirm every PatMax detail in Cognex’s PatMax-specific pages, and Cognex’s claims about speed are its own and are not independently benchmarked here.

For where tool choices feed the PLC, see PLC integration. If you want help specifying an inspection, ask about our systems integration service.


Related: VisionPro · VisionPro vs In-Sight · In-Sight smart cameras · Cognex hub

Frequently asked questions

What is Cognex PatMax?

PatMax is Cognex's geometric pattern matching tool. You train it on an image of a part or feature, and it later finds that pattern in new images, reporting position, angle and a score. Cognex documents PatMax RedLine as using a feature-based representation rather than a pixel grid, so it can be rotated and scaled quickly during the search.

What is the difference between PatMax and PatMax RedLine?

Cognex documentation says that for most vision applications RedLine performs faster with similar accuracy and reliability, and that its speed advantage grows as the angle and scale search ranges widen. RedLine has documented limits, such as no elasticity control, no multi-pattern running and no perspective poses. Cognex recommends RedLine for new applications and keeps supporting PatMax for existing ones.

Does PatMax work in In-Sight and in VisionPro?

Yes. Cognex lists PatMax and PatMax RedLine among the In-Sight Vision Suite tool families, where it is typically used to locate a part so later tools follow it, and the RedLine documentation we used is part of the VisionPro 9.5 documentation set. Names of individual settings differ between the two, so use the manual for your product.

What score should I use as the accept threshold?

There is no universal number. Cognex documents the score as a value from zero to one that rises with coverage, and advises setting the accept threshold below the lowest score a true instance is expected to receive. Collect scores from good parts across a real production run, then place the threshold beneath them.

Can PatMax find defects like contamination?

It is not designed for that. PatMax locates a trained shape, so its job in most inspections is to find the part and set a reference frame for other tools. In our field notes on the In-Sight 3800 documentation, the recommendation is to use it as a fixture rather than as a contamination detector. Use blob, edge or deep learning tools for the defect itself.

References and further reading

  1. PatMax RedLine tool documentation (VisionPro 9.5) · Cognex documentationThe primary source for this page: how RedLine works, its parameters and its limits.
  2. In-Sight Vision Suite release history · Cognex documentationHow the In-Sight tool set has grown.
  3. IS3800 Reference Manual · Cognex documentationIn-Sight 3800 tools and settings.
  4. Cognex Form 10-K for fiscal 2023 · U.S. Securities and Exchange CommissionCognex's description of its patented vision tools.

← VisionPro

Have a project that needs technical ownership?

Send us the situation. If it is not something we should take on, we will say so.

The Plant-Side Brief

The weekly brief for the people who own a plant’s control systems.

One email every Wednesday for engineering and operations leaders responsible for controls, SCADA, MES and OT networks. Skim the top in two minutes; read the Deep Dive when you have fifteen.

  • One modernization problem, worked through to cost, risk and a schedule you can defend. The Deep Dive.
  • End-of-support dates before they reach your plant Windows, servers, controllers and HMI software. Lifecycle Watch.
  • A checklist your engineers can run that week not a framework to admire. Field Kit.
  • Every number sourced, no vendor agenda we are paid by plants, never by vendors.