tfourier: Tangent angle Fourier transform

View source: R/core-out-tfourier.R

tfourierR Documentation

Tangent angle Fourier transform

Description

tfourier computes tangent angle Fourier analysis from a matrix or a list of coordinates.

Usage

tfourier(x, ...)

## Default S3 method:
tfourier(x, nb.h, smooth.it = 0, norm = FALSE, ...)

## S3 method for class 'Out'
tfourier(x, nb.h = 40, smooth.it = 0, norm = TRUE, ...)

## S3 method for class 'list'
tfourier(x, ...)

Arguments

x

A list or matrix of coordinates or an Out

...

useless here

nb.h

integer. The number of harmonics to use. If missing, 12 is used on shapes; 99 percent of harmonic power on Out objects, both with messages.

smooth.it

integer. The number of smoothing iterations to perform

norm

logical. Whether to scale and register new coordinates so that the first point used is sent on the origin.

Value

A list with the following components:

  • ao ao harmonic coefficient

  • an vector of a_{1->n} harmonic coefficients

  • bn vector of b_{1->n} harmonic coefficients

  • phi vector of variation of the tangent angle

  • t vector of distance along the perimeter expressed in radians

  • perimeter numeric. The perimeter of the outline

  • thetao numeric. The first tangent angle

  • x1 The x-coordinate of the first point

  • y1 The y-coordinate of the first point.

Note

Silent message and progress bars (if any) with options("verbose"=FALSE).

Directly borrowed for Claude (2008), and called fourier2 there.

References

Zahn CT, Roskies RZ. 1972. Fourier Descriptors for Plane Closed Curves. IEEE Transactions on Computers C-21: 269-281.

Claude, J. (2008) Morphometrics with R, Use R! series, Springer 316 pp.

See Also

Other tfourier: tfourier_i(), tfourier_shape()

Examples

coo <- bot[1]
coo_plot(coo)
tf  <- tfourier(coo, 12)
tf
tfi <- tfourier_i(tf)
coo_draw(tfi, border='red', col=NA) # the outline is not closed...
coo_draw(tfourier_i(tf, force2close=TRUE), border='blue', col=NA) # we force it to close.

vbonhomme/Momocs documentation built on Nov. 13, 2023, 8:54 p.m.