Lenses & opticsExplainer

Calculate object space pixel size from magnification

Calculate object space pixel size from sensor pitch and magnification, compare field of view, and check what limits dimensional accuracy.

LumaSpec Vision9 min read Share on LinkedIn

On this page 10 sections
  1. 01Calculate object space pixel size by dividing by magnification
  2. 02Understand what increasing magnification changes
  3. 03Connect sampling to field of view and pixel count
  4. 04Separate sampling from measurement accuracy
  5. 05Choose optics for the required measurement plane
  6. 06Verify the installed scale with a dimensional reference
  7. 07Account for binning, cropping and resized images
  8. 08Check the design before ordering
  9. 09Recognize when one scale value is not enough
  10. 10Questions

A camera pixel has a fixed physical pitch on the sensor, but the area it samples on the part depends on optical magnification. Confusing these quantities can produce an incorrect lens choice or an unrealistic measurement specification. For dimensional inspection, start by calculating object-space sampling, then check field of view, optical detail and calibration. You will be able to distinguish what each pixel represents from how accurately the complete system can measure.

Calculate object space pixel size by dividing by magnification

Optical magnification is the ratio of an image dimension at the sensor to the corresponding object dimension. Use its positive magnitude for these sizing calculations. Magnification is dimensionless, so dividing sensor pixel pitch by magnification preserves the pitch unit.

m = image dimension / object dimension s = p / m m = optical magnification p = sensor pixel pitch s = object-space sampling interval

For a hypothetical sensor with a 2 µm pixel pitch and a lens operating at 0.8x magnification:

s = 2 µm / 0.8 s = 2.5 µm per pixel

Each neighboring pixel center therefore corresponds to a nominal 2.5 µm displacement across the object plane. The sensor pixels themselves remain 2 µm apart. The lens changes the relationship between the object and its image, not the physical construction of the sensor.

The calculation describes sampling at a particular object plane and optical configuration. It does not establish the smallest detectable defect, the resolved line spacing or the measurement uncertainty.

Understand what increasing magnification changes

Higher optical magnification spreads the same object feature across more sensor pixels. Consequently, each pixel represents a smaller distance on the object, while the field of view becomes smaller.

The following comparison uses a hypothetical 2 µm sensor pitch and 4,000 active pixels across the image. These are example inputs, not specifications for a catalog product.

Optical magnification Object-space sampling Horizontal field of view
0.4x 5 µm per pixel 20 mm
0.8x 2.5 µm per pixel 10 mm
1.6x 1.25 µm per pixel 5 mm

Doubling magnification halves both the object-space sampling interval and the field width when the sensor remains unchanged. It also doubles the pixel span of a feature that stays in the object plane.

How sensor width, working distance and field of view set the focal length Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.CameraField of view (FOV)Working distance (WD)≈ fsensor width slensm = s / FOVf = WD × m / (1 + m)
How sensor width, working distance and field of view set the focal length. Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.

Magnifying an image on a display is different. Enlarging a captured image does not recover additional object detail. For conventional lenses, changing focus or working distance can also change magnification. Treat a nominal lens setting as a starting point, then measure the installed scale.

For the relationship between sensor dimensions, working distance and conventional optics, use the guide to choosing a machine vision lens focal length.

Connect sampling to field of view and pixel count

Field of view follows directly from sampling and the number of active pixels. Use the active acquisition dimensions, rather than the size of a display window or an exported preview.

Sensor width = horizontal pixel count × sensor pixel pitch Object field width = sensor width / magnification Object field width = horizontal pixel count × object-space sampling Required horizontal pixels = required field width / target sampling

Suppose the hypothetical sensor has 4,000 × 3,000 active pixels, each with a 2 µm pitch. Its active dimensions are:

Sensor width = 4,000 × 2 µm = 8,000 µm = 8 mm Sensor height = 3,000 × 2 µm = 6,000 µm = 6 mm At 0.8x magnification: Field width = 8 mm / 0.8 = 10 mm Field height = 6 mm / 0.8 = 7.5 mm

Now consider a requirement to represent a 10 µm feature with four pixels across its width. That chosen sampling target is 10 µm / 4 = 2.5 µm per pixel. Covering a 10 mm field then requires 10,000 µm / 2.5 µm = 4,000 horizontal pixels.

Four pixels is a design assumption here, not a universal detection or measurement guarantee. Required sampling depends on contrast, feature shape, optical blur and the algorithm. The guide to camera resolution for dimensional inspection explains how to develop that requirement.

Camera resolution for the smallest feature
Units
Pixels needed
–
Sensor size
– MP
Smallest sensor that fits
–
Pixel on the part
– mm
Pixels across the feature, that sensor
–

Pixels needed = field / feature × pixels per feature on each axis (field incl. margin). The lens must resolve the pixels too: Nyquist = 1000 / (2 × pixel µm) lp/mm.

Find cameras with enough pixels Open the full calculator

Use area scan cameras and the camera finder to investigate sensor options after defining the required field and sampling. Verify actual pixel pitch and active dimensions in the selected camera's documentation; a megapixel label alone is insufficient.

Separate sampling from measurement accuracy

A sampling interval is a coordinate conversion, not an accuracy specification. At 2.5 µm per pixel, an algorithm may estimate an edge between pixel centers. That does not mean its reported position is correct to the same fraction under every operating condition.

Several different limits contribute to the final measurement:

  • Optical blur reduces edge contrast and merges nearby features.
  • Noise changes the estimated edge location between captures.
  • Distortion makes image scale depend on position.
  • Part-height changes can alter magnification with conventional optics.
  • Lighting and surface finish can move the apparent edge.
  • Calibration uncertainty and mechanical movement add further error.

For example, a repeatability of 0.2 pixel corresponds to 0.2 × 2.5 µm = 0.5 µm at the object. This describes repeated observations under the tested conditions. It does not include an unknown scale bias or establish traceable accuracy.

A separate scale error of 0.1% across a 10 mm measurement contributes 10 mm × 0.001 = 0.01 mm, or 10 µm. A system can therefore have stable subpixel readings while retaining a much larger dimensional bias.

Do not add these example quantities into an uncertainty total without defining their statistical meaning and dependence. Instead, test repeatability, scale error and position-dependent error separately. The discussion of vision guided positioning accuracy limits develops this distinction further.

Choose optics for the required measurement plane

Conventional machine vision lenses can suit inspections where the part remains in a controlled plane. Their magnification depends on the optical setup, so calculate the approximate configuration and verify its scale after focusing.

Object-side telecentric lenses reduce perspective-related magnification changes as the object moves within their specified operating range. They are useful when dimensional measurements must tolerate some part-height variation. They do not provide unlimited depth of field or eliminate every calibration error.

Perspective with a standard lens compared with a telecentric lens Left: the same part at two distances appears at two sizes through a standard lens. Right: a telecentric lens accepts only rays parallel to its axis, so the part appears the same size at both distances.Standard lensfarnearsensorThe same part looks bigger when nearer:its measured size depends on distanceTelecentric lensOnly rays parallel to the axis enter:the same size at any distance
Perspective with a standard lens compared with a telecentric lens. Left: the same part at two distances appears at two sizes through a standard lens. Right: a telecentric lens accepts only rays parallel to its axis, so the part appears the same size at both distances.

The distinction between telecentricity, distortion and focus matters more than the label alone. Read telecentric lens distortion and telecentricity explained when assigning limits to height sensitivity and field-dependent scale.

The LS-TCL-0651 is an object-side telecentric lens with 0.66x magnification, 110 mm working distance and 1" sensor format.

Telecentric lensesObject-side telecentric lens, 0.66x, 110 mm WD, 1" (LS-TCL-0651)LS-TCL-0651
Sensor format
1"
Mount
C-mount
Image circle
11-16 mm
Type
Object-side telecentric
$969.00View partBuild a system with it

The LS-TCL-2118 is an object-side telecentric lens with 1x magnification, 108 mm working distance, 2/3" sensor format and C-mount.

Telecentric lenses1x, WD 108 mm, 2/3", C-mount telecentric lens (LS-TCL-2118)LS-TCL-2118
Sensor format
2/3"
Mount
C-mount
Image circle
8-11 mm
Type
Object-side telecentric
$1,239.00View partBuild a system with it

These are separate starting points, not interchangeable recommendations. Compare sensor coverage, mount, working distance and the required object field before selecting either. The lens finder helps narrow those requirements, while the guide to lens sensor format explains why nominal format compatibility needs checking.

Verify the installed scale with a dimensional reference

The nominal calculation is useful for selection. Calibration establishes the relationship used by the finished inspection station.

  1. Place a suitable dimensional target in the actual measurement plane. Keep it flat and aligned with the inspection geometry.
  2. Set the final focus, aperture, acquisition region and processing configuration. Avoid changing them after calibration without checking scale again.
  3. Measure the image span of a known target distance. Use a reference long enough that a small endpoint error does not dominate the calculation.
  4. Repeat the measurement near the center and edges of the usable field. A changing scale may require distortion correction or a spatial calibration model.
  5. Capture repeated images, then remove and replace the target where practical. This separates image repeatability from fixture repeatability.

For an illustrative calibration, a known 5 mm interval spanning 2,000 pixels gives:

Measured object-space scale = known distance / measured pixel span Measured object-space scale = 5,000 µm / 2,000 pixels Measured object-space scale = 2.5 µm per pixel

Agreement with the nominal calculation is a useful check, but one interval does not validate the whole field. Use additional distances, positions and orientations representative of the measurements you will make.

The guide to camera calibration for length measurement covers reference-based scaling. Leave sufficient target coverage and positioning margin using the guidance on calibration target field of view and lens coverage margins.

Account for binning, cropping and resized images

Always identify which image coordinates your measurement software receives. Native sensor pixels and processed image pixels are not necessarily equivalent.

With an original sampling interval of 2.5 µm per pixel, an output formed by 2 × 2 binning has a nominal 5 µm spacing between neighboring output samples along each axis. Confirm the camera's documented implementation and output dimensions before applying that conversion.

Cropping alone preserves sampling: it removes coverage without changing the spacing between retained pixel centers. Resizing to half the original width and height instead produces an output spacing of 5 µm per pixel in this example.

Upsampling adds interpolated samples, not new optical information. Undistortion and perspective transformations may also change local scale or assign a new output coordinate system. Calibrate the image that the measurement algorithm actually uses, or explicitly maintain the transformation back to calibrated coordinates.

The guide to antialiasing when downsampling or warping images explains why resampling can change feature appearance as well as coordinate spacing.

Check the design before ordering

Use this short checklist to turn a nominal sampling calculation into a defensible specification:

  • Confirm sensor pixel pitch from the camera documentation, rather than inferring it from a nominal sensor format.
  • Define the smallest relevant feature and the required measurement uncertainty separately. They answer different design questions.
  • Include part-position variation in the required field of view, not just the nominal part dimensions.
  • Check lens image-circle coverage and mechanical mount compatibility with the selected camera.
  • Confirm working distance, focus access and clearance around the part and fixture.
  • Evaluate edge contrast at the intended aperture, illumination and exposure conditions.
  • Record acquisition dimensions, binning, cropping and every image-resizing operation.
  • Plan calibration checks across the field and through the permitted part-height range.

A useful acceptance record includes the nominal scale, calibrated scale, repeated-measurement spread and maximum observed dimensional error. Keep these values separate so later changes can be diagnosed rather than hidden inside one accuracy claim.

Recognize when one scale value is not enough

A single object-space pixel size works best for a defined plane with controlled geometry. A tilted surface can have different scale along different directions. A three-dimensional part may present features at several depths, and a conventional lens may assign them different magnifications.

Likewise, residual distortion can make a center-calibrated scale unsuitable near the image boundary. In these cases, use an appropriate geometric calibration, telecentric optics within their specified limits, or a measurement method that accounts for depth.

Start with sensor pitch divided by magnification, but accept the system only after checking actual dimensional performance. Take your field of view, sensor dimensions, working distance and uncertainty target to the lens configurator. If the measurement plane or height variation remains uncertain, use application support to review those constraints before choosing optics.

Questions

How do you calculate object space pixel size?

Divide sensor pixel pitch by optical magnification. A hypothetical 2 µm sensor pitch used at 0.8x magnification gives 2 / 0.8 = 2.5 µm per pixel at the object. Keep the pitch units consistent and use magnification at the actual measurement plane.

Does increasing magnification make the sensor pixels larger?

No. The sensor's physical pixel pitch remains fixed. Increasing optical magnification makes a given object feature cover more sensor pixels, so each pixel represents a smaller object distance. Enlarging the displayed image is different because it changes presentation without adding captured detail.

Does object-space sampling determine measurement accuracy?

Not by itself. Sampling describes the distance between object-space samples, while accuracy also depends on optics, contrast, noise, calibration, mechanics and the measurement algorithm. Subpixel edge estimates can improve position repeatability, but their dimensional accuracy must be verified against an appropriate reference.

Does cropping or resizing change the measurement scale?

Cropping without resampling preserves the spacing of retained samples and reduces only the covered area. Resizing changes the coordinate spacing in the output image. Any measurement performed after resizing must use an updated scale or a documented transformation back to the calibrated image coordinates.

Is a telecentric lens always required for dimensional measurement?

No. A conventional lens can work when the measurement plane and part position are sufficiently controlled. Telecentric optics become useful when perspective and height-dependent magnification would otherwise exceed the error budget. Check field coverage, working distance, focus limits and calibration requirements before selecting either approach.