Skip to content

Instantly share code, notes, and snippets.

View nepomnyi's full-sized avatar

Ivan Nepomnyashchikh nepomnyi

  • EFMRL Oregon State University
View GitHub Profile
@nepomnyi
nepomnyi / customDeen.py
Last active December 15, 2022 19:06
The custom implementation of the PIV image preprocessing algorithm after N. Deen et al., "On image preprocessing for PIV of single- and two-phase flows over reflecting objects", Exp. Fluids, 49(2):525-530, 2010.
import cv2
import numpy as np
def customDeen(frame0,
frame1,
blockOne,
algorithmType = 'basic',
minMaxKernel = (15,15),
minMaxLowLimit = 10,
cliplimit = 2.0,
@nepomnyi
nepomnyi / MinMaxForPIV.py
Last active December 14, 2022 22:53
A python min-max filter implementation after Adrain & Westerweel, "Particle image velocimetry", 2011, p.250.
import cv2
import numpy as np
def minMaxFilter(img, filterSize, minContrast):
"""
After R.Adrian, J.Westerweel, "Particle image velocimetry", Cambridge
university press, 2011. See ch.6.1.2, p.248-250.
Parameters: img (ndarray) - image to be filtered
filterSize (ndarray) - a 1x2 numpy array of the filter height
and width correspondingly