piv_overlay#
Generate PIV arrow overlayed images for PIV visual inspection and illustration.
Syntax
python piv_overlay.py matDir imgDir [optional args]
matDir – compact PIV data file (.mat) directory
imgDir – tiffstack image file (.tif) directory
output_width (optional) – specify the width of output overlay images (pixels). Default is 300. To use, do
--width 300
.videofps (optional) – specify the framerate of the output video. Default is 20.
Test
python piv_overlay.py test_images\piv_drop test_images\piv_drop --width 300 --videofps 20
Edit
Jan 03, 2022 – (i) move from PIV to script, (ii) set scale, (iii) update docstring, (iv) minor structural changes
Note
See PIV technical report Sec II.A.1 for the reasoning of scale settings.
Jan 22, 2022 – reduce scale by 1.5 to increase the arrow size
Mar 03, 2022 – (i) Use droplet_image class to rewrite the script, (ii) remove logging
Jan 05, 2023 – Adapt myimagelib import style.
Feb 08, 2023 – Rewrite in function wrapper form, to make autodoc work properly. (autodoc import the script and execute it, so anything outside
if __name__=="__main__"
will be executed, causing problems)Apr 27, 2023 – (i) Stop using
droplet_image
class for making PIV overlay. Making PIV overlay is necessary in multiple projects and should be made more general. (ii) In this edit, we use tiffstack and compact PIV as the standard input for this script. In future versions, nd2 should also be legit input images. (iii) Sparcity argument is disabled temporarily. (iv) rewrite commandline argument parser with argparse module.Apr 28, 2023 – (i) make avi videos and delete jpg files, (ii) no longer require output_folder. Instead, always store the .jpg files in piv_folder/output first, and then convert the .jpg stack into .avi movie. The .avi will be saved in the same folder as the .mat PIV data files. The .jpg images will be deleted after the .avi video is generated.