Crate efd

source ·
Expand description

EFD Rust Library

dependency status documentation

Elliptical Fourier Descriptor (EFD) implementation in Rust. This crate implements 2D/3D EFD and its related functions.

Keyword Alias:

  • Elliptical Fourier Analysis (EFA)
  • Elliptical Fourier Function (EFF)

Reference: Kuhl, FP and Giardina, CR (1982). Elliptic Fourier features of a closed contour. Computer graphics and image processing, 18(3), 236-258.

This is an unofficial implementation.

@article{kuhl1982elliptic,
  title={Elliptic Fourier features of a closed contour},
  author={Kuhl, Frank P and Giardina, Charles R},
  journal={Computer graphics and image processing},
  volume={18},
  number={3},
  pages={236--258},
  year={1982},
  publisher={Elsevier}
}

Example of re-describing a new closed curve:

let curve = vec![
    [0., 0.],
    [1., 1.],
    [2., 2.],
    [3., 3.],
    [2., 2.],
    [1., 1.],
];
assert!(efd::valid_curve(&curve).is_some());
let described_curve = efd::Efd2::from_curve(curve, false).generate(20);

Features

This crate support no-std solution via using “libm”, a crate provide pure-rust math functions. Disable the “std” feature will automatic enable it.

Re-exports

Structs

  • Elliptical Fourier Descriptor coefficients. Provide transformation between discrete points and coefficients.
  • Transform type.

Enums

  • 2D EFD dimension marker.
  • 3D EFD dimension marker.

Traits

Functions

Type Definitions

  • Alias for the coefficient number. (DIM * 2)
  • A matrix view of specific coefficients. (DIM * 2)
  • A mutable matrix view of specific coefficients. (DIM * 2)
  • Coefficient type.
  • 2D Coefficient type.
  • 3D Coefficient type.
  • Alias for evaluate EfdDim::Trans::Coord from D.
  • Coordinate view used in the conversion method.
  • Alias for the dimension.
  • 2D EFD coefficients type.
  • 3D EFD coefficients type.
  • 2D transformation inner type.
  • 3D transformation inner type.
  • 2D transformation type.
  • 3D transformation type.