pyIDI#
Image-based Displacement Identification (IDI) from high-speed video, in Python.
pyIDI reads a recording, tracks the points you select, and returns their
sub-pixel displacement history — an array of shape
(n_points, n_frames, 2) you can feed straight into a modal analysis.
from pyidi import VideoReader, LucasKanade
video = VideoReader('measurement.cih')
lk = LucasKanade(video)
lk.set_points(points=[[150, 200], [150, 260], [150, 320]])
lk.configure(roi_size=(21, 21))
displacements = lk.get_displacements() # (n_points, n_frames, 2), in pixels
Install pyIDI, load a video, select points and run your first identification.
Simplified Optical Flow, Lucas-Kanade, Directional DIC and full-field DIC — what each one is for and how to configure it.
The SelectionGUI: draw a region, score the whole image, and let
the selection find the best-separated features inside it.
Eulerian video magnification for pre-test motion visualization, and mode-shape magnification of identified displacements.
Every public class and function, generated from the source.
Coming from 1.3.3 or from the pre-1.0 pyIDI class? Start here.
What pyIDI does#
Photron .cih/.cihx, Phantom .cine, Pharsighted .SLOW,
image sequences, ordinary video files, and plain
numpy.ndarray stacks — behind one
VideoReader interface.
Four identification methods, from a fast whole-field gradient estimate to an iterative full-field DIC solve, sharing one configuration, checkpointing and result-saving framework.
The Lucas-Kanade inner loop is compiled with numba and runs
across threads or processes, with crash-resistant checkpointing for
long analyses.
Citing pyIDI#
If you use pyIDI in your research, please cite the article behind the method you used:
Masmeijer, T., Habtour, E., Zaletelj, K., & Slavič, J. (2024). Directional DIC method with automatic feature selection. Mechanical Systems and Signal Processing, 224. https://doi.org/10.1016/j.ymssp.2024.112080
Čufar, K., Slavič, J., & Boltežar, M. (2024). Mode-shape magnification in high-speed camera measurements. Mechanical Systems and Signal Processing, 213, 111336. https://doi.org/10.1016/J.YMSSP.2024.111336
Zaletelj, K., Gorjup, D., Slavič, J., & Boltežar, M. (2023). Multi-level curvature-based parametrization and model updating using a 3D full-field response. Mechanical Systems and Signal Processing, 187, 109927. https://doi.org/10.1016/j.ymssp.2022.109927
Zaletelj, K., Slavič, J., & Boltežar, M. (2022). Full-field DIC-based model updating for localized parameter identification. Mechanical Systems and Signal Processing, 164. https://doi.org/10.1016/j.ymssp.2021.108287
Gorjup, D., Slavič, J., & Boltežar, M. (2019). Frequency domain triangulation for full-field 3D operating-deflection-shape identification. Mechanical Systems and Signal Processing, 133. https://doi.org/10.1016/j.ymssp.2019.106287
The package itself is archived on Zenodo: https://doi.org/10.5281/zenodo.4017153