Assessment of valid window size and overlap

41 views
Skip to first unread message

brouwe...@gmail.com

unread,
Oct 25, 2022, 8:45:44 AM10/25/22
to openpiv-users

Hi,

 I am using the OpenPiv script on consecutive images created with ultrasound. The width of the images is therefore limited to the width of the ultrasound array, in my case only 13.8 mm.

 The scaling factor is 10 pixels/mm.

 Due to the limited width of my images, I need to be careful in choosing the interrogation window size and the overlap. If the windows are to large, the script will not run and stop with the error message: “(my>ky) failed for hidden my: regrid_smth:my=2“. 

I can compensate this by also increasing the overlap, but also here there is a limit.

Meanwhile I found some combinations of window size and overlap that do work, see table below:

Window sizes | Overlap | Works?
48, 24, 12 | 24, 12, 6 | Yes
56, 28, 14 | 28, 14, 7 | No
56, 28, 14 | 32, 16, 8 | Yes
64, 32, 16 | 32, 16, 8 | No
64, 32, 16 | 40, 20, 10 | Yes
72, 36, 18 | 48, 24, 12 | No
72, 36, 18 | 56, 28, 14 | Yes

However, I don’t understand how it is assessed if the combination of window size and overlap will work for the images or not. Can someone clarify this or provide me with a reference where this is elaborated?  

 

Thanks in advance

Alex Liberzon

unread,
Oct 25, 2022, 8:59:12 AM10/25/22
to brouwe...@gmail.com, openpiv-users
Hi,

could you show us a pair of images? the important question is about the image size in pixels - it seems that some combinations fail because of number of columns and some because the number of rows. I'm also not sure whether word "works" corresponds to the same error message?
 

--
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/df4f1588-d4aa-45e8-b9c5-1e9977e58963n%40googlegroups.com.

brouwe...@gmail.com

unread,
Oct 25, 2022, 9:14:26 AM10/25/22
to openpiv-users
Hi Mr. Liberzon,

Thank you for your fast reply.
Enclosed you can find a pair of images 

Their size is 80.1 mm high and 13.9 mm wide

By "works", I want to indicate whether the script runs or not and results in the aforementioned error message.

Kind regards,

Bart 
Op dinsdag 25 oktober 2022 om 14:59:12 UTC+2 schreef alex.l...@gmail.com:
A125b.tif
A125a.tif

Alex Liberzon

unread,
Oct 25, 2022, 5:46:34 PM10/25/22
to openpiv-users
Hi,

the issue is simple, for the largest window size and corresponding overlap size the number of interrogation windows per width is less than 4 and tfor those cases the interpolation of 3rd order polynomial fails.

See here:


if you want to predict which one would work or not, use `get_rect_coordinates(image_shape, window_size, overlap)` and check if the minimum dimension is less than 4.

e.g.

```
x,y = get_rect_coordinates(frame_a.shape, settings.windowsizes[0], settings.overlap[0])
print(f'for {settings.windowsizes[0]},{settings.overlap[0]} the shape to be interpolated is {x.shape}')
print(f'if number of vectors is smaller than 4 it will fail: {min(x.shape)}')
```

brouwe...@gmail.com

unread,
Oct 26, 2022, 3:23:55 AM10/26/22
to openpiv-users
Thanks Alex, this is clear for me now.

Kind Regards,

Bart

Op dinsdag 25 oktober 2022 om 23:46:34 UTC+2 schreef alex.l...@gmail.com:

brouwe...@gmail.com

unread,
Oct 28, 2022, 3:04:59 AM10/28/22
to openpiv-users
Hi,

As I now understand how this assessment works, I am able to process higher velocities by increasing not only the window size but also the overlap.

However, in different literature and manuals I see the following "rules/recommendations":
  • An overlap of 50% of the window size is advised
  • The values for overlap have to be values of base 2

With window sizes of (100, 50, 25) and overlap (88, 44, 22), there are sufficient vectors to run the script. Also the results are OK and correct. Nonetheless I do not comply with the above mentioned rules/recommendations.

Are these two rules/recommendations maybe superseded? 
Does someone know where they originate from and why they don't mess up my results (As I thought they would)?

Thanks in advance!

Kind regards,

Bart


Op woensdag 26 oktober 2022 om 09:23:55 UTC+2 schreef brouwe...@gmail.com:

Alex Liberzon

unread,
Oct 28, 2022, 6:28:55 AM10/28/22
to brouwe...@gmail.com, openpiv-users
50% overlap is recommended from the point of view of statistics and the validity of the result. very high overlap means over-sampling of the same data (same particles contribute to more neighbour vectors), and low overlap means the increased loss of particles near the borders of interrogation windows.

power of 2 recommendation is based on the speed of FFT. 

So there is no restriction, as you see, in openpiv to choose any overlap you want, as we don't think it's a universal or strict condition. In the GUI version, though, the choice is not always infinite if the user only selects a set of possible values from a list of options. there we'll probably limit it to some set of fixed values of power of 2

regards

No

You received this message because you are subscribed to a topic in the Google Groups "openpiv-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openpiv-users/6WvQN6ThoGU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openpiv-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openpiv-users/d2c56b9a-7a8a-41ba-9a26-232517172089n%40googlegroups.com.

Erich's Lab

unread,
Oct 28, 2022, 3:33:52 PM10/28/22
to openpiv-users
Hi all,

I just want to add some information about that error message mentioned in the original post. That error message is caused when the number of interrogation windows in either of the axes are too low. The spline interpolation algorithm (netlib fitpack) will fail if there are less than 3  (5 for a higher order interpolation) points in each axes to interpolate on. It is best to have at least 5-8 interrogation windows per axes so everything works properly and to attain better accuracy or precision.
Reply all
Reply to author
Forward
0 new messages