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.
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.
Cognex PatMax and PatMax RedLine compared
| PatMax | PatMax RedLine | |
|---|---|---|
| Cognex’s recommendation | Continues to be supported for existing applications | Recommended for new vision applications |
| Speed | Baseline | Faster for most applications, with the gap growing as search ranges widen (Cognex) |
| Feature threshold | Absolute “Edge Threshold” decides which features train | Relative FeatureThreshold |
| Scale | Independent X and Y scale ranges supported | One uniform scale range |
| Elasticity control | Not covered by the page we used | Not supported |
| Input and platform | Not covered by the page we used | 8-bit greyscale, a 64-bit operating system for the speed benefit, an SSE4.1-capable processor |
| Fit error | Not covered by the page we used | Not 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.
- 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.
- 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.
- 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.
- Turn on clutter scoring only if you need it. RedLine reports clutter only when ScoreUsingClutter is enabled. Otherwise it reports minus one.
- 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.
- Pick the accuracy mode. Fast, Standard and Accurate trade speed against accuracy.

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