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)

This is an unofficial implementation.

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::util::valid_curve(&curve).is_some());
let described_curve = efd::Efd2::from_curve(curve, false).generate(20);

Bibliography

Kuhl, FP and Giardina, CR (1982). Elliptic Fourier features of a closed contour. Computer graphics and image processing, 18(3), 236-258.
@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 Images

2D and 3D closed curve:

2d 3d

2D and 3D open curve:

2d 3d

Features

This crate supports no-std solution. Disable the “std” feature will enable it.

default-features = false

An extra curve_diff features provides some functions to calculate the difference between two curves. Requires the interp crate.

features = ["curve_diff"]

Re-exports

  • pub extern crate nalgebra as na;
  • pub use crate::curve::*;
  • pub use crate::dim::*;
  • pub use crate::geo::*;

Modules

  • Curve trait and its implementations.
  • Dimension specific implementation.
  • Geometric types, the geometric invariant.
  • Utility functions for the library.

Structs

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

Traits

  • Be able to calculate the distance between two instances.

Type Aliases

  • 2D EFD coefficients type.
  • 3D EFD coefficients type.