Pick-and-place machines place thousands of components per hour, and each one must land in the right position and the right rotation. This explainer walks through the measurement pipeline behind SMT placement vision: binarization, edge extraction, feature-point detection, and the angle and position math applied to parts like 0402, 0603 and 1206 chip components. It also covers the optics that make those numbers trustworthy, because a perfect algorithm cannot save an image where the part changes size with board height. By the end you will know the processing chain, the formulas, and how to select a telecentric lens and lighting for a reliable cell.
What the measurement must produce
A placement head needs two numbers from vision: the XY offset between where the component actually is and where the program expects it, and the rotation error around the part's centre. Typical tolerances are tens of micrometres in position and a few tenths of a degree in angle for fine-pitch work. Everything downstream, from nozzle correction to placement reporting, depends on these two values being stable from image to image.
The measurement runs on a binary silhouette of the part. Chip components like 0402 (1.0 x 0.5 mm), 0603 (1.6 x 0.8 mm) and 1206 (3.2 x 1.6 mm) have bright metallic terminations at each end and a darker ceramic or moulded body. The processing chain exploits that contrast:
- Capture a high-contrast image of the part.
- Binarize: separate part (or terminations) from background.
- Extract the outline edges of the binary region.
- Detect feature points: termination midpoints, body corners, polarity marks.
- Compute position from the centroid and angle from a two-point baseline.
Binarization: the foundation everything sits on
Binarization turns each pixel into part or background with a threshold. The threshold level shifts every extracted edge by a fraction of a pixel, so it must be stable. With uniform illumination a single fixed threshold works; with uneven lighting, an adaptive threshold that adjusts locally keeps the outline from drifting across the field.
The practical rule: fix the lighting before tuning the threshold. A part lit with even coaxial illumination against a dark background gives a grey histogram with two clean peaks, and the threshold can sit anywhere in the valley between them without moving the edge. Our guide on live binary image preview for defect inspection shows how to watch the binary result live while you tune it.
Edge extraction and feature-point detection
From the binary image, the vision software traces the boundary between part and background as a closed contour. Subpixel edge refinement, fitting a line to the grey-level transition around each boundary point, improves edge location to a fraction of a pixel and directly improves both position and angle accuracy.
Feature points are the landmarks you actually measure from. For a chip component, the best set is:
- The midpoint of each end termination band, giving a long, high-contrast baseline.
- The intersection points of body edges (corners), useful for size checks and mix-up detection.
- Polarity features for packages that have them: the notch or dot on a small-outline transistor, pin 1 on an IC.
Detecting the wrong feature is worse than detecting it imprecisely. A reflection off a curved capacitor body can mimic an edge, so feature detection should always be constrained by geometry: a termination midpoint must lie near the body's principal axis, a pin-1 mark must lie inside the body contour.
Feature-based geometry also underlies our guide on part identification by dimensions to prevent mixed parts, which uses the same outline measurements to catch wrong components before they are placed.
Computing position and angle
Position comes from the centroid of the part contour, or from the midpoint of the two termination points. Angle comes from any two feature points that define the part's axis:
where (x1, y1) and (x2, y2) are the two feature points in image coordinates. Convert to millimetres with the pixel scale, and to board coordinates with the camera calibration, the same chain described in camera calibration for length measurement from image markers.
Angular resolution follows from the baseline length. A one-pixel error at one endpoint of a baseline of L pixels shifts the angle by roughly 1/L radians:
Long parts therefore give better angles. This is why a 1206 measures its rotation more precisely than an 0402 at the same pixel scale.
Worked example: a 0603 at 0.5x magnification
Take a 0603 component (1.6 x 0.8 mm body) imaged by a telecentric lens at 0.5x on a camera with 3.45 micrometre pixels. One pixel on the object side is 3.45 / 0.5 = 6.9 micrometres. The component's 1.6 mm length spans 1600 / 6.9 ≈ 232 pixels.
Suppose subpixel edge fitting locates the two termination midpoints at (812.4, 301.2) and (1042.9, 288.5). Then:
- Baseline: dx = 230.5 px, dy = -12.7 px
- Angle: atan2(-12.7, 230.5) = -3.15 degrees
- Position: midpoint at (927.7, 294.9) px = (6.40, 2.03) mm from the image origin
If the placement program expects the part at 0 degrees and (6.35, 2.05) mm, the corrections are -0.05 mm in X, -0.02 mm in Y, and -3.15 degrees of rotation. A one-pixel error at one endpoint (1/230.5 = 0.0043 rad ≈ 0.25 degrees) bounds the worst-case angle error, and averaging the full termination edges rather than single points typically brings it well under that.
To check what camera pixel count your field of view needs, use the camera resolution calculator before you order anything.
Why the lens must be telecentric
Every millimetre in the example assumed a known, constant pixel scale. With a standard lens, that scale changes with working distance: a board sitting 0.5 mm high makes every part look larger and every position look further from centre. The error appears as phantom placement error even though the part is perfect.
An object-side telecentric lens images with the same magnification across its depth of field, so board height variation does not corrupt the measurement. That trade-off is covered in depth in when you need a telecentric lens for gauging. For component work, pick the magnification from your field of view: the part plus margin must fit the sensor, and the pixel scale must resolve the smallest feature.
A compact pick-and-place inspection station around a single component size works well with a 1x lens:
- Sensor format
- 2/3"
- Mount
- C-mount
- Image circle
- 8-11 mm
- Type
- Object-side telecentric
For larger parts or multiple components in one view, a lower magnification covers more area:
- Sensor format
- 1"
- Mount
- C-mount
- Image circle
- 11-16 mm
- Type
- Object-side telecentric
Both styles are available across magnifications in the telecentric lenses category, and you can filter the lens finder by sensor format and working distance. If your station inspects parts at a fixed, well-controlled height and tolerates a small scale error, a standard C-mount lens can serve, as discussed in machine vision lens selection for reliable inspection.
- Type
- Machine vision fixed
- Sensor format
- 2/3"
- Mount
- C-mount
- Resolution
- 6-10 MP
Lighting: coaxial for features, backlight for silhouettes
Two lighting arrangements cover SMT localization. Coaxial light, introduced along the lens axis through a beamsplitter, illuminates flat and shiny surfaces evenly and shows surface features such as terminations and polarity marks. Backlighting renders the part as a pure silhouette, ideal when you only need outline, position and angle.
For termination-based feature points on chip components, coaxial is usually the right choice:
- Size
- 50-100 mm
- Voltage
- 24 V
The size of the coaxial window should cover the field of view with margin; browse coaxial lights by window size and colour. When you only need a silhouette, the choice between collimated and diffuse backlight follows the same logic as in collimated backlight or diffuse backlight for edge gauging: collimated for the sharpest edges, diffuse when the part sits close to the glass.
Choosing the set-up: a short checklist
- Define the smallest feature you must resolve, then derive the required pixel scale and camera resolution.
- Pick the telecentric magnification so the largest part plus rotation margin fits the sensor.
- Match the lens image circle to the sensor size; a lens that vignettes the corners destroys edge measurement at exactly the wrong place.
- Choose coaxial light sized to the field of view, or a collimated backlight for silhouette-only tasks.
- Verify angle stability with a repeat-capture test: a stationary part must report the same angle within tolerance over many frames.
- Budget for calibration: pixel scale, camera-to-board coordinate transform, and periodic re-verification.
The system configurator walks camera, lens, light and controller into one build if you want a starting point rather than picking each part from the finders.
When the usual answer is wrong
A telecentric lens with coaxial light is the default, but not always the answer. If your cell verifies parts after placement on a crowded board, nearby components and solder reflections, not the optics, set the error budget; a narrower field of view per capture with more captures may beat one wide telecentric shot. If parts arrive in tape rather than on a board, a backlight silhouette through the tape pocket is simpler and more robust than coaxial features. And if you are choosing the camera and architecture for the whole cell, the integration constraints matter as much as the algorithm; see this vision system selection overview for pick-and-place robots.
Finally, remember that angle measurement degrades on the shortest parts. If 0402 rotation tolerance is tight, consider measuring angle from the tape pocket or nozzle rather than from the placed part, where the baseline is longer.
If you want help sizing a lens and light for a specific component mix, contact us through the contact page with the part dimensions and tolerances, and we will work the numbers with you.
Questions
How accurate can component angle measurement be with a telecentric lens?
Angle accuracy depends on the length of the baseline you measure over. With a 0.5x telecentric lens and 3.45 micron pixels, one pixel on the object is about 6.9 micrometres. On a 1206 component (3.2 mm long, about 460 pixels), a one-pixel endpoint error moves the angle by roughly 0.12 degrees, and averaging edges across the whole outline improves on that. Small parts like 0402 have shorter baselines, so their angle estimates are inherently noisier.
Why is a telecentric lens preferred over a standard lens for SMT placement?
A telecentric lens has constant magnification within its depth of field, so the measured size and position of a component do not change when the board or the part sits slightly higher or lower. A standard lens scales the image with distance, which turns height variation into apparent position error. For pick-and-place, where the nozzle places parts from above and board flatness varies, that scaling error directly becomes placement error.
Should I use coaxial light or a backlight for component localization?
Use coaxial light when you inspect the component body from above: it gives uniform, glare-free brightness on the terminations and body edges, which suits feature-point extraction. Use a backlight when you only need the silhouette for position and angle, such as checking feeder pockets or part presence. A collimated backlight gives the sharpest silhouettes for edge gauging, as covered in our edge-gauging guide.
How does binarization affect the measurement result?
Binarization converts the grey image into part versus background, and the threshold level shifts every edge by a fraction of a pixel. With a well-lit, high-contrast image this error is stable and calibrates out. With uneven illumination, the threshold shifts differently across the field and both position and angle drift. Fix the lighting first, then choose a fixed or adaptive threshold, and verify with a repeat-capture test on a stationary part.
Which feature points work best for angle measurement on chip components?
The two metal termination bands at the ends of a chip component are the usual choice: they are high-contrast, easy to segment, and far apart, which maximizes angular resolution. The midpoints of each termination edge give a clean long baseline. Body corners also work but sit on lower-contrast edges. For transistor and IC packages, use the body outline plus a polarity mark such as a dot or notch.



