System designApplication note

High speed whisker tracking: optics, light and latency

Plan high speed whisker tracking with two cameras: calculate feature sampling, motion blur, lighting needs and tracking latency before selecting parts.

LumaSpec Vision10 min read Share on LinkedIn

On this page 11 sections
  1. 01Define what the close-up must measure
  2. 02Calculate pixels across a whisker first
  3. 03Separate frame rate from exposure time
  4. 04Coordinate the overview and close-up cameras
  5. 05Turn field margin into a latency budget
  6. 06Choose optics and camera candidates against acceptance gates
  7. 07Build lighting around contrast and approved exposure
  8. 08Validate capture, timestamps and fine-feature visibility
  9. 09Know when pan-tilt is the wrong architecture
  10. 10Check the design before ordering
  11. 11Questions

A sharp view of the maze does not guarantee a useful recording of whiskers. The close-up camera must keep individual features visible while the head moves, the whiskers sweep and the tracking mechanism changes direction. More megapixels cannot compensate for blur or a head leaving the image.

For a two-camera research setup, begin with feature sampling and acceptable motion blur, then calculate how much tracking delay the close-up view can tolerate. This separates requirements for the overhead tracker, close-up optics, illumination, motion control and recording system before you select hardware.

Define what the close-up must measure

Write the measurement objective before choosing a camera. Detecting the whisker envelope, locating individual shafts and reconstructing their curvature require different images. A feature that is visible as a faint line may still be unsuitable for repeatable centerline measurement.

Record these application requirements:

  • The smallest whisker diameter or separation that matters, measured from representative specimens or reference images.
  • The head region that must remain visible, including useful whisker length.
  • Maximum head displacement, depth change and orientation change during the task.
  • Required temporal detail, recording duration and acceptable missing frames.
  • Permitted illumination and mechanical arrangements under the approved animal-care protocol.

Treat animal-motion values as measurements, not generic constants. Every numerical example below is an illustrative design assumption, not a biological specification.

The sports tracking camera selection guide explains the broader trade between reach, image detail and motion. Here, the additional constraint is coordinating a wide tracking view with a much narrower measurement view.

Calculate pixels across a whisker first

For a roughly planar view, object-space sampling follows directly from field width and horizontal pixel count:

Object-space pixel size = field width / horizontal pixels Pixels across a feature = feature width / object-space pixel size

Suppose the illustrative feature width is 40 µm. Across a 60 mm field recorded with 2,400 horizontal pixels:

Pixel size = 60 mm / 2,400 = 0.025 mm/pixel Feature sampling = 0.040 mm / 0.025 mm/pixel = 1.6 pixels

That is a fragile basis for distinguishing neighboring shafts or estimating width. Contrast, focus, subpixel position and the lens transfer function can all change apparent visibility.

Narrowing the field to 30 mm with 3,000 horizontal pixels gives:

Pixel size = 30 mm / 3,000 = 0.010 mm/pixel Feature sampling = 0.040 mm / 0.010 mm/pixel = 4 pixels

Four pixels across the assumed feature is a reasonable starting test condition, not an accuracy guarantee. Verify the actual measurement against representative images, especially where whiskers overlap or leave the focus plane.

Use the object-space pixel size explanation to connect this calculation to magnification. The camera resolution guide for dimensional inspection explains why nominal pixel count alone is insufficient.

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

Keep pixels allocated to the usable field, rather than counting pixels later discarded by cropping or stabilization. A generous tracking margin and fine feature sampling compete for the same sensor width.

Separate frame rate from exposure time

Frame rate determines how often you sample motion. Exposure determines how far a feature moves within each sample. A camera can deliver many frames while every frame remains blurred.

At 100 fps, frames begin approximately 10 ms apart. At 200 fps, that interval becomes 5 ms. Neither interval establishes a suitable exposure.

For motion approximately parallel to the image plane:

Blur in pixels = apparent image speed × exposure time Maximum exposure = allowed blur / apparent image speed

Assume a projected feature speed of 600 mm/s and the earlier sampling of 0.010 mm/pixel:

Image speed = 600 mm/s / 0.010 mm/pixel = 60,000 pixels/s Exposure for 0.5-pixel blur = 0.5 / 60,000 = 8.3 µs

This exposure is much shorter than the frame interval. The exposure and moving-part inspection guide develops the same distinction.

Measure apparent image speed during tracking, because camera rotation can add motion even when the head is nearly stationary. For an illustrative 20 Hz periodic component, 100 fps supplies five samples per cycle and 200 fps supplies ten. Faster transients and trajectory fitting may require more; meeting the basic sampling limit does not guarantee useful shape reconstruction.

Coordinate the overview and close-up cameras

The overview camera supplies target position. The close-up camera supplies fine detail. They need not use the same frame rate, resolution or exposure, but their measurements must share a usable time reference.

Do not assume that an overhead body centroid identifies the head. Heading, posture and partial occlusion can move the desired aim point away from that centroid. Track a head landmark directly where possible, or measure the error introduced by a body-position estimate.

A practical signal chain is:

  1. Timestamp the overview exposure.
  2. Locate the target and estimate tracking confidence.
  3. Transform the target position into the motion system's coordinate frame.
  4. Predict target position at the expected actuation time, where prediction has been validated.
  5. Command motion within documented travel and speed limits.
  6. Record close-up frames with timestamps and tracking metadata.

An overview pixel-to-maze calibration is only part of the geometry. The pan-tilt pivot, camera offset, lens distortion and target height also affect pointing. A mapping calibrated at one height can miss a raised head.

The camera extrinsic calibration accuracy guide explains why a small image-space calibration residual does not establish accurate positioning throughout the workspace. Validate pointing at multiple locations and heights using a nonliving target before introducing the animal.

Turn field margin into a latency budget

The close-up field must contain both the required head region and tracking error. Along one image axis, a simple centered margin estimate is:

Available margin = (usable field width − required region width) / 2 Delay displacement ≈ target speed × end-to-end delay

For a 30 mm usable field and a required region 20 mm wide:

Available margin = (30 mm − 20 mm) / 2 = 5 mm

At an assumed head speed of 200 mm/s, a 30 ms delay produces:

Delay displacement = 200 mm/s × 0.030 s = 6 mm

The delay error alone exceeds the available margin. A higher close-up frame rate does not correct this pointing problem.

At 12 ms, the same estimate becomes 2.4 mm. Reserving another 1 mm for calibration and landmark error leaves 1.6 mm for other effects, including actuator lag and prediction error. This illustrates a budget; real errors may be correlated and should be measured together.

Include overview exposure timing, readout, transfer, processing, queues, command transport and mechanical response. Measure the distribution of end-to-end delay, not just its average. Direction reversals and occlusions often reveal failures hidden by steady-motion trials.

Prediction can reduce lag during smooth movement, but acceleration can invalidate it. Define what happens when tracking confidence falls: stop chasing uncertain coordinates, retain the overview recording and flag the close-up interval as unreliable.

Choose optics and camera candidates against acceptance gates

Start with area scan cameras and use the camera finder to narrow shutter type, interface and sensor format. A global shutter avoids row-dependent exposure timing during motion, but it does not eliminate blur or guarantee the required frame rate.

The MV-CH120-11UC is a global-shutter candidate for evaluation, not a confirmed selection for this recording requirement.

Area scan camerasHikrobot MV-CH120-11UC 12 MP Area Scan Camera, USB3, IMX304, High-speed version, ColorMV-CH120-11UC
Sensor format
1.1"
Lens mount
C-mount
Interface
USB3
Resolution
12 MP
$2,339.00 · quotedView and quoteBuild a system with it

The supplied catalog information does not establish the required acquisition rate for this candidate. Before ordering, obtain confirmation of sustained frame rate at the intended image dimensions, pixel format, exposure and trigger mode. If those conditions cannot be confirmed, select another camera rather than assuming a reduced image region will solve the problem.

For machine vision lenses, establish image-circle coverage, mount compatibility, working distance and minimum focusing distance. The lens finder helps narrow candidates, but the required field must still be checked at the actual focus setting.

The LS-FFL-0567 is an optics candidate to assess for coverage, focus range and mechanical clearance.

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

These candidates are not a validated matched kit. A lens that covers the sensor may still fail to focus closely enough or leave sufficient clearance around the task.

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.

Depth changes deserve a separate test. Stopping down can increase usable depth of field, but reduces collected light and eventually makes diffraction more significant. Verify feature visibility at the nearest and farthest expected whisker positions, not only at the center focus plane.

Build lighting around contrast and approved exposure

Choose illumination by the image contrast it produces within the permitted exposure conditions. A bright background behind a thin feature can create a useful silhouette, but only where the geometry keeps that background behind the measurement region. Oblique reflected light may work elsewhere, with greater sensitivity to orientation and background texture.

Adjustable bar lights provide useful bench-test geometries. Use the lighting finder to compare size, diffusion and emission options after establishing the required contrast.

The LS-BAR-1276 and LS-BAR-1047 are lighting candidates for evaluating different illumination arrangements.

Bar lightsBar light, 372 x 28 mm, White (LS-BAR-1276)LS-BAR-1276
Size
200-400 mm
Type
Diffused
$439.00View part
Bar lights290 x 30 mm LED bar light (LS-BAR-1047)LS-BAR-1047
Size
200-400 mm
Type
Standard
$449.00View part

The catalog information does not establish irradiance at the animal, biological suitability or permitted pulse operation. Measure illumination in the actual geometry and obtain the required protocol approval. Do not assume that an invisible wavelength is behaviorally neutral or safe.

Where pulsed operation is permitted and supported, specify the light driver or controller alongside the camera. Confirm electrical compatibility, allowed pulse duration, repetition rate, duty cycle and trigger timing from the relevant documentation. Never overdrive a light without explicit support.

A commanded pulse is not necessarily a rectangular optical pulse. The optical rise-time guide explains how to measure usable light during a short exposure. If using continuous illumination, test image variation across the complete recording to detect flicker or modulation.

Validate capture, timestamps and fine-feature visibility

Test the complete acquisition pipeline before connecting tracking performance to biological measurements. For an illustrative uncompressed stream:

Payload rate = pixels per frame × bytes per pixel × frames per second Payload rate = 3,000 × 2,000 × 1 × 200 Payload rate = 1,200,000,000 bytes/s ≈ 1.2 GB/s

This is an application estimate, not a specification for any candidate above. It excludes transport overhead and assumes one stored byte per pixel. Different packing and storage formats change the requirement.

The high-speed recording guide covers sustained acquisition and storage checks. Distinguish exposure timestamps from host arrival times; queued frames can arrive late while retaining their original capture timing.

Use a staged validation sequence:

  1. Image a stationary fine-feature target at every intended focus depth.
  2. Move that target through known trajectories with the close-up camera fixed.
  3. Repeat while operating the tracking mechanism.
  4. Log timestamps, frame identifiers, tracking confidence and pointing error.
  5. Compare raw images against the measurement output, especially during reversals.

The timestamp-based frame matching guide is useful when tracking messages and close-up images travel through separate queues. Do not assume matching frame counts establish synchronization.

Know when pan-tilt is the wrong architecture

Mechanical tracking is useful only when its errors fit inside the available field and blur budgets. Compare alternatives before committing to a moving camera.

Architecture Useful when Main limitation to test
Fixed close-up observation zone The task naturally brings the head into a known region Limited coverage of behavior elsewhere
Fixed wider view with software cropping Fine features remain adequately sampled across the wider field Cropping cannot restore missing optical detail
Pan-tilt close-up camera Target motion is predictable enough for the available margin Delay, vibration and changing viewpoint
Several fixed close-up views Multiple viewpoints are acceptable to the experiment Occlusion, synchronization and additional data

Software stabilization can improve presentation or simplify analysis, but cannot recover features blurred during exposure. Likewise, a wider lens solves some pointing failures by sacrificing pixels across each whisker.

If close-up quality collapses only during steering, measure vibration and apparent image speed before increasing resolution. If visibility fails while stationary, fix focus, sampling or contrast first. These are different failure modes and need different remedies.

Check the design before ordering

Use this short acceptance checklist to close the main risks:

  • Sampling: representative whiskers remain measurable at the worst field position and depth.
  • Exposure: motion blur stays within the chosen pixel allowance during head and camera movement.
  • Timing: sustained acquisition meets the required rate at the intended image dimensions and format.
  • Pointing: measured error stays inside the usable margin during acceleration, reversal and reacquisition.
  • Lighting: contrast is adequate within approved illumination conditions and documented operating limits.
  • Recording: a full-duration trial preserves frame identifiers, timestamps and required metadata.
  • Mechanical safety: mounts, travel limits and cable routing keep moving hardware clear of the animal and task area.

Use the lens and lighting test plan to organize sample images and acceptance criteria. Keep the successful raw recordings, not just processed overlays, as the reference for later changes.

Bring your measured field width, smallest feature, speed estimate, exposure limit, tracking-delay budget and recording duration to application support. Then use the camera configuration starting point to assemble candidates against those requirements rather than selecting by megapixels and frame rate alone.

Questions

Is a megapixel camera enough to record individual whiskers?

No. Pixel count only becomes meaningful after you specify the field of view and smallest feature. A narrow view may resolve a whisker well but be difficult to track. Check pixels across representative features, optical sharpness, contrast and exposure before setting a minimum camera resolution.

Will increasing capture from 100 fps to 200 fps solve motion blur?

It doubles the temporal sampling rate, but does not automatically sharpen individual frames. Exposure must still be short enough for the fastest apparent feature motion. Confirm that the additional samples improve the intended measurement and that the camera interface and storage can sustain them.

Can an overhead position tracker directly control the close-up camera?

Sometimes, but body position alone may not locate the head accurately enough for a narrow view. Validate the head-position estimate, coordinate transformation and end-to-end delay. Changes in posture and height can produce pointing errors even when the overhead trajectory appears smooth.

Should whisker imaging use pulsed illumination?

Not necessarily. Pulsing can concentrate illumination into the exposure interval, but requires documented light and driver support, suitable synchronization and protocol approval. Continuous illumination may be simpler when it provides adequate contrast. Evaluate optical output, flicker, heat and animal exposure in the actual arrangement.

When is a fixed camera preferable to pan-tilt tracking?

Use a fixed camera when the experiment provides a predictable observation zone or when a wider stationary view still samples the whiskers adequately. It removes steering delay and camera-motion blur. The trade is reduced close-up coverage or fewer pixels across fine features.