pydic, a python suite for local digital image correlation
pydic is a free and easy-to-use python tool for digital image correlation (DIC). Note that pydic is not a
graphical application. pydic is a python module, named
pydic.py, delivered with
didactic examples that may be used as tutorials.
From a set of pictures, pydic can compute the displacement and the strain fields inside a zone of interest. If you want to learn more about digital image correlation, you can visit the wikipedia page. Note that the method used here is said as local digital image correlation.
The main problem with the local digital image correlation is the induced noise. pydic embeds a set of numerical tools for reducing this noise and computing smoothed strain fields. Another interesting feature of pydic is the capability to compute displacement and strain fields from a non-grid-aligned set of points. This feature may be useful to optimize the digital image correlation and let automatic choosing best points for DIC thanks to algorithms such as the goodFeaturesToTrack from the opencv library.
pydic is based on matplotlib, numpy, scipy and opencv2. You have to install these libraries to use pydic. Generally, matplotlib, numpy, and scipy are embedded in the main python packages such as python(x,y) or available in the standard package repositories of the main GNU/Linux distributions.
The opencv2 library is a powerful library for image processing with python bindings.
The DIC processings are managed by this library. Probably, you need to compile manually
the opencv2 library. The installation and compilation procedure of opencv2 are
detailed in the official tutorial page about opencv2. Once you have done this work, you can
download the pydic package and go to the
examples directory to run the tensile test or the four point bending test examples.
Running the four point bending test example
Go to the
examples/4-pt-bending-test and simply run with python the
main.py file. This
shows how to use pydic for :
- reading a picture series and run the DIC with the
pydic.init()method. This method ends by writing a separated result file
- reading the
*.dicfile and compute (and eventually smooth) the displacement and strain fields with the
pydic.read_dic_file()method. This step write a series of results files. These files are located in the
imgfolder where :
dispfolder contains pictures that paint the displacement fields
gridfolder contains pictures that paint the displacement grids
markerfolder contains pictures that paint the displacement of the correlated windows
resultfolder contains csv result files. These files can be used to post-treat the results given by the DIC with your favorite tool such as spreadsheet software.
- plotting strain field interactive maps thanks to matplotlib
- using meta-data file to store sensor data for each picture such as the loading force
- using the power of the python language to make complex post-treatment such as automatically computing the Young's modulus from strain fields and meta-data.
Quick overview of result image files : disp, grid and marker files
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Feel free to contact me at