Fourier Transform Textural Ordination


License
MIT
Install
pip install fototex==1.5.9

Documentation

Fourier Transform Textural Ordination in Python

Freely adapted from https://github.com/CaussesCevennes/FOTO.py

Description

FOTO (Fourier Textural Ordination) is an algorithm allowing texture characterization and comparison, and is fully described in Textural ordination based on Fourier spectral decomposition: a method to analyze and compare landscape patterns (Pierre Couteron, Nicolas Barbier and Denis Gautier, 2006)

Installation

Use PIP in a terminal to install fototex:

$ pip install fototex

Usage

In memory against HDF5

  • Regarding computation performances, in case you have a strong machine with extended memory, or if you have small images to treat, you can implement the algorithm "in memory":
from fototex.foto import Foto

foto = Foto("path/to/your/image", method='block', band=1, in_memory=True)
foto.run(window_size=11)
  • Otherwise, in case of large images or a limited machine, it is possible to implement the algorithm with HDF5 data storage. In that case, Foto runs an incremental PCA, that you may customize, assisted with HDF5 storage:
from fototex.foto import Foto

foto = Foto("path/to/your/image", method="moving_window", in_memory=False, data_chunk_size=40000)
foto.run(window_size=11)

The argument data_chunk_size gives information on the reading/writing rate to h5 files.

DC component

When computing the R-spectra, you may keep the DC component of the FFT, such as:

from fototex.foto import Foto
foto = Foto("path/to/your/image", method="moving_window", in_memory=False, data_chunk_size=40000)
foto.run(window_size=11, nb_sample=5, keep_dc_component=True)

In that case, it is important to keep in mind that R will range from 0 to nb_sample - 1 (in the example, R=0, 1, 2, 3, 4). Otherwise, it will range from 1 to nb_sample (here, R=1, 2, 3, 4, 5).

Standardize

If you want to standardize the values of the power spectrum over the image (dividing by the variance of each given window), you may add the option (False by default):

from fototex.foto import Foto
foto = Foto("path/to/your/image", method="moving_window", in_memory=False, data_chunk_size=40000)
foto.run(window_size=11, standardize=True)