efd 0.9.0

Elliptical Fourier Descriptor (EFD) implementation in Rust.
Documentation

efd

dependency status

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

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}
}

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);