Skip to main content

Python Image Displacement Identification.

Project description

Documentation Status example workflow

pyidi

Image-based Displacement Identification (IDI) implementation in python.

See the documentation for pyIDI.

Now version 1.0!

In version 1.0, we overhauled the package API. With growing usage in IDEs other than jupyter notebooks, we have made the package more user-friendly. The new API allows the autocompletion and documentation of the package to be more accessible in IDEs like VSCode, Cursor, PyCharm, etc.

To install the new version, use the following command:

pip install pyidi

or to upgrade (if already installed):

pip install -U pyidi

Whats different?

For the user, the main difference is that instead of calling the pyIDI class where the method is set, first, the VideoReader class is called. Then, this instance is passed to the specific method class. Here is an example:

from pyidi import VideoReader, SimplifiedOpticalFlow

# Read the video
video = VideoReader('video.cih')

# Pass the video to the selected method class
sof = SimplifiedOpticalFlow(video)

sof.set_points(points=[[0, 1], [1, 1], [2, 1]])
sof.configure(...)
displacements = sof.get_displacements()

The methods themselves have not changed, only the way they are called. Unfortunately, this breaks the backward compatibility with the previous version. We apologize for any inconvenience this may cause. To keep using the old version, please install the package with the following command:

pip install pyidi==0.30.2

or use the legacy pyIDI class:

from pyidi import pyIDI

Note that the legacy pyIDI class does not necessarily offer the full functionality of the new version. The legacy pyIDI class is only kept for compatibility with the old version and will not be updated.

Use Napari UI for quick displacement identification:

BASIC USAGE:

Run GUI by instantiating GUI class (input is VideoReader object):

from pyidi import VideoReader, GUI

# Read the video
video = VideoReader('data/data_synthetic.cih')

# Run GUI
gui = GUI(video)

Method class (e.g. SimplifiedOpticalFlow) is instantiated during the use of GUI. It is accessible in gui.method. To get displacements:

method = gui.method
displacements = method.displacements

The pyIDI method works with various formats: .cih, .cihx, .png, .avi etc. Additionally, it can also work with numpy.ndarray as input. If an array is passed, it must have a shape of: (n time points, image height, image width).

Set the points where displacements will be determined:

p = np.array([[0, 1], [1, 1], [2, 1]]) # example of points
video.set_points(points=p)

Or use point selection UI to set individual points or grid inside selected area. For more information about UI see documentation. Launch viewer with:

DEVELOPER GUIDELINES:

  • Add _name_of_method.py with class that inherits after IDIMethods
  • This class must have methods:
    • calculate_displacements with attribute displacements
    • get_points (static method - sets attribute video.points)
  • In pyIDI add a new method of identification in avaliable_methods dictionary.

Citing

If you are using the pyIDI package for your research, consider citing our articles:

  • 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

DOI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyidi-1.3.2.tar.gz (73.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyidi-1.3.2-py3-none-any.whl (94.3 kB view details)

Uploaded Python 3

File details

Details for the file pyidi-1.3.2.tar.gz.

File metadata

  • Download URL: pyidi-1.3.2.tar.gz
  • Upload date:
  • Size: 73.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyidi-1.3.2.tar.gz
Algorithm Hash digest
SHA256 700c93c3cd95f2740e652f3f53e921abb7ef932cd1591101184527e485d75ffb
MD5 ba9f2c477031ea341fdde7be9ab6ccdf
BLAKE2b-256 8cd763b44b38680098d24edea0cee2164c18747923e53f76dda436df6fe71252

See more details on using hashes here.

File details

Details for the file pyidi-1.3.2-py3-none-any.whl.

File metadata

  • Download URL: pyidi-1.3.2-py3-none-any.whl
  • Upload date:
  • Size: 94.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyidi-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 107bf4eba5294f11459e763de30b1a33f6291e0a5e3f0939fd2e2f8057773e2f
MD5 e617ffbb83b1ee3eaecedda4e00cc0cf
BLAKE2b-256 5fe7e38ebaac1bec6738a82a97acc1567d98e44643067e37dd09e1b6ba684421

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page