pyidi is a python package for displacement identification from raw video.
Currently the pyIDI method works with Photron
.cihx files, however,
also be passed as
cih_file argument. If an array is passed, it must have a shape of:
(n time points, image height, image width).
The basic usage of the package is presented.
Loading the video¶
First create the
video = pyidi.pyIDI('filename.cih')
Setting the points¶
Displacements are computed for certain points or certain regions of interest that are represented by a point.
Points must be of shape
n_points x 2:
points = [[1, 2], [1, 5], [2, 10]]
where the first column indicates indices along axis 0, and the second column indices along axis 1.
The points must be passed to
Setting the method¶
The method for displacement identification must be selected:
video.set_method(method='sof') # Simplified optical flow method
After the method is selected, the arguments can be configured. Note that the docstring is now showing the required arguments for the selected method.
For more details on the available methods, see the currently implemented Displacement identification methods.
Finally, displacements can be identified:
displacements = video.get_displacements()
The settings of the analysis and the identified displacements are saved in a directory next
to the loaded
Directory content before the analysis:
Directory content after the analysis:
Loading saved analysis¶
The saved analysis can be loaded using the
analysis_path = 'video_to_analyze_pyidi_analysis/analysis_001' video_loaded, info_dict = pyidi.load_analysis(analysis_path)
Now we can access the
video_loaded attributes, e.g.: