Expand description
EFD Rust Library
Elliptical Fourier Descriptor (EFD) implementation in Rust. This crate implements 1D/2D/3D EFD and its related functions.
Keyword Alias:
- Elliptical Fourier Analysis (EFA)
- Elliptical Fourier Function (EFF)
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);Example Images
2D and 3D closed curve:
2D and 3D open curve:
Posed EFD combined a curve with a pose (unit vectors) to describe the orientation of each point.
2D open curve and its full reconstruction:
Citations
Original
- Kuhl, FP and Giardina, CR (1982). Elliptic Fourier features of a closed contour. Computer graphics and image processing, 18(3), 236-258. https://doi.org/10.1016/0146-664X(82)90034-X
My Applications
- Chang, Y., Chang, JL., Lee, JJ. (2024). Atlas-Based Path Synthesis of Planar Four-Bar Linkages Using Elliptical Fourier Descriptors. In: Okada, M. (eds) Advances in Mechanism and Machine Science. IFToMM WC 2023. Mechanisms and Machine Science, vol 149. Springer, Cham. https://doi.org/10.1007/978-3-031-45709-8_20
Features
This crate supports no-std solution. Disable the “std” feature will enable it.
default-features = false
Re-exports
pub extern crate nalgebra as na;
Modules
- Utility functions for the library.
Structs
- Elliptical Fourier Descriptor coefficients. Provide transformation between discrete points and coefficients.
- Geometric variables.
- A shape with a pose described by EFD.
Enums
- EFD dimension marker.
Traits
- Copy-on-write curve type.
- Be able to calculate the distance between two instances.
- Trait for the dimension
U<D>of EFD. - Rotation hint for
GeoVar.
Functions
- Get the theta value of each point coordinate of the curve.
Type Aliases
- Coefficients type.
- 1D Coefficients type.
- 2D Coefficients type.
- 3D Coefficients type.
- Coordinate type of the dimension
D. - A 1D shape described by EFD.
- A 2D shape described by EFD.
- A 3D shape described by EFD.
- 1D geometric type.
- 2D geometric type.
- 3D geometric type.
- An owned matrix of specific coefficients. (Dx2)
- A 1D shape with a pose described by EFD.
- A 2D shape with a pose described by EFD.
- A 3D shape with a pose described by EFD.
- Rotation type of the EFD.