System designExplainer

Machine vision focus preview zoom for precise focusing

Use machine vision focus preview zoom to inspect native pixels, distinguish display crops from camera ROI, and verify focus across the full image.

LumaSpec Vision9 min read Share on LinkedIn

On this page 9 sections
  1. 01Choose display-only enlargement first
  2. 02Calculate how much the preview hides
  3. 03Follow a repeatable focusing routine
  4. 04Separate visibility from captured resolution
  5. 05Distinguish viewer zoom from camera controls
  6. 06Choose hardware only when capture is the limitation
  7. 07Check the cases where center enlargement misleads
  8. 08Verify the setup before returning to inspection
  9. 09Questions

A full camera image squeezed into a small preview can hide the detail you need for precise manual focusing. Enlarging the center is usually a display task, not a reason to change the lens or camera acquisition settings. For inspection setup, the useful feature is a movable preview crop drawn from the original image buffer. You can then adjust focus at native pixel scale, inspect the corners, and return to the complete scene without changing the inspection image.

Choose display-only enlargement first

Use a preview viewer that can select a region from the acquired image and enlarge that region independently of acquisition. Keep the complete frame available to the inspection process.

The distinction matters because similar-looking controls can operate at different points in the image path:

Operation What changes What to check
Display crop and enlargement The portion and scale shown in the viewer Acquisition dimensions and saved images remain unchanged
Camera region of interest The sensor region delivered through acquisition Dimensions, offsets, calibration assumptions, and processing coordinates
Camera-side digital enlargement Device-dependent cropping or resampling Documented behavior and whether original detail remains available
Optical zoom or camera repositioning Optical coverage of the scene Field of view, focus, and calibration

A display crop does not change the scene projected onto the sensor. Lens focal length, sensor size, and working distance still determine the captured field of view.

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.

For the wider decision about cropping instead of changing optics, use the explanation of digital enlargement versus optical coverage. For focusing, the narrower goal is to see existing detail clearly, not to create additional detail.

Calculate how much the preview hides

Define preview scale as displayed pixels divided by source-image pixels along the same axis. When that scale is below one, several source pixels must contribute to fewer display pixels.

Preview scale = displayed width / source-region width Native-pixel view: preview scale = 1 Enlargement relative to fit view = new scale / fit-view scale

Consider a hypothetical acquired image measuring 4000 × 3000 pixels and a usable preview viewport measuring 1000 × 750 pixels. These are example image and viewport dimensions, not a hardware recommendation.

Fitting the whole image gives:

Fit-view scale = 1000 / 4000 = 0.25 Native-view enlargement relative to fit = 1 / 0.25 = 4

The fit view reduces four source pixels to one display pixel along each axis. Fine texture can become difficult to judge, even when the saved image contains useful detail.

Preview mode Source region Displayed region Display pixels per source pixel
Complete image fitted to viewport 4000 × 3000 pixels 1000 × 750 pixels 0.25
Native-pixel crop 1000 × 750 pixels 1000 × 750 pixels 1
Enlarged crop 500 × 375 pixels 1000 × 750 pixels 2

The native-pixel crop is therefore four times larger linearly than the fit view. Enlarging beyond that can make pixel transitions easier to inspect, but it adds no captured information.

Some applications define their zoom percentage relative to a fitted image rather than native pixels. Operating-system display scaling can introduce another difference. Verify the actual pixel mapping instead of relying only on a percentage label.

Follow a repeatable focusing routine

Keep the preview adjustment separate from acquisition and inspection configuration. A practical setup sequence is:

  1. Place the target at the inspection plane. Use representative part detail or a suitable focus target. A target at a different height can produce a misleading adjustment.
  2. Stabilize the image. Hold the target still and use enough light to obtain a clear exposure. If motion cannot stop, address motion blur before evaluating focus.
  3. Hold exposure and gain steady. Automatic brightness changes can make successive focus positions difficult to compare. Avoid saturated edges and heavily amplified noise.
  4. Select a central crop from the original frame. Use approximately one displayed pixel per source pixel as the starting point. Do not enlarge an already reduced preview image.
  5. Move through best focus in both directions. Pass the sharpest position slightly, then return. Compare the same edges or fine texture rather than unrelated parts of the scene.
  6. Pan to the inspection regions and corners. Check all locations that matter to the task, not just the center.
  7. Return to the complete image and save a frame. Confirm coverage and inspect the saved original independently of the preview.

Lock focus only after checking the required image regions, then verify that locking did not move the adjustment. The guide to focus and aperture locking screws explains why mechanical locking deserves a final image check.

If adjustment reaches its mechanical limit without producing a sharp image, more preview enlargement will not solve the problem. Follow the checks for a lens that focuses only at close distance before replacing parts.

Separate visibility from captured resolution

Preview enlargement helps you judge detail already present in the image. It cannot compensate for insufficient sampling, poor optical contrast, motion blur, or a target outside the useful focus range.

For a preliminary sampling check, relate field width to the smallest relevant feature:

Required horizontal pixels = field width × pixels across feature / feature width Object-space pixel size = field width / horizontal pixels

Suppose an inspection covers 120 mm horizontally and must represent a 0.12 mm feature with four pixels across it:

Required horizontal pixels = 120 mm × 4 / 0.12 mm = 4000 pixels Object-space pixel size = 120 mm / 4000 = 0.03 mm/pixel

Four pixels across a feature is an illustrative sampling target, not a universal detection or measurement requirement. Contrast, feature shape, processing, and acceptable uncertainty determine the actual requirement.

At the example fit-view scale of 0.25, that four-pixel feature occupies only one displayed pixel across. A native-pixel crop makes the captured sampling visible without changing it.

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

