Version: | 1.1 |
Title: | Fourier Transform Textural Ordination |
Description: | A tool to use a principal component analysis on radially averaged two dimensional Fourier spectra to characterize image texture. The method within the context of ecology was first described by Couteron et al. (2005) <doi:10.1111/j.1365-2664.2005.01097.x> and expanded upon by Solorzano et al. (2018) <doi:10.1117/1.JRS.12.036006> using a moving window approach. |
URL: | https://github.com/bluegreen-labs/foto |
BugReports: | https://github.com/bluegreen-labs/foto/issues |
Depends: | R (≥ 3.4) |
Imports: | terra, stats, parallel, grDevices |
Suggests: | knitr, rmarkdown, covr, testthat |
License: | AGPL-3 |
ByteCompile: | true |
RoxygenNote: | 7.2.1 |
VignetteBuilder: | knitr |
NeedsCompilation: | no |
Packaged: | 2023-10-03 18:02:05 UTC; khufkens |
Author: | Koen Hufkens |
Maintainer: | Koen Hufkens <koen.hufkens@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2023-10-03 21:50:08 UTC |
Calculates FOTO classification of texture
Description
Note that the input matrix should be square or results will be discarded
Usage
foto(
x,
window_size = 61,
method = "zones",
norm_spec = FALSE,
high_pass = TRUE,
pca = TRUE,
plot = FALSE
)
Arguments
x |
an image file, or single or multi-layer SpatRaster (RGB or otherwise), multi-layer data are averaged to a single layer |
window_size |
a moving window size in pixels (default = 61 pixels) |
method |
zones (for discrete zones) or mw for a moving window approach |
norm_spec |
normalize radial spectrum,
bolean |
high_pass |
apply high pass filter to radial spectra,
bolean |
pca |
execute PCA, |
plot |
plot output, bolean |
Value
returns a radial spectrum for a moving window across a raster layer
See Also
Examples
## Not run:
# load demo data
r <- terra::rast(system.file("extdata",
"yangambi.png",
package = "foto",
mustWork = TRUE
))
# classify pixels using zones (discrete steps)
output <- foto(r,
plot = FALSE,
window_size = 25,
method = "zones"
)
# print data structure
print(names(output))
## End(Not run)
Calculates FOTO classification of texture for an image batch
Description
This routine process images as a batch, normalizing the PCA analysis across images. This global normalization makes it possible to compare the resulting PCA scores across images and infer trends over different remote sensing tiles or across time.
Usage
foto_batch(path, window_size = 61, method = "zones", cores = 1)
Arguments
path |
directory containing (only) image files to process |
window_size |
a moving window size in pixels (default = 61 pixels) |
method |
zones (for discrete zones) or mw for a moving window approach |
cores |
number of cores to use in parallel calculations |
Value
returns a radial spectrum for a moving window across a raster layer
See Also
Examples
## Not run:
# load demo data path
path <- system.file("extdata", package = "foto")
# classify pixels using zones (discrete steps)
output <- foto_batch(
path = path,
window_size = 25,
method = "zones"
)
## End(Not run)
Normalize a matrix or vector
Description
Normalize values between 0 and 1, internal function only.
Usage
normalize(x)
Arguments
x |
a matrix or vector |
Value
returns a normalized matrix or vector
Calculates a radial spectrum
Description
This is an internal function and not to be used stand-alone.
Usage
rspectrum(x, w, n = TRUE, h = TRUE, env, ...)
Arguments
x |
a square matrix |
w |
a moving window size |
n |
normalize, bolean |
h |
high pass filter on the two first spectra values
set to 0, limits the influence of low frequency components
bolean |
env |
local environment to evaluate |
... |
additional parameters to forward |
Value
Returns a radial spectrum values for the image used in order to classify texture using a PCA (or other) analysis.