Crate efd[][src]

Expand description

This crate implements Elliptical Fourier Descriptor (EFD) and its related functions.

Simple usage of resampling circle:

use efd::Efd;
use ndarray::{stack, Array1, Axis};
use std::f64::consts::TAU;

const N: usize = 10;
let circle = stack![
    Axis(1),
    Array1::linspace(0., TAU, N).mapv(f64::cos),
    Array1::linspace(0., TAU, N).mapv(f64::sin)
];
let curve = circle
    .axis_iter(Axis(0))
    .map(|c| [c[0], c[1]])
    .collect::<Vec<_>>();
let new_curve = Efd::from_curve(&curve, None).generate(20);

Structs

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

Geometric information.

Functions

Compute the total Fourier power and find the minimum number of harmonics required to exceed the threshold fraction of the total power.