Cameras & sensorsHow-to

Simulated camera resolution and pixel scale: set the FOV right

Set a simulated camera's field of view and pixel scale from focal length, sensor size and working distance, and capture full resolution without a huge window.

LumaSpec Vision7 min read Share on LinkedIn

On this page 7 sections
  1. 01Derive the field of view from the optics
  2. 02Worked example: 50 mm at 523 mm on a 12 MP sensor
  3. 03Keep the preview window at screen size
  4. 04Capture full-resolution images without a live window
  5. 05Verify the model before ordering hardware
  6. 06From model to hardware
  7. 07Questions

Simulating a vision cell before the cameras arrive is the right order of work, and it breaks in a predictable place: the view window opens at the buffer size. A 4024 × 3036 simulated camera floods a 1920 × 1080 screen, and every API grab re-opens that oversized window until the tool hangs and must be restarted. The fix is to separate optics from display. This guide derives the field of view and pixel scale from focal length, sensor size and working distance, keeps the preview at screen size, and captures full-resolution images headlessly — so the station you validate is the station you order, cameras included.

Derive the field of view from the optics

The simulation needs four inputs, not a format name: focal length f, working distance WD, buffer resolution and pixel pitch. A 1/1.7" label is a size class, not an active area — compute the width from the buffer: 4024 pixels at 1.85 µm span 7.44 mm, 3036 pixels span 5.62 mm. With f and WD in the same units, the exact thin-lens relations are:

m = f / (WD - f) FOV = active sensor width / m object pixel scale = pixel pitch / m

Use the exact form whenever the magnification m exceeds about 0.05. The pinhole shortcut FOV ≈ width × WD/f overstates the field by m itself: 5% out at m = 0.05, 10% out at 0.10. The same geometry drives real lens picks — it is the working distance and field of view formula, and object-space pixel size from magnification tabulates the scale relation.

Worked example: 50 mm at 523 mm on a 12 MP sensor

Inputs: f = 50 mm, WD = 523 mm, buffer 4024 × 3036, pitch 1.85 µm.

  • Active area: 4024 × 1.85 µm = 7444 µm = 7.44 mm wide; 3036 × 1.85 µm = 5617 µm = 5.62 mm high; diagonal sqrt(7.44² + 5.62²) = 9.33 mm — the 1/1.7" class in real numbers.
  • Magnification: m = 50 / (523 - 50) = 50 / 473 = 0.1057.
  • Field of view: 7.44 / 0.1057 = 70.4 mm wide; 5.62 / 0.1057 = 53.1 mm high.
  • Pixel scale: 70.4 mm / 4024 px = 17.5 µm per object pixel. Cross-check: 1.85 µm / 0.1057 = 17.5 µm — 57 pixels per millimetre on the part.
  • Shortcut check: 7.44 × 523 / 50 = 77.9 mm, 10.6% too wide — the m-sized error predicted above.

Enter FOV 70.4 × 53.1 mm at 523 mm and the 4024 × 3036 buffer; every length the simulation then reports reads in true scale.

Lens focal length, field of view and working distance
Units
Solve for
Focal length
– mm
Field of view
– mm
Working distance
– mm
Magnification
– x
Angle of view
– °
Pixel on the part
– mm

Thin-lens model: m = sensor width / field of view, f = WD × m / (1 + m). Accurate to a few percent above about 150 mm; check the lens's minimum object distance.

Find lenses with this focal length Open the full calculator

The calculator runs this focal-length and FOV relation, and its button filters machine vision lenses to the focal length you need.

Keep the preview window at screen size

A 4024 × 3036 view holds 12.2 million pixels against 2.07 million on a 1920 × 1080 screen — 5.9 times more than the display has, which is the whole lag. Set each view window to a fixed screen-sized value and let the tool scale the buffer into it: at 1920 × 1080 the frame fits at 36% (1080 / 3036); at 960 × 540 it fits at 24%, leaving room for a camera grid. The buffer stays 4024 × 3036; scaling touches only what is drawn. If the camera properties offer an 'Allow Resize' checkbox, that governs dragging the window after it opens — it does not shrink the initial size, so set the window dimensions explicitly.

Capture full-resolution images without a live window

  1. Create the camera with the optics: f = 50 mm, WD = 523 mm, active area 7.44 × 5.62 mm, buffer 4024 × 3036.
  2. Frame a 70 × 53 mm rectangle at 523 mm. It should fill the view edge to edge; if it does not, the FOV field is wrong, not the rectangle.
  3. Fix each view window explicitly at 1920 × 1080, or 960 × 540 in a multi-camera grid, so no buffer size ever resizes the display.
  4. Grab in snapshot mode — the SNAPSHOT option of the simulator's camera-add call — which writes the image to file or buffer without opening a live view.
  5. Where your tool insists on a view, open it minimized (the MINIMIZED option) and read the image from the buffer.
  6. For a seven-camera station, keep one handle per camera, snapshot in sequence, and reopen any closed view with setParam('Open', 1) before its next grab. Confirm each returned image is 4024 × 3036; full resolution is the point.

Verify the model before ordering hardware

  • Field: the 70.4 × 53.1 mm rectangle fills the frame at 523 mm, and a measured bar reads 70.4 mm exactly. The geometry is closed-form, so any mismatch is a set-up typo, not model error.
  • Scale: a 1 mm feature spans 57 pixels. A feature needs 3-5 pixels of sampling, so this set-up resolves 53-88 µm details; a 20 µm defect is out of reach. Close the gap with a shorter working distance, tighter framing or more pixels — the trade-offs are in small-pixel camera selection: resolution versus usable detail.
  • Coverage: the lens you buy must cover the 9.33 mm diagonal; apply the margin logic from calibration target field of view and lens coverage margins.
  • Motion: rolling shutter skews parts that move during exposure — if parts travel under the camera, plan a global-shutter model or a strobed flash.

From model to hardware

The catalog part behind the simulation: the LS-CMR-0053 is a 12 MP GigE area scan camera on a 1/1.7" rolling-shutter IMX226 sensor, and the LS-CMR-0166 carries the same 1/1.7" 12 MP sensor on USB3 at 30 fps:

Area scan cameras12 MP GigE area scan camera, IMX226, 1/1.7" rolling shutter, 9 fps (LS-CMR-0053)LS-CMR-0053
Sensor format
1/1.7"
Lens mount
C-mount
$560.00View part
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
$560.00View part

For the lens, set the lens finder to 50-100 mm focal length at 12 MP resolution so the purchased optic reproduces the simulated field; the focal-length chooser walks that decision. Where the cell wants a compact short focal length instead, the LS-FFL-0567 is a 16 mm, C-mount lens for a 1.1" format, rated 20 MP with F2.8-22 and <0.3% distortion on a 16-22 mm image circle. That circle clears the simulated 9.33 mm diagonal with margin.

Machine vision lenses16 mm, 1.1", 20 MP, C-mount machine vision lens, F2.8-22, <0.3% distortion (LS-FFL-0567)LS-FFL-0567
Type
Machine vision fixed
Sensor format
1.1"
Mount
C-mount
Resolution
16-25 MP
$679.00View partBuild a system with it

Carry the three results to the counter — FOV 70.4 × 53.1 mm, buffer 4024 × 3036, scale 17.5 µm per pixel. The camera step of the configurator filters area scan cameras to models that match those numbers. If the field of view changes, rerun the three formulas before you shop — two minutes of arithmetic against days of rework; for anything unusual, talk to the applications team.

Questions

Does the 1/1.7" format name give the exact sensor size?

No — it is a size class. Compute the active area from the buffer: 4024 pixels × 1.85 µm = 7.44 mm wide and 3036 × 1.85 µm = 5.62 mm high, a 9.33 mm diagonal. Nominal formats exist because aspect ratios vary; pixels times pitch is the number your FOV and scale math needs, and the one to enter in the simulator.

What defect size can this simulated set-up resolve?

At 17.5 µm per object pixel, the 3-5 pixel sampling rule puts reliable detail at 53-88 µm; anything below about 53 µm is undersampled. A 20 µm defect spec needs a pixel scale near 4-7 µm, which means a much shorter working distance, tighter framing or a higher-resolution sensor with a matching lens — rerun m, FOV and scale before committing.

How do I show seven simulated cameras on one screen?

Give each view a quarter-window of 960 × 540 on a 1920 × 1080 display: the 4024 × 3036 buffer scales to 24% and four views tile with room for the rest, or use 640 × 360 tiles — three across, three down — for all seven at once. Acquisition never changes: each camera still returns its full 4024 × 3036 image through the snapshot path.

Should the simulated camera use a global shutter?

The simulation itself is shutter-blind, so decide before ordering hardware. Rolling shutter reads lines in sequence and skews anything that moves during exposure; a part travelling fast enough to shift a fraction of a pixel between readout lines distorts. Keep rolling for static parts, choose global shutter or a short strobed flash for motion — both cameras featured above are rolling shutter, so note it in the hardware review.