Pytorch implementation of StrainNet-3D.
(Including training codes of SubpixelNet and RefineNet, and the affine-transformation-based 3D displacement calculation workflow)
- A CNN-based 3D displacement calculation method for stereo speckle images. (To realize real-time and high-precision 3D-DIC)
- Method work flow:
- Simulated stereo speckle images with displacement labels (to train or to evaluate this method) can be found in my another repository Here
- Core CNN used to calculate subpixel displacement: A light-weight CNN named SubpixelCorrNet (Architecture shows below).
- For algorithm details and the principles, please see Wang et al., 2022
- python38
- opencv-python (4.4.0 used)
- numpy (1.22.1 used)
- torch with cuda (torch1.9.0+cu111)
- Train the networks
- Run
Train_FlowNet.py - If you want to train FuseNet, displacement cache file calculated by SubpixelCorrNet should be generated first.
- If you want to generate your own training dataset, please refer to the Stereo Speckle Generator
- Run
- 2-D displacement (and deformation) calculation
- Run
DispCalculator2D.py, remember to shift the model filepath and the image filepath to your own ones. - Strain calculation using gradient filter technique is provided.
- Run
- 3-D displacement (and deformation) calculation
- Run
DispCalculator3D.py, remember to shift the model filepath and the image filepath to your own ones. - The calibration parameters and other settings should be set correctly.
- Simple strain calculation code using gradient filter is provided.
- Run
- Pre-trained parameter file of SubpixelCorrNet can be download from Google drive.
-
Experimental speckle images calculation in extreme light conditions.
-
Light-changing real-time displacement monitoring demo. The Realtime demo video can be found here
@article{WANG2022107184,
title = {StrainNet-3D: Real-time and robust 3-dimensional speckle image correlation using deep learning},
journal = {Optics and Lasers in Engineering},
volume = {158},
pages = {107184},
year = {2022},
issn = {0143-8166},
doi = {https://doi.org/10.1016/j.optlaseng.2022.107184},
url = {https://www.sciencedirect.com/science/article/pii/S0143816622002378},
author = {Guowen Wang and Laibin Zhang and Xuefeng Yao}