pub struct ImageArray<T: Gradient + Average + VectorLen + Norm> { /* private fields */ }
Expand description
An array representing an image, used with the solvers.
The From trait is implemented for the types GrayImage and RgbImage in the
image
crate.
Implementations§
Source§impl ImageArray<Array3<f64>>
impl ImageArray<Array3<f64>>
Source§impl ImageArray<Array3<f64>>
impl ImageArray<Array3<f64>>
Sourcepub fn denoise(
&self,
lambda: f64,
tau: f64,
sigma: f64,
gamma: f64,
max_iter: u32,
convergence_threshold: f64,
) -> Result<Self, ShapeError>
pub fn denoise( &self, lambda: f64, tau: f64, sigma: f64, gamma: f64, max_iter: u32, convergence_threshold: f64, ) -> Result<Self, ShapeError>
Image denoising algorithm for 2 dimentional shapes with 1 dimention of information (pixels) as an arbitrarily sized vector. Assumes axes 0 and 1 and the x and y coordinates of the image, and axis 2 is the pixel vector coordinate of the image.
§inputs
lambda
is the target value of the dual objective function,
i.e. how close you want the output to be to the input:
approaching 0, the output should be completely smooth (flat),
approaching “infinifty”, the output should be the same as
the original input.
tau
and sigma
affect how fast the algorithm converges,
according to Chambolle, A. and Pock, T. (2011) these should
be chosen such that tau * lambda * L2 norm^2 <= 1
where
L2 norm^2 <= 8
.
gamma
updates the algorithm’s internal variables,
for the accelerated algorithm of Chambolle, A. and Pock, T. (2011)
the chosen value is 0.35 * lambda
.
max_iter
and convergence_threshold
bound the runtime of the
algorithm, i.e. it runs until convergence_threshold < norm(current - previous) / norm(previous)
or max_iter
is hit.
Trait Implementations§
Source§impl<T: Clone + Gradient + Average + VectorLen + Norm> Clone for ImageArray<T>
impl<T: Clone + Gradient + Average + VectorLen + Norm> Clone for ImageArray<T>
Source§fn clone(&self) -> ImageArray<T>
fn clone(&self) -> ImageArray<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<T: Debug + Gradient + Average + VectorLen + Norm> Debug for ImageArray<T>
impl<T: Debug + Gradient + Average + VectorLen + Norm> Debug for ImageArray<T>
Source§impl<T: Gradient + Average + VectorLen + Norm> Deref for ImageArray<T>
impl<T: Gradient + Average + VectorLen + Norm> Deref for ImageArray<T>
Source§impl<T: Copy + Into<f64>, D: Dimension + RemoveAxis> From<&ArrayBase<OwnedRepr<T>, D>> for ImageArray<Array<f64, D>>
impl<T: Copy + Into<f64>, D: Dimension + RemoveAxis> From<&ArrayBase<OwnedRepr<T>, D>> for ImageArray<Array<f64, D>>
Auto Trait Implementations§
impl<T> Freeze for ImageArray<T>where
T: Freeze,
impl<T> RefUnwindSafe for ImageArray<T>where
T: RefUnwindSafe,
impl<T> Send for ImageArray<T>where
T: Send,
impl<T> Sync for ImageArray<T>where
T: Sync,
impl<T> Unpin for ImageArray<T>where
T: Unpin,
impl<T> UnwindSafe for ImageArray<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more