An openCV based Python project for processing Kerr microscopy image. KerrPy is used to extract ellipse fits of bubble domains created under the application of out-of-plane and in-plane fields. These fits are used to estimate the underlying Dzyaloshinskii Moriya interaction (DMI)
-
Anaconda (preferably 64 bit) for managing Python environments.
-
A Python environment
-
Installation of dependencies
Every Python project is recommended to have a separate python environment. There are two ways to create a new environment.
A walkthrough of the installation is given in YouTube video of installation walkthrough
-
Activate the environment
-
Install packages in the environment
core packages | image processing packages | IDE packages |
---|---|---|
numpy | opencv | spyder |
scipy | ||
matplotlib |
Anaconda maintains "channels" for storing repositories.
Core packages are available in standard/default channel.
So can be directly downloaded
whereas
opencv is only present in "conda-forge" channel.
Update: The default channel also provides
opencv
.
conda-forge is a community maintained channel. The community is comprised mostly of researchers. So we need to add conda-forge channel to the environment.
Newer versions of Anaconda has opencv
in the default channel
So no need to add conda-forge
However latest versions of opencv
may not be supported in the default.
However we will install the default channel version.
-
through command line. Use the
environment.yml
in the top level directory.conda env create -f environmentKerrPy.yml
-
activate the environments
conda activate envKerr
-
As we need an interactive backend to select a Region of Interest (ROI), Spyder has to be configured to use the Qt5 backend.
Tools > Preferences > IPython Console > Graphics > Qt5 backend
-
Then the first file to configure is the
globalVariables.py
. It has the following categories of parameters- Training parameters,
- File handling parameters,
- Flag parameters,
- Matplotlib parameters, and
- Image parameters
These parameters are self-explanatory. For additional information, refer to the adjoining comments.
Now run the scripts in the following order
- processDataWithCustomROI.py
- processFigures.py
- processVelocity.py
The output is piped to the PostProcessing
folder. The ellipse fit(yellow) is shown below along with the inliers (green) and outliers (red).
The restored image is shown below.