Created
March 26, 2019 21:14
-
-
Save xd009642/11125e09051799a1b19dac23415f3fdb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub struct HoughParameters<T, D, F> | |
where | |
D: Dimension, | |
F: Sized + (Fn(f64) -> Array1<T>), | |
{ | |
/// Represents the dimensionality of the hough space | |
pub dim: PhantomData<D>, | |
/// Parameter bounds | |
pub bounds: Array2<T>, | |
/// Search resolution for each parameter. Should be the same size as bounds. | |
pub resolution: Option<Array1<T>>, | |
/// Function that taking an angle returns the n-dimensioned point in Hough | |
/// Space that the entry would belong to. Output should be same dimensions | |
/// as bounds. | |
pub get_params: F, | |
} | |
/// Trait for a general Hough Transform. | |
pub trait GeneralisedHoughTransformExt<T, D, F> | |
where | |
D: Dimension, | |
F: Sized + (Fn(f64) -> Array1<T>), | |
{ | |
/// Given the `HoughParameters` return the accumulated view of the Hough Space | |
fn hough<S>(&self, d_theta: f64, params: HoughParameters<T, D, F>) -> ArrayBase<S, D> | |
where | |
S: Data<Elem = usize>; | |
} | |
impl<T, D, F, S> GeneralisedHoughTransformExt<T, D, F> for Array2<S> | |
where | |
D: Dimension, | |
S: Data<Elem = bool>, | |
F: Sized + (Fn(f64) -> Array1<T>), | |
{ | |
fn hough<U>(&self, d_theta: f64, params: HoughParameters<T, D, F>) -> ArrayBase<U, D> | |
where | |
U: Data<Elem = usize> | |
{ | |
unimplemented!(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment