View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
PIVlab - time-resolved particle image velocimetry (PIV) tool

4.9 | 56 ratings Rate this file 479 Downloads (last 30 days) File Size: 7.69 MB File ID: #27659 Version: 1.41
image thumbnail

PIVlab - time-resolved particle image velocimetry (PIV) tool



19 May 2010 (Updated )

A GUI based tool to preprocess, analyze, validate, postprocess, visualize and simulate PIV data.

| Watch this File

File Information

PIVlab is a time-resolved particle image velocimetry (PIV) software that does not only calculate the velocity distribution within particle image pairs, but can also be used to derive, display and export multiple parameters of the flow pattern. A user-friendly graphical user interface (GUI) makes PIV analyses and data post-processing fast and efficient.
Screen-capture video of the tool:
Example analyses & videos can be found on the PIVlab website:
Please ask your questions in the PIVlab forum:
Main features:
* completely GUI based PIV tool
* multi-pass, multi grid window deformation technique
* import bmp/ tiff/ jpeg image pairs/ series
* image sequencing styles A-B, C-D, ... or A-B, B-C, ...
* individual image masking and region of interest (ROI) selection
* image pre-processing (contrast enhancement, highpass, intensity capping)
* two different sub-pixel estimators
* multiple vector validation methods
* magnitude/ vorticity/ divergence/ shear / ...
* data smoothing, vector field highpass
* multiple colormaps
* streamlines
* extensive data extraction tools/ integration via poly lines/ circles/ area
* statistics (histograms, scatterplot, mean & stdev)
* precise particle image pair generation with user-defined parameters and several flow simulations (synthetic PIV image generator)
* data export (matlab, ascii, movie file, image, Paraview, ...)
* main features accessible via comand line scripting
In addition to the acknowledgements to MATLAB fex submissions, we would like to acknowledge Uri Shavit, Roi Gurka & Alex Liberzon for sharing their code for 3-point gaussian sub-pixel estimation ( ).
Thanks to Nima Bigdely Shamlo for allowing me to include the LIC function. Thanks to Raffel et al. for writing the book "Particle Image Velocimetry, A Practical Guide", which was a very good help.
See the file "thirdparty.txt" in the zip archive for licenses and references.
If you use our work, please leave a comment and a rating.


Ellipse.M, Exportfig, Inpaint Nans, Uipickfiles: Uigetfile On Steroids, Fast 'N Easy Smoothing, and Improved 2 D Streamlines inspired this file.

This file inspired Pt Vlab (Particle Tracking Velocimetry Lab) and Pi Vsuite.

Required Products Image Processing Toolbox
Robust Control Toolbox
MATLAB release MATLAB 7.12 (R2011a)
MATLAB Search Path
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (140)
15 Feb 2017 Harold Fatzinger

Is it compatible with Matlab R2016b?

Comment only
09 Feb 2017 Aswin Muralidharan

09 Feb 2017 Ferhat Karakas

08 Feb 2017 Juan Camilo Coral

05 Feb 2017 Aswin Muralidharan

I am writing to know if it is possible to read im7(LaVision Davis) images using the readimx package in matlab and use that along with this code? It would be of great help if it was possible

Comment only
02 Feb 2017 Marc D.

beautiful tool!
thanks for making my Masterthesis great (again)

11 Jan 2017 hakan alper kamiloglu

23 Nov 2016 Linus Schumacher

There is a superfluous space in line 155 of PIVlab_GUI that seems to prevent the default settings being read correctly on linux (but not on mac).

13 Oct 2016 leo huang

how can i download this?

13 Sep 2016 Shahar Grossbard

06 Jul 2016 aiqing2016

10 Jun 2016 Oliver Eisermann

11 May 2016 Delphine Dullin

10 May 2016 E. Cheynet

09 May 2016 Javad

Javad (view profile)

First of all, thanks for writing and developing this tool! I mask some area that gives me NaNs. When I smooth or interpolate the vector field, these NaNs are replaced with some numbers that I can not distinguish them from the region of my interest. On the other hand, if I don't use interpolation, there are some other NaNs in the original regions. I was wondering is there any way to use interpolation or smoothing with excluding the masked area or I am doing something wrong?!

Comment only
05 May 2016 Bi Dianfang

11 Apr 2016 Nicolas Castro

Please, provide a function that generates cross correlation maps of an user defined interrogation window.

06 Apr 2016 Martin Teich

04 Apr 2016 Sophie Roman

13 Feb 2016 William Thielicke

The latest version is 10 to 30 times faster in processing. See the blog for details!

Comment only
21 Dec 2015 Melody Hathaway

01 Oct 2015 Rebecca McAlpine

19 Sep 2015 Feng

Feng (view profile)

10 Sep 2015 Ryan Baker

26 Aug 2015 Jamie Mullin

18 Mar 2015 William Thielicke

The latest version (PIVlab 1.4beta) is compatible with R2014b (and above, and below). This website will soon be updated with v1.4. Until then, download a copy @

Comment only
18 Jan 2015 William Thielicke

If you're using Matlab R2014b and considering to work with PIVlab, then please have a look at this post here:

Comment only
09 Nov 2014 William Thielicke

Dear Aahdi, please, as I mentioned in the e-mail, use the forum for questions, and give more detail, e.g. a drawing or example.
The forum is here:

Comment only
09 Nov 2014 AADHI NARESH

I got one doubt in piv lab let me clarify please, what is the refererence distance in calibration , if we want to mention from river or any channel.

how frequency is described

Comment only
13 Sep 2014 AADHI NARESH


i was sent to you through facebook. what is the actual meaning of 'ms' it is the capture time of images or camera specification. my camera gives 8fps. my mail id is


Comment only
13 Sep 2014 AADHI NARESH


i was sent to you through facebook. my mail id is


Comment only
13 Sep 2014 William Thielicke

@Aadhi: That sounds like your calibration might be wrong. Did you note that you have to enter the distance in 'mm' and the time step in 'ms' during calibration? If that doesn't fix your problem, you could send me some example images.

Comment only
13 Sep 2014 AADHI NARESH

hi @ William

here after my analysis i got the u velocity is 0.00025 m/s, but when i did manually in channel i got around 0.205 m/s, in my analysis i used Canon EOS 7D camera is used. here i got the error as 1/1000, please give any one exact explanation.

Comment only
12 Sep 2014 William Thielicke

@Sidaard: I don't know what file format your ".dat" file should be, but you could export to individual text files by using File -> save -> ASCII-file -> Export all frames

Comment only
08 Sep 2014 Sidaard

I was wondering how I would acquire individual vector files for all my image pairs.

I tried using DPIV software but I could not get individual .dat files for each of my image pairs. I need individual vector data files to calculate Reynolds stress.

Any helpful information will be greatly appreciated.


Comment only
25 Aug 2014 AADHI NARESH


how the graphs and velocity maps are saved, i will get a problem in opening ASCII chart when i was save at any location

Comment only
18 Aug 2014 William Thielicke

@AADHI NARESH: Sorry, but I think I'd be way more fruitful if you'd give details about the problem first.

Comment only
17 Aug 2014 AADHI NARESH



i have a problem with cross correlation process please give details about that

Comment only
01 Aug 2014 William Thielicke

@Dimitris: No, that is not really possible. PIVlab needs specific session files with the data organized in a specific way. I'd recommend to redo the analysis in PIVlab.

Comment only
31 Jul 2014 Dimitris

Is it possible to use the tool only for post-processing, as long as I already have the velocity field?

Comment only
30 Jul 2014 William Thielicke

@Kristine: There is no possibility to do this in the PIVlab GUI (because the velocity you want to subtract varies with time). But you could export the results to the workspace, measure (take the average of a region) the velocity and subtract it from the results. This can be automated I think.

---> comment nr. 100, yaay! Let's drink an ice-cold bottle of coffee on this!

Comment only
29 Jul 2014 Kristine

our camera shaked a bit during one of the recordings. We know that some parts of the images are fixed while recording. Is there a possibility to set these 'fixed parts' as 'zero movement'? So the analysis finally gives the real movement of the moving particles without the shaking of the camera?
Thank you very much!

15 Jul 2014 Adam

Adam (view profile)

@William: Ah ha, thanks. That should help me solve my problem.


Comment only
14 Jul 2014 William Thielicke

@Adam: Yes, y = positive in downward direction, and x positive to the right. 0,0 is in the upper left corner of the input image. The coordinates of the ROI (xstart, ystart, width, height) are given in the ROI panel.

Comment only
14 Jul 2014 Adam

Adam (view profile)

@William: So y is positive in the downward direction (in terms of the image)? From my own tests I think that it is, but I just thought I'd check.

Also, is x=0 y=0 set in the top left corner of the image, or the Region of Interest?

Danke Schön!

Comment only
11 Jul 2014 William Thielicke

@Adam: Thanks :-D. Concerning your question: It is the top-left corner (this seems to be the standard for image-based data). You can change that only by exporting data from PIVlab and then writing a custom script (shouldn't be that difficult however).

Comment only
11 Jul 2014 Adam

Adam (view profile)

PIVlab is by far and away the best PIV software that I've used, even better than proprietary stuff that wants lots of money for the "full" version!

I have a question: I'm trying to convert Cartesian coordinates to polar coordinates. Where does PIVlab place x=0 y=0? At the bottom left hand corner? Is it possible to change the default location of 0,0? (As this would make converting easier.)

12 Jun 2014 pratik

pratik (view profile)

04 Jun 2014 William Thielicke

@Petra: Yes that might work. But then you'll have to select the "A-B, B-C, ..." sequencing style, otherwise you might skip every 2nd image.

Comment only
04 Jun 2014 Petra S

I changed in the PIVlab_GUI.m in Line 1631 the "filepath{i}" to "filepath{1}".

I think this will do the trick.

Comment only
02 Jun 2014 Petra S

Thank you for your quick answer.

I would like to do the cross-correlation for a lot of images to the same reference image.

Comment only
02 Jun 2014 William Thielicke

@Petra: Yes, just select your reference image as "image A" for image pair.

Comment only
02 Jun 2014 Petra S

is it possible to do the cross-correlation to a fixed reference image?

Many thanks,

Comment only
02 Jun 2014 William Thielicke

@Joe: What you see is the vector validation between the passes. This doesn't really affect your end result. All vectors of the final pass are "real vectors", they are not interpolated.

@Elizabeth: You need texture in the medium that you want to track. As a rule of thumb: If your eyes can see a movement in the images, then PIVlab will also be able to do a cross-correlation.

@Edouard: I did something similar in my PhD project, but you need to do the calculations in Matlab. I can recommend Paraview for displaying the 3D data.

Comment only
30 May 2014 Dipin K K

29 Apr 2014 Edouard Bahous


I have several PIV images at different cross-sectional angles of an axi-symmetric part and would like to interpolate between each image to create a 3D flow field. Does PIV lab have this capability?

Thank you

Comment only
16 Apr 2014 Elizabeth

I need to construct a kind of flume experiment to measure soil erosion. It seems like this is a great tool to track soil movement. But do I have to use tracers to obtain the streamlines on water?

Comment only
10 Apr 2014 Joseph Decker

This is really good software expecially for free. I am using this for my senior project in college. I see that while it is running it discards vectors. I would like to run it for a while to get a nice average of vectors but it keeps deleting vectors that seem to be fine. Could you please advise me on where I can disable this feature so that it just dumps out all the raw data without discarding any vectors?



Comment only
08 Apr 2014 William Thielicke

Hi Roe,
to export the 2D vector data, go to file -> save -> ASCII File or MAT File or Paraview binary VTK (depending on the format you want it to have).
The documentation will be available this summer in my thesis and (hopefully) also in a journal...

Comment only
07 Apr 2014 Roe Burrell


First, please accept my thanks for developing such excellent software. I am finding is preferable to commercially available PIV programs for my PhD work (of course, you will be cited where appropriate).

My question - I'd like to export the full 2D velocity vector components (u,v). I've seen where I can export u or v along a line under the "Extractions" menu, but is there a function in the GUI to do this for the full 2D vector field over the entire ROI?

Finally, it is mentioned that documentation about the accuracy of the algorithms, etc. may be available by early 2014 pending publication of your thesis. Do you have any further information in this regard?

Many thanks,

Comment only
03 Apr 2014 William Thielicke

Hi Josephine,
it uses a cross correlation to determine the paticle displacement. You can select "direct cross-correlation" (in the spatial domain) or a "discrete Fourier transform" (in the frequency domain).

Comment only
02 Apr 2014 Josephine

Hello, I would like to know what method of determination used PIVlab (
Phase correlation, block-based methods, Differential methods (Lucas-Kanade method, Horn-Schunck method, Buxton Buxton method, Black-Jepson method))
General variational methods, Discrete optimization methods). I write a master's thesis and can not use this code if I do not know what it does exactly.

Thank you in advence,


Comment only
02 Apr 2014 William Thielicke

Dear Ram, this is the PIVlab comment page and not the PTVlab page. Although the GUI from PTVlab is from our project, I can't help you with the bugs in PTVlab.

Comment only
02 Apr 2014 Ram

Ram (view profile)

Nice code, but I am facing problem during run. When I open image per-prcossing and enable subtract means & click preview current frame then nothing happen. Instead program becomes unable/inactive. I have to shut down PTVLab. Can any one help me?
Thanks in advance!!!

Comment only
04 Feb 2014 William Thielicke

Dear Petra,
PIVlab uses uipickfiles.m to load the paths and filenames of image data. You could replace this function with a custom function that loads matrices from the Matlab workspace. See the documentation of uipickfiles.m to understand it's data structure.

Comment only
03 Feb 2014 Petra S

Hi William,

thanks for your great programm.

What I would like to know:
Is it possible to import the images (matrices) directly from the current Matlab-session without saving them to file?

Best regards

Comment only
30 Oct 2013 David Jessop

16 Aug 2013 William Thielicke

@Uli: Thanks, I'll try not to forget to include it in the next release.

@Tobias: The "area mean flow direction" works on full cells: A cell is included in the average, if more than 50% of its area are within the area that you selected.
The "area mean value" uses exactly the area in your polygon. So this is more precise.

Comment only
16 Aug 2013 Tobias

Tobias (view profile)

Hey William,
I love your program. It is truly sophisticated and quite easy to work with.
One thing appeared to me, however. If I extract the velocity magnitude from an area, I have two possibilities, right? - through "area mean value" -> "velocity magnitude" and through "area mean flow direction". Though, the results are different. I'm not a matlab-pro so it's hard for me to follow the source-code to where the exact difference is. Maybe you can give me an advice which possibility I could "trust" more ;)
Thanks for everything,

19 Jul 2013 Uli Kleßinger

Dear William,
thanks for the great code.
I just tried it and it works great. However, i think i found a bug which might appear when images contain blank areas:
I then get an error in piv_FFTmulti (line 122).
You might add "~isempty(x) && ~isempty(y)" in that line to solve that problem.

11 Jun 2013 Jon

Jon (view profile)

Hi William,
Thank you very much for providing this useful tool. One quick follow-up question to the last user post regarding obtaining the correlation peak. Do we run PIV_FFTmulti.m separately or can it (correlation peaking specifically) be run from the GUI?

Comment only
07 Apr 2013 William Thielicke

The correlation result is here:
result_conv=result_conv/max(max(result_conv))*255; %normalize, peak=always 255

Comment only
05 Apr 2013 Konstantinos Margaris

Dear William,

How can I plot the correlation peak for an interrogation window?

Comment only
29 Mar 2013 Sina Tebianian

Many thanks for your precious help. I will send you some of the snapshots.

29 Mar 2013 William Thielicke

Dear Sina,
Images are not binarized. PIVlab however only uses intensity information from the images.
There should be minimally around 6 particle pairs in the last pass. The larger the interrogation area is, the better are the individual vectors. But you lose resolution of course.
When there are no particles in a region, then PIV doesn't work... The challenge usually is to optimally set up the experiment , but I guess thiss will be hard in your case... Please send me some images, ans I can have a look.

Comment only
28 Mar 2013 Sina Tebianian

Dear William,
Thank you for the amazing PIV code that you created. I am working with a series of images obtained in a dense fluidized bed made of many particles. Some questions that arose while I started working with your PIV lab are:
1. Does the program binarize all the images once I do the image pre-processing?
2. There are regions where there is no particle but I see that there are many velocity vectors that should be avoided somehow.
3. How should I choose Pass1, 2 and 3? Is there a certain criteria for that?

I'll be happy to send you some of the images too.

Best regards

Comment only
28 Jan 2013 Vincent

17 Dec 2012 William Thielicke

Dear Ian,
PIVlab uses a cross correlation of sub images to find the displacements. Please see Raffel et al.: "Particle Image Velocimetry, A Practical Guide" for information on PIV. That book also gives an overview on the size of interrogation areas in flows with high displacements and multi-pass algorithms.

Comment only
17 Dec 2012 Ian

Ian (view profile)

Thank you for the excellent PIV algorithm that you created. I've used a few now and this appears the most user-friendly in my opinion.
Thank you for your reply to my previous question. I found that there was obvious flickering of the video i analysed before, which would introduce artefacts.

Say if i have particles flowing in a fluid, does PIVlab generate vectors on the basis of particle tracking or is more of a textural analysis algorithm?

If it is particle tracking, i might have more issues with determining vectors as i'm currently working with smaller ROI's hence if i increase the bulk flow rate, soon i would have to increase the interrogation window size to some unreasonable value and i might lose valuable information.

11 Dec 2012 William Thielicke

Dear Ian, the amount of erronoeus vectors depends on your image quality. Image noise or compression artifacts can really become a problem. You can filter erroneous vectors semi-automatically by applying e.g. the stdev filter, the normalized median test, or a global velocity threshold. You can also send me some of your images so I can have a look.

Comment only
10 Dec 2012 Ian

Ian (view profile)

Hi I want to generate streamlines of fluid flow around a structure in an enclosed flow channel. To aid in the tracking of fluid flow and its velocity i have added micro-particles to the fluid. So I'm using this GUI to generate the streamlines for me.

The problem i have is that when i play the video of the fluid flow, i can easily see the net direction of the flow. But when i analyse a few frames of it using PIVlab, i get a fair few errant vectors that are pointing in the wrong direction. Other than manually eliminating this every time for every frame that i analyse, is there something else i could do?
Thank you for considering my question.

Comment only
05 Dec 2012 William Thielicke

Dear Konstantinos,
1: the commandline script is not intended to produce PIVlab session files. But you could analyze 2-3 images in the GUI, then save the session and have a look at the resulting .mat file. The variable "resultslist" contains the x,y,u,v,typevector information.
2: I am using the exportfig function to export the figure. You could search for "exportfig" in the PIVlab_GUI.m and modifiy the figure before it is saved.

Comment only
04 Dec 2012 Konstantinos Margaris

I got the following error when applying intensity capping in my images:

Error using median (line 28)
First input must be single or double.
Error in PIVlab_preproc (line 24)
up_lim_im_1 = median(in_roi(:)) + n*std2(in_roi); % upper limit for
image 1
Error in PIVlab_GUI>preview_preprocess_Callback (line 1502)
out = PIVlab_preproc (img,roirect,clahe,
Error in gui_mainfcn (line 96)
Error in PIVlab_GUI (line 32)
gui_mainfcn(gui_State, varargin{:});
Error in
Error while evaluating uicontrol Callback

The issue is solved if one converts the argument in the median function to a double. I am not sure if it is a general bug or just my images (8-bit Tiff).

Also if you could help me out with a couple of things I would be grateful:

1. What will be the command to save a mat file with the results, using the command line script, in order to load it to the GUI for preprocessing?

2. I am using an edge detection algorithm to detect and mask boundaries in my images. I'd like to plot the edges in the GUI and also save them on the images when I export images or videos. Could you point me to the image variables that are saved so I can add the detected edges?

04 Dec 2012 Susanne

01 Nov 2012 William Thielicke

Dear Konstantinos, you can save your session, and then extract the masks from the saved session using this piece of code that Eileen sent to me a while ago:
function ReadSaveMasksFromSession(filename, outfile)
% filename is the name of the PIVlab session file
% outfile is the name for the MATLAB file to be saved
% This function saves the x- and y- coordinates for a mask from PIVlab
% previously saved to a session file. It only does the first image slice,
% but that can be copied to the other images from within PIVlab.
% If the user wishes to run PIVlab on other images with the same
% orientation, the outfile from this program can be loaded into PIVlab.
% Eileen M. McMahon, PhD, May, 2012
masks = load(filename, '-mat', 'maskiererx', 'maskierery');
xmask = masks.maskiererx{1,1};
ymask = masks.maskierery{1,1};

Comment only
31 Oct 2012 Konstantinos Margaris

Excellent work!

Is there a way to save masks drawn in PIVlab, in order to reuse them in different sessions?

22 Oct 2012 Amy

Amy (view profile)

07 Sep 2012 John

John (view profile)

This has been great. For my first time using PIV, this code has been very helpful. I was wondering though what the matrix 'typevector' represents when I save results to a .mat. Does it display which vectors are the original and which ones are replaced after vector validation?

Comment only
09 Jun 2012 William Thielicke

@Emil: I am using Matlabs built in streamline function. As far as I can see, it will only draw streamlines in one direction from the point. I'll look for alternatives for the next release.

Comment only
25 May 2012 Emil Rozbicki

It's very good. Just been wondering if there is any way to display streamline not only "starting from the point" but also "ending at the point" or if there would be a way to display the "full" streamline that passes through the given point.

04 May 2012 Martin Richard

I think that this tool is great!

29 Apr 2012 William Thielicke

It's not complicated, here's a quick and dirty parabolic flow:


Comment only
28 Apr 2012 Alok

Alok (view profile)

Thanks for the quick reply. I'll give it a shot, although it does look complicated.

Comment only
28 Apr 2012 William Thielicke

Hi Alok,
in line 3636 in PIVlab_GUI.m, you can find the code to generate a uniform displacement flow. You can put your parabola flow profile here, you just need a u and v displacement matrix for all pixels in the image.

Comment only
28 Apr 2012 Alok

Alok (view profile)

Picking up from my previous question, is there a way I can specify the displacement in terms of the equation of a parabola and generate particle images out of it in PIVLab?

Comment only
28 Apr 2012 Alok

Alok (view profile)

This is an amazing tool. I have tried a lot of alternatives before finding PIVLAb. Good job!! I have a query, though. I dont seem to be able to generate images for simple parabolic flows like Poiseuille flow in a channel. Am I missing something? Thanks

Comment only
19 Feb 2012 chen

chen (view profile)

good job.

Comment only
09 Feb 2012 Jan Neggers

03 Feb 2012 William Thielicke

@York: yes, just disable the "autoscale map" feature in "Plot -> derive parameters"

Comment only
02 Feb 2012 York

York (view profile)

Quick question, is there a way that I can fix the range of the colorbar for the entire sequence of images?

Comment only
02 Feb 2012 York

York (view profile)

22 Dec 2011 R. Aragall

20 Dec 2011 Bhavin Dalal

Thank you.

Comment only
20 Dec 2011 William Thielicke

@Bhavin: You could open pivlab_gui.m and search for "vectorcolor='g'". Replace this with e.g. 'r' for red or 'k' for black.
When you want to modify the vector colors that are plotted during displaying derivatives (e.g. vorticity or magnitude etc.), search for vectorcolor='k' and replace it with a color of your choice. I will add the possibility for changing vector colors in a next release.

@ALL: If you miss some features, please add your comment/wish here:
Otherwise I might forget to add the desired features in the next release (I have quite a number of projects, and it's hard to keep track of everything..).

Comment only
20 Dec 2011 Bhavin Dalal

Very good program. Robust, fast and easy to use. One question, Is there any way I can change the color of the arrows from Green to say Black or Red? I am using color image for demonstration.

20 Dec 2011 William Thielicke

@XP Wu:
Thanks for your feedback.
The lines 1605-1607 are correct in my opinion. They set the value of the checkboxes (value==1 means checkbox checked, value==0 means checkbox not checked). And the variables pass2, pass3, pass4 are 0 respectively 1. This works fine.
Your second change makes much sense, and I'll include it in the next release. Thanks!

Comment only
20 Dec 2011 XP Wu

XP Wu (view profile)

Great work!
And some bugs should be fixed.
See the line 1605 to 1607:

set(handles.checkbox26, 'value',pass2);
set(handles.checkbox27, 'value',pass3);
set(handles.checkbox28, 'value',pass4);
Because checkbox has no property named 'value',so these code should be as follows:

%% {Modefied by XP wu
set(handles.checkbox26, 'String','Pass 2:');
set(handles.checkbox27, 'String','Pass 3:');
set(handles.checkbox28, 'String','Pass 4:');
%% 2011-12-15}

20 Dec 2011 XP Wu

XP Wu (view profile)

PIVlab_GUI doesn't need start from it''s folder.Just change the Line 105 :

could be as follows ::
%% {Modefied by XP Wu
% read_settings ('PIVlab_settings_default.mat',pwd);
read_settings ('PIVlab_settings_default.mat',psdfile(1:(dindex(end)-1)));
%% 2011-12-15}

23 Sep 2011 Hayder

Hayder (view profile)

Excellent code. Very friendly and accurate.
I am using it in all my PhD work

21 Sep 2011 Kelly

Kelly (view profile)

Is there any 3D version of this code?

Comment only
01 Sep 2011 William Thielicke

Hi thefourtheye,
if some areas are completely black, my tool will not be able to calculate a velocity in that areas. So the velocity is not zero in these areas, but it is "not measurable". That is why the tool puts "NaNs" in these areas. In the vector validation, all missing data (=NaNs) is interpolated. I just modified the file piv_FFTmulti.m so that a "0" is placed in black areas instead of a "NaN". If you want me to send you the file, please write an email to
P I V l a b @ g m x . c o m

Comment only
31 Aug 2011 thefourtheye

Hello W Thielicke, your tool is awesome. Thanks for posting it! I have a question about vector validation. I am running your program for wound healing analysis. Before analysis, I apply a binary threshold to my images to decrease noise. When I run the program, there are vectors for the cells, aberrant vectors from cell division, and dots on the denuded areas where no movement occurred. When I select velocity limits and apply them to the frames, the aberrant vectors are replaced by smaller orange vectors, but now the denuded area that should have no movement between frames has small orange vectors too. Why are areas on no movement being assigned vectors when I limit the velocity range? I take care to center my limits on (0,0) on the scatter plot (I will select the area between (-1,1) and (1,-1), for example).

17 Aug 2011 Gareth

Gareth (view profile)

Yes, I've added in a statement to send the data to the workspace and I can now access the data. Thanks!

Comment only
16 Aug 2011 William Thielicke

@Gareth: The histograms and the other statistics plots are done in line 3019 of PIVlab_GUI.m . Just enter the "keyboard" command below this line, and you have access to the data. Is this what you meant? You can also add the assignin command here, so that the data is always sent to your workspace.

Comment only
16 Aug 2011 Gareth

Gareth (view profile)

Hi, this is a great tool, thanks. I have a question though. Not only do I want to see the histograms and graphs that PIV Lab generates, but I'd like get the data it used to generate them. So, if it used axes x and y to generate a histogram, I want those data vectors. Is this possible?

Comment only
21 Jul 2011 Yuyang

Yuyang (view profile)

09 Jul 2011 William Thielicke

Hi there, I have good news: The last days I programmed a multi-pass window deformation PIV algorithm. the results look fantastic, noise is reduced dramatically, peak-locking is reduced, and large gradients and very small interrogation areas are less of a problem. Have a look at for first results. I will do some final tests and upload the update soon.

Comment only
04 Jul 2011 Erman Celik

PIV Lab is the most efficient program that I have ever used. User friendly interface and operation instructions are very useful for quick process. Thanks for this efficient code. Sincerely

15 Jun 2011 William Thielicke

I think loading analyses from external programs will not be possible. Is there no way to decrease the displacement in your analyses? If your flow is more or less homogeneous, you could try to shift the images prior to the analysis. Could you send me some example recordings? Maybe I'll find some time to play around with multipass again, and then I'd need some images where multipass has an advantage.

Comment only
15 Jun 2011 K.Wager

@W Thielicke:
Thanks for your fast answer.
The reason why I need to use multipass is due to my flow conditions (µ-PIV, velocities above 15 m/s).

I am wondering if I could do the cross correlation with my commercial software and load the data afterwards in PIVlab. Is this possible via load PIVlab session? Which format and data are needed?

Comment only
15 Jun 2011 William Thielicke

I did some preliminary multi-pass tests a while ago. I did a normal analysis as first pass, and got a displacement in x and y. In the next pass, I shifted the interrogation areas of the second image using the integer displacement of the first pass and redid the analysis. The result of the analysis didn't change at all after two passes. I think the reason is that I am using a DCC approach for the analysis, but I am not yet sure about this. Maybe, if I'd use a FFT approach, the result would be better with a multipass analysis. Also, if i'd decrease the interrogation area in the second pass, the results would probably not become better, because the analysis would then be based on less pixel information, which might increase noise.

In the latest release (not uploaded yet), I added a feature to draw streamlines in the analyses. Maybe this will be interesting to some of you.

Comment only
15 Jun 2011 K.Wager

I just started to work with PIVlab, but I already think it's way better than the commercial software!

Is there a possibility to do a multipass interrogation with decreasing window size?

Comment only
14 Jun 2011 João Brás

Fantastic work!! your software, work way better than other commercial software in many ways. very useful!

Thank you

João Brás

30 May 2011 Osman Mosa


04 May 2011 sid

sid (view profile)

Thanks a lot!! This will help in rejecting some vectors manually.

Comment only
28 Apr 2011 Liran Oren

Fantastic work!!!
I am getting the same results that the $15k Davis software (from LaVision) gives. Kudos!
How would you compute the pressure field from the results? It seems like the OpenPIV group started working on it, but never finished... Solving the N-S and Poisson equations will give you a ball park that can be good enough for some applications

27 Apr 2011 William Thielicke

Where does it round to zero? In the tools panel when you click on a vector? The velocity display in this panel is just meant for information, not to measure something. But you can search for this line in PIVlab_GUI.m:

set(handles.u_cp, 'String', ['u:' num2str(round((u(info(1,1),info(1,2))*retr('caluv')-retr('subtr_u'))*1000)/1000)]);

and replace the "1000" with a "10000" to get more precise information.

Comment only
27 Apr 2011 sid

sid (view profile)

Very nice tool to work with!!!
Only one problem I faced. It gives values of velocity components zero when the velocities are below or around 0.002 m/s.
Is there any round off error which is causing this problem? How should I solve it?

Comment only
10 Apr 2011 Amitesh

Good work! I hope you can add the option "apply to all frames" in the Statistics and Extractions sections too. When one is trying to extract data using polyline, area, area integral series etc, it would be very useful to be able to do so to all the loaded frames at once automatically. Thank you.

08 Apr 2011 David

David (view profile)

Excellent tool!!!

Extremely user-friendly.
All the useful output variables avaiable.
All the useful data output formats available.

Definitely one of the best tools I've seen in file-exchange. (I felt compelled to register myself, just to place this comment.)

07 Apr 2011 William Thielicke

@all: If you experience problems with this tool, please contact me. I only have two computers (Win7) and one MATLAB version to test it with. The software became pretty complex by now, so it is impossible to me to predict potential problems on all of the possible hardware / OS / MATLAB release combinations.
Nevertheless, I can't promise that I'll always have enough free time to instantly solve your problems.

Comment only
21 Mar 2011 Patrick

Fantastic work!

14 Mar 2011 Khaldon

15 Nov 2010 William Thielicke

Hi Shashi, I am currently working on the next release, and I will add a possibility to change vector thickness.

Comment only
11 Nov 2010 Shashi Thutupalli


This is really nice and works very well for me. Is there a way I can modify the thickness of the vectors etc.


Comment only
24 Sep 2010 Hadi Mohammadi

23 Sep 2010 Hadi Mohammadi

I got another problem, which is the compiling time, I'm just want to plot the velocity profile in sample of code, but it takes too much time and I just cut it off, meanwhile I'm using a new brand laptop and desktop, any idea?

Comment only
22 Sep 2010 Hadi Mohammadi

Hi I was going to use this GUI for tracking the particles and I was succeeded to use it for the first try, then I encountered with an error when I wanted to run it again, the error in MATLAB command line says:
??? Error using ==> guihandles
H must be the handle to a figure or figure descendent.

Error in ==> PIVlab_GUI>switchui at 149

Error in ==> PIVlab_GUI>loadimgs_Callback at 592

Error in ==> gui_mainfcn at 75

Error in ==> PIVlab_GUI at 25
gui_mainfcn(gui_State, varargin{:});

??? Error while evaluating uimenu Callback.

error saving last directory
It would be great if any one can help me to fix this bug.

Comment only
19 Aug 2010 Wouter M

Very nice. I am new to this field of study. I was getting frustrated by the 'professional' software. I tried a few other Matlab PIV-toolboxes, but this one is the best imho.

Again: very nice work! I have two suggestions which I think will be useful. Suggestions: 1) Make all commands available for use in command-line or scripting and add a short documentation. 2) Add possibility to calculate mean flow field and turbulence velocity of a timeseries of images.

Comment only
19 Aug 2010 Wouter M

24 May 2010 1.1

updated description

26 May 2010 1.3

updated credits

31 May 2010 1.4

several slight improvements (search for missing image files, colorbar in exported images etc.)

26 Jul 2010 1.5

Updated products required

18 Nov 2010 1.6

PIVlab 1.1 released. New features added & improvements (see description).

22 Nov 2010 1.7

PIVlab 1.11: fixed a bug with incorrect results for line/ circle/ area extractions when a ROI was applied. Added a feature to calculate mean velocities of the whole session.

23 Nov 2010 1.8

corrected typo...

05 Apr 2011 1.9

PIVlab 1.12:
Changed figure and all UI element units from pixels to points. This hopefully solves some problems with displaying the GUI. Please give me feedback on this.

11 Apr 2011 1.11

PIVlab 1.13: Statistics toolbox no longer necessary thans to the NaN Suite by J. Gläscher.

21 Apr 2011 1.12

Manual vector rejection improvements (PIVlab remembers previously discarded vectors)

26 May 2011 1.13

v1.131: when deleting some vectors manually and then starting a new session, PIVlab ran into problems. This was fixed.

11 Jul 2011 1.14

v 1.2:
*Added a multi-pass window deformation technique for much better PIV results (less noise, better response to gradients, less peak-locking)
*Streamlines added
*Improved image export

11 Jul 2011 1.16

Changed default PIV algo to "multi-pass window deformation"

12 Jul 2011 1.17

Added an example for using PIVlab via the command line:

06 Feb 2012 1.19

See the changes and additional features here:

02 Apr 2012 1.24

version 1.31 updates:

26 Sep 2012 1.27

version 1.32 updates:

30 Jun 2014 1.28

Updates described on

07 Jul 2014 1.29

Added the script 'Accuracy.m' where you can do a simple accuracy test on your system.

24 Oct 2014 1.30

just added link to forum in description

24 Oct 2014 1.31

Added link to the PIVlab forum in the help menu
Updated links to references because my papers / thesis are now published

22 Mar 2015 1.32

PIVlab 1.4: r2014b compatible & several small tweaks

25 Mar 2015 1.33

A compatibility problem with uipickfiles.m and r2015a was fixed (thanks to Douglas Schwarz).

25 Mar 2015 1.34

enabled 'toolbox install'

12 Feb 2016 1.41


Contact us