How do I use Open PIV (Particle Image Velocimetry) interface in MATLAB for 2 circular images?

19 views (last 30 days)
A quick background on PIV:
Open PIV (Particle Image Velocimetry) is a open source MATLAB version for analyzing the velocity profiles of pixels in 2 snapshots of a dynamic flow. You can refer this link for a quick background on PIV and download the module along with the tutorial (don't worry it is very short and easy).
The PIV tutorial quite concisely explains how to use the GUI interface. The test files (given along with the PIV totorial) can be loaded and run to check its working and to see the corresponding velocity vectors.
My question:
Now the problem is when I try load and run the actual images on which I seek the velocity vectors, they don't even load. Here is the error that I don't understand. I am also attaching here the images on which I need the velocity profiles. I would be very much obliged if somebody can help me with this.
_Error using ==> minus Matrix dimensions must agree.
Error in ==> openpivgui>ReadImageDirectory at 1220 firstDif = find(handles.files{2}-handles.files{1},1,'first'); % how the first two files are different?
Error in ==> openpivgui>load_Callback at 409 handles = ReadImageDirectory(handles);
Error in ==> gui_mainfcn at 96 feval(varargin{:});
Error in ==> openpivgui at 44 gui_mainfcn(gui_State, varargin{:});
Error in ==> @(hObject,eventdata)openpivgui('load_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uimenu Callback_
The images I used are given below. If the images are not appearing on your screen then please copy the image URL and paste it in the address bar in a new tab.

Accepted Answer

Image Analyst
Image Analyst on 3 Sep 2013
It looks like in this expression "handles.files{2}-handles.files{1}" they're trying to subtract images and find the linear index of the first pixel that is different between the two. The error says that the image in files{2} is not the same size or number of color channels as the image in files{1}. Make sure all your images are the same size, since it seems to require that.
  3 Comments
Image Analyst
Image Analyst on 5 Sep 2013
Put this after you get each image
[rows, columns, numberOfColorChannels] = size(yourImage)
and see what it reports back to the command window for each image. You should see that not all images have the same values.
Amal
Amal on 9 Sep 2013
Hi Image Analyst
Thanks for telling how to check the size. Indeed they were differing and that was the main problem. But I have only 3 different sizes so now I can load the images of the same size and proceed.
Again thanks a lot. Your answer really helped.
Regards

Sign in to comment.

More Answers (0)

Categories

Find more on Fluid Dynamics in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!