Image pre-processing

Pre-processing filters clean up your images before the cross-correlation runs, so PIVlab can find particles more reliably. They don't change your original image files — they're applied on the fly whenever an image is analysed or previewed.

Opening the panel

Choose Image settings → Image pre-processing / enhancement (Ctrl+I). Every filter here has its own tool tip — hover over a checkbox or field for a short explanation.

Two filters are enabled by default: Enable CLAHE and Auto contrast stretch. For most datasets these two are all you need; the rest exist for specific, less common problems.

PIVlab Image pre-processing panel
The Image pre-processing panel, with its default filters enabled.

CLAHE (recommended, on by default)

Enable CLAHE — Contrast Limited Adaptive Histogram Equalization — locally boosts contrast across the image, which generally makes particles easier for the correlation to distinguish. Window size [px] (default 64) sets the tile size CLAHE works on; the default is fine in most cases.

Filters for special cases (off by default)

These address specific image problems. Leave them off unless you have a concrete reason to turn one on:

FilterParameterWhat it's for
Enable highpass Kernel size [px] (default 15) Subtracts a low-pass (blurred) version of the image from itself, removing slow background brightness variations while keeping fine particle detail.
Enable intensity capping — Caps very bright pixels (e.g. reflections or glare) so a few extreme values don't dominate the correlation.
Wiener2 denoise and low pass Window size [px] (default 15) Wiener denoising followed by a Gaussian low-pass — reduces sensor noise in low-quality or noisy images.

Auto contrast stretch (recommended, on by default)

Auto contrast stretch automatically stretches the image's intensity histogram between a minimum and maximum value. This matters most for 16-bit images, whose useful intensity range is often only a small slice of the full range — without stretching, the image can look almost blank. The two fields show the detected bounds (0–1 scale) and update automatically.

Background subtraction

The Background Subtraction panel computes one background image from your whole loaded sequence and subtracts it from every frame — useful for removing a static, unwanted structure (a fixed reflection, a stationary object's outline) that would otherwise interfere with the correlation.

ControlEffect
Dropdown: off / subtract average intensity / subtract minimum intensity Chooses whether to build the background from the average or the minimum intensity across all loaded images, or to disable subtraction.
View background imageDisplays the computed background; click again to toggle between the A and B background.
Save / LoadSave the computed background image to reuse later, or load one you saved previously.

Applying your changes

  1. Enable and configure the filters you want.
  2. Click Apply and preview current frame to see the result on the frame currently shown. This is only a preview — but the same filter settings are automatically applied to every frame in the session once you run the PIV analysis, so you don't need to repeat this per frame.
  3. Optionally, click Export preview to save the pre-processed image currently shown (use the Toggle button in the Tools panel to switch between image A and B first).

Tips & tricks: preprocessing isn't a fix-all

Preprocessing changes your measured velocities Filters here are not a cosmetic step — they alter the image data the correlation actually runs on, which can shift your results. Treat preprocessing as a real analysis decision, and revisit it if something about your results looks off. It also can't rescue fundamentally poor image data; see Particle seeding & image quality for what to fix upstream instead.