For the relationship between sensor sampling and magnification, use the explanation of calculating object-space pixel size. Treat sampling as necessary but not sufficient: a sharply displayed pixel grid does not prove the optics resolve the feature.

Distinguish viewer zoom from camera controls

A software interface can expose a zoom setting even when the connected device does not implement that function. Its presence in a programming interface does not establish support in the camera.

Use the manufacturer's documented feature list or acquisition interface to determine whether a setting changes a viewer, a sensor region, or a device processing stage. If a control is unsupported, implement the focus view in the display layer rather than repeatedly sending unsupported settings.

Compare a baseline capture with a capture made after changing the suspected zoom control. Record:

  • Acquired image width and height.
  • Region offsets, where available.
  • Whether peripheral scene features remain in the saved original.
  • Any change in frame timing or acquisition configuration.
  • Whether inspection coordinates still refer to the same image locations.

Unchanged image dimensions alone are not proof of display-only behavior. A device can crop and resample back to its original output size. The saved scene coverage and documented processing path also matter.

If camera region settings really must change, treat that as an acquisition change. Recheck downstream region definitions, calibration, and result coordinates before returning the inspection to service.

Choose hardware only when capture is the limitation

If the original saved frame is sharp but the preview is not, start with the viewer. Replacing a camera or lens is unlikely to correct an unnecessarily downsampled display path.

When acquisition itself needs revision, compare area scan cameras through the camera finder. Consider required sampling, motion, interface, and software compatibility separately from the preview feature.

The LS-CMR-0166 has a 4000 × 3000 resolution and a USB3 interface. Its catalog entry does not establish whether a particular viewer provides display-only enlargement.

Area scan cameras12 MP USB3 area scan camera, IMX226, 1/1.7" rolling shutter, 30 fps, 4000 × 3000 resolution (LS-CMR-0166)LS-CMR-0166
Sensor format
1/1.7"
Interface
USB3
Resolution
12 MP
Shutter
Rolling
$560.00View partBuild a system with it

For an optical limitation, compare machine vision lenses using the lens finder. Start with working distance, required coverage, sensor coverage, and mechanical fit rather than choosing a longer focal length simply to enlarge the preview.

The LS-FFL-0602 is an 8.5 mm, C-mount machine vision lens with a 1" sensor format. It is an optical selection example, not a matched-kit recommendation for the camera above.

Machine vision lenses8.5 mm, 1", 10 MP, C-mount machine vision lens (LS-FFL-0602)LS-FFL-0602
Type
Machine vision fixed
Sensor format
1"
Mount
C-mount
Resolution
6-10 MP
$429.00View partBuild a system with it

Check the explanation of lens sensor coverage before assuming that a mechanical connection establishes optical compatibility. Confirm the intended camera-and-lens combination independently.

Check the cases where center enlargement misleads

Center focus is a useful starting point, but it is not always the correct final adjustment. A tilted target, varying part height, field curvature, or insufficient depth of field can leave other inspection regions soft.

Likewise, a larger display can make noise, sharpening artifacts, and compression edges look like useful texture. Compare representative fine detail under consistent settings. For manual judgment, nearest-neighbor enlargement exposes the pixel structure; smoother interpolation may look cleaner but can conceal small differences.

A preview created from an already reduced stream cannot reveal detail discarded before display. Request a crop from the original-resolution buffer where the software permits it. If the preview and saved image use different processing paths, compare them before accepting focus.

Finally, the sharpest stationary frame does not establish performance on moving parts. Verify focus again with production exposure, lighting, motion, and target height.

Verify the setup before returning to inspection

Use this short acceptance checklist:

  • Original frame preserved: preview enlargement does not alter the image delivered to inspection.
  • Pixel mapping understood: native-pixel view is verified rather than inferred from a zoom label.
  • Relevant regions checked: the center, corners, and actual inspection features meet the task's needs.
  • Mechanical adjustment stable: focus remains acceptable after locking and normal handling.
  • Production capture verified: representative moving parts remain sufficiently sharp at the intended exposure.
  • Normal view restored: operators can recover the complete scene without changing acquisition settings.

If the saved frame already contains the required detail, make the preview change and retain the optical setup. If capture remains inadequate, start with the lens configuration workflow, or request application support with the original image, field width, working distance, and smallest relevant feature.

Questions

Does enlarging the focus preview change the field of view?

Display-only enlargement preserves the captured optical field of view and changes only what the viewer shows. Camera-side cropping can remove peripheral coverage from the delivered image. Check an original saved frame and the acquisition configuration to determine which operation your control performs.

What preview magnification is useful for manual focusing?

Start with one displayed pixel per source-image pixel. Enlarge further if pixel transitions are difficult to see, but recognize that additional enlargement only spreads existing information over more display pixels. Confirm how your viewer defines zoom percentages and handles display scaling.

Why does the image remain soft after preview enlargement?

The viewer may be enlarging a reduced preview stream rather than accessing the original image. Alternatively, the acquisition may contain defocus, motion blur, or inadequate optical detail. Compare an original-resolution saved frame with the preview before changing the lens or camera.

Should a camera region of interest be used for focusing?

A camera region of interest can be useful when transfer or processing limits prevent a responsive full-frame preview. It also changes the delivered image region and may affect downstream coordinates. Prefer display-only cropping when you need to preserve the existing inspection configuration.

Is checking focus at the center sufficient?

No. Inspect every region used by the application, including relevant corners and different part heights. A sharp center can coexist with soft edges or out-of-focus raised features. Complete the final check using production lighting, exposure, motion, and representative parts.