Crates.io | efd |
lib.rs | efd |
version | 10.1.3 |
source | src |
created_at | 2021-04-16 10:15:00.752679 |
updated_at | 2024-05-26 07:42:49.90112 |
description | 1D/2D/3D Elliptical Fourier Descriptor (EFD) implementation in Rust. |
homepage | |
repository | https://github.com/KmolYuan/efd-rs |
max_upload_size | |
id | 385261 |
size | 211,399 |
Elliptical Fourier Descriptor (EFD) implementation in Rust. This crate implements 1D/2D/3D EFD and its related functions.
This implementation is totally safe and supports no-std + alloc
environment.
Keyword Alias:
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).recon(20);
The harmonic number can be set with efd::Efd::from_curve_harmonic()
method. The following figures show the reconstruction of a 2D closed curve with 1-8 harmonics.
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: