How to advect first-image pixels to second-image time with PIV velocity?

27 views
Skip to first unread message

Brian Mapes

unread,
Sep 10, 2022, 2:29:08 PM9/10/22
to openpiv-users
The 2D PIV velocity field looks good from my data using the first tutorial notebook. Hooray! 

But what I really want is an Eulerian field of the Lagrangian tendency: isolating the development of convection cells, wave modulations, etc. That is, I want to subtract from image2 an image composed of the image1's pixels, shifted according to the PIV-derived velocity (or really, displacement) field. 

I can see ways how I could proceed, using the output coarse V field to shift and write sliced-out patches of values from image1 into a full-resolution dummy array. There would be gaps to fill where the flow is divergent, and overlaps to resolve somehow where it is convergent. 

If I used buffer zones or "overlap" then I could avoids gaps and only have to resolve overlaps. As a programmer, I could do something from scratch. 

winsize = 32 # pixels, interrogation window size in frame A
searchsize = 38  # pixels, search in image B
overlap = 12 # pixels, 50% overlap


But am I reinventing the mousetrap here? Does someone already have an elegant code? Or the right words to use to improve my google-fu about finding more? 

 

Brian Mapes

unread,
Sep 10, 2022, 3:05:31 PM9/10/22
to openpiv-users
For definiteness, here is the movie I am trying to decompose into advection + evolution + waves:


and here is the OpenPIV tutorial used naively: quite successful in the vectors matching my eyes:  

Alex Liberzon

unread,
Sep 10, 2022, 4:06:04 PM9/10/22
to openpiv-users
Just read the source code of windef - it's doing precisely this, but in the opposite direction - from coarse to fine


if need more inputs, make your repo fork, and mention me in the issue

Alex Liberzon

unread,
Sep 10, 2022, 4:28:51 PM9/10/22
to Brian Mapes, openpiv-users
Just a note - you can use MP4 directly, see some examples on openpiv-python-examples


--
You received this message because you are subscribed to the Google Groups "openpiv-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpiv-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openpiv-users/55587a8e-70ce-4f94-a436-dea387a3acbdn%40googlegroups.com.

Brian Mapes

unread,
Sep 10, 2022, 4:37:14 PM9/10/22
to Alex Liberzon, openpiv-users
Reply all
Reply to author
Forward
0 new messages