Cameras & sensorsHow-to

How to measure camera frame rate reliably

Measure camera frame rate with a timed frame counter, separate delivered images from trigger settings, and check losses without a camera-specific library.

LumaSpec Vision9 min read Share on LinkedIn

On this page 9 sections
  1. 011. Decide which rate you need to measure
  2. 022. Prepare a repeatable acquisition test
  3. 033. Count frames inside a fixed time window
  4. 044. Calculate the rate and interpret the result
  5. 055. Check missing frames, duplicates, and queued images
  6. 066. Add workload back to locate the bottleneck
  7. 077. Choose hardware after identifying the limiting stage
  8. 088. Verify the result against an acceptance checklist
  9. 09Questions

A configured frame rate tells you what the camera was asked to do, not how many usable images your application received. To measure delivery reliably, count completed frames during a defined interval and time that interval with a monotonic clock. This method works across acquisition libraries because it measures events at your application boundary. You can then compare the count with trigger activity, frame identifiers, and processing throughput to find where images are delayed or missing.

1. Decide which rate you need to measure

Before writing a counter, define what qualifies as a frame and where you will count it. Several rates can exist simultaneously in one inspection system.

Measurement What it describes What it does not prove
Configured acquisition rate The requested camera setting That the camera achieved it
External trigger rate Pulses presented to the camera That every pulse caused an exposure
Delivered frame rate Completed images reaching the acquisition boundary That processing kept up
Processed frame rate Images completing inspection That every acquired image was inspected
Display refresh rate Images presented by the interface The underlying acquisition rate

For a first benchmark, count complete, successful frame deliveries before image conversion, inspection, display, or file writing. Count unsuccessful deliveries separately rather than including them as usable images.

Do not count how often your acquisition loop runs. A loop can execute repeatedly while receiving no new image, or return an image retained from an earlier acquisition.

If the application uses external pulses, also review hardware-trigger timing and acquisition limits. Trigger frequency and successful frame delivery are different measurements.

2. Prepare a repeatable acquisition test

Record the settings that affect workload: image dimensions, region of interest, pixel format, exposure, acquisition mode, trigger source, and requested frame rate. Keep them unchanged throughout each measurement window.

Use the same acquisition path as the intended application. A preview utility may use different settings, conversion, buffering, or transport configuration.

For the initial baseline:

  1. Open the device and allocate buffers before timing begins.
  2. Start acquisition and allow a short warm-up period, such as 2 seconds.
  3. Disable image saving, inspection, and display updates where practical.
  4. Count completed deliveries in the earliest suitable application callback or receive function.
  5. Keep the callback short and release buffers according to the acquisition library's documented ownership rules.

Use a monotonic clock, which measures elapsed time without following wall-clock adjustments. A date-and-time clock can jump when the operating system corrects its time.

Warm-up does not replace a startup test. If the production requirement includes the first image after connection or arming, measure startup latency separately. The distinction is explained in trigger-call timing versus exposure timing.

3. Count frames inside a fixed time window

Choose a measurement duration and establish its start and end on the monotonic clock. Count a delivery only when its callback-entry timestamp falls inside that window.

Delivered frame rate = complete frame count / elapsed time f = N / T

Here, N is the number of complete deliveries inside the window, and T is its duration in seconds. The result is frames per second.

The following pseudocode describes the method without depending on a particular acquisition library:

Start acquisition
Wait for warm-up to finish

Reset counters
start = monotonic_time()
end = start + measurement_duration

On each delivered frame:
    arrival = monotonic_time()
    if start <= arrival and arrival < end:
        if delivery_is_complete:
            atomically_increment(complete_count)
        else:
            atomically_increment(incomplete_count)
    release_frame_as_documented()

Wait until monotonic_time() >= end
Synchronize with active callbacks
Read final counters
rate = complete_count / (end - start)

Initialize the measurement state before callbacks can access it. Use the language's appropriate synchronization mechanism so that callbacks cannot observe partially updated state or lose counter increments.

The interval is half-open: deliveries exactly at its start are included, while deliveries at its end are excluded. This avoids counting the same boundary event twice in adjacent windows.

If the waiting thread wakes late, do not extend the denominator while retaining the original counting window. Count and elapsed time must describe the same interval.

4. Calculate the rate and interpret the result

Suppose a 60-second window contains 1,796 complete deliveries and 2 incomplete deliveries. Calculate usable delivery rate from complete images only:

f = 1,796 / 60 f = 29.93 frames/s Incomplete delivery events = 2

Report both values. Including incomplete deliveries would conceal a quality problem even if the resulting event rate looked closer to the configured setting.

If the requested rate was 30 frames/s, the arithmetic expectation is:

Expected count = 30 × 60 = 1,800 frames Difference = 1,800 - 1,796 = 4 frames

That difference is a diagnostic clue, not proof that four frames were lost in transport. The actual exposure rate may differ from the request. Trigger acceptance, window boundaries, and delivery latency can also affect the comparison.

A longer window reduces the relative effect of a single boundary event. One frame changes a 1-second result by 1 frame/s, but changes a 60-second result by about 0.017 frame/s.

Repeat the measurement three times under unchanged conditions. Keep each result rather than reporting only the highest value. Large variation deserves investigation even when the average appears acceptable.

For irregular spacing or suspected bursts, use timestamp-based frame interval analysis. A window average can hide a pause followed by rapid delivery of queued images.

5. Check missing frames, duplicates, and queued images

A delivery counter answers how many complete images reached the selected boundary. It does not establish that those images represent every exposure, or that they arrived promptly.

Where available, record lightweight metadata alongside the counters:

  • Frame identifier or block identifier.
  • Camera timestamp and its documented event meaning.
  • Host monotonic arrival timestamp.
  • Complete or incomplete delivery status.
  • Application queue depth and rejected-image count.

Interpret identifiers according to the device documentation. A sequence gap can indicate missing deliveries, but identifier wraparound, acquisition restarts, and filtering must be excluded first. A repeated identifier may indicate duplicate handling or reuse of the same delivered image.

Host arrival timestamps include transport, buffering, and scheduling effects. Camera timestamps describe a device-side event whose meaning must be checked. Do not subtract a camera timestamp from a host timestamp unless their clocks and offsets have been aligned.

Buffered delivery also changes the interpretation. Images exposed before the measurement starts may arrive inside its window. For sustained-rate testing, warm up first and confirm that queue depth remains stable. For event-specific timing, match frame metadata to the relevant exposure or trigger event.

For finite triggered tests, count input pulses, accepted triggers if reported, complete frames, incomplete frames, and application discards separately. Allow accepted frames to finish arriving after the final pulse before closing that test.

If the requirement is continuous recording, recording without dropped frames covers the additional storage and buffering checks.

6. Add workload back to locate the bottleneck

Once the acquisition-only baseline is stable, restore one operation at a time: conversion, inspection, display, then storage. Measure delivered and processed rates separately at every stage.

Suppose images arrive at 30 frames/s, while serial processing takes 40 milliseconds per image:

Processing capacity = 1 / 0.040 = 25 frames/s Queue growth = 30 - 25 = 5 frames/s Backlog after 60 seconds = 5 × 60 = 300 frames

A larger queue delays failure but does not correct that throughput mismatch. The application must reduce processing time, use suitable parallelism, lower acquisition demand, or deliberately discard images under a documented policy.

A display may intentionally show only the newest frame. That can be appropriate for an operator preview, but its refresh count cannot verify complete inspection coverage.

If delivery is already slow with processing disabled, investigate exposure, trigger acceptance, sensor readout, transport capacity, and buffer handling. Use the acquisition-rate bottleneck checks to separate these causes.

Exposure duration alone does not establish the delivered rate. Cameras differ in how exposure, readout, and triggering overlap. Consult the documented timing behavior instead of assuming that the inverse of exposure time is the achieved acquisition rate.

7. Choose hardware after identifying the limiting stage

The counting method applies to both direct camera connections and systems using acquisition cards. Browse area scan cameras and the camera finder when selecting the required interface and imaging configuration.

The LS-CMR-0053 is a GigE camera option. Validate sustained delivery with the intended settings and host before treating any nominal rate as a system-level guarantee.

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
Interface
GigE
Resolution
12 MP
$560.00View partBuild a system with it

The LS-CMR-0166 provides a USB3 alternative. Its transport choice does not remove the need to measure callback workload, queue behavior, and complete-image delivery.

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

These are interface examples, not a recommendation to replace an existing camera before diagnosis. First determine whether the limit is acquisition, transfer, or downstream processing.

If the connection requires an acquisition card, compare frame grabbers through the accessories finder. Check interface compatibility, driver support, host slot requirements, and buffer ownership before ordering. The guide to frame-grabber acquisition paths explains where counting and completion status belong in those systems.

A different card cannot correct an application that retains buffers indefinitely or processes every frame too slowly.

8. Verify the result against an acceptance checklist

Before calling the measurement complete, confirm the following:

  • Defined boundary: the report states whether it measures deliveries, completed inspections, or saved images.
  • Stable settings: acquisition parameters remain unchanged throughout each run.
  • Matching interval: the count and denominator use identical start and end boundaries.
  • Valid images: incomplete deliveries and intentional discards have separate counters.
  • No hidden backlog: queue depth does not grow continuously during the test.
  • Sequence checks: available identifiers have been examined for unexplained gaps or repeats.
  • Production workload: the final run includes the operations required during normal use.
  • Repeatability: repeated windows produce results consistent with the application's tolerance.

Do not apply a universal pass threshold. An inspection that requires every triggered image needs different acceptance criteria from a preview that deliberately skips older images.

Record the settings, window duration, complete count, incomplete count, processed count, and queue behavior together. This makes later comparisons meaningful after software or hardware changes.

For a new system, begin with the camera configurator. For an unexplained delivery shortfall, send the measurement record through application support before selecting replacement hardware.

Questions

Do you need a special library to measure camera frame rate?

No special measurement library is necessary if your acquisition software exposes completed frame deliveries. Increment a counter at that boundary and measure a defined interval with a monotonic clock. You still need the supported camera driver or acquisition library to receive images and identify unsuccessful deliveries.

How long should a frame-rate measurement run?

A 30- to 60-second window is a useful starting point for sustained acquisition. Slower cameras or intermittent triggers may require longer observation. Short windows help reveal rapid changes, but individual boundary events have a larger effect on their calculated rate. Repeat the test under identical settings.

Why is the preview rate lower than the delivered frame rate?

Preview software often limits display updates or selects the newest available image instead of displaying every delivery. Measure at the acquisition boundary and count display updates separately. If acquisition is satisfactory but inspection or storage falls behind, monitor queue growth and downstream completion counts.

Does reaching the expected average prove that no frames were dropped?

No. An average can hide bursts, pauses, duplicates, or losses offset by queued deliveries. Check successful completion status, frame identifiers, application discards, and queue behavior as separate evidence. For triggered acquisition, compare the completed image count with accepted triggers after pending transfers have finished.