Zernike moments: Digital images
Project description
Zernike moments: Digital images
The Zernike moment's package program is developed for square digital images mimicking some part of Matlab code provided by Christian Wolf. Zernike moments are unique due to orthogonality and a complete set of Zernike polynomials. Zernike moments are used in image analysis to characterize the shape and structure of objects. The following articles and their references give a detailed description of the Zernike polynomials and Zernike moments.
Description
The code includes the following functions:
zernike_order_list: Generates a list of Zernike polynomial orders.
robust_fact_quot: Calculates the robust factor quotient between two lists of values.
zernike_bf: Generates Zernike basis functions for a given size and order.
zernike_mom: Calculates the Zernike moments of an input image using precomputed Zernike basis functions.
zernike_rec: Reconstructs an image from Zernike moments(Inverse trasformation).
Installation
Install the ZEMO library using pip:
pip install ZEMO
Usage
- The standard way to import ZEMO library:
import ZEMO
from ZEMO import zemo
- Generates Zernike basis functions for a given
size
,order
, and optionalwithneg
parameter for a square images of size SZ. If withneg is 1, then the basis functions with negative repetition are included.
ZBFSTR = zemo.zernike_bf(SZ,order,withneg)
- Calculates Zernike moments of an input image (images) using precomputed Zernike basis functions. I is the input image.
Z = zemo.zernike_mom(I,ZBFSTR)
- Reconstructs an image from Zernike moments using precomputed Zernike basis functions.
I = zemo.zernike_rec(Z,SZ,ZBFSTR)
Here is an example of face (Hossein Safari) image:
from ZEMO import dataset
dataset.Face_Data()
Due to the slightly large size of the "dataset", the command "dataset.Face_Data()" will take a few moments.
You can see some examples of the ZEMO code in https://github.com/hmddev1/ZEMO
How to Cite
Raboonik, A., Safari, H., Alipour, N., & Wheatland, M. S. 2017, ApJ, 834, 11
Alipour, N., Mohammadi, F., Safari, H. 2019, ApJS, 243, 20
Authors
Hossein Safari (https://orcid.org/0000-0003-2326-3201), Nasibe Alipour (https://orcid.org/0000-0003-3643-5121), Hamed Ghaderi (https://orcid.org/0009-0005-7934-2752), Pardis Garavand
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.