Skip to main content

AI-POWERED DOCS

What do you want to know?

Step 2: Alignment

The aligner is the most powerful (and the most misunderstood) part of the camera. Once you understand it, everything clicks. Let's explain it simply.

See it in action

Play with the simulator before you read on. Toggle the aligner off, then move the sliders to shift and rotate the part. The orange ROI shows the inspection region tracking the part, and the green boxes turn red when the aligner can no longer follow.

Camera Settings

Status: Tracking Locked / Pass

Simulate Real World

Move the part coming down the line.

ROI

What alignment does (and why you need it)

Imagine you're inspecting screws on a circuit board. You've drawn a little box around each screw location. But what happens when the next board comes in slightly shifted to the left? Or rotated a degree? Your boxes are now looking at the wrong spots.

The aligner solves this. It looks at each new image, figures out where the part moved to, and shifts all your inspection boxes to match. It's like having a helper who says "the board moved 3 pixels left and rotated 0.5 degrees, so let me move all your boxes to match."

Why this is powerful: When your inspection boxes can move with the part, you can make them smaller. And smaller boxes need less data to train the AI. It's a cascading benefit that starts with good alignment.

Why alignment is the foundation of everything

The aligner isn't just a nice-to-have. It's the first domino in a chain that determines the accuracy of your entire inspection. Here's the pipeline:

AlignmentSmaller ROIsLess training data neededMore accurate AI

Each step depends on the one before it:

  1. Good alignment means your inspection boxes track the part precisely, even when it shifts or rotates on the conveyor.
  2. Precise tracking means you can draw smaller inspection boxes (ROIs). You don't need to add extra padding to account for part movement.
  3. Smaller ROIs mean the AI sees a tightly cropped view of just the feature you care about (a screw, a connector, a weld), not a sea of irrelevant background.
  4. Less background noise means the AI needs fewer training images to learn, and it makes fewer mistakes in production.
This is the concept most people miss

The aligner doesn't inspect anything. It doesn't judge pass or fail. Its only job is to dynamically move your inspection boxes so they land on the right spots every time. The inspection boxes do the actual inspecting. The AI inside those boxes does the actual judging. But none of that works if the boxes are in the wrong place.

Think of it as a chain: Aligner → ROIs → Classifier/Segmenter. If the first link is weak, everything downstream breaks.

How it works: think of it like a puzzle

The aligner works by matching edges. Here's a simple way to think about it:

  1. You take a "reference photo" (the template image) of a perfect part
  2. You point to specific features on that photo (corners, edges, holes) that look the same on every part
  3. Every time a new part arrives, the camera finds those same features in the new image
  4. It calculates the difference: "this part is 5 pixels left, 2 pixels up, and tilted 1.2 degrees"
  5. It moves all your inspection boxes by exactly that amount

It's like playing a matching game. The camera finds the features you showed it and uses them as anchor points.

The golden rule of alignment

Place 2-3 small template regions as far apart as possible on the part

This single rule will determine whether your alignment works perfectly or jitters frustratingly. Here's why:

Think of it like this: Imagine you're trying to figure out if a picture frame on the wall is crooked.

  • If you only look at one corner, you might think it's straight when it's actually tilted
  • If you look at two opposite corners (top-left and bottom-right), you can instantly tell if it's crooked, and by exactly how much

The same principle applies to the aligner. With one region on one side of the part, a tiny measurement error of 0.5 degrees stays at 0.5 degrees. But with two regions on opposite sides, that same error averages out to about 0.05 degrees, ten times more accurate.

Critical: what NOT to align to

This is the number one cause of alignment failures. Before you touch the aligner interface, internalize these two rules.

1. Never align to defects

Defects are unpredictable. A scratch, a dent, or a missing screw might look completely different on every part, or it might not be there at all.

If you tell the camera to use a scratch as its anchor point, the alignment will completely fail when a perfectly good, scratch-free part comes down the line. The camera won't know where to place your inspection boxes, and the system will break down.

The Rule

Use the aligner to find the part using features that are always there (rigid edges, machined corners, drilled holes). Then use the inspection boxes to look for the unpredictable defects. The aligner finds the part. The inspection boxes find the problems.

2. Never align to moving parts or labels

If you align to something that can move independently of the main object, like a loose wire, a cardboard flap, or a barcode sticker, you will accidentally trick the camera into shifting all your inspection boxes to the wrong position.

Example: Imagine you anchor your aligner to a barcode sticker. On the next part, a worker accidentally places that sticker a half-inch to the left. The camera sees the sticker move and assumes the entire part shifted a half-inch to the left. It shifts all of your inspection boxes to compensate. But the actual metal part didn't move, only the sticker did. Now all of your inspection boxes are looking at the wrong spots, causing false failures across the board.

The Rule

Only anchor to features that are permanently fixed to the rigid body of the part: machined edges, molded corners, drilled holes, PCB outlines. Never anchor to labels, stickers, wires, flaps, or anything a human could accidentally reposition.

Quick summary: what to align to vs. what to avoid

Align to (permanent, rigid features)Never align to (variable or movable)
Machined edgesScratches, dents, or defects
Drilled holesBarcode stickers or labels
PCB outlinesLoose wires or cables
Molded corners or featuresCardboard flaps or packaging
Stamped metal edgesTape, adhesive, or markers
Cast or forged geometryAny feature a human could reposition

The aligner interface

Here's what the aligner setup screen looks like. You'll see your template image with colored edge highlights showing what the aligner is using as reference features:

Aligner tool, full page overview

Step-by-step setup

1. Capture the template image

Place a good, defect-free part in the camera's field of view. This part becomes the reference that every future part is compared against.

  • The part should be well-lit with clear edges
  • Make sure it's clean, with no debris or unusual markings
  • Position it how it will typically appear in production

Click Capture Template Image.

2. Add template regions

Click + Rectangle (or + Circle) to create a template region. You'll place 2-3 of these.

What to align to (features that never change):

  • Machined edges
  • Drilled holes
  • PCB outlines
  • Molded features
  • Stamped corners

What NOT to align to:

  • Textured or variable surfaces
  • Areas where defects might appear
  • Reflective spots that create glare
  • Tiny details that might not be visible in every image
  • Labels or markings that could move

3. Understand the edge highlights

When you place a template region, you'll see colored highlights:

Edge highlights and red dot reference point

  • Green highlights = Strong, usable edges detected. This is what you want.
  • Red highlights = Not enough edges. Move the region to a feature with clearer edges.
  • Red dot = The alignment reference point (center of all your inspection regions).

4. Clean up noisy edges with the Ignore tool

This step is overlooked by most people, and it makes a huge difference.

Click Ignore Template Region and paint over any edges you don't want the aligner to use. Remove:

  • Random background texture
  • Glare or reflections
  • Surface noise
  • Edges from debris or labels
  • Any edge that might change between parts
High sensitivity + aggressive cleanup = best results

If you need more edges, increase the sensitivity slider. But the more you increase sensitivity, the more important it is to clean up the noise with the Ignore tool. Think of it as casting a wide net, then carefully picking out only the good fish.

Sensitivity slider

5. Set rotation range

Rotation range setting

This controls how much rotation the aligner will search for:

  • ±180°: Find the part at any rotation (full 360). Best for most applications.
  • ±5-20°: Only match if the part is roughly in the expected orientation
  • ±0°: Exact angle match only
Use rotation as a quality gate

If you set a narrow range like ±5° and a part comes in rotated 10°, the aligner won't match it, and you can use this failure as a reject signal. Handy for catching parts that aren't properly oriented.

6. Set confidence threshold

Confidence threshold setting

How confident the aligner needs to be that it found the right match:

  • Range: 0.0 to 1.0 (lower percentage = stricter match)
  • Recommended: 0.6 to 0.9
  • Too high → may miss valid parts. Too low → may match wrong features.

7. Enable Scale Invariant (if needed)

If your part can be ±10% closer or farther from the camera (height variation on a conveyor, for example), enable this. Otherwise, leave it off for maximum speed.

8. Save and test

This is the most important step. Do not skip testing.

  1. Click Save. This trains and deploys the aligner.
  2. Click Live Preview Mode
  3. Move the part around: left, right, up, down
  4. Rotate it within your expected range
  5. Put it in the corners of the frame
  6. Try different valid parts
  7. Try to break it. Find the positions where it fails.

If the alignment doesn't track reliably, fix it now. If you move on and spend time setting up inspection regions and training AI, then discover the alignment is unreliable, you'll have to come back and redo everything. That's the waterfall.

The 2D limitation (important to know)

The aligner works in 2D only: the flat plane that the camera sees. It handles:

  • Left/right movement
  • Up/down movement
  • Rotation (spinning on the flat surface)
  • Slight size changes (if Scale Invariant is on)

It does NOT handle:

  • Warped or bent parts
  • Parts tilted toward or away from the camera
  • Any 3D variation

If your parts have 3D variation (one side closer to the camera than the other), skip the aligner entirely and use a segmenter with location-invariant training instead.

When to skip the aligner

You still need to capture a template image (the system requires it), but you can toggle Skip Aligner if:

  • Your parts are in a precision fixture with less than 1-2 pixel movement
  • You're using mechanical registration that guarantees exact positioning
  • You're using a segmenter that doesn't need position tracking

Quick reference

SettingRecommendedAdjust when...
Template regions2-3, as far apart as possibleAlignment jitters → add regions, spread them out
SensitivityLowest that gives solid green on your featuresNot enough edges (red) → increase, then clean up noise
Rotation range±180° for most applicationsParts come in a known orientation → narrow the range
Confidence0.6-0.9Wrong matches → increase. Missing valid parts → decrease
Scale invariantOff unless neededParts at varying distance from camera → enable

Troubleshooting alignment

Common alignment problems and fixes
ProblemLikely causeFix
ROIs don't move with the partSkip Aligner is on, or no template regionsDisable skip; add template regions
Alignment jitters back and forthSingle region, or regions too close togetherAdd 2-3 regions far apart on opposite sides
Confidence stays near 0%No usable edges in regionsMove regions to features with strong, clear edges
Matches the wrong thingFeatures aren't unique enough, threshold too lowChoose more distinctive features; increase confidence threshold
Works on some parts, fails on othersRegions placed on features that vary between partsMove regions to universal features (machined edges, holes)

Alignment checklist

Before moving on, confirm:

  • Template image captured from a good, defect-free part
  • 2-3 template regions placed on strong, stable features
  • Regions spread as far apart as possible on the part
  • Noisy edges cleaned up with the Ignore tool
  • Rotation range and confidence threshold set
  • Live Preview tested; alignment tracks the part in all positions

Alignment working well? Move to Step 3: Inspection Regions.