Cross-Correlation for Particle Image Velocimetry (PIV) using MATLAB

  Рет қаралды 51,758

Tanmay Agrawal

Tanmay Agrawal

Күн бұрын

Пікірлер: 111
@Willa1980
@Willa1980 6 жыл бұрын
Hi, this video seems very nice, good work! Cheers, William from PIVlab
@songswrittenbyme
@songswrittenbyme 6 жыл бұрын
Thanks Tanmay for the fluid explanation. This was extremely helpful.
@sreelakshmig1698
@sreelakshmig1698 7 жыл бұрын
It is really very well explained video Tanmay. We are actually looking forward about how to capture shear strain under plane strain condition.
@omarsalem5832
@omarsalem5832 2 ай бұрын
great explanation , thank you!
@yernurchakenov4659
@yernurchakenov4659 4 жыл бұрын
Thanks, very good implementation
@arnabchakraborty6342
@arnabchakraborty6342 7 жыл бұрын
thank you Tanmay, you did great. I am looking to capture strains in an arch. hopefully I shall be able to do it now.
@TanmayAgrawal7
@TanmayAgrawal7 7 жыл бұрын
Good luck. I am glad it helps.
@amonahud3250
@amonahud3250 2 жыл бұрын
@Tanmay ,Your tutorial makes cross cotrelation easy to understand. I am using PIV technique in thermoacoustic device. I acquired data inside a hear exchanger channel by PIV but now I need to stitch 6 data together through Matlab to have images for full channel. Unfortunately, I don't know how to that in matlab as I don't have coding background. Would great if you could help, how can I contact you? Many thanks
@pawandev23
@pawandev23 4 жыл бұрын
good job Mr. Tanmay!
@sreedharmatkm
@sreedharmatkm 7 жыл бұрын
Great video with excellent presentation. Thank you, it helps a lot for beginners like me.
@Alimaliyu
@Alimaliyu 6 жыл бұрын
Fantastic explanation. Very useful.
@alexandradupere5377
@alexandradupere5377 3 жыл бұрын
you just saved my life bro
@kumaruiuc3498
@kumaruiuc3498 7 жыл бұрын
Hello Tanmay Thank you for the video introduction to cross correlation. My background is particle localization and I am new to the field of PIV and therefore I have the following question. I have movies with 3D information of particle flow with time (with less density than your movies so I can do particle localization and particle trajectory linking) and I would like to do their time-dependent PIV. As i understand there is the cross correlation strategy which most people seem to use in 2D and there is the method of localizing particle positions, linking trajectories and therefore getting velocity vectors of each particle which seems to be the approach of some research websites doing 3D imaging and consequent PIV. Is it a common practice in the field to take the approach of cross correlation while doing 2D PIV and not using the same for 3D maybe because the time tomaximize the cross correlation in 3D space is maybe longer? Or is my naive observation not valid?
@roshanjoshi8069
@roshanjoshi8069 3 жыл бұрын
Thank you very much for the video. It was very helpful.
@nabil9223
@nabil9223 4 жыл бұрын
Thanks for these two videos. Can you please uplode the Powerpiont in the discription?
@berkcanozturk655
@berkcanozturk655 3 жыл бұрын
Great video, really helpful.
@Marvelous-b8u
@Marvelous-b8u Жыл бұрын
Hello, I am confused why I always get a peak on the center of correlation matrix
@yogeshwarang2043
@yogeshwarang2043 2 жыл бұрын
can you explain about the multi-pass option to obtain the velocity field of the captured images? Can share any literatutre related to that
@souradippaul7466
@souradippaul7466 5 жыл бұрын
It is a nice video about cross correlation in a image. Can you please explain the displacement part ?
@madepython
@madepython 6 жыл бұрын
Thank you Tanmay
@ChiefEngr-GabsonAcademy
@ChiefEngr-GabsonAcademy 7 жыл бұрын
I am looking for ways to like this video more than once, if not 1million times. Is the 2nd and last video on PIV?
@TanmayAgrawal7
@TanmayAgrawal7 7 жыл бұрын
Thanks for the kind words. Most probably, yes. But at max, there could be one more.
@maheshtom9003
@maheshtom9003 7 жыл бұрын
hello tanmay what correlation is used here. Is it direct correlation or FFT type?
@TanmayAgrawal7
@TanmayAgrawal7 7 жыл бұрын
It is FFT based cross-correlation.
@maheshtom9003
@maheshtom9003 7 жыл бұрын
thanks for the quick reply.to do this cross correlation..do I need to install along with MATLAB additional software like PIV 4 toolbox or PIVlab? or can it be done directly on MATLAB alone?(I have MATLAB 2009)
@TanmayAgrawal7
@TanmayAgrawal7 7 жыл бұрын
No. MATLAB's image processing toolbox is all you need. It contains the inbuilt function normxcorr2 about which you can read more on au.mathworks.com/help/images/ref/normxcorr2.html
@ansumansahu5245
@ansumansahu5245 4 жыл бұрын
as per the point mentioned at 3:56 mins Can you explain how to find the x and y displacements of the center of the window?
@muhammadchoudhry5864
@muhammadchoudhry5864 4 жыл бұрын
I followed your script and I am getting this error: 'Unable to perform assignment because the size of the left size is 1-by-1 and the size of the right side is 2-by-1. Error in cross correlation (line 53) dpx(i,j) = xpeak1 - xgrid(I); ........anyone ? any help would be appreciated!
@yuvanscircle3437
@yuvanscircle3437 7 жыл бұрын
Awesome stuff! I tried running your commands on Matlab, but it's not working. I used an image from google images twice and displaced the particles a little bit in the +y-direction. However, I kept getting the following error: Index exceeds matrix dimensions. Error in CrossCorrelation (line 57) test_imb = imageb((test_xmin-x_disp_max):(test_xmax+x_disp_max),... I realized maybe the images where small or not clear enough. So I tried creating 2 images in Paint with white dots on a black background. However, I got the following error: Error in CrossCorrelation (line 65) dpx(i,j) = xpeak1 - xgrid(i); Please let me know what to do. I am very fascinated by the video!
@TanmayAgrawal7
@TanmayAgrawal7 7 жыл бұрын
Thank you. These errors are usually encountered when there is some problem with the window sizes or when you are doing something wrong with the indexing. I am not sure if the code is universally correct, but a double-checking wouldn't hurt :)
@Abubakrqureshi5075
@Abubakrqureshi5075 4 жыл бұрын
Hi Tanmay, Nice explaination for the topic. If you please explain how did you do the rescaling for the peaks' location. It will highly be appreciated. Thanks,
@TanmayAgrawal7
@TanmayAgrawal7 4 жыл бұрын
It's a shifting of coordinates you can imagine. The way normxcorr2 works is that it gives a zero padding in the system.
@ansumansahu5245
@ansumansahu5245 4 жыл бұрын
Could you explain Line number 61 and 62 of the code ?
@melvinabraham3451
@melvinabraham3451 6 жыл бұрын
Tanmay dude this is a pretty good tutorial , good job Btw, would a 30 fps DSLR or 120 fps Iphone suffice for a small setup ?
@MrKestable
@MrKestable 6 жыл бұрын
I was thinking the same...
@mfoucault1984
@mfoucault1984 7 жыл бұрын
pretty cool man, congrats. Im just trying to change a little bit your code to do the same thing but in polar coordinates, for a fluid in a magnetic agitator.
@TanmayAgrawal7
@TanmayAgrawal7 7 жыл бұрын
Please feel free to do the same. If possible, please share your code which could help others.
@sanjaykalita711
@sanjaykalita711 4 ай бұрын
Can you please tell me logic behind starting from 200 and ending at 864 matlab code line number 20
@nazimbennini9721
@nazimbennini9721 4 жыл бұрын
the sequence at 12:14 reminded me something I was doing some months ago in Matlab using the same image processing functions you're using and I had to do some tests to find out actully that fact about rows and columuns which made my program giving really weird results at first ... Nice video overall Please I have a question, I have read that the computational cost is much higher with direct cross-correlation than for fft cross-correlation. do you know about the fft cross-correlation ?
@TanmayAgrawal7
@TanmayAgrawal7 4 жыл бұрын
FFT works with frequency space. Functions like normxcorr2 take advantage of that.
@8880Blue
@8880Blue 6 жыл бұрын
Its really work. Could you please publish Matlabcode?
@ramavathjagadeesh1030
@ramavathjagadeesh1030 Жыл бұрын
Sir can you please share the Matlab code
@alexanderbraun8742
@alexanderbraun8742 4 жыл бұрын
Nice job, thx.
@kbrajasekarababu3878
@kbrajasekarababu3878 3 жыл бұрын
Bro could you help me to buy the PIV?
@TanmayAgrawal7
@TanmayAgrawal7 3 жыл бұрын
What specifically are you after? What is your budget?
@mostafanagi8406
@mostafanagi8406 5 жыл бұрын
Thanks, but how can i overlay the flow vectors on the image, the coordinates are different
@TanmayAgrawal7
@TanmayAgrawal7 5 жыл бұрын
Can you explain in detail what you meant?
@ahsanzaman1562
@ahsanzaman1562 5 жыл бұрын
How do you interpret the graph you obtained using quiver? what do all those vectors represent? Thanks.
@TanmayAgrawal7
@TanmayAgrawal7 5 жыл бұрын
It plots the two dimensional matrix as a vector plot. In our case, it's a displacement plot you can say for various X and Y locations.
@ahsanzaman1562
@ahsanzaman1562 5 жыл бұрын
Thank you, Tanmay! You're a superstar!
@ahsanzaman1562
@ahsanzaman1562 5 жыл бұрын
@@TanmayAgrawal7 Hello again! I need some help with PIV lab and MATLAB for my project. Is it possible I could discuss that with you in length? Kindly let me know. Regards :)
@lovelyboy1366
@lovelyboy1366 7 жыл бұрын
Thanks for the video. How about 3d cross correlation? Is it easy to use it on 2 images from different angles to extract out of plane displacement? (Z direction)
@TanmayAgrawal7
@TanmayAgrawal7 7 жыл бұрын
I believe you are talking about stereo PIV, is that correct?
@mohammadhdaib3300
@mohammadhdaib3300 5 жыл бұрын
when i was reading some articles about PIV. I read something called planar self-calibration and volumetric self-calibration, are the the same as correlation or an other types of correlation????? thanks a lot for your videos.
@mohammadhdaib3300
@mohammadhdaib3300 5 жыл бұрын
when i tried to find a definition of it. i found it is a method to correct the misalignments between laser light sheet and calibration plane. but i don't have any idea wt is calibration plane and laser light sheet.
@TanmayAgrawal7
@TanmayAgrawal7 5 жыл бұрын
Yes. Calibration during an experiment is to make sure that your data is meaningful once you get it and you can get some sort of reference to measure it against. Correlation on the other hand is a post processing tool.
@sevvalsaregulduren1955
@sevvalsaregulduren1955 3 жыл бұрын
Can we calculate the velocity of the particle according to this?
@TanmayAgrawal7
@TanmayAgrawal7 3 жыл бұрын
This approach provides a spatially averaged (in the window) velocity. For individual particle, please look up Lagrangian approaches.
@sevvalsaregulduren1955
@sevvalsaregulduren1955 3 жыл бұрын
@@TanmayAgrawal7 So average velocity can be find from displacement values over time difference between pictures, right? because I could not see it in the code.
@TanmayAgrawal7
@TanmayAgrawal7 3 жыл бұрын
@@sevvalsaregulduren1955 Precisely! The time difference between the two snapshots is fixed by the camera and the code calculates the displacement between two windows.
@asharmd2001
@asharmd2001 7 жыл бұрын
Hi! Have you calculated turbulent energy dissipation rate from PIV/LDA datas using MATLAB code? Thanks.
@TanmayAgrawal7
@TanmayAgrawal7 7 жыл бұрын
No, sorry.
@asrithpyla606
@asrithpyla606 6 жыл бұрын
How to get 3D plot with correlation coefficient on the z-axis?
@TanmayAgrawal7
@TanmayAgrawal7 6 жыл бұрын
I think you're asking about the surface plot. Use the command surf, that should help.
@manjupoorvi7701
@manjupoorvi7701 6 жыл бұрын
Hlo it's showing error at line 54 as index exceeds matrix dimension
@TanmayAgrawal7
@TanmayAgrawal7 6 жыл бұрын
Please check some of the numbers such as those related to size of the image (pixels). Or the numbers involved in the window. Make sure that the window#2 still lies within the image. Problems might occur when it is close to the boundary, hope that helps
@sameerkosurkar7801
@sameerkosurkar7801 3 жыл бұрын
I have a project related to this, can you just help me with it ?
@TanmayAgrawal7
@TanmayAgrawal7 3 жыл бұрын
Please email me on tanmayagrawal7@gmail.com
@PaulaGarciaRuiz
@PaulaGarciaRuiz 4 жыл бұрын
could you share the tiff files?
@TanmayAgrawal7
@TanmayAgrawal7 4 жыл бұрын
Please write to me on tanmayagrawal7@gmail.com
@raghuvanshnarayan916
@raghuvanshnarayan916 3 жыл бұрын
can u send me the code??
@harshavardhanreddy4671
@harshavardhanreddy4671 2 жыл бұрын
Lqq
@ernestadisi491
@ernestadisi491 6 жыл бұрын
hi, thanks for the vid, would it be possible to ask some questions please via email
@TanmayAgrawal7
@TanmayAgrawal7 6 жыл бұрын
Yes sure. It's tanmayagrawal7@gmail.com
@ernestadisi491
@ernestadisi491 6 жыл бұрын
hi tanmay, is it the correct one please, email wont send
@ernestadisi491
@ernestadisi491 6 жыл бұрын
sorry my mistake, sent it now thank you Tanmay
@SahadevanVigneshN
@SahadevanVigneshN 4 жыл бұрын
@@TanmayAgrawal7 I am receiving error. Could you help me please? Error using normxcorr2>checkSizesTandA (line 272) TEMPLATE must contain at least 2 elements. Error in normxcorr2>ParseInputs (line 242) checkSizesTandA(T,A) Error in normxcorr2 (line 61) [T, A] = ParseInputs(varargin{:}); Error in piv_code (line 52) correlation = normxcorr2(test_ima, test_imb); >>
@shareyguleria54
@shareyguleria54 6 жыл бұрын
Can you please tell how to fit correlation peak with Gaussian curve to determine the peak location approximately and getting position data with some accuracy?
@SGK2325
@SGK2325 5 жыл бұрын
can you share piv images for matlab prg
@muhammadnawaz9818
@muhammadnawaz9818 3 жыл бұрын
Hi Sir! Your videos are very informative. Can you please make a video on how we can perform this experiment in a lab and if we put some flexible vegetation at different location in a channel then on which locations we have to find velocities. Also if you suggest some manuals on how to setup PIV and calculate velocity ? Your response is highly appreciated.
@TanmayAgrawal7
@TanmayAgrawal7 3 жыл бұрын
Look up the book ob PIV by Raffel. That is pretty much everything you'd need.
@mkschreder
@mkschreder 5 жыл бұрын
Talks of windows, windows pops up a useless modal dialog, clicks the dialog, windows derails presentation...
@jasonwong2726
@jasonwong2726 Жыл бұрын
Don't know if I will get a response, but using your code and my images, my test_ima and b arrays appear to be all zeros, why is this the case?
@TanmayAgrawal7
@TanmayAgrawal7 Жыл бұрын
Can you check the start and end indices? Debugging line by line might be the way to go.
@VikiJoker1924
@VikiJoker1924 Жыл бұрын
It seems this process is now made easier with the invention of the MATLAB extension, PIVLab by WIlliam Thielicke, could you make another video if possible using PIVLab?
@deepbhatt2254
@deepbhatt2254 4 жыл бұрын
Hello, Great video bro...but i got an error while running the same programme for a test section can you help me with this
@ashutoshpati7874
@ashutoshpati7874 7 жыл бұрын
Thank you Tanmay.
@arpansow3870
@arpansow3870 3 жыл бұрын
Omg ! This means a lot !! I have learned PIV imaging in just 3 videos ! Amazing ! Thanks @Tanmay
@sumitzanje9660
@sumitzanje9660 3 жыл бұрын
I'm getting following error: Error using normxcorr2>checkIfFlat (line 283) The values of TEMPLATE cannot all be the same. Error in normxcorr2>ParseInputs (line 250) checkIfFlat(T); Error in normxcorr2 (line 61) [T, A] = ParseInputs(varargin{:});
@TanmayAgrawal7
@TanmayAgrawal7 3 жыл бұрын
Hi, I think your template is a uniform matrix with no changes at all. That is why...
@RahmanIITDelhi
@RahmanIITDelhi 2 жыл бұрын
Sir how to calibrate .. .
@ludwigprandtl39
@ludwigprandtl39 4 жыл бұрын
Hello, Tanmay dada, I am from Bangladesh. Can you please tell me what CHC is in terms of PIV analysis? And can its value be negative? like -2? I haven't yet started my PhD. Actually my potential supervisor asked me to do a calculation of determining time averaged velocity field and turbulent kinetic energy from some data which shows the u and v velocity data in different x and y co-ordinates. Can you help me in this?
@TanmayAgrawal7
@TanmayAgrawal7 4 жыл бұрын
Hello. I'm not sure what CHC is since I'm not an expert in PIV. Please consult research papers.
@aathirahvalmaypriyono6954
@aathirahvalmaypriyono6954 4 жыл бұрын
your video is realllyyy save my ass! but may I ask, what is the dimension of your image instant1 and instant2? Since I don't know where 864 and 1696 came from for xgrid and ygrid. Thank you!
@TanmayAgrawal7
@TanmayAgrawal7 4 жыл бұрын
I believe it should be 1080 X 1920. That's where we trimmed the sides to make the dimensions 864 and 1696. Also this is related to the window size so that we are sure that everything fits nicely.
@Rahul-ny4ee
@Rahul-ny4ee 7 жыл бұрын
make some more using dantec if possible
@flowingcode8069
@flowingcode8069 6 жыл бұрын
Thank you very much. It was very helpful. :-)
@ahmadsyazwan6555
@ahmadsyazwan6555 5 жыл бұрын
I have a picture with double frames and i need to change it to individual single frame to do this in piv. Anyone know how?
@TanmayAgrawal7
@TanmayAgrawal7 5 жыл бұрын
A very basic tool could be to use snipping tool of windows to do that. Otherwise you can read the full image in MATLAB using imagesc and then make two matrices out of the one big matrix.
@cwprsselvabalan7872
@cwprsselvabalan7872 3 жыл бұрын
good
@christianarmstrong754
@christianarmstrong754 4 жыл бұрын
Hi, really nice work Tanmay! Just to inundate you with another question, has MATLAB updated its language? I tried to run your code. However in MATLAB 2020a, the matrices: test_ima and test_imb, are not fully populated with values. It seems that the for loop does not iterate past i = 1, filling even that window with arbitrary values. Therefore the normxcorr2 func reports that the template and image values cannot be the same and the script does not advance. Your code obviously runs in MATLAB 2016a as evident in the video, however the exact same code with similar image resolutions does not function in MATLAB 2020a. I understand this is an older video, however any advice would be great. Thanks.
@TanmayAgrawal7
@TanmayAgrawal7 4 жыл бұрын
Not sure what's going on there. I haven't run it in my current version of MATLAB. Please have a look manually what's going wrong and more importantly, why the two matrices are of similar size.
@christianarmstrong754
@christianarmstrong754 4 жыл бұрын
@@TanmayAgrawal7 Thank you for your reply. After some experimenting with the code, I found an embarassingly simple cause of error. The template image had areas of identically dark areas where pixel values were uniform. When the first window of the template tried to be compared with that of the subsequent image, MATLAB was identifying the entire image to be the same. Reframing the template to cover a more complex area of system (with regards to the 2D signal produced) and/or changing the window size rectified the issue. Thanks again for your help. Best wishes, Christian
@mehbubbasha2615
@mehbubbasha2615 4 жыл бұрын
hii, thank you for the introduction to cross correlation, can we find the voricity by defining the density of vectors? or else can you help to explain how to find vorticity of the flow field.
@TanmayAgrawal7
@TanmayAgrawal7 3 жыл бұрын
You need to calculate vorticity the mathematical way, using gradients, after calculating velocity.
@solnik6236
@solnik6236 5 жыл бұрын
hi .thanks for video its realy helpfull . I'm using your code but i have a problem that i couldn't find answer for it can you help me ? at the line of 63 dpx(i,j)=xpeak1 - xgrid(i); i have an eror : "Assignment has more non-singleton rhs dimensions than non-singleton subscripts" how i can fix it ? it says the dimensions doesnt match but i cant accept that . i tryed this code on 2014 2016a 2017b matlabs and all of them had this error .
@TanmayAgrawal7
@TanmayAgrawal7 5 жыл бұрын
This is a very common problem and is usually encountered when the size of windows/image do not match their counterparts. OR. When you are trying to assign a matrix to another which is not of same size. Please do careful debugging. It should be solvable.
@santiagocanozapata9572
@santiagocanozapata9572 5 жыл бұрын
Hola, ¿lo lograste solucionar?
@nesbittwei6307
@nesbittwei6307 4 жыл бұрын
3:27 "Ah Oh" cutie pie lol
@ASHISHKUMAR-be7ly
@ASHISHKUMAR-be7ly 6 жыл бұрын
thanxx tanmay :)
Part 2: Convolution and Cross-Correlation - G. Jensen
15:06
caltech
Рет қаралды 194 М.
Which One Is The Best - From Small To Giant #katebrush #shorts
00:17
Please Help This Poor Boy 🙏
00:40
Alan Chikin Chow
Рет қаралды 14 МЛН
K-means & Image Segmentation - Computerphile
8:27
Computerphile
Рет қаралды 296 М.
Fundamentals of Speckling for DIC
13:11
Correlated Solutions
Рет қаралды 3,6 М.
OpenAI’s New ChatGPT: 7 Incredible Capabilities!
6:27
Two Minute Papers
Рет қаралды 190 М.
Image Processing Made Easy - Previous Version
38:40
MATLAB
Рет қаралды 501 М.
PIV Cross-Correlation
17:29
Luftvis Science
Рет қаралды 4,6 М.
Image Matching using Cross Correlation (Cyrill Stachniss, 2021)
53:07
Cyrill Stachniss
Рет қаралды 18 М.
Terence Tao at IMO 2024: AI and Mathematics
57:24
AIMO Prize
Рет қаралды 403 М.
Cross Correlation Demo using Matlabs xcorr function
9:33
David Dorran
Рет қаралды 148 М.