correlation matrices after ensemble correlation

20 views
Skip to first unread message

Gladys Diaz

unread,
Feb 16, 2026, 7:02:05 AMFeb 16
to PIVlab
Hi William,
I've been using PIVlab for a couple years now, trying to get the velocity of RBCs in a microchannel. We are using ensemble correlation with 100 pairs of images. I am doing 3 passes with sizes of 16, 8 and 8. 
We are getting an overestimation of the velocity close to the walls, and we believe it is due to the high shear and a higher variability of velocities inside the interrogation window, so we were interested in seeing the correlation matrices and the shape of the correlation peak. 
I have tried to save the matrices in piv_FFtensemble but they all seem to show a displacement of ~0, so I believe I am saving the wrong matrix. 
I am currently saving result_conv_ensemble after line 850. I tried changing do_correlation_matrices to 1 in PIVlab_GUI but it wasn't saving anything. 
I am using PIVlab 3.10 in matlab 2025a
Any help would be much appreciated 
Thanks! 
Gladys Diaz 

William

unread,
Feb 16, 2026, 7:34:51 AMFeb 16
to PIVlab
Hi, I can check this later. But what is the displacement in pixels in your images? 16 px as interrogation area seems very small. And you should not have two passes with the same size, as this will only increase noise.

Gladys Diaz

unread,
Feb 16, 2026, 7:54:14 AMFeb 16
to PIVlab
Hi William, 
My displacement depends on the location in the channel. They should all be between 1 and 4 pixels. My windows are small because we are trying to get as many vectors in the radial direction and our channel is 68 pixels wide, so my images are 68x5000 pixels. I can reduce my passes to only two

William

unread,
Feb 16, 2026, 3:22:41 PMFeb 16
to PIVlab
Hi, when I uncomment these lines in piv_FFTensemble, then I get all correlation matrices in Matlabs workspace as soon as the analysis finishes:
%% Write correlation matrices to the workspace
%{
try
counter=evalin('base','counter');
counter=counter+1;
assignin('base','counter',counter);
all_matrices=evalin('base','all_matrices');
all_matrices{end+1}=result_conv_ensemble;
assignin('base','all_matrices',all_matrices);
disp('appended matrix')
catch
assignin('base','counter',1);
all_matrices{1}=result_conv_ensemble;
assignin('base','all_matrices',all_matrices);
disp('created new matrix')
end
%}

Erfan Saeedian Sar

unread,
Feb 26, 2026, 9:44:27 AM (7 days ago) Feb 26
to PIVlab
Hello Dear William, 

I have been using the PIVlab in my research for internal combustion engine (thanks for the fantastic app, it makes life much easier:), and for uncertaitny analysis of PIV based on some scholars (like Vlachos,2013 paper on PIV uncertainty based on correlations peak), I need to have full access to the correlation matcies, from the method Multipass FFT windows deformation. Is there a similar way to have access ot it? I tried to modfiy the codes a bit, but got no resluts so far. 

Thanks for time and help,
Erfan

thielickeoptolution

unread,
Feb 26, 2026, 9:53:15 AM (7 days ago) Feb 26
to PIVlab
Hi, afaik, you just set do_correlation_matrices to 1 in PIVlab_GUI.m That is only possible when using Matlab. Then they should appear in the matlab workspace.

Erfan Saeedian Sar

unread,
Feb 26, 2026, 10:09:53 AM (7 days ago) Feb 26
to PIVlab
Hello, Thanks for the response. It works now! 
Reply all
Reply to author
Forward
0 new messages