We may disclose the functionalities for an audience around a class with some options. Some possible pseudo-code below. Thoughts are much welcome.
class IWaVE:
def __init__(
resolution: float = 0.01,
window_size: int = 64,
fps: Optional[int] = None,
frames: Optional[np.ndarray] = None, # you can directly provide an existing set of frames in NxXxY dimensions
fn_video: Optional[str] =None # or provide a video from which frames are extracted
):
# Set the attributes
....
# several properties may be useful
@property
def dims(self):
# estimate the nx ny amount of windows
@property
def ...
def load_video(
self,
fn_video: str,
start_frame=0,
end_frame=None
):
# load video into memory(perhaps use dask?)
....
self.frames = frames
def _rearrange_frames(self):
# get frames rearranged to window x time x X x Y format
...
self._arr_frames = arr_frames
def _fourier(self):
# perform fourier transform on rearranged frames (check if field exists)
if not(hasattr(self, "_arr_frames")):
raise ValueError("IWaVE object does not yet have an arranged set of frames, ensure _rearrange_frames has been
run")
...
self._velo_spectrum = velo_spectrum
def _optimize_velocimetry(self):
# perform optimization of velocimetry vector estimation using fourier analysis
if not(hasattr(self, "_arr_frames")):
raise ValueError("IWaVE object does not yet have a velocimetry spectrum analysis, ensure _fourier has been run")
...
# set velocimetry
self.v_x = ...
self.v_y = ....
def velocimetry(self):
# perform entire velocimetry process
...
self._rearrange_frames()
self._fourier()
self._optimize_velocimetry():
We may disclose the functionalities for an audience around a class with some options. Some possible pseudo-code below. Thoughts are much welcome.