Region of interest (ROI)

A region of interest (ROI) restricts the entire analysis to a single rectangular area of the image — everything outside it is cropped away before any processing happens. It's the simplest way to speed up an analysis or ignore irrelevant parts of a large image.

Opening the panel

Choose Image settings → Define region of interest (ROI) (Ctrl+Shift+E). The panel shows a status readout (ROI inactive / ROI active), draw/clear buttons, and four numeric fields for exact placement.

If you don't set a ROI, the whole image is analysed — fine for most cases.

PIVlab Region of interest panel showing an active ROI
The Region of interest panel with an active ROI.

Setting a ROI

  1. Click Select ROI. A green, editable rectangle appears on the image.
  2. Drag it into place and resize it by its corner/edge handles. A live label shows the current x, y, w, h as you drag.
  3. Alternatively (or for pixel-exact placement), type values directly into the x:, y:, width: and height: fields.
  4. Click Clear ROI to remove it and analyse the full image again.
A green ROI rectangle drawn over part of the Karman-vortex example image
An active ROI (green, dashed). Only the area inside it will be processed — note it doesn't need to exclude the rod; that's what masking is for (see below).

ROI vs. masking — which should I use?

How a ROI and a mask differ, and when to use each reference

Both restrict what gets analysed, but they work differently:

Region of interestMasking
Shape One rectangle only Any shape, any number of them (freehand, circle, rectangle, polygon, automatic)
Per frame? No — one ROI for the whole session Yes — masks are per-frame (though easy to copy to many frames)
How it works Crops the image before any processing — pixels outside it are never touched, which is also faster Processes the whole image, then sets the masked pixels' results to NaN afterwards
Use it for Cutting a large image down to the area you actually care about (e.g. ignoring wide borders or an unused part of the field of view) Excluding specific obstacles, reflections or invalid regions — including holes inside the area you keep (see the masking page's overlapping-masks recipe)
They combine A ROI and masks are independent and can be used together: crop the image to the relevant area with a ROI, then use masks to exclude specific objects within it.
Use it to cut away the unused parts, not the flow A ROI is a good way to speed up analysis on a large image with wide unused borders or an irrelevant part of the field of view — but don't crop away flow structure you actually need. If you're unsure whether a region matters, leave it in and use a mask instead if it turns out to be a problem